dsp-semactic 0.5.57 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),El=require("vue-i18n"),Hl=["data-chart-type"],Al={class:"dss-chart-header-titles"},Ll={key:0,class:"dss-chart-title"},$l={key:1,class:"dss-chart-subtitle"},Dl=["onClick","onMouseenter"],Il={class:"dss-legend-text"},_l=["onClick","onMouseenter"],Rl={class:"dss-legend-text"},Fl=["title"],zl=["src"],Pl={class:"dss-chart-area-wrapper"},Ol={key:0,class:"dss-chart-z-axis-label"},Zl=["width","height","data-smooth","data-animated"],Wl={id:"chart-clip"},Ul=["x","y","width","height"],ql=["id"],Xl=["d"],Yl=["id"],jl=["d"],Kl={key:0},Gl={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},Jl=["x1","x2","y1","y2"],Ql={class:"dss-axes"},ea=["x1","x2","y1","y2"],ta=["x1","x2","y1","y2"],oa={class:"dss-axis-labels"},na=["x","y"],la=["x","y"],aa=["x","y"],sa=["y","transform"],ra={key:1,class:"dss-flag-markers"},ia={"clip-path":"url(#chart-clip)"},ca=["x1","x2","y1","y2","onMouseover"],ua=["x1","x2","y1","y2","onMouseover"],da=["x1","x2","y1","y2","onMouseover"],ma=["cx","cy","onMouseover"],pa=["cx","cy","fill","onMouseover"],fa=["x","y"],va={class:"dss-chart-data","clip-path":"url(#chart-clip)"},ha={key:0},ga=["d","onMouseover"],ya=["x","y","width","height","fill","onMouseover"],Ca={class:"dss-line-chart"},ka=["d","stroke","stroke-width"],xa=["d","stroke","stroke-width","opacity"],wa=["cx","cy","r","fill","onMouseover"],ba={key:1},Ea=["d","stroke","stroke-width"],Va=["d","stroke","stroke-width"],Sa=["d","stroke","stroke-width","opacity"],Na=["cx","cy","r","fill","onMouseover"],Ma={key:2},Ba=["id"],Ta=["x","y","width","height"],Ha=["d","fill","fill-opacity","mask"],Aa=["d","stroke","stroke-width"],La=["d","fill","onMouseover"],$a=["x","y","width","height","onMouseover"],Da={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},Ia=["x1","x2","y1","y2","stroke"],_a=["cx","cy","r","fill"],Ra={key:1,class:"dss-bubble-chart"},Fa={key:0,class:"dss-bubble-group"},za=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Pa=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Oa={key:2,class:"radial-chart"},Za=["cx","cy","r"],Wa=["data-chart-type","clip-path"],Ua=["d","fill","fill-opacity","stroke","stroke-width","onMouseover"],qa={key:1,class:"dss-radial-segment-data-labels"},Xa=["x","y"],Ya=["x1","y1","x2","y2","stroke"],ja=["x1","y1","x2","y2","stroke"],Ka=["x","y","text-anchor","font-size"],Ga={key:3,class:"dss-spider-chart"},Ja={key:0,class:"dss-spider-grid"},Qa=["cx","cy","r"],es={class:"dss-spider-grid-labels"},ts=["x","y"],os=["x","y"],ns=["x1","x2","y1","y2"],ls={class:"dss-spider-labels"},as=["x","y","text-anchor","dominant-baseline"],ss=["points","fill","fill-opacity","stroke","stroke-width"],rs=["cx","cy","r","fill","onMouseover"],is={class:"dss-chart-logos"},cs=["cx","cy","r","fill"],us=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],ds=["onClick","onMouseenter"],ms=["src"],ps={class:"dss-marker-tooltip-category"},fs={key:0,class:"dss-marker-tooltip-description"},vs={key:0,class:"dss-tooltip-section"},hs={key:0,class:"dss-tooltip-title"},gs={class:"dss-tooltip-series-name"},ys={class:"dss-tooltip-series-value"},Cs={key:1,class:"dss-tooltip-section"},ks={key:0,class:"dss-tooltip-title"},xs={class:"dss-bubble-tooltip-data"},ws={key:2,class:"dss-tooltip-section"},bs={class:"dss-tooltip-title"},Es={class:"dss-tooltip-value"},Vs={key:0,class:"dss-tooltip-section"},Ss={class:"dss-tooltip-section-title"},Ns={class:"dss-tooltip-group-header"},Ms={class:"dss-tooltip-item-content"},Bs={class:"dss-tooltip-item-text"},Ts={key:1,class:"dss-tooltip-section"},Hs={class:"dss-tooltip-section-title"},As={class:"dss-tooltip-item-content"},Ls={class:"dss-tooltip-item-title"},$s={key:0,class:"dss-tooltip-item-description"},Ds={class:"dss-tooltip-section"},Is={class:"dss-tooltip-title"},_s={key:0,class:"dss-bubble-tooltip-data"},Rs={class:"dss-tooltip-series-name"},Fs={class:"dss-tooltip-series-value"},zs={key:0,class:"dss-tooltip-section"},Ps={class:"dss-tooltip-section-title"},Os={class:"dss-tooltip-group-header"},Zs={class:"dss-tooltip-item-content"},Ws={class:"dss-tooltip-item-text"},Us={key:1,class:"dss-tooltip-section"},qs={class:"dss-tooltip-section-title"},Xs={class:"dss-tooltip-item-content"},Ys={class:"dss-tooltip-item-title"},js={key:0,class:"dss-tooltip-item-description"},Ks={key:1,class:"dss-context-menu-separator"},Gs={key:0,class:"dss-context-menu-separator"},Js={key:0,class:"dss-context-menu-separator"},Qs=["onClick"],er=["innerHTML"],tr={key:0,class:"dss-context-menu-icon"},or={class:"dss-marker-modal-header"},nr={class:"dss-marker-modal-body"},lr={class:"dss-form-group"},ar={key:0},sr={key:1},rr=["disabled"],ir=["value"],cr={class:"dss-form-group"},ur={for:"dss-marker-description"},dr={key:0,class:"dss-form-text-display"},mr=["placeholder"],pr={class:"dss-form-group"},fr={class:"icon-preview"},vr=["src"],hr={class:"dss-marker-modal-footer"},gr={class:"modal-footer-left"},yr={class:"dss-modal-footer-right"},Cr=["disabled"],kr={name:"DSSChart"},xr=Object.assign(kr,{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:z=>typeof z=="object"&&z!==null}},emits:["add-marker","update-marker","delete-marker"],setup(z,{emit:vo}){const{t:J,locale:H}=El.useI18n(),zt=vo,S=e.ref(null),ie=e.ref(null),bo=e.ref(null),Uo=e.ref(0),g=e.ref(0);let Re=null;const ct=20,et=e.computed(()=>{if(!S.value||!ie.value)return 0;try{const t=S.value.getBoundingClientRect();return ie.value.getBoundingClientRect().top-t.top}catch{return 0}}),D=z,le={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}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:"25%",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:!0,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},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function ke(t,r){const n=Object.assign({},t);return yt(t)&&yt(r)&&Object.keys(r).forEach(c=>{yt(r[c])?c in t?n[c]=ke(t[c],r[c]):Object.assign(n,{[c]:r[c]}):Object.assign(n,{[c]:r[c]})}),n}const gt=()=>{let t=20,r=0,n=0;if(j.value&&(t+=30),xe.value&&(t+=25),Ce.value&&D.series.length>0){const c=D.series.filter((v,f)=>!Ee.value.has(f)).length;if(Ae.value==="top"||Ae.value==="bottom"){if(Lt.value==="horizontal"){const f=Math.floor(Ze.value/100);r=Math.ceil(c/f)*25+10}else r=c*25+10;t+=r}else n=150}return{height:t,legendHeight:r,legendWidth:n}};function yt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const $=e.computed(()=>ke(le,D.options)),Ye=e.computed(()=>{const t=$.value;return t&&t.chart&&t.chart.width==="auto"}),Ht=e.computed(()=>{const t=$.value;return t&&t.chart&&t.chart.height==="auto"}),Ze=e.computed(()=>{const t=$.value;return Ye.value?Uo.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),He=e.ref(ct),je=e.computed(()=>{const t=$.value;return Ht.value?Math.max(0,(g.value||400)-He.value):t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),ae=e.computed(()=>{const t=$.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Eo=e.computed(()=>{const t=D.series.map(r=>r.type||ae.value);return new Set(t).size>1}),j=e.computed(()=>{const t=$.value;return t&&t.title&&t.title.text?t.title.text:""}),xe=e.computed(()=>{const t=$.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),rn=e.computed(()=>{const t=$.value;if(!t||!t.zAxis)return"";const r=t.zAxis;return typeof r=="string"?r:r&&typeof r.label=="string"?r.label:""}),Ao=e.computed(()=>{const t=$.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),At=e.computed(()=>{const t=$.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),lo=e.computed(()=>{const t=$.value;if(!t||!t.yAxis)return oo;const r=t.yAxis.min;return typeof r=="number"||r===oo?r:oo}),Ct=e.computed(()=>{const t=$.value;if(!t||!t.yAxis)return oo;const r=t.yAxis.max;return typeof r=="number"||r===oo?r:oo}),Lo=e.computed(()=>{const t=$.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),kt=e.computed(()=>{const t=$.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Je=e.computed(()=>{const t=$.value;return t&&t.grid&&t.grid.show!==!1}),Ce=e.computed(()=>{const t=$.value;return t&&t.legend&&t.legend.show!==!1}),Ae=e.computed(()=>{const t=$.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Lt=e.computed(()=>{const t=$.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Vo=e.computed(()=>{const t=$.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),ue=e.computed(()=>{const t=$.value;if(!t||!t.crosshair)return!1;const r=t.crosshair.show;return r===!0||r==="true"}),$o=e.computed(()=>{const t=$.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Pt=e.computed(()=>{const t=$.value;return t&&t.zoom&&t.zoom.enabled!==!1}),So=e.computed(()=>{const t=$.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Bn=e.computed(()=>{const t=$.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),We=e.computed(()=>{const t=$.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),nt=e.computed(()=>{if(!vt.value)return 0;const t=$.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Ke=e.computed(()=>{const t=$.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),rt=e.computed(()=>{const{maxX:t}=he.value;return t===0}),ut=(t,r)=>rt.value&&r===0?5:r,xt=e.computed(()=>{const t=$.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),lt=e.computed(()=>{const t=$.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),te=e.computed(()=>{const t=$.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),ve=e.computed(()=>{const t=$.value;return lt.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),$t=e.computed(()=>{const t=$.value,r=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return r.length>0?r:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),tt=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.enabled!==!1}),wt=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),dt=e.computed(()=>{const t=$.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),mt=e.computed(()=>{const t=$.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),pt=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),se=e.computed(()=>{const t=$.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Ne=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Ot=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),ho=e.computed(()=>{const t=$.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),bt=e.computed(()=>$.value?.spider?.gridSteps||5),Et=e.computed(()=>{const t=[],r=bt.value;for(let n=1;n<=r;n++)t.push(ce.value/r*n);return t}),Zt=t=>{const r=ao.value;if(r&&Array.isArray(r)&&r[t]!==void 0)return r[t].toString();const n=Et.value[t];return Math.round(n/ce.value*100)+"%"},ao=e.computed(()=>$.value?.spider?.gridLabels||null),Fe=e.computed(()=>{const t=$.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ue=e.computed(()=>{const t=$.value,r={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...r,...t.contextMenu.items}:r}),Wt=e.computed(()=>{const t=$.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Dt=e.computed(()=>{const t=$.value;return t&&t.markers&&t.markers.icon?t.markers.icon:qo.value}),It=e.computed(()=>{const t=$.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Ut=e.computed(()=>{const t=$.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Do=e.computed(()=>!A.value.isZooming);e.computed(()=>Me.value.map(t=>{if(t.categoryIndex!==void 0&&(De.value||Be.value)){const r=ge(t.categoryIndex),n=et.value+E.value.bottom-Ut.value/2;return{...t,x:r,y:n}}return t}));function Tn(t,r){const n=new Date(t);let c=0,v=1/0;return r.forEach((f,C)=>{const[y,b,V]=f.split("-"),N=new Date(`20${V}`,b-1,y),M=Math.abs(N-n);M<v&&(v=M,c=C)}),c}const al=e.computed(()=>{const t=D.markers.map(n=>{const c=Tn(n.marker_date,D.categories),v=ge(c),f=et.value+E.value.bottom-Ut.value/2;return{...n,x:v,y:f,categoryIndex:c,source:"props"}}),r=Me.value.map(n=>{if(n.categoryIndex!==void 0&&(De.value||Be.value)){const c=ge(n.categoryIndex),v=et.value+E.value.bottom-Ut.value/2;return{...n,x:c,y:v,source:"internal"}}return{...n,source:"internal"}});return[...t,...r]}),Vt=e.computed(()=>{const t=$.value;return t&&t.watermark&&t.watermark.enabled===!0}),cn=e.computed(()=>{const t=$.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),sl=e.computed(()=>{const t=$.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:"25%"}),un=e.computed(()=>{const t=$.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),dn=e.computed(()=>{const t={left:E.value.left,top:E.value.top,width:E.value.width,height:E.value.height};let r,n;const c=String(sl.value);if(c.includes("%")){const v=parseFloat(c)/100;r=t.width*v,n=r*(96/499)}else{const v=parseFloat(c)||25;r=Math.min(t.width*.25,200)*(v/25),n=r*(96/499)}return{width:r,height:n,area:t}}),Hn=e.computed(()=>{const{width:t,height:r}=dn.value,n=un.value;let c,v;const f=E.value.left,C=E.value.right,y=E.value.top,b=E.value.bottom,V=E.value.width,N=E.value.height;switch(n){case"center":c=f+(V-t)/2,v=y+(N-r)/2;break;case"top-left":c=f+15,v=y+90;break;case"top-right":c=C-t-15,v=y+90;break;case"bottom-left":c=f+15,v=b-r+75;break;case"bottom-right":default:c=C-t-15,v=b-r+75;break}return{backgroundPositionX:c+"px",backgroundPositionY:v+"px",backgroundSize:`${t}px ${r}px`}}),An=t=>!D.flags||!D.flags.length?[]:D.flags.filter(r=>r.categoryIndex===t),St=t=>{const r=An(t),n=Go(t),c=r.filter(C=>C.manual),v=r.filter(C=>!C.manual),f=[];return c.length>0&&f.push({type:J("chart.tooltip.manualFlags"),color:"#047395",flags:c.map(C=>({text:C.text,color:"#047395"}))}),v.length>0&&f.push({type:J("chart.tooltip.autoFlags"),color:"#0dbf89",flags:v.map(C=>({text:C.text,color:"#0dbf89"}))}),{flagGroups:f,markers:n.map(C=>({title:C.title,description:C.description,type:J("chart.tooltip.markers"),color:C.color||"#FF6B6B"}))}},qo=e.computed(()=>`data:image/svg+xml;base64,${btoa(`<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"),Wl=require("vue-i18n"),_o=["data-chart-type"],Ao={class:"dss-chart-header-titles"},Do={key:0,class:"dss-chart-title"},Ro={key:1,class:"dss-chart-subtitle"},Io=["onClick","onMouseenter"],Fo={class:"dss-legend-text"},zo=["onClick","onMouseenter"],Po={class:"dss-legend-text"},Oo=["title"],Zo=["src"],Wo={class:"dss-chart-area-wrapper"},qo={key:0,class:"dss-chart-z-axis-label"},Uo=["width","height","data-smooth","data-animated"],Xo={id:"chart-clip"},Yo=["x","y","width","height"],jo=["id"],Ko=["d"],Go=["id"],Qo=["d"],Jo={key:0},ea={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},ta=["x1","x2","y1","y2"],na={class:"dss-axes"},la=["x1","x2","y1","y2"],oa=["x1","x2","y1","y2"],aa={class:"dss-axis-labels"},sa=["x","y"],ra=["x","y"],ia=["x","y"],ca=["y","transform"],da={key:1,class:"dss-flag-markers"},ua={"clip-path":"url(#chart-clip)"},ma=["x1","x2","y1","y2","onMouseover"],pa=["x1","x2","y1","y2","onMouseover"],va=["x1","x2","y1","y2","onMouseover"],fa=["cx","cy","onMouseover"],ga=["cx","cy","fill","onMouseover"],ha=["x","y"],ya={class:"dss-chart-data","clip-path":"url(#chart-clip)"},ka={key:0},Ca=["d","onMouseover"],ba=["x","y","width","height","fill","onMouseover"],wa={class:"dss-line-chart"},xa=["d","stroke","stroke-width"],Ea=["d","stroke","stroke-width","opacity"],Va=["cx","cy","r","fill","onMouseover"],Na={key:1},Sa=["d","stroke","stroke-width"],Ma=["d","stroke","stroke-width"],Ba=["d","stroke","stroke-width","opacity"],Ta=["cx","cy","r","fill","onMouseover"],Ha={key:2},$a=["id"],La=["x","y","width","height"],_a=["d","fill","fill-opacity","mask"],Aa=["d","stroke","stroke-width"],Da=["d","fill","onMouseover"],Ra=["x","y","width","height","onMouseover"],Ia={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},Fa=["x1","x2","y1","y2","stroke"],za=["cx","cy","r","fill"],Pa={key:1,class:"dss-bubble-chart"},Oa={key:0,class:"dss-bubble-group"},Za=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Wa=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],qa={key:2,class:"radial-chart"},Ua=["cx","cy","r"],Xa=["data-chart-type","clip-path"],Ya=["d","fill","fill-opacity","stroke","stroke-width","onMouseover"],ja={key:1,class:"dss-radial-segment-data-labels"},Ka=["x","y"],Ga=["x1","y1","x2","y2","stroke"],Qa=["x1","y1","x2","y2","stroke"],Ja=["x","y","text-anchor","font-size"],es={key:3,class:"dss-spider-chart"},ts={key:0,class:"dss-spider-grid"},ns=["cx","cy","r"],ls={class:"dss-spider-grid-labels"},os=["x","y"],as=["x","y"],ss=["x1","x2","y1","y2"],rs={class:"dss-spider-labels"},is=["x","y","text-anchor","dominant-baseline"],cs=["points","fill","fill-opacity","stroke","stroke-width"],ds=["cx","cy","r","fill","onMouseover"],us={class:"dss-chart-logos"},ms=["cx","cy","r","fill"],ps=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],vs=["onClick","onMouseenter"],fs=["src"],gs={class:"dss-marker-tooltip-category"},hs={key:0,class:"dss-marker-tooltip-description"},ys={key:0,class:"dss-tooltip-section"},ks={key:0,class:"dss-tooltip-title"},Cs={class:"dss-tooltip-series-name"},bs={class:"dss-tooltip-series-value"},ws={key:1,class:"dss-tooltip-section"},xs={key:0,class:"dss-tooltip-title"},Es={class:"dss-bubble-tooltip-data"},Vs={key:2,class:"dss-tooltip-section"},Ns={class:"dss-tooltip-title"},Ss={class:"dss-tooltip-value"},Ms={key:0,class:"dss-tooltip-section"},Bs={class:"dss-tooltip-section-title"},Ts={class:"dss-tooltip-group-header"},Hs={class:"dss-tooltip-item-content"},$s={class:"dss-tooltip-item-text"},Ls={key:1,class:"dss-tooltip-section"},_s={class:"dss-tooltip-section-title"},As={class:"dss-tooltip-item-content"},Ds={class:"dss-tooltip-item-title"},Rs={key:0,class:"dss-tooltip-item-description"},Is={class:"dss-tooltip-section"},Fs={class:"dss-tooltip-title"},zs={key:0,class:"dss-bubble-tooltip-data"},Ps={class:"dss-tooltip-series-name"},Os={class:"dss-tooltip-series-value"},Zs={key:0,class:"dss-tooltip-section"},Ws={class:"dss-tooltip-section-title"},qs={class:"dss-tooltip-group-header"},Us={class:"dss-tooltip-item-content"},Xs={class:"dss-tooltip-item-text"},Ys={key:1,class:"dss-tooltip-section"},js={class:"dss-tooltip-section-title"},Ks={class:"dss-tooltip-item-content"},Gs={class:"dss-tooltip-item-title"},Qs={key:0,class:"dss-tooltip-item-description"},Js={key:1,class:"dss-context-menu-separator"},er={key:0,class:"dss-context-menu-separator"},tr={key:0,class:"dss-context-menu-separator"},nr=["onClick"],lr=["innerHTML"],or={key:0,class:"dss-context-menu-icon"},ar={class:"dss-marker-modal-header"},sr={class:"dss-marker-modal-body"},rr={class:"dss-form-group"},ir={key:0},cr={key:1},dr=["disabled"],ur=["value"],mr={class:"dss-form-group"},pr={for:"dss-marker-description"},vr={key:0,class:"dss-form-text-display"},fr=["placeholder"],gr={class:"dss-form-group"},hr={class:"icon-preview"},yr=["src"],kr={class:"dss-marker-modal-footer"},Cr={class:"modal-footer-left"},br={class:"dss-modal-footer-right"},wr=["disabled"],xr={name:"DSSChart"},Er=Object.assign(xr,{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:Z=>typeof Z=="object"&&Z!==null}},emits:["add-marker","update-marker","delete-marker"],setup(Z,{emit:Kt}){const{t:z,locale:R}=Wl.useI18n(),De=Kt,N=e.ref(null),ke=e.ref(null),Qe=e.ref(null),vt=e.ref(0),v=e.ref(0);let Ce=null;const _e=20,xe=e.computed(()=>{if(!N.value||!ke.value)return 0;try{const t=N.value.getBoundingClientRect();return ke.value.getBoundingClientRect().top-t.top}catch{return 0}}),I=Z,re={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}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:"25%",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:!0,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},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function be(t,r){const l=Object.assign({},t);return Gt(t)&&Gt(r)&&Object.keys(r).forEach(c=>{Gt(r[c])?c in t?l[c]=be(t[c],r[c]):Object.assign(l,{[c]:r[c]}):Object.assign(l,{[c]:r[c]})}),l}const Zt=()=>{let t=20,r=0,l=0;if(te.value&&(t+=30),Te.value&&(t+=25),He.value&&I.series.length>0){const c=I.series.filter((g,f)=>!tt.value.has(f)).length;if(ze.value==="top"||ze.value==="bottom"){if(en.value==="horizontal"){const f=Math.floor(Re.value/100);r=Math.ceil(c/f)*25+10}else r=c*25+10;t+=r}else l=150}return{height:t,legendHeight:r,legendWidth:l}};function Gt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const O=e.computed(()=>be(re,I.options)),ft=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.width==="auto"}),Wt=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.height==="auto"}),Re=e.computed(()=>{const t=O.value;return ft.value?vt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Oe=e.ref(_e),lt=e.computed(()=>{const t=O.value;return Wt.value?Math.max(0,(v.value||400)-Oe.value):t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),ie=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Ct=e.computed(()=>{const t=I.series.map(r=>r.type||ie.value);return new Set(t).size>1}),te=e.computed(()=>{const t=O.value;return t&&t.title&&t.title.text?t.title.text:""}),Te=e.computed(()=>{const t=O.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),jn=e.computed(()=>{const t=O.value;if(!t||!t.zAxis)return"";const r=t.zAxis;return typeof r=="string"?r:r&&typeof r.label=="string"?r.label:""}),Rt=e.computed(()=>{const t=O.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Qt=e.computed(()=>{const t=O.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),cn=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Rn;const r=t.yAxis.min;return typeof r=="number"||r===Rn?r:Rn}),Jt=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Rn;const r=t.yAxis.max;return typeof r=="number"||r===Rn?r:Rn}),vn=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),We=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),qe=e.computed(()=>{const t=O.value;return t&&t.grid&&t.grid.show!==!1}),He=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.show!==!1}),ze=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),en=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),bn=e.computed(()=>{const t=O.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ne=e.computed(()=>{const t=O.value;if(!t||!t.crosshair)return!1;const r=t.crosshair.show;return r===!0||r==="true"}),fn=e.computed(()=>{const t=O.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Lt=e.computed(()=>{const t=O.value;return t&&t.zoom&&t.zoom.enabled!==!1}),ln=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),nl=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Ue=e.computed(()=>{const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Xe=e.computed(()=>{if(!mn.value)return 0;const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),rt=e.computed(()=>{const t=O.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),It=e.computed(()=>{const{maxX:t}=Ze.value;return t===0}),_t=(t,r)=>It.value&&r===0?5:r,Ye=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),ot=e.computed(()=>{const t=O.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),ue=e.computed(()=>{const t=O.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Ee=e.computed(()=>{const t=O.value;return ot.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),qt=e.computed(()=>{const t=O.value,r=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return r.length>0?r:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),je=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.enabled!==!1}),Ft=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Je=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),et=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Ke=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),pe=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),$e=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Tt=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Be=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),gt=e.computed(()=>O.value?.spider?.gridSteps||5),Ut=e.computed(()=>{const t=[],r=gt.value;for(let l=1;l<=r;l++)t.push(Le.value/r*l);return t}),ht=t=>{const r=it.value;if(r&&Array.isArray(r)&&r[t]!==void 0)return r[t].toString();const l=Ut.value[t];return Math.round(l/Le.value*100)+"%"},it=e.computed(()=>O.value?.spider?.gridLabels||null),at=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),st=e.computed(()=>{const t=O.value,r={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...r,...t.contextMenu.items}:r}),on=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),ct=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.icon?t.markers.icon:zn.value}),bt=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),M=e.computed(()=>{const t=O.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),D=e.computed(()=>!P.value.isZooming);e.computed(()=>ut.value.map(t=>{if(t.categoryIndex!==void 0&&(St.value||xt.value)){const r=Ge(t.categoryIndex),l=xe.value+B.value.bottom-M.value/2;return{...t,x:r,y:l}}return t}));function _(t,r){const l=new Date(t);let c=0,g=1/0;return r.forEach((f,b)=>{const[k,S,T]=f.split("-"),$=new Date(`20${T}`,S-1,k),L=Math.abs($-l);L<g&&(g=L,c=b)}),c}const X=e.computed(()=>{const t=I.markers.map(l=>{const c=_(l.marker_date,I.categories),g=Ge(c),f=xe.value+B.value.bottom-M.value/2;return{...l,x:g,y:f,categoryIndex:c,source:"props"}}),r=ut.value.map(l=>{if(l.categoryIndex!==void 0&&(St.value||xt.value)){const c=Ge(l.categoryIndex),g=xe.value+B.value.bottom-M.value/2;return{...l,x:c,y:g,source:"internal"}}return{...l,source:"internal"}});return[...t,...r]}),ae=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.enabled===!0}),we=e.computed(()=>{const t=O.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),Se=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:"25%"}),ye=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Pe=e.computed(()=>{const t={left:B.value.left,top:B.value.top,width:B.value.width,height:B.value.height};let r,l;const c=String(Se.value);if(c.includes("%")){const g=parseFloat(c)/100;r=t.width*g,l=r*(96/499)}else{const g=parseFloat(c)||25;r=Math.min(t.width*.25,200)*(g/25),l=r*(96/499)}return{width:r,height:l,area:t}}),Xt=e.computed(()=>{const{width:t,height:r}=Pe.value,l=ye.value;let c,g;const f=B.value.left,b=B.value.right,k=B.value.top,S=B.value.bottom,T=B.value.width,$=B.value.height;switch(l){case"center":c=f+(T-t)/2,g=k+($-r)/2;break;case"top-left":c=f+15,g=k+90;break;case"top-right":c=b-t-15,g=k+90;break;case"bottom-left":c=f+15,g=S-r+75;break;case"bottom-right":default:c=b-t-15,g=S-r+75;break}return{backgroundPositionX:c+"px",backgroundPositionY:g+"px",backgroundSize:`${t}px ${r}px`}}),Fn=t=>!I.flags||!I.flags.length?[]:I.flags.filter(r=>r.categoryIndex===t),tn=t=>{const r=Fn(t),l=En(t),c=r.filter(b=>b.manual),g=r.filter(b=>!b.manual),f=[];return c.length>0&&f.push({type:z("chart.tooltip.manualFlags"),color:"#047395",flags:c.map(b=>({text:b.text,color:"#047395"}))}),g.length>0&&f.push({type:z("chart.tooltip.autoFlags"),color:"#0dbf89",flags:g.map(b=>({text:b.text,color:"#0dbf89"}))}),{flagGroups:f,markers:l.map(b=>({title:b.title,description:b.description,type:z("chart.tooltip.markers"),color:b.color||"#FF6B6B"}))}},zn=e.computed(()=>`data:image/svg+xml;base64,${btoa(`<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="#fafafa"/>
5
5
  <path d="M27.2846 45.1083H38.04C42.2352 45.1083 45.6368 41.6468 45.6368 37.3776C45.6368 33.1084 42.2352 29.6469 38.04 29.6469H27.1955C26.6366 29.6469 26.1831 30.1084 26.1831 30.6854L26.2803 44.0863C26.2803 44.655 26.7338 45.1083 27.2927 45.1083H27.2846Z" fill="#07A9DA"/>
6
6
  <path d="M16.3198 44.4813C20.1575 44.4813 23.2687 41.3153 23.2687 37.4099C23.2687 33.5045 20.1575 30.3386 16.3198 30.3386C12.482 30.3386 9.37085 33.5045 9.37085 37.4099C9.37085 41.3153 12.482 44.4813 16.3198 44.4813Z" fill="#fafafa"/>
7
- </svg>`)}`),mn=e.computed(()=>`data:image/svg+xml;base64,${btoa(`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
7
+ </svg>`)}`),cl=e.computed(()=>`data:image/svg+xml;base64,${btoa(`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
8
8
  <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"/>
9
9
  <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"/>
10
10
  <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"/>
@@ -18,23 +18,23 @@
18
18
  <path d="M67.37 43.9C74.0582 43.9 79.48 38.4782 79.48 31.79C79.48 25.1018 74.0582 19.68 67.37 19.68C60.6818 19.68 55.26 25.1018 55.26 31.79C55.26 38.4782 60.6818 43.9 67.37 43.9Z" fill="#fafafa"/>
19
19
  <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"/>
20
20
  <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"/>
21
- </svg>`)}`),pn=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),Ln=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=$.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const rl=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),qt=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),il=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),$n=e.computed(()=>{const r=$.value?.radialBar?.dataLabels;return r&&(r.show===!0||r.enabled===!0)}),Xo=e.computed(()=>{const r=$.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof r=="number"&&r>=0?r:20}),Dn=e.computed(()=>{if(!$n.value||!vt.value||!Oo.value.length)return[];const t=Xo.value*Math.PI/180,r=(ot.value+ce.value)/2;return Oo.value.map(n=>{const v=n.endAngle-n.startAngle>=t&&!n.isHidden,f=Ve.value+Math.cos(n.midAngle)*r,C=Se.value+Math.sin(n.midAngle)*r;return{value:n.value,x:f,y:C,show:v,color:n.color}})}),fn=e.computed(()=>{if(!D.flags||!D.flags.length)return[];const t=new Map;return D.flags.forEach(r=>{const n=r.categoryIndex;t.has(n)||t.set(n,[]),t.get(n).push(r)}),Array.from(t.entries()).map(([r,n])=>{const c=ge(r),v=n.filter(C=>C.manual),f=n.filter(C=>!C.manual);return{categoryIndex:parseInt(r),x:c,flags:n,manualCount:v.length,autoCount:f.length,totalCount:n.length,hasManual:v.length>0,hasAuto:f.length>0,texts:n.map(C=>C.text).join(`
22
- `)}})}),Yo=e.ref({show:!1,x:0,y:0,content:"",count:0}),jo=e.computed(()=>$.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),vn=e.computed(()=>{const t=$.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),cl=e.computed(()=>$.value?.bubbles?.tooltip?.formatters||{}),Ee=e.ref(new Set),U=e.ref(null),hn=e.ref(!1),oe=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),so=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),ne=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),re=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),A=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Me=e.ref([]),X=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1});e.computed(()=>{const t=["default"];return It.value&&t.push(...Object.keys(It.value)),t});const ul=e.computed(()=>{if(!D.categories||D.categories.length===0){const{maxX:t}=he.value;return Array.from({length:t+1},(r,n)=>J("chart.fallback.item",{number:n+1}))}return D.categories}),go=e.computed(()=>X.value.editingMarkerId!==null),No=e.computed(()=>X.value.readonly),ft=t=>{Ee.value.has(t)||(h.value=!0,U.value=t)},Nt=()=>{h.value=!1,U.value=null},Ko=t=>{if(k.value||x.value){ne.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),c=t.clientX-n.left,v=t.clientY-n.top,f=Be.value?c>=E.value.left-50&&c<=E.value.right+50&&v>=E.value.top-50&&v<=E.value.bottom+100:c>=E.value.left&&c<=E.value.right&&v>=E.value.top&&v<=E.value.bottom;if(hn.value=f,Be.value){if(!ue.value||!f||A.value.isDragging||A.value.isZooming){ne.value.show=!1;return}if(Ho.value.find(I=>!I||I.isHidden?!1:Math.sqrt(Math.pow(I.x-c,2)+Math.pow(I.y-v,2))<=I.radius+3))ne.value.show=!1;else{const I=Ho.value.filter(Z=>!Z||Z.isHidden?!1:Math.sqrt(Math.pow(Z.x-c,2)+Math.pow(Z.y-v,2))<=250);if(I.length>0){let Z=I[0],P=Math.sqrt(Math.pow(Z.x-c,2)+Math.pow(Z.y-v,2));I.forEach(O=>{const W=Math.sqrt(Math.pow(O.x-c,2)+Math.pow(O.y-v,2));W<P&&(P=W,Z=O)});const _=30,ee=Ho.value.filter(O=>!O||O.isHidden?!1:Math.abs(O.x-Z.x)<=_).sort((O,W)=>O.y-W.y);ne.value={show:!0,x:Z.x,categoryIndex:Math.round(Z.originalX),data:(()=>{const O=jo.value,W=vn.value,K=[];return ee.forEach(G=>{O.forEach(de=>{const pe=W[de]||de,ht=tl(de,G);ht&&K.push({seriesName:G.seriesName,label:G.label,value:`${pe}: ${ht}`,color:G.color,y:G.y})})}),K})()}}else ne.value.show=!1}return}if(A.value.isDragging&&A.value.scale>1&&De.value&&Pt.value){ne.value.show=!1;const Y=t.clientX-A.value.lastMouseX,{minX:I,maxX:Z}=he.value,P=Z-I||1,ee=Y*.8;A.value.offsetX+=ee;const O=P/A.value.scale,W=P-O,K=0,G=-W/P*E.value.width,de=K;A.value.offsetX=Math.max(G,Math.min(de,A.value.offsetX)),A.value.lastMouseX=t.clientX,A.value.lastMouseY=t.clientY;return}if(!ue.value||!De.value||A.value.isDragging||A.value.isZooming||!f){ne.value.show=!1;return}const{minX:C,maxX:y}=he.value,b=y-C||1,V=b/A.value.scale,N=C-A.value.offsetX/E.value.width*b,M=(c-E.value.left)/E.value.width,R=N+M*V,q=Math.round(R);if(q>=0&&q<=y){const Y=ge(q),I=uo.value.map((Z,P)=>{const _=D.series.findIndex(O=>O===Z),ee=Z.data[q];return{seriesName:Z.name,value:ee!==void 0?ee:null,color:ye(_),y:ee!==void 0?we(ee):null}}).filter(Z=>Z.value!==null);ne.value={show:!0,x:Y,categoryIndex:q,data:I}}},ze=()=>{ne.value.show=!1,hn.value=!1,x.value=!1,k.value||(Yo.value.show=!1),A.value.isDragging&&(A.value.isDragging=!1),A.value.zoomTimeout&&(clearTimeout(A.value.zoomTimeout),A.value.zoomTimeout=null),A.value.isZooming=!1,setTimeout(()=>{U.value=null,oe.value.show=!1},150)},fe=t=>{if(t.preventDefault(),t.stopPropagation(),!Fe.value)return;const r=t.currentTarget.getBoundingClientRect(),n=t.clientX-r.left,c=t.clientY-r.top;if(vt.value){re.value.show=!1,e.nextTick(()=>{re.value.show=!0,re.value.x=t.clientX,re.value.y=t.clientY,re.value.categoryIndex=null});return}const v=Math.max(0,E.value.left-20),f=E.value.right,C=E.value.top,y=E.value.bottom+80;n>=v&&n<=f&&c>=C&&c<=y&&(re.value.show=!1,e.nextTick(()=>{re.value.show=!0,re.value.x=t.clientX,re.value.y=t.clientY,re.value.categoryIndex=null;const b=Math.max(E.value.left,Math.min(n,E.value.right))-E.value.left,N=E.value.width/xn.value.length,M=Math.floor(b/N);M>=0&&M<xn.value.length&&(re.value.categoryIndex=M)}))},Xt=t=>{if(!(t&&t.button===2)){if(re.value.show&&t&&t.type==="click"){const r=document.querySelector(".dss-context-menu");if(r&&r.contains(t.target))return}re.value.show=!1}},gn=t=>{if(typeof t.template=="function"){const r={series:D.series,categories:D.categories,markers:Me.value},n={chartX:re.value.chartX,chartY:re.value.chartY,dataX:re.value.mouseDataX,dataY:re.value.mouseDataY,categoryIndex:re.value.categoryIndex};return t.template(r,n)}return t.template||t.label||""},Yt=t=>{const r=["dss-context-menu-item"];return t.cssClass&&r.push(t.cssClass),r},dl=t=>t.style||{},yn=t=>t.type&&It.value[t.type]?It.value[t.type]:t.customIcon?t.customIcon:Dt.value,Cn=t=>t==null?"":D.categories&&D.categories[t]?D.categories[t]:"",Go=t=>Me.value.length?Me.value.filter(r=>r.categoryIndex===t):[],ro=t=>{if(!De.value&&!Be.value)return{x:0,y:0};const r=ge(t),n=et.value+E.value.bottom-Ut.value/2;return{x:r,y:n}},In=()=>{Me.value.forEach(t=>{if(t.categoryIndex!==void 0&&(De.value||Be.value)){const r=ro(t.categoryIndex);t.x=r.x,t.y=r.y}})},ml=()=>{if(X.value.description&&X.value.description.length){if(go.value){const t=Me.value.findIndex(r=>r.id===X.value.editingMarkerId);t!==-1?(Me.value[t].description=X.value.description||"",Me.value[t].color=X.value.color||"",Me.value[t].type=X.value.type||"default",zt("update-marker",Me.value[t])):zt("update-marker",{id:X.value.editingMarkerId,description:X.value.description||"",color:X.value.color||"",type:X.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let r=Math.max(0,X.value.categoryIndex);if(Be.value){const{maxX:C}=he.value;r=Math.max(0,Math.min(r,Math.floor(C)))}else De.value&&(r=Math.max(0,Math.min(r,he.value.maxX)));const n=ge(r),c=et.value+E.value.bottom-Ut.value/2,v=Array.isArray(D.categories)?D.categories[r]:null,f={id:t,title:"",description:X.value.description||"",color:X.value.color||"",type:X.value.type||"default",categoryIndex:r,x:n,y:c,marker_date:v||null};X.value.categoryIndex=r,Me.value.push(f),zt("add-marker",f)}at(),jt()}},at=()=>{X.value.show=!1,X.value.title="",X.value.description="",X.value.color="#FF6B6B",X.value.type="default",X.value.editingMarkerId=null,X.value.readonly=!1,X.value.categoryIndex=null,X.value.fromButton=!1},st=()=>{go.value&&(_n(X.value.editingMarkerId),at())},_n=t=>{const r=Me.value.findIndex(n=>n.id===t);r!==-1&&(Me.value.splice(r,1),jt()),zt("delete-marker",t)},Qe=t=>{X.value.show=!0,X.value.title=t?.title??t?.comment??"",X.value.description=t?.description??t?.comment??"",X.value.color=t?.color??"",X.value.type=t?.type??"default",X.value.editingMarkerId=t?.id??t?.marker_id??null,X.value.readonly=t?.readonly??!1,X.value.categoryIndex=t?.categoryIndex??null},jt=()=>{try{const t=`dss-chart-markers-${D.chartId}`;localStorage.setItem(t,JSON.stringify(Me.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},pl=()=>{try{const t=`dss-chart-markers-${D.chartId}`,r=localStorage.getItem(t);if(r){const n=JSON.parse(r);Array.isArray(n)&&(Me.value=n.map(c=>({...c,originalYOffset:c.originalYOffset!==void 0?c.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Me.value=[]}},Io=t=>{const r=j.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${r.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},kn=()=>{const t=ne.value.show,r=oe.value.show;return ne.value.show=!1,oe.value.show=!1,{originalCrosshair:t,originalTooltip:r}},Le=t=>{ne.value.show=t.originalCrosshair,oe.value.show=t.originalTooltip},Rn=async(t,r=32,n=32)=>new Promise((c,v)=>{if(t.startsWith("data:")){c(t);return}const f=new Image;f.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),c(t)},5e3);f.onload=()=>{clearTimeout(C);try{const y=document.createElement("canvas"),b=y.getContext("2d");y.width=r,y.height=n,b.fillStyle="#fafafa",b.fillRect(0,0,r,n),b.drawImage(f,0,0,r,n);const V=y.toDataURL("image/png");c(V)}catch(y){console.warn("Canvas conversion failed:",y),c(t)}},f.onerror=y=>{clearTimeout(C),console.warn("Failed to load image:",t,y),c(t)},f.src=t}),Fn=async()=>{try{const t=kn();setTimeout(async()=>{try{const r=document.querySelector(".dss-chart-svg");if(!r){console.error("Chart SVG element not found"),Le(t);return}const n=gt(),c=Ze.value,v=je.value+n.height,f=r.cloneNode(!0);f.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(_=>_.remove());const y=f.querySelectorAll("image"),b=Array.from(y).map(async _=>{const ee=_.getAttribute("xlink:href")||_.getAttribute("href");if(ee&&!ee.startsWith("data:"))try{const O=await Rn(ee,32,32);_.setAttribute("xlink:href",O),_.setAttribute("href",O)}catch(O){console.warn("Failed to convert logo to base64:",O)}});await Promise.all(b);const N=new XMLSerializer().serializeToString(f).replace(/<svg[^>]*>/,"").replace("</svg>","");let M="",R=30;if(j.value&&(M+=`
23
- <text x="24" y="${R}"
21
+ </svg>`)}`),ll=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),Cl=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const Mn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),dt=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),un=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),wn=e.computed(()=>{const r=O.value?.radialBar?.dataLabels;return r&&(r.show===!0||r.enabled===!0)}),Pn=e.computed(()=>{const r=O.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof r=="number"&&r>=0?r:20}),bl=e.computed(()=>{if(!wn.value||!mn.value||!hl.value.length)return[];const t=Pn.value*Math.PI/180,r=(nn.value+Le.value)/2;return hl.value.map(l=>{const g=l.endAngle-l.startAngle>=t&&!l.isHidden,f=yt.value+Math.cos(l.midAngle)*r,b=kt.value+Math.sin(l.midAngle)*r;return{value:l.value,x:f,y:b,show:g,color:l.color}})}),ol=e.computed(()=>{if(!I.flags||!I.flags.length)return[];const t=new Map;return I.flags.forEach(r=>{const l=r.categoryIndex;t.has(l)||t.set(l,[]),t.get(l).push(r)}),Array.from(t.entries()).map(([r,l])=>{const c=Ge(r),g=l.filter(b=>b.manual),f=l.filter(b=>!b.manual);return{categoryIndex:parseInt(r),x:c,flags:l,manualCount:g.length,autoCount:f.length,totalCount:l.length,hasManual:g.length>0,hasAuto:f.length>0,texts:l.map(b=>b.text).join(`
22
+ `)}})}),On=e.ref({show:!1,x:0,y:0,content:"",count:0}),xn=e.computed(()=>O.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Yt=e.computed(()=>{const t=O.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),$l=e.computed(()=>O.value?.bubbles?.tooltip?.formatters||{}),tt=e.ref(new Set),G=e.ref(null),dl=e.ref(!1),ve=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),gn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),me=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),Me=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),P=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),ut=e.ref([]),Q=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1});e.computed(()=>{const t=["default"];return bt.value&&t.push(...Object.keys(bt.value)),t});const Ll=e.computed(()=>{if(!I.categories||I.categories.length===0){const{maxX:t}=Ze.value;return Array.from({length:t+1},(r,l)=>z("chart.fallback.item",{number:l+1}))}return I.categories}),Bn=e.computed(()=>Q.value.editingMarkerId!==null),hn=e.computed(()=>Q.value.readonly),wt=t=>{tt.value.has(t)||(h.value=!0,G.value=t)},an=()=>{h.value=!1,G.value=null},Kn=t=>{if(w.value||x.value){me.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),c=t.clientX-l.left,g=t.clientY-l.top,f=xt.value?c>=B.value.left-50&&c<=B.value.right+50&&g>=B.value.top-50&&g<=B.value.bottom+100:c>=B.value.left&&c<=B.value.right&&g>=B.value.top&&g<=B.value.bottom;if(dl.value=f,xt.value){if(!Ne.value||!f||P.value.isDragging||P.value.isZooming){me.value.show=!1;return}if(il.value.find(q=>!q||q.isHidden?!1:Math.sqrt(Math.pow(q.x-c,2)+Math.pow(q.y-g,2))<=q.radius+3))me.value.show=!1;else{const q=il.value.filter(ne=>!ne||ne.isHidden?!1:Math.sqrt(Math.pow(ne.x-c,2)+Math.pow(ne.y-g,2))<=250);if(q.length>0){let ne=q[0],J=Math.sqrt(Math.pow(ne.x-c,2)+Math.pow(ne.y-g,2));q.forEach(ee=>{const le=Math.sqrt(Math.pow(ee.x-c,2)+Math.pow(ee.y-g,2));le<J&&(J=le,ne=ee)});const U=30,ge=il.value.filter(ee=>!ee||ee.isHidden?!1:Math.abs(ee.x-ne.x)<=U).sort((ee,le)=>ee.y-le.y);me.value={show:!0,x:ne.x,categoryIndex:Math.round(ne.originalX),data:(()=>{const ee=xn.value,le=Yt.value,ce=[];return ge.forEach(de=>{ee.forEach(Ae=>{const Fe=le[Ae]||Ae,pn=po(Ae,de);pn&&ce.push({seriesName:de.seriesName,label:de.label,value:`${Fe}: ${pn}`,color:de.color,y:de.y})})}),ce})()}}else me.value.show=!1}return}if(P.value.isDragging&&P.value.scale>1&&St.value&&Lt.value){me.value.show=!1;const se=t.clientX-P.value.lastMouseX,{minX:q,maxX:ne}=Ze.value,J=ne-q||1,ge=se*.8;P.value.offsetX+=ge;const ee=J/P.value.scale,le=J-ee,ce=0,de=-le/J*B.value.width,Ae=ce;P.value.offsetX=Math.max(de,Math.min(Ae,P.value.offsetX)),P.value.lastMouseX=t.clientX,P.value.lastMouseY=t.clientY;return}if(!Ne.value||!St.value||P.value.isDragging||P.value.isZooming||!f){me.value.show=!1;return}const{minX:b,maxX:k}=Ze.value,S=k-b||1,T=S/P.value.scale,$=b-P.value.offsetX/B.value.width*S,L=(c-B.value.left)/B.value.width,j=$+L*T,oe=Math.round(j);if(oe>=0&&oe<=k){const se=Ge(oe),q=qn.value.map((ne,J)=>{const U=I.series.findIndex(ee=>ee===ne),ge=ne.data[oe];return{seriesName:ne.name,value:ge!==void 0?ge:null,color:nt(U),y:ge!==void 0?mt(ge):null}}).filter(ne=>ne.value!==null);me.value={show:!0,x:se,categoryIndex:oe,data:q}}},C=()=>{me.value.show=!1,dl.value=!1,x.value=!1,w.value||(On.value.show=!1),P.value.isDragging&&(P.value.isDragging=!1),P.value.zoomTimeout&&(clearTimeout(P.value.zoomTimeout),P.value.zoomTimeout=null),P.value.isZooming=!1,setTimeout(()=>{G.value=null,ve.value.show=!1},150)},y=t=>{if(t.preventDefault(),t.stopPropagation(),!at.value)return;const r=t.currentTarget.getBoundingClientRect(),l=t.clientX-r.left,c=t.clientY-r.top;if(mn.value){Me.value.show=!1,e.nextTick(()=>{Me.value.show=!0,Me.value.x=t.clientX,Me.value.y=t.clientY,Me.value.categoryIndex=null});return}const g=Math.max(0,B.value.left-20),f=B.value.right,b=B.value.top,k=B.value.bottom+80;l>=g&&l<=f&&c>=b&&c<=k&&(Me.value.show=!1,e.nextTick(()=>{Me.value.show=!0,Me.value.x=t.clientX,Me.value.y=t.clientY,Me.value.categoryIndex=null;const S=Math.max(B.value.left,Math.min(l,B.value.right))-B.value.left,$=B.value.width/Dl.value.length,L=Math.floor(S/$);L>=0&&L<Dl.value.length&&(Me.value.categoryIndex=L)}))},V=t=>{if(!(t&&t.button===2)){if(Me.value.show&&t&&t.type==="click"){const r=document.querySelector(".dss-context-menu");if(r&&r.contains(t.target))return}Me.value.show=!1}},H=t=>{if(typeof t.template=="function"){const r={series:I.series,categories:I.categories,markers:ut.value},l={chartX:Me.value.chartX,chartY:Me.value.chartY,dataX:Me.value.mouseDataX,dataY:Me.value.mouseDataY,categoryIndex:Me.value.categoryIndex};return t.template(r,l)}return t.template||t.label||""},Y=t=>{const r=["dss-context-menu-item"];return t.cssClass&&r.push(t.cssClass),r},he=t=>t.style||{},Ve=t=>t.type&&bt.value[t.type]?bt.value[t.type]:t.customIcon?t.customIcon:ct.value,zt=t=>t==null?"":I.categories&&I.categories[t]?I.categories[t]:"",En=t=>ut.value.length?ut.value.filter(r=>r.categoryIndex===t):[],Pt=t=>{if(!St.value&&!xt.value)return{x:0,y:0};const r=Ge(t),l=xe.value+B.value.bottom-M.value/2;return{x:r,y:l}},wl=()=>{ut.value.forEach(t=>{if(t.categoryIndex!==void 0&&(St.value||xt.value)){const r=Pt(t.categoryIndex);t.x=r.x,t.y=r.y}})},_l=()=>{if(Q.value.description&&Q.value.description.length){if(Bn.value){const t=ut.value.findIndex(r=>r.id===Q.value.editingMarkerId);t!==-1?(ut.value[t].description=Q.value.description||"",ut.value[t].color=Q.value.color||"",ut.value[t].type=Q.value.type||"default",De("update-marker",ut.value[t])):De("update-marker",{id:Q.value.editingMarkerId,description:Q.value.description||"",color:Q.value.color||"",type:Q.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let r=Math.max(0,Q.value.categoryIndex);if(xt.value){const{maxX:b}=Ze.value;r=Math.max(0,Math.min(r,Math.floor(b)))}else St.value&&(r=Math.max(0,Math.min(r,Ze.value.maxX)));const l=Ge(r),c=xe.value+B.value.bottom-M.value/2,g=Array.isArray(I.categories)?I.categories[r]:null,f={id:t,title:"",description:Q.value.description||"",color:Q.value.color||"",type:Q.value.type||"default",categoryIndex:r,x:l,y:c,marker_date:g||null};Q.value.categoryIndex=r,ut.value.push(f),De("add-marker",f)}sn(),Tn()}},sn=()=>{Q.value.show=!1,Q.value.title="",Q.value.description="",Q.value.color="#FF6B6B",Q.value.type="default",Q.value.editingMarkerId=null,Q.value.readonly=!1,Q.value.categoryIndex=null,Q.value.fromButton=!1},rn=()=>{Bn.value&&(Yl(Q.value.editingMarkerId),sn())},Yl=t=>{const r=ut.value.findIndex(l=>l.id===t);r!==-1&&(ut.value.splice(r,1),Tn()),De("delete-marker",t)},jt=t=>{Q.value.show=!0,Q.value.title=t?.title??t?.comment??"",Q.value.description=t?.description??t?.comment??"",Q.value.color=t?.color??"",Q.value.type=t?.type??"default",Q.value.editingMarkerId=t?.id??t?.marker_id??null,Q.value.readonly=t?.readonly??!1,Q.value.categoryIndex=t?.categoryIndex??null},Tn=()=>{try{const t=`dss-chart-markers-${I.chartId}`;localStorage.setItem(t,JSON.stringify(ut.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},ho=()=>{try{const t=`dss-chart-markers-${I.chartId}`,r=localStorage.getItem(t);if(r){const l=JSON.parse(r);Array.isArray(l)&&(ut.value=l.map(c=>({...c,originalYOffset:c.originalYOffset!==void 0?c.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),ut.value=[]}},ul=t=>{const r=te.value||"Chart",l=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${r.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${l}.${t}`},Al=()=>{const t=me.value.show,r=ve.value.show;return me.value.show=!1,ve.value.show=!1,{originalCrosshair:t,originalTooltip:r}},Vt=t=>{me.value.show=t.originalCrosshair,ve.value.show=t.originalTooltip},jl=async(t,r=32,l=32)=>new Promise((c,g)=>{if(t.startsWith("data:")){c(t);return}const f=new Image;f.crossOrigin="anonymous";const b=setTimeout(()=>{console.warn("Image conversion timeout for:",t),c(t)},5e3);f.onload=()=>{clearTimeout(b);try{const k=document.createElement("canvas"),S=k.getContext("2d");k.width=r,k.height=l,S.fillStyle="#fafafa",S.fillRect(0,0,r,l),S.drawImage(f,0,0,r,l);const T=k.toDataURL("image/png");c(T)}catch(k){console.warn("Canvas conversion failed:",k),c(t)}},f.onerror=k=>{clearTimeout(b),console.warn("Failed to load image:",t,k),c(t)},f.src=t}),Kl=async()=>{try{const t=Al();setTimeout(async()=>{try{const r=document.querySelector(".dss-chart-svg");if(!r){console.error("Chart SVG element not found"),Vt(t);return}const l=Zt(),c=Re.value,g=lt.value+l.height,f=r.cloneNode(!0);f.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(U=>U.remove());const k=f.querySelectorAll("image"),S=Array.from(k).map(async U=>{const ge=U.getAttribute("xlink:href")||U.getAttribute("href");if(ge&&!ge.startsWith("data:"))try{const ee=await jl(ge,32,32);U.setAttribute("xlink:href",ee),U.setAttribute("href",ee)}catch(ee){console.warn("Failed to convert logo to base64:",ee)}});await Promise.all(S);const $=new XMLSerializer().serializeToString(f).replace(/<svg[^>]*>/,"").replace("</svg>","");let L="",j=30;if(te.value&&(L+=`
23
+ <text x="24" y="${j}"
24
24
  font-family="Arial, sans-serif"
25
25
  font-size="18"
26
26
  font-weight="bold"
27
27
  fill="#333">
28
- ${j.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
29
- </text>`,R+=30),xe.value&&(M+=`
30
- <text x="24" y="${R}"
28
+ ${te.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
29
+ </text>`,j+=30),Te.value&&(L+=`
30
+ <text x="24" y="${j}"
31
31
  font-family="Arial, sans-serif"
32
32
  font-size="14"
33
33
  fill="#666">
34
- ${xe.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
35
- </text>`,R+=25),Ce.value&&D.series.length>0){let _=c-200,ee=j.value||xe.value?35:25;const O=Math.floor((c-250)/120);let W=0;D.series.forEach((K,G)=>{if(!Ee.value.has(G)){const de=ye(G),pe=K.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");M+=`<circle cx="${_+6}" cy="${ee-4}" r="6" fill="${de}"/>`,M+=`<text x="${_+18}" y="${ee}" font-family="Arial, sans-serif" font-size="12" fill="#333">${pe}</text>`,W++,W%O===0?(_=c-200,ee+=20):_+=Math.min(120,pe.length*8+35)}})}let q="";if(Vt.value)try{const{width:_,height:ee}=dn.value,O=un.value,W=E.value.left,K=E.value.right,G=E.value.top,de=E.value.bottom,pe=E.value.width,ht=E.value.height;let Ge,fo;switch(O){case"center":Ge=W+(pe-_)/2,fo=G+(ht-ee)/2;break;case"top-left":Ge=W+15,fo=G+5;break;case"top-right":Ge=K-_-5,fo=G+5;break;case"bottom-left":Ge=W+15,fo=de-ee-5;break;case"bottom-right":default:Ge=K-_-5,fo=de-ee-5;break}q=`
36
- <g opacity="${cn.value}">
37
- <g transform="translate(${Ge}, ${fo}) scale(${_/499})">
34
+ ${Te.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
35
+ </text>`,j+=25),He.value&&I.series.length>0){let U=c-200,ge=te.value||Te.value?35:25;const ee=Math.floor((c-250)/120);let le=0;I.series.forEach((ce,de)=>{if(!tt.value.has(de)){const Ae=nt(de),Fe=ce.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");L+=`<circle cx="${U+6}" cy="${ge-4}" r="6" fill="${Ae}"/>`,L+=`<text x="${U+18}" y="${ge}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Fe}</text>`,le++,le%ee===0?(U=c-200,ge+=20):U+=Math.min(120,Fe.length*8+35)}})}let oe="";if(ae.value)try{const{width:U,height:ge}=Pe.value,ee=ye.value,le=B.value.left,ce=B.value.right,de=B.value.top,Ae=B.value.bottom,Fe=B.value.width,pn=B.value.height;let Ot,Yn;switch(ee){case"center":Ot=le+(Fe-U)/2,Yn=de+(pn-ge)/2;break;case"top-left":Ot=le+15,Yn=de+5;break;case"top-right":Ot=ce-U-5,Yn=de+5;break;case"bottom-left":Ot=le+15,Yn=Ae-ge-5;break;case"bottom-right":default:Ot=ce-U-5,Yn=Ae-ge-5;break}oe=`
36
+ <g opacity="${we.value}">
37
+ <g transform="translate(${Ot}, ${Yn}) scale(${U/499})">
38
38
  <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"/>
39
39
  <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"/>
40
40
  <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"/>
@@ -49,8 +49,8 @@
49
49
  <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"/>
50
50
  <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"/>
51
51
  </g>
52
- </g>`}catch(_){console.warn("Watermark processing failed, skipping watermark in SVG:",_),q=""}const Y=`<?xml version="1.0" encoding="UTF-8"?>
53
- <svg width="${c}" height="${v}"
52
+ </g>`}catch(U){console.warn("Watermark processing failed, skipping watermark in SVG:",U),oe=""}const se=`<?xml version="1.0" encoding="UTF-8"?>
53
+ <svg width="${c}" height="${g}"
54
54
  xmlns="http://www.w3.org/2000/svg"
55
55
  xmlns:xlink="http://www.w3.org/1999/xlink">
56
56
  <defs>
@@ -61,20 +61,20 @@
61
61
  </style>
62
62
  </defs>
63
63
  <rect width="100%" height="100%" fill="#fafafa"/>
64
- ${M}
65
- <g transform="translate(0, ${n.height})">
66
- ${N}
67
- ${q}
64
+ ${L}
65
+ <g transform="translate(0, ${l.height})">
66
+ ${$}
67
+ ${oe}
68
68
  </g>
69
- </svg>`,I=new Blob([Y],{type:"image/svg+xml;charset=utf-8"}),Z=URL.createObjectURL(I),P=document.createElement("a");P.href=Z,P.download=Io("svg"),document.body.appendChild(P),P.click(),document.body.removeChild(P),URL.revokeObjectURL(Z),Le(t),Xt()}catch(r){console.error("Error downloading SVG:",r),Le(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},zn=async()=>{try{const t=kn();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(_=>setTimeout(_,300));const r=gt(),n=Ze.value,c=je.value+r.height,v=document.createElement("canvas"),f=v.getContext("2d"),C=2;v.width=n*C,v.height=c*C,v.style.width=n+"px",v.style.height=c+"px",f.scale(C,C),f.fillStyle="#fafafa",f.fillRect(0,0,n,c);let y=30;if(j.value&&(f.fillStyle="#333",f.font="bold 18px Arial, sans-serif",f.fillText(j.value,24,y),y+=30),xe.value&&(f.fillStyle="#666",f.font="14px Arial, sans-serif",f.fillText(xe.value,24,y),y+=25),Ce.value&&D.series.length>0){let _=n-200,ee=j.value||xe.value?35:25;const O=Math.floor((n-250)/120);let W=0;f.font="12px Arial, sans-serif",D.series.forEach((K,G)=>{if(!Ee.value.has(G)){const de=ye(G);f.beginPath(),f.arc(_+6,ee-4,6,0,2*Math.PI),f.fillStyle=de,f.fill(),f.fillStyle="#333",f.fillText(K.name,_+18,ee),W++,W%O===0?(_=n-200,ee+=20):_+=Math.min(120,K.name.length*8+35)}})}const V=document.querySelector(".dss-chart-svg").cloneNode(!0),N=V.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),M=V.querySelectorAll(".dss-crosshair"),R=V.querySelectorAll('[class*="tooltip"]');N.forEach(_=>_.remove()),M.forEach(_=>_.remove()),R.forEach(_=>_.remove()),V.querySelectorAll("image").forEach((_,ee)=>{const O=_.getAttribute("xlink:href")||_.getAttribute("href");if(O&&!O.startsWith("data:")){const W=s.value[ee],K=W?ye(W.seriesIndex):"#3B82F6",G=_.getAttribute("x")||0,de=_.getAttribute("y")||0,pe=_.getAttribute("width")||32,ht=_.getAttribute("height")||32,Ge=document.createElementNS("http://www.w3.org/2000/svg","circle");Ge.setAttribute("cx",parseFloat(G)+parseFloat(pe)/2),Ge.setAttribute("cy",parseFloat(de)+parseFloat(ht)/2),Ge.setAttribute("r",Math.min(parseFloat(pe),parseFloat(ht))/2-1),Ge.setAttribute("fill",K),Ge.setAttribute("stroke","#fafafa"),Ge.setAttribute("stroke-width","2"),_.parentNode.replaceChild(Ge,_)}});const Y=new XMLSerializer().serializeToString(V),I=new Blob([Y],{type:"image/svg+xml;charset=utf-8"}),Z=URL.createObjectURL(I),P=new Image;return new Promise((_,ee)=>{P.onload=async()=>{try{if(f.drawImage(P,0,r.height),s.value.forEach(O=>{const W=O.x,K=O.y+r.height,G=(O.width||32)/2,de=ye(O.seriesIndex);f.save(),f.beginPath(),f.arc(W,K,G-1,0,2*Math.PI),f.fillStyle=de,f.fill(),f.strokeStyle="#fafafa",f.lineWidth=2,f.stroke(),f.restore()}),Vt.value){const O=new Image,W=()=>{const{width:G,height:de}=dn.value,pe=un.value,ht=E.value.left,Ge=E.value.right,fo=E.value.top,Ml=E.value.bottom,Bl=E.value.width,Tl=E.value.height;let an,sn;switch(pe){case"center":an=ht+(Bl-G)/2,sn=fo+r.height+(Tl-de)/2;break;case"top-left":an=ht+15,sn=fo+r.height+10;break;case"top-right":an=Ge-G-5,sn=fo+r.height+10;break;case"bottom-left":an=ht+15,sn=Ml+r.height-de-5;break;case"bottom-right":default:an=Ge-G-5,sn=Ml+r.height-de-5;break}f.globalAlpha=cn.value,f.drawImage(O,an,sn,G,de),f.globalAlpha=1,K()},K=()=>{v.toBlob(G=>{const de=URL.createObjectURL(G),pe=document.createElement("a");pe.href=de,pe.download=Io("png"),document.body.appendChild(pe),pe.click(),document.body.removeChild(pe),URL.revokeObjectURL(de),URL.revokeObjectURL(Z),Le(t),Xt(),_()},"image/png")};O.onload=W,O.onerror=K,O.src=mn.value}else v.toBlob(O=>{const W=URL.createObjectURL(O),K=document.createElement("a");K.href=W,K.download=Io("png"),document.body.appendChild(K),K.click(),document.body.removeChild(K),URL.revokeObjectURL(W),URL.revokeObjectURL(Z),Le(t),Xt(),_()},"image/png")}catch(O){URL.revokeObjectURL(Z),Le(t),ee(O)}},P.onerror=()=>{URL.revokeObjectURL(Z),Le(t),ee(new Error("Failed to load SVG image"))},P.src=Z})}catch(t){console.error("Error downloading PNG:",t)}},Pn=()=>{try{let t="";j.value&&(t+=`# ${J("chart.csv.chartTitle")}: ${j.value}
70
- `),xe.value&&(t+=`# ${J("chart.csv.chartSubtitle")}: ${xe.value}
71
- `),t+=`# ${J("chart.csv.generated")}: ${new Date().toLocaleString()}
69
+ </svg>`,q=new Blob([se],{type:"image/svg+xml;charset=utf-8"}),ne=URL.createObjectURL(q),J=document.createElement("a");J.href=ne,J.download=ul("svg"),document.body.appendChild(J),J.click(),document.body.removeChild(J),URL.revokeObjectURL(ne),Vt(t),V()}catch(r){console.error("Error downloading SVG:",r),Vt(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Gl=async()=>{try{const t=Al();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(U=>setTimeout(U,300));const r=Zt(),l=Re.value,c=lt.value+r.height,g=document.createElement("canvas"),f=g.getContext("2d"),b=2;g.width=l*b,g.height=c*b,g.style.width=l+"px",g.style.height=c+"px",f.scale(b,b),f.fillStyle="#fafafa",f.fillRect(0,0,l,c);let k=30;if(te.value&&(f.fillStyle="#333",f.font="bold 18px Arial, sans-serif",f.fillText(te.value,24,k),k+=30),Te.value&&(f.fillStyle="#666",f.font="14px Arial, sans-serif",f.fillText(Te.value,24,k),k+=25),He.value&&I.series.length>0){let U=l-200,ge=te.value||Te.value?35:25;const ee=Math.floor((l-250)/120);let le=0;f.font="12px Arial, sans-serif",I.series.forEach((ce,de)=>{if(!tt.value.has(de)){const Ae=nt(de);f.beginPath(),f.arc(U+6,ge-4,6,0,2*Math.PI),f.fillStyle=Ae,f.fill(),f.fillStyle="#333",f.fillText(ce.name,U+18,ge),le++,le%ee===0?(U=l-200,ge+=20):U+=Math.min(120,ce.name.length*8+35)}})}const T=document.querySelector(".dss-chart-svg").cloneNode(!0),$=T.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),L=T.querySelectorAll(".dss-crosshair"),j=T.querySelectorAll('[class*="tooltip"]');$.forEach(U=>U.remove()),L.forEach(U=>U.remove()),j.forEach(U=>U.remove()),T.querySelectorAll("image").forEach((U,ge)=>{const ee=U.getAttribute("xlink:href")||U.getAttribute("href");if(ee&&!ee.startsWith("data:")){const le=s.value[ge],ce=le?nt(le.seriesIndex):"#3B82F6",de=U.getAttribute("x")||0,Ae=U.getAttribute("y")||0,Fe=U.getAttribute("width")||32,pn=U.getAttribute("height")||32,Ot=document.createElementNS("http://www.w3.org/2000/svg","circle");Ot.setAttribute("cx",parseFloat(de)+parseFloat(Fe)/2),Ot.setAttribute("cy",parseFloat(Ae)+parseFloat(pn)/2),Ot.setAttribute("r",Math.min(parseFloat(Fe),parseFloat(pn))/2-1),Ot.setAttribute("fill",ce),Ot.setAttribute("stroke","#fafafa"),Ot.setAttribute("stroke-width","2"),U.parentNode.replaceChild(Ot,U)}});const se=new XMLSerializer().serializeToString(T),q=new Blob([se],{type:"image/svg+xml;charset=utf-8"}),ne=URL.createObjectURL(q),J=new Image;return new Promise((U,ge)=>{J.onload=async()=>{try{if(f.drawImage(J,0,r.height),s.value.forEach(ee=>{const le=ee.x,ce=ee.y+r.height,de=(ee.width||32)/2,Ae=nt(ee.seriesIndex);f.save(),f.beginPath(),f.arc(le,ce,de-1,0,2*Math.PI),f.fillStyle=Ae,f.fill(),f.strokeStyle="#fafafa",f.lineWidth=2,f.stroke(),f.restore()}),ae.value){const ee=new Image,le=()=>{const{width:de,height:Ae}=Pe.value,Fe=ye.value,pn=B.value.left,Ot=B.value.right,Yn=B.value.top,To=B.value.bottom,$o=B.value.width,Lo=B.value.height;let Tl,Hl;switch(Fe){case"center":Tl=pn+($o-de)/2,Hl=Yn+r.height+(Lo-Ae)/2;break;case"top-left":Tl=pn+15,Hl=Yn+r.height+10;break;case"top-right":Tl=Ot-de-5,Hl=Yn+r.height+10;break;case"bottom-left":Tl=pn+15,Hl=To+r.height-Ae-5;break;case"bottom-right":default:Tl=Ot-de-5,Hl=To+r.height-Ae-5;break}f.globalAlpha=we.value,f.drawImage(ee,Tl,Hl,de,Ae),f.globalAlpha=1,ce()},ce=()=>{g.toBlob(de=>{const Ae=URL.createObjectURL(de),Fe=document.createElement("a");Fe.href=Ae,Fe.download=ul("png"),document.body.appendChild(Fe),Fe.click(),document.body.removeChild(Fe),URL.revokeObjectURL(Ae),URL.revokeObjectURL(ne),Vt(t),V(),U()},"image/png")};ee.onload=le,ee.onerror=ce,ee.src=cl.value}else g.toBlob(ee=>{const le=URL.createObjectURL(ee),ce=document.createElement("a");ce.href=le,ce.download=ul("png"),document.body.appendChild(ce),ce.click(),document.body.removeChild(ce),URL.revokeObjectURL(le),URL.revokeObjectURL(ne),Vt(t),V(),U()},"image/png")}catch(ee){URL.revokeObjectURL(ne),Vt(t),ge(ee)}},J.onerror=()=>{URL.revokeObjectURL(ne),Vt(t),ge(new Error("Failed to load SVG image"))},J.src=ne})}catch(t){console.error("Error downloading PNG:",t)}},Ql=()=>{try{let t="";te.value&&(t+=`# ${z("chart.csv.chartTitle")}: ${te.value}
70
+ `),Te.value&&(t+=`# ${z("chart.csv.chartSubtitle")}: ${Te.value}
71
+ `),t+=`# ${z("chart.csv.generated")}: ${new Date().toLocaleString()}
72
72
 
73
- `,t+="Category",D.series.forEach(f=>{const C=f.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
74
- `;const r=Math.max(...D.series.map(f=>f.data?.length||0));for(let f=0;f<r;f++){let b='"'+(D.categories[f]||J("chart.fallback.item",{number:f+1})).toString().replace(/"/g,'""')+'"';D.series.forEach(V=>{const N=V.data&&V.data[f]!==void 0?V.data[f]:"";b+=","+N}),t+=b+`
75
- `}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(n),v=document.createElement("a");v.href=c,v.download=Io("csv"),document.body.appendChild(v),v.click(),document.body.removeChild(v),URL.revokeObjectURL(c),Xt()}catch(t){console.error("Error downloading CSV:",t)}},On=t=>{if(typeof t.action=="function"){const r={series:D.series,categories:D.categories,markers:Me.value},n={chartX:re.value.chartX,chartY:re.value.chartY,dataX:re.value.mouseDataX,dataY:re.value.mouseDataY,categoryIndex:clampedCategoryIndex||re.value.categoryIndex};t.action(r,n)}Xt()},it=()=>{at(),X.value.show=!0,X.value.categoryIndex=re.value.categoryIndex,X.value.fromButton=!1,Xt()},Zn=()=>{at(),X.value.show=!0,X.value.categoryIndex=0,X.value.fromButton=!0},Wn=t=>{if(re.value.show){const r=document.querySelector(".dss-context-menu");r&&!r.contains(t.target)&&(re.value.show=!1)}},qe=t=>{re.value.show&&!t.target.closest(".context-menu")&&(re.value.show=!1)},Kt=t=>{if(!De.value||!Pt.value)return;t.preventDefault(),t.stopPropagation(),A.value.isZooming=!0,ne.value.show=!1,A.value.zoomTimeout&&clearTimeout(A.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),c=t.clientX-n.left,v=t.clientY-n.top;if(c<E.value.left-50||c>E.value.right+50||v<E.value.top-50||v>E.value.bottom+100){A.value.isZooming=!1;return}const f=t.deltaY>0?.9:1.1,C=Math.max(A.value.minScale,Math.min(A.value.maxScale,A.value.scale*f));if(C!==A.value.scale){const{minX:y,maxX:b}=he.value,V=b-y||1,N=V/A.value.scale,M=y-A.value.offsetX/E.value.width*V,R=(c-E.value.left)/E.value.width,q=M+R*N;A.value.scale=C;const Y=V/A.value.scale,I=q-R*Y;A.value.offsetX=-(I-y)/V*E.value.width,A.value.scale<=1.01&&(A.value.scale=1,A.value.offsetX=0)}A.value.zoomTimeout=setTimeout(()=>{A.value.isZooming=!1,A.value.zoomTimeout=null},300)},Mo=t=>{if(!De.value||!Pt.value||A.value.scale<=1)return;ne.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,A.value.isDragging=!0,A.value.lastMouseX=t.clientX,A.value.lastMouseY=t.clientY,t.preventDefault()},Gt=()=>{A.value.isDragging=!1},Mt=()=>{!De.value||!Pt.value||(A.value.scale=1,A.value.offsetX=0,A.value.isDragging=!1,A.value.zoomTimeout&&(clearTimeout(A.value.zoomTimeout),A.value.zoomTimeout=null),A.value.isZooming=!1)},io=()=>!De.value||!hn.value||!Pt.value?"default":A.value.isDragging?"grabbing":A.value.scale>1?"grab":"dss-crosshair",_t=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 r=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const c=t[Math.max(n-1,0)],v=t[n],f=t[n+1],C=t[Math.min(n+2,t.length-1)],y=v.x+(f.x-c.x)/6*te.value,b=v.y+(f.y-c.y)/6*te.value,V=f.x-(C.x-v.x)/6*te.value,N=f.y-(C.y-v.y)/6*te.value;r+=` C ${y} ${b} ${V} ${N} ${f.x} ${f.y}`}return r},$e=e.computed(()=>{let r=50+(Ao.value?30:0)+60;if(Jt.value)return{left:90,top:90,right:90,bottom:90};if(vt.value){let C=0;j.value&&(C+=15),xe.value&&(C+=10);const y=gt();let b=66,V=50;return Ce.value&&Ae.value==="left"?b+=y.legendWidth||150:Ce.value&&Ae.value==="right"&&(V+=y.legendWidth||150),{left:b,top:50+C,right:V,bottom:130}}let n=0;j.value&&(n+=15),xe.value&&(n+=10);const c=gt();let v=66,f=50;return Ce.value&&Ae.value==="left"?v+=c.legendWidth||150:Ce.value&&Ae.value==="right"&&(f+=c.legendWidth||150),Ce.value&&Ae.value==="bottom"&&(r+=c.legendHeight||0),{left:v,top:50+n,right:f,bottom:r}}),E=e.computed(()=>({left:$e.value.left,top:$e.value.top,right:Ze.value-$e.value.right,bottom:je.value-$e.value.bottom,width:Ze.value-($e.value.left+$e.value.right),height:je.value-($e.value.top+$e.value.bottom)})),De=e.computed(()=>["line","area","bar"].includes(ae.value)||Eo.value),Bt=e.computed(()=>Eo.value),vt=e.computed(()=>["radial","semi-radial"].includes(ae.value)),Jt=e.computed(()=>ae.value==="spider"),Be=e.computed(()=>ae.value==="bubble"),Xe=e.computed(()=>$.value?.chart?.orientation==="horizontal"&&(ae.value==="bar"||Bt.value)),Qt=t=>{const{minY:r,maxY:n}=he.value,c=n-r||1;return E.value.left+(t-r)/c*E.value.width},yo=t=>{const{maxX:r}=he.value,n=r+1,v=E.value.height/n;return E.value.top+(t+.5)*v},Ve=e.computed(()=>Ze.value/2),Se=e.computed(()=>Jt.value?je.value/2-40:je.value/2),ce=e.computed(()=>{if(Jt.value){const t=E.value.width-80,r=E.value.height-80;return Math.min(t,r)/2}return Math.min(E.value.width,E.value.height)/2}),ot=e.computed(()=>{const t=$.value,r=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof r=="number"&&r>=0&&r<=1?r:.45;return ce.value*n}),_o=e.ref(0),Un=e.computed(()=>`semi-radial-fill-clip-${D.chartId}`),Ro=e.computed(()=>ae.value==="semi-radial"),Jo=e.computed(()=>Ro.value&&tt.value&&!Q.value),qn=e.computed(()=>{const t=Jo.value?_o.value:1,r=Ve.value,n=Se.value,c=ot.value,v=ce.value,f=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${r} ${n} L ${r} ${n} Z`;const y=r+v*Math.cos(f),b=n+v*Math.sin(f),V=r+v*Math.cos(C),N=n+v*Math.sin(C),M=r+c*Math.cos(C),R=n+c*Math.sin(C),q=r+c*Math.cos(f),Y=n+c*Math.sin(f),I=t>.5?1:0;return`M ${r} ${n} L ${y} ${b} A ${v} ${v} 0 ${I} 1 ${V} ${N} L ${M} ${R} A ${c} ${c} 0 ${I} 1 ${q} ${Y} Z`}),Xn=e.computed(()=>Ro.value&&Jo.value?`url(#${Un.value})`:void 0),Co=e.ref(0),Yn=e.computed(()=>`radial-reveal-clip-${D.chartId}`),Rt=e.computed(()=>ae.value==="radial"),Bo=e.computed(()=>{const t=Rt.value?Co.value:1,r=Ve.value,n=Se.value,c=Math.max(ce.value*1.5,Ze.value,je.value);if(t<=0)return`M ${r} ${n} L ${r} ${n} Z`;if(t>=1){const M=r-c,R=r+c;return`M ${M} ${n} A ${c} ${c} 0 0 1 ${R} ${n} A ${c} ${c} 0 0 1 ${M} ${n} Z`}const v=-Math.PI/2,f=v+t*Math.PI*2,C=r+c*Math.cos(v),y=n+c*Math.sin(v),b=r+c*Math.cos(f),V=n+c*Math.sin(f),N=t>=.5?1:0;return`M ${r} ${n} L ${C} ${y} A ${c} ${c} 0 ${N} 1 ${b} ${V} Z`}),Qo=e.computed(()=>{if(Xn.value)return Xn.value;if(Rt.value)return`url(#${Yn.value})`});let co=null;const fl=()=>{if(!Jo.value)return;_o.value=0;const t=dt.value,r=performance.now(),n=c=>{const v=c-r,f=Math.min(1,v/t);_o.value=F(pt.value,f),f<1&&(co=requestAnimationFrame(n))};co=requestAnimationFrame(n)},jn=e.computed(()=>$.value?.bubbles?.minSize||8),Kn=e.computed(()=>$.value?.bubbles?.maxSize||50),eo=e.computed(()=>$.value?.bubbles?.opacity||.7),to=(t,r)=>{const n=[15,20,25,18,22],c=n[t%n.length]||20,v=1+Math.sin(r*.5)*.2;return Math.max(5,c*v)},ko=t=>{const r=document.querySelector(`.dss-bubble-image-${t}`);r&&(r.style.opacity="1")},Fo=t=>{const r=document.querySelector(`.dss-bubble-image-${t}`);r&&(r.style.display="none")},me=e.computed(()=>D.series),uo=e.computed(()=>D.series.filter((t,r)=>!Ee.value.has(r))),oo="auto",he=e.computed(()=>{if(Be.value)return xo();if(!uo.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,r=-1/0,n=0;uo.value.forEach(y=>{y.data&&y.data.length&&(n=Math.max(n,y.data.length-1),y.data.forEach(b=>{typeof b=="number"&&(t=Math.min(t,b),r=Math.max(r,b))}))}),D.categories.length>0&&(n=Math.max(n,D.categories.length-1)),t===1/0&&(t=0,r=100);const c=lo.value,v=Ct.value;let f,C;if(c===oo){const y=r-t,b=y>0?y*.1:1;f=Math.max(0,t-b)}else if(typeof c=="number")f=c;else{const y=r-t,b=y>0?y*.1:1;f=Math.max(0,t-b)}if(v===oo){const y=r-t,b=y>0?y*.1:2;C=r+b}else if(typeof v=="number")C=v;else{const y=r-t,b=y>0?y*.1:2;C=r+b}return{minX:0,maxX:n,minY:f,maxY:C}}),xo=()=>{if(!uo.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,r=-1/0,n=1/0,c=-1/0,v=1/0,f=-1/0,C=!1;if(uo.value.forEach((q,Y)=>{q?.data?.length&&q.data.forEach((I,Z)=>{let P,_,ee;if(typeof I=="object"&&I!==null&&!Array.isArray(I))P=typeof I.x=="number"?I.x:Z,_=typeof I.y=="number"?I.y:0,ee=typeof I.size=="number"?I.size:20;else if(Array.isArray(I)&&I.length>=3)P=typeof I[0]=="number"?I[0]:Z,_=typeof I[1]=="number"?I[1]:0,ee=typeof I[2]=="number"?I[2]:20;else if(typeof I=="number")P=Z,_=I,ee=to(Y,Z);else return;isFinite(P)&&isFinite(_)&&isFinite(ee)&&(t=Math.min(t,P),r=Math.max(r,P),n=Math.min(n,_),c=Math.max(c,_),v=Math.min(v,ee),f=Math.max(f,ee),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===r&&(t=Math.min(t,0),r=Math.max(r,D.categories?.length-1||8)),n===c&&(n=Math.max(0,n-10),c=n+20);const y=r-t,b=c-n;let V,N,M,R;return Lo.value!==null?V=Lo.value:V=t-y*.1,kt.value!==null?N=kt.value:N=r+y*.1,lo.value!==null&&typeof lo.value=="number"?M=lo.value:M=Math.max(0,n-b*.1),Ct.value!==null&&typeof Ct.value=="number"?R=Ct.value:R=c+b*.1,{minX:V,maxX:N,minY:M,maxY:R,minSize:v,maxSize:f}},ge=t=>{if(Be.value){const{minX:y,maxX:b}=he.value,V=b-y||1;return E.value.left+(t-y)/V*E.value.width}const{minX:r,maxX:n}=he.value,c=n-r;if(n===0||c===0)return E.value.left+E.value.width/2;const v=c/A.value.scale,f=r-A.value.offsetX/E.value.width*c,C=(t-f)/v;return E.value.left+C*E.value.width},we=t=>{const{minY:r,maxY:n}=he.value,c=n-r||1;return E.value.bottom-(t-r)/c*E.value.height},To=t=>{if(!Be.value)return Ke.value||4;const{maxSize:r}=he.value,n=Math.max(1,r),c=Math.min(1,Math.max(0,t/n));return jn.value+c*(Kn.value-jn.value)},vl=e.computed(()=>wn.value.map(t=>({y:t.y}))),xn=e.computed(()=>{if(Be.value)return zo();if(ae.value==="bar"){if(Xe.value){const O=[],{minY:W,maxY:K}=he.value,G=5,de=K-W||1;for(let pe=0;pe<=G;pe++){const ht=W+de*(pe/G),Ge=Qt(ht);O.push({x:Ge,y:E.value.bottom+20,text:Math.round(ht).toString()})}return O}const Y=[],{maxX:I}=he.value,Z=I+1,P=5,ee=(E.value.width-P*2)/Z;for(let O=0;O<=I;O++){const W=E.value.left+P+(O+.5)*ee;Y.push({x:W,y:E.value.bottom+20,text:D.categories[O]||J("chart.fallback.item",{number:O+1})})}return Y}const t=[],{minX:r,maxX:n}=he.value,c=n-r||1,v=c/A.value.scale,f=r-A.value.offsetX/E.value.width*c,C=f+v,y=Math.max(0,Math.floor(f-2)),b=Math.min(n,Math.ceil(C+2)),V=b-y,N=E.value.width,R=Math.floor(N/60);let q=1;V>R&&(q=Math.ceil(V/R));for(let Y=y;Y<=b;Y+=q)if(Y>=0&&Y<=n){const I=ge(Y);I>=E.value.left-100&&I<=E.value.right+100&&t.push({x:I,y:E.value.bottom+20,text:D.categories[Y]||`Item ${Y+1}`})}return t}),zo=()=>{const t=[],{minX:r,maxX:n}=he.value,c=n-r||1,v=Math.min(8,Math.max(4,Math.floor(E.value.width/80)));for(let f=0;f<=v;f++){const C=r+c*f/v,y=ge(C);if(y>=E.value.left-10&&y<=E.value.right+10){const b=Math.round(C),V=D.categories?.[b];t.push({x:y,y:E.value.bottom+20,text:V||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},wn=e.computed(()=>{if(Xe.value){const v=[],{maxX:f}=he.value;for(let C=0;C<=f;C++)v.push({x:E.value.left-10,y:yo(C),text:D.categories[C]||`Item ${C+1}`});return v}const t=[],{minY:r,maxY:n}=he.value,c=5;for(let v=0;v<=c;v++){const f=r+(n-r)*(v/c),C=Math.round(f);t.push({x:E.value.left-10,y:we(f),text:C.toString()})}return t}),ye=t=>{const r=$t.value;if(!r||r.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return r[t%r.length]},en=t=>{if(!t||typeof t!="string")return t;const r=t.trim(),n=r.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const f=Math.max(0,Math.floor(Number(n[1])*.65)),C=Math.max(0,Math.floor(Number(n[2])*.65)),y=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${f}, ${C}, ${y})`}const c=r.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(c){const f=Math.max(0,Math.floor(Number(c[1])*.65)),C=Math.max(0,Math.floor(Number(c[2])*.65)),y=Math.max(0,Math.floor(Number(c[3])*.65));return`rgba(${f}, ${C}, ${y}, ${c[4]})`}const v=r.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(v){let f=v[1];f.length===3&&(f=f[0]+f[0]+f[1]+f[1]+f[2]+f[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(0,2),16)*.65))),y=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(2,4),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(4,6),16)*.65)));return`#${[C,y,b].map(V=>V.toString(16).padStart(2,"0")).join("")}`}return r},Gn=(t,r)=>{const c=$.value?.stroke?.color;return c==null?en(r):typeof c=="string"?c:Array.isArray(c)&&c.length?c[t%c.length]??en(r):en(r)},bn=t=>{let r=0;for(let n=1;n<t.length;n++){const c=t[n].x-t[n-1].x,v=t[n].y-t[n-1].y;r+=Math.sqrt(c*c+v*v)}return r},Po=e.computed(()=>ae.value==="line"||Bt.value?(Bt.value?D.series.filter(r=>(r.type||ae.value)==="line"):me.value).map((r,n)=>{const c=D.series.findIndex(M=>M===r),v=[];let f=[];r.data.forEach((M,R)=>{M==null?f.length>0&&(v.push([...f]),f=[]):f.push({x:Xe.value?Qt(M):ge(R),y:Xe.value?yo(R):we(M),index:R})}),f.length>0&&v.push(f);let C="";v.forEach(M=>{if(M.length>0){let R="";lt.value?R=_t(M):R=`M ${M[0].x} ${M[0].y}`+M.slice(1).map(q=>` L ${q.x} ${q.y}`).join(""),C+=(C?" ":"")+R}});const y=v.reduce((M,R)=>M+bn(R),0),b=Ee.value.has(c),V=U.value===c,N=U.value!==null&&U.value!==c;return{path:C,color:ye(c),pathLength:y,seriesIndex:c,animationDelay:n*se.value,isHighlighted:V,isDimmed:N,isHidden:b}}):[]),tn=e.computed(()=>{if(!(ae.value==="line"||Bt.value))return[];const t=Bt.value?D.series.filter(n=>(n.type||ae.value)==="line"):me.value,r=[];return t.forEach((n,c)=>{const v=D.series.findIndex(f=>f===n);for(let f=0;f<n.data.length-1;f++){const C=n.data[f];if(C!=null){let y=-1,b=0;for(let V=f+1;V<n.data.length;V++){const N=n.data[V];if(N==null)b++;else{y=V;break}}if(b>0&&y!==-1){const V=n.data[y],N=Xe.value?Qt(C):ge(f),M=Xe.value?yo(f):we(C),R=Xe.value?Qt(V):ge(y),q=Xe.value?yo(y):we(V),Y=Ee.value.has(v),I=U.value===v,Z=U.value!==null&&U.value!==v;r.push({path:`M ${N} ${M} L ${R} ${q}`,color:ye(v),seriesIndex:v,animationDelay:c*se.value,isHighlighted:I,isDimmed:Z,isHidden:Y,gapSize:b}),f=y-1}}}}),r}),En=e.computed(()=>ae.value==="line"||Bt.value?!tt.value||Q.value||L.value.hasAnimated?[]:(Bt.value?D.series.filter(r=>(r.type||ae.value)==="line"):me.value).map((r,n)=>{const c=D.series.findIndex(b=>b===r);let v="",f=null;r.data.forEach((b,V)=>{if(b!=null){const N={x:Xe.value?Qt(b):ge(V),y:Xe.value?yo(V):we(b)};f===null?v+=`M ${N.x} ${N.y}`:v+=` L ${N.x} ${N.y}`,f=N}else if(f!==null){const N=r.data.findIndex((M,R)=>R>V&&M!==null&&M!==void 0);if(N!==-1){const M={x:Xe.value?Qt(r.data[N]):ge(N),y:Xe.value?yo(N):we(r.data[N])};v+=` L ${M.x} ${M.y}`,f=M}}});const C=r.data.map((b,V)=>b==null?null:{x:Xe.value?Qt(b):ge(V),y:Xe.value?yo(V):we(b)}).filter(b=>b!==null),y=bn(C);return{path:v,pathLength:y,color:ye(c),animationDelay:n*se.value,seriesIndex:c}}):[]),hl=e.computed(()=>{if(ae.value!=="line")return[];const t=[];return me.value.forEach((r,n)=>{const c=U.value===n,v=U.value!==null&&U.value!==n,f=Ee.value.has(n);r.data.forEach((C,y)=>{C!=null&&t.push({x:ge(y),y:we(C),color:ye(n),value:C,label:D.categories[y]||y.toString(),seriesName:r.name,categoryIndex:y,dataIndex:y,animationDelay:(n*r.data.length+y)*(se.value/8),isHighlighted:c,isDimmed:v,isHidden:f})})}),t}),Jn=e.computed(()=>{if(!Bt.value)return[];const t=[];return D.series.filter(n=>(n.type||ae.value)==="line").forEach((n,c)=>{const v=D.series.findIndex(b=>b===n),f=U.value===v,C=U.value!==null&&U.value!==v,y=Ee.value.has(v);n.data.forEach((b,V)=>{b!=null&&t.push({x:ge(V),y:we(b),color:ye(v),value:b,label:D.categories[V]||V.toString(),seriesName:n.name,categoryIndex:V,dataIndex:V,animationDelay:(c*n.data.length+V)*(se.value/8),isHighlighted:f,isDimmed:C,isHidden:y})})}),t}),Ho=e.computed(()=>{if(!Be.value)return[];const t=[];return me.value.forEach((r,n)=>{if(!r?.data?.length)return;const c=U.value,v=c!==null&&c===n,f=c!==null&&c!==n,C=Ee.value.has(n);r.data.forEach((y,b)=>{let V,N,M,R,q;if(typeof y=="object"&&y!==null&&!Array.isArray(y))V=typeof y.x=="number"?y.x:b,N=typeof y.y=="number"?y.y:0,M=typeof y.size=="number"?y.size:20,R=y.label||D.categories?.[b]||`Point ${b+1}`,q=y.image||y.imageUrl;else if(Array.isArray(y)&&y.length>=3)V=typeof y[0]=="number"?y[0]:b,N=typeof y[1]=="number"?y[1]:0,M=typeof y[2]=="number"?y[2]:20,R=y[3]||D.categories?.[b]||`Point ${b+1}`,q=y[4];else if(typeof y=="number")V=b,N=y,M=to(n,b),R=D.categories?.[b]||`Point ${b+1}`;else return;!isFinite(V)||!isFinite(N)||!isFinite(M)||t.push({x:ge(V),y:we(N),radius:To(M),originalX:V,originalY:N,originalSize:M,color:ye(n),seriesName:r.name||`Series ${n+1}`,label:R,imageUrl:q,seriesIndex:n,dataIndex:b,categoryIndex:Math.round(V),isHighlighted:v,isDimmed:f,isHidden:C,opacity:eo.value})})}),t}),on=e.computed(()=>ae.value!=="area"?[]:me.value.map((t,r)=>{const n=[];let c=[];if(t.data.forEach((M,R)=>{M==null?c.length>0&&(n.push([...c]),c=[]):c.push({x:ge(R),y:we(M),index:R})}),c.length>0&&n.push(c),n.length===0)return{linePath:"",areaPath:"",color:ye(r),isHidden:Ee.value.has(r)};const v=E.value.bottom+1;let f="",C="";n.forEach((M,R)=>{if(M.length===0)return;let q=`M ${M[0].x} ${M[0].y}`;lt.value&&M.length>1?q=_t(M):M.slice(1).forEach(I=>{q+=` L ${I.x} ${I.y}`}),f+=(f?" ":"")+q;let Y=`M ${M[0].x} ${v}`;if(Y+=` L ${M[0].x} ${M[0].y}`,lt.value&&M.length>1){const I=_t(M),Z=I.substring(I.indexOf("C")||I.indexOf("Q")||I.indexOf("L"));Z?Y+=" "+Z:M.slice(1).forEach(P=>{Y+=` L ${P.x} ${P.y}`})}else M.slice(1).forEach(I=>{Y+=` L ${I.x} ${I.y}`});Y+=` L ${M[M.length-1].x} ${v} Z`,C+=(C?" ":"")+Y});const y=U.value===r,b=U.value!==null&&U.value!==r,V=Ee.value.has(r),N=n.reduce((M,R)=>M+bn(R),0);return{linePath:f,areaPath:C,color:ye(r),pathLength:N,isHighlighted:y,isDimmed:b,isHidden:V}})),Qn=e.computed(()=>{if(!(["bar"].includes(ae.value)||Bt.value))return[];const t=[],{maxX:r}=he.value,n=Bt.value?D.series.filter(v=>(v.type||ae.value)==="bar"):me.value,c=n.length;if(Xe.value){const v=r+1,C=E.value.height/v,y=C*(2/3),b=Math.min(4,y/c*.15),V=y-(c-1)*b,N=Math.max(4,V/c);n.forEach((M,R)=>{const q=D.series.findIndex(P=>P===M),Y=U.value===q,I=U.value!==null&&U.value!==q,Z=Ee.value.has(q);M.data.forEach((P,_)=>{if(P==null||typeof P!="number"||!isFinite(P))return;const W=E.value.top+(_+.5)*C-y/2+R*(N+b),K=E.value.left,G=Math.abs(Qt(P)-E.value.left);let de="";if(lt.value&&G>0){const pe=Math.min(ve.value,N/2,G/2);de=[`M ${K} ${W}`,`L ${K+G-pe} ${W}`,`Q ${K+G} ${W} ${K+G} ${W+pe}`,`L ${K+G} ${W+N-pe}`,`Q ${K+G} ${W+N} ${K+G-pe} ${W+N}`,`L ${K} ${W+N}`,"Z"].join(" ")}t.push({x:K,y:W,width:G,height:N,color:ye(c===1?_:q),value:P,label:D.categories[_]||_.toString(),seriesName:M.name,animationDelay:(R*n.length+_)*(se.value/4),isHighlighted:Y,isDimmed:I,isHidden:Z,barPath:de,isSmooth:lt.value&&G>0})})})}else{const v=r+1,C=E.value.width/v,y=C*.8,b=y/c,V=b*.05,N=b-V;n.forEach((M,R)=>{const q=D.series.findIndex(P=>P===M),Y=U.value===q,I=U.value!==null&&U.value!==q,Z=Ee.value.has(q);M.data.forEach((P,_)=>{if(P==null||typeof P!="number"||!isFinite(P))return;const W=E.value.left+(_+.5)*C-y/2+R*b+V/2,K=we(Math.max(0,P)),G=Math.abs(we(0)-we(P));let de="";if(lt.value&&G>0){const pe=Math.min(ve.value,N/2,G/2);de=[`M ${W} ${K+G}`,`L ${W} ${K+pe}`,`Q ${W} ${K} ${W+pe} ${K}`,`L ${W+N-pe} ${K}`,`Q ${W+N} ${K} ${W+N} ${K+pe}`,`L ${W+N} ${K+G}`,"Z"].join(" ")}t.push({x:W,y:K,width:N,height:G,color:ye(c===1?_:q),value:P,label:D.categories[_]||_.toString(),seriesName:M.name,animationDelay:(R*n.length+_)*(se.value/4),isHighlighted:Y,isDimmed:I,isHidden:Z,barPath:de,isSmooth:lt.value&&G>0})})})}return t}),Oo=e.computed(()=>{if(!vt.value)return[];const t=me.value.map((f,C)=>({series:f,originalIndex:C})).filter(({originalIndex:f})=>!Ee.value.has(f));if(t.length===0)return[];let r=ae.value==="semi-radial"?Math.PI:-Math.PI/2;const n=ae.value==="semi-radial"?Math.PI:Math.PI*2,c=[];if(t.length===1){const{series:f,originalIndex:C}=t[0],y=f.data[0]||0,b=r,V=r+n-.001,N=b+n/2,M=Ve.value+Math.cos(b)*ot.value,R=Se.value+Math.sin(b)*ot.value,q=Ve.value+Math.cos(V)*ot.value,Y=Se.value+Math.sin(V)*ot.value,I=Ve.value+Math.cos(V)*ce.value,Z=Se.value+Math.sin(V)*ce.value,P=Ve.value+Math.cos(b)*ce.value,_=Se.value+Math.sin(b)*ce.value,ee=1,O=[`M ${M} ${R}`,`A ${ot.value} ${ot.value} 0 ${ee} 1 ${q} ${Y}`,`L ${I} ${Z}`,`A ${ce.value} ${ce.value} 0 ${ee} 0 ${P} ${_}`,"Z"].join(" "),W=ye(C);return c.push({path:O,color:W,strokeWidth:nt.value,strokeColor:Gn(0,W),value:y,seriesName:f.name,opacity:.8,isHighlighted:U.value===C,isDimmed:!1,isHidden:!1,startAngle:b,endAngle:V,midAngle:N}),c}const v=t.reduce((f,{series:C})=>f+(C.data[0]||0),0);return v===0?[]:(t.forEach(({series:f,originalIndex:C})=>{const y=f.data[0]||0,b=y/v*n,V=r,N=r+b,M=V+b/2,R=Ve.value+Math.cos(V)*ot.value,q=Se.value+Math.sin(V)*ot.value,Y=Ve.value+Math.cos(N)*ot.value,I=Se.value+Math.sin(N)*ot.value,Z=Ve.value+Math.cos(N)*ce.value,P=Se.value+Math.sin(N)*ce.value,_=Ve.value+Math.cos(V)*ce.value,ee=Se.value+Math.sin(V)*ce.value,O=b>Math.PI?1:0,W=[`M ${R} ${q}`,`A ${ot.value} ${ot.value} 0 ${O} 1 ${Y} ${I}`,`L ${Z} ${P}`,`A ${ce.value} ${ce.value} 0 ${O} 0 ${_} ${ee}`,"Z"].join(" "),K=ye(C);c.push({path:W,color:K,strokeWidth:nt.value,strokeColor:Gn(c.length,K),value:y,seriesName:f.name,opacity:.8,isHighlighted:U.value===C,isDimmed:U.value!==null&&U.value!==C,isHidden:!1,startAngle:V,endAngle:N,midAngle:M}),r=N}),c)}),el=e.computed(()=>!pn.value||!vt.value?[]:Oo.value.map((t,r)=>{if(t.isHidden)return null;const n=rl.value,c=qt.value,v=il.value,f=Ve.value+Math.cos(t.midAngle)*ce.value,C=Se.value+Math.sin(t.midAngle)*ce.value,y=Ve.value+Math.cos(t.midAngle)*(ce.value+n),b=Se.value+Math.sin(t.midAngle)*(ce.value+n),V=Math.cos(t.midAngle)>=0,M=y+c*(V?1:-1),R=b,q=V?y+15:y-15,Y=R-v,I=V?"start":"end",Z=Math.hypot(y-f,b-C),P=Math.hypot(M-y,R-b);return{pointerStartX:f,pointerStartY:C,pointerEndX:y,pointerEndY:b,horizontalEndX:M,horizontalEndY:R,textX:q,textY:Y,text:`${t.seriesName}: ${t.value}`,color:t.color,textAnchor:I,isRightSide:V,isHighlighted:t.isHighlighted,isDimmed:t.isDimmed,pointerLineLength:Z,horizontalLineLength:P}}).filter(Boolean)),gl=t=>{if(!t||t.isHidden)return 0;const r=t.opacity||eo.value||.7;return U.value===null||U.value===void 0?r:U.value!==null?t.seriesIndex===U.value?Math.min(1,r+.1):Math.max(.5,r*.8):r},Zo=t=>{if(!t||t.isHidden)return 0;const r=t.radius>20?.9:.8;return U.value!==null?t.seriesIndex===U.value?Math.min(1,r+.1):r*.7:r},no=(t,r)=>{if(t)try{if(U.value===t.seriesIndex?U.value=null:U.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:r,chartId:D.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},Vn=(t,r)=>{const n=[`dss-bubble-fallback-${r}`];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(" ")},Sn=(t,r)=>{if(!t||(r.stopPropagation(),x.value=!0,U.value=t.seriesIndex,ne.value.show=!1,!Vo.value))return;const n=r.target.closest(".dss-custom-chart-container");if(!n)return;const c=n.getBoundingClientRect();let v=r.clientX-c.left+10,f=r.clientY-c.top-10;const C=200,y=120;v+C>Ze.value&&(v=r.clientX-c.left-C-10),f+y>c.height&&(f=r.clientY-c.top-y-10),v<0&&(v=10),f<0&&(f=10);const b=jo.value,V=vn.value,N=b.map(M=>{const R=V[M]||M,q=tl(M,t);return q?{seriesName:t.seriesName,label:t.label,value:`${R}: ${q}`,color:t.color}:null}).filter(Boolean);oe.value={show:!0,x:v,y:f,title:t.label||t.seriesName||"",value:"",bubbleData:N,categoryIndex:void 0,spiderSeries:[]}},tl=(t,r)=>{let n;switch(t){case"x":n=r.originalX;break;case"y":n=r.originalY;break;case"size":n=r.originalSize;break;case"label":n=r.label;break;case"seriesName":n=r.seriesName;break;default:n=r[t]||""}const c=cl.value[t];return typeof c=="function"?c(n,r):typeof n=="number"?n.toFixed(1):n?.toString()||""},yl=()=>{if(!Be.value||!ne.value.data||ne.value.data.length===0)return"Bubbles";const t=[],r=new Set;return ne.value.data.forEach(n=>{if(n.seriesName&&n.label){const c=`${n.seriesName} - ${n.label}`;r.has(c)||(t.push(c),r.add(c))}else n.seriesName&&(r.has(n.seriesName)||(t.push(n.seriesName),r.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},ol=(t,r)=>{t&&(x.value=!1,U.value=null,oe.value.show=!1,oe.value.bubbleData=[])},nn=(t,r)=>{const n=r.target.closest(".dss-custom-chart-container");if(!n)return;const c=n.getBoundingClientRect(),v=Cn(t.categoryIndex),f=t.description||t.comment||"";let C=r.clientX-c.left+15,y=r.clientY-c.top-10;const b=200,V=f?80:50;C+b>Ze.value&&(C=r.clientX-c.left-b-15),y+V>je.value&&(y=r.clientY-c.top-V-10),C<0&&(C=10),y<0&&(y=10),so.value={show:!0,x:C,y,categoryValue:v,description:f}},Tt=()=>{so.value.show=!1},Wo=e.computed(()=>D.categories.length||Math.max(...uo.value.map(t=>t.data.length))),wo=e.computed(()=>{let t=0;return uo.value.forEach(r=>{r.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),ln=e.computed(()=>{const t=[],r=Wo.value;for(let n=0;n<r;n++){const c=n*2*Math.PI/r-Math.PI/2,v=Ve.value+Math.cos(c)*ce.value,f=Se.value+Math.sin(c)*ce.value;t.push({x:v,y:f,angle:c,index:n})}return t}),Cl=e.computed(()=>{const t=[],r=Wo.value;return ln.value.forEach((n,c)=>{const v=ce.value+15,f=c*2*Math.PI/r-Math.PI/2,C=Ve.value+Math.cos(f)*v,y=Se.value+Math.sin(f)*v+5;let b="middle",V="middle";Math.abs(Math.cos(f))>.5&&(b=Math.cos(f)>0?"start":"end"),Math.abs(Math.sin(f))>.5&&(V=Math.sin(f)>0?"hanging":"auto"),t.push({x:C,y,text:D.categories[c]||`Axis ${c+1}`,anchor:b,baseline:V})}),t}),nl=e.ref(new Set),ll=(t,r,n)=>{const c=`current-${n}`,v=nl.value.has(c);return!v&&U.value===null?r.fillOpacity||ho.value:r.isHighlighted||v?(r.fillOpacity||ho.value)+.15:r.isDimmed?(r.fillOpacity||ho.value)*.3:r.fillOpacity||ho.value},l=e.computed(()=>{if(!Jt.value)return[];const t=[],r=Wo.value;return me.value.forEach((n,c)=>{const v=[],f=[],C=[],y=U.value===c,b=U.value!==null&&U.value!==c,V=Ee.value.has(c);for(let N=0;N<r;N++){const M=n.data[N]||0,q=M/wo.value*ce.value,Y=N*2*Math.PI/r-Math.PI/2,I=Ve.value+Math.cos(Y)*q,Z=Se.value+Math.sin(Y)*q;v.push(`${I},${Z}`),f.push({x:I,y:Z}),C.push({x:I,y:Z,value:M,label:D.categories[N]||`Axis ${N+1}`,seriesName:n.name})}t.push({points:v.join(" "),polygonPoints:f,dataPoints:C,color:ye(c),fillOpacity:ho.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:y,isDimmed:b,isHidden:V,seriesIndex:c})}),t}),o=(t,r)=>{if(!r||r.length<3)return!1;let n=!1;for(let c=0,v=r.length-1;c<r.length;v=c++){const f=r[c].x,C=r[c].y,y=r[v].x,b=r[v].y;C>t.y!=b>t.y&&t.x<(y-f)*(t.y-C)/(b-C)+f&&(n=!n)}return n},a=t=>{if(!Jt.value)return;const r=t.currentTarget.closest(".dss-custom-chart-container");if(!r)return;const n=r.getBoundingClientRect(),c=ie.value?.getBoundingClientRect();if(!c)return;const v=t.clientX-c.left,f=t.clientY-c.top,C=l.value.filter(y=>y.isHidden?!1:o({x:v,y:f},y.polygonPoints));if(C.length>0){C.length,U.value=C[0].seriesIndex;const y=t.clientX-n.left+10,b=t.clientY-n.top-10,V=200,N=50+C.length*25;let M=y,R=b;M+V>Ze.value&&(M=t.clientX-n.left-V-10),R+N>je.value&&(R=t.clientY-n.top-N-10),M<0&&(M=10),R<0&&(R=10);const q=C.map(Y=>{let I=Y.dataPoints[0],Z=1/0;return Y.dataPoints.forEach(P=>{const _=Math.sqrt(Math.pow(P.x-v,2)+Math.pow(P.y-f,2));_<Z&&(Z=_,I=P)}),{seriesName:Y.seriesName,color:Y.color,value:I.value!==void 0?I.value:Y.value}});oe.value={show:!0,x:M,y:R,title:C.length===1?C[0].seriesName:"",value:"",bubbleData:[],spiderSeries:q}}else w()},s=e.computed(()=>{const t=$.value;return t.logos.map((r,n)=>{const c=D.series[r.seriesIndex];if(!c||!c.data||c.data.length===0||Ee.value.has(r.seriesIndex))return null;let v,f;if(De.value){let y=-1,b=null;for(let N=c.data.length-1;N>=0;N--)if(c.data[N]!==null&&c.data[N]!==void 0){y=N,b=c.data[N];break}if(y===-1||b===null)return null;const V=c.data.map((N,M)=>N==null?null:{x:ge(M),y:we(N),index:M}).filter(N=>N!==null);if(t.animations.enabled&&!Q.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(L.value.isAnimating||!L.value.hasAnimated))if(L.value.isAnimating){const N=L.value.currentFrame/L.value.totalFrames,M=F(t.animations.easing,Math.min(N,1)),R=kl(V,M);v=R.x+(r.offsetX||0),f=R.y+(r.offsetY||0)}else v=V[0].x+(r.offsetX||0),f=V[0].y+(r.offsetY||0);else v=ge(y)+(r.offsetX||0),f=we(b)+(r.offsetY||0)}else if(vt.value||Jt.value){const y=Math.PI*2/t.logos.length*n;v=Ve.value+Math.cos(y)*(ce.value+30)+(r.offsetX||0),f=Se.value+Math.sin(y)*(ce.value+30)+(r.offsetY||0)}return{...r,x:v,y:f,seriesIndex:r.seriesIndex}}).filter(Boolean)}),i=t=>{const r=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);r&&(r.style.opacity="0"),n&&(n.style.opacity="1")},d=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const r=document.querySelector(`.dss-logo-image-${t}`);r&&(r.style.display="none")},u=t=>{Ee.value.has(t)?Ee.value.delete(t):Ee.value.add(t)},m=e.computed(()=>{if(!oe.value.show&&!(ue.value&&ne.value.show&&!A.value.isZooming))return{display:"none"};let t,r;if(ue.value&&ne.value.show&&!A.value.isZooming){t=ne.value.x+15,r=E.value.top;const n=Be.value?200:150;t+n>Ze.value&&(t=ne.value.x-n-15),t<0&&(t=10),r<10&&(r=10)}else t=oe.value.x,r=oe.value.y;return{left:t+"px",top:r+"px"}}),p=(t,r)=>{if(!Vo.value||k.value)return;const c=r.target.closest(".dss-custom-chart-container").getBoundingClientRect();let v=r.clientX-c.left+10,f=r.clientY-c.top-10;const C=200,y=120,b=Ze.value,V=je.value;v+C>b&&(v=r.clientX-c.left-C-10),f+y>V&&(f=r.clientY-c.top-y-10),v<0&&(v=10),f<0&&(f=10);let N;typeof t.categoryIndex=="number"?N=t.categoryIndex:typeof t.dataIndex=="number"?N=t.dataIndex:t.label&&D.categories.includes(t.label)&&(N=D.categories.indexOf(t.label));const M=(Xe.value||ae.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";oe.value={show:!0,x:v,y:f,title:M,value:t.value?.toString()||"",categoryIndex:N,spiderSeries:[]}},h=e.ref(!1),x=e.ref(!1),w=()=>{oe.value.show=!1,oe.value.spiderSeries=[],oe.value.bubbleData=[],ne.value.show=!1,h.value||(U.value=null)},k=e.ref(!1),T=(t,r)=>{k.value=!0,oe.value.show=!1,ne.value.show=!1;const c=r.target.closest(".dss-custom-chart-container").getBoundingClientRect();let v=r.clientX-c.left+15,f=r.clientY-c.top-10;const C=250;v+C>Ze.value&&(v=r.clientX-c.left-C-15),v<0&&(v=10),f<0&&(f=10),Yo.value={show:!0,x:v,y:f,content:t.texts,count:t.totalCount}},B=()=>{k.value=!1,Yo.value.show=!1},L=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),F=(t,r)=>{switch(t){case"linear":return r;case"ease":return r<.5?2*r*r:-1+(4-2*r)*r;case"ease-in":return r*r;case"ease-out":return r*(2-r);case"ease-in-out":return r<.5?2*r*r:-1+(4-2*r)*r;default:return r}},Q=e.computed(()=>Ot.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Pe=()=>{if(!tt.value||Q.value){L.value.hasAnimated=!0,Rt.value&&(Co.value=1);return}Rt.value&&(Co.value=0),L.value.isAnimating=!0,L.value.currentFrame=0,L.value.totalFrames=Math.ceil(dt.value/16.67);const t=()=>{const r=L.value.currentFrame/L.value.totalFrames,n=F(pt.value,Math.min(r,1));Oe(n),Rt.value&&(Co.value=n),r<1?(L.value.currentFrame++,L.value.animationId=requestAnimationFrame(t)):Te()};L.value.animationId=requestAnimationFrame(t)},Oe=t=>{const r=document.querySelector(".dss-custom-chart-container");r&&r.style.setProperty("--dss-animation-progress",t)},Te=()=>{L.value.isAnimating=!1,L.value.hasAnimated=!0,Rt.value&&(Co.value=1),L.value.animationId&&(cancelAnimationFrame(L.value.animationId),L.value.animationId=null)},Ie=e.computed(()=>!vt.value||L.value.hasAnimated?!0:Rt.value?Co.value>=1:Ro.value?_o.value>=1:!0),_e=e.computed(()=>pn.value&&Ie.value),be=e.ref(!1);e.watch(_e,t=>{t?(be.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{be.value=!0})})):be.value=!1},{immediate:!0});const Ft=e.computed(()=>{if(!tt.value||Q.value||L.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${dt.value}ms`,t["--dss-animation-easing"]=mo(pt.value),t["--dss-stagger-delay"]=`${se.value}ms`,t}),mo=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",po=()=>{if(!tt.value||Q.value)return"";const t=["dss-chart-animated"];return L.value.hasAnimated||t.push(`dss-animate-${wt.value}`),L.value.hasAnimated||(vt.value&&ae.value!=="semi-radial"?t.push("dss-animate-fill"):vt.value||t.push(`dss-animate-${wt.value}`)),L.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>D.series,(t,r)=>{Ne.value&&r&&L.value.hasAnimated&&(L.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Pe(),mt.value)}))},{deep:!0}),e.watch(()=>A.value.isZooming,(t,r)=>{r&&!t&&setTimeout(()=>{In()},50)}),e.watch(()=>[A.value.scale,A.value.offsetX],()=>{!A.value.isZooming&&!A.value.isDragging&&In()},{flush:"post"}),e.watch([So,Bn],([t,r])=>{A.value.minScale=t,A.value.maxScale=r,(A.value.scale<t||A.value.scale>r)&&Mt()},{immediate:!0}),e.watch(()=>D.locale,t=>{t&&t!==H.value&&(H.value=t)},{immediate:!0}),e.watch(()=>re.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",qe)}):document.removeEventListener("click",qe)}),e.onMounted(()=>{U.value=null,Rt.value&&(!tt.value||Q.value)&&(Co.value=1),pl(),S.value&&typeof ResizeObserver<"u"&&(Re=new ResizeObserver(t=>{const r=t[0];if(!r||!r.contentRect)return;const{width:n,height:c}=r.contentRect;Uo.value=Math.round(n),g.value=Math.round(c),bo.value&&(He.value=bo.value.offsetHeight||ct)}),Re.observe(S.value)),tt.value&&!Q.value?ae.value==="semi-radial"?setTimeout(()=>fl(),mt.value):setTimeout(()=>Pe(),mt.value):(L.value.hasAnimated=!0,ae.value==="semi-radial"&&(_o.value=1)),document.addEventListener("mousemove",Nn),document.addEventListener("mouseup",Mn),document.addEventListener("click",Wn)}),e.onUnmounted(()=>{Re&&S.value&&(Re.unobserve(S.value),Re.disconnect(),Re=null),L.value.animationId&&cancelAnimationFrame(L.value.animationId),co&&(cancelAnimationFrame(co),co=null),A.value.zoomTimeout&&clearTimeout(A.value.zoomTimeout),document.removeEventListener("mousemove",Nn),document.removeEventListener("mouseup",Mn),document.removeEventListener("click",Wn),document.removeEventListener("click",qe)});const Nn=t=>{if(A.value.isDragging&&A.value.scale>1&&De.value){ne.value.show=!1;const r=t.clientX-A.value.lastMouseX,{minX:n,maxX:c}=he.value,v=c-n||1,C=r*.8;A.value.offsetX+=C;const y=v/A.value.scale,b=v-y,V=0,N=-b/v*E.value.width,M=V;A.value.offsetX=Math.max(N,Math.min(M,A.value.offsetX)),A.value.lastMouseX=t.clientX,A.value.lastMouseY=t.clientY}},Mn=()=>{A.value.isDragging&&(A.value.isDragging=!1,setTimeout(()=>{!A.value.isDragging&&A.value.isZooming},100))},kl=(t,r)=>{const n=t.filter(y=>y!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||r<=0)return n[0];if(r>=1)return n[n.length-1];let c=0;const v=[];for(let y=1;y<n.length;y++){const b=n[y].x-n[y-1].x,V=n[y].y-n[y-1].y,N=Math.sqrt(b*b+V*V);v.push(N),c+=N}const f=c*r;let C=0;for(let y=0;y<v.length;y++){const b=C+v[y];if(f<=b){const V=(f-C)/v[y],N=n[y],M=n[y+1];return{x:N.x+(M.x-N.x)*V,y:N.y+(M.y-N.y)*V}}C=b}return n[n.length-1]};return(t,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[po(),{"dss-chart-fill-width":Ye.value,"dss-chart-fill-height":Ht.value}]]),style:e.normalizeStyle({width:Ye.value?"100%":Ze.value+"px",height:Ht.value?"100%":je.value+20+"px",...Ft.value,cursor:io()}),"data-chart-type":ae.value,ref_key:"containerEl",ref:S,onWheel:Kt,onMousedown:Mo,onMousemove:Ko,onMouseup:Gt,onMouseleave:ze,onDblclick:Mt,onContextmenu:e.withModifiers(fe,["prevent"]),onClick:e.withModifiers(Xt,["left"]),onWheelCapture:Kt},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:bo},[e.createElementVNode("div",Al,[j.value?(e.openBlock(),e.createElementBlock("div",Ll,e.toDisplayString(j.value),1)):e.createCommentVNode("",!0),xe.value?(e.openBlock(),e.createElementBlock("div",$l,e.toDisplayString(xe.value),1)):e.createCommentVNode("",!0)]),Ce.value&&(Ae.value==="top"||Ae.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Lt.value==="horizontal","dss-legend-vertical":Lt.value==="vertical","dss-legend-top":Ae.value==="top","dss-legend-bottom":Ae.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.series,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ee.value.has(c),"dss-legend-hovered":U.value===c,"dss-legend-dimmed":U.value!==null&&U.value!==c}]),onClick:v=>u(c),onMouseenter:v=>ft(c),onMouseleave:Nt,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:ye(c)})},null,4),e.createElementVNode("span",Il,e.toDisplayString(n.name),1)],46,Dl))),128))],2)):e.createCommentVNode("",!0),Ce.value&&(Ae.value==="left"||Ae.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Ae.value==="left","dss-legend-right":Ae.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.series,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ee.value.has(c),"dss-legend-hovered":U.value===c,"dss-legend-dimmed":U.value!==null&&U.value!==c}]),onClick:v=>u(c),onMouseenter:v=>ft(c),onMouseleave:Nt,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:ye(c)})},null,4),e.createElementVNode("span",Rl,e.toDisplayString(n.name),1)],46,_l))),128))],2)):e.createCommentVNode("",!0)],512),z.showAddMarkerButton&&Ue.value.addMarker&&(De.value||Be.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Zn,title:e.unref(J)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Dt.value,class:"dss-add-marker-button-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,zl),r[5]||(r[5]=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,Fl)):e.createCommentVNode("",!0),e.createElementVNode("div",Pl,[Be.value&&rn.value?(e.openBlock(),e.createElementBlock("div",Ol,"Bubble size: "+e.toDisplayString(rn.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ze.value,height:je.value,class:"dss-chart-svg","data-smooth":lt.value,"data-animated":tt.value,ref_key:"svgEl",ref:ie},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",Wl,[e.createElementVNode("rect",{x:E.value.left,y:E.value.top,width:E.value.width,height:E.value.height*4},null,8,Ul)]),Ro.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Un.value},[e.createElementVNode("path",{d:qn.value},null,8,Xl)],8,ql)):e.createCommentVNode("",!0),Rt.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Yn.value},[e.createElementVNode("path",{d:Bo.value},null,8,jl)],8,Yl)):e.createCommentVNode("",!0)]),De.value||Be.value?(e.openBlock(),e.createElementBlock("g",Kl,[Je.value?(e.openBlock(),e.createElementBlock("g",Gl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vl.value,(n,c)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${c}`,x1:E.value.left,x2:E.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${c*50}ms`})},null,12,Jl))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ql,[e.createElementVNode("line",{x1:E.value.left,x2:E.value.right,y1:E.value.bottom,y2:E.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ea),e.createElementVNode("line",{x1:E.value.left,x2:E.value.left,y1:E.value.top,y2:E.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ta)]),e.createElementVNode("g",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xn.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${c}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},e.toDisplayString(n.text),13,na))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wn.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${c}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${c*80}ms`})},e.toDisplayString(n.text),13,la))),128)),Ao.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:E.value.left+E.value.width/2,y:E.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Ao.value),9,aa)):e.createCommentVNode("",!0),At.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:E.value.top+12+E.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${E.value.top+E.value.height/2})`},e.toDisplayString(At.value),9,sa)):e.createCommentVNode("",!0)]),fn.value.length>0?(e.openBlock(),e.createElementBlock("g",ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",ia,[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:E.value.bottom,y2:E.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>T(n,c),onMouseleave:B},null,40,ca)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:E.value.bottom,y2:E.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>T(n,c),onMouseleave:B},null,40,ua)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:E.value.bottom,y2:E.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>T(n,c),onMouseleave:B},null,40,da)):e.createCommentVNode("",!0)]),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,E.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:c=>T(n,c),onMouseleave:B},null,40,ma)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,E.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:c=>T(n,c),onMouseleave:B},null,40,pa),e.createElementVNode("text",{x:n.x,y:Math.max(15,E.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,fa)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",va,[Bt.value?(e.openBlock(),e.createElementBlock("g",ha,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Xe.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qn.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${c}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>p(n,v),onMouseleave:w},null,46,ga)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>p(n,v),onMouseleave:w},null,46,ya))],64))),128))],2),e.createElementVNode("g",Ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Po.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,ka))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.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,xa))),128)),Ke.value>0||rt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Jn.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${c}`,cx:n.x,cy:n.y,r:n.isHighlighted?ut(n,Ke.value)+2:ut(n,Ke.value),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>p(n,v),onMouseleave:w},null,46,wa))),128)):e.createCommentVNode("",!0)])])):ae.value==="line"?(e.openBlock(),e.createElementBlock("g",ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(En.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${c}`,d:n.path,stroke:n.color,"stroke-width":We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":L.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Ea))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Po.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Va))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.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,Sa))),128)),Ke.value>0||rt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(hl.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:n.x,cy:n.y,r:n.isHighlighted?ut(n,Ke.value)+2:ut(n,Ke.value),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>p(n,v),onMouseleave:w},null,46,Na))),128)):e.createCommentVNode("",!0)])):ae.value==="area"?(e.openBlock(),e.createElementBlock("g",Ma,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,(n,c)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${c}`,id:`area-mask-${c}-${z.chartId}`},[e.createElementVNode("rect",{x:E.value.left-10,y:E.value.top-10,width:E.value.width+20,height:E.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${E.value.width+20}px`})},null,12,Ta)],8,Ba))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${c}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?xt.value+.2:xt.value,mask:`url(#area-mask-${c}-${z.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,Ha))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${c}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?We.value+1:We.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:`${c*se.value}ms`})},null,14,Aa))),128))])):ae.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Xe.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qn.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${c}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>p(n,v),onMouseleave:w},null,46,La)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>p(n,v),onMouseleave:w},null,46,$a))],64))),128))],2)):e.createCommentVNode("",!0)]),ue.value&&ne.value.show&&!A.value.isZooming?(e.openBlock(),e.createElementBlock("g",Da,[e.createElementVNode("line",{x1:ne.value.x,x2:ne.value.x,y1:E.value.top,y2:E.value.bottom,stroke:$o.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Ia),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${c}`,cx:ne.value.x,cy:n.y,r:Ke.value+2,fill:n.color,stroke:"none",opacity:"0.9"},null,8,_a))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Be.value?(e.openBlock(),e.createElementBlock("g",Ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ho.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${c}`},[n?(e.openBlock(),e.createElementBlock("g",Fa,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:n.radius,fill:n.color,"fill-opacity":gl(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(Vn(n,c)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:v=>Sn(n,v),onMouseleave:v=>ol(n),onClick:v=>no(n,v)},null,42,za),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-${c} ${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:Zo(n)}),onLoad:v=>ko(c),onError:v=>Fo(c),onMouseenter:v=>Sn(n,v),onMouseleave:v=>ol(n),onClick:v=>no(n,v)},null,46,Pa)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),vt.value?(e.openBlock(),e.createElementBlock("g",Oa,[ae.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Ve.value,cy:Se.value,r:ce.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Za)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ae.value,"clip-path":Qo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oo.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${c}`,d:n.path,fill:n.color,"fill-opacity":n.isHighlighted?(n.opacity||.8)+.2:n.opacity||.8,stroke:n.strokeWidth?n.strokeColor||n.color:"none","stroke-width":n.strokeWidth||0,class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),onMouseover:v=>p(n,v),onMouseleave:w},null,42,Ua))),128))],8,Wa),$n.value&&Ie.value?(e.openBlock(),e.createElementBlock("g",qa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dn.value,(n,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${c}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label"},e.toDisplayString(n.value),9,Xa)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),_e.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":be.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${c}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${c*.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,Ya),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,ja),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":Ln.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,Ka)],6))),128))],2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Jt.value?(e.openBlock(),e.createElementBlock("g",Ga,[Je.value?(e.openBlock(),e.createElementBlock("g",Ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Et.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${c}`,cx:Ve.value,cy:Se.value,r:n,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*150}ms`})},null,12,Qa))),128)),e.createElementVNode("g",es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Et.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${c}`},[e.createElementVNode("rect",{x:Ve.value-16,y:Se.value-n-7,width:"32",height:"16",fill:"#fafafa",stroke:"none"},null,8,ts),e.createElementVNode("text",{x:Ve.value,y:Se.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Zt(c)),9,os)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ln.value,(n,c)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${c}`,x1:Ve.value,x2:n.x,y1:Se.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},null,12,ns))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${c}`,x:n.x+Math.cos(c*2*Math.PI/Wo.value-Math.PI/2)*16,y:n.y+Math.sin(c*2*Math.PI/Wo.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:`${c*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,as))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:a,onMouseleave:w},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${c}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":ll("current",n,c),stroke:n.color,"stroke-width":n.isHighlighted?We.value+1:We.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:`${c*se.value}ms`,transition:"all 0.2s ease"})},null,14,ss),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(v,f)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${c}-${f}`,cx:v.x,cy:v.y,r:n.isHighlighted?Ke.value+1:Ke.value>0?Ke.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:`${c*se.value+f*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>p(v,C),onMouseleave:w},null,46,rs))),128))]))),128))],32)])):e.createCommentVNode("",!0),e.createElementVNode("g",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${c}`,cx:n.x,cy:n.y,r:n.width/2,fill:ye(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${c}`),style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,14,cs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(n,c)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${c}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:v=>i(c),onError:v=>d(c),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${c}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,46,us))),128))])],8,Zl))]),Vt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ze.value+"px",height:je.value+"px",backgroundImage:`url('${mn.value}')`,backgroundRepeat:"no-repeat",...Hn.value,opacity:cn.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(al.value,(n,c)=>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:Ut.value+"px",height:Ut.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(v=>Qe(n),["stop"]),onMouseenter:v=>nn(n,v),onMouseleave:Tt},[e.createElementVNode("img",{src:yn(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,ms)],44,ds)),[[e.vShow,Do.value]])),128)),so.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:so.value.x+"px",top:so.value.y+"px"})},[e.createElementVNode("div",ps,e.toDisplayString(so.value.categoryValue),1),so.value.description?(e.openBlock(),e.createElementBlock("div",fs,e.toDisplayString(so.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Vo.value&&(oe.value.show||ue.value&&ne.value.show&&!A.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":ue.value&&ne.value.show&&!A.value.isZooming}]),style:e.normalizeStyle(m.value)},[!ue.value||!ne.value.show||A.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Jt.value&&oe.value.spiderSeries&&oe.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",vs,[oe.value.title?(e.openBlock(),e.createElementBlock("div",hs,e.toDisplayString(oe.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value.spiderSeries,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",gs,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",ys,e.toDisplayString(n.value),1)]))),128))])):Be.value&&oe.value.bubbleData&&oe.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Cs,[oe.value.title?(e.openBlock(),e.createElementBlock("div",ks,e.toDisplayString(oe.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value.bubbleData,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",ws,[e.createElementVNode("div",bs,e.toDisplayString(oe.value.title),1),e.createElementVNode("div",Es,e.toDisplayString(oe.value.value),1)])),oe.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[St(oe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Vs,[r[6]||(r[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ss,e.toDisplayString(e.unref(J)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(oe.value.categoryIndex).flagGroups,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${c}`},[e.createElementVNode("div",Ns,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(v,f)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${c}-${f}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Ms,[e.createElementVNode("div",Bs,e.toDisplayString(v.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),St(oe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ts,[r[7]||(r[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Hs,e.toDisplayString(e.unref(J)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(oe.value.categoryIndex).markers,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",As,[e.createElementVNode("div",Ls,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",$s,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",Ds,[e.createElementVNode("div",Is,e.toDisplayString(Be.value?yl():z.categories[ne.value.categoryIndex]||`Category ${ne.value.categoryIndex+1}`),1),Be.value?(e.openBlock(),e.createElementBlock("div",_s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ne.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Rs,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Fs,e.toDisplayString(n.value),1)]))),128))]),St(ne.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",zs,[r[8]||(r[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ps,e.toDisplayString(e.unref(J)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(ne.value.categoryIndex).flagGroups,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${c}`},[e.createElementVNode("div",Os,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(v,f)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${c}-${f}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Zs,[e.createElementVNode("div",Ws,e.toDisplayString(v.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),St(ne.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Us,[r[9]||(r[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",qs,e.toDisplayString(e.unref(J)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(ne.value.categoryIndex).markers,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Xs,[e.createElementVNode("div",Ys,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",js,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),De.value&&Pt.value&&A.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Mt},[r[10]||(r[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(A.value.scale*100))+"% "+e.toDisplayString(e.unref(J)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Hl),re.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:re.value.x+"px",top:re.value.y+"px"}),onClick:r[0]||(r[0]=e.withModifiers(()=>{},["stop"]))},[Ue.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:it},e.toDisplayString(e.unref(J)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ue.value.addMarker&&(Ue.value.downloadSvg||Ue.value.downloadPng||Ue.value.downloadCsv||Wt.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ks)):e.createCommentVNode("",!0),Ue.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Fn},e.toDisplayString(e.unref(J)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ue.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:zn},e.toDisplayString(e.unref(J)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ue.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Pn},e.toDisplayString(e.unref(J)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Wt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ue.value.downloadSvg||Ue.value.downloadPng||Ue.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Gs)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+c},[n.separator?(e.openBlock(),e.createElementBlock("div",Js)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Yt(n)),style:e.normalizeStyle(dl(n)),onClick:v=>On(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:gn(n),class:"dss-custom-menu-content"},null,8,er)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",tr,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,Qs)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),X.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:at},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:r[4]||(r[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",or,[e.createElementVNode("h3",null,e.toDisplayString(No.value?e.unref(J)("chart.modalMarker.viewMarker"):go.value?e.unref(J)("chart.modalMarker.editMarker"):e.unref(J)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:at},"×")]),e.createElementVNode("div",nr,[e.createElementVNode("div",lr,[X.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",ar,e.toDisplayString(Cn(X.value.categoryIndex)||""),1)),X.value.fromButton?(e.openBlock(),e.createElementBlock("div",sr,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":r[1]||(r[1]=n=>X.value.categoryIndex=n),class:"dss-form-select",disabled:No.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,(n,c)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${c}`,value:c},e.toDisplayString(n),9,ir))),128))],8,rr),[[e.vModelSelect,X.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",cr,[e.createElementVNode("label",ur,e.toDisplayString(e.unref(J)("chart.modalMarker.description")),1),No.value?(e.openBlock(),e.createElementBlock("div",dr,e.toDisplayString(X.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":r[2]||(r[2]=n=>X.value.description=n),placeholder:e.unref(J)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,mr)),[[e.vModelText,X.value.description]])]),e.createElementVNode("div",pr,[e.createElementVNode("label",null,e.toDisplayString(e.unref(J)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",fr,[e.createElementVNode("img",{src:yn({type:X.value.type}),alt:"Marker Icon Preview",class:"preview-icon",style:{width:"32px",height:"32px","border-radius":"50%",border:"2px solid #ddd"},onError:r[3]||(r[3]=n=>n.target.style.display="none")},null,40,vr)])])]),e.createElementVNode("div",hr,[e.createElementVNode("div",gr,[go.value&&!No.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:st},e.toDisplayString(e.unref(J)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",yr,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:at},e.toDisplayString(No.value?e.unref(J)("chart.modalMarker.close"):e.unref(J)("chart.modalMarker.cancel")),1),No.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:ml,disabled:!(X.value.description&&X.value.description.length)},e.toDisplayString(go.value?e.unref(J)("chart.modalMarker.save"):e.unref(J)("chart.contextMenu.addMarker")),9,Cr))])])])])):e.createCommentVNode("",!0)],64))}}),wr={class:"dss-modal-title"},br={class:"dss-modal-actions"},xl={__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(z,{emit:vo}){const J=z,H=vo,zt=e.ref(null),S=e.ref(null),ie=e.computed(()=>{const le={"max-width":J.width};return J.height!=="auto"&&(le.height=J.height,le["min-height"]="0"),le}),bo=e.computed(()=>({}));function Uo(){H("close-modal")}function g(){J.backDrop&&!zt.value&&H("close-modal")}function Re(le){le.target.tagName==="INPUT"&&(zt.value=le.target.tagName)}function ct(){setTimeout(()=>{zt.value=null},300)}function et(){const le=document.body,ke=document.documentElement;S.value={bodyOverflow:le.style.overflow,bodyPosition:le.style.position,bodyTop:le.style.top,bodyWidth:le.style.width,htmlOverflow:ke.style.overflow,scrollY:window.scrollY},le.style.overflow="hidden",le.style.position="fixed",le.style.top=`-${S.value.scrollY}px`,le.style.width="100%",le.style.left="0",ke.style.overflow="hidden"}function D(){if(!S.value)return;const le=document.body,ke=document.documentElement,{bodyOverflow:gt,bodyPosition:yt,bodyTop:$,bodyWidth:Ye,htmlOverflow:Ht,scrollY:Ze}=S.value;le.style.overflow=gt||"",le.style.position=yt||"",le.style.top=$||"",le.style.width=Ye||"",le.style.left="",ke.style.overflow=Ht||"",window.scrollTo(0,Ze||0)}return e.watch(()=>J.showModal,le=>{if(le)et(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ke=document.getElementById("dss-modal-backdrop");ke&&(ke.addEventListener("focusin",Re),ke.addEventListener("focusout",ct))},100);else{D(),document.body.classList.remove("dss-modal-open");const ke=document.getElementById("dss-modal-backdrop");ke&&(ke.removeEventListener("focusin",Re),ke.removeEventListener("focusout",ct))}},{immediate:!0}),e.onUnmounted(()=>{J.showModal&&D()}),(le,ke)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[z.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:g},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(ie.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ke[0]||(ke[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":z.headerType,"font-size":z.titleSize})},[e.createElementVNode("h1",wr,[e.renderSlot(le.$slots,"title",{},()=>[ke[1]||(ke[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(le.$slots,"title-data"),z.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:Uo,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(bo.value)},[e.renderSlot(le.$slots,"content",{},()=>[ke[2]||(ke[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",br,[e.renderSlot(le.$slots,"actions")])])],4),[[e.vShow,z.showModal]])])):e.createCommentVNode("",!0)]))}},Er={class:"dss-toolbar-left"},Vr=["title"],Sr=["title"],Nr={class:"dss-toolbar-dropdown-wrapper"},Mr=["title"],Br={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Tr={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Hr={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ar={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Lr={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$r={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Dr={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Ir=["title"],_r=["title"],Rr=["title"],Fr=["title"],zr=["title"],Pr=["title"],Or=["title"],Zr=["title"],Wr=["title"],Ur={key:2,class:"dss-toolbar-separator"},qr=["title"],Xr={key:4,class:"dss-toolbar-separator"},Yr={key:5,class:"dss-toolbar-dropdown-wrapper"},jr=["title"],Kr={class:"dss-toolbar-dropdown-ai"},Gr={class:"dss-toolbar-right"},Jr={key:0,class:"dss-toolbar-custom-group"},Qr={key:1,class:"dss-toolbar-separator"},ei={class:"dss-link-modal-content"},ti={class:"dss-link-modal-field"},oi={class:"dss-link-modal-label"},ni=["placeholder"],li={class:"dss-link-modal-field"},ai={class:"dss-link-modal-label"},si=["placeholder"],ri={class:"dss-image-modal-tabs"},ii={key:0,class:"dss-image-tab-content"},ci={class:"dss-link-modal-content"},ui={class:"dss-link-modal-field"},di={key:0,class:"dss-link-modal-label"},mi=["src"],pi={class:"dss-link-modal-field"},fi={class:"dss-link-modal-label"},vi=["placeholder"],hi={class:"dss-link-modal-field"},gi={class:"dss-link-modal-label"},yi=["placeholder"],Ci={class:"dss-link-modal-field"},ki={class:"dss-link-modal-label"},xi=["placeholder"],wi={key:1,class:"dss-image-tab-content"},bi={class:"dss-link-modal-content"},Ei={class:"dss-link-modal-field"},Vi={class:"dss-link-modal-label"},Si=["placeholder"],Ni={class:"dss-link-modal-field"},Mi={class:"dss-link-modal-label"},Bi=["placeholder"],Ti={class:"dss-link-modal-field"},Hi={class:"dss-link-modal-label"},Ai=["placeholder"],Li={class:"dss-link-modal-field"},$i={class:"dss-link-modal-label"},Di=["placeholder"],Ii={class:"dss-text-editor-title-input-container"},_i={key:0,class:"dss-text-editor-title-preview"},Ri={key:0},Fi={key:1,class:"dss-text-editor-preview-placeholder"},zi=["value","placeholder","disabled"],Pi={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Oi={class:"dss-text-editor-description-input-container"},Zi={key:0,class:"dss-text-editor-description-preview"},Wi={key:0},Ui={key:1,class:"dss-text-editor-preview-placeholder"},qi=["value","placeholder","disabled"],Xi={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Yi=["data-comment-id","onMouseenter"],ji=["onClick"],Ki=["src","alt"],Gi={key:1},Ji=["onClick"],Qi=["src","alt"],ec={key:1},tc=["data-has-second-user","onClick"],oc={class:"editor-comment-marker-count"},nc={key:4,class:"dss-text-editor-textarea-wrapper"},lc=["value","placeholder","rows","disabled"],ac={class:"dss-text-editor-footer"},sc={class:"dss-text-editor-footer-content"},rc={class:"dss-text-editor-footer-stat"},ic={class:"dss-text-editor-footer-stat"},cc={key:5,class:"dss-text-editor-content-wrapper"},uc={key:0,class:"dss-comment-overlay-body"},dc={class:"dss-comment-selection-wrapper"},mc=["innerHTML"],pc={class:"dss-comment-messages-wrapper"},fc={key:0,class:"dss-comment-avatar-wrapper"},vc={class:"dss-comment-avatar"},hc=["src","alt"],gc={key:1},yc={class:"dss-comment-header"},Cc={class:"dss-comment-header-text"},kc={class:"dss-comment-author"},xc={key:0,class:"dss-comment-date"},wc=["onClick","title"],bc={class:"dss-comment-overlay-inner"},Ec=["placeholder","onKeydown"],Vc={class:"dss-text-editor-footer"},Sc={class:"dss-text-editor-footer-content"},Nc={class:"dss-text-editor-footer-stat"},Mc={class:"dss-text-editor-footer-stat"},Bc=["title"],Tc=["title"],Hc={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:""},Ac={class:"dss-image-popup-content"},Lc={key:0,class:"dss-image-popup-no-alt-icon"},$c=["title"],Dc=["title"],Ic={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:""},_c={class:"dss-toolbar-left"},Rc=["title"],Fc=["title"],zc={class:"dss-toolbar-dropdown-wrapper"},Pc=["title"],Oc={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Zc={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wc={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Uc={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qc={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Xc={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Yc={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},jc=["title"],Kc=["title"],Gc=["title"],Jc=["title"],Qc=["title"],eu=["title"],tu=["title"],ou=["title"],nu=["title"],lu=["title"],au={key:2,class:"dss-toolbar-separator"},su={key:3,class:"dss-toolbar-dropdown-wrapper"},ru=["title"],iu={class:"dss-toolbar-dropdown-ai"},cu={key:0,class:"dss-toolbar-right"},uu={key:0,class:"dss-toolbar-separator"},du={key:0,class:"dss-toolbar-custom-group"},mu={key:1,class:"dss-toolbar-separator"},pu={name:"DSSTextEditor"},fu=Object.assign(pu,{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:z=>typeof z=="object"&&z!==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:z=>typeof z=="object"&&z!==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(z,{expose:vo,emit:J}){const{t:H,locale:zt}=El.useI18n(),S=z,ie=J,bo=e.useSlots(),Uo=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
73
+ `,t+="Category",I.series.forEach(f=>{const b=f.name.replace(/"/g,'""');t+=',"'+b+'"'}),t+=`
74
+ `;const r=Math.max(...I.series.map(f=>f.data?.length||0));for(let f=0;f<r;f++){let S='"'+(I.categories[f]||z("chart.fallback.item",{number:f+1})).toString().replace(/"/g,'""')+'"';I.series.forEach(T=>{const $=T.data&&T.data[f]!==void 0?T.data[f]:"";S+=","+$}),t+=S+`
75
+ `}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(l),g=document.createElement("a");g.href=c,g.download=ul("csv"),document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(c),V()}catch(t){console.error("Error downloading CSV:",t)}},Jl=t=>{if(typeof t.action=="function"){const r={series:I.series,categories:I.categories,markers:ut.value},l={chartX:Me.value.chartX,chartY:Me.value.chartY,dataX:Me.value.mouseDataX,dataY:Me.value.mouseDataY,categoryIndex:clampedCategoryIndex||Me.value.categoryIndex};t.action(r,l)}V()},dn=()=>{sn(),Q.value.show=!0,Q.value.categoryIndex=Me.value.categoryIndex,Q.value.fromButton=!1,V()},eo=()=>{sn(),Q.value.show=!0,Q.value.categoryIndex=0,Q.value.fromButton=!0},to=t=>{if(Me.value.show){const r=document.querySelector(".dss-context-menu");r&&!r.contains(t.target)&&(Me.value.show=!1)}},At=t=>{Me.value.show&&!t.target.closest(".context-menu")&&(Me.value.show=!1)},Hn=t=>{if(!St.value||!Lt.value)return;t.preventDefault(),t.stopPropagation(),P.value.isZooming=!0,me.value.show=!1,P.value.zoomTimeout&&clearTimeout(P.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),c=t.clientX-l.left,g=t.clientY-l.top;if(c<B.value.left-50||c>B.value.right+50||g<B.value.top-50||g>B.value.bottom+100){P.value.isZooming=!1;return}const f=t.deltaY>0?.9:1.1,b=Math.max(P.value.minScale,Math.min(P.value.maxScale,P.value.scale*f));if(b!==P.value.scale){const{minX:k,maxX:S}=Ze.value,T=S-k||1,$=T/P.value.scale,L=k-P.value.offsetX/B.value.width*T,j=(c-B.value.left)/B.value.width,oe=L+j*$;P.value.scale=b;const se=T/P.value.scale,q=oe-j*se;P.value.offsetX=-(q-k)/T*B.value.width,P.value.scale<=1.01&&(P.value.scale=1,P.value.offsetX=0)}P.value.zoomTimeout=setTimeout(()=>{P.value.isZooming=!1,P.value.zoomTimeout=null},300)},al=t=>{if(!St.value||!Lt.value||P.value.scale<=1)return;me.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,P.value.isDragging=!0,P.value.lastMouseX=t.clientX,P.value.lastMouseY=t.clientY,t.preventDefault()},$n=()=>{P.value.isDragging=!1},yn=()=>{!St.value||!Lt.value||(P.value.scale=1,P.value.offsetX=0,P.value.isDragging=!1,P.value.zoomTimeout&&(clearTimeout(P.value.zoomTimeout),P.value.zoomTimeout=null),P.value.isZooming=!1)},Zn=()=>!St.value||!dl.value||!Lt.value?"default":P.value.isDragging?"grabbing":P.value.scale>1?"grab":"dss-crosshair",Vn=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 r=`M ${t[0].x} ${t[0].y}`;for(let l=0;l<t.length-1;l++){const c=t[Math.max(l-1,0)],g=t[l],f=t[l+1],b=t[Math.min(l+2,t.length-1)],k=g.x+(f.x-c.x)/6*ue.value,S=g.y+(f.y-c.y)/6*ue.value,T=f.x-(b.x-g.x)/6*ue.value,$=f.y-(b.y-g.y)/6*ue.value;r+=` C ${k} ${S} ${T} ${$} ${f.x} ${f.y}`}return r},Nt=e.computed(()=>{let r=50+(Rt.value?30:0)+60;if(Ln.value)return{left:90,top:90,right:90,bottom:90};if(mn.value){let b=0;te.value&&(b+=15),Te.value&&(b+=10);const k=Zt();let S=66,T=50;return He.value&&ze.value==="left"?S+=k.legendWidth||150:He.value&&ze.value==="right"&&(T+=k.legendWidth||150),{left:S,top:50+b,right:T,bottom:130}}let l=0;te.value&&(l+=15),Te.value&&(l+=10);const c=Zt();let g=66,f=50;return He.value&&ze.value==="left"?g+=c.legendWidth||150:He.value&&ze.value==="right"&&(f+=c.legendWidth||150),He.value&&ze.value==="bottom"&&(r+=c.legendHeight||0),{left:g,top:50+l,right:f,bottom:r}}),B=e.computed(()=>({left:Nt.value.left,top:Nt.value.top,right:Re.value-Nt.value.right,bottom:lt.value-Nt.value.bottom,width:Re.value-(Nt.value.left+Nt.value.right),height:lt.value-(Nt.value.top+Nt.value.bottom)})),St=e.computed(()=>["line","area","bar"].includes(ie.value)||Ct.value),kn=e.computed(()=>Ct.value),mn=e.computed(()=>["radial","semi-radial"].includes(ie.value)),Ln=e.computed(()=>ie.value==="spider"),xt=e.computed(()=>ie.value==="bubble"),Dt=e.computed(()=>O.value?.chart?.orientation==="horizontal"&&(ie.value==="bar"||kn.value)),_n=t=>{const{minY:r,maxY:l}=Ze.value,c=l-r||1;return B.value.left+(t-r)/c*B.value.width},Gn=t=>{const{maxX:r}=Ze.value,l=r+1,g=B.value.height/l;return B.value.top+(t+.5)*g},yt=e.computed(()=>Re.value/2),kt=e.computed(()=>Ln.value?lt.value/2-40:lt.value/2),Le=e.computed(()=>{if(Ln.value){const t=B.value.width-80,r=B.value.height-80;return Math.min(t,r)/2}return Math.min(B.value.width,B.value.height)/2}),nn=e.computed(()=>{const t=O.value,r=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof r=="number"&&r>=0&&r<=1?r:.45;return Le.value*l}),ml=e.ref(0),no=e.computed(()=>`semi-radial-fill-clip-${I.chartId}`),pl=e.computed(()=>ie.value==="semi-radial"),xl=e.computed(()=>pl.value&&je.value&&!fe.value),lo=e.computed(()=>{const t=xl.value?ml.value:1,r=yt.value,l=kt.value,c=nn.value,g=Le.value,f=Math.PI,b=Math.PI+t*Math.PI;if(t<=0)return`M ${r} ${l} L ${r} ${l} Z`;const k=r+g*Math.cos(f),S=l+g*Math.sin(f),T=r+g*Math.cos(b),$=l+g*Math.sin(b),L=r+c*Math.cos(b),j=l+c*Math.sin(b),oe=r+c*Math.cos(f),se=l+c*Math.sin(f),q=t>.5?1:0;return`M ${r} ${l} L ${k} ${S} A ${g} ${g} 0 ${q} 1 ${T} ${$} L ${L} ${j} A ${c} ${c} 0 ${q} 1 ${oe} ${se} Z`}),oo=e.computed(()=>pl.value&&xl.value?`url(#${no.value})`:void 0),Qn=e.ref(0),ao=e.computed(()=>`radial-reveal-clip-${I.chartId}`),Nn=e.computed(()=>ie.value==="radial"),sl=e.computed(()=>{const t=Nn.value?Qn.value:1,r=yt.value,l=kt.value,c=Math.max(Le.value*1.5,Re.value,lt.value);if(t<=0)return`M ${r} ${l} L ${r} ${l} Z`;if(t>=1){const L=r-c,j=r+c;return`M ${L} ${l} A ${c} ${c} 0 0 1 ${j} ${l} A ${c} ${c} 0 0 1 ${L} ${l} Z`}const g=-Math.PI/2,f=g+t*Math.PI*2,b=r+c*Math.cos(g),k=l+c*Math.sin(g),S=r+c*Math.cos(f),T=l+c*Math.sin(f),$=t>=.5?1:0;return`M ${r} ${l} L ${b} ${k} A ${c} ${c} 0 ${$} 1 ${S} ${T} Z`}),El=e.computed(()=>{if(oo.value)return oo.value;if(Nn.value)return`url(#${ao.value})`});let Wn=null;const yo=()=>{if(!xl.value)return;ml.value=0;const t=Je.value,r=performance.now(),l=c=>{const g=c-r,f=Math.min(1,g/t);ml.value=K(Ke.value,f),f<1&&(Wn=requestAnimationFrame(l))};Wn=requestAnimationFrame(l)},so=e.computed(()=>O.value?.bubbles?.minSize||8),ro=e.computed(()=>O.value?.bubbles?.maxSize||50),An=e.computed(()=>O.value?.bubbles?.opacity||.7),Dn=(t,r)=>{const l=[15,20,25,18,22],c=l[t%l.length]||20,g=1+Math.sin(r*.5)*.2;return Math.max(5,c*g)},Jn=t=>{const r=document.querySelector(`.dss-bubble-image-${t}`);r&&(r.style.opacity="1")},vl=t=>{const r=document.querySelector(`.dss-bubble-image-${t}`);r&&(r.style.display="none")},Ie=e.computed(()=>I.series),qn=e.computed(()=>I.series.filter((t,r)=>!tt.value.has(r))),Rn="auto",Ze=e.computed(()=>{if(xt.value)return el();if(!qn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,r=-1/0,l=0;qn.value.forEach(k=>{k.data&&k.data.length&&(l=Math.max(l,k.data.length-1),k.data.forEach(S=>{typeof S=="number"&&(t=Math.min(t,S),r=Math.max(r,S))}))}),I.categories.length>0&&(l=Math.max(l,I.categories.length-1)),t===1/0&&(t=0,r=100);const c=cn.value,g=Jt.value;let f,b;if(c===Rn){const k=r-t,S=k>0?k*.1:1;f=Math.max(0,t-S)}else if(typeof c=="number")f=c;else{const k=r-t,S=k>0?k*.1:1;f=Math.max(0,t-S)}if(g===Rn){const k=r-t,S=k>0?k*.1:2;b=r+S}else if(typeof g=="number")b=g;else{const k=r-t,S=k>0?k*.1:2;b=r+S}return{minX:0,maxX:l,minY:f,maxY:b}}),el=()=>{if(!qn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,r=-1/0,l=1/0,c=-1/0,g=1/0,f=-1/0,b=!1;if(qn.value.forEach((oe,se)=>{oe?.data?.length&&oe.data.forEach((q,ne)=>{let J,U,ge;if(typeof q=="object"&&q!==null&&!Array.isArray(q))J=typeof q.x=="number"?q.x:ne,U=typeof q.y=="number"?q.y:0,ge=typeof q.size=="number"?q.size:20;else if(Array.isArray(q)&&q.length>=3)J=typeof q[0]=="number"?q[0]:ne,U=typeof q[1]=="number"?q[1]:0,ge=typeof q[2]=="number"?q[2]:20;else if(typeof q=="number")J=ne,U=q,ge=Dn(se,ne);else return;isFinite(J)&&isFinite(U)&&isFinite(ge)&&(t=Math.min(t,J),r=Math.max(r,J),l=Math.min(l,U),c=Math.max(c,U),g=Math.min(g,ge),f=Math.max(f,ge),b=!0)})}),!b)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===r&&(t=Math.min(t,0),r=Math.max(r,I.categories?.length-1||8)),l===c&&(l=Math.max(0,l-10),c=l+20);const k=r-t,S=c-l;let T,$,L,j;return vn.value!==null?T=vn.value:T=t-k*.1,We.value!==null?$=We.value:$=r+k*.1,cn.value!==null&&typeof cn.value=="number"?L=cn.value:L=Math.max(0,l-S*.1),Jt.value!==null&&typeof Jt.value=="number"?j=Jt.value:j=c+S*.1,{minX:T,maxX:$,minY:L,maxY:j,minSize:g,maxSize:f}},Ge=t=>{if(xt.value){const{minX:k,maxX:S}=Ze.value,T=S-k||1;return B.value.left+(t-k)/T*B.value.width}const{minX:r,maxX:l}=Ze.value,c=l-r;if(l===0||c===0)return B.value.left+B.value.width/2;const g=c/P.value.scale,f=r-P.value.offsetX/B.value.width*c,b=(t-f)/g;return B.value.left+b*B.value.width},mt=t=>{const{minY:r,maxY:l}=Ze.value,c=l-r||1;return B.value.bottom-(t-r)/c*B.value.height},rl=t=>{if(!xt.value)return rt.value||4;const{maxSize:r}=Ze.value,l=Math.max(1,r),c=Math.min(1,Math.max(0,t/l));return so.value+c*(ro.value-so.value)},ko=e.computed(()=>Rl.value.map(t=>({y:t.y}))),Dl=e.computed(()=>{if(xt.value)return fl();if(ie.value==="bar"){if(Dt.value){const ee=[],{minY:le,maxY:ce}=Ze.value,de=5,Ae=ce-le||1;for(let Fe=0;Fe<=de;Fe++){const pn=le+Ae*(Fe/de),Ot=_n(pn);ee.push({x:Ot,y:B.value.bottom+20,text:Math.round(pn).toString()})}return ee}const se=[],{maxX:q}=Ze.value,ne=q+1,J=5,ge=(B.value.width-J*2)/ne;for(let ee=0;ee<=q;ee++){const le=B.value.left+J+(ee+.5)*ge;se.push({x:le,y:B.value.bottom+20,text:I.categories[ee]||z("chart.fallback.item",{number:ee+1})})}return se}const t=[],{minX:r,maxX:l}=Ze.value,c=l-r||1,g=c/P.value.scale,f=r-P.value.offsetX/B.value.width*c,b=f+g,k=Math.max(0,Math.floor(f-2)),S=Math.min(l,Math.ceil(b+2)),T=S-k,$=B.value.width,j=Math.floor($/60);let oe=1;T>j&&(oe=Math.ceil(T/j));for(let se=k;se<=S;se+=oe)if(se>=0&&se<=l){const q=Ge(se);q>=B.value.left-100&&q<=B.value.right+100&&t.push({x:q,y:B.value.bottom+20,text:I.categories[se]||`Item ${se+1}`})}return t}),fl=()=>{const t=[],{minX:r,maxX:l}=Ze.value,c=l-r||1,g=Math.min(8,Math.max(4,Math.floor(B.value.width/80)));for(let f=0;f<=g;f++){const b=r+c*f/g,k=Ge(b);if(k>=B.value.left-10&&k<=B.value.right+10){const S=Math.round(b),T=I.categories?.[S];t.push({x:k,y:B.value.bottom+20,text:T||(Number.isInteger(b)?b.toString():b.toFixed(1))})}}return t},Rl=e.computed(()=>{if(Dt.value){const g=[],{maxX:f}=Ze.value;for(let b=0;b<=f;b++)g.push({x:B.value.left-10,y:Gn(b),text:I.categories[b]||`Item ${b+1}`});return g}const t=[],{minY:r,maxY:l}=Ze.value,c=5;for(let g=0;g<=c;g++){const f=r+(l-r)*(g/c),b=Math.round(f);t.push({x:B.value.left-10,y:mt(f),text:b.toString()})}return t}),nt=t=>{const r=qt.value;if(!r||r.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return r[t%r.length]},Vl=t=>{if(!t||typeof t!="string")return t;const r=t.trim(),l=r.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const f=Math.max(0,Math.floor(Number(l[1])*.65)),b=Math.max(0,Math.floor(Number(l[2])*.65)),k=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${f}, ${b}, ${k})`}const c=r.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(c){const f=Math.max(0,Math.floor(Number(c[1])*.65)),b=Math.max(0,Math.floor(Number(c[2])*.65)),k=Math.max(0,Math.floor(Number(c[3])*.65));return`rgba(${f}, ${b}, ${k}, ${c[4]})`}const g=r.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(g){let f=g[1];f.length===3&&(f=f[0]+f[0]+f[1]+f[1]+f[2]+f[2]);const b=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(0,2),16)*.65))),k=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(2,4),16)*.65))),S=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(4,6),16)*.65)));return`#${[b,k,S].map(T=>T.toString(16).padStart(2,"0")).join("")}`}return r},io=(t,r)=>{const c=O.value?.stroke?.color;return c==null?Vl(r):typeof c=="string"?c:Array.isArray(c)&&c.length?c[t%c.length]??Vl(r):Vl(r)},Il=t=>{let r=0;for(let l=1;l<t.length;l++){const c=t[l].x-t[l-1].x,g=t[l].y-t[l-1].y;r+=Math.sqrt(c*c+g*g)}return r},gl=e.computed(()=>ie.value==="line"||kn.value?(kn.value?I.series.filter(r=>(r.type||ie.value)==="line"):Ie.value).map((r,l)=>{const c=I.series.findIndex(L=>L===r),g=[];let f=[];r.data.forEach((L,j)=>{L==null?f.length>0&&(g.push([...f]),f=[]):f.push({x:Dt.value?_n(L):Ge(j),y:Dt.value?Gn(j):mt(L),index:j})}),f.length>0&&g.push(f);let b="";g.forEach(L=>{if(L.length>0){let j="";ot.value?j=Vn(L):j=`M ${L[0].x} ${L[0].y}`+L.slice(1).map(oe=>` L ${oe.x} ${oe.y}`).join(""),b+=(b?" ":"")+j}});const k=g.reduce((L,j)=>L+Il(j),0),S=tt.value.has(c),T=G.value===c,$=G.value!==null&&G.value!==c;return{path:b,color:nt(c),pathLength:k,seriesIndex:c,animationDelay:l*pe.value,isHighlighted:T,isDimmed:$,isHidden:S}}):[]),Nl=e.computed(()=>{if(!(ie.value==="line"||kn.value))return[];const t=kn.value?I.series.filter(l=>(l.type||ie.value)==="line"):Ie.value,r=[];return t.forEach((l,c)=>{const g=I.series.findIndex(f=>f===l);for(let f=0;f<l.data.length-1;f++){const b=l.data[f];if(b!=null){let k=-1,S=0;for(let T=f+1;T<l.data.length;T++){const $=l.data[T];if($==null)S++;else{k=T;break}}if(S>0&&k!==-1){const T=l.data[k],$=Dt.value?_n(b):Ge(f),L=Dt.value?Gn(f):mt(b),j=Dt.value?_n(T):Ge(k),oe=Dt.value?Gn(k):mt(T),se=tt.value.has(g),q=G.value===g,ne=G.value!==null&&G.value!==g;r.push({path:`M ${$} ${L} L ${j} ${oe}`,color:nt(g),seriesIndex:g,animationDelay:c*pe.value,isHighlighted:q,isDimmed:ne,isHidden:se,gapSize:S}),f=k-1}}}}),r}),Fl=e.computed(()=>ie.value==="line"||kn.value?!je.value||fe.value||W.value.hasAnimated?[]:(kn.value?I.series.filter(r=>(r.type||ie.value)==="line"):Ie.value).map((r,l)=>{const c=I.series.findIndex(S=>S===r);let g="",f=null;r.data.forEach((S,T)=>{if(S!=null){const $={x:Dt.value?_n(S):Ge(T),y:Dt.value?Gn(T):mt(S)};f===null?g+=`M ${$.x} ${$.y}`:g+=` L ${$.x} ${$.y}`,f=$}else if(f!==null){const $=r.data.findIndex((L,j)=>j>T&&L!==null&&L!==void 0);if($!==-1){const L={x:Dt.value?_n(r.data[$]):Ge($),y:Dt.value?Gn($):mt(r.data[$])};g+=` L ${L.x} ${L.y}`,f=L}}});const b=r.data.map((S,T)=>S==null?null:{x:Dt.value?_n(S):Ge(T),y:Dt.value?Gn(T):mt(S)}).filter(S=>S!==null),k=Il(b);return{path:g,pathLength:k,color:nt(c),animationDelay:l*pe.value,seriesIndex:c}}):[]),Co=e.computed(()=>{if(ie.value!=="line")return[];const t=[];return Ie.value.forEach((r,l)=>{const c=G.value===l,g=G.value!==null&&G.value!==l,f=tt.value.has(l);r.data.forEach((b,k)=>{b!=null&&t.push({x:Ge(k),y:mt(b),color:nt(l),value:b,label:I.categories[k]||k.toString(),seriesName:r.name,categoryIndex:k,dataIndex:k,animationDelay:(l*r.data.length+k)*(pe.value/8),isHighlighted:c,isDimmed:g,isHidden:f})})}),t}),co=e.computed(()=>{if(!kn.value)return[];const t=[];return I.series.filter(l=>(l.type||ie.value)==="line").forEach((l,c)=>{const g=I.series.findIndex(S=>S===l),f=G.value===g,b=G.value!==null&&G.value!==g,k=tt.value.has(g);l.data.forEach((S,T)=>{S!=null&&t.push({x:Ge(T),y:mt(S),color:nt(g),value:S,label:I.categories[T]||T.toString(),seriesName:l.name,categoryIndex:T,dataIndex:T,animationDelay:(c*l.data.length+T)*(pe.value/8),isHighlighted:f,isDimmed:b,isHidden:k})})}),t}),il=e.computed(()=>{if(!xt.value)return[];const t=[];return Ie.value.forEach((r,l)=>{if(!r?.data?.length)return;const c=G.value,g=c!==null&&c===l,f=c!==null&&c!==l,b=tt.value.has(l);r.data.forEach((k,S)=>{let T,$,L,j,oe;if(typeof k=="object"&&k!==null&&!Array.isArray(k))T=typeof k.x=="number"?k.x:S,$=typeof k.y=="number"?k.y:0,L=typeof k.size=="number"?k.size:20,j=k.label||I.categories?.[S]||`Point ${S+1}`,oe=k.image||k.imageUrl;else if(Array.isArray(k)&&k.length>=3)T=typeof k[0]=="number"?k[0]:S,$=typeof k[1]=="number"?k[1]:0,L=typeof k[2]=="number"?k[2]:20,j=k[3]||I.categories?.[S]||`Point ${S+1}`,oe=k[4];else if(typeof k=="number")T=S,$=k,L=Dn(l,S),j=I.categories?.[S]||`Point ${S+1}`;else return;!isFinite(T)||!isFinite($)||!isFinite(L)||t.push({x:Ge(T),y:mt($),radius:rl(L),originalX:T,originalY:$,originalSize:L,color:nt(l),seriesName:r.name||`Series ${l+1}`,label:j,imageUrl:oe,seriesIndex:l,dataIndex:S,categoryIndex:Math.round(T),isHighlighted:g,isDimmed:f,isHidden:b,opacity:An.value})})}),t}),Sl=e.computed(()=>ie.value!=="area"?[]:Ie.value.map((t,r)=>{const l=[];let c=[];if(t.data.forEach((L,j)=>{L==null?c.length>0&&(l.push([...c]),c=[]):c.push({x:Ge(j),y:mt(L),index:j})}),c.length>0&&l.push(c),l.length===0)return{linePath:"",areaPath:"",color:nt(r),isHidden:tt.value.has(r)};const g=B.value.bottom+1;let f="",b="";l.forEach((L,j)=>{if(L.length===0)return;let oe=`M ${L[0].x} ${L[0].y}`;ot.value&&L.length>1?oe=Vn(L):L.slice(1).forEach(q=>{oe+=` L ${q.x} ${q.y}`}),f+=(f?" ":"")+oe;let se=`M ${L[0].x} ${g}`;if(se+=` L ${L[0].x} ${L[0].y}`,ot.value&&L.length>1){const q=Vn(L),ne=q.substring(q.indexOf("C")||q.indexOf("Q")||q.indexOf("L"));ne?se+=" "+ne:L.slice(1).forEach(J=>{se+=` L ${J.x} ${J.y}`})}else L.slice(1).forEach(q=>{se+=` L ${q.x} ${q.y}`});se+=` L ${L[L.length-1].x} ${g} Z`,b+=(b?" ":"")+se});const k=G.value===r,S=G.value!==null&&G.value!==r,T=tt.value.has(r),$=l.reduce((L,j)=>L+Il(j),0);return{linePath:f,areaPath:b,color:nt(r),pathLength:$,isHighlighted:k,isDimmed:S,isHidden:T}})),uo=e.computed(()=>{if(!(["bar"].includes(ie.value)||kn.value))return[];const t=[],{maxX:r}=Ze.value,l=kn.value?I.series.filter(g=>(g.type||ie.value)==="bar"):Ie.value,c=l.length;if(Dt.value){const g=r+1,b=B.value.height/g,k=b*(2/3),S=Math.min(4,k/c*.15),T=k-(c-1)*S,$=Math.max(4,T/c);l.forEach((L,j)=>{const oe=I.series.findIndex(J=>J===L),se=G.value===oe,q=G.value!==null&&G.value!==oe,ne=tt.value.has(oe);L.data.forEach((J,U)=>{if(J==null||typeof J!="number"||!isFinite(J))return;const le=B.value.top+(U+.5)*b-k/2+j*($+S),ce=B.value.left,de=Math.abs(_n(J)-B.value.left);let Ae="";if(ot.value&&de>0){const Fe=Math.min(Ee.value,$/2,de/2);Ae=[`M ${ce} ${le}`,`L ${ce+de-Fe} ${le}`,`Q ${ce+de} ${le} ${ce+de} ${le+Fe}`,`L ${ce+de} ${le+$-Fe}`,`Q ${ce+de} ${le+$} ${ce+de-Fe} ${le+$}`,`L ${ce} ${le+$}`,"Z"].join(" ")}t.push({x:ce,y:le,width:de,height:$,color:nt(c===1?U:oe),value:J,label:I.categories[U]||U.toString(),seriesName:L.name,animationDelay:(j*l.length+U)*(pe.value/4),isHighlighted:se,isDimmed:q,isHidden:ne,barPath:Ae,isSmooth:ot.value&&de>0})})})}else{const g=r+1,b=B.value.width/g,k=b*.8,S=k/c,T=S*.05,$=S-T;l.forEach((L,j)=>{const oe=I.series.findIndex(J=>J===L),se=G.value===oe,q=G.value!==null&&G.value!==oe,ne=tt.value.has(oe);L.data.forEach((J,U)=>{if(J==null||typeof J!="number"||!isFinite(J))return;const le=B.value.left+(U+.5)*b-k/2+j*S+T/2,ce=mt(Math.max(0,J)),de=Math.abs(mt(0)-mt(J));let Ae="";if(ot.value&&de>0){const Fe=Math.min(Ee.value,$/2,de/2);Ae=[`M ${le} ${ce+de}`,`L ${le} ${ce+Fe}`,`Q ${le} ${ce} ${le+Fe} ${ce}`,`L ${le+$-Fe} ${ce}`,`Q ${le+$} ${ce} ${le+$} ${ce+Fe}`,`L ${le+$} ${ce+de}`,"Z"].join(" ")}t.push({x:le,y:ce,width:$,height:de,color:nt(c===1?U:oe),value:J,label:I.categories[U]||U.toString(),seriesName:L.name,animationDelay:(j*l.length+U)*(pe.value/4),isHighlighted:se,isDimmed:q,isHidden:ne,barPath:Ae,isSmooth:ot.value&&de>0})})})}return t}),hl=e.computed(()=>{if(!mn.value)return[];const t=Ie.value.map((f,b)=>({series:f,originalIndex:b})).filter(({originalIndex:f})=>!tt.value.has(f));if(t.length===0)return[];let r=ie.value==="semi-radial"?Math.PI:-Math.PI/2;const l=ie.value==="semi-radial"?Math.PI:Math.PI*2,c=[];if(t.length===1){const{series:f,originalIndex:b}=t[0],k=f.data[0]||0,S=r,T=r+l-.001,$=S+l/2,L=yt.value+Math.cos(S)*nn.value,j=kt.value+Math.sin(S)*nn.value,oe=yt.value+Math.cos(T)*nn.value,se=kt.value+Math.sin(T)*nn.value,q=yt.value+Math.cos(T)*Le.value,ne=kt.value+Math.sin(T)*Le.value,J=yt.value+Math.cos(S)*Le.value,U=kt.value+Math.sin(S)*Le.value,ge=1,ee=[`M ${L} ${j}`,`A ${nn.value} ${nn.value} 0 ${ge} 1 ${oe} ${se}`,`L ${q} ${ne}`,`A ${Le.value} ${Le.value} 0 ${ge} 0 ${J} ${U}`,"Z"].join(" "),le=nt(b);return c.push({path:ee,color:le,strokeWidth:Xe.value,strokeColor:io(0,le),value:k,seriesName:f.name,opacity:.8,isHighlighted:G.value===b,isDimmed:!1,isHidden:!1,startAngle:S,endAngle:T,midAngle:$}),c}const g=t.reduce((f,{series:b})=>f+(b.data[0]||0),0);return g===0?[]:(t.forEach(({series:f,originalIndex:b})=>{const k=f.data[0]||0,S=k/g*l,T=r,$=r+S,L=T+S/2,j=yt.value+Math.cos(T)*nn.value,oe=kt.value+Math.sin(T)*nn.value,se=yt.value+Math.cos($)*nn.value,q=kt.value+Math.sin($)*nn.value,ne=yt.value+Math.cos($)*Le.value,J=kt.value+Math.sin($)*Le.value,U=yt.value+Math.cos(T)*Le.value,ge=kt.value+Math.sin(T)*Le.value,ee=S>Math.PI?1:0,le=[`M ${j} ${oe}`,`A ${nn.value} ${nn.value} 0 ${ee} 1 ${se} ${q}`,`L ${ne} ${J}`,`A ${Le.value} ${Le.value} 0 ${ee} 0 ${U} ${ge}`,"Z"].join(" "),ce=nt(b);c.push({path:le,color:ce,strokeWidth:Xe.value,strokeColor:io(c.length,ce),value:k,seriesName:f.name,opacity:.8,isHighlighted:G.value===b,isDimmed:G.value!==null&&G.value!==b,isHidden:!1,startAngle:T,endAngle:$,midAngle:L}),r=$}),c)}),mo=e.computed(()=>!ll.value||!mn.value?[]:hl.value.map((t,r)=>{if(t.isHidden)return null;const l=Mn.value,c=dt.value,g=un.value,f=yt.value+Math.cos(t.midAngle)*Le.value,b=kt.value+Math.sin(t.midAngle)*Le.value,k=yt.value+Math.cos(t.midAngle)*(Le.value+l),S=kt.value+Math.sin(t.midAngle)*(Le.value+l),T=Math.cos(t.midAngle)>=0,L=k+c*(T?1:-1),j=S,oe=T?k+15:k-15,se=j-g,q=T?"start":"end",ne=Math.hypot(k-f,S-b),J=Math.hypot(L-k,j-S);return{pointerStartX:f,pointerStartY:b,pointerEndX:k,pointerEndY:S,horizontalEndX:L,horizontalEndY:j,textX:oe,textY:se,text:`${t.seriesName}: ${t.value}`,color:t.color,textAnchor:q,isRightSide:T,isHighlighted:t.isHighlighted,isDimmed:t.isDimmed,pointerLineLength:ne,horizontalLineLength:J}}).filter(Boolean)),bo=t=>{if(!t||t.isHidden)return 0;const r=t.opacity||An.value||.7;return G.value===null||G.value===void 0?r:G.value!==null?t.seriesIndex===G.value?Math.min(1,r+.1):Math.max(.5,r*.8):r},yl=t=>{if(!t||t.isHidden)return 0;const r=t.radius>20?.9:.8;return G.value!==null?t.seriesIndex===G.value?Math.min(1,r+.1):r*.7:r},In=(t,r)=>{if(t)try{if(G.value===t.seriesIndex?G.value=null:G.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:r,chartId:I.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},zl=(t,r)=>{const l=[`dss-bubble-fallback-${r}`];return t.isHighlighted&&l.push("dss-bubble-highlighted"),t.isDimmed&&l.push("dss-bubble-dimmed"),t.isHidden&&l.push("dss-bubble-hidden"),l.push(`dss-bubble-series-${t.seriesIndex}`),l.join(" ")},Pl=(t,r)=>{if(!t||(r.stopPropagation(),x.value=!0,G.value=t.seriesIndex,me.value.show=!1,!bn.value))return;const l=r.target.closest(".dss-custom-chart-container");if(!l)return;const c=l.getBoundingClientRect();let g=r.clientX-c.left+10,f=r.clientY-c.top-10;const b=200,k=120;g+b>Re.value&&(g=r.clientX-c.left-b-10),f+k>c.height&&(f=r.clientY-c.top-k-10),g<0&&(g=10),f<0&&(f=10);const S=xn.value,T=Yt.value,$=S.map(L=>{const j=T[L]||L,oe=po(L,t);return oe?{seriesName:t.seriesName,label:t.label,value:`${j}: ${oe}`,color:t.color}:null}).filter(Boolean);ve.value={show:!0,x:g,y:f,title:t.label||t.seriesName||"",value:"",bubbleData:$,categoryIndex:void 0,spiderSeries:[]}},po=(t,r)=>{let l;switch(t){case"x":l=r.originalX;break;case"y":l=r.originalY;break;case"size":l=r.originalSize;break;case"label":l=r.label;break;case"seriesName":l=r.seriesName;break;default:l=r[t]||""}const c=$l.value[t];return typeof c=="function"?c(l,r):typeof l=="number"?l.toFixed(1):l?.toString()||""},wo=()=>{if(!xt.value||!me.value.data||me.value.data.length===0)return"Bubbles";const t=[],r=new Set;return me.value.data.forEach(l=>{if(l.seriesName&&l.label){const c=`${l.seriesName} - ${l.label}`;r.has(c)||(t.push(c),r.add(c))}else l.seriesName&&(r.has(l.seriesName)||(t.push(l.seriesName),r.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},vo=(t,r)=>{t&&(x.value=!1,G.value=null,ve.value.show=!1,ve.value.bubbleData=[])},Ml=(t,r)=>{const l=r.target.closest(".dss-custom-chart-container");if(!l)return;const c=l.getBoundingClientRect(),g=zt(t.categoryIndex),f=t.description||t.comment||"";let b=r.clientX-c.left+15,k=r.clientY-c.top-10;const S=200,T=f?80:50;b+S>Re.value&&(b=r.clientX-c.left-S-15),k+T>lt.value&&(k=r.clientY-c.top-T-10),b<0&&(b=10),k<0&&(k=10),gn.value={show:!0,x:b,y:k,categoryValue:g,description:f}},Cn=()=>{gn.value.show=!1},kl=e.computed(()=>I.categories.length||Math.max(...qn.value.map(t=>t.data.length))),tl=e.computed(()=>{let t=0;return qn.value.forEach(r=>{r.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),Bl=e.computed(()=>{const t=[],r=kl.value;for(let l=0;l<r;l++){const c=l*2*Math.PI/r-Math.PI/2,g=yt.value+Math.cos(c)*Le.value,f=kt.value+Math.sin(c)*Le.value;t.push({x:g,y:f,angle:c,index:l})}return t}),xo=e.computed(()=>{const t=[],r=kl.value;return Bl.value.forEach((l,c)=>{const g=Le.value+15,f=c*2*Math.PI/r-Math.PI/2,b=yt.value+Math.cos(f)*g,k=kt.value+Math.sin(f)*g+5;let S="middle",T="middle";Math.abs(Math.cos(f))>.5&&(S=Math.cos(f)>0?"start":"end"),Math.abs(Math.sin(f))>.5&&(T=Math.sin(f)>0?"hanging":"auto"),t.push({x:b,y:k,text:I.categories[c]||`Axis ${c+1}`,anchor:S,baseline:T})}),t}),fo=e.ref(new Set),go=(t,r,l)=>{const c=`current-${l}`,g=fo.value.has(c);return!g&&G.value===null?r.fillOpacity||Be.value:r.isHighlighted||g?(r.fillOpacity||Be.value)+.15:r.isDimmed?(r.fillOpacity||Be.value)*.3:r.fillOpacity||Be.value},o=e.computed(()=>{if(!Ln.value)return[];const t=[],r=kl.value;return Ie.value.forEach((l,c)=>{const g=[],f=[],b=[],k=G.value===c,S=G.value!==null&&G.value!==c,T=tt.value.has(c);for(let $=0;$<r;$++){const L=l.data[$]||0,oe=L/tl.value*Le.value,se=$*2*Math.PI/r-Math.PI/2,q=yt.value+Math.cos(se)*oe,ne=kt.value+Math.sin(se)*oe;g.push(`${q},${ne}`),f.push({x:q,y:ne}),b.push({x:q,y:ne,value:L,label:I.categories[$]||`Axis ${$+1}`,seriesName:l.name})}t.push({points:g.join(" "),polygonPoints:f,dataPoints:b,color:nt(c),fillOpacity:Be.value,seriesName:l.name,value:`${l.name}: ${l.data.join(", ")}`,isHighlighted:k,isDimmed:S,isHidden:T,seriesIndex:c})}),t}),n=(t,r)=>{if(!r||r.length<3)return!1;let l=!1;for(let c=0,g=r.length-1;c<r.length;g=c++){const f=r[c].x,b=r[c].y,k=r[g].x,S=r[g].y;b>t.y!=S>t.y&&t.x<(k-f)*(t.y-b)/(S-b)+f&&(l=!l)}return l},a=t=>{if(!Ln.value)return;const r=t.currentTarget.closest(".dss-custom-chart-container");if(!r)return;const l=r.getBoundingClientRect(),c=ke.value?.getBoundingClientRect();if(!c)return;const g=t.clientX-c.left,f=t.clientY-c.top,b=o.value.filter(k=>k.isHidden?!1:n({x:g,y:f},k.polygonPoints));if(b.length>0){b.length,G.value=b[0].seriesIndex;const k=t.clientX-l.left+10,S=t.clientY-l.top-10,T=200,$=50+b.length*25;let L=k,j=S;L+T>Re.value&&(L=t.clientX-l.left-T-10),j+$>lt.value&&(j=t.clientY-l.top-$-10),L<0&&(L=10),j<0&&(j=10);const oe=b.map(se=>{let q=se.dataPoints[0],ne=1/0;return se.dataPoints.forEach(J=>{const U=Math.sqrt(Math.pow(J.x-g,2)+Math.pow(J.y-f,2));U<ne&&(ne=U,q=J)}),{seriesName:se.seriesName,color:se.color,value:q.value!==void 0?q.value:se.value}});ve.value={show:!0,x:L,y:j,title:b.length===1?b[0].seriesName:"",value:"",bubbleData:[],spiderSeries:oe}}else E()},s=e.computed(()=>{const t=O.value;return t.logos.map((r,l)=>{const c=I.series[r.seriesIndex];if(!c||!c.data||c.data.length===0||tt.value.has(r.seriesIndex))return null;let g,f;if(St.value){let k=-1,S=null;for(let $=c.data.length-1;$>=0;$--)if(c.data[$]!==null&&c.data[$]!==void 0){k=$,S=c.data[$];break}if(k===-1||S===null)return null;const T=c.data.map(($,L)=>$==null?null:{x:Ge(L),y:mt($),index:L}).filter($=>$!==null);if(t.animations.enabled&&!fe.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(W.value.isAnimating||!W.value.hasAnimated))if(W.value.isAnimating){const $=W.value.currentFrame/W.value.totalFrames,L=K(t.animations.easing,Math.min($,1)),j=Eo(T,L);g=j.x+(r.offsetX||0),f=j.y+(r.offsetY||0)}else g=T[0].x+(r.offsetX||0),f=T[0].y+(r.offsetY||0);else g=Ge(k)+(r.offsetX||0),f=mt(S)+(r.offsetY||0)}else if(mn.value||Ln.value){const k=Math.PI*2/t.logos.length*l;g=yt.value+Math.cos(k)*(Le.value+30)+(r.offsetX||0),f=kt.value+Math.sin(k)*(Le.value+30)+(r.offsetY||0)}return{...r,x:g,y:f,seriesIndex:r.seriesIndex}}).filter(Boolean)}),i=t=>{const r=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);r&&(r.style.opacity="0"),l&&(l.style.opacity="1")},u=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const r=document.querySelector(`.dss-logo-image-${t}`);r&&(r.style.display="none")},d=t=>{tt.value.has(t)?tt.value.delete(t):tt.value.add(t)},m=e.computed(()=>{if(!ve.value.show&&!(Ne.value&&me.value.show&&!P.value.isZooming))return{display:"none"};let t,r;if(Ne.value&&me.value.show&&!P.value.isZooming){t=me.value.x+15,r=B.value.top;const l=xt.value?200:150;t+l>Re.value&&(t=me.value.x-l-15),t<0&&(t=10),r<10&&(r=10)}else t=ve.value.x,r=ve.value.y;return{left:t+"px",top:r+"px"}}),p=(t,r)=>{if(!bn.value||w.value)return;const c=r.target.closest(".dss-custom-chart-container").getBoundingClientRect();let g=r.clientX-c.left+10,f=r.clientY-c.top-10;const b=200,k=120,S=Re.value,T=lt.value;g+b>S&&(g=r.clientX-c.left-b-10),f+k>T&&(f=r.clientY-c.top-k-10),g<0&&(g=10),f<0&&(f=10);let $;typeof t.categoryIndex=="number"?$=t.categoryIndex:typeof t.dataIndex=="number"?$=t.dataIndex:t.label&&I.categories.includes(t.label)&&($=I.categories.indexOf(t.label));const L=(Dt.value||ie.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";ve.value={show:!0,x:g,y:f,title:L,value:t.value?.toString()||"",categoryIndex:$,spiderSeries:[]}},h=e.ref(!1),x=e.ref(!1),E=()=>{ve.value.show=!1,ve.value.spiderSeries=[],ve.value.bubbleData=[],me.value.show=!1,h.value||(G.value=null)},w=e.ref(!1),F=(t,r)=>{w.value=!0,ve.value.show=!1,me.value.show=!1;const c=r.target.closest(".dss-custom-chart-container").getBoundingClientRect();let g=r.clientX-c.left+15,f=r.clientY-c.top-10;const b=250;g+b>Re.value&&(g=r.clientX-c.left-b-15),g<0&&(g=10),f<0&&(f=10),On.value={show:!0,x:g,y:f,content:t.texts,count:t.totalCount}},A=()=>{w.value=!1,On.value.show=!1},W=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),K=(t,r)=>{switch(t){case"linear":return r;case"ease":return r<.5?2*r*r:-1+(4-2*r)*r;case"ease-in":return r*r;case"ease-out":return r*(2-r);case"ease-in-out":return r<.5?2*r*r:-1+(4-2*r)*r;default:return r}},fe=e.computed(()=>Tt.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Ht=()=>{if(!je.value||fe.value){W.value.hasAnimated=!0,Nn.value&&(Qn.value=1);return}Nn.value&&(Qn.value=0),W.value.isAnimating=!0,W.value.currentFrame=0,W.value.totalFrames=Math.ceil(Je.value/16.67);const t=()=>{const r=W.value.currentFrame/W.value.totalFrames,l=K(Ke.value,Math.min(r,1));$t(l),Nn.value&&(Qn.value=l),r<1?(W.value.currentFrame++,W.value.animationId=requestAnimationFrame(t)):Et()};W.value.animationId=requestAnimationFrame(t)},$t=t=>{const r=document.querySelector(".dss-custom-chart-container");r&&r.style.setProperty("--dss-animation-progress",t)},Et=()=>{W.value.isAnimating=!1,W.value.hasAnimated=!0,Nn.value&&(Qn.value=1),W.value.animationId&&(cancelAnimationFrame(W.value.animationId),W.value.animationId=null)},Mt=e.computed(()=>!mn.value||W.value.hasAnimated?!0:Nn.value?Qn.value>=1:pl.value?ml.value>=1:!0),Bt=e.computed(()=>ll.value&&Mt.value),pt=e.ref(!1);e.watch(Bt,t=>{t?(pt.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{pt.value=!0})})):pt.value=!1},{immediate:!0});const Sn=e.computed(()=>{if(!je.value||fe.value||W.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Je.value}ms`,t["--dss-animation-easing"]=Un(Ke.value),t["--dss-stagger-delay"]=`${pe.value}ms`,t}),Un=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Xn=()=>{if(!je.value||fe.value)return"";const t=["dss-chart-animated"];return W.value.hasAnimated||t.push(`dss-animate-${Ft.value}`),W.value.hasAnimated||(mn.value&&ie.value!=="semi-radial"?t.push("dss-animate-fill"):mn.value||t.push(`dss-animate-${Ft.value}`)),W.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>I.series,(t,r)=>{$e.value&&r&&W.value.hasAnimated&&(W.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Ht(),et.value)}))},{deep:!0}),e.watch(()=>P.value.isZooming,(t,r)=>{r&&!t&&setTimeout(()=>{wl()},50)}),e.watch(()=>[P.value.scale,P.value.offsetX],()=>{!P.value.isZooming&&!P.value.isDragging&&wl()},{flush:"post"}),e.watch([ln,nl],([t,r])=>{P.value.minScale=t,P.value.maxScale=r,(P.value.scale<t||P.value.scale>r)&&yn()},{immediate:!0}),e.watch(()=>I.locale,t=>{t&&t!==R.value&&(R.value=t)},{immediate:!0}),e.watch(()=>Me.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",At)}):document.removeEventListener("click",At)}),e.onMounted(()=>{G.value=null,Nn.value&&(!je.value||fe.value)&&(Qn.value=1),ho(),N.value&&typeof ResizeObserver<"u"&&(Ce=new ResizeObserver(t=>{const r=t[0];if(!r||!r.contentRect)return;const{width:l,height:c}=r.contentRect;vt.value=Math.round(l),v.value=Math.round(c),Qe.value&&(Oe.value=Qe.value.offsetHeight||_e)}),Ce.observe(N.value)),je.value&&!fe.value?ie.value==="semi-radial"?setTimeout(()=>yo(),et.value):setTimeout(()=>Ht(),et.value):(W.value.hasAnimated=!0,ie.value==="semi-radial"&&(ml.value=1)),document.addEventListener("mousemove",Ol),document.addEventListener("mouseup",Zl),document.addEventListener("click",to)}),e.onUnmounted(()=>{Ce&&N.value&&(Ce.unobserve(N.value),Ce.disconnect(),Ce=null),W.value.animationId&&cancelAnimationFrame(W.value.animationId),Wn&&(cancelAnimationFrame(Wn),Wn=null),P.value.zoomTimeout&&clearTimeout(P.value.zoomTimeout),document.removeEventListener("mousemove",Ol),document.removeEventListener("mouseup",Zl),document.removeEventListener("click",to),document.removeEventListener("click",At)});const Ol=t=>{if(P.value.isDragging&&P.value.scale>1&&St.value){me.value.show=!1;const r=t.clientX-P.value.lastMouseX,{minX:l,maxX:c}=Ze.value,g=c-l||1,b=r*.8;P.value.offsetX+=b;const k=g/P.value.scale,S=g-k,T=0,$=-S/g*B.value.width,L=T;P.value.offsetX=Math.max($,Math.min(L,P.value.offsetX)),P.value.lastMouseX=t.clientX,P.value.lastMouseY=t.clientY}},Zl=()=>{P.value.isDragging&&(P.value.isDragging=!1,setTimeout(()=>{!P.value.isDragging&&P.value.isZooming},100))},Eo=(t,r)=>{const l=t.filter(k=>k!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||r<=0)return l[0];if(r>=1)return l[l.length-1];let c=0;const g=[];for(let k=1;k<l.length;k++){const S=l[k].x-l[k-1].x,T=l[k].y-l[k-1].y,$=Math.sqrt(S*S+T*T);g.push($),c+=$}const f=c*r;let b=0;for(let k=0;k<g.length;k++){const S=b+g[k];if(f<=S){const T=(f-b)/g[k],$=l[k],L=l[k+1];return{x:$.x+(L.x-$.x)*T,y:$.y+(L.y-$.y)*T}}b=S}return l[l.length-1]};return(t,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[Xn(),{"dss-chart-fill-width":ft.value,"dss-chart-fill-height":Wt.value}]]),style:e.normalizeStyle({width:ft.value?"100%":Re.value+"px",height:Wt.value?"100%":lt.value+20+"px",...Sn.value,cursor:Zn()}),"data-chart-type":ie.value,ref_key:"containerEl",ref:N,onWheel:Hn,onMousedown:al,onMousemove:Kn,onMouseup:$n,onMouseleave:C,onDblclick:yn,onContextmenu:e.withModifiers(y,["prevent"]),onClick:e.withModifiers(V,["left"]),onWheelCapture:Hn},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:Qe},[e.createElementVNode("div",Ao,[te.value?(e.openBlock(),e.createElementBlock("div",Do,e.toDisplayString(te.value),1)):e.createCommentVNode("",!0),Te.value?(e.openBlock(),e.createElementBlock("div",Ro,e.toDisplayString(Te.value),1)):e.createCommentVNode("",!0)]),He.value&&(ze.value==="top"||ze.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":en.value==="horizontal","dss-legend-vertical":en.value==="vertical","dss-legend-top":ze.value==="top","dss-legend-bottom":ze.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.series,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":tt.value.has(c),"dss-legend-hovered":G.value===c,"dss-legend-dimmed":G.value!==null&&G.value!==c}]),onClick:g=>d(c),onMouseenter:g=>wt(c),onMouseleave:an,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:nt(c)})},null,4),e.createElementVNode("span",Fo,e.toDisplayString(l.name),1)],46,Io))),128))],2)):e.createCommentVNode("",!0),He.value&&(ze.value==="left"||ze.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":ze.value==="left","dss-legend-right":ze.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.series,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":tt.value.has(c),"dss-legend-hovered":G.value===c,"dss-legend-dimmed":G.value!==null&&G.value!==c}]),onClick:g=>d(c),onMouseenter:g=>wt(c),onMouseleave:an,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:nt(c)})},null,4),e.createElementVNode("span",Po,e.toDisplayString(l.name),1)],46,zo))),128))],2)):e.createCommentVNode("",!0)],512),Z.showAddMarkerButton&&st.value.addMarker&&(St.value||xt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:eo,title:e.unref(z)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:ct.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,Zo),r[5]||(r[5]=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,Oo)):e.createCommentVNode("",!0),e.createElementVNode("div",Wo,[xt.value&&jn.value?(e.openBlock(),e.createElementBlock("div",qo,"Bubble size: "+e.toDisplayString(jn.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Re.value,height:lt.value,class:"dss-chart-svg","data-smooth":ot.value,"data-animated":je.value,ref_key:"svgEl",ref:ke},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",Xo,[e.createElementVNode("rect",{x:B.value.left,y:B.value.top,width:B.value.width,height:B.value.height*4},null,8,Yo)]),pl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:no.value},[e.createElementVNode("path",{d:lo.value},null,8,Ko)],8,jo)):e.createCommentVNode("",!0),Nn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:ao.value},[e.createElementVNode("path",{d:sl.value},null,8,Qo)],8,Go)):e.createCommentVNode("",!0)]),St.value||xt.value?(e.openBlock(),e.createElementBlock("g",Jo,[qe.value?(e.openBlock(),e.createElementBlock("g",ea,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ko.value,(l,c)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${c}`,x1:B.value.left,x2:B.value.right,y1:l.y,y2:l.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${c*50}ms`})},null,12,ta))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",na,[e.createElementVNode("line",{x1:B.value.left,x2:B.value.right,y1:B.value.bottom,y2:B.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,la),e.createElementVNode("line",{x1:B.value.left,x2:B.value.left,y1:B.value.top,y2:B.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,oa)]),e.createElementVNode("g",aa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dl.value,(l,c)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${c}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},e.toDisplayString(l.text),13,sa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl.value,(l,c)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${c}`,x:l.x,y:l.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${c*80}ms`})},e.toDisplayString(l.text),13,ra))),128)),Rt.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:B.value.left+B.value.width/2,y:B.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Rt.value),9,ia)):e.createCommentVNode("",!0),Qt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:B.value.top+12+B.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${B.value.top+B.value.height/2})`},e.toDisplayString(Qt.value),9,ca)):e.createCommentVNode("",!0)]),ol.value.length>0?(e.openBlock(),e.createElementBlock("g",da,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ol.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",ua,[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:B.value.bottom,y2:B.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>F(l,c),onMouseleave:A},null,40,ma)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:B.value.bottom,y2:B.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>F(l,c),onMouseleave:A},null,40,pa)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:B.value.bottom,y2:B.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>F(l,c),onMouseleave:A},null,40,va)):e.createCommentVNode("",!0)]),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,B.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:c=>F(l,c),onMouseleave:A},null,40,fa)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,B.value.top-10),r:"14",fill:l.hasManual&&l.hasAuto||l.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:c=>F(l,c),onMouseleave:A},null,40,ga),e.createElementVNode("text",{x:l.x,y:Math.max(15,B.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(l.totalCount),9,ha)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ya,[kn.value?(e.openBlock(),e.createElementBlock("g",ka,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Dt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(uo.value,(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${c}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:g=>p(l,g),onMouseleave:E},null,46,Ca)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:g=>p(l,g),onMouseleave:E},null,46,ba))],64))),128))],2),e.createElementVNode("g",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gl.value,(l,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${c}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ue.value+2:Ue.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,xa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nl.value,(l,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${c}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ue.value+2:Ue.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Ea))),128)),rt.value>0||It.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(co.value,(l,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${c}`,cx:l.x,cy:l.y,r:l.isHighlighted?_t(l,rt.value)+2:_t(l,rt.value),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:g=>p(l,g),onMouseleave:E},null,46,Va))),128)):e.createCommentVNode("",!0)])])):ie.value==="line"?(e.openBlock(),e.createElementBlock("g",Na,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fl.value,(l,c)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${c}`,d:l.path,stroke:l.color,"stroke-width":Ue.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":W.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Sa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gl.value,(l,c)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${c}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ue.value+2:Ue.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Ma))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nl.value,(l,c)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${c}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ue.value+2:Ue.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Ba))),128)),rt.value>0||It.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Co.value,(l,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:l.x,cy:l.y,r:l.isHighlighted?_t(l,rt.value)+2:_t(l,rt.value),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:g=>p(l,g),onMouseleave:E},null,46,Ta))),128)):e.createCommentVNode("",!0)])):ie.value==="area"?(e.openBlock(),e.createElementBlock("g",Ha,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Sl.value,(l,c)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${c}`,id:`area-mask-${c}-${Z.chartId}`},[e.createElementVNode("rect",{x:B.value.left-10,y:B.value.top-10,width:B.value.width+20,height:B.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${B.value.width+20}px`})},null,12,La)],8,$a))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Sl.value,(l,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${c}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?Ye.value+.2:Ye.value,mask:`url(#area-mask-${c}-${Z.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden})},null,10,_a))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Sl.value,(l,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${c}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?Ue.value+1:Ue.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${c*pe.value}ms`})},null,14,Aa))),128))])):ie.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Dt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(uo.value,(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${c}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:g=>p(l,g),onMouseleave:E},null,46,Da)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:g=>p(l,g),onMouseleave:E},null,46,Ra))],64))),128))],2)):e.createCommentVNode("",!0)]),Ne.value&&me.value.show&&!P.value.isZooming?(e.openBlock(),e.createElementBlock("g",Ia,[e.createElementVNode("line",{x1:me.value.x,x2:me.value.x,y1:B.value.top,y2:B.value.bottom,stroke:fn.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Fa),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value.data,(l,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${c}`,cx:me.value.x,cy:l.y,r:rt.value+2,fill:l.color,stroke:"none",opacity:"0.9"},null,8,za))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),xt.value?(e.openBlock(),e.createElementBlock("g",Pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(il.value,(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${c}`},[l?(e.openBlock(),e.createElementBlock("g",Oa,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:l.radius,fill:l.color,"fill-opacity":bo(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(zl(l,c)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:g=>Pl(l,g),onMouseleave:g=>vo(l),onClick:g=>In(l,g)},null,42,Za),l.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:l.x-l.radius*.65,y:l.y-l.radius*.65,width:l.radius*1.3,height:l.radius*1.3,"xlink:href":l.imageUrl,class:e.normalizeClass(`dss-bubble-image-${c} ${l.isHighlighted?"dss-bubble-highlighted":""} ${l.isDimmed?"dss-bubble-dimmed":""} ${l.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${l.radius*.65}px at ${l.radius*.65}px ${l.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:yl(l)}),onLoad:g=>Jn(c),onError:g=>vl(c),onMouseenter:g=>Pl(l,g),onMouseleave:g=>vo(l),onClick:g=>In(l,g)},null,46,Wa)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),mn.value?(e.openBlock(),e.createElementBlock("g",qa,[ie.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:yt.value,cy:kt.value,r:Le.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Ua)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ie.value,"clip-path":El.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hl.value,(l,c)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${c}`,d:l.path,fill:l.color,"fill-opacity":l.isHighlighted?(l.opacity||.8)+.2:l.opacity||.8,stroke:l.strokeWidth?l.strokeColor||l.color:"none","stroke-width":l.strokeWidth||0,class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),onMouseover:g=>p(l,g),onMouseleave:E},null,42,Ya))),128))],8,Xa),wn.value&&Mt.value?(e.openBlock(),e.createElementBlock("g",ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bl.value,(l,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${c}`,x:l.x,y:l.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label"},e.toDisplayString(l.value),9,Ka)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),Bt.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":pt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mo.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${c}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":l.isHighlighted,"dss-label-dimmed":l.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${c*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:l.pointerStartX,y1:l.pointerStartY,x2:l.pointerEndX,y2:l.pointerEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.pointerLineLength})},null,12,Ga),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:l.pointerEndX,y1:l.pointerEndY,x2:l.horizontalEndX,y2:l.horizontalEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.horizontalLineLength})},null,12,Qa),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":Cl.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,Ja)],6))),128))],2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ln.value?(e.openBlock(),e.createElementBlock("g",es,[qe.value?(e.openBlock(),e.createElementBlock("g",ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,(l,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${c}`,cx:yt.value,cy:kt.value,r:l,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*150}ms`})},null,12,ns))),128)),e.createElementVNode("g",ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${c}`},[e.createElementVNode("rect",{x:yt.value-16,y:kt.value-l-7,width:"32",height:"16",fill:"#fafafa",stroke:"none"},null,8,os),e.createElementVNode("text",{x:yt.value,y:kt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(ht(c)),9,as)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bl.value,(l,c)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${c}`,x1:yt.value,x2:l.x,y1:kt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},null,12,ss))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(l,c)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${c}`,x:l.x+Math.cos(c*2*Math.PI/kl.value-Math.PI/2)*16,y:l.y+Math.sin(c*2*Math.PI/kl.value-Math.PI/2)*16,"text-anchor":l.anchor,"dominant-baseline":l.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${c*120}ms`})},e.toDisplayString(l.text.charAt(0).toUpperCase()+l.text.slice(1)),13,is))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:a,onMouseleave:E},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${c}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":go("current",l,c),stroke:l.color,"stroke-width":l.isHighlighted?Ue.value+1:Ue.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${c*pe.value}ms`,transition:"all 0.2s ease"})},null,14,cs),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dataPoints,(g,f)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${c}-${f}`,cx:g.x,cy:g.y,r:l.isHighlighted?rt.value+1:rt.value>0?rt.value:0,fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${c*pe.value+f*50}ms`,transition:"all 0.2s ease"}),onMouseover:b=>p(g,b),onMouseleave:E},null,46,ds))),128))]))),128))],32)])):e.createCommentVNode("",!0),e.createElementVNode("g",us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(l,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${c}`,cx:l.x,cy:l.y,r:l.width/2,fill:nt(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${c}`),style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,14,ms))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(l,c)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${c}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:g=>i(c),onError:g=>u(c),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${c}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,46,ps))),128))])],8,Uo))]),ae.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Re.value+"px",height:lt.value+"px",backgroundImage:`url('${cl.value}')`,backgroundRepeat:"no-repeat",...Xt.value,opacity:we.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,(l,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+l.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:l.x+"px",top:l.y+"px",width:M.value+"px",height:M.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(g=>jt(l),["stop"]),onMouseenter:g=>Ml(l,g),onMouseleave:Cn},[e.createElementVNode("img",{src:Ve(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,fs)],44,vs)),[[e.vShow,D.value]])),128)),gn.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:gn.value.x+"px",top:gn.value.y+"px"})},[e.createElementVNode("div",gs,e.toDisplayString(gn.value.categoryValue),1),gn.value.description?(e.openBlock(),e.createElementBlock("div",hs,e.toDisplayString(gn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),bn.value&&(ve.value.show||Ne.value&&me.value.show&&!P.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ne.value&&me.value.show&&!P.value.isZooming}]),style:e.normalizeStyle(m.value)},[!Ne.value||!me.value.show||P.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ln.value&&ve.value.spiderSeries&&ve.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",ys,[ve.value.title?(e.openBlock(),e.createElementBlock("div",ks,e.toDisplayString(ve.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value.spiderSeries,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",Cs,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",bs,e.toDisplayString(l.value),1)]))),128))])):xt.value&&ve.value.bubbleData&&ve.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",ws,[ve.value.title?(e.openBlock(),e.createElementBlock("div",xs,e.toDisplayString(ve.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value.bubbleData,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Vs,[e.createElementVNode("div",Ns,e.toDisplayString(ve.value.title),1),e.createElementVNode("div",Ss,e.toDisplayString(ve.value.value),1)])),ve.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[tn(ve.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ms,[r[6]||(r[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Bs,e.toDisplayString(e.unref(z)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn(ve.value.categoryIndex).flagGroups,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${c}`},[e.createElementVNode("div",Ts,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(g,f)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${c}-${f}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Hs,[e.createElementVNode("div",$s,e.toDisplayString(g.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),tn(ve.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ls,[r[7]||(r[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",_s,e.toDisplayString(e.unref(z)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn(ve.value.categoryIndex).markers,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",As,[e.createElementVNode("div",Ds,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Rs,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Is,[e.createElementVNode("div",Fs,e.toDisplayString(xt.value?wo():Z.categories[me.value.categoryIndex]||`Category ${me.value.categoryIndex+1}`),1),xt.value?(e.openBlock(),e.createElementBlock("div",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value.data,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(me.value.data,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",Ps,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Os,e.toDisplayString(l.value),1)]))),128))]),tn(me.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Zs,[r[8]||(r[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ws,e.toDisplayString(e.unref(z)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn(me.value.categoryIndex).flagGroups,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${c}`},[e.createElementVNode("div",qs,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(g,f)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${c}-${f}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Us,[e.createElementVNode("div",Xs,e.toDisplayString(g.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),tn(me.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ys,[r[9]||(r[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",js,e.toDisplayString(e.unref(z)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn(me.value.categoryIndex).markers,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",Ks,[e.createElementVNode("div",Gs,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Qs,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),St.value&&Lt.value&&P.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:yn},[r[10]||(r[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(P.value.scale*100))+"% "+e.toDisplayString(e.unref(z)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,_o),Me.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:Me.value.x+"px",top:Me.value.y+"px"}),onClick:r[0]||(r[0]=e.withModifiers(()=>{},["stop"]))},[st.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:dn},e.toDisplayString(e.unref(z)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),st.value.addMarker&&(st.value.downloadSvg||st.value.downloadPng||st.value.downloadCsv||on.value.length>0)?(e.openBlock(),e.createElementBlock("div",Js)):e.createCommentVNode("",!0),st.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Kl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),st.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Gl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),st.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Ql},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),on.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[st.value.downloadSvg||st.value.downloadPng||st.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",er)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+c},[l.separator?(e.openBlock(),e.createElementBlock("div",tr)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Y(l)),style:e.normalizeStyle(he(l)),onClick:g=>Jl(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:H(l),class:"dss-custom-menu-content"},null,8,lr)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",or,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,nr)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Q.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:sn},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:r[4]||(r[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",ar,[e.createElementVNode("h3",null,e.toDisplayString(hn.value?e.unref(z)("chart.modalMarker.viewMarker"):Bn.value?e.unref(z)("chart.modalMarker.editMarker"):e.unref(z)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:sn},"×")]),e.createElementVNode("div",sr,[e.createElementVNode("div",rr,[Q.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",ir,e.toDisplayString(zt(Q.value.categoryIndex)||""),1)),Q.value.fromButton?(e.openBlock(),e.createElementBlock("div",cr,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":r[1]||(r[1]=l=>Q.value.categoryIndex=l),class:"dss-form-select",disabled:hn.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ll.value,(l,c)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${c}`,value:c},e.toDisplayString(l),9,ur))),128))],8,dr),[[e.vModelSelect,Q.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",mr,[e.createElementVNode("label",pr,e.toDisplayString(e.unref(z)("chart.modalMarker.description")),1),hn.value?(e.openBlock(),e.createElementBlock("div",vr,e.toDisplayString(Q.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":r[2]||(r[2]=l=>Q.value.description=l),placeholder:e.unref(z)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,fr)),[[e.vModelText,Q.value.description]])]),e.createElementVNode("div",gr,[e.createElementVNode("label",null,e.toDisplayString(e.unref(z)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",hr,[e.createElementVNode("img",{src:Ve({type:Q.value.type}),alt:"Marker Icon Preview",class:"preview-icon",style:{width:"32px",height:"32px","border-radius":"50%",border:"2px solid #ddd"},onError:r[3]||(r[3]=l=>l.target.style.display="none")},null,40,yr)])])]),e.createElementVNode("div",kr,[e.createElementVNode("div",Cr,[Bn.value&&!hn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:rn},e.toDisplayString(e.unref(z)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",br,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:sn},e.toDisplayString(hn.value?e.unref(z)("chart.modalMarker.close"):e.unref(z)("chart.modalMarker.cancel")),1),hn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:_l,disabled:!(Q.value.description&&Q.value.description.length)},e.toDisplayString(Bn.value?e.unref(z)("chart.modalMarker.save"):e.unref(z)("chart.contextMenu.addMarker")),9,wr))])])])])):e.createCommentVNode("",!0)],64))}}),Vr={class:"dss-modal-title"},Nr={class:"dss-modal-actions"},Vo={__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(Z,{emit:Kt}){const z=Z,R=Kt,De=e.ref(null),N=e.ref(null),ke=e.computed(()=>{const re={"max-width":z.width};return z.height!=="auto"&&(re.height=z.height,re["min-height"]="0"),re}),Qe=e.computed(()=>({}));function vt(){R("close-modal")}function v(){z.backDrop&&!De.value&&R("close-modal")}function Ce(re){re.target.tagName==="INPUT"&&(De.value=re.target.tagName)}function _e(){setTimeout(()=>{De.value=null},300)}function xe(){const re=document.body,be=document.documentElement;N.value={bodyOverflow:re.style.overflow,bodyPosition:re.style.position,bodyTop:re.style.top,bodyWidth:re.style.width,htmlOverflow:be.style.overflow,scrollY:window.scrollY},re.style.overflow="hidden",re.style.position="fixed",re.style.top=`-${N.value.scrollY}px`,re.style.width="100%",re.style.left="0",be.style.overflow="hidden"}function I(){if(!N.value)return;const re=document.body,be=document.documentElement,{bodyOverflow:Zt,bodyPosition:Gt,bodyTop:O,bodyWidth:ft,htmlOverflow:Wt,scrollY:Re}=N.value;re.style.overflow=Zt||"",re.style.position=Gt||"",re.style.top=O||"",re.style.width=ft||"",re.style.left="",be.style.overflow=Wt||"",window.scrollTo(0,Re||0)}return e.watch(()=>z.showModal,re=>{if(re)xe(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const be=document.getElementById("dss-modal-backdrop");be&&(be.addEventListener("focusin",Ce),be.addEventListener("focusout",_e))},100);else{I(),document.body.classList.remove("dss-modal-open");const be=document.getElementById("dss-modal-backdrop");be&&(be.removeEventListener("focusin",Ce),be.removeEventListener("focusout",_e))}},{immediate:!0}),e.onUnmounted(()=>{z.showModal&&I()}),(re,be)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Z.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:v},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(ke.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:be[0]||(be[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":Z.headerType,"font-size":Z.titleSize})},[e.createElementVNode("h1",Vr,[e.renderSlot(re.$slots,"title",{},()=>[be[1]||(be[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(re.$slots,"title-data"),Z.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:vt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(Qe.value)},[e.renderSlot(re.$slots,"content",{},()=>[be[2]||(be[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Nr,[e.renderSlot(re.$slots,"actions")])])],4),[[e.vShow,Z.showModal]])])):e.createCommentVNode("",!0)]))}},Sr={key:0,class:"dss-table-toolbar"},Mr={class:"dss-table-toolbar-left"},Br=["aria-expanded"],Tr={class:"dss-pagination-select-dropdown",role:"listbox"},Hr={class:"dss-table-column-visibility-label"},$r={class:"dss-table-checkbox-wrapper"},Lr=["checked","onChange"],_r={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Ar={class:"dss-table-column-visibility-text"},Dr={class:"dss-table-toolbar-right"},Rr=["placeholder"],Ir=["aria-expanded"],Fr={key:1,class:"dss-table-toolbar-extra"},zr={class:"dss-table-thead"},Pr={key:0,class:"dss-table-th dss-table-selection-column"},Or={key:0,class:"dss-table-checkbox-wrapper"},Zr=["checked","indeterminate"],Wr={key:0,class:"dss-table-checkbox__indeterminate"},qr={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Ur={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},Xr=["onClick"],Yr={class:"dss-table-th-content"},jr={class:"dss-table-th-text"},Kr={key:0},Gr={key:1},Qr={key:2},Jr=["aria-expanded","onClick"],ei={class:"dss-table-tbody"},ti=["onClick"],ni={class:"dss-table-checkbox-wrapper"},li=["type","name","checked","onChange"],oi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},ai={key:1,class:"dss-table-checkbox__dot"},si=["onClick"],ri=["aria-expanded","aria-label"],ii={key:0,class:"dss-table-expansion-row"},ci=["colspan"],di=["colspan"],ui={key:1,class:"dss-table-pagination"},mi={class:"dss-pagination-center"},pi={class:"dss-pagination-controls"},vi=["disabled","title"],fi=["disabled","title"],gi={class:"dss-pagination-pages"},hi=["onClick"],yi={key:1,class:"dss-pagination-ellipsis"},ki=["disabled","title"],Ci=["disabled","title"],bi=["aria-expanded"],wi={class:"dss-pagination-select-dropdown",role:"listbox"},xi=["aria-selected","onClick"],Ei={key:0,class:"dss-table-filter-row"},Vi=["value","placeholder"],Ni=["min","max","value"],Si=["min","max","value"],Mi={class:"dss-table-filter-double-range-values"},Bi={key:2,class:"dss-table-filter-daterange"},Ti={class:"dss-table-filter-daterange-row"},Hi={class:"dss-table-filter-daterange-label"},$i=["value"],Li={class:"dss-table-filter-daterange-row"},_i={class:"dss-table-filter-daterange-label"},Ai=["value"],Di=["value","placeholder"],Ri={class:"dss-table-filter-list"},Ii=["checked","onChange"],Fi={class:"dss-table-filter-actions"},zi={name:"DSSTable"},Pi=Object.assign(zi,{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:Z=>typeof Z=="object"&&Z!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(Z,{emit:Kt}){const{t:z,locale:R}=Wl.useI18n(),De=Z,N=Kt,ke={table:{width:"auto",height:null,rowHeight:"auto",expandable:!1,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single"},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100]},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:"No data available"};function Qe(C,y){const V=Object.assign({},C);return vt(C)&&vt(y)&&Object.keys(y).forEach(H=>{vt(y[H])?H in C?V[H]=Qe(C[H],y[H]):Object.assign(V,{[H]:y[H]}):Object.assign(V,{[H]:y[H]})}),V}function vt(C){return C&&typeof C=="object"&&!Array.isArray(C)}const v=e.computed(()=>Qe(ke,De.options)),Ce=e.computed(()=>{const C=v.value.table.width;return C==="auto"?null:typeof C=="number"?C:null}),_e=e.computed(()=>v.value.table.height),xe=e.computed(()=>v.value.table.rowHeight??"auto"),I=e.computed(()=>({height:xe.value})),re=e.computed(()=>v.value.table.expandable===!0),be=e.computed(()=>v.value.table.striped),Zt=e.computed(()=>v.value.table.bordered),Gt=e.computed(()=>v.value.table.hoverable),O=e.computed(()=>v.value.table.size),ft=e.computed(()=>v.value.table.align||"left");e.computed(()=>v.value.title.text),e.computed(()=>v.value.subtitle.text);const Wt=e.computed(()=>v.value.selection.enabled),Re=e.computed(()=>v.value.selection.mode),Oe=e.computed(()=>v.value.sorting.enabled),lt=e.computed(()=>v.value.sorting.mode),ie=e.computed(()=>v.value.pagination.enabled),Ct=e.computed(()=>v.value.pagination.rows),te=e.computed(()=>v.value.pagination.rowsPerPageOptions),Te=e.computed(()=>v.value.scrollable),jn=e.computed(()=>v.value.emptyMessage),Rt=e.computed(()=>v.value.toolbar?.downloads?.pdf!==!1),Qt=e.computed(()=>v.value.toolbar?.downloads?.excel!==!1),cn=e.computed(()=>v.value.toolbar?.search!==!1),Jt=e.computed(()=>Rt.value||Qt.value||cn.value||vn.value),vn=e.computed(()=>v.value.toolbar?.columnVisibility!==!1),We=e.ref(""),qe=e.ref(!1),He=e.ref(null);let ze=null;function en(){qe.value?(ze&&(clearTimeout(ze),ze=null),qe.value=!1,We.value="",N("search",""),He.value?.blur()):(qe.value=!0,ze=setTimeout(()=>{ze=null,He.value?.focus()},80))}function bn(){We.value||(qe.value=!1)}function Ne(){We.value="",N("search",""),He.value?.focus()}const fn=e.computed(()=>({"dss-table-striped":be.value,"dss-table-bordered":Zt.value,"dss-table-hoverable":Gt.value,[`dss-table-${O.value}`]:O.value!=="default"})),Lt=(C,y)=>C?.field??C?.key??y,ln=e.ref(new Set);function nl(){const C=new Set;De.columns.forEach((y,V)=>{y?.hidden!==!0&&C.add(Lt(y,V))}),ln.value=C}const Ue=e.computed(()=>De.columns.filter((C,y)=>ln.value.has(Lt(C,y)))),Xe=C=>{const y=De.columns.findIndex(V=>V===C);return Lt(C,y>=0?y:0)},rt=(C,y)=>ln.value.has(Lt(C,y));function It(C,y){const V=Lt(C,y),H=new Set(ln.value);H.has(V)?H.delete(V):H.add(V),ln.value=H}const _t=e.ref(null),Ye=e.ref(!1);function ot(C){_t.value&&!_t.value.contains(C.target)&&(Ye.value=!1)}const ue=e.computed(()=>Ue.value.length+(Wt.value?1:0)+(re.value?1:0)),Ee=(C,y)=>C?.id??C?.key??y,qt=e.ref(new Set),je=(C,y)=>qt.value.has(Ee(C,y)),Ft=(C,y,V)=>{V&&V.stopPropagation();const H=Ee(C,y),Y=new Set(qt.value);Y.has(H)?(Y.delete(H),N("row-collapse",{data:C,index:y})):(Y.add(H),N("row-expand",{data:C,index:y})),qt.value=Y},Je=e.ref(null),et=e.ref(0),Ke=e.ref([]),pe=C=>{if(lt.value==="single")return Je.value===C.field?et.value:0;{const y=Ke.value.find(V=>V.field===C.field);return y?y.order:0}},$e=C=>{const y=pe(C);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},Tt=e.ref({}),Be=e.ref(null),gt=e.ref(null),Ut=220,ht=e.computed(()=>Ue.value.find(C=>Xe(C)===Be.value)??null),it=e.computed(()=>{if(!ht.value||ht.value.filter!=="range")return null;const C=ht.value,y=Be.value,{min:V,max:H}=Se(C),Y=C.filterMin??V,he=C.filterMax??H,Ve=ct(y),zt=Ve.min??Y,En=Ve.max??he,Pt=he-Y,wl=Pt===0?0:(zt-Y)/Pt*100,_l=Pt===0?100:(En-Y)/Pt*100;return{rangeMin:Y,rangeMax:he,currentMin:zt,currentMax:En,minPct:wl,maxPct:_l}}),at=e.ref(null),st=e.ref("max");function on(C){const y=at.value,V=it.value;if(!y||!V)return;const H=y.getBoundingClientRect(),he=(C.clientX-H.left)/H.width*100,Ve=(V.minPct+V.maxPct)/2;st.value=he<Ve?"min":"max"}function ct(C){return Tt.value[C]??{}}function bt(C,y){Tt.value={...Tt.value,[C]:y}}function M(C){const y=Tt.value[C];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 D(C){const y={...Tt.value};delete y[C],Tt.value=y,Be.value=null,gt.value=null}const _=e.computed(()=>{let C=[...De.data];return Ue.value.forEach(y=>{const V=Xe(y),H=Tt.value[V];if(!H)return;const Y=y.field;if(Y){if(H.type==="string"&&H.value?.trim()){const he=H.value.trim().toLowerCase();C=C.filter(Ve=>{const zt=hn(Ve,y);return String(zt??"").toLowerCase().includes(he)})}else if(H.type==="range")C=C.filter(he=>{const Ve=wt(he,Y),zt=Number(Ve);return!(Number.isNaN(zt)||H.min!=null&&zt<H.min||H.max!=null&&zt>H.max)});else if(H.type==="dateRange"){const he=H.from?new Date(H.from).getTime():null,Ve=H.to?new Date(H.to).getTime():null;C=C.filter(zt=>{const En=wt(zt,Y),Pt=En?new Date(En).getTime():NaN;return!(Number.isNaN(Pt)||he!=null&&Pt<he||Ve!=null&&Pt>Ve)})}else if(H.type==="list"&&H.selected?.length){const he=new Set(H.selected);C=C.filter(Ve=>{const zt=hn(Ve,y);return he.has(zt!=null?String(zt):"")})}}}),C});function X(C){const y=new Set;return De.data.forEach(V=>{const H=hn(V,C);y.add(H!=null?String(H):"")}),Array.from(y).sort((V,H)=>String(V).localeCompare(String(H)))}function ae(C,y){if(Be.value===C){Be.value=null,gt.value=null;return}if(y?.currentTarget){const V=y.currentTarget.getBoundingClientRect();gt.value={top:V.bottom+6,left:Math.max(8,V.right-Ut)}}Be.value=C}function we(C,y){bt(C,{type:"string",value:y})}function Se(C){const y=C.field;if(!y)return{min:0,max:100};let V=1/0,H=-1/0;return De.data.forEach(Y=>{const he=wt(Y,y),Ve=Number(he);Number.isNaN(Ve)||(V=Math.min(V,Ve),H=Math.max(H,Ve))}),{min:V===1/0?0:V,max:H===-1/0?100:H}}function ye(C,y,V){const H={...ct(C),type:"range"},Y=V===""?null:Number(V),he=Y===null||Number.isNaN(Y)?null:Y;H[y]=he,he!=null&&(y==="min"&&H.max!=null&&he>H.max&&(H.max=he),y==="max"&&H.min!=null&&he<H.min&&(H.min=he)),bt(C,H)}function Pe(C,y,V){const H={...ct(C),type:"dateRange"};H[y]=V||"",bt(C,H)}const Xt=e.reactive({});function Fn(C,y){Xt[C]=y}function tn(C){const y=Xe(C),V=(Xt[y]??"").trim().toLowerCase(),H=X(C);return V?H.filter(Y=>String(Y).toLowerCase().includes(V)):H}function zn(C,y){return(ct(C).selected??[]).includes(y!=null?String(y):"")}function cl(C,y){const H=[...ct(C).selected??[]],Y=y!=null?String(y):"",he=H.indexOf(Y);he>=0?H.splice(he,1):H.push(Y),bt(C,{type:"list",selected:H})}function ll(C){Be.value&&!C.target.closest(".dss-table-filter-wrap")&&!C.target.closest(".dss-table-filter-dropdown")&&(Be.value=null,gt.value=null)}const Cl=C=>{if(!(C.sortable===!1||!Oe.value))if(lt.value==="single")Je.value===C.field?et.value=et.value===1?-1:et.value===-1?0:1:(Je.value=C.field,et.value=1),et.value===0&&(Je.value=null),N("sort",{field:Je.value,order:et.value});else{const y=Ke.value.findIndex(V=>V.field===C.field);y>=0?Ke.value[y].order===1?Ke.value[y].order=-1:Ke.value.splice(y,1):Ke.value.push({field:C.field,order:1}),N("sort",{multiSortMeta:Ke.value})}},Mn=e.computed(()=>{if(!Oe.value)return _.value;let C=[..._.value];return lt.value==="single"&&Je.value&&et.value!==0?C.sort((y,V)=>{const H=wt(y,Je.value),Y=wt(V,Je.value);return H===Y?0:H==null?1:Y==null?-1:(H<Y?-1:H>Y?1:0)*et.value}):lt.value==="multiple"&&Ke.value.length>0&&C.sort((y,V)=>{for(const H of Ke.value){const Y=wt(y,H.field),he=wt(V,H.field);if(Y===he)continue;if(Y==null)return 1;if(he==null)return-1;const Ve=Y<he?-1:Y>he?1:0;if(Ve!==0)return Ve*H.order}return 0}),C}),dt=e.ref(0),un=e.ref(Ct.value),wn=e.ref(!1),Pn=e.ref(null),bl=C=>{un.value=C,wn.value=!1,dt.value=0,N("page",{page:0,rows:un.value})};function ol(C){Pn.value&&!Pn.value.contains(C.target)&&(wn.value=!1)}const On=e.computed(()=>Mn.value.length),xn=e.computed(()=>Math.ceil(On.value/un.value)),Yt=e.computed(()=>ie.value?dt.value*un.value:0),$l=e.computed(()=>ie.value?Math.min((dt.value+1)*un.value,On.value):On.value),tt=e.computed(()=>{if(!ie.value)return Mn.value;const C=Yt.value,y=$l.value;return Mn.value.slice(C,y)}),G=e.ref(new Set),dl=e.computed(()=>Mn.value.filter((C,y)=>G.value.has(Ee(C,y)))),ve=e.computed(()=>{const C=Mn.value.length;return C>0&&G.value.size===C}),gn=e.computed(()=>{const C=Mn.value.length,y=G.value.size;return y>0&&y<C}),me=(C,y)=>G.value.has(Ee(C,y)),Me=()=>{if(ve.value)G.value=new Set,N("unselect-all");else{const C=new Set;Mn.value.forEach((y,V)=>C.add(Ee(y,V))),G.value=C,N("select-all",dl.value)}},P=(C,y)=>{const V=Ee(C,y),H=new Set(G.value),Y=H.has(V);Re.value==="single"?Y?(H.delete(V),N("row-unselect",C)):(H.clear(),H.add(V),N("row-select",C)):Y?(H.delete(V),N("row-unselect",C)):(H.add(V),N("row-select",C)),G.value=H},ut=e.computed(()=>{const C=xn.value,y=dt.value+1,V=2,H=[],Y=[];let he;for(let Ve=1;Ve<=C;Ve++)(Ve===1||Ve===C||Ve>=y-V&&Ve<=y+V)&&H.push(Ve);for(const Ve of H)he&&(Ve-he===2?Y.push(he+1):Ve-he!==1&&Y.push("...")),Y.push(Ve),he=Ve;return Y}),Q=C=>{C<0||C>=xn.value||(dt.value=C,N("page",{page:C,rows:un.value}))},Ll=(C,y,V)=>{N("row-click",{data:C,index:y,originalEvent:V})},Bn=(C,y)=>({"dss-table-row-selected":me(C,Yt.value+y),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0}),hn=(C,y)=>y.field?wt(C,y.field):"",wt=(C,y)=>y.split(".").reduce((V,H)=>V&&V[H],C),an=C=>{const y=C.align??ft.value;return{"dss-table-sortable":C.sortable!==!1&&Oe.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[C.className]:C.className}},Kn=C=>{const y={};return C.width&&(y.width=typeof C.width=="number"?`${C.width}px`:C.width),C.minWidth&&(y.minWidth=typeof C.minWidth=="number"?`${C.minWidth}px`:C.minWidth),C.maxWidth&&(y.maxWidth=typeof C.maxWidth=="number"?`${C.maxWidth}px`:C.maxWidth),y};return e.watch(()=>De.locale,C=>{C&&C!==R.value&&(R.value=C)},{immediate:!0}),e.watch(Ct,C=>{un.value=C,dt.value=0}),e.watch(We,C=>{N("search",C??"")}),e.watch(()=>De.columns,()=>{nl()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",ol),document.addEventListener("click",ot),document.addEventListener("click",ll)}),e.onUnmounted(()=>{document.removeEventListener("click",ol),document.removeEventListener("click",ot),document.removeEventListener("click",ll)}),(C,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",style:e.normalizeStyle({width:Ce.value+"px",height:_e.value?_e.value+"px":"auto"})},[Jt.value?(e.openBlock(),e.createElementBlock("div",Sr,[e.createElementVNode("div",Mr,[Rt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=V=>N("download-pdf"))},[y[21]||(y[21]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(z)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),Qt.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=V=>N("download-excel"))},[y[22]||(y[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(z)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),vn.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:_t},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Ye.value}]),onClick:y[2]||(y[2]=V=>Ye.value=!Ye.value),"aria-expanded":Ye.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(z)("table.columnVisibility"))+" ",1),y[23]||(y[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Br),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Tr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.columns,(V,H)=>(e.openBlock(),e.createElementBlock("li",{key:Lt(V,H),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Hr,[e.createElementVNode("span",$r,[e.createElementVNode("input",{type:"checkbox",checked:rt(V,H),onChange:Y=>It(V,H),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Lr),rt(V,H)?(e.openBlock(),e.createElementBlock("span",_r,[...y[24]||(y[24]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Ar,e.toDisplayString(V.header),1)])]))),128))],512),[[e.vShow,Ye.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Dr,[cn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":qe.value||We.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:He,"onUpdate:modelValue":y[4]||(y[4]=V=>We.value=V),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(z)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:y[5]||(y[5]=V=>qe.value=!0),onBlur:bn},null,40,Rr),[[e.vModelText,We.value]]),We.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:Ne},[...y[25]||(y[25]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":"Search","aria-expanded":qe.value||!!We.value,onMousedown:e.withModifiers(en,["prevent"])},[...y[26]||(y[26]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,Ir)],2)):e.createCommentVNode("",!0),C.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Fr,[e.renderSlot(C.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Te.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",fn.value])},[e.createElementVNode("thead",zr,[e.createElementVNode("tr",null,[Wt.value?(e.openBlock(),e.createElementBlock("th",Pr,[Re.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Or,[e.createElementVNode("input",{type:"checkbox",checked:ve.value,indeterminate:gn.value,onChange:Me,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Zr),gn.value?(e.openBlock(),e.createElementBlock("span",Wr)):ve.value?(e.openBlock(),e.createElementBlock("span",qr,[...y[27]||(y[27]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),re.value?(e.openBlock(),e.createElementBlock("th",Ur)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,(V,H)=>(e.openBlock(),e.createElementBlock("th",{key:Xe(V),class:e.normalizeClass(["dss-table-th",an(V)]),style:e.normalizeStyle(Kn(V)),onClick:Y=>Cl(V)},[e.createElementVNode("div",Yr,[e.createElementVNode("span",jr,e.toDisplayString(V.header),1),V.sortable!==!1&&Oe.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",$e(V)])},[pe(V)===0?(e.openBlock(),e.createElementBlock("span",Kr,[...y[28]||(y[28]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):pe(V)===1?(e.openBlock(),e.createElementBlock("span",Gr,[...y[29]||(y[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):pe(V)===-1?(e.openBlock(),e.createElementBlock("span",Qr,[...y[30]||(y[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),V.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Be.value===Xe(V)}]),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":M(Xe(V))}]),"aria-expanded":Be.value===Xe(V),"aria-label":"Filter column",onClick:Y=>ae(Xe(V),Y)},[...y[31]||(y[31]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,Jr)],2)):e.createCommentVNode("",!0)])],14,Xr))),128))])]),e.createElementVNode("tbody",ei,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tt.value,(V,H)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ee(V,Yt.value+H)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Bn(V,H)]),style:e.normalizeStyle(I.value),onClick:Y=>Ll(V,H,Y)},[Wt.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",ni,[e.createElementVNode("input",{type:Re.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${Z.tableId}`,checked:me(V,Yt.value+H),onChange:Y=>P(V,Yt.value+H),class:e.normalizeClass(["dss-table-checkbox",Re.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,li),Re.value==="multiple"&&me(V,Yt.value+H)?(e.openBlock(),e.createElementBlock("span",oi,[...y[32]||(y[32]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):Re.value==="single"&&me(V,Yt.value+H)?(e.openBlock(),e.createElementBlock("span",ai)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),re.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(Y=>Ft(V,Yt.value+H,Y),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":je(V,Yt.value+H),"aria-label":je(V,Yt.value+H)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":je(V,Yt.value+H)}]),"aria-hidden":"true"},[...y[33]||(y[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,ri)],8,si)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,(Y,he)=>(e.openBlock(),e.createElementBlock("td",{key:Xe(Y),class:e.normalizeClass(["dss-table-td",an(Y)]),style:e.normalizeStyle(Kn(Y))},[e.renderSlot(C.$slots,`cell-${Y.field}`,{data:V,column:Y,rowIndex:H},()=>[e.createTextVNode(e.toDisplayString(hn(V,Y)),1)])],6))),128))],14,ti),re.value&&je(V,Yt.value+H)?(e.openBlock(),e.createElementBlock("tr",ii,[e.createElementVNode("td",{colspan:ue.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(C.$slots,"expansion",{data:V,rowIndex:H})],8,ci)])):e.createCommentVNode("",!0)],64))),128)),tt.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(I.value)},[e.createElementVNode("td",{colspan:ue.value,class:"dss-table-empty-cell"},[e.renderSlot(C.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(jn.value),1)])],8,di)],4))])],2)],2),ie.value?(e.openBlock(),e.createElementBlock("div",ui,[e.createElementVNode("div",mi,[e.createElementVNode("div",pi,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dt.value===0,onClick:y[8]||(y[8]=V=>Q(0)),title:e.unref(z)("table.firstPage")},[...y[34]||(y[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,vi),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dt.value===0,onClick:y[9]||(y[9]=V=>Q(dt.value-1)),title:e.unref(z)("table.previousPage")}," ‹ ",8,fi),e.createElementVNode("span",gi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ut.value,V=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V},[V!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":V===dt.value+1}]),onClick:H=>Q(V-1)},e.toDisplayString(V),11,hi)):(e.openBlock(),e.createElementBlock("span",yi,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dt.value>=xn.value-1,onClick:y[10]||(y[10]=V=>Q(dt.value+1)),title:e.unref(z)("table.nextPage")}," › ",8,ki),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dt.value>=xn.value-1,onClick:y[11]||(y[11]=V=>Q(xn.value-1)),title:e.unref(z)("table.lastPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Ci)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Pn},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":wn.value}]),onClick:y[12]||(y[12]=V=>wn.value=!wn.value),"aria-expanded":wn.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(un.value)+" ",1),y[36]||(y[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,bi),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",wi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V,role:"option","aria-selected":V===un.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":V===un.value}]),onClick:H=>bl(V)},e.toDisplayString(V),11,xi))),128))],512),[[e.vShow,wn.value]])]),_:1})],512)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(gt.value?{top:gt.value.top+"px",left:gt.value.left+"px",width:Ut+"px"}:void 0),onClick:y[20]||(y[20]=e.withModifiers(()=>{},["stop"]))},[ht.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ht.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Ei,[e.createElementVNode("input",{type:"text",value:ct(Be.value).value??"",onInput:y[13]||(y[13]=V=>we(Be.value,V.target.value)),class:"dss-table-filter-input",placeholder:e.unref(z)("table.search")||"Search..."},null,40,Vi)])):ht.value.filter==="range"&&it.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":it.value.minPct+"%","--range-max-pct":it.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:at,class:"dss-table-filter-double-range-track",onMousemove:on,onMouseenter:on},[e.createElementVNode("input",{type:"range",min:it.value.rangeMin,max:it.value.rangeMax,value:it.value.currentMin,onInput:y[14]||(y[14]=V=>ye(Be.value,"min",V.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:st.value==="min"?2:1})},null,44,Ni),e.createElementVNode("input",{type:"range",min:it.value.rangeMin,max:it.value.rangeMax,value:it.value.currentMax,onInput:y[15]||(y[15]=V=>ye(Be.value,"max",V.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:st.value==="max"?2:1})},null,44,Si)],544),e.createElementVNode("div",Mi,e.toDisplayString(it.value.currentMin)+" – "+e.toDisplayString(it.value.currentMax),1)],4)):ht.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Bi,[e.createElementVNode("div",Ti,[e.createElementVNode("label",Hi,e.toDisplayString(e.unref(z)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:ct(Be.value).from??"",onInput:y[16]||(y[16]=V=>Pe(Be.value,"from",V.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,$i)]),e.createElementVNode("div",Li,[e.createElementVNode("label",_i,e.toDisplayString(e.unref(z)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:ct(Be.value).to??"",onInput:y[17]||(y[17]=V=>Pe(Be.value,"to",V.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Ai)])])):ht.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:Xt[Be.value]??"",onInput:y[18]||(y[18]=V=>Fn(Be.value,V.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(z)("table.search")||"Search..."},null,40,Di),e.createElementVNode("div",Ri,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn(ht.value),V=>(e.openBlock(),e.createElementBlock("label",{key:V,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:zn(Be.value,V),onChange:H=>cl(Be.value,V)},null,40,Ii),e.createElementVNode("span",null,e.toDisplayString(V),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Fi,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[19]||(y[19]=V=>D(Be.value))},e.toDisplayString(e.unref(z)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Be.value&&ht.value&&gt.value]])]),_:1})]))],64))}}),Oi={class:"dss-toolbar-left"},Zi=["title"],Wi=["title"],qi={class:"dss-toolbar-dropdown-wrapper"},Ui=["title"],Xi={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Yi={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ji={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ki={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Gi={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Qi={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ji={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},ec=["title"],tc=["title"],nc=["title"],lc=["title"],oc=["title"],ac=["title"],sc=["title"],rc=["title"],ic=["title"],cc={key:2,class:"dss-toolbar-separator"},dc=["title"],uc={key:4,class:"dss-toolbar-separator"},mc={key:5,class:"dss-toolbar-dropdown-wrapper"},pc=["title"],vc={class:"dss-toolbar-dropdown-ai"},fc={class:"dss-toolbar-right"},gc={key:0,class:"dss-toolbar-custom-group"},hc={key:1,class:"dss-toolbar-separator"},yc={class:"dss-link-modal-content"},kc={class:"dss-link-modal-field"},Cc={class:"dss-link-modal-label"},bc=["placeholder"],wc={class:"dss-link-modal-field"},xc={class:"dss-link-modal-label"},Ec=["placeholder"],Vc={class:"dss-image-modal-tabs"},Nc={key:0,class:"dss-image-tab-content"},Sc={class:"dss-link-modal-content"},Mc={class:"dss-link-modal-field"},Bc={key:0,class:"dss-link-modal-label"},Tc=["src"],Hc={class:"dss-link-modal-field"},$c={class:"dss-link-modal-label"},Lc=["placeholder"],_c={class:"dss-link-modal-field"},Ac={class:"dss-link-modal-label"},Dc=["placeholder"],Rc={class:"dss-link-modal-field"},Ic={class:"dss-link-modal-label"},Fc=["placeholder"],zc={key:1,class:"dss-image-tab-content"},Pc={class:"dss-link-modal-content"},Oc={class:"dss-link-modal-field"},Zc={class:"dss-link-modal-label"},Wc=["placeholder"],qc={class:"dss-link-modal-field"},Uc={class:"dss-link-modal-label"},Xc=["placeholder"],Yc={class:"dss-link-modal-field"},jc={class:"dss-link-modal-label"},Kc=["placeholder"],Gc={class:"dss-link-modal-field"},Qc={class:"dss-link-modal-label"},Jc=["placeholder"],ed={class:"dss-text-editor-title-input-container"},td={key:0,class:"dss-text-editor-title-preview"},nd={key:0},ld={key:1,class:"dss-text-editor-preview-placeholder"},od=["value","placeholder","disabled"],ad={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},sd={class:"dss-text-editor-description-input-container"},rd={key:0,class:"dss-text-editor-description-preview"},id={key:0},cd={key:1,class:"dss-text-editor-preview-placeholder"},dd=["value","placeholder","disabled"],ud={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},md=["data-comment-id","onMouseenter"],pd=["onClick"],vd=["src","alt"],fd={key:1},gd=["onClick"],hd=["src","alt"],yd={key:1},kd=["data-has-second-user","onClick"],Cd={class:"editor-comment-marker-count"},bd={key:4,class:"dss-text-editor-textarea-wrapper"},wd=["value","placeholder","rows","disabled"],xd={class:"dss-text-editor-footer"},Ed={class:"dss-text-editor-footer-content"},Vd={class:"dss-text-editor-footer-stat"},Nd={class:"dss-text-editor-footer-stat"},Sd={key:5,class:"dss-text-editor-content-wrapper"},Md={key:0,class:"dss-comment-overlay-body"},Bd={class:"dss-comment-selection-wrapper"},Td=["innerHTML"],Hd={class:"dss-comment-messages-wrapper"},$d={key:0,class:"dss-comment-avatar-wrapper"},Ld={class:"dss-comment-avatar"},_d=["src","alt"],Ad={key:1},Dd={class:"dss-comment-header"},Rd={class:"dss-comment-header-text"},Id={class:"dss-comment-author"},Fd={key:0,class:"dss-comment-date"},zd=["onClick","title"],Pd={class:"dss-comment-overlay-inner"},Od=["placeholder","onKeydown"],Zd={class:"dss-text-editor-footer"},Wd={class:"dss-text-editor-footer-content"},qd={class:"dss-text-editor-footer-stat"},Ud={class:"dss-text-editor-footer-stat"},Xd=["title"],Yd=["title"],jd={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:""},Kd={class:"dss-image-popup-content"},Gd={key:0,class:"dss-image-popup-no-alt-icon"},Qd=["title"],Jd=["title"],eu={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:""},tu={class:"dss-toolbar-left"},nu=["title"],lu=["title"],ou={class:"dss-toolbar-dropdown-wrapper"},au=["title"],su={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ru={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},iu={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cu={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},du={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},uu={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},mu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},pu=["title"],vu=["title"],fu=["title"],gu=["title"],hu=["title"],yu=["title"],ku=["title"],Cu=["title"],bu=["title"],wu=["title"],xu={key:2,class:"dss-toolbar-separator"},Eu={key:3,class:"dss-toolbar-dropdown-wrapper"},Vu=["title"],Nu={class:"dss-toolbar-dropdown-ai"},Su={key:0,class:"dss-toolbar-right"},Mu={key:0,class:"dss-toolbar-separator"},Bu={key:0,class:"dss-toolbar-custom-group"},Tu={key:1,class:"dss-toolbar-separator"},Hu={name:"DSSTextEditor"},$u=Object.assign(Hu,{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:Z=>typeof Z=="object"&&Z!==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:Z=>typeof Z=="object"&&Z!==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(Z,{expose:Kt,emit:z}){const{t:R,locale:De}=Wl.useI18n(),N=Z,ke=z,Qe=e.useSlots(),vt=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
76
76
  <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"/>
77
- </svg>`,g=e.ref(null),Re=e.ref(null),ct=e.ref(!1),et=e.ref(!1),D=e.ref(!1),le=e.ref(""),ke=e.ref({}),gt=e.ref(!1),yt=e.ref(!1),$=e.ref(""),Ye=e.ref(""),Ht=e.ref(null),Ze=e.ref(null),He=e.ref(null),je=e.ref(null),ae=e.ref(""),Eo=e.ref(!1),j=e.ref({}),xe=e.ref(!1),rn=e.ref({}),Ao=e.ref(null),At=e.ref(null),lo=e.ref(!1),Ct=e.ref(""),Lo=e.ref(null),kt=e.ref(""),Je=e.ref(""),Ce=e.ref(""),Ae=e.ref(null),Lt=e.ref(null),Vo=e.ref(null),ue=e.ref(null),$o=e.ref(null),Pt=e.ref(!1),So=e.ref(""),Bn=e.ref({}),We=e.ref(!1),nt=e.ref("upload"),Ke=e.ref(""),rt=e.ref(null),ut=e.ref(null),xt=e.ref([]),lt=e.ref([]),te=e.ref(null),ve=e.ref(!1),$t=e.ref(""),tt=e.ref(""),wt=e.ref(""),dt=e.ref(""),mt=e.ref(""),pt=e.ref(""),se=e.ref(null),Ne=e.ref(null),Ot=e.ref(null),ho=e.ref(!1),bt=e.ref(null),Et=e.ref(!1),Zt=e.ref(!1),ao=e.ref(null),Fe=e.ref("p"),Ue=e.ref(!1),Wt=e.ref([]),Dt=e.ref(null),It=e.ref(null),Ut=e.ref(null),Do=e.ref(!1),Tn=e.ref(0),al=100,Vt=e.ref(null),cn=e.computed(()=>({"dss-text-editor-no-border":!S.border,"dss-text-editor-rounded":S.rounded,"dss-text-editor-full-height":S.fullHeight,"dss-comment-overlay-open":qe.value!==null})),sl=e.computed(()=>({})),un=e.computed(()=>!S.fixedHeight||S.fullHeight?{}:{height:`${1.6*14*S.rows+24+2}px`,resize:"none",overflowY:"auto"}),dn=e.computed(()=>!S.fixedHeight||S.fullHeight?{}:{height:`${1.6*14*S.rows+32}px`,overflowY:"auto"}),Hn=e.computed(()=>S.richText&&lt.value.length>0),An=e.computed(()=>{if(!S.modelValue)return"";if(S.richText){let l=S.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return l=l.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),l=l.replace(/<[^>]+>/g,""),l=l.replace(/&nbsp;/g," "),l=l.replace(/&amp;/g,"&"),l=l.replace(/&lt;/g,"<"),l=l.replace(/&gt;/g,">"),l=l.replace(/&quot;/g,'"'),l=l.replace(/&#39;/g,"'"),l=l.replace(/\s+/g," ").trim(),l}return S.modelValue}),St=e.computed(()=>{const l=An.value.trim();return l?l.split(/\s+/).filter(o=>o.length>0).length:0}),qo=e.computed(()=>An.value.length),mn=e.computed(()=>ue.value!==null&&nt.value==="upload"&&kt.value&&kt.value.startsWith("data:")),pn=e.computed(()=>S.titlePlaceholder||H("textEditor.placeholders.title")),Ln=e.computed(()=>S.descriptionPlaceholder||H("textEditor.placeholders.description")),rl=e.computed(()=>S.placeholder||H("textEditor.placeholders.startTyping")),qt=l=>bo&&bo[l]!==void 0,il=l=>{for(let o=l+1;o<S.customToolbarSlots.length;o++)if(qt(S.customToolbarSlots[o]))return!0;return!1},$n=l=>{for(let o=l+1;o<S.customToolbarSlots.length;o++){const a=S.customToolbarSlots[o];if(qt(a)&&Xo(a))return!0}return!1},Xo=l=>S.customToolbarFloatingMap.hasOwnProperty(l)?S.customToolbarFloatingMap[l]===!0:!0,Dn=e.computed(()=>S.customToolbarSlots.some(l=>qt(l)&&Xo(l))),fn=e.computed(()=>qt("title-slot")),Yo=e.computed(()=>qt("description-slot")),jo=l=>{if(!l||l.trim()==="")return"<html></html>";const o=l.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?l:`<html>${l}</html>`},vn=l=>{if(!l||l.trim()==="")return"";const o=l.replace(/<!--[\s\S]*?-->/g,""),a=o.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():o},cl=l=>{if(!l)return;const o=document.createTreeWalker(l,NodeFilter.SHOW_COMMENT,null,!1),a=[];let s=o.nextNode();for(;s;)a.push(s),s=o.nextNode();a.forEach(i=>i.remove())},Ee=l=>{try{const o=String(l.getDate()).padStart(2,"0"),s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][l.getMonth()],i=l.getFullYear();return`${o} ${s} ${i}`}catch{return""}},U=l=>{if(!l||typeof l!="string")return!1;const o=l.trim();if(!o)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(o))return!0;try{const i=H("textEditor.started_conversation");if(i&&o===i)return!0}catch{}const s=o.toLowerCase();return s.includes("started conversation")||s.includes("démarré la conversation")||s==="started conversation"||s==="a démarré la conversation"},hn=l=>{const o=l.target.value;ie("update:modelValue",o),ie("change",o)},oe=()=>{if(!se.value)return;const l=se.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const s=l.value;l.value="M";const i=l.scrollHeight;l.value=s,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},so=()=>{Et.value=!0,oe()},ne=()=>{Et.value=!1,re()},re=()=>{if(!se.value)return;const l=se.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const o=l.value;l.value="M";const a=l.scrollHeight;l.value=o,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},A=l=>{const a=l.target.value;Et.value&&oe(),ie("update:title",a),ie("title-change",a),Ot.value="title",S.richText&&(ve.value||(tt.value=$t.value,mt.value=wt.value,pt.value=dt.value),te.value&&clearTimeout(te.value),ve.value=!0,te.value=setTimeout(()=>{ve.value=!1,ze()},500))},Me=()=>{if(!Ne.value)return;const l=Ne.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const s=l.value;l.value="M";const i=l.scrollHeight;l.value=s,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},X=()=>{Zt.value=!0,Me()},ul=()=>{Zt.value=!1,go()},go=()=>{if(!Ne.value)return;const l=Ne.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const o=l.value;l.value="M";const a=l.scrollHeight;l.value=o,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},No=l=>{const a=l.target.value;Zt.value&&Me(),ie("update:description",a),ie("description-change",a),Ot.value="description",S.richText&&(ve.value||(tt.value=$t.value,mt.value=wt.value,pt.value=dt.value),te.value&&clearTimeout(te.value),ve.value=!0,te.value=setTimeout(()=>{ve.value=!1,ze()},500))},ft=()=>{const l=window.getSelection();if(l.rangeCount===0)return null;const o=l.getRangeAt(0);if(o.startContainer.nodeType===1)return{type:"element",element:o.startContainer,offset:o.startOffset};const a=o.cloneRange();return a.selectNodeContents(g.value),a.setEnd(o.startContainer,o.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+o.toString().length}},Nt=l=>{if(!(!l||!g.value))try{const o=window.getSelection(),a=document.createRange();if(l.type==="element"&&l.element)if(g.value.contains(l.element)){a.setStart(l.element,l.offset),a.collapse(!0),o.removeAllRanges(),o.addRange(a);return}else{g.value.focus();return}let s=0;const i=[g.value];let d=null,u=!1,m=!1;for(;!m&&(d=i.pop());)if(d.nodeType===3){const p=s+d.length;!u&&l.start>=s&&l.start<=p&&(a.setStart(d,l.start-s),u=!0),u&&l.end>=s&&l.end<=p&&(a.setEnd(d,l.end-s),m=!0),s=p}else{let p=d.childNodes.length;for(;p--;)i.push(d.childNodes[p])}o.removeAllRanges(),o.addRange(a)}catch{g.value.focus()}},Ko=()=>{if(!g.value)return;g.value.focus();const l=window.getSelection(),o=document.createRange(),a=i=>{if(i.nodeType===3||i.childNodes.length===0)return i;for(let d=i.childNodes.length-1;d>=0;d--){const u=i.childNodes[d],m=a(u);if(m)return m}return i},s=a(g.value);if(s.nodeType===3)o.setStart(s,s.length),o.setEnd(s,s.length);else if(s.childNodes.length>0){const i=a(s);i&&i.nodeType===3?(o.setStart(i,i.length),o.setEnd(i,i.length)):(o.selectNodeContents(s),o.collapse(!1))}else o.setStart(s,0),o.setEnd(s,0);l.removeAllRanges(),l.addRange(o)},ze=(l=!1)=>{if(!g.value)return;const o=g.value.innerHTML,a=S.title||"",s=S.description||"";if(!l&&o===$t.value&&a===wt.value&&s===dt.value)return;const i={content:tt.value||$t.value,title:mt.value!==void 0?mt.value:wt.value,description:pt.value!==void 0?pt.value:dt.value},d=xt.value.length>0?xt.value[xt.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=i.content!==d:u=i.content!==d.content||i.title!==d.title||i.description!==d.description),u&&(xt.value.push(i),xt.value.length>50&&xt.value.shift(),lt.value=[]),$t.value=o,wt.value=a,dt.value=s,tt.value=o,mt.value=a,pt.value=s},fe=l=>{if(!g.value)return;Xt(),g.value&&cl(g.value);let o=null;g.value&&(g.value.querySelector("p")||(o=ft(),gn()));const a=l&&l.inputType&&(l.inputType==="insertText"||l.inputType==="insertCompositionText"||l.inputType==="deleteContentBackward"||l.inputType==="deleteContentForward");a&&ao.value&&(ao.value=null),et.value=!0;const s=g.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),i=jo(s);ie("update:modelValue",i),ie("change",i),Ot.value="editor",ve.value||(tt.value=$t.value,mt.value=wt.value,pt.value=dt.value),te.value&&clearTimeout(te.value),ve.value=!0,te.value=setTimeout(()=>{ve.value=!1,ze(),En(),Jn()},500),e.nextTick(()=>{o&&Nt(o),Xt();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,p=m&&m.collapsed;if(d.forEach(h=>{try{if(p&&ao.value?.command===h){j.value[h]=ao.value.state;return}if(h==="bold")if(m){const x=m.commonAncestorContainer,w=x.nodeType===3?x.parentElement:x;let k=!1;if(w&&((w.tagName==="STRONG"||w.tagName==="B"||w.closest&&w.closest("strong, b"))&&(k=!0),!k&&w.style&&parseInt(w.style.fontWeight)>=600&&(k=!0),!k))try{const T=window.getComputedStyle(w);parseInt(T.fontWeight)>=600&&(k=!0)}catch{}j.value[h]=k}else j.value.hasOwnProperty(h)||(j.value[h]=!1);else if(h==="italic")if(m){const x=m.commonAncestorContainer,w=x.nodeType===3?x.parentElement:x,k=w&&(w.tagName==="EM"||w.tagName==="I"||w.closest&&w.closest("em, i"));j.value[h]=!!k}else{const x=document.queryCommandState(h);j.value[h]=x}else{const x=document.queryCommandState(h);j.value[h]=x}}catch{}}),it(),Yt(),ro(),me(),eo(),Tt("handleRichTextInput"),a&&(l.inputType==="insertText"||l.inputType==="insertCompositionText")){const h=l.data||"";h&&h.length===1&&setTimeout(()=>Jn(h),0),(h===" "||h===`
78
- `||/[.,;:!?]/.test(h))&&setTimeout(()=>{En()},100)}et.value=!1})},Xt=()=>{if(!g.value)return;const l=window.getSelection();if(!l||l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer,s=a.nodeType===3?a.parentElement:a;if(!s)return;const i=s.closest(".dss-image-wrapper");if(i){const d=i.querySelector("img");if(s!==d&&!d?.contains(s)){const u=o.startContainer.nodeType===3?o.startContainer.parentElement:o.startContainer,m=o.endContainer.nodeType===3?o.endContainer.parentElement:o.endContainer;if(i.contains(u)&&u!==d||i.contains(m)&&m!==d){const p=document.createRange();p.setStartAfter(i),p.collapse(!0),l.removeAllRanges(),l.addRange(p)}}}},gn=()=>{if(!g.value)return;const l=g.value;if(l.querySelector&&l.querySelector("p"))return;const o=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(l.childNodes);let s=null;a.forEach(i=>{if(i.nodeType===Node.TEXT_NODE){if((i.textContent||"").trim()===""){i.parentNode===l&&l.removeChild(i);return}s||(s=document.createElement("p"),l.insertBefore(s,i)),s.appendChild(i);return}if(i.nodeType===Node.ELEMENT_NODE){const d=i,u=d.tagName;if(u==="BR"){s=null;return}if(o.has(u)){s=null;return}s||(s=document.createElement("p"),l.insertBefore(s,d)),s.appendChild(d)}})},Yt=()=>{if(g.value&&!ho.value){ho.value=!0;try{g.value.querySelectorAll(".dss-image-wrapper").forEach(s=>{s.querySelector("img")||s.remove()}),g.value.querySelectorAll(".dss-image-no-alt-icon").forEach(s=>{const i=s.parentElement;!i||!i.classList.contains("dss-image-wrapper")?s.remove():i.querySelector("img")||s.remove()}),g.value.querySelectorAll("img").forEach(s=>{let i=s.getAttribute("alt");i===null&&(i=s.alt||"");const d=s.getAttribute("src")||s.src||"";if(i){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),x=i===d||i===h;(i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")||x||x)&&(i="")}s.setAttribute("alt",i),s.setAttribute("data-alt",i);const u=!i||i.trim()==="";let m=s.parentElement;const p=m&&m.classList.contains("dss-image-wrapper");if(p){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=s.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?s.nextElementSibling:null;h&&h.remove()}if(u){p?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),s.parentNode.insertBefore(m,s),m.appendChild(s));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=Uo,m.appendChild(h)}else if(p&&m.children.length===1){const h=m.parentNode;h.insertBefore(s,m),h.removeChild(m)}})}finally{ho.value=!1}}},dl=l=>{En(),ie("blur",l),Fo()},yn=()=>{if(S.disabled||!S.richText||!g.value)return;Qe(),te.value&&(clearTimeout(te.value),te.value=null),ve.value&&(ze(),ve.value=!1);const l=Ot.value==="title",o=Ot.value==="description",a=Ot.value==="editor";if(xt.value.length===0){l&&se.value?se.value.focus():o&&Ne.value?Ne.value.focus():g.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{fe()});return}const s={content:g.value.innerHTML,title:S.title||"",description:S.description||""};lt.value.push(s);const i=xt.value.pop();if(i!==void 0){et.value=!0;const d=typeof i=="string"?i:i.content,u=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";g.value.innerHTML=d,$t.value=d,wt.value=u,dt.value=m,tt.value=d,mt.value=u,pt.value=m,e.nextTick(()=>{it(),Le(),to(),me();const p=jo(d);ie("update:modelValue",p),ie("update:title",u),ie("update:description",m),ie("change",p),ie("title-change",u),ie("description-change",m),et.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(se.value){se.value.focus();const h=u.length;se.value.setSelectionRange&&se.value.setSelectionRange(h,h),oe()}}else if(o){if(Ne.value){Ne.value.focus();const h=m.length;Ne.value.setSelectionRange(h,h)}}else if(a)Ko();else if(se.value&&document.activeElement===se.value){const h=u.length;se.value.setSelectionRange&&se.value.setSelectionRange(h,h),oe()}else if(Ne.value&&document.activeElement===Ne.value){const h=m.length;Ne.value.setSelectionRange(h,h)}else g.value&&Ko()},10)})})}},Cn=()=>{if(S.disabled||!S.richText||!g.value)return;Qe();const l=Ot.value==="title",o=Ot.value==="description",a=Ot.value==="editor";if(lt.value.length===0){l&&se.value?se.value.focus():o&&Ne.value?Ne.value.focus():g.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{fe()});return}const s={content:g.value.innerHTML,title:S.title||"",description:S.description||""};xt.value.push(s);const i=lt.value.pop();if(i!==void 0){et.value=!0;const d=typeof i=="string"?i:i.content,u=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";g.value.innerHTML=d,$t.value=d,wt.value=u,dt.value=m,tt.value=d,mt.value=u,pt.value=m,e.nextTick(()=>{it(),Le(),to(),me();const p=jo(d);ie("update:modelValue",p),ie("update:title",u),ie("update:description",m),ie("change",p),ie("title-change",u),ie("description-change",m),et.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(se.value){se.value.focus();const h=u.length;se.value.setSelectionRange&&se.value.setSelectionRange(h,h),oe()}}else if(o){if(Ne.value){Ne.value.focus();const h=m.length;Ne.value.setSelectionRange(h,h)}}else if(a)Ko();else if(se.value&&document.activeElement===se.value){const h=u.length;se.value.setSelectionRange&&se.value.setSelectionRange(h,h),oe()}else if(Ne.value&&document.activeElement===Ne.value){const h=m.length;Ne.value.setSelectionRange(h,h)}else g.value&&Ko()},10)})})}},Go=()=>{if(!g.value)return;g.value.querySelectorAll('span[style*="font-weight"]').forEach(s=>{const i=s.style.fontWeight;if(i==="normal"||i==="400"){const d=document.createDocumentFragment();for(;s.firstChild;)d.appendChild(s.firstChild);s.parentNode&&s.parentNode.replaceChild(d,s)}}),g.value.querySelectorAll('span[style*="font-weight"]').forEach(s=>{if(parseInt(s.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";s.firstChild;)d.appendChild(s.firstChild);s.parentNode&&s.parentNode.replaceChild(d,s)}}),g.value.querySelectorAll("b, strong").forEach(s=>{s.style.fontWeight="600"})},ro=()=>{if(!g.value)return;g.value.querySelectorAll("i, em").forEach(o=>{o.style.fontStyle="italic"})},In=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const o=l.getRangeAt(0);let a=!1;if(o.collapsed){const s=o.startContainer;let i=s.nodeType===3?s.parentElement:s;for(;i&&i!==g.value;){if(i.tagName==="EM"||i.tagName==="I"){a=!0;break}if(i.style&&i.style.fontStyle==="italic"){a=!0;break}i=i.parentElement}}else{const s=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(s){const i=document.createTreeWalker(s,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=i.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==g.value;){if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{ro()}),!1;if(o.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{ro()});else try{const s=o.extractContents(),i=document.createElement("em");i.style.fontStyle="italic",i.appendChild(s),o.insertNode(i),o.setStartAfter(i),o.collapse(!0),l.removeAllRanges(),l.addRange(o),e.nextTick(()=>{ro()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{ro()})}return!0},ml=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const o=l.getRangeAt(0);let a=!1;if(o.collapsed){const s=o.startContainer;let i=s.nodeType===3?s.parentElement:s;for(;i&&i!==g.value;){if(i.tagName==="STRONG"||i.tagName==="B"){a=!0;break}if(i.style&&parseInt(i.style.fontWeight)>=600){a=!0;break}i=i.parentElement}}else{const s=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(s){const i=document.createTreeWalker(s,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=i.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==g.value;){if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{Go()}),!1;if(o.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0),d=i.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==g.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const p=document.createElement("b");p.style.fontWeight="600";const h=document.createDocumentFragment();for(;u.firstChild;)h.appendChild(u.firstChild);p.appendChild(h),u.parentNode&&u.parentNode.replaceChild(p,u),i.setStart(p,0),i.collapse(!0),s.removeAllRanges(),s.addRange(i);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===g.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",i.insertNode(m),i.setStart(m,0),i.collapse(!0),s.removeAllRanges(),s.addRange(i)}}Go()});else try{const s=o.extractContents(),i=document.createElement("b");i.style.fontWeight="600",i.appendChild(s),o.insertNode(i),o.setStartAfter(i),o.collapse(!0),l.removeAllRanges(),l.addRange(o),e.nextTick(()=>{Go()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Go()})}return!0},at=(l,o=null)=>{if(S.disabled||!S.richText||!g.value)return;ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Qe(),g.value.focus();const a=window.getSelection();let s=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&ko(d)&&(s=ft())}if(l==="createLink"&&o){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const p=document.createTextNode(o);u.insertNode(p),u.selectNodeContents(p)}}}if(l==="bold"){const d=ml();j.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(ao.value={command:"bold",state:d}),e.nextTick(()=>{s&&(Nt(s),e.nextTick(()=>{const m=st("bold");j.value.bold=m})),fe(),Le(),me()});return}if(l==="italic"){const d=In();j.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(ao.value={command:"italic",state:d}),e.nextTick(()=>{s&&(Nt(s),e.nextTick(()=>{const m=st("italic");j.value.italic=m})),fe(),ro(),Le(),me()});return}let i=!1;try{i=document.execCommand(l,!1,o)}catch{}e.nextTick(()=>{if(s&&Nt(s),["bold","italic","underline"].includes(l))try{if(l==="bold")s&&e.nextTick(()=>{const u=st("bold");j.value.bold=u});else if(l==="italic")if(s)e.nextTick(()=>{const u=st("italic");j.value.italic=u});else{const u=document.queryCommandState(l);j.value[l]=u}else{const u=document.queryCommandState(l);j.value[l]=u}}catch{j.value.hasOwnProperty(l)?j.value[l]=!j.value[l]:j.value[l]=!0}if(l==="createLink"&&o){const u=window.getSelection();if(u.rangeCount>0){const p=u.getRangeAt(0),h=p.commonAncestorContainer.nodeType===1?p.commonAncestorContainer.closest("a"):p.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",o)}g.value.querySelectorAll("a").forEach(p=>{const h=p.getAttribute("href");(!h||h===""||h==="#")&&p.setAttribute("href",o)})}fe(),Le(),me()})},st=(l,o=null)=>{if(S.disabled||!g.value)return!1;try{if(l==="formatBlock"&&o){const s=document.queryCommandValue("formatBlock");if(o==="<blockquote>"){const i=s.toLowerCase();if(i==="blockquote"||i==="<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 s===o||s.toLowerCase()===o.toLowerCase()}if(["bold","italic","underline"].includes(l))try{const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0);if(l==="bold"){let u=!1;if(i.collapsed){const m=i.commonAncestorContainer,p=m.nodeType===3?m.parentElement:m;if(p&&((p.tagName==="STRONG"||p.tagName==="B"||p.closest&&p.closest("strong, b"))&&(u=!0),!u&&p.style&&parseInt(p.style.fontWeight)>=600&&(u=!0),!u))try{const h=window.getComputedStyle(p);parseInt(h.fontWeight)>=600&&(u=!0)}catch{}return j.value.hasOwnProperty(l)?j.value[l]:(j.value[l]=u,u)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let p=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let x;for(;x=h.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(x))){if(x.nodeType===3){if(!(x.textContent||"").trim())continue;p=!0;let k=x.parentElement;for(;k&&k!==g.value;){if(k.tagName==="STRONG"||k.tagName==="B"){u=!0;break}if(k.style&&parseInt(k.style.fontWeight)>=600){u=!0;break}k=k.parentElement}}else if(x.nodeType===1){const w=x;if(w.tagName==="STRONG"||w.tagName==="B"){u=!0;break}if(w.style&&parseInt(w.style.fontWeight)>=600){u=!0;break}}if(u)break}}return j.value[l]=u&&p,u&&p}}if(l==="italic"){let u=!1;if(i.collapsed){const m=i.commonAncestorContainer,p=m.nodeType===3?m.parentElement:m;if(p&&((p.tagName==="EM"||p.tagName==="I"||p.closest&&p.closest("em, i"))&&(u=!0),!u&&p.style&&p.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(p).fontStyle==="italic"&&(u=!0)}catch{}return j.value.hasOwnProperty(l)?j.value[l]:(j.value[l]=u,u)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let p=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let x;for(;x=h.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(x))){if(x.nodeType===3){if(!(x.textContent||"").trim())continue;p=!0;let k=x.parentElement;for(;k&&k!==g.value;){if(k.tagName==="EM"||k.tagName==="I"){u=!0;break}if(k.style&&k.style.fontStyle==="italic"){u=!0;break}k=k.parentElement}}else if(x.nodeType===1){const w=x;if(w.tagName==="EM"||w.tagName==="I"){u=!0;break}if(w.style&&w.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return j.value[l]=u&&p,u&&p}}const d=document.queryCommandState(l);return i.collapsed&&j.value.hasOwnProperty(l)?j.value[l]:(j.value[l]=d,d)}return j.value.hasOwnProperty(l)?j.value[l]:!1}catch{return j.value.hasOwnProperty(l)?j.value[l]:!1}try{return document.queryCommandState(l)}catch{return!1}}catch{return!1}},_n=l=>{S.disabled||!S.richText||(Re.value=Re.value===l?null:l,l==="askAi"&&(At.value=null))},Qe=()=>{Re.value=null,rt.value=null},jt=l=>{at("formatBlock",l),Qe()},pl=l=>{if(!l||!g.value)return l;const o=L=>{let F=L.nodeType===Node.TEXT_NODE?L.parentElement:L;for(;F&&F!==g.value;){const Q=F.tagName;if(Q==="P"){const Pe=F.parentElement;if(Pe===g.value||Pe.tagName==="BLOCKQUOTE")return F}if(Q==="BLOCKQUOTE")break;F=F.parentElement}return null},a=o(l.startContainer),s=o(l.endContainer);if(!a||!s)return l;const i=[],d=document.createTreeWalker(g.value,NodeFilter.SHOW_ELEMENT,{acceptNode:L=>{const F=L.tagName;if(F==="P"){const Q=L.parentElement;if(Q===g.value||Q.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return F==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)i.push(u);const m=i.indexOf(a),p=i.indexOf(s);if(m===-1||p===-1)return l;const h=Math.min(m,p),x=Math.max(m,p),w=i.slice(h,x+1);if(w.length===0)return l;const k=w[0],T=w[w.length-1],B=document.createRange();return B.setStartBefore(k),B.setEndAfter(T),B},Io=()=>{if(S.disabled||!S.richText||!g.value)return;ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Qe(),g.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;let o=l.getRangeAt(0);!o.collapsed&&ko(o)&&(o=pl(o),l.removeAllRanges(),l.addRange(o));let a=null;!o.collapsed&&ko(o)&&(a=ft());const s=o.commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!!(i&&g.value.contains(i))){if(i){const u=i.parentNode;Array.from(i.childNodes).forEach(p=>{if(p.nodeType===Node.ELEMENT_NODE)if(p.tagName==="P"||p.tagName==="DIV")u.insertBefore(p,i);else{const h=document.createElement("p");h.appendChild(p.cloneNode(!0)),u.insertBefore(h,i)}else if(p.nodeType===Node.TEXT_NODE&&p.textContent.trim()){const h=document.createElement("p");h.appendChild(p.cloneNode(!0)),u.insertBefore(h,i)}}),i.remove()}}else if(o.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=o.extractContents();u.appendChild(m),o.insertNode(u);const p=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:k=>k.parentNode===u&&k.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let x;for(;x=h.nextNode();)p.push(x);if(p.forEach(k=>{const T=document.createElement("p");k.parentNode.insertBefore(T,k),T.appendChild(k)}),u.querySelectorAll("p, div").forEach(k=>{k.textContent.trim()===""&&!k.querySelector("img")&&(k.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const k=document.createElement("p");k.innerHTML="<br>",u.appendChild(k)}}e.nextTick(()=>{a&&Nt(a),to(),fe(),me()})},kn=()=>{if(!g.value)return;const l=window.getSelection();if(l.rangeCount===0)return;const a=l.getRangeAt(0).commonAncestorContainer,s=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!s||!g.value.contains(s))return;const i=x=>{if(!x)return!1;const w=x.textContent||"",T=(x.innerHTML||"").trim();return w.trim()===""||T===""||T==="<br>"||T==="<br/>"||T==="<p></p>"||T==="<p><br></p>"||T==="<p><br/></p>"||T==="<p> </p>"||T==="<p><br> </p>"||T==="<div></div>"||T==="<div><br></div>"||T==="<div><br/></div>"};let d=null;for(a.nodeType===3?d=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?d=a:d=a.closest("p, div"),d&&s.contains(d)&&i(d)&&d.remove();s.lastChild;){const x=s.lastChild;if(x.nodeType===1&&x.tagName==="BR")x.remove();else if(x.nodeType===3)if((x.textContent||"").trim()==="")x.remove();else break;else break}if(s.children.length>0)for(let x=s.children.length-1;x>=0;x--){const w=s.children[x];if((w.tagName==="P"||w.tagName==="DIV")&&i(w))w.remove();else break}let u=s.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(s.innerHTML=u);const p=document.createElement("p");p.innerHTML="<br>",s.parentNode?s.nextSibling?s.parentNode.insertBefore(p,s.nextSibling):s.parentNode.appendChild(p):g.value&&g.value.appendChild(p);const h=document.createRange();h.selectNodeContents(p),h.collapse(!0),l.removeAllRanges(),l.addRange(h),e.nextTick(()=>{to(),fe()})},Le=()=>{if(!g.value){ct.value=!1;return}try{const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,s=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");ct.value=!!s}else ct.value=!1}catch{ct.value=!1}},Rn=()=>{if(!g.value)return;const l=window.getSelection();l&&l.rangeCount>0&&l.getRangeAt(0),je.value=ft();const o=window.getSelection();let a="";o.rangeCount>0&&(a=o.getRangeAt(0).toString()),$.value="",Ye.value=a,ae.value="",He.value=null,yt.value=!0,Qe(),e.nextTick(()=>{Ht.value&&Ht.value.focus()})},Fn=()=>{if(!g.value)return;ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze();const l=window.getSelection();let o=null;if(l.rangeCount>0){const s=l.getRangeAt(0).commonAncestorContainer;o=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a")}if(!o&&He.value&&(o=He.value),o&&o.parentNode){const a=document.createDocumentFragment();for(;o.firstChild;)a.appendChild(o.firstChild);if(o.parentNode.replaceChild(a,o),a.firstChild){const s=document.createRange();s.setStartBefore(a.firstChild),s.setEndAfter(a.lastChild||a.firstChild),l.removeAllRanges(),l.addRange(s),document.execCommand("removeFormat",!1),s.collapse(!1),l.removeAllRanges(),l.addRange(s)}He.value=null}else at("unlink");ct.value=!1,Qe(),e.nextTick(()=>{fe(),Le()})},zn=()=>{S.disabled||!S.richText||g.value&&(ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Qe(),g.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{it(),fe(),me()}))},Pn=()=>{S.disabled||!S.richText||g.value&&(ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Qe(),g.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{it(),fe(),me()}))},On=l=>{const o=l.parentElement;if(!o||o.tagName!=="OL")return null;let a=0,s=l.previousElementSibling;for(;s;)s.tagName==="LI"&&a++,s=s.previousElementSibling;return a+1},it=()=>{if(!g.value)return;g.value.querySelectorAll("li > ol").forEach(o=>{const a=o.parentElement;if(a&&a.tagName==="LI"){const s=On(a);s!==null&&Array.from(o.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(s))})}})},Zn=()=>{if(S.disabled||!S.richText||!g.value)return;Qe(),g.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{it(),fe()});return}const s=a.parentElement;if(!s||s.tagName!=="OL"&&s.tagName!=="UL")return;const i=a.previousElementSibling;if(i&&i.tagName==="LI"){const d=s.tagName.toLowerCase();let u=i.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),i.appendChild(u));const m=On(i);u.appendChild(a),m!==null&&s.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),it();const p=document.createRange();p.selectNodeContents(a),p.collapse(!1),l.removeAllRanges(),l.addRange(p),e.nextTick(()=>{fe(),me()})}else document.execCommand("indent",!1),e.nextTick(()=>{it(),fe(),me()})},Wn=()=>{if(S.disabled||!S.richText||!g.value)return;Qe(),g.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{it(),fe()});return}const s=a.parentElement;if(!s||s.tagName!=="OL"&&s.tagName!=="UL")return;const i=s.parentElement;if(i&&i.tagName==="LI"){const d=i.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){s.tagName==="OL"&&a.removeAttribute("data-parent-num"),d.insertBefore(a,i.nextSibling),s.children.length===0&&s.remove(),it();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),l.removeAllRanges(),l.addRange(u),e.nextTick(()=>{fe(),me()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{it(),fe(),me()})},qe=e.ref(null),Kt=e.ref(null),Mo=e.ref({}),Gt=e.ref(""),Mt=e.ref(null),io=e.ref("");e.ref("");const _t=e.ref(null);e.ref("");const $e=e.ref([]),E=e.ref(!1),De=e.ref(!1),Bt=l=>{if(!l)return"";const o=l.cloneRange(),a=document.createElement("div");return a.appendChild(o.cloneContents()),a.innerHTML},vt=()=>{if(S.disabled||!S.richText||!g.value)return;if(qe.value!==null){qe.value=null,Gt.value="",io.value="",_t.value=null,$e.value=[],wo(!0);return}Qe(),g.value.focus();const l=window.getSelection();if(!l||l.rangeCount===0)return;const o=l.getRangeAt(0);if(o.collapsed||!ko(o))return;io.value=Bt(o)||"",_t.value=ft();const a=o.getBoundingClientRect(),s=g.value.parentElement;if(!s)return;const i=s.getBoundingClientRect(),d=a.bottom-i.top,m=Math.max(d+8,0);Mo.value={top:`${m}px`,bottom:"auto"},qe.value=Date.now(),e.nextTick(()=>{if(Gt.value="",Mt.value){const h=Mt.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const p=s.querySelector(".dss-comment-overlay");if(p&&s){const h=s.querySelector(".dss-text-editor-footer");if(h){const x=s.getBoundingClientRect(),w=p.getBoundingClientRect(),k=h.getBoundingClientRect(),T=w.bottom-x.top,B=k.top-x.top,L=8;if(T>B-L){const F=k.height;Mo.value={bottom:`${F+L}px`,top:"auto"}}else Mo.value={top:`${m}px`,bottom:"auto"}}}})},Jt=()=>{if(!Gt.value.trim())return;const l=Gt.value.trim(),o=new Date,a={text:l,selectionText:io.value,selectionRange:_t.value,commentId:qe.value,user:S.commentUser||null,createdAt:o.toISOString()};$e.value=[...$e.value,a],ie("comment-submitted",a),Ve(a),_t.value&&!Xe(_t.value)&&yo(qe.value,_t.value),Gt.value="",e.nextTick(()=>{if(Mt.value){const s=Mt.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`,s.focus()}Tt("sendComment")})},Be=(l,o)=>{if(!(!S.commentUser||!l.user||l.user.id!==S.commentUser.id)){if($e.value=$e.value.filter((a,s)=>s!==o),qe.value!==null&&g.value){const a=String(qe.value),s=g.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(s&&$e.value.length>0){const i=[],d=new Set;$e.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),i.push(u.user))}),i.length>0?s.setAttribute("data-comment-user",JSON.stringify(i[0])):s.removeAttribute("data-comment-user"),i.length>1?s.setAttribute("data-comment-user-2",JSON.stringify(i[1])):s.removeAttribute("data-comment-user-2"),s.setAttribute("data-comment-count",String($e.value.length))}else s&&$e.value.length===0&&(s.removeAttribute("data-comment-user"),s.removeAttribute("data-comment-user-2"),s.setAttribute("data-comment-count","0"))}if(ie("comment-deleted",{comment:l,index:o,commentId:qe.value}),S.comments&&Array.isArray(S.comments)){const a=S.comments.filter(s=>!(s.commentId===l.commentId&&s.text===l.text&&s.user?.id===l.user?.id));ie("update:comments",a)}e.nextTick(()=>{Tt("deleteComment")})}},Xe=l=>{if(!l||!g.value)return!1;try{const o=Qt(l);if(!o)return!1;const a=o.commonAncestorContainer,s=a.nodeType===3?a.parentElement:a;if(s)return!!s.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Qt=l=>{if(!l||!g.value)return null;try{const o=document.createRange();if(l.type==="element"&&l.element)return g.value.contains(l.element)?(o.setStart(l.element,l.offset),o.collapse(!0),o):null;let a=0;const s=[g.value];let i=null,d=!1,u=!1;for(;!u&&(i=s.pop());)if(i.nodeType===3){const m=a+i.length;!d&&l.start>=a&&l.start<=m&&(o.setStart(i,l.start-a),d=!0),d&&l.end>=a&&l.end<=m&&(o.setEnd(i,l.end-a),u=!0),a=m}else{let m=i.childNodes.length;for(;m--;)s.push(i.childNodes[m])}return d?o:null}catch{return null}},yo=(l,o)=>{if(!(!l||!o||!g.value))try{const a=Qt(o);if(!a||a.collapsed)return;const s=a.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i){const m=i.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(l)&&m.getAttribute("data-fake-comment")!==String(l)&&m.setAttribute("data-comment",String(l));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(l));try{const m=a.startContainer,p=a.endContainer,h=a.startOffset,x=a.endOffset,w=m.nodeType===3?m.parentNode:m,k=p.nodeType===3?p.parentNode:p;if(w===k&&h===0&&x===(p.nodeType===3?p.length:k.childNodes.length)&&(w.tagName==="P"||w.tagName==="DIV"||w.tagName==="H1"||w.tagName==="H2"||w.tagName==="H3"||w.tagName==="H4"||w.tagName==="H5"||w.tagName==="H6")){const B=a.extractContents();d.appendChild(B),a.insertNode(d)}else a.surroundContents(d)}catch{const p=a.extractContents();d.appendChild(p),a.insertNode(d)}const u=g.value.querySelector(`[data-comment="${String(l)}"]`);e.nextTick(()=>{Tt("wrapSelectionWithCommentMarker"),fe()})}catch{}},Ve=l=>{if(!l||!l.commentId)return;const o=Array.isArray(S.comments)?[...S.comments]:[],a=typeof l.commentId=="string"&&l.commentId.startsWith("comment-")?Date.now():Number(l.commentId)||l.commentId;let s=o.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(a)||d.conversation_id===a);const i={text:l.text,user:l.user,createdAt:l.createdAt,created_at:l.createdAt,updated_at:l.createdAt};if(s>=0){const d=o[s];if(d.conversation||(d.conversation=[]),d.conversation.push(i),d.updated_at=l.createdAt,!d.article_id&&o.length>0){const u=o.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=l.selectionRange,u=o.length>0&&o.find(p=>p.article_id)?.article_id||null,m={conversation_id:a,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:l.selectionText||"",conversation:[i],created_by_user:l.user,created_at:l.createdAt,updated_at:l.createdAt,status:"active"};o.push(m)}E.value=!0,ie("update:comments",o)},Se=(l,o=[])=>{if(S.disabled||!S.richText||!g.value)return;const a=g.value;let s=null;try{s=a.querySelector(l)}catch{return}if(!s)return;Qe(),a.focus();const i=document.createRange();i.selectNodeContents(s);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(i)),io.value=s.innerHTML||"",_t.value=ft();const u=i.getBoundingClientRect(),m=a.parentElement;if(m){const x=m.getBoundingClientRect(),w=u.bottom-x.top,T=Math.max(w+8,0);Mo.value={top:`${T}px`,bottom:"auto"}}const p=s.getAttribute("data-comment")||s.getAttribute("data-fake-comment");let h=[];if(p&&S.comments&&Array.isArray(S.comments)){const x=S.comments.find(w=>String(w.conversation_id)===String(p));if(x&&x.conversation&&Array.isArray(x.conversation)){const w=x.conversation.map(k=>({id:k.id||k.commentary_id,commentary_id:k.id||k.commentary_id,conversation_id:x.id||x.conversation_id,text:k.text,user:k.user,createdAt:k.created_at||k.createdAt,updated_at:k.updated_at||k.updatedAt}));h.push(...w)}}h.length===0&&Array.isArray(o)&&o.length>0&&(h=o.slice()),h.sort((x,w)=>{const k=L=>{if(!L)return 0;const F=new Date(L).getTime();return isNaN(F)?0:F},T=k(x.createdAt),B=k(w.createdAt);return T===B?0:T-B}),$e.value=h,wo(!0),qe.value=p||null,s&&(Kt.value=s,s.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Gt.value="",Mt.value){const x=Mt.value;x.style.height="auto",x.style.height=`${x.scrollHeight}px`,x.focus()}if(m){const x=m.querySelector(".dss-comment-overlay");if(x){const w=m.querySelector(".dss-text-editor-footer");if(w){const k=m.getBoundingClientRect(),T=x.getBoundingClientRect(),B=w.getBoundingClientRect(),L=T.bottom-k.top,F=B.top-k.top,Q=8;if(L>F-Q){const Pe=B.height;Mo.value={bottom:`${Pe+Q}px`,top:"auto"}}}}}Tt("openCommentOverlayForSelector")})},ce=e.ref(null),ot=e.ref(0),_o=l=>{if(!(S.disabled||!S.richText)){if(l.key==="Escape"){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!!(i&&g.value&&g.value.contains(i))){l.preventDefault();let u=null;s.nodeType===3?u=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?u=s:u=s.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&i.contains(u)&&u.nextSibling?i.insertBefore(m,u.nextSibling):i.appendChild(m),setTimeout(()=>{kn()},50);return}}}if(l.key.length===1||l.key==="Enter"){const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0),s=a.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i){const d=i.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(i!==u&&!u?.contains(i)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,p=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(p)&&p!==u){l.preventDefault();const h=document.createRange();h.setStartAfter(d),h.collapse(!0),o.removeAllRanges(),o.addRange(h);return}}}}}}if(l.key==="Backspace"||l.key==="Delete"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);let s=null,i=null;if(a.collapsed)if(l.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(s=m,i=s.closest(".dss-image-wrapper"))),i||(i=u.closest(".dss-image-wrapper"),i&&(s=i.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(s=m,i=s.closest(".dss-image-wrapper"))),i||(i=u.closest(".dss-image-wrapper"),i&&(s=i.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(s=d,i=s.closest(".dss-image-wrapper")):(s=d.querySelector("img"),s&&(i=s.closest(".dss-image-wrapper"))),i){const p=i.contains(u)||u===i,h=i.contains(m)||m===i,w=a.cloneContents().textContent?.trim()||"",k=i.textContent?.trim()||"";(!p||!h||w.length>k.length)&&(i=null,s=null)}}if(i){l.preventDefault(),l.stopPropagation();const d=i.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,i),i.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),o.removeAllRanges(),o.addRange(m),e.nextTick(()=>{fe()});return}}}}if(l.key==="Tab"){l.preventDefault(),l.shiftKey?Wn():Zn();return}if(l.key==="Enter"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);if(a.collapsed){const u=a.startContainer,m=p=>{if(!p)return!1;let h=p.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 x=p.parentElement;return x&&x!==g.value?m(x):!1};if(u.nodeType===3){const p=u.parentElement;if(p&&(m(p)||m(u))){const h=p.closest("p, div");if(h&&h!==g.value){l.preventDefault(),l.stopPropagation();let x=null;const w=a.startOffset;w<u.length&&(x=u.splitText(w));const k=document.createElement("p");if(x?k.appendChild(x):k.innerHTML="<br>",u.length===0){const B=u.parentElement;B&&(B.removeChild(u),B.childNodes.length===0&&B.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(k,h.nextSibling):h.parentNode.appendChild(k);const T=document.createRange();x?T.setStart(x,0):T.setStart(k,0),T.collapse(!0),o.removeAllRanges(),o.addRange(T),e.nextTick(()=>{fe()});return}}}}const s=a.commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!!(i&&g.value&&g.value.contains(i))){let u=null;s.nodeType===3?u=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?u=s:u=s.closest("p, div");const m=B=>{if(!B)return!1;const L=B.textContent||"",Q=(B.innerHTML||"").trim(),Pe=Q.replace(/<br\s*\/?>/gi,"").trim();return L.trim()===""||Q===""||Pe===""||Q==="<br>"||Q==="<br/>"||Q==="<p></p>"||Q==="<p><br></p>"||Q==="<p><br/></p>"||Q==="<p> </p>"||Q==="<p><br> </p>"||Q==="<div></div>"||Q==="<div><br></div>"||Q==="<div><br/></div>"},p=i.lastChild,h=p&&p.nodeType===1&&p.tagName==="BR",x=a.startContainer,w=x.nodeType===3?x.parentElement:x,k=w===i||w&&w.parentElement===i;if(u&&m(u)||h&&k){l.preventDefault(),setTimeout(()=>{kn()},50);return}}}}if(l.key===" "){const o=Date.now(),a=o-ot.value;if(ce.value===" "&&a<300){const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0),d=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer.closest("li"):i.commonAncestorContainer.parentElement?.closest("li");if(d){const u=i.startContainer.textContent?.substring(0,i.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){l.preventDefault(),Zn();return}}}}ce.value=" ",ot.value=o}else ce.value=l.key}},Un=l=>{if(S.disabled||!S.richText)return;l.preventDefault();let o=l.clipboardData.getData("text/html"),a=l.clipboardData.getData("text/plain");o&&(o=o.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),ze();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){let m=s.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),i=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const p=new DOMParser().parseFromString(u,"text/html");let h=g.value.querySelector("h1")?1:0;if(p.querySelectorAll("h1").forEach(w=>{if(h>0){const k=p.createElement("p");k.innerHTML=w.innerHTML,w.parentNode.replaceChild(k,w)}else h++}),i){const w=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],k=Array.from(p.body.children).filter(T=>w.includes(T.tagName));if(k.length===1){const T=k[0].tagName,B=i.tagName,L=i.textContent.trim()===""&&!i.querySelector("img");let F=!1;if(["H1","H2","H3","H4","H5","H6"].includes(B)?F=!0:L||(T===B||T==="P")&&(F=!0),F)return k[0].innerHTML.trim()}}return p.body.innerHTML.trim()};if(o){const u=d(o);document.execCommand("insertHTML",!1,u)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=d(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);fe()},Ro=l=>{if(Re.value){const a=l.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Qe()}if(xe.value){const a=l.target,s=a.closest(".dss-floating-toolbar"),i=g.value&&a.closest(".dss-text-editor-content");!s&&!i&&Fo()}if(At.value){const a=l.target,s=a.closest(".dss-floating-toolbar"),i=a.closest(".dss-toolbar-dropdown");!s&&!i&&oo()}const o=l.target;if(!o.closest(".dss-toolbar-dropdown")&&!o.closest(".dss-toolbar-dropdown-submenu")&&(rt.value=null),!g.value||!o.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);Ue.value=!s.collapsed&&ko(s)}else Ue.value=!1}if(qe.value!==null){const a=document.querySelector(".dss-comment-overlay");let s=!1;if(a){const u=a.getBoundingClientRect(),m=l.clientX,p=l.clientY;s=m>=u.left&&m<=u.right&&p>=u.top&&p<=u.bottom}const i=o.closest(".dss-toolbar-button"),d=i&&i.getAttribute("title")==="Comment";!s&&!d&&(qe.value=null,Gt.value="",io.value="",_t.value=null,$e.value=[],wo(!0))}},Jo=(l,o)=>{l&&l.stopPropagation&&l.stopPropagation(),ut.value&&(clearTimeout(ut.value),ut.value=null),rt.value=o},qn=l=>{const o=l.relatedTarget;if(o){const a=o.closest(".dss-toolbar-dropdown-submenu"),s=o.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||s)return}ut.value&&clearTimeout(ut.value),ut.value=setTimeout(()=>{rt.value=null,ut.value=null},150)},Xn=l=>{rt.value=null};let Co=0;const Yn=l=>{if(!l)return;const o=Array.from(l.children);o.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),o.forEach((a,s)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const i=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),d=a.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(i||u){const m=`submenu-auto-${++Co}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let p=null;i?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(i,a.nextSibling),i.classList.add("dss-toolbar-dropdown-submenu"),p=i):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),p=d),p&&(p.setAttribute("data-submenu-id",m),p.setAttribute("data-processed","true"),i&&a.tagName!=="BUTTON"?p.dataset.originalParentRef="inside":p.dataset.originalParentRef="sibling",Array.from(p.children).forEach(x=>{(x.tagName==="BUTTON"||x.tagName==="DIV")&&!x.classList.contains("dss-toolbar-dropdown-item")&&x.classList.add("dss-toolbar-dropdown-item")}))}})},Rt=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(o=>{Yn(o),o.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(i=>{const d=i._subMenuHandlers;d&&(i.removeEventListener("mouseenter",d.enter),i.removeEventListener("mouseleave",d.leave));const u=p=>{const h=i.getAttribute("data-submenu-id");h&&Jo(p,h)},m=qn;i.addEventListener("mouseenter",u),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:u,leave:m}}),o.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(i=>{const d=i._subMenuHandlers;d&&(i.removeEventListener("mouseenter",d.enter),i.removeEventListener("mouseleave",d.leave));const u=h=>{const x=i.getAttribute("data-submenu-id");x&&Jo(h,x)},m=qn;i.addEventListener("mouseenter",u),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:u,leave:m},i.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",Xn)})})})};let Bo=null;const Qo=()=>{if(rt.value){const l=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${rt.value}"]`),o=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${rt.value}"]`);l&&o&&ll(l,o)}if(xe.value&&me(),S.richText){if(Bo!==null)return;Bo=setTimeout(()=>{Bo=null,Tt("handleWindowResize")},150)}},co=()=>{if(!S.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(o=>{Array.from(o.children).filter(s=>s.tagName==="DIV"&&!s.classList.contains("dss-toolbar-button")).forEach(s=>{s.classList.add("dss-toolbar-button")})})},fl=()=>{const l=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),o=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const s=window.getSelection();s.removeAllRanges?s.removeAllRanges():s.empty&&s.empty()}return!1};l.forEach(a=>{a.addEventListener("selectstart",o),a.addEventListener("mousedown",o),a.addEventListener("dragstart",o),a.addEventListener("contextmenu",o),a.addEventListener("click",s=>{if(window.getSelection){const i=window.getSelection();i.removeAllRanges&&i.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Et.value?oe():re(),Zt.value?Me():go()})}),e.nextTick(()=>{fl()}),S.richText&&g.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Ro),window.addEventListener("resize",Qo);let l=null;const o=()=>{l===null&&(l=setTimeout(()=>{l=null,Qo()},150))};window.addEventListener("scroll",o,!0),g.value._windowScrollHandler=o,g.value._windowScrollTimeout=l,g.value.closest(".editor-with-comments"),g.value.closest(".dss-text-editor-content-wrapper");const a=g.value.closest(".dss-text-editor-content");let s=null;const i=()=>{s===null&&(s=setTimeout(()=>{s=null,Qo()},150))};a&&(a.addEventListener("scroll",i),g.value._scrollHandlers={wrapper:null,content:a,handler:i}),e.nextTick(()=>{Rt(),co()}),g.value.addEventListener("click",m=>{const p=m.target;p.closest("a")&&!S.disabled&&m.preventDefault();const x=p.closest(".dss-image-no-alt-icon"),w=p.closest(".dss-image-wrapper");if(x||w&&p===w){m.preventDefault(),m.stopPropagation();const k=window.getSelection(),T=document.createRange();T.setStartAfter(w),T.collapse(!0),k.removeAllRanges(),k.addRange(T)}else w&&p.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const k=window.getSelection();if(k.rangeCount>0){const B=k.getRangeAt(0).commonAncestorContainer,L=B.nodeType===3?B.parentElement:B;if(w.contains(L)&&L!==w.querySelector("img")){const F=document.createRange();F.setStartAfter(w),F.collapse(!0),k.removeAllRanges(),k.addRange(F)}}else{const T=document.createRange();T.setStartAfter(w),T.collapse(!0),k.addRange(T)}}))},!0),g.value.addEventListener("mousedown",m=>{const p=m.target,h=p.closest(".dss-image-no-alt-icon"),x=p.closest(".dss-image-wrapper");if(h||x&&p.tagName!=="IMG"){m.preventDefault();const w=window.getSelection(),k=document.createRange();x&&(k.setStartAfter(x),k.collapse(!0),w.removeAllRanges(),w.addRange(k))}},!0),g.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!g.value)return;g.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 w=h.getAttribute("alt")||h.alt||"";if(w){const k=h.getAttribute("src")||h.src||"",T=k.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),B=w===k||w===T;(w.startsWith("http://")||w.startsWith("https://")||w.startsWith("data:")||B||B)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),Yt()})}),g.value.addEventListener("dragstart",m=>{const p=m.target,h=p.tagName==="IMG"?p:p.closest("img"),x=h?.closest(".dss-image-wrapper");h&&g.value.contains(h)&&(bt.value=x||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),g.value.addEventListener("dragover",m=>{bt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),g.value.addEventListener("dragenter",m=>{bt.value&&(m.preventDefault(),m.stopPropagation())}),g.value.addEventListener("drop",m=>{if(!bt.value||!g.value)return;m.preventDefault(),m.stopPropagation();const p=bt.value,h=p.classList?.contains("dss-image-wrapper"),x=h?p.querySelector("img"):p,w=h?p:x?.closest(".dss-image-wrapper");if(!x||!g.value.contains(x)){bt.value=null;return}let k=null;const T=m.clientX,B=m.clientY;if(document.caretRangeFromPoint)k=document.caretRangeFromPoint(T,B);else{const Te=window.getSelection();Te.rangeCount>0?k=Te.getRangeAt(0).cloneRange():(k=document.createRange(),k.selectNodeContents(g.value),k.collapse(!1))}if(!k){bt.value=null;return}const L=k.commonAncestorContainer,F=L.nodeType===3?L.parentElement:L;if(F?.closest(".dss-image-wrapper")===w||w&&w.contains(F)){bt.value=null;return}if(w&&(F===w||w.contains(F))){bt.value=null;return}const Pe=x.getAttribute("src");let Oe=null;w?Oe=w.cloneNode(!0):Oe=x.cloneNode(!0);try{let Te=k.startContainer;if(Te.nodeType===3&&(Te=Te.parentElement),w&&(Te===w||w.contains(Te))){const be=document.createRange();be.setStartAfter(w),be.collapse(!0),k=be}k.insertNode(Oe);const Ie=document.createRange();Ie.setStartAfter(Oe),Ie.collapse(!0);const _e=window.getSelection();_e.removeAllRanges(),_e.addRange(Ie)}catch{if(g.value.childNodes.length===0){const Ie=document.createElement("p");Ie.appendChild(Oe),g.value.appendChild(Ie)}else{const Ie=g.value.lastChild;if(Ie&&Ie.nodeType===1)Ie.appendChild(Oe);else{const _e=document.createElement("p");_e.appendChild(Oe),g.value.appendChild(_e)}}}w?w.remove():x.remove(),bt.value=null,e.nextTick(()=>{const Te=g.value.querySelectorAll("img");let Ie=!1;Te.forEach(_e=>{if(_e.getAttribute("src")===Pe)if(!Ie)Ie=!0;else{const be=_e.closest(".dss-image-wrapper");be?be.remove():_e.remove()}}),Yt(),fe()})}),g.value.addEventListener("dragend",m=>{bt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(p=>{p.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 x=h.querySelectorAll&&h.querySelectorAll("img");x&&x.forEach(w=>{w.removeAttribute("alt"),w.removeAttribute("data-alt"),w.setAttribute("alt",""),w.setAttribute("data-alt",""),w.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Yt(),co(),d=null},100)});if(u.observe(g.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const p=new MutationObserver(()=>{e.nextTick(()=>{co()})});p.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=p}}),S.modelValue){const m=vn(S.modelValue);g.value.innerHTML=m,gn()}e.nextTick(()=>{const m=g.value.innerHTML||"",p=S.title||"",h=S.description||"";$t.value=m,wt.value=p,dt.value=h,mt.value=p,pt.value=h,it(),Yt(),ro(),eo(),nl(),Vn()}),Le(),to(),g.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Ro),window.removeEventListener("resize",Qo),g.value&&g.value._windowScrollHandler&&window.removeEventListener("scroll",g.value._windowScrollHandler,!0),Bo!==null&&(clearTimeout(Bo),Bo=null),g.value&&g.value._windowScrollTimeout!==null&&clearTimeout(g.value._windowScrollTimeout),te.value&&clearTimeout(te.value),ut.value&&clearTimeout(ut.value),g.value&&g.value._mutationObserver&&g.value._mutationObserver.disconnect(),Dt.value&&Dt.value.disconnect(),It.value!==null&&(cancelAnimationFrame(It.value),It.value=null),Ut.value!==null&&(clearTimeout(Ut.value),Ut.value=null),Vt.value!==null&&(clearTimeout(Vt.value),Vt.value=null),wo(!0),g.value&&g.value._scrollHandlers){const{wrapper:o,content:a,handler:s}=g.value._scrollHandlers;o&&o.removeEventListener("scroll",s),a&&a.removeEventListener("scroll",s)}const l=document.querySelector(".dss-text-editor-toolbar");l&&l._toolbarMutationObserver&&l._toolbarMutationObserver.disconnect()});const jn=l=>{const o=l.target,a=o.closest("a");if(a&&!S.disabled){l.preventDefault();const i=document.createRange();i.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(i)}const s=o.closest(".dss-image-wrapper");s&&o.tagName!=="IMG"?e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const u=i.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(s.contains(m)&&m!==s.querySelector("img")){const p=document.createRange();p.setStartAfter(s),p.collapse(!0),i.removeAllRanges(),i.addRange(p)}}Yt(),Le(),to(),me(),eo()}):e.nextTick(()=>{Yt(),Le(),to(),me(),eo()})},Kn=()=>{Xt();const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0);Ue.value=!a.collapsed&&ko(a),!a.collapsed&&ao.value&&(ao.value=null)}else Ue.value=!1;if(Yt(),Le(),to(),me(),eo(),l&&l.rangeCount>0){const s=l.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i&&i.closest(".dss-text-editor-footer")){l.removeAllRanges(),Ue.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0);if(!i.collapsed)if(a==="bold"){const d=i.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 p=window.getComputedStyle(u);parseInt(p.fontWeight)>=600&&(m=!0)}catch{}j.value[a]=m}else{const d=document.queryCommandState(a);j.value[a]=d}}}catch{}})},eo=()=>{if(!S.richText||S.disabled||!g.value){Fe.value="p";return}try{const l=window.getSelection();if(!l||l.rangeCount===0){Fe.value="p";return}const a=l.getRangeAt(0).commonAncestorContainer,s=a.nodeType===3?a.parentElement:a;if(!s||!g.value.contains(s)){Fe.value="p";return}const i=s.closest("h1, h2, h3, h4, h5, h6, p");if(!i){Fe.value="p";return}const d=i.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?Fe.value=d:Fe.value="p"}catch{Fe.value="p"}},to=()=>{if(!g.value){Eo.value=!1;return}try{const l=window.getSelection();let o=!1;if(l.rangeCount>0){const s=l.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");o=!!(i&&g.value.contains(i))}Eo.value=o}catch{Eo.value=!1}},ko=l=>{if(!l||!g.value)return!1;const o=l.commonAncestorContainer;if(!o)return!1;const a=o.nodeType===3?o.parentElement:o;return a?g.value.contains(a):!1},Fo=()=>{xe.value=!1},me=()=>{if(!S.floatingToolbar||!S.richText||S.disabled){xe.value=!1;return}const l=window.getSelection();if(!l||l.rangeCount===0){xe.value=!1;return}const o=l.getRangeAt(0);if(o.collapsed||!ko(o)){xe.value=!1;return}const a=o.getBoundingClientRect();if(!a||a.width===0&&a.height===0){xe.value=!1;return}const s=g.value;if(!s){xe.value=!1;return}const i=s.getBoundingClientRect();if(!i||i.width===0){xe.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let p=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let x=0;Ao.value&&(x=Ao.value.getBoundingClientRect().width);const w=(x||320)/2;let k=i.left+w,T=i.right-w;if(T<k){const B=i.left+i.width/2;k=B,T=B}if(h>0){const B=w+u,L=h-w-u;if(k=Math.max(k,B),T=Math.min(T,L),T<k){const F=h/2;k=F,T=F}}p<k?p=k:p>T&&(p=T),rn.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${p}px`,transform:"translate(-50%, -100%)",zIndex:10003},xe.value=!0},uo=l=>{S.disabled||!S.richText||(At.value=At.value===l?null:l,l==="askAi"&&(Re.value=null))},oo=()=>{At.value=null,rt.value=null},he=l=>{jt(l),oo()};let xo=null,ge=null,we=null,To=null;const vl=l=>{if(S.disabled||!S.richText){zo(),ye();return}const o=l.target,a=o.closest("a"),s=o.closest("img");if(xo&&(clearTimeout(xo),xo=null),we&&(clearTimeout(we),we=null),a&&a!==ge){ye(),ge=a;let i=a.getAttribute("href")||"";(!i||i==="#"||i==="")&&(i=a.textContent||""),He.value=a,le.value=i,D.value=!0,gt.value=!0,wn(a)}else!a&&ge?(ge=null,xo=setTimeout(()=>{gt.value||zo()},150)):a&&a===ge&&wn(a);if(s&&s!==To){zo(),To=s;let i=s.getAttribute("alt");i===null&&(i=s.alt||"");let d=s.getAttribute("data-alt");d===null&&(d=i),s.hasAttribute("alt")||s.setAttribute("alt",i),s.hasAttribute("data-alt")||s.setAttribute("data-alt",d),ue.value=s,So.value=i.trim()||H("textEditor.image.noAlt"),Pt.value=!0,We.value=!0,en(s)}else!s&&To?(To=null,we=setTimeout(()=>{We.value||ye()},150)):s&&s===To&&en(s)},xn=l=>{const o=l.relatedTarget;(!o||!o.closest(".dss-text-editor-content")&&!o.closest(".dss-link-popup"))&&(ge=null,To=null,xo&&(clearTimeout(xo),xo=null),we&&(clearTimeout(we),we=null),zo(),ye())},zo=()=>{gt.value=!1,setTimeout(()=>{gt.value||(D.value=!1,le.value="",yt.value||(He.value=null))},100)},wn=l=>{if(!l||!g.value)return;const o=l.getBoundingClientRect(),i=o.top-32-8,d=o.left+o.width/2;ke.value={position:"fixed",top:`${i}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},ye=()=>{We.value=!1,setTimeout(()=>{We.value||(Pt.value=!1,So.value="",lo.value||(ue.value=null))},100)},en=l=>{if(!l||!g.value)return;const o=l.getBoundingClientRect(),i=o.top-32-8,d=o.left+o.width/2;Bn.value={position:"fixed",top:`${i}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Gn=()=>{if(!le.value||!He.value)return;let o=He.value.getAttribute("href")||le.value;!o.startsWith("http://")&&!o.startsWith("https://")&&!o.startsWith("mailto:")&&(o="https://"+o),window.open(o,"_blank","noopener,noreferrer")},bn=()=>{if(He.value){const l=He.value.textContent||"",o=He.value.getAttribute("href")||"",a=He.value;$.value=o,Ye.value=l,ae.value=l,gt.value=!1,D.value=!1,le.value="",He.value=a,yt.value=!0}else if(ct.value){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,s=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(s){const i=s.textContent||"",d=s.getAttribute("href")||"";$.value=d,Ye.value=i,ae.value=i,He.value=s,yt.value=!0}}}else{je.value=ft();const l=window.getSelection();let o="";l.rangeCount>0&&(o=l.getRangeAt(0).toString()),$.value="",Ye.value=o,ae.value="",He.value=null,yt.value=!0}e.nextTick(()=>{Ht.value&&(Ht.value.focus(),Ht.value.select())})},Po=()=>{yt.value=!1,$.value="",Ye.value="",ae.value="",He.value=null,je.value=null},tn=()=>{if(!$.value.trim()){Po();return}if(ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Ye.value.trim()||(Ye.value=$.value.trim()),He.value&&g.value&&g.value.contains(He.value)){const l=window.getSelection();l.rangeCount>0&&l.removeAllRanges();const o=He.value;if(o.setAttribute("href",$.value.trim()),Ye.value.trim()!==ae.value.trim()){for(;o.firstChild;)o.removeChild(o.firstChild);o.textContent=Ye.value.trim()}o.style.color="#60afdf",o.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(o),a.collapse(!1),l.removeAllRanges(),l.addRange(a),fe()}else if(g.value){g.value.focus();const l=window.getSelection();l.removeAllRanges(),je.value&&Nt(je.value);let o=null;if(l.rangeCount>0&&(o=l.getRangeAt(0)),o&&!o.collapsed){o.toString();const a=document.createElement("a");a.href=$.value.trim(),a.textContent=Ye.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",o.deleteContents(),o.insertNode(a);const s=document.createTextNode(" ");o.setStartAfter(a),o.insertNode(s),o.setStartAfter(s),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}else{o||(o=document.createRange(),o.selectNodeContents(g.value),o.collapse(!1));const a=o.startContainer,s=a.nodeType===3,i=s&&o.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=$.value.trim(),d.textContent=Ye.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",i){let u=a.parentElement;for(;u&&u!==g.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==g.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const p=document.createTextNode(" ");m.appendChild(p);const h=document.createRange();h.setStartAfter(d),h.collapse(!0),l.removeAllRanges(),l.addRange(h)}else{if(o.startOffset>0){const h=a.textContent.substring(0,o.startOffset),x=h[h.length-1];if(x&&x!==" "&&x!==" "&&x!==`
79
- `){const w=document.createTextNode(" ");o.insertNode(w),o.setStartAfter(w)}}o.insertNode(d);const p=document.createTextNode(" ");o.setStartAfter(d),o.insertNode(p),o.setStartAfter(p),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}}}else{if(s&&o.startOffset>0){const m=a.textContent.substring(0,o.startOffset),p=m[m.length-1];if(p&&p!==" "&&p!==" "&&p!==`
80
- `){const h=document.createTextNode(" ");o.insertNode(h),o.setStartAfter(h)}}o.insertNode(d);const u=document.createTextNode(" ");o.setStartAfter(d),o.insertNode(u),o.setStartAfter(u),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}}fe()}e.nextTick(()=>{Le(),Po()})},En=()=>{if(!g.value||et.value)return;const l=window.getSelection();let o=null;l&&l.rangeCount>0&&(o=ft());const a=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,s=document.createTreeWalker(g.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const p=m.parentElement;return!p||p.closest("a")||p.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),i=[];let d;for(;d=s.nextNode();)i.push(d);let u=!1;for(let m=i.length-1;m>=0;m--){const p=i[m],h=p.textContent;a.lastIndex=0;const x=[...h.matchAll(a)];if(x.length===0)continue;const w=x.filter(B=>{const L=B[0],F=B.index;if(F>0&&h[F-1]==="@"||F+L.length<h.length&&h[F+L.length]==="@")return!1;const Q=p.parentElement;return!(Q&&Q.closest("a"))});if(w.length===0)continue;if(w.length===1&&w[0][0]===h.trim()){const B=w[0][0],L=B.startsWith("http://")||B.startsWith("https://")?B:`https://${B}`,F=document.createElement("a");F.href=L,F.textContent=B,F.style.color="#60afdf",F.style.textDecoration="underline",p.parentNode&&(p.parentNode.replaceChild(F,p),u=!0);continue}let k=0;const T=document.createDocumentFragment();if(w.forEach(B=>{const L=B.index,F=B[0];if(L>k){const Oe=h.substring(k,L);Oe&&T.appendChild(document.createTextNode(Oe))}const Q=F.startsWith("http://")||F.startsWith("https://")?F:`https://${F}`,Pe=document.createElement("a");Pe.href=Q,Pe.textContent=F,Pe.style.color="#60afdf",Pe.style.textDecoration="underline",T.appendChild(Pe),k=L+F.length}),k<h.length){const B=h.substring(k);B&&T.appendChild(document.createTextNode(B))}p.parentNode&&T.childNodes.length>0&&(p.parentNode.replaceChild(T,p),u=!0)}u&&o&&e.nextTick(()=>{Nt(o),Le()})},hl=()=>{if(!g.value)return;const l=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,o=document.createTreeWalker(g.value,NodeFilter.SHOW_TEXT,{acceptNode:i=>{const d=i.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let s;for(;s=o.nextNode();)a.push(s);for(let i=a.length-1;i>=0;i--){const d=a[i],u=d.textContent,m=[...u.matchAll(l)];if(m.length===0)continue;let p=0;const h=document.createDocumentFragment();m.forEach(x=>{const w=x.index,k=x[0].startsWith("<u>")?"u":"ins",T=x[1]||x[2]||"";w>p&&h.appendChild(document.createTextNode(u.substring(p,w)));const B=document.createElement(k);B.textContent=T,h.appendChild(B),p=w+x[0].length}),p<u.length&&h.appendChild(document.createTextNode(u.substring(p))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},Jn=l=>{if(!g.value||et.value)return;if(!l){hl();return}if(!["*","_",">"].includes(l))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const s=a.getRangeAt(0);if(!s.collapsed)return;const i=s.startContainer.nodeType===Node.TEXT_NODE?s.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):s.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!i||i===g.value||!g.value.contains(i))return;const d=()=>{let Oe="",Te=0,Ie=!1;const _e=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:Ft=>Ft.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(i,NodeFilter.SHOW_TEXT,null);let be=0;for(;_e.nextNode();){const Ft=_e.currentNode,mo=Ft.textContent||"",po=be;if(be+=mo.length,Ft===s.startContainer){Oe+=mo.substring(0,s.startOffset),Te=po+s.startOffset,Ie=!0;break}Oe+=mo}return Ie||(Te=Oe.length),{textBeforeCursor:Oe,cursorCharOffset:Te}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,p=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?p="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?p="em":l===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(p=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],x=m[1],w=u.length-h.length,T=(Oe=>{let Te=0;const Ie=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:be=>be.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let _e;for(;_e=Ie.nextNode();){const be=(_e.textContent||"").length;if(Te+be>=Oe)return{node:_e,offset:Oe-Te};Te+=be}return null})(w);if(!T)return;const B=document.createRange();B.setStart(T.node,T.offset),B.setEnd(s.endContainer,s.endOffset);const L=document.createElement(p);L.textContent=x,B.deleteContents(),B.insertNode(L);const F=window.getSelection(),Q=document.createRange();Q.setStartAfter(L),Q.collapse(!0),F.removeAllRanges(),F.addRange(Q);const Pe=ft();e.nextTick(()=>{fe(),Pe&&Nt(Pe)})},Ho=()=>{g.value&&($o.value=ft(),Ct.value="",kt.value="",Ke.value="",Je.value="",Ce.value="",Lo.value=null,ue.value=null,nt.value="upload",lo.value=!0,Qe(),e.nextTick(()=>{Ae.value&&Ae.value.focus(),Lt.value&&(Lt.value.value="")}))},on=l=>{const o=l.target?.files?.[0];if(!o){Lo.value=null,kt.value="";return}Lo.value=o;const a=new FileReader;a.onload=s=>{kt.value=s.target?.result||""},a.readAsDataURL(o)},Qn=()=>{Lt.value&&Lt.value.click()},Oo=()=>{Je.value&&(Ce.value="")},el=()=>{Ce.value&&(Je.value="")},gl=()=>{let l=ue.value;if(!l){const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer;l=s.nodeType===1?s.closest("img"):s.parentElement?.closest("img")}}if(l){const o=l.getAttribute("data-alt")||l.getAttribute("alt")||"";ue.value=l,Ct.value=o.trim()===""||o.trim()==="Image"?"":o;const a=l.getAttribute("src")||l.src||"";a.startsWith("http://")||a.startsWith("https://")?(Ke.value=a,kt.value="",nt.value="url"):(kt.value=a,Ke.value="",nt.value="upload");const i=l.style.width||l.getAttribute("width")||"",d=l.style.height||l.getAttribute("height")||"";Je.value=i.endsWith("px")?i.replace("px",""):i,Ce.value=d.endsWith("px")?d.replace("px",""):d,$o.value=null}else{Ho();return}lo.value=!0,We.value=!1,Pt.value=!1,e.nextTick(()=>{nt.value==="url"&&Vo.value?(Vo.value.focus(),Vo.value.select()):Ae.value&&(Ae.value.focus(),Ae.value.select()),Lt.value&&(Lt.value.value="")})},Zo=()=>{lo.value=!1,Ct.value="",kt.value="",Ke.value="",Je.value="",Ce.value="",Lo.value=null,ue.value=null,$o.value=null,nt.value="upload"},no=()=>{const l=(Ct.value||"").trim(),o=g.value?._mutationObserver;o&&o.disconnect(),ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze();const a=nt.value==="url"?Ke.value.trim():kt.value;if(ue.value&&g.value&&g.value.contains(ue.value)){a&&(ue.value.src=a),ue.value.setAttribute("alt",l),ue.value.setAttribute("data-alt",l),Je.value?(ue.value.style.width=`${Je.value}px`,ue.value.setAttribute("width",Je.value)):(ue.value.style.removeProperty("width"),ue.value.removeAttribute("width")),Ce.value?(ue.value.style.height=`${Ce.value}px`,ue.value.setAttribute("height",Ce.value)):(ue.value.style.removeProperty("height"),ue.value.removeAttribute("height"));const s=window.getSelection();if(s){s.removeAllRanges();const i=document.createRange();i.setStartAfter(ue.value),i.collapse(!0),s.addRange(i)}fe()}else{if(!a){o&&g.value&&o.observe(g.value,{childList:!0,subtree:!0}),Zo();return}if(g.value){g.value.focus();const s=window.getSelection();s&&s.rangeCount>0&&s.removeAllRanges();const i=window.getSelection();let d=null;if($o.value&&(Nt($o.value),i&&i.rangeCount>0&&(d=i.getRangeAt(0))),!d&&i&&i.rangeCount>0&&(d=i.getRangeAt(0)),!d&&g.value){if(d=document.createRange(),g.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",g.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(g.value),d.collapse(!1);i&&(i.removeAllRanges(),i.addRange(d))}if(!d){Zo();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!g.value.contains(m)){if(d=document.createRange(),g.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",g.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(g.value),d.collapse(!1);i&&(i.removeAllRanges(),i.addRange(d))}const p=document.createElement("img");p.src=a,p.setAttribute("alt",l),p.setAttribute("data-alt",l),Je.value&&(p.style.width=`${Je.value}px`,p.setAttribute("width",Je.value)),Ce.value&&(p.style.height=`${Ce.value}px`,p.setAttribute("height",Ce.value));try{d.insertNode(p),d.setStartAfter(p),d.collapse(!0),i&&(i.removeAllRanges(),i.addRange(d))}catch{if(g.value){if(g.value.childNodes.length===0){const w=document.createElement("p");g.value.appendChild(w),w.appendChild(p)}else{const w=g.value.lastChild;if(w&&w.nodeType===1)w.appendChild(p);else{const k=document.createElement("p");g.value.appendChild(k),k.appendChild(p)}}const x=document.createRange();x.setStartAfter(p),x.collapse(!0),i&&(i.removeAllRanges(),i.addRange(x))}}ue.value=p,fe()}}e.nextTick(()=>{o&&g.value&&o.observe(g.value,{childList:!0,subtree:!0}),Le(),me(),Zo()})};e.watch(()=>S.modelValue,l=>{if(S.richText&&g.value&&!et.value){const o=vn(l||""),s=g.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),i=o.replace(/&nbsp;|\u00A0/g," ");if(s!==i){const d=ft();g.value.innerHTML=o,e.nextTick(()=>{gn();const u=g.value.innerHTML||"",m=S.title||"",p=S.description||"";$t.value=u,wt.value=m,dt.value=p,tt.value=u,mt.value=m,pt.value=p,xt.value=[],lt.value=[],te.value&&(clearTimeout(te.value),te.value=null),ve.value=!1,d&&Nt(d),it(),Yt(),ro(),Le(),me(),eo(),Tt("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>S.richText,l=>{l?(me(),e.nextTick(()=>{nl()})):(Fo(),Wt.value=[],Dt.value&&(Dt.value.disconnect(),Dt.value=null)),eo()}),e.watch(()=>S.floatingToolbar,l=>{l?me():Fo()}),e.watch(()=>S.disabled,l=>{l&&Fo(),eo()}),e.watch(()=>S.description,()=>{e.nextTick(()=>{Zt.value?Me():go()})}),e.watch(()=>S.title,()=>{e.nextTick(()=>{Et.value?oe():re()})}),e.watch(()=>S.customToolbarSlots,()=>{e.nextTick(()=>{co()})},{deep:!0}),e.watch(()=>S.comments,(l,o)=>{if(E.value){E.value=!1;return}De.value||S.richText&&g.value&&e.nextTick(()=>{Vn()})},{deep:!0,immediate:!1});const Vn=()=>{if(!De.value&&!(!S.comments||!Array.isArray(S.comments)||S.comments.length===0)&&!(!S.richText||!g.value)){De.value=!0;try{const l=new Set,o=S.comments.filter(u=>{const m=String(u.conversation_id||u.id);return l.has(m)?!1:(l.add(m),!0)}),a=g.value.querySelectorAll("[data-comment], [data-fake-comment]"),s=a.length;a.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let i=0;const d=new Set;o.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 p=String(m);if(d.has(p))return;const h=g.value.querySelector(`[data-comment="${p}"]`);if(h){nn(h,u),d.add(p);return}try{const x=ol(u.selection_range,u.selection_text);if(x&&!x.collapsed){const w=x.commonAncestorContainer,k=w.nodeType===3?w.parentElement:w;if(k){const L=k.closest("[data-comment], [data-fake-comment]");if(L){const F=L.getAttribute("data-comment")||L.getAttribute("data-fake-comment");if(String(F)===String(m)){L.setAttribute("data-comment",p),L.removeAttribute("data-fake-comment"),nn(L,u),d.add(p);return}else return}}const T=g.value.querySelector(`[data-comment="${p}"]`);if(T){nn(T,u),d.add(p);return}const B=document.createElement("span");B.setAttribute("data-comment",p),nn(B,u);try{x.surroundContents(B),i++,d.add(p)}catch{try{const F=document.createRange();F.setStart(x.startContainer,x.startOffset),F.setEnd(x.endContainer,x.endOffset),Sn(F),F.surroundContents(B),i++,d.add(p)}catch{try{const Q=x.extractContents();B.appendChild(Q),x.insertNode(B),i++,d.add(p)}catch(Q){console.warn("Failed to create comment marker:",Q)}}}}}catch{}}),e.nextTick(()=>{Tt("restoreCommentsFromModel"),fe(),De.value=!1})}catch{De.value=!1}}},Sn=l=>{if(!l||!g.value)return l;try{const o=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=l.startContainer,s=l.startOffset;if(a.nodeType===3){const u=a.parentElement;u&&o.includes(u.tagName)&&(s===0&&!tl(a)||l.setStartBefore(u))}else a.nodeType===1&&o.includes(a.tagName)&&s>0&&l.setStartBefore(a);let i=l.endContainer,d=l.endOffset;if(i.nodeType===3){const u=i.parentElement;u&&o.includes(u.tagName)&&(d===i.length&&!yl(i)||l.setEndAfter(u))}else i.nodeType===1&&o.includes(i.tagName)&&d<i.childNodes.length&&l.setEndAfter(i);return l}catch{return l}},tl=l=>{let o=l.previousSibling;for(;o;){if(o.nodeType===3&&o.textContent.trim().length>0||o.nodeType===1&&o.textContent.trim().length>0)return!0;o=o.previousSibling}return!1},yl=l=>{let o=l.nextSibling;for(;o;){if(o.nodeType===3&&o.textContent.trim().length>0||o.nodeType===1&&o.textContent.trim().length>0)return!0;o=o.nextSibling}return!1},ol=(l,o)=>{if(!l||!g.value)return null;try{const a=document.createRange();if(l.type==="text"&&typeof l.start=="number"&&typeof l.end=="number"){let s=0;const i=[g.value];let d=null,u=!1,m=!1;for(;!m&&(d=i.pop());)if(d.nodeType===3){const p=s+d.length;!u&&l.start>=s&&l.start<=p&&(a.setStart(d,l.start-s),u=!0),u&&l.end>=s&&l.end<=p&&(a.setEnd(d,l.end-s),m=!0),s=p}else{let p=d.childNodes.length;for(;p--;)i.push(d.childNodes[p])}return u?Sn(a):null}}catch{return null}return null},nn=(l,o)=>{if(!l||!o)return;const a=o.conversation||[],s=new Set,i=[],d=m=>{m&&m.id&&!s.has(m.id)&&(s.add(m.id),i.push(m))};a.length>0&&a.forEach(m=>{m.user&&d(m.user)}),i.length>0?l.setAttribute("data-comment-user",JSON.stringify(i[0])):l.removeAttribute("data-comment-user"),i.length>1?l.setAttribute("data-comment-user-2",JSON.stringify(i[1])):l.removeAttribute("data-comment-user-2");const u=a.length;u>0?l.setAttribute("data-comment-count",String(u)):l.removeAttribute("data-comment-count")},Tt=(l="unknown")=>{if(!S.richText||!g.value){Wt.value=[];return}Date.now()-Tn.value<al&&It.value!==null||It.value===null&&(It.value=requestAnimationFrame(()=>{if(It.value=null,Tn.value=Date.now(),Do.value)return;Do.value=!0;const a={},s=g.value;if(!s){Do.value=!1;return}const i=s.closest(".editor-with-comments");if(!i){Do.value=!1;return}const d=s.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(k=>{const T=k.getAttribute("data-comment")||k.getAttribute("data-fake-comment");T&&k.tagName==="SPAN"&&(m.has(T)||(u.push(k),m.add(T)))}),d.forEach(k=>{const T=k.getAttribute("data-comment")||k.getAttribute("data-fake-comment");!T||m.has(T)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(k.tagName)?k.querySelector(`span[data-comment="${T}"], span[data-fake-comment="${T}"]`)||(u.push(k),m.add(T)):k.tagName!=="SPAN"&&(u.push(k),m.add(T)))});const p=i.getBoundingClientRect(),h=s.getBoundingClientRect();u.forEach((k,T)=>{let B=k.getAttribute("data-comment")||k.getAttribute("data-fake-comment");if(!B)return;if(typeof B=="string"&&B.startsWith("comment-")){const f=k.textContent?.trim(),C=S.comments?.find(y=>(typeof y.conversation_id=="string"&&y.conversation_id.startsWith("comment-")?null:y.conversation_id)&&y.selection_text?.trim()===f);C?(B=String(C.conversation_id),k.setAttribute("data-comment",B),k.removeAttribute("data-fake-comment")):(B=String(Date.now()),k.setAttribute("data-comment",B),k.removeAttribute("data-fake-comment"))}const L=k.getBoundingClientRect(),F=window.getComputedStyle(k),Q=parseFloat(F.lineHeight)||parseFloat(F.fontSize)*1.2,Te=L.top-h.top+Q/2-15,_e=h.top-p.top+Te;let be=null,Ft=null,mo=0;const po=[],Nn=new Set;if(B&&S.comments){const f=S.comments.find(C=>String(C.conversation_id||C.id)===String(B));if(f){const C=f.conversation||[];C.length>0?(C.forEach(y=>{y.user&&y.user.id&&!Nn.has(y.user.id)&&(Nn.add(y.user.id),po.push(y.user))}),mo=C.length):(mo=0,be=null,Ft=null),po.length>0?be=po[0]:be=null,po.length>1?Ft=po[1]:Ft=null}}const Mn=L.top+Q/2-15,kl=Mn+30,t=5,n=kl>h.top+t&&Mn<h.bottom-t?1:0;Wt.value.find(f=>f.id===B);let c=k;if(!c&&B&&g.value){const f=String(B);c=g.value.querySelector(`[data-comment="${f}"], [data-fake-comment="${f}"]`)}const v=po.length;a[B]?(a[B].top=_e,a[B].opacity=n,a[B].element=c,a[B].firstUser=be,a[B].secondUser=Ft,a[B].totalCount=mo,a[B].uniqueUserCount=v):a[B]={id:B,top:_e,opacity:n,element:c,firstUser:be,secondUser:Ft,totalCount:mo,uniqueUserCount:v}});const x=Object.values(a).map(k=>{const T=Math.max(0,(k.uniqueUserCount??0)-2);if(!k.element&&k.id&&g.value){const L=String(k.id);k.element=g.value.querySelector(`[data-comment="${L}"], [data-fake-comment="${L}"]`)}return{...k,firstUser:k.firstUser||null,secondUser:k.secondUser||null,totalCount:k.totalCount,additionalCount:T}});(Wt.value.length!==x.length||x.some((k,T)=>{const B=Wt.value[T];if(!B)return!0;const L=(B.firstUser?.id||null)!==(k.firstUser?.id||null),F=(B.secondUser?.id||null)!==(k.secondUser?.id||null);return B.id!==k.id||Math.abs(B.top-k.top)>1||B.opacity!==k.opacity||B.totalCount!==k.totalCount||B.additionalCount!==k.additionalCount||L||F||B.element!==k.element}))&&(Wt.value=x),Do.value=!1}))},Wo=l=>{if(!l)return;let o=l.element;if(!o&&l.id&&g.value){const a=String(l.id);o=g.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}o&&(wo(),Kt.value=o,o.classList.add("editor-comment-highlighted"))},wo=(l=!1)=>{!l&&qe.value!==null&&Kt.value&&(Kt.value.getAttribute("data-comment")||Kt.value.getAttribute("data-fake-comment"))===qe.value||(g.value&&g.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Kt.value&&(Kt.value.classList.remove("editor-comment-highlighted"),Kt.value=null))},ln=l=>{if(!l||!l.element)return;wo(!0);const o=l.element.getAttribute("data-comment")||l.element.getAttribute("data-fake-comment");if(!o)return;const a=`[data-comment="${o}"], [data-fake-comment="${o}"]`;ie("comment-marker-clicked",{commentId:o,selector:a,element:l.element})},Cl=()=>{wo()},nl=()=>{!S.richText||!g.value||(Dt.value&&Dt.value.disconnect(),Vt.value!==null&&(clearTimeout(Vt.value),Vt.value=null),Dt.value=new MutationObserver(()=>{Vt.value===null&&(Vt.value=setTimeout(()=>{Vt.value=null,e.nextTick(()=>{Tt("MutationObserver")})},200))}),Dt.value.observe(g.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Tt("setupCommentMarkersObserver-initial"))},ll=(l,o)=>{if(!l||!o)return;const a=o.getBoundingClientRect();let s=a.top,i=a.right+4;l.style.top=`${s}px`,l.style.left=`${i}px`,l.offsetHeight;const d=l.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const p=a.left-d.width-4;l.style.left=`${p}px`}if(d.bottom>m){const p=Math.max(8,m-d.height-8);l.style.top=`${p}px`}d.top<0&&(l.style.top="8px")};return e.watch(()=>rt.value,l=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const s=a.getAttribute("data-submenu-id");if(s===l&&l){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i){if(a.parentNode!==document.body){const d=a.parentNode;a.dataset.originalParentRef=d===i?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{ll(a,i),a.offsetHeight,a.setAttribute("data-active","true"),a.style.visibility="visible",a.style.opacity="1"})})}else a.setAttribute("data-active","true")}else a.setAttribute("data-active","false"),a.style.display="none",a.style.top="",a.style.left="",a.style.visibility="",a.style.opacity=""})})}),e.watch(()=>[Re.value,At.value],()=>{Re.value==="askAi"||At.value==="askAi"?e.nextTick(()=>{Rt()}):(rt.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(o=>{if(o.parentNode===document.body){const a=o.getAttribute("data-submenu-id");if(a){const s=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(s)if(o.dataset.originalParentRef==="inside")s.appendChild(o);else{const d=s.closest(".dss-toolbar-dropdown");d&&d.insertBefore(o,s.nextSibling)}}}})}))}),e.watch(()=>S.locale,l=>{l&&l!==zt.value&&(zt.value=l)},{immediate:!0}),vo({openCommentOverlayForSelector:Se,updateCommentMarkers:Tt,restoreCommentsFromModel:Vn}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",cn.value]),style:e.normalizeStyle(sl.value)},[z.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:o[14]||(o[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Er,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:yn,title:e.unref(H)("textEditor.toolbar.undo")},[...o[45]||(o[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Vr),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Hn.value}]),onClick:Cn,title:e.unref(H)("textEditor.toolbar.redo")},[...o[46]||(o[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Sr),o[73]||(o[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Nr,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[0]||(o[0]=a=>_n("paragraph")),title:e.unref(H)("textEditor.toolbar.paragraphFormat")},[Fe.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Br,[...o[47]||(o[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Tr,[...o[48]||(o[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Hr,[...o[49]||(o[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Ar,[...o[50]||(o[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Lr,[...o[51]||(o[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h6"?(e.openBlock(),e.createElementBlock("svg",$r,[...o[52]||(o[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Dr,[...o[53]||(o[53]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),o[54]||(o[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Mr),Re.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[8]||(o[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[1]||(o[1]=a=>jt("<h1>"))},[o[55]||(o[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[2]||(o[2]=a=>jt("<h2>"))},[o[56]||(o[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[3]||(o[3]=a=>jt("<h3>"))},[o[57]||(o[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[4]||(o[4]=a=>jt("<h4>"))},[o[58]||(o[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[5]||(o[5]=a=>jt("<h5>"))},[o[59]||(o[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[6]||(o[6]=a=>jt("<h6>"))},[o[60]||(o[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[7]||(o[7]=a=>jt("<p>"))},[o[61]||(o[61]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("bold")}]),onClick:o[9]||(o[9]=a=>at("bold")),title:e.unref(H)("textEditor.toolbar.bold")},[...o[62]||(o[62]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Ir),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("italic")}]),onClick:o[10]||(o[10]=a=>at("italic")),title:e.unref(H)("textEditor.toolbar.italic")},[...o[63]||(o[63]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,_r),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("underline")}]),onClick:o[11]||(o[11]=a=>at("underline")),title:e.unref(H)("textEditor.toolbar.underline")},[...o[64]||(o[64]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Rr),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Eo.value}]),onClick:Io,title:e.unref(H)("textEditor.toolbar.citation")},[...o[65]||(o[65]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Fr),o[74]||(o[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ct.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Fn,title:e.unref(H)("textEditor.toolbar.removeLink")},[...o[67]||(o[67]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Pr)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Rn,title:e.unref(H)("textEditor.toolbar.insertLink")},[...o[66]||(o[66]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,zr)),o[75]||(o[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("insertUnorderedList")}]),onClick:zn,title:e.unref(H)("textEditor.toolbar.bulletList")},[...o[68]||(o[68]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Or),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("insertOrderedList")}]),onClick:Pn,title:e.unref(H)("textEditor.toolbar.numberList")},[...o[69]||(o[69]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Zr),o[76]||(o[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Ho,title:e.unref(H)("textEditor.toolbar.image")},[...o[70]||(o[70]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Wr),Ue.value?(e.openBlock(),e.createElementBlock("div",Ur)):e.createCommentVNode("",!0),Ue.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(H)("textEditor.toolbar.comment"),onClick:vt},[...o[71]||(o[71]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,qr)):e.createCommentVNode("",!0),z.askAi?(e.openBlock(),e.createElementBlock("div",Xr)):e.createCommentVNode("",!0),z.askAi?(e.openBlock(),e.createElementBlock("div",Yr,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:o[12]||(o[12]=a=>_n("askAi")),title:e.unref(H)("textEditor.toolbar.askAi")},[o[72]||(o[72]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",Kr,e.toDisplayString(e.unref(H)("textEditor.toolbar.askAi")),1)],8,jr),Re.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[13]||(o[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.customToolbarSlots,(a,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[qt(a)?(e.openBlock(),e.createElementBlock("div",Jr,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),qt(a)&&s<z.customToolbarSlots.length-1&&il(s)?(e.openBlock(),e.createElementBlock("div",Qr)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(Re.value==="paragraph"||Re.value==="askAi")&&z.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Qe})):e.createCommentVNode("",!0),e.createVNode(xl,{showModal:yt.value,width:"500px",height:"55vh",onCloseModal:Po},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(H)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ei,[e.createElementVNode("div",ti,[e.createElementVNode("label",oi,e.toDisplayString(e.unref(H)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ze,type:"text","onUpdate:modelValue":o[15]||(o[15]=a=>Ye.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.link.enterAltText"),onKeyup:e.withKeys(tn,["enter"])},null,40,ni),[[e.vModelText,Ye.value]])]),e.createElementVNode("div",li,[e.createElementVNode("label",ai,e.toDisplayString(e.unref(H)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Ht,type:"text","onUpdate:modelValue":o[16]||(o[16]=a=>$.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.link.enterUrl"),onKeyup:e.withKeys(tn,["enter"])},null,40,si),[[e.vModelText,$.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Po},e.toDisplayString(e.unref(H)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:tn},e.toDisplayString(e.unref(H)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(xl,{showModal:lo.value,width:"500px",height:"80vh",onCloseModal:Zo},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ue.value?e.unref(H)("textEditor.image.editImage"):e.unref(H)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ri,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":nt.value==="upload"}]),onClick:o[17]||(o[17]=a=>nt.value="upload")},e.toDisplayString(e.unref(H)("textEditor.image.upload")),3),o[77]||(o[77]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":nt.value==="url"}]),onClick:o[18]||(o[18]=a=>nt.value="url")},e.toDisplayString(e.unref(H)("textEditor.image.imageLink")),3)]),nt.value==="upload"?(e.openBlock(),e.createElementBlock("div",ii,[e.createElementVNode("div",ci,[e.createElementVNode("div",ui,[mn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",di,e.toDisplayString(e.unref(H)("textEditor.image.uploadImage")),1)),mn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Qn},[e.createElementVNode("img",{src:kt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,mi),o[78]||(o[78]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:Lt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:on},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Lt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:on},null,544))]),e.createElementVNode("div",pi,[e.createElementVNode("label",fi,e.toDisplayString(e.unref(H)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Ae,type:"text","onUpdate:modelValue":o[19]||(o[19]=a=>Ct.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.enterAltText"),onKeyup:e.withKeys(no,["enter"])},null,40,vi),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",hi,[e.createElementVNode("label",gi,e.toDisplayString(e.unref(H)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[20]||(o[20]=a=>Je.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.auto"),onKeyup:e.withKeys(no,["enter"]),onInput:Oo},null,40,yi),[[e.vModelText,Je.value]])]),e.createElementVNode("div",Ci,[e.createElementVNode("label",ki,e.toDisplayString(e.unref(H)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[21]||(o[21]=a=>Ce.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.auto"),onKeyup:e.withKeys(no,["enter"]),onInput:el},null,40,xi),[[e.vModelText,Ce.value]])])])])):e.createCommentVNode("",!0),nt.value==="url"?(e.openBlock(),e.createElementBlock("div",wi,[e.createElementVNode("div",bi,[e.createElementVNode("div",Ei,[e.createElementVNode("label",Vi,e.toDisplayString(e.unref(H)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Vo,type:"text","onUpdate:modelValue":o[22]||(o[22]=a=>Ke.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(no,["enter"])},null,40,Si),[[e.vModelText,Ke.value]])]),e.createElementVNode("div",Ni,[e.createElementVNode("label",Mi,e.toDisplayString(e.unref(H)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":o[23]||(o[23]=a=>Ct.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.enterAltText"),onKeyup:e.withKeys(no,["enter"])},null,40,Bi),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",Ti,[e.createElementVNode("label",Hi,e.toDisplayString(e.unref(H)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[24]||(o[24]=a=>Je.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.auto"),onKeyup:e.withKeys(no,["enter"]),onInput:Oo},null,40,Ai),[[e.vModelText,Je.value]])]),e.createElementVNode("div",Li,[e.createElementVNode("label",$i,e.toDisplayString(e.unref(H)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[25]||(o[25]=a=>Ce.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.auto"),onKeyup:e.withKeys(no,["enter"]),onInput:el},null,40,Di),[[e.vModelText,Ce.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Zo},e.toDisplayString(e.unref(H)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:no},e.toDisplayString(e.unref(H)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":fn.value&&Et.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(H)("textEditor.labels.title")),1),e.createElementVNode("div",Ii,[Et.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",_i,[z.title?(e.openBlock(),e.createElementBlock("span",Ri,e.toDisplayString(z.title),1)):(e.openBlock(),e.createElementBlock("span",Fi,e.toDisplayString(pn.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:se,value:z.title,onInput:A,onFocus:so,onBlur:ne,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Et.value}]),placeholder:pn.value,disabled:z.disabled,rows:"1"},null,42,zi)])],2),fn.value&&Et.value?(e.openBlock(),e.createElementBlock("div",Pi,[e.renderSlot(l.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Yo.value&&Zt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(H)("textEditor.labels.description")),1),e.createElementVNode("div",Oi,[Zt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Zi,[z.description?(e.openBlock(),e.createElementBlock("span",Wi,e.toDisplayString(z.description),1)):(e.openBlock(),e.createElementBlock("span",Ui,e.toDisplayString(Ln.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Ne,value:z.description,onInput:No,onFocus:X,onBlur:ul,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!Zt.value}]),placeholder:Ln.value,disabled:z.disabled,rows:"1"},null,42,qi)])],2),Yo.value&&Zt.value?(e.openBlock(),e.createElementBlock("div",Xi,[e.renderSlot(l.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":qe.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:s=>Wo(a),onMouseleave:Cl},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(s=>ln(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Ki)):(e.openBlock(),e.createElementBlock("span",Gi,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,ji)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(s=>ln(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Qi)):(e.openBlock(),e.createElementBlock("span",ec,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Ji)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(s=>ln(a),["stop"])},[e.createElementVNode("span",oc,"+"+e.toDisplayString(a.additionalCount),1)],12,tc)):e.createCommentVNode("",!0)],46,Yi))),128)),z.richText?(e.openBlock(),e.createElementBlock("div",cc,[e.createElementVNode("div",{ref_key:"editorRef",ref:g,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":z.disabled,"dss-text-editor-fixed-height":z.fixedHeight}]),style:e.normalizeStyle(dn.value),onInput:fe,onBlur:dl,onClick:jn,onMouseup:Kn,onKeyup:Kn,onKeydown:_o,onPaste:Un,onMousemove:vl,onMouseleave:xn},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[qe.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(Mo.value)},[io.value||$e.value.length>0?(e.openBlock(),e.createElementBlock("div",uc,[e.createElementVNode("div",dc,[io.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:io.value},null,8,mc)):e.createCommentVNode("",!0)]),e.createElementVNode("div",pc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(a,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",fc,[e.createElementVNode("div",vc,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,hc)):(e.openBlock(),e.createElementBlock("span",gc,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",yc,[e.createElementVNode("div",Cc,[e.createElementVNode("div",kc,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",xc,e.toDisplayString(Ee(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":U(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),S.commentUser&&a.user&&a.user.id===S.commentUser.id&&!U(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(i=>Be(a,s),["stop"]),title:e.unref(H)("textEditor.comment.delete")||"Delete comment"},[...o[80]||(o[80]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,wc)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",bc,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Mt,"onUpdate:modelValue":o[26]||(o[26]=a=>Gt.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(H)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Jt,["prevent","stop"]),["enter"]),onInput:o[27]||(o[27]=()=>{if(Mt.value){const a=Mt.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,Ec),[[e.vModelText,Gt.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Jt,["stop"])},[...o[81]||(o[81]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Vc,[e.createElementVNode("div",Sc,[e.createElementVNode("span",Nc,e.toDisplayString(St.value)+" "+e.toDisplayString(St.value===1?e.unref(H)("textEditor.footer.word"):e.unref(H)("textEditor.footer.words")),1),o[82]||(o[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Mc,e.toDisplayString(qo.value)+" "+e.toDisplayString(qo.value===1?e.unref(H)("textEditor.footer.character"):e.unref(H)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",nc,[e.createElementVNode("textarea",{value:z.modelValue,onInput:hn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":z.fixedHeight}]),placeholder:rl.value,rows:z.rows,disabled:z.disabled,style:e.normalizeStyle(un.value)},null,46,lc),e.createElementVNode("div",ac,[e.createElementVNode("div",sc,[e.createElementVNode("span",rc,e.toDisplayString(St.value)+" "+e.toDisplayString(St.value===1?e.unref(H)("textEditor.footer.word"):e.unref(H)("textEditor.footer.words")),1),o[79]||(o[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",ic,e.toDisplayString(qo.value)+" "+e.toDisplayString(qo.value===1?e.unref(H)("textEditor.footer.character"):e.unref(H)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[D.value&&le.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ke.value),onMouseenter:o[28]||(o[28]=a=>gt.value=!0),onMouseleave:zo},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Gn,["stop"]),title:le.value},e.toDisplayString(le.value),9,Bc),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(bn,["stop"]),title:e.unref(H)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Hc,[...o[83]||(o[83]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Tc)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Pt.value&&So.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Bn.value),onMouseenter:o[29]||(o[29]=a=>We.value=!0),onMouseleave:ye},[e.createElementVNode("div",Ac,[So.value===e.unref(H)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Lc,[...o[84]||(o[84]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:So.value},e.toDisplayString(So.value),9,$c)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(gl,["stop"]),title:e.unref(H)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",Ic,[...o[85]||(o[85]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Dc)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[z.floatingToolbar&&z.richText&&xe.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Ao,class:"dss-floating-toolbar",style:e.normalizeStyle(rn.value),onMousedown:o[44]||(o[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",_c,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(yn,["stop"]),title:e.unref(H)("textEditor.toolbar.undo")},[...o[86]||(o[86]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Rc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Hn.value}]),onClick:e.withModifiers(Cn,["stop"]),title:e.unref(H)("textEditor.toolbar.redo")},[...o[87]||(o[87]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Fc),o[107]||(o[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",zc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[30]||(o[30]=e.withModifiers(a=>uo("paragraph"),["stop"])),title:e.unref(H)("textEditor.toolbar.paragraphFormat")},[Fe.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Oc,[...o[88]||(o[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Zc,[...o[89]||(o[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Wc,[...o[90]||(o[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Uc,[...o[91]||(o[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h5"?(e.openBlock(),e.createElementBlock("svg",qc,[...o[92]||(o[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Xc,[...o[93]||(o[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Yc,[...o[94]||(o[94]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),o[95]||(o[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Pc),At.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[38]||(o[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[31]||(o[31]=a=>he("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[32]||(o[32]=a=>he("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[33]||(o[33]=a=>he("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[34]||(o[34]=a=>he("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[35]||(o[35]=a=>he("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[36]||(o[36]=a=>he("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[37]||(o[37]=a=>he("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),o[108]||(o[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("bold")}]),onClick:o[39]||(o[39]=e.withModifiers(a=>at("bold"),["stop"])),title:e.unref(H)("textEditor.toolbar.bold")},[...o[96]||(o[96]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,jc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("italic")}]),onClick:o[40]||(o[40]=e.withModifiers(a=>at("italic"),["stop"])),title:e.unref(H)("textEditor.toolbar.italic")},[...o[97]||(o[97]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Kc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("underline")}]),onClick:o[41]||(o[41]=e.withModifiers(a=>at("underline"),["stop"])),title:e.unref(H)("textEditor.toolbar.underline")},[...o[98]||(o[98]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Gc),o[109]||(o[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Eo.value}]),onClick:e.withModifiers(Io,["stop"]),title:e.unref(H)("textEditor.toolbar.citation")},[...o[99]||(o[99]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Jc),o[110]||(o[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ct.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Fn,["stop"]),title:e.unref(H)("textEditor.toolbar.removeLink")},[...o[101]||(o[101]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,eu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Rn,["stop"]),title:e.unref(H)("textEditor.toolbar.insertLink")},[...o[100]||(o[100]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Qc)),o[111]||(o[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("insertUnorderedList")}]),onClick:e.withModifiers(zn,["stop"]),title:e.unref(H)("textEditor.toolbar.bulletList")},[...o[102]||(o[102]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("insertOrderedList")}]),onClick:e.withModifiers(Pn,["stop"]),title:e.unref(H)("textEditor.toolbar.numberList")},[...o[103]||(o[103]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,ou),o[112]||(o[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Ho,["stop"]),title:e.unref(H)("textEditor.toolbar.image")},[...o[104]||(o[104]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,nu),o[113]||(o[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(H)("textEditor.toolbar.comment"),onClick:e.withModifiers(vt,["stop"])},[...o[105]||(o[105]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,lu),z.askAi?(e.openBlock(),e.createElementBlock("div",au)):e.createCommentVNode("",!0),z.askAi?(e.openBlock(),e.createElementBlock("div",su,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:o[42]||(o[42]=e.withModifiers(a=>uo("askAi"),["stop"])),title:e.unref(H)("textEditor.toolbar.askAi")},[o[106]||(o[106]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",iu,e.toDisplayString(e.unref(H)("textEditor.toolbar.askAi")),1)],8,ru),At.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[43]||(o[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Dn.value?(e.openBlock(),e.createElementBlock("div",cu,[z.askAi&&Dn.value?(e.openBlock(),e.createElementBlock("div",uu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.customToolbarSlots,(a,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[qt(a)&&Xo(a)?(e.openBlock(),e.createElementBlock("div",du,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),qt(a)&&Xo(a)&&s<z.customToolbarSlots.length-1&&$n(s)?(e.openBlock(),e.createElementBlock("div",mu)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),vu={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 (optional)"},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"}},hu={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"}},Vl={chart:vu,textEditor:hu},gu={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 (optionnel)"},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"}},yu={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"}},Sl={chart:gu,textEditor:yu},Cu={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"}},ku={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"}},Nl={chart:Cu,textEditor:ku},wl={en:Vl,fr:Sl,nl:Nl};function xu(z){if(!z||!z.global)return;const vo=z.global.availableLocales||[];Object.keys(wl).forEach(J=>{vo.includes(J)&&z.global.mergeLocaleMessage(J,wl[J])})}const bl={en:{textEditor:Vl.textEditor},fr:{textEditor:Sl.textEditor},nl:{textEditor:Nl.textEditor}};function wu(z){if(!z||!z.global)return;const vo=z.global.availableLocales||[];Object.keys(bl).forEach(J=>{vo.includes(J)&&z.global.mergeLocaleMessage(J,bl[J])})}const bu={en:{...Vl},fr:{...Sl},nl:{...Nl}};El.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:bu});exports.DSSChart=xr;exports.DSSChartMessages=wl;exports.DSSModal=xl;exports.DSSTextEditor=fu;exports.DSSTextEditorMessages=bl;exports.addDSSChartTranslations=xu;exports.addDSSTextEditorTranslations=wu;
77
+ </svg>`,v=e.ref(null),Ce=e.ref(null),_e=e.ref(!1),xe=e.ref(!1),I=e.ref(!1),re=e.ref(""),be=e.ref({}),Zt=e.ref(!1),Gt=e.ref(!1),O=e.ref(""),ft=e.ref(""),Wt=e.ref(null),Re=e.ref(null),Oe=e.ref(null),lt=e.ref(null),ie=e.ref(""),Ct=e.ref(!1),te=e.ref({}),Te=e.ref(!1),jn=e.ref({}),Rt=e.ref(null),Qt=e.ref(null),cn=e.ref(!1),Jt=e.ref(""),vn=e.ref(null),We=e.ref(""),qe=e.ref(""),He=e.ref(""),ze=e.ref(null),en=e.ref(null),bn=e.ref(null),Ne=e.ref(null),fn=e.ref(null),Lt=e.ref(!1),ln=e.ref(""),nl=e.ref({}),Ue=e.ref(!1),Xe=e.ref("upload"),rt=e.ref(""),It=e.ref(null),_t=e.ref(null),Ye=e.ref([]),ot=e.ref([]),ue=e.ref(null),Ee=e.ref(!1),qt=e.ref(""),je=e.ref(""),Ft=e.ref(""),Je=e.ref(""),et=e.ref(""),Ke=e.ref(""),pe=e.ref(null),$e=e.ref(null),Tt=e.ref(null),Be=e.ref(!1),gt=e.ref(null),Ut=e.ref(!1),ht=e.ref(!1),it=e.ref(null),at=e.ref("p"),st=e.ref(!1),on=e.ref([]),ct=e.ref(null),bt=e.ref(null),M=e.ref(null),D=e.ref(!1),_=e.ref(0),X=100,ae=e.ref(null),we=e.computed(()=>({"dss-text-editor-no-border":!N.border,"dss-text-editor-rounded":N.rounded,"dss-text-editor-full-height":N.fullHeight,"dss-comment-overlay-open":At.value!==null})),Se=e.computed(()=>({})),ye=e.computed(()=>!N.fixedHeight||N.fullHeight?{}:{height:`${1.6*14*N.rows+24+2}px`,resize:"none",overflowY:"auto"}),Pe=e.computed(()=>!N.fixedHeight||N.fullHeight?{}:{height:`${1.6*14*N.rows+32}px`,overflowY:"auto"}),Xt=e.computed(()=>N.richText&&ot.value.length>0),Fn=e.computed(()=>{if(!N.modelValue)return"";if(N.richText){let o=N.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/&nbsp;/g," "),o=o.replace(/&amp;/g,"&"),o=o.replace(/&lt;/g,"<"),o=o.replace(/&gt;/g,">"),o=o.replace(/&quot;/g,'"'),o=o.replace(/&#39;/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return N.modelValue}),tn=e.computed(()=>{const o=Fn.value.trim();return o?o.split(/\s+/).filter(n=>n.length>0).length:0}),zn=e.computed(()=>Fn.value.length),cl=e.computed(()=>Ne.value!==null&&Xe.value==="upload"&&We.value&&We.value.startsWith("data:")),ll=e.computed(()=>N.titlePlaceholder||R("textEditor.placeholders.title")),Cl=e.computed(()=>N.descriptionPlaceholder||R("textEditor.placeholders.description")),Mn=e.computed(()=>N.placeholder||R("textEditor.placeholders.startTyping")),dt=o=>Qe&&Qe[o]!==void 0,un=o=>{for(let n=o+1;n<N.customToolbarSlots.length;n++)if(dt(N.customToolbarSlots[n]))return!0;return!1},wn=o=>{for(let n=o+1;n<N.customToolbarSlots.length;n++){const a=N.customToolbarSlots[n];if(dt(a)&&Pn(a))return!0}return!1},Pn=o=>N.customToolbarFloatingMap.hasOwnProperty(o)?N.customToolbarFloatingMap[o]===!0:!0,bl=e.computed(()=>N.customToolbarSlots.some(o=>dt(o)&&Pn(o))),ol=e.computed(()=>dt("title-slot")),On=e.computed(()=>dt("description-slot")),xn=o=>{if(!o||o.trim()==="")return"<html></html>";const n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?o:`<html>${o}</html>`},Yt=o=>{if(!o||o.trim()==="")return"";const n=o.replace(/<!--[\s\S]*?-->/g,""),a=n.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():n},$l=o=>{if(!o)return;const n=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),a=[];let s=n.nextNode();for(;s;)a.push(s),s=n.nextNode();a.forEach(i=>i.remove())},tt=o=>{try{const n=String(o.getDate()).padStart(2,"0"),s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],i=o.getFullYear();return`${n} ${s} ${i}`}catch{return""}},G=o=>{if(!o||typeof o!="string")return!1;const n=o.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const i=R("textEditor.started_conversation");if(i&&n===i)return!0}catch{}const s=n.toLowerCase();return s.includes("started conversation")||s.includes("démarré la conversation")||s==="started conversation"||s==="a démarré la conversation"},dl=o=>{const n=o.target.value;ke("update:modelValue",n),ke("change",n)},ve=()=>{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 s=o.value;o.value="M";const i=o.scrollHeight;o.value=s,o.style.setProperty("height",`${i}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},gn=()=>{Ut.value=!0,ve()},me=()=>{Ut.value=!1,Me()},Me=()=>{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 n=o.value;o.value="M";const a=o.scrollHeight;o.value=n,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},P=o=>{const a=o.target.value;Ut.value&&ve(),ke("update:title",a),ke("title-change",a),Tt.value="title",N.richText&&(Ee.value||(je.value=qt.value,et.value=Ft.value,Ke.value=Je.value),ue.value&&clearTimeout(ue.value),Ee.value=!0,ue.value=setTimeout(()=>{Ee.value=!1,C()},500))},ut=()=>{if(!$e.value)return;const o=$e.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 s=o.value;o.value="M";const i=o.scrollHeight;o.value=s,o.style.setProperty("height",`${i}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},Q=()=>{ht.value=!0,ut()},Ll=()=>{ht.value=!1,Bn()},Bn=()=>{if(!$e.value)return;const o=$e.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const n=o.value;o.value="M";const a=o.scrollHeight;o.value=n,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},hn=o=>{const a=o.target.value;ht.value&&ut(),ke("update:description",a),ke("description-change",a),Tt.value="description",N.richText&&(Ee.value||(je.value=qt.value,et.value=Ft.value,Ke.value=Je.value),ue.value&&clearTimeout(ue.value),Ee.value=!0,ue.value=setTimeout(()=>{Ee.value=!1,C()},500))},wt=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const n=o.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const a=n.cloneRange();return a.selectNodeContents(v.value),a.setEnd(n.startContainer,n.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+n.toString().length}},an=o=>{if(!(!o||!v.value))try{const n=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(v.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}else{v.value.focus();return}let s=0;const i=[v.value];let u=null,d=!1,m=!1;for(;!m&&(u=i.pop());)if(u.nodeType===3){const p=s+u.length;!d&&o.start>=s&&o.start<=p&&(a.setStart(u,o.start-s),d=!0),d&&o.end>=s&&o.end<=p&&(a.setEnd(u,o.end-s),m=!0),s=p}else{let p=u.childNodes.length;for(;p--;)i.push(u.childNodes[p])}n.removeAllRanges(),n.addRange(a)}catch{v.value.focus()}},Kn=()=>{if(!v.value)return;v.value.focus();const o=window.getSelection(),n=document.createRange(),a=i=>{if(i.nodeType===3||i.childNodes.length===0)return i;for(let u=i.childNodes.length-1;u>=0;u--){const d=i.childNodes[u],m=a(d);if(m)return m}return i},s=a(v.value);if(s.nodeType===3)n.setStart(s,s.length),n.setEnd(s,s.length);else if(s.childNodes.length>0){const i=a(s);i&&i.nodeType===3?(n.setStart(i,i.length),n.setEnd(i,i.length)):(n.selectNodeContents(s),n.collapse(!1))}else n.setStart(s,0),n.setEnd(s,0);o.removeAllRanges(),o.addRange(n)},C=(o=!1)=>{if(!v.value)return;const n=v.value.innerHTML,a=N.title||"",s=N.description||"";if(!o&&n===qt.value&&a===Ft.value&&s===Je.value)return;const i={content:je.value||qt.value,title:et.value!==void 0?et.value:Ft.value,description:Ke.value!==void 0?Ke.value:Je.value},u=Ye.value.length>0?Ye.value[Ye.value.length-1]:null;let d=!0;u&&(typeof u=="string"?d=i.content!==u:d=i.content!==u.content||i.title!==u.title||i.description!==u.description),d&&(Ye.value.push(i),Ye.value.length>50&&Ye.value.shift(),ot.value=[]),qt.value=n,Ft.value=a,Je.value=s,je.value=n,et.value=a,Ke.value=s},y=o=>{if(!v.value)return;V(),v.value&&$l(v.value);let n=null;v.value&&(v.value.querySelector("p")||(n=wt(),H()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&it.value&&(it.value=null),xe.value=!0;const s=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),i=xn(s);ke("update:modelValue",i),ke("change",i),Tt.value="editor",Ee.value||(je.value=qt.value,et.value=Ft.value,Ke.value=Je.value),ue.value&&clearTimeout(ue.value),Ee.value=!0,ue.value=setTimeout(()=>{Ee.value=!1,C(),Fl(),co()},500),e.nextTick(()=>{n&&an(n),V();const u=["bold","italic","underline"],d=window.getSelection(),m=d.rangeCount>0?d.getRangeAt(0):null,p=m&&m.collapsed;if(u.forEach(h=>{try{if(p&&it.value?.command===h){te.value[h]=it.value.state;return}if(h==="bold")if(m){const x=m.commonAncestorContainer,E=x.nodeType===3?x.parentElement:x;let w=!1;if(E&&((E.tagName==="STRONG"||E.tagName==="B"||E.closest&&E.closest("strong, b"))&&(w=!0),!w&&E.style&&parseInt(E.style.fontWeight)>=600&&(w=!0),!w))try{const F=window.getComputedStyle(E);parseInt(F.fontWeight)>=600&&(w=!0)}catch{}te.value[h]=w}else te.value.hasOwnProperty(h)||(te.value[h]=!1);else if(h==="italic")if(m){const x=m.commonAncestorContainer,E=x.nodeType===3?x.parentElement:x,w=E&&(E.tagName==="EM"||E.tagName==="I"||E.closest&&E.closest("em, i"));te.value[h]=!!w}else{const x=document.queryCommandState(h);te.value[h]=x}else{const x=document.queryCommandState(h);te.value[h]=x}}catch{}}),dn(),Y(),Pt(),Ie(),An(),Cn("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>co(h),0),(h===" "||h===`
78
+ `||/[.,;:!?]/.test(h))&&setTimeout(()=>{Fl()},100)}xe.value=!1})},V=()=>{if(!v.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer,s=a.nodeType===3?a.parentElement:a;if(!s)return;const i=s.closest(".dss-image-wrapper");if(i){const u=i.querySelector("img");if(s!==u&&!u?.contains(s)){const d=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,m=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(i.contains(d)&&d!==u||i.contains(m)&&m!==u){const p=document.createRange();p.setStartAfter(i),p.collapse(!0),o.removeAllRanges(),o.addRange(p)}}}},H=()=>{if(!v.value)return;const o=v.value;if(o.querySelector&&o.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(o.childNodes);let s=null;a.forEach(i=>{if(i.nodeType===Node.TEXT_NODE){if((i.textContent||"").trim()===""){i.parentNode===o&&o.removeChild(i);return}s||(s=document.createElement("p"),o.insertBefore(s,i)),s.appendChild(i);return}if(i.nodeType===Node.ELEMENT_NODE){const u=i,d=u.tagName;if(d==="BR"){s=null;return}if(n.has(d)){s=null;return}s||(s=document.createElement("p"),o.insertBefore(s,u)),s.appendChild(u)}})},Y=()=>{if(v.value&&!Be.value){Be.value=!0;try{v.value.querySelectorAll(".dss-image-wrapper").forEach(s=>{s.querySelector("img")||s.remove()}),v.value.querySelectorAll(".dss-image-no-alt-icon").forEach(s=>{const i=s.parentElement;!i||!i.classList.contains("dss-image-wrapper")?s.remove():i.querySelector("img")||s.remove()}),v.value.querySelectorAll("img").forEach(s=>{let i=s.getAttribute("alt");i===null&&(i=s.alt||"");const u=s.getAttribute("src")||s.src||"";if(i){const h=u.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),x=i===u||i===h;(i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")||x||x)&&(i="")}s.setAttribute("alt",i),s.setAttribute("data-alt",i);const d=!i||i.trim()==="";let m=s.parentElement;const p=m&&m.classList.contains("dss-image-wrapper");if(p){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=s.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?s.nextElementSibling:null;h&&h.remove()}if(d){p?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),s.parentNode.insertBefore(m,s),m.appendChild(s));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=vt,m.appendChild(h)}else if(p&&m.children.length===1){const h=m.parentNode;h.insertBefore(s,m),h.removeChild(m)}})}finally{Be.value=!1}}},he=o=>{Fl(),ke("blur",o),vl()},Ve=()=>{if(N.disabled||!N.richText||!v.value)return;jt(),ue.value&&(clearTimeout(ue.value),ue.value=null),Ee.value&&(C(),Ee.value=!1);const o=Tt.value==="title",n=Tt.value==="description",a=Tt.value==="editor";if(Ye.value.length===0){o&&pe.value?pe.value.focus():n&&$e.value?$e.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{y()});return}const s={content:v.value.innerHTML,title:N.title||"",description:N.description||""};ot.value.push(s);const i=Ye.value.pop();if(i!==void 0){xe.value=!0;const u=typeof i=="string"?i:i.content,d=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";v.value.innerHTML=u,qt.value=u,Ft.value=d,Je.value=m,je.value=u,et.value=d,Ke.value=m,e.nextTick(()=>{dn(),Vt(),Dn(),Ie();const p=xn(u);ke("update:modelValue",p),ke("update:title",d),ke("update:description",m),ke("change",p),ke("title-change",d),ke("description-change",m),xe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(pe.value){pe.value.focus();const h=d.length;pe.value.setSelectionRange&&pe.value.setSelectionRange(h,h),ve()}}else if(n){if($e.value){$e.value.focus();const h=m.length;$e.value.setSelectionRange(h,h)}}else if(a)Kn();else if(pe.value&&document.activeElement===pe.value){const h=d.length;pe.value.setSelectionRange&&pe.value.setSelectionRange(h,h),ve()}else if($e.value&&document.activeElement===$e.value){const h=m.length;$e.value.setSelectionRange(h,h)}else v.value&&Kn()},10)})})}},zt=()=>{if(N.disabled||!N.richText||!v.value)return;jt();const o=Tt.value==="title",n=Tt.value==="description",a=Tt.value==="editor";if(ot.value.length===0){o&&pe.value?pe.value.focus():n&&$e.value?$e.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{y()});return}const s={content:v.value.innerHTML,title:N.title||"",description:N.description||""};Ye.value.push(s);const i=ot.value.pop();if(i!==void 0){xe.value=!0;const u=typeof i=="string"?i:i.content,d=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";v.value.innerHTML=u,qt.value=u,Ft.value=d,Je.value=m,je.value=u,et.value=d,Ke.value=m,e.nextTick(()=>{dn(),Vt(),Dn(),Ie();const p=xn(u);ke("update:modelValue",p),ke("update:title",d),ke("update:description",m),ke("change",p),ke("title-change",d),ke("description-change",m),xe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(pe.value){pe.value.focus();const h=d.length;pe.value.setSelectionRange&&pe.value.setSelectionRange(h,h),ve()}}else if(n){if($e.value){$e.value.focus();const h=m.length;$e.value.setSelectionRange(h,h)}}else if(a)Kn();else if(pe.value&&document.activeElement===pe.value){const h=d.length;pe.value.setSelectionRange&&pe.value.setSelectionRange(h,h),ve()}else if($e.value&&document.activeElement===$e.value){const h=m.length;$e.value.setSelectionRange(h,h)}else v.value&&Kn()},10)})})}},En=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(s=>{const i=s.style.fontWeight;if(i==="normal"||i==="400"){const u=document.createDocumentFragment();for(;s.firstChild;)u.appendChild(s.firstChild);s.parentNode&&s.parentNode.replaceChild(u,s)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(s=>{if(parseInt(s.style.fontWeight)>=600){const u=document.createElement("b");for(u.style.fontWeight="600";s.firstChild;)u.appendChild(s.firstChild);s.parentNode&&s.parentNode.replaceChild(u,s)}}),v.value.querySelectorAll("b, strong").forEach(s=>{s.style.fontWeight="600"})},Pt=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},wl=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let a=!1;if(n.collapsed){const s=n.startContainer;let i=s.nodeType===3?s.parentElement:s;for(;i&&i!==v.value;){if(i.tagName==="EM"||i.tagName==="I"){a=!0;break}if(i.style&&i.style.fontStyle==="italic"){a=!0;break}i=i.parentElement}}else{const s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(s){const i=document.createTreeWalker(s,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=i.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==v.value;){if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{Pt()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Pt()});else try{const s=n.extractContents(),i=document.createElement("em");i.style.fontStyle="italic",i.appendChild(s),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{Pt()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Pt()})}return!0},_l=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let a=!1;if(n.collapsed){const s=n.startContainer;let i=s.nodeType===3?s.parentElement:s;for(;i&&i!==v.value;){if(i.tagName==="STRONG"||i.tagName==="B"){a=!0;break}if(i.style&&parseInt(i.style.fontWeight)>=600){a=!0;break}i=i.parentElement}}else{const s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(s){const i=document.createTreeWalker(s,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=i.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==v.value;){if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{En()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0),u=i.startContainer;let d=u.nodeType===3?u.parentElement:u;for(;d&&d!==v.value;){if(d.tagName==="SPAN"&&d.style.fontWeight){const m=d.style.fontWeight;if(m==="normal"||m==="400"){const p=document.createElement("b");p.style.fontWeight="600";const h=document.createDocumentFragment();for(;d.firstChild;)h.appendChild(d.firstChild);p.appendChild(h),d.parentNode&&d.parentNode.replaceChild(p,d),i.setStart(p,0),i.collapse(!0),s.removeAllRanges(),s.addRange(i);break}}else if(d.tagName==="STRONG"||d.tagName==="B"){d.style.fontWeight="600";break}d=d.parentElement}if(!d||d===v.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",i.insertNode(m),i.setStart(m,0),i.collapse(!0),s.removeAllRanges(),s.addRange(i)}}En()});else try{const s=n.extractContents(),i=document.createElement("b");i.style.fontWeight="600",i.appendChild(s),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{En()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{En()})}return!0},sn=(o,n=null)=>{if(N.disabled||!N.richText||!v.value)return;Ee.value?(ue.value&&(clearTimeout(ue.value),ue.value=null),C(),Ee.value=!1):C(),jt(),v.value.focus();const a=window.getSelection();let s=null;if(a&&a.rangeCount>0){const u=a.getRangeAt(0);!u.collapsed&&Jn(u)&&(s=wt())}if(o==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const d=u.getRangeAt(0);if(d.collapsed)try{d.expand("word")}catch{const p=document.createTextNode(n);d.insertNode(p),d.selectNodeContents(p)}}}if(o==="bold"){const u=_l();te.value.bold=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(it.value={command:"bold",state:u}),e.nextTick(()=>{s&&(an(s),e.nextTick(()=>{const m=rn("bold");te.value.bold=m})),y(),Vt(),Ie()});return}if(o==="italic"){const u=wl();te.value.italic=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(it.value={command:"italic",state:u}),e.nextTick(()=>{s&&(an(s),e.nextTick(()=>{const m=rn("italic");te.value.italic=m})),y(),Pt(),Vt(),Ie()});return}let i=!1;try{i=document.execCommand(o,!1,n)}catch{}e.nextTick(()=>{if(s&&an(s),["bold","italic","underline"].includes(o))try{if(o==="bold")s&&e.nextTick(()=>{const d=rn("bold");te.value.bold=d});else if(o==="italic")if(s)e.nextTick(()=>{const d=rn("italic");te.value.italic=d});else{const d=document.queryCommandState(o);te.value[o]=d}else{const d=document.queryCommandState(o);te.value[o]=d}}catch{te.value.hasOwnProperty(o)?te.value[o]=!te.value[o]:te.value[o]=!0}if(o==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const p=d.getRangeAt(0),h=p.commonAncestorContainer.nodeType===1?p.commonAncestorContainer.closest("a"):p.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",n)}v.value.querySelectorAll("a").forEach(p=>{const h=p.getAttribute("href");(!h||h===""||h==="#")&&p.setAttribute("href",n)})}y(),Vt(),Ie()})},rn=(o,n=null)=>{if(N.disabled||!v.value)return!1;try{if(o==="formatBlock"&&n){const s=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const i=s.toLowerCase();if(i==="blockquote"||i==="<blockquote>")return!0;const u=window.getSelection();if(u.rangeCount>0){const m=u.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return s===n||s.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0);if(o==="bold"){let d=!1;if(i.collapsed){const m=i.commonAncestorContainer,p=m.nodeType===3?m.parentElement:m;if(p&&((p.tagName==="STRONG"||p.tagName==="B"||p.closest&&p.closest("strong, b"))&&(d=!0),!d&&p.style&&parseInt(p.style.fontWeight)>=600&&(d=!0),!d))try{const h=window.getComputedStyle(p);parseInt(h.fontWeight)>=600&&(d=!0)}catch{}return te.value.hasOwnProperty(o)?te.value[o]:(te.value[o]=d,d)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let p=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let x;for(;x=h.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(x))){if(x.nodeType===3){if(!(x.textContent||"").trim())continue;p=!0;let w=x.parentElement;for(;w&&w!==v.value;){if(w.tagName==="STRONG"||w.tagName==="B"){d=!0;break}if(w.style&&parseInt(w.style.fontWeight)>=600){d=!0;break}w=w.parentElement}}else if(x.nodeType===1){const E=x;if(E.tagName==="STRONG"||E.tagName==="B"){d=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){d=!0;break}}if(d)break}}return te.value[o]=d&&p,d&&p}}if(o==="italic"){let d=!1;if(i.collapsed){const m=i.commonAncestorContainer,p=m.nodeType===3?m.parentElement:m;if(p&&((p.tagName==="EM"||p.tagName==="I"||p.closest&&p.closest("em, i"))&&(d=!0),!d&&p.style&&p.style.fontStyle==="italic"&&(d=!0),!d))try{window.getComputedStyle(p).fontStyle==="italic"&&(d=!0)}catch{}return te.value.hasOwnProperty(o)?te.value[o]:(te.value[o]=d,d)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let p=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let x;for(;x=h.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(x))){if(x.nodeType===3){if(!(x.textContent||"").trim())continue;p=!0;let w=x.parentElement;for(;w&&w!==v.value;){if(w.tagName==="EM"||w.tagName==="I"){d=!0;break}if(w.style&&w.style.fontStyle==="italic"){d=!0;break}w=w.parentElement}}else if(x.nodeType===1){const E=x;if(E.tagName==="EM"||E.tagName==="I"){d=!0;break}if(E.style&&E.style.fontStyle==="italic"){d=!0;break}}if(d)break}}return te.value[o]=d&&p,d&&p}}const u=document.queryCommandState(o);return i.collapsed&&te.value.hasOwnProperty(o)?te.value[o]:(te.value[o]=u,u)}return te.value.hasOwnProperty(o)?te.value[o]:!1}catch{return te.value.hasOwnProperty(o)?te.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Yl=o=>{N.disabled||!N.richText||(Ce.value=Ce.value===o?null:o,o==="askAi"&&(Qt.value=null))},jt=()=>{Ce.value=null,It.value=null},Tn=o=>{sn("formatBlock",o),jt()},ho=o=>{if(!o||!v.value)return o;const n=W=>{let K=W.nodeType===Node.TEXT_NODE?W.parentElement:W;for(;K&&K!==v.value;){const fe=K.tagName;if(fe==="P"){const Ht=K.parentElement;if(Ht===v.value||Ht.tagName==="BLOCKQUOTE")return K}if(fe==="BLOCKQUOTE")break;K=K.parentElement}return null},a=n(o.startContainer),s=n(o.endContainer);if(!a||!s)return o;const i=[],u=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:W=>{const K=W.tagName;if(K==="P"){const fe=W.parentElement;if(fe===v.value||fe.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return K==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let d;for(;d=u.nextNode();)i.push(d);const m=i.indexOf(a),p=i.indexOf(s);if(m===-1||p===-1)return o;const h=Math.min(m,p),x=Math.max(m,p),E=i.slice(h,x+1);if(E.length===0)return o;const w=E[0],F=E[E.length-1],A=document.createRange();return A.setStartBefore(w),A.setEndAfter(F),A},ul=()=>{if(N.disabled||!N.richText||!v.value)return;Ee.value?(ue.value&&(clearTimeout(ue.value),ue.value=null),C(),Ee.value=!1):C(),jt(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let n=o.getRangeAt(0);!n.collapsed&&Jn(n)&&(n=ho(n),o.removeAllRanges(),o.addRange(n));let a=null;!n.collapsed&&Jn(n)&&(a=wt());const s=n.commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!!(i&&v.value.contains(i))){if(i){const d=i.parentNode;Array.from(i.childNodes).forEach(p=>{if(p.nodeType===Node.ELEMENT_NODE)if(p.tagName==="P"||p.tagName==="DIV")d.insertBefore(p,i);else{const h=document.createElement("p");h.appendChild(p.cloneNode(!0)),d.insertBefore(h,i)}else if(p.nodeType===Node.TEXT_NODE&&p.textContent.trim()){const h=document.createElement("p");h.appendChild(p.cloneNode(!0)),d.insertBefore(h,i)}}),i.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const d=document.createElement("blockquote"),m=n.extractContents();d.appendChild(m),n.insertNode(d);const p=[],h=document.createTreeWalker(d,NodeFilter.SHOW_TEXT,{acceptNode:w=>w.parentNode===d&&w.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let x;for(;x=h.nextNode();)p.push(x);if(p.forEach(w=>{const F=document.createElement("p");w.parentNode.insertBefore(F,w),F.appendChild(w)}),d.querySelectorAll("p, div").forEach(w=>{w.textContent.trim()===""&&!w.querySelector("img")&&(w.innerHTML="<br>")}),d.children.length===0&&d.textContent.trim()===""){const w=document.createElement("p");w.innerHTML="<br>",d.appendChild(w)}}e.nextTick(()=>{a&&an(a),Dn(),y(),Ie()})},Al=()=>{if(!v.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const a=o.getRangeAt(0).commonAncestorContainer,s=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!s||!v.value.contains(s))return;const i=x=>{if(!x)return!1;const E=x.textContent||"",F=(x.innerHTML||"").trim();return E.trim()===""||F===""||F==="<br>"||F==="<br/>"||F==="<p></p>"||F==="<p><br></p>"||F==="<p><br/></p>"||F==="<p> </p>"||F==="<p><br> </p>"||F==="<div></div>"||F==="<div><br></div>"||F==="<div><br/></div>"};let u=null;for(a.nodeType===3?u=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?u=a:u=a.closest("p, div"),u&&s.contains(u)&&i(u)&&u.remove();s.lastChild;){const x=s.lastChild;if(x.nodeType===1&&x.tagName==="BR")x.remove();else if(x.nodeType===3)if((x.textContent||"").trim()==="")x.remove();else break;else break}if(s.children.length>0)for(let x=s.children.length-1;x>=0;x--){const E=s.children[x];if((E.tagName==="P"||E.tagName==="DIV")&&i(E))E.remove();else break}let d=s.innerHTML;const m=d;d=d.replace(/(<br\s*\/?>)+$/gi,""),d!==m&&(s.innerHTML=d);const p=document.createElement("p");p.innerHTML="<br>",s.parentNode?s.nextSibling?s.parentNode.insertBefore(p,s.nextSibling):s.parentNode.appendChild(p):v.value&&v.value.appendChild(p);const h=document.createRange();h.selectNodeContents(p),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Dn(),y()})},Vt=()=>{if(!v.value){_e.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,s=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");_e.value=!!s}else _e.value=!1}catch{_e.value=!1}},jl=()=>{if(!v.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),lt.value=wt();const n=window.getSelection();let a="";n.rangeCount>0&&(a=n.getRangeAt(0).toString()),O.value="",ft.value=a,ie.value="",Oe.value=null,Gt.value=!0,jt(),e.nextTick(()=>{Wt.value&&Wt.value.focus()})},Kl=()=>{if(!v.value)return;Ee.value?(ue.value&&(clearTimeout(ue.value),ue.value=null),C(),Ee.value=!1):C();const o=window.getSelection();let n=null;if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer;n=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a")}if(!n&&Oe.value&&(n=Oe.value),n&&n.parentNode){const a=document.createDocumentFragment();for(;n.firstChild;)a.appendChild(n.firstChild);if(n.parentNode.replaceChild(a,n),a.firstChild){const s=document.createRange();s.setStartBefore(a.firstChild),s.setEndAfter(a.lastChild||a.firstChild),o.removeAllRanges(),o.addRange(s),document.execCommand("removeFormat",!1),s.collapse(!1),o.removeAllRanges(),o.addRange(s)}Oe.value=null}else sn("unlink");_e.value=!1,jt(),e.nextTick(()=>{y(),Vt()})},Gl=()=>{N.disabled||!N.richText||v.value&&(Ee.value?(ue.value&&(clearTimeout(ue.value),ue.value=null),C(),Ee.value=!1):C(),jt(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{dn(),y(),Ie()}))},Ql=()=>{N.disabled||!N.richText||v.value&&(Ee.value?(ue.value&&(clearTimeout(ue.value),ue.value=null),C(),Ee.value=!1):C(),jt(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{dn(),y(),Ie()}))},Jl=o=>{const n=o.parentElement;if(!n||n.tagName!=="OL")return null;let a=0,s=o.previousElementSibling;for(;s;)s.tagName==="LI"&&a++,s=s.previousElementSibling;return a+1},dn=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(n=>{const a=n.parentElement;if(a&&a.tagName==="LI"){const s=Jl(a);s!==null&&Array.from(n.children).filter(u=>u.tagName==="LI").forEach(u=>{u.setAttribute("data-parent-num",String(s))})}})},eo=()=>{if(N.disabled||!N.richText||!v.value)return;jt(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{dn(),y()});return}const s=a.parentElement;if(!s||s.tagName!=="OL"&&s.tagName!=="UL")return;const i=a.previousElementSibling;if(i&&i.tagName==="LI"){const u=s.tagName.toLowerCase();let d=i.querySelector(`:scope > ${u}`);d||(d=document.createElement(u),i.appendChild(d));const m=Jl(i);d.appendChild(a),m!==null&&s.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),dn();const p=document.createRange();p.selectNodeContents(a),p.collapse(!1),o.removeAllRanges(),o.addRange(p),e.nextTick(()=>{y(),Ie()})}else document.execCommand("indent",!1),e.nextTick(()=>{dn(),y(),Ie()})},to=()=>{if(N.disabled||!N.richText||!v.value)return;jt(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{dn(),y()});return}const s=a.parentElement;if(!s||s.tagName!=="OL"&&s.tagName!=="UL")return;const i=s.parentElement;if(i&&i.tagName==="LI"){const u=i.parentElement;if(u&&(u.tagName==="OL"||u.tagName==="UL")){s.tagName==="OL"&&a.removeAttribute("data-parent-num"),u.insertBefore(a,i.nextSibling),s.children.length===0&&s.remove(),dn();const d=document.createRange();d.selectNodeContents(a),d.collapse(!1),o.removeAllRanges(),o.addRange(d),e.nextTick(()=>{y(),Ie()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{dn(),y(),Ie()})},At=e.ref(null),Hn=e.ref(null),al=e.ref({}),$n=e.ref(""),yn=e.ref(null),Zn=e.ref("");e.ref("");const Vn=e.ref(null);e.ref("");const Nt=e.ref([]),B=e.ref(!1),St=e.ref(!1),kn=o=>{if(!o)return"";const n=o.cloneRange(),a=document.createElement("div");return a.appendChild(n.cloneContents()),a.innerHTML},mn=()=>{if(N.disabled||!N.richText||!v.value)return;if(At.value!==null){At.value=null,$n.value="",Zn.value="",Vn.value=null,Nt.value=[],tl(!0);return}jt(),v.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0);if(n.collapsed||!Jn(n))return;Zn.value=kn(n)||"",Vn.value=wt();const a=n.getBoundingClientRect(),s=v.value.parentElement;if(!s)return;const i=s.getBoundingClientRect(),u=a.bottom-i.top,m=Math.max(u+8,0);al.value={top:`${m}px`,bottom:"auto"},At.value=Date.now(),e.nextTick(()=>{if($n.value="",yn.value){const h=yn.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const p=s.querySelector(".dss-comment-overlay");if(p&&s){const h=s.querySelector(".dss-text-editor-footer");if(h){const x=s.getBoundingClientRect(),E=p.getBoundingClientRect(),w=h.getBoundingClientRect(),F=E.bottom-x.top,A=w.top-x.top,W=8;if(F>A-W){const K=w.height;al.value={bottom:`${K+W}px`,top:"auto"}}else al.value={top:`${m}px`,bottom:"auto"}}}})},Ln=()=>{if(!$n.value.trim())return;const o=$n.value.trim(),n=new Date,a={text:o,selectionText:Zn.value,selectionRange:Vn.value,commentId:At.value,user:N.commentUser||null,createdAt:n.toISOString()};Nt.value=[...Nt.value,a],ke("comment-submitted",a),yt(a),Vn.value&&!Dt(Vn.value)&&Gn(At.value,Vn.value),$n.value="",e.nextTick(()=>{if(yn.value){const s=yn.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`,s.focus()}Cn("sendComment")})},xt=(o,n)=>{if(!(!N.commentUser||!o.user||o.user.id!==N.commentUser.id)){if(Nt.value=Nt.value.filter((a,s)=>s!==n),At.value!==null&&v.value){const a=String(At.value),s=v.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(s&&Nt.value.length>0){const i=[],u=new Set;Nt.value.forEach(d=>{d.user&&d.user.id&&!u.has(d.user.id)&&(u.add(d.user.id),i.push(d.user))}),i.length>0?s.setAttribute("data-comment-user",JSON.stringify(i[0])):s.removeAttribute("data-comment-user"),i.length>1?s.setAttribute("data-comment-user-2",JSON.stringify(i[1])):s.removeAttribute("data-comment-user-2"),s.setAttribute("data-comment-count",String(Nt.value.length))}else s&&Nt.value.length===0&&(s.removeAttribute("data-comment-user"),s.removeAttribute("data-comment-user-2"),s.setAttribute("data-comment-count","0"))}if(ke("comment-deleted",{comment:o,index:n,commentId:At.value}),N.comments&&Array.isArray(N.comments)){const a=N.comments.filter(s=>!(s.commentId===o.commentId&&s.text===o.text&&s.user?.id===o.user?.id));ke("update:comments",a)}e.nextTick(()=>{Cn("deleteComment")})}},Dt=o=>{if(!o||!v.value)return!1;try{const n=_n(o);if(!n)return!1;const a=n.commonAncestorContainer,s=a.nodeType===3?a.parentElement:a;if(s)return!!s.closest("[data-comment], [data-fake-comment]")}catch{}return!1},_n=o=>{if(!o||!v.value)return null;try{const n=document.createRange();if(o.type==="element"&&o.element)return v.value.contains(o.element)?(n.setStart(o.element,o.offset),n.collapse(!0),n):null;let a=0;const s=[v.value];let i=null,u=!1,d=!1;for(;!d&&(i=s.pop());)if(i.nodeType===3){const m=a+i.length;!u&&o.start>=a&&o.start<=m&&(n.setStart(i,o.start-a),u=!0),u&&o.end>=a&&o.end<=m&&(n.setEnd(i,o.end-a),d=!0),a=m}else{let m=i.childNodes.length;for(;m--;)s.push(i.childNodes[m])}return u?n:null}catch{return null}},Gn=(o,n)=>{if(!(!o||!n||!v.value))try{const a=_n(n);if(!a||a.collapsed)return;const s=a.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i){const m=i.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 u=document.createElement("span");u.setAttribute("data-comment",String(o));try{const m=a.startContainer,p=a.endContainer,h=a.startOffset,x=a.endOffset,E=m.nodeType===3?m.parentNode:m,w=p.nodeType===3?p.parentNode:p;if(E===w&&h===0&&x===(p.nodeType===3?p.length:w.childNodes.length)&&(E.tagName==="P"||E.tagName==="DIV"||E.tagName==="H1"||E.tagName==="H2"||E.tagName==="H3"||E.tagName==="H4"||E.tagName==="H5"||E.tagName==="H6")){const A=a.extractContents();u.appendChild(A),a.insertNode(u)}else a.surroundContents(u)}catch{const p=a.extractContents();u.appendChild(p),a.insertNode(u)}const d=v.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Cn("wrapSelectionWithCommentMarker"),y()})}catch{}},yt=o=>{if(!o||!o.commentId)return;const n=Array.isArray(N.comments)?[...N.comments]:[],a=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let s=n.findIndex(u=>typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)===Number(a)||u.conversation_id===a);const i={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(s>=0){const u=n[s];if(u.conversation||(u.conversation=[]),u.conversation.push(i),u.updated_at=o.createdAt,!u.article_id&&n.length>0){const d=n.find(m=>m.article_id);d&&(u.article_id=d.article_id)}}else{const u=o.selectionRange,d=n.length>0&&n.find(p=>p.article_id)?.article_id||null,m={conversation_id:a,article_id:d,selection_range:u?{start:u.start||0,end:u.end||0,type:u.type||"text"}:null,selection_text:o.selectionText||"",conversation:[i],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};n.push(m)}B.value=!0,ke("update:comments",n)},kt=(o,n=[])=>{if(N.disabled||!N.richText||!v.value)return;const a=v.value;let s=null;try{s=a.querySelector(o)}catch{return}if(!s)return;jt(),a.focus();const i=document.createRange();i.selectNodeContents(s);const u=window.getSelection();u&&(u.removeAllRanges(),u.addRange(i)),Zn.value=s.innerHTML||"",Vn.value=wt();const d=i.getBoundingClientRect(),m=a.parentElement;if(m){const x=m.getBoundingClientRect(),E=d.bottom-x.top,F=Math.max(E+8,0);al.value={top:`${F}px`,bottom:"auto"}}const p=s.getAttribute("data-comment")||s.getAttribute("data-fake-comment");let h=[];if(p&&N.comments&&Array.isArray(N.comments)){const x=N.comments.find(E=>String(E.conversation_id)===String(p));if(x&&x.conversation&&Array.isArray(x.conversation)){const E=x.conversation.map(w=>({id:w.id||w.commentary_id,commentary_id:w.id||w.commentary_id,conversation_id:x.id||x.conversation_id,text:w.text,user:w.user,createdAt:w.created_at||w.createdAt,updated_at:w.updated_at||w.updatedAt}));h.push(...E)}}h.length===0&&Array.isArray(n)&&n.length>0&&(h=n.slice()),h.sort((x,E)=>{const w=W=>{if(!W)return 0;const K=new Date(W).getTime();return isNaN(K)?0:K},F=w(x.createdAt),A=w(E.createdAt);return F===A?0:F-A}),Nt.value=h,tl(!0),At.value=p||null,s&&(Hn.value=s,s.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if($n.value="",yn.value){const x=yn.value;x.style.height="auto",x.style.height=`${x.scrollHeight}px`,x.focus()}if(m){const x=m.querySelector(".dss-comment-overlay");if(x){const E=m.querySelector(".dss-text-editor-footer");if(E){const w=m.getBoundingClientRect(),F=x.getBoundingClientRect(),A=E.getBoundingClientRect(),W=F.bottom-w.top,K=A.top-w.top,fe=8;if(W>K-fe){const Ht=A.height;al.value={bottom:`${Ht+fe}px`,top:"auto"}}}}}Cn("openCommentOverlayForSelector")})},Le=e.ref(null),nn=e.ref(0),ml=o=>{if(!(N.disabled||!N.richText)){if(o.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!!(i&&v.value&&v.value.contains(i))){o.preventDefault();let d=null;s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",d&&i.contains(d)&&d.nextSibling?i.insertBefore(m,d.nextSibling):i.appendChild(m),setTimeout(()=>{Al()},50);return}}}if(o.key.length===1||o.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const a=n.getRangeAt(0),s=a.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i){const u=i.closest(".dss-image-wrapper");if(u){const d=u.querySelector("img");if(i!==d&&!d?.contains(i)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,p=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.contains(m)&&m!==d||u.contains(p)&&p!==d){o.preventDefault();const h=document.createRange();h.setStartAfter(u),h.collapse(!0),n.removeAllRanges(),n.addRange(h);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);let s=null,i=null;if(a.collapsed)if(o.key==="Backspace"){const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===0?d=u.previousSibling||u.parentNode:d=u.parentNode);const m=d.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(s=m,i=s.closest(".dss-image-wrapper"))),i||(i=d.closest(".dss-image-wrapper"),i&&(s=i.querySelector("img")))}else{const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===u.length?d=u.nextSibling||u.parentNode:d=u.parentNode);const m=d.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(s=m,i=s.closest(".dss-image-wrapper"))),i||(i=d.closest(".dss-image-wrapper"),i&&(s=i.querySelector("img")))}else{const u=a.commonAncestorContainer,d=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.nodeType===1&&u.tagName==="IMG"?(s=u,i=s.closest(".dss-image-wrapper")):(s=u.querySelector("img"),s&&(i=s.closest(".dss-image-wrapper"))),i){const p=i.contains(d)||d===i,h=i.contains(m)||m===i,E=a.cloneContents().textContent?.trim()||"",w=i.textContent?.trim()||"";(!p||!h||E.length>w.length)&&(i=null,s=null)}}if(i){o.preventDefault(),o.stopPropagation();const u=i.parentNode;if(u){const d=document.createTextNode("");u.insertBefore(d,i),i.remove();const m=document.createRange();m.setStartAfter(d),m.collapse(!0),n.removeAllRanges(),n.addRange(m),e.nextTick(()=>{y()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?to():eo();return}if(o.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);if(a.collapsed){const d=a.startContainer,m=p=>{if(!p)return!1;let h=p.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 x=p.parentElement;return x&&x!==v.value?m(x):!1};if(d.nodeType===3){const p=d.parentElement;if(p&&(m(p)||m(d))){const h=p.closest("p, div");if(h&&h!==v.value){o.preventDefault(),o.stopPropagation();let x=null;const E=a.startOffset;E<d.length&&(x=d.splitText(E));const w=document.createElement("p");if(x?w.appendChild(x):w.innerHTML="<br>",d.length===0){const A=d.parentElement;A&&(A.removeChild(d),A.childNodes.length===0&&A.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(w,h.nextSibling):h.parentNode.appendChild(w);const F=document.createRange();x?F.setStart(x,0):F.setStart(w,0),F.collapse(!0),n.removeAllRanges(),n.addRange(F),e.nextTick(()=>{y()});return}}}}const s=a.commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!!(i&&v.value&&v.value.contains(i))){let d=null;s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div");const m=A=>{if(!A)return!1;const W=A.textContent||"",fe=(A.innerHTML||"").trim(),Ht=fe.replace(/<br\s*\/?>/gi,"").trim();return W.trim()===""||fe===""||Ht===""||fe==="<br>"||fe==="<br/>"||fe==="<p></p>"||fe==="<p><br></p>"||fe==="<p><br/></p>"||fe==="<p> </p>"||fe==="<p><br> </p>"||fe==="<div></div>"||fe==="<div><br></div>"||fe==="<div><br/></div>"},p=i.lastChild,h=p&&p.nodeType===1&&p.tagName==="BR",x=a.startContainer,E=x.nodeType===3?x.parentElement:x,w=E===i||E&&E.parentElement===i;if(d&&m(d)||h&&w){o.preventDefault(),setTimeout(()=>{Al()},50);return}}}}if(o.key===" "){const n=Date.now(),a=n-nn.value;if(Le.value===" "&&a<300){const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0),u=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer.closest("li"):i.commonAncestorContainer.parentElement?.closest("li");if(u){const d=i.startContainer.textContent?.substring(0,i.startOffset)||"";if((u.textContent||"").indexOf(d.trim())<=10||d.trim().length<=2){o.preventDefault(),eo();return}}}}Le.value=" ",nn.value=n}else Le.value=o.key}},no=o=>{if(N.disabled||!N.richText)return;o.preventDefault();let n=o.clipboardData.getData("text/html"),a=o.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),C();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){let m=s.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),i=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const u=d=>{const p=new DOMParser().parseFromString(d,"text/html");let h=v.value.querySelector("h1")?1:0;if(p.querySelectorAll("h1").forEach(E=>{if(h>0){const w=p.createElement("p");w.innerHTML=E.innerHTML,E.parentNode.replaceChild(w,E)}else h++}),i){const E=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],w=Array.from(p.body.children).filter(F=>E.includes(F.tagName));if(w.length===1){const F=w[0].tagName,A=i.tagName,W=i.textContent.trim()===""&&!i.querySelector("img");let K=!1;if(["H1","H2","H3","H4","H5","H6"].includes(A)?K=!0:W||(F===A||F==="P")&&(K=!0),K)return w[0].innerHTML.trim()}}return p.body.innerHTML.trim()};if(n){const d=u(n);document.execCommand("insertHTML",!1,d)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=u(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);y()},pl=o=>{if(Ce.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&jt()}if(Te.value){const a=o.target,s=a.closest(".dss-floating-toolbar"),i=v.value&&a.closest(".dss-text-editor-content");!s&&!i&&vl()}if(Qt.value){const a=o.target,s=a.closest(".dss-floating-toolbar"),i=a.closest(".dss-toolbar-dropdown");!s&&!i&&Rn()}const n=o.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(It.value=null),!v.value||!n.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);st.value=!s.collapsed&&Jn(s)}else st.value=!1}if(At.value!==null){const a=document.querySelector(".dss-comment-overlay");let s=!1;if(a){const d=a.getBoundingClientRect(),m=o.clientX,p=o.clientY;s=m>=d.left&&m<=d.right&&p>=d.top&&p<=d.bottom}const i=n.closest(".dss-toolbar-button"),u=i&&i.getAttribute("title")==="Comment";!s&&!u&&(At.value=null,$n.value="",Zn.value="",Vn.value=null,Nt.value=[],tl(!0))}},xl=(o,n)=>{o&&o.stopPropagation&&o.stopPropagation(),_t.value&&(clearTimeout(_t.value),_t.value=null),It.value=n},lo=o=>{const n=o.relatedTarget;if(n){const a=n.closest(".dss-toolbar-dropdown-submenu"),s=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||s)return}_t.value&&clearTimeout(_t.value),_t.value=setTimeout(()=>{It.value=null,_t.value=null},150)},oo=o=>{It.value=null};let Qn=0;const ao=o=>{if(!o)return;const n=Array.from(o.children);n.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),n.forEach((a,s)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const i=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),u=a.nextElementSibling,d=u&&!u.classList.contains("dss-toolbar-dropdown-submenu")&&!u.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&u.tagName==="DIV"&&!u.classList.contains("dss-toolbar-dropdown-item")&&Array.from(u.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(i||d){const m=`submenu-auto-${++Qn}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let p=null;i?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(i,a.nextSibling),i.classList.add("dss-toolbar-dropdown-submenu"),p=i):d&&(u.classList.add("dss-toolbar-dropdown-submenu"),p=u),p&&(p.setAttribute("data-submenu-id",m),p.setAttribute("data-processed","true"),i&&a.tagName!=="BUTTON"?p.dataset.originalParentRef="inside":p.dataset.originalParentRef="sibling",Array.from(p.children).forEach(x=>{(x.tagName==="BUTTON"||x.tagName==="DIV")&&!x.classList.contains("dss-toolbar-dropdown-item")&&x.classList.add("dss-toolbar-dropdown-item")}))}})},Nn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{ao(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(i=>{const u=i._subMenuHandlers;u&&(i.removeEventListener("mouseenter",u.enter),i.removeEventListener("mouseleave",u.leave));const d=p=>{const h=i.getAttribute("data-submenu-id");h&&xl(p,h)},m=lo;i.addEventListener("mouseenter",d),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:d,leave:m}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(i=>{const u=i._subMenuHandlers;u&&(i.removeEventListener("mouseenter",u.enter),i.removeEventListener("mouseleave",u.leave));const d=h=>{const x=i.getAttribute("data-submenu-id");x&&xl(h,x)},m=lo;i.addEventListener("mouseenter",d),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:d,leave:m},i.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",oo)})})})};let sl=null;const El=()=>{if(It.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${It.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${It.value}"]`);o&&n&&go(o,n)}if(Te.value&&Ie(),N.richText){if(sl!==null)return;sl=setTimeout(()=>{sl=null,Cn("handleWindowResize")},150)}},Wn=()=>{if(!N.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(s=>s.tagName==="DIV"&&!s.classList.contains("dss-toolbar-button")).forEach(s=>{s.classList.add("dss-toolbar-button")})})},yo=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const s=window.getSelection();s.removeAllRanges?s.removeAllRanges():s.empty&&s.empty()}return!1};o.forEach(a=>{a.addEventListener("selectstart",n),a.addEventListener("mousedown",n),a.addEventListener("dragstart",n),a.addEventListener("contextmenu",n),a.addEventListener("click",s=>{if(window.getSelection){const i=window.getSelection();i.removeAllRanges&&i.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Ut.value?ve():Me(),ht.value?ut():Bn()})}),e.nextTick(()=>{yo()}),N.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",pl),window.addEventListener("resize",El);let o=null;const n=()=>{o===null&&(o=setTimeout(()=>{o=null,El()},150))};window.addEventListener("scroll",n,!0),v.value._windowScrollHandler=n,v.value._windowScrollTimeout=o,v.value.closest(".editor-with-comments"),v.value.closest(".dss-text-editor-content-wrapper");const a=v.value.closest(".dss-text-editor-content");let s=null;const i=()=>{s===null&&(s=setTimeout(()=>{s=null,El()},150))};a&&(a.addEventListener("scroll",i),v.value._scrollHandlers={wrapper:null,content:a,handler:i}),e.nextTick(()=>{Nn(),Wn()}),v.value.addEventListener("click",m=>{const p=m.target;p.closest("a")&&!N.disabled&&m.preventDefault();const x=p.closest(".dss-image-no-alt-icon"),E=p.closest(".dss-image-wrapper");if(x||E&&p===E){m.preventDefault(),m.stopPropagation();const w=window.getSelection(),F=document.createRange();F.setStartAfter(E),F.collapse(!0),w.removeAllRanges(),w.addRange(F)}else E&&p.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const w=window.getSelection();if(w.rangeCount>0){const A=w.getRangeAt(0).commonAncestorContainer,W=A.nodeType===3?A.parentElement:A;if(E.contains(W)&&W!==E.querySelector("img")){const K=document.createRange();K.setStartAfter(E),K.collapse(!0),w.removeAllRanges(),w.addRange(K)}}else{const F=document.createRange();F.setStartAfter(E),F.collapse(!0),w.addRange(F)}}))},!0),v.value.addEventListener("mousedown",m=>{const p=m.target,h=p.closest(".dss-image-no-alt-icon"),x=p.closest(".dss-image-wrapper");if(h||x&&p.tagName!=="IMG"){m.preventDefault();const E=window.getSelection(),w=document.createRange();x&&(w.setStartAfter(x),w.collapse(!0),E.removeAllRanges(),E.addRange(w))}},!0),v.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!v.value)return;v.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const E=h.getAttribute("alt")||h.alt||"";if(E){const w=h.getAttribute("src")||h.src||"",F=w.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),A=E===w||E===F;(E.startsWith("http://")||E.startsWith("https://")||E.startsWith("data:")||A||A)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),Y()})}),v.value.addEventListener("dragstart",m=>{const p=m.target,h=p.tagName==="IMG"?p:p.closest("img"),x=h?.closest(".dss-image-wrapper");h&&v.value.contains(h)&&(gt.value=x||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",m=>{gt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",m=>{gt.value&&(m.preventDefault(),m.stopPropagation())}),v.value.addEventListener("drop",m=>{if(!gt.value||!v.value)return;m.preventDefault(),m.stopPropagation();const p=gt.value,h=p.classList?.contains("dss-image-wrapper"),x=h?p.querySelector("img"):p,E=h?p:x?.closest(".dss-image-wrapper");if(!x||!v.value.contains(x)){gt.value=null;return}let w=null;const F=m.clientX,A=m.clientY;if(document.caretRangeFromPoint)w=document.caretRangeFromPoint(F,A);else{const Et=window.getSelection();Et.rangeCount>0?w=Et.getRangeAt(0).cloneRange():(w=document.createRange(),w.selectNodeContents(v.value),w.collapse(!1))}if(!w){gt.value=null;return}const W=w.commonAncestorContainer,K=W.nodeType===3?W.parentElement:W;if(K?.closest(".dss-image-wrapper")===E||E&&E.contains(K)){gt.value=null;return}if(E&&(K===E||E.contains(K))){gt.value=null;return}const Ht=x.getAttribute("src");let $t=null;E?$t=E.cloneNode(!0):$t=x.cloneNode(!0);try{let Et=w.startContainer;if(Et.nodeType===3&&(Et=Et.parentElement),E&&(Et===E||E.contains(Et))){const pt=document.createRange();pt.setStartAfter(E),pt.collapse(!0),w=pt}w.insertNode($t);const Mt=document.createRange();Mt.setStartAfter($t),Mt.collapse(!0);const Bt=window.getSelection();Bt.removeAllRanges(),Bt.addRange(Mt)}catch{if(v.value.childNodes.length===0){const Mt=document.createElement("p");Mt.appendChild($t),v.value.appendChild(Mt)}else{const Mt=v.value.lastChild;if(Mt&&Mt.nodeType===1)Mt.appendChild($t);else{const Bt=document.createElement("p");Bt.appendChild($t),v.value.appendChild(Bt)}}}E?E.remove():x.remove(),gt.value=null,e.nextTick(()=>{const Et=v.value.querySelectorAll("img");let Mt=!1;Et.forEach(Bt=>{if(Bt.getAttribute("src")===Ht)if(!Mt)Mt=!0;else{const pt=Bt.closest(".dss-image-wrapper");pt?pt.remove():Bt.remove()}}),Y(),y()})}),v.value.addEventListener("dragend",m=>{gt.value=null});let u=null;const d=new MutationObserver(m=>{m.forEach(p=>{p.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 x=h.querySelectorAll&&h.querySelectorAll("img");x&&x.forEach(E=>{E.removeAttribute("alt"),E.removeAttribute("data-alt"),E.setAttribute("alt",""),E.setAttribute("data-alt",""),E.alt=""})}})}),u&&clearTimeout(u),u=setTimeout(()=>{Y(),Wn(),u=null},100)});if(d.observe(v.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const p=new MutationObserver(()=>{e.nextTick(()=>{Wn()})});p.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=p}}),N.modelValue){const m=Yt(N.modelValue);v.value.innerHTML=m,H()}e.nextTick(()=>{const m=v.value.innerHTML||"",p=N.title||"",h=N.description||"";qt.value=m,Ft.value=p,Je.value=h,et.value=p,Ke.value=h,dn(),Y(),Pt(),An(),fo(),zl()}),Vt(),Dn(),v.value._mutationObserver=d}}),e.onUnmounted(()=>{if(document.removeEventListener("click",pl),window.removeEventListener("resize",El),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),sl!==null&&(clearTimeout(sl),sl=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),ue.value&&clearTimeout(ue.value),_t.value&&clearTimeout(_t.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),ct.value&&ct.value.disconnect(),bt.value!==null&&(cancelAnimationFrame(bt.value),bt.value=null),M.value!==null&&(clearTimeout(M.value),M.value=null),ae.value!==null&&(clearTimeout(ae.value),ae.value=null),tl(!0),v.value&&v.value._scrollHandlers){const{wrapper:n,content:a,handler:s}=v.value._scrollHandlers;n&&n.removeEventListener("scroll",s),a&&a.removeEventListener("scroll",s)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const so=o=>{const n=o.target,a=n.closest("a");if(a&&!N.disabled){o.preventDefault();const i=document.createRange();i.selectNodeContents(a);const u=window.getSelection();u.removeAllRanges(),u.addRange(i)}const s=n.closest(".dss-image-wrapper");s&&n.tagName!=="IMG"?e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const d=i.getRangeAt(0).commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(s.contains(m)&&m!==s.querySelector("img")){const p=document.createRange();p.setStartAfter(s),p.collapse(!0),i.removeAllRanges(),i.addRange(p)}}Y(),Vt(),Dn(),Ie(),An()}):e.nextTick(()=>{Y(),Vt(),Dn(),Ie(),An()})},ro=()=>{V();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);st.value=!a.collapsed&&Jn(a),!a.collapsed&&it.value&&(it.value=null)}else st.value=!1;if(Y(),Vt(),Dn(),Ie(),An(),o&&o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i&&i.closest(".dss-text-editor-footer")){o.removeAllRanges(),st.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0);if(!i.collapsed)if(a==="bold"){const u=i.commonAncestorContainer,d=u.nodeType===3?u.parentElement:u;let m=!1;if(d&&((d.tagName==="STRONG"||d.tagName==="B"||d.closest&&d.closest("strong, b"))&&(m=!0),!m&&d.style&&parseInt(d.style.fontWeight)>=600&&(m=!0),!m))try{const p=window.getComputedStyle(d);parseInt(p.fontWeight)>=600&&(m=!0)}catch{}te.value[a]=m}else{const u=document.queryCommandState(a);te.value[a]=u}}}catch{}})},An=()=>{if(!N.richText||N.disabled||!v.value){at.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){at.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,s=a.nodeType===3?a.parentElement:a;if(!s||!v.value.contains(s)){at.value="p";return}const i=s.closest("h1, h2, h3, h4, h5, h6, p");if(!i){at.value="p";return}const u=i.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(u)?at.value=u:at.value="p"}catch{at.value="p"}},Dn=()=>{if(!v.value){Ct.value=!1;return}try{const o=window.getSelection();let n=!1;if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");n=!!(i&&v.value.contains(i))}Ct.value=n}catch{Ct.value=!1}},Jn=o=>{if(!o||!v.value)return!1;const n=o.commonAncestorContainer;if(!n)return!1;const a=n.nodeType===3?n.parentElement:n;return a?v.value.contains(a):!1},vl=()=>{Te.value=!1},Ie=()=>{if(!N.floatingToolbar||!N.richText||N.disabled){Te.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){Te.value=!1;return}const n=o.getRangeAt(0);if(n.collapsed||!Jn(n)){Te.value=!1;return}const a=n.getBoundingClientRect();if(!a||a.width===0&&a.height===0){Te.value=!1;return}const s=v.value;if(!s){Te.value=!1;return}const i=s.getBoundingClientRect();if(!i||i.width===0){Te.value=!1;return}const u=40,d=8,m=a.top-u/2+15;let p=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let x=0;Rt.value&&(x=Rt.value.getBoundingClientRect().width);const E=(x||320)/2;let w=i.left+E,F=i.right-E;if(F<w){const A=i.left+i.width/2;w=A,F=A}if(h>0){const A=E+d,W=h-E-d;if(w=Math.max(w,A),F=Math.min(F,W),F<w){const K=h/2;w=K,F=K}}p<w?p=w:p>F&&(p=F),jn.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${p}px`,transform:"translate(-50%, -100%)",zIndex:10003},Te.value=!0},qn=o=>{N.disabled||!N.richText||(Qt.value=Qt.value===o?null:o,o==="askAi"&&(Ce.value=null))},Rn=()=>{Qt.value=null,It.value=null},Ze=o=>{Tn(o),Rn()};let el=null,Ge=null,mt=null,rl=null;const ko=o=>{if(N.disabled||!N.richText){fl(),nt();return}const n=o.target,a=n.closest("a"),s=n.closest("img");if(el&&(clearTimeout(el),el=null),mt&&(clearTimeout(mt),mt=null),a&&a!==Ge){nt(),Ge=a;let i=a.getAttribute("href")||"";(!i||i==="#"||i==="")&&(i=a.textContent||""),Oe.value=a,re.value=i,I.value=!0,Zt.value=!0,Rl(a)}else!a&&Ge?(Ge=null,el=setTimeout(()=>{Zt.value||fl()},150)):a&&a===Ge&&Rl(a);if(s&&s!==rl){fl(),rl=s;let i=s.getAttribute("alt");i===null&&(i=s.alt||"");let u=s.getAttribute("data-alt");u===null&&(u=i),s.hasAttribute("alt")||s.setAttribute("alt",i),s.hasAttribute("data-alt")||s.setAttribute("data-alt",u),Ne.value=s,ln.value=i.trim()||R("textEditor.image.noAlt"),Lt.value=!0,Ue.value=!0,Vl(s)}else!s&&rl?(rl=null,mt=setTimeout(()=>{Ue.value||nt()},150)):s&&s===rl&&Vl(s)},Dl=o=>{const n=o.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(Ge=null,rl=null,el&&(clearTimeout(el),el=null),mt&&(clearTimeout(mt),mt=null),fl(),nt())},fl=()=>{Zt.value=!1,setTimeout(()=>{Zt.value||(I.value=!1,re.value="",Gt.value||(Oe.value=null))},100)},Rl=o=>{if(!o||!v.value)return;const n=o.getBoundingClientRect(),i=n.top-32-8,u=n.left+n.width/2;be.value={position:"fixed",top:`${i}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},nt=()=>{Ue.value=!1,setTimeout(()=>{Ue.value||(Lt.value=!1,ln.value="",cn.value||(Ne.value=null))},100)},Vl=o=>{if(!o||!v.value)return;const n=o.getBoundingClientRect(),i=n.top-32-8,u=n.left+n.width/2;nl.value={position:"fixed",top:`${i}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},io=()=>{if(!re.value||!Oe.value)return;let n=Oe.value.getAttribute("href")||re.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Il=()=>{if(Oe.value){const o=Oe.value.textContent||"",n=Oe.value.getAttribute("href")||"",a=Oe.value;O.value=n,ft.value=o,ie.value=o,Zt.value=!1,I.value=!1,re.value="",Oe.value=a,Gt.value=!0}else if(_e.value){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,s=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(s){const i=s.textContent||"",u=s.getAttribute("href")||"";O.value=u,ft.value=i,ie.value=i,Oe.value=s,Gt.value=!0}}}else{lt.value=wt();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),O.value="",ft.value=n,ie.value="",Oe.value=null,Gt.value=!0}e.nextTick(()=>{Wt.value&&(Wt.value.focus(),Wt.value.select())})},gl=()=>{Gt.value=!1,O.value="",ft.value="",ie.value="",Oe.value=null,lt.value=null},Nl=()=>{if(!O.value.trim()){gl();return}if(Ee.value?(ue.value&&(clearTimeout(ue.value),ue.value=null),C(),Ee.value=!1):C(),ft.value.trim()||(ft.value=O.value.trim()),Oe.value&&v.value&&v.value.contains(Oe.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const n=Oe.value;if(n.setAttribute("href",O.value.trim()),ft.value.trim()!==ie.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=ft.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(n),a.collapse(!1),o.removeAllRanges(),o.addRange(a),y()}else if(v.value){v.value.focus();const o=window.getSelection();o.removeAllRanges(),lt.value&&an(lt.value);let n=null;if(o.rangeCount>0&&(n=o.getRangeAt(0)),n&&!n.collapsed){n.toString();const a=document.createElement("a");a.href=O.value.trim(),a.textContent=ft.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",n.deleteContents(),n.insertNode(a);const s=document.createTextNode(" ");n.setStartAfter(a),n.insertNode(s),n.setStartAfter(s),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(v.value),n.collapse(!1));const a=n.startContainer,s=a.nodeType===3,i=s&&n.startOffset===a.textContent.length,u=document.createElement("a");if(u.href=O.value.trim(),u.textContent=ft.value.trim(),u.style.color="#60afdf",u.style.textDecoration="underline",i){let d=a.parentElement;for(;d&&d!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(d.tagName);)d=d.parentElement;if(d&&d!==v.value){let m=d.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(u);const p=document.createTextNode(" ");m.appendChild(p);const h=document.createRange();h.setStartAfter(u),h.collapse(!0),o.removeAllRanges(),o.addRange(h)}else{if(n.startOffset>0){const h=a.textContent.substring(0,n.startOffset),x=h[h.length-1];if(x&&x!==" "&&x!==" "&&x!==`
79
+ `){const E=document.createTextNode(" ");n.insertNode(E),n.setStartAfter(E)}}n.insertNode(u);const p=document.createTextNode(" ");n.setStartAfter(u),n.insertNode(p),n.setStartAfter(p),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}}}else{if(s&&n.startOffset>0){const m=a.textContent.substring(0,n.startOffset),p=m[m.length-1];if(p&&p!==" "&&p!==" "&&p!==`
80
+ `){const h=document.createTextNode(" ");n.insertNode(h),n.setStartAfter(h)}}n.insertNode(u);const d=document.createTextNode(" ");n.setStartAfter(u),n.insertNode(d),n.setStartAfter(d),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}}y()}e.nextTick(()=>{Vt(),gl()})},Fl=()=>{if(!v.value||xe.value)return;const o=window.getSelection();let n=null;o&&o.rangeCount>0&&(n=wt());const a=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,s=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const p=m.parentElement;return!p||p.closest("a")||p.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),i=[];let u;for(;u=s.nextNode();)i.push(u);let d=!1;for(let m=i.length-1;m>=0;m--){const p=i[m],h=p.textContent;a.lastIndex=0;const x=[...h.matchAll(a)];if(x.length===0)continue;const E=x.filter(A=>{const W=A[0],K=A.index;if(K>0&&h[K-1]==="@"||K+W.length<h.length&&h[K+W.length]==="@")return!1;const fe=p.parentElement;return!(fe&&fe.closest("a"))});if(E.length===0)continue;if(E.length===1&&E[0][0]===h.trim()){const A=E[0][0],W=A.startsWith("http://")||A.startsWith("https://")?A:`https://${A}`,K=document.createElement("a");K.href=W,K.textContent=A,K.style.color="#60afdf",K.style.textDecoration="underline",p.parentNode&&(p.parentNode.replaceChild(K,p),d=!0);continue}let w=0;const F=document.createDocumentFragment();if(E.forEach(A=>{const W=A.index,K=A[0];if(W>w){const $t=h.substring(w,W);$t&&F.appendChild(document.createTextNode($t))}const fe=K.startsWith("http://")||K.startsWith("https://")?K:`https://${K}`,Ht=document.createElement("a");Ht.href=fe,Ht.textContent=K,Ht.style.color="#60afdf",Ht.style.textDecoration="underline",F.appendChild(Ht),w=W+K.length}),w<h.length){const A=h.substring(w);A&&F.appendChild(document.createTextNode(A))}p.parentNode&&F.childNodes.length>0&&(p.parentNode.replaceChild(F,p),d=!0)}d&&n&&e.nextTick(()=>{an(n),Vt()})},Co=()=>{if(!v.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:i=>{const u=i.parentElement;return!u||u.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let s;for(;s=n.nextNode();)a.push(s);for(let i=a.length-1;i>=0;i--){const u=a[i],d=u.textContent,m=[...d.matchAll(o)];if(m.length===0)continue;let p=0;const h=document.createDocumentFragment();m.forEach(x=>{const E=x.index,w=x[0].startsWith("<u>")?"u":"ins",F=x[1]||x[2]||"";E>p&&h.appendChild(document.createTextNode(d.substring(p,E)));const A=document.createElement(w);A.textContent=F,h.appendChild(A),p=E+x[0].length}),p<d.length&&h.appendChild(document.createTextNode(d.substring(p))),u.parentNode&&h.childNodes.length>0&&u.parentNode.replaceChild(h,u)}},co=o=>{if(!v.value||xe.value)return;if(!o){Co();return}if(!["*","_",">"].includes(o))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const s=a.getRangeAt(0);if(!s.collapsed)return;const i=s.startContainer.nodeType===Node.TEXT_NODE?s.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):s.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!i||i===v.value||!v.value.contains(i))return;const u=()=>{let $t="",Et=0,Mt=!1;const Bt=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:Sn=>Sn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(i,NodeFilter.SHOW_TEXT,null);let pt=0;for(;Bt.nextNode();){const Sn=Bt.currentNode,Un=Sn.textContent||"",Xn=pt;if(pt+=Un.length,Sn===s.startContainer){$t+=Un.substring(0,s.startOffset),Et=Xn+s.startOffset,Mt=!0;break}$t+=Un}return Mt||(Et=$t.length),{textBeforeCursor:$t,cursorCharOffset:Et}},{textBeforeCursor:d}=u();if(!d.length)return;let m=null,p=null;if(d.endsWith("**")&&(m=d.match(/\*\*(.+?)\*\*$/s))||d.endsWith("__")&&(m=d.match(/__(.+?)__$/s))?p="strong":d.endsWith("*")&&!d.endsWith("**")&&(m=d.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||d.endsWith("_")&&!d.endsWith("__")&&(m=d.match(new RegExp("(?<!_)_([^_]+)_$")))?p="em":o===">"&&((m=d.match(/<u>(.+?)<\/u>$/s))||(m=d.match(/<ins>(.+?)<\/ins>$/s)))&&(p=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],x=m[1],E=d.length-h.length,F=($t=>{let Et=0;const Mt=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:pt=>pt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Bt;for(;Bt=Mt.nextNode();){const pt=(Bt.textContent||"").length;if(Et+pt>=$t)return{node:Bt,offset:$t-Et};Et+=pt}return null})(E);if(!F)return;const A=document.createRange();A.setStart(F.node,F.offset),A.setEnd(s.endContainer,s.endOffset);const W=document.createElement(p);W.textContent=x,A.deleteContents(),A.insertNode(W);const K=window.getSelection(),fe=document.createRange();fe.setStartAfter(W),fe.collapse(!0),K.removeAllRanges(),K.addRange(fe);const Ht=wt();e.nextTick(()=>{y(),Ht&&an(Ht)})},il=()=>{v.value&&(fn.value=wt(),Jt.value="",We.value="",rt.value="",qe.value="",He.value="",vn.value=null,Ne.value=null,Xe.value="upload",cn.value=!0,jt(),e.nextTick(()=>{ze.value&&ze.value.focus(),en.value&&(en.value.value="")}))},Sl=o=>{const n=o.target?.files?.[0];if(!n){vn.value=null,We.value="";return}vn.value=n;const a=new FileReader;a.onload=s=>{We.value=s.target?.result||""},a.readAsDataURL(n)},uo=()=>{en.value&&en.value.click()},hl=()=>{qe.value&&(He.value="")},mo=()=>{He.value&&(qe.value="")},bo=()=>{let o=Ne.value;if(!o){const n=window.getSelection();if(n&&n.rangeCount>0){const s=n.getRangeAt(0).commonAncestorContainer;o=s.nodeType===1?s.closest("img"):s.parentElement?.closest("img")}}if(o){const n=o.getAttribute("data-alt")||o.getAttribute("alt")||"";Ne.value=o,Jt.value=n.trim()===""||n.trim()==="Image"?"":n;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(rt.value=a,We.value="",Xe.value="url"):(We.value=a,rt.value="",Xe.value="upload");const i=o.style.width||o.getAttribute("width")||"",u=o.style.height||o.getAttribute("height")||"";qe.value=i.endsWith("px")?i.replace("px",""):i,He.value=u.endsWith("px")?u.replace("px",""):u,fn.value=null}else{il();return}cn.value=!0,Ue.value=!1,Lt.value=!1,e.nextTick(()=>{Xe.value==="url"&&bn.value?(bn.value.focus(),bn.value.select()):ze.value&&(ze.value.focus(),ze.value.select()),en.value&&(en.value.value="")})},yl=()=>{cn.value=!1,Jt.value="",We.value="",rt.value="",qe.value="",He.value="",vn.value=null,Ne.value=null,fn.value=null,Xe.value="upload"},In=()=>{const o=(Jt.value||"").trim(),n=v.value?._mutationObserver;n&&n.disconnect(),Ee.value?(ue.value&&(clearTimeout(ue.value),ue.value=null),C(),Ee.value=!1):C();const a=Xe.value==="url"?rt.value.trim():We.value;if(Ne.value&&v.value&&v.value.contains(Ne.value)){a&&(Ne.value.src=a),Ne.value.setAttribute("alt",o),Ne.value.setAttribute("data-alt",o),qe.value?(Ne.value.style.width=`${qe.value}px`,Ne.value.setAttribute("width",qe.value)):(Ne.value.style.removeProperty("width"),Ne.value.removeAttribute("width")),He.value?(Ne.value.style.height=`${He.value}px`,Ne.value.setAttribute("height",He.value)):(Ne.value.style.removeProperty("height"),Ne.value.removeAttribute("height"));const s=window.getSelection();if(s){s.removeAllRanges();const i=document.createRange();i.setStartAfter(Ne.value),i.collapse(!0),s.addRange(i)}y()}else{if(!a){n&&v.value&&n.observe(v.value,{childList:!0,subtree:!0}),yl();return}if(v.value){v.value.focus();const s=window.getSelection();s&&s.rangeCount>0&&s.removeAllRanges();const i=window.getSelection();let u=null;if(fn.value&&(an(fn.value),i&&i.rangeCount>0&&(u=i.getRangeAt(0))),!u&&i&&i.rangeCount>0&&(u=i.getRangeAt(0)),!u&&v.value){if(u=document.createRange(),v.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",v.value.appendChild(h),u.setStart(h,0),u.collapse(!0)}else u.selectNodeContents(v.value),u.collapse(!1);i&&(i.removeAllRanges(),i.addRange(u))}if(!u){yl();return}const d=u.commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(!v.value.contains(m)){if(u=document.createRange(),v.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",v.value.appendChild(h),u.setStart(h,0),u.collapse(!0)}else u.selectNodeContents(v.value),u.collapse(!1);i&&(i.removeAllRanges(),i.addRange(u))}const p=document.createElement("img");p.src=a,p.setAttribute("alt",o),p.setAttribute("data-alt",o),qe.value&&(p.style.width=`${qe.value}px`,p.setAttribute("width",qe.value)),He.value&&(p.style.height=`${He.value}px`,p.setAttribute("height",He.value));try{u.insertNode(p),u.setStartAfter(p),u.collapse(!0),i&&(i.removeAllRanges(),i.addRange(u))}catch{if(v.value){if(v.value.childNodes.length===0){const E=document.createElement("p");v.value.appendChild(E),E.appendChild(p)}else{const E=v.value.lastChild;if(E&&E.nodeType===1)E.appendChild(p);else{const w=document.createElement("p");v.value.appendChild(w),w.appendChild(p)}}const x=document.createRange();x.setStartAfter(p),x.collapse(!0),i&&(i.removeAllRanges(),i.addRange(x))}}Ne.value=p,y()}}e.nextTick(()=>{n&&v.value&&n.observe(v.value,{childList:!0,subtree:!0}),Vt(),Ie(),yl()})};e.watch(()=>N.modelValue,o=>{if(N.richText&&v.value&&!xe.value){const n=Yt(o||""),s=v.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),i=n.replace(/&nbsp;|\u00A0/g," ");if(s!==i){const u=wt();v.value.innerHTML=n,e.nextTick(()=>{H();const d=v.value.innerHTML||"",m=N.title||"",p=N.description||"";qt.value=d,Ft.value=m,Je.value=p,je.value=d,et.value=m,Ke.value=p,Ye.value=[],ot.value=[],ue.value&&(clearTimeout(ue.value),ue.value=null),Ee.value=!1,u&&an(u),dn(),Y(),Pt(),Vt(),Ie(),An(),Cn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>N.richText,o=>{o?(Ie(),e.nextTick(()=>{fo()})):(vl(),on.value=[],ct.value&&(ct.value.disconnect(),ct.value=null)),An()}),e.watch(()=>N.floatingToolbar,o=>{o?Ie():vl()}),e.watch(()=>N.disabled,o=>{o&&vl(),An()}),e.watch(()=>N.description,()=>{e.nextTick(()=>{ht.value?ut():Bn()})}),e.watch(()=>N.title,()=>{e.nextTick(()=>{Ut.value?ve():Me()})}),e.watch(()=>N.customToolbarSlots,()=>{e.nextTick(()=>{Wn()})},{deep:!0}),e.watch(()=>N.comments,(o,n)=>{if(B.value){B.value=!1;return}St.value||N.richText&&v.value&&e.nextTick(()=>{zl()})},{deep:!0,immediate:!1});const zl=()=>{if(!St.value&&!(!N.comments||!Array.isArray(N.comments)||N.comments.length===0)&&!(!N.richText||!v.value)){St.value=!0;try{const o=new Set,n=N.comments.filter(d=>{const m=String(d.conversation_id||d.id);return o.has(m)?!1:(o.add(m),!0)}),a=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),s=a.length;a.forEach(d=>{const m=d.parentNode;if(m){for(;d.firstChild;)m.insertBefore(d.firstChild,d);m.removeChild(d)}});let i=0;const u=new Set;n.forEach(d=>{if(!d.conversation_id||!d.selection_range)return;const m=typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)||d.conversation_id;if(!m)return;const p=String(m);if(u.has(p))return;const h=v.value.querySelector(`[data-comment="${p}"]`);if(h){Ml(h,d),u.add(p);return}try{const x=vo(d.selection_range,d.selection_text);if(x&&!x.collapsed){const E=x.commonAncestorContainer,w=E.nodeType===3?E.parentElement:E;if(w){const W=w.closest("[data-comment], [data-fake-comment]");if(W){const K=W.getAttribute("data-comment")||W.getAttribute("data-fake-comment");if(String(K)===String(m)){W.setAttribute("data-comment",p),W.removeAttribute("data-fake-comment"),Ml(W,d),u.add(p);return}else return}}const F=v.value.querySelector(`[data-comment="${p}"]`);if(F){Ml(F,d),u.add(p);return}const A=document.createElement("span");A.setAttribute("data-comment",p),Ml(A,d);try{x.surroundContents(A),i++,u.add(p)}catch{try{const K=document.createRange();K.setStart(x.startContainer,x.startOffset),K.setEnd(x.endContainer,x.endOffset),Pl(K),K.surroundContents(A),i++,u.add(p)}catch{try{const fe=x.extractContents();A.appendChild(fe),x.insertNode(A),i++,u.add(p)}catch(fe){console.warn("Failed to create comment marker:",fe)}}}}}catch{}}),e.nextTick(()=>{Cn("restoreCommentsFromModel"),y(),St.value=!1})}catch{St.value=!1}}},Pl=o=>{if(!o||!v.value)return o;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=o.startContainer,s=o.startOffset;if(a.nodeType===3){const d=a.parentElement;d&&n.includes(d.tagName)&&(s===0&&!po(a)||o.setStartBefore(d))}else a.nodeType===1&&n.includes(a.tagName)&&s>0&&o.setStartBefore(a);let i=o.endContainer,u=o.endOffset;if(i.nodeType===3){const d=i.parentElement;d&&n.includes(d.tagName)&&(u===i.length&&!wo(i)||o.setEndAfter(d))}else i.nodeType===1&&n.includes(i.tagName)&&u<i.childNodes.length&&o.setEndAfter(i);return o}catch{return o}},po=o=>{let n=o.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},wo=o=>{let n=o.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},vo=(o,n)=>{if(!o||!v.value)return null;try{const a=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let s=0;const i=[v.value];let u=null,d=!1,m=!1;for(;!m&&(u=i.pop());)if(u.nodeType===3){const p=s+u.length;!d&&o.start>=s&&o.start<=p&&(a.setStart(u,o.start-s),d=!0),d&&o.end>=s&&o.end<=p&&(a.setEnd(u,o.end-s),m=!0),s=p}else{let p=u.childNodes.length;for(;p--;)i.push(u.childNodes[p])}return d?Pl(a):null}}catch{return null}return null},Ml=(o,n)=>{if(!o||!n)return;const a=n.conversation||[],s=new Set,i=[],u=m=>{m&&m.id&&!s.has(m.id)&&(s.add(m.id),i.push(m))};a.length>0&&a.forEach(m=>{m.user&&u(m.user)}),i.length>0?o.setAttribute("data-comment-user",JSON.stringify(i[0])):o.removeAttribute("data-comment-user"),i.length>1?o.setAttribute("data-comment-user-2",JSON.stringify(i[1])):o.removeAttribute("data-comment-user-2");const d=a.length;d>0?o.setAttribute("data-comment-count",String(d)):o.removeAttribute("data-comment-count")},Cn=(o="unknown")=>{if(!N.richText||!v.value){on.value=[];return}Date.now()-_.value<X&&bt.value!==null||bt.value===null&&(bt.value=requestAnimationFrame(()=>{if(bt.value=null,_.value=Date.now(),D.value)return;D.value=!0;const a={},s=v.value;if(!s){D.value=!1;return}const i=s.closest(".editor-with-comments");if(!i){D.value=!1;return}const u=s.querySelectorAll("[data-comment], [data-fake-comment]"),d=[],m=new Set;u.forEach(w=>{const F=w.getAttribute("data-comment")||w.getAttribute("data-fake-comment");F&&w.tagName==="SPAN"&&(m.has(F)||(d.push(w),m.add(F)))}),u.forEach(w=>{const F=w.getAttribute("data-comment")||w.getAttribute("data-fake-comment");!F||m.has(F)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(w.tagName)?w.querySelector(`span[data-comment="${F}"], span[data-fake-comment="${F}"]`)||(d.push(w),m.add(F)):w.tagName!=="SPAN"&&(d.push(w),m.add(F)))});const p=i.getBoundingClientRect(),h=s.getBoundingClientRect();d.forEach((w,F)=>{let A=w.getAttribute("data-comment")||w.getAttribute("data-fake-comment");if(!A)return;if(typeof A=="string"&&A.startsWith("comment-")){const f=w.textContent?.trim(),b=N.comments?.find(k=>(typeof k.conversation_id=="string"&&k.conversation_id.startsWith("comment-")?null:k.conversation_id)&&k.selection_text?.trim()===f);b?(A=String(b.conversation_id),w.setAttribute("data-comment",A),w.removeAttribute("data-fake-comment")):(A=String(Date.now()),w.setAttribute("data-comment",A),w.removeAttribute("data-fake-comment"))}const W=w.getBoundingClientRect(),K=window.getComputedStyle(w),fe=parseFloat(K.lineHeight)||parseFloat(K.fontSize)*1.2,Et=W.top-h.top+fe/2-15,Bt=h.top-p.top+Et;let pt=null,Sn=null,Un=0;const Xn=[],Ol=new Set;if(A&&N.comments){const f=N.comments.find(b=>String(b.conversation_id||b.id)===String(A));if(f){const b=f.conversation||[];b.length>0?(b.forEach(k=>{k.user&&k.user.id&&!Ol.has(k.user.id)&&(Ol.add(k.user.id),Xn.push(k.user))}),Un=b.length):(Un=0,pt=null,Sn=null),Xn.length>0?pt=Xn[0]:pt=null,Xn.length>1?Sn=Xn[1]:Sn=null}}const Zl=W.top+fe/2-15,Eo=Zl+30,t=5,l=Eo>h.top+t&&Zl<h.bottom-t?1:0;on.value.find(f=>f.id===A);let c=w;if(!c&&A&&v.value){const f=String(A);c=v.value.querySelector(`[data-comment="${f}"], [data-fake-comment="${f}"]`)}const g=Xn.length;a[A]?(a[A].top=Bt,a[A].opacity=l,a[A].element=c,a[A].firstUser=pt,a[A].secondUser=Sn,a[A].totalCount=Un,a[A].uniqueUserCount=g):a[A]={id:A,top:Bt,opacity:l,element:c,firstUser:pt,secondUser:Sn,totalCount:Un,uniqueUserCount:g}});const x=Object.values(a).map(w=>{const F=Math.max(0,(w.uniqueUserCount??0)-2);if(!w.element&&w.id&&v.value){const W=String(w.id);w.element=v.value.querySelector(`[data-comment="${W}"], [data-fake-comment="${W}"]`)}return{...w,firstUser:w.firstUser||null,secondUser:w.secondUser||null,totalCount:w.totalCount,additionalCount:F}});(on.value.length!==x.length||x.some((w,F)=>{const A=on.value[F];if(!A)return!0;const W=(A.firstUser?.id||null)!==(w.firstUser?.id||null),K=(A.secondUser?.id||null)!==(w.secondUser?.id||null);return A.id!==w.id||Math.abs(A.top-w.top)>1||A.opacity!==w.opacity||A.totalCount!==w.totalCount||A.additionalCount!==w.additionalCount||W||K||A.element!==w.element}))&&(on.value=x),D.value=!1}))},kl=o=>{if(!o)return;let n=o.element;if(!n&&o.id&&v.value){const a=String(o.id);n=v.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}n&&(tl(),Hn.value=n,n.classList.add("editor-comment-highlighted"))},tl=(o=!1)=>{!o&&At.value!==null&&Hn.value&&(Hn.value.getAttribute("data-comment")||Hn.value.getAttribute("data-fake-comment"))===At.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Hn.value&&(Hn.value.classList.remove("editor-comment-highlighted"),Hn.value=null))},Bl=o=>{if(!o||!o.element)return;tl(!0);const n=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!n)return;const a=`[data-comment="${n}"], [data-fake-comment="${n}"]`;ke("comment-marker-clicked",{commentId:n,selector:a,element:o.element})},xo=()=>{tl()},fo=()=>{!N.richText||!v.value||(ct.value&&ct.value.disconnect(),ae.value!==null&&(clearTimeout(ae.value),ae.value=null),ct.value=new MutationObserver(()=>{ae.value===null&&(ae.value=setTimeout(()=>{ae.value=null,e.nextTick(()=>{Cn("MutationObserver")})},200))}),ct.value.observe(v.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Cn("setupCommentMarkersObserver-initial"))},go=(o,n)=>{if(!o||!n)return;const a=n.getBoundingClientRect();let s=a.top,i=a.right+4;o.style.top=`${s}px`,o.style.left=`${i}px`,o.offsetHeight;const u=o.getBoundingClientRect(),d=window.innerWidth,m=window.innerHeight;if(u.right>d){const p=a.left-u.width-4;o.style.left=`${p}px`}if(u.bottom>m){const p=Math.max(8,m-u.height-8);o.style.top=`${p}px`}u.top<0&&(o.style.top="8px")};return e.watch(()=>It.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const s=a.getAttribute("data-submenu-id");if(s===o&&o){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i){if(a.parentNode!==document.body){const u=a.parentNode;a.dataset.originalParentRef=u===i?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{go(a,i),a.offsetHeight,a.setAttribute("data-active","true"),a.style.visibility="visible",a.style.opacity="1"})})}else a.setAttribute("data-active","true")}else a.setAttribute("data-active","false"),a.style.display="none",a.style.top="",a.style.left="",a.style.visibility="",a.style.opacity=""})})}),e.watch(()=>[Ce.value,Qt.value],()=>{Ce.value==="askAi"||Qt.value==="askAi"?e.nextTick(()=>{Nn()}):(It.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const a=n.getAttribute("data-submenu-id");if(a){const s=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(s)if(n.dataset.originalParentRef==="inside")s.appendChild(n);else{const u=s.closest(".dss-toolbar-dropdown");u&&u.insertBefore(n,s.nextSibling)}}}})}))}),e.watch(()=>N.locale,o=>{o&&o!==De.value&&(De.value=o)},{immediate:!0}),Kt({openCommentOverlayForSelector:kt,updateCommentMarkers:Cn,restoreCommentsFromModel:zl}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",we.value]),style:e.normalizeStyle(Se.value)},[Z.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Oi,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Ve,title:e.unref(R)("textEditor.toolbar.undo")},[...n[45]||(n[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Zi),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Xt.value}]),onClick:zt,title:e.unref(R)("textEditor.toolbar.redo")},[...n[46]||(n[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Wi),n[73]||(n[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",qi,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=a=>Yl("paragraph")),title:e.unref(R)("textEditor.toolbar.paragraphFormat")},[at.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Xi,[...n[47]||(n[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):at.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Yi,[...n[48]||(n[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):at.value==="h3"?(e.openBlock(),e.createElementBlock("svg",ji,[...n[49]||(n[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):at.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Ki,[...n[50]||(n[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):at.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Gi,[...n[51]||(n[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):at.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Qi,[...n[52]||(n[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Ji,[...n[53]||(n[53]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[54]||(n[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Ui),Ce.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=a=>Tn("<h1>"))},[n[55]||(n[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=a=>Tn("<h2>"))},[n[56]||(n[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=a=>Tn("<h3>"))},[n[57]||(n[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=a=>Tn("<h4>"))},[n[58]||(n[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=a=>Tn("<h5>"))},[n[59]||(n[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=a=>Tn("<h6>"))},[n[60]||(n[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=a=>Tn("<p>"))},[n[61]||(n[61]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rn("bold")}]),onClick:n[9]||(n[9]=a=>sn("bold")),title:e.unref(R)("textEditor.toolbar.bold")},[...n[62]||(n[62]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,ec),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rn("italic")}]),onClick:n[10]||(n[10]=a=>sn("italic")),title:e.unref(R)("textEditor.toolbar.italic")},[...n[63]||(n[63]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,tc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rn("underline")}]),onClick:n[11]||(n[11]=a=>sn("underline")),title:e.unref(R)("textEditor.toolbar.underline")},[...n[64]||(n[64]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,nc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ct.value}]),onClick:ul,title:e.unref(R)("textEditor.toolbar.citation")},[...n[65]||(n[65]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,lc),n[74]||(n[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),_e.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Kl,title:e.unref(R)("textEditor.toolbar.removeLink")},[...n[67]||(n[67]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,ac)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:jl,title:e.unref(R)("textEditor.toolbar.insertLink")},[...n[66]||(n[66]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,oc)),n[75]||(n[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rn("insertUnorderedList")}]),onClick:Gl,title:e.unref(R)("textEditor.toolbar.bulletList")},[...n[68]||(n[68]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,sc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rn("insertOrderedList")}]),onClick:Ql,title:e.unref(R)("textEditor.toolbar.numberList")},[...n[69]||(n[69]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,rc),n[76]||(n[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:il,title:e.unref(R)("textEditor.toolbar.image")},[...n[70]||(n[70]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,ic),st.value?(e.openBlock(),e.createElementBlock("div",cc)):e.createCommentVNode("",!0),st.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(R)("textEditor.toolbar.comment"),onClick:mn},[...n[71]||(n[71]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,dc)):e.createCommentVNode("",!0),Z.askAi?(e.openBlock(),e.createElementBlock("div",uc)):e.createCommentVNode("",!0),Z.askAi?(e.openBlock(),e.createElementBlock("div",mc,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=a=>Yl("askAi")),title:e.unref(R)("textEditor.toolbar.askAi")},[n[72]||(n[72]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",vc,e.toDisplayString(e.unref(R)("textEditor.toolbar.askAi")),1)],8,pc),Ce.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.customToolbarSlots,(a,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[dt(a)?(e.openBlock(),e.createElementBlock("div",gc,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),dt(a)&&s<Z.customToolbarSlots.length-1&&un(s)?(e.openBlock(),e.createElementBlock("div",hc)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(Ce.value==="paragraph"||Ce.value==="askAi")&&Z.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:jt})):e.createCommentVNode("",!0),e.createVNode(Vo,{showModal:Gt.value,width:"500px",height:"55vh",onCloseModal:gl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(R)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",yc,[e.createElementVNode("div",kc,[e.createElementVNode("label",Cc,e.toDisplayString(e.unref(R)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Re,type:"text","onUpdate:modelValue":n[15]||(n[15]=a=>ft.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Nl,["enter"])},null,40,bc),[[e.vModelText,ft.value]])]),e.createElementVNode("div",wc,[e.createElementVNode("label",xc,e.toDisplayString(e.unref(R)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Wt,type:"text","onUpdate:modelValue":n[16]||(n[16]=a=>O.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Nl,["enter"])},null,40,Ec),[[e.vModelText,O.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:gl},e.toDisplayString(e.unref(R)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Nl},e.toDisplayString(e.unref(R)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Vo,{showModal:cn.value,width:"500px",height:"80vh",onCloseModal:yl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Ne.value?e.unref(R)("textEditor.image.editImage"):e.unref(R)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Vc,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Xe.value==="upload"}]),onClick:n[17]||(n[17]=a=>Xe.value="upload")},e.toDisplayString(e.unref(R)("textEditor.image.upload")),3),n[77]||(n[77]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Xe.value==="url"}]),onClick:n[18]||(n[18]=a=>Xe.value="url")},e.toDisplayString(e.unref(R)("textEditor.image.imageLink")),3)]),Xe.value==="upload"?(e.openBlock(),e.createElementBlock("div",Nc,[e.createElementVNode("div",Sc,[e.createElementVNode("div",Mc,[cl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Bc,e.toDisplayString(e.unref(R)("textEditor.image.uploadImage")),1)),cl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:uo},[e.createElementVNode("img",{src:We.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Tc),n[78]||(n[78]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:en,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Sl},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:en,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Sl},null,544))]),e.createElementVNode("div",Hc,[e.createElementVNode("label",$c,e.toDisplayString(e.unref(R)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:ze,type:"text","onUpdate:modelValue":n[19]||(n[19]=a=>Jt.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterAltText"),onKeyup:e.withKeys(In,["enter"])},null,40,Lc),[[e.vModelText,Jt.value]])]),e.createElementVNode("div",_c,[e.createElementVNode("label",Ac,e.toDisplayString(e.unref(R)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=a=>qe.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(In,["enter"]),onInput:hl},null,40,Dc),[[e.vModelText,qe.value]])]),e.createElementVNode("div",Rc,[e.createElementVNode("label",Ic,e.toDisplayString(e.unref(R)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=a=>He.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(In,["enter"]),onInput:mo},null,40,Fc),[[e.vModelText,He.value]])])])])):e.createCommentVNode("",!0),Xe.value==="url"?(e.openBlock(),e.createElementBlock("div",zc,[e.createElementVNode("div",Pc,[e.createElementVNode("div",Oc,[e.createElementVNode("label",Zc,e.toDisplayString(e.unref(R)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:bn,type:"text","onUpdate:modelValue":n[22]||(n[22]=a=>rt.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(In,["enter"])},null,40,Wc),[[e.vModelText,rt.value]])]),e.createElementVNode("div",qc,[e.createElementVNode("label",Uc,e.toDisplayString(e.unref(R)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=a=>Jt.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterAltText"),onKeyup:e.withKeys(In,["enter"])},null,40,Xc),[[e.vModelText,Jt.value]])]),e.createElementVNode("div",Yc,[e.createElementVNode("label",jc,e.toDisplayString(e.unref(R)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=a=>qe.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(In,["enter"]),onInput:hl},null,40,Kc),[[e.vModelText,qe.value]])]),e.createElementVNode("div",Gc,[e.createElementVNode("label",Qc,e.toDisplayString(e.unref(R)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=a=>He.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(In,["enter"]),onInput:mo},null,40,Jc),[[e.vModelText,He.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:yl},e.toDisplayString(e.unref(R)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:In},e.toDisplayString(e.unref(R)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":ol.value&&Ut.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.labels.title")),1),e.createElementVNode("div",ed,[Ut.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",td,[Z.title?(e.openBlock(),e.createElementBlock("span",nd,e.toDisplayString(Z.title),1)):(e.openBlock(),e.createElementBlock("span",ld,e.toDisplayString(ll.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:pe,value:Z.title,onInput:P,onFocus:gn,onBlur:me,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Ut.value}]),placeholder:ll.value,disabled:Z.disabled,rows:"1"},null,42,od)])],2),ol.value&&Ut.value?(e.openBlock(),e.createElementBlock("div",ad,[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":On.value&&ht.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.labels.description")),1),e.createElementVNode("div",sd,[ht.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",rd,[Z.description?(e.openBlock(),e.createElementBlock("span",id,e.toDisplayString(Z.description),1)):(e.openBlock(),e.createElementBlock("span",cd,e.toDisplayString(Cl.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:$e,value:Z.description,onInput:hn,onFocus:Q,onBlur:Ll,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!ht.value}]),placeholder:Cl.value,disabled:Z.disabled,rows:"1"},null,42,dd)])],2),On.value&&ht.value?(e.openBlock(),e.createElementBlock("div",ud,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":At.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:s=>kl(a),onMouseleave:xo},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(s=>Bl(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,vd)):(e.openBlock(),e.createElementBlock("span",fd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,pd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(s=>Bl(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,hd)):(e.openBlock(),e.createElementBlock("span",yd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,gd)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(s=>Bl(a),["stop"])},[e.createElementVNode("span",Cd,"+"+e.toDisplayString(a.additionalCount),1)],12,kd)):e.createCommentVNode("",!0)],46,md))),128)),Z.richText?(e.openBlock(),e.createElementBlock("div",Sd,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":Z.disabled,"dss-text-editor-fixed-height":Z.fixedHeight}]),style:e.normalizeStyle(Pe.value),onInput:y,onBlur:he,onClick:so,onMouseup:ro,onKeyup:ro,onKeydown:ml,onPaste:no,onMousemove:ko,onMouseleave:Dl},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[At.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(al.value)},[Zn.value||Nt.value.length>0?(e.openBlock(),e.createElementBlock("div",Md,[e.createElementVNode("div",Bd,[Zn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Zn.value},null,8,Td)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Hd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nt.value,(a,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",$d,[e.createElementVNode("div",Ld,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,_d)):(e.openBlock(),e.createElementBlock("span",Ad,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Dd,[e.createElementVNode("div",Rd,[e.createElementVNode("div",Id,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",Fd,e.toDisplayString(tt(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":G(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),N.commentUser&&a.user&&a.user.id===N.commentUser.id&&!G(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(i=>xt(a,s),["stop"]),title:e.unref(R)("textEditor.comment.delete")||"Delete comment"},[...n[80]||(n[80]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,zd)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Pd,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:yn,"onUpdate:modelValue":n[26]||(n[26]=a=>$n.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(R)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Ln,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(yn.value){const a=yn.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,Od),[[e.vModelText,$n.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Ln,["stop"])},[...n[81]||(n[81]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Zd,[e.createElementVNode("div",Wd,[e.createElementVNode("span",qd,e.toDisplayString(tn.value)+" "+e.toDisplayString(tn.value===1?e.unref(R)("textEditor.footer.word"):e.unref(R)("textEditor.footer.words")),1),n[82]||(n[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Ud,e.toDisplayString(zn.value)+" "+e.toDisplayString(zn.value===1?e.unref(R)("textEditor.footer.character"):e.unref(R)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",bd,[e.createElementVNode("textarea",{value:Z.modelValue,onInput:dl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":Z.fixedHeight}]),placeholder:Mn.value,rows:Z.rows,disabled:Z.disabled,style:e.normalizeStyle(ye.value)},null,46,wd),e.createElementVNode("div",xd,[e.createElementVNode("div",Ed,[e.createElementVNode("span",Vd,e.toDisplayString(tn.value)+" "+e.toDisplayString(tn.value===1?e.unref(R)("textEditor.footer.word"):e.unref(R)("textEditor.footer.words")),1),n[79]||(n[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Nd,e.toDisplayString(zn.value)+" "+e.toDisplayString(zn.value===1?e.unref(R)("textEditor.footer.character"):e.unref(R)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[I.value&&re.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(be.value),onMouseenter:n[28]||(n[28]=a=>Zt.value=!0),onMouseleave:fl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(io,["stop"]),title:re.value},e.toDisplayString(re.value),9,Xd),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Il,["stop"]),title:e.unref(R)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",jd,[...n[83]||(n[83]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Yd)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Lt.value&&ln.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(nl.value),onMouseenter:n[29]||(n[29]=a=>Ue.value=!0),onMouseleave:nt},[e.createElementVNode("div",Kd,[ln.value===e.unref(R)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Gd,[...n[84]||(n[84]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:ln.value},e.toDisplayString(ln.value),9,Qd)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(bo,["stop"]),title:e.unref(R)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",eu,[...n[85]||(n[85]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Jd)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Z.floatingToolbar&&Z.richText&&Te.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Rt,class:"dss-floating-toolbar",style:e.normalizeStyle(jn.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",tu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Ve,["stop"]),title:e.unref(R)("textEditor.toolbar.undo")},[...n[86]||(n[86]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,nu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Xt.value}]),onClick:e.withModifiers(zt,["stop"]),title:e.unref(R)("textEditor.toolbar.redo")},[...n[87]||(n[87]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,lu),n[107]||(n[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",ou,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(a=>qn("paragraph"),["stop"])),title:e.unref(R)("textEditor.toolbar.paragraphFormat")},[at.value==="h1"?(e.openBlock(),e.createElementBlock("svg",su,[...n[88]||(n[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):at.value==="h2"?(e.openBlock(),e.createElementBlock("svg",ru,[...n[89]||(n[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):at.value==="h3"?(e.openBlock(),e.createElementBlock("svg",iu,[...n[90]||(n[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):at.value==="h4"?(e.openBlock(),e.createElementBlock("svg",cu,[...n[91]||(n[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):at.value==="h5"?(e.openBlock(),e.createElementBlock("svg",du,[...n[92]||(n[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):at.value==="h6"?(e.openBlock(),e.createElementBlock("svg",uu,[...n[93]||(n[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",mu,[...n[94]||(n[94]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[95]||(n[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,au),Qt.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[38]||(n[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[31]||(n[31]=a=>Ze("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=a=>Ze("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=a=>Ze("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=a=>Ze("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=a=>Ze("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=a=>Ze("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=a=>Ze("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[108]||(n[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rn("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(a=>sn("bold"),["stop"])),title:e.unref(R)("textEditor.toolbar.bold")},[...n[96]||(n[96]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,pu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rn("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(a=>sn("italic"),["stop"])),title:e.unref(R)("textEditor.toolbar.italic")},[...n[97]||(n[97]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,vu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rn("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(a=>sn("underline"),["stop"])),title:e.unref(R)("textEditor.toolbar.underline")},[...n[98]||(n[98]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,fu),n[109]||(n[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ct.value}]),onClick:e.withModifiers(ul,["stop"]),title:e.unref(R)("textEditor.toolbar.citation")},[...n[99]||(n[99]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,gu),n[110]||(n[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),_e.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Kl,["stop"]),title:e.unref(R)("textEditor.toolbar.removeLink")},[...n[101]||(n[101]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,yu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(jl,["stop"]),title:e.unref(R)("textEditor.toolbar.insertLink")},[...n[100]||(n[100]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,hu)),n[111]||(n[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rn("insertUnorderedList")}]),onClick:e.withModifiers(Gl,["stop"]),title:e.unref(R)("textEditor.toolbar.bulletList")},[...n[102]||(n[102]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,ku),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rn("insertOrderedList")}]),onClick:e.withModifiers(Ql,["stop"]),title:e.unref(R)("textEditor.toolbar.numberList")},[...n[103]||(n[103]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Cu),n[112]||(n[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(il,["stop"]),title:e.unref(R)("textEditor.toolbar.image")},[...n[104]||(n[104]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,bu),n[113]||(n[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(R)("textEditor.toolbar.comment"),onClick:e.withModifiers(mn,["stop"])},[...n[105]||(n[105]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,wu),Z.askAi?(e.openBlock(),e.createElementBlock("div",xu)):e.createCommentVNode("",!0),Z.askAi?(e.openBlock(),e.createElementBlock("div",Eu,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(a=>qn("askAi"),["stop"])),title:e.unref(R)("textEditor.toolbar.askAi")},[n[106]||(n[106]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",Nu,e.toDisplayString(e.unref(R)("textEditor.toolbar.askAi")),1)],8,Vu),Qt.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),bl.value?(e.openBlock(),e.createElementBlock("div",Su,[Z.askAi&&bl.value?(e.openBlock(),e.createElementBlock("div",Mu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.customToolbarSlots,(a,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[dt(a)&&Pn(a)?(e.openBlock(),e.createElementBlock("div",Bu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),dt(a)&&Pn(a)&&s<Z.customToolbarSlots.length-1&&wn(s)?(e.openBlock(),e.createElementBlock("div",Tu)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Lu={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},_u=["value"],Au=["placeholder","value","disabled"],Du=["placeholder","value"],Ru={key:0,class:"dss-datepicker__double-wrap"},Iu={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},Fu=["onClick"],zu={class:"dss-datepicker__double-calendars"},Pu={class:"dss-datepicker__double-calendar"},Ou={class:"dss-datepicker__calendar-header"},Zu=["aria-label"],Wu={class:"dss-datepicker__month-year-row"},qu=["aria-label"],Uu={class:"dss-datepicker__weekdays"},Xu={class:"dss-datepicker__grid"},Yu=["disabled","onClick"],ju={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ku={class:"dss-datepicker__double-calendar"},Gu={class:"dss-datepicker__calendar-header"},Qu=["aria-label"],Ju={class:"dss-datepicker__month-year-row"},e1=["aria-label"],t1={class:"dss-datepicker__weekdays"},n1={class:"dss-datepicker__grid"},l1=["disabled","onClick"],o1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},a1={class:"dss-datepicker__calendar-header"},s1=["aria-label"],r1={class:"dss-datepicker__month-year-row"},i1=["aria-label"],c1={class:"dss-datepicker__weekdays"},d1={class:"dss-datepicker__grid"},u1=["disabled","onClick"],m1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},p1={class:"dss-datepicker__calendar-header"},v1={class:"dss-datepicker__month-year-row"},f1={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},g1={class:"dss-datepicker__months-grid"},h1=["onClick"],y1={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},k1={class:"dss-datepicker__month-year"},C1={class:"dss-datepicker__years-grid"},b1=["onClick"],Ho=15,w1={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:Z=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(Z)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(Z,{emit:Kt}){const z=Z,R=Kt,{t:De,locale:N}=Wl.useI18n(),ke=e.ref(!1),Qe=e.ref("days"),vt=e.ref(new Date().getMonth()),v=e.ref(new Date().getFullYear()),Ce=e.ref(new Date().getMonth()),_e=e.ref(new Date().getFullYear()),xe=e.ref(new Date().getMonth()),I=e.ref(new Date().getFullYear()),re=e.ref("start"),be=e.ref(null),Zt=new Date;function Gt(){const M=Zt.getMonth(),D=Zt.getFullYear(),_=M===11?0:M+1,X=M===11?D+1:D;return{left:{month:M,year:D},right:{month:_,year:X}}}const O=e.ref(null),ft=e.ref(null),Wt=e.ref(null),Re=e.ref(null),Oe=e.ref(null),lt=new Date().getFullYear(),ie=e.computed(()=>["single","singleFromAvailable"].includes(z.mode)),Ct=e.computed(()=>["range","rangeFromAvailable"].includes(z.mode)),te=e.computed(()=>{if(z.mode!=="single"&&z.mode!=="singleFromAvailable")return null;const M=z.modelValue;return M instanceof Date?M:null}),Te=e.computed(()=>{if(!Ct.value)return{start:null,end:null};const M=z.modelValue;return!M||typeof M!="object"?{start:null,end:null}:{start:M.start instanceof Date?M.start:null,end:M.end instanceof Date?M.end:null}});function jn(M){const D=(M||N.value).toLowerCase();return D==="en"||D.startsWith("en-")}function Rt(M,D=N.value){if(!M||!(M instanceof Date))return"";const _=M.getDate(),X=M.getMonth()+1,ae=M.getFullYear(),we=Se=>String(Se).padStart(2,"0");return jn(D)?`${we(X)}/${we(_)}/${ae}`:`${we(_)}/${we(X)}/${ae}`}const Qt=e.computed(()=>Rt(te.value)),cn=e.computed(()=>{const{start:M,end:D}=Te.value;if(!M&&!D)return"";const _=!D||M&&M<=D?M:D,X=!M||D&&D>=M?D:M;return Ye(_,X)?Rt(_):`${Rt(_)} - ${Rt(X)}`}),Jt=e.computed(()=>{if(z.mode!=="readonly")return"—";const M=z.modelValue;if(M instanceof Date)return Rt(M)||"—";if(M&&typeof M=="object"&&("start"in M||"end"in M)){const D=M.start instanceof Date?M.start:null,_=M.end instanceof Date?M.end:null;if(!D&&!_)return"—";const X=!_||D&&D<=_?D:_,ae=!D||_&&_>=D?_:D;return Ye(X,ae)?Rt(X):`${Rt(X)} - ${Rt(ae)}`}return"—"});e.computed(()=>{const M=new Date(v.value,vt.value,1);return new Intl.DateTimeFormat(N.value,{month:"long",year:"numeric"}).format(M)});const vn=e.computed(()=>be.value==="left"?Ce.value:be.value==="right"?xe.value:vt.value),We=e.computed(()=>be.value==="left"?_e.value:be.value==="right"?I.value:v.value),qe=e.computed(()=>{const M=new Date(v.value,vt.value,1);return new Intl.DateTimeFormat(N.value,{month:"long"}).format(M)}),He=e.computed(()=>{const M=new Date(We.value,vn.value,1);return new Intl.DateTimeFormat(N.value,{month:"long"}).format(M)}),ze=e.computed(()=>{const M=new Intl.DateTimeFormat(N.value,{month:"short"});return Array.from({length:12},(D,_)=>M.format(new Date(2024,_,1)))}),en=e.computed(()=>{const D=(be.value?We.value:v.value)-Math.floor(Ho/2);return Array.from({length:Ho},(_,X)=>D+X)}),bn=e.computed(()=>{const M=en.value;return M.length?`${M[0]} – ${M[M.length-1]}`:""}),Ne=e.computed(()=>{const M=new Intl.DateTimeFormat(N.value,{weekday:"short"}),D=new Date(2024,0,1),_=[];for(let X=0;X<7;X++){const ae=new Date(D);ae.setDate(D.getDate()+X),_.push(M.format(ae).slice(0,2))}return _});function fn(M,D){const _=new Date(M,D,1),X=new Date(M,D+1,0),ae=_.getDay(),we=X.getDate(),Se=[];for(let ye=0;ye<ae;ye++)Se.push(null);for(let ye=1;ye<=we;ye++)Se.push(new Date(M,D,ye));return Se}const Lt=e.computed(()=>fn(v.value,vt.value)),ln=e.computed(()=>fn(_e.value,Ce.value)),nl=e.computed(()=>fn(I.value,xe.value));e.computed(()=>{const M=new Date(_e.value,Ce.value,1);return new Intl.DateTimeFormat(N.value,{month:"long",year:"numeric"}).format(M)}),e.computed(()=>{const M=new Date(I.value,xe.value,1);return new Intl.DateTimeFormat(N.value,{month:"long",year:"numeric"}).format(M)});const Ue=e.computed(()=>{const M=new Date(_e.value,Ce.value,1);return new Intl.DateTimeFormat(N.value,{month:"long"}).format(M)}),Xe=e.computed(()=>{const M=new Date(I.value,xe.value,1);return new Intl.DateTimeFormat(N.value,{month:"long"}).format(M)}),rt=e.computed(()=>z.availableDates&&z.availableDates.length>0),It=e.computed(()=>rt.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),_t=e.computed(()=>{if(!Re.value)return{};const M=Re.value.getBoundingClientRect();return{position:"fixed",left:`${M.left}px`,top:`${M.bottom+4}px`,zIndex:1002}});function Ye(M,D){return!M||!D?!1:M.getFullYear()===D.getFullYear()&&M.getMonth()===D.getMonth()&&M.getDate()===D.getDate()}function ot(M){return new Date(M.getFullYear(),M.getMonth(),M.getDate()).getTime()}function ue(M){return!z.availableDates||!z.availableDates.length?!0:z.availableDates.some(D=>D instanceof Date&&Ye(D,M))}function Ee(M){const D=ot(M);return!(z.minDate instanceof Date&&D<ot(z.minDate)||z.maxDate instanceof Date&&D>ot(z.maxDate))}function qt(M){return!z.exceptDates||!z.exceptDates.length?!1:z.exceptDates.some(D=>D instanceof Date&&Ye(D,M))}function je(M){return qt(M)?!1:["singleFromAvailable","rangeFromAvailable"].includes(z.mode)?ue(M):Ee(M)}function Ft(M){const D=te.value,_=Te.value,X=ot(M),ae=Ct.value&&_.start&&_.end&&X>ot(_.start)&&X<ot(_.end),we=Ct.value&&_.start&&Ye(M,_.start),Se=Ct.value&&_.end&&Ye(M,_.end),ye=we&&Se;return{"dss-datepicker__day--selected":(ie.value&&D&&Ye(M,D)||we||Se)&&!ye,"dss-datepicker__day--range-start":we&&!ye,"dss-datepicker__day--range-end":Se&&!ye,"dss-datepicker__day--range-single":ye,"dss-datepicker__day--in-range":ae&&!we&&!Se,"dss-datepicker__day--disabled":!je(M)}}function Je(){if(!z.doubleCalendar||!Ct.value)return;const M=Te.value,{start:D,end:_}=M;if(D&&_){const we=D<=_?D:_,Se=D<=_?_:D,ye=we.getMonth(),Pe=we.getFullYear(),Xt=Se.getMonth(),Fn=Se.getFullYear(),tn=Ce.value===ye&&_e.value===Pe,zn=xe.value===Xt&&I.value===Fn;if(tn&&zn)return;ye!==Xt||Pe!==Fn?(Ce.value=ye,_e.value=Pe,xe.value=Xt,I.value=Fn):(Ce.value=ye,_e.value=Pe,ye===11?(xe.value=0,I.value=Pe+1):(xe.value=ye+1,I.value=Pe));return}const X=D||_;if(X){const we=X.getMonth(),Se=X.getFullYear(),ye=Ce.value===we&&_e.value===Se,Pe=xe.value===we&&I.value===Se;if(ye||Pe)return;Ce.value=we,_e.value=Se,we===11?(xe.value=0,I.value=Se+1):(xe.value=we+1,I.value=Se);return}const ae=Gt();Ce.value=ae.left.month,_e.value=ae.left.year,xe.value=ae.right.month,I.value=ae.right.year}function et(M="start"){if(z.mode==="readonly")return;re.value=M;const D=te.value,_=Te.value;if(ie.value&&D)vt.value=D.getMonth(),v.value=D.getFullYear();else if(Ct.value)if(z.doubleCalendar)Je();else{const X=M==="start"&&_.start?_.start:_.end||_.start;X&&(vt.value=X.getMonth(),v.value=X.getFullYear())}Re.value=ie.value?O.value?.closest(".dss-datepicker__input-wrap"):ft.value,Qe.value="days",be.value=null,ke.value=!0}function Ke(){Qe.value="days",be.value=null,ke.value=!1}function pe(M,D){be.value=M,Qe.value=D}function $e(){Qe.value="days",be.value=null}function Tt(M){const D=new Date,_=D.getFullYear(),X=D.getMonth(),ae=D.getDate();let we,Se;if(rt.value){const ye=[...z.availableDates].filter(Pe=>Pe instanceof Date).map(Pe=>new Date(Pe.getFullYear(),Pe.getMonth(),Pe.getDate()));if(ye.sort((Pe,Xt)=>Pe.getTime()-Xt.getTime()),ye.length===0)return;if(M==="all")we=ye[0],Se=ye[ye.length-1];else{const Pe=parseInt(M.replace("last",""),10);if(Pe<2||Pe>5)return;const Xt=ye.slice(-Pe);we=Xt[0],Se=Xt[Xt.length-1]}}else{const ye=new Date(_,X,ae);switch(M){case"today":we=ye,Se=ye;break;case"lastWeek":we=new Date(_,X,ae-6),Se=ye;break;case"last15Days":we=new Date(_,X,ae-14),Se=ye;break;case"last30Days":we=new Date(_,X,ae-29),Se=ye;break;case"thisMonth":we=new Date(_,X,1),Se=ye;break;case"last3Months":we=new Date(_,X-3,1),Se=new Date(_,X,0);break;case"last6Months":we=new Date(_,X-6,1),Se=new Date(_,X,0);break;case"last12Months":we=new Date(_,X-12,1),Se=new Date(_,X,0);break;case"lastYear":we=new Date(_-1,0,1),Se=new Date(_-1,11,31);break;default:return}}R("update:modelValue",{start:we,end:Se}),Je()}function Be(M){be.value==="left"?Ce.value=M:be.value==="right"?xe.value=M:vt.value=M,$e()}function gt(M){be.value==="left"?_e.value=M:be.value==="right"?I.value=M:v.value=M,$e()}function Ut(){vt.value===0?(vt.value=11,v.value--):vt.value--}function ht(){vt.value===11?(vt.value=0,v.value++):vt.value++}function it(){Ce.value===0?(Ce.value=11,_e.value--):Ce.value--}function at(){Ce.value===11?(Ce.value=0,_e.value++):Ce.value++}function st(){xe.value===0?(xe.value=11,I.value--):xe.value--}function on(){xe.value===11?(xe.value=0,I.value++):xe.value++}function ct(M){if(!je(M))return;const D=new Date(M.getFullYear(),M.getMonth(),M.getDate());if(ie.value){R("update:modelValue",D),Ke();return}const _=Te.value;if(_.start&&_.end){R("update:modelValue",{start:D,end:null}),re.value="end";return}if(re.value==="start"){let X=D,ae=_.end;X&&ae&&X>ae&&([X,ae]=[ae,X]),R("update:modelValue",{start:X||ae,end:ae||X}),re.value="end"}else{let X=_.start,ae=D;X&&ae&&ae<X&&([X,ae]=[ae,X]),R("update:modelValue",{start:X||ae,end:ae||X}),re.value="start"}}e.watch(Te,()=>{z.doubleCalendar&&Ct.value&&ke.value&&Je()},{deep:!0});let bt=null;return e.watch(ke,M=>{bt&&(document.removeEventListener("keydown",bt),bt=null),M&&(bt=D=>{D.key==="Escape"&&(Qe.value==="years"||Qe.value==="months"?$e():Ke())},document.addEventListener("keydown",bt))}),(M,D)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":Z.mode==="readonly"}])},[Z.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Lu,[D[9]||(D[9]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:Jt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,_u)])):ie.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:D[0]||(D[0]=_=>et("start"))},[D[10]||(D[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:O,type:"text",class:"dss-datepicker__input",placeholder:e.unref(De)("datepicker.selectDate"),value:Qt.value,readonly:"",disabled:Z.mode==="readonly"},null,8,Au)])):Ct.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:ft,onClick:D[1]||(D[1]=_=>et("start"))},[D[11]||(D[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:Wt,type:"text",class:"dss-datepicker__input",placeholder:e.unref(De)("datepicker.selectRange"),value:cn.value,readonly:""},null,8,Du)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ke.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Ke,["self"])},[e.createElementVNode("div",{class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":Z.doubleCalendar&&Ct.value&&Qe.value==="days","dss-datepicker__dropdown--quick-select":Z.doubleCalendar&&Ct.value&&Qe.value==="days"&&Z.quickSelect}]),style:e.normalizeStyle(_t.value)},[Qe.value==="days"&&Z.doubleCalendar&&Ct.value?(e.openBlock(),e.createElementBlock("div",Ru,[Z.quickSelect?(e.openBlock(),e.createElementBlock("nav",Iu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(It.value,_=>(e.openBlock(),e.createElementBlock("button",{key:_.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:X=>Tt(_.id)},e.toDisplayString(e.unref(De)(_.labelKey)),9,Fu))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",zu,[e.createElementVNode("div",Pu,[e.createElementVNode("div",Ou,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(De)("datepicker.prevMonth"),onClick:it}," ‹ ",8,Zu),e.createElementVNode("div",Wu,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[2]||(D[2]=_=>pe("left","months"))},e.toDisplayString(Ue.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[3]||(D[3]=_=>pe("left","years"))},e.toDisplayString(_e.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(De)("datepicker.nextMonth"),onClick:at}," › ",8,qu)]),e.createElementVNode("div",Uu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",Xu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ln.value,(_,X)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+X},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ft(_)]),disabled:!je(_),onClick:ae=>ct(_)},e.toDisplayString(_.getDate()),11,Yu)):(e.openBlock(),e.createElementBlock("span",ju))],64))),128))])]),e.createElementVNode("div",Ku,[e.createElementVNode("div",Gu,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(De)("datepicker.prevMonth"),onClick:st}," ‹ ",8,Qu),e.createElementVNode("div",Ju,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[4]||(D[4]=_=>pe("right","months"))},e.toDisplayString(Xe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[5]||(D[5]=_=>pe("right","years"))},e.toDisplayString(I.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(De)("datepicker.nextMonth"),onClick:on}," › ",8,e1)]),e.createElementVNode("div",t1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",n1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nl.value,(_,X)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+X},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ft(_)]),disabled:!je(_),onClick:ae=>ct(_)},e.toDisplayString(_.getDate()),11,l1)):(e.openBlock(),e.createElementBlock("span",o1))],64))),128))])])])])):Qe.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",a1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(De)("datepicker.prevMonth"),onClick:Ut}," ‹ ",8,s1),e.createElementVNode("div",r1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[6]||(D[6]=_=>Qe.value="months")},e.toDisplayString(qe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[7]||(D[7]=_=>Qe.value="years")},e.toDisplayString(v.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(De)("datepicker.nextMonth"),onClick:ht}," › ",8,i1)]),e.createElementVNode("div",c1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",d1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lt.value,(_,X)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:X},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ft(_)]),disabled:!je(_),onClick:ae=>ct(_)},e.toDisplayString(_.getDate()),11,u1)):(e.openBlock(),e.createElementBlock("span",m1))],64))),128))])],64)):Qe.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",p1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:$e}," ‹ "),e.createElementVNode("div",v1,[e.createElementVNode("span",f1,e.toDisplayString(He.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:D[8]||(D[8]=_=>Qe.value="years")},e.toDisplayString(We.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:$e}," › ")]),e.createElementVNode("div",g1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,(_,X)=>(e.openBlock(),e.createElementBlock("button",{key:X,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":X===vn.value}]),onClick:ae=>Be(X)},e.toDisplayString(_),11,h1))),128))])],64)):Qe.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",y1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:$e}," ‹ "),e.createElementVNode("span",k1,e.toDisplayString(bn.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:$e}," › ")]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Oe},[e.createElementVNode("div",C1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(en.value,_=>(e.openBlock(),e.createElementBlock("button",{key:_,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":_===We.value,"dss-datepicker__year-cell--current":_===e.unref(lt)}]),onClick:X=>gt(_)},e.toDisplayString(_),11,b1))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},x1={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 (optional)"},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"}},E1={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy"},V1={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"}},N1={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:x1,table:E1,datepicker:V1,textEditor:N1},S1={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 (optionnel)"},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"}},M1={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa"},B1={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"}},T1={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"}},Ul={chart:S1,table:M1,datepicker:B1,textEditor:T1},H1={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"}},$1={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj"},L1={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"}},_1={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"}},Xl={chart:H1,table:$1,datepicker:L1,textEditor:_1},No={en:ql,fr:Ul,nl:Xl};function A1(Z){if(!Z||!Z.global)return;const Kt=Z.global.availableLocales||[];Object.keys(No).forEach(z=>{Kt.includes(z)&&Z.global.mergeLocaleMessage(z,No[z])})}const So={en:{textEditor:ql.textEditor},fr:{textEditor:Ul.textEditor},nl:{textEditor:Xl.textEditor}};function D1(Z){if(!Z||!Z.global)return;const Kt=Z.global.availableLocales||[];Object.keys(So).forEach(z=>{Kt.includes(z)&&Z.global.mergeLocaleMessage(z,So[z])})}const Mo={en:{table:ql.table},fr:{table:Ul.table},nl:{table:Xl.table}};function R1(Z){if(!Z||!Z.global)return;const Kt=Z.global.availableLocales||[];Object.keys(Mo).forEach(z=>{Kt.includes(z)&&Z.global.mergeLocaleMessage(z,Mo[z])})}const Bo={en:{datepicker:ql.datepicker},fr:{datepicker:Ul.datepicker},nl:{datepicker:Xl.datepicker}};function I1(Z){if(!Z||!Z.global)return;const Kt=Z.global.availableLocales||[];Object.keys(Bo).forEach(z=>{Kt.includes(z)&&Z.global.mergeLocaleMessage(z,Bo[z])})}const F1={en:{...ql},fr:{...Ul},nl:{...Xl}};Wl.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:F1});exports.DSSChart=Er;exports.DSSChartMessages=No;exports.DSSDatepicker=w1;exports.DSSDatepickerMessages=Bo;exports.DSSModal=Vo;exports.DSSTable=Pi;exports.DSSTableMessages=Mo;exports.DSSTextEditor=$u;exports.DSSTextEditorMessages=So;exports.addDSSChartTranslations=A1;exports.addDSSDatepickerTranslations=I1;exports.addDSSTableTranslations=R1;exports.addDSSTextEditorTranslations=D1;