dsp-semactic 0.5.55 → 0.5.56

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"),Kn=require("vue-i18n"),ol=["data-chart-type"],nl={class:"dss-chart-header"},ll={class:"dss-chart-header-titles"},al={key:0,class:"dss-chart-title"},sl={key:1,class:"dss-chart-subtitle"},rl=["onClick","onMouseenter"],il={class:"dss-legend-text"},cl=["onClick","onMouseenter"],dl={class:"dss-legend-text"},ul=["title"],ml=["src"],fl=["width","height","data-smooth","data-animated"],pl={id:"chart-clip"},vl=["x","y","width","height"],gl={key:0},hl={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},yl=["x1","x2","y1","y2"],Cl={class:"dss-axes"},kl=["x1","x2","y1","y2"],xl=["x1","x2","y1","y2"],wl={class:"dss-axis-labels"},El=["x","y"],bl=["x","y"],Vl=["x","y"],Sl=["y","transform"],Nl={key:1,class:"dss-flag-markers"},Ml={"clip-path":"url(#chart-clip)"},Bl=["x1","x2","y1","y2","onMouseover"],Tl=["x1","x2","y1","y2","onMouseover"],Hl=["x1","x2","y1","y2","onMouseover"],Al=["cx","cy","onMouseover"],Ll=["cx","cy","fill","onMouseover"],$l=["x","y"],Dl={class:"dss-chart-data","clip-path":"url(#chart-clip)"},_l={key:0},Il={class:"dss-bar-chart"},Rl=["d","onMouseover"],Fl=["x","y","width","height","fill","onMouseover"],zl={class:"dss-line-chart"},Ol=["d","stroke","stroke-width"],Pl=["d","stroke","stroke-width","opacity"],Zl=["cx","cy","r","fill","onMouseover"],Ul={key:1},Wl=["d","stroke","stroke-width"],ql=["d","stroke","stroke-width"],Xl=["d","stroke","stroke-width","opacity"],Yl=["cx","cy","r","fill","onMouseover"],jl={key:2},Kl=["id"],Gl=["x","y","width","height"],Jl=["d","fill","fill-opacity","mask"],Ql=["d","stroke","stroke-width"],ea={key:3},ta=["d","fill","onMouseover"],oa=["x","y","width","height","onMouseover"],na={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},la=["x1","x2","y1","y2","stroke"],aa=["cx","cy","r","fill"],sa={key:1,class:"dss-bubble-chart"},ra={key:0,class:"dss-bubble-group"},ia=["cx","cy","r","fill","fill-opacity","stroke","stroke-width","onMouseenter","onMouseleave","onClick"],ca=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],da={key:2,class:"radial-chart"},ua=["cx","cy","r"],ma=["data-chart-type"],fa=["d","fill","fill-opacity","stroke","stroke-width","onMouseover"],pa={key:1,class:"dss-radial-labels"},va=["x1","y1","x2","y2","stroke"],ga=["x1","y1","x2","y2","stroke"],ha=["x","y","text-anchor","font-size"],ya={key:3,class:"dss-spider-chart"},Ca={key:0,class:"dss-spider-grid"},ka=["cx","cy","r"],xa={class:"dss-spider-grid-labels"},wa=["x","y"],Ea=["x","y"],ba=["x1","x2","y1","y2"],Va={class:"dss-spider-labels"},Sa=["x","y","text-anchor","dominant-baseline"],Na=["points","fill","fill-opacity","stroke","stroke-width"],Ma=["cx","cy","r","fill","onMouseover"],Ba={class:"dss-chart-logos"},Ta=["cx","cy","r","fill"],Ha=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Aa=["onClick","onMouseenter"],La=["src"],$a={class:"dss-marker-tooltip-category"},Da={key:0,class:"dss-marker-tooltip-description"},_a={key:0,class:"dss-tooltip-section"},Ia={key:0,class:"dss-tooltip-title"},Ra={class:"dss-tooltip-series-name"},Fa={class:"dss-tooltip-series-value"},za={key:1,class:"dss-tooltip-section"},Oa={class:"dss-tooltip-title"},Pa={class:"dss-tooltip-value"},Za={key:0,class:"dss-tooltip-section"},Ua={class:"dss-tooltip-section-title"},Wa={class:"dss-tooltip-group-header"},qa={class:"dss-tooltip-item-content"},Xa={class:"dss-tooltip-item-text"},Ya={key:1,class:"dss-tooltip-section"},ja={class:"dss-tooltip-section-title"},Ka={class:"dss-tooltip-item-content"},Ga={class:"dss-tooltip-item-title"},Ja={key:0,class:"dss-tooltip-item-description"},Qa={class:"dss-tooltip-section"},es={class:"dss-tooltip-title"},ts={key:0,class:"dss-bubble-tooltip-data"},os={class:"dss-tooltip-series-name"},ns={class:"dss-tooltip-series-value"},ls={key:0,class:"dss-tooltip-section"},as={class:"dss-tooltip-section-title"},ss={class:"dss-tooltip-group-header"},rs={class:"dss-tooltip-item-content"},is={class:"dss-tooltip-item-text"},cs={key:1,class:"dss-tooltip-section"},ds={class:"dss-tooltip-section-title"},us={class:"dss-tooltip-item-content"},ms={class:"dss-tooltip-item-title"},fs={key:0,class:"dss-tooltip-item-description"},ps={key:1,class:"dss-context-menu-separator"},vs={key:0,class:"dss-context-menu-separator"},gs={key:0,class:"dss-context-menu-separator"},hs=["onClick"],ys=["innerHTML"],Cs={key:0,class:"dss-context-menu-icon"},ks={class:"dss-marker-modal-header"},xs={class:"dss-marker-modal-body"},ws={class:"dss-form-group"},Es={key:0},bs={key:1},Vs=["disabled"],Ss=["value"],Ns={class:"dss-form-group"},Ms={for:"dss-marker-description"},Bs={key:0,class:"dss-form-text-display"},Ts=["placeholder"],Hs={class:"dss-form-group"},As={class:"icon-preview"},Ls=["src"],$s={class:"dss-marker-modal-footer"},Ds={class:"modal-footer-left"},_s={class:"dss-modal-footer-right"},Is=["disabled"],Rs={name:"DSSChart"},Fs=Object.assign(Rs,{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:B=>typeof B=="object"&&B!==null}},emits:["add-marker","update-marker","delete-marker"],setup(B,{emit:It}){const{t:_,locale:x}=Kn.useI18n(),ct=It,C=e.ref(null),W=e.ref(null),bt=e.computed(()=>{if(!C.value||!W.value)return 0;try{const t=C.value.getBoundingClientRect();return W.value.getBoundingClientRect().top-t.top}catch{return 0}}),V=B,p={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},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},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 He(t,n){const o=Object.assign({},t);return Re(t)&&Re(n)&&Object.keys(n).forEach(l=>{Re(n[l])?l in t?o[l]=He(t[l],n[l]):Object.assign(o,{[l]:n[l]}):Object.assign(o,{[l]:n[l]})}),o}const $e=()=>{let t=20,n=0,o=0;if(K.value&&(t+=30),G.value&&(t+=25),ve.value&&V.series.length>0){const l=V.series.filter((a,s)=>!re.value.has(s)).length;if(Ne.value==="top"||Ne.value==="bottom"){if(uo.value==="horizontal"){const s=Math.floor(D.value/100);n=Math.ceil(l/s)*25+10}else n=l*25+10;t+=n}else o=150}return{height:t,legendHeight:n,legendWidth:o}};function Re(t){return t&&typeof t=="object"&&!Array.isArray(t)}const S=e.computed(()=>He(p,V.options)),D=e.computed(()=>{const t=S.value;return t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Z=e.computed(()=>{const t=S.value;return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),P=e.computed(()=>{const t=S.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Qe=e.computed(()=>{const t=V.series.map(n=>n.type||P.value);return new Set(t).size>1}),K=e.computed(()=>{const t=S.value;return t&&t.title&&t.title.text?t.title.text:""}),G=e.computed(()=>{const t=S.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),et=e.computed(()=>{const t=S.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Co=e.computed(()=>{const t=S.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),ie=e.computed(()=>{const t=S.value;if(!t||!t.yAxis)return kt;const n=t.yAxis.min;return typeof n=="number"||n===kt?n:kt}),Vt=e.computed(()=>{const t=S.value;if(!t||!t.yAxis)return kt;const n=t.yAxis.max;return typeof n=="number"||n===kt?n:kt}),Rt=e.computed(()=>{const t=S.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),oo=e.computed(()=>{const t=S.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),z=e.computed(()=>{const t=S.value;return t&&t.grid&&t.grid.show!==!1}),ve=e.computed(()=>{const t=S.value;return t&&t.legend&&t.legend.show!==!1}),Ne=e.computed(()=>{const t=S.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),uo=e.computed(()=>{const t=S.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Me=e.computed(()=>{const t=S.value;if(!t||!t.crosshair)return!1;const n=t.crosshair.show;return n===!0||n==="true"}),mo=e.computed(()=>{const t=S.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Fe=e.computed(()=>{const t=S.value;return t&&t.zoom&&t.zoom.enabled!==!1}),ko=e.computed(()=>{const t=S.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),tt=e.computed(()=>{const t=S.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),le=e.computed(()=>{const t=S.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),se=e.computed(()=>{const t=S.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),St=e.computed(()=>{const{maxX:t}=ue.value;return t===0}),qe=(t,n)=>St.value&&n===0?5:n,fo=e.computed(()=>{const t=S.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),q=e.computed(()=>{const t=S.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Nt=e.computed(()=>{const t=S.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),po=e.computed(()=>{const t=S.value;return q.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),no=e.computed(()=>{const t=S.value,n=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return n.length>0?n:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Ft=e.computed(()=>{const t=S.value;return t&&t.animations&&t.animations.enabled!==!1}),zt=e.computed(()=>{const t=S.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),De=e.computed(()=>{const t=S.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Mt=e.computed(()=>{const t=S.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),ze=e.computed(()=>{const t=S.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),he=e.computed(()=>{const t=S.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),ot=e.computed(()=>{const t=S.value;return t&&t.animations&&t.animations.onDataChange!==!1}),lo=e.computed(()=>{const t=S.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),I=e.computed(()=>{const t=S.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),ne=e.computed(()=>S.value?.spider?.gridSteps||5),Oe=e.computed(()=>{const t=[],n=ne.value;for(let o=1;o<=n;o++)t.push(U.value/n*o);return t}),Bt=t=>{const n=nt.value;if(n&&Array.isArray(n)&&n[t]!==void 0)return n[t].toString();const o=Oe.value[t];return Math.round(o/U.value*100)+"%"},nt=e.computed(()=>S.value?.spider?.gridLabels||null);e.computed(()=>{const t=S.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0});const de=e.computed(()=>{const t=S.value,n={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...n,...t.contextMenu.items}:n}),Pe=e.computed(()=>{const t=S.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Xe=e.computed(()=>{const t=S.value;return t&&t.markers&&t.markers.icon?t.markers.icon:vo.value}),j=e.computed(()=>{const t=S.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),J=e.computed(()=>{const t=S.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),dt=e.computed(()=>!E.value.isZooming);e.computed(()=>Ce.value.map(t=>{if(t.categoryIndex!==void 0&&(Se.value||we.value)){const n=me(t.categoryIndex),o=bt.value+h.value.bottom-J.value/2;return{...t,x:n,y:o}}return t}));function Do(t,n){const o=new Date(t);let l=0,a=1/0;return n.forEach((s,r)=>{const[i,c,d]=s.split("-"),u=new Date(`20${d}`,c-1,i),m=Math.abs(u-o);m<a&&(a=m,l=r)}),l}const ut=e.computed(()=>{const t=V.markers.map(o=>{const l=Do(o.marker_date,V.categories),a=me(l),s=bt.value+h.value.bottom-J.value/2;return{...o,x:a,y:s,categoryIndex:l,source:"props"}}),n=Ce.value.map(o=>{if(o.categoryIndex!==void 0&&(Se.value||we.value)){const l=me(o.categoryIndex),a=bt.value+h.value.bottom-J.value/2;return{...o,x:l,y:a,source:"internal"}}return{...o,source:"internal"}});return[...t,...n]}),Ye=e.computed(()=>{const t=S.value;return t&&t.watermark&&t.watermark.enabled===!0}),lt=e.computed(()=>{const t=S.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),ye=e.computed(()=>{const t=S.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:"25%"}),mt=e.computed(()=>{const t=S.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),ft=e.computed(()=>{const t={left:h.value.left,top:h.value.top,width:h.value.width,height:h.value.height};let n,o;const l=String(ye.value);if(l.includes("%")){const a=parseFloat(l)/100;n=t.width*a,o=n*(96/499)}else{const a=parseFloat(l)||25;n=Math.min(t.width*.25,200)*(a/25),o=n*(96/499)}return{width:n,height:o,area:t}}),pt=e.computed(()=>{const{width:t,height:n}=ft.value,o=mt.value;let l,a;const s=h.value.left,r=h.value.right,i=h.value.top,c=h.value.bottom,d=h.value.width,u=h.value.height;switch(o){case"center":l=s+(d-t)/2,a=i+(u-n)/2;break;case"top-left":l=s+15,a=i+90;break;case"top-right":l=r-t-15,a=i+90;break;case"bottom-left":l=s+15,a=c-n+75;break;case"bottom-right":default:l=r-t-15,a=c-n+75;break}return{backgroundPositionX:l+"px",backgroundPositionY:a+"px",backgroundSize:`${t}px ${n}px`}}),Ot=t=>!V.flags||!V.flags.length?[]:V.flags.filter(n=>n.categoryIndex===t),at=t=>{const n=Ot(t),o=In(t),l=n.filter(r=>r.manual),a=n.filter(r=>!r.manual),s=[];return l.length>0&&s.push({type:_("chart.tooltip.manualFlags"),color:"#047395",flags:l.map(r=>({text:r.text,color:"#047395"}))}),a.length>0&&s.push({type:_("chart.tooltip.autoFlags"),color:"#0dbf89",flags:a.map(r=>({text:r.text,color:"#0dbf89"}))}),{flagGroups:s,markers:o.map(r=>({title:r.title,description:r.description,type:_("chart.tooltip.markers"),color:r.color||"#FF6B6B"}))}},vo=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"),Jn=require("vue-i18n"),ll=["data-chart-type"],al={class:"dss-chart-header"},sl={class:"dss-chart-header-titles"},rl={key:0,class:"dss-chart-title"},il={key:1,class:"dss-chart-subtitle"},cl=["onClick","onMouseenter"],dl={class:"dss-legend-text"},ul=["onClick","onMouseenter"],ml={class:"dss-legend-text"},pl=["title"],fl=["src"],vl=["width","height","data-smooth","data-animated"],gl={id:"chart-clip"},hl=["x","y","width","height"],yl={key:0},Cl={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},kl=["x1","x2","y1","y2"],xl={class:"dss-axes"},wl=["x1","x2","y1","y2"],El=["x1","x2","y1","y2"],bl={class:"dss-axis-labels"},Vl=["x","y"],Sl=["x","y"],Nl=["x","y"],Ml=["y","transform"],Bl={key:1,class:"dss-flag-markers"},Tl={"clip-path":"url(#chart-clip)"},Hl=["x1","x2","y1","y2","onMouseover"],Al=["x1","x2","y1","y2","onMouseover"],Ll=["x1","x2","y1","y2","onMouseover"],$l=["cx","cy","onMouseover"],Dl=["cx","cy","fill","onMouseover"],_l=["x","y"],Il={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Rl={key:0},Fl={class:"dss-bar-chart"},zl=["d","onMouseover"],Ol=["x","y","width","height","fill","onMouseover"],Pl={class:"dss-line-chart"},Zl=["d","stroke","stroke-width"],Ul=["d","stroke","stroke-width","opacity"],Wl=["cx","cy","r","fill","onMouseover"],ql={key:1},Xl=["d","stroke","stroke-width"],Yl=["d","stroke","stroke-width"],jl=["d","stroke","stroke-width","opacity"],Kl=["cx","cy","r","fill","onMouseover"],Gl={key:2},Jl=["id"],Ql=["x","y","width","height"],ea=["d","fill","fill-opacity","mask"],ta=["d","stroke","stroke-width"],oa={key:3},na=["d","fill","onMouseover"],la=["x","y","width","height","onMouseover"],aa={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},sa=["x1","x2","y1","y2","stroke"],ra=["cx","cy","r","fill"],ia={key:1,class:"dss-bubble-chart"},ca={key:0,class:"dss-bubble-group"},da=["cx","cy","r","fill","fill-opacity","stroke","stroke-width","onMouseenter","onMouseleave","onClick"],ua=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],ma={key:2,class:"radial-chart"},pa=["cx","cy","r"],fa=["data-chart-type"],va=["d","fill","fill-opacity","stroke","stroke-width","onMouseover"],ga={key:1,class:"dss-radial-labels"},ha=["x1","y1","x2","y2","stroke"],ya=["x1","y1","x2","y2","stroke"],Ca=["x","y","text-anchor","font-size"],ka={key:3,class:"dss-spider-chart"},xa={key:0,class:"dss-spider-grid"},wa=["cx","cy","r"],Ea={class:"dss-spider-grid-labels"},ba=["x","y"],Va=["x","y"],Sa=["x1","x2","y1","y2"],Na={class:"dss-spider-labels"},Ma=["x","y","text-anchor","dominant-baseline"],Ba=["points","fill","fill-opacity","stroke","stroke-width"],Ta=["cx","cy","r","fill","onMouseover"],Ha={class:"dss-chart-logos"},Aa=["cx","cy","r","fill"],La=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],$a=["onClick","onMouseenter"],Da=["src"],_a={class:"dss-marker-tooltip-category"},Ia={key:0,class:"dss-marker-tooltip-description"},Ra={key:0,class:"dss-tooltip-section"},Fa={key:0,class:"dss-tooltip-title"},za={class:"dss-tooltip-series-name"},Oa={class:"dss-tooltip-series-value"},Pa={key:1,class:"dss-tooltip-section"},Za={class:"dss-tooltip-title"},Ua={class:"dss-tooltip-value"},Wa={key:0,class:"dss-tooltip-section"},qa={class:"dss-tooltip-section-title"},Xa={class:"dss-tooltip-group-header"},Ya={class:"dss-tooltip-item-content"},ja={class:"dss-tooltip-item-text"},Ka={key:1,class:"dss-tooltip-section"},Ga={class:"dss-tooltip-section-title"},Ja={class:"dss-tooltip-item-content"},Qa={class:"dss-tooltip-item-title"},es={key:0,class:"dss-tooltip-item-description"},ts={class:"dss-tooltip-section"},os={class:"dss-tooltip-title"},ns={key:0,class:"dss-bubble-tooltip-data"},ls={class:"dss-tooltip-series-name"},as={class:"dss-tooltip-series-value"},ss={key:0,class:"dss-tooltip-section"},rs={class:"dss-tooltip-section-title"},is={class:"dss-tooltip-group-header"},cs={class:"dss-tooltip-item-content"},ds={class:"dss-tooltip-item-text"},us={key:1,class:"dss-tooltip-section"},ms={class:"dss-tooltip-section-title"},ps={class:"dss-tooltip-item-content"},fs={class:"dss-tooltip-item-title"},vs={key:0,class:"dss-tooltip-item-description"},gs={key:1,class:"dss-context-menu-separator"},hs={key:0,class:"dss-context-menu-separator"},ys={key:0,class:"dss-context-menu-separator"},Cs=["onClick"],ks=["innerHTML"],xs={key:0,class:"dss-context-menu-icon"},ws={class:"dss-marker-modal-header"},Es={class:"dss-marker-modal-body"},bs={class:"dss-form-group"},Vs={key:0},Ss={key:1},Ns=["disabled"],Ms=["value"],Bs={class:"dss-form-group"},Ts={for:"dss-marker-description"},Hs={key:0,class:"dss-form-text-display"},As=["placeholder"],Ls={class:"dss-form-group"},$s={class:"icon-preview"},Ds=["src"],_s={class:"dss-marker-modal-footer"},Is={class:"modal-footer-left"},Rs={class:"dss-modal-footer-right"},Fs=["disabled"],zs={name:"DSSChart"},Os=Object.assign(zs,{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:A=>typeof A=="object"&&A!==null}},emits:["add-marker","update-marker","delete-marker"],setup(A,{emit:zt}){const{t:F,locale:b}=Jn.useI18n(),dt=zt,w=e.ref(null),X=e.ref(null),kt=e.computed(()=>{if(!w.value||!X.value)return 0;try{const l=w.value.getBoundingClientRect();return X.value.getBoundingClientRect().top-l.top}catch{return 0}}),N=A,v={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},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},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 Le(l,u){const s=Object.assign({},l);return Oe(l)&&Oe(u)&&Object.keys(u).forEach(t=>{Oe(u[t])?t in l?s[t]=Le(l[t],u[t]):Object.assign(s,{[t]:u[t]}):Object.assign(s,{[t]:u[t]})}),s}const De=()=>{let l=20,u=0,s=0;if(J.value&&(l+=30),Q.value&&(l+=25),ye.value&&N.series.length>0){const t=N.series.filter((o,n)=>!re.value.has(n)).length;if(Be.value==="top"||Be.value==="bottom"){if(fo.value==="horizontal"){const n=Math.floor(D.value/100);u=Math.ceil(t/n)*25+10}else u=t*25+10;l+=u}else s=150}return{height:l,legendHeight:u,legendWidth:s}};function Oe(l){return l&&typeof l=="object"&&!Array.isArray(l)}const T=e.computed(()=>Le(v,N.options)),D=e.computed(()=>{const l=T.value;return l&&l.chart&&typeof l.chart.width=="number"?l.chart.width:800}),W=e.computed(()=>{const l=T.value;return l&&l.chart&&typeof l.chart.height=="number"?l.chart.height:400}),P=e.computed(()=>{const l=T.value;return l&&l.chart&&l.chart.type?l.chart.type:"line"}),et=e.computed(()=>{const l=N.series.map(u=>u.type||P.value);return new Set(l).size>1}),J=e.computed(()=>{const l=T.value;return l&&l.title&&l.title.text?l.title.text:""}),Q=e.computed(()=>{const l=T.value;return l&&l.subtitle&&l.subtitle.text?l.subtitle.text:""}),tt=e.computed(()=>{const l=T.value;return l&&l.xAxis&&l.xAxis.title&&l.xAxis.title.text?l.xAxis.title.text:""}),bo=e.computed(()=>{const l=T.value;return l&&l.yAxis&&l.yAxis.title&&l.yAxis.title.text?l.yAxis.title.text:""}),de=e.computed(()=>{const l=T.value;if(!l||!l.yAxis)return Lt;const u=l.yAxis.min;return typeof u=="number"||u===Lt?u:Lt}),xt=e.computed(()=>{const l=T.value;if(!l||!l.yAxis)return Lt;const u=l.yAxis.max;return typeof u=="number"||u===Lt?u:Lt}),Ot=e.computed(()=>{const l=T.value;return!l||!l.xAxis?null:typeof l.xAxis.min=="number"?l.xAxis.min:null}),Jt=e.computed(()=>{const l=T.value;return!l||!l.xAxis?null:typeof l.xAxis.max=="number"?l.xAxis.max:null}),O=e.computed(()=>{const l=T.value;return l&&l.grid&&l.grid.show!==!1}),ye=e.computed(()=>{const l=T.value;return l&&l.legend&&l.legend.show!==!1}),Be=e.computed(()=>{const l=T.value;return l&&l.legend&&l.legend.position?l.legend.position:"top"}),fo=e.computed(()=>{const l=T.value;return l&&l.legend&&l.legend.orientation?l.legend.orientation:"horizontal"}),Te=e.computed(()=>{const l=T.value;if(!l||!l.crosshair)return!1;const u=l.crosshair.show;return u===!0||u==="true"}),vo=e.computed(()=>{const l=T.value;return l&&l.crosshair&&l.crosshair.color?l.crosshair.color:"#666"}),Pe=e.computed(()=>{const l=T.value;return l&&l.zoom&&l.zoom.enabled!==!1}),Vo=e.computed(()=>{const l=T.value;return l&&l.zoom&&typeof l.zoom.minScale=="number"?l.zoom.minScale:1}),ot=e.computed(()=>{const l=T.value;return l&&l.zoom&&typeof l.zoom.maxScale=="number"?l.zoom.maxScale:2.5}),ee=e.computed(()=>{const l=T.value;return l&&l.stroke&&typeof l.stroke.width=="number"?l.stroke.width:2}),se=e.computed(()=>{const l=T.value;return l&&l.bubbles&&typeof l.bubbles.size=="number"?l.bubbles.size:4}),wt=e.computed(()=>{const{maxX:l}=ue.value;return l===0}),Xe=(l,u)=>wt.value&&u===0?5:u,go=e.computed(()=>{const l=T.value;return l&&l.fill&&l.fill.area&&typeof l.fill.area.opacity=="number"?l.fill.area.opacity:.3}),Y=e.computed(()=>{const l=T.value;return l&&l.smoothing&&l.smoothing.enabled===!0}),Et=e.computed(()=>{const l=T.value;return l&&l.smoothing&&typeof l.smoothing.factor=="number"?l.smoothing.factor:.3}),ho=e.computed(()=>{const l=T.value;return Y.value?l&&l.smoothing&&typeof l.smoothing.barRadius=="number"?l.smoothing.barRadius:4:0}),Qt=e.computed(()=>{const l=T.value,u=l&&l.colors&&Array.isArray(l.colors)?l.colors:[];return u.length>0?u:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Pt=e.computed(()=>{const l=T.value;return l&&l.animations&&l.animations.enabled!==!1}),Zt=e.computed(()=>{const l=T.value;return l&&l.animations&&l.animations.type?l.animations.type:"draw"}),_e=e.computed(()=>{const l=T.value;return l&&l.animations&&typeof l.animations.duration=="number"?l.animations.duration:2500}),bt=e.computed(()=>{const l=T.value;return l&&l.animations&&typeof l.animations.delay=="number"?l.animations.delay:0}),Ze=e.computed(()=>{const l=T.value;return l&&l.animations&&l.animations.easing?l.animations.easing:"ease-out"}),xe=e.computed(()=>{const l=T.value;return l&&l.animations&&typeof l.animations.staggerDelay=="number"?l.animations.staggerDelay:200}),nt=e.computed(()=>{const l=T.value;return l&&l.animations&&l.animations.onDataChange!==!1}),eo=e.computed(()=>{const l=T.value;return l&&l.animations&&l.animations.respectReducedMotion!==!1}),z=e.computed(()=>{const l=T.value;return l&&l.fill&&l.fill.spider&&typeof l.fill.spider.opacity=="number"?l.fill.spider.opacity:.15}),le=e.computed(()=>T.value?.spider?.gridSteps||5),Ue=e.computed(()=>{const l=[],u=le.value;for(let s=1;s<=u;s++)l.push(Z.value/u*s);return l}),Vt=l=>{const u=lt.value;if(u&&Array.isArray(u)&&u[l]!==void 0)return u[l].toString();const s=Ue.value[l];return Math.round(s/Z.value*100)+"%"},lt=e.computed(()=>T.value?.spider?.gridLabels||null);e.computed(()=>{const l=T.value;return l&&l.contextMenu&&l.contextMenu.enabled===!0});const fe=e.computed(()=>{const l=T.value,u={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return l&&l.contextMenu&&l.contextMenu.items?{...u,...l.contextMenu.items}:u}),We=e.computed(()=>{const l=T.value;return l&&l.contextMenu&&Array.isArray(l.contextMenu.customItems)?l.contextMenu.customItems:[]}),Ye=e.computed(()=>{const l=T.value;return l&&l.markers&&l.markers.icon?l.markers.icon:zo.value}),K=e.computed(()=>{const l=T.value;return l&&l.markers&&l.markers.customIcons?l.markers.customIcons:{}}),te=e.computed(()=>{const l=T.value;return l&&l.markers&&typeof l.markers.iconSize=="number"?l.markers.iconSize:20}),ut=e.computed(()=>!S.value.isZooming);e.computed(()=>ge.value.map(l=>{if(l.categoryIndex!==void 0&&(Se.value||ke.value)){const u=he(l.categoryIndex),s=kt.value+k.value.bottom-te.value/2;return{...l,x:u,y:s}}return l}));function Fo(l,u){const s=new Date(l);let t=0,o=1/0;return u.forEach((n,a)=>{const[r,c,i]=n.split("-"),d=new Date(`20${i}`,c-1,r),m=Math.abs(d-s);m<o&&(o=m,t=a)}),t}const je=e.computed(()=>{const l=N.markers.map(s=>{const t=Fo(s.marker_date,N.categories),o=he(t),n=kt.value+k.value.bottom-te.value/2;return{...s,x:o,y:n,categoryIndex:t,source:"props"}}),u=ge.value.map(s=>{if(s.categoryIndex!==void 0&&(Se.value||ke.value)){const t=he(s.categoryIndex),o=kt.value+k.value.bottom-te.value/2;return{...s,x:t,y:o,source:"internal"}}return{...s,source:"internal"}});return[...l,...u]}),Ke=e.computed(()=>{const l=T.value;return l&&l.watermark&&l.watermark.enabled===!0}),Ge=e.computed(()=>{const l=T.value;return l&&l.watermark&&typeof l.watermark.opacity=="number"?l.watermark.opacity:.05}),St=e.computed(()=>{const l=T.value;return l&&l.watermark&&l.watermark.size?l.watermark.size:"25%"}),ve=e.computed(()=>{const l=T.value;return l&&l.watermark&&l.watermark.position?l.watermark.position:"bottom-right"}),mt=e.computed(()=>{const l={left:k.value.left,top:k.value.top,width:k.value.width,height:k.value.height};let u,s;const t=String(St.value);if(t.includes("%")){const o=parseFloat(t)/100;u=l.width*o,s=u*(96/499)}else{const o=parseFloat(t)||25;u=Math.min(l.width*.25,200)*(o/25),s=u*(96/499)}return{width:u,height:s,area:l}}),Ut=e.computed(()=>{const{width:l,height:u}=mt.value,s=ve.value;let t,o;const n=k.value.left,a=k.value.right,r=k.value.top,c=k.value.bottom,i=k.value.width,d=k.value.height;switch(s){case"center":t=n+(i-l)/2,o=r+(d-u)/2;break;case"top-left":t=n+15,o=r+90;break;case"top-right":t=a-l-15,o=r+90;break;case"bottom-left":t=n+15,o=c-u+75;break;case"bottom-right":default:t=a-l-15,o=c-u+75;break}return{backgroundPositionX:t+"px",backgroundPositionY:o+"px",backgroundSize:`${l}px ${u}px`}}),pt=l=>!N.flags||!N.flags.length?[]:N.flags.filter(u=>u.categoryIndex===l),Ie=l=>{const u=pt(l),s=Ln(l),t=u.filter(a=>a.manual),o=u.filter(a=>!a.manual),n=[];return t.length>0&&n.push({type:F("chart.tooltip.manualFlags"),color:"#047395",flags:t.map(a=>({text:a.text,color:"#047395"}))}),o.length>0&&n.push({type:F("chart.tooltip.autoFlags"),color:"#0dbf89",flags:o.map(a=>({text:a.text,color:"#0dbf89"}))}),{flagGroups:n,markers:s.map(a=>({title:a.title,description:a.description,type:F("chart.tooltip.markers"),color:a.color||"#FF6B6B"}))}},zo=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>`)}`),_o=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>`)}`),to=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>`)}`),Jo=e.computed(()=>{const t=S.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),vt=e.computed(()=>{const t=S.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=S.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const Hn=e.computed(()=>{const t=S.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),An=e.computed(()=>{const t=S.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),Ln=e.computed(()=>{const t=S.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Qo=e.computed(()=>{if(!V.flags||!V.flags.length)return[];const t=new Map;return V.flags.forEach(n=>{const o=n.categoryIndex;t.has(o)||t.set(o,[]),t.get(o).push(n)}),Array.from(t.entries()).map(([n,o])=>{const l=me(n),a=o.filter(r=>r.manual),s=o.filter(r=>!r.manual);return{categoryIndex:parseInt(n),x:l,flags:o,manualCount:a.length,autoCount:s.length,totalCount:o.length,hasManual:a.length>0,hasAuto:s.length>0,texts:o.map(r=>r.text).join(`
22
- `)}})}),xo=e.ref({show:!1,x:0,y:0,content:"",count:0}),en=e.computed(()=>S.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),wo=e.computed(()=>{const t=S.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Eo=e.computed(()=>S.value?.bubbles?.tooltip?.formatters||{}),re=e.ref(new Set),H=e.ref(null),bo=e.ref(!1),ae=e.ref({show:!1,x:0,y:0,title:"",value:"",spiderSeries:[]}),Be=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),R=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),Q=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),E=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Ce=e.ref([]),$=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1});e.computed(()=>{const t=["default"];return j.value&&t.push(...Object.keys(j.value)),t});const tn=e.computed(()=>{if(!V.categories||V.categories.length===0){const{maxX:t}=ue.value;return Array.from({length:t+1},(n,o)=>_("chart.fallback.item",{number:o+1}))}return V.categories}),Pt=e.computed(()=>$.value.editingMarkerId!==null),Zt=e.computed(()=>$.value.readonly),on=t=>{re.value.has(t)||(Ao.value=!0,H.value=t)},nn=()=>{Ao.value=!1,H.value=null},ln=t=>{if(xt.value||Lo.value){R.value.show=!1;return}const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left,a=t.clientY-o.top,s=we.value?l>=h.value.left-50&&l<=h.value.right+50&&a>=h.value.top-50&&a<=h.value.bottom+100:l>=h.value.left&&l<=h.value.right&&a>=h.value.top&&a<=h.value.bottom;if(bo.value=s,we.value){if(!Me.value||!s||E.value.isDragging||E.value.isZooming){R.value.show=!1;return}if(qt.value.find(y=>!y||y.isHidden?!1:Math.sqrt(Math.pow(y.x-l,2)+Math.pow(y.y-a,2))<=y.radius+3))R.value.show=!1;else{const y=qt.value.filter(k=>!k||k.isHidden?!1:Math.sqrt(Math.pow(k.x-l,2)+Math.pow(k.y-a,2))<=250);if(y.length>0){let k=y[0],w=Math.sqrt(Math.pow(k.x-l,2)+Math.pow(k.y-a,2));y.forEach(N=>{const T=Math.sqrt(Math.pow(N.x-l,2)+Math.pow(N.y-a,2));T<w&&(w=T,k=N)});const b=30,A=qt.value.filter(N=>!N||N.isHidden?!1:Math.abs(N.x-k.x)<=b).sort((N,T)=>N.y-T.y);R.value={show:!0,x:k.x,categoryIndex:Math.round(k.originalX),data:(()=>{const N=en.value,T=wo.value,L=[];return A.forEach(M=>{N.forEach(F=>{const O=T[F]||F,pe=kn(F,M);pe&&L.push({seriesName:M.seriesName,label:M.label,value:`${O}: ${pe}`,color:M.color,y:M.y})})}),L})()}}else R.value.show=!1}return}if(E.value.isDragging&&E.value.scale>1&&Se.value&&Fe.value){R.value.show=!1;const v=t.clientX-E.value.lastMouseX,{minX:y,maxX:k}=ue.value,w=k-y||1,A=v*.8;E.value.offsetX+=A;const N=w/E.value.scale,T=w-N,L=0,M=-T/w*h.value.width,F=L;E.value.offsetX=Math.max(M,Math.min(F,E.value.offsetX)),E.value.lastMouseX=t.clientX,E.value.lastMouseY=t.clientY;return}if(!Me.value||!Se.value||E.value.isDragging||E.value.isZooming||!s){R.value.show=!1;return}const{minX:r,maxX:i}=ue.value,c=i-r||1,d=c/E.value.scale,u=r-E.value.offsetX/h.value.width*c,m=(l-h.value.left)/h.value.width,f=u+m*d,g=Math.round(f);if(g>=0&&g<=i){const v=me(g),y=Wt.value.map((k,w)=>{const b=V.series.findIndex(N=>N===k),A=k.data[g];return{seriesName:k.name,value:A!==void 0?A:null,color:ce(b),y:A!==void 0?be(A):null}}).filter(k=>k.value!==null);R.value={show:!0,x:v,categoryIndex:g,data:y}}},$n=()=>{R.value.show=!1,bo.value=!1,Lo.value=!1,xt.value||(xo.value.show=!1),E.value.isDragging&&(E.value.isDragging=!1),E.value.zoomTimeout&&(clearTimeout(E.value.zoomTimeout),E.value.zoomTimeout=null),E.value.isZooming=!1,setTimeout(()=>{H.value=null,ae.value.show=!1},150)},Tt=t=>{if(t.preventDefault(),t.stopPropagation(),xe.value)return;const n=t.currentTarget.getBoundingClientRect(),o=t.clientX-n.left,l=t.clientY-n.top,a=Math.max(0,h.value.left-20),s=h.value.right,r=h.value.top,i=h.value.bottom+80;o>=a&&o<=s&&l>=r&&l<=i&&(Q.value.show=!1,e.nextTick(()=>{Q.value.show=!0,Q.value.x=t.clientX,Q.value.y=t.clientY,Q.value.categoryIndex=null;const c=Math.max(h.value.left,Math.min(o,h.value.right))-h.value.left,u=h.value.width/Oo.value.length,m=Math.floor(c/u);m>=0&&m<Oo.value.length&&(Q.value.categoryIndex=m)}))},Ut=t=>{if(!(t&&t.button===2)){if(Q.value.show&&t&&t.type==="click"){const n=document.querySelector(".dss-context-menu");if(n&&n.contains(t.target))return}Q.value.show=!1}},Dn=t=>{if(typeof t.template=="function"){const n={series:V.series,categories:V.categories,markers:Ce.value},o={chartX:Q.value.chartX,chartY:Q.value.chartY,dataX:Q.value.mouseDataX,dataY:Q.value.mouseDataY,categoryIndex:Q.value.categoryIndex};return t.template(n,o)}return t.template||t.label||""},Io=t=>{const n=["dss-context-menu-item"];return t.cssClass&&n.push(t.cssClass),n},_n=t=>t.style||{},go=t=>t.type&&j.value[t.type]?j.value[t.type]:t.customIcon?t.customIcon:Xe.value,an=t=>t==null?"":V.categories&&V.categories[t]?V.categories[t]:"",In=t=>Ce.value.length?Ce.value.filter(n=>n.categoryIndex===t):[],Ro=t=>{if(!Se.value&&!we.value)return{x:0,y:0};const n=me(t),o=bt.value+h.value.bottom-J.value/2;return{x:n,y:o}},sn=()=>{Ce.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Se.value||we.value)){const n=Ro(t.categoryIndex);t.x=n.x,t.y=n.y}})},je=()=>{if($.value.description&&$.value.description.length){if(Pt.value){const t=Ce.value.findIndex(n=>n.id===$.value.editingMarkerId);t!==-1?(Ce.value[t].description=$.value.description||"",Ce.value[t].color=$.value.color||"",Ce.value[t].type=$.value.type||"default",ct("update-marker",Ce.value[t])):ct("update-marker",{id:$.value.editingMarkerId,description:$.value.description||"",color:$.value.color||"",type:$.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let n=Math.max(0,$.value.categoryIndex);if(we.value){const{maxX:r}=ue.value;n=Math.max(0,Math.min(n,Math.floor(r)))}else Se.value&&(n=Math.max(0,Math.min(n,ue.value.maxX)));const o=me(n),l=bt.value+h.value.bottom-J.value/2,a=Array.isArray(V.categories)?V.categories[n]:null,s={id:t,title:"",description:$.value.description||"",color:$.value.color||"",type:$.value.type||"default",categoryIndex:n,x:o,y:l,marker_date:a||null};$.value.categoryIndex=n,Ce.value.push(s),ct("add-marker",s)}Te(),So()}},Te=()=>{$.value.show=!1,$.value.title="",$.value.description="",$.value.color="#FF6B6B",$.value.type="default",$.value.editingMarkerId=null,$.value.readonly=!1,$.value.categoryIndex=null,$.value.fromButton=!1},Vo=()=>{Pt.value&&(ke($.value.editingMarkerId),Te())},ke=t=>{const n=Ce.value.findIndex(o=>o.id===t);n!==-1&&(Ce.value.splice(n,1),So()),ct("delete-marker",t)},ee=t=>{$.value.show=!0,$.value.title=t?.title??t?.comment??"",$.value.description=t?.description??t?.comment??"",$.value.color=t?.color??"",$.value.type=t?.type??"default",$.value.editingMarkerId=t?.id??t?.marker_id??null,$.value.readonly=t?.readonly??!1,$.value.categoryIndex=t?.categoryIndex??null},So=()=>{try{const t=`dss-chart-markers-${V.chartId}`;localStorage.setItem(t,JSON.stringify(Ce.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Fo=()=>{try{const t=`dss-chart-markers-${V.chartId}`,n=localStorage.getItem(t);if(n){const o=JSON.parse(n);Array.isArray(o)&&(Ce.value=o.map(l=>({...l,originalYOffset:l.originalYOffset!==void 0?l.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Ce.value=[]}},Ke=t=>{const n=K.value||"Chart",o=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${n.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${o}.${t}`},rn=()=>{const t=R.value.show,n=ae.value.show;return R.value.show=!1,ae.value.show=!1,{originalCrosshair:t,originalTooltip:n}},Ht=t=>{R.value.show=t.originalCrosshair,ae.value.show=t.originalTooltip},cn=async(t,n=32,o=32)=>new Promise((l,a)=>{if(t.startsWith("data:")){l(t);return}const s=new Image;s.crossOrigin="anonymous";const r=setTimeout(()=>{console.warn("Image conversion timeout for:",t),l(t)},5e3);s.onload=()=>{clearTimeout(r);try{const i=document.createElement("canvas"),c=i.getContext("2d");i.width=n,i.height=o,c.fillStyle="#fafafa",c.fillRect(0,0,n,o),c.drawImage(s,0,0,n,o);const d=i.toDataURL("image/png");l(d)}catch(i){console.warn("Canvas conversion failed:",i),l(t)}},s.onerror=i=>{clearTimeout(r),console.warn("Failed to load image:",t,i),l(t)},s.src=t}),No=async()=>{try{const t=rn();setTimeout(async()=>{try{const n=document.querySelector(".dss-chart-svg");if(!n){console.error("Chart SVG element not found"),Ht(t);return}const o=$e(),l=D.value,a=Z.value+o.height,s=n.cloneNode(!0);s.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(b=>b.remove());const i=s.querySelectorAll("image"),c=Array.from(i).map(async b=>{const A=b.getAttribute("xlink:href")||b.getAttribute("href");if(A&&!A.startsWith("data:"))try{const N=await cn(A,32,32);b.setAttribute("xlink:href",N),b.setAttribute("href",N)}catch(N){console.warn("Failed to convert logo to base64:",N)}});await Promise.all(c);const u=new XMLSerializer().serializeToString(s).replace(/<svg[^>]*>/,"").replace("</svg>","");let m="",f=30;if(K.value&&(m+=`
23
- <text x="24" y="${f}"
21
+ </svg>`)}`),Oo=e.computed(()=>{const l=T.value;return l&&l.radialLabels&&l.radialLabels.show===!0}),Sn=e.computed(()=>{const l=T.value;return l&&l.radialLabels&&typeof l.radialLabels.fontSize=="number"?l.radialLabels.fontSize:12});e.computed(()=>{const l=T.value;return l&&l.radialLabels&&l.radialLabels.color?l.radialLabels.color:"#000"});const ft=e.computed(()=>{const l=T.value;return l&&l.radialLabels&&typeof l.radialLabels.pointerLength=="number"?l.radialLabels.pointerLength:25}),Nn=e.computed(()=>{const l=T.value;return l&&l.radialLabels&&typeof l.radialLabels.horizontalLength=="number"?l.radialLabels.horizontalLength:40}),Mn=e.computed(()=>{const l=T.value;return l&&l.radialLabels&&typeof l.radialLabels.textOffset=="number"?l.radialLabels.textOffset:8}),Jo=e.computed(()=>{if(!N.flags||!N.flags.length)return[];const l=new Map;return N.flags.forEach(u=>{const s=u.categoryIndex;l.has(s)||l.set(s,[]),l.get(s).push(u)}),Array.from(l.entries()).map(([u,s])=>{const t=he(u),o=s.filter(a=>a.manual),n=s.filter(a=>!a.manual);return{categoryIndex:parseInt(u),x:t,flags:s,manualCount:o.length,autoCount:n.length,totalCount:s.length,hasManual:o.length>0,hasAuto:n.length>0,texts:s.map(a=>a.text).join(`
22
+ `)}})}),Po=e.ref({show:!1,x:0,y:0,content:"",count:0}),Qo=e.computed(()=>T.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),en=e.computed(()=>{const l=T.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...l?.bubbles?.tooltip?.labels||{}}}),So=e.computed(()=>T.value?.bubbles?.tooltip?.formatters||{}),re=e.ref(new Set),L=e.ref(null),No=e.ref(!1),ae=e.ref({show:!1,x:0,y:0,title:"",value:"",spiderSeries:[]}),Nt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),I=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),oe=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),S=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),ge=e.ref([]),$=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1});e.computed(()=>{const l=["default"];return K.value&&l.push(...Object.keys(K.value)),l});const tn=e.computed(()=>{if(!N.categories||N.categories.length===0){const{maxX:l}=ue.value;return Array.from({length:l+1},(u,s)=>F("chart.fallback.item",{number:s+1}))}return N.categories}),oo=e.computed(()=>$.value.editingMarkerId!==null),Mt=e.computed(()=>$.value.readonly),Zo=l=>{re.value.has(l)||(xo.value=!0,L.value=l)},on=()=>{xo.value=!1,L.value=null},Bn=l=>{if(uo.value||wo.value){I.value.show=!1;return}const s=l.currentTarget.getBoundingClientRect(),t=l.clientX-s.left,o=l.clientY-s.top,n=ke.value?t>=k.value.left-50&&t<=k.value.right+50&&o>=k.value.top-50&&o<=k.value.bottom+100:t>=k.value.left&&t<=k.value.right&&o>=k.value.top&&o<=k.value.bottom;if(No.value=n,ke.value){if(!Te.value||!n||S.value.isDragging||S.value.isZooming){I.value.show=!1;return}if(Xt.value.find(f=>!f||f.isHidden?!1:Math.sqrt(Math.pow(f.x-t,2)+Math.pow(f.y-o,2))<=f.radius+3))I.value.show=!1;else{const f=Xt.value.filter(C=>!C||C.isHidden?!1:Math.sqrt(Math.pow(C.x-t,2)+Math.pow(C.y-o,2))<=250);if(f.length>0){let C=f[0],y=Math.sqrt(Math.pow(C.x-t,2)+Math.pow(C.y-o,2));f.forEach(V=>{const M=Math.sqrt(Math.pow(V.x-t,2)+Math.pow(V.y-o,2));M<y&&(y=M,C=V)});const x=30,E=Xt.value.filter(V=>!V||V.isHidden?!1:Math.abs(V.x-C.x)<=x).sort((V,M)=>V.y-M.y);I.value={show:!0,x:C.x,categoryIndex:Math.round(C.originalX),data:(()=>{const V=Qo.value,M=en.value,H=[];return E.forEach(B=>{V.forEach(_=>{const R=M[_]||_,q=hn(_,B);q&&H.push({seriesName:B.seriesName,label:B.label,value:`${R}: ${q}`,color:B.color,y:B.y})})}),H})()}}else I.value.show=!1}return}if(S.value.isDragging&&S.value.scale>1&&Se.value&&Pe.value){I.value.show=!1;const h=l.clientX-S.value.lastMouseX,{minX:f,maxX:C}=ue.value,y=C-f||1,E=h*.8;S.value.offsetX+=E;const V=y/S.value.scale,M=y-V,H=0,B=-M/y*k.value.width,_=H;S.value.offsetX=Math.max(B,Math.min(_,S.value.offsetX)),S.value.lastMouseX=l.clientX,S.value.lastMouseY=l.clientY;return}if(!Te.value||!Se.value||S.value.isDragging||S.value.isZooming||!n){I.value.show=!1;return}const{minX:a,maxX:r}=ue.value,c=r-a||1,i=c/S.value.scale,d=a-S.value.offsetX/k.value.width*c,m=(t-k.value.left)/k.value.width,p=d+m*i,g=Math.round(p);if(g>=0&&g<=r){const h=he(g),f=qt.value.map((C,y)=>{const x=N.series.findIndex(V=>V===C),E=C.data[g];return{seriesName:C.name,value:E!==void 0?E:null,color:me(x),y:E!==void 0?Ne(E):null}}).filter(C=>C.value!==null);I.value={show:!0,x:h,categoryIndex:g,data:f}}},nn=()=>{I.value.show=!1,No.value=!1,wo.value=!1,uo.value||(Po.value.show=!1),S.value.isDragging&&(S.value.isDragging=!1),S.value.zoomTimeout&&(clearTimeout(S.value.zoomTimeout),S.value.zoomTimeout=null),S.value.isZooming=!1,setTimeout(()=>{L.value=null,ae.value.show=!1},150)},Tn=l=>{if(l.preventDefault(),l.stopPropagation(),At.value)return;const u=l.currentTarget.getBoundingClientRect(),s=l.clientX-u.left,t=l.clientY-u.top,o=Math.max(0,k.value.left-20),n=k.value.right,a=k.value.top,r=k.value.bottom+80;s>=o&&s<=n&&t>=a&&t<=r&&(oe.value.show=!1,e.nextTick(()=>{oe.value.show=!0,oe.value.x=l.clientX,oe.value.y=l.clientY,oe.value.categoryIndex=null;const c=Math.max(k.value.left,Math.min(s,k.value.right))-k.value.left,d=k.value.width/Xo.value.length,m=Math.floor(c/d);m>=0&&m<Xo.value.length&&(oe.value.categoryIndex=m)}))},Re=l=>{if(!(l&&l.button===2)){if(oe.value.show&&l&&l.type==="click"){const u=document.querySelector(".dss-context-menu");if(u&&u.contains(l.target))return}oe.value.show=!1}},Hn=l=>{if(typeof l.template=="function"){const u={series:N.series,categories:N.categories,markers:ge.value},s={chartX:oe.value.chartX,chartY:oe.value.chartY,dataX:oe.value.mouseDataX,dataY:oe.value.mouseDataY,categoryIndex:oe.value.categoryIndex};return l.template(u,s)}return l.template||l.label||""},An=l=>{const u=["dss-context-menu-item"];return l.cssClass&&u.push(l.cssClass),u},Uo=l=>l.style||{},ln=l=>l.type&&K.value[l.type]?K.value[l.type]:l.customIcon?l.customIcon:Ye.value,yo=l=>l==null?"":N.categories&&N.categories[l]?N.categories[l]:"",Ln=l=>ge.value.length?ge.value.filter(u=>u.categoryIndex===l):[],$n=l=>{if(!Se.value&&!ke.value)return{x:0,y:0};const u=he(l),s=kt.value+k.value.bottom-te.value/2;return{x:u,y:s}},Mo=()=>{ge.value.forEach(l=>{if(l.categoryIndex!==void 0&&(Se.value||ke.value)){const u=$n(l.categoryIndex);l.x=u.x,l.y=u.y}})},Dn=()=>{if($.value.description&&$.value.description.length){if(oo.value){const l=ge.value.findIndex(u=>u.id===$.value.editingMarkerId);l!==-1?(ge.value[l].description=$.value.description||"",ge.value[l].color=$.value.color||"",ge.value[l].type=$.value.type||"default",dt("update-marker",ge.value[l])):dt("update-marker",{id:$.value.editingMarkerId,description:$.value.description||"",color:$.value.color||"",type:$.value.type||"default"})}else{const l="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let u=Math.max(0,$.value.categoryIndex);if(ke.value){const{maxX:a}=ue.value;u=Math.max(0,Math.min(u,Math.floor(a)))}else Se.value&&(u=Math.max(0,Math.min(u,ue.value.maxX)));const s=he(u),t=kt.value+k.value.bottom-te.value/2,o=Array.isArray(N.categories)?N.categories[u]:null,n={id:l,title:"",description:$.value.description||"",color:$.value.color||"",type:$.value.type||"default",categoryIndex:u,x:s,y:t,marker_date:o||null};$.value.categoryIndex=u,ge.value.push(n),dt("add-marker",n)}be(),j()}},be=()=>{$.value.show=!1,$.value.title="",$.value.description="",$.value.color="#FF6B6B",$.value.type="default",$.value.editingMarkerId=null,$.value.readonly=!1,$.value.categoryIndex=null,$.value.fromButton=!1},at=()=>{oo.value&&(Bo($.value.editingMarkerId),be())},Bo=l=>{const u=ge.value.findIndex(s=>s.id===l);u!==-1&&(ge.value.splice(u,1),j()),dt("delete-marker",l)},we=l=>{$.value.show=!0,$.value.title=l?.title??l?.comment??"",$.value.description=l?.description??l?.comment??"",$.value.color=l?.color??"",$.value.type=l?.type??"default",$.value.editingMarkerId=l?.id??l?.marker_id??null,$.value.readonly=l?.readonly??!1,$.value.categoryIndex=l?.categoryIndex??null},j=()=>{try{const l=`dss-chart-markers-${N.chartId}`;localStorage.setItem(l,JSON.stringify(ge.value))}catch(l){console.warn("Could not save markers to localStorage:",l)}},Wo=()=>{try{const l=`dss-chart-markers-${N.chartId}`,u=localStorage.getItem(l);if(u){const s=JSON.parse(u);Array.isArray(s)&&(ge.value=s.map(t=>({...t,originalYOffset:t.originalYOffset!==void 0?t.originalYOffset:15})))}}catch(l){console.warn("Could not load markers from localStorage:",l),ge.value=[]}},no=l=>{const u=J.value||"Chart",s=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${u.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${s}.${l}`},st=()=>{const l=I.value.show,u=ae.value.show;return I.value.show=!1,ae.value.show=!1,{originalCrosshair:l,originalTooltip:u}},Wt=l=>{I.value.show=l.originalCrosshair,ae.value.show=l.originalTooltip},an=async(l,u=32,s=32)=>new Promise((t,o)=>{if(l.startsWith("data:")){t(l);return}const n=new Image;n.crossOrigin="anonymous";const a=setTimeout(()=>{console.warn("Image conversion timeout for:",l),t(l)},5e3);n.onload=()=>{clearTimeout(a);try{const r=document.createElement("canvas"),c=r.getContext("2d");r.width=u,r.height=s,c.fillStyle="#fafafa",c.fillRect(0,0,u,s),c.drawImage(n,0,0,u,s);const i=r.toDataURL("image/png");t(i)}catch(r){console.warn("Canvas conversion failed:",r),t(l)}},n.onerror=r=>{clearTimeout(a),console.warn("Failed to load image:",l,r),t(l)},n.src=l}),sn=async()=>{try{const l=st();setTimeout(async()=>{try{const u=document.querySelector(".dss-chart-svg");if(!u){console.error("Chart SVG element not found"),Wt(l);return}const s=De(),t=D.value,o=W.value+s.height,n=u.cloneNode(!0);n.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(x=>x.remove());const r=n.querySelectorAll("image"),c=Array.from(r).map(async x=>{const E=x.getAttribute("xlink:href")||x.getAttribute("href");if(E&&!E.startsWith("data:"))try{const V=await an(E,32,32);x.setAttribute("xlink:href",V),x.setAttribute("href",V)}catch(V){console.warn("Failed to convert logo to base64:",V)}});await Promise.all(c);const d=new XMLSerializer().serializeToString(n).replace(/<svg[^>]*>/,"").replace("</svg>","");let m="",p=30;if(J.value&&(m+=`
23
+ <text x="24" y="${p}"
24
24
  font-family="Arial, sans-serif"
25
25
  font-size="18"
26
26
  font-weight="bold"
27
27
  fill="#333">
28
- ${K.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
29
- </text>`,f+=30),G.value&&(m+=`
30
- <text x="24" y="${f}"
28
+ ${J.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
29
+ </text>`,p+=30),Q.value&&(m+=`
30
+ <text x="24" y="${p}"
31
31
  font-family="Arial, sans-serif"
32
32
  font-size="14"
33
33
  fill="#666">
34
- ${G.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
35
- </text>`,f+=25),ve.value&&V.series.length>0){let b=l-200,A=K.value||G.value?35:25;const N=Math.floor((l-250)/120);let T=0;V.series.forEach((L,M)=>{if(!re.value.has(M)){const F=ce(M),O=L.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");m+=`<circle cx="${b+6}" cy="${A-4}" r="6" fill="${F}"/>`,m+=`<text x="${b+18}" y="${A}" font-family="Arial, sans-serif" font-size="12" fill="#333">${O}</text>`,T++,T%N===0?(b=l-200,A+=20):b+=Math.min(120,O.length*8+35)}})}let g="";if(Ye.value)try{const{width:b,height:A}=ft.value,N=mt.value,T=h.value.left,L=h.value.right,M=h.value.top,F=h.value.bottom,O=h.value.width,pe=h.value.height;let ge,Je;switch(N){case"center":ge=T+(O-b)/2,Je=M+(pe-A)/2;break;case"top-left":ge=T+15,Je=M+5;break;case"top-right":ge=L-b-5,Je=M+5;break;case"bottom-left":ge=T+15,Je=F-A-5;break;case"bottom-right":default:ge=L-b-5,Je=F-A-5;break}g=`
36
- <g opacity="${lt.value}">
37
- <g transform="translate(${ge}, ${Je}) scale(${b/499})">
34
+ ${Q.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
35
+ </text>`,p+=25),ye.value&&N.series.length>0){let x=t-200,E=J.value||Q.value?35:25;const V=Math.floor((t-250)/120);let M=0;N.series.forEach((H,B)=>{if(!re.value.has(B)){const _=me(B),R=H.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");m+=`<circle cx="${x+6}" cy="${E-4}" r="6" fill="${_}"/>`,m+=`<text x="${x+18}" y="${E}" font-family="Arial, sans-serif" font-size="12" fill="#333">${R}</text>`,M++,M%V===0?(x=t-200,E+=20):x+=Math.min(120,R.length*8+35)}})}let g="";if(Ke.value)try{const{width:x,height:E}=mt.value,V=ve.value,M=k.value.left,H=k.value.right,B=k.value.top,_=k.value.bottom,R=k.value.width,q=k.value.height;let G,Me;switch(V){case"center":G=M+(R-x)/2,Me=B+(q-E)/2;break;case"top-left":G=M+15,Me=B+5;break;case"top-right":G=H-x-5,Me=B+5;break;case"bottom-left":G=M+15,Me=_-E-5;break;case"bottom-right":default:G=H-x-5,Me=_-E-5;break}g=`
36
+ <g opacity="${Ge.value}">
37
+ <g transform="translate(${G}, ${Me}) scale(${x/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(b){console.warn("Watermark processing failed, skipping watermark in SVG:",b),g=""}const v=`<?xml version="1.0" encoding="UTF-8"?>
53
- <svg width="${l}" height="${a}"
52
+ </g>`}catch(x){console.warn("Watermark processing failed, skipping watermark in SVG:",x),g=""}const h=`<?xml version="1.0" encoding="UTF-8"?>
53
+ <svg width="${t}" height="${o}"
54
54
  xmlns="http://www.w3.org/2000/svg"
55
55
  xmlns:xlink="http://www.w3.org/1999/xlink">
56
56
  <defs>
@@ -62,19 +62,19 @@
62
62
  </defs>
63
63
  <rect width="100%" height="100%" fill="#fafafa"/>
64
64
  ${m}
65
- <g transform="translate(0, ${o.height})">
66
- ${u}
65
+ <g transform="translate(0, ${s.height})">
66
+ ${d}
67
67
  ${g}
68
68
  </g>
69
- </svg>`,y=new Blob([v],{type:"image/svg+xml;charset=utf-8"}),k=URL.createObjectURL(y),w=document.createElement("a");w.href=k,w.download=Ke("svg"),document.body.appendChild(w),w.click(),document.body.removeChild(w),URL.revokeObjectURL(k),Ht(t),Ut()}catch(n){console.error("Error downloading SVG:",n),Ht(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},At=async()=>{try{const t=rn();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(b=>setTimeout(b,300));const n=$e(),o=D.value,l=Z.value+n.height,a=document.createElement("canvas"),s=a.getContext("2d"),r=2;a.width=o*r,a.height=l*r,a.style.width=o+"px",a.style.height=l+"px",s.scale(r,r),s.fillStyle="#fafafa",s.fillRect(0,0,o,l);let i=30;if(K.value&&(s.fillStyle="#333",s.font="bold 18px Arial, sans-serif",s.fillText(K.value,24,i),i+=30),G.value&&(s.fillStyle="#666",s.font="14px Arial, sans-serif",s.fillText(G.value,24,i),i+=25),ve.value&&V.series.length>0){let b=o-200,A=K.value||G.value?35:25;const N=Math.floor((o-250)/120);let T=0;s.font="12px Arial, sans-serif",V.series.forEach((L,M)=>{if(!re.value.has(M)){const F=ce(M);s.beginPath(),s.arc(b+6,A-4,6,0,2*Math.PI),s.fillStyle=F,s.fill(),s.fillStyle="#333",s.fillText(L.name,b+18,A),T++,T%N===0?(b=o-200,A+=20):b+=Math.min(120,L.name.length*8+35)}})}const d=document.querySelector(".dss-chart-svg").cloneNode(!0),u=d.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),m=d.querySelectorAll(".dss-crosshair"),f=d.querySelectorAll('[class*="tooltip"]');u.forEach(b=>b.remove()),m.forEach(b=>b.remove()),f.forEach(b=>b.remove()),d.querySelectorAll("image").forEach((b,A)=>{const N=b.getAttribute("xlink:href")||b.getAttribute("href");if(N&&!N.startsWith("data:")){const T=Kt.value[A],L=T?ce(T.seriesIndex):"#3B82F6",M=b.getAttribute("x")||0,F=b.getAttribute("y")||0,O=b.getAttribute("width")||32,pe=b.getAttribute("height")||32,ge=document.createElementNS("http://www.w3.org/2000/svg","circle");ge.setAttribute("cx",parseFloat(M)+parseFloat(O)/2),ge.setAttribute("cy",parseFloat(F)+parseFloat(pe)/2),ge.setAttribute("r",Math.min(parseFloat(O),parseFloat(pe))/2-1),ge.setAttribute("fill",L),ge.setAttribute("stroke","#fafafa"),ge.setAttribute("stroke-width","2"),b.parentNode.replaceChild(ge,b)}});const v=new XMLSerializer().serializeToString(d),y=new Blob([v],{type:"image/svg+xml;charset=utf-8"}),k=URL.createObjectURL(y),w=new Image;return new Promise((b,A)=>{w.onload=async()=>{try{if(s.drawImage(w,0,n.height),Kt.value.forEach(N=>{const T=N.x,L=N.y+n.height,M=(N.width||32)/2,F=ce(N.seriesIndex);s.save(),s.beginPath(),s.arc(T,L,M-1,0,2*Math.PI),s.fillStyle=F,s.fill(),s.strokeStyle="#fafafa",s.lineWidth=2,s.stroke(),s.restore()}),Ye.value){const N=new Image,T=()=>{const{width:M,height:F}=ft.value,O=mt.value,pe=h.value.left,ge=h.value.right,Je=h.value.top,Bn=h.value.bottom,Tn=h.value.width,el=h.value.height;let Qt,wt;switch(O){case"center":Qt=pe+(Tn-M)/2,wt=Je+n.height+(el-F)/2;break;case"top-left":Qt=pe+15,wt=Je+n.height+10;break;case"top-right":Qt=ge-M-5,wt=Je+n.height+10;break;case"bottom-left":Qt=pe+15,wt=Bn+n.height-F-5;break;case"bottom-right":default:Qt=ge-M-5,wt=Bn+n.height-F-5;break}s.globalAlpha=lt.value,s.drawImage(N,Qt,wt,M,F),s.globalAlpha=1,L()},L=()=>{a.toBlob(M=>{const F=URL.createObjectURL(M),O=document.createElement("a");O.href=F,O.download=Ke("png"),document.body.appendChild(O),O.click(),document.body.removeChild(O),URL.revokeObjectURL(F),URL.revokeObjectURL(k),Ht(t),Ut(),b()},"image/png")};N.onload=T,N.onerror=L,N.src=_o.value}else a.toBlob(N=>{const T=URL.createObjectURL(N),L=document.createElement("a");L.href=T,L.download=Ke("png"),document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(T),URL.revokeObjectURL(k),Ht(t),Ut(),b()},"image/png")}catch(N){URL.revokeObjectURL(k),Ht(t),A(N)}},w.onerror=()=>{URL.revokeObjectURL(k),Ht(t),A(new Error("Failed to load SVG image"))},w.src=k})}catch(t){console.error("Error downloading PNG:",t)}},Rn=()=>{try{let t="";K.value&&(t+=`# ${_("chart.csv.chartTitle")}: ${K.value}
70
- `),G.value&&(t+=`# ${_("chart.csv.chartSubtitle")}: ${G.value}
71
- `),t+=`# ${_("chart.csv.generated")}: ${new Date().toLocaleString()}
69
+ </svg>`,f=new Blob([h],{type:"image/svg+xml;charset=utf-8"}),C=URL.createObjectURL(f),y=document.createElement("a");y.href=C,y.download=no("svg"),document.body.appendChild(y),y.click(),document.body.removeChild(y),URL.revokeObjectURL(C),Wt(l),Re()}catch(u){console.error("Error downloading SVG:",u),Wt(l)}},50)}catch(l){console.error("Error downloading SVG:",l)}},To=async()=>{try{const l=st();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(x=>setTimeout(x,300));const u=De(),s=D.value,t=W.value+u.height,o=document.createElement("canvas"),n=o.getContext("2d"),a=2;o.width=s*a,o.height=t*a,o.style.width=s+"px",o.style.height=t+"px",n.scale(a,a),n.fillStyle="#fafafa",n.fillRect(0,0,s,t);let r=30;if(J.value&&(n.fillStyle="#333",n.font="bold 18px Arial, sans-serif",n.fillText(J.value,24,r),r+=30),Q.value&&(n.fillStyle="#666",n.font="14px Arial, sans-serif",n.fillText(Q.value,24,r),r+=25),ye.value&&N.series.length>0){let x=s-200,E=J.value||Q.value?35:25;const V=Math.floor((s-250)/120);let M=0;n.font="12px Arial, sans-serif",N.series.forEach((H,B)=>{if(!re.value.has(B)){const _=me(B);n.beginPath(),n.arc(x+6,E-4,6,0,2*Math.PI),n.fillStyle=_,n.fill(),n.fillStyle="#333",n.fillText(H.name,x+18,E),M++,M%V===0?(x=s-200,E+=20):x+=Math.min(120,H.name.length*8+35)}})}const i=document.querySelector(".dss-chart-svg").cloneNode(!0),d=i.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),m=i.querySelectorAll(".dss-crosshair"),p=i.querySelectorAll('[class*="tooltip"]');d.forEach(x=>x.remove()),m.forEach(x=>x.remove()),p.forEach(x=>x.remove()),i.querySelectorAll("image").forEach((x,E)=>{const V=x.getAttribute("xlink:href")||x.getAttribute("href");if(V&&!V.startsWith("data:")){const M=Do.value[E],H=M?me(M.seriesIndex):"#3B82F6",B=x.getAttribute("x")||0,_=x.getAttribute("y")||0,R=x.getAttribute("width")||32,q=x.getAttribute("height")||32,G=document.createElementNS("http://www.w3.org/2000/svg","circle");G.setAttribute("cx",parseFloat(B)+parseFloat(R)/2),G.setAttribute("cy",parseFloat(_)+parseFloat(q)/2),G.setAttribute("r",Math.min(parseFloat(R),parseFloat(q))/2-1),G.setAttribute("fill",H),G.setAttribute("stroke","#fafafa"),G.setAttribute("stroke-width","2"),x.parentNode.replaceChild(G,x)}});const h=new XMLSerializer().serializeToString(i),f=new Blob([h],{type:"image/svg+xml;charset=utf-8"}),C=URL.createObjectURL(f),y=new Image;return new Promise((x,E)=>{y.onload=async()=>{try{if(n.drawImage(y,0,u.height),Do.value.forEach(V=>{const M=V.x,H=V.y+u.height,B=(V.width||32)/2,_=me(V.seriesIndex);n.save(),n.beginPath(),n.arc(M,H,B-1,0,2*Math.PI),n.fillStyle=_,n.fill(),n.strokeStyle="#fafafa",n.lineWidth=2,n.stroke(),n.restore()}),Ke.value){const V=new Image,M=()=>{const{width:B,height:_}=mt.value,R=ve.value,q=k.value.left,G=k.value.right,Me=k.value.top,yt=k.value.bottom,En=k.value.width,bn=k.value.height;let po,jt;switch(R){case"center":po=q+(En-B)/2,jt=Me+u.height+(bn-_)/2;break;case"top-left":po=q+15,jt=Me+u.height+10;break;case"top-right":po=G-B-5,jt=Me+u.height+10;break;case"bottom-left":po=q+15,jt=yt+u.height-_-5;break;case"bottom-right":default:po=G-B-5,jt=yt+u.height-_-5;break}n.globalAlpha=Ge.value,n.drawImage(V,po,jt,B,_),n.globalAlpha=1,H()},H=()=>{o.toBlob(B=>{const _=URL.createObjectURL(B),R=document.createElement("a");R.href=_,R.download=no("png"),document.body.appendChild(R),R.click(),document.body.removeChild(R),URL.revokeObjectURL(_),URL.revokeObjectURL(C),Wt(l),Re(),x()},"image/png")};V.onload=M,V.onerror=H,V.src=to.value}else o.toBlob(V=>{const M=URL.createObjectURL(V),H=document.createElement("a");H.href=M,H.download=no("png"),document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(M),URL.revokeObjectURL(C),Wt(l),Re(),x()},"image/png")}catch(V){URL.revokeObjectURL(C),Wt(l),E(V)}},y.onerror=()=>{URL.revokeObjectURL(C),Wt(l),E(new Error("Failed to load SVG image"))},y.src=C})}catch(l){console.error("Error downloading PNG:",l)}},Bt=()=>{try{let l="";J.value&&(l+=`# ${F("chart.csv.chartTitle")}: ${J.value}
70
+ `),Q.value&&(l+=`# ${F("chart.csv.chartSubtitle")}: ${Q.value}
71
+ `),l+=`# ${F("chart.csv.generated")}: ${new Date().toLocaleString()}
72
72
 
73
- `,t+="Category",V.series.forEach(s=>{const r=s.name.replace(/"/g,'""');t+=',"'+r+'"'}),t+=`
74
- `;const n=Math.max(...V.series.map(s=>s.data?.length||0));for(let s=0;s<n;s++){let c='"'+(V.categories[s]||_("chart.fallback.item",{number:s+1})).toString().replace(/"/g,'""')+'"';V.series.forEach(d=>{const u=d.data&&d.data[s]!==void 0?d.data[s]:"";c+=","+u}),t+=c+`
75
- `}const o=new Blob([t],{type:"text/csv;charset=utf-8;"}),l=URL.createObjectURL(o),a=document.createElement("a");a.href=l,a.download=Ke("csv"),document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(l),Ut()}catch(t){console.error("Error downloading CSV:",t)}},Fn=t=>{if(typeof t.action=="function"){const n={series:V.series,categories:V.categories,markers:Ce.value},o={chartX:Q.value.chartX,chartY:Q.value.chartY,dataX:Q.value.mouseDataX,dataY:Q.value.mouseDataY,categoryIndex:clampedCategoryIndex||Q.value.categoryIndex};t.action(n,o)}Ut()},Lt=()=>{Te(),$.value.show=!0,$.value.categoryIndex=Q.value.categoryIndex,$.value.fromButton=!1,Ut()},_e=()=>{Te(),$.value.show=!0,$.value.categoryIndex=0,$.value.fromButton=!0},zo=t=>{if(Q.value.show){const n=document.querySelector(".dss-context-menu");n&&!n.contains(t.target)&&(Q.value.show=!1)}},Ve=t=>{Q.value.show&&!t.target.closest(".context-menu")&&(Q.value.show=!1)},gt=t=>{if(!Se.value||!Fe.value)return;t.preventDefault(),t.stopPropagation(),E.value.isZooming=!0,R.value.show=!1,E.value.zoomTimeout&&clearTimeout(E.value.zoomTimeout);const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left,a=t.clientY-o.top;if(l<h.value.left-50||l>h.value.right+50||a<h.value.top-50||a>h.value.bottom+100){E.value.isZooming=!1;return}const s=t.deltaY>0?.9:1.1,r=Math.max(E.value.minScale,Math.min(E.value.maxScale,E.value.scale*s));if(r!==E.value.scale){const{minX:i,maxX:c}=ue.value,d=c-i||1,u=d/E.value.scale,m=i-E.value.offsetX/h.value.width*d,f=(l-h.value.left)/h.value.width,g=m+f*u;E.value.scale=r;const v=d/E.value.scale,y=g-f*v;E.value.offsetX=-(y-i)/d*h.value.width,E.value.scale<=1.01&&(E.value.scale=1,E.value.offsetX=0)}E.value.zoomTimeout=setTimeout(()=>{E.value.isZooming=!1,E.value.zoomTimeout=null},300)},zn=t=>{if(!Se.value||!Fe.value||E.value.scale<=1)return;R.value.show=!1;const o=t.currentTarget.getBoundingClientRect();t.clientX-o.left,t.clientY-o.top,E.value.isDragging=!0,E.value.lastMouseX=t.clientX,E.value.lastMouseY=t.clientY,t.preventDefault()},dn=()=>{E.value.isDragging=!1},Mo=()=>{!Se.value||!Fe.value||(E.value.scale=1,E.value.offsetX=0,E.value.isDragging=!1,E.value.zoomTimeout&&(clearTimeout(E.value.zoomTimeout),E.value.zoomTimeout=null),E.value.isZooming=!1)},Ie=()=>!Se.value||!bo.value||!Fe.value?"default":E.value.isDragging?"grabbing":E.value.scale>1?"grab":"dss-crosshair",Bo=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 n=`M ${t[0].x} ${t[0].y}`;for(let o=0;o<t.length-1;o++){const l=t[Math.max(o-1,0)],a=t[o],s=t[o+1],r=t[Math.min(o+2,t.length-1)],i=a.x+(s.x-l.x)/6*Nt.value,c=a.y+(s.y-l.y)/6*Nt.value,d=s.x-(r.x-a.x)/6*Nt.value,u=s.y-(r.y-a.y)/6*Nt.value;n+=` C ${i} ${c} ${d} ${u} ${s.x} ${s.y}`}return n},ht=e.computed(()=>{let n=50+(et.value?30:0)+60;if(yt.value)return{left:90,top:90,right:90,bottom:90};if(xe.value){let r=0;K.value&&(r+=15),G.value&&(r+=10);const i=$e();let c=66,d=50;return ve.value&&Ne.value==="left"?c+=i.legendWidth||150:ve.value&&Ne.value==="right"&&(d+=i.legendWidth||150),{left:c,top:50+r,right:d,bottom:130}}let o=0;K.value&&(o+=15),G.value&&(o+=10);const l=$e();let a=66,s=50;return ve.value&&Ne.value==="left"?a+=l.legendWidth||150:ve.value&&Ne.value==="right"&&(s+=l.legendWidth||150),ve.value&&Ne.value==="bottom"&&(n+=l.legendHeight||0),{left:a,top:50+o,right:s,bottom:n}}),h=e.computed(()=>({left:ht.value.left,top:ht.value.top,right:D.value-ht.value.right,bottom:Z.value-ht.value.bottom,width:D.value-(ht.value.left+ht.value.right),height:Z.value-(ht.value.top+ht.value.bottom)})),Se=e.computed(()=>["line","area","bar"].includes(P.value)||Qe.value),Ze=e.computed(()=>Qe.value),xe=e.computed(()=>["radial","semi-radial"].includes(P.value)),yt=e.computed(()=>P.value==="spider"),we=e.computed(()=>P.value==="bubble"),X=e.computed(()=>S.value?.chart?.orientation==="horizontal"&&(P.value==="bar"||Ze.value)),Ae=t=>{const{minY:n,maxY:o}=ue.value,l=o-n||1;return h.value.left+(t-n)/l*h.value.width},Ue=t=>{const{maxX:n}=ue.value,o=n+1,a=h.value.height/o;return h.value.top+(t+.5)*a},te=e.computed(()=>D.value/2),oe=e.computed(()=>yt.value?Z.value/2-40:Z.value/2),U=e.computed(()=>{if(yt.value){const t=h.value.width-80,n=h.value.height-80;return Math.min(t,n)/2}return Math.min(h.value.width,h.value.height)/2}),Ee=e.computed(()=>U.value*.45),Le=e.computed(()=>S.value?.bubbles?.minSize||8),To=e.computed(()=>S.value?.bubbles?.maxSize||50),ao=e.computed(()=>S.value?.bubbles?.opacity||.7),un=(t,n)=>{const o=[15,20,25,18,22],l=o[t%o.length]||20,a=1+Math.sin(n*.5)*.2;return Math.max(5,l*a)},mn=t=>{const n=document.querySelector(`.dss-bubble-image-${t}`);n&&(n.style.opacity="1")},fn=t=>{const n=document.querySelector(`.dss-bubble-image-${t}`);n&&(n.style.display="none")},Ct=e.computed(()=>V.series),Wt=e.computed(()=>V.series.filter((t,n)=>!re.value.has(n))),kt="auto",ue=e.computed(()=>{if(we.value)return On();if(!Wt.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,n=-1/0,o=0;Wt.value.forEach(i=>{i.data&&i.data.length&&(o=Math.max(o,i.data.length-1),i.data.forEach(c=>{typeof c=="number"&&(t=Math.min(t,c),n=Math.max(n,c))}))}),V.categories.length>0&&(o=Math.max(o,V.categories.length-1)),t===1/0&&(t=0,n=100);const l=ie.value,a=Vt.value;let s,r;if(l===kt){const i=n-t,c=i>0?i*.1:1;s=Math.max(0,t-c)}else if(typeof l=="number")s=l;else{const i=n-t,c=i>0?i*.1:1;s=Math.max(0,t-c)}if(a===kt){const i=n-t,c=i>0?i*.1:2;r=n+c}else if(typeof a=="number")r=a;else{const i=n-t,c=i>0?i*.1:2;r=n+c}return{minX:0,maxX:o,minY:s,maxY:r}}),On=()=>{if(!Wt.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,n=-1/0,o=1/0,l=-1/0,a=1/0,s=-1/0,r=!1;if(Wt.value.forEach((g,v)=>{g?.data?.length&&g.data.forEach((y,k)=>{let w,b,A;if(typeof y=="object"&&y!==null&&!Array.isArray(y))w=typeof y.x=="number"?y.x:k,b=typeof y.y=="number"?y.y:0,A=typeof y.size=="number"?y.size:20;else if(Array.isArray(y)&&y.length>=3)w=typeof y[0]=="number"?y[0]:k,b=typeof y[1]=="number"?y[1]:0,A=typeof y[2]=="number"?y[2]:20;else if(typeof y=="number")w=k,b=y,A=un(v,k);else return;isFinite(w)&&isFinite(b)&&isFinite(A)&&(t=Math.min(t,w),n=Math.max(n,w),o=Math.min(o,b),l=Math.max(l,b),a=Math.min(a,A),s=Math.max(s,A),r=!0)})}),!r)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===n&&(t=Math.min(t,0),n=Math.max(n,V.categories?.length-1||8)),o===l&&(o=Math.max(0,o-10),l=o+20);const i=n-t,c=l-o;let d,u,m,f;return Rt.value!==null?d=Rt.value:d=t-i*.1,oo.value!==null?u=oo.value:u=n+i*.1,ie.value!==null&&typeof ie.value=="number"?m=ie.value:m=Math.max(0,o-c*.1),Vt.value!==null&&typeof Vt.value=="number"?f=Vt.value:f=l+c*.1,{minX:d,maxX:u,minY:m,maxY:f,minSize:a,maxSize:s}},me=t=>{if(we.value){const{minX:i,maxX:c}=ue.value,d=c-i||1;return h.value.left+(t-i)/d*h.value.width}const{minX:n,maxX:o}=ue.value,l=o-n;if(o===0||l===0)return h.value.left+h.value.width/2;const a=l/E.value.scale,s=n-E.value.offsetX/h.value.width*l,r=(t-s)/a;return h.value.left+r*h.value.width},be=t=>{const{minY:n,maxY:o}=ue.value,l=o-n||1;return h.value.bottom-(t-n)/l*h.value.height},pn=t=>{if(!we.value)return se.value||4;const{minSize:n,maxSize:o}=ue.value,l=o-n||1;if(l===0)return(Le.value+To.value)/2;const a=(t-n)/l;return Le.value+a*(To.value-Le.value)},Pn=e.computed(()=>Po.value.map(t=>({y:t.y}))),Oo=e.computed(()=>{if(we.value)return vn();if(P.value==="bar"){if(X.value){const N=[],{minY:T,maxY:L}=ue.value,M=5,F=L-T||1;for(let O=0;O<=M;O++){const pe=T+F*(O/M),ge=Ae(pe);N.push({x:ge,y:h.value.bottom+20,text:Math.round(pe).toString()})}return N}const v=[],{maxX:y}=ue.value,k=y+1,w=5,A=(h.value.width-w*2)/k;for(let N=0;N<=y;N++){const T=h.value.left+w+(N+.5)*A;v.push({x:T,y:h.value.bottom+20,text:V.categories[N]||_("chart.fallback.item",{number:N+1})})}return v}const t=[],{minX:n,maxX:o}=ue.value,l=o-n||1,a=l/E.value.scale,s=n-E.value.offsetX/h.value.width*l,r=s+a,i=Math.max(0,Math.floor(s-2)),c=Math.min(o,Math.ceil(r+2)),d=c-i,u=h.value.width,f=Math.floor(u/60);let g=1;d>f&&(g=Math.ceil(d/f));for(let v=i;v<=c;v+=g)if(v>=0&&v<=o){const y=me(v);y>=h.value.left-100&&y<=h.value.right+100&&t.push({x:y,y:h.value.bottom+20,text:V.categories[v]||`Item ${v+1}`})}return t}),vn=()=>{const t=[],{minX:n,maxX:o}=ue.value,l=o-n||1,a=Math.min(8,Math.max(4,Math.floor(h.value.width/80)));for(let s=0;s<=a;s++){const r=n+l*s/a,i=me(r);if(i>=h.value.left-10&&i<=h.value.right+10){const c=Math.round(r),d=V.categories?.[c];t.push({x:i,y:h.value.bottom+20,text:d||(Number.isInteger(r)?r.toString():r.toFixed(1))})}}return t},Po=e.computed(()=>{if(X.value){const a=[],{maxX:s}=ue.value;for(let r=0;r<=s;r++)a.push({x:h.value.left-10,y:Ue(r),text:V.categories[r]||`Item ${r+1}`});return a}const t=[],{minY:n,maxY:o}=ue.value,l=5;for(let a=0;a<=l;a++){const s=n+(o-n)*(a/l),r=Math.round(s);t.push({x:h.value.left-10,y:be(s),text:r.toString()})}return t}),ce=t=>{const n=no.value;if(!n||n.length===0){const o=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return o[t%o.length]}return n[t%n.length]},Zo=t=>{let n=0;for(let o=1;o<t.length;o++){const l=t[o].x-t[o-1].x,a=t[o].y-t[o-1].y;n+=Math.sqrt(l*l+a*a)}return n},gn=e.computed(()=>P.value==="line"||Ze.value?(Ze.value?V.series.filter(n=>(n.type||P.value)==="line"):Ct.value).map((n,o)=>{const l=V.series.findIndex(m=>m===n),a=[];let s=[];n.data.forEach((m,f)=>{m==null?s.length>0&&(a.push([...s]),s=[]):s.push({x:X.value?Ae(m):me(f),y:X.value?Ue(f):be(m),index:f})}),s.length>0&&a.push(s);let r="";a.forEach(m=>{if(m.length>0){let f="";q.value?f=Bo(m):f=`M ${m[0].x} ${m[0].y}`+m.slice(1).map(g=>` L ${g.x} ${g.y}`).join(""),r+=(r?" ":"")+f}});const i=a.reduce((m,f)=>m+Zo(f),0),c=re.value.has(l),d=H.value===l,u=H.value!==null&&H.value!==l;return{path:r,color:ce(l),pathLength:i,seriesIndex:l,animationDelay:o*he.value,isHighlighted:d,isDimmed:u,isHidden:c}}):[]),hn=e.computed(()=>{if(!(P.value==="line"||Ze.value))return[];const t=Ze.value?V.series.filter(o=>(o.type||P.value)==="line"):Ct.value,n=[];return t.forEach((o,l)=>{const a=V.series.findIndex(s=>s===o);for(let s=0;s<o.data.length-1;s++){const r=o.data[s];if(r!=null){let i=-1,c=0;for(let d=s+1;d<o.data.length;d++){const u=o.data[d];if(u==null)c++;else{i=d;break}}if(c>0&&i!==-1){const d=o.data[i],u=X.value?Ae(r):me(s),m=X.value?Ue(s):be(r),f=X.value?Ae(d):me(i),g=X.value?Ue(i):be(d),v=re.value.has(a),y=H.value===a,k=H.value!==null&&H.value!==a;n.push({path:`M ${u} ${m} L ${f} ${g}`,color:ce(a),seriesIndex:a,animationDelay:l*he.value,isHighlighted:y,isDimmed:k,isHidden:v,gapSize:c}),s=i-1}}}}),n}),yn=e.computed(()=>P.value==="line"||Ze.value?!Ft.value||co.value||Y.value.hasAnimated?[]:(Ze.value?V.series.filter(n=>(n.type||P.value)==="line"):Ct.value).map((n,o)=>{const l=V.series.findIndex(c=>c===n);let a="",s=null;n.data.forEach((c,d)=>{if(c!=null){const u={x:X.value?Ae(c):me(d),y:X.value?Ue(d):be(c)};s===null?a+=`M ${u.x} ${u.y}`:a+=` L ${u.x} ${u.y}`,s=u}else if(s!==null){const u=n.data.findIndex((m,f)=>f>d&&m!==null&&m!==void 0);if(u!==-1){const m={x:X.value?Ae(n.data[u]):me(u),y:X.value?Ue(u):be(n.data[u])};a+=` L ${m.x} ${m.y}`,s=m}}});const r=n.data.map((c,d)=>c==null?null:{x:X.value?Ae(c):me(d),y:X.value?Ue(d):be(c)}).filter(c=>c!==null),i=Zo(r);return{path:a,pathLength:i,color:ce(l),animationDelay:o*he.value,seriesIndex:l}}):[]),so=e.computed(()=>{if(P.value!=="line")return[];const t=[];return Ct.value.forEach((n,o)=>{const l=H.value===o,a=H.value!==null&&H.value!==o,s=re.value.has(o);n.data.forEach((r,i)=>{r!=null&&t.push({x:me(i),y:be(r),color:ce(o),value:r,label:V.categories[i]||i.toString(),seriesName:n.name,categoryIndex:i,dataIndex:i,animationDelay:(o*n.data.length+i)*(he.value/8),isHighlighted:l,isDimmed:a,isHidden:s})})}),t}),Ho=e.computed(()=>{if(!Ze.value)return[];const t=[];return V.series.filter(o=>(o.type||P.value)==="line").forEach((o,l)=>{const a=V.series.findIndex(c=>c===o),s=H.value===a,r=H.value!==null&&H.value!==a,i=re.value.has(a);o.data.forEach((c,d)=>{c!=null&&t.push({x:me(d),y:be(c),color:ce(a),value:c,label:V.categories[d]||d.toString(),seriesName:o.name,categoryIndex:d,dataIndex:d,animationDelay:(l*o.data.length+d)*(he.value/8),isHighlighted:s,isDimmed:r,isHidden:i})})}),t}),qt=e.computed(()=>{if(!we.value)return[];const t=[];return Ct.value.forEach((n,o)=>{if(!n?.data?.length)return;const l=H.value,a=l!==null&&l===o,s=l!==null&&l!==o,r=re.value.has(o);n.data.forEach((i,c)=>{let d,u,m,f,g;if(typeof i=="object"&&i!==null&&!Array.isArray(i))d=typeof i.x=="number"?i.x:c,u=typeof i.y=="number"?i.y:0,m=typeof i.size=="number"?i.size:20,f=i.label||V.categories?.[c]||`Point ${c+1}`,g=i.image||i.imageUrl;else if(Array.isArray(i)&&i.length>=3)d=typeof i[0]=="number"?i[0]:c,u=typeof i[1]=="number"?i[1]:0,m=typeof i[2]=="number"?i[2]:20,f=i[3]||V.categories?.[c]||`Point ${c+1}`,g=i[4];else if(typeof i=="number")d=c,u=i,m=un(o,c),f=V.categories?.[c]||`Point ${c+1}`;else return;!isFinite(d)||!isFinite(u)||!isFinite(m)||t.push({x:me(d),y:be(u),radius:pn(m),originalX:d,originalY:u,originalSize:m,color:ce(o),seriesName:n.name||`Series ${o+1}`,label:f,imageUrl:g,seriesIndex:o,dataIndex:c,categoryIndex:Math.round(d),isHighlighted:a,isDimmed:s,isHidden:r,opacity:ao.value})})}),t}),Uo=e.computed(()=>P.value!=="area"?[]:Ct.value.map((t,n)=>{const o=[];let l=[];if(t.data.forEach((m,f)=>{m==null?l.length>0&&(o.push([...l]),l=[]):l.push({x:me(f),y:be(m),index:f})}),l.length>0&&o.push(l),o.length===0)return{linePath:"",areaPath:"",color:ce(n),isHidden:re.value.has(n)};const a=h.value.bottom+1;let s="",r="";o.forEach((m,f)=>{if(m.length===0)return;let g=`M ${m[0].x} ${m[0].y}`;q.value&&m.length>1?g=Bo(m):m.slice(1).forEach(y=>{g+=` L ${y.x} ${y.y}`}),s+=(s?" ":"")+g;let v=`M ${m[0].x} ${a}`;if(v+=` L ${m[0].x} ${m[0].y}`,q.value&&m.length>1){const y=Bo(m),k=y.substring(y.indexOf("C")||y.indexOf("Q")||y.indexOf("L"));k?v+=" "+k:m.slice(1).forEach(w=>{v+=` L ${w.x} ${w.y}`})}else m.slice(1).forEach(y=>{v+=` L ${y.x} ${y.y}`});v+=` L ${m[m.length-1].x} ${a} Z`,r+=(r?" ":"")+v});const i=H.value===n,c=H.value!==null&&H.value!==n,d=re.value.has(n),u=o.reduce((m,f)=>m+Zo(f),0);return{linePath:s,areaPath:r,color:ce(n),pathLength:u,isHighlighted:i,isDimmed:c,isHidden:d}})),Cn=e.computed(()=>{if(!(["bar"].includes(P.value)||Ze.value))return[];const t=[],{maxX:n}=ue.value,o=Ze.value?V.series.filter(a=>(a.type||P.value)==="bar"):Ct.value,l=o.length;if(X.value){const a=n+1,r=h.value.height/a,i=r*(2/3),c=i/l,d=c*.02,u=l===a?Math.max(12,i-d*l):Math.max(12,c-d);o.forEach((m,f)=>{const g=V.series.findIndex(w=>w===m),v=H.value===g,y=H.value!==null&&H.value!==g,k=re.value.has(g);m.data.forEach((w,b)=>{if(w==null||typeof w!="number"||!isFinite(w))return;const T=h.value.top+(b+.5)*r-i/2+f*c+d/2,L=h.value.left,M=Math.abs(Ae(w)-h.value.left);let F="";if(q.value&&M>0){const O=Math.min(po.value,u/2,M/2);F=[`M ${L} ${T}`,`L ${L+M-O} ${T}`,`Q ${L+M} ${T} ${L+M} ${T+O}`,`L ${L+M} ${T+u-O}`,`Q ${L+M} ${T+u} ${L+M-O} ${T+u}`,`L ${L} ${T+u}`,"Z"].join(" ")}t.push({x:L,y:T,width:M,height:u,color:ce(g),value:w,label:V.categories[b]||b.toString(),seriesName:m.name,animationDelay:(f*o.length+b)*(he.value/4),isHighlighted:v,isDimmed:y,isHidden:k,barPath:F,isSmooth:q.value&&M>0})})})}else{const a=n+1,r=h.value.width/a,i=r*.8,c=i/l,d=c*.05,u=c-d;o.forEach((m,f)=>{const g=V.series.findIndex(w=>w===m),v=H.value===g,y=H.value!==null&&H.value!==g,k=re.value.has(g);m.data.forEach((w,b)=>{if(w==null||typeof w!="number"||!isFinite(w))return;const T=h.value.left+(b+.5)*r-i/2+f*c+d/2,L=be(Math.max(0,w)),M=Math.abs(be(0)-be(w));let F="";if(q.value&&M>0){const O=Math.min(po.value,u/2,M/2);F=[`M ${T} ${L+M}`,`L ${T} ${L+O}`,`Q ${T} ${L} ${T+O} ${L}`,`L ${T+u-O} ${L}`,`Q ${T+u} ${L} ${T+u} ${L+O}`,`L ${T+u} ${L+M}`,"Z"].join(" ")}t.push({x:T,y:L,width:u,height:M,color:ce(g),value:w,label:V.categories[b]||b.toString(),seriesName:m.name,animationDelay:(f*o.length+b)*(he.value/4),isHighlighted:v,isDimmed:y,isHidden:k,barPath:F,isSmooth:q.value&&M>0})})})}return t}),Wo=e.computed(()=>{if(!xe.value)return[];const t=Ct.value.map((s,r)=>({series:s,originalIndex:r})).filter(({originalIndex:s})=>!re.value.has(s));if(t.length===0)return[];let n=P.value==="semi-radial"?Math.PI:-Math.PI/2;const o=P.value==="semi-radial"?Math.PI:Math.PI*2,l=[];if(t.length===1){const{series:s,originalIndex:r}=t[0],i=s.data[0]||0,c=n,d=n+o-.001,u=c+o/2,m=te.value+Math.cos(c)*Ee.value,f=oe.value+Math.sin(c)*Ee.value,g=te.value+Math.cos(d)*Ee.value,v=oe.value+Math.sin(d)*Ee.value,y=te.value+Math.cos(d)*U.value,k=oe.value+Math.sin(d)*U.value,w=te.value+Math.cos(c)*U.value,b=oe.value+Math.sin(c)*U.value,A=1,N=[`M ${m} ${f}`,`A ${Ee.value} ${Ee.value} 0 ${A} 1 ${g} ${v}`,`L ${y} ${k}`,`A ${U.value} ${U.value} 0 ${A} 0 ${w} ${b}`,"Z"].join(" ");return l.push({path:N,color:ce(r),value:i,seriesName:s.name,opacity:.8,isHighlighted:H.value===r,isDimmed:!1,isHidden:!1,startAngle:c,endAngle:d,midAngle:u}),l}const a=t.reduce((s,{series:r})=>s+(r.data[0]||0),0);return a===0?[]:(t.forEach(({series:s,originalIndex:r})=>{const i=s.data[0]||0,c=i/a*o,d=n,u=n+c,m=d+c/2,f=te.value+Math.cos(d)*Ee.value,g=oe.value+Math.sin(d)*Ee.value,v=te.value+Math.cos(u)*Ee.value,y=oe.value+Math.sin(u)*Ee.value,k=te.value+Math.cos(u)*U.value,w=oe.value+Math.sin(u)*U.value,b=te.value+Math.cos(d)*U.value,A=oe.value+Math.sin(d)*U.value,N=c>Math.PI?1:0,T=[`M ${f} ${g}`,`A ${Ee.value} ${Ee.value} 0 ${N} 1 ${v} ${y}`,`L ${k} ${w}`,`A ${U.value} ${U.value} 0 ${N} 0 ${b} ${A}`,"Z"].join(" ");l.push({path:T,color:ce(r),value:i,seriesName:s.name,opacity:.8,isHighlighted:H.value===r,isDimmed:H.value!==null&&H.value!==r,isHidden:!1,startAngle:d,endAngle:u,midAngle:m}),n=u}),l)}),$t=e.computed(()=>!Jo.value||!xe.value?[]:Wo.value.map((t,n)=>{if(t.isHidden)return null;const o=Hn.value,l=An.value,a=Ln.value,s=te.value+Math.cos(t.midAngle)*U.value,r=oe.value+Math.sin(t.midAngle)*U.value,i=te.value+Math.cos(t.midAngle)*(U.value+o),c=oe.value+Math.sin(t.midAngle)*(U.value+o),d=Math.cos(t.midAngle)>=0,m=i+l*(d?1:-1),f=c,g=d?i+15:i-15,v=f-a,y=d?"start":"end";return{pointerStartX:s,pointerStartY:r,pointerEndX:i,pointerEndY:c,horizontalEndX:m,horizontalEndY:f,textX:g,textY:v,text:`${t.seriesName}: ${t.value}`,color:t.color,textAnchor:y,isRightSide:d,isHighlighted:t.isHighlighted,isDimmed:t.isDimmed}}).filter(Boolean)),Dt=t=>{if(!t||t.isHidden)return 0;const n=t.opacity||ao.value||.7;return H.value===null||H.value===void 0?n:H.value!==null?t.seriesIndex===H.value?Math.min(1,n+.1):Math.max(.5,n*.8):n},Xt=t=>{if(!t||t.isHidden)return 0;const n=t.radius>20?.9:.8;return H.value!==null?t.seriesIndex===H.value?Math.min(1,n+.1):n*.7:n},ro=(t,n)=>{if(t)try{if(H.value===t.seriesIndex?H.value=null:H.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const o=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:n,chartId:V.chartId}});window.dispatchEvent(o)}}catch(o){console.error("Error in onBubbleClick:",o)}},fe=(t,n)=>{const o=[`dss-bubble-fallback-${n}`];return t.isHighlighted&&o.push("dss-bubble-highlighted"),t.isDimmed&&o.push("dss-bubble-dimmed"),t.isHidden&&o.push("dss-bubble-hidden"),o.push(`dss-bubble-series-${t.seriesIndex}`),o.join(" ")},qo=(t,n)=>{t&&(n.stopPropagation(),Lo.value=!0,H.value=t.seriesIndex,R.value.show=!1)},kn=(t,n)=>{let o;switch(t){case"x":o=n.originalX;break;case"y":o=n.originalY;break;case"size":o=n.originalSize;break;case"label":o=n.label;break;case"seriesName":o=n.seriesName;break;default:o=n[t]||""}const l=Eo.value[t];return typeof l=="function"?l(o,n):typeof o=="number"?o.toFixed(1):o?.toString()||""},Yt=()=>{if(!we.value||!R.value.data||R.value.data.length===0)return"Bubbles";const t=[],n=new Set;return R.value.data.forEach(o=>{if(o.seriesName&&o.label){const l=`${o.seriesName} - ${o.label}`;n.has(l)||(t.push(l),n.add(l))}else o.seriesName&&(n.has(o.seriesName)||(t.push(o.seriesName),n.add(o.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},_t=(t,n)=>{t&&(Lo.value=!1,H.value=null)},io=(t,n)=>{const o=n.target.closest(".dss-custom-chart-container");if(!o)return;const l=o.getBoundingClientRect(),a=an(t.categoryIndex),s=t.description||t.comment||"";let r=n.clientX-l.left+15,i=n.clientY-l.top-10;const c=200,d=s?80:50;r+c>D.value&&(r=n.clientX-l.left-c-15),i+d>Z.value&&(i=n.clientY-l.top-d-10),r<0&&(r=10),i<0&&(i=10),Be.value={show:!0,x:r,y:i,categoryValue:a,description:s}},jt=()=>{Be.value.show=!1},st=e.computed(()=>V.categories.length||Math.max(...Wt.value.map(t=>t.data.length))),Zn=e.computed(()=>{let t=0;return Wt.value.forEach(n=>{n.data.forEach(o=>{typeof o=="number"&&(t=Math.max(t,o))})}),t||100}),xn=e.computed(()=>{const t=[],n=st.value;for(let o=0;o<n;o++){const l=o*2*Math.PI/n-Math.PI/2,a=te.value+Math.cos(l)*U.value,s=oe.value+Math.sin(l)*U.value;t.push({x:a,y:s,angle:l,index:o})}return t}),ho=e.computed(()=>{const t=[],n=st.value;return xn.value.forEach((o,l)=>{const a=U.value+15,s=l*2*Math.PI/n-Math.PI/2,r=te.value+Math.cos(s)*a,i=oe.value+Math.sin(s)*a+5;let c="middle",d="middle";Math.abs(Math.cos(s))>.5&&(c=Math.cos(s)>0?"start":"end"),Math.abs(Math.sin(s))>.5&&(d=Math.sin(s)>0?"hanging":"auto"),t.push({x:r,y:i,text:V.categories[l]||`Axis ${l+1}`,anchor:c,baseline:d})}),t}),wn=e.ref(new Set),yo=(t,n,o)=>{const l=`current-${o}`,a=wn.value.has(l);return!a&&H.value===null?n.fillOpacity||I.value:n.isHighlighted||a?(n.fillOpacity||I.value)+.15:n.isDimmed?(n.fillOpacity||I.value)*.3:n.fillOpacity||I.value},Xo=e.computed(()=>{if(!yt.value)return[];const t=[],n=st.value;return Ct.value.forEach((o,l)=>{const a=[],s=[],r=[],i=H.value===l,c=H.value!==null&&H.value!==l,d=re.value.has(l);for(let u=0;u<n;u++){const m=o.data[u]||0,g=m/Zn.value*U.value,v=u*2*Math.PI/n-Math.PI/2,y=te.value+Math.cos(v)*g,k=oe.value+Math.sin(v)*g;a.push(`${y},${k}`),s.push({x:y,y:k}),r.push({x:y,y:k,value:m,label:V.categories[u]||`Axis ${u+1}`,seriesName:o.name})}t.push({points:a.join(" "),polygonPoints:s,dataPoints:r,color:ce(l),fillOpacity:I.value,seriesName:o.name,value:`${o.name}: ${o.data.join(", ")}`,isHighlighted:i,isDimmed:c,isHidden:d,seriesIndex:l})}),t}),Un=(t,n)=>{if(!n||n.length<3)return!1;let o=!1;for(let l=0,a=n.length-1;l<n.length;a=l++){const s=n[l].x,r=n[l].y,i=n[a].x,c=n[a].y;r>t.y!=c>t.y&&t.x<(i-s)*(t.y-r)/(c-r)+s&&(o=!o)}return o},Wn=t=>{if(!yt.value)return;const n=t.currentTarget.closest(".dss-custom-chart-container");if(!n)return;const o=n.getBoundingClientRect(),l=W.value?.getBoundingClientRect();if(!l)return;const a=t.clientX-l.left,s=t.clientY-l.top,r=Xo.value.filter(i=>i.isHidden?!1:Un({x:a,y:s},i.polygonPoints));if(r.length>0){r.length,H.value=r[0].seriesIndex;const i=t.clientX-o.left+10,c=t.clientY-o.top-10,d=200,u=50+r.length*25;let m=i,f=c;m+d>D.value&&(m=t.clientX-o.left-d-10),f+u>Z.value&&(f=t.clientY-o.top-u-10),m<0&&(m=10),f<0&&(f=10);const g=r.map(v=>{let y=v.dataPoints[0],k=1/0;return v.dataPoints.forEach(w=>{const b=Math.sqrt(Math.pow(w.x-a,2)+Math.pow(w.y-s,2));b<k&&(k=b,y=w)}),{seriesName:v.seriesName,color:v.color,value:y.value!==void 0?y.value:v.value}});ae.value={show:!0,x:m,y:f,title:r.length===1?r[0].seriesName:"",value:"",spiderSeries:g}}else it()},Kt=e.computed(()=>{const t=S.value;return t.logos.map((n,o)=>{const l=V.series[n.seriesIndex];if(!l||!l.data||l.data.length===0||re.value.has(n.seriesIndex))return null;let a,s;if(Se.value){let i=-1,c=null;for(let u=l.data.length-1;u>=0;u--)if(l.data[u]!==null&&l.data[u]!==void 0){i=u,c=l.data[u];break}if(i===-1||c===null)return null;const d=l.data.map((u,m)=>u==null?null:{x:me(m),y:be(u),index:m}).filter(u=>u!==null);if(t.animations.enabled&&!co.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Y.value.isAnimating||!Y.value.hasAnimated))if(Y.value.isAnimating){const u=Y.value.currentFrame/Y.value.totalFrames,m=Vn(t.animations.easing,Math.min(u,1)),f=Mn(d,m);a=f.x+(n.offsetX||0),s=f.y+(n.offsetY||0)}else a=d[0].x+(n.offsetX||0),s=d[0].y+(n.offsetY||0);else a=me(i)+(n.offsetX||0),s=be(c)+(n.offsetY||0)}else if(xe.value||yt.value){const i=Math.PI*2/t.logos.length*o;a=te.value+Math.cos(i)*(U.value+30)+(n.offsetX||0),s=oe.value+Math.sin(i)*(U.value+30)+(n.offsetY||0)}return{...n,x:a,y:s,seriesIndex:n.seriesIndex}}).filter(Boolean)}),Yo=t=>{const n=document.querySelector(`.dss-logo-fallback-${t}`),o=document.querySelector(`.dss-logo-image-${t}`);n&&(n.style.opacity="0"),o&&(o.style.opacity="1")},jo=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const n=document.querySelector(`.dss-logo-image-${t}`);n&&(n.style.display="none")},En=t=>{re.value.has(t)?re.value.delete(t):re.value.add(t)},bn=e.computed(()=>{if(!ae.value.show&&!(Me.value&&R.value.show&&!E.value.isZooming))return{display:"none"};let t,n;if(Me.value&&R.value.show&&!E.value.isZooming){t=R.value.x+15,n=h.value.top;const o=we.value?200:150;t+o>D.value&&(t=R.value.x-o-15),t<0&&(t=10),n<10&&(n=10)}else t=ae.value.x,n=ae.value.y;return{left:t+"px",top:n+"px"}}),rt=(t,n)=>{if(xt.value)return;const l=n.target.closest(".dss-custom-chart-container").getBoundingClientRect();let a=n.clientX-l.left+10,s=n.clientY-l.top-10;const r=200,i=120,c=D.value,d=Z.value;a+r>c&&(a=n.clientX-l.left-r-10),s+i>d&&(s=n.clientY-l.top-i-10),a<0&&(a=10),s<0&&(s=10);let u;typeof t.categoryIndex=="number"?u=t.categoryIndex:typeof t.dataIndex=="number"?u=t.dataIndex:t.label&&V.categories.includes(t.label)&&(u=V.categories.indexOf(t.label));const m=(X.value||P.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";ae.value={show:!0,x:a,y:s,title:m,value:t.value?.toString()||"",categoryIndex:u,spiderSeries:[]}},Ao=e.ref(!1),Lo=e.ref(!1),it=()=>{ae.value.show=!1,ae.value.spiderSeries=[],R.value.show=!1,Ao.value||(H.value=null)},xt=e.ref(!1),We=(t,n)=>{xt.value=!0,ae.value.show=!1,R.value.show=!1;const l=n.target.closest(".dss-custom-chart-container").getBoundingClientRect();let a=n.clientX-l.left+15,s=n.clientY-l.top-10;const r=250;a+r>D.value&&(a=n.clientX-l.left-r-15),a<0&&(a=10),s<0&&(s=10),xo.value={show:!0,x:a,y:s,content:t.texts,count:t.totalCount}},Gt=()=>{xt.value=!1,xo.value.show=!1},Y=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Vn=(t,n)=>{switch(t){case"linear":return n;case"ease":return n<.5?2*n*n:-1+(4-2*n)*n;case"ease-in":return n*n;case"ease-out":return n*(2-n);case"ease-in-out":return n<.5?2*n*n:-1+(4-2*n)*n;default:return n}},co=e.computed(()=>lo.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Sn=()=>{if(!Ft.value||co.value){Y.value.hasAnimated=!0;return}Y.value.isAnimating=!0,Y.value.currentFrame=0,Y.value.totalFrames=Math.ceil(De.value/16.67);const t=()=>{const n=Y.value.currentFrame/Y.value.totalFrames,o=Vn(ze.value,Math.min(n,1));$o(o),n<1?(Y.value.currentFrame++,Y.value.animationId=requestAnimationFrame(t)):Ge()};Y.value.animationId=requestAnimationFrame(t)},$o=t=>{const n=document.querySelector(".dss-custom-chart-container");n&&n.style.setProperty("--dss-animation-progress",t)},Ge=()=>{Y.value.isAnimating=!1,Y.value.hasAnimated=!0,Y.value.animationId&&(cancelAnimationFrame(Y.value.animationId),Y.value.animationId=null)},qn=e.computed(()=>{if(!Ft.value||co.value||Y.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${De.value}ms`,t["--dss-animation-easing"]=Jt(ze.value),t["--dss-stagger-delay"]=`${he.value}ms`,t}),Jt=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Ko=()=>{if(!Ft.value||co.value)return"";const t=["dss-chart-animated"];return Y.value.hasAnimated||t.push(`dss-animate-${zt.value}`),Y.value.hasAnimated||(xe.value?t.push("dss-animate-fill"):t.push(`dss-animate-${zt.value}`)),Y.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>V.series,(t,n)=>{ot.value&&n&&Y.value.hasAnimated&&(Y.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Sn(),Mt.value)}))},{deep:!0}),e.watch(()=>E.value.isZooming,(t,n)=>{n&&!t&&setTimeout(()=>{sn()},50)}),e.watch(()=>[E.value.scale,E.value.offsetX],()=>{!E.value.isZooming&&!E.value.isDragging&&sn()},{flush:"post"}),e.watch([ko,tt],([t,n])=>{E.value.minScale=t,E.value.maxScale=n,(E.value.scale<t||E.value.scale>n)&&Mo()},{immediate:!0}),e.watch(()=>V.locale,t=>{t&&t!==x.value&&(x.value=t)},{immediate:!0}),e.watch(()=>Q.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Ve)}):document.removeEventListener("click",Ve)}),e.onMounted(()=>{H.value=null,Fo(),Ft.value&&!co.value?setTimeout(()=>Sn(),Mt.value):Y.value.hasAnimated=!0,document.addEventListener("mousemove",Nn),document.addEventListener("mouseup",Go),document.addEventListener("click",zo)}),e.onUnmounted(()=>{Y.value.animationId&&cancelAnimationFrame(Y.value.animationId),E.value.zoomTimeout&&clearTimeout(E.value.zoomTimeout),document.removeEventListener("mousemove",Nn),document.removeEventListener("mouseup",Go),document.removeEventListener("click",zo),document.removeEventListener("click",Ve)});const Nn=t=>{if(E.value.isDragging&&E.value.scale>1&&Se.value){R.value.show=!1;const n=t.clientX-E.value.lastMouseX,{minX:o,maxX:l}=ue.value,a=l-o||1,r=n*.8;E.value.offsetX+=r;const i=a/E.value.scale,c=a-i,d=0,u=-c/a*h.value.width,m=d;E.value.offsetX=Math.max(u,Math.min(m,E.value.offsetX)),E.value.lastMouseX=t.clientX,E.value.lastMouseY=t.clientY}},Go=()=>{E.value.isDragging&&(E.value.isDragging=!1,setTimeout(()=>{!E.value.isDragging&&E.value.isZooming},100))},Mn=(t,n)=>{const o=t.filter(i=>i!=null);if(!o||o.length===0)return{x:0,y:0};if(o.length===1||n<=0)return o[0];if(n>=1)return o[o.length-1];let l=0;const a=[];for(let i=1;i<o.length;i++){const c=o[i].x-o[i-1].x,d=o[i].y-o[i-1].y,u=Math.sqrt(c*c+d*d);a.push(u),l+=u}const s=l*n;let r=0;for(let i=0;i<a.length;i++){const c=r+a[i];if(s<=c){const d=(s-r)/a[i],u=o[i],m=o[i+1];return{x:u.x+(m.x-u.x)*d,y:u.y+(m.y-u.y)*d}}r=c}return o[o.length-1]};return(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",Ko()]),style:e.normalizeStyle({width:D.value+"px",height:Z.value+20+"px",...qn.value,cursor:Ie()}),"data-chart-type":P.value,ref_key:"containerEl",ref:C,onWheel:gt,onMousedown:zn,onMousemove:ln,onMouseup:dn,onMouseleave:$n,onDblclick:Mo,onContextmenu:e.withModifiers(Tt,["prevent"]),onClick:e.withModifiers(Ut,["left"]),onWheelCapture:gt},[e.createElementVNode("div",nl,[e.createElementVNode("div",ll,[K.value?(e.openBlock(),e.createElementBlock("div",al,e.toDisplayString(K.value),1)):e.createCommentVNode("",!0),G.value?(e.openBlock(),e.createElementBlock("div",sl,e.toDisplayString(G.value),1)):e.createCommentVNode("",!0)]),ve.value&&(Ne.value==="top"||Ne.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":uo.value==="horizontal","dss-legend-vertical":uo.value==="vertical","dss-legend-top":Ne.value==="top","dss-legend-bottom":Ne.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.series,(o,l)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${l}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":re.value.has(l),"dss-legend-hovered":H.value===l,"dss-legend-dimmed":H.value!==null&&H.value!==l}]),onClick:a=>En(l),onMouseenter:a=>on(l),onMouseleave:nn,style:e.normalizeStyle({animationDelay:`${l*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:ce(l)})},null,4),e.createElementVNode("span",il,e.toDisplayString(o.name),1)],46,rl))),128))],2)):e.createCommentVNode("",!0),ve.value&&(Ne.value==="left"||Ne.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Ne.value==="left","dss-legend-right":Ne.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.series,(o,l)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${l}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":re.value.has(l),"dss-legend-hovered":H.value===l,"dss-legend-dimmed":H.value!==null&&H.value!==l}]),onClick:a=>En(l),onMouseenter:a=>on(l),onMouseleave:nn,style:e.normalizeStyle({animationDelay:`${l*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:ce(l)})},null,4),e.createElementVNode("span",dl,e.toDisplayString(o.name),1)],46,cl))),128))],2)):e.createCommentVNode("",!0)]),B.showAddMarkerButton&&de.value.addMarker&&(Se.value||we.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:_e,title:e.unref(_)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Xe.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,ml),n[5]||(n[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,ul)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:D.value,height:Z.value,class:"dss-chart-svg","data-smooth":q.value,"data-animated":Ft.value,ref_key:"svgEl",ref:W},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",pl,[e.createElementVNode("rect",{x:h.value.left,y:h.value.top,width:h.value.width,height:h.value.height*4},null,8,vl)])]),Se.value||we.value?(e.openBlock(),e.createElementBlock("g",gl,[z.value?(e.openBlock(),e.createElementBlock("g",hl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pn.value,(o,l)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${l}`,x1:h.value.left,x2:h.value.right,y1:o.y,y2:o.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${l*50}ms`})},null,12,yl))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Cl,[e.createElementVNode("line",{x1:h.value.left,x2:h.value.right,y1:h.value.bottom,y2:h.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,kl),e.createElementVNode("line",{x1:h.value.left,x2:h.value.left,y1:h.value.top,y2:h.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,xl)]),e.createElementVNode("g",wl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oo.value,(o,l)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${l}`,x:o.x,y:o.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${l*100}ms`})},e.toDisplayString(o.text),13,El))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Po.value,(o,l)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${l}`,x:o.x,y:o.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${l*80}ms`})},e.toDisplayString(o.text),13,bl))),128)),et.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:h.value.left+h.value.width/2,y:h.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(et.value),9,Vl)):e.createCommentVNode("",!0),Co.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:h.value.top+12+h.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${h.value.top+h.value.height/2})`},e.toDisplayString(Co.value),9,Sl)):e.createCommentVNode("",!0)]),Qo.value.length>0?(e.openBlock(),e.createElementBlock("g",Nl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qo.value,o=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${o.categoryIndex}`},[e.createElementVNode("g",Ml,[o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x,y1:h.value.bottom,y2:h.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:l=>We(o,l),onMouseleave:Gt},null,40,Bl)):e.createCommentVNode("",!0),o.hasAuto&&!o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x,y1:h.value.bottom,y2:h.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:l=>We(o,l),onMouseleave:Gt},null,40,Tl)):e.createCommentVNode("",!0),o.hasAuto&&o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x,y1:h.value.bottom,y2:h.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:l=>We(o,l),onMouseleave:Gt},null,40,Hl)):e.createCommentVNode("",!0)]),o.hasManual&&o.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:o.x+8,cy:Math.max(15,h.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:l=>We(o,l),onMouseleave:Gt},null,40,Al)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:o.x,cy:Math.max(15,h.value.top-10),r:"14",fill:o.hasManual&&o.hasAuto||o.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:l=>We(o,l),onMouseleave:Gt},null,40,Ll),e.createElementVNode("text",{x:o.x,y:Math.max(15,h.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(o.totalCount),9,$l)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Dl,[Ze.value?(e.openBlock(),e.createElementBlock("g",_l,[e.createElementVNode("g",Il,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cn.value,(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${l}`},[o.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({fill:o.color,fillOpacity:o.isDimmed?.4:1,animationDelay:`${o.animationDelay}ms`}),onMouseover:a=>rt(o,a),onMouseleave:it},null,46,Rl)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:o.x,y:o.y,width:o.width,height:o.height,fill:o.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:a=>rt(o,a),onMouseleave:it},null,46,Fl))],64))),128))]),e.createElementVNode("g",zl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gn.value,(o,l)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${l}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?le.value+2:le.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${o.animationDelay}ms`})},null,14,Ol))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hn.value,(o,l)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${l}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?le.value+2:le.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:o.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Pl))),128)),se.value>0||St.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ho.value,(o,l)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${l}`,cx:o.x,cy:o.y,r:o.isHighlighted?qe(o,se.value)+2:qe(o,se.value),fill:o.color,stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass({"dss-point-highlighted":o.isHighlighted,"dss-point-dimmed":o.isDimmed,"dss-point-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:a=>rt(o,a),onMouseleave:it},null,46,Zl))),128)):e.createCommentVNode("",!0)])])):P.value==="line"?(e.openBlock(),e.createElementBlock("g",Ul,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yn.value,(o,l)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${l}`,d:o.path,stroke:o.color,"stroke-width":le.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Y.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${o.animationDelay}ms`})},null,14,Wl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gn.value,(o,l)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${l}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?le.value+2:le.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${o.animationDelay}ms`})},null,14,ql))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hn.value,(o,l)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${l}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?le.value+2:le.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:o.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Xl))),128)),se.value>0||St.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(so.value,(o,l)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${l}`,cx:o.x,cy:o.y,r:o.isHighlighted?qe(o,se.value)+2:qe(o,se.value),fill:o.color,stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass({"dss-point-highlighted":o.isHighlighted,"dss-point-dimmed":o.isDimmed,"dss-point-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:a=>rt(o,a),onMouseleave:it},null,46,Yl))),128)):e.createCommentVNode("",!0)])):P.value==="area"?(e.openBlock(),e.createElementBlock("g",jl,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Uo.value,(o,l)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${l}`,id:`area-mask-${l}-${B.chartId}`},[e.createElementVNode("rect",{x:h.value.left-10,y:h.value.top-10,width:h.value.width+20,height:h.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${h.value.width+20}px`})},null,12,Gl)],8,Kl))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Uo.value,(o,l)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${l}`,d:o.areaPath,fill:o.color,"fill-opacity":o.isHighlighted?fo.value+.2:fo.value,mask:`url(#area-mask-${l}-${B.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden})},null,10,Jl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Uo.value,(o,l)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${l}`,d:o.linePath,stroke:o.color,"stroke-width":o.isHighlighted?le.value+1:le.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${l*he.value}ms`})},null,14,Ql))),128))])):P.value==="bar"?(e.openBlock(),e.createElementBlock("g",ea,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cn.value,(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${l}`},[o.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.barPath,fill:o.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:a=>rt(o,a),onMouseleave:it},null,46,ta)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:o.x,y:o.y,width:o.width,height:o.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({fill:o.color,fillOpacity:o.isDimmed?.4:1,animationDelay:`${o.animationDelay}ms`}),onMouseover:a=>rt(o,a),onMouseleave:it},null,46,oa))],64))),128))])):e.createCommentVNode("",!0)]),Me.value&&R.value.show&&!E.value.isZooming?(e.openBlock(),e.createElementBlock("g",na,[e.createElementVNode("line",{x1:R.value.x,x2:R.value.x,y1:h.value.top,y2:h.value.bottom,stroke:mo.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,la),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value.data,(o,l)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${l}`,cx:R.value.x,cy:o.y,r:se.value+2,fill:o.color,stroke:"#fafafa","stroke-width":"2",opacity:"0.9"},null,8,aa))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),we.value?(e.openBlock(),e.createElementBlock("g",sa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt.value,(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${l}`},[o?(e.openBlock(),e.createElementBlock("g",ra,[e.createElementVNode("circle",{cx:o.x,cy:o.y,r:o.radius,fill:o.color,"fill-opacity":Dt(o),stroke:o.color,"stroke-width":o.isHighlighted?3:1,"stroke-opacity":"0.8",class:e.normalizeClass(fe(o,l)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:a=>qo(o,a),onMouseleave:a=>_t(o),onClick:a=>ro(o,a)},null,42,ia),o.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:o.x-o.radius*.65,y:o.y-o.radius*.65,width:o.radius*1.3,height:o.radius*1.3,"xlink:href":o.imageUrl,class:e.normalizeClass(`dss-bubble-image-${l} ${o.isHighlighted?"dss-bubble-highlighted":""} ${o.isDimmed?"dss-bubble-dimmed":""} ${o.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${o.radius*.65}px at ${o.radius*.65}px ${o.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:Xt(o)}),onLoad:a=>mn(l),onError:a=>fn(l),onMouseenter:a=>qo(o,a),onMouseleave:a=>_t(o),onClick:a=>ro(o,a)},null,46,ca)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),xe.value?(e.openBlock(),e.createElementBlock("g",da,[P.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:te.value,cy:oe.value,r:U.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,ua)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":P.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wo.value,(o,l)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${l}`,d:o.path,fill:o.color,"fill-opacity":o.isHighlighted?(o.opacity||.8)+.2:o.opacity||.8,stroke:o.color,"stroke-width":o.isHighlighted?2:1,class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),onMouseover:a=>rt(o,a),onMouseleave:it},null,42,fa))),128))],8,ma),Jo.value?(e.openBlock(),e.createElementBlock("g",pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($t.value,(o,l)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${l}`,class:e.normalizeClass({"dss-label-highlighted":o.isHighlighted,"dss-label-dimmed":o.isDimmed})},[e.createElementVNode("line",{x1:o.pointerStartX,y1:o.pointerStartY,x2:o.pointerEndX,y2:o.pointerEndY,stroke:o.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({animationDelay:`${l*100}ms`})},null,12,va),e.createElementVNode("line",{x1:o.pointerEndX,y1:o.pointerEndY,x2:o.horizontalEndX,y2:o.horizontalEndY,stroke:o.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({animationDelay:`${l*120}ms`})},null,12,ga),e.createElementVNode("text",{x:o.textX,y:o.textY,"text-anchor":o.textAnchor,"font-size":vt.value,"dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${l*150}ms`})},e.toDisplayString(o.text),13,ha)],2))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),yt.value?(e.openBlock(),e.createElementBlock("g",ya,[z.value?(e.openBlock(),e.createElementBlock("g",Ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,(o,l)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${l}`,cx:te.value,cy:oe.value,r:o,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${l*150}ms`})},null,12,ka))),128)),e.createElementVNode("g",xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,(o,l)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${l}`},[e.createElementVNode("rect",{x:te.value-16,y:oe.value-o-7,width:"32",height:"16",fill:"#fafafa",stroke:"none"},null,8,wa),e.createElementVNode("text",{x:te.value,y:oe.value-o+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Bt(l)),9,Ea)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xn.value,(o,l)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${l}`,x1:te.value,x2:o.x,y1:oe.value,y2:o.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${l*100}ms`})},null,12,ba))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Va,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ho.value,(o,l)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${l}`,x:o.x+Math.cos(l*2*Math.PI/st.value-Math.PI/2)*16,y:o.y+Math.sin(l*2*Math.PI/st.value-Math.PI/2)*16,"text-anchor":o.anchor,"dominant-baseline":o.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${l*120}ms`})},e.toDisplayString(o.text.charAt(0).toUpperCase()+o.text.slice(1)),13,Sa))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Wn,onMouseleave:it},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xo.value,(o,l)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${l}`},[e.createElementVNode("polygon",{points:o.points,fill:o.color,"fill-opacity":yo("current",o,l),stroke:o.color,"stroke-width":o.isHighlighted?le.value+1:le.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${l*he.value}ms`,transition:"all 0.2s ease"})},null,14,Na),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.dataPoints,(a,s)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${l}-${s}`,cx:a.x,cy:a.y,r:o.isHighlighted?se.value+1:se.value>0?se.value:0,fill:o.color,stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass({"dss-point-highlighted":o.isHighlighted,"dss-point-dimmed":o.isDimmed,"dss-point-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${l*he.value+s*50}ms`,transition:"all 0.2s ease"}),onMouseover:r=>rt(a,r),onMouseleave:it},null,46,Ma))),128))]))),128))],32)])):e.createCommentVNode("",!0),e.createElementVNode("g",Ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Kt.value,(o,l)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${l}`,cx:o.x,cy:o.y,r:o.width/2,fill:ce(o.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${l}`),style:e.normalizeStyle({animationDelay:`${l*200}ms`})},null,14,Ta))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Kt.value,(o,l)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${l}`,x:o.x-o.width/2,y:o.y-o.height/2,width:o.width,height:o.height,"xlink:href":o.url,onLoad:a=>Yo(l),onError:a=>jo(l),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${l}`),"clip-path":`circle(${o.width/2}px at ${o.width/2}px ${o.height/2}px)`,style:e.normalizeStyle({animationDelay:`${l*200}ms`})},null,46,Ha))),128))])],8,fl)),Ye.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:D.value+"px",height:Z.value+"px",backgroundImage:`url('${_o.value}')`,backgroundRepeat:"no-repeat",...pt.value,opacity:lt.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ut.value,(o,l)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+o.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:o.x+"px",top:o.y+"px",width:J.value+"px",height:J.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(a=>ee(o),["stop"]),onMouseenter:a=>io(o,a),onMouseleave:jt},[e.createElementVNode("img",{src:go(o),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,La)],44,Aa)),[[e.vShow,dt.value]])),128)),Be.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Be.value.x+"px",top:Be.value.y+"px"})},[e.createElementVNode("div",$a,e.toDisplayString(Be.value.categoryValue),1),Be.value.description?(e.openBlock(),e.createElementBlock("div",Da,e.toDisplayString(Be.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),ae.value.show||Me.value&&R.value.show&&!E.value.isZooming?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Me.value&&R.value.show&&!E.value.isZooming}]),style:e.normalizeStyle(bn.value)},[!Me.value||!R.value.show||E.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[yt.value&&ae.value.spiderSeries&&ae.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",_a,[ae.value.title?(e.openBlock(),e.createElementBlock("div",Ia,e.toDisplayString(ae.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value.spiderSeries,(o,l)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${l}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",Ra,e.toDisplayString(o.seriesName)+":",1),e.createElementVNode("span",Fa,e.toDisplayString(o.value),1)]))),128))])):(e.openBlock(),e.createElementBlock("div",za,[e.createElementVNode("div",Oa,e.toDisplayString(ae.value.title),1),e.createElementVNode("div",Pa,e.toDisplayString(ae.value.value),1)])),ae.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[at(ae.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Za,[n[6]||(n[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ua,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at(ae.value.categoryIndex).flagGroups,(o,l)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${l}`},[e.createElementVNode("div",Wa,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(o.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.flags,(a,s)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${l}-${s}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",qa,[e.createElementVNode("div",Xa,e.toDisplayString(a.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),at(ae.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ya,[n[7]||(n[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ja,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at(ae.value.categoryIndex).markers,(o,l)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${l}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("div",Ka,[e.createElementVNode("div",Ga,e.toDisplayString(o.title),1),o.description?(e.openBlock(),e.createElementBlock("div",Ja,e.toDisplayString(o.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",Qa,[e.createElementVNode("div",es,e.toDisplayString(we.value?Yt():B.categories[R.value.categoryIndex]||`Category ${R.value.categoryIndex+1}`),1),we.value?(e.openBlock(),e.createElementBlock("div",ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value.data,(o,l)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${l}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(o.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(R.value.data,(o,l)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${l}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",os,e.toDisplayString(o.seriesName)+":",1),e.createElementVNode("span",ns,e.toDisplayString(o.value),1)]))),128))]),at(R.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",ls,[n[8]||(n[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",as,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at(R.value.categoryIndex).flagGroups,(o,l)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${l}`},[e.createElementVNode("div",ss,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(o.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.flags,(a,s)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${l}-${s}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",rs,[e.createElementVNode("div",is,e.toDisplayString(a.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),at(R.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",cs,[n[9]||(n[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ds,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at(R.value.categoryIndex).markers,(o,l)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${l}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("div",us,[e.createElementVNode("div",ms,e.toDisplayString(o.title),1),o.description?(e.openBlock(),e.createElementBlock("div",fs,e.toDisplayString(o.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Se.value&&Fe.value&&E.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Mo},[n[10]||(n[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(E.value.scale*100))+"% "+e.toDisplayString(e.unref(_)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,ol),Q.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:Q.value.x+"px",top:Q.value.y+"px"}),onClick:n[0]||(n[0]=e.withModifiers(()=>{},["stop"]))},[de.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Lt},e.toDisplayString(e.unref(_)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),de.value.addMarker&&(de.value.downloadSvg||de.value.downloadPng||de.value.downloadCsv||Pe.value.length>0)?(e.openBlock(),e.createElementBlock("div",ps)):e.createCommentVNode("",!0),de.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:No},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),de.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:At},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),de.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Rn},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Pe.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[de.value.downloadSvg||de.value.downloadPng||de.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",vs)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value,(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+l},[o.separator?(e.openBlock(),e.createElementBlock("div",gs)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Io(o)),style:e.normalizeStyle(_n(o)),onClick:a=>Fn(o)},[o.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Dn(o),class:"dss-custom-menu-content"},null,8,ys)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.icon?(e.openBlock(),e.createElementBlock("span",Cs,e.toDisplayString(o.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(o.label),1)],64))],14,hs)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),$.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:Te},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:n[4]||(n[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",ks,[e.createElementVNode("h3",null,e.toDisplayString(Zt.value?e.unref(_)("chart.modalMarker.viewMarker"):Pt.value?e.unref(_)("chart.modalMarker.editMarker"):e.unref(_)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Te},"×")]),e.createElementVNode("div",xs,[e.createElementVNode("div",ws,[$.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Es,e.toDisplayString(an($.value.categoryIndex)||""),1)),$.value.fromButton?(e.openBlock(),e.createElementBlock("div",bs,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":n[1]||(n[1]=o=>$.value.categoryIndex=o),class:"dss-form-select",disabled:Zt.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn.value,(o,l)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${l}`,value:l},e.toDisplayString(o),9,Ss))),128))],8,Vs),[[e.vModelSelect,$.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ns,[e.createElementVNode("label",Ms,e.toDisplayString(e.unref(_)("chart.modalMarker.description")),1),Zt.value?(e.openBlock(),e.createElementBlock("div",Bs,e.toDisplayString($.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":n[2]||(n[2]=o=>$.value.description=o),placeholder:e.unref(_)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,Ts)),[[e.vModelText,$.value.description]])]),e.createElementVNode("div",Hs,[e.createElementVNode("label",null,e.toDisplayString(e.unref(_)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",As,[e.createElementVNode("img",{src:go({type:$.value.type}),alt:"Marker Icon Preview",class:"preview-icon",style:{width:"32px",height:"32px","border-radius":"50%",border:"2px solid #ddd"},onError:n[3]||(n[3]=o=>o.target.style.display="none")},null,40,Ls)])])]),e.createElementVNode("div",$s,[e.createElementVNode("div",Ds,[Pt.value&&!Zt.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:Vo},e.toDisplayString(e.unref(_)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",_s,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Te},e.toDisplayString(Zt.value?e.unref(_)("chart.modalMarker.close"):e.unref(_)("chart.modalMarker.cancel")),1),Zt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:je,disabled:!($.value.description&&$.value.description.length)},e.toDisplayString(Pt.value?e.unref(_)("chart.modalMarker.save"):e.unref(_)("chart.contextMenu.addMarker")),9,Is))])])])])):e.createCommentVNode("",!0)],64))}}),zs={class:"dss-modal-title"},Os={class:"dss-modal-actions"},Xn={__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(B,{emit:It}){const _=B,x=It,ct=e.ref(null),C=e.ref(null),W=e.computed(()=>{const D={"max-width":_.width};return _.height!=="auto"&&(D.height=_.height,D["min-height"]="0"),D}),bt=e.computed(()=>({}));function V(){x("close-modal")}function p(){_.backDrop&&!ct.value&&x("close-modal")}function He(D){D.target.tagName==="INPUT"&&(ct.value=D.target.tagName)}function $e(){setTimeout(()=>{ct.value=null},300)}function Re(){const D=document.body,Z=document.documentElement;C.value={bodyOverflow:D.style.overflow,bodyPosition:D.style.position,bodyTop:D.style.top,bodyWidth:D.style.width,htmlOverflow:Z.style.overflow,scrollY:window.scrollY},D.style.overflow="hidden",D.style.position="fixed",D.style.top=`-${C.value.scrollY}px`,D.style.width="100%",D.style.left="0",Z.style.overflow="hidden"}function S(){if(!C.value)return;const D=document.body,Z=document.documentElement,{bodyOverflow:P,bodyPosition:Qe,bodyTop:K,bodyWidth:G,htmlOverflow:et,scrollY:Co}=C.value;D.style.overflow=P||"",D.style.position=Qe||"",D.style.top=K||"",D.style.width=G||"",D.style.left="",Z.style.overflow=et||"",window.scrollTo(0,Co||0)}return e.watch(()=>_.showModal,D=>{if(D)Re(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const Z=document.getElementById("dss-modal-backdrop");Z&&(Z.addEventListener("focusin",He),Z.addEventListener("focusout",$e))},100);else{S(),document.body.classList.remove("dss-modal-open");const Z=document.getElementById("dss-modal-backdrop");Z&&(Z.removeEventListener("focusin",He),Z.removeEventListener("focusout",$e))}},{immediate:!0}),e.onUnmounted(()=>{_.showModal&&S()}),(D,Z)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[B.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:p},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(W.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:Z[0]||(Z[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":B.headerType,"font-size":B.titleSize})},[e.createElementVNode("h1",zs,[e.renderSlot(D.$slots,"title",{},()=>[Z[1]||(Z[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(D.$slots,"title-data"),B.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:V,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(bt.value)},[e.renderSlot(D.$slots,"content",{},()=>[Z[2]||(Z[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Os,[e.renderSlot(D.$slots,"actions")])])],4),[[e.vShow,B.showModal]])])):e.createCommentVNode("",!0)]))}},Ps={class:"dss-toolbar-left"},Zs=["title"],Us=["title"],Ws={class:"dss-toolbar-dropdown-wrapper"},qs=["title"],Xs={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"},Ys={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"},js={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"},Ks={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"},Gs={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"},Js={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"},Qs={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},er=["title"],tr=["title"],or=["title"],nr=["title"],lr=["title"],ar=["title"],sr=["title"],rr=["title"],ir=["title"],cr={key:2,class:"dss-toolbar-separator"},dr=["title"],ur={key:4,class:"dss-toolbar-separator"},mr={key:5,class:"dss-toolbar-dropdown-wrapper"},fr=["title"],pr={class:"dss-toolbar-dropdown-ai"},vr={class:"dss-toolbar-right"},gr={key:0,class:"dss-toolbar-custom-group"},hr={key:1,class:"dss-toolbar-separator"},yr={class:"dss-link-modal-content"},Cr={class:"dss-link-modal-field"},kr={class:"dss-link-modal-label"},xr=["placeholder"],wr={class:"dss-link-modal-field"},Er={class:"dss-link-modal-label"},br=["placeholder"],Vr={class:"dss-image-modal-tabs"},Sr={key:0,class:"dss-image-tab-content"},Nr={class:"dss-link-modal-content"},Mr={class:"dss-link-modal-field"},Br={key:0,class:"dss-link-modal-label"},Tr=["src"],Hr={class:"dss-link-modal-field"},Ar={class:"dss-link-modal-label"},Lr=["placeholder"],$r={class:"dss-link-modal-field"},Dr={class:"dss-link-modal-label"},_r=["placeholder"],Ir={class:"dss-link-modal-field"},Rr={class:"dss-link-modal-label"},Fr=["placeholder"],zr={key:1,class:"dss-image-tab-content"},Or={class:"dss-link-modal-content"},Pr={class:"dss-link-modal-field"},Zr={class:"dss-link-modal-label"},Ur=["placeholder"],Wr={class:"dss-link-modal-field"},qr={class:"dss-link-modal-label"},Xr=["placeholder"],Yr={class:"dss-link-modal-field"},jr={class:"dss-link-modal-label"},Kr=["placeholder"],Gr={class:"dss-link-modal-field"},Jr={class:"dss-link-modal-label"},Qr=["placeholder"],ei={class:"dss-text-editor-title-input-container"},ti={key:0,class:"dss-text-editor-title-preview"},oi={key:0},ni={key:1,class:"dss-text-editor-preview-placeholder"},li=["value","placeholder","disabled"],ai={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},si={class:"dss-text-editor-description-input-container"},ri={key:0,class:"dss-text-editor-description-preview"},ii={key:0},ci={key:1,class:"dss-text-editor-preview-placeholder"},di=["value","placeholder","disabled"],ui={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},mi=["data-comment-id","onMouseenter"],fi=["onClick"],pi=["src","alt"],vi={key:1},gi=["onClick"],hi=["src","alt"],yi={key:1},Ci=["data-has-second-user","onClick"],ki={class:"editor-comment-marker-count"},xi={key:4,class:"dss-text-editor-textarea-wrapper"},wi=["value","placeholder","rows","disabled"],Ei={class:"dss-text-editor-footer"},bi={class:"dss-text-editor-footer-content"},Vi={class:"dss-text-editor-footer-stat"},Si={class:"dss-text-editor-footer-stat"},Ni={key:5,class:"dss-text-editor-content-wrapper"},Mi={key:0,class:"dss-comment-overlay-body"},Bi={class:"dss-comment-selection-wrapper"},Ti=["innerHTML"],Hi={class:"dss-comment-messages-wrapper"},Ai={key:0,class:"dss-comment-avatar-wrapper"},Li={class:"dss-comment-avatar"},$i=["src","alt"],Di={key:1},_i={class:"dss-comment-header"},Ii={class:"dss-comment-header-text"},Ri={class:"dss-comment-author"},Fi={key:0,class:"dss-comment-date"},zi=["onClick","title"],Oi={class:"dss-comment-overlay-inner"},Pi=["placeholder","onKeydown"],Zi={class:"dss-text-editor-footer"},Ui={class:"dss-text-editor-footer-content"},Wi={class:"dss-text-editor-footer-stat"},qi={class:"dss-text-editor-footer-stat"},Xi=["title"],Yi=["title"],ji={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:""},Ki={class:"dss-image-popup-content"},Gi={key:0,class:"dss-image-popup-no-alt-icon"},Ji=["title"],Qi=["title"],ec={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:""},tc={class:"dss-toolbar-left"},oc=["title"],nc=["title"],lc={class:"dss-toolbar-dropdown-wrapper"},ac=["title"],sc={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"},rc={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"},ic={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"},cc={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"},dc={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"},uc={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"},mc={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},fc=["title"],pc=["title"],vc=["title"],gc=["title"],hc=["title"],yc=["title"],Cc=["title"],kc=["title"],xc=["title"],wc=["title"],Ec={key:2,class:"dss-toolbar-separator"},bc={key:3,class:"dss-toolbar-dropdown-wrapper"},Vc=["title"],Sc={class:"dss-toolbar-dropdown-ai"},Nc={key:0,class:"dss-toolbar-right"},Mc={key:0,class:"dss-toolbar-separator"},Bc={key:0,class:"dss-toolbar-custom-group"},Tc={key:1,class:"dss-toolbar-separator"},Hc={name:"DSSTextEditor"},Ac=Object.assign(Hc,{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:B=>typeof B=="object"&&B!==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:B=>typeof B=="object"&&B!==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(B,{expose:It,emit:_}){const{t:x,locale:ct}=Kn.useI18n(),C=B,W=_,bt=e.useSlots(),V=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
73
+ `,l+="Category",N.series.forEach(n=>{const a=n.name.replace(/"/g,'""');l+=',"'+a+'"'}),l+=`
74
+ `;const u=Math.max(...N.series.map(n=>n.data?.length||0));for(let n=0;n<u;n++){let c='"'+(N.categories[n]||F("chart.fallback.item",{number:n+1})).toString().replace(/"/g,'""')+'"';N.series.forEach(i=>{const d=i.data&&i.data[n]!==void 0?i.data[n]:"";c+=","+d}),l+=c+`
75
+ `}const s=new Blob([l],{type:"text/csv;charset=utf-8;"}),t=URL.createObjectURL(s),o=document.createElement("a");o.href=t,o.download=no("csv"),document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(t),Re()}catch(l){console.error("Error downloading CSV:",l)}},_n=l=>{if(typeof l.action=="function"){const u={series:N.series,categories:N.categories,markers:ge.value},s={chartX:oe.value.chartX,chartY:oe.value.chartY,dataX:oe.value.mouseDataX,dataY:oe.value.mouseDataY,categoryIndex:clampedCategoryIndex||oe.value.categoryIndex};l.action(u,s)}Re()},In=()=>{be(),$.value.show=!0,$.value.categoryIndex=oe.value.categoryIndex,$.value.fromButton=!1,Re()},Tt=()=>{be(),$.value.show=!0,$.value.categoryIndex=0,$.value.fromButton=!0},$e=l=>{if(oe.value.show){const u=document.querySelector(".dss-context-menu");u&&!u.contains(l.target)&&(oe.value.show=!1)}},Ho=l=>{oe.value.show&&!l.target.closest(".context-menu")&&(oe.value.show=!1)},Ve=l=>{if(!Se.value||!Pe.value)return;l.preventDefault(),l.stopPropagation(),S.value.isZooming=!0,I.value.show=!1,S.value.zoomTimeout&&clearTimeout(S.value.zoomTimeout);const s=l.currentTarget.getBoundingClientRect(),t=l.clientX-s.left,o=l.clientY-s.top;if(t<k.value.left-50||t>k.value.right+50||o<k.value.top-50||o>k.value.bottom+100){S.value.isZooming=!1;return}const n=l.deltaY>0?.9:1.1,a=Math.max(S.value.minScale,Math.min(S.value.maxScale,S.value.scale*n));if(a!==S.value.scale){const{minX:r,maxX:c}=ue.value,i=c-r||1,d=i/S.value.scale,m=r-S.value.offsetX/k.value.width*i,p=(t-k.value.left)/k.value.width,g=m+p*d;S.value.scale=a;const h=i/S.value.scale,f=g-p*h;S.value.offsetX=-(f-r)/i*k.value.width,S.value.scale<=1.01&&(S.value.scale=1,S.value.offsetX=0)}S.value.zoomTimeout=setTimeout(()=>{S.value.isZooming=!1,S.value.zoomTimeout=null},300)},Ht=l=>{if(!Se.value||!Pe.value||S.value.scale<=1)return;I.value.show=!1;const s=l.currentTarget.getBoundingClientRect();l.clientX-s.left,l.clientY-s.top,S.value.isDragging=!0,S.value.lastMouseX=l.clientX,S.value.lastMouseY=l.clientY,l.preventDefault()},Rn=()=>{S.value.isDragging=!1},Ao=()=>{!Se.value||!Pe.value||(S.value.scale=1,S.value.offsetX=0,S.value.isDragging=!1,S.value.zoomTimeout&&(clearTimeout(S.value.zoomTimeout),S.value.zoomTimeout=null),S.value.isZooming=!1)},rn=()=>!Se.value||!No.value||!Pe.value?"default":S.value.isDragging?"grabbing":S.value.scale>1?"grab":"dss-crosshair",He=l=>{if(l.length<2)return"";if(l.length===2)return`M ${l[0].x} ${l[0].y} L ${l[1].x} ${l[1].y}`;let u=`M ${l[0].x} ${l[0].y}`;for(let s=0;s<l.length-1;s++){const t=l[Math.max(s-1,0)],o=l[s],n=l[s+1],a=l[Math.min(s+2,l.length-1)],r=o.x+(n.x-t.x)/6*Et.value,c=o.y+(n.y-t.y)/6*Et.value,i=n.x-(a.x-o.x)/6*Et.value,d=n.y-(a.y-o.y)/6*Et.value;u+=` C ${r} ${c} ${i} ${d} ${n.x} ${n.y}`}return u},vt=e.computed(()=>{let u=50+(tt.value?30:0)+60;if(Ce.value)return{left:90,top:90,right:90,bottom:90};if(At.value){let a=0;J.value&&(a+=15),Q.value&&(a+=10);const r=De();let c=66,i=50;return ye.value&&Be.value==="left"?c+=r.legendWidth||150:ye.value&&Be.value==="right"&&(i+=r.legendWidth||150),{left:c,top:50+a,right:i,bottom:130}}let s=0;J.value&&(s+=15),Q.value&&(s+=10);const t=De();let o=66,n=50;return ye.value&&Be.value==="left"?o+=t.legendWidth||150:ye.value&&Be.value==="right"&&(n+=t.legendWidth||150),ye.value&&Be.value==="bottom"&&(u+=t.legendHeight||0),{left:o,top:50+s,right:n,bottom:u}}),k=e.computed(()=>({left:vt.value.left,top:vt.value.top,right:D.value-vt.value.right,bottom:W.value-vt.value.bottom,width:D.value-(vt.value.left+vt.value.right),height:W.value-(vt.value.top+vt.value.bottom)})),Se=e.computed(()=>["line","area","bar"].includes(P.value)||et.value),qe=e.computed(()=>et.value),At=e.computed(()=>["radial","semi-radial"].includes(P.value)),Ce=e.computed(()=>P.value==="spider"),ke=e.computed(()=>P.value==="bubble"),Ae=e.computed(()=>T.value?.chart?.orientation==="horizontal"&&(P.value==="bar"||qe.value)),ce=l=>{const{minY:u,maxY:s}=ue.value,t=s-u||1;return k.value.left+(l-u)/t*k.value.width},Fe=l=>{const{maxX:u}=ue.value,s=u+1,o=k.value.height/s;return k.value.top+(l+.5)*o},ie=e.computed(()=>D.value/2),ne=e.computed(()=>Ce.value?W.value/2-40:W.value/2),Z=e.computed(()=>{if(Ce.value){const l=k.value.width-80,u=k.value.height-80;return Math.min(l,u)/2}return Math.min(k.value.width,k.value.height)/2}),Ee=e.computed(()=>Z.value*.45),rt=e.computed(()=>T.value?.bubbles?.minSize||8),ze=e.computed(()=>T.value?.bubbles?.maxSize||50),Lo=e.computed(()=>T.value?.bubbles?.opacity||.7),lo=(l,u)=>{const s=[15,20,25,18,22],t=s[l%s.length]||20,o=1+Math.sin(u*.5)*.2;return Math.max(5,t*o)},Fn=l=>{const u=document.querySelector(`.dss-bubble-image-${l}`);u&&(u.style.opacity="1")},cn=l=>{const u=document.querySelector(`.dss-bubble-image-${l}`);u&&(u.style.display="none")},it=e.computed(()=>N.series),qt=e.computed(()=>N.series.filter((l,u)=>!re.value.has(u))),Lt="auto",ue=e.computed(()=>{if(ke.value)return zn();if(!qt.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let l=1/0,u=-1/0,s=0;qt.value.forEach(r=>{r.data&&r.data.length&&(s=Math.max(s,r.data.length-1),r.data.forEach(c=>{typeof c=="number"&&(l=Math.min(l,c),u=Math.max(u,c))}))}),N.categories.length>0&&(s=Math.max(s,N.categories.length-1)),l===1/0&&(l=0,u=100);const t=de.value,o=xt.value;let n,a;if(t===Lt){const r=u-l,c=r>0?r*.1:1;n=Math.max(0,l-c)}else if(typeof t=="number")n=t;else{const r=u-l,c=r>0?r*.1:1;n=Math.max(0,l-c)}if(o===Lt){const r=u-l,c=r>0?r*.1:2;a=u+c}else if(typeof o=="number")a=o;else{const r=u-l,c=r>0?r*.1:2;a=u+c}return{minX:0,maxX:s,minY:n,maxY:a}}),zn=()=>{if(!qt.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let l=1/0,u=-1/0,s=1/0,t=-1/0,o=1/0,n=-1/0,a=!1;if(qt.value.forEach((g,h)=>{g?.data?.length&&g.data.forEach((f,C)=>{let y,x,E;if(typeof f=="object"&&f!==null&&!Array.isArray(f))y=typeof f.x=="number"?f.x:C,x=typeof f.y=="number"?f.y:0,E=typeof f.size=="number"?f.size:20;else if(Array.isArray(f)&&f.length>=3)y=typeof f[0]=="number"?f[0]:C,x=typeof f[1]=="number"?f[1]:0,E=typeof f[2]=="number"?f[2]:20;else if(typeof f=="number")y=C,x=f,E=lo(h,C);else return;isFinite(y)&&isFinite(x)&&isFinite(E)&&(l=Math.min(l,y),u=Math.max(u,y),s=Math.min(s,x),t=Math.max(t,x),o=Math.min(o,E),n=Math.max(n,E),a=!0)})}),!a)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};l===u&&(l=Math.min(l,0),u=Math.max(u,N.categories?.length-1||8)),s===t&&(s=Math.max(0,s-10),t=s+20);const r=u-l,c=t-s;let i,d,m,p;return Ot.value!==null?i=Ot.value:i=l-r*.1,Jt.value!==null?d=Jt.value:d=u+r*.1,de.value!==null&&typeof de.value=="number"?m=de.value:m=Math.max(0,s-c*.1),xt.value!==null&&typeof xt.value=="number"?p=xt.value:p=t+c*.1,{minX:i,maxX:d,minY:m,maxY:p,minSize:o,maxSize:n}},he=l=>{if(ke.value){const{minX:r,maxX:c}=ue.value,i=c-r||1;return k.value.left+(l-r)/i*k.value.width}const{minX:u,maxX:s}=ue.value,t=s-u;if(s===0||t===0)return k.value.left+k.value.width/2;const o=t/S.value.scale,n=u-S.value.offsetX/k.value.width*t,a=(l-n)/o;return k.value.left+a*k.value.width},Ne=l=>{const{minY:u,maxY:s}=ue.value,t=s-u||1;return k.value.bottom-(l-u)/t*k.value.height},qo=l=>{if(!ke.value)return se.value||4;const{minSize:u,maxSize:s}=ue.value,t=s-u||1;if(t===0)return(rt.value+ze.value)/2;const o=(l-u)/t;return rt.value+o*(ze.value-rt.value)},dn=e.computed(()=>Yo.value.map(l=>({y:l.y}))),Xo=e.computed(()=>{if(ke.value)return On();if(P.value==="bar"){if(Ae.value){const V=[],{minY:M,maxY:H}=ue.value,B=5,_=H-M||1;for(let R=0;R<=B;R++){const q=M+_*(R/B),G=ce(q);V.push({x:G,y:k.value.bottom+20,text:Math.round(q).toString()})}return V}const h=[],{maxX:f}=ue.value,C=f+1,y=5,E=(k.value.width-y*2)/C;for(let V=0;V<=f;V++){const M=k.value.left+y+(V+.5)*E;h.push({x:M,y:k.value.bottom+20,text:N.categories[V]||F("chart.fallback.item",{number:V+1})})}return h}const l=[],{minX:u,maxX:s}=ue.value,t=s-u||1,o=t/S.value.scale,n=u-S.value.offsetX/k.value.width*t,a=n+o,r=Math.max(0,Math.floor(n-2)),c=Math.min(s,Math.ceil(a+2)),i=c-r,d=k.value.width,p=Math.floor(d/60);let g=1;i>p&&(g=Math.ceil(i/p));for(let h=r;h<=c;h+=g)if(h>=0&&h<=s){const f=he(h);f>=k.value.left-100&&f<=k.value.right+100&&l.push({x:f,y:k.value.bottom+20,text:N.categories[h]||`Item ${h+1}`})}return l}),On=()=>{const l=[],{minX:u,maxX:s}=ue.value,t=s-u||1,o=Math.min(8,Math.max(4,Math.floor(k.value.width/80)));for(let n=0;n<=o;n++){const a=u+t*n/o,r=he(a);if(r>=k.value.left-10&&r<=k.value.right+10){const c=Math.round(a),i=N.categories?.[c];l.push({x:r,y:k.value.bottom+20,text:i||(Number.isInteger(a)?a.toString():a.toFixed(1))})}}return l},Yo=e.computed(()=>{if(Ae.value){const o=[],{maxX:n}=ue.value;for(let a=0;a<=n;a++)o.push({x:k.value.left-10,y:Fe(a),text:N.categories[a]||`Item ${a+1}`});return o}const l=[],{minY:u,maxY:s}=ue.value,t=5;for(let o=0;o<=t;o++){const n=u+(s-u)*(o/t),a=Math.round(n);l.push({x:k.value.left-10,y:Ne(n),text:a.toString()})}return l}),me=l=>{const u=Qt.value;if(!u||u.length===0){const s=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return s[l%s.length]}return u[l%u.length]},$o=l=>{let u=0;for(let s=1;s<l.length;s++){const t=l[s].x-l[s-1].x,o=l[s].y-l[s-1].y;u+=Math.sqrt(t*t+o*o)}return u},un=e.computed(()=>P.value==="line"||qe.value?(qe.value?N.series.filter(u=>(u.type||P.value)==="line"):it.value).map((u,s)=>{const t=N.series.findIndex(m=>m===u),o=[];let n=[];u.data.forEach((m,p)=>{m==null?n.length>0&&(o.push([...n]),n=[]):n.push({x:Ae.value?ce(m):he(p),y:Ae.value?Fe(p):Ne(m),index:p})}),n.length>0&&o.push(n);let a="";o.forEach(m=>{if(m.length>0){let p="";Y.value?p=He(m):p=`M ${m[0].x} ${m[0].y}`+m.slice(1).map(g=>` L ${g.x} ${g.y}`).join(""),a+=(a?" ":"")+p}});const r=o.reduce((m,p)=>m+$o(p),0),c=re.value.has(t),i=L.value===t,d=L.value!==null&&L.value!==t;return{path:a,color:me(t),pathLength:r,seriesIndex:t,animationDelay:s*xe.value,isHighlighted:i,isDimmed:d,isHidden:c}}):[]),mn=e.computed(()=>{if(!(P.value==="line"||qe.value))return[];const l=qe.value?N.series.filter(s=>(s.type||P.value)==="line"):it.value,u=[];return l.forEach((s,t)=>{const o=N.series.findIndex(n=>n===s);for(let n=0;n<s.data.length-1;n++){const a=s.data[n];if(a!=null){let r=-1,c=0;for(let i=n+1;i<s.data.length;i++){const d=s.data[i];if(d==null)c++;else{r=i;break}}if(c>0&&r!==-1){const i=s.data[r],d=Ae.value?ce(a):he(n),m=Ae.value?Fe(n):Ne(a),p=Ae.value?ce(i):he(r),g=Ae.value?Fe(r):Ne(i),h=re.value.has(o),f=L.value===o,C=L.value!==null&&L.value!==o;u.push({path:`M ${d} ${m} L ${p} ${g}`,color:me(o),seriesIndex:o,animationDelay:t*xe.value,isHighlighted:f,isDimmed:C,isHidden:h,gapSize:c}),n=r-1}}}}),u}),Pn=e.computed(()=>P.value==="line"||qe.value?!Pt.value||Rt.value||U.value.hasAnimated?[]:(qe.value?N.series.filter(u=>(u.type||P.value)==="line"):it.value).map((u,s)=>{const t=N.series.findIndex(c=>c===u);let o="",n=null;u.data.forEach((c,i)=>{if(c!=null){const d={x:Ae.value?ce(c):he(i),y:Ae.value?Fe(i):Ne(c)};n===null?o+=`M ${d.x} ${d.y}`:o+=` L ${d.x} ${d.y}`,n=d}else if(n!==null){const d=u.data.findIndex((m,p)=>p>i&&m!==null&&m!==void 0);if(d!==-1){const m={x:Ae.value?ce(u.data[d]):he(d),y:Ae.value?Fe(d):Ne(u.data[d])};o+=` L ${m.x} ${m.y}`,n=m}}});const a=u.data.map((c,i)=>c==null?null:{x:Ae.value?ce(c):he(i),y:Ae.value?Fe(i):Ne(c)}).filter(c=>c!==null),r=$o(a);return{path:o,pathLength:r,color:me(t),animationDelay:s*xe.value,seriesIndex:t}}):[]),pn=e.computed(()=>{if(P.value!=="line")return[];const l=[];return it.value.forEach((u,s)=>{const t=L.value===s,o=L.value!==null&&L.value!==s,n=re.value.has(s);u.data.forEach((a,r)=>{a!=null&&l.push({x:he(r),y:Ne(a),color:me(s),value:a,label:N.categories[r]||r.toString(),seriesName:u.name,categoryIndex:r,dataIndex:r,animationDelay:(s*u.data.length+r)*(xe.value/8),isHighlighted:t,isDimmed:o,isHidden:n})})}),l}),ao=e.computed(()=>{if(!qe.value)return[];const l=[];return N.series.filter(s=>(s.type||P.value)==="line").forEach((s,t)=>{const o=N.series.findIndex(c=>c===s),n=L.value===o,a=L.value!==null&&L.value!==o,r=re.value.has(o);s.data.forEach((c,i)=>{c!=null&&l.push({x:he(i),y:Ne(c),color:me(o),value:c,label:N.categories[i]||i.toString(),seriesName:s.name,categoryIndex:i,dataIndex:i,animationDelay:(t*s.data.length+i)*(xe.value/8),isHighlighted:n,isDimmed:a,isHidden:r})})}),l}),Xt=e.computed(()=>{if(!ke.value)return[];const l=[];return it.value.forEach((u,s)=>{if(!u?.data?.length)return;const t=L.value,o=t!==null&&t===s,n=t!==null&&t!==s,a=re.value.has(s);u.data.forEach((r,c)=>{let i,d,m,p,g;if(typeof r=="object"&&r!==null&&!Array.isArray(r))i=typeof r.x=="number"?r.x:c,d=typeof r.y=="number"?r.y:0,m=typeof r.size=="number"?r.size:20,p=r.label||N.categories?.[c]||`Point ${c+1}`,g=r.image||r.imageUrl;else if(Array.isArray(r)&&r.length>=3)i=typeof r[0]=="number"?r[0]:c,d=typeof r[1]=="number"?r[1]:0,m=typeof r[2]=="number"?r[2]:20,p=r[3]||N.categories?.[c]||`Point ${c+1}`,g=r[4];else if(typeof r=="number")i=c,d=r,m=lo(s,c),p=N.categories?.[c]||`Point ${c+1}`;else return;!isFinite(i)||!isFinite(d)||!isFinite(m)||l.push({x:he(i),y:Ne(d),radius:qo(m),originalX:i,originalY:d,originalSize:m,color:me(s),seriesName:u.name||`Series ${s+1}`,label:p,imageUrl:g,seriesIndex:s,dataIndex:c,categoryIndex:Math.round(i),isHighlighted:o,isDimmed:n,isHidden:a,opacity:Lo.value})})}),l}),so=e.computed(()=>P.value!=="area"?[]:it.value.map((l,u)=>{const s=[];let t=[];if(l.data.forEach((m,p)=>{m==null?t.length>0&&(s.push([...t]),t=[]):t.push({x:he(p),y:Ne(m),index:p})}),t.length>0&&s.push(t),s.length===0)return{linePath:"",areaPath:"",color:me(u),isHidden:re.value.has(u)};const o=k.value.bottom+1;let n="",a="";s.forEach((m,p)=>{if(m.length===0)return;let g=`M ${m[0].x} ${m[0].y}`;Y.value&&m.length>1?g=He(m):m.slice(1).forEach(f=>{g+=` L ${f.x} ${f.y}`}),n+=(n?" ":"")+g;let h=`M ${m[0].x} ${o}`;if(h+=` L ${m[0].x} ${m[0].y}`,Y.value&&m.length>1){const f=He(m),C=f.substring(f.indexOf("C")||f.indexOf("Q")||f.indexOf("L"));C?h+=" "+C:m.slice(1).forEach(y=>{h+=` L ${y.x} ${y.y}`})}else m.slice(1).forEach(f=>{h+=` L ${f.x} ${f.y}`});h+=` L ${m[m.length-1].x} ${o} Z`,a+=(a?" ":"")+h});const r=L.value===u,c=L.value!==null&&L.value!==u,i=re.value.has(u),d=s.reduce((m,p)=>m+$o(p),0);return{linePath:n,areaPath:a,color:me(u),pathLength:d,isHighlighted:r,isDimmed:c,isHidden:i}})),fn=e.computed(()=>{if(!(["bar"].includes(P.value)||qe.value))return[];const l=[],{maxX:u}=ue.value,s=qe.value?N.series.filter(o=>(o.type||P.value)==="bar"):it.value,t=s.length;if(Ae.value){const o=u+1,a=k.value.height/o,r=a*(2/3),c=r/t,i=c*.02,d=t===o?Math.max(12,r-i*t):Math.max(12,c-i);s.forEach((m,p)=>{const g=N.series.findIndex(y=>y===m),h=L.value===g,f=L.value!==null&&L.value!==g,C=re.value.has(g);m.data.forEach((y,x)=>{if(y==null||typeof y!="number"||!isFinite(y))return;const M=k.value.top+(x+.5)*a-r/2+p*c+i/2,H=k.value.left,B=Math.abs(ce(y)-k.value.left);let _="";if(Y.value&&B>0){const R=Math.min(ho.value,d/2,B/2);_=[`M ${H} ${M}`,`L ${H+B-R} ${M}`,`Q ${H+B} ${M} ${H+B} ${M+R}`,`L ${H+B} ${M+d-R}`,`Q ${H+B} ${M+d} ${H+B-R} ${M+d}`,`L ${H} ${M+d}`,"Z"].join(" ")}l.push({x:H,y:M,width:B,height:d,color:me(g),value:y,label:N.categories[x]||x.toString(),seriesName:m.name,animationDelay:(p*s.length+x)*(xe.value/4),isHighlighted:h,isDimmed:f,isHidden:C,barPath:_,isSmooth:Y.value&&B>0})})})}else{const o=u+1,a=k.value.width/o,r=a*.8,c=r/t,i=c*.05,d=c-i;s.forEach((m,p)=>{const g=N.series.findIndex(y=>y===m),h=L.value===g,f=L.value!==null&&L.value!==g,C=re.value.has(g);m.data.forEach((y,x)=>{if(y==null||typeof y!="number"||!isFinite(y))return;const M=k.value.left+(x+.5)*a-r/2+p*c+i/2,H=Ne(Math.max(0,y)),B=Math.abs(Ne(0)-Ne(y));let _="";if(Y.value&&B>0){const R=Math.min(ho.value,d/2,B/2);_=[`M ${M} ${H+B}`,`L ${M} ${H+R}`,`Q ${M} ${H} ${M+R} ${H}`,`L ${M+d-R} ${H}`,`Q ${M+d} ${H} ${M+d} ${H+R}`,`L ${M+d} ${H+B}`,"Z"].join(" ")}l.push({x:M,y:H,width:d,height:B,color:me(g),value:y,label:N.categories[x]||x.toString(),seriesName:m.name,animationDelay:(p*s.length+x)*(xe.value/4),isHighlighted:h,isDimmed:f,isHidden:C,barPath:_,isSmooth:Y.value&&B>0})})})}return l}),vn=e.computed(()=>{if(!At.value)return[];const l=it.value.map((n,a)=>({series:n,originalIndex:a})).filter(({originalIndex:n})=>!re.value.has(n));if(l.length===0)return[];let u=P.value==="semi-radial"?Math.PI:-Math.PI/2;const s=P.value==="semi-radial"?Math.PI:Math.PI*2,t=[];if(l.length===1){const{series:n,originalIndex:a}=l[0],r=n.data[0]||0,c=u,i=u+s-.001,d=c+s/2,m=ie.value+Math.cos(c)*Ee.value,p=ne.value+Math.sin(c)*Ee.value,g=ie.value+Math.cos(i)*Ee.value,h=ne.value+Math.sin(i)*Ee.value,f=ie.value+Math.cos(i)*Z.value,C=ne.value+Math.sin(i)*Z.value,y=ie.value+Math.cos(c)*Z.value,x=ne.value+Math.sin(c)*Z.value,E=1,V=[`M ${m} ${p}`,`A ${Ee.value} ${Ee.value} 0 ${E} 1 ${g} ${h}`,`L ${f} ${C}`,`A ${Z.value} ${Z.value} 0 ${E} 0 ${y} ${x}`,"Z"].join(" ");return t.push({path:V,color:me(a),value:r,seriesName:n.name,opacity:.8,isHighlighted:L.value===a,isDimmed:!1,isHidden:!1,startAngle:c,endAngle:i,midAngle:d}),t}const o=l.reduce((n,{series:a})=>n+(a.data[0]||0),0);return o===0?[]:(l.forEach(({series:n,originalIndex:a})=>{const r=n.data[0]||0,c=r/o*s,i=u,d=u+c,m=i+c/2,p=ie.value+Math.cos(i)*Ee.value,g=ne.value+Math.sin(i)*Ee.value,h=ie.value+Math.cos(d)*Ee.value,f=ne.value+Math.sin(d)*Ee.value,C=ie.value+Math.cos(d)*Z.value,y=ne.value+Math.sin(d)*Z.value,x=ie.value+Math.cos(i)*Z.value,E=ne.value+Math.sin(i)*Z.value,V=c>Math.PI?1:0,M=[`M ${p} ${g}`,`A ${Ee.value} ${Ee.value} 0 ${V} 1 ${h} ${f}`,`L ${C} ${y}`,`A ${Z.value} ${Z.value} 0 ${V} 0 ${x} ${E}`,"Z"].join(" ");t.push({path:M,color:me(a),value:r,seriesName:n.name,opacity:.8,isHighlighted:L.value===a,isDimmed:L.value!==null&&L.value!==a,isHidden:!1,startAngle:i,endAngle:d,midAngle:m}),u=d}),t)}),gn=e.computed(()=>!Oo.value||!At.value?[]:vn.value.map((l,u)=>{if(l.isHidden)return null;const s=ft.value,t=Nn.value,o=Mn.value,n=ie.value+Math.cos(l.midAngle)*Z.value,a=ne.value+Math.sin(l.midAngle)*Z.value,r=ie.value+Math.cos(l.midAngle)*(Z.value+s),c=ne.value+Math.sin(l.midAngle)*(Z.value+s),i=Math.cos(l.midAngle)>=0,m=r+t*(i?1:-1),p=c,g=i?r+15:r-15,h=p-o,f=i?"start":"end";return{pointerStartX:n,pointerStartY:a,pointerEndX:r,pointerEndY:c,horizontalEndX:m,horizontalEndY:p,textX:g,textY:h,text:`${l.seriesName}: ${l.value}`,color:l.color,textAnchor:f,isRightSide:i,isHighlighted:l.isHighlighted,isDimmed:l.isDimmed}}).filter(Boolean)),$t=l=>{if(!l||l.isHidden)return 0;const u=l.opacity||Lo.value||.7;return L.value===null||L.value===void 0?u:L.value!==null?l.seriesIndex===L.value?Math.min(1,u+.1):Math.max(.5,u*.8):u},Dt=l=>{if(!l||l.isHidden)return 0;const u=l.radius>20?.9:.8;return L.value!==null?l.seriesIndex===L.value?Math.min(1,u+.1):u*.7:u},_t=(l,u)=>{if(l)try{if(L.value===l.seriesIndex?L.value=null:L.value=l.seriesIndex,typeof window<"u"&&window.dispatchEvent){const s=new CustomEvent("dss-bubble-click",{detail:{bubble:l,originalEvent:u,chartId:N.chartId}});window.dispatchEvent(s)}}catch(s){console.error("Error in onBubbleClick:",s)}},Co=(l,u)=>{const s=[`dss-bubble-fallback-${u}`];return l.isHighlighted&&s.push("dss-bubble-highlighted"),l.isDimmed&&s.push("dss-bubble-dimmed"),l.isHidden&&s.push("dss-bubble-hidden"),s.push(`dss-bubble-series-${l.seriesIndex}`),s.join(" ")},pe=(l,u)=>{l&&(u.stopPropagation(),wo.value=!0,L.value=l.seriesIndex,I.value.show=!1)},hn=(l,u)=>{let s;switch(l){case"x":s=u.originalX;break;case"y":s=u.originalY;break;case"size":s=u.originalSize;break;case"label":s=u.label;break;case"seriesName":s=u.seriesName;break;default:s=u[l]||""}const t=So.value[l];return typeof t=="function"?t(s,u):typeof s=="number"?s.toFixed(1):s?.toString()||""},yn=()=>{if(!ke.value||!I.value.data||I.value.data.length===0)return"Bubbles";const l=[],u=new Set;return I.value.data.forEach(s=>{if(s.seriesName&&s.label){const t=`${s.seriesName} - ${s.label}`;u.has(t)||(l.push(t),u.add(t))}else s.seriesName&&(u.has(s.seriesName)||(l.push(s.seriesName),u.add(s.seriesName)))}),l.length>0?l.join(" | "):"Bubbles"},It=(l,u)=>{l&&(wo.value=!1,L.value=null)},Yt=(l,u)=>{const s=u.target.closest(".dss-custom-chart-container");if(!s)return;const t=s.getBoundingClientRect(),o=yo(l.categoryIndex),n=l.description||l.comment||"";let a=u.clientX-t.left+15,r=u.clientY-t.top-10;const c=200,i=n?80:50;a+c>D.value&&(a=u.clientX-t.left-c-15),r+i>W.value&&(r=u.clientY-t.top-i-10),a<0&&(a=10),r<0&&(r=10),Nt.value={show:!0,x:a,y:r,categoryValue:o,description:n}},ro=()=>{Nt.value.show=!1},Je=e.computed(()=>N.categories.length||Math.max(...qt.value.map(l=>l.data.length))),io=e.computed(()=>{let l=0;return qt.value.forEach(u=>{u.data.forEach(s=>{typeof s=="number"&&(l=Math.max(l,s))})}),l||100}),Cn=e.computed(()=>{const l=[],u=Je.value;for(let s=0;s<u;s++){const t=s*2*Math.PI/u-Math.PI/2,o=ie.value+Math.cos(t)*Z.value,n=ne.value+Math.sin(t)*Z.value;l.push({x:o,y:n,angle:t,index:s})}return l}),Zn=e.computed(()=>{const l=[],u=Je.value;return Cn.value.forEach((s,t)=>{const o=Z.value+15,n=t*2*Math.PI/u-Math.PI/2,a=ie.value+Math.cos(n)*o,r=ne.value+Math.sin(n)*o+5;let c="middle",i="middle";Math.abs(Math.cos(n))>.5&&(c=Math.cos(n)>0?"start":"end"),Math.abs(Math.sin(n))>.5&&(i=Math.sin(n)>0?"hanging":"auto"),l.push({x:a,y:r,text:N.categories[t]||`Axis ${t+1}`,anchor:c,baseline:i})}),l}),ko=e.ref(new Set),kn=(l,u,s)=>{const t=`current-${s}`,o=ko.value.has(t);return!o&&L.value===null?u.fillOpacity||z.value:u.isHighlighted||o?(u.fillOpacity||z.value)+.15:u.isDimmed?(u.fillOpacity||z.value)*.3:u.fillOpacity||z.value},co=e.computed(()=>{if(!Ce.value)return[];const l=[],u=Je.value;return it.value.forEach((s,t)=>{const o=[],n=[],a=[],r=L.value===t,c=L.value!==null&&L.value!==t,i=re.value.has(t);for(let d=0;d<u;d++){const m=s.data[d]||0,g=m/io.value*Z.value,h=d*2*Math.PI/u-Math.PI/2,f=ie.value+Math.cos(h)*g,C=ne.value+Math.sin(h)*g;o.push(`${f},${C}`),n.push({x:f,y:C}),a.push({x:f,y:C,value:m,label:N.categories[d]||`Axis ${d+1}`,seriesName:s.name})}l.push({points:o.join(" "),polygonPoints:n,dataPoints:a,color:me(t),fillOpacity:z.value,seriesName:s.name,value:`${s.name}: ${s.data.join(", ")}`,isHighlighted:r,isDimmed:c,isHidden:i,seriesIndex:t})}),l}),xn=(l,u)=>{if(!u||u.length<3)return!1;let s=!1;for(let t=0,o=u.length-1;t<u.length;o=t++){const n=u[t].x,a=u[t].y,r=u[o].x,c=u[o].y;a>l.y!=c>l.y&&l.x<(r-n)*(l.y-a)/(c-a)+n&&(s=!s)}return s},Un=l=>{if(!Ce.value)return;const u=l.currentTarget.closest(".dss-custom-chart-container");if(!u)return;const s=u.getBoundingClientRect(),t=X.value?.getBoundingClientRect();if(!t)return;const o=l.clientX-t.left,n=l.clientY-t.top,a=co.value.filter(r=>r.isHidden?!1:xn({x:o,y:n},r.polygonPoints));if(a.length>0){a.length,L.value=a[0].seriesIndex;const r=l.clientX-s.left+10,c=l.clientY-s.top-10,i=200,d=50+a.length*25;let m=r,p=c;m+i>D.value&&(m=l.clientX-s.left-i-10),p+d>W.value&&(p=l.clientY-s.top-d-10),m<0&&(m=10),p<0&&(p=10);const g=a.map(h=>{let f=h.dataPoints[0],C=1/0;return h.dataPoints.forEach(y=>{const x=Math.sqrt(Math.pow(y.x-o,2)+Math.pow(y.y-n,2));x<C&&(C=x,f=y)}),{seriesName:h.seriesName,color:h.color,value:f.value!==void 0?f.value:h.value}});ae.value={show:!0,x:m,y:p,title:a.length===1?a[0].seriesName:"",value:"",spiderSeries:g}}else ct()},Do=e.computed(()=>{const l=T.value;return l.logos.map((u,s)=>{const t=N.series[u.seriesIndex];if(!t||!t.data||t.data.length===0||re.value.has(u.seriesIndex))return null;let o,n;if(Se.value){let r=-1,c=null;for(let d=t.data.length-1;d>=0;d--)if(t.data[d]!==null&&t.data[d]!==void 0){r=d,c=t.data[d];break}if(r===-1||c===null)return null;const i=t.data.map((d,m)=>d==null?null:{x:he(m),y:Ne(d),index:m}).filter(d=>d!==null);if(l.animations.enabled&&!Rt.value&&l.animations.type==="draw"&&l.chart.type==="line"&&(U.value.isAnimating||!U.value.hasAnimated))if(U.value.isAnimating){const d=U.value.currentFrame/U.value.totalFrames,m=ht(l.animations.easing,Math.min(d,1)),p=Go(i,m);o=p.x+(u.offsetX||0),n=p.y+(u.offsetY||0)}else o=i[0].x+(u.offsetX||0),n=i[0].y+(u.offsetY||0);else o=he(r)+(u.offsetX||0),n=Ne(c)+(u.offsetY||0)}else if(At.value||Ce.value){const r=Math.PI*2/l.logos.length*s;o=ie.value+Math.cos(r)*(Z.value+30)+(u.offsetX||0),n=ne.value+Math.sin(r)*(Z.value+30)+(u.offsetY||0)}return{...u,x:o,y:n,seriesIndex:u.seriesIndex}}).filter(Boolean)}),_o=l=>{const u=document.querySelector(`.dss-logo-fallback-${l}`),s=document.querySelector(`.dss-logo-image-${l}`);u&&(u.style.opacity="0"),s&&(s.style.opacity="1")},jo=l=>{console.warn(`Logo ${l} failed to load, keeping fallback circle`);const u=document.querySelector(`.dss-logo-image-${l}`);u&&(u.style.display="none")},Io=l=>{re.value.has(l)?re.value.delete(l):re.value.add(l)},Wn=e.computed(()=>{if(!ae.value.show&&!(Te.value&&I.value.show&&!S.value.isZooming))return{display:"none"};let l,u;if(Te.value&&I.value.show&&!S.value.isZooming){l=I.value.x+15,u=k.value.top;const s=ke.value?200:150;l+s>D.value&&(l=I.value.x-s-15),l<0&&(l=10),u<10&&(u=10)}else l=ae.value.x,u=ae.value.y;return{left:l+"px",top:u+"px"}}),gt=(l,u)=>{if(uo.value)return;const t=u.target.closest(".dss-custom-chart-container").getBoundingClientRect();let o=u.clientX-t.left+10,n=u.clientY-t.top-10;const a=200,r=120,c=D.value,i=W.value;o+a>c&&(o=u.clientX-t.left-a-10),n+r>i&&(n=u.clientY-t.top-r-10),o<0&&(o=10),n<0&&(n=10);let d;typeof l.categoryIndex=="number"?d=l.categoryIndex:typeof l.dataIndex=="number"?d=l.dataIndex:l.label&&N.categories.includes(l.label)&&(d=N.categories.indexOf(l.label));const m=(Ae.value||P.value==="bar")&&l.label?l.label:l.seriesName||l.label||"";ae.value={show:!0,x:o,y:n,title:m,value:l.value?.toString()||"",categoryIndex:d,spiderSeries:[]}},xo=e.ref(!1),wo=e.ref(!1),ct=()=>{ae.value.show=!1,ae.value.spiderSeries=[],I.value.show=!1,xo.value||(L.value=null)},uo=e.ref(!1),mo=(l,u)=>{uo.value=!0,ae.value.show=!1,I.value.show=!1;const t=u.target.closest(".dss-custom-chart-container").getBoundingClientRect();let o=u.clientX-t.left+15,n=u.clientY-t.top-10;const a=250;o+a>D.value&&(o=u.clientX-t.left-a-15),o<0&&(o=10),n<0&&(n=10),Po.value={show:!0,x:o,y:n,content:l.texts,count:l.totalCount}},Eo=()=>{uo.value=!1,Po.value.show=!1},U=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),ht=(l,u)=>{switch(l){case"linear":return u;case"ease":return u<.5?2*u*u:-1+(4-2*u)*u;case"ease-in":return u*u;case"ease-out":return u*(2-u);case"ease-in-out":return u<.5?2*u*u:-1+(4-2*u)*u;default:return u}},Rt=e.computed(()=>eo.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Ko=()=>{if(!Pt.value||Rt.value){U.value.hasAnimated=!0;return}U.value.isAnimating=!0,U.value.currentFrame=0,U.value.totalFrames=Math.ceil(_e.value/16.67);const l=()=>{const u=U.value.currentFrame/U.value.totalFrames,s=ht(Ze.value,Math.min(u,1));qn(s),u<1?(U.value.currentFrame++,U.value.animationId=requestAnimationFrame(l)):Xn()};U.value.animationId=requestAnimationFrame(l)},qn=l=>{const u=document.querySelector(".dss-custom-chart-container");u&&u.style.setProperty("--dss-animation-progress",l)},Xn=()=>{U.value.isAnimating=!1,U.value.hasAnimated=!0,U.value.animationId&&(cancelAnimationFrame(U.value.animationId),U.value.animationId=null)},Yn=e.computed(()=>{if(!Pt.value||Rt.value||U.value.hasAnimated)return{};const l={};return l["--dss-animation-duration"]=`${_e.value}ms`,l["--dss-animation-easing"]=Ro(Ze.value),l["--dss-stagger-delay"]=`${xe.value}ms`,l}),Ro=l=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[l]||"ease-out",Qe=()=>{if(!Pt.value||Rt.value)return"";const l=["dss-chart-animated"];return U.value.hasAnimated||l.push(`dss-animate-${Zt.value}`),U.value.hasAnimated||(At.value?l.push("dss-animate-fill"):l.push(`dss-animate-${Zt.value}`)),U.value.isAnimating&&l.push("dss-is-animating"),l.join(" ")};e.watch(()=>N.series,(l,u)=>{nt.value&&u&&U.value.hasAnimated&&(U.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Ko(),bt.value)}))},{deep:!0}),e.watch(()=>S.value.isZooming,(l,u)=>{u&&!l&&setTimeout(()=>{Mo()},50)}),e.watch(()=>[S.value.scale,S.value.offsetX],()=>{!S.value.isZooming&&!S.value.isDragging&&Mo()},{flush:"post"}),e.watch([Vo,ot],([l,u])=>{S.value.minScale=l,S.value.maxScale=u,(S.value.scale<l||S.value.scale>u)&&Ao()},{immediate:!0}),e.watch(()=>N.locale,l=>{l&&l!==b.value&&(b.value=l)},{immediate:!0}),e.watch(()=>oe.value.show,l=>{l?e.nextTick(()=>{document.addEventListener("click",Ho)}):document.removeEventListener("click",Ho)}),e.onMounted(()=>{L.value=null,Wo(),Pt.value&&!Rt.value?setTimeout(()=>Ko(),bt.value):U.value.hasAnimated=!0,document.addEventListener("mousemove",wn),document.addEventListener("mouseup",Ft),document.addEventListener("click",$e)}),e.onUnmounted(()=>{U.value.animationId&&cancelAnimationFrame(U.value.animationId),S.value.zoomTimeout&&clearTimeout(S.value.zoomTimeout),document.removeEventListener("mousemove",wn),document.removeEventListener("mouseup",Ft),document.removeEventListener("click",$e),document.removeEventListener("click",Ho)});const wn=l=>{if(S.value.isDragging&&S.value.scale>1&&Se.value){I.value.show=!1;const u=l.clientX-S.value.lastMouseX,{minX:s,maxX:t}=ue.value,o=t-s||1,a=u*.8;S.value.offsetX+=a;const r=o/S.value.scale,c=o-r,i=0,d=-c/o*k.value.width,m=i;S.value.offsetX=Math.max(d,Math.min(m,S.value.offsetX)),S.value.lastMouseX=l.clientX,S.value.lastMouseY=l.clientY}},Ft=()=>{S.value.isDragging&&(S.value.isDragging=!1,setTimeout(()=>{!S.value.isDragging&&S.value.isZooming},100))},Go=(l,u)=>{const s=l.filter(r=>r!=null);if(!s||s.length===0)return{x:0,y:0};if(s.length===1||u<=0)return s[0];if(u>=1)return s[s.length-1];let t=0;const o=[];for(let r=1;r<s.length;r++){const c=s[r].x-s[r-1].x,i=s[r].y-s[r-1].y,d=Math.sqrt(c*c+i*i);o.push(d),t+=d}const n=t*u;let a=0;for(let r=0;r<o.length;r++){const c=a+o[r];if(n<=c){const i=(n-a)/o[r],d=s[r],m=s[r+1];return{x:d.x+(m.x-d.x)*i,y:d.y+(m.y-d.y)*i}}a=c}return s[s.length-1]};return(l,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",Qe()]),style:e.normalizeStyle({width:D.value+"px",height:W.value+20+"px",...Yn.value,cursor:rn()}),"data-chart-type":P.value,ref_key:"containerEl",ref:w,onWheel:Ve,onMousedown:Ht,onMousemove:Bn,onMouseup:Rn,onMouseleave:nn,onDblclick:Ao,onContextmenu:e.withModifiers(Tn,["prevent"]),onClick:e.withModifiers(Re,["left"]),onWheelCapture:Ve},[e.createElementVNode("div",al,[e.createElementVNode("div",sl,[J.value?(e.openBlock(),e.createElementBlock("div",rl,e.toDisplayString(J.value),1)):e.createCommentVNode("",!0),Q.value?(e.openBlock(),e.createElementBlock("div",il,e.toDisplayString(Q.value),1)):e.createCommentVNode("",!0)]),ye.value&&(Be.value==="top"||Be.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":fo.value==="horizontal","dss-legend-vertical":fo.value==="vertical","dss-legend-top":Be.value==="top","dss-legend-bottom":Be.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.series,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${t}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":re.value.has(t),"dss-legend-hovered":L.value===t,"dss-legend-dimmed":L.value!==null&&L.value!==t}]),onClick:o=>Io(t),onMouseenter:o=>Zo(t),onMouseleave:on,style:e.normalizeStyle({animationDelay:`${t*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:me(t)})},null,4),e.createElementVNode("span",dl,e.toDisplayString(s.name),1)],46,cl))),128))],2)):e.createCommentVNode("",!0),ye.value&&(Be.value==="left"||Be.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Be.value==="left","dss-legend-right":Be.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.series,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${t}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":re.value.has(t),"dss-legend-hovered":L.value===t,"dss-legend-dimmed":L.value!==null&&L.value!==t}]),onClick:o=>Io(t),onMouseenter:o=>Zo(t),onMouseleave:on,style:e.normalizeStyle({animationDelay:`${t*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:me(t)})},null,4),e.createElementVNode("span",ml,e.toDisplayString(s.name),1)],46,ul))),128))],2)):e.createCommentVNode("",!0)]),A.showAddMarkerButton&&fe.value.addMarker&&(Se.value||ke.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Tt,title:e.unref(F)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Ye.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,fl),u[5]||(u[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,pl)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:D.value,height:W.value,class:"dss-chart-svg","data-smooth":Y.value,"data-animated":Pt.value,ref_key:"svgEl",ref:X},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",gl,[e.createElementVNode("rect",{x:k.value.left,y:k.value.top,width:k.value.width,height:k.value.height*4},null,8,hl)])]),Se.value||ke.value?(e.openBlock(),e.createElementBlock("g",yl,[O.value?(e.openBlock(),e.createElementBlock("g",Cl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dn.value,(s,t)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${t}`,x1:k.value.left,x2:k.value.right,y1:s.y,y2:s.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${t*50}ms`})},null,12,kl))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",xl,[e.createElementVNode("line",{x1:k.value.left,x2:k.value.right,y1:k.value.bottom,y2:k.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,wl),e.createElementVNode("line",{x1:k.value.left,x2:k.value.left,y1:k.value.top,y2:k.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,El)]),e.createElementVNode("g",bl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xo.value,(s,t)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${t}`,x:s.x,y:s.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${t*100}ms`})},e.toDisplayString(s.text),13,Vl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yo.value,(s,t)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${t}`,x:s.x,y:s.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${t*80}ms`})},e.toDisplayString(s.text),13,Sl))),128)),tt.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:k.value.left+k.value.width/2,y:k.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(tt.value),9,Nl)):e.createCommentVNode("",!0),bo.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:k.value.top+12+k.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${k.value.top+k.value.height/2})`},e.toDisplayString(bo.value),9,Ml)):e.createCommentVNode("",!0)]),Jo.value.length>0?(e.openBlock(),e.createElementBlock("g",Bl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jo.value,s=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${s.categoryIndex}`},[e.createElementVNode("g",Tl,[s.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:s.x,x2:s.x,y1:k.value.bottom,y2:k.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:t=>mo(s,t),onMouseleave:Eo},null,40,Hl)):e.createCommentVNode("",!0),s.hasAuto&&!s.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:s.x,x2:s.x,y1:k.value.bottom,y2:k.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:t=>mo(s,t),onMouseleave:Eo},null,40,Al)):e.createCommentVNode("",!0),s.hasAuto&&s.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:s.x,x2:s.x,y1:k.value.bottom,y2:k.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:t=>mo(s,t),onMouseleave:Eo},null,40,Ll)):e.createCommentVNode("",!0)]),s.hasManual&&s.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:s.x+8,cy:Math.max(15,k.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:t=>mo(s,t),onMouseleave:Eo},null,40,$l)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:s.x,cy:Math.max(15,k.value.top-10),r:"14",fill:s.hasManual&&s.hasAuto||s.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:t=>mo(s,t),onMouseleave:Eo},null,40,Dl),e.createElementVNode("text",{x:s.x,y:Math.max(15,k.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(s.totalCount),9,_l)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Il,[qe.value?(e.openBlock(),e.createElementBlock("g",Rl,[e.createElementVNode("g",Fl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.value,(s,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${t}`},[s.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:s.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":s.isHighlighted,"dss-bar-dimmed":s.isDimmed,"dss-bar-hidden":s.isHidden}),style:e.normalizeStyle({fill:s.color,fillOpacity:s.isDimmed?.4:1,animationDelay:`${s.animationDelay}ms`}),onMouseover:o=>gt(s,o),onMouseleave:ct},null,46,zl)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:s.x,y:s.y,width:s.width,height:s.height,fill:s.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":s.isHighlighted,"dss-bar-dimmed":s.isDimmed,"dss-bar-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${s.animationDelay}ms`}),onMouseover:o=>gt(s,o),onMouseleave:ct},null,46,Ol))],64))),128))]),e.createElementVNode("g",Pl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(un.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${t}`,d:s.path,stroke:s.color,"stroke-width":s.isHighlighted?ee.value+2:ee.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":s.isHighlighted,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden}),style:e.normalizeStyle({"--dss-path-length":s.pathLength,animationDelay:`${s.animationDelay}ms`})},null,14,Zl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${t}`,d:s.path,stroke:s.color,"stroke-width":s.isHighlighted?ee.value+2:ee.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:s.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${s.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Ul))),128)),se.value>0||wt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ao.value,(s,t)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${t}`,cx:s.x,cy:s.y,r:s.isHighlighted?Xe(s,se.value)+2:Xe(s,se.value),fill:s.color,stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass({"dss-point-highlighted":s.isHighlighted,"dss-point-dimmed":s.isDimmed,"dss-point-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${s.animationDelay}ms`}),onMouseover:o=>gt(s,o),onMouseleave:ct},null,46,Wl))),128)):e.createCommentVNode("",!0)])])):P.value==="line"?(e.openBlock(),e.createElementBlock("g",ql,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pn.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${t}`,d:s.path,stroke:s.color,"stroke-width":ee.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":U.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":s.pathLength,animationDelay:`${s.animationDelay}ms`})},null,14,Xl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(un.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${t}`,d:s.path,stroke:s.color,"stroke-width":s.isHighlighted?ee.value+2:ee.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":s.isHighlighted,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden}),style:e.normalizeStyle({"--dss-path-length":s.pathLength,animationDelay:`${s.animationDelay}ms`})},null,14,Yl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${t}`,d:s.path,stroke:s.color,"stroke-width":s.isHighlighted?ee.value+2:ee.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:s.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${s.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,jl))),128)),se.value>0||wt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(pn.value,(s,t)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${t}`,cx:s.x,cy:s.y,r:s.isHighlighted?Xe(s,se.value)+2:Xe(s,se.value),fill:s.color,stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass({"dss-point-highlighted":s.isHighlighted,"dss-point-dimmed":s.isDimmed,"dss-point-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${s.animationDelay}ms`}),onMouseover:o=>gt(s,o),onMouseleave:ct},null,46,Kl))),128)):e.createCommentVNode("",!0)])):P.value==="area"?(e.openBlock(),e.createElementBlock("g",Gl,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(so.value,(s,t)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${t}`,id:`area-mask-${t}-${A.chartId}`},[e.createElementVNode("rect",{x:k.value.left-10,y:k.value.top-10,width:k.value.width+20,height:k.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${k.value.width+20}px`})},null,12,Ql)],8,Jl))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(so.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${t}`,d:s.areaPath,fill:s.color,"fill-opacity":s.isHighlighted?go.value+.2:go.value,mask:`url(#area-mask-${t}-${A.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":s.isHighlighted,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden})},null,10,ea))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(so.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${t}`,d:s.linePath,stroke:s.color,"stroke-width":s.isHighlighted?ee.value+1:ee.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":s.isHighlighted,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden}),style:e.normalizeStyle({"--dss-path-length":s.pathLength,animationDelay:`${t*xe.value}ms`})},null,14,ta))),128))])):P.value==="bar"?(e.openBlock(),e.createElementBlock("g",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.value,(s,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${t}`},[s.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:s.barPath,fill:s.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":s.isHighlighted,"dss-bar-dimmed":s.isDimmed,"dss-bar-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${s.animationDelay}ms`}),onMouseover:o=>gt(s,o),onMouseleave:ct},null,46,na)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:s.x,y:s.y,width:s.width,height:s.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":s.isHighlighted,"dss-bar-dimmed":s.isDimmed,"dss-bar-hidden":s.isHidden}),style:e.normalizeStyle({fill:s.color,fillOpacity:s.isDimmed?.4:1,animationDelay:`${s.animationDelay}ms`}),onMouseover:o=>gt(s,o),onMouseleave:ct},null,46,la))],64))),128))])):e.createCommentVNode("",!0)]),Te.value&&I.value.show&&!S.value.isZooming?(e.openBlock(),e.createElementBlock("g",aa,[e.createElementVNode("line",{x1:I.value.x,x2:I.value.x,y1:k.value.top,y2:k.value.bottom,stroke:vo.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,sa),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value.data,(s,t)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${t}`,cx:I.value.x,cy:s.y,r:se.value+2,fill:s.color,stroke:"#fafafa","stroke-width":"2",opacity:"0.9"},null,8,ra))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ke.value?(e.openBlock(),e.createElementBlock("g",ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt.value,(s,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${t}`},[s?(e.openBlock(),e.createElementBlock("g",ca,[e.createElementVNode("circle",{cx:s.x,cy:s.y,r:s.radius,fill:s.color,"fill-opacity":$t(s),stroke:s.color,"stroke-width":s.isHighlighted?3:1,"stroke-opacity":"0.8",class:e.normalizeClass(Co(s,t)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:o=>pe(s,o),onMouseleave:o=>It(s),onClick:o=>_t(s,o)},null,42,da),s.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:s.x-s.radius*.65,y:s.y-s.radius*.65,width:s.radius*1.3,height:s.radius*1.3,"xlink:href":s.imageUrl,class:e.normalizeClass(`dss-bubble-image-${t} ${s.isHighlighted?"dss-bubble-highlighted":""} ${s.isDimmed?"dss-bubble-dimmed":""} ${s.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${s.radius*.65}px at ${s.radius*.65}px ${s.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:Dt(s)}),onLoad:o=>Fn(t),onError:o=>cn(t),onMouseenter:o=>pe(s,o),onMouseleave:o=>It(s),onClick:o=>_t(s,o)},null,46,ua)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),At.value?(e.openBlock(),e.createElementBlock("g",ma,[P.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:ie.value,cy:ne.value,r:Z.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,pa)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":P.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vn.value,(s,t)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${t}`,d:s.path,fill:s.color,"fill-opacity":s.isHighlighted?(s.opacity||.8)+.2:s.opacity||.8,stroke:s.color,"stroke-width":s.isHighlighted?2:1,class:e.normalizeClass({"dss-series-highlighted":s.isHighlighted,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden}),onMouseover:o=>gt(s,o),onMouseleave:ct},null,42,va))),128))],8,fa),Oo.value?(e.openBlock(),e.createElementBlock("g",ga,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gn.value,(s,t)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${t}`,class:e.normalizeClass({"dss-label-highlighted":s.isHighlighted,"dss-label-dimmed":s.isDimmed})},[e.createElementVNode("line",{x1:s.pointerStartX,y1:s.pointerStartY,x2:s.pointerEndX,y2:s.pointerEndY,stroke:s.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({animationDelay:`${t*100}ms`})},null,12,ha),e.createElementVNode("line",{x1:s.pointerEndX,y1:s.pointerEndY,x2:s.horizontalEndX,y2:s.horizontalEndY,stroke:s.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({animationDelay:`${t*120}ms`})},null,12,ya),e.createElementVNode("text",{x:s.textX,y:s.textY,"text-anchor":s.textAnchor,"font-size":Sn.value,"dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${t*150}ms`})},e.toDisplayString(s.text),13,Ca)],2))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ce.value?(e.openBlock(),e.createElementBlock("g",ka,[O.value?(e.openBlock(),e.createElementBlock("g",xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,(s,t)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${t}`,cx:ie.value,cy:ne.value,r:s,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${t*150}ms`})},null,12,wa))),128)),e.createElementVNode("g",Ea,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,(s,t)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${t}`},[e.createElementVNode("rect",{x:ie.value-16,y:ne.value-s-7,width:"32",height:"16",fill:"#fafafa",stroke:"none"},null,8,ba),e.createElementVNode("text",{x:ie.value,y:ne.value-s+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Vt(t)),9,Va)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cn.value,(s,t)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${t}`,x1:ie.value,x2:s.x,y1:ne.value,y2:s.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${t*100}ms`})},null,12,Sa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Na,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zn.value,(s,t)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${t}`,x:s.x+Math.cos(t*2*Math.PI/Je.value-Math.PI/2)*16,y:s.y+Math.sin(t*2*Math.PI/Je.value-Math.PI/2)*16,"text-anchor":s.anchor,"dominant-baseline":s.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${t*120}ms`})},e.toDisplayString(s.text.charAt(0).toUpperCase()+s.text.slice(1)),13,Ma))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Un,onMouseleave:ct},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(co.value,(s,t)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${t}`},[e.createElementVNode("polygon",{points:s.points,fill:s.color,"fill-opacity":kn("current",s,t),stroke:s.color,"stroke-width":s.isHighlighted?ee.value+1:ee.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":s.isHighlighted,"dss-series-dimmed":s.isDimmed,"dss-series-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${t*xe.value}ms`,transition:"all 0.2s ease"})},null,14,Ba),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.dataPoints,(o,n)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${t}-${n}`,cx:o.x,cy:o.y,r:s.isHighlighted?se.value+1:se.value>0?se.value:0,fill:s.color,stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass({"dss-point-highlighted":s.isHighlighted,"dss-point-dimmed":s.isDimmed,"dss-point-hidden":s.isHidden}),style:e.normalizeStyle({animationDelay:`${t*xe.value+n*50}ms`,transition:"all 0.2s ease"}),onMouseover:a=>gt(o,a),onMouseleave:ct},null,46,Ta))),128))]))),128))],32)])):e.createCommentVNode("",!0),e.createElementVNode("g",Ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Do.value,(s,t)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${t}`,cx:s.x,cy:s.y,r:s.width/2,fill:me(s.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${t}`),style:e.normalizeStyle({animationDelay:`${t*200}ms`})},null,14,Aa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Do.value,(s,t)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${t}`,x:s.x-s.width/2,y:s.y-s.height/2,width:s.width,height:s.height,"xlink:href":s.url,onLoad:o=>_o(t),onError:o=>jo(t),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${t}`),"clip-path":`circle(${s.width/2}px at ${s.width/2}px ${s.height/2}px)`,style:e.normalizeStyle({animationDelay:`${t*200}ms`})},null,46,La))),128))])],8,vl)),Ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:D.value+"px",height:W.value+"px",backgroundImage:`url('${to.value}')`,backgroundRepeat:"no-repeat",...Ut.value,opacity:Ge.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value,(s,t)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+s.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:s.x+"px",top:s.y+"px",width:te.value+"px",height:te.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(o=>we(s),["stop"]),onMouseenter:o=>Yt(s,o),onMouseleave:ro},[e.createElementVNode("img",{src:ln(s),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Da)],44,$a)),[[e.vShow,ut.value]])),128)),Nt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Nt.value.x+"px",top:Nt.value.y+"px"})},[e.createElementVNode("div",_a,e.toDisplayString(Nt.value.categoryValue),1),Nt.value.description?(e.openBlock(),e.createElementBlock("div",Ia,e.toDisplayString(Nt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),ae.value.show||Te.value&&I.value.show&&!S.value.isZooming?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Te.value&&I.value.show&&!S.value.isZooming}]),style:e.normalizeStyle(Wn.value)},[!Te.value||!I.value.show||S.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ce.value&&ae.value.spiderSeries&&ae.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Ra,[ae.value.title?(e.openBlock(),e.createElementBlock("div",Fa,e.toDisplayString(ae.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value.spiderSeries,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${t}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("span",za,e.toDisplayString(s.seriesName)+":",1),e.createElementVNode("span",Oa,e.toDisplayString(s.value),1)]))),128))])):(e.openBlock(),e.createElementBlock("div",Pa,[e.createElementVNode("div",Za,e.toDisplayString(ae.value.title),1),e.createElementVNode("div",Ua,e.toDisplayString(ae.value.value),1)])),ae.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[Ie(ae.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Wa,[u[6]||(u[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",qa,e.toDisplayString(e.unref(F)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie(ae.value.categoryIndex).flagGroups,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${t}`},[e.createElementVNode("div",Xa,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(s.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.flags,(o,n)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${t}-${n}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Ya,[e.createElementVNode("div",ja,e.toDisplayString(o.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Ie(ae.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ka,[u[7]||(u[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ga,e.toDisplayString(e.unref(F)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie(ae.value.categoryIndex).markers,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${t}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("div",Ja,[e.createElementVNode("div",Qa,e.toDisplayString(s.title),1),s.description?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(s.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",ts,[e.createElementVNode("div",os,e.toDisplayString(ke.value?yn():A.categories[I.value.categoryIndex]||`Category ${I.value.categoryIndex+1}`),1),ke.value?(e.openBlock(),e.createElementBlock("div",ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value.data,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${t}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(s.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(I.value.data,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${t}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("span",ls,e.toDisplayString(s.seriesName)+":",1),e.createElementVNode("span",as,e.toDisplayString(s.value),1)]))),128))]),Ie(I.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",ss,[u[8]||(u[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",rs,e.toDisplayString(e.unref(F)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie(I.value.categoryIndex).flagGroups,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${t}`},[e.createElementVNode("div",is,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(s.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.flags,(o,n)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${t}-${n}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",cs,[e.createElementVNode("div",ds,e.toDisplayString(o.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Ie(I.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",us,[u[9]||(u[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ms,e.toDisplayString(e.unref(F)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie(I.value.categoryIndex).markers,(s,t)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${t}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:s.color})},null,4),e.createElementVNode("div",ps,[e.createElementVNode("div",fs,e.toDisplayString(s.title),1),s.description?(e.openBlock(),e.createElementBlock("div",vs,e.toDisplayString(s.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Se.value&&Pe.value&&S.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Ao},[u[10]||(u[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(S.value.scale*100))+"% "+e.toDisplayString(e.unref(F)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,ll),oe.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:oe.value.x+"px",top:oe.value.y+"px"}),onClick:u[0]||(u[0]=e.withModifiers(()=>{},["stop"]))},[fe.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:In},e.toDisplayString(e.unref(F)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),fe.value.addMarker&&(fe.value.downloadSvg||fe.value.downloadPng||fe.value.downloadCsv||We.value.length>0)?(e.openBlock(),e.createElementBlock("div",gs)):e.createCommentVNode("",!0),fe.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:sn},e.toDisplayString(e.unref(F)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),fe.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:To},e.toDisplayString(e.unref(F)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),fe.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Bt},e.toDisplayString(e.unref(F)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),We.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[fe.value.downloadSvg||fe.value.downloadPng||fe.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",hs)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,(s,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+t},[s.separator?(e.openBlock(),e.createElementBlock("div",ys)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(An(s)),style:e.normalizeStyle(Uo(s)),onClick:o=>_n(s)},[s.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Hn(s),class:"dss-custom-menu-content"},null,8,ks)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.icon?(e.openBlock(),e.createElementBlock("span",xs,e.toDisplayString(s.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(s.label),1)],64))],14,Cs)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),$.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:be},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:u[4]||(u[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",ws,[e.createElementVNode("h3",null,e.toDisplayString(Mt.value?e.unref(F)("chart.modalMarker.viewMarker"):oo.value?e.unref(F)("chart.modalMarker.editMarker"):e.unref(F)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:be},"×")]),e.createElementVNode("div",Es,[e.createElementVNode("div",bs,[$.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Vs,e.toDisplayString(yo($.value.categoryIndex)||""),1)),$.value.fromButton?(e.openBlock(),e.createElementBlock("div",Ss,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":u[1]||(u[1]=s=>$.value.categoryIndex=s),class:"dss-form-select",disabled:Mt.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn.value,(s,t)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${t}`,value:t},e.toDisplayString(s),9,Ms))),128))],8,Ns),[[e.vModelSelect,$.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bs,[e.createElementVNode("label",Ts,e.toDisplayString(e.unref(F)("chart.modalMarker.description")),1),Mt.value?(e.openBlock(),e.createElementBlock("div",Hs,e.toDisplayString($.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":u[2]||(u[2]=s=>$.value.description=s),placeholder:e.unref(F)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,As)),[[e.vModelText,$.value.description]])]),e.createElementVNode("div",Ls,[e.createElementVNode("label",null,e.toDisplayString(e.unref(F)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",$s,[e.createElementVNode("img",{src:ln({type:$.value.type}),alt:"Marker Icon Preview",class:"preview-icon",style:{width:"32px",height:"32px","border-radius":"50%",border:"2px solid #ddd"},onError:u[3]||(u[3]=s=>s.target.style.display="none")},null,40,Ds)])])]),e.createElementVNode("div",_s,[e.createElementVNode("div",Is,[oo.value&&!Mt.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:at},e.toDisplayString(e.unref(F)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Rs,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:be},e.toDisplayString(Mt.value?e.unref(F)("chart.modalMarker.close"):e.unref(F)("chart.modalMarker.cancel")),1),Mt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:Dn,disabled:!($.value.description&&$.value.description.length)},e.toDisplayString(oo.value?e.unref(F)("chart.modalMarker.save"):e.unref(F)("chart.contextMenu.addMarker")),9,Fs))])])])])):e.createCommentVNode("",!0)],64))}}),Ps={class:"dss-modal-title"},Zs={class:"dss-modal-actions"},jn={__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(A,{emit:zt}){const F=A,b=zt,dt=e.ref(null),w=e.ref(null),X=e.computed(()=>{const D={"max-width":F.width};return F.height!=="auto"&&(D.height=F.height,D["min-height"]="0"),D}),kt=e.computed(()=>({}));function N(){b("close-modal")}function v(){F.backDrop&&!dt.value&&b("close-modal")}function Le(D){D.target.tagName==="INPUT"&&(dt.value=D.target.tagName)}function De(){setTimeout(()=>{dt.value=null},300)}function Oe(){const D=document.body,W=document.documentElement;w.value={bodyOverflow:D.style.overflow,bodyPosition:D.style.position,bodyTop:D.style.top,bodyWidth:D.style.width,htmlOverflow:W.style.overflow,scrollY:window.scrollY},D.style.overflow="hidden",D.style.position="fixed",D.style.top=`-${w.value.scrollY}px`,D.style.width="100%",D.style.left="0",W.style.overflow="hidden"}function T(){if(!w.value)return;const D=document.body,W=document.documentElement,{bodyOverflow:P,bodyPosition:et,bodyTop:J,bodyWidth:Q,htmlOverflow:tt,scrollY:bo}=w.value;D.style.overflow=P||"",D.style.position=et||"",D.style.top=J||"",D.style.width=Q||"",D.style.left="",W.style.overflow=tt||"",window.scrollTo(0,bo||0)}return e.watch(()=>F.showModal,D=>{if(D)Oe(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const W=document.getElementById("dss-modal-backdrop");W&&(W.addEventListener("focusin",Le),W.addEventListener("focusout",De))},100);else{T(),document.body.classList.remove("dss-modal-open");const W=document.getElementById("dss-modal-backdrop");W&&(W.removeEventListener("focusin",Le),W.removeEventListener("focusout",De))}},{immediate:!0}),e.onUnmounted(()=>{F.showModal&&T()}),(D,W)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[A.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(X.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:W[0]||(W[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":A.headerType,"font-size":A.titleSize})},[e.createElementVNode("h1",Ps,[e.renderSlot(D.$slots,"title",{},()=>[W[1]||(W[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(D.$slots,"title-data"),A.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:N,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(kt.value)},[e.renderSlot(D.$slots,"content",{},()=>[W[2]||(W[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Zs,[e.renderSlot(D.$slots,"actions")])])],4),[[e.vShow,A.showModal]])])):e.createCommentVNode("",!0)]))}},Us={class:"dss-toolbar-left"},Ws=["title"],qs=["title"],Xs={class:"dss-toolbar-dropdown-wrapper"},Ys=["title"],js={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"},Ks={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"},Gs={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"},Js={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"},Qs={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"},er={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"},tr={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},or=["title"],nr=["title"],lr=["title"],ar=["title"],sr=["title"],rr=["title"],ir=["title"],cr=["title"],dr=["title"],ur={key:2,class:"dss-toolbar-separator"},mr=["title"],pr={key:4,class:"dss-toolbar-separator"},fr={key:5,class:"dss-toolbar-dropdown-wrapper"},vr=["title"],gr={class:"dss-toolbar-dropdown-ai"},hr={class:"dss-toolbar-right"},yr={key:0,class:"dss-toolbar-custom-group"},Cr={key:1,class:"dss-toolbar-separator"},kr={class:"dss-link-modal-content"},xr={class:"dss-link-modal-field"},wr={class:"dss-link-modal-label"},Er=["placeholder"],br={class:"dss-link-modal-field"},Vr={class:"dss-link-modal-label"},Sr=["placeholder"],Nr={class:"dss-image-modal-tabs"},Mr={key:0,class:"dss-image-tab-content"},Br={class:"dss-link-modal-content"},Tr={class:"dss-link-modal-field"},Hr={key:0,class:"dss-link-modal-label"},Ar=["src"],Lr={class:"dss-link-modal-field"},$r={class:"dss-link-modal-label"},Dr=["placeholder"],_r={class:"dss-link-modal-field"},Ir={class:"dss-link-modal-label"},Rr=["placeholder"],Fr={class:"dss-link-modal-field"},zr={class:"dss-link-modal-label"},Or=["placeholder"],Pr={key:1,class:"dss-image-tab-content"},Zr={class:"dss-link-modal-content"},Ur={class:"dss-link-modal-field"},Wr={class:"dss-link-modal-label"},qr=["placeholder"],Xr={class:"dss-link-modal-field"},Yr={class:"dss-link-modal-label"},jr=["placeholder"],Kr={class:"dss-link-modal-field"},Gr={class:"dss-link-modal-label"},Jr=["placeholder"],Qr={class:"dss-link-modal-field"},ei={class:"dss-link-modal-label"},ti=["placeholder"],oi={class:"dss-text-editor-title-input-container"},ni={key:0,class:"dss-text-editor-title-preview"},li={key:0},ai={key:1,class:"dss-text-editor-preview-placeholder"},si=["value","placeholder","disabled"],ri={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},ii={class:"dss-text-editor-description-input-container"},ci={key:0,class:"dss-text-editor-description-preview"},di={key:0},ui={key:1,class:"dss-text-editor-preview-placeholder"},mi=["value","placeholder","disabled"],pi={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},fi=["data-comment-id","onMouseenter"],vi=["onClick"],gi=["src","alt"],hi={key:1},yi=["onClick"],Ci=["src","alt"],ki={key:1},xi=["data-has-second-user","onClick"],wi={class:"editor-comment-marker-count"},Ei={key:4,class:"dss-text-editor-textarea-wrapper"},bi=["value","placeholder","rows","disabled"],Vi={class:"dss-text-editor-footer"},Si={class:"dss-text-editor-footer-content"},Ni={class:"dss-text-editor-footer-stat"},Mi={class:"dss-text-editor-footer-stat"},Bi={key:5,class:"dss-text-editor-content-wrapper"},Ti={key:0,class:"dss-comment-overlay-body"},Hi={class:"dss-comment-selection-wrapper"},Ai=["innerHTML"],Li={class:"dss-comment-messages-wrapper"},$i={key:0,class:"dss-comment-avatar-wrapper"},Di={class:"dss-comment-avatar"},_i=["src","alt"],Ii={key:1},Ri={class:"dss-comment-header"},Fi={class:"dss-comment-header-text"},zi={class:"dss-comment-author"},Oi={key:0,class:"dss-comment-date"},Pi=["onClick","title"],Zi={class:"dss-comment-overlay-inner"},Ui=["placeholder","onKeydown"],Wi={class:"dss-text-editor-footer"},qi={class:"dss-text-editor-footer-content"},Xi={class:"dss-text-editor-footer-stat"},Yi={class:"dss-text-editor-footer-stat"},ji=["title"],Ki=["title"],Gi={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:""},Ji={class:"dss-image-popup-content"},Qi={key:0,class:"dss-image-popup-no-alt-icon"},ec=["title"],tc=["title"],oc={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:""},nc={class:"dss-toolbar-left"},lc=["title"],ac=["title"],sc={class:"dss-toolbar-dropdown-wrapper"},rc=["title"],ic={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"},cc={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"},dc={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"},mc={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"},pc={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"},fc={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},vc=["title"],gc=["title"],hc=["title"],yc=["title"],Cc=["title"],kc=["title"],xc=["title"],wc=["title"],Ec=["title"],bc=["title"],Vc={key:2,class:"dss-toolbar-separator"},Sc={key:3,class:"dss-toolbar-dropdown-wrapper"},Nc=["title"],Mc={class:"dss-toolbar-dropdown-ai"},Bc={key:0,class:"dss-toolbar-right"},Tc={key:0,class:"dss-toolbar-separator"},Hc={key:0,class:"dss-toolbar-custom-group"},Ac={key:1,class:"dss-toolbar-separator"},Lc={name:"DSSTextEditor"},$c=Object.assign(Lc,{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:A=>typeof A=="object"&&A!==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:A=>typeof A=="object"&&A!==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(A,{expose:zt,emit:F}){const{t:b,locale:dt}=Jn.useI18n(),w=A,X=F,kt=e.useSlots(),N=`<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>`,p=e.ref(null),He=e.ref(null),$e=e.ref(!1),Re=e.ref(!1),S=e.ref(!1),D=e.ref(""),Z=e.ref({}),P=e.ref(!1),Qe=e.ref(!1),K=e.ref(""),G=e.ref(""),et=e.ref(null),Co=e.ref(null),ie=e.ref(null),Vt=e.ref(null),Rt=e.ref(""),oo=e.ref(!1),z=e.ref({}),ve=e.ref(!1),Ne=e.ref({}),uo=e.ref(null),Me=e.ref(null),mo=e.ref(!1),Fe=e.ref(""),ko=e.ref(null),tt=e.ref(""),le=e.ref(""),se=e.ref(""),St=e.ref(null),qe=e.ref(null),fo=e.ref(null),q=e.ref(null),Nt=e.ref(null),po=e.ref(!1),no=e.ref(""),Ft=e.ref({}),zt=e.ref(!1),De=e.ref("upload"),Mt=e.ref(""),ze=e.ref(null),he=e.ref(null),ot=e.ref([]),lo=e.ref([]),I=e.ref(null),ne=e.ref(!1),Oe=e.ref(""),Bt=e.ref(""),nt=e.ref(""),de=e.ref(""),Pe=e.ref(""),Xe=e.ref(""),j=e.ref(null),J=e.ref(null),dt=e.ref(null),Do=e.ref(!1),ut=e.ref(!1),Ye=e.ref(!1),lt=e.ref(null),ye=e.ref("p"),mt=e.ref(!1),ft=e.ref([]),pt=e.ref(null),Ot=e.ref(null),at=e.ref(null),vo=e.ref(!1),_o=e.ref(0),Jo=100,vt=e.ref(null),Hn=e.computed(()=>({"dss-text-editor-no-border":!C.border,"dss-text-editor-rounded":C.rounded,"dss-text-editor-full-height":C.fullHeight,"dss-comment-overlay-open":X.value!==null})),An=e.computed(()=>({})),Ln=e.computed(()=>!C.fixedHeight||C.fullHeight?{}:{height:`${1.6*14*C.rows+24+2}px`,resize:"none",overflowY:"auto"}),Qo=e.computed(()=>!C.fixedHeight||C.fullHeight?{}:{height:`${1.6*14*C.rows+32}px`,overflowY:"auto"}),xo=e.computed(()=>C.richText&&lo.value.length>0),en=e.computed(()=>{if(!C.modelValue)return"";if(C.richText){let t=C.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return t=t.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),t=t.replace(/<[^>]+>/g,""),t=t.replace(/&nbsp;/g," "),t=t.replace(/&amp;/g,"&"),t=t.replace(/&lt;/g,"<"),t=t.replace(/&gt;/g,">"),t=t.replace(/&quot;/g,'"'),t=t.replace(/&#39;/g,"'"),t=t.replace(/\s+/g," ").trim(),t}return C.modelValue}),wo=e.computed(()=>{const t=en.value.trim();return t?t.split(/\s+/).filter(n=>n.length>0).length:0}),Eo=e.computed(()=>en.value.length),re=e.computed(()=>q.value!==null&&De.value==="upload"&&tt.value&&tt.value.startsWith("data:")),H=e.computed(()=>C.titlePlaceholder||x("textEditor.placeholders.title")),bo=e.computed(()=>C.descriptionPlaceholder||x("textEditor.placeholders.description")),ae=e.computed(()=>C.placeholder||x("textEditor.placeholders.startTyping")),Be=t=>bt&&bt[t]!==void 0,R=t=>{for(let n=t+1;n<C.customToolbarSlots.length;n++)if(Be(C.customToolbarSlots[n]))return!0;return!1},Q=t=>{for(let n=t+1;n<C.customToolbarSlots.length;n++){const o=C.customToolbarSlots[n];if(Be(o)&&E(o))return!0}return!1},E=t=>C.customToolbarFloatingMap.hasOwnProperty(t)?C.customToolbarFloatingMap[t]===!0:!0,Ce=e.computed(()=>C.customToolbarSlots.some(t=>Be(t)&&E(t))),$=e.computed(()=>Be("title-slot")),tn=e.computed(()=>Be("description-slot")),Pt=t=>{if(!t||t.trim()==="")return"<html></html>";const n=t.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?t:`<html>${t}</html>`},Zt=t=>{if(!t||t.trim()==="")return"";const n=t.replace(/<!--[\s\S]*?-->/g,""),o=n.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?o.slice(6,-7).trim():n},on=t=>{if(!t)return;const n=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT,null,!1),o=[];let l=n.nextNode();for(;l;)o.push(l),l=n.nextNode();o.forEach(a=>a.remove())},nn=t=>{try{const n=String(t.getDate()).padStart(2,"0"),l=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()],a=t.getFullYear();return`${n} ${l} ${a}`}catch{return""}},ln=t=>{if(!t||typeof t!="string")return!1;const n=t.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const a=x("textEditor.started_conversation");if(a&&n===a)return!0}catch{}const l=n.toLowerCase();return l.includes("started conversation")||l.includes("démarré la conversation")||l==="started conversation"||l==="a démarré la conversation"},$n=t=>{const n=t.target.value;W("update:modelValue",n),W("change",n)},Tt=()=>{if(!j.value)return;const t=j.value;if(t.style.setProperty("text-overflow","","important"),t.style.setProperty("white-space","","important"),t.style.setProperty("overflow-x","","important"),t.style.setProperty("height","auto","important"),t.value.trim()===""){const l=t.value;t.value="M";const a=t.scrollHeight;t.value=l,t.style.setProperty("height",`${a}px`,"important"),t.style.setProperty("overflow-y","hidden","important");return}t.offsetHeight;const o=t.scrollHeight;t.style.setProperty("height",`${o}px`,"important"),t.style.setProperty("overflow-y","hidden","important")},Ut=()=>{ut.value=!0,Tt()},Dn=()=>{ut.value=!1,Io()},Io=()=>{if(!j.value)return;const t=j.value;t.style.setProperty("text-overflow","","important"),t.style.setProperty("white-space","","important"),t.style.setProperty("overflow-x","","important"),t.style.setProperty("height","auto","important");const n=t.value;t.value="M";const o=t.scrollHeight;t.value=n,t.offsetHeight,t.style.setProperty("height",`${o}px`,"important"),t.style.setProperty("overflow-y","hidden","important"),t.style.setProperty("overflow-x","hidden","important"),t.style.setProperty("text-overflow","ellipsis","important"),t.style.setProperty("white-space","nowrap","important")},_n=t=>{const o=t.target.value;ut.value&&Tt(),W("update:title",o),W("title-change",o),dt.value="title",C.richText&&(ne.value||(Bt.value=Oe.value,Pe.value=nt.value,Xe.value=de.value),I.value&&clearTimeout(I.value),ne.value=!0,I.value=setTimeout(()=>{ne.value=!1,ke()},500))},go=()=>{if(!J.value)return;const t=J.value;if(t.style.setProperty("text-overflow","","important"),t.style.setProperty("white-space","","important"),t.style.setProperty("overflow-x","","important"),t.style.setProperty("height","auto","important"),t.value.trim()===""){const l=t.value;t.value="M";const a=t.scrollHeight;t.value=l,t.style.setProperty("height",`${a}px`,"important"),t.style.setProperty("overflow-y","hidden","important");return}t.offsetHeight;const o=t.scrollHeight;t.style.setProperty("height",`${o}px`,"important"),t.style.setProperty("overflow-y","hidden","important")},an=()=>{Ye.value=!0,go()},In=()=>{Ye.value=!1,Ro()},Ro=()=>{if(!J.value)return;const t=J.value;t.style.setProperty("text-overflow","","important"),t.style.setProperty("white-space","","important"),t.style.setProperty("overflow-x","","important"),t.style.setProperty("height","auto","important");const n=t.value;t.value="M";const o=t.scrollHeight;t.value=n,t.offsetHeight,t.style.setProperty("height",`${o}px`,"important"),t.style.setProperty("overflow-y","hidden","important"),t.style.setProperty("overflow-x","hidden","important"),t.style.setProperty("text-overflow","ellipsis","important"),t.style.setProperty("white-space","nowrap","important")},sn=t=>{const o=t.target.value;Ye.value&&go(),W("update:description",o),W("description-change",o),dt.value="description",C.richText&&(ne.value||(Bt.value=Oe.value,Pe.value=nt.value,Xe.value=de.value),I.value&&clearTimeout(I.value),ne.value=!0,I.value=setTimeout(()=>{ne.value=!1,ke()},500))},je=()=>{const t=window.getSelection();if(t.rangeCount===0)return null;const n=t.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const o=n.cloneRange();return o.selectNodeContents(p.value),o.setEnd(n.startContainer,n.startOffset),{type:"text",start:o.toString().length,end:o.toString().length+n.toString().length}},Te=t=>{if(!(!t||!p.value))try{const n=window.getSelection(),o=document.createRange();if(t.type==="element"&&t.element)if(p.value.contains(t.element)){o.setStart(t.element,t.offset),o.collapse(!0),n.removeAllRanges(),n.addRange(o);return}else{p.value.focus();return}let l=0;const a=[p.value];let s=null,r=!1,i=!1;for(;!i&&(s=a.pop());)if(s.nodeType===3){const c=l+s.length;!r&&t.start>=l&&t.start<=c&&(o.setStart(s,t.start-l),r=!0),r&&t.end>=l&&t.end<=c&&(o.setEnd(s,t.end-l),i=!0),l=c}else{let c=s.childNodes.length;for(;c--;)a.push(s.childNodes[c])}n.removeAllRanges(),n.addRange(o)}catch{p.value.focus()}},Vo=()=>{if(!p.value)return;p.value.focus();const t=window.getSelection(),n=document.createRange(),o=a=>{if(a.nodeType===3||a.childNodes.length===0)return a;for(let s=a.childNodes.length-1;s>=0;s--){const r=a.childNodes[s],i=o(r);if(i)return i}return a},l=o(p.value);if(l.nodeType===3)n.setStart(l,l.length),n.setEnd(l,l.length);else if(l.childNodes.length>0){const a=o(l);a&&a.nodeType===3?(n.setStart(a,a.length),n.setEnd(a,a.length)):(n.selectNodeContents(l),n.collapse(!1))}else n.setStart(l,0),n.setEnd(l,0);t.removeAllRanges(),t.addRange(n)},ke=(t=!1)=>{if(!p.value)return;const n=p.value.innerHTML,o=C.title||"",l=C.description||"";if(!t&&n===Oe.value&&o===nt.value&&l===de.value)return;const a={content:Bt.value||Oe.value,title:Pe.value!==void 0?Pe.value:nt.value,description:Xe.value!==void 0?Xe.value:de.value},s=ot.value.length>0?ot.value[ot.value.length-1]:null;let r=!0;s&&(typeof s=="string"?r=a.content!==s:r=a.content!==s.content||a.title!==s.title||a.description!==s.description),r&&(ot.value.push(a),ot.value.length>50&&ot.value.shift(),lo.value=[]),Oe.value=n,nt.value=o,de.value=l,Bt.value=n,Pe.value=o,Xe.value=l},ee=t=>{if(!p.value)return;So(),p.value&&on(p.value);let n=null;p.value&&(p.value.querySelector("p")||(n=je(),Fo()));const o=t&&t.inputType&&(t.inputType==="insertText"||t.inputType==="insertCompositionText"||t.inputType==="deleteContentBackward"||t.inputType==="deleteContentForward");o&&lt.value&&(lt.value=null),Re.value=!0;const l=p.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),a=Pt(l);W("update:modelValue",a),W("change",a),dt.value="editor",ne.value||(Bt.value=Oe.value,Pe.value=nt.value,Xe.value=de.value),I.value&&clearTimeout(I.value),ne.value=!0,I.value=setTimeout(()=>{ne.value=!1,ke(),jo(),bn()},500),e.nextTick(()=>{n&&Te(n),So();const s=["bold","italic","underline"],r=window.getSelection(),i=r.rangeCount>0?r.getRangeAt(0):null,c=i&&i.collapsed;if(s.forEach(d=>{try{if(c&&lt.value?.command===d){z.value[d]=lt.value.state;return}if(d==="bold")if(i){const u=i.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;let f=!1;if(m&&((m.tagName==="STRONG"||m.tagName==="B"||m.closest&&m.closest("strong, b"))&&(f=!0),!f&&m.style&&parseInt(m.style.fontWeight)>=600&&(f=!0),!f))try{const g=window.getComputedStyle(m);parseInt(g.fontWeight)>=600&&(f=!0)}catch{}z.value[d]=f}else z.value.hasOwnProperty(d)||(z.value[d]=!1);else if(d==="italic")if(i){const u=i.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u,f=m&&(m.tagName==="EM"||m.tagName==="I"||m.closest&&m.closest("em, i"));z.value[d]=!!f}else{const u=document.queryCommandState(d);z.value[d]=u}else{const u=document.queryCommandState(d);z.value[d]=u}}catch{}}),xe(),Ke(),At(),fe(),$t(),Ge("handleRichTextInput"),o&&(t.inputType==="insertText"||t.inputType==="insertCompositionText")){const d=t.data||"";d&&d.length===1&&setTimeout(()=>bn(d),0),(d===" "||d===`
78
- `||/[.,;:!?]/.test(d))&&setTimeout(()=>{jo()},100)}Re.value=!1})},So=()=>{if(!p.value)return;const t=window.getSelection();if(!t||t.rangeCount===0)return;const n=t.getRangeAt(0),o=n.commonAncestorContainer,l=o.nodeType===3?o.parentElement:o;if(!l)return;const a=l.closest(".dss-image-wrapper");if(a){const s=a.querySelector("img");if(l!==s&&!s?.contains(l)){const r=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,i=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(a.contains(r)&&r!==s||a.contains(i)&&i!==s){const c=document.createRange();c.setStartAfter(a),c.collapse(!0),t.removeAllRanges(),t.addRange(c)}}}},Fo=()=>{if(!p.value)return;const t=p.value;if(t.querySelector&&t.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),o=Array.from(t.childNodes);let l=null;o.forEach(a=>{if(a.nodeType===Node.TEXT_NODE){if((a.textContent||"").trim()===""){a.parentNode===t&&t.removeChild(a);return}l||(l=document.createElement("p"),t.insertBefore(l,a)),l.appendChild(a);return}if(a.nodeType===Node.ELEMENT_NODE){const s=a,r=s.tagName;if(r==="BR"){l=null;return}if(n.has(r)){l=null;return}l||(l=document.createElement("p"),t.insertBefore(l,s)),l.appendChild(s)}})},Ke=()=>{if(p.value&&!Do.value){Do.value=!0;try{p.value.querySelectorAll(".dss-image-wrapper").forEach(l=>{l.querySelector("img")||l.remove()}),p.value.querySelectorAll(".dss-image-no-alt-icon").forEach(l=>{const a=l.parentElement;!a||!a.classList.contains("dss-image-wrapper")?l.remove():a.querySelector("img")||l.remove()}),p.value.querySelectorAll("img").forEach(l=>{let a=l.getAttribute("alt");a===null&&(a=l.alt||"");const s=l.getAttribute("src")||l.src||"";if(a){const d=s.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),u=a===s||a===d;(a.startsWith("http://")||a.startsWith("https://")||a.startsWith("data:")||u||u)&&(a="")}l.setAttribute("alt",a),l.setAttribute("data-alt",a);const r=!a||a.trim()==="";let i=l.parentElement;const c=i&&i.classList.contains("dss-image-wrapper");if(c){const d=i.querySelector(".dss-image-no-alt-icon");d&&d.remove()}else{const d=l.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?l.nextElementSibling:null;d&&d.remove()}if(r){c?i.setAttribute("contenteditable","false"):(i=document.createElement("span"),i.className="dss-image-wrapper",i.setAttribute("contenteditable","false"),l.parentNode.insertBefore(i,l),i.appendChild(l));const d=document.createElement("div");d.className="dss-image-no-alt-icon",d.setAttribute("contenteditable","false"),d.innerHTML=V,i.appendChild(d)}else if(c&&i.children.length===1){const d=i.parentNode;d.insertBefore(l,i),d.removeChild(i)}})}finally{Do.value=!1}}},rn=t=>{jo(),W("blur",t),ro()},Ht=()=>{if(C.disabled||!C.richText||!p.value)return;Ve(),I.value&&(clearTimeout(I.value),I.value=null),ne.value&&(ke(),ne.value=!1);const t=dt.value==="title",n=dt.value==="description",o=dt.value==="editor";if(ot.value.length===0){t&&j.value?j.value.focus():n&&J.value?J.value.focus():p.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{ee()});return}const l={content:p.value.innerHTML,title:C.title||"",description:C.description||""};lo.value.push(l);const a=ot.value.pop();if(a!==void 0){Re.value=!0;const s=typeof a=="string"?a:a.content,r=typeof a=="object"&&a.title||"",i=typeof a=="object"&&a.description||"";p.value.innerHTML=s,Oe.value=s,nt.value=r,de.value=i,Bt.value=s,Pe.value=r,Xe.value=i,e.nextTick(()=>{xe(),Ie(),Dt(),fe();const c=Pt(s);W("update:modelValue",c),W("update:title",r),W("update:description",i),W("change",c),W("title-change",r),W("description-change",i),Re.value=!1,e.nextTick(()=>{setTimeout(()=>{if(t){if(j.value){j.value.focus();const d=r.length;j.value.setSelectionRange&&j.value.setSelectionRange(d,d),Tt()}}else if(n){if(J.value){J.value.focus();const d=i.length;J.value.setSelectionRange(d,d)}}else if(o)Vo();else if(j.value&&document.activeElement===j.value){const d=r.length;j.value.setSelectionRange&&j.value.setSelectionRange(d,d),Tt()}else if(J.value&&document.activeElement===J.value){const d=i.length;J.value.setSelectionRange(d,d)}else p.value&&Vo()},10)})})}},cn=()=>{if(C.disabled||!C.richText||!p.value)return;Ve();const t=dt.value==="title",n=dt.value==="description",o=dt.value==="editor";if(lo.value.length===0){t&&j.value?j.value.focus():n&&J.value?J.value.focus():p.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{ee()});return}const l={content:p.value.innerHTML,title:C.title||"",description:C.description||""};ot.value.push(l);const a=lo.value.pop();if(a!==void 0){Re.value=!0;const s=typeof a=="string"?a:a.content,r=typeof a=="object"&&a.title||"",i=typeof a=="object"&&a.description||"";p.value.innerHTML=s,Oe.value=s,nt.value=r,de.value=i,Bt.value=s,Pe.value=r,Xe.value=i,e.nextTick(()=>{xe(),Ie(),Dt(),fe();const c=Pt(s);W("update:modelValue",c),W("update:title",r),W("update:description",i),W("change",c),W("title-change",r),W("description-change",i),Re.value=!1,e.nextTick(()=>{setTimeout(()=>{if(t){if(j.value){j.value.focus();const d=r.length;j.value.setSelectionRange&&j.value.setSelectionRange(d,d),Tt()}}else if(n){if(J.value){J.value.focus();const d=i.length;J.value.setSelectionRange(d,d)}}else if(o)Vo();else if(j.value&&document.activeElement===j.value){const d=r.length;j.value.setSelectionRange&&j.value.setSelectionRange(d,d),Tt()}else if(J.value&&document.activeElement===J.value){const d=i.length;J.value.setSelectionRange(d,d)}else p.value&&Vo()},10)})})}},No=()=>{if(!p.value)return;p.value.querySelectorAll('span[style*="font-weight"]').forEach(l=>{const a=l.style.fontWeight;if(a==="normal"||a==="400"){const s=document.createDocumentFragment();for(;l.firstChild;)s.appendChild(l.firstChild);l.parentNode&&l.parentNode.replaceChild(s,l)}}),p.value.querySelectorAll('span[style*="font-weight"]').forEach(l=>{if(parseInt(l.style.fontWeight)>=600){const s=document.createElement("b");for(s.style.fontWeight="600";l.firstChild;)s.appendChild(l.firstChild);l.parentNode&&l.parentNode.replaceChild(s,l)}}),p.value.querySelectorAll("b, strong").forEach(l=>{l.style.fontWeight="600"})},At=()=>{if(!p.value)return;p.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Rn=()=>{const t=window.getSelection();if(!t||t.rangeCount===0)return!1;const n=t.getRangeAt(0);let o=!1;if(n.collapsed){const l=n.startContainer;let a=l.nodeType===3?l.parentElement:l;for(;a&&a!==p.value;){if(a.tagName==="EM"||a.tagName==="I"){o=!0;break}if(a.style&&a.style.fontStyle==="italic"){o=!0;break}a=a.parentElement}}else{const l=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(l){const a=document.createTreeWalker(l,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let s;for(;s=a.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(s))){if(s.nodeType===3){let r=s.parentElement;for(;r&&r!==p.value;){if(r.tagName==="EM"||r.tagName==="I"){o=!0;break}if(r.style&&r.style.fontStyle==="italic"){o=!0;break}r=r.parentElement}}else if(s.nodeType===1){const r=s;if(r.tagName==="EM"||r.tagName==="I"){o=!0;break}if(r.style&&r.style.fontStyle==="italic"){o=!0;break}}if(o)break}}}if(o)return document.execCommand("italic",!1),e.nextTick(()=>{At()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{At()});else try{const l=n.extractContents(),a=document.createElement("em");a.style.fontStyle="italic",a.appendChild(l),n.insertNode(a),n.setStartAfter(a),n.collapse(!0),t.removeAllRanges(),t.addRange(n),e.nextTick(()=>{At()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{At()})}return!0},Fn=()=>{const t=window.getSelection();if(!t||t.rangeCount===0)return!1;const n=t.getRangeAt(0);let o=!1;if(n.collapsed){const l=n.startContainer;let a=l.nodeType===3?l.parentElement:l;for(;a&&a!==p.value;){if(a.tagName==="STRONG"||a.tagName==="B"){o=!0;break}if(a.style&&parseInt(a.style.fontWeight)>=600){o=!0;break}a=a.parentElement}}else{const l=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(l){const a=document.createTreeWalker(l,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let s;for(;s=a.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(s))){if(s.nodeType===3){let r=s.parentElement;for(;r&&r!==p.value;){if(r.tagName==="STRONG"||r.tagName==="B"){o=!0;break}if(r.style&&parseInt(r.style.fontWeight)>=600){o=!0;break}r=r.parentElement}}else if(s.nodeType===1){const r=s;if(r.tagName==="STRONG"||r.tagName==="B"){o=!0;break}if(r.style&&parseInt(r.style.fontWeight)>=600){o=!0;break}}if(o)break}}}if(o)return document.execCommand("bold",!1),e.nextTick(()=>{No()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0),s=a.startContainer;let r=s.nodeType===3?s.parentElement:s;for(;r&&r!==p.value;){if(r.tagName==="SPAN"&&r.style.fontWeight){const i=r.style.fontWeight;if(i==="normal"||i==="400"){const c=document.createElement("b");c.style.fontWeight="600";const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);c.appendChild(d),r.parentNode&&r.parentNode.replaceChild(c,r),a.setStart(c,0),a.collapse(!0),l.removeAllRanges(),l.addRange(a);break}}else if(r.tagName==="STRONG"||r.tagName==="B"){r.style.fontWeight="600";break}r=r.parentElement}if(!r||r===p.value){const i=document.createElement("b");i.style.fontWeight="600",i.innerHTML="<br>",a.insertNode(i),a.setStart(i,0),a.collapse(!0),l.removeAllRanges(),l.addRange(a)}}No()});else try{const l=n.extractContents(),a=document.createElement("b");a.style.fontWeight="600",a.appendChild(l),n.insertNode(a),n.setStartAfter(a),n.collapse(!0),t.removeAllRanges(),t.addRange(n),e.nextTick(()=>{No()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{No()})}return!0},Lt=(t,n=null)=>{if(C.disabled||!C.richText||!p.value)return;ne.value?(I.value&&(clearTimeout(I.value),I.value=null),ke(),ne.value=!1):ke(),Ve(),p.value.focus();const o=window.getSelection();let l=null;if(o&&o.rangeCount>0){const s=o.getRangeAt(0);!s.collapsed&&Xt(s)&&(l=je())}if(t==="createLink"&&n){const s=window.getSelection();if(s.rangeCount>0){const r=s.getRangeAt(0);if(r.collapsed)try{r.expand("word")}catch{const c=document.createTextNode(n);r.insertNode(c),r.selectNodeContents(c)}}}if(t==="bold"){const s=Fn();z.value.bold=s;const r=window.getSelection();r.rangeCount>0&&r.getRangeAt(0).collapsed&&(lt.value={command:"bold",state:s}),e.nextTick(()=>{l&&(Te(l),e.nextTick(()=>{const i=_e("bold");z.value.bold=i})),ee(),Ie(),fe()});return}if(t==="italic"){const s=Rn();z.value.italic=s;const r=window.getSelection();r.rangeCount>0&&r.getRangeAt(0).collapsed&&(lt.value={command:"italic",state:s}),e.nextTick(()=>{l&&(Te(l),e.nextTick(()=>{const i=_e("italic");z.value.italic=i})),ee(),At(),Ie(),fe()});return}let a=!1;try{a=document.execCommand(t,!1,n)}catch{}e.nextTick(()=>{if(l&&Te(l),["bold","italic","underline"].includes(t))try{if(t==="bold")l&&e.nextTick(()=>{const r=_e("bold");z.value.bold=r});else if(t==="italic")if(l)e.nextTick(()=>{const r=_e("italic");z.value.italic=r});else{const r=document.queryCommandState(t);z.value[t]=r}else{const r=document.queryCommandState(t);z.value[t]=r}}catch{z.value.hasOwnProperty(t)?z.value[t]=!z.value[t]:z.value[t]=!0}if(t==="createLink"&&n){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("a"):c.commonAncestorContainer.parentElement?.closest("a");d&&(!d.getAttribute("href")||d.getAttribute("href")==="")&&d.setAttribute("href",n)}p.value.querySelectorAll("a").forEach(c=>{const d=c.getAttribute("href");(!d||d===""||d==="#")&&c.setAttribute("href",n)})}ee(),Ie(),fe()})},_e=(t,n=null)=>{if(C.disabled||!p.value)return!1;try{if(t==="formatBlock"&&n){const l=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const a=l.toLowerCase();if(a==="blockquote"||a==="<blockquote>")return!0;const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0).commonAncestorContainer;return!!(i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote"))}}return l===n||l.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(t))try{const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);if(t==="bold"){let r=!1;if(a.collapsed){const i=a.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&((c.tagName==="STRONG"||c.tagName==="B"||c.closest&&c.closest("strong, b"))&&(r=!0),!r&&c.style&&parseInt(c.style.fontWeight)>=600&&(r=!0),!r))try{const d=window.getComputedStyle(c);parseInt(d.fontWeight)>=600&&(r=!0)}catch{}return z.value.hasOwnProperty(t)?z.value[t]:(z.value[t]=r,r)}else{const i=a.commonAncestorContainer.nodeType===1?a.commonAncestorContainer:a.commonAncestorContainer.parentNode;let c=!1;if(i){const d=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=d.nextNode();)if(!(typeof a.intersectsNode=="function"&&!a.intersectsNode(u))){if(u.nodeType===3){if(!(u.textContent||"").trim())continue;c=!0;let f=u.parentElement;for(;f&&f!==p.value;){if(f.tagName==="STRONG"||f.tagName==="B"){r=!0;break}if(f.style&&parseInt(f.style.fontWeight)>=600){r=!0;break}f=f.parentElement}}else if(u.nodeType===1){const m=u;if(m.tagName==="STRONG"||m.tagName==="B"){r=!0;break}if(m.style&&parseInt(m.style.fontWeight)>=600){r=!0;break}}if(r)break}}return z.value[t]=r&&c,r&&c}}if(t==="italic"){let r=!1;if(a.collapsed){const i=a.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&((c.tagName==="EM"||c.tagName==="I"||c.closest&&c.closest("em, i"))&&(r=!0),!r&&c.style&&c.style.fontStyle==="italic"&&(r=!0),!r))try{window.getComputedStyle(c).fontStyle==="italic"&&(r=!0)}catch{}return z.value.hasOwnProperty(t)?z.value[t]:(z.value[t]=r,r)}else{const i=a.commonAncestorContainer.nodeType===1?a.commonAncestorContainer:a.commonAncestorContainer.parentNode;let c=!1;if(i){const d=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=d.nextNode();)if(!(typeof a.intersectsNode=="function"&&!a.intersectsNode(u))){if(u.nodeType===3){if(!(u.textContent||"").trim())continue;c=!0;let f=u.parentElement;for(;f&&f!==p.value;){if(f.tagName==="EM"||f.tagName==="I"){r=!0;break}if(f.style&&f.style.fontStyle==="italic"){r=!0;break}f=f.parentElement}}else if(u.nodeType===1){const m=u;if(m.tagName==="EM"||m.tagName==="I"){r=!0;break}if(m.style&&m.style.fontStyle==="italic"){r=!0;break}}if(r)break}}return z.value[t]=r&&c,r&&c}}const s=document.queryCommandState(t);return a.collapsed&&z.value.hasOwnProperty(t)?z.value[t]:(z.value[t]=s,s)}return z.value.hasOwnProperty(t)?z.value[t]:!1}catch{return z.value.hasOwnProperty(t)?z.value[t]:!1}try{return document.queryCommandState(t)}catch{return!1}}catch{return!1}},zo=t=>{C.disabled||!C.richText||(He.value=He.value===t?null:t,t==="askAi"&&(Me.value=null))},Ve=()=>{He.value=null,ze.value=null},gt=t=>{Lt("formatBlock",t),Ve()},zn=t=>{if(!t||!p.value)return t;const n=y=>{let k=y.nodeType===Node.TEXT_NODE?y.parentElement:y;for(;k&&k!==p.value;){const w=k.tagName;if(w==="P"){const b=k.parentElement;if(b===p.value||b.tagName==="BLOCKQUOTE")return k}if(w==="BLOCKQUOTE")break;k=k.parentElement}return null},o=n(t.startContainer),l=n(t.endContainer);if(!o||!l)return t;const a=[],s=document.createTreeWalker(p.value,NodeFilter.SHOW_ELEMENT,{acceptNode:y=>{const k=y.tagName;if(k==="P"){const w=y.parentElement;if(w===p.value||w.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return k==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let r;for(;r=s.nextNode();)a.push(r);const i=a.indexOf(o),c=a.indexOf(l);if(i===-1||c===-1)return t;const d=Math.min(i,c),u=Math.max(i,c),m=a.slice(d,u+1);if(m.length===0)return t;const f=m[0],g=m[m.length-1],v=document.createRange();return v.setStartBefore(f),v.setEndAfter(g),v},dn=()=>{if(C.disabled||!C.richText||!p.value)return;ne.value?(I.value&&(clearTimeout(I.value),I.value=null),ke(),ne.value=!1):ke(),Ve(),p.value.focus();const t=window.getSelection();if(t.rangeCount===0)return;let n=t.getRangeAt(0);!n.collapsed&&Xt(n)&&(n=zn(n),t.removeAllRanges(),t.addRange(n));let o=null;!n.collapsed&&Xt(n)&&(o=je());const l=n.commonAncestorContainer,a=l.nodeType===1?l.tagName==="BLOCKQUOTE"?l:l.closest("blockquote"):l.parentElement?.closest("blockquote");if(!!(a&&p.value.contains(a))){if(a){const r=a.parentNode;Array.from(a.childNodes).forEach(c=>{if(c.nodeType===Node.ELEMENT_NODE)if(c.tagName==="P"||c.tagName==="DIV")r.insertBefore(c,a);else{const d=document.createElement("p");d.appendChild(c.cloneNode(!0)),r.insertBefore(d,a)}else if(c.nodeType===Node.TEXT_NODE&&c.textContent.trim()){const d=document.createElement("p");d.appendChild(c.cloneNode(!0)),r.insertBefore(d,a)}}),a.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const r=document.createElement("blockquote"),i=n.extractContents();r.appendChild(i),n.insertNode(r);const c=[],d=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode:f=>f.parentNode===r&&f.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let u;for(;u=d.nextNode();)c.push(u);if(c.forEach(f=>{const g=document.createElement("p");f.parentNode.insertBefore(g,f),g.appendChild(f)}),r.querySelectorAll("p, div").forEach(f=>{f.textContent.trim()===""&&!f.querySelector("img")&&(f.innerHTML="<br>")}),r.children.length===0&&r.textContent.trim()===""){const f=document.createElement("p");f.innerHTML="<br>",r.appendChild(f)}}e.nextTick(()=>{o&&Te(o),Dt(),ee(),fe()})},Mo=()=>{if(!p.value)return;const t=window.getSelection();if(t.rangeCount===0)return;const o=t.getRangeAt(0).commonAncestorContainer,l=o.nodeType===1?o.tagName==="BLOCKQUOTE"?o:o.closest("blockquote"):o.parentElement?.closest("blockquote");if(!l||!p.value.contains(l))return;const a=u=>{if(!u)return!1;const m=u.textContent||"",g=(u.innerHTML||"").trim();return m.trim()===""||g===""||g==="<br>"||g==="<br/>"||g==="<p></p>"||g==="<p><br></p>"||g==="<p><br/></p>"||g==="<p> </p>"||g==="<p><br> </p>"||g==="<div></div>"||g==="<div><br></div>"||g==="<div><br/></div>"};let s=null;for(o.nodeType===3?s=o.parentElement:o.tagName==="P"||o.tagName==="DIV"?s=o:s=o.closest("p, div"),s&&l.contains(s)&&a(s)&&s.remove();l.lastChild;){const u=l.lastChild;if(u.nodeType===1&&u.tagName==="BR")u.remove();else if(u.nodeType===3)if((u.textContent||"").trim()==="")u.remove();else break;else break}if(l.children.length>0)for(let u=l.children.length-1;u>=0;u--){const m=l.children[u];if((m.tagName==="P"||m.tagName==="DIV")&&a(m))m.remove();else break}let r=l.innerHTML;const i=r;r=r.replace(/(<br\s*\/?>)+$/gi,""),r!==i&&(l.innerHTML=r);const c=document.createElement("p");c.innerHTML="<br>",l.parentNode?l.nextSibling?l.parentNode.insertBefore(c,l.nextSibling):l.parentNode.appendChild(c):p.value&&p.value.appendChild(c);const d=document.createRange();d.selectNodeContents(c),d.collapse(!0),t.removeAllRanges(),t.addRange(d),e.nextTick(()=>{Dt(),ee()})},Ie=()=>{if(!p.value){$e.value=!1;return}try{const t=window.getSelection();if(t.rangeCount>0){const o=t.getRangeAt(0).commonAncestorContainer,l=o.nodeType===1?o.closest("a"):o.parentElement?.closest("a");$e.value=!!l}else $e.value=!1}catch{$e.value=!1}},Bo=()=>{if(!p.value)return;const t=window.getSelection();t&&t.rangeCount>0&&t.getRangeAt(0),Vt.value=je();const n=window.getSelection();let o="";n.rangeCount>0&&(o=n.getRangeAt(0).toString()),K.value="",G.value=o,Rt.value="",ie.value=null,Qe.value=!0,Ve(),e.nextTick(()=>{et.value&&et.value.focus()})},ht=()=>{if(!p.value)return;ne.value?(I.value&&(clearTimeout(I.value),I.value=null),ke(),ne.value=!1):ke();const t=window.getSelection();let n=null;if(t.rangeCount>0){const l=t.getRangeAt(0).commonAncestorContainer;n=l.nodeType===1?l.closest("a"):l.parentElement?.closest("a")}if(!n&&ie.value&&(n=ie.value),n&&n.parentNode){const o=document.createDocumentFragment();for(;n.firstChild;)o.appendChild(n.firstChild);if(n.parentNode.replaceChild(o,n),o.firstChild){const l=document.createRange();l.setStartBefore(o.firstChild),l.setEndAfter(o.lastChild||o.firstChild),t.removeAllRanges(),t.addRange(l),document.execCommand("removeFormat",!1),l.collapse(!1),t.removeAllRanges(),t.addRange(l)}ie.value=null}else Lt("unlink");$e.value=!1,Ve(),e.nextTick(()=>{ee(),Ie()})},h=()=>{C.disabled||!C.richText||p.value&&(ne.value?(I.value&&(clearTimeout(I.value),I.value=null),ke(),ne.value=!1):ke(),Ve(),p.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{xe(),ee(),fe()}))},Se=()=>{C.disabled||!C.richText||p.value&&(ne.value?(I.value&&(clearTimeout(I.value),I.value=null),ke(),ne.value=!1):ke(),Ve(),p.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{xe(),ee(),fe()}))},Ze=t=>{const n=t.parentElement;if(!n||n.tagName!=="OL")return null;let o=0,l=t.previousElementSibling;for(;l;)l.tagName==="LI"&&o++,l=l.previousElementSibling;return o+1},xe=()=>{if(!p.value)return;p.value.querySelectorAll("li > ol").forEach(n=>{const o=n.parentElement;if(o&&o.tagName==="LI"){const l=Ze(o);l!==null&&Array.from(n.children).filter(s=>s.tagName==="LI").forEach(s=>{s.setAttribute("data-parent-num",String(l))})}})},yt=()=>{if(C.disabled||!C.richText||!p.value)return;Ve(),p.value.focus();const t=window.getSelection();if(t.rangeCount===0)return;const n=t.getRangeAt(0),o=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!o){document.execCommand("indent",!1),e.nextTick(()=>{xe(),ee()});return}const l=o.parentElement;if(!l||l.tagName!=="OL"&&l.tagName!=="UL")return;const a=o.previousElementSibling;if(a&&a.tagName==="LI"){const s=l.tagName.toLowerCase();let r=a.querySelector(`:scope > ${s}`);r||(r=document.createElement(s),a.appendChild(r));const i=Ze(a);r.appendChild(o),i!==null&&l.tagName==="OL"&&o.setAttribute("data-parent-num",String(i)),xe();const c=document.createRange();c.selectNodeContents(o),c.collapse(!1),t.removeAllRanges(),t.addRange(c),e.nextTick(()=>{ee(),fe()})}else document.execCommand("indent",!1),e.nextTick(()=>{xe(),ee(),fe()})},we=()=>{if(C.disabled||!C.richText||!p.value)return;Ve(),p.value.focus();const t=window.getSelection();if(t.rangeCount===0)return;const n=t.getRangeAt(0),o=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!o){document.execCommand("outdent",!1),e.nextTick(()=>{xe(),ee()});return}const l=o.parentElement;if(!l||l.tagName!=="OL"&&l.tagName!=="UL")return;const a=l.parentElement;if(a&&a.tagName==="LI"){const s=a.parentElement;if(s&&(s.tagName==="OL"||s.tagName==="UL")){l.tagName==="OL"&&o.removeAttribute("data-parent-num"),s.insertBefore(o,a.nextSibling),l.children.length===0&&l.remove(),xe();const r=document.createRange();r.selectNodeContents(o),r.collapse(!1),t.removeAllRanges(),t.addRange(r),e.nextTick(()=>{ee(),fe()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{xe(),ee(),fe()})},X=e.ref(null),Ae=e.ref(null),Ue=e.ref({}),te=e.ref(""),oe=e.ref(null),U=e.ref("");e.ref("");const Ee=e.ref(null);e.ref("");const Le=e.ref([]),To=e.ref(!1),ao=e.ref(!1),un=t=>{if(!t)return"";const n=t.cloneRange(),o=document.createElement("div");return o.appendChild(n.cloneContents()),o.innerHTML},mn=()=>{if(C.disabled||!C.richText||!p.value)return;if(X.value!==null){X.value=null,te.value="",U.value="",Ee.value=null,Le.value=[],Jt(!0);return}Ve(),p.value.focus();const t=window.getSelection();if(!t||t.rangeCount===0)return;const n=t.getRangeAt(0);if(n.collapsed||!Xt(n))return;U.value=un(n)||"",Ee.value=je();const o=n.getBoundingClientRect(),l=p.value.parentElement;if(!l)return;const a=l.getBoundingClientRect(),s=o.bottom-a.top,i=Math.max(s+8,0);Ue.value={top:`${i}px`,bottom:"auto"},X.value=Date.now(),e.nextTick(()=>{if(te.value="",oe.value){const d=oe.value;d.style.height="auto",d.style.height=`${d.scrollHeight}px`,d.focus()}const c=l.querySelector(".dss-comment-overlay");if(c&&l){const d=l.querySelector(".dss-text-editor-footer");if(d){const u=l.getBoundingClientRect(),m=c.getBoundingClientRect(),f=d.getBoundingClientRect(),g=m.bottom-u.top,v=f.top-u.top,y=8;if(g>v-y){const k=f.height;Ue.value={bottom:`${k+y}px`,top:"auto"}}else Ue.value={top:`${i}px`,bottom:"auto"}}}})},fn=()=>{if(!te.value.trim())return;const t=te.value.trim(),n=new Date,o={text:t,selectionText:U.value,selectionRange:Ee.value,commentId:X.value,user:C.commentUser||null,createdAt:n.toISOString()};Le.value=[...Le.value,o],W("comment-submitted",o),On(o),Ee.value&&!Wt(Ee.value)&&ue(X.value,Ee.value),te.value="",e.nextTick(()=>{if(oe.value){const l=oe.value;l.style.height="auto",l.style.height=`${l.scrollHeight}px`,l.focus()}Ge("sendComment")})},Ct=(t,n)=>{if(!(!C.commentUser||!t.user||t.user.id!==C.commentUser.id)){if(Le.value=Le.value.filter((o,l)=>l!==n),X.value!==null&&p.value){const o=String(X.value),l=p.value.querySelector(`[data-comment="${o}"], [data-fake-comment="${o}"]`);if(l&&Le.value.length>0){const a=[],s=new Set;Le.value.forEach(r=>{r.user&&r.user.id&&!s.has(r.user.id)&&(s.add(r.user.id),a.push(r.user))}),a.length>0?l.setAttribute("data-comment-user",JSON.stringify(a[0])):l.removeAttribute("data-comment-user"),a.length>1?l.setAttribute("data-comment-user-2",JSON.stringify(a[1])):l.removeAttribute("data-comment-user-2"),l.setAttribute("data-comment-count",String(Le.value.length))}else l&&Le.value.length===0&&(l.removeAttribute("data-comment-user"),l.removeAttribute("data-comment-user-2"),l.setAttribute("data-comment-count","0"))}if(W("comment-deleted",{comment:t,index:n,commentId:X.value}),C.comments&&Array.isArray(C.comments)){const o=C.comments.filter(l=>!(l.commentId===t.commentId&&l.text===t.text&&l.user?.id===t.user?.id));W("update:comments",o)}e.nextTick(()=>{Ge("deleteComment")})}},Wt=t=>{if(!t||!p.value)return!1;try{const n=kt(t);if(!n)return!1;const o=n.commonAncestorContainer,l=o.nodeType===3?o.parentElement:o;if(l)return!!l.closest("[data-comment], [data-fake-comment]")}catch{}return!1},kt=t=>{if(!t||!p.value)return null;try{const n=document.createRange();if(t.type==="element"&&t.element)return p.value.contains(t.element)?(n.setStart(t.element,t.offset),n.collapse(!0),n):null;let o=0;const l=[p.value];let a=null,s=!1,r=!1;for(;!r&&(a=l.pop());)if(a.nodeType===3){const i=o+a.length;!s&&t.start>=o&&t.start<=i&&(n.setStart(a,t.start-o),s=!0),s&&t.end>=o&&t.end<=i&&(n.setEnd(a,t.end-o),r=!0),o=i}else{let i=a.childNodes.length;for(;i--;)l.push(a.childNodes[i])}return s?n:null}catch{return null}},ue=(t,n)=>{if(!(!t||!n||!p.value))try{const o=kt(n);if(!o||o.collapsed)return;const l=o.commonAncestorContainer,a=l.nodeType===3?l.parentElement:l;if(a){const i=a.closest("[data-comment], [data-fake-comment]");if(i){i.getAttribute("data-comment")!==String(t)&&i.getAttribute("data-fake-comment")!==String(t)&&i.setAttribute("data-comment",String(t));return}}const s=document.createElement("span");s.setAttribute("data-comment",String(t));try{const i=o.startContainer,c=o.endContainer,d=o.startOffset,u=o.endOffset,m=i.nodeType===3?i.parentNode:i,f=c.nodeType===3?c.parentNode:c;if(m===f&&d===0&&u===(c.nodeType===3?c.length:f.childNodes.length)&&(m.tagName==="P"||m.tagName==="DIV"||m.tagName==="H1"||m.tagName==="H2"||m.tagName==="H3"||m.tagName==="H4"||m.tagName==="H5"||m.tagName==="H6")){const v=o.extractContents();s.appendChild(v),o.insertNode(s)}else o.surroundContents(s)}catch{const c=o.extractContents();s.appendChild(c),o.insertNode(s)}const r=p.value.querySelector(`[data-comment="${String(t)}"]`);e.nextTick(()=>{Ge("wrapSelectionWithCommentMarker"),ee()})}catch{}},On=t=>{if(!t||!t.commentId)return;const n=Array.isArray(C.comments)?[...C.comments]:[],o=typeof t.commentId=="string"&&t.commentId.startsWith("comment-")?Date.now():Number(t.commentId)||t.commentId;let l=n.findIndex(s=>typeof s.conversation_id=="string"&&s.conversation_id.startsWith("comment-")?null:Number(s.conversation_id)===Number(o)||s.conversation_id===o);const a={text:t.text,user:t.user,createdAt:t.createdAt,created_at:t.createdAt,updated_at:t.createdAt};if(l>=0){const s=n[l];if(s.conversation||(s.conversation=[]),s.conversation.push(a),s.updated_at=t.createdAt,!s.article_id&&n.length>0){const r=n.find(i=>i.article_id);r&&(s.article_id=r.article_id)}}else{const s=t.selectionRange,r=n.length>0&&n.find(c=>c.article_id)?.article_id||null,i={conversation_id:o,article_id:r,selection_range:s?{start:s.start||0,end:s.end||0,type:s.type||"text"}:null,selection_text:t.selectionText||"",conversation:[a],created_by_user:t.user,created_at:t.createdAt,updated_at:t.createdAt,status:"active"};n.push(i)}To.value=!0,W("update:comments",n)},me=(t,n=[])=>{if(C.disabled||!C.richText||!p.value)return;const o=p.value;let l=null;try{l=o.querySelector(t)}catch{return}if(!l)return;Ve(),o.focus();const a=document.createRange();a.selectNodeContents(l);const s=window.getSelection();s&&(s.removeAllRanges(),s.addRange(a)),U.value=l.innerHTML||"",Ee.value=je();const r=a.getBoundingClientRect(),i=o.parentElement;if(i){const u=i.getBoundingClientRect(),m=r.bottom-u.top,g=Math.max(m+8,0);Ue.value={top:`${g}px`,bottom:"auto"}}const c=l.getAttribute("data-comment")||l.getAttribute("data-fake-comment");let d=[];if(c&&C.comments&&Array.isArray(C.comments)){const u=C.comments.find(m=>String(m.conversation_id)===String(c));if(u&&u.conversation&&Array.isArray(u.conversation)){const m=u.conversation.map(f=>({id:f.id||f.commentary_id,commentary_id:f.id||f.commentary_id,conversation_id:u.id||u.conversation_id,text:f.text,user:f.user,createdAt:f.created_at||f.createdAt,updated_at:f.updated_at||f.updatedAt}));d.push(...m)}}d.length===0&&Array.isArray(n)&&n.length>0&&(d=n.slice()),d.sort((u,m)=>{const f=y=>{if(!y)return 0;const k=new Date(y).getTime();return isNaN(k)?0:k},g=f(u.createdAt),v=f(m.createdAt);return g===v?0:g-v}),Le.value=d,Jt(!0),X.value=c||null,l&&(Ae.value=l,l.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(te.value="",oe.value){const u=oe.value;u.style.height="auto",u.style.height=`${u.scrollHeight}px`,u.focus()}if(i){const u=i.querySelector(".dss-comment-overlay");if(u){const m=i.querySelector(".dss-text-editor-footer");if(m){const f=i.getBoundingClientRect(),g=u.getBoundingClientRect(),v=m.getBoundingClientRect(),y=g.bottom-f.top,k=v.top-f.top,w=8;if(y>k-w){const b=v.height;Ue.value={bottom:`${b+w}px`,top:"auto"}}}}}Ge("openCommentOverlayForSelector")})},be=e.ref(null),pn=e.ref(0),Pn=t=>{if(!(C.disabled||!C.richText)){if(t.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const l=n.getRangeAt(0).commonAncestorContainer,a=l.nodeType===1?l.tagName==="BLOCKQUOTE"?l:l.closest("blockquote"):l.parentElement?.closest("blockquote");if(!!(a&&p.value&&p.value.contains(a))){t.preventDefault();let r=null;l.nodeType===3?r=l.parentElement:l.tagName==="P"||l.tagName==="DIV"?r=l:r=l.closest("p, div");const i=document.createElement("p");i.innerHTML="<br>",r&&a.contains(r)&&r.nextSibling?a.insertBefore(i,r.nextSibling):a.appendChild(i),setTimeout(()=>{Mo()},50);return}}}if(t.key.length===1||t.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const o=n.getRangeAt(0),l=o.commonAncestorContainer,a=l.nodeType===3?l.parentElement:l;if(a){const s=a.closest(".dss-image-wrapper");if(s){const r=s.querySelector("img");if(a!==r&&!r?.contains(a)){const i=o.startContainer.nodeType===3?o.startContainer.parentElement:o.startContainer,c=o.endContainer.nodeType===3?o.endContainer.parentElement:o.endContainer;if(s.contains(i)&&i!==r||s.contains(c)&&c!==r){t.preventDefault();const d=document.createRange();d.setStartAfter(s),d.collapse(!0),n.removeAllRanges(),n.addRange(d);return}}}}}}if(t.key==="Backspace"||t.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const o=n.getRangeAt(0);let l=null,a=null;if(o.collapsed)if(t.key==="Backspace"){const s=o.startContainer;let r=s;s.nodeType===3&&(o.startOffset===0?r=s.previousSibling||s.parentNode:r=s.parentNode);const i=r.previousSibling;i&&(i.classList&&i.classList.contains("dss-image-wrapper")?a=i:i.tagName==="IMG"&&(l=i,a=l.closest(".dss-image-wrapper"))),a||(a=r.closest(".dss-image-wrapper"),a&&(l=a.querySelector("img")))}else{const s=o.startContainer;let r=s;s.nodeType===3&&(o.startOffset===s.length?r=s.nextSibling||s.parentNode:r=s.parentNode);const i=r.nextSibling;i&&(i.classList&&i.classList.contains("dss-image-wrapper")?a=i:i.tagName==="IMG"&&(l=i,a=l.closest(".dss-image-wrapper"))),a||(a=r.closest(".dss-image-wrapper"),a&&(l=a.querySelector("img")))}else{const s=o.commonAncestorContainer,r=o.startContainer.nodeType===3?o.startContainer.parentElement:o.startContainer,i=o.endContainer.nodeType===3?o.endContainer.parentElement:o.endContainer;if(s.nodeType===1&&s.tagName==="IMG"?(l=s,a=l.closest(".dss-image-wrapper")):(l=s.querySelector("img"),l&&(a=l.closest(".dss-image-wrapper"))),a){const c=a.contains(r)||r===a,d=a.contains(i)||i===a,m=o.cloneContents().textContent?.trim()||"",f=a.textContent?.trim()||"";(!c||!d||m.length>f.length)&&(a=null,l=null)}}if(a){t.preventDefault(),t.stopPropagation();const s=a.parentNode;if(s){const r=document.createTextNode("");s.insertBefore(r,a),a.remove();const i=document.createRange();i.setStartAfter(r),i.collapse(!0),n.removeAllRanges(),n.addRange(i),e.nextTick(()=>{ee()});return}}}}if(t.key==="Tab"){t.preventDefault(),t.shiftKey?we():yt();return}if(t.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const o=n.getRangeAt(0);if(o.collapsed){const r=o.startContainer,i=c=>{if(!c)return!1;let d=c.previousSibling;for(;d;){if(d.classList&&d.classList.contains("dss-image-wrapper")||d.tagName==="IMG"||d.querySelector&&d.querySelector(".dss-image-wrapper")||d.querySelector&&d.querySelector("img"))return!0;d=d.previousSibling}const u=c.parentElement;return u&&u!==p.value?i(u):!1};if(r.nodeType===3){const c=r.parentElement;if(c&&(i(c)||i(r))){const d=c.closest("p, div");if(d&&d!==p.value){t.preventDefault(),t.stopPropagation();let u=null;const m=o.startOffset;m<r.length&&(u=r.splitText(m));const f=document.createElement("p");if(u?f.appendChild(u):f.innerHTML="<br>",r.length===0){const v=r.parentElement;v&&(v.removeChild(r),v.childNodes.length===0&&v.appendChild(document.createElement("br")))}d.nextSibling?d.parentNode.insertBefore(f,d.nextSibling):d.parentNode.appendChild(f);const g=document.createRange();u?g.setStart(u,0):g.setStart(f,0),g.collapse(!0),n.removeAllRanges(),n.addRange(g),e.nextTick(()=>{ee()});return}}}}const l=o.commonAncestorContainer,a=l.nodeType===1?l.tagName==="BLOCKQUOTE"?l:l.closest("blockquote"):l.parentElement?.closest("blockquote");if(!!(a&&p.value&&p.value.contains(a))){let r=null;l.nodeType===3?r=l.parentElement:l.tagName==="P"||l.tagName==="DIV"?r=l:r=l.closest("p, div");const i=v=>{if(!v)return!1;const y=v.textContent||"",w=(v.innerHTML||"").trim(),b=w.replace(/<br\s*\/?>/gi,"").trim();return y.trim()===""||w===""||b===""||w==="<br>"||w==="<br/>"||w==="<p></p>"||w==="<p><br></p>"||w==="<p><br/></p>"||w==="<p> </p>"||w==="<p><br> </p>"||w==="<div></div>"||w==="<div><br></div>"||w==="<div><br/></div>"},c=a.lastChild,d=c&&c.nodeType===1&&c.tagName==="BR",u=o.startContainer,m=u.nodeType===3?u.parentElement:u,f=m===a||m&&m.parentElement===a;if(r&&i(r)||d&&f){t.preventDefault(),setTimeout(()=>{Mo()},50);return}}}}if(t.key===" "){const n=Date.now(),o=n-pn.value;if(be.value===" "&&o<300){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0),s=a.commonAncestorContainer.nodeType===1?a.commonAncestorContainer.closest("li"):a.commonAncestorContainer.parentElement?.closest("li");if(s){const r=a.startContainer.textContent?.substring(0,a.startOffset)||"";if((s.textContent||"").indexOf(r.trim())<=10||r.trim().length<=2){t.preventDefault(),yt();return}}}}be.value=" ",pn.value=n}else be.value=t.key}},Oo=t=>{if(C.disabled||!C.richText)return;t.preventDefault();let n=t.clipboardData.getData("text/html"),o=t.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),o&&(o=o.replace(/<!--[\s\S]*?-->/g,"")),ke();const l=window.getSelection();let a=null;if(l&&l.rangeCount>0){let i=l.getRangeAt(0).commonAncestorContainer;i.nodeType===3&&(i=i.parentNode),a=i.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const s=r=>{const c=new DOMParser().parseFromString(r,"text/html");let d=p.value.querySelector("h1")?1:0;if(c.querySelectorAll("h1").forEach(m=>{if(d>0){const f=c.createElement("p");f.innerHTML=m.innerHTML,m.parentNode.replaceChild(f,m)}else d++}),a){const m=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],f=Array.from(c.body.children).filter(g=>m.includes(g.tagName));if(f.length===1){const g=f[0].tagName,v=a.tagName,y=a.textContent.trim()===""&&!a.querySelector("img");let k=!1;if(["H1","H2","H3","H4","H5","H6"].includes(v)?k=!0:y||(g===v||g==="P")&&(k=!0),k)return f[0].innerHTML.trim()}}return c.body.innerHTML.trim()};if(n){const r=s(n);document.execCommand("insertHTML",!1,r)}else if(o)if(/<[a-z][\s\S]*>/i.test(o)){const i=s(o);document.execCommand("insertHTML",!1,i)}else document.execCommand("insertText",!1,o);ee()},vn=t=>{if(He.value){const o=t.target;!o.closest(".dss-toolbar-dropdown")&&!o.closest(".dss-toolbar-dropdown-toggle")&&Ve()}if(ve.value){const o=t.target,l=o.closest(".dss-floating-toolbar"),a=p.value&&o.closest(".dss-text-editor-content");!l&&!a&&ro()}if(Me.value){const o=t.target,l=o.closest(".dss-floating-toolbar"),a=o.closest(".dss-toolbar-dropdown");!l&&!a&&kn()}const n=t.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(ze.value=null),!p.value||!n.closest(".dss-text-editor-content")){const o=window.getSelection();if(o&&o.rangeCount>0){const l=o.getRangeAt(0);mt.value=!l.collapsed&&Xt(l)}else mt.value=!1}if(X.value!==null){const o=document.querySelector(".dss-comment-overlay");let l=!1;if(o){const r=o.getBoundingClientRect(),i=t.clientX,c=t.clientY;l=i>=r.left&&i<=r.right&&c>=r.top&&c<=r.bottom}const a=n.closest(".dss-toolbar-button"),s=a&&a.getAttribute("title")==="Comment";!l&&!s&&(X.value=null,te.value="",U.value="",Ee.value=null,Le.value=[],Jt(!0))}},Po=(t,n)=>{t&&t.stopPropagation&&t.stopPropagation(),he.value&&(clearTimeout(he.value),he.value=null),ze.value=n},ce=t=>{const n=t.relatedTarget;if(n){const o=n.closest(".dss-toolbar-dropdown-submenu"),l=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(o||l)return}he.value&&clearTimeout(he.value),he.value=setTimeout(()=>{ze.value=null,he.value=null},150)},Zo=t=>{ze.value=null};let gn=0;const hn=t=>{if(!t)return;const n=Array.from(t.children);n.forEach(o=>{o.classList.contains("dss-toolbar-dropdown-submenu")||o.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(o.tagName==="BUTTON"||o.tagName==="DIV")&&!o.classList.contains("dss-toolbar-dropdown-item")&&o.classList.add("dss-toolbar-dropdown-item")}),n.forEach((o,l)=>{if(o.classList.contains("dss-toolbar-dropdown-item-has-submenu")||o.classList.contains("dss-toolbar-dropdown-submenu")||!o.classList.contains("dss-toolbar-dropdown-item"))return;const a=Array.from(o.children).find(i=>i.tagName==="DIV"?i.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(i.children).filter(d=>d.tagName==="BUTTON"||d.tagName==="DIV").length>0:!1),s=o.nextElementSibling,r=s&&!s.classList.contains("dss-toolbar-dropdown-submenu")&&!s.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&s.tagName==="DIV"&&!s.classList.contains("dss-toolbar-dropdown-item")&&Array.from(s.children).some(i=>i.tagName==="BUTTON"||i.tagName==="DIV");if(a||r){const i=`submenu-auto-${++gn}`;o.classList.add("dss-toolbar-dropdown-item-has-submenu"),o.setAttribute("data-submenu-id",i);let c=null;a?(o.tagName==="BUTTON"&&o.parentNode.insertBefore(a,o.nextSibling),a.classList.add("dss-toolbar-dropdown-submenu"),c=a):r&&(s.classList.add("dss-toolbar-dropdown-submenu"),c=s),c&&(c.setAttribute("data-submenu-id",i),c.setAttribute("data-processed","true"),a&&o.tagName!=="BUTTON"?c.dataset.originalParentRef="inside":c.dataset.originalParentRef="sibling",Array.from(c.children).forEach(u=>{(u.tagName==="BUTTON"||u.tagName==="DIV")&&!u.classList.contains("dss-toolbar-dropdown-item")&&u.classList.add("dss-toolbar-dropdown-item")}))}})},yn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{hn(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(a=>{const s=a._subMenuHandlers;s&&(a.removeEventListener("mouseenter",s.enter),a.removeEventListener("mouseleave",s.leave));const r=c=>{const d=a.getAttribute("data-submenu-id");d&&Po(c,d)},i=ce;a.addEventListener("mouseenter",r),a.addEventListener("mouseleave",i),a._subMenuHandlers={enter:r,leave:i}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const s=a._subMenuHandlers;s&&(a.removeEventListener("mouseenter",s.enter),a.removeEventListener("mouseleave",s.leave));const r=d=>{const u=a.getAttribute("data-submenu-id");u&&Po(d,u)},i=ce;a.addEventListener("mouseenter",r),a.addEventListener("mouseleave",i),a._subMenuHandlers={enter:r,leave:i},a.querySelectorAll(".dss-toolbar-dropdown-item").forEach(d=>{d.addEventListener("click",Zo)})})})};let so=null;const Ho=()=>{if(ze.value){const t=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${ze.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${ze.value}"]`);t&&n&&Mn(t,n)}if(ve.value&&fe(),C.richText){if(so!==null)return;so=setTimeout(()=>{so=null,Ge("handleWindowResize")},150)}},qt=()=>{if(!C.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(l=>l.tagName==="DIV"&&!l.classList.contains("dss-toolbar-button")).forEach(l=>{l.classList.add("dss-toolbar-button")})})},Uo=()=>{const t=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=o=>{if(o.preventDefault(),o.stopPropagation(),window.getSelection){const l=window.getSelection();l.removeAllRanges?l.removeAllRanges():l.empty&&l.empty()}return!1};t.forEach(o=>{o.addEventListener("selectstart",n),o.addEventListener("mousedown",n),o.addEventListener("dragstart",n),o.addEventListener("contextmenu",n),o.addEventListener("click",l=>{if(window.getSelection){const a=window.getSelection();a.removeAllRanges&&a.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{ut.value?Tt():Io(),Ye.value?go():Ro()})}),e.nextTick(()=>{Uo()}),C.richText&&p.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",vn),window.addEventListener("resize",Ho);let t=null;const n=()=>{t===null&&(t=setTimeout(()=>{t=null,Ho()},150))};window.addEventListener("scroll",n,!0),p.value._windowScrollHandler=n,p.value._windowScrollTimeout=t,p.value.closest(".editor-with-comments"),p.value.closest(".dss-text-editor-content-wrapper");const o=p.value.closest(".dss-text-editor-content");let l=null;const a=()=>{l===null&&(l=setTimeout(()=>{l=null,Ho()},150))};o&&(o.addEventListener("scroll",a),p.value._scrollHandlers={wrapper:null,content:o,handler:a}),e.nextTick(()=>{yn(),qt()}),p.value.addEventListener("click",i=>{const c=i.target;c.closest("a")&&!C.disabled&&i.preventDefault();const u=c.closest(".dss-image-no-alt-icon"),m=c.closest(".dss-image-wrapper");if(u||m&&c===m){i.preventDefault(),i.stopPropagation();const f=window.getSelection(),g=document.createRange();g.setStartAfter(m),g.collapse(!0),f.removeAllRanges(),f.addRange(g)}else m&&c.tagName!=="IMG"&&(i.preventDefault(),e.nextTick(()=>{const f=window.getSelection();if(f.rangeCount>0){const v=f.getRangeAt(0).commonAncestorContainer,y=v.nodeType===3?v.parentElement:v;if(m.contains(y)&&y!==m.querySelector("img")){const k=document.createRange();k.setStartAfter(m),k.collapse(!0),f.removeAllRanges(),f.addRange(k)}}else{const g=document.createRange();g.setStartAfter(m),g.collapse(!0),f.addRange(g)}}))},!0),p.value.addEventListener("mousedown",i=>{const c=i.target,d=c.closest(".dss-image-no-alt-icon"),u=c.closest(".dss-image-wrapper");if(d||u&&c.tagName!=="IMG"){i.preventDefault();const m=window.getSelection(),f=document.createRange();u&&(f.setStartAfter(u),f.collapse(!0),m.removeAllRanges(),m.addRange(f))}},!0),p.value.addEventListener("paste",i=>{e.nextTick(()=>{if(!p.value)return;p.value.querySelectorAll("img").forEach(d=>{if(!d.closest(".dss-image-wrapper"))d.removeAttribute("alt"),d.removeAttribute("data-alt"),d.setAttribute("alt",""),d.setAttribute("data-alt",""),d.alt="";else{const m=d.getAttribute("alt")||d.alt||"";if(m){const f=d.getAttribute("src")||d.src||"",g=f.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),v=m===f||m===g;(m.startsWith("http://")||m.startsWith("https://")||m.startsWith("data:")||v||v)&&(d.setAttribute("alt",""),d.setAttribute("data-alt",""),d.alt="")}}}),Ke()})});let s=null;const r=new MutationObserver(i=>{i.forEach(c=>{c.addedNodes.forEach(d=>{if(d.nodeType===1){d.tagName==="IMG"&&(d.removeAttribute("alt"),d.removeAttribute("data-alt"),d.setAttribute("alt",""),d.setAttribute("data-alt",""),d.alt="");const u=d.querySelectorAll&&d.querySelectorAll("img");u&&u.forEach(m=>{m.removeAttribute("alt"),m.removeAttribute("data-alt"),m.setAttribute("alt",""),m.setAttribute("data-alt",""),m.alt=""})}})}),s&&clearTimeout(s),s=setTimeout(()=>{Ke(),qt(),s=null},100)});if(r.observe(p.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const i=document.querySelector(".dss-text-editor-toolbar");if(i){const c=new MutationObserver(()=>{e.nextTick(()=>{qt()})});c.observe(i,{childList:!0,subtree:!0}),i._toolbarMutationObserver=c}}),C.modelValue){const i=Zt(C.modelValue);p.value.innerHTML=i,Fo()}e.nextTick(()=>{const i=p.value.innerHTML||"",c=C.title||"",d=C.description||"";Oe.value=i,nt.value=c,de.value=d,Pe.value=c,Xe.value=d,xe(),Ke(),At(),$t(),Go(),Gt()}),Ie(),Dt(),p.value._mutationObserver=r}}),e.onUnmounted(()=>{if(document.removeEventListener("click",vn),window.removeEventListener("resize",Ho),p.value&&p.value._windowScrollHandler&&window.removeEventListener("scroll",p.value._windowScrollHandler,!0),so!==null&&(clearTimeout(so),so=null),p.value&&p.value._windowScrollTimeout!==null&&clearTimeout(p.value._windowScrollTimeout),I.value&&clearTimeout(I.value),he.value&&clearTimeout(he.value),p.value&&p.value._mutationObserver&&p.value._mutationObserver.disconnect(),pt.value&&pt.value.disconnect(),Ot.value!==null&&(cancelAnimationFrame(Ot.value),Ot.value=null),at.value!==null&&(clearTimeout(at.value),at.value=null),vt.value!==null&&(clearTimeout(vt.value),vt.value=null),Jt(!0),p.value&&p.value._scrollHandlers){const{wrapper:n,content:o,handler:l}=p.value._scrollHandlers;n&&n.removeEventListener("scroll",l),o&&o.removeEventListener("scroll",l)}const t=document.querySelector(".dss-text-editor-toolbar");t&&t._toolbarMutationObserver&&t._toolbarMutationObserver.disconnect()});const Cn=t=>{const n=t.target,o=n.closest("a");if(o&&!C.disabled){t.preventDefault();const a=document.createRange();a.selectNodeContents(o);const s=window.getSelection();s.removeAllRanges(),s.addRange(a)}const l=n.closest(".dss-image-wrapper");l&&n.tagName!=="IMG"?e.nextTick(()=>{const a=window.getSelection();if(a.rangeCount>0){const r=a.getRangeAt(0).commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(l.contains(i)&&i!==l.querySelector("img")){const c=document.createRange();c.setStartAfter(l),c.collapse(!0),a.removeAllRanges(),a.addRange(c)}}Ke(),Ie(),Dt(),fe(),$t()}):e.nextTick(()=>{Ke(),Ie(),Dt(),fe(),$t()})},Wo=()=>{So();const t=window.getSelection();if(t&&t.rangeCount>0){const o=t.getRangeAt(0);mt.value=!o.collapsed&&Xt(o),!o.collapsed&&lt.value&&(lt.value=null)}else mt.value=!1;if(Ke(),Ie(),Dt(),fe(),$t(),t&&t.rangeCount>0){const l=t.getRangeAt(0).commonAncestorContainer,a=l.nodeType===3?l.parentElement:l;if(a&&a.closest(".dss-text-editor-footer")){t.removeAllRanges(),mt.value=!1;return}}["bold","italic","underline"].forEach(o=>{try{const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);if(!a.collapsed)if(o==="bold"){const s=a.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;let i=!1;if(r&&((r.tagName==="STRONG"||r.tagName==="B"||r.closest&&r.closest("strong, b"))&&(i=!0),!i&&r.style&&parseInt(r.style.fontWeight)>=600&&(i=!0),!i))try{const c=window.getComputedStyle(r);parseInt(c.fontWeight)>=600&&(i=!0)}catch{}z.value[o]=i}else{const s=document.queryCommandState(o);z.value[o]=s}}}catch{}})},$t=()=>{if(!C.richText||C.disabled||!p.value){ye.value="p";return}try{const t=window.getSelection();if(!t||t.rangeCount===0){ye.value="p";return}const o=t.getRangeAt(0).commonAncestorContainer,l=o.nodeType===3?o.parentElement:o;if(!l||!p.value.contains(l)){ye.value="p";return}const a=l.closest("h1, h2, h3, h4, h5, h6, p");if(!a){ye.value="p";return}const s=a.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(s)?ye.value=s:ye.value="p"}catch{ye.value="p"}},Dt=()=>{if(!p.value){oo.value=!1;return}try{const t=window.getSelection();let n=!1;if(t.rangeCount>0){const l=t.getRangeAt(0).commonAncestorContainer,a=l.nodeType===1?l.tagName==="BLOCKQUOTE"?l:l.closest("blockquote"):l.parentElement?.closest("blockquote");n=!!(a&&p.value.contains(a))}oo.value=n}catch{oo.value=!1}},Xt=t=>{if(!t||!p.value)return!1;const n=t.commonAncestorContainer;if(!n)return!1;const o=n.nodeType===3?n.parentElement:n;return o?p.value.contains(o):!1},ro=()=>{ve.value=!1},fe=()=>{if(!C.floatingToolbar||!C.richText||C.disabled){ve.value=!1;return}const t=window.getSelection();if(!t||t.rangeCount===0){ve.value=!1;return}const n=t.getRangeAt(0);if(n.collapsed||!Xt(n)){ve.value=!1;return}const o=n.getBoundingClientRect();if(!o||o.width===0&&o.height===0){ve.value=!1;return}const l=p.value;if(!l){ve.value=!1;return}const a=l.getBoundingClientRect();if(!a||a.width===0){ve.value=!1;return}const s=40,r=8,i=o.top-s/2+15;let c=o.left+o.width/2;const d=window.innerWidth||document.documentElement.clientWidth||0;let u=0;uo.value&&(u=uo.value.getBoundingClientRect().width);const m=(u||320)/2;let f=a.left+m,g=a.right-m;if(g<f){const v=a.left+a.width/2;f=v,g=v}if(d>0){const v=m+r,y=d-m-r;if(f=Math.max(f,v),g=Math.min(g,y),g<f){const k=d/2;f=k,g=k}}c<f?c=f:c>g&&(c=g),Ne.value={position:"fixed",top:`${Math.max(i,8)}px`,left:`${c}px`,transform:"translate(-50%, -100%)",zIndex:10003},ve.value=!0},qo=t=>{C.disabled||!C.richText||(Me.value=Me.value===t?null:t,t==="askAi"&&(He.value=null))},kn=()=>{Me.value=null,ze.value=null},Yt=t=>{gt(t),kn()};let _t=null,io=null,jt=null,st=null;const Zn=t=>{if(C.disabled||!C.richText){ho(),yo();return}const n=t.target,o=n.closest("a"),l=n.closest("img");if(_t&&(clearTimeout(_t),_t=null),jt&&(clearTimeout(jt),jt=null),o&&o!==io){yo(),io=o;let a=o.getAttribute("href")||"";(!a||a==="#"||a==="")&&(a=o.textContent||""),ie.value=o,D.value=a,S.value=!0,P.value=!0,wn(o)}else!o&&io?(io=null,_t=setTimeout(()=>{P.value||ho()},150)):o&&o===io&&wn(o);if(l&&l!==st){ho(),st=l;let a=l.getAttribute("alt");a===null&&(a=l.alt||"");let s=l.getAttribute("data-alt");s===null&&(s=a),l.hasAttribute("alt")||l.setAttribute("alt",a),l.hasAttribute("data-alt")||l.setAttribute("data-alt",s),q.value=l,no.value=a.trim()||x("textEditor.image.noAlt"),po.value=!0,zt.value=!0,Xo(l)}else!l&&st?(st=null,jt=setTimeout(()=>{zt.value||yo()},150)):l&&l===st&&Xo(l)},xn=t=>{const n=t.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(io=null,st=null,_t&&(clearTimeout(_t),_t=null),jt&&(clearTimeout(jt),jt=null),ho(),yo())},ho=()=>{P.value=!1,setTimeout(()=>{P.value||(S.value=!1,D.value="",Qe.value||(ie.value=null))},100)},wn=t=>{if(!t||!p.value)return;const n=t.getBoundingClientRect(),a=n.top-32-8,s=n.left+n.width/2;Z.value={position:"fixed",top:`${a}px`,left:`${s}px`,transform:"translateX(-50%)",zIndex:10002}},yo=()=>{zt.value=!1,setTimeout(()=>{zt.value||(po.value=!1,no.value="",mo.value||(q.value=null))},100)},Xo=t=>{if(!t||!p.value)return;const n=t.getBoundingClientRect(),a=n.top-32-8,s=n.left+n.width/2;Ft.value={position:"fixed",top:`${a}px`,left:`${s}px`,transform:"translateX(-50%)",zIndex:10002}},Un=()=>{if(!D.value||!ie.value)return;let n=ie.value.getAttribute("href")||D.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Wn=()=>{if(ie.value){const t=ie.value.textContent||"",n=ie.value.getAttribute("href")||"",o=ie.value;K.value=n,G.value=t,Rt.value=t,P.value=!1,S.value=!1,D.value="",ie.value=o,Qe.value=!0}else if($e.value){const t=window.getSelection();if(t.rangeCount>0){const o=t.getRangeAt(0).commonAncestorContainer,l=o.nodeType===1?o.closest("a"):o.parentElement?.closest("a");if(l){const a=l.textContent||"",s=l.getAttribute("href")||"";K.value=s,G.value=a,Rt.value=a,ie.value=l,Qe.value=!0}}}else{Vt.value=je();const t=window.getSelection();let n="";t.rangeCount>0&&(n=t.getRangeAt(0).toString()),K.value="",G.value=n,Rt.value="",ie.value=null,Qe.value=!0}e.nextTick(()=>{et.value&&(et.value.focus(),et.value.select())})},Kt=()=>{Qe.value=!1,K.value="",G.value="",Rt.value="",ie.value=null,Vt.value=null},Yo=()=>{if(!K.value.trim()){Kt();return}if(ne.value?(I.value&&(clearTimeout(I.value),I.value=null),ke(),ne.value=!1):ke(),G.value.trim()||(G.value=K.value.trim()),ie.value&&p.value&&p.value.contains(ie.value)){const t=window.getSelection();t.rangeCount>0&&t.removeAllRanges();const n=ie.value;if(n.setAttribute("href",K.value.trim()),G.value.trim()!==Rt.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=G.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const o=document.createRange();o.selectNodeContents(n),o.collapse(!1),t.removeAllRanges(),t.addRange(o),ee()}else if(p.value){p.value.focus();const t=window.getSelection();t.removeAllRanges(),Vt.value&&Te(Vt.value);let n=null;if(t.rangeCount>0&&(n=t.getRangeAt(0)),n&&!n.collapsed){n.toString();let o=n.endContainer;o.nodeType===3&&(o=o.parentElement);const l=o.closest("p, div, h1, h2, h3, h4, h5, h6"),a=document.createElement("a");if(a.href=K.value.trim(),a.textContent=G.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",l&&l!==p.value){l.textContent="",l.appendChild(a);const s=document.createTextNode(" ");l.appendChild(s);const r=document.createRange();r.setStartAfter(s),r.collapse(!0),t.removeAllRanges(),t.addRange(r)}else{n.deleteContents(),n.insertNode(a);const s=document.createTextNode(" ");n.setStartAfter(a),n.insertNode(s),n.setStartAfter(s),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}}else{n||(n=document.createRange(),n.selectNodeContents(p.value),n.collapse(!1));const o=n.startContainer,l=o.nodeType===3,a=l&&n.startOffset===o.textContent.length,s=document.createElement("a");if(s.href=K.value.trim(),s.textContent=G.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",a){let r=o.parentElement;for(;r&&r!==p.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(r.tagName);)r=r.parentElement;if(r&&r!==p.value){let i=r.nextElementSibling;if(i&&(i.innerHTML==="<br>"||i.innerHTML==="<br/>"||i.textContent.trim()==="")){i.textContent="",i.appendChild(s);const c=document.createTextNode(" ");i.appendChild(c);const d=document.createRange();d.setStartAfter(s),d.collapse(!0),t.removeAllRanges(),t.addRange(d)}else{if(n.startOffset>0){const d=o.textContent.substring(0,n.startOffset),u=d[d.length-1];if(u&&u!==" "&&u!==" "&&u!==`
79
- `){const m=document.createTextNode(" ");n.insertNode(m),n.setStartAfter(m)}}n.insertNode(s);const c=document.createTextNode(" ");n.setStartAfter(s),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}}}else{if(l&&n.startOffset>0){const i=o.textContent.substring(0,n.startOffset),c=i[i.length-1];if(c&&c!==" "&&c!==" "&&c!==`
80
- `){const d=document.createTextNode(" ");n.insertNode(d),n.setStartAfter(d)}}n.insertNode(s);const r=document.createTextNode(" ");n.setStartAfter(s),n.insertNode(r),n.setStartAfter(r),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}}ee()}e.nextTick(()=>{Ie(),Kt()})},jo=()=>{if(!p.value||Re.value)return;const t=window.getSelection();let n=null;t&&t.rangeCount>0&&(n=je());const o=/(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,l=document.createTreeWalker(p.value,NodeFilter.SHOW_TEXT,{acceptNode:i=>{const c=i.parentElement;return!c||c.closest("a")||c.closest(".dss-image-wrapper")||!i.textContent||i.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let s;for(;s=l.nextNode();)a.push(s);let r=!1;for(let i=a.length-1;i>=0;i--){const c=a[i],d=c.textContent;o.lastIndex=0;const u=[...d.matchAll(o)];if(u.length===0)continue;const m=u.filter(v=>{const y=v[0],k=v.index;if(k>0&&d[k-1]==="@"||k+y.length<d.length&&d[k+y.length]==="@")return!1;const w=c.parentElement;return!(w&&w.closest("a"))});if(m.length===0)continue;if(m.length===1&&m[0][0]===d.trim()){const v=m[0][0],y=v.startsWith("http://")||v.startsWith("https://")?v:`https://${v}`,k=document.createElement("a");k.href=y,k.textContent=v,k.style.color="#60afdf",k.style.textDecoration="underline",c.parentNode&&(c.parentNode.replaceChild(k,c),r=!0);continue}let f=0;const g=document.createDocumentFragment();if(m.forEach(v=>{const y=v.index,k=v[0];if(y>f){const A=d.substring(f,y);A&&g.appendChild(document.createTextNode(A))}const w=k.startsWith("http://")||k.startsWith("https://")?k:`https://${k}`,b=document.createElement("a");b.href=w,b.textContent=k,b.style.color="#60afdf",b.style.textDecoration="underline",g.appendChild(b),f=y+k.length}),f<d.length){const v=d.substring(f);v&&g.appendChild(document.createTextNode(v))}c.parentNode&&g.childNodes.length>0&&(c.parentNode.replaceChild(g,c),r=!0)}r&&n&&e.nextTick(()=>{Te(n),Ie()})},En=()=>{if(!p.value)return;const t=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(p.value,NodeFilter.SHOW_TEXT,{acceptNode:a=>{const s=a.parentElement;return!s||s.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),o=[];let l;for(;l=n.nextNode();)o.push(l);for(let a=o.length-1;a>=0;a--){const s=o[a],r=s.textContent,i=[...r.matchAll(t)];if(i.length===0)continue;let c=0;const d=document.createDocumentFragment();i.forEach(u=>{const m=u.index,f=u[0].startsWith("<u>")?"u":"ins",g=u[1]||u[2]||"";m>c&&d.appendChild(document.createTextNode(r.substring(c,m)));const v=document.createElement(f);v.textContent=g,d.appendChild(v),c=m+u[0].length}),c<r.length&&d.appendChild(document.createTextNode(r.substring(c))),s.parentNode&&d.childNodes.length>0&&s.parentNode.replaceChild(d,s)}},bn=t=>{if(!p.value||Re.value)return;if(!t){En();return}if(!["*","_",">"].includes(t))return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(!l.collapsed)return;const a=l.startContainer.nodeType===Node.TEXT_NODE?l.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):l.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!a||a===p.value||!p.value.contains(a))return;const s=()=>{let A="",N=0,T=!1;const L=document.createTreeWalker(a,NodeFilter.SHOW_TEXT,{acceptNode:F=>F.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(a,NodeFilter.SHOW_TEXT,null);let M=0;for(;L.nextNode();){const F=L.currentNode,O=F.textContent||"",pe=M;if(M+=O.length,F===l.startContainer){A+=O.substring(0,l.startOffset),N=pe+l.startOffset,T=!0;break}A+=O}return T||(N=A.length),{textBeforeCursor:A,cursorCharOffset:N}},{textBeforeCursor:r}=s();if(!r.length)return;let i=null,c=null;if(r.endsWith("**")&&(i=r.match(/\*\*(.+?)\*\*$/s))||r.endsWith("__")&&(i=r.match(/__(.+?)__$/s))?c="strong":r.endsWith("*")&&!r.endsWith("**")&&(i=r.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||r.endsWith("_")&&!r.endsWith("__")&&(i=r.match(new RegExp("(?<!_)_([^_]+)_$")))?c="em":t===">"&&((i=r.match(/<u>(.+?)<\/u>$/s))||(i=r.match(/<ins>(.+?)<\/ins>$/s)))&&(c=i[0].startsWith("<u>")?"u":"ins",i[0].startsWith("<u>"),i[0].startsWith("<u>")),!i||!i[1])return;const d=i[0],u=i[1],m=r.length-d.length,g=(A=>{let N=0;const T=document.createTreeWalker(a,NodeFilter.SHOW_TEXT,{acceptNode:M=>M.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let L;for(;L=T.nextNode();){const M=(L.textContent||"").length;if(N+M>=A)return{node:L,offset:A-N};N+=M}return null})(m);if(!g)return;const v=document.createRange();v.setStart(g.node,g.offset),v.setEnd(l.endContainer,l.endOffset);const y=document.createElement(c);y.textContent=u,v.deleteContents(),v.insertNode(y);const k=window.getSelection(),w=document.createRange();w.setStartAfter(y),w.collapse(!0),k.removeAllRanges(),k.addRange(w);const b=je();e.nextTick(()=>{ee(),b&&Te(b)})},rt=()=>{p.value&&(Nt.value=je(),Fe.value="",tt.value="",Mt.value="",le.value="",se.value="",ko.value=null,q.value=null,De.value="upload",mo.value=!0,Ve(),e.nextTick(()=>{St.value&&St.value.focus(),qe.value&&(qe.value.value="")}))},Ao=t=>{const n=t.target?.files?.[0];if(!n){ko.value=null,tt.value="";return}ko.value=n;const o=new FileReader;o.onload=l=>{tt.value=l.target?.result||""},o.readAsDataURL(n)},Lo=()=>{qe.value&&qe.value.click()},it=()=>{let t=q.value;if(!t){const n=window.getSelection();if(n&&n.rangeCount>0){const l=n.getRangeAt(0).commonAncestorContainer;t=l.nodeType===1?l.closest("img"):l.parentElement?.closest("img")}}if(t){const n=t.getAttribute("data-alt")||t.getAttribute("alt")||"";q.value=t,Fe.value=n.trim()===""||n.trim()==="Image"?"":n;const o=t.getAttribute("src")||t.src||"";o.startsWith("http://")||o.startsWith("https://")?(Mt.value=o,tt.value="",De.value="url"):(tt.value=o,Mt.value="",De.value="upload");const a=t.style.width||t.getAttribute("width")||"",s=t.style.height||t.getAttribute("height")||"";le.value=a.endsWith("px")?a.replace("px",""):a,se.value=s.endsWith("px")?s.replace("px",""):s,Nt.value=null}else{rt();return}mo.value=!0,zt.value=!1,po.value=!1,e.nextTick(()=>{De.value==="url"&&fo.value?(fo.value.focus(),fo.value.select()):St.value&&(St.value.focus(),St.value.select()),qe.value&&(qe.value.value="")})},xt=()=>{mo.value=!1,Fe.value="",tt.value="",Mt.value="",le.value="",se.value="",ko.value=null,q.value=null,Nt.value=null,De.value="upload"},We=()=>{const t=(Fe.value||"").trim(),n=p.value?._mutationObserver;n&&n.disconnect(),ne.value?(I.value&&(clearTimeout(I.value),I.value=null),ke(),ne.value=!1):ke();const o=De.value==="url"?Mt.value.trim():tt.value;if(q.value&&p.value&&p.value.contains(q.value)){o&&(q.value.src=o),q.value.setAttribute("alt",t),q.value.setAttribute("data-alt",t),le.value?(q.value.style.width=`${le.value}px`,q.value.setAttribute("width",le.value)):(q.value.style.removeProperty("width"),q.value.removeAttribute("width")),se.value?(q.value.style.height=`${se.value}px`,q.value.setAttribute("height",se.value)):(q.value.style.removeProperty("height"),q.value.removeAttribute("height"));const l=window.getSelection();if(l){l.removeAllRanges();const a=document.createRange();a.setStartAfter(q.value),a.collapse(!0),l.addRange(a)}ee()}else{if(!o){n&&p.value&&n.observe(p.value,{childList:!0,subtree:!0}),xt();return}if(p.value){p.value.focus();const l=window.getSelection();l&&l.rangeCount>0&&l.removeAllRanges();const a=window.getSelection();let s=null;if(Nt.value&&(Te(Nt.value),a&&a.rangeCount>0&&(s=a.getRangeAt(0))),!s&&a&&a.rangeCount>0&&(s=a.getRangeAt(0)),!s&&p.value){if(s=document.createRange(),p.value.childNodes.length===0){const d=document.createElement("p");d.innerHTML="<br>",p.value.appendChild(d),s.setStart(d,0),s.collapse(!0)}else s.selectNodeContents(p.value),s.collapse(!1);a&&(a.removeAllRanges(),a.addRange(s))}if(!s){xt();return}const r=s.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(!p.value.contains(i)){if(s=document.createRange(),p.value.childNodes.length===0){const d=document.createElement("p");d.innerHTML="<br>",p.value.appendChild(d),s.setStart(d,0),s.collapse(!0)}else s.selectNodeContents(p.value),s.collapse(!1);a&&(a.removeAllRanges(),a.addRange(s))}const c=document.createElement("img");c.src=o,c.setAttribute("alt",t),c.setAttribute("data-alt",t),le.value&&(c.style.width=`${le.value}px`,c.setAttribute("width",le.value)),se.value&&(c.style.height=`${se.value}px`,c.setAttribute("height",se.value));try{s.insertNode(c),s.setStartAfter(c),s.collapse(!0),a&&(a.removeAllRanges(),a.addRange(s))}catch{if(p.value){if(p.value.childNodes.length===0){const m=document.createElement("p");p.value.appendChild(m),m.appendChild(c)}else{const m=p.value.lastChild;if(m&&m.nodeType===1)m.appendChild(c);else{const f=document.createElement("p");p.value.appendChild(f),f.appendChild(c)}}const u=document.createRange();u.setStartAfter(c),u.collapse(!0),a&&(a.removeAllRanges(),a.addRange(u))}}q.value=c,ee()}}e.nextTick(()=>{n&&p.value&&n.observe(p.value,{childList:!0,subtree:!0}),Ie(),fe(),xt()})};e.watch(()=>C.modelValue,t=>{if(C.richText&&p.value&&!Re.value){const n=Zt(t||""),l=p.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),a=n.replace(/&nbsp;|\u00A0/g," ");if(l!==a){const s=je();p.value.innerHTML=n,e.nextTick(()=>{Fo();const r=p.value.innerHTML||"",i=C.title||"",c=C.description||"";Oe.value=r,nt.value=i,de.value=c,Bt.value=r,Pe.value=i,Xe.value=c,ot.value=[],lo.value=[],I.value&&(clearTimeout(I.value),I.value=null),ne.value=!1,s&&Te(s),xe(),Ke(),At(),Ie(),fe(),$t(),Ge("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>C.richText,t=>{t?(fe(),e.nextTick(()=>{Go()})):(ro(),ft.value=[],pt.value&&(pt.value.disconnect(),pt.value=null)),$t()}),e.watch(()=>C.floatingToolbar,t=>{t?fe():ro()}),e.watch(()=>C.disabled,t=>{t&&ro(),$t()}),e.watch(()=>C.description,()=>{e.nextTick(()=>{Ye.value?go():Ro()})}),e.watch(()=>C.title,()=>{e.nextTick(()=>{ut.value?Tt():Io()})}),e.watch(()=>C.customToolbarSlots,()=>{e.nextTick(()=>{qt()})},{deep:!0}),e.watch(()=>C.comments,(t,n)=>{if(To.value){To.value=!1;return}ao.value||C.richText&&p.value&&e.nextTick(()=>{Gt()})},{deep:!0,immediate:!1});const Gt=()=>{if(!ao.value&&!(!C.comments||!Array.isArray(C.comments)||C.comments.length===0)&&!(!C.richText||!p.value)){ao.value=!0;try{const t=new Set,n=C.comments.filter(r=>{const i=String(r.conversation_id||r.id);return t.has(i)?!1:(t.add(i),!0)}),o=p.value.querySelectorAll("[data-comment], [data-fake-comment]"),l=o.length;o.forEach(r=>{const i=r.parentNode;if(i){for(;r.firstChild;)i.insertBefore(r.firstChild,r);i.removeChild(r)}});let a=0;const s=new Set;n.forEach(r=>{if(!r.conversation_id||!r.selection_range)return;const i=typeof r.conversation_id=="string"&&r.conversation_id.startsWith("comment-")?null:Number(r.conversation_id)||r.conversation_id;if(!i)return;const c=String(i);if(s.has(c))return;const d=p.value.querySelector(`[data-comment="${c}"]`);if(d){$o(d,r),s.add(c);return}try{const u=Sn(r.selection_range,r.selection_text);if(u&&!u.collapsed){const m=u.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f){const y=f.closest("[data-comment], [data-fake-comment]");if(y){const k=y.getAttribute("data-comment")||y.getAttribute("data-fake-comment");if(String(k)===String(i)){y.setAttribute("data-comment",c),y.removeAttribute("data-fake-comment"),$o(y,r),s.add(c);return}else return}}const g=p.value.querySelector(`[data-comment="${c}"]`);if(g){$o(g,r),s.add(c);return}const v=document.createElement("span");v.setAttribute("data-comment",c),$o(v,r);try{u.surroundContents(v),a++,s.add(c)}catch{try{const k=document.createRange();k.setStart(u.startContainer,u.startOffset),k.setEnd(u.endContainer,u.endOffset),Y(k),k.surroundContents(v),a++,s.add(c)}catch{try{const w=u.extractContents();v.appendChild(w),u.insertNode(v),a++,s.add(c)}catch(w){console.warn("Failed to create comment marker:",w)}}}}}catch{}}),e.nextTick(()=>{Ge("restoreCommentsFromModel"),ee(),ao.value=!1})}catch{ao.value=!1}}},Y=t=>{if(!t||!p.value)return t;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let o=t.startContainer,l=t.startOffset;if(o.nodeType===3){const r=o.parentElement;r&&n.includes(r.tagName)&&(l===0&&!Vn(o)||t.setStartBefore(r))}else o.nodeType===1&&n.includes(o.tagName)&&l>0&&t.setStartBefore(o);let a=t.endContainer,s=t.endOffset;if(a.nodeType===3){const r=a.parentElement;r&&n.includes(r.tagName)&&(s===a.length&&!co(a)||t.setEndAfter(r))}else a.nodeType===1&&n.includes(a.tagName)&&s<a.childNodes.length&&t.setEndAfter(a);return t}catch{return t}},Vn=t=>{let n=t.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},co=t=>{let n=t.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},Sn=(t,n)=>{if(!t||!p.value)return null;try{const o=document.createRange();if(t.type==="text"&&typeof t.start=="number"&&typeof t.end=="number"){let l=0;const a=[p.value];let s=null,r=!1,i=!1;for(;!i&&(s=a.pop());)if(s.nodeType===3){const c=l+s.length;!r&&t.start>=l&&t.start<=c&&(o.setStart(s,t.start-l),r=!0),r&&t.end>=l&&t.end<=c&&(o.setEnd(s,t.end-l),i=!0),l=c}else{let c=s.childNodes.length;for(;c--;)a.push(s.childNodes[c])}return r?Y(o):null}}catch{return null}return null},$o=(t,n)=>{if(!t||!n)return;const o=n.conversation||[],l=new Set,a=[],s=i=>{i&&i.id&&!l.has(i.id)&&(l.add(i.id),a.push(i))};o.length>0&&o.forEach(i=>{i.user&&s(i.user)}),a.length>0?t.setAttribute("data-comment-user",JSON.stringify(a[0])):t.removeAttribute("data-comment-user"),a.length>1?t.setAttribute("data-comment-user-2",JSON.stringify(a[1])):t.removeAttribute("data-comment-user-2");const r=o.length;r>0?t.setAttribute("data-comment-count",String(r)):t.removeAttribute("data-comment-count")},Ge=(t="unknown")=>{if(!C.richText||!p.value){ft.value=[];return}Date.now()-_o.value<Jo&&Ot.value!==null||Ot.value===null&&(Ot.value=requestAnimationFrame(()=>{if(Ot.value=null,_o.value=Date.now(),vo.value)return;vo.value=!0;const o={},l=p.value;if(!l){vo.value=!1;return}const a=l.closest(".editor-with-comments");if(!a){vo.value=!1;return}const s=l.querySelectorAll("[data-comment], [data-fake-comment]"),r=[],i=new Set;s.forEach(f=>{const g=f.getAttribute("data-comment")||f.getAttribute("data-fake-comment");g&&f.tagName==="SPAN"&&(i.has(g)||(r.push(f),i.add(g)))}),s.forEach(f=>{const g=f.getAttribute("data-comment")||f.getAttribute("data-fake-comment");!g||i.has(g)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(f.tagName)?f.querySelector(`span[data-comment="${g}"], span[data-fake-comment="${g}"]`)||(r.push(f),i.add(g)):f.tagName!=="SPAN"&&(r.push(f),i.add(g)))});const c=a.getBoundingClientRect(),d=l.getBoundingClientRect();r.forEach((f,g)=>{let v=f.getAttribute("data-comment")||f.getAttribute("data-fake-comment");if(!v)return;if(typeof v=="string"&&v.startsWith("comment-")){const eo=f.textContent?.trim(),to=C.comments?.find(Et=>(typeof Et.conversation_id=="string"&&Et.conversation_id.startsWith("comment-")?null:Et.conversation_id)&&Et.selection_text?.trim()===eo);to?(v=String(to.conversation_id),f.setAttribute("data-comment",v),f.removeAttribute("data-fake-comment")):(v=String(Date.now()),f.setAttribute("data-comment",v),f.removeAttribute("data-fake-comment"))}const y=f.getBoundingClientRect(),k=window.getComputedStyle(f),w=parseFloat(k.lineHeight)||parseFloat(k.fontSize)*1.2,N=y.top-d.top+w/2-15,L=d.top-c.top+N;let M=null,F=null,O=0;const pe=[],ge=new Set;if(v&&C.comments){const eo=C.comments.find(to=>String(to.conversation_id||to.id)===String(v));if(eo){const to=eo.conversation||[];to.length>0?(to.forEach(Et=>{Et.user&&Et.user.id&&!ge.has(Et.user.id)&&(ge.add(Et.user.id),pe.push(Et.user))}),O=to.length):(O=0,M=null,F=null),pe.length>0?M=pe[0]:M=null,pe.length>1?F=pe[1]:F=null}}const Je=y.top+w/2-15,Bn=Je+30,Tn=5,Qt=Bn>d.top+Tn&&Je<d.bottom-Tn?1:0;ft.value.find(eo=>eo.id===v);let wt=f;if(!wt&&v&&p.value){const eo=String(v);wt=p.value.querySelector(`[data-comment="${eo}"], [data-fake-comment="${eo}"]`)}const tl=pe.length;o[v]?(o[v].top=L,o[v].opacity=Qt,o[v].element=wt,o[v].firstUser=M,o[v].secondUser=F,o[v].totalCount=O,o[v].uniqueUserCount=tl):o[v]={id:v,top:L,opacity:Qt,element:wt,firstUser:M,secondUser:F,totalCount:O,uniqueUserCount:tl}});const u=Object.values(o).map(f=>{const g=Math.max(0,(f.uniqueUserCount??0)-2);if(!f.element&&f.id&&p.value){const y=String(f.id);f.element=p.value.querySelector(`[data-comment="${y}"], [data-fake-comment="${y}"]`)}return{...f,firstUser:f.firstUser||null,secondUser:f.secondUser||null,totalCount:f.totalCount,additionalCount:g}});(ft.value.length!==u.length||u.some((f,g)=>{const v=ft.value[g];if(!v)return!0;const y=(v.firstUser?.id||null)!==(f.firstUser?.id||null),k=(v.secondUser?.id||null)!==(f.secondUser?.id||null);return v.id!==f.id||Math.abs(v.top-f.top)>1||v.opacity!==f.opacity||v.totalCount!==f.totalCount||v.additionalCount!==f.additionalCount||y||k||v.element!==f.element}))&&(ft.value=u),vo.value=!1}))},qn=t=>{if(!t)return;let n=t.element;if(!n&&t.id&&p.value){const o=String(t.id);n=p.value.querySelector(`[data-comment="${o}"], [data-fake-comment="${o}"]`)}n&&(Jt(),Ae.value=n,n.classList.add("editor-comment-highlighted"))},Jt=(t=!1)=>{!t&&X.value!==null&&Ae.value&&(Ae.value.getAttribute("data-comment")||Ae.value.getAttribute("data-fake-comment"))===X.value||(p.value&&p.value.querySelectorAll(".editor-comment-highlighted").forEach(o=>{o.classList.remove("editor-comment-highlighted")}),Ae.value&&(Ae.value.classList.remove("editor-comment-highlighted"),Ae.value=null))},Ko=t=>{if(!t||!t.element)return;Jt(!0);const n=t.element.getAttribute("data-comment")||t.element.getAttribute("data-fake-comment");if(!n)return;const o=`[data-comment="${n}"], [data-fake-comment="${n}"]`;W("comment-marker-clicked",{commentId:n,selector:o,element:t.element})},Nn=()=>{Jt()},Go=()=>{!C.richText||!p.value||(pt.value&&pt.value.disconnect(),vt.value!==null&&(clearTimeout(vt.value),vt.value=null),pt.value=new MutationObserver(()=>{vt.value===null&&(vt.value=setTimeout(()=>{vt.value=null,e.nextTick(()=>{Ge("MutationObserver")})},200))}),pt.value.observe(p.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Ge("setupCommentMarkersObserver-initial"))},Mn=(t,n)=>{if(!t||!n)return;const o=n.getBoundingClientRect();let l=o.top,a=o.right+4;t.style.top=`${l}px`,t.style.left=`${a}px`,t.offsetHeight;const s=t.getBoundingClientRect(),r=window.innerWidth,i=window.innerHeight;if(s.right>r){const c=o.left-s.width-4;t.style.left=`${c}px`}if(s.bottom>i){const c=Math.max(8,i-s.height-8);t.style.top=`${c}px`}s.top<0&&(t.style.top="8px")};return e.watch(()=>ze.value,t=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(o=>{const l=o.getAttribute("data-submenu-id");if(l===t&&t){const a=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${l}"]`);if(a){if(o.parentNode!==document.body){const s=o.parentNode;o.dataset.originalParentRef=s===a?"inside":"sibling",document.body.appendChild(o)}o.style.display="block",o.style.visibility="hidden",o.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Mn(o,a),o.offsetHeight,o.setAttribute("data-active","true"),o.style.visibility="visible",o.style.opacity="1"})})}else o.setAttribute("data-active","true")}else o.setAttribute("data-active","false"),o.style.display="none",o.style.top="",o.style.left="",o.style.visibility="",o.style.opacity=""})})}),e.watch(()=>[He.value,Me.value],()=>{He.value==="askAi"||Me.value==="askAi"?e.nextTick(()=>{yn()}):(ze.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const o=n.getAttribute("data-submenu-id");if(o){const l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${o}"]`);if(l)if(n.dataset.originalParentRef==="inside")l.appendChild(n);else{const s=l.closest(".dss-toolbar-dropdown");s&&s.insertBefore(n,l.nextSibling)}}}})}))}),e.watch(()=>C.locale,t=>{t&&t!==ct.value&&(ct.value=t)},{immediate:!0}),It({openCommentOverlayForSelector:me,updateCommentMarkers:Ge,restoreCommentsFromModel:Gt}),(t,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",Hn.value]),style:e.normalizeStyle(An.value)},[B.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Ps,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Ht,title:e.unref(x)("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,Zs),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!xo.value}]),onClick:cn,title:e.unref(x)("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,Us),n[73]||(n[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Ws,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=o=>zo("paragraph")),title:e.unref(x)("textEditor.toolbar.paragraphFormat")},[ye.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Xs,[...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)])])):ye.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Ys,[...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)])])):ye.value==="h3"?(e.openBlock(),e.createElementBlock("svg",js,[...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)])])):ye.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Ks,[...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)])])):ye.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Gs,[...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)])])):ye.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Js,[...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",Qs,[...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,qs),He.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]=o=>gt("<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(x)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=o=>gt("<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(x)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=o=>gt("<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(x)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=o=>gt("<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(x)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=o=>gt("<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(x)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=o=>gt("<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(x)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=o=>gt("<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(x)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":_e("bold")}]),onClick:n[9]||(n[9]=o=>Lt("bold")),title:e.unref(x)("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,er),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":_e("italic")}]),onClick:n[10]||(n[10]=o=>Lt("italic")),title:e.unref(x)("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,tr),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":_e("underline")}]),onClick:n[11]||(n[11]=o=>Lt("underline")),title:e.unref(x)("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,or),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":oo.value}]),onClick:dn,title:e.unref(x)("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,nr),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:ht,title:e.unref(x)("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,ar)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Bo,title:e.unref(x)("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,lr)),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":_e("insertUnorderedList")}]),onClick:h,title:e.unref(x)("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,sr),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":_e("insertOrderedList")}]),onClick:Se,title:e.unref(x)("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,rr),n[76]||(n[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:rt,title:e.unref(x)("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,ir),mt.value?(e.openBlock(),e.createElementBlock("div",cr)):e.createCommentVNode("",!0),mt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(x)("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,dr)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",ur)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",mr,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=o=>zo("askAi")),title:e.unref(x)("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",pr,e.toDisplayString(e.unref(x)("textEditor.toolbar.askAi")),1)],8,fr),He.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(t.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",vr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.customToolbarSlots,(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l},[Be(o)?(e.openBlock(),e.createElementBlock("div",gr,[e.renderSlot(t.$slots,o)])):e.createCommentVNode("",!0),Be(o)&&l<B.customToolbarSlots.length-1&&R(l)?(e.openBlock(),e.createElementBlock("div",hr)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(He.value==="paragraph"||He.value==="askAi")&&B.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Ve})):e.createCommentVNode("",!0),e.createVNode(Xn,{showModal:Qe.value,width:"500px",height:"55vh",onCloseModal:Kt},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(x)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",yr,[e.createElementVNode("div",Cr,[e.createElementVNode("label",kr,e.toDisplayString(e.unref(x)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Co,type:"text","onUpdate:modelValue":n[15]||(n[15]=o=>G.value=o),class:"dss-link-modal-input",placeholder:e.unref(x)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Yo,["enter"])},null,40,xr),[[e.vModelText,G.value]])]),e.createElementVNode("div",wr,[e.createElementVNode("label",Er,e.toDisplayString(e.unref(x)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:et,type:"text","onUpdate:modelValue":n[16]||(n[16]=o=>K.value=o),class:"dss-link-modal-input",placeholder:e.unref(x)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Yo,["enter"])},null,40,br),[[e.vModelText,K.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Kt},e.toDisplayString(e.unref(x)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Yo},e.toDisplayString(e.unref(x)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Xn,{showModal:mo.value,width:"500px",height:"80vh",onCloseModal:xt},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(q.value?e.unref(x)("textEditor.image.editImage"):e.unref(x)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Vr,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":De.value==="upload"}]),onClick:n[17]||(n[17]=o=>De.value="upload")},e.toDisplayString(e.unref(x)("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":De.value==="url"}]),onClick:n[18]||(n[18]=o=>De.value="url")},e.toDisplayString(e.unref(x)("textEditor.image.imageLink")),3)]),De.value==="upload"?(e.openBlock(),e.createElementBlock("div",Sr,[e.createElementVNode("div",Nr,[e.createElementVNode("div",Mr,[re.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Br,e.toDisplayString(e.unref(x)("textEditor.image.uploadImage")),1)),re.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Lo},[e.createElementVNode("img",{src:tt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Tr),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:qe,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Ao},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:qe,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Ao},null,544))]),e.createElementVNode("div",Hr,[e.createElementVNode("label",Ar,e.toDisplayString(e.unref(x)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:St,type:"text","onUpdate:modelValue":n[19]||(n[19]=o=>Fe.value=o),class:"dss-link-modal-input",placeholder:e.unref(x)("textEditor.image.enterAltText"),onKeyup:e.withKeys(We,["enter"])},null,40,Lr),[[e.vModelText,Fe.value]])]),e.createElementVNode("div",$r,[e.createElementVNode("label",Dr,e.toDisplayString(e.unref(x)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=o=>le.value=o),class:"dss-link-modal-input",placeholder:e.unref(x)("textEditor.image.auto"),onKeyup:e.withKeys(We,["enter"])},null,40,_r),[[e.vModelText,le.value]])]),e.createElementVNode("div",Ir,[e.createElementVNode("label",Rr,e.toDisplayString(e.unref(x)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=o=>se.value=o),class:"dss-link-modal-input",placeholder:e.unref(x)("textEditor.image.auto"),onKeyup:e.withKeys(We,["enter"])},null,40,Fr),[[e.vModelText,se.value]])])])])):e.createCommentVNode("",!0),De.value==="url"?(e.openBlock(),e.createElementBlock("div",zr,[e.createElementVNode("div",Or,[e.createElementVNode("div",Pr,[e.createElementVNode("label",Zr,e.toDisplayString(e.unref(x)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:fo,type:"text","onUpdate:modelValue":n[22]||(n[22]=o=>Mt.value=o),class:"dss-link-modal-input",placeholder:e.unref(x)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(We,["enter"])},null,40,Ur),[[e.vModelText,Mt.value]])]),e.createElementVNode("div",Wr,[e.createElementVNode("label",qr,e.toDisplayString(e.unref(x)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=o=>Fe.value=o),class:"dss-link-modal-input",placeholder:e.unref(x)("textEditor.image.enterAltText"),onKeyup:e.withKeys(We,["enter"])},null,40,Xr),[[e.vModelText,Fe.value]])]),e.createElementVNode("div",Yr,[e.createElementVNode("label",jr,e.toDisplayString(e.unref(x)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=o=>le.value=o),class:"dss-link-modal-input",placeholder:e.unref(x)("textEditor.image.auto"),onKeyup:e.withKeys(We,["enter"])},null,40,Kr),[[e.vModelText,le.value]])]),e.createElementVNode("div",Gr,[e.createElementVNode("label",Jr,e.toDisplayString(e.unref(x)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=o=>se.value=o),class:"dss-link-modal-input",placeholder:e.unref(x)("textEditor.image.auto"),onKeyup:e.withKeys(We,["enter"])},null,40,Qr),[[e.vModelText,se.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:xt},e.toDisplayString(e.unref(x)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:We},e.toDisplayString(e.unref(x)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":$.value&&ut.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(x)("textEditor.labels.title")),1),e.createElementVNode("div",ei,[ut.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ti,[B.title?(e.openBlock(),e.createElementBlock("span",oi,e.toDisplayString(B.title),1)):(e.openBlock(),e.createElementBlock("span",ni,e.toDisplayString(H.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:j,value:B.title,onInput:_n,onFocus:Ut,onBlur:Dn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!ut.value}]),placeholder:H.value,disabled:B.disabled,rows:"1"},null,42,li)])],2),$.value&&ut.value?(e.openBlock(),e.createElementBlock("div",ai,[e.renderSlot(t.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":tn.value&&Ye.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(x)("textEditor.labels.description")),1),e.createElementVNode("div",si,[Ye.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ri,[B.description?(e.openBlock(),e.createElementBlock("span",ii,e.toDisplayString(B.description),1)):(e.openBlock(),e.createElementBlock("span",ci,e.toDisplayString(bo.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:J,value:B.description,onInput:sn,onFocus:an,onBlur:In,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!Ye.value}]),placeholder:bo.value,disabled:B.disabled,rows:"1"},null,42,di)])],2),tn.value&&Ye.value?(e.openBlock(),e.createElementBlock("div",ui,[e.renderSlot(t.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ft.value,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":X.value===o.id,"editor-comment-marker-group-out-of-view":o.opacity===0}]),"data-comment-id":o.id,style:e.normalizeStyle({top:o.top+"px"}),onMouseenter:l=>qn(o),onMouseleave:Nn},[o.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(l=>Ko(o),["stop"])},[o.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:o.firstUser.avatar,alt:o.firstUser.name||"avatar"},null,8,pi)):(e.openBlock(),e.createElementBlock("span",vi,e.toDisplayString(o.firstUser.initials||(o.firstUser.name?o.firstUser.name.charAt(0):"")),1))],8,fi)):e.createCommentVNode("",!0),o.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(l=>Ko(o),["stop"])},[o.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:o.secondUser.avatar,alt:o.secondUser.name||"avatar"},null,8,hi)):(e.openBlock(),e.createElementBlock("span",yi,e.toDisplayString(o.secondUser.initials||(o.secondUser.name?o.secondUser.name.charAt(0):"")),1))],8,gi)):e.createCommentVNode("",!0),o.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:o.secondUser?"30px":"15px"}),"data-has-second-user":o.secondUser?"true":"false",onClick:e.withModifiers(l=>Ko(o),["stop"])},[e.createElementVNode("span",ki,"+"+e.toDisplayString(o.additionalCount),1)],12,Ci)):e.createCommentVNode("",!0)],46,mi))),128)),B.richText?(e.openBlock(),e.createElementBlock("div",Ni,[e.createElementVNode("div",{ref_key:"editorRef",ref:p,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":B.disabled,"dss-text-editor-fixed-height":B.fixedHeight}]),style:e.normalizeStyle(Qo.value),onInput:ee,onBlur:rn,onClick:Cn,onMouseup:Wo,onKeyup:Wo,onKeydown:Pn,onPaste:Oo,onMousemove:Zn,onMouseleave:xn},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[X.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(Ue.value)},[U.value||Le.value.length>0?(e.openBlock(),e.createElementBlock("div",Mi,[e.createElementVNode("div",Bi,[U.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:U.value},null,8,Ti)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Hi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value,(o,l)=>(e.openBlock(),e.createElementBlock("div",{key:l,class:"dss-comment-message"},[o.user&&(o.user.avatar||o.user.initials||o.user.name)?(e.openBlock(),e.createElementBlock("div",Ai,[e.createElementVNode("div",Li,[o.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:o.user.avatar,alt:o.user.name||"avatar"},null,8,$i)):(e.openBlock(),e.createElementBlock("span",Di,e.toDisplayString(o.user.initials||(o.user.name?o.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",_i,[e.createElementVNode("div",Ii,[e.createElementVNode("div",Ri,e.toDisplayString(o.user&&o.user.name||"Comment"),1),o.createdAt?(e.openBlock(),e.createElementBlock("div",Fi,e.toDisplayString(nn(new Date(o.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":ln(o.text)||o.class==="comment-started"}])},e.toDisplayString(o.text||""),3)]),C.commentUser&&o.user&&o.user.id===C.commentUser.id&&!ln(o.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(a=>Ct(o,l),["stop"]),title:e.unref(x)("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,zi)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Oi,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:oe,"onUpdate:modelValue":n[26]||(n[26]=o=>te.value=o),class:"dss-comment-input",rows:"1",placeholder:e.unref(x)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(fn,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(oe.value){const o=oe.value;o.style.height="auto",o.style.height=`${o.scrollHeight}px`}})},null,40,Pi),[[e.vModelText,te.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(fn,["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",Zi,[e.createElementVNode("div",Ui,[e.createElementVNode("span",Wi,e.toDisplayString(wo.value)+" "+e.toDisplayString(wo.value===1?e.unref(x)("textEditor.footer.word"):e.unref(x)("textEditor.footer.words")),1),n[82]||(n[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",qi,e.toDisplayString(Eo.value)+" "+e.toDisplayString(Eo.value===1?e.unref(x)("textEditor.footer.character"):e.unref(x)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",xi,[e.createElementVNode("textarea",{value:B.modelValue,onInput:$n,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":B.fixedHeight}]),placeholder:ae.value,rows:B.rows,disabled:B.disabled,style:e.normalizeStyle(Ln.value)},null,46,wi),e.createElementVNode("div",Ei,[e.createElementVNode("div",bi,[e.createElementVNode("span",Vi,e.toDisplayString(wo.value)+" "+e.toDisplayString(wo.value===1?e.unref(x)("textEditor.footer.word"):e.unref(x)("textEditor.footer.words")),1),n[79]||(n[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Si,e.toDisplayString(Eo.value)+" "+e.toDisplayString(Eo.value===1?e.unref(x)("textEditor.footer.character"):e.unref(x)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[S.value&&D.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Z.value),onMouseenter:n[28]||(n[28]=o=>P.value=!0),onMouseleave:ho},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Un,["stop"]),title:D.value},e.toDisplayString(D.value),9,Xi),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Wn,["stop"]),title:e.unref(x)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",ji,[...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,Yi)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[po.value&&no.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Ft.value),onMouseenter:n[29]||(n[29]=o=>zt.value=!0),onMouseleave:yo},[e.createElementVNode("div",Ki,[no.value===e.unref(x)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Gi,[...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:no.value},e.toDisplayString(no.value),9,Ji)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(it,["stop"]),title:e.unref(x)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",ec,[...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,Qi)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[B.floatingToolbar&&B.richText&&ve.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:uo,class:"dss-floating-toolbar",style:e.normalizeStyle(Ne.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",tc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Ht,["stop"]),title:e.unref(x)("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,oc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!xo.value}]),onClick:e.withModifiers(cn,["stop"]),title:e.unref(x)("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,nc),n[107]||(n[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",lc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(o=>qo("paragraph"),["stop"])),title:e.unref(x)("textEditor.toolbar.paragraphFormat")},[ye.value==="h1"?(e.openBlock(),e.createElementBlock("svg",sc,[...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)])])):ye.value==="h2"?(e.openBlock(),e.createElementBlock("svg",rc,[...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)])])):ye.value==="h3"?(e.openBlock(),e.createElementBlock("svg",ic,[...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)])])):ye.value==="h4"?(e.openBlock(),e.createElementBlock("svg",cc,[...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)])])):ye.value==="h5"?(e.openBlock(),e.createElementBlock("svg",dc,[...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)])])):ye.value==="h6"?(e.openBlock(),e.createElementBlock("svg",uc,[...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",mc,[...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,ac),Me.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]=o=>Yt("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(x)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=o=>Yt("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(x)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=o=>Yt("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(x)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=o=>Yt("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(x)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=o=>Yt("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(x)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=o=>Yt("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(x)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=o=>Yt("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(x)("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":_e("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(o=>Lt("bold"),["stop"])),title:e.unref(x)("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,fc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":_e("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(o=>Lt("italic"),["stop"])),title:e.unref(x)("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,pc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":_e("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(o=>Lt("underline"),["stop"])),title:e.unref(x)("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,vc),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":oo.value}]),onClick:e.withModifiers(dn,["stop"]),title:e.unref(x)("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,gc),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(ht,["stop"]),title:e.unref(x)("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,yc)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Bo,["stop"]),title:e.unref(x)("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,hc)),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":_e("insertUnorderedList")}]),onClick:e.withModifiers(h,["stop"]),title:e.unref(x)("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,Cc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":_e("insertOrderedList")}]),onClick:e.withModifiers(Se,["stop"]),title:e.unref(x)("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,kc),n[112]||(n[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(rt,["stop"]),title:e.unref(x)("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,xc),n[113]||(n[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(x)("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,wc),B.askAi?(e.openBlock(),e.createElementBlock("div",Ec)):e.createCommentVNode("",!0),B.askAi?(e.openBlock(),e.createElementBlock("div",bc,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(o=>qo("askAi"),["stop"])),title:e.unref(x)("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",Sc,e.toDisplayString(e.unref(x)("textEditor.toolbar.askAi")),1)],8,Vc),Me.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(t.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Ce.value?(e.openBlock(),e.createElementBlock("div",Nc,[B.askAi&&Ce.value?(e.openBlock(),e.createElementBlock("div",Mc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.customToolbarSlots,(o,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l},[Be(o)&&E(o)?(e.openBlock(),e.createElementBlock("div",Bc,[e.renderSlot(t.$slots,o)])):e.createCommentVNode("",!0),Be(o)&&E(o)&&l<B.customToolbarSlots.length-1&&Q(l)?(e.openBlock(),e.createElementBlock("div",Tc)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Lc={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"}},$c={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"}},Gn={chart:Lc,textEditor:$c},Dc={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"}},_c={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},Jn={chart:Dc,textEditor:_c},Ic={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"}},Rc={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"}},Qn={chart:Ic,textEditor:Rc},Yn={en:Gn,fr:Jn,nl:Qn};function Fc(B){if(!B||!B.global)return;const It=B.global.availableLocales||[];Object.keys(Yn).forEach(_=>{It.includes(_)&&B.global.mergeLocaleMessage(_,Yn[_])})}const jn={en:{textEditor:Gn.textEditor},fr:{textEditor:Jn.textEditor},nl:{textEditor:Qn.textEditor}};function zc(B){if(!B||!B.global)return;const It=B.global.availableLocales||[];Object.keys(jn).forEach(_=>{It.includes(_)&&B.global.mergeLocaleMessage(_,jn[_])})}const Oc={en:{...Gn},fr:{...Jn},nl:{...Qn}};Kn.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:Oc});exports.DSSChart=Fs;exports.DSSChartMessages=Yn;exports.DSSModal=Xn;exports.DSSTextEditor=Ac;exports.DSSTextEditorMessages=jn;exports.addDSSChartTranslations=Fc;exports.addDSSTextEditorTranslations=zc;
77
+ </svg>`,v=e.ref(null),Le=e.ref(null),De=e.ref(!1),Oe=e.ref(!1),T=e.ref(!1),D=e.ref(""),W=e.ref({}),P=e.ref(!1),et=e.ref(!1),J=e.ref(""),Q=e.ref(""),tt=e.ref(null),bo=e.ref(null),de=e.ref(null),xt=e.ref(null),Ot=e.ref(""),Jt=e.ref(!1),O=e.ref({}),ye=e.ref(!1),Be=e.ref({}),fo=e.ref(null),Te=e.ref(null),vo=e.ref(!1),Pe=e.ref(""),Vo=e.ref(null),ot=e.ref(""),ee=e.ref(""),se=e.ref(""),wt=e.ref(null),Xe=e.ref(null),go=e.ref(null),Y=e.ref(null),Et=e.ref(null),ho=e.ref(!1),Qt=e.ref(""),Pt=e.ref({}),Zt=e.ref(!1),_e=e.ref("upload"),bt=e.ref(""),Ze=e.ref(null),xe=e.ref(null),nt=e.ref([]),eo=e.ref([]),z=e.ref(null),le=e.ref(!1),Ue=e.ref(""),Vt=e.ref(""),lt=e.ref(""),fe=e.ref(""),We=e.ref(""),Ye=e.ref(""),K=e.ref(null),te=e.ref(null),ut=e.ref(null),Fo=e.ref(!1),je=e.ref(null),Ke=e.ref(!1),Ge=e.ref(!1),St=e.ref(null),ve=e.ref("p"),mt=e.ref(!1),Ut=e.ref([]),pt=e.ref(null),Ie=e.ref(null),zo=e.ref(null),to=e.ref(!1),Oo=e.ref(0),Sn=100,ft=e.ref(null),Nn=e.computed(()=>({"dss-text-editor-no-border":!w.border,"dss-text-editor-rounded":w.rounded,"dss-text-editor-full-height":w.fullHeight,"dss-comment-overlay-open":ce.value!==null})),Mn=e.computed(()=>({})),Jo=e.computed(()=>!w.fixedHeight||w.fullHeight?{}:{height:`${1.6*14*w.rows+24+2}px`,resize:"none",overflowY:"auto"}),Po=e.computed(()=>!w.fixedHeight||w.fullHeight?{}:{height:`${1.6*14*w.rows+32}px`,overflowY:"auto"}),Qo=e.computed(()=>w.richText&&eo.value.length>0),en=e.computed(()=>{if(!w.modelValue)return"";if(w.richText){let t=w.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return t=t.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),t=t.replace(/<[^>]+>/g,""),t=t.replace(/&nbsp;/g," "),t=t.replace(/&amp;/g,"&"),t=t.replace(/&lt;/g,"<"),t=t.replace(/&gt;/g,">"),t=t.replace(/&quot;/g,'"'),t=t.replace(/&#39;/g,"'"),t=t.replace(/\s+/g," ").trim(),t}return w.modelValue}),So=e.computed(()=>{const t=en.value.trim();return t?t.split(/\s+/).filter(o=>o.length>0).length:0}),re=e.computed(()=>en.value.length),L=e.computed(()=>Y.value!==null&&_e.value==="upload"&&ot.value&&ot.value.startsWith("data:")),No=e.computed(()=>w.titlePlaceholder||b("textEditor.placeholders.title")),ae=e.computed(()=>w.descriptionPlaceholder||b("textEditor.placeholders.description")),Nt=e.computed(()=>w.placeholder||b("textEditor.placeholders.startTyping")),I=t=>kt&&kt[t]!==void 0,oe=t=>{for(let o=t+1;o<w.customToolbarSlots.length;o++)if(I(w.customToolbarSlots[o]))return!0;return!1},S=t=>{for(let o=t+1;o<w.customToolbarSlots.length;o++){const n=w.customToolbarSlots[o];if(I(n)&&ge(n))return!0}return!1},ge=t=>w.customToolbarFloatingMap.hasOwnProperty(t)?w.customToolbarFloatingMap[t]===!0:!0,$=e.computed(()=>w.customToolbarSlots.some(t=>I(t)&&ge(t))),tn=e.computed(()=>I("title-slot")),oo=e.computed(()=>I("description-slot")),Mt=t=>{if(!t||t.trim()==="")return"<html></html>";const o=t.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?t:`<html>${t}</html>`},Zo=t=>{if(!t||t.trim()==="")return"";const o=t.replace(/<!--[\s\S]*?-->/g,""),n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?n.slice(6,-7).trim():o},on=t=>{if(!t)return;const o=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT,null,!1),n=[];let a=o.nextNode();for(;a;)n.push(a),a=o.nextNode();n.forEach(r=>r.remove())},Bn=t=>{try{const o=String(t.getDate()).padStart(2,"0"),a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()],r=t.getFullYear();return`${o} ${a} ${r}`}catch{return""}},nn=t=>{if(!t||typeof t!="string")return!1;const o=t.trim();if(!o)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(o))return!0;try{const r=b("textEditor.started_conversation");if(r&&o===r)return!0}catch{}const a=o.toLowerCase();return a.includes("started conversation")||a.includes("démarré la conversation")||a==="started conversation"||a==="a démarré la conversation"},Tn=t=>{const o=t.target.value;X("update:modelValue",o),X("change",o)},Re=()=>{if(!K.value)return;const t=K.value;if(t.style.setProperty("text-overflow","","important"),t.style.setProperty("white-space","","important"),t.style.setProperty("overflow-x","","important"),t.style.setProperty("height","auto","important"),t.value.trim()===""){const a=t.value;t.value="M";const r=t.scrollHeight;t.value=a,t.style.setProperty("height",`${r}px`,"important"),t.style.setProperty("overflow-y","hidden","important");return}t.offsetHeight;const n=t.scrollHeight;t.style.setProperty("height",`${n}px`,"important"),t.style.setProperty("overflow-y","hidden","important")},Hn=()=>{Ke.value=!0,Re()},An=()=>{Ke.value=!1,Uo()},Uo=()=>{if(!K.value)return;const t=K.value;t.style.setProperty("text-overflow","","important"),t.style.setProperty("white-space","","important"),t.style.setProperty("overflow-x","","important"),t.style.setProperty("height","auto","important");const o=t.value;t.value="M";const n=t.scrollHeight;t.value=o,t.offsetHeight,t.style.setProperty("height",`${n}px`,"important"),t.style.setProperty("overflow-y","hidden","important"),t.style.setProperty("overflow-x","hidden","important"),t.style.setProperty("text-overflow","ellipsis","important"),t.style.setProperty("white-space","nowrap","important")},ln=t=>{const n=t.target.value;Ke.value&&Re(),X("update:title",n),X("title-change",n),ut.value="title",w.richText&&(le.value||(Vt.value=Ue.value,We.value=lt.value,Ye.value=fe.value),z.value&&clearTimeout(z.value),le.value=!0,z.value=setTimeout(()=>{le.value=!1,we()},500))},yo=()=>{if(!te.value)return;const t=te.value;if(t.style.setProperty("text-overflow","","important"),t.style.setProperty("white-space","","important"),t.style.setProperty("overflow-x","","important"),t.style.setProperty("height","auto","important"),t.value.trim()===""){const a=t.value;t.value="M";const r=t.scrollHeight;t.value=a,t.style.setProperty("height",`${r}px`,"important"),t.style.setProperty("overflow-y","hidden","important");return}t.offsetHeight;const n=t.scrollHeight;t.style.setProperty("height",`${n}px`,"important"),t.style.setProperty("overflow-y","hidden","important")},Ln=()=>{Ge.value=!0,yo()},$n=()=>{Ge.value=!1,Mo()},Mo=()=>{if(!te.value)return;const t=te.value;t.style.setProperty("text-overflow","","important"),t.style.setProperty("white-space","","important"),t.style.setProperty("overflow-x","","important"),t.style.setProperty("height","auto","important");const o=t.value;t.value="M";const n=t.scrollHeight;t.value=o,t.offsetHeight,t.style.setProperty("height",`${n}px`,"important"),t.style.setProperty("overflow-y","hidden","important"),t.style.setProperty("overflow-x","hidden","important"),t.style.setProperty("text-overflow","ellipsis","important"),t.style.setProperty("white-space","nowrap","important")},Dn=t=>{const n=t.target.value;Ge.value&&yo(),X("update:description",n),X("description-change",n),ut.value="description",w.richText&&(le.value||(Vt.value=Ue.value,We.value=lt.value,Ye.value=fe.value),z.value&&clearTimeout(z.value),le.value=!0,z.value=setTimeout(()=>{le.value=!1,we()},500))},be=()=>{const t=window.getSelection();if(t.rangeCount===0)return null;const o=t.getRangeAt(0);if(o.startContainer.nodeType===1)return{type:"element",element:o.startContainer,offset:o.startOffset};const n=o.cloneRange();return n.selectNodeContents(v.value),n.setEnd(o.startContainer,o.startOffset),{type:"text",start:n.toString().length,end:n.toString().length+o.toString().length}},at=t=>{if(!(!t||!v.value))try{const o=window.getSelection(),n=document.createRange();if(t.type==="element"&&t.element)if(v.value.contains(t.element)){n.setStart(t.element,t.offset),n.collapse(!0),o.removeAllRanges(),o.addRange(n);return}else{v.value.focus();return}let a=0;const r=[v.value];let c=null,i=!1,d=!1;for(;!d&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!i&&t.start>=a&&t.start<=m&&(n.setStart(c,t.start-a),i=!0),i&&t.end>=a&&t.end<=m&&(n.setEnd(c,t.end-a),d=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}o.removeAllRanges(),o.addRange(n)}catch{v.value.focus()}},Bo=()=>{if(!v.value)return;v.value.focus();const t=window.getSelection(),o=document.createRange(),n=r=>{if(r.nodeType===3||r.childNodes.length===0)return r;for(let c=r.childNodes.length-1;c>=0;c--){const i=r.childNodes[c],d=n(i);if(d)return d}return r},a=n(v.value);if(a.nodeType===3)o.setStart(a,a.length),o.setEnd(a,a.length);else if(a.childNodes.length>0){const r=n(a);r&&r.nodeType===3?(o.setStart(r,r.length),o.setEnd(r,r.length)):(o.selectNodeContents(a),o.collapse(!1))}else o.setStart(a,0),o.setEnd(a,0);t.removeAllRanges(),t.addRange(o)},we=(t=!1)=>{if(!v.value)return;const o=v.value.innerHTML,n=w.title||"",a=w.description||"";if(!t&&o===Ue.value&&n===lt.value&&a===fe.value)return;const r={content:Vt.value||Ue.value,title:We.value!==void 0?We.value:lt.value,description:Ye.value!==void 0?Ye.value:fe.value},c=nt.value.length>0?nt.value[nt.value.length-1]:null;let i=!0;c&&(typeof c=="string"?i=r.content!==c:i=r.content!==c.content||r.title!==c.title||r.description!==c.description),i&&(nt.value.push(r),nt.value.length>50&&nt.value.shift(),eo.value=[]),Ue.value=o,lt.value=n,fe.value=a,Vt.value=o,We.value=n,Ye.value=a},j=t=>{if(!v.value)return;Wo(),v.value&&on(v.value);let o=null;v.value&&(v.value.querySelector("p")||(o=be(),no()));const n=t&&t.inputType&&(t.inputType==="insertText"||t.inputType==="insertCompositionText"||t.inputType==="deleteContentBackward"||t.inputType==="deleteContentForward");n&&St.value&&(St.value=null),Oe.value=!0;const a=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),r=Mt(a);X("update:modelValue",r),X("change",r),ut.value="editor",le.value||(Vt.value=Ue.value,We.value=lt.value,Ye.value=fe.value),z.value&&clearTimeout(z.value),le.value=!0,z.value=setTimeout(()=>{le.value=!1,we(),Io(),gt()},500),e.nextTick(()=>{o&&at(o),Wo();const c=["bold","italic","underline"],i=window.getSelection(),d=i.rangeCount>0?i.getRangeAt(0):null,m=d&&d.collapsed;if(c.forEach(p=>{try{if(m&&St.value?.command===p){O.value[p]=St.value.state;return}if(p==="bold")if(d){const g=d.commonAncestorContainer,h=g.nodeType===3?g.parentElement:g;let f=!1;if(h&&((h.tagName==="STRONG"||h.tagName==="B"||h.closest&&h.closest("strong, b"))&&(f=!0),!f&&h.style&&parseInt(h.style.fontWeight)>=600&&(f=!0),!f))try{const C=window.getComputedStyle(h);parseInt(C.fontWeight)>=600&&(f=!0)}catch{}O.value[p]=f}else O.value.hasOwnProperty(p)||(O.value[p]=!1);else if(p==="italic")if(d){const g=d.commonAncestorContainer,h=g.nodeType===3?g.parentElement:g,f=h&&(h.tagName==="EM"||h.tagName==="I"||h.closest&&h.closest("em, i"));O.value[p]=!!f}else{const g=document.queryCommandState(p);O.value[p]=g}else{const g=document.queryCommandState(p);O.value[p]=g}}catch{}}),Ce(),st(),Bt(),pe(),$t(),Qe("handleRichTextInput"),n&&(t.inputType==="insertText"||t.inputType==="insertCompositionText")){const p=t.data||"";p&&p.length===1&&setTimeout(()=>gt(p),0),(p===" "||p===`
78
+ `||/[.,;:!?]/.test(p))&&setTimeout(()=>{Io()},100)}Oe.value=!1})},Wo=()=>{if(!v.value)return;const t=window.getSelection();if(!t||t.rangeCount===0)return;const o=t.getRangeAt(0),n=o.commonAncestorContainer,a=n.nodeType===3?n.parentElement:n;if(!a)return;const r=a.closest(".dss-image-wrapper");if(r){const c=r.querySelector("img");if(a!==c&&!c?.contains(a)){const i=o.startContainer.nodeType===3?o.startContainer.parentElement:o.startContainer,d=o.endContainer.nodeType===3?o.endContainer.parentElement:o.endContainer;if(r.contains(i)&&i!==c||r.contains(d)&&d!==c){const m=document.createRange();m.setStartAfter(r),m.collapse(!0),t.removeAllRanges(),t.addRange(m)}}}},no=()=>{if(!v.value)return;const t=v.value;if(t.querySelector&&t.querySelector("p"))return;const o=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),n=Array.from(t.childNodes);let a=null;n.forEach(r=>{if(r.nodeType===Node.TEXT_NODE){if((r.textContent||"").trim()===""){r.parentNode===t&&t.removeChild(r);return}a||(a=document.createElement("p"),t.insertBefore(a,r)),a.appendChild(r);return}if(r.nodeType===Node.ELEMENT_NODE){const c=r,i=c.tagName;if(i==="BR"){a=null;return}if(o.has(i)){a=null;return}a||(a=document.createElement("p"),t.insertBefore(a,c)),a.appendChild(c)}})},st=()=>{if(v.value&&!Fo.value){Fo.value=!0;try{v.value.querySelectorAll(".dss-image-wrapper").forEach(a=>{a.querySelector("img")||a.remove()}),v.value.querySelectorAll(".dss-image-no-alt-icon").forEach(a=>{const r=a.parentElement;!r||!r.classList.contains("dss-image-wrapper")?a.remove():r.querySelector("img")||a.remove()}),v.value.querySelectorAll("img").forEach(a=>{let r=a.getAttribute("alt");r===null&&(r=a.alt||"");const c=a.getAttribute("src")||a.src||"";if(r){const p=c.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),g=r===c||r===p;(r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")||g||g)&&(r="")}a.setAttribute("alt",r),a.setAttribute("data-alt",r);const i=!r||r.trim()==="";let d=a.parentElement;const m=d&&d.classList.contains("dss-image-wrapper");if(m){const p=d.querySelector(".dss-image-no-alt-icon");p&&p.remove()}else{const p=a.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?a.nextElementSibling:null;p&&p.remove()}if(i){m?d.setAttribute("contenteditable","false"):(d=document.createElement("span"),d.className="dss-image-wrapper",d.setAttribute("contenteditable","false"),a.parentNode.insertBefore(d,a),d.appendChild(a));const p=document.createElement("div");p.className="dss-image-no-alt-icon",p.setAttribute("contenteditable","false"),p.innerHTML=N,d.appendChild(p)}else if(m&&d.children.length===1){const p=d.parentNode;p.insertBefore(a,d),p.removeChild(d)}})}finally{Fo.value=!1}}},Wt=t=>{Io(),X("blur",t),Co()},an=()=>{if(w.disabled||!w.richText||!v.value)return;Ve(),z.value&&(clearTimeout(z.value),z.value=null),le.value&&(we(),le.value=!1);const t=ut.value==="title",o=ut.value==="description",n=ut.value==="editor";if(nt.value.length===0){t&&K.value?K.value.focus():o&&te.value?te.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{j()});return}const a={content:v.value.innerHTML,title:w.title||"",description:w.description||""};eo.value.push(a);const r=nt.value.pop();if(r!==void 0){Oe.value=!0;const c=typeof r=="string"?r:r.content,i=typeof r=="object"&&r.title||"",d=typeof r=="object"&&r.description||"";v.value.innerHTML=c,Ue.value=c,lt.value=i,fe.value=d,Vt.value=c,We.value=i,Ye.value=d,e.nextTick(()=>{Ce(),He(),Dt(),pe();const m=Mt(c);X("update:modelValue",m),X("update:title",i),X("update:description",d),X("change",m),X("title-change",i),X("description-change",d),Oe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(t){if(K.value){K.value.focus();const p=i.length;K.value.setSelectionRange&&K.value.setSelectionRange(p,p),Re()}}else if(o){if(te.value){te.value.focus();const p=d.length;te.value.setSelectionRange(p,p)}}else if(n)Bo();else if(K.value&&document.activeElement===K.value){const p=i.length;K.value.setSelectionRange&&K.value.setSelectionRange(p,p),Re()}else if(te.value&&document.activeElement===te.value){const p=d.length;te.value.setSelectionRange(p,p)}else v.value&&Bo()},10)})})}},sn=()=>{if(w.disabled||!w.richText||!v.value)return;Ve();const t=ut.value==="title",o=ut.value==="description",n=ut.value==="editor";if(eo.value.length===0){t&&K.value?K.value.focus():o&&te.value?te.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{j()});return}const a={content:v.value.innerHTML,title:w.title||"",description:w.description||""};nt.value.push(a);const r=eo.value.pop();if(r!==void 0){Oe.value=!0;const c=typeof r=="string"?r:r.content,i=typeof r=="object"&&r.title||"",d=typeof r=="object"&&r.description||"";v.value.innerHTML=c,Ue.value=c,lt.value=i,fe.value=d,Vt.value=c,We.value=i,Ye.value=d,e.nextTick(()=>{Ce(),He(),Dt(),pe();const m=Mt(c);X("update:modelValue",m),X("update:title",i),X("update:description",d),X("change",m),X("title-change",i),X("description-change",d),Oe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(t){if(K.value){K.value.focus();const p=i.length;K.value.setSelectionRange&&K.value.setSelectionRange(p,p),Re()}}else if(o){if(te.value){te.value.focus();const p=d.length;te.value.setSelectionRange(p,p)}}else if(n)Bo();else if(K.value&&document.activeElement===K.value){const p=i.length;K.value.setSelectionRange&&K.value.setSelectionRange(p,p),Re()}else if(te.value&&document.activeElement===te.value){const p=d.length;te.value.setSelectionRange(p,p)}else v.value&&Bo()},10)})})}},To=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(a=>{const r=a.style.fontWeight;if(r==="normal"||r==="400"){const c=document.createDocumentFragment();for(;a.firstChild;)c.appendChild(a.firstChild);a.parentNode&&a.parentNode.replaceChild(c,a)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(a=>{if(parseInt(a.style.fontWeight)>=600){const c=document.createElement("b");for(c.style.fontWeight="600";a.firstChild;)c.appendChild(a.firstChild);a.parentNode&&a.parentNode.replaceChild(c,a)}}),v.value.querySelectorAll("b, strong").forEach(a=>{a.style.fontWeight="600"})},Bt=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(o=>{o.style.fontStyle="italic"})},_n=()=>{const t=window.getSelection();if(!t||t.rangeCount===0)return!1;const o=t.getRangeAt(0);let n=!1;if(o.collapsed){const a=o.startContainer;let r=a.nodeType===3?a.parentElement:a;for(;r&&r!==v.value;){if(r.tagName==="EM"||r.tagName==="I"){n=!0;break}if(r.style&&r.style.fontStyle==="italic"){n=!0;break}r=r.parentElement}}else{const a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(a){const r=document.createTreeWalker(a,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let c;for(;c=r.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(c))){if(c.nodeType===3){let i=c.parentElement;for(;i&&i!==v.value;){if(i.tagName==="EM"||i.tagName==="I"){n=!0;break}if(i.style&&i.style.fontStyle==="italic"){n=!0;break}i=i.parentElement}}else if(c.nodeType===1){const i=c;if(i.tagName==="EM"||i.tagName==="I"){n=!0;break}if(i.style&&i.style.fontStyle==="italic"){n=!0;break}}if(n)break}}}if(n)return document.execCommand("italic",!1),e.nextTick(()=>{Bt()}),!1;if(o.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Bt()});else try{const a=o.extractContents(),r=document.createElement("em");r.style.fontStyle="italic",r.appendChild(a),o.insertNode(r),o.setStartAfter(r),o.collapse(!0),t.removeAllRanges(),t.addRange(o),e.nextTick(()=>{Bt()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Bt()})}return!0},In=()=>{const t=window.getSelection();if(!t||t.rangeCount===0)return!1;const o=t.getRangeAt(0);let n=!1;if(o.collapsed){const a=o.startContainer;let r=a.nodeType===3?a.parentElement:a;for(;r&&r!==v.value;){if(r.tagName==="STRONG"||r.tagName==="B"){n=!0;break}if(r.style&&parseInt(r.style.fontWeight)>=600){n=!0;break}r=r.parentElement}}else{const a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(a){const r=document.createTreeWalker(a,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let c;for(;c=r.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(c))){if(c.nodeType===3){let i=c.parentElement;for(;i&&i!==v.value;){if(i.tagName==="STRONG"||i.tagName==="B"){n=!0;break}if(i.style&&parseInt(i.style.fontWeight)>=600){n=!0;break}i=i.parentElement}}else if(c.nodeType===1){const i=c;if(i.tagName==="STRONG"||i.tagName==="B"){n=!0;break}if(i.style&&parseInt(i.style.fontWeight)>=600){n=!0;break}}if(n)break}}}if(n)return document.execCommand("bold",!1),e.nextTick(()=>{To()}),!1;if(o.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const a=window.getSelection();if(a.rangeCount>0){const r=a.getRangeAt(0),c=r.startContainer;let i=c.nodeType===3?c.parentElement:c;for(;i&&i!==v.value;){if(i.tagName==="SPAN"&&i.style.fontWeight){const d=i.style.fontWeight;if(d==="normal"||d==="400"){const m=document.createElement("b");m.style.fontWeight="600";const p=document.createDocumentFragment();for(;i.firstChild;)p.appendChild(i.firstChild);m.appendChild(p),i.parentNode&&i.parentNode.replaceChild(m,i),r.setStart(m,0),r.collapse(!0),a.removeAllRanges(),a.addRange(r);break}}else if(i.tagName==="STRONG"||i.tagName==="B"){i.style.fontWeight="600";break}i=i.parentElement}if(!i||i===v.value){const d=document.createElement("b");d.style.fontWeight="600",d.innerHTML="<br>",r.insertNode(d),r.setStart(d,0),r.collapse(!0),a.removeAllRanges(),a.addRange(r)}}To()});else try{const a=o.extractContents(),r=document.createElement("b");r.style.fontWeight="600",r.appendChild(a),o.insertNode(r),o.setStartAfter(r),o.collapse(!0),t.removeAllRanges(),t.addRange(o),e.nextTick(()=>{To()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{To()})}return!0},Tt=(t,o=null)=>{if(w.disabled||!w.richText||!v.value)return;le.value?(z.value&&(clearTimeout(z.value),z.value=null),we(),le.value=!1):we(),Ve(),v.value.focus();const n=window.getSelection();let a=null;if(n&&n.rangeCount>0){const c=n.getRangeAt(0);!c.collapsed&&_t(c)&&(a=be())}if(t==="createLink"&&o){const c=window.getSelection();if(c.rangeCount>0){const i=c.getRangeAt(0);if(i.collapsed)try{i.expand("word")}catch{const m=document.createTextNode(o);i.insertNode(m),i.selectNodeContents(m)}}}if(t==="bold"){const c=In();O.value.bold=c;const i=window.getSelection();i.rangeCount>0&&i.getRangeAt(0).collapsed&&(St.value={command:"bold",state:c}),e.nextTick(()=>{a&&(at(a),e.nextTick(()=>{const d=$e("bold");O.value.bold=d})),j(),He(),pe()});return}if(t==="italic"){const c=_n();O.value.italic=c;const i=window.getSelection();i.rangeCount>0&&i.getRangeAt(0).collapsed&&(St.value={command:"italic",state:c}),e.nextTick(()=>{a&&(at(a),e.nextTick(()=>{const d=$e("italic");O.value.italic=d})),j(),Bt(),He(),pe()});return}let r=!1;try{r=document.execCommand(t,!1,o)}catch{}e.nextTick(()=>{if(a&&at(a),["bold","italic","underline"].includes(t))try{if(t==="bold")a&&e.nextTick(()=>{const i=$e("bold");O.value.bold=i});else if(t==="italic")if(a)e.nextTick(()=>{const i=$e("italic");O.value.italic=i});else{const i=document.queryCommandState(t);O.value[t]=i}else{const i=document.queryCommandState(t);O.value[t]=i}}catch{O.value.hasOwnProperty(t)?O.value[t]=!O.value[t]:O.value[t]=!0}if(t==="createLink"&&o){const i=window.getSelection();if(i.rangeCount>0){const m=i.getRangeAt(0),p=m.commonAncestorContainer.nodeType===1?m.commonAncestorContainer.closest("a"):m.commonAncestorContainer.parentElement?.closest("a");p&&(!p.getAttribute("href")||p.getAttribute("href")==="")&&p.setAttribute("href",o)}v.value.querySelectorAll("a").forEach(m=>{const p=m.getAttribute("href");(!p||p===""||p==="#")&&m.setAttribute("href",o)})}j(),He(),pe()})},$e=(t,o=null)=>{if(w.disabled||!v.value)return!1;try{if(t==="formatBlock"&&o){const a=document.queryCommandValue("formatBlock");if(o==="<blockquote>"){const r=a.toLowerCase();if(r==="blockquote"||r==="<blockquote>")return!0;const c=window.getSelection();if(c.rangeCount>0){const d=c.getRangeAt(0).commonAncestorContainer;return!!(d.nodeType===1?d.tagName==="BLOCKQUOTE"?d:d.closest("blockquote"):d.parentElement?.closest("blockquote"))}}return a===o||a.toLowerCase()===o.toLowerCase()}if(["bold","italic","underline"].includes(t))try{const a=window.getSelection();if(a.rangeCount>0){const r=a.getRangeAt(0);if(t==="bold"){let i=!1;if(r.collapsed){const d=r.commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(m&&((m.tagName==="STRONG"||m.tagName==="B"||m.closest&&m.closest("strong, b"))&&(i=!0),!i&&m.style&&parseInt(m.style.fontWeight)>=600&&(i=!0),!i))try{const p=window.getComputedStyle(m);parseInt(p.fontWeight)>=600&&(i=!0)}catch{}return O.value.hasOwnProperty(t)?O.value[t]:(O.value[t]=i,i)}else{const d=r.commonAncestorContainer.nodeType===1?r.commonAncestorContainer:r.commonAncestorContainer.parentNode;let m=!1;if(d){const p=document.createTreeWalker(d,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let g;for(;g=p.nextNode();)if(!(typeof r.intersectsNode=="function"&&!r.intersectsNode(g))){if(g.nodeType===3){if(!(g.textContent||"").trim())continue;m=!0;let f=g.parentElement;for(;f&&f!==v.value;){if(f.tagName==="STRONG"||f.tagName==="B"){i=!0;break}if(f.style&&parseInt(f.style.fontWeight)>=600){i=!0;break}f=f.parentElement}}else if(g.nodeType===1){const h=g;if(h.tagName==="STRONG"||h.tagName==="B"){i=!0;break}if(h.style&&parseInt(h.style.fontWeight)>=600){i=!0;break}}if(i)break}}return O.value[t]=i&&m,i&&m}}if(t==="italic"){let i=!1;if(r.collapsed){const d=r.commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(m&&((m.tagName==="EM"||m.tagName==="I"||m.closest&&m.closest("em, i"))&&(i=!0),!i&&m.style&&m.style.fontStyle==="italic"&&(i=!0),!i))try{window.getComputedStyle(m).fontStyle==="italic"&&(i=!0)}catch{}return O.value.hasOwnProperty(t)?O.value[t]:(O.value[t]=i,i)}else{const d=r.commonAncestorContainer.nodeType===1?r.commonAncestorContainer:r.commonAncestorContainer.parentNode;let m=!1;if(d){const p=document.createTreeWalker(d,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let g;for(;g=p.nextNode();)if(!(typeof r.intersectsNode=="function"&&!r.intersectsNode(g))){if(g.nodeType===3){if(!(g.textContent||"").trim())continue;m=!0;let f=g.parentElement;for(;f&&f!==v.value;){if(f.tagName==="EM"||f.tagName==="I"){i=!0;break}if(f.style&&f.style.fontStyle==="italic"){i=!0;break}f=f.parentElement}}else if(g.nodeType===1){const h=g;if(h.tagName==="EM"||h.tagName==="I"){i=!0;break}if(h.style&&h.style.fontStyle==="italic"){i=!0;break}}if(i)break}}return O.value[t]=i&&m,i&&m}}const c=document.queryCommandState(t);return r.collapsed&&O.value.hasOwnProperty(t)?O.value[t]:(O.value[t]=c,c)}return O.value.hasOwnProperty(t)?O.value[t]:!1}catch{return O.value.hasOwnProperty(t)?O.value[t]:!1}try{return document.queryCommandState(t)}catch{return!1}}catch{return!1}},Ho=t=>{w.disabled||!w.richText||(Le.value=Le.value===t?null:t,t==="askAi"&&(Te.value=null))},Ve=()=>{Le.value=null,Ze.value=null},Ht=t=>{Tt("formatBlock",t),Ve()},Rn=t=>{if(!t||!v.value)return t;const o=x=>{let E=x.nodeType===Node.TEXT_NODE?x.parentElement:x;for(;E&&E!==v.value;){const V=E.tagName;if(V==="P"){const M=E.parentElement;if(M===v.value||M.tagName==="BLOCKQUOTE")return E}if(V==="BLOCKQUOTE")break;E=E.parentElement}return null},n=o(t.startContainer),a=o(t.endContainer);if(!n||!a)return t;const r=[],c=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:x=>{const E=x.tagName;if(E==="P"){const V=x.parentElement;if(V===v.value||V.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return E==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let i;for(;i=c.nextNode();)r.push(i);const d=r.indexOf(n),m=r.indexOf(a);if(d===-1||m===-1)return t;const p=Math.min(d,m),g=Math.max(d,m),h=r.slice(p,g+1);if(h.length===0)return t;const f=h[0],C=h[h.length-1],y=document.createRange();return y.setStartBefore(f),y.setEndAfter(C),y},Ao=()=>{if(w.disabled||!w.richText||!v.value)return;le.value?(z.value&&(clearTimeout(z.value),z.value=null),we(),le.value=!1):we(),Ve(),v.value.focus();const t=window.getSelection();if(t.rangeCount===0)return;let o=t.getRangeAt(0);!o.collapsed&&_t(o)&&(o=Rn(o),t.removeAllRanges(),t.addRange(o));let n=null;!o.collapsed&&_t(o)&&(n=be());const a=o.commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!!(r&&v.value.contains(r))){if(r){const i=r.parentNode;Array.from(r.childNodes).forEach(m=>{if(m.nodeType===Node.ELEMENT_NODE)if(m.tagName==="P"||m.tagName==="DIV")i.insertBefore(m,r);else{const p=document.createElement("p");p.appendChild(m.cloneNode(!0)),i.insertBefore(p,r)}else if(m.nodeType===Node.TEXT_NODE&&m.textContent.trim()){const p=document.createElement("p");p.appendChild(m.cloneNode(!0)),i.insertBefore(p,r)}}),r.remove()}}else if(o.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const i=document.createElement("blockquote"),d=o.extractContents();i.appendChild(d),o.insertNode(i);const m=[],p=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:f=>f.parentNode===i&&f.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let g;for(;g=p.nextNode();)m.push(g);if(m.forEach(f=>{const C=document.createElement("p");f.parentNode.insertBefore(C,f),C.appendChild(f)}),i.querySelectorAll("p, div").forEach(f=>{f.textContent.trim()===""&&!f.querySelector("img")&&(f.innerHTML="<br>")}),i.children.length===0&&i.textContent.trim()===""){const f=document.createElement("p");f.innerHTML="<br>",i.appendChild(f)}}e.nextTick(()=>{n&&at(n),Dt(),j(),pe()})},rn=()=>{if(!v.value)return;const t=window.getSelection();if(t.rangeCount===0)return;const n=t.getRangeAt(0).commonAncestorContainer,a=n.nodeType===1?n.tagName==="BLOCKQUOTE"?n:n.closest("blockquote"):n.parentElement?.closest("blockquote");if(!a||!v.value.contains(a))return;const r=g=>{if(!g)return!1;const h=g.textContent||"",C=(g.innerHTML||"").trim();return h.trim()===""||C===""||C==="<br>"||C==="<br/>"||C==="<p></p>"||C==="<p><br></p>"||C==="<p><br/></p>"||C==="<p> </p>"||C==="<p><br> </p>"||C==="<div></div>"||C==="<div><br></div>"||C==="<div><br/></div>"};let c=null;for(n.nodeType===3?c=n.parentElement:n.tagName==="P"||n.tagName==="DIV"?c=n:c=n.closest("p, div"),c&&a.contains(c)&&r(c)&&c.remove();a.lastChild;){const g=a.lastChild;if(g.nodeType===1&&g.tagName==="BR")g.remove();else if(g.nodeType===3)if((g.textContent||"").trim()==="")g.remove();else break;else break}if(a.children.length>0)for(let g=a.children.length-1;g>=0;g--){const h=a.children[g];if((h.tagName==="P"||h.tagName==="DIV")&&r(h))h.remove();else break}let i=a.innerHTML;const d=i;i=i.replace(/(<br\s*\/?>)+$/gi,""),i!==d&&(a.innerHTML=i);const m=document.createElement("p");m.innerHTML="<br>",a.parentNode?a.nextSibling?a.parentNode.insertBefore(m,a.nextSibling):a.parentNode.appendChild(m):v.value&&v.value.appendChild(m);const p=document.createRange();p.selectNodeContents(m),p.collapse(!0),t.removeAllRanges(),t.addRange(p),e.nextTick(()=>{Dt(),j()})},He=()=>{if(!v.value){De.value=!1;return}try{const t=window.getSelection();if(t.rangeCount>0){const n=t.getRangeAt(0).commonAncestorContainer,a=n.nodeType===1?n.closest("a"):n.parentElement?.closest("a");De.value=!!a}else De.value=!1}catch{De.value=!1}},vt=()=>{if(!v.value)return;const t=window.getSelection();t&&t.rangeCount>0&&t.getRangeAt(0),xt.value=be();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),J.value="",Q.value=n,Ot.value="",de.value=null,et.value=!0,Ve(),e.nextTick(()=>{tt.value&&tt.value.focus()})},k=()=>{if(!v.value)return;le.value?(z.value&&(clearTimeout(z.value),z.value=null),we(),le.value=!1):we();const t=window.getSelection();let o=null;if(t.rangeCount>0){const a=t.getRangeAt(0).commonAncestorContainer;o=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a")}if(!o&&de.value&&(o=de.value),o&&o.parentNode){const n=document.createDocumentFragment();for(;o.firstChild;)n.appendChild(o.firstChild);if(o.parentNode.replaceChild(n,o),n.firstChild){const a=document.createRange();a.setStartBefore(n.firstChild),a.setEndAfter(n.lastChild||n.firstChild),t.removeAllRanges(),t.addRange(a),document.execCommand("removeFormat",!1),a.collapse(!1),t.removeAllRanges(),t.addRange(a)}de.value=null}else Tt("unlink");De.value=!1,Ve(),e.nextTick(()=>{j(),He()})},Se=()=>{w.disabled||!w.richText||v.value&&(le.value?(z.value&&(clearTimeout(z.value),z.value=null),we(),le.value=!1):we(),Ve(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Ce(),j(),pe()}))},qe=()=>{w.disabled||!w.richText||v.value&&(le.value?(z.value&&(clearTimeout(z.value),z.value=null),we(),le.value=!1):we(),Ve(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Ce(),j(),pe()}))},At=t=>{const o=t.parentElement;if(!o||o.tagName!=="OL")return null;let n=0,a=t.previousElementSibling;for(;a;)a.tagName==="LI"&&n++,a=a.previousElementSibling;return n+1},Ce=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(o=>{const n=o.parentElement;if(n&&n.tagName==="LI"){const a=At(n);a!==null&&Array.from(o.children).filter(c=>c.tagName==="LI").forEach(c=>{c.setAttribute("data-parent-num",String(a))})}})},ke=()=>{if(w.disabled||!w.richText||!v.value)return;Ve(),v.value.focus();const t=window.getSelection();if(t.rangeCount===0)return;const o=t.getRangeAt(0),n=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!n){document.execCommand("indent",!1),e.nextTick(()=>{Ce(),j()});return}const a=n.parentElement;if(!a||a.tagName!=="OL"&&a.tagName!=="UL")return;const r=n.previousElementSibling;if(r&&r.tagName==="LI"){const c=a.tagName.toLowerCase();let i=r.querySelector(`:scope > ${c}`);i||(i=document.createElement(c),r.appendChild(i));const d=At(r);i.appendChild(n),d!==null&&a.tagName==="OL"&&n.setAttribute("data-parent-num",String(d)),Ce();const m=document.createRange();m.selectNodeContents(n),m.collapse(!1),t.removeAllRanges(),t.addRange(m),e.nextTick(()=>{j(),pe()})}else document.execCommand("indent",!1),e.nextTick(()=>{Ce(),j(),pe()})},Ae=()=>{if(w.disabled||!w.richText||!v.value)return;Ve(),v.value.focus();const t=window.getSelection();if(t.rangeCount===0)return;const o=t.getRangeAt(0),n=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!n){document.execCommand("outdent",!1),e.nextTick(()=>{Ce(),j()});return}const a=n.parentElement;if(!a||a.tagName!=="OL"&&a.tagName!=="UL")return;const r=a.parentElement;if(r&&r.tagName==="LI"){const c=r.parentElement;if(c&&(c.tagName==="OL"||c.tagName==="UL")){a.tagName==="OL"&&n.removeAttribute("data-parent-num"),c.insertBefore(n,r.nextSibling),a.children.length===0&&a.remove(),Ce();const i=document.createRange();i.selectNodeContents(n),i.collapse(!1),t.removeAllRanges(),t.addRange(i),e.nextTick(()=>{j(),pe()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Ce(),j(),pe()})},ce=e.ref(null),Fe=e.ref(null),ie=e.ref({}),ne=e.ref(""),Z=e.ref(null),Ee=e.ref("");e.ref("");const rt=e.ref(null);e.ref("");const ze=e.ref([]),Lo=e.ref(!1),lo=e.ref(!1),Fn=t=>{if(!t)return"";const o=t.cloneRange(),n=document.createElement("div");return n.appendChild(o.cloneContents()),n.innerHTML},cn=()=>{if(w.disabled||!w.richText||!v.value)return;if(ce.value!==null){ce.value=null,ne.value="",Ee.value="",rt.value=null,ze.value=[],Ft(!0);return}Ve(),v.value.focus();const t=window.getSelection();if(!t||t.rangeCount===0)return;const o=t.getRangeAt(0);if(o.collapsed||!_t(o))return;Ee.value=Fn(o)||"",rt.value=be();const n=o.getBoundingClientRect(),a=v.value.parentElement;if(!a)return;const r=a.getBoundingClientRect(),c=n.bottom-r.top,d=Math.max(c+8,0);ie.value={top:`${d}px`,bottom:"auto"},ce.value=Date.now(),e.nextTick(()=>{if(ne.value="",Z.value){const p=Z.value;p.style.height="auto",p.style.height=`${p.scrollHeight}px`,p.focus()}const m=a.querySelector(".dss-comment-overlay");if(m&&a){const p=a.querySelector(".dss-text-editor-footer");if(p){const g=a.getBoundingClientRect(),h=m.getBoundingClientRect(),f=p.getBoundingClientRect(),C=h.bottom-g.top,y=f.top-g.top,x=8;if(C>y-x){const E=f.height;ie.value={bottom:`${E+x}px`,top:"auto"}}else ie.value={top:`${d}px`,bottom:"auto"}}}})},it=()=>{if(!ne.value.trim())return;const t=ne.value.trim(),o=new Date,n={text:t,selectionText:Ee.value,selectionRange:rt.value,commentId:ce.value,user:w.commentUser||null,createdAt:o.toISOString()};ze.value=[...ze.value,n],X("comment-submitted",n),he(n),rt.value&&!Lt(rt.value)&&zn(ce.value,rt.value),ne.value="",e.nextTick(()=>{if(Z.value){const a=Z.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`,a.focus()}Qe("sendComment")})},qt=(t,o)=>{if(!(!w.commentUser||!t.user||t.user.id!==w.commentUser.id)){if(ze.value=ze.value.filter((n,a)=>a!==o),ce.value!==null&&v.value){const n=String(ce.value),a=v.value.querySelector(`[data-comment="${n}"], [data-fake-comment="${n}"]`);if(a&&ze.value.length>0){const r=[],c=new Set;ze.value.forEach(i=>{i.user&&i.user.id&&!c.has(i.user.id)&&(c.add(i.user.id),r.push(i.user))}),r.length>0?a.setAttribute("data-comment-user",JSON.stringify(r[0])):a.removeAttribute("data-comment-user"),r.length>1?a.setAttribute("data-comment-user-2",JSON.stringify(r[1])):a.removeAttribute("data-comment-user-2"),a.setAttribute("data-comment-count",String(ze.value.length))}else a&&ze.value.length===0&&(a.removeAttribute("data-comment-user"),a.removeAttribute("data-comment-user-2"),a.setAttribute("data-comment-count","0"))}if(X("comment-deleted",{comment:t,index:o,commentId:ce.value}),w.comments&&Array.isArray(w.comments)){const n=w.comments.filter(a=>!(a.commentId===t.commentId&&a.text===t.text&&a.user?.id===t.user?.id));X("update:comments",n)}e.nextTick(()=>{Qe("deleteComment")})}},Lt=t=>{if(!t||!v.value)return!1;try{const o=ue(t);if(!o)return!1;const n=o.commonAncestorContainer,a=n.nodeType===3?n.parentElement:n;if(a)return!!a.closest("[data-comment], [data-fake-comment]")}catch{}return!1},ue=t=>{if(!t||!v.value)return null;try{const o=document.createRange();if(t.type==="element"&&t.element)return v.value.contains(t.element)?(o.setStart(t.element,t.offset),o.collapse(!0),o):null;let n=0;const a=[v.value];let r=null,c=!1,i=!1;for(;!i&&(r=a.pop());)if(r.nodeType===3){const d=n+r.length;!c&&t.start>=n&&t.start<=d&&(o.setStart(r,t.start-n),c=!0),c&&t.end>=n&&t.end<=d&&(o.setEnd(r,t.end-n),i=!0),n=d}else{let d=r.childNodes.length;for(;d--;)a.push(r.childNodes[d])}return c?o:null}catch{return null}},zn=(t,o)=>{if(!(!t||!o||!v.value))try{const n=ue(o);if(!n||n.collapsed)return;const a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r){const d=r.closest("[data-comment], [data-fake-comment]");if(d){d.getAttribute("data-comment")!==String(t)&&d.getAttribute("data-fake-comment")!==String(t)&&d.setAttribute("data-comment",String(t));return}}const c=document.createElement("span");c.setAttribute("data-comment",String(t));try{const d=n.startContainer,m=n.endContainer,p=n.startOffset,g=n.endOffset,h=d.nodeType===3?d.parentNode:d,f=m.nodeType===3?m.parentNode:m;if(h===f&&p===0&&g===(m.nodeType===3?m.length:f.childNodes.length)&&(h.tagName==="P"||h.tagName==="DIV"||h.tagName==="H1"||h.tagName==="H2"||h.tagName==="H3"||h.tagName==="H4"||h.tagName==="H5"||h.tagName==="H6")){const y=n.extractContents();c.appendChild(y),n.insertNode(c)}else n.surroundContents(c)}catch{const m=n.extractContents();c.appendChild(m),n.insertNode(c)}const i=v.value.querySelector(`[data-comment="${String(t)}"]`);e.nextTick(()=>{Qe("wrapSelectionWithCommentMarker"),j()})}catch{}},he=t=>{if(!t||!t.commentId)return;const o=Array.isArray(w.comments)?[...w.comments]:[],n=typeof t.commentId=="string"&&t.commentId.startsWith("comment-")?Date.now():Number(t.commentId)||t.commentId;let a=o.findIndex(c=>typeof c.conversation_id=="string"&&c.conversation_id.startsWith("comment-")?null:Number(c.conversation_id)===Number(n)||c.conversation_id===n);const r={text:t.text,user:t.user,createdAt:t.createdAt,created_at:t.createdAt,updated_at:t.createdAt};if(a>=0){const c=o[a];if(c.conversation||(c.conversation=[]),c.conversation.push(r),c.updated_at=t.createdAt,!c.article_id&&o.length>0){const i=o.find(d=>d.article_id);i&&(c.article_id=i.article_id)}}else{const c=t.selectionRange,i=o.length>0&&o.find(m=>m.article_id)?.article_id||null,d={conversation_id:n,article_id:i,selection_range:c?{start:c.start||0,end:c.end||0,type:c.type||"text"}:null,selection_text:t.selectionText||"",conversation:[r],created_by_user:t.user,created_at:t.createdAt,updated_at:t.createdAt,status:"active"};o.push(d)}Lo.value=!0,X("update:comments",o)},Ne=(t,o=[])=>{if(w.disabled||!w.richText||!v.value)return;const n=v.value;let a=null;try{a=n.querySelector(t)}catch{return}if(!a)return;Ve(),n.focus();const r=document.createRange();r.selectNodeContents(a);const c=window.getSelection();c&&(c.removeAllRanges(),c.addRange(r)),Ee.value=a.innerHTML||"",rt.value=be();const i=r.getBoundingClientRect(),d=n.parentElement;if(d){const g=d.getBoundingClientRect(),h=i.bottom-g.top,C=Math.max(h+8,0);ie.value={top:`${C}px`,bottom:"auto"}}const m=a.getAttribute("data-comment")||a.getAttribute("data-fake-comment");let p=[];if(m&&w.comments&&Array.isArray(w.comments)){const g=w.comments.find(h=>String(h.conversation_id)===String(m));if(g&&g.conversation&&Array.isArray(g.conversation)){const h=g.conversation.map(f=>({id:f.id||f.commentary_id,commentary_id:f.id||f.commentary_id,conversation_id:g.id||g.conversation_id,text:f.text,user:f.user,createdAt:f.created_at||f.createdAt,updated_at:f.updated_at||f.updatedAt}));p.push(...h)}}p.length===0&&Array.isArray(o)&&o.length>0&&(p=o.slice()),p.sort((g,h)=>{const f=x=>{if(!x)return 0;const E=new Date(x).getTime();return isNaN(E)?0:E},C=f(g.createdAt),y=f(h.createdAt);return C===y?0:C-y}),ze.value=p,Ft(!0),ce.value=m||null,a&&(Fe.value=a,a.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(ne.value="",Z.value){const g=Z.value;g.style.height="auto",g.style.height=`${g.scrollHeight}px`,g.focus()}if(d){const g=d.querySelector(".dss-comment-overlay");if(g){const h=d.querySelector(".dss-text-editor-footer");if(h){const f=d.getBoundingClientRect(),C=g.getBoundingClientRect(),y=h.getBoundingClientRect(),x=C.bottom-f.top,E=y.top-f.top,V=8;if(x>E-V){const M=y.height;ie.value={bottom:`${M+V}px`,top:"auto"}}}}}Qe("openCommentOverlayForSelector")})},qo=e.ref(null),dn=e.ref(0),Xo=t=>{if(!(w.disabled||!w.richText)){if(t.key==="Escape"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!!(r&&v.value&&v.value.contains(r))){t.preventDefault();let i=null;a.nodeType===3?i=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?i=a:i=a.closest("p, div");const d=document.createElement("p");d.innerHTML="<br>",i&&r.contains(i)&&i.nextSibling?r.insertBefore(d,i.nextSibling):r.appendChild(d),setTimeout(()=>{rn()},50);return}}}if(t.key.length===1||t.key==="Enter"){const o=window.getSelection();if(o&&o.rangeCount>0){const n=o.getRangeAt(0),a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r){const c=r.closest(".dss-image-wrapper");if(c){const i=c.querySelector("img");if(r!==i&&!i?.contains(r)){const d=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,m=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(d)&&d!==i||c.contains(m)&&m!==i){t.preventDefault();const p=document.createRange();p.setStartAfter(c),p.collapse(!0),o.removeAllRanges(),o.addRange(p);return}}}}}}if(t.key==="Backspace"||t.key==="Delete"){const o=window.getSelection();if(o.rangeCount>0){const n=o.getRangeAt(0);let a=null,r=null;if(n.collapsed)if(t.key==="Backspace"){const c=n.startContainer;let i=c;c.nodeType===3&&(n.startOffset===0?i=c.previousSibling||c.parentNode:i=c.parentNode);const d=i.previousSibling;d&&(d.classList&&d.classList.contains("dss-image-wrapper")?r=d:d.tagName==="IMG"&&(a=d,r=a.closest(".dss-image-wrapper"))),r||(r=i.closest(".dss-image-wrapper"),r&&(a=r.querySelector("img")))}else{const c=n.startContainer;let i=c;c.nodeType===3&&(n.startOffset===c.length?i=c.nextSibling||c.parentNode:i=c.parentNode);const d=i.nextSibling;d&&(d.classList&&d.classList.contains("dss-image-wrapper")?r=d:d.tagName==="IMG"&&(a=d,r=a.closest(".dss-image-wrapper"))),r||(r=i.closest(".dss-image-wrapper"),r&&(a=r.querySelector("img")))}else{const c=n.commonAncestorContainer,i=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,d=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.nodeType===1&&c.tagName==="IMG"?(a=c,r=a.closest(".dss-image-wrapper")):(a=c.querySelector("img"),a&&(r=a.closest(".dss-image-wrapper"))),r){const m=r.contains(i)||i===r,p=r.contains(d)||d===r,h=n.cloneContents().textContent?.trim()||"",f=r.textContent?.trim()||"";(!m||!p||h.length>f.length)&&(r=null,a=null)}}if(r){t.preventDefault(),t.stopPropagation();const c=r.parentNode;if(c){const i=document.createTextNode("");c.insertBefore(i,r),r.remove();const d=document.createRange();d.setStartAfter(i),d.collapse(!0),o.removeAllRanges(),o.addRange(d),e.nextTick(()=>{j()});return}}}}if(t.key==="Tab"){t.preventDefault(),t.shiftKey?Ae():ke();return}if(t.key==="Enter"){const o=window.getSelection();if(o.rangeCount>0){const n=o.getRangeAt(0);if(n.collapsed){const i=n.startContainer,d=m=>{if(!m)return!1;let p=m.previousSibling;for(;p;){if(p.classList&&p.classList.contains("dss-image-wrapper")||p.tagName==="IMG"||p.querySelector&&p.querySelector(".dss-image-wrapper")||p.querySelector&&p.querySelector("img"))return!0;p=p.previousSibling}const g=m.parentElement;return g&&g!==v.value?d(g):!1};if(i.nodeType===3){const m=i.parentElement;if(m&&(d(m)||d(i))){const p=m.closest("p, div");if(p&&p!==v.value){t.preventDefault(),t.stopPropagation();let g=null;const h=n.startOffset;h<i.length&&(g=i.splitText(h));const f=document.createElement("p");if(g?f.appendChild(g):f.innerHTML="<br>",i.length===0){const y=i.parentElement;y&&(y.removeChild(i),y.childNodes.length===0&&y.appendChild(document.createElement("br")))}p.nextSibling?p.parentNode.insertBefore(f,p.nextSibling):p.parentNode.appendChild(f);const C=document.createRange();g?C.setStart(g,0):C.setStart(f,0),C.collapse(!0),o.removeAllRanges(),o.addRange(C),e.nextTick(()=>{j()});return}}}}const a=n.commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!!(r&&v.value&&v.value.contains(r))){let i=null;a.nodeType===3?i=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?i=a:i=a.closest("p, div");const d=y=>{if(!y)return!1;const x=y.textContent||"",V=(y.innerHTML||"").trim(),M=V.replace(/<br\s*\/?>/gi,"").trim();return x.trim()===""||V===""||M===""||V==="<br>"||V==="<br/>"||V==="<p></p>"||V==="<p><br></p>"||V==="<p><br/></p>"||V==="<p> </p>"||V==="<p><br> </p>"||V==="<div></div>"||V==="<div><br></div>"||V==="<div><br/></div>"},m=r.lastChild,p=m&&m.nodeType===1&&m.tagName==="BR",g=n.startContainer,h=g.nodeType===3?g.parentElement:g,f=h===r||h&&h.parentElement===r;if(i&&d(i)||p&&f){t.preventDefault(),setTimeout(()=>{rn()},50);return}}}}if(t.key===" "){const o=Date.now(),n=o-dn.value;if(qo.value===" "&&n<300){const a=window.getSelection();if(a.rangeCount>0){const r=a.getRangeAt(0),c=r.commonAncestorContainer.nodeType===1?r.commonAncestorContainer.closest("li"):r.commonAncestorContainer.parentElement?.closest("li");if(c){const i=r.startContainer.textContent?.substring(0,r.startOffset)||"";if((c.textContent||"").indexOf(i.trim())<=10||i.trim().length<=2){t.preventDefault(),ke();return}}}}qo.value=" ",dn.value=o}else qo.value=t.key}},On=t=>{if(w.disabled||!w.richText)return;t.preventDefault();let o=t.clipboardData.getData("text/html"),n=t.clipboardData.getData("text/plain");o&&(o=o.replace(/<!--[\s\S]*?-->/g,"")),n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),we();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){let d=a.getRangeAt(0).commonAncestorContainer;d.nodeType===3&&(d=d.parentNode),r=d.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const c=i=>{const m=new DOMParser().parseFromString(i,"text/html");let p=v.value.querySelector("h1")?1:0;if(m.querySelectorAll("h1").forEach(h=>{if(p>0){const f=m.createElement("p");f.innerHTML=h.innerHTML,h.parentNode.replaceChild(f,h)}else p++}),r){const h=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],f=Array.from(m.body.children).filter(C=>h.includes(C.tagName));if(f.length===1){const C=f[0].tagName,y=r.tagName,x=r.textContent.trim()===""&&!r.querySelector("img");let E=!1;if(["H1","H2","H3","H4","H5","H6"].includes(y)?E=!0:x||(C===y||C==="P")&&(E=!0),E)return f[0].innerHTML.trim()}}return m.body.innerHTML.trim()};if(o){const i=c(o);document.execCommand("insertHTML",!1,i)}else if(n)if(/<[a-z][\s\S]*>/i.test(n)){const d=c(n);document.execCommand("insertHTML",!1,d)}else document.execCommand("insertText",!1,n);j()},Yo=t=>{if(Le.value){const n=t.target;!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-toggle")&&Ve()}if(ye.value){const n=t.target,a=n.closest(".dss-floating-toolbar"),r=v.value&&n.closest(".dss-text-editor-content");!a&&!r&&Co()}if(Te.value){const n=t.target,a=n.closest(".dss-floating-toolbar"),r=n.closest(".dss-toolbar-dropdown");!a&&!r&&yn()}const o=t.target;if(!o.closest(".dss-toolbar-dropdown")&&!o.closest(".dss-toolbar-dropdown-submenu")&&(Ze.value=null),!v.value||!o.closest(".dss-text-editor-content")){const n=window.getSelection();if(n&&n.rangeCount>0){const a=n.getRangeAt(0);mt.value=!a.collapsed&&_t(a)}else mt.value=!1}if(ce.value!==null){const n=document.querySelector(".dss-comment-overlay");let a=!1;if(n){const i=n.getBoundingClientRect(),d=t.clientX,m=t.clientY;a=d>=i.left&&d<=i.right&&m>=i.top&&m<=i.bottom}const r=o.closest(".dss-toolbar-button"),c=r&&r.getAttribute("title")==="Comment";!a&&!c&&(ce.value=null,ne.value="",Ee.value="",rt.value=null,ze.value=[],Ft(!0))}},me=(t,o)=>{t&&t.stopPropagation&&t.stopPropagation(),xe.value&&(clearTimeout(xe.value),xe.value=null),Ze.value=o},$o=t=>{const o=t.relatedTarget;if(o){const n=o.closest(".dss-toolbar-dropdown-submenu"),a=o.closest(".dss-toolbar-dropdown-item-has-submenu");if(n||a)return}xe.value&&clearTimeout(xe.value),xe.value=setTimeout(()=>{Ze.value=null,xe.value=null},150)},un=t=>{Ze.value=null};let mn=0;const Pn=t=>{if(!t)return;const o=Array.from(t.children);o.forEach(n=>{n.classList.contains("dss-toolbar-dropdown-submenu")||n.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(n.tagName==="BUTTON"||n.tagName==="DIV")&&!n.classList.contains("dss-toolbar-dropdown-item")&&n.classList.add("dss-toolbar-dropdown-item")}),o.forEach((n,a)=>{if(n.classList.contains("dss-toolbar-dropdown-item-has-submenu")||n.classList.contains("dss-toolbar-dropdown-submenu")||!n.classList.contains("dss-toolbar-dropdown-item"))return;const r=Array.from(n.children).find(d=>d.tagName==="DIV"?d.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(d.children).filter(p=>p.tagName==="BUTTON"||p.tagName==="DIV").length>0:!1),c=n.nextElementSibling,i=c&&!c.classList.contains("dss-toolbar-dropdown-submenu")&&!c.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&c.tagName==="DIV"&&!c.classList.contains("dss-toolbar-dropdown-item")&&Array.from(c.children).some(d=>d.tagName==="BUTTON"||d.tagName==="DIV");if(r||i){const d=`submenu-auto-${++mn}`;n.classList.add("dss-toolbar-dropdown-item-has-submenu"),n.setAttribute("data-submenu-id",d);let m=null;r?(n.tagName==="BUTTON"&&n.parentNode.insertBefore(r,n.nextSibling),r.classList.add("dss-toolbar-dropdown-submenu"),m=r):i&&(c.classList.add("dss-toolbar-dropdown-submenu"),m=c),m&&(m.setAttribute("data-submenu-id",d),m.setAttribute("data-processed","true"),r&&n.tagName!=="BUTTON"?m.dataset.originalParentRef="inside":m.dataset.originalParentRef="sibling",Array.from(m.children).forEach(g=>{(g.tagName==="BUTTON"||g.tagName==="DIV")&&!g.classList.contains("dss-toolbar-dropdown-item")&&g.classList.add("dss-toolbar-dropdown-item")}))}})},pn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(o=>{Pn(o),o.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(r=>{const c=r._subMenuHandlers;c&&(r.removeEventListener("mouseenter",c.enter),r.removeEventListener("mouseleave",c.leave));const i=m=>{const p=r.getAttribute("data-submenu-id");p&&me(m,p)},d=$o;r.addEventListener("mouseenter",i),r.addEventListener("mouseleave",d),r._subMenuHandlers={enter:i,leave:d}}),o.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(r=>{const c=r._subMenuHandlers;c&&(r.removeEventListener("mouseenter",c.enter),r.removeEventListener("mouseleave",c.leave));const i=p=>{const g=r.getAttribute("data-submenu-id");g&&me(p,g)},d=$o;r.addEventListener("mouseenter",i),r.addEventListener("mouseleave",d),r._subMenuHandlers={enter:i,leave:d},r.querySelectorAll(".dss-toolbar-dropdown-item").forEach(p=>{p.addEventListener("click",un)})})})};let ao=null;const Xt=()=>{if(Ze.value){const t=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ze.value}"]`),o=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ze.value}"]`);t&&o&&s(t,o)}if(ye.value&&pe(),w.richText){if(ao!==null)return;ao=setTimeout(()=>{ao=null,Qe("handleWindowResize")},150)}},so=()=>{if(!w.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(o=>{Array.from(o.children).filter(a=>a.tagName==="DIV"&&!a.classList.contains("dss-toolbar-button")).forEach(a=>{a.classList.add("dss-toolbar-button")})})},fn=()=>{const t=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),o=n=>{if(n.preventDefault(),n.stopPropagation(),window.getSelection){const a=window.getSelection();a.removeAllRanges?a.removeAllRanges():a.empty&&a.empty()}return!1};t.forEach(n=>{n.addEventListener("selectstart",o),n.addEventListener("mousedown",o),n.addEventListener("dragstart",o),n.addEventListener("contextmenu",o),n.addEventListener("click",a=>{if(window.getSelection){const r=window.getSelection();r.removeAllRanges&&r.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Ke.value?Re():Uo(),Ge.value?yo():Mo()})}),e.nextTick(()=>{fn()}),w.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Yo),window.addEventListener("resize",Xt);let t=null;const o=()=>{t===null&&(t=setTimeout(()=>{t=null,Xt()},150))};window.addEventListener("scroll",o,!0),v.value._windowScrollHandler=o,v.value._windowScrollTimeout=t,v.value.closest(".editor-with-comments"),v.value.closest(".dss-text-editor-content-wrapper");const n=v.value.closest(".dss-text-editor-content");let a=null;const r=()=>{a===null&&(a=setTimeout(()=>{a=null,Xt()},150))};n&&(n.addEventListener("scroll",r),v.value._scrollHandlers={wrapper:null,content:n,handler:r}),e.nextTick(()=>{pn(),so()}),v.value.addEventListener("click",d=>{const m=d.target;m.closest("a")&&!w.disabled&&d.preventDefault();const g=m.closest(".dss-image-no-alt-icon"),h=m.closest(".dss-image-wrapper");if(g||h&&m===h){d.preventDefault(),d.stopPropagation();const f=window.getSelection(),C=document.createRange();C.setStartAfter(h),C.collapse(!0),f.removeAllRanges(),f.addRange(C)}else h&&m.tagName!=="IMG"&&(d.preventDefault(),e.nextTick(()=>{const f=window.getSelection();if(f.rangeCount>0){const y=f.getRangeAt(0).commonAncestorContainer,x=y.nodeType===3?y.parentElement:y;if(h.contains(x)&&x!==h.querySelector("img")){const E=document.createRange();E.setStartAfter(h),E.collapse(!0),f.removeAllRanges(),f.addRange(E)}}else{const C=document.createRange();C.setStartAfter(h),C.collapse(!0),f.addRange(C)}}))},!0),v.value.addEventListener("mousedown",d=>{const m=d.target,p=m.closest(".dss-image-no-alt-icon"),g=m.closest(".dss-image-wrapper");if(p||g&&m.tagName!=="IMG"){d.preventDefault();const h=window.getSelection(),f=document.createRange();g&&(f.setStartAfter(g),f.collapse(!0),h.removeAllRanges(),h.addRange(f))}},!0),v.value.addEventListener("paste",d=>{e.nextTick(()=>{if(!v.value)return;v.value.querySelectorAll("img").forEach(p=>{if(!p.closest(".dss-image-wrapper"))p.removeAttribute("alt"),p.removeAttribute("data-alt"),p.setAttribute("alt",""),p.setAttribute("data-alt",""),p.alt="";else{const h=p.getAttribute("alt")||p.alt||"";if(h){const f=p.getAttribute("src")||p.src||"",C=f.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),y=h===f||h===C;(h.startsWith("http://")||h.startsWith("https://")||h.startsWith("data:")||y||y)&&(p.setAttribute("alt",""),p.setAttribute("data-alt",""),p.alt="")}}}),st()})}),v.value.addEventListener("dragstart",d=>{const m=d.target,p=m.tagName==="IMG"?m:m.closest("img"),g=p?.closest(".dss-image-wrapper");p&&v.value.contains(p)&&(je.value=g||p,d.dataTransfer.effectAllowed="move",d.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",d=>{je.value&&(d.preventDefault(),d.stopPropagation(),d.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",d=>{je.value&&(d.preventDefault(),d.stopPropagation())}),v.value.addEventListener("drop",d=>{if(!je.value||!v.value)return;d.preventDefault(),d.stopPropagation();const m=je.value,p=m.classList?.contains("dss-image-wrapper"),g=p?m.querySelector("img"):m,h=p?m:g?.closest(".dss-image-wrapper");if(!g||!v.value.contains(g)){je.value=null;return}let f=null;const C=d.clientX,y=d.clientY;if(document.caretRangeFromPoint)f=document.caretRangeFromPoint(C,y);else{const B=window.getSelection();B.rangeCount>0?f=B.getRangeAt(0).cloneRange():(f=document.createRange(),f.selectNodeContents(v.value),f.collapse(!1))}if(!f){je.value=null;return}const x=f.commonAncestorContainer,E=x.nodeType===3?x.parentElement:x;if(E?.closest(".dss-image-wrapper")===h||h&&h.contains(E)){je.value=null;return}if(h&&(E===h||h.contains(E))){je.value=null;return}const M=g.getAttribute("src");let H=null;h?H=h.cloneNode(!0):H=g.cloneNode(!0);try{let B=f.startContainer;if(B.nodeType===3&&(B=B.parentElement),h&&(B===h||h.contains(B))){const q=document.createRange();q.setStartAfter(h),q.collapse(!0),f=q}f.insertNode(H);const _=document.createRange();_.setStartAfter(H),_.collapse(!0);const R=window.getSelection();R.removeAllRanges(),R.addRange(_)}catch{if(v.value.childNodes.length===0){const _=document.createElement("p");_.appendChild(H),v.value.appendChild(_)}else{const _=v.value.lastChild;if(_&&_.nodeType===1)_.appendChild(H);else{const R=document.createElement("p");R.appendChild(H),v.value.appendChild(R)}}}h?h.remove():g.remove(),je.value=null,e.nextTick(()=>{const B=v.value.querySelectorAll("img");let _=!1;B.forEach(R=>{if(R.getAttribute("src")===M)if(!_)_=!0;else{const q=R.closest(".dss-image-wrapper");q?q.remove():R.remove()}}),st(),j()})}),v.value.addEventListener("dragend",d=>{je.value=null});let c=null;const i=new MutationObserver(d=>{d.forEach(m=>{m.addedNodes.forEach(p=>{if(p.nodeType===1){p.tagName==="IMG"&&(p.removeAttribute("alt"),p.removeAttribute("data-alt"),p.setAttribute("alt",""),p.setAttribute("data-alt",""),p.alt="");const g=p.querySelectorAll&&p.querySelectorAll("img");g&&g.forEach(h=>{h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt=""})}})}),c&&clearTimeout(c),c=setTimeout(()=>{st(),so(),c=null},100)});if(i.observe(v.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const d=document.querySelector(".dss-text-editor-toolbar");if(d){const m=new MutationObserver(()=>{e.nextTick(()=>{so()})});m.observe(d,{childList:!0,subtree:!0}),d._toolbarMutationObserver=m}}),w.modelValue){const d=Zo(w.modelValue);v.value.innerHTML=d,no()}e.nextTick(()=>{const d=v.value.innerHTML||"",m=w.title||"",p=w.description||"";Ue.value=d,lt.value=m,fe.value=p,We.value=m,Ye.value=p,Ce(),st(),Bt(),$t(),u(),Rt()}),He(),Dt(),v.value._mutationObserver=i}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Yo),window.removeEventListener("resize",Xt),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),ao!==null&&(clearTimeout(ao),ao=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),z.value&&clearTimeout(z.value),xe.value&&clearTimeout(xe.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),pt.value&&pt.value.disconnect(),Ie.value!==null&&(cancelAnimationFrame(Ie.value),Ie.value=null),zo.value!==null&&(clearTimeout(zo.value),zo.value=null),ft.value!==null&&(clearTimeout(ft.value),ft.value=null),Ft(!0),v.value&&v.value._scrollHandlers){const{wrapper:o,content:n,handler:a}=v.value._scrollHandlers;o&&o.removeEventListener("scroll",a),n&&n.removeEventListener("scroll",a)}const t=document.querySelector(".dss-text-editor-toolbar");t&&t._toolbarMutationObserver&&t._toolbarMutationObserver.disconnect()});const vn=t=>{const o=t.target,n=o.closest("a");if(n&&!w.disabled){t.preventDefault();const r=document.createRange();r.selectNodeContents(n);const c=window.getSelection();c.removeAllRanges(),c.addRange(r)}const a=o.closest(".dss-image-wrapper");a&&o.tagName!=="IMG"?e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0).commonAncestorContainer,d=i.nodeType===3?i.parentElement:i;if(a.contains(d)&&d!==a.querySelector("img")){const m=document.createRange();m.setStartAfter(a),m.collapse(!0),r.removeAllRanges(),r.addRange(m)}}st(),He(),Dt(),pe(),$t()}):e.nextTick(()=>{st(),He(),Dt(),pe(),$t()})},gn=()=>{Wo();const t=window.getSelection();if(t&&t.rangeCount>0){const n=t.getRangeAt(0);mt.value=!n.collapsed&&_t(n),!n.collapsed&&St.value&&(St.value=null)}else mt.value=!1;if(st(),He(),Dt(),pe(),$t(),t&&t.rangeCount>0){const a=t.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r&&r.closest(".dss-text-editor-footer")){t.removeAllRanges(),mt.value=!1;return}}["bold","italic","underline"].forEach(n=>{try{const a=window.getSelection();if(a.rangeCount>0){const r=a.getRangeAt(0);if(!r.collapsed)if(n==="bold"){const c=r.commonAncestorContainer,i=c.nodeType===3?c.parentElement:c;let d=!1;if(i&&((i.tagName==="STRONG"||i.tagName==="B"||i.closest&&i.closest("strong, b"))&&(d=!0),!d&&i.style&&parseInt(i.style.fontWeight)>=600&&(d=!0),!d))try{const m=window.getComputedStyle(i);parseInt(m.fontWeight)>=600&&(d=!0)}catch{}O.value[n]=d}else{const c=document.queryCommandState(n);O.value[n]=c}}}catch{}})},$t=()=>{if(!w.richText||w.disabled||!v.value){ve.value="p";return}try{const t=window.getSelection();if(!t||t.rangeCount===0){ve.value="p";return}const n=t.getRangeAt(0).commonAncestorContainer,a=n.nodeType===3?n.parentElement:n;if(!a||!v.value.contains(a)){ve.value="p";return}const r=a.closest("h1, h2, h3, h4, h5, h6, p");if(!r){ve.value="p";return}const c=r.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(c)?ve.value=c:ve.value="p"}catch{ve.value="p"}},Dt=()=>{if(!v.value){Jt.value=!1;return}try{const t=window.getSelection();let o=!1;if(t.rangeCount>0){const a=t.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");o=!!(r&&v.value.contains(r))}Jt.value=o}catch{Jt.value=!1}},_t=t=>{if(!t||!v.value)return!1;const o=t.commonAncestorContainer;if(!o)return!1;const n=o.nodeType===3?o.parentElement:o;return n?v.value.contains(n):!1},Co=()=>{ye.value=!1},pe=()=>{if(!w.floatingToolbar||!w.richText||w.disabled){ye.value=!1;return}const t=window.getSelection();if(!t||t.rangeCount===0){ye.value=!1;return}const o=t.getRangeAt(0);if(o.collapsed||!_t(o)){ye.value=!1;return}const n=o.getBoundingClientRect();if(!n||n.width===0&&n.height===0){ye.value=!1;return}const a=v.value;if(!a){ye.value=!1;return}const r=a.getBoundingClientRect();if(!r||r.width===0){ye.value=!1;return}const c=40,i=8,d=n.top-c/2+15;let m=n.left+n.width/2;const p=window.innerWidth||document.documentElement.clientWidth||0;let g=0;fo.value&&(g=fo.value.getBoundingClientRect().width);const h=(g||320)/2;let f=r.left+h,C=r.right-h;if(C<f){const y=r.left+r.width/2;f=y,C=y}if(p>0){const y=h+i,x=p-h-i;if(f=Math.max(f,y),C=Math.min(C,x),C<f){const E=p/2;f=E,C=E}}m<f?m=f:m>C&&(m=C),Be.value={position:"fixed",top:`${Math.max(d,8)}px`,left:`${m}px`,transform:"translate(-50%, -100%)",zIndex:10003},ye.value=!0},hn=t=>{w.disabled||!w.richText||(Te.value=Te.value===t?null:t,t==="askAi"&&(Le.value=null))},yn=()=>{Te.value=null,Ze.value=null},It=t=>{Ht(t),yn()};let Yt=null,ro=null,Je=null,io=null;const Cn=t=>{if(w.disabled||!w.richText){ko(),co();return}const o=t.target,n=o.closest("a"),a=o.closest("img");if(Yt&&(clearTimeout(Yt),Yt=null),Je&&(clearTimeout(Je),Je=null),n&&n!==ro){co(),ro=n;let r=n.getAttribute("href")||"";(!r||r==="#"||r==="")&&(r=n.textContent||""),de.value=n,D.value=r,T.value=!0,P.value=!0,kn(n)}else!n&&ro?(ro=null,Yt=setTimeout(()=>{P.value||ko()},150)):n&&n===ro&&kn(n);if(a&&a!==io){ko(),io=a;let r=a.getAttribute("alt");r===null&&(r=a.alt||"");let c=a.getAttribute("data-alt");c===null&&(c=r),a.hasAttribute("alt")||a.setAttribute("alt",r),a.hasAttribute("data-alt")||a.setAttribute("data-alt",c),Y.value=a,Qt.value=r.trim()||b("textEditor.image.noAlt"),ho.value=!0,Zt.value=!0,xn(a)}else!a&&io?(io=null,Je=setTimeout(()=>{Zt.value||co()},150)):a&&a===io&&xn(a)},Zn=t=>{const o=t.relatedTarget;(!o||!o.closest(".dss-text-editor-content")&&!o.closest(".dss-link-popup"))&&(ro=null,io=null,Yt&&(clearTimeout(Yt),Yt=null),Je&&(clearTimeout(Je),Je=null),ko(),co())},ko=()=>{P.value=!1,setTimeout(()=>{P.value||(T.value=!1,D.value="",et.value||(de.value=null))},100)},kn=t=>{if(!t||!v.value)return;const o=t.getBoundingClientRect(),r=o.top-32-8,c=o.left+o.width/2;W.value={position:"fixed",top:`${r}px`,left:`${c}px`,transform:"translateX(-50%)",zIndex:10002}},co=()=>{Zt.value=!1,setTimeout(()=>{Zt.value||(ho.value=!1,Qt.value="",vo.value||(Y.value=null))},100)},xn=t=>{if(!t||!v.value)return;const o=t.getBoundingClientRect(),r=o.top-32-8,c=o.left+o.width/2;Pt.value={position:"fixed",top:`${r}px`,left:`${c}px`,transform:"translateX(-50%)",zIndex:10002}},Un=()=>{if(!D.value||!de.value)return;let o=de.value.getAttribute("href")||D.value;!o.startsWith("http://")&&!o.startsWith("https://")&&!o.startsWith("mailto:")&&(o="https://"+o),window.open(o,"_blank","noopener,noreferrer")},Do=()=>{if(de.value){const t=de.value.textContent||"",o=de.value.getAttribute("href")||"",n=de.value;J.value=o,Q.value=t,Ot.value=t,P.value=!1,T.value=!1,D.value="",de.value=n,et.value=!0}else if(De.value){const t=window.getSelection();if(t.rangeCount>0){const n=t.getRangeAt(0).commonAncestorContainer,a=n.nodeType===1?n.closest("a"):n.parentElement?.closest("a");if(a){const r=a.textContent||"",c=a.getAttribute("href")||"";J.value=c,Q.value=r,Ot.value=r,de.value=a,et.value=!0}}}else{xt.value=be();const t=window.getSelection();let o="";t.rangeCount>0&&(o=t.getRangeAt(0).toString()),J.value="",Q.value=o,Ot.value="",de.value=null,et.value=!0}e.nextTick(()=>{tt.value&&(tt.value.focus(),tt.value.select())})},_o=()=>{et.value=!1,J.value="",Q.value="",Ot.value="",de.value=null,xt.value=null},jo=()=>{if(!J.value.trim()){_o();return}if(le.value?(z.value&&(clearTimeout(z.value),z.value=null),we(),le.value=!1):we(),Q.value.trim()||(Q.value=J.value.trim()),de.value&&v.value&&v.value.contains(de.value)){const t=window.getSelection();t.rangeCount>0&&t.removeAllRanges();const o=de.value;if(o.setAttribute("href",J.value.trim()),Q.value.trim()!==Ot.value.trim()){for(;o.firstChild;)o.removeChild(o.firstChild);o.textContent=Q.value.trim()}o.style.color="#60afdf",o.style.textDecoration="underline";const n=document.createRange();n.selectNodeContents(o),n.collapse(!1),t.removeAllRanges(),t.addRange(n),j()}else if(v.value){v.value.focus();const t=window.getSelection();t.removeAllRanges(),xt.value&&at(xt.value);let o=null;if(t.rangeCount>0&&(o=t.getRangeAt(0)),o&&!o.collapsed){o.toString();const n=document.createElement("a");n.href=J.value.trim(),n.textContent=Q.value.trim(),n.style.color="#60afdf",n.style.textDecoration="underline",o.deleteContents(),o.insertNode(n);const a=document.createTextNode(" ");o.setStartAfter(n),o.insertNode(a),o.setStartAfter(a),o.collapse(!0),t.removeAllRanges(),t.addRange(o)}else{o||(o=document.createRange(),o.selectNodeContents(v.value),o.collapse(!1));const n=o.startContainer,a=n.nodeType===3,r=a&&o.startOffset===n.textContent.length,c=document.createElement("a");if(c.href=J.value.trim(),c.textContent=Q.value.trim(),c.style.color="#60afdf",c.style.textDecoration="underline",r){let i=n.parentElement;for(;i&&i!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(i.tagName);)i=i.parentElement;if(i&&i!==v.value){let d=i.nextElementSibling;if(d&&(d.innerHTML==="<br>"||d.innerHTML==="<br/>"||d.textContent.trim()==="")){d.textContent="",d.appendChild(c);const m=document.createTextNode(" ");d.appendChild(m);const p=document.createRange();p.setStartAfter(c),p.collapse(!0),t.removeAllRanges(),t.addRange(p)}else{if(o.startOffset>0){const p=n.textContent.substring(0,o.startOffset),g=p[p.length-1];if(g&&g!==" "&&g!==" "&&g!==`
79
+ `){const h=document.createTextNode(" ");o.insertNode(h),o.setStartAfter(h)}}o.insertNode(c);const m=document.createTextNode(" ");o.setStartAfter(c),o.insertNode(m),o.setStartAfter(m),o.collapse(!0),t.removeAllRanges(),t.addRange(o)}}}else{if(a&&o.startOffset>0){const d=n.textContent.substring(0,o.startOffset),m=d[d.length-1];if(m&&m!==" "&&m!==" "&&m!==`
80
+ `){const p=document.createTextNode(" ");o.insertNode(p),o.setStartAfter(p)}}o.insertNode(c);const i=document.createTextNode(" ");o.setStartAfter(c),o.insertNode(i),o.setStartAfter(i),o.collapse(!0),t.removeAllRanges(),t.addRange(o)}}j()}e.nextTick(()=>{He(),_o()})},Io=()=>{if(!v.value||Oe.value)return;const t=window.getSelection();let o=null;t&&t.rangeCount>0&&(o=be());const n=/(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,a=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:d=>{const m=d.parentElement;return!m||m.closest("a")||m.closest(".dss-image-wrapper")||!d.textContent||d.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),r=[];let c;for(;c=a.nextNode();)r.push(c);let i=!1;for(let d=r.length-1;d>=0;d--){const m=r[d],p=m.textContent;n.lastIndex=0;const g=[...p.matchAll(n)];if(g.length===0)continue;const h=g.filter(y=>{const x=y[0],E=y.index;if(E>0&&p[E-1]==="@"||E+x.length<p.length&&p[E+x.length]==="@")return!1;const V=m.parentElement;return!(V&&V.closest("a"))});if(h.length===0)continue;if(h.length===1&&h[0][0]===p.trim()){const y=h[0][0],x=y.startsWith("http://")||y.startsWith("https://")?y:`https://${y}`,E=document.createElement("a");E.href=x,E.textContent=y,E.style.color="#60afdf",E.style.textDecoration="underline",m.parentNode&&(m.parentNode.replaceChild(E,m),i=!0);continue}let f=0;const C=document.createDocumentFragment();if(h.forEach(y=>{const x=y.index,E=y[0];if(x>f){const H=p.substring(f,x);H&&C.appendChild(document.createTextNode(H))}const V=E.startsWith("http://")||E.startsWith("https://")?E:`https://${E}`,M=document.createElement("a");M.href=V,M.textContent=E,M.style.color="#60afdf",M.style.textDecoration="underline",C.appendChild(M),f=x+E.length}),f<p.length){const y=p.substring(f);y&&C.appendChild(document.createTextNode(y))}m.parentNode&&C.childNodes.length>0&&(m.parentNode.replaceChild(C,m),i=!0)}i&&o&&e.nextTick(()=>{at(o),He()})},Wn=()=>{if(!v.value)return;const t=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,o=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:r=>{const c=r.parentElement;return!c||c.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),n=[];let a;for(;a=o.nextNode();)n.push(a);for(let r=n.length-1;r>=0;r--){const c=n[r],i=c.textContent,d=[...i.matchAll(t)];if(d.length===0)continue;let m=0;const p=document.createDocumentFragment();d.forEach(g=>{const h=g.index,f=g[0].startsWith("<u>")?"u":"ins",C=g[1]||g[2]||"";h>m&&p.appendChild(document.createTextNode(i.substring(m,h)));const y=document.createElement(f);y.textContent=C,p.appendChild(y),m=h+g[0].length}),m<i.length&&p.appendChild(document.createTextNode(i.substring(m))),c.parentNode&&p.childNodes.length>0&&c.parentNode.replaceChild(p,c)}},gt=t=>{if(!v.value||Oe.value)return;if(!t){Wn();return}if(!["*","_",">"].includes(t))return;const n=window.getSelection();if(!n||n.rangeCount===0)return;const a=n.getRangeAt(0);if(!a.collapsed)return;const r=a.startContainer.nodeType===Node.TEXT_NODE?a.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):a.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!r||r===v.value||!v.value.contains(r))return;const c=()=>{let H="",B=0,_=!1;const R=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode:G=>G.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null);let q=0;for(;R.nextNode();){const G=R.currentNode,Me=G.textContent||"",yt=q;if(q+=Me.length,G===a.startContainer){H+=Me.substring(0,a.startOffset),B=yt+a.startOffset,_=!0;break}H+=Me}return _||(B=H.length),{textBeforeCursor:H,cursorCharOffset:B}},{textBeforeCursor:i}=c();if(!i.length)return;let d=null,m=null;if(i.endsWith("**")&&(d=i.match(/\*\*(.+?)\*\*$/s))||i.endsWith("__")&&(d=i.match(/__(.+?)__$/s))?m="strong":i.endsWith("*")&&!i.endsWith("**")&&(d=i.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||i.endsWith("_")&&!i.endsWith("__")&&(d=i.match(new RegExp("(?<!_)_([^_]+)_$")))?m="em":t===">"&&((d=i.match(/<u>(.+?)<\/u>$/s))||(d=i.match(/<ins>(.+?)<\/ins>$/s)))&&(m=d[0].startsWith("<u>")?"u":"ins",d[0].startsWith("<u>"),d[0].startsWith("<u>")),!d||!d[1])return;const p=d[0],g=d[1],h=i.length-p.length,C=(H=>{let B=0;const _=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode:q=>q.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let R;for(;R=_.nextNode();){const q=(R.textContent||"").length;if(B+q>=H)return{node:R,offset:H-B};B+=q}return null})(h);if(!C)return;const y=document.createRange();y.setStart(C.node,C.offset),y.setEnd(a.endContainer,a.endOffset);const x=document.createElement(m);x.textContent=g,y.deleteContents(),y.insertNode(x);const E=window.getSelection(),V=document.createRange();V.setStartAfter(x),V.collapse(!0),E.removeAllRanges(),E.addRange(V);const M=be();e.nextTick(()=>{j(),M&&at(M)})},xo=()=>{v.value&&(Et.value=be(),Pe.value="",ot.value="",bt.value="",ee.value="",se.value="",Vo.value=null,Y.value=null,_e.value="upload",vo.value=!0,Ve(),e.nextTick(()=>{wt.value&&wt.value.focus(),Xe.value&&(Xe.value.value="")}))},wo=t=>{const o=t.target?.files?.[0];if(!o){Vo.value=null,ot.value="";return}Vo.value=o;const n=new FileReader;n.onload=a=>{ot.value=a.target?.result||""},n.readAsDataURL(o)},ct=()=>{Xe.value&&Xe.value.click()},uo=()=>{ee.value&&(se.value="")},mo=()=>{se.value&&(ee.value="")},Eo=()=>{let t=Y.value;if(!t){const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer;t=a.nodeType===1?a.closest("img"):a.parentElement?.closest("img")}}if(t){const o=t.getAttribute("data-alt")||t.getAttribute("alt")||"";Y.value=t,Pe.value=o.trim()===""||o.trim()==="Image"?"":o;const n=t.getAttribute("src")||t.src||"";n.startsWith("http://")||n.startsWith("https://")?(bt.value=n,ot.value="",_e.value="url"):(ot.value=n,bt.value="",_e.value="upload");const r=t.style.width||t.getAttribute("width")||"",c=t.style.height||t.getAttribute("height")||"";ee.value=r.endsWith("px")?r.replace("px",""):r,se.value=c.endsWith("px")?c.replace("px",""):c,Et.value=null}else{xo();return}vo.value=!0,Zt.value=!1,ho.value=!1,e.nextTick(()=>{_e.value==="url"&&go.value?(go.value.focus(),go.value.select()):wt.value&&(wt.value.focus(),wt.value.select()),Xe.value&&(Xe.value.value="")})},U=()=>{vo.value=!1,Pe.value="",ot.value="",bt.value="",ee.value="",se.value="",Vo.value=null,Y.value=null,Et.value=null,_e.value="upload"},ht=()=>{const t=(Pe.value||"").trim(),o=v.value?._mutationObserver;o&&o.disconnect(),le.value?(z.value&&(clearTimeout(z.value),z.value=null),we(),le.value=!1):we();const n=_e.value==="url"?bt.value.trim():ot.value;if(Y.value&&v.value&&v.value.contains(Y.value)){n&&(Y.value.src=n),Y.value.setAttribute("alt",t),Y.value.setAttribute("data-alt",t),ee.value?(Y.value.style.width=`${ee.value}px`,Y.value.setAttribute("width",ee.value)):(Y.value.style.removeProperty("width"),Y.value.removeAttribute("width")),se.value?(Y.value.style.height=`${se.value}px`,Y.value.setAttribute("height",se.value)):(Y.value.style.removeProperty("height"),Y.value.removeAttribute("height"));const a=window.getSelection();if(a){a.removeAllRanges();const r=document.createRange();r.setStartAfter(Y.value),r.collapse(!0),a.addRange(r)}j()}else{if(!n){o&&v.value&&o.observe(v.value,{childList:!0,subtree:!0}),U();return}if(v.value){v.value.focus();const a=window.getSelection();a&&a.rangeCount>0&&a.removeAllRanges();const r=window.getSelection();let c=null;if(Et.value&&(at(Et.value),r&&r.rangeCount>0&&(c=r.getRangeAt(0))),!c&&r&&r.rangeCount>0&&(c=r.getRangeAt(0)),!c&&v.value){if(c=document.createRange(),v.value.childNodes.length===0){const p=document.createElement("p");p.innerHTML="<br>",v.value.appendChild(p),c.setStart(p,0),c.collapse(!0)}else c.selectNodeContents(v.value),c.collapse(!1);r&&(r.removeAllRanges(),r.addRange(c))}if(!c){U();return}const i=c.commonAncestorContainer,d=i.nodeType===3?i.parentElement:i;if(!v.value.contains(d)){if(c=document.createRange(),v.value.childNodes.length===0){const p=document.createElement("p");p.innerHTML="<br>",v.value.appendChild(p),c.setStart(p,0),c.collapse(!0)}else c.selectNodeContents(v.value),c.collapse(!1);r&&(r.removeAllRanges(),r.addRange(c))}const m=document.createElement("img");m.src=n,m.setAttribute("alt",t),m.setAttribute("data-alt",t),ee.value&&(m.style.width=`${ee.value}px`,m.setAttribute("width",ee.value)),se.value&&(m.style.height=`${se.value}px`,m.setAttribute("height",se.value));try{c.insertNode(m),c.setStartAfter(m),c.collapse(!0),r&&(r.removeAllRanges(),r.addRange(c))}catch{if(v.value){if(v.value.childNodes.length===0){const h=document.createElement("p");v.value.appendChild(h),h.appendChild(m)}else{const h=v.value.lastChild;if(h&&h.nodeType===1)h.appendChild(m);else{const f=document.createElement("p");v.value.appendChild(f),f.appendChild(m)}}const g=document.createRange();g.setStartAfter(m),g.collapse(!0),r&&(r.removeAllRanges(),r.addRange(g))}}Y.value=m,j()}}e.nextTick(()=>{o&&v.value&&o.observe(v.value,{childList:!0,subtree:!0}),He(),pe(),U()})};e.watch(()=>w.modelValue,t=>{if(w.richText&&v.value&&!Oe.value){const o=Zo(t||""),a=v.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),r=o.replace(/&nbsp;|\u00A0/g," ");if(a!==r){const c=be();v.value.innerHTML=o,e.nextTick(()=>{no();const i=v.value.innerHTML||"",d=w.title||"",m=w.description||"";Ue.value=i,lt.value=d,fe.value=m,Vt.value=i,We.value=d,Ye.value=m,nt.value=[],eo.value=[],z.value&&(clearTimeout(z.value),z.value=null),le.value=!1,c&&at(c),Ce(),st(),Bt(),He(),pe(),$t(),Qe("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>w.richText,t=>{t?(pe(),e.nextTick(()=>{u()})):(Co(),Ut.value=[],pt.value&&(pt.value.disconnect(),pt.value=null)),$t()}),e.watch(()=>w.floatingToolbar,t=>{t?pe():Co()}),e.watch(()=>w.disabled,t=>{t&&Co(),$t()}),e.watch(()=>w.description,()=>{e.nextTick(()=>{Ge.value?yo():Mo()})}),e.watch(()=>w.title,()=>{e.nextTick(()=>{Ke.value?Re():Uo()})}),e.watch(()=>w.customToolbarSlots,()=>{e.nextTick(()=>{so()})},{deep:!0}),e.watch(()=>w.comments,(t,o)=>{if(Lo.value){Lo.value=!1;return}lo.value||w.richText&&v.value&&e.nextTick(()=>{Rt()})},{deep:!0,immediate:!1});const Rt=()=>{if(!lo.value&&!(!w.comments||!Array.isArray(w.comments)||w.comments.length===0)&&!(!w.richText||!v.value)){lo.value=!0;try{const t=new Set,o=w.comments.filter(i=>{const d=String(i.conversation_id||i.id);return t.has(d)?!1:(t.add(d),!0)}),n=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),a=n.length;n.forEach(i=>{const d=i.parentNode;if(d){for(;i.firstChild;)d.insertBefore(i.firstChild,i);d.removeChild(i)}});let r=0;const c=new Set;o.forEach(i=>{if(!i.conversation_id||!i.selection_range)return;const d=typeof i.conversation_id=="string"&&i.conversation_id.startsWith("comment-")?null:Number(i.conversation_id)||i.conversation_id;if(!d)return;const m=String(d);if(c.has(m))return;const p=v.value.querySelector(`[data-comment="${m}"]`);if(p){Ro(p,i),c.add(m);return}try{const g=Yn(i.selection_range,i.selection_text);if(g&&!g.collapsed){const h=g.commonAncestorContainer,f=h.nodeType===3?h.parentElement:h;if(f){const x=f.closest("[data-comment], [data-fake-comment]");if(x){const E=x.getAttribute("data-comment")||x.getAttribute("data-fake-comment");if(String(E)===String(d)){x.setAttribute("data-comment",m),x.removeAttribute("data-fake-comment"),Ro(x,i),c.add(m);return}else return}}const C=v.value.querySelector(`[data-comment="${m}"]`);if(C){Ro(C,i),c.add(m);return}const y=document.createElement("span");y.setAttribute("data-comment",m),Ro(y,i);try{g.surroundContents(y),r++,c.add(m)}catch{try{const E=document.createRange();E.setStart(g.startContainer,g.startOffset),E.setEnd(g.endContainer,g.endOffset),Ko(E),E.surroundContents(y),r++,c.add(m)}catch{try{const V=g.extractContents();y.appendChild(V),g.insertNode(y),r++,c.add(m)}catch(V){console.warn("Failed to create comment marker:",V)}}}}}catch{}}),e.nextTick(()=>{Qe("restoreCommentsFromModel"),j(),lo.value=!1})}catch{lo.value=!1}}},Ko=t=>{if(!t||!v.value)return t;try{const o=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let n=t.startContainer,a=t.startOffset;if(n.nodeType===3){const i=n.parentElement;i&&o.includes(i.tagName)&&(a===0&&!qn(n)||t.setStartBefore(i))}else n.nodeType===1&&o.includes(n.tagName)&&a>0&&t.setStartBefore(n);let r=t.endContainer,c=t.endOffset;if(r.nodeType===3){const i=r.parentElement;i&&o.includes(i.tagName)&&(c===r.length&&!Xn(r)||t.setEndAfter(i))}else r.nodeType===1&&o.includes(r.tagName)&&c<r.childNodes.length&&t.setEndAfter(r);return t}catch{return t}},qn=t=>{let o=t.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},Xn=t=>{let o=t.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},Yn=(t,o)=>{if(!t||!v.value)return null;try{const n=document.createRange();if(t.type==="text"&&typeof t.start=="number"&&typeof t.end=="number"){let a=0;const r=[v.value];let c=null,i=!1,d=!1;for(;!d&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!i&&t.start>=a&&t.start<=m&&(n.setStart(c,t.start-a),i=!0),i&&t.end>=a&&t.end<=m&&(n.setEnd(c,t.end-a),d=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return i?Ko(n):null}}catch{return null}return null},Ro=(t,o)=>{if(!t||!o)return;const n=o.conversation||[],a=new Set,r=[],c=d=>{d&&d.id&&!a.has(d.id)&&(a.add(d.id),r.push(d))};n.length>0&&n.forEach(d=>{d.user&&c(d.user)}),r.length>0?t.setAttribute("data-comment-user",JSON.stringify(r[0])):t.removeAttribute("data-comment-user"),r.length>1?t.setAttribute("data-comment-user-2",JSON.stringify(r[1])):t.removeAttribute("data-comment-user-2");const i=n.length;i>0?t.setAttribute("data-comment-count",String(i)):t.removeAttribute("data-comment-count")},Qe=(t="unknown")=>{if(!w.richText||!v.value){Ut.value=[];return}Date.now()-Oo.value<Sn&&Ie.value!==null||Ie.value===null&&(Ie.value=requestAnimationFrame(()=>{if(Ie.value=null,Oo.value=Date.now(),to.value)return;to.value=!0;const n={},a=v.value;if(!a){to.value=!1;return}const r=a.closest(".editor-with-comments");if(!r){to.value=!1;return}const c=a.querySelectorAll("[data-comment], [data-fake-comment]"),i=[],d=new Set;c.forEach(f=>{const C=f.getAttribute("data-comment")||f.getAttribute("data-fake-comment");C&&f.tagName==="SPAN"&&(d.has(C)||(i.push(f),d.add(C)))}),c.forEach(f=>{const C=f.getAttribute("data-comment")||f.getAttribute("data-fake-comment");!C||d.has(C)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(f.tagName)?f.querySelector(`span[data-comment="${C}"], span[data-fake-comment="${C}"]`)||(i.push(f),d.add(C)):f.tagName!=="SPAN"&&(i.push(f),d.add(C)))});const m=r.getBoundingClientRect(),p=a.getBoundingClientRect();i.forEach((f,C)=>{let y=f.getAttribute("data-comment")||f.getAttribute("data-fake-comment");if(!y)return;if(typeof y=="string"&&y.startsWith("comment-")){const Kt=f.textContent?.trim(),Gt=w.comments?.find(Ct=>(typeof Ct.conversation_id=="string"&&Ct.conversation_id.startsWith("comment-")?null:Ct.conversation_id)&&Ct.selection_text?.trim()===Kt);Gt?(y=String(Gt.conversation_id),f.setAttribute("data-comment",y),f.removeAttribute("data-fake-comment")):(y=String(Date.now()),f.setAttribute("data-comment",y),f.removeAttribute("data-fake-comment"))}const x=f.getBoundingClientRect(),E=window.getComputedStyle(f),V=parseFloat(E.lineHeight)||parseFloat(E.fontSize)*1.2,B=x.top-p.top+V/2-15,R=p.top-m.top+B;let q=null,G=null,Me=0;const yt=[],En=new Set;if(y&&w.comments){const Kt=w.comments.find(Gt=>String(Gt.conversation_id||Gt.id)===String(y));if(Kt){const Gt=Kt.conversation||[];Gt.length>0?(Gt.forEach(Ct=>{Ct.user&&Ct.user.id&&!En.has(Ct.user.id)&&(En.add(Ct.user.id),yt.push(Ct.user))}),Me=Gt.length):(Me=0,q=null,G=null),yt.length>0?q=yt[0]:q=null,yt.length>1?G=yt[1]:G=null}}const bn=x.top+V/2-15,po=bn+30,jt=5,ol=po>p.top+jt&&bn<p.bottom-jt?1:0;Ut.value.find(Kt=>Kt.id===y);let Vn=f;if(!Vn&&y&&v.value){const Kt=String(y);Vn=v.value.querySelector(`[data-comment="${Kt}"], [data-fake-comment="${Kt}"]`)}const nl=yt.length;n[y]?(n[y].top=R,n[y].opacity=ol,n[y].element=Vn,n[y].firstUser=q,n[y].secondUser=G,n[y].totalCount=Me,n[y].uniqueUserCount=nl):n[y]={id:y,top:R,opacity:ol,element:Vn,firstUser:q,secondUser:G,totalCount:Me,uniqueUserCount:nl}});const g=Object.values(n).map(f=>{const C=Math.max(0,(f.uniqueUserCount??0)-2);if(!f.element&&f.id&&v.value){const x=String(f.id);f.element=v.value.querySelector(`[data-comment="${x}"], [data-fake-comment="${x}"]`)}return{...f,firstUser:f.firstUser||null,secondUser:f.secondUser||null,totalCount:f.totalCount,additionalCount:C}});(Ut.value.length!==g.length||g.some((f,C)=>{const y=Ut.value[C];if(!y)return!0;const x=(y.firstUser?.id||null)!==(f.firstUser?.id||null),E=(y.secondUser?.id||null)!==(f.secondUser?.id||null);return y.id!==f.id||Math.abs(y.top-f.top)>1||y.opacity!==f.opacity||y.totalCount!==f.totalCount||y.additionalCount!==f.additionalCount||x||E||y.element!==f.element}))&&(Ut.value=g),to.value=!1}))},wn=t=>{if(!t)return;let o=t.element;if(!o&&t.id&&v.value){const n=String(t.id);o=v.value.querySelector(`[data-comment="${n}"], [data-fake-comment="${n}"]`)}o&&(Ft(),Fe.value=o,o.classList.add("editor-comment-highlighted"))},Ft=(t=!1)=>{!t&&ce.value!==null&&Fe.value&&(Fe.value.getAttribute("data-comment")||Fe.value.getAttribute("data-fake-comment"))===ce.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(n=>{n.classList.remove("editor-comment-highlighted")}),Fe.value&&(Fe.value.classList.remove("editor-comment-highlighted"),Fe.value=null))},Go=t=>{if(!t||!t.element)return;Ft(!0);const o=t.element.getAttribute("data-comment")||t.element.getAttribute("data-fake-comment");if(!o)return;const n=`[data-comment="${o}"], [data-fake-comment="${o}"]`;X("comment-marker-clicked",{commentId:o,selector:n,element:t.element})},l=()=>{Ft()},u=()=>{!w.richText||!v.value||(pt.value&&pt.value.disconnect(),ft.value!==null&&(clearTimeout(ft.value),ft.value=null),pt.value=new MutationObserver(()=>{ft.value===null&&(ft.value=setTimeout(()=>{ft.value=null,e.nextTick(()=>{Qe("MutationObserver")})},200))}),pt.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"]}),Qe("setupCommentMarkersObserver-initial"))},s=(t,o)=>{if(!t||!o)return;const n=o.getBoundingClientRect();let a=n.top,r=n.right+4;t.style.top=`${a}px`,t.style.left=`${r}px`,t.offsetHeight;const c=t.getBoundingClientRect(),i=window.innerWidth,d=window.innerHeight;if(c.right>i){const m=n.left-c.width-4;t.style.left=`${m}px`}if(c.bottom>d){const m=Math.max(8,d-c.height-8);t.style.top=`${m}px`}c.top<0&&(t.style.top="8px")};return e.watch(()=>Ze.value,t=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{const a=n.getAttribute("data-submenu-id");if(a===t&&t){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r){if(n.parentNode!==document.body){const c=n.parentNode;n.dataset.originalParentRef=c===r?"inside":"sibling",document.body.appendChild(n)}n.style.display="block",n.style.visibility="hidden",n.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{s(n,r),n.offsetHeight,n.setAttribute("data-active","true"),n.style.visibility="visible",n.style.opacity="1"})})}else n.setAttribute("data-active","true")}else n.setAttribute("data-active","false"),n.style.display="none",n.style.top="",n.style.left="",n.style.visibility="",n.style.opacity=""})})}),e.watch(()=>[Le.value,Te.value],()=>{Le.value==="askAi"||Te.value==="askAi"?e.nextTick(()=>{pn()}):(Ze.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(o=>{if(o.parentNode===document.body){const n=o.getAttribute("data-submenu-id");if(n){const a=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${n}"]`);if(a)if(o.dataset.originalParentRef==="inside")a.appendChild(o);else{const c=a.closest(".dss-toolbar-dropdown");c&&c.insertBefore(o,a.nextSibling)}}}})}))}),e.watch(()=>w.locale,t=>{t&&t!==dt.value&&(dt.value=t)},{immediate:!0}),zt({openCommentOverlayForSelector:Ne,updateCommentMarkers:Qe,restoreCommentsFromModel:Rt}),(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",Nn.value]),style:e.normalizeStyle(Mn.value)},[A.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:o[14]||(o[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Us,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:an,title:e.unref(b)("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,Ws),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Qo.value}]),onClick:sn,title:e.unref(b)("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,qs),o[73]||(o[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Xs,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[0]||(o[0]=n=>Ho("paragraph")),title:e.unref(b)("textEditor.toolbar.paragraphFormat")},[ve.value==="h1"?(e.openBlock(),e.createElementBlock("svg",js,[...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)])])):ve.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Ks,[...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)])])):ve.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Gs,[...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)])])):ve.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Js,[...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)])])):ve.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Qs,[...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)])])):ve.value==="h6"?(e.openBlock(),e.createElementBlock("svg",er,[...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",tr,[...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,Ys),Le.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]=n=>Ht("<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(b)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[2]||(o[2]=n=>Ht("<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(b)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[3]||(o[3]=n=>Ht("<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(b)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[4]||(o[4]=n=>Ht("<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(b)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[5]||(o[5]=n=>Ht("<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(b)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[6]||(o[6]=n=>Ht("<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(b)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[7]||(o[7]=n=>Ht("<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(b)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":$e("bold")}]),onClick:o[9]||(o[9]=n=>Tt("bold")),title:e.unref(b)("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,or),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":$e("italic")}]),onClick:o[10]||(o[10]=n=>Tt("italic")),title:e.unref(b)("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,nr),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":$e("underline")}]),onClick:o[11]||(o[11]=n=>Tt("underline")),title:e.unref(b)("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,lr),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt.value}]),onClick:Ao,title:e.unref(b)("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,ar),o[74]||(o[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),De.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:k,title:e.unref(b)("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,rr)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:vt,title:e.unref(b)("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,sr)),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":$e("insertUnorderedList")}]),onClick:Se,title:e.unref(b)("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,ir),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":$e("insertOrderedList")}]),onClick:qe,title:e.unref(b)("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,cr),o[76]||(o[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:xo,title:e.unref(b)("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,dr),mt.value?(e.openBlock(),e.createElementBlock("div",ur)):e.createCommentVNode("",!0),mt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(b)("textEditor.toolbar.comment"),onClick:cn},[...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,mr)):e.createCommentVNode("",!0),A.askAi?(e.openBlock(),e.createElementBlock("div",pr)):e.createCommentVNode("",!0),A.askAi?(e.openBlock(),e.createElementBlock("div",fr,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:o[12]||(o[12]=n=>Ho("askAi")),title:e.unref(b)("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",gr,e.toDisplayString(e.unref(b)("textEditor.toolbar.askAi")),1)],8,vr),Le.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[13]||(o[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(t.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.customToolbarSlots,(n,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a},[I(n)?(e.openBlock(),e.createElementBlock("div",yr,[e.renderSlot(t.$slots,n)])):e.createCommentVNode("",!0),I(n)&&a<A.customToolbarSlots.length-1&&oe(a)?(e.openBlock(),e.createElementBlock("div",Cr)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(Le.value==="paragraph"||Le.value==="askAi")&&A.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Ve})):e.createCommentVNode("",!0),e.createVNode(jn,{showModal:et.value,width:"500px",height:"55vh",onCloseModal:_o},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",kr,[e.createElementVNode("div",xr,[e.createElementVNode("label",wr,e.toDisplayString(e.unref(b)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:bo,type:"text","onUpdate:modelValue":o[15]||(o[15]=n=>Q.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.link.enterAltText"),onKeyup:e.withKeys(jo,["enter"])},null,40,Er),[[e.vModelText,Q.value]])]),e.createElementVNode("div",br,[e.createElementVNode("label",Vr,e.toDisplayString(e.unref(b)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:tt,type:"text","onUpdate:modelValue":o[16]||(o[16]=n=>J.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.link.enterUrl"),onKeyup:e.withKeys(jo,["enter"])},null,40,Sr),[[e.vModelText,J.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:_o},e.toDisplayString(e.unref(b)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:jo},e.toDisplayString(e.unref(b)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(jn,{showModal:vo.value,width:"500px",height:"80vh",onCloseModal:U},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Y.value?e.unref(b)("textEditor.image.editImage"):e.unref(b)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Nr,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":_e.value==="upload"}]),onClick:o[17]||(o[17]=n=>_e.value="upload")},e.toDisplayString(e.unref(b)("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":_e.value==="url"}]),onClick:o[18]||(o[18]=n=>_e.value="url")},e.toDisplayString(e.unref(b)("textEditor.image.imageLink")),3)]),_e.value==="upload"?(e.openBlock(),e.createElementBlock("div",Mr,[e.createElementVNode("div",Br,[e.createElementVNode("div",Tr,[L.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Hr,e.toDisplayString(e.unref(b)("textEditor.image.uploadImage")),1)),L.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:ct},[e.createElementVNode("img",{src:ot.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Ar),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:Xe,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:wo},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Xe,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:wo},null,544))]),e.createElementVNode("div",Lr,[e.createElementVNode("label",$r,e.toDisplayString(e.unref(b)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:wt,type:"text","onUpdate:modelValue":o[19]||(o[19]=n=>Pe.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ht,["enter"])},null,40,Dr),[[e.vModelText,Pe.value]])]),e.createElementVNode("div",_r,[e.createElementVNode("label",Ir,e.toDisplayString(e.unref(b)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[20]||(o[20]=n=>ee.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.image.auto"),onKeyup:e.withKeys(ht,["enter"]),onInput:uo},null,40,Rr),[[e.vModelText,ee.value]])]),e.createElementVNode("div",Fr,[e.createElementVNode("label",zr,e.toDisplayString(e.unref(b)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[21]||(o[21]=n=>se.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.image.auto"),onKeyup:e.withKeys(ht,["enter"]),onInput:mo},null,40,Or),[[e.vModelText,se.value]])])])])):e.createCommentVNode("",!0),_e.value==="url"?(e.openBlock(),e.createElementBlock("div",Pr,[e.createElementVNode("div",Zr,[e.createElementVNode("div",Ur,[e.createElementVNode("label",Wr,e.toDisplayString(e.unref(b)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:go,type:"text","onUpdate:modelValue":o[22]||(o[22]=n=>bt.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(ht,["enter"])},null,40,qr),[[e.vModelText,bt.value]])]),e.createElementVNode("div",Xr,[e.createElementVNode("label",Yr,e.toDisplayString(e.unref(b)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":o[23]||(o[23]=n=>Pe.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ht,["enter"])},null,40,jr),[[e.vModelText,Pe.value]])]),e.createElementVNode("div",Kr,[e.createElementVNode("label",Gr,e.toDisplayString(e.unref(b)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[24]||(o[24]=n=>ee.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.image.auto"),onKeyup:e.withKeys(ht,["enter"]),onInput:uo},null,40,Jr),[[e.vModelText,ee.value]])]),e.createElementVNode("div",Qr,[e.createElementVNode("label",ei,e.toDisplayString(e.unref(b)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[25]||(o[25]=n=>se.value=n),class:"dss-link-modal-input",placeholder:e.unref(b)("textEditor.image.auto"),onKeyup:e.withKeys(ht,["enter"]),onInput:mo},null,40,ti),[[e.vModelText,se.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:U},e.toDisplayString(e.unref(b)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:ht},e.toDisplayString(e.unref(b)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":tn.value&&Ke.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(b)("textEditor.labels.title")),1),e.createElementVNode("div",oi,[Ke.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ni,[A.title?(e.openBlock(),e.createElementBlock("span",li,e.toDisplayString(A.title),1)):(e.openBlock(),e.createElementBlock("span",ai,e.toDisplayString(No.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:K,value:A.title,onInput:ln,onFocus:Hn,onBlur:An,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Ke.value}]),placeholder:No.value,disabled:A.disabled,rows:"1"},null,42,si)])],2),tn.value&&Ke.value?(e.openBlock(),e.createElementBlock("div",ri,[e.renderSlot(t.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":oo.value&&Ge.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(b)("textEditor.labels.description")),1),e.createElementVNode("div",ii,[Ge.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ci,[A.description?(e.openBlock(),e.createElementBlock("span",di,e.toDisplayString(A.description),1)):(e.openBlock(),e.createElementBlock("span",ui,e.toDisplayString(ae.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:te,value:A.description,onInput:Dn,onFocus:Ln,onBlur:$n,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!Ge.value}]),placeholder:ae.value,disabled:A.disabled,rows:"1"},null,42,mi)])],2),oo.value&&Ge.value?(e.openBlock(),e.createElementBlock("div",pi,[e.renderSlot(t.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":ce.value===n.id,"editor-comment-marker-group-out-of-view":n.opacity===0}]),"data-comment-id":n.id,style:e.normalizeStyle({top:n.top+"px"}),onMouseenter:a=>wn(n),onMouseleave:l},[n.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(a=>Go(n),["stop"])},[n.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.firstUser.avatar,alt:n.firstUser.name||"avatar"},null,8,gi)):(e.openBlock(),e.createElementBlock("span",hi,e.toDisplayString(n.firstUser.initials||(n.firstUser.name?n.firstUser.name.charAt(0):"")),1))],8,vi)):e.createCommentVNode("",!0),n.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(a=>Go(n),["stop"])},[n.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.secondUser.avatar,alt:n.secondUser.name||"avatar"},null,8,Ci)):(e.openBlock(),e.createElementBlock("span",ki,e.toDisplayString(n.secondUser.initials||(n.secondUser.name?n.secondUser.name.charAt(0):"")),1))],8,yi)):e.createCommentVNode("",!0),n.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:n.secondUser?"30px":"15px"}),"data-has-second-user":n.secondUser?"true":"false",onClick:e.withModifiers(a=>Go(n),["stop"])},[e.createElementVNode("span",wi,"+"+e.toDisplayString(n.additionalCount),1)],12,xi)):e.createCommentVNode("",!0)],46,fi))),128)),A.richText?(e.openBlock(),e.createElementBlock("div",Bi,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":A.disabled,"dss-text-editor-fixed-height":A.fixedHeight}]),style:e.normalizeStyle(Po.value),onInput:j,onBlur:Wt,onClick:vn,onMouseup:gn,onKeyup:gn,onKeydown:Xo,onPaste:On,onMousemove:Cn,onMouseleave:Zn},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[ce.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(ie.value)},[Ee.value||ze.value.length>0?(e.openBlock(),e.createElementBlock("div",Ti,[e.createElementVNode("div",Hi,[Ee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Ee.value},null,8,Ai)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Li,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,(n,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,class:"dss-comment-message"},[n.user&&(n.user.avatar||n.user.initials||n.user.name)?(e.openBlock(),e.createElementBlock("div",$i,[e.createElementVNode("div",Di,[n.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.user.avatar,alt:n.user.name||"avatar"},null,8,_i)):(e.openBlock(),e.createElementBlock("span",Ii,e.toDisplayString(n.user.initials||(n.user.name?n.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ri,[e.createElementVNode("div",Fi,[e.createElementVNode("div",zi,e.toDisplayString(n.user&&n.user.name||"Comment"),1),n.createdAt?(e.openBlock(),e.createElementBlock("div",Oi,e.toDisplayString(Bn(new Date(n.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":nn(n.text)||n.class==="comment-started"}])},e.toDisplayString(n.text||""),3)]),w.commentUser&&n.user&&n.user.id===w.commentUser.id&&!nn(n.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(r=>qt(n,a),["stop"]),title:e.unref(b)("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,Pi)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Zi,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Z,"onUpdate:modelValue":o[26]||(o[26]=n=>ne.value=n),class:"dss-comment-input",rows:"1",placeholder:e.unref(b)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(it,["prevent","stop"]),["enter"]),onInput:o[27]||(o[27]=()=>{if(Z.value){const n=Z.value;n.style.height="auto",n.style.height=`${n.scrollHeight}px`}})},null,40,Ui),[[e.vModelText,ne.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(it,["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",Wi,[e.createElementVNode("div",qi,[e.createElementVNode("span",Xi,e.toDisplayString(So.value)+" "+e.toDisplayString(So.value===1?e.unref(b)("textEditor.footer.word"):e.unref(b)("textEditor.footer.words")),1),o[82]||(o[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Yi,e.toDisplayString(re.value)+" "+e.toDisplayString(re.value===1?e.unref(b)("textEditor.footer.character"):e.unref(b)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Ei,[e.createElementVNode("textarea",{value:A.modelValue,onInput:Tn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":A.fixedHeight}]),placeholder:Nt.value,rows:A.rows,disabled:A.disabled,style:e.normalizeStyle(Jo.value)},null,46,bi),e.createElementVNode("div",Vi,[e.createElementVNode("div",Si,[e.createElementVNode("span",Ni,e.toDisplayString(So.value)+" "+e.toDisplayString(So.value===1?e.unref(b)("textEditor.footer.word"):e.unref(b)("textEditor.footer.words")),1),o[79]||(o[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Mi,e.toDisplayString(re.value)+" "+e.toDisplayString(re.value===1?e.unref(b)("textEditor.footer.character"):e.unref(b)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.value&&D.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(W.value),onMouseenter:o[28]||(o[28]=n=>P.value=!0),onMouseleave:ko},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Un,["stop"]),title:D.value},e.toDisplayString(D.value),9,ji),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Do,["stop"]),title:e.unref(b)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Gi,[...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,Ki)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ho.value&&Qt.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Pt.value),onMouseenter:o[29]||(o[29]=n=>Zt.value=!0),onMouseleave:co},[e.createElementVNode("div",Ji,[Qt.value===e.unref(b)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Qi,[...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:Qt.value},e.toDisplayString(Qt.value),9,ec)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Eo,["stop"]),title:e.unref(b)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",oc,[...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,tc)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[A.floatingToolbar&&A.richText&&ye.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:fo,class:"dss-floating-toolbar",style:e.normalizeStyle(Be.value),onMousedown:o[44]||(o[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",nc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(an,["stop"]),title:e.unref(b)("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,lc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Qo.value}]),onClick:e.withModifiers(sn,["stop"]),title:e.unref(b)("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,ac),o[107]||(o[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",sc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[30]||(o[30]=e.withModifiers(n=>hn("paragraph"),["stop"])),title:e.unref(b)("textEditor.toolbar.paragraphFormat")},[ve.value==="h1"?(e.openBlock(),e.createElementBlock("svg",ic,[...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)])])):ve.value==="h2"?(e.openBlock(),e.createElementBlock("svg",cc,[...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)])])):ve.value==="h3"?(e.openBlock(),e.createElementBlock("svg",dc,[...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)])])):ve.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)])])):ve.value==="h5"?(e.openBlock(),e.createElementBlock("svg",mc,[...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)])])):ve.value==="h6"?(e.openBlock(),e.createElementBlock("svg",pc,[...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",fc,[...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,rc),Te.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]=n=>It("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(b)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[32]||(o[32]=n=>It("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(b)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[33]||(o[33]=n=>It("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(b)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[34]||(o[34]=n=>It("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(b)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[35]||(o[35]=n=>It("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(b)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[36]||(o[36]=n=>It("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(b)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[37]||(o[37]=n=>It("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(b)("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":$e("bold")}]),onClick:o[39]||(o[39]=e.withModifiers(n=>Tt("bold"),["stop"])),title:e.unref(b)("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,vc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":$e("italic")}]),onClick:o[40]||(o[40]=e.withModifiers(n=>Tt("italic"),["stop"])),title:e.unref(b)("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,gc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":$e("underline")}]),onClick:o[41]||(o[41]=e.withModifiers(n=>Tt("underline"),["stop"])),title:e.unref(b)("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,hc),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":Jt.value}]),onClick:e.withModifiers(Ao,["stop"]),title:e.unref(b)("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,yc),o[110]||(o[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),De.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(k,["stop"]),title:e.unref(b)("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,kc)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(vt,["stop"]),title:e.unref(b)("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,Cc)),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":$e("insertUnorderedList")}]),onClick:e.withModifiers(Se,["stop"]),title:e.unref(b)("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,xc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":$e("insertOrderedList")}]),onClick:e.withModifiers(qe,["stop"]),title:e.unref(b)("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,wc),o[112]||(o[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(xo,["stop"]),title:e.unref(b)("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,Ec),o[113]||(o[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(b)("textEditor.toolbar.comment"),onClick:e.withModifiers(cn,["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,bc),A.askAi?(e.openBlock(),e.createElementBlock("div",Vc)):e.createCommentVNode("",!0),A.askAi?(e.openBlock(),e.createElementBlock("div",Sc,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:o[42]||(o[42]=e.withModifiers(n=>hn("askAi"),["stop"])),title:e.unref(b)("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",Mc,e.toDisplayString(e.unref(b)("textEditor.toolbar.askAi")),1)],8,Nc),Te.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[43]||(o[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(t.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),$.value?(e.openBlock(),e.createElementBlock("div",Bc,[A.askAi&&$.value?(e.openBlock(),e.createElementBlock("div",Tc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.customToolbarSlots,(n,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a},[I(n)&&ge(n)?(e.openBlock(),e.createElementBlock("div",Hc,[e.renderSlot(t.$slots,n)])):e.createCommentVNode("",!0),I(n)&&ge(n)&&a<A.customToolbarSlots.length-1&&S(a)?(e.openBlock(),e.createElementBlock("div",Ac)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Dc={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"}},_c={toolbar:{undo:"Undo",redo:"Redo",paragraphFormat:"Paragraph Format",bold:"Bold",italic:"Italic",underline:"Underline",citation:"Citation",insertLink:"Insert Link",removeLink:"Remove Link",bulletList:"Bullet List",numberList:"Number List",image:"Image",comment:"Comment",askAi:"Ask AI"},paragraph:{heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph"},link:{editLink:"Edit Link",altText:"Alt text:",url:"URL:",enterAltText:"Enter alt text...",enterUrl:"Enter URL...",cancel:"Cancel",save:"Save"},image:{addImage:"Add Image",editImage:"Edit Image",upload:"Upload",imageLink:"Image Link",uploadImage:"Upload image:",imageUrl:"Image URL:",altText:"Alt text:",width:"Width (px):",height:"Height (px):",enterAltText:"Enter alt text...",enterImageUrl:"https://example.com/image.jpg",auto:"Auto",noAlt:"No alt",cancel:"Cancel",save:"Save"},comment:{placeholder:"Add a comment",send:"Send",delete:"Delete comment"},started_conversation:"Started conversation",labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},Qn={chart:Dc,textEditor:_c},Ic={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"}},Rc={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"}},el={chart:Ic,textEditor:Rc},Fc={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"}},zc={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"}},tl={chart:Fc,textEditor:zc},Kn={en:Qn,fr:el,nl:tl};function Oc(A){if(!A||!A.global)return;const zt=A.global.availableLocales||[];Object.keys(Kn).forEach(F=>{zt.includes(F)&&A.global.mergeLocaleMessage(F,Kn[F])})}const Gn={en:{textEditor:Qn.textEditor},fr:{textEditor:el.textEditor},nl:{textEditor:tl.textEditor}};function Pc(A){if(!A||!A.global)return;const zt=A.global.availableLocales||[];Object.keys(Gn).forEach(F=>{zt.includes(F)&&A.global.mergeLocaleMessage(F,Gn[F])})}const Zc={en:{...Qn},fr:{...el},nl:{...tl}};Jn.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:Zc});exports.DSSChart=Os;exports.DSSChartMessages=Kn;exports.DSSModal=jn;exports.DSSTextEditor=$c;exports.DSSTextEditorMessages=Gn;exports.addDSSChartTranslations=Oc;exports.addDSSTextEditorTranslations=Pc;