dsp-semactic 0.5.55 → 0.5.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dsp-semactic.css +1 -1
- package/dist/index.cjs.js +28 -28
- package/dist/index.es.js +5645 -5368
- package/package.json +1 -1
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"),El=require("vue-i18n"),Hl=["data-chart-type"],Al={class:"dss-chart-header-titles"},Ll={key:0,class:"dss-chart-title"},$l={key:1,class:"dss-chart-subtitle"},Dl=["onClick","onMouseenter"],Il={class:"dss-legend-text"},_l=["onClick","onMouseenter"],Rl={class:"dss-legend-text"},Fl=["title"],zl=["src"],Pl={class:"dss-chart-area-wrapper"},Ol={key:0,class:"dss-chart-z-axis-label"},Zl=["width","height","data-smooth","data-animated"],Wl={id:"chart-clip"},Ul=["x","y","width","height"],ql=["id"],Xl=["d"],Yl=["id"],jl=["d"],Kl={key:0},Gl={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},Jl=["x1","x2","y1","y2"],Ql={class:"dss-axes"},ea=["x1","x2","y1","y2"],ta=["x1","x2","y1","y2"],oa={class:"dss-axis-labels"},na=["x","y"],la=["x","y"],aa=["x","y"],sa=["y","transform"],ra={key:1,class:"dss-flag-markers"},ia={"clip-path":"url(#chart-clip)"},ca=["x1","x2","y1","y2","onMouseover"],ua=["x1","x2","y1","y2","onMouseover"],da=["x1","x2","y1","y2","onMouseover"],ma=["cx","cy","onMouseover"],pa=["cx","cy","fill","onMouseover"],fa=["x","y"],va={class:"dss-chart-data","clip-path":"url(#chart-clip)"},ha={key:0},ga=["d","onMouseover"],ya=["x","y","width","height","fill","onMouseover"],Ca={class:"dss-line-chart"},ka=["d","stroke","stroke-width"],xa=["d","stroke","stroke-width","opacity"],wa=["cx","cy","r","fill","onMouseover"],ba={key:1},Ea=["d","stroke","stroke-width"],Va=["d","stroke","stroke-width"],Sa=["d","stroke","stroke-width","opacity"],Na=["cx","cy","r","fill","onMouseover"],Ma={key:2},Ba=["id"],Ta=["x","y","width","height"],Ha=["d","fill","fill-opacity","mask"],Aa=["d","stroke","stroke-width"],La=["d","fill","onMouseover"],$a=["x","y","width","height","onMouseover"],Da={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},Ia=["x1","x2","y1","y2","stroke"],_a=["cx","cy","r","fill"],Ra={key:1,class:"dss-bubble-chart"},Fa={key:0,class:"dss-bubble-group"},za=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Pa=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Oa={key:2,class:"radial-chart"},Za=["cx","cy","r"],Wa=["data-chart-type","clip-path"],Ua=["d","fill","fill-opacity","stroke","stroke-width","onMouseover"],qa={key:1,class:"dss-radial-segment-data-labels"},Xa=["x","y"],Ya=["x1","y1","x2","y2","stroke"],ja=["x1","y1","x2","y2","stroke"],Ka=["x","y","text-anchor","font-size"],Ga={key:3,class:"dss-spider-chart"},Ja={key:0,class:"dss-spider-grid"},Qa=["cx","cy","r"],es={class:"dss-spider-grid-labels"},ts=["x","y"],os=["x","y"],ns=["x1","x2","y1","y2"],ls={class:"dss-spider-labels"},as=["x","y","text-anchor","dominant-baseline"],ss=["points","fill","fill-opacity","stroke","stroke-width"],rs=["cx","cy","r","fill","onMouseover"],is={class:"dss-chart-logos"},cs=["cx","cy","r","fill"],us=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],ds=["onClick","onMouseenter"],ms=["src"],ps={class:"dss-marker-tooltip-category"},fs={key:0,class:"dss-marker-tooltip-description"},vs={key:0,class:"dss-tooltip-section"},hs={key:0,class:"dss-tooltip-title"},gs={class:"dss-tooltip-series-name"},ys={class:"dss-tooltip-series-value"},Cs={key:1,class:"dss-tooltip-section"},ks={key:0,class:"dss-tooltip-title"},xs={class:"dss-bubble-tooltip-data"},ws={key:2,class:"dss-tooltip-section"},bs={class:"dss-tooltip-title"},Es={class:"dss-tooltip-value"},Vs={key:0,class:"dss-tooltip-section"},Ss={class:"dss-tooltip-section-title"},Ns={class:"dss-tooltip-group-header"},Ms={class:"dss-tooltip-item-content"},Bs={class:"dss-tooltip-item-text"},Ts={key:1,class:"dss-tooltip-section"},Hs={class:"dss-tooltip-section-title"},As={class:"dss-tooltip-item-content"},Ls={class:"dss-tooltip-item-title"},$s={key:0,class:"dss-tooltip-item-description"},Ds={class:"dss-tooltip-section"},Is={class:"dss-tooltip-title"},_s={key:0,class:"dss-bubble-tooltip-data"},Rs={class:"dss-tooltip-series-name"},Fs={class:"dss-tooltip-series-value"},zs={key:0,class:"dss-tooltip-section"},Ps={class:"dss-tooltip-section-title"},Os={class:"dss-tooltip-group-header"},Zs={class:"dss-tooltip-item-content"},Ws={class:"dss-tooltip-item-text"},Us={key:1,class:"dss-tooltip-section"},qs={class:"dss-tooltip-section-title"},Xs={class:"dss-tooltip-item-content"},Ys={class:"dss-tooltip-item-title"},js={key:0,class:"dss-tooltip-item-description"},Ks={key:1,class:"dss-context-menu-separator"},Gs={key:0,class:"dss-context-menu-separator"},Js={key:0,class:"dss-context-menu-separator"},Qs=["onClick"],er=["innerHTML"],tr={key:0,class:"dss-context-menu-icon"},or={class:"dss-marker-modal-header"},nr={class:"dss-marker-modal-body"},lr={class:"dss-form-group"},ar={key:0},sr={key:1},rr=["disabled"],ir=["value"],cr={class:"dss-form-group"},ur={for:"dss-marker-description"},dr={key:0,class:"dss-form-text-display"},mr=["placeholder"],pr={class:"dss-form-group"},fr={class:"icon-preview"},vr=["src"],hr={class:"dss-marker-modal-footer"},gr={class:"modal-footer-left"},yr={class:"dss-modal-footer-right"},Cr=["disabled"],kr={name:"DSSChart"},xr=Object.assign(kr,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:z=>typeof z=="object"&&z!==null}},emits:["add-marker","update-marker","delete-marker"],setup(z,{emit:vo}){const{t:J,locale:H}=El.useI18n(),zt=vo,S=e.ref(null),ie=e.ref(null),bo=e.ref(null),Uo=e.ref(0),g=e.ref(0);let Re=null;const ct=20,et=e.computed(()=>{if(!S.value||!ie.value)return 0;try{const t=S.value.getBoundingClientRect();return ie.value.getBoundingClientRect().top-t.top}catch{return 0}}),D=z,le={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:"25%",position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!0,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function ke(t,r){const n=Object.assign({},t);return yt(t)&&yt(r)&&Object.keys(r).forEach(c=>{yt(r[c])?c in t?n[c]=ke(t[c],r[c]):Object.assign(n,{[c]:r[c]}):Object.assign(n,{[c]:r[c]})}),n}const gt=()=>{let t=20,r=0,n=0;if(j.value&&(t+=30),xe.value&&(t+=25),Ce.value&&D.series.length>0){const c=D.series.filter((v,f)=>!Ee.value.has(f)).length;if(Ae.value==="top"||Ae.value==="bottom"){if(Lt.value==="horizontal"){const f=Math.floor(Ze.value/100);r=Math.ceil(c/f)*25+10}else r=c*25+10;t+=r}else n=150}return{height:t,legendHeight:r,legendWidth:n}};function yt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const $=e.computed(()=>ke(le,D.options)),Ye=e.computed(()=>{const t=$.value;return t&&t.chart&&t.chart.width==="auto"}),Ht=e.computed(()=>{const t=$.value;return t&&t.chart&&t.chart.height==="auto"}),Ze=e.computed(()=>{const t=$.value;return Ye.value?Uo.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),He=e.ref(ct),je=e.computed(()=>{const t=$.value;return Ht.value?Math.max(0,(g.value||400)-He.value):t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),ae=e.computed(()=>{const t=$.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Eo=e.computed(()=>{const t=D.series.map(r=>r.type||ae.value);return new Set(t).size>1}),j=e.computed(()=>{const t=$.value;return t&&t.title&&t.title.text?t.title.text:""}),xe=e.computed(()=>{const t=$.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),rn=e.computed(()=>{const t=$.value;if(!t||!t.zAxis)return"";const r=t.zAxis;return typeof r=="string"?r:r&&typeof r.label=="string"?r.label:""}),Ao=e.computed(()=>{const t=$.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),At=e.computed(()=>{const t=$.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),lo=e.computed(()=>{const t=$.value;if(!t||!t.yAxis)return oo;const r=t.yAxis.min;return typeof r=="number"||r===oo?r:oo}),Ct=e.computed(()=>{const t=$.value;if(!t||!t.yAxis)return oo;const r=t.yAxis.max;return typeof r=="number"||r===oo?r:oo}),Lo=e.computed(()=>{const t=$.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),kt=e.computed(()=>{const t=$.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Je=e.computed(()=>{const t=$.value;return t&&t.grid&&t.grid.show!==!1}),Ce=e.computed(()=>{const t=$.value;return t&&t.legend&&t.legend.show!==!1}),Ae=e.computed(()=>{const t=$.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Lt=e.computed(()=>{const t=$.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Vo=e.computed(()=>{const t=$.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),ue=e.computed(()=>{const t=$.value;if(!t||!t.crosshair)return!1;const r=t.crosshair.show;return r===!0||r==="true"}),$o=e.computed(()=>{const t=$.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Pt=e.computed(()=>{const t=$.value;return t&&t.zoom&&t.zoom.enabled!==!1}),So=e.computed(()=>{const t=$.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Bn=e.computed(()=>{const t=$.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),We=e.computed(()=>{const t=$.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),nt=e.computed(()=>{if(!vt.value)return 0;const t=$.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Ke=e.computed(()=>{const t=$.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),rt=e.computed(()=>{const{maxX:t}=he.value;return t===0}),ut=(t,r)=>rt.value&&r===0?5:r,xt=e.computed(()=>{const t=$.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),lt=e.computed(()=>{const t=$.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),te=e.computed(()=>{const t=$.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),ve=e.computed(()=>{const t=$.value;return lt.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),$t=e.computed(()=>{const t=$.value,r=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return r.length>0?r:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),tt=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.enabled!==!1}),wt=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),dt=e.computed(()=>{const t=$.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),mt=e.computed(()=>{const t=$.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),pt=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),se=e.computed(()=>{const t=$.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Ne=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Ot=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),ho=e.computed(()=>{const t=$.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),bt=e.computed(()=>$.value?.spider?.gridSteps||5),Et=e.computed(()=>{const t=[],r=bt.value;for(let n=1;n<=r;n++)t.push(ce.value/r*n);return t}),Zt=t=>{const r=ao.value;if(r&&Array.isArray(r)&&r[t]!==void 0)return r[t].toString();const n=Et.value[t];return Math.round(n/ce.value*100)+"%"},ao=e.computed(()=>$.value?.spider?.gridLabels||null),Fe=e.computed(()=>{const t=$.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ue=e.computed(()=>{const t=$.value,r={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...r,...t.contextMenu.items}:r}),Wt=e.computed(()=>{const t=$.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Dt=e.computed(()=>{const t=$.value;return t&&t.markers&&t.markers.icon?t.markers.icon:qo.value}),It=e.computed(()=>{const t=$.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Ut=e.computed(()=>{const t=$.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Do=e.computed(()=>!A.value.isZooming);e.computed(()=>Me.value.map(t=>{if(t.categoryIndex!==void 0&&(De.value||Be.value)){const r=ge(t.categoryIndex),n=et.value+E.value.bottom-Ut.value/2;return{...t,x:r,y:n}}return t}));function Tn(t,r){const n=new Date(t);let c=0,v=1/0;return r.forEach((f,C)=>{const[y,b,V]=f.split("-"),N=new Date(`20${V}`,b-1,y),M=Math.abs(N-n);M<v&&(v=M,c=C)}),c}const al=e.computed(()=>{const t=D.markers.map(n=>{const c=Tn(n.marker_date,D.categories),v=ge(c),f=et.value+E.value.bottom-Ut.value/2;return{...n,x:v,y:f,categoryIndex:c,source:"props"}}),r=Me.value.map(n=>{if(n.categoryIndex!==void 0&&(De.value||Be.value)){const c=ge(n.categoryIndex),v=et.value+E.value.bottom-Ut.value/2;return{...n,x:c,y:v,source:"internal"}}return{...n,source:"internal"}});return[...t,...r]}),Vt=e.computed(()=>{const t=$.value;return t&&t.watermark&&t.watermark.enabled===!0}),cn=e.computed(()=>{const t=$.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),sl=e.computed(()=>{const t=$.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:"25%"}),un=e.computed(()=>{const t=$.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),dn=e.computed(()=>{const t={left:E.value.left,top:E.value.top,width:E.value.width,height:E.value.height};let r,n;const c=String(sl.value);if(c.includes("%")){const v=parseFloat(c)/100;r=t.width*v,n=r*(96/499)}else{const v=parseFloat(c)||25;r=Math.min(t.width*.25,200)*(v/25),n=r*(96/499)}return{width:r,height:n,area:t}}),Hn=e.computed(()=>{const{width:t,height:r}=dn.value,n=un.value;let c,v;const f=E.value.left,C=E.value.right,y=E.value.top,b=E.value.bottom,V=E.value.width,N=E.value.height;switch(n){case"center":c=f+(V-t)/2,v=y+(N-r)/2;break;case"top-left":c=f+15,v=y+90;break;case"top-right":c=C-t-15,v=y+90;break;case"bottom-left":c=f+15,v=b-r+75;break;case"bottom-right":default:c=C-t-15,v=b-r+75;break}return{backgroundPositionX:c+"px",backgroundPositionY:v+"px",backgroundSize:`${t}px ${r}px`}}),An=t=>!D.flags||!D.flags.length?[]:D.flags.filter(r=>r.categoryIndex===t),St=t=>{const r=An(t),n=Go(t),c=r.filter(C=>C.manual),v=r.filter(C=>!C.manual),f=[];return c.length>0&&f.push({type:J("chart.tooltip.manualFlags"),color:"#047395",flags:c.map(C=>({text:C.text,color:"#047395"}))}),v.length>0&&f.push({type:J("chart.tooltip.autoFlags"),color:"#0dbf89",flags:v.map(C=>({text:C.text,color:"#0dbf89"}))}),{flagGroups:f,markers:n.map(C=>({title:C.title,description:C.description,type:J("chart.tooltip.markers"),color:C.color||"#FF6B6B"}))}},qo=e.computed(()=>`data:image/svg+xml;base64,${btoa(`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
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>`)}`),
|
|
7
|
+
</svg>`)}`),mn=e.computed(()=>`data:image/svg+xml;base64,${btoa(`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
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>`)}`),
|
|
22
|
-
`)}})}),
|
|
23
|
-
<text x="24" y="${
|
|
21
|
+
</svg>`)}`),pn=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),Ln=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=$.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const rl=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),qt=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),il=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),$n=e.computed(()=>{const r=$.value?.radialBar?.dataLabels;return r&&(r.show===!0||r.enabled===!0)}),Xo=e.computed(()=>{const r=$.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof r=="number"&&r>=0?r:20}),Dn=e.computed(()=>{if(!$n.value||!vt.value||!Oo.value.length)return[];const t=Xo.value*Math.PI/180,r=(ot.value+ce.value)/2;return Oo.value.map(n=>{const v=n.endAngle-n.startAngle>=t&&!n.isHidden,f=Ve.value+Math.cos(n.midAngle)*r,C=Se.value+Math.sin(n.midAngle)*r;return{value:n.value,x:f,y:C,show:v,color:n.color}})}),fn=e.computed(()=>{if(!D.flags||!D.flags.length)return[];const t=new Map;return D.flags.forEach(r=>{const n=r.categoryIndex;t.has(n)||t.set(n,[]),t.get(n).push(r)}),Array.from(t.entries()).map(([r,n])=>{const c=ge(r),v=n.filter(C=>C.manual),f=n.filter(C=>!C.manual);return{categoryIndex:parseInt(r),x:c,flags:n,manualCount:v.length,autoCount:f.length,totalCount:n.length,hasManual:v.length>0,hasAuto:f.length>0,texts:n.map(C=>C.text).join(`
|
|
22
|
+
`)}})}),Yo=e.ref({show:!1,x:0,y:0,content:"",count:0}),jo=e.computed(()=>$.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),vn=e.computed(()=>{const t=$.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),cl=e.computed(()=>$.value?.bubbles?.tooltip?.formatters||{}),Ee=e.ref(new Set),U=e.ref(null),hn=e.ref(!1),oe=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),so=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),ne=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),re=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),A=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Me=e.ref([]),X=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1});e.computed(()=>{const t=["default"];return It.value&&t.push(...Object.keys(It.value)),t});const ul=e.computed(()=>{if(!D.categories||D.categories.length===0){const{maxX:t}=he.value;return Array.from({length:t+1},(r,n)=>J("chart.fallback.item",{number:n+1}))}return D.categories}),go=e.computed(()=>X.value.editingMarkerId!==null),No=e.computed(()=>X.value.readonly),ft=t=>{Ee.value.has(t)||(h.value=!0,U.value=t)},Nt=()=>{h.value=!1,U.value=null},Ko=t=>{if(k.value||x.value){ne.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),c=t.clientX-n.left,v=t.clientY-n.top,f=Be.value?c>=E.value.left-50&&c<=E.value.right+50&&v>=E.value.top-50&&v<=E.value.bottom+100:c>=E.value.left&&c<=E.value.right&&v>=E.value.top&&v<=E.value.bottom;if(hn.value=f,Be.value){if(!ue.value||!f||A.value.isDragging||A.value.isZooming){ne.value.show=!1;return}if(Ho.value.find(I=>!I||I.isHidden?!1:Math.sqrt(Math.pow(I.x-c,2)+Math.pow(I.y-v,2))<=I.radius+3))ne.value.show=!1;else{const I=Ho.value.filter(Z=>!Z||Z.isHidden?!1:Math.sqrt(Math.pow(Z.x-c,2)+Math.pow(Z.y-v,2))<=250);if(I.length>0){let Z=I[0],P=Math.sqrt(Math.pow(Z.x-c,2)+Math.pow(Z.y-v,2));I.forEach(O=>{const W=Math.sqrt(Math.pow(O.x-c,2)+Math.pow(O.y-v,2));W<P&&(P=W,Z=O)});const _=30,ee=Ho.value.filter(O=>!O||O.isHidden?!1:Math.abs(O.x-Z.x)<=_).sort((O,W)=>O.y-W.y);ne.value={show:!0,x:Z.x,categoryIndex:Math.round(Z.originalX),data:(()=>{const O=jo.value,W=vn.value,K=[];return ee.forEach(G=>{O.forEach(de=>{const pe=W[de]||de,ht=tl(de,G);ht&&K.push({seriesName:G.seriesName,label:G.label,value:`${pe}: ${ht}`,color:G.color,y:G.y})})}),K})()}}else ne.value.show=!1}return}if(A.value.isDragging&&A.value.scale>1&&De.value&&Pt.value){ne.value.show=!1;const Y=t.clientX-A.value.lastMouseX,{minX:I,maxX:Z}=he.value,P=Z-I||1,ee=Y*.8;A.value.offsetX+=ee;const O=P/A.value.scale,W=P-O,K=0,G=-W/P*E.value.width,de=K;A.value.offsetX=Math.max(G,Math.min(de,A.value.offsetX)),A.value.lastMouseX=t.clientX,A.value.lastMouseY=t.clientY;return}if(!ue.value||!De.value||A.value.isDragging||A.value.isZooming||!f){ne.value.show=!1;return}const{minX:C,maxX:y}=he.value,b=y-C||1,V=b/A.value.scale,N=C-A.value.offsetX/E.value.width*b,M=(c-E.value.left)/E.value.width,R=N+M*V,q=Math.round(R);if(q>=0&&q<=y){const Y=ge(q),I=uo.value.map((Z,P)=>{const _=D.series.findIndex(O=>O===Z),ee=Z.data[q];return{seriesName:Z.name,value:ee!==void 0?ee:null,color:ye(_),y:ee!==void 0?we(ee):null}}).filter(Z=>Z.value!==null);ne.value={show:!0,x:Y,categoryIndex:q,data:I}}},ze=()=>{ne.value.show=!1,hn.value=!1,x.value=!1,k.value||(Yo.value.show=!1),A.value.isDragging&&(A.value.isDragging=!1),A.value.zoomTimeout&&(clearTimeout(A.value.zoomTimeout),A.value.zoomTimeout=null),A.value.isZooming=!1,setTimeout(()=>{U.value=null,oe.value.show=!1},150)},fe=t=>{if(t.preventDefault(),t.stopPropagation(),!Fe.value)return;const r=t.currentTarget.getBoundingClientRect(),n=t.clientX-r.left,c=t.clientY-r.top;if(vt.value){re.value.show=!1,e.nextTick(()=>{re.value.show=!0,re.value.x=t.clientX,re.value.y=t.clientY,re.value.categoryIndex=null});return}const v=Math.max(0,E.value.left-20),f=E.value.right,C=E.value.top,y=E.value.bottom+80;n>=v&&n<=f&&c>=C&&c<=y&&(re.value.show=!1,e.nextTick(()=>{re.value.show=!0,re.value.x=t.clientX,re.value.y=t.clientY,re.value.categoryIndex=null;const b=Math.max(E.value.left,Math.min(n,E.value.right))-E.value.left,N=E.value.width/xn.value.length,M=Math.floor(b/N);M>=0&&M<xn.value.length&&(re.value.categoryIndex=M)}))},Xt=t=>{if(!(t&&t.button===2)){if(re.value.show&&t&&t.type==="click"){const r=document.querySelector(".dss-context-menu");if(r&&r.contains(t.target))return}re.value.show=!1}},gn=t=>{if(typeof t.template=="function"){const r={series:D.series,categories:D.categories,markers:Me.value},n={chartX:re.value.chartX,chartY:re.value.chartY,dataX:re.value.mouseDataX,dataY:re.value.mouseDataY,categoryIndex:re.value.categoryIndex};return t.template(r,n)}return t.template||t.label||""},Yt=t=>{const r=["dss-context-menu-item"];return t.cssClass&&r.push(t.cssClass),r},dl=t=>t.style||{},yn=t=>t.type&&It.value[t.type]?It.value[t.type]:t.customIcon?t.customIcon:Dt.value,Cn=t=>t==null?"":D.categories&&D.categories[t]?D.categories[t]:"",Go=t=>Me.value.length?Me.value.filter(r=>r.categoryIndex===t):[],ro=t=>{if(!De.value&&!Be.value)return{x:0,y:0};const r=ge(t),n=et.value+E.value.bottom-Ut.value/2;return{x:r,y:n}},In=()=>{Me.value.forEach(t=>{if(t.categoryIndex!==void 0&&(De.value||Be.value)){const r=ro(t.categoryIndex);t.x=r.x,t.y=r.y}})},ml=()=>{if(X.value.description&&X.value.description.length){if(go.value){const t=Me.value.findIndex(r=>r.id===X.value.editingMarkerId);t!==-1?(Me.value[t].description=X.value.description||"",Me.value[t].color=X.value.color||"",Me.value[t].type=X.value.type||"default",zt("update-marker",Me.value[t])):zt("update-marker",{id:X.value.editingMarkerId,description:X.value.description||"",color:X.value.color||"",type:X.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let r=Math.max(0,X.value.categoryIndex);if(Be.value){const{maxX:C}=he.value;r=Math.max(0,Math.min(r,Math.floor(C)))}else De.value&&(r=Math.max(0,Math.min(r,he.value.maxX)));const n=ge(r),c=et.value+E.value.bottom-Ut.value/2,v=Array.isArray(D.categories)?D.categories[r]:null,f={id:t,title:"",description:X.value.description||"",color:X.value.color||"",type:X.value.type||"default",categoryIndex:r,x:n,y:c,marker_date:v||null};X.value.categoryIndex=r,Me.value.push(f),zt("add-marker",f)}at(),jt()}},at=()=>{X.value.show=!1,X.value.title="",X.value.description="",X.value.color="#FF6B6B",X.value.type="default",X.value.editingMarkerId=null,X.value.readonly=!1,X.value.categoryIndex=null,X.value.fromButton=!1},st=()=>{go.value&&(_n(X.value.editingMarkerId),at())},_n=t=>{const r=Me.value.findIndex(n=>n.id===t);r!==-1&&(Me.value.splice(r,1),jt()),zt("delete-marker",t)},Qe=t=>{X.value.show=!0,X.value.title=t?.title??t?.comment??"",X.value.description=t?.description??t?.comment??"",X.value.color=t?.color??"",X.value.type=t?.type??"default",X.value.editingMarkerId=t?.id??t?.marker_id??null,X.value.readonly=t?.readonly??!1,X.value.categoryIndex=t?.categoryIndex??null},jt=()=>{try{const t=`dss-chart-markers-${D.chartId}`;localStorage.setItem(t,JSON.stringify(Me.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},pl=()=>{try{const t=`dss-chart-markers-${D.chartId}`,r=localStorage.getItem(t);if(r){const n=JSON.parse(r);Array.isArray(n)&&(Me.value=n.map(c=>({...c,originalYOffset:c.originalYOffset!==void 0?c.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Me.value=[]}},Io=t=>{const r=j.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${r.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},kn=()=>{const t=ne.value.show,r=oe.value.show;return ne.value.show=!1,oe.value.show=!1,{originalCrosshair:t,originalTooltip:r}},Le=t=>{ne.value.show=t.originalCrosshair,oe.value.show=t.originalTooltip},Rn=async(t,r=32,n=32)=>new Promise((c,v)=>{if(t.startsWith("data:")){c(t);return}const f=new Image;f.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),c(t)},5e3);f.onload=()=>{clearTimeout(C);try{const y=document.createElement("canvas"),b=y.getContext("2d");y.width=r,y.height=n,b.fillStyle="#fafafa",b.fillRect(0,0,r,n),b.drawImage(f,0,0,r,n);const V=y.toDataURL("image/png");c(V)}catch(y){console.warn("Canvas conversion failed:",y),c(t)}},f.onerror=y=>{clearTimeout(C),console.warn("Failed to load image:",t,y),c(t)},f.src=t}),Fn=async()=>{try{const t=kn();setTimeout(async()=>{try{const r=document.querySelector(".dss-chart-svg");if(!r){console.error("Chart SVG element not found"),Le(t);return}const n=gt(),c=Ze.value,v=je.value+n.height,f=r.cloneNode(!0);f.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(_=>_.remove());const y=f.querySelectorAll("image"),b=Array.from(y).map(async _=>{const ee=_.getAttribute("xlink:href")||_.getAttribute("href");if(ee&&!ee.startsWith("data:"))try{const O=await Rn(ee,32,32);_.setAttribute("xlink:href",O),_.setAttribute("href",O)}catch(O){console.warn("Failed to convert logo to base64:",O)}});await Promise.all(b);const N=new XMLSerializer().serializeToString(f).replace(/<svg[^>]*>/,"").replace("</svg>","");let M="",R=30;if(j.value&&(M+=`
|
|
23
|
+
<text x="24" y="${R}"
|
|
24
24
|
font-family="Arial, sans-serif"
|
|
25
25
|
font-size="18"
|
|
26
26
|
font-weight="bold"
|
|
27
27
|
fill="#333">
|
|
28
|
-
${
|
|
29
|
-
</text>`,
|
|
30
|
-
<text x="24" y="${
|
|
28
|
+
${j.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
29
|
+
</text>`,R+=30),xe.value&&(M+=`
|
|
30
|
+
<text x="24" y="${R}"
|
|
31
31
|
font-family="Arial, sans-serif"
|
|
32
32
|
font-size="14"
|
|
33
33
|
fill="#666">
|
|
34
|
-
${
|
|
35
|
-
</text>`,
|
|
36
|
-
<g opacity="${
|
|
37
|
-
<g transform="translate(${
|
|
34
|
+
${xe.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
35
|
+
</text>`,R+=25),Ce.value&&D.series.length>0){let _=c-200,ee=j.value||xe.value?35:25;const O=Math.floor((c-250)/120);let W=0;D.series.forEach((K,G)=>{if(!Ee.value.has(G)){const de=ye(G),pe=K.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");M+=`<circle cx="${_+6}" cy="${ee-4}" r="6" fill="${de}"/>`,M+=`<text x="${_+18}" y="${ee}" font-family="Arial, sans-serif" font-size="12" fill="#333">${pe}</text>`,W++,W%O===0?(_=c-200,ee+=20):_+=Math.min(120,pe.length*8+35)}})}let q="";if(Vt.value)try{const{width:_,height:ee}=dn.value,O=un.value,W=E.value.left,K=E.value.right,G=E.value.top,de=E.value.bottom,pe=E.value.width,ht=E.value.height;let Ge,fo;switch(O){case"center":Ge=W+(pe-_)/2,fo=G+(ht-ee)/2;break;case"top-left":Ge=W+15,fo=G+5;break;case"top-right":Ge=K-_-5,fo=G+5;break;case"bottom-left":Ge=W+15,fo=de-ee-5;break;case"bottom-right":default:Ge=K-_-5,fo=de-ee-5;break}q=`
|
|
36
|
+
<g opacity="${cn.value}">
|
|
37
|
+
<g transform="translate(${Ge}, ${fo}) scale(${_/499})">
|
|
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(
|
|
53
|
-
<svg width="${
|
|
52
|
+
</g>`}catch(_){console.warn("Watermark processing failed, skipping watermark in SVG:",_),q=""}const Y=`<?xml version="1.0" encoding="UTF-8"?>
|
|
53
|
+
<svg width="${c}" height="${v}"
|
|
54
54
|
xmlns="http://www.w3.org/2000/svg"
|
|
55
55
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
56
56
|
<defs>
|
|
@@ -61,20 +61,20 @@
|
|
|
61
61
|
</style>
|
|
62
62
|
</defs>
|
|
63
63
|
<rect width="100%" height="100%" fill="#fafafa"/>
|
|
64
|
-
${
|
|
65
|
-
<g transform="translate(0, ${
|
|
66
|
-
${
|
|
67
|
-
${
|
|
64
|
+
${M}
|
|
65
|
+
<g transform="translate(0, ${n.height})">
|
|
66
|
+
${N}
|
|
67
|
+
${q}
|
|
68
68
|
</g>
|
|
69
|
-
</svg>`,
|
|
70
|
-
`),
|
|
71
|
-
`),t+=`# ${
|
|
69
|
+
</svg>`,I=new Blob([Y],{type:"image/svg+xml;charset=utf-8"}),Z=URL.createObjectURL(I),P=document.createElement("a");P.href=Z,P.download=Io("svg"),document.body.appendChild(P),P.click(),document.body.removeChild(P),URL.revokeObjectURL(Z),Le(t),Xt()}catch(r){console.error("Error downloading SVG:",r),Le(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},zn=async()=>{try{const t=kn();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(_=>setTimeout(_,300));const r=gt(),n=Ze.value,c=je.value+r.height,v=document.createElement("canvas"),f=v.getContext("2d"),C=2;v.width=n*C,v.height=c*C,v.style.width=n+"px",v.style.height=c+"px",f.scale(C,C),f.fillStyle="#fafafa",f.fillRect(0,0,n,c);let y=30;if(j.value&&(f.fillStyle="#333",f.font="bold 18px Arial, sans-serif",f.fillText(j.value,24,y),y+=30),xe.value&&(f.fillStyle="#666",f.font="14px Arial, sans-serif",f.fillText(xe.value,24,y),y+=25),Ce.value&&D.series.length>0){let _=n-200,ee=j.value||xe.value?35:25;const O=Math.floor((n-250)/120);let W=0;f.font="12px Arial, sans-serif",D.series.forEach((K,G)=>{if(!Ee.value.has(G)){const de=ye(G);f.beginPath(),f.arc(_+6,ee-4,6,0,2*Math.PI),f.fillStyle=de,f.fill(),f.fillStyle="#333",f.fillText(K.name,_+18,ee),W++,W%O===0?(_=n-200,ee+=20):_+=Math.min(120,K.name.length*8+35)}})}const V=document.querySelector(".dss-chart-svg").cloneNode(!0),N=V.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),M=V.querySelectorAll(".dss-crosshair"),R=V.querySelectorAll('[class*="tooltip"]');N.forEach(_=>_.remove()),M.forEach(_=>_.remove()),R.forEach(_=>_.remove()),V.querySelectorAll("image").forEach((_,ee)=>{const O=_.getAttribute("xlink:href")||_.getAttribute("href");if(O&&!O.startsWith("data:")){const W=s.value[ee],K=W?ye(W.seriesIndex):"#3B82F6",G=_.getAttribute("x")||0,de=_.getAttribute("y")||0,pe=_.getAttribute("width")||32,ht=_.getAttribute("height")||32,Ge=document.createElementNS("http://www.w3.org/2000/svg","circle");Ge.setAttribute("cx",parseFloat(G)+parseFloat(pe)/2),Ge.setAttribute("cy",parseFloat(de)+parseFloat(ht)/2),Ge.setAttribute("r",Math.min(parseFloat(pe),parseFloat(ht))/2-1),Ge.setAttribute("fill",K),Ge.setAttribute("stroke","#fafafa"),Ge.setAttribute("stroke-width","2"),_.parentNode.replaceChild(Ge,_)}});const Y=new XMLSerializer().serializeToString(V),I=new Blob([Y],{type:"image/svg+xml;charset=utf-8"}),Z=URL.createObjectURL(I),P=new Image;return new Promise((_,ee)=>{P.onload=async()=>{try{if(f.drawImage(P,0,r.height),s.value.forEach(O=>{const W=O.x,K=O.y+r.height,G=(O.width||32)/2,de=ye(O.seriesIndex);f.save(),f.beginPath(),f.arc(W,K,G-1,0,2*Math.PI),f.fillStyle=de,f.fill(),f.strokeStyle="#fafafa",f.lineWidth=2,f.stroke(),f.restore()}),Vt.value){const O=new Image,W=()=>{const{width:G,height:de}=dn.value,pe=un.value,ht=E.value.left,Ge=E.value.right,fo=E.value.top,Ml=E.value.bottom,Bl=E.value.width,Tl=E.value.height;let an,sn;switch(pe){case"center":an=ht+(Bl-G)/2,sn=fo+r.height+(Tl-de)/2;break;case"top-left":an=ht+15,sn=fo+r.height+10;break;case"top-right":an=Ge-G-5,sn=fo+r.height+10;break;case"bottom-left":an=ht+15,sn=Ml+r.height-de-5;break;case"bottom-right":default:an=Ge-G-5,sn=Ml+r.height-de-5;break}f.globalAlpha=cn.value,f.drawImage(O,an,sn,G,de),f.globalAlpha=1,K()},K=()=>{v.toBlob(G=>{const de=URL.createObjectURL(G),pe=document.createElement("a");pe.href=de,pe.download=Io("png"),document.body.appendChild(pe),pe.click(),document.body.removeChild(pe),URL.revokeObjectURL(de),URL.revokeObjectURL(Z),Le(t),Xt(),_()},"image/png")};O.onload=W,O.onerror=K,O.src=mn.value}else v.toBlob(O=>{const W=URL.createObjectURL(O),K=document.createElement("a");K.href=W,K.download=Io("png"),document.body.appendChild(K),K.click(),document.body.removeChild(K),URL.revokeObjectURL(W),URL.revokeObjectURL(Z),Le(t),Xt(),_()},"image/png")}catch(O){URL.revokeObjectURL(Z),Le(t),ee(O)}},P.onerror=()=>{URL.revokeObjectURL(Z),Le(t),ee(new Error("Failed to load SVG image"))},P.src=Z})}catch(t){console.error("Error downloading PNG:",t)}},Pn=()=>{try{let t="";j.value&&(t+=`# ${J("chart.csv.chartTitle")}: ${j.value}
|
|
70
|
+
`),xe.value&&(t+=`# ${J("chart.csv.chartSubtitle")}: ${xe.value}
|
|
71
|
+
`),t+=`# ${J("chart.csv.generated")}: ${new Date().toLocaleString()}
|
|
72
72
|
|
|
73
|
-
`,t+="Category",
|
|
74
|
-
`;const
|
|
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
|
+
`,t+="Category",D.series.forEach(f=>{const C=f.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
|
|
74
|
+
`;const r=Math.max(...D.series.map(f=>f.data?.length||0));for(let f=0;f<r;f++){let b='"'+(D.categories[f]||J("chart.fallback.item",{number:f+1})).toString().replace(/"/g,'""')+'"';D.series.forEach(V=>{const N=V.data&&V.data[f]!==void 0?V.data[f]:"";b+=","+N}),t+=b+`
|
|
75
|
+
`}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(n),v=document.createElement("a");v.href=c,v.download=Io("csv"),document.body.appendChild(v),v.click(),document.body.removeChild(v),URL.revokeObjectURL(c),Xt()}catch(t){console.error("Error downloading CSV:",t)}},On=t=>{if(typeof t.action=="function"){const r={series:D.series,categories:D.categories,markers:Me.value},n={chartX:re.value.chartX,chartY:re.value.chartY,dataX:re.value.mouseDataX,dataY:re.value.mouseDataY,categoryIndex:clampedCategoryIndex||re.value.categoryIndex};t.action(r,n)}Xt()},it=()=>{at(),X.value.show=!0,X.value.categoryIndex=re.value.categoryIndex,X.value.fromButton=!1,Xt()},Zn=()=>{at(),X.value.show=!0,X.value.categoryIndex=0,X.value.fromButton=!0},Wn=t=>{if(re.value.show){const r=document.querySelector(".dss-context-menu");r&&!r.contains(t.target)&&(re.value.show=!1)}},qe=t=>{re.value.show&&!t.target.closest(".context-menu")&&(re.value.show=!1)},Kt=t=>{if(!De.value||!Pt.value)return;t.preventDefault(),t.stopPropagation(),A.value.isZooming=!0,ne.value.show=!1,A.value.zoomTimeout&&clearTimeout(A.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),c=t.clientX-n.left,v=t.clientY-n.top;if(c<E.value.left-50||c>E.value.right+50||v<E.value.top-50||v>E.value.bottom+100){A.value.isZooming=!1;return}const f=t.deltaY>0?.9:1.1,C=Math.max(A.value.minScale,Math.min(A.value.maxScale,A.value.scale*f));if(C!==A.value.scale){const{minX:y,maxX:b}=he.value,V=b-y||1,N=V/A.value.scale,M=y-A.value.offsetX/E.value.width*V,R=(c-E.value.left)/E.value.width,q=M+R*N;A.value.scale=C;const Y=V/A.value.scale,I=q-R*Y;A.value.offsetX=-(I-y)/V*E.value.width,A.value.scale<=1.01&&(A.value.scale=1,A.value.offsetX=0)}A.value.zoomTimeout=setTimeout(()=>{A.value.isZooming=!1,A.value.zoomTimeout=null},300)},Mo=t=>{if(!De.value||!Pt.value||A.value.scale<=1)return;ne.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,A.value.isDragging=!0,A.value.lastMouseX=t.clientX,A.value.lastMouseY=t.clientY,t.preventDefault()},Gt=()=>{A.value.isDragging=!1},Mt=()=>{!De.value||!Pt.value||(A.value.scale=1,A.value.offsetX=0,A.value.isDragging=!1,A.value.zoomTimeout&&(clearTimeout(A.value.zoomTimeout),A.value.zoomTimeout=null),A.value.isZooming=!1)},io=()=>!De.value||!hn.value||!Pt.value?"default":A.value.isDragging?"grabbing":A.value.scale>1?"grab":"dss-crosshair",_t=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let r=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const c=t[Math.max(n-1,0)],v=t[n],f=t[n+1],C=t[Math.min(n+2,t.length-1)],y=v.x+(f.x-c.x)/6*te.value,b=v.y+(f.y-c.y)/6*te.value,V=f.x-(C.x-v.x)/6*te.value,N=f.y-(C.y-v.y)/6*te.value;r+=` C ${y} ${b} ${V} ${N} ${f.x} ${f.y}`}return r},$e=e.computed(()=>{let r=50+(Ao.value?30:0)+60;if(Jt.value)return{left:90,top:90,right:90,bottom:90};if(vt.value){let C=0;j.value&&(C+=15),xe.value&&(C+=10);const y=gt();let b=66,V=50;return Ce.value&&Ae.value==="left"?b+=y.legendWidth||150:Ce.value&&Ae.value==="right"&&(V+=y.legendWidth||150),{left:b,top:50+C,right:V,bottom:130}}let n=0;j.value&&(n+=15),xe.value&&(n+=10);const c=gt();let v=66,f=50;return Ce.value&&Ae.value==="left"?v+=c.legendWidth||150:Ce.value&&Ae.value==="right"&&(f+=c.legendWidth||150),Ce.value&&Ae.value==="bottom"&&(r+=c.legendHeight||0),{left:v,top:50+n,right:f,bottom:r}}),E=e.computed(()=>({left:$e.value.left,top:$e.value.top,right:Ze.value-$e.value.right,bottom:je.value-$e.value.bottom,width:Ze.value-($e.value.left+$e.value.right),height:je.value-($e.value.top+$e.value.bottom)})),De=e.computed(()=>["line","area","bar"].includes(ae.value)||Eo.value),Bt=e.computed(()=>Eo.value),vt=e.computed(()=>["radial","semi-radial"].includes(ae.value)),Jt=e.computed(()=>ae.value==="spider"),Be=e.computed(()=>ae.value==="bubble"),Xe=e.computed(()=>$.value?.chart?.orientation==="horizontal"&&(ae.value==="bar"||Bt.value)),Qt=t=>{const{minY:r,maxY:n}=he.value,c=n-r||1;return E.value.left+(t-r)/c*E.value.width},yo=t=>{const{maxX:r}=he.value,n=r+1,v=E.value.height/n;return E.value.top+(t+.5)*v},Ve=e.computed(()=>Ze.value/2),Se=e.computed(()=>Jt.value?je.value/2-40:je.value/2),ce=e.computed(()=>{if(Jt.value){const t=E.value.width-80,r=E.value.height-80;return Math.min(t,r)/2}return Math.min(E.value.width,E.value.height)/2}),ot=e.computed(()=>{const t=$.value,r=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof r=="number"&&r>=0&&r<=1?r:.45;return ce.value*n}),_o=e.ref(0),Un=e.computed(()=>`semi-radial-fill-clip-${D.chartId}`),Ro=e.computed(()=>ae.value==="semi-radial"),Jo=e.computed(()=>Ro.value&&tt.value&&!Q.value),qn=e.computed(()=>{const t=Jo.value?_o.value:1,r=Ve.value,n=Se.value,c=ot.value,v=ce.value,f=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${r} ${n} L ${r} ${n} Z`;const y=r+v*Math.cos(f),b=n+v*Math.sin(f),V=r+v*Math.cos(C),N=n+v*Math.sin(C),M=r+c*Math.cos(C),R=n+c*Math.sin(C),q=r+c*Math.cos(f),Y=n+c*Math.sin(f),I=t>.5?1:0;return`M ${r} ${n} L ${y} ${b} A ${v} ${v} 0 ${I} 1 ${V} ${N} L ${M} ${R} A ${c} ${c} 0 ${I} 1 ${q} ${Y} Z`}),Xn=e.computed(()=>Ro.value&&Jo.value?`url(#${Un.value})`:void 0),Co=e.ref(0),Yn=e.computed(()=>`radial-reveal-clip-${D.chartId}`),Rt=e.computed(()=>ae.value==="radial"),Bo=e.computed(()=>{const t=Rt.value?Co.value:1,r=Ve.value,n=Se.value,c=Math.max(ce.value*1.5,Ze.value,je.value);if(t<=0)return`M ${r} ${n} L ${r} ${n} Z`;if(t>=1){const M=r-c,R=r+c;return`M ${M} ${n} A ${c} ${c} 0 0 1 ${R} ${n} A ${c} ${c} 0 0 1 ${M} ${n} Z`}const v=-Math.PI/2,f=v+t*Math.PI*2,C=r+c*Math.cos(v),y=n+c*Math.sin(v),b=r+c*Math.cos(f),V=n+c*Math.sin(f),N=t>=.5?1:0;return`M ${r} ${n} L ${C} ${y} A ${c} ${c} 0 ${N} 1 ${b} ${V} Z`}),Qo=e.computed(()=>{if(Xn.value)return Xn.value;if(Rt.value)return`url(#${Yn.value})`});let co=null;const fl=()=>{if(!Jo.value)return;_o.value=0;const t=dt.value,r=performance.now(),n=c=>{const v=c-r,f=Math.min(1,v/t);_o.value=F(pt.value,f),f<1&&(co=requestAnimationFrame(n))};co=requestAnimationFrame(n)},jn=e.computed(()=>$.value?.bubbles?.minSize||8),Kn=e.computed(()=>$.value?.bubbles?.maxSize||50),eo=e.computed(()=>$.value?.bubbles?.opacity||.7),to=(t,r)=>{const n=[15,20,25,18,22],c=n[t%n.length]||20,v=1+Math.sin(r*.5)*.2;return Math.max(5,c*v)},ko=t=>{const r=document.querySelector(`.dss-bubble-image-${t}`);r&&(r.style.opacity="1")},Fo=t=>{const r=document.querySelector(`.dss-bubble-image-${t}`);r&&(r.style.display="none")},me=e.computed(()=>D.series),uo=e.computed(()=>D.series.filter((t,r)=>!Ee.value.has(r))),oo="auto",he=e.computed(()=>{if(Be.value)return xo();if(!uo.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,r=-1/0,n=0;uo.value.forEach(y=>{y.data&&y.data.length&&(n=Math.max(n,y.data.length-1),y.data.forEach(b=>{typeof b=="number"&&(t=Math.min(t,b),r=Math.max(r,b))}))}),D.categories.length>0&&(n=Math.max(n,D.categories.length-1)),t===1/0&&(t=0,r=100);const c=lo.value,v=Ct.value;let f,C;if(c===oo){const y=r-t,b=y>0?y*.1:1;f=Math.max(0,t-b)}else if(typeof c=="number")f=c;else{const y=r-t,b=y>0?y*.1:1;f=Math.max(0,t-b)}if(v===oo){const y=r-t,b=y>0?y*.1:2;C=r+b}else if(typeof v=="number")C=v;else{const y=r-t,b=y>0?y*.1:2;C=r+b}return{minX:0,maxX:n,minY:f,maxY:C}}),xo=()=>{if(!uo.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,r=-1/0,n=1/0,c=-1/0,v=1/0,f=-1/0,C=!1;if(uo.value.forEach((q,Y)=>{q?.data?.length&&q.data.forEach((I,Z)=>{let P,_,ee;if(typeof I=="object"&&I!==null&&!Array.isArray(I))P=typeof I.x=="number"?I.x:Z,_=typeof I.y=="number"?I.y:0,ee=typeof I.size=="number"?I.size:20;else if(Array.isArray(I)&&I.length>=3)P=typeof I[0]=="number"?I[0]:Z,_=typeof I[1]=="number"?I[1]:0,ee=typeof I[2]=="number"?I[2]:20;else if(typeof I=="number")P=Z,_=I,ee=to(Y,Z);else return;isFinite(P)&&isFinite(_)&&isFinite(ee)&&(t=Math.min(t,P),r=Math.max(r,P),n=Math.min(n,_),c=Math.max(c,_),v=Math.min(v,ee),f=Math.max(f,ee),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===r&&(t=Math.min(t,0),r=Math.max(r,D.categories?.length-1||8)),n===c&&(n=Math.max(0,n-10),c=n+20);const y=r-t,b=c-n;let V,N,M,R;return Lo.value!==null?V=Lo.value:V=t-y*.1,kt.value!==null?N=kt.value:N=r+y*.1,lo.value!==null&&typeof lo.value=="number"?M=lo.value:M=Math.max(0,n-b*.1),Ct.value!==null&&typeof Ct.value=="number"?R=Ct.value:R=c+b*.1,{minX:V,maxX:N,minY:M,maxY:R,minSize:v,maxSize:f}},ge=t=>{if(Be.value){const{minX:y,maxX:b}=he.value,V=b-y||1;return E.value.left+(t-y)/V*E.value.width}const{minX:r,maxX:n}=he.value,c=n-r;if(n===0||c===0)return E.value.left+E.value.width/2;const v=c/A.value.scale,f=r-A.value.offsetX/E.value.width*c,C=(t-f)/v;return E.value.left+C*E.value.width},we=t=>{const{minY:r,maxY:n}=he.value,c=n-r||1;return E.value.bottom-(t-r)/c*E.value.height},To=t=>{if(!Be.value)return Ke.value||4;const{maxSize:r}=he.value,n=Math.max(1,r),c=Math.min(1,Math.max(0,t/n));return jn.value+c*(Kn.value-jn.value)},vl=e.computed(()=>wn.value.map(t=>({y:t.y}))),xn=e.computed(()=>{if(Be.value)return zo();if(ae.value==="bar"){if(Xe.value){const O=[],{minY:W,maxY:K}=he.value,G=5,de=K-W||1;for(let pe=0;pe<=G;pe++){const ht=W+de*(pe/G),Ge=Qt(ht);O.push({x:Ge,y:E.value.bottom+20,text:Math.round(ht).toString()})}return O}const Y=[],{maxX:I}=he.value,Z=I+1,P=5,ee=(E.value.width-P*2)/Z;for(let O=0;O<=I;O++){const W=E.value.left+P+(O+.5)*ee;Y.push({x:W,y:E.value.bottom+20,text:D.categories[O]||J("chart.fallback.item",{number:O+1})})}return Y}const t=[],{minX:r,maxX:n}=he.value,c=n-r||1,v=c/A.value.scale,f=r-A.value.offsetX/E.value.width*c,C=f+v,y=Math.max(0,Math.floor(f-2)),b=Math.min(n,Math.ceil(C+2)),V=b-y,N=E.value.width,R=Math.floor(N/60);let q=1;V>R&&(q=Math.ceil(V/R));for(let Y=y;Y<=b;Y+=q)if(Y>=0&&Y<=n){const I=ge(Y);I>=E.value.left-100&&I<=E.value.right+100&&t.push({x:I,y:E.value.bottom+20,text:D.categories[Y]||`Item ${Y+1}`})}return t}),zo=()=>{const t=[],{minX:r,maxX:n}=he.value,c=n-r||1,v=Math.min(8,Math.max(4,Math.floor(E.value.width/80)));for(let f=0;f<=v;f++){const C=r+c*f/v,y=ge(C);if(y>=E.value.left-10&&y<=E.value.right+10){const b=Math.round(C),V=D.categories?.[b];t.push({x:y,y:E.value.bottom+20,text:V||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},wn=e.computed(()=>{if(Xe.value){const v=[],{maxX:f}=he.value;for(let C=0;C<=f;C++)v.push({x:E.value.left-10,y:yo(C),text:D.categories[C]||`Item ${C+1}`});return v}const t=[],{minY:r,maxY:n}=he.value,c=5;for(let v=0;v<=c;v++){const f=r+(n-r)*(v/c),C=Math.round(f);t.push({x:E.value.left-10,y:we(f),text:C.toString()})}return t}),ye=t=>{const r=$t.value;if(!r||r.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return r[t%r.length]},en=t=>{if(!t||typeof t!="string")return t;const r=t.trim(),n=r.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const f=Math.max(0,Math.floor(Number(n[1])*.65)),C=Math.max(0,Math.floor(Number(n[2])*.65)),y=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${f}, ${C}, ${y})`}const c=r.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(c){const f=Math.max(0,Math.floor(Number(c[1])*.65)),C=Math.max(0,Math.floor(Number(c[2])*.65)),y=Math.max(0,Math.floor(Number(c[3])*.65));return`rgba(${f}, ${C}, ${y}, ${c[4]})`}const v=r.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(v){let f=v[1];f.length===3&&(f=f[0]+f[0]+f[1]+f[1]+f[2]+f[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(0,2),16)*.65))),y=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(2,4),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(4,6),16)*.65)));return`#${[C,y,b].map(V=>V.toString(16).padStart(2,"0")).join("")}`}return r},Gn=(t,r)=>{const c=$.value?.stroke?.color;return c==null?en(r):typeof c=="string"?c:Array.isArray(c)&&c.length?c[t%c.length]??en(r):en(r)},bn=t=>{let r=0;for(let n=1;n<t.length;n++){const c=t[n].x-t[n-1].x,v=t[n].y-t[n-1].y;r+=Math.sqrt(c*c+v*v)}return r},Po=e.computed(()=>ae.value==="line"||Bt.value?(Bt.value?D.series.filter(r=>(r.type||ae.value)==="line"):me.value).map((r,n)=>{const c=D.series.findIndex(M=>M===r),v=[];let f=[];r.data.forEach((M,R)=>{M==null?f.length>0&&(v.push([...f]),f=[]):f.push({x:Xe.value?Qt(M):ge(R),y:Xe.value?yo(R):we(M),index:R})}),f.length>0&&v.push(f);let C="";v.forEach(M=>{if(M.length>0){let R="";lt.value?R=_t(M):R=`M ${M[0].x} ${M[0].y}`+M.slice(1).map(q=>` L ${q.x} ${q.y}`).join(""),C+=(C?" ":"")+R}});const y=v.reduce((M,R)=>M+bn(R),0),b=Ee.value.has(c),V=U.value===c,N=U.value!==null&&U.value!==c;return{path:C,color:ye(c),pathLength:y,seriesIndex:c,animationDelay:n*se.value,isHighlighted:V,isDimmed:N,isHidden:b}}):[]),tn=e.computed(()=>{if(!(ae.value==="line"||Bt.value))return[];const t=Bt.value?D.series.filter(n=>(n.type||ae.value)==="line"):me.value,r=[];return t.forEach((n,c)=>{const v=D.series.findIndex(f=>f===n);for(let f=0;f<n.data.length-1;f++){const C=n.data[f];if(C!=null){let y=-1,b=0;for(let V=f+1;V<n.data.length;V++){const N=n.data[V];if(N==null)b++;else{y=V;break}}if(b>0&&y!==-1){const V=n.data[y],N=Xe.value?Qt(C):ge(f),M=Xe.value?yo(f):we(C),R=Xe.value?Qt(V):ge(y),q=Xe.value?yo(y):we(V),Y=Ee.value.has(v),I=U.value===v,Z=U.value!==null&&U.value!==v;r.push({path:`M ${N} ${M} L ${R} ${q}`,color:ye(v),seriesIndex:v,animationDelay:c*se.value,isHighlighted:I,isDimmed:Z,isHidden:Y,gapSize:b}),f=y-1}}}}),r}),En=e.computed(()=>ae.value==="line"||Bt.value?!tt.value||Q.value||L.value.hasAnimated?[]:(Bt.value?D.series.filter(r=>(r.type||ae.value)==="line"):me.value).map((r,n)=>{const c=D.series.findIndex(b=>b===r);let v="",f=null;r.data.forEach((b,V)=>{if(b!=null){const N={x:Xe.value?Qt(b):ge(V),y:Xe.value?yo(V):we(b)};f===null?v+=`M ${N.x} ${N.y}`:v+=` L ${N.x} ${N.y}`,f=N}else if(f!==null){const N=r.data.findIndex((M,R)=>R>V&&M!==null&&M!==void 0);if(N!==-1){const M={x:Xe.value?Qt(r.data[N]):ge(N),y:Xe.value?yo(N):we(r.data[N])};v+=` L ${M.x} ${M.y}`,f=M}}});const C=r.data.map((b,V)=>b==null?null:{x:Xe.value?Qt(b):ge(V),y:Xe.value?yo(V):we(b)}).filter(b=>b!==null),y=bn(C);return{path:v,pathLength:y,color:ye(c),animationDelay:n*se.value,seriesIndex:c}}):[]),hl=e.computed(()=>{if(ae.value!=="line")return[];const t=[];return me.value.forEach((r,n)=>{const c=U.value===n,v=U.value!==null&&U.value!==n,f=Ee.value.has(n);r.data.forEach((C,y)=>{C!=null&&t.push({x:ge(y),y:we(C),color:ye(n),value:C,label:D.categories[y]||y.toString(),seriesName:r.name,categoryIndex:y,dataIndex:y,animationDelay:(n*r.data.length+y)*(se.value/8),isHighlighted:c,isDimmed:v,isHidden:f})})}),t}),Jn=e.computed(()=>{if(!Bt.value)return[];const t=[];return D.series.filter(n=>(n.type||ae.value)==="line").forEach((n,c)=>{const v=D.series.findIndex(b=>b===n),f=U.value===v,C=U.value!==null&&U.value!==v,y=Ee.value.has(v);n.data.forEach((b,V)=>{b!=null&&t.push({x:ge(V),y:we(b),color:ye(v),value:b,label:D.categories[V]||V.toString(),seriesName:n.name,categoryIndex:V,dataIndex:V,animationDelay:(c*n.data.length+V)*(se.value/8),isHighlighted:f,isDimmed:C,isHidden:y})})}),t}),Ho=e.computed(()=>{if(!Be.value)return[];const t=[];return me.value.forEach((r,n)=>{if(!r?.data?.length)return;const c=U.value,v=c!==null&&c===n,f=c!==null&&c!==n,C=Ee.value.has(n);r.data.forEach((y,b)=>{let V,N,M,R,q;if(typeof y=="object"&&y!==null&&!Array.isArray(y))V=typeof y.x=="number"?y.x:b,N=typeof y.y=="number"?y.y:0,M=typeof y.size=="number"?y.size:20,R=y.label||D.categories?.[b]||`Point ${b+1}`,q=y.image||y.imageUrl;else if(Array.isArray(y)&&y.length>=3)V=typeof y[0]=="number"?y[0]:b,N=typeof y[1]=="number"?y[1]:0,M=typeof y[2]=="number"?y[2]:20,R=y[3]||D.categories?.[b]||`Point ${b+1}`,q=y[4];else if(typeof y=="number")V=b,N=y,M=to(n,b),R=D.categories?.[b]||`Point ${b+1}`;else return;!isFinite(V)||!isFinite(N)||!isFinite(M)||t.push({x:ge(V),y:we(N),radius:To(M),originalX:V,originalY:N,originalSize:M,color:ye(n),seriesName:r.name||`Series ${n+1}`,label:R,imageUrl:q,seriesIndex:n,dataIndex:b,categoryIndex:Math.round(V),isHighlighted:v,isDimmed:f,isHidden:C,opacity:eo.value})})}),t}),on=e.computed(()=>ae.value!=="area"?[]:me.value.map((t,r)=>{const n=[];let c=[];if(t.data.forEach((M,R)=>{M==null?c.length>0&&(n.push([...c]),c=[]):c.push({x:ge(R),y:we(M),index:R})}),c.length>0&&n.push(c),n.length===0)return{linePath:"",areaPath:"",color:ye(r),isHidden:Ee.value.has(r)};const v=E.value.bottom+1;let f="",C="";n.forEach((M,R)=>{if(M.length===0)return;let q=`M ${M[0].x} ${M[0].y}`;lt.value&&M.length>1?q=_t(M):M.slice(1).forEach(I=>{q+=` L ${I.x} ${I.y}`}),f+=(f?" ":"")+q;let Y=`M ${M[0].x} ${v}`;if(Y+=` L ${M[0].x} ${M[0].y}`,lt.value&&M.length>1){const I=_t(M),Z=I.substring(I.indexOf("C")||I.indexOf("Q")||I.indexOf("L"));Z?Y+=" "+Z:M.slice(1).forEach(P=>{Y+=` L ${P.x} ${P.y}`})}else M.slice(1).forEach(I=>{Y+=` L ${I.x} ${I.y}`});Y+=` L ${M[M.length-1].x} ${v} Z`,C+=(C?" ":"")+Y});const y=U.value===r,b=U.value!==null&&U.value!==r,V=Ee.value.has(r),N=n.reduce((M,R)=>M+bn(R),0);return{linePath:f,areaPath:C,color:ye(r),pathLength:N,isHighlighted:y,isDimmed:b,isHidden:V}})),Qn=e.computed(()=>{if(!(["bar"].includes(ae.value)||Bt.value))return[];const t=[],{maxX:r}=he.value,n=Bt.value?D.series.filter(v=>(v.type||ae.value)==="bar"):me.value,c=n.length;if(Xe.value){const v=r+1,C=E.value.height/v,y=C*(2/3),b=Math.min(4,y/c*.15),V=y-(c-1)*b,N=Math.max(4,V/c);n.forEach((M,R)=>{const q=D.series.findIndex(P=>P===M),Y=U.value===q,I=U.value!==null&&U.value!==q,Z=Ee.value.has(q);M.data.forEach((P,_)=>{if(P==null||typeof P!="number"||!isFinite(P))return;const W=E.value.top+(_+.5)*C-y/2+R*(N+b),K=E.value.left,G=Math.abs(Qt(P)-E.value.left);let de="";if(lt.value&&G>0){const pe=Math.min(ve.value,N/2,G/2);de=[`M ${K} ${W}`,`L ${K+G-pe} ${W}`,`Q ${K+G} ${W} ${K+G} ${W+pe}`,`L ${K+G} ${W+N-pe}`,`Q ${K+G} ${W+N} ${K+G-pe} ${W+N}`,`L ${K} ${W+N}`,"Z"].join(" ")}t.push({x:K,y:W,width:G,height:N,color:ye(c===1?_:q),value:P,label:D.categories[_]||_.toString(),seriesName:M.name,animationDelay:(R*n.length+_)*(se.value/4),isHighlighted:Y,isDimmed:I,isHidden:Z,barPath:de,isSmooth:lt.value&&G>0})})})}else{const v=r+1,C=E.value.width/v,y=C*.8,b=y/c,V=b*.05,N=b-V;n.forEach((M,R)=>{const q=D.series.findIndex(P=>P===M),Y=U.value===q,I=U.value!==null&&U.value!==q,Z=Ee.value.has(q);M.data.forEach((P,_)=>{if(P==null||typeof P!="number"||!isFinite(P))return;const W=E.value.left+(_+.5)*C-y/2+R*b+V/2,K=we(Math.max(0,P)),G=Math.abs(we(0)-we(P));let de="";if(lt.value&&G>0){const pe=Math.min(ve.value,N/2,G/2);de=[`M ${W} ${K+G}`,`L ${W} ${K+pe}`,`Q ${W} ${K} ${W+pe} ${K}`,`L ${W+N-pe} ${K}`,`Q ${W+N} ${K} ${W+N} ${K+pe}`,`L ${W+N} ${K+G}`,"Z"].join(" ")}t.push({x:W,y:K,width:N,height:G,color:ye(c===1?_:q),value:P,label:D.categories[_]||_.toString(),seriesName:M.name,animationDelay:(R*n.length+_)*(se.value/4),isHighlighted:Y,isDimmed:I,isHidden:Z,barPath:de,isSmooth:lt.value&&G>0})})})}return t}),Oo=e.computed(()=>{if(!vt.value)return[];const t=me.value.map((f,C)=>({series:f,originalIndex:C})).filter(({originalIndex:f})=>!Ee.value.has(f));if(t.length===0)return[];let r=ae.value==="semi-radial"?Math.PI:-Math.PI/2;const n=ae.value==="semi-radial"?Math.PI:Math.PI*2,c=[];if(t.length===1){const{series:f,originalIndex:C}=t[0],y=f.data[0]||0,b=r,V=r+n-.001,N=b+n/2,M=Ve.value+Math.cos(b)*ot.value,R=Se.value+Math.sin(b)*ot.value,q=Ve.value+Math.cos(V)*ot.value,Y=Se.value+Math.sin(V)*ot.value,I=Ve.value+Math.cos(V)*ce.value,Z=Se.value+Math.sin(V)*ce.value,P=Ve.value+Math.cos(b)*ce.value,_=Se.value+Math.sin(b)*ce.value,ee=1,O=[`M ${M} ${R}`,`A ${ot.value} ${ot.value} 0 ${ee} 1 ${q} ${Y}`,`L ${I} ${Z}`,`A ${ce.value} ${ce.value} 0 ${ee} 0 ${P} ${_}`,"Z"].join(" "),W=ye(C);return c.push({path:O,color:W,strokeWidth:nt.value,strokeColor:Gn(0,W),value:y,seriesName:f.name,opacity:.8,isHighlighted:U.value===C,isDimmed:!1,isHidden:!1,startAngle:b,endAngle:V,midAngle:N}),c}const v=t.reduce((f,{series:C})=>f+(C.data[0]||0),0);return v===0?[]:(t.forEach(({series:f,originalIndex:C})=>{const y=f.data[0]||0,b=y/v*n,V=r,N=r+b,M=V+b/2,R=Ve.value+Math.cos(V)*ot.value,q=Se.value+Math.sin(V)*ot.value,Y=Ve.value+Math.cos(N)*ot.value,I=Se.value+Math.sin(N)*ot.value,Z=Ve.value+Math.cos(N)*ce.value,P=Se.value+Math.sin(N)*ce.value,_=Ve.value+Math.cos(V)*ce.value,ee=Se.value+Math.sin(V)*ce.value,O=b>Math.PI?1:0,W=[`M ${R} ${q}`,`A ${ot.value} ${ot.value} 0 ${O} 1 ${Y} ${I}`,`L ${Z} ${P}`,`A ${ce.value} ${ce.value} 0 ${O} 0 ${_} ${ee}`,"Z"].join(" "),K=ye(C);c.push({path:W,color:K,strokeWidth:nt.value,strokeColor:Gn(c.length,K),value:y,seriesName:f.name,opacity:.8,isHighlighted:U.value===C,isDimmed:U.value!==null&&U.value!==C,isHidden:!1,startAngle:V,endAngle:N,midAngle:M}),r=N}),c)}),el=e.computed(()=>!pn.value||!vt.value?[]:Oo.value.map((t,r)=>{if(t.isHidden)return null;const n=rl.value,c=qt.value,v=il.value,f=Ve.value+Math.cos(t.midAngle)*ce.value,C=Se.value+Math.sin(t.midAngle)*ce.value,y=Ve.value+Math.cos(t.midAngle)*(ce.value+n),b=Se.value+Math.sin(t.midAngle)*(ce.value+n),V=Math.cos(t.midAngle)>=0,M=y+c*(V?1:-1),R=b,q=V?y+15:y-15,Y=R-v,I=V?"start":"end",Z=Math.hypot(y-f,b-C),P=Math.hypot(M-y,R-b);return{pointerStartX:f,pointerStartY:C,pointerEndX:y,pointerEndY:b,horizontalEndX:M,horizontalEndY:R,textX:q,textY:Y,text:`${t.seriesName}: ${t.value}`,color:t.color,textAnchor:I,isRightSide:V,isHighlighted:t.isHighlighted,isDimmed:t.isDimmed,pointerLineLength:Z,horizontalLineLength:P}}).filter(Boolean)),gl=t=>{if(!t||t.isHidden)return 0;const r=t.opacity||eo.value||.7;return U.value===null||U.value===void 0?r:U.value!==null?t.seriesIndex===U.value?Math.min(1,r+.1):Math.max(.5,r*.8):r},Zo=t=>{if(!t||t.isHidden)return 0;const r=t.radius>20?.9:.8;return U.value!==null?t.seriesIndex===U.value?Math.min(1,r+.1):r*.7:r},no=(t,r)=>{if(t)try{if(U.value===t.seriesIndex?U.value=null:U.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:r,chartId:D.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},Vn=(t,r)=>{const n=[`dss-bubble-fallback-${r}`];return t.isHighlighted&&n.push("dss-bubble-highlighted"),t.isDimmed&&n.push("dss-bubble-dimmed"),t.isHidden&&n.push("dss-bubble-hidden"),n.push(`dss-bubble-series-${t.seriesIndex}`),n.join(" ")},Sn=(t,r)=>{if(!t||(r.stopPropagation(),x.value=!0,U.value=t.seriesIndex,ne.value.show=!1,!Vo.value))return;const n=r.target.closest(".dss-custom-chart-container");if(!n)return;const c=n.getBoundingClientRect();let v=r.clientX-c.left+10,f=r.clientY-c.top-10;const C=200,y=120;v+C>Ze.value&&(v=r.clientX-c.left-C-10),f+y>c.height&&(f=r.clientY-c.top-y-10),v<0&&(v=10),f<0&&(f=10);const b=jo.value,V=vn.value,N=b.map(M=>{const R=V[M]||M,q=tl(M,t);return q?{seriesName:t.seriesName,label:t.label,value:`${R}: ${q}`,color:t.color}:null}).filter(Boolean);oe.value={show:!0,x:v,y:f,title:t.label||t.seriesName||"",value:"",bubbleData:N,categoryIndex:void 0,spiderSeries:[]}},tl=(t,r)=>{let n;switch(t){case"x":n=r.originalX;break;case"y":n=r.originalY;break;case"size":n=r.originalSize;break;case"label":n=r.label;break;case"seriesName":n=r.seriesName;break;default:n=r[t]||""}const c=cl.value[t];return typeof c=="function"?c(n,r):typeof n=="number"?n.toFixed(1):n?.toString()||""},yl=()=>{if(!Be.value||!ne.value.data||ne.value.data.length===0)return"Bubbles";const t=[],r=new Set;return ne.value.data.forEach(n=>{if(n.seriesName&&n.label){const c=`${n.seriesName} - ${n.label}`;r.has(c)||(t.push(c),r.add(c))}else n.seriesName&&(r.has(n.seriesName)||(t.push(n.seriesName),r.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},ol=(t,r)=>{t&&(x.value=!1,U.value=null,oe.value.show=!1,oe.value.bubbleData=[])},nn=(t,r)=>{const n=r.target.closest(".dss-custom-chart-container");if(!n)return;const c=n.getBoundingClientRect(),v=Cn(t.categoryIndex),f=t.description||t.comment||"";let C=r.clientX-c.left+15,y=r.clientY-c.top-10;const b=200,V=f?80:50;C+b>Ze.value&&(C=r.clientX-c.left-b-15),y+V>je.value&&(y=r.clientY-c.top-V-10),C<0&&(C=10),y<0&&(y=10),so.value={show:!0,x:C,y,categoryValue:v,description:f}},Tt=()=>{so.value.show=!1},Wo=e.computed(()=>D.categories.length||Math.max(...uo.value.map(t=>t.data.length))),wo=e.computed(()=>{let t=0;return uo.value.forEach(r=>{r.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),ln=e.computed(()=>{const t=[],r=Wo.value;for(let n=0;n<r;n++){const c=n*2*Math.PI/r-Math.PI/2,v=Ve.value+Math.cos(c)*ce.value,f=Se.value+Math.sin(c)*ce.value;t.push({x:v,y:f,angle:c,index:n})}return t}),Cl=e.computed(()=>{const t=[],r=Wo.value;return ln.value.forEach((n,c)=>{const v=ce.value+15,f=c*2*Math.PI/r-Math.PI/2,C=Ve.value+Math.cos(f)*v,y=Se.value+Math.sin(f)*v+5;let b="middle",V="middle";Math.abs(Math.cos(f))>.5&&(b=Math.cos(f)>0?"start":"end"),Math.abs(Math.sin(f))>.5&&(V=Math.sin(f)>0?"hanging":"auto"),t.push({x:C,y,text:D.categories[c]||`Axis ${c+1}`,anchor:b,baseline:V})}),t}),nl=e.ref(new Set),ll=(t,r,n)=>{const c=`current-${n}`,v=nl.value.has(c);return!v&&U.value===null?r.fillOpacity||ho.value:r.isHighlighted||v?(r.fillOpacity||ho.value)+.15:r.isDimmed?(r.fillOpacity||ho.value)*.3:r.fillOpacity||ho.value},l=e.computed(()=>{if(!Jt.value)return[];const t=[],r=Wo.value;return me.value.forEach((n,c)=>{const v=[],f=[],C=[],y=U.value===c,b=U.value!==null&&U.value!==c,V=Ee.value.has(c);for(let N=0;N<r;N++){const M=n.data[N]||0,q=M/wo.value*ce.value,Y=N*2*Math.PI/r-Math.PI/2,I=Ve.value+Math.cos(Y)*q,Z=Se.value+Math.sin(Y)*q;v.push(`${I},${Z}`),f.push({x:I,y:Z}),C.push({x:I,y:Z,value:M,label:D.categories[N]||`Axis ${N+1}`,seriesName:n.name})}t.push({points:v.join(" "),polygonPoints:f,dataPoints:C,color:ye(c),fillOpacity:ho.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:y,isDimmed:b,isHidden:V,seriesIndex:c})}),t}),o=(t,r)=>{if(!r||r.length<3)return!1;let n=!1;for(let c=0,v=r.length-1;c<r.length;v=c++){const f=r[c].x,C=r[c].y,y=r[v].x,b=r[v].y;C>t.y!=b>t.y&&t.x<(y-f)*(t.y-C)/(b-C)+f&&(n=!n)}return n},a=t=>{if(!Jt.value)return;const r=t.currentTarget.closest(".dss-custom-chart-container");if(!r)return;const n=r.getBoundingClientRect(),c=ie.value?.getBoundingClientRect();if(!c)return;const v=t.clientX-c.left,f=t.clientY-c.top,C=l.value.filter(y=>y.isHidden?!1:o({x:v,y:f},y.polygonPoints));if(C.length>0){C.length,U.value=C[0].seriesIndex;const y=t.clientX-n.left+10,b=t.clientY-n.top-10,V=200,N=50+C.length*25;let M=y,R=b;M+V>Ze.value&&(M=t.clientX-n.left-V-10),R+N>je.value&&(R=t.clientY-n.top-N-10),M<0&&(M=10),R<0&&(R=10);const q=C.map(Y=>{let I=Y.dataPoints[0],Z=1/0;return Y.dataPoints.forEach(P=>{const _=Math.sqrt(Math.pow(P.x-v,2)+Math.pow(P.y-f,2));_<Z&&(Z=_,I=P)}),{seriesName:Y.seriesName,color:Y.color,value:I.value!==void 0?I.value:Y.value}});oe.value={show:!0,x:M,y:R,title:C.length===1?C[0].seriesName:"",value:"",bubbleData:[],spiderSeries:q}}else w()},s=e.computed(()=>{const t=$.value;return t.logos.map((r,n)=>{const c=D.series[r.seriesIndex];if(!c||!c.data||c.data.length===0||Ee.value.has(r.seriesIndex))return null;let v,f;if(De.value){let y=-1,b=null;for(let N=c.data.length-1;N>=0;N--)if(c.data[N]!==null&&c.data[N]!==void 0){y=N,b=c.data[N];break}if(y===-1||b===null)return null;const V=c.data.map((N,M)=>N==null?null:{x:ge(M),y:we(N),index:M}).filter(N=>N!==null);if(t.animations.enabled&&!Q.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(L.value.isAnimating||!L.value.hasAnimated))if(L.value.isAnimating){const N=L.value.currentFrame/L.value.totalFrames,M=F(t.animations.easing,Math.min(N,1)),R=kl(V,M);v=R.x+(r.offsetX||0),f=R.y+(r.offsetY||0)}else v=V[0].x+(r.offsetX||0),f=V[0].y+(r.offsetY||0);else v=ge(y)+(r.offsetX||0),f=we(b)+(r.offsetY||0)}else if(vt.value||Jt.value){const y=Math.PI*2/t.logos.length*n;v=Ve.value+Math.cos(y)*(ce.value+30)+(r.offsetX||0),f=Se.value+Math.sin(y)*(ce.value+30)+(r.offsetY||0)}return{...r,x:v,y:f,seriesIndex:r.seriesIndex}}).filter(Boolean)}),i=t=>{const r=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);r&&(r.style.opacity="0"),n&&(n.style.opacity="1")},d=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const r=document.querySelector(`.dss-logo-image-${t}`);r&&(r.style.display="none")},u=t=>{Ee.value.has(t)?Ee.value.delete(t):Ee.value.add(t)},m=e.computed(()=>{if(!oe.value.show&&!(ue.value&&ne.value.show&&!A.value.isZooming))return{display:"none"};let t,r;if(ue.value&&ne.value.show&&!A.value.isZooming){t=ne.value.x+15,r=E.value.top;const n=Be.value?200:150;t+n>Ze.value&&(t=ne.value.x-n-15),t<0&&(t=10),r<10&&(r=10)}else t=oe.value.x,r=oe.value.y;return{left:t+"px",top:r+"px"}}),p=(t,r)=>{if(!Vo.value||k.value)return;const c=r.target.closest(".dss-custom-chart-container").getBoundingClientRect();let v=r.clientX-c.left+10,f=r.clientY-c.top-10;const C=200,y=120,b=Ze.value,V=je.value;v+C>b&&(v=r.clientX-c.left-C-10),f+y>V&&(f=r.clientY-c.top-y-10),v<0&&(v=10),f<0&&(f=10);let N;typeof t.categoryIndex=="number"?N=t.categoryIndex:typeof t.dataIndex=="number"?N=t.dataIndex:t.label&&D.categories.includes(t.label)&&(N=D.categories.indexOf(t.label));const M=(Xe.value||ae.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";oe.value={show:!0,x:v,y:f,title:M,value:t.value?.toString()||"",categoryIndex:N,spiderSeries:[]}},h=e.ref(!1),x=e.ref(!1),w=()=>{oe.value.show=!1,oe.value.spiderSeries=[],oe.value.bubbleData=[],ne.value.show=!1,h.value||(U.value=null)},k=e.ref(!1),T=(t,r)=>{k.value=!0,oe.value.show=!1,ne.value.show=!1;const c=r.target.closest(".dss-custom-chart-container").getBoundingClientRect();let v=r.clientX-c.left+15,f=r.clientY-c.top-10;const C=250;v+C>Ze.value&&(v=r.clientX-c.left-C-15),v<0&&(v=10),f<0&&(f=10),Yo.value={show:!0,x:v,y:f,content:t.texts,count:t.totalCount}},B=()=>{k.value=!1,Yo.value.show=!1},L=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),F=(t,r)=>{switch(t){case"linear":return r;case"ease":return r<.5?2*r*r:-1+(4-2*r)*r;case"ease-in":return r*r;case"ease-out":return r*(2-r);case"ease-in-out":return r<.5?2*r*r:-1+(4-2*r)*r;default:return r}},Q=e.computed(()=>Ot.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Pe=()=>{if(!tt.value||Q.value){L.value.hasAnimated=!0,Rt.value&&(Co.value=1);return}Rt.value&&(Co.value=0),L.value.isAnimating=!0,L.value.currentFrame=0,L.value.totalFrames=Math.ceil(dt.value/16.67);const t=()=>{const r=L.value.currentFrame/L.value.totalFrames,n=F(pt.value,Math.min(r,1));Oe(n),Rt.value&&(Co.value=n),r<1?(L.value.currentFrame++,L.value.animationId=requestAnimationFrame(t)):Te()};L.value.animationId=requestAnimationFrame(t)},Oe=t=>{const r=document.querySelector(".dss-custom-chart-container");r&&r.style.setProperty("--dss-animation-progress",t)},Te=()=>{L.value.isAnimating=!1,L.value.hasAnimated=!0,Rt.value&&(Co.value=1),L.value.animationId&&(cancelAnimationFrame(L.value.animationId),L.value.animationId=null)},Ie=e.computed(()=>!vt.value||L.value.hasAnimated?!0:Rt.value?Co.value>=1:Ro.value?_o.value>=1:!0),_e=e.computed(()=>pn.value&&Ie.value),be=e.ref(!1);e.watch(_e,t=>{t?(be.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{be.value=!0})})):be.value=!1},{immediate:!0});const Ft=e.computed(()=>{if(!tt.value||Q.value||L.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${dt.value}ms`,t["--dss-animation-easing"]=mo(pt.value),t["--dss-stagger-delay"]=`${se.value}ms`,t}),mo=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",po=()=>{if(!tt.value||Q.value)return"";const t=["dss-chart-animated"];return L.value.hasAnimated||t.push(`dss-animate-${wt.value}`),L.value.hasAnimated||(vt.value&&ae.value!=="semi-radial"?t.push("dss-animate-fill"):vt.value||t.push(`dss-animate-${wt.value}`)),L.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>D.series,(t,r)=>{Ne.value&&r&&L.value.hasAnimated&&(L.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Pe(),mt.value)}))},{deep:!0}),e.watch(()=>A.value.isZooming,(t,r)=>{r&&!t&&setTimeout(()=>{In()},50)}),e.watch(()=>[A.value.scale,A.value.offsetX],()=>{!A.value.isZooming&&!A.value.isDragging&&In()},{flush:"post"}),e.watch([So,Bn],([t,r])=>{A.value.minScale=t,A.value.maxScale=r,(A.value.scale<t||A.value.scale>r)&&Mt()},{immediate:!0}),e.watch(()=>D.locale,t=>{t&&t!==H.value&&(H.value=t)},{immediate:!0}),e.watch(()=>re.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",qe)}):document.removeEventListener("click",qe)}),e.onMounted(()=>{U.value=null,Rt.value&&(!tt.value||Q.value)&&(Co.value=1),pl(),S.value&&typeof ResizeObserver<"u"&&(Re=new ResizeObserver(t=>{const r=t[0];if(!r||!r.contentRect)return;const{width:n,height:c}=r.contentRect;Uo.value=Math.round(n),g.value=Math.round(c),bo.value&&(He.value=bo.value.offsetHeight||ct)}),Re.observe(S.value)),tt.value&&!Q.value?ae.value==="semi-radial"?setTimeout(()=>fl(),mt.value):setTimeout(()=>Pe(),mt.value):(L.value.hasAnimated=!0,ae.value==="semi-radial"&&(_o.value=1)),document.addEventListener("mousemove",Nn),document.addEventListener("mouseup",Mn),document.addEventListener("click",Wn)}),e.onUnmounted(()=>{Re&&S.value&&(Re.unobserve(S.value),Re.disconnect(),Re=null),L.value.animationId&&cancelAnimationFrame(L.value.animationId),co&&(cancelAnimationFrame(co),co=null),A.value.zoomTimeout&&clearTimeout(A.value.zoomTimeout),document.removeEventListener("mousemove",Nn),document.removeEventListener("mouseup",Mn),document.removeEventListener("click",Wn),document.removeEventListener("click",qe)});const Nn=t=>{if(A.value.isDragging&&A.value.scale>1&&De.value){ne.value.show=!1;const r=t.clientX-A.value.lastMouseX,{minX:n,maxX:c}=he.value,v=c-n||1,C=r*.8;A.value.offsetX+=C;const y=v/A.value.scale,b=v-y,V=0,N=-b/v*E.value.width,M=V;A.value.offsetX=Math.max(N,Math.min(M,A.value.offsetX)),A.value.lastMouseX=t.clientX,A.value.lastMouseY=t.clientY}},Mn=()=>{A.value.isDragging&&(A.value.isDragging=!1,setTimeout(()=>{!A.value.isDragging&&A.value.isZooming},100))},kl=(t,r)=>{const n=t.filter(y=>y!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||r<=0)return n[0];if(r>=1)return n[n.length-1];let c=0;const v=[];for(let y=1;y<n.length;y++){const b=n[y].x-n[y-1].x,V=n[y].y-n[y-1].y,N=Math.sqrt(b*b+V*V);v.push(N),c+=N}const f=c*r;let C=0;for(let y=0;y<v.length;y++){const b=C+v[y];if(f<=b){const V=(f-C)/v[y],N=n[y],M=n[y+1];return{x:N.x+(M.x-N.x)*V,y:N.y+(M.y-N.y)*V}}C=b}return n[n.length-1]};return(t,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[po(),{"dss-chart-fill-width":Ye.value,"dss-chart-fill-height":Ht.value}]]),style:e.normalizeStyle({width:Ye.value?"100%":Ze.value+"px",height:Ht.value?"100%":je.value+20+"px",...Ft.value,cursor:io()}),"data-chart-type":ae.value,ref_key:"containerEl",ref:S,onWheel:Kt,onMousedown:Mo,onMousemove:Ko,onMouseup:Gt,onMouseleave:ze,onDblclick:Mt,onContextmenu:e.withModifiers(fe,["prevent"]),onClick:e.withModifiers(Xt,["left"]),onWheelCapture:Kt},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:bo},[e.createElementVNode("div",Al,[j.value?(e.openBlock(),e.createElementBlock("div",Ll,e.toDisplayString(j.value),1)):e.createCommentVNode("",!0),xe.value?(e.openBlock(),e.createElementBlock("div",$l,e.toDisplayString(xe.value),1)):e.createCommentVNode("",!0)]),Ce.value&&(Ae.value==="top"||Ae.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Lt.value==="horizontal","dss-legend-vertical":Lt.value==="vertical","dss-legend-top":Ae.value==="top","dss-legend-bottom":Ae.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.series,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ee.value.has(c),"dss-legend-hovered":U.value===c,"dss-legend-dimmed":U.value!==null&&U.value!==c}]),onClick:v=>u(c),onMouseenter:v=>ft(c),onMouseleave:Nt,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:ye(c)})},null,4),e.createElementVNode("span",Il,e.toDisplayString(n.name),1)],46,Dl))),128))],2)):e.createCommentVNode("",!0),Ce.value&&(Ae.value==="left"||Ae.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Ae.value==="left","dss-legend-right":Ae.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.series,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ee.value.has(c),"dss-legend-hovered":U.value===c,"dss-legend-dimmed":U.value!==null&&U.value!==c}]),onClick:v=>u(c),onMouseenter:v=>ft(c),onMouseleave:Nt,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:ye(c)})},null,4),e.createElementVNode("span",Rl,e.toDisplayString(n.name),1)],46,_l))),128))],2)):e.createCommentVNode("",!0)],512),z.showAddMarkerButton&&Ue.value.addMarker&&(De.value||Be.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Zn,title:e.unref(J)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Dt.value,class:"dss-add-marker-button-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,zl),r[5]||(r[5]=e.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 4V16M4 10H16",stroke:"hsl(60, 2%, 47%)","stroke-width":"2","stroke-linecap":"round"})],-1))],8,Fl)):e.createCommentVNode("",!0),e.createElementVNode("div",Pl,[Be.value&&rn.value?(e.openBlock(),e.createElementBlock("div",Ol,"Bubble size: "+e.toDisplayString(rn.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ze.value,height:je.value,class:"dss-chart-svg","data-smooth":lt.value,"data-animated":tt.value,ref_key:"svgEl",ref:ie},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",Wl,[e.createElementVNode("rect",{x:E.value.left,y:E.value.top,width:E.value.width,height:E.value.height*4},null,8,Ul)]),Ro.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Un.value},[e.createElementVNode("path",{d:qn.value},null,8,Xl)],8,ql)):e.createCommentVNode("",!0),Rt.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Yn.value},[e.createElementVNode("path",{d:Bo.value},null,8,jl)],8,Yl)):e.createCommentVNode("",!0)]),De.value||Be.value?(e.openBlock(),e.createElementBlock("g",Kl,[Je.value?(e.openBlock(),e.createElementBlock("g",Gl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vl.value,(n,c)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${c}`,x1:E.value.left,x2:E.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${c*50}ms`})},null,12,Jl))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ql,[e.createElementVNode("line",{x1:E.value.left,x2:E.value.right,y1:E.value.bottom,y2:E.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ea),e.createElementVNode("line",{x1:E.value.left,x2:E.value.left,y1:E.value.top,y2:E.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ta)]),e.createElementVNode("g",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xn.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${c}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},e.toDisplayString(n.text),13,na))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wn.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${c}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${c*80}ms`})},e.toDisplayString(n.text),13,la))),128)),Ao.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:E.value.left+E.value.width/2,y:E.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Ao.value),9,aa)):e.createCommentVNode("",!0),At.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:E.value.top+12+E.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${E.value.top+E.value.height/2})`},e.toDisplayString(At.value),9,sa)):e.createCommentVNode("",!0)]),fn.value.length>0?(e.openBlock(),e.createElementBlock("g",ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",ia,[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:E.value.bottom,y2:E.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>T(n,c),onMouseleave:B},null,40,ca)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:E.value.bottom,y2:E.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>T(n,c),onMouseleave:B},null,40,ua)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:E.value.bottom,y2:E.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>T(n,c),onMouseleave:B},null,40,da)):e.createCommentVNode("",!0)]),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,E.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:c=>T(n,c),onMouseleave:B},null,40,ma)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,E.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:c=>T(n,c),onMouseleave:B},null,40,pa),e.createElementVNode("text",{x:n.x,y:Math.max(15,E.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(n.totalCount),9,fa)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",va,[Bt.value?(e.openBlock(),e.createElementBlock("g",ha,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Xe.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qn.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${c}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>p(n,v),onMouseleave:w},null,46,ga)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>p(n,v),onMouseleave:w},null,46,ya))],64))),128))],2),e.createElementVNode("g",Ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Po.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,ka))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,xa))),128)),Ke.value>0||rt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Jn.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${c}`,cx:n.x,cy:n.y,r:n.isHighlighted?ut(n,Ke.value)+2:ut(n,Ke.value),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>p(n,v),onMouseleave:w},null,46,wa))),128)):e.createCommentVNode("",!0)])])):ae.value==="line"?(e.openBlock(),e.createElementBlock("g",ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(En.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${c}`,d:n.path,stroke:n.color,"stroke-width":We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":L.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Ea))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Po.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Va))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Sa))),128)),Ke.value>0||rt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(hl.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:n.x,cy:n.y,r:n.isHighlighted?ut(n,Ke.value)+2:ut(n,Ke.value),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>p(n,v),onMouseleave:w},null,46,Na))),128)):e.createCommentVNode("",!0)])):ae.value==="area"?(e.openBlock(),e.createElementBlock("g",Ma,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,(n,c)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${c}`,id:`area-mask-${c}-${z.chartId}`},[e.createElementVNode("rect",{x:E.value.left-10,y:E.value.top-10,width:E.value.width+20,height:E.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${E.value.width+20}px`})},null,12,Ta)],8,Ba))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${c}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?xt.value+.2:xt.value,mask:`url(#area-mask-${c}-${z.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden})},null,10,Ha))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${c}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?We.value+1:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${c*se.value}ms`})},null,14,Aa))),128))])):ae.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Xe.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qn.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${c}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>p(n,v),onMouseleave:w},null,46,La)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>p(n,v),onMouseleave:w},null,46,$a))],64))),128))],2)):e.createCommentVNode("",!0)]),ue.value&&ne.value.show&&!A.value.isZooming?(e.openBlock(),e.createElementBlock("g",Da,[e.createElementVNode("line",{x1:ne.value.x,x2:ne.value.x,y1:E.value.top,y2:E.value.bottom,stroke:$o.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Ia),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${c}`,cx:ne.value.x,cy:n.y,r:Ke.value+2,fill:n.color,stroke:"none",opacity:"0.9"},null,8,_a))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Be.value?(e.openBlock(),e.createElementBlock("g",Ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ho.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${c}`},[n?(e.openBlock(),e.createElementBlock("g",Fa,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:n.radius,fill:n.color,"fill-opacity":gl(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(Vn(n,c)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:v=>Sn(n,v),onMouseleave:v=>ol(n),onClick:v=>no(n,v)},null,42,za),n.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:n.x-n.radius*.65,y:n.y-n.radius*.65,width:n.radius*1.3,height:n.radius*1.3,"xlink:href":n.imageUrl,class:e.normalizeClass(`dss-bubble-image-${c} ${n.isHighlighted?"dss-bubble-highlighted":""} ${n.isDimmed?"dss-bubble-dimmed":""} ${n.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${n.radius*.65}px at ${n.radius*.65}px ${n.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:Zo(n)}),onLoad:v=>ko(c),onError:v=>Fo(c),onMouseenter:v=>Sn(n,v),onMouseleave:v=>ol(n),onClick:v=>no(n,v)},null,46,Pa)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),vt.value?(e.openBlock(),e.createElementBlock("g",Oa,[ae.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Ve.value,cy:Se.value,r:ce.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Za)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ae.value,"clip-path":Qo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oo.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${c}`,d:n.path,fill:n.color,"fill-opacity":n.isHighlighted?(n.opacity||.8)+.2:n.opacity||.8,stroke:n.strokeWidth?n.strokeColor||n.color:"none","stroke-width":n.strokeWidth||0,class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),onMouseover:v=>p(n,v),onMouseleave:w},null,42,Ua))),128))],8,Wa),$n.value&&Ie.value?(e.openBlock(),e.createElementBlock("g",qa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dn.value,(n,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${c}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label"},e.toDisplayString(n.value),9,Xa)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),_e.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":be.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${c}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${c*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:n.pointerStartX,y1:n.pointerStartY,x2:n.pointerEndX,y2:n.pointerEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.pointerLineLength})},null,12,Ya),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:n.pointerEndX,y1:n.pointerEndY,x2:n.horizontalEndX,y2:n.horizontalEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.horizontalLineLength})},null,12,ja),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":Ln.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,Ka)],6))),128))],2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Jt.value?(e.openBlock(),e.createElementBlock("g",Ga,[Je.value?(e.openBlock(),e.createElementBlock("g",Ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Et.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${c}`,cx:Ve.value,cy:Se.value,r:n,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*150}ms`})},null,12,Qa))),128)),e.createElementVNode("g",es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Et.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${c}`},[e.createElementVNode("rect",{x:Ve.value-16,y:Se.value-n-7,width:"32",height:"16",fill:"#fafafa",stroke:"none"},null,8,ts),e.createElementVNode("text",{x:Ve.value,y:Se.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Zt(c)),9,os)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ln.value,(n,c)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${c}`,x1:Ve.value,x2:n.x,y1:Se.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},null,12,ns))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${c}`,x:n.x+Math.cos(c*2*Math.PI/Wo.value-Math.PI/2)*16,y:n.y+Math.sin(c*2*Math.PI/Wo.value-Math.PI/2)*16,"text-anchor":n.anchor,"dominant-baseline":n.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${c*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,as))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:a,onMouseleave:w},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${c}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":ll("current",n,c),stroke:n.color,"stroke-width":n.isHighlighted?We.value+1:We.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${c*se.value}ms`,transition:"all 0.2s ease"})},null,14,ss),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(v,f)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${c}-${f}`,cx:v.x,cy:v.y,r:n.isHighlighted?Ke.value+1:Ke.value>0?Ke.value:0,fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${c*se.value+f*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>p(v,C),onMouseleave:w},null,46,rs))),128))]))),128))],32)])):e.createCommentVNode("",!0),e.createElementVNode("g",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${c}`,cx:n.x,cy:n.y,r:n.width/2,fill:ye(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${c}`),style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,14,cs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(n,c)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${c}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:v=>i(c),onError:v=>d(c),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${c}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,46,us))),128))])],8,Zl))]),Vt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ze.value+"px",height:je.value+"px",backgroundImage:`url('${mn.value}')`,backgroundRepeat:"no-repeat",...Hn.value,opacity:cn.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(al.value,(n,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+n.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:n.x+"px",top:n.y+"px",width:Ut.value+"px",height:Ut.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(v=>Qe(n),["stop"]),onMouseenter:v=>nn(n,v),onMouseleave:Tt},[e.createElementVNode("img",{src:yn(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,ms)],44,ds)),[[e.vShow,Do.value]])),128)),so.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:so.value.x+"px",top:so.value.y+"px"})},[e.createElementVNode("div",ps,e.toDisplayString(so.value.categoryValue),1),so.value.description?(e.openBlock(),e.createElementBlock("div",fs,e.toDisplayString(so.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Vo.value&&(oe.value.show||ue.value&&ne.value.show&&!A.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":ue.value&&ne.value.show&&!A.value.isZooming}]),style:e.normalizeStyle(m.value)},[!ue.value||!ne.value.show||A.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Jt.value&&oe.value.spiderSeries&&oe.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",vs,[oe.value.title?(e.openBlock(),e.createElementBlock("div",hs,e.toDisplayString(oe.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value.spiderSeries,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",gs,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",ys,e.toDisplayString(n.value),1)]))),128))])):Be.value&&oe.value.bubbleData&&oe.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Cs,[oe.value.title?(e.openBlock(),e.createElementBlock("div",ks,e.toDisplayString(oe.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value.bubbleData,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",ws,[e.createElementVNode("div",bs,e.toDisplayString(oe.value.title),1),e.createElementVNode("div",Es,e.toDisplayString(oe.value.value),1)])),oe.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[St(oe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Vs,[r[6]||(r[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ss,e.toDisplayString(e.unref(J)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(oe.value.categoryIndex).flagGroups,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${c}`},[e.createElementVNode("div",Ns,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(v,f)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${c}-${f}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Ms,[e.createElementVNode("div",Bs,e.toDisplayString(v.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),St(oe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ts,[r[7]||(r[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Hs,e.toDisplayString(e.unref(J)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(oe.value.categoryIndex).markers,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",As,[e.createElementVNode("div",Ls,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",$s,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ds,[e.createElementVNode("div",Is,e.toDisplayString(Be.value?yl():z.categories[ne.value.categoryIndex]||`Category ${ne.value.categoryIndex+1}`),1),Be.value?(e.openBlock(),e.createElementBlock("div",_s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ne.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Rs,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Fs,e.toDisplayString(n.value),1)]))),128))]),St(ne.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",zs,[r[8]||(r[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ps,e.toDisplayString(e.unref(J)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(ne.value.categoryIndex).flagGroups,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${c}`},[e.createElementVNode("div",Os,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(v,f)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${c}-${f}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Zs,[e.createElementVNode("div",Ws,e.toDisplayString(v.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),St(ne.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Us,[r[9]||(r[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",qs,e.toDisplayString(e.unref(J)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St(ne.value.categoryIndex).markers,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Xs,[e.createElementVNode("div",Ys,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",js,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),De.value&&Pt.value&&A.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Mt},[r[10]||(r[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(A.value.scale*100))+"% "+e.toDisplayString(e.unref(J)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Hl),re.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:re.value.x+"px",top:re.value.y+"px"}),onClick:r[0]||(r[0]=e.withModifiers(()=>{},["stop"]))},[Ue.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:it},e.toDisplayString(e.unref(J)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ue.value.addMarker&&(Ue.value.downloadSvg||Ue.value.downloadPng||Ue.value.downloadCsv||Wt.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ks)):e.createCommentVNode("",!0),Ue.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Fn},e.toDisplayString(e.unref(J)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ue.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:zn},e.toDisplayString(e.unref(J)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ue.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Pn},e.toDisplayString(e.unref(J)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Wt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ue.value.downloadSvg||Ue.value.downloadPng||Ue.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Gs)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+c},[n.separator?(e.openBlock(),e.createElementBlock("div",Js)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Yt(n)),style:e.normalizeStyle(dl(n)),onClick:v=>On(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:gn(n),class:"dss-custom-menu-content"},null,8,er)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",tr,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,Qs)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),X.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:at},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:r[4]||(r[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",or,[e.createElementVNode("h3",null,e.toDisplayString(No.value?e.unref(J)("chart.modalMarker.viewMarker"):go.value?e.unref(J)("chart.modalMarker.editMarker"):e.unref(J)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:at},"×")]),e.createElementVNode("div",nr,[e.createElementVNode("div",lr,[X.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",ar,e.toDisplayString(Cn(X.value.categoryIndex)||""),1)),X.value.fromButton?(e.openBlock(),e.createElementBlock("div",sr,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":r[1]||(r[1]=n=>X.value.categoryIndex=n),class:"dss-form-select",disabled:No.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,(n,c)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${c}`,value:c},e.toDisplayString(n),9,ir))),128))],8,rr),[[e.vModelSelect,X.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",cr,[e.createElementVNode("label",ur,e.toDisplayString(e.unref(J)("chart.modalMarker.description")),1),No.value?(e.openBlock(),e.createElementBlock("div",dr,e.toDisplayString(X.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":r[2]||(r[2]=n=>X.value.description=n),placeholder:e.unref(J)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,mr)),[[e.vModelText,X.value.description]])]),e.createElementVNode("div",pr,[e.createElementVNode("label",null,e.toDisplayString(e.unref(J)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",fr,[e.createElementVNode("img",{src:yn({type:X.value.type}),alt:"Marker Icon Preview",class:"preview-icon",style:{width:"32px",height:"32px","border-radius":"50%",border:"2px solid #ddd"},onError:r[3]||(r[3]=n=>n.target.style.display="none")},null,40,vr)])])]),e.createElementVNode("div",hr,[e.createElementVNode("div",gr,[go.value&&!No.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:st},e.toDisplayString(e.unref(J)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",yr,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:at},e.toDisplayString(No.value?e.unref(J)("chart.modalMarker.close"):e.unref(J)("chart.modalMarker.cancel")),1),No.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:ml,disabled:!(X.value.description&&X.value.description.length)},e.toDisplayString(go.value?e.unref(J)("chart.modalMarker.save"):e.unref(J)("chart.contextMenu.addMarker")),9,Cr))])])])])):e.createCommentVNode("",!0)],64))}}),wr={class:"dss-modal-title"},br={class:"dss-modal-actions"},xl={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(z,{emit:vo}){const J=z,H=vo,zt=e.ref(null),S=e.ref(null),ie=e.computed(()=>{const le={"max-width":J.width};return J.height!=="auto"&&(le.height=J.height,le["min-height"]="0"),le}),bo=e.computed(()=>({}));function Uo(){H("close-modal")}function g(){J.backDrop&&!zt.value&&H("close-modal")}function Re(le){le.target.tagName==="INPUT"&&(zt.value=le.target.tagName)}function ct(){setTimeout(()=>{zt.value=null},300)}function et(){const le=document.body,ke=document.documentElement;S.value={bodyOverflow:le.style.overflow,bodyPosition:le.style.position,bodyTop:le.style.top,bodyWidth:le.style.width,htmlOverflow:ke.style.overflow,scrollY:window.scrollY},le.style.overflow="hidden",le.style.position="fixed",le.style.top=`-${S.value.scrollY}px`,le.style.width="100%",le.style.left="0",ke.style.overflow="hidden"}function D(){if(!S.value)return;const le=document.body,ke=document.documentElement,{bodyOverflow:gt,bodyPosition:yt,bodyTop:$,bodyWidth:Ye,htmlOverflow:Ht,scrollY:Ze}=S.value;le.style.overflow=gt||"",le.style.position=yt||"",le.style.top=$||"",le.style.width=Ye||"",le.style.left="",ke.style.overflow=Ht||"",window.scrollTo(0,Ze||0)}return e.watch(()=>J.showModal,le=>{if(le)et(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ke=document.getElementById("dss-modal-backdrop");ke&&(ke.addEventListener("focusin",Re),ke.addEventListener("focusout",ct))},100);else{D(),document.body.classList.remove("dss-modal-open");const ke=document.getElementById("dss-modal-backdrop");ke&&(ke.removeEventListener("focusin",Re),ke.removeEventListener("focusout",ct))}},{immediate:!0}),e.onUnmounted(()=>{J.showModal&&D()}),(le,ke)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[z.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:g},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(ie.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ke[0]||(ke[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":z.headerType,"font-size":z.titleSize})},[e.createElementVNode("h1",wr,[e.renderSlot(le.$slots,"title",{},()=>[ke[1]||(ke[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(le.$slots,"title-data"),z.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:Uo,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(bo.value)},[e.renderSlot(le.$slots,"content",{},()=>[ke[2]||(ke[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",br,[e.renderSlot(le.$slots,"actions")])])],4),[[e.vShow,z.showModal]])])):e.createCommentVNode("",!0)]))}},Er={class:"dss-toolbar-left"},Vr=["title"],Sr=["title"],Nr={class:"dss-toolbar-dropdown-wrapper"},Mr=["title"],Br={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Tr={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Hr={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ar={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Lr={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$r={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Dr={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Ir=["title"],_r=["title"],Rr=["title"],Fr=["title"],zr=["title"],Pr=["title"],Or=["title"],Zr=["title"],Wr=["title"],Ur={key:2,class:"dss-toolbar-separator"},qr=["title"],Xr={key:4,class:"dss-toolbar-separator"},Yr={key:5,class:"dss-toolbar-dropdown-wrapper"},jr=["title"],Kr={class:"dss-toolbar-dropdown-ai"},Gr={class:"dss-toolbar-right"},Jr={key:0,class:"dss-toolbar-custom-group"},Qr={key:1,class:"dss-toolbar-separator"},ei={class:"dss-link-modal-content"},ti={class:"dss-link-modal-field"},oi={class:"dss-link-modal-label"},ni=["placeholder"],li={class:"dss-link-modal-field"},ai={class:"dss-link-modal-label"},si=["placeholder"],ri={class:"dss-image-modal-tabs"},ii={key:0,class:"dss-image-tab-content"},ci={class:"dss-link-modal-content"},ui={class:"dss-link-modal-field"},di={key:0,class:"dss-link-modal-label"},mi=["src"],pi={class:"dss-link-modal-field"},fi={class:"dss-link-modal-label"},vi=["placeholder"],hi={class:"dss-link-modal-field"},gi={class:"dss-link-modal-label"},yi=["placeholder"],Ci={class:"dss-link-modal-field"},ki={class:"dss-link-modal-label"},xi=["placeholder"],wi={key:1,class:"dss-image-tab-content"},bi={class:"dss-link-modal-content"},Ei={class:"dss-link-modal-field"},Vi={class:"dss-link-modal-label"},Si=["placeholder"],Ni={class:"dss-link-modal-field"},Mi={class:"dss-link-modal-label"},Bi=["placeholder"],Ti={class:"dss-link-modal-field"},Hi={class:"dss-link-modal-label"},Ai=["placeholder"],Li={class:"dss-link-modal-field"},$i={class:"dss-link-modal-label"},Di=["placeholder"],Ii={class:"dss-text-editor-title-input-container"},_i={key:0,class:"dss-text-editor-title-preview"},Ri={key:0},Fi={key:1,class:"dss-text-editor-preview-placeholder"},zi=["value","placeholder","disabled"],Pi={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Oi={class:"dss-text-editor-description-input-container"},Zi={key:0,class:"dss-text-editor-description-preview"},Wi={key:0},Ui={key:1,class:"dss-text-editor-preview-placeholder"},qi=["value","placeholder","disabled"],Xi={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Yi=["data-comment-id","onMouseenter"],ji=["onClick"],Ki=["src","alt"],Gi={key:1},Ji=["onClick"],Qi=["src","alt"],ec={key:1},tc=["data-has-second-user","onClick"],oc={class:"editor-comment-marker-count"},nc={key:4,class:"dss-text-editor-textarea-wrapper"},lc=["value","placeholder","rows","disabled"],ac={class:"dss-text-editor-footer"},sc={class:"dss-text-editor-footer-content"},rc={class:"dss-text-editor-footer-stat"},ic={class:"dss-text-editor-footer-stat"},cc={key:5,class:"dss-text-editor-content-wrapper"},uc={key:0,class:"dss-comment-overlay-body"},dc={class:"dss-comment-selection-wrapper"},mc=["innerHTML"],pc={class:"dss-comment-messages-wrapper"},fc={key:0,class:"dss-comment-avatar-wrapper"},vc={class:"dss-comment-avatar"},hc=["src","alt"],gc={key:1},yc={class:"dss-comment-header"},Cc={class:"dss-comment-header-text"},kc={class:"dss-comment-author"},xc={key:0,class:"dss-comment-date"},wc=["onClick","title"],bc={class:"dss-comment-overlay-inner"},Ec=["placeholder","onKeydown"],Vc={class:"dss-text-editor-footer"},Sc={class:"dss-text-editor-footer-content"},Nc={class:"dss-text-editor-footer-stat"},Mc={class:"dss-text-editor-footer-stat"},Bc=["title"],Tc=["title"],Hc={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},Ac={class:"dss-image-popup-content"},Lc={key:0,class:"dss-image-popup-no-alt-icon"},$c=["title"],Dc=["title"],Ic={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},_c={class:"dss-toolbar-left"},Rc=["title"],Fc=["title"],zc={class:"dss-toolbar-dropdown-wrapper"},Pc=["title"],Oc={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Zc={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wc={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Uc={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qc={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Xc={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Yc={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},jc=["title"],Kc=["title"],Gc=["title"],Jc=["title"],Qc=["title"],eu=["title"],tu=["title"],ou=["title"],nu=["title"],lu=["title"],au={key:2,class:"dss-toolbar-separator"},su={key:3,class:"dss-toolbar-dropdown-wrapper"},ru=["title"],iu={class:"dss-toolbar-dropdown-ai"},cu={key:0,class:"dss-toolbar-right"},uu={key:0,class:"dss-toolbar-separator"},du={key:0,class:"dss-toolbar-custom-group"},mu={key:1,class:"dss-toolbar-separator"},pu={name:"DSSTextEditor"},fu=Object.assign(pu,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:z=>typeof z=="object"&&z!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:z=>typeof z=="object"&&z!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(z,{expose:vo,emit:J}){const{t:H,locale:zt}=El.useI18n(),S=z,ie=J,bo=e.useSlots(),Uo=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
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(/ /g," "),t=t.replace(/&/g,"&"),t=t.replace(/</g,"<"),t=t.replace(/>/g,">"),t=t.replace(/"/g,'"'),t=t.replace(/'/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&<.value&&(lt.value=null),Re.value=!0;const l=p.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\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&<.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&<.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
|
|
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(/ |\u00A0/g," "),a=n.replace(/ |\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>`,g=e.ref(null),Re=e.ref(null),ct=e.ref(!1),et=e.ref(!1),D=e.ref(!1),le=e.ref(""),ke=e.ref({}),gt=e.ref(!1),yt=e.ref(!1),$=e.ref(""),Ye=e.ref(""),Ht=e.ref(null),Ze=e.ref(null),He=e.ref(null),je=e.ref(null),ae=e.ref(""),Eo=e.ref(!1),j=e.ref({}),xe=e.ref(!1),rn=e.ref({}),Ao=e.ref(null),At=e.ref(null),lo=e.ref(!1),Ct=e.ref(""),Lo=e.ref(null),kt=e.ref(""),Je=e.ref(""),Ce=e.ref(""),Ae=e.ref(null),Lt=e.ref(null),Vo=e.ref(null),ue=e.ref(null),$o=e.ref(null),Pt=e.ref(!1),So=e.ref(""),Bn=e.ref({}),We=e.ref(!1),nt=e.ref("upload"),Ke=e.ref(""),rt=e.ref(null),ut=e.ref(null),xt=e.ref([]),lt=e.ref([]),te=e.ref(null),ve=e.ref(!1),$t=e.ref(""),tt=e.ref(""),wt=e.ref(""),dt=e.ref(""),mt=e.ref(""),pt=e.ref(""),se=e.ref(null),Ne=e.ref(null),Ot=e.ref(null),ho=e.ref(!1),bt=e.ref(null),Et=e.ref(!1),Zt=e.ref(!1),ao=e.ref(null),Fe=e.ref("p"),Ue=e.ref(!1),Wt=e.ref([]),Dt=e.ref(null),It=e.ref(null),Ut=e.ref(null),Do=e.ref(!1),Tn=e.ref(0),al=100,Vt=e.ref(null),cn=e.computed(()=>({"dss-text-editor-no-border":!S.border,"dss-text-editor-rounded":S.rounded,"dss-text-editor-full-height":S.fullHeight,"dss-comment-overlay-open":qe.value!==null})),sl=e.computed(()=>({})),un=e.computed(()=>!S.fixedHeight||S.fullHeight?{}:{height:`${1.6*14*S.rows+24+2}px`,resize:"none",overflowY:"auto"}),dn=e.computed(()=>!S.fixedHeight||S.fullHeight?{}:{height:`${1.6*14*S.rows+32}px`,overflowY:"auto"}),Hn=e.computed(()=>S.richText&<.value.length>0),An=e.computed(()=>{if(!S.modelValue)return"";if(S.richText){let l=S.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return l=l.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),l=l.replace(/<[^>]+>/g,""),l=l.replace(/ /g," "),l=l.replace(/&/g,"&"),l=l.replace(/</g,"<"),l=l.replace(/>/g,">"),l=l.replace(/"/g,'"'),l=l.replace(/'/g,"'"),l=l.replace(/\s+/g," ").trim(),l}return S.modelValue}),St=e.computed(()=>{const l=An.value.trim();return l?l.split(/\s+/).filter(o=>o.length>0).length:0}),qo=e.computed(()=>An.value.length),mn=e.computed(()=>ue.value!==null&&nt.value==="upload"&&kt.value&&kt.value.startsWith("data:")),pn=e.computed(()=>S.titlePlaceholder||H("textEditor.placeholders.title")),Ln=e.computed(()=>S.descriptionPlaceholder||H("textEditor.placeholders.description")),rl=e.computed(()=>S.placeholder||H("textEditor.placeholders.startTyping")),qt=l=>bo&&bo[l]!==void 0,il=l=>{for(let o=l+1;o<S.customToolbarSlots.length;o++)if(qt(S.customToolbarSlots[o]))return!0;return!1},$n=l=>{for(let o=l+1;o<S.customToolbarSlots.length;o++){const a=S.customToolbarSlots[o];if(qt(a)&&Xo(a))return!0}return!1},Xo=l=>S.customToolbarFloatingMap.hasOwnProperty(l)?S.customToolbarFloatingMap[l]===!0:!0,Dn=e.computed(()=>S.customToolbarSlots.some(l=>qt(l)&&Xo(l))),fn=e.computed(()=>qt("title-slot")),Yo=e.computed(()=>qt("description-slot")),jo=l=>{if(!l||l.trim()==="")return"<html></html>";const o=l.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?l:`<html>${l}</html>`},vn=l=>{if(!l||l.trim()==="")return"";const o=l.replace(/<!--[\s\S]*?-->/g,""),a=o.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():o},cl=l=>{if(!l)return;const o=document.createTreeWalker(l,NodeFilter.SHOW_COMMENT,null,!1),a=[];let s=o.nextNode();for(;s;)a.push(s),s=o.nextNode();a.forEach(i=>i.remove())},Ee=l=>{try{const o=String(l.getDate()).padStart(2,"0"),s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][l.getMonth()],i=l.getFullYear();return`${o} ${s} ${i}`}catch{return""}},U=l=>{if(!l||typeof l!="string")return!1;const o=l.trim();if(!o)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(o))return!0;try{const i=H("textEditor.started_conversation");if(i&&o===i)return!0}catch{}const s=o.toLowerCase();return s.includes("started conversation")||s.includes("démarré la conversation")||s==="started conversation"||s==="a démarré la conversation"},hn=l=>{const o=l.target.value;ie("update:modelValue",o),ie("change",o)},oe=()=>{if(!se.value)return;const l=se.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const s=l.value;l.value="M";const i=l.scrollHeight;l.value=s,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},so=()=>{Et.value=!0,oe()},ne=()=>{Et.value=!1,re()},re=()=>{if(!se.value)return;const l=se.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const o=l.value;l.value="M";const a=l.scrollHeight;l.value=o,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},A=l=>{const a=l.target.value;Et.value&&oe(),ie("update:title",a),ie("title-change",a),Ot.value="title",S.richText&&(ve.value||(tt.value=$t.value,mt.value=wt.value,pt.value=dt.value),te.value&&clearTimeout(te.value),ve.value=!0,te.value=setTimeout(()=>{ve.value=!1,ze()},500))},Me=()=>{if(!Ne.value)return;const l=Ne.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const s=l.value;l.value="M";const i=l.scrollHeight;l.value=s,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},X=()=>{Zt.value=!0,Me()},ul=()=>{Zt.value=!1,go()},go=()=>{if(!Ne.value)return;const l=Ne.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const o=l.value;l.value="M";const a=l.scrollHeight;l.value=o,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},No=l=>{const a=l.target.value;Zt.value&&Me(),ie("update:description",a),ie("description-change",a),Ot.value="description",S.richText&&(ve.value||(tt.value=$t.value,mt.value=wt.value,pt.value=dt.value),te.value&&clearTimeout(te.value),ve.value=!0,te.value=setTimeout(()=>{ve.value=!1,ze()},500))},ft=()=>{const l=window.getSelection();if(l.rangeCount===0)return null;const o=l.getRangeAt(0);if(o.startContainer.nodeType===1)return{type:"element",element:o.startContainer,offset:o.startOffset};const a=o.cloneRange();return a.selectNodeContents(g.value),a.setEnd(o.startContainer,o.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+o.toString().length}},Nt=l=>{if(!(!l||!g.value))try{const o=window.getSelection(),a=document.createRange();if(l.type==="element"&&l.element)if(g.value.contains(l.element)){a.setStart(l.element,l.offset),a.collapse(!0),o.removeAllRanges(),o.addRange(a);return}else{g.value.focus();return}let s=0;const i=[g.value];let d=null,u=!1,m=!1;for(;!m&&(d=i.pop());)if(d.nodeType===3){const p=s+d.length;!u&&l.start>=s&&l.start<=p&&(a.setStart(d,l.start-s),u=!0),u&&l.end>=s&&l.end<=p&&(a.setEnd(d,l.end-s),m=!0),s=p}else{let p=d.childNodes.length;for(;p--;)i.push(d.childNodes[p])}o.removeAllRanges(),o.addRange(a)}catch{g.value.focus()}},Ko=()=>{if(!g.value)return;g.value.focus();const l=window.getSelection(),o=document.createRange(),a=i=>{if(i.nodeType===3||i.childNodes.length===0)return i;for(let d=i.childNodes.length-1;d>=0;d--){const u=i.childNodes[d],m=a(u);if(m)return m}return i},s=a(g.value);if(s.nodeType===3)o.setStart(s,s.length),o.setEnd(s,s.length);else if(s.childNodes.length>0){const i=a(s);i&&i.nodeType===3?(o.setStart(i,i.length),o.setEnd(i,i.length)):(o.selectNodeContents(s),o.collapse(!1))}else o.setStart(s,0),o.setEnd(s,0);l.removeAllRanges(),l.addRange(o)},ze=(l=!1)=>{if(!g.value)return;const o=g.value.innerHTML,a=S.title||"",s=S.description||"";if(!l&&o===$t.value&&a===wt.value&&s===dt.value)return;const i={content:tt.value||$t.value,title:mt.value!==void 0?mt.value:wt.value,description:pt.value!==void 0?pt.value:dt.value},d=xt.value.length>0?xt.value[xt.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=i.content!==d:u=i.content!==d.content||i.title!==d.title||i.description!==d.description),u&&(xt.value.push(i),xt.value.length>50&&xt.value.shift(),lt.value=[]),$t.value=o,wt.value=a,dt.value=s,tt.value=o,mt.value=a,pt.value=s},fe=l=>{if(!g.value)return;Xt(),g.value&&cl(g.value);let o=null;g.value&&(g.value.querySelector("p")||(o=ft(),gn()));const a=l&&l.inputType&&(l.inputType==="insertText"||l.inputType==="insertCompositionText"||l.inputType==="deleteContentBackward"||l.inputType==="deleteContentForward");a&&ao.value&&(ao.value=null),et.value=!0;const s=g.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),i=jo(s);ie("update:modelValue",i),ie("change",i),Ot.value="editor",ve.value||(tt.value=$t.value,mt.value=wt.value,pt.value=dt.value),te.value&&clearTimeout(te.value),ve.value=!0,te.value=setTimeout(()=>{ve.value=!1,ze(),En(),Jn()},500),e.nextTick(()=>{o&&Nt(o),Xt();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,p=m&&m.collapsed;if(d.forEach(h=>{try{if(p&&ao.value?.command===h){j.value[h]=ao.value.state;return}if(h==="bold")if(m){const x=m.commonAncestorContainer,w=x.nodeType===3?x.parentElement:x;let k=!1;if(w&&((w.tagName==="STRONG"||w.tagName==="B"||w.closest&&w.closest("strong, b"))&&(k=!0),!k&&w.style&&parseInt(w.style.fontWeight)>=600&&(k=!0),!k))try{const T=window.getComputedStyle(w);parseInt(T.fontWeight)>=600&&(k=!0)}catch{}j.value[h]=k}else j.value.hasOwnProperty(h)||(j.value[h]=!1);else if(h==="italic")if(m){const x=m.commonAncestorContainer,w=x.nodeType===3?x.parentElement:x,k=w&&(w.tagName==="EM"||w.tagName==="I"||w.closest&&w.closest("em, i"));j.value[h]=!!k}else{const x=document.queryCommandState(h);j.value[h]=x}else{const x=document.queryCommandState(h);j.value[h]=x}}catch{}}),it(),Yt(),ro(),me(),eo(),Tt("handleRichTextInput"),a&&(l.inputType==="insertText"||l.inputType==="insertCompositionText")){const h=l.data||"";h&&h.length===1&&setTimeout(()=>Jn(h),0),(h===" "||h===`
|
|
78
|
+
`||/[.,;:!?]/.test(h))&&setTimeout(()=>{En()},100)}et.value=!1})},Xt=()=>{if(!g.value)return;const l=window.getSelection();if(!l||l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer,s=a.nodeType===3?a.parentElement:a;if(!s)return;const i=s.closest(".dss-image-wrapper");if(i){const d=i.querySelector("img");if(s!==d&&!d?.contains(s)){const u=o.startContainer.nodeType===3?o.startContainer.parentElement:o.startContainer,m=o.endContainer.nodeType===3?o.endContainer.parentElement:o.endContainer;if(i.contains(u)&&u!==d||i.contains(m)&&m!==d){const p=document.createRange();p.setStartAfter(i),p.collapse(!0),l.removeAllRanges(),l.addRange(p)}}}},gn=()=>{if(!g.value)return;const l=g.value;if(l.querySelector&&l.querySelector("p"))return;const o=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(l.childNodes);let s=null;a.forEach(i=>{if(i.nodeType===Node.TEXT_NODE){if((i.textContent||"").trim()===""){i.parentNode===l&&l.removeChild(i);return}s||(s=document.createElement("p"),l.insertBefore(s,i)),s.appendChild(i);return}if(i.nodeType===Node.ELEMENT_NODE){const d=i,u=d.tagName;if(u==="BR"){s=null;return}if(o.has(u)){s=null;return}s||(s=document.createElement("p"),l.insertBefore(s,d)),s.appendChild(d)}})},Yt=()=>{if(g.value&&!ho.value){ho.value=!0;try{g.value.querySelectorAll(".dss-image-wrapper").forEach(s=>{s.querySelector("img")||s.remove()}),g.value.querySelectorAll(".dss-image-no-alt-icon").forEach(s=>{const i=s.parentElement;!i||!i.classList.contains("dss-image-wrapper")?s.remove():i.querySelector("img")||s.remove()}),g.value.querySelectorAll("img").forEach(s=>{let i=s.getAttribute("alt");i===null&&(i=s.alt||"");const d=s.getAttribute("src")||s.src||"";if(i){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),x=i===d||i===h;(i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")||x||x)&&(i="")}s.setAttribute("alt",i),s.setAttribute("data-alt",i);const u=!i||i.trim()==="";let m=s.parentElement;const p=m&&m.classList.contains("dss-image-wrapper");if(p){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=s.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?s.nextElementSibling:null;h&&h.remove()}if(u){p?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),s.parentNode.insertBefore(m,s),m.appendChild(s));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=Uo,m.appendChild(h)}else if(p&&m.children.length===1){const h=m.parentNode;h.insertBefore(s,m),h.removeChild(m)}})}finally{ho.value=!1}}},dl=l=>{En(),ie("blur",l),Fo()},yn=()=>{if(S.disabled||!S.richText||!g.value)return;Qe(),te.value&&(clearTimeout(te.value),te.value=null),ve.value&&(ze(),ve.value=!1);const l=Ot.value==="title",o=Ot.value==="description",a=Ot.value==="editor";if(xt.value.length===0){l&&se.value?se.value.focus():o&&Ne.value?Ne.value.focus():g.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{fe()});return}const s={content:g.value.innerHTML,title:S.title||"",description:S.description||""};lt.value.push(s);const i=xt.value.pop();if(i!==void 0){et.value=!0;const d=typeof i=="string"?i:i.content,u=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";g.value.innerHTML=d,$t.value=d,wt.value=u,dt.value=m,tt.value=d,mt.value=u,pt.value=m,e.nextTick(()=>{it(),Le(),to(),me();const p=jo(d);ie("update:modelValue",p),ie("update:title",u),ie("update:description",m),ie("change",p),ie("title-change",u),ie("description-change",m),et.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(se.value){se.value.focus();const h=u.length;se.value.setSelectionRange&&se.value.setSelectionRange(h,h),oe()}}else if(o){if(Ne.value){Ne.value.focus();const h=m.length;Ne.value.setSelectionRange(h,h)}}else if(a)Ko();else if(se.value&&document.activeElement===se.value){const h=u.length;se.value.setSelectionRange&&se.value.setSelectionRange(h,h),oe()}else if(Ne.value&&document.activeElement===Ne.value){const h=m.length;Ne.value.setSelectionRange(h,h)}else g.value&&Ko()},10)})})}},Cn=()=>{if(S.disabled||!S.richText||!g.value)return;Qe();const l=Ot.value==="title",o=Ot.value==="description",a=Ot.value==="editor";if(lt.value.length===0){l&&se.value?se.value.focus():o&&Ne.value?Ne.value.focus():g.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{fe()});return}const s={content:g.value.innerHTML,title:S.title||"",description:S.description||""};xt.value.push(s);const i=lt.value.pop();if(i!==void 0){et.value=!0;const d=typeof i=="string"?i:i.content,u=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";g.value.innerHTML=d,$t.value=d,wt.value=u,dt.value=m,tt.value=d,mt.value=u,pt.value=m,e.nextTick(()=>{it(),Le(),to(),me();const p=jo(d);ie("update:modelValue",p),ie("update:title",u),ie("update:description",m),ie("change",p),ie("title-change",u),ie("description-change",m),et.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(se.value){se.value.focus();const h=u.length;se.value.setSelectionRange&&se.value.setSelectionRange(h,h),oe()}}else if(o){if(Ne.value){Ne.value.focus();const h=m.length;Ne.value.setSelectionRange(h,h)}}else if(a)Ko();else if(se.value&&document.activeElement===se.value){const h=u.length;se.value.setSelectionRange&&se.value.setSelectionRange(h,h),oe()}else if(Ne.value&&document.activeElement===Ne.value){const h=m.length;Ne.value.setSelectionRange(h,h)}else g.value&&Ko()},10)})})}},Go=()=>{if(!g.value)return;g.value.querySelectorAll('span[style*="font-weight"]').forEach(s=>{const i=s.style.fontWeight;if(i==="normal"||i==="400"){const d=document.createDocumentFragment();for(;s.firstChild;)d.appendChild(s.firstChild);s.parentNode&&s.parentNode.replaceChild(d,s)}}),g.value.querySelectorAll('span[style*="font-weight"]').forEach(s=>{if(parseInt(s.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";s.firstChild;)d.appendChild(s.firstChild);s.parentNode&&s.parentNode.replaceChild(d,s)}}),g.value.querySelectorAll("b, strong").forEach(s=>{s.style.fontWeight="600"})},ro=()=>{if(!g.value)return;g.value.querySelectorAll("i, em").forEach(o=>{o.style.fontStyle="italic"})},In=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const o=l.getRangeAt(0);let a=!1;if(o.collapsed){const s=o.startContainer;let i=s.nodeType===3?s.parentElement:s;for(;i&&i!==g.value;){if(i.tagName==="EM"||i.tagName==="I"){a=!0;break}if(i.style&&i.style.fontStyle==="italic"){a=!0;break}i=i.parentElement}}else{const s=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(s){const i=document.createTreeWalker(s,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=i.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==g.value;){if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{ro()}),!1;if(o.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{ro()});else try{const s=o.extractContents(),i=document.createElement("em");i.style.fontStyle="italic",i.appendChild(s),o.insertNode(i),o.setStartAfter(i),o.collapse(!0),l.removeAllRanges(),l.addRange(o),e.nextTick(()=>{ro()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{ro()})}return!0},ml=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const o=l.getRangeAt(0);let a=!1;if(o.collapsed){const s=o.startContainer;let i=s.nodeType===3?s.parentElement:s;for(;i&&i!==g.value;){if(i.tagName==="STRONG"||i.tagName==="B"){a=!0;break}if(i.style&&parseInt(i.style.fontWeight)>=600){a=!0;break}i=i.parentElement}}else{const s=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(s){const i=document.createTreeWalker(s,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=i.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==g.value;){if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{Go()}),!1;if(o.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0),d=i.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==g.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const p=document.createElement("b");p.style.fontWeight="600";const h=document.createDocumentFragment();for(;u.firstChild;)h.appendChild(u.firstChild);p.appendChild(h),u.parentNode&&u.parentNode.replaceChild(p,u),i.setStart(p,0),i.collapse(!0),s.removeAllRanges(),s.addRange(i);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===g.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",i.insertNode(m),i.setStart(m,0),i.collapse(!0),s.removeAllRanges(),s.addRange(i)}}Go()});else try{const s=o.extractContents(),i=document.createElement("b");i.style.fontWeight="600",i.appendChild(s),o.insertNode(i),o.setStartAfter(i),o.collapse(!0),l.removeAllRanges(),l.addRange(o),e.nextTick(()=>{Go()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Go()})}return!0},at=(l,o=null)=>{if(S.disabled||!S.richText||!g.value)return;ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Qe(),g.value.focus();const a=window.getSelection();let s=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&ko(d)&&(s=ft())}if(l==="createLink"&&o){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const p=document.createTextNode(o);u.insertNode(p),u.selectNodeContents(p)}}}if(l==="bold"){const d=ml();j.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(ao.value={command:"bold",state:d}),e.nextTick(()=>{s&&(Nt(s),e.nextTick(()=>{const m=st("bold");j.value.bold=m})),fe(),Le(),me()});return}if(l==="italic"){const d=In();j.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(ao.value={command:"italic",state:d}),e.nextTick(()=>{s&&(Nt(s),e.nextTick(()=>{const m=st("italic");j.value.italic=m})),fe(),ro(),Le(),me()});return}let i=!1;try{i=document.execCommand(l,!1,o)}catch{}e.nextTick(()=>{if(s&&Nt(s),["bold","italic","underline"].includes(l))try{if(l==="bold")s&&e.nextTick(()=>{const u=st("bold");j.value.bold=u});else if(l==="italic")if(s)e.nextTick(()=>{const u=st("italic");j.value.italic=u});else{const u=document.queryCommandState(l);j.value[l]=u}else{const u=document.queryCommandState(l);j.value[l]=u}}catch{j.value.hasOwnProperty(l)?j.value[l]=!j.value[l]:j.value[l]=!0}if(l==="createLink"&&o){const u=window.getSelection();if(u.rangeCount>0){const p=u.getRangeAt(0),h=p.commonAncestorContainer.nodeType===1?p.commonAncestorContainer.closest("a"):p.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",o)}g.value.querySelectorAll("a").forEach(p=>{const h=p.getAttribute("href");(!h||h===""||h==="#")&&p.setAttribute("href",o)})}fe(),Le(),me()})},st=(l,o=null)=>{if(S.disabled||!g.value)return!1;try{if(l==="formatBlock"&&o){const s=document.queryCommandValue("formatBlock");if(o==="<blockquote>"){const i=s.toLowerCase();if(i==="blockquote"||i==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return s===o||s.toLowerCase()===o.toLowerCase()}if(["bold","italic","underline"].includes(l))try{const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0);if(l==="bold"){let u=!1;if(i.collapsed){const m=i.commonAncestorContainer,p=m.nodeType===3?m.parentElement:m;if(p&&((p.tagName==="STRONG"||p.tagName==="B"||p.closest&&p.closest("strong, b"))&&(u=!0),!u&&p.style&&parseInt(p.style.fontWeight)>=600&&(u=!0),!u))try{const h=window.getComputedStyle(p);parseInt(h.fontWeight)>=600&&(u=!0)}catch{}return j.value.hasOwnProperty(l)?j.value[l]:(j.value[l]=u,u)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let p=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let x;for(;x=h.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(x))){if(x.nodeType===3){if(!(x.textContent||"").trim())continue;p=!0;let k=x.parentElement;for(;k&&k!==g.value;){if(k.tagName==="STRONG"||k.tagName==="B"){u=!0;break}if(k.style&&parseInt(k.style.fontWeight)>=600){u=!0;break}k=k.parentElement}}else if(x.nodeType===1){const w=x;if(w.tagName==="STRONG"||w.tagName==="B"){u=!0;break}if(w.style&&parseInt(w.style.fontWeight)>=600){u=!0;break}}if(u)break}}return j.value[l]=u&&p,u&&p}}if(l==="italic"){let u=!1;if(i.collapsed){const m=i.commonAncestorContainer,p=m.nodeType===3?m.parentElement:m;if(p&&((p.tagName==="EM"||p.tagName==="I"||p.closest&&p.closest("em, i"))&&(u=!0),!u&&p.style&&p.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(p).fontStyle==="italic"&&(u=!0)}catch{}return j.value.hasOwnProperty(l)?j.value[l]:(j.value[l]=u,u)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let p=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let x;for(;x=h.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(x))){if(x.nodeType===3){if(!(x.textContent||"").trim())continue;p=!0;let k=x.parentElement;for(;k&&k!==g.value;){if(k.tagName==="EM"||k.tagName==="I"){u=!0;break}if(k.style&&k.style.fontStyle==="italic"){u=!0;break}k=k.parentElement}}else if(x.nodeType===1){const w=x;if(w.tagName==="EM"||w.tagName==="I"){u=!0;break}if(w.style&&w.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return j.value[l]=u&&p,u&&p}}const d=document.queryCommandState(l);return i.collapsed&&j.value.hasOwnProperty(l)?j.value[l]:(j.value[l]=d,d)}return j.value.hasOwnProperty(l)?j.value[l]:!1}catch{return j.value.hasOwnProperty(l)?j.value[l]:!1}try{return document.queryCommandState(l)}catch{return!1}}catch{return!1}},_n=l=>{S.disabled||!S.richText||(Re.value=Re.value===l?null:l,l==="askAi"&&(At.value=null))},Qe=()=>{Re.value=null,rt.value=null},jt=l=>{at("formatBlock",l),Qe()},pl=l=>{if(!l||!g.value)return l;const o=L=>{let F=L.nodeType===Node.TEXT_NODE?L.parentElement:L;for(;F&&F!==g.value;){const Q=F.tagName;if(Q==="P"){const Pe=F.parentElement;if(Pe===g.value||Pe.tagName==="BLOCKQUOTE")return F}if(Q==="BLOCKQUOTE")break;F=F.parentElement}return null},a=o(l.startContainer),s=o(l.endContainer);if(!a||!s)return l;const i=[],d=document.createTreeWalker(g.value,NodeFilter.SHOW_ELEMENT,{acceptNode:L=>{const F=L.tagName;if(F==="P"){const Q=L.parentElement;if(Q===g.value||Q.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return F==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)i.push(u);const m=i.indexOf(a),p=i.indexOf(s);if(m===-1||p===-1)return l;const h=Math.min(m,p),x=Math.max(m,p),w=i.slice(h,x+1);if(w.length===0)return l;const k=w[0],T=w[w.length-1],B=document.createRange();return B.setStartBefore(k),B.setEndAfter(T),B},Io=()=>{if(S.disabled||!S.richText||!g.value)return;ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Qe(),g.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;let o=l.getRangeAt(0);!o.collapsed&&ko(o)&&(o=pl(o),l.removeAllRanges(),l.addRange(o));let a=null;!o.collapsed&&ko(o)&&(a=ft());const s=o.commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!!(i&&g.value.contains(i))){if(i){const u=i.parentNode;Array.from(i.childNodes).forEach(p=>{if(p.nodeType===Node.ELEMENT_NODE)if(p.tagName==="P"||p.tagName==="DIV")u.insertBefore(p,i);else{const h=document.createElement("p");h.appendChild(p.cloneNode(!0)),u.insertBefore(h,i)}else if(p.nodeType===Node.TEXT_NODE&&p.textContent.trim()){const h=document.createElement("p");h.appendChild(p.cloneNode(!0)),u.insertBefore(h,i)}}),i.remove()}}else if(o.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=o.extractContents();u.appendChild(m),o.insertNode(u);const p=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:k=>k.parentNode===u&&k.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let x;for(;x=h.nextNode();)p.push(x);if(p.forEach(k=>{const T=document.createElement("p");k.parentNode.insertBefore(T,k),T.appendChild(k)}),u.querySelectorAll("p, div").forEach(k=>{k.textContent.trim()===""&&!k.querySelector("img")&&(k.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const k=document.createElement("p");k.innerHTML="<br>",u.appendChild(k)}}e.nextTick(()=>{a&&Nt(a),to(),fe(),me()})},kn=()=>{if(!g.value)return;const l=window.getSelection();if(l.rangeCount===0)return;const a=l.getRangeAt(0).commonAncestorContainer,s=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!s||!g.value.contains(s))return;const i=x=>{if(!x)return!1;const w=x.textContent||"",T=(x.innerHTML||"").trim();return w.trim()===""||T===""||T==="<br>"||T==="<br/>"||T==="<p></p>"||T==="<p><br></p>"||T==="<p><br/></p>"||T==="<p> </p>"||T==="<p><br> </p>"||T==="<div></div>"||T==="<div><br></div>"||T==="<div><br/></div>"};let d=null;for(a.nodeType===3?d=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?d=a:d=a.closest("p, div"),d&&s.contains(d)&&i(d)&&d.remove();s.lastChild;){const x=s.lastChild;if(x.nodeType===1&&x.tagName==="BR")x.remove();else if(x.nodeType===3)if((x.textContent||"").trim()==="")x.remove();else break;else break}if(s.children.length>0)for(let x=s.children.length-1;x>=0;x--){const w=s.children[x];if((w.tagName==="P"||w.tagName==="DIV")&&i(w))w.remove();else break}let u=s.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(s.innerHTML=u);const p=document.createElement("p");p.innerHTML="<br>",s.parentNode?s.nextSibling?s.parentNode.insertBefore(p,s.nextSibling):s.parentNode.appendChild(p):g.value&&g.value.appendChild(p);const h=document.createRange();h.selectNodeContents(p),h.collapse(!0),l.removeAllRanges(),l.addRange(h),e.nextTick(()=>{to(),fe()})},Le=()=>{if(!g.value){ct.value=!1;return}try{const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,s=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");ct.value=!!s}else ct.value=!1}catch{ct.value=!1}},Rn=()=>{if(!g.value)return;const l=window.getSelection();l&&l.rangeCount>0&&l.getRangeAt(0),je.value=ft();const o=window.getSelection();let a="";o.rangeCount>0&&(a=o.getRangeAt(0).toString()),$.value="",Ye.value=a,ae.value="",He.value=null,yt.value=!0,Qe(),e.nextTick(()=>{Ht.value&&Ht.value.focus()})},Fn=()=>{if(!g.value)return;ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze();const l=window.getSelection();let o=null;if(l.rangeCount>0){const s=l.getRangeAt(0).commonAncestorContainer;o=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a")}if(!o&&He.value&&(o=He.value),o&&o.parentNode){const a=document.createDocumentFragment();for(;o.firstChild;)a.appendChild(o.firstChild);if(o.parentNode.replaceChild(a,o),a.firstChild){const s=document.createRange();s.setStartBefore(a.firstChild),s.setEndAfter(a.lastChild||a.firstChild),l.removeAllRanges(),l.addRange(s),document.execCommand("removeFormat",!1),s.collapse(!1),l.removeAllRanges(),l.addRange(s)}He.value=null}else at("unlink");ct.value=!1,Qe(),e.nextTick(()=>{fe(),Le()})},zn=()=>{S.disabled||!S.richText||g.value&&(ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Qe(),g.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{it(),fe(),me()}))},Pn=()=>{S.disabled||!S.richText||g.value&&(ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Qe(),g.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{it(),fe(),me()}))},On=l=>{const o=l.parentElement;if(!o||o.tagName!=="OL")return null;let a=0,s=l.previousElementSibling;for(;s;)s.tagName==="LI"&&a++,s=s.previousElementSibling;return a+1},it=()=>{if(!g.value)return;g.value.querySelectorAll("li > ol").forEach(o=>{const a=o.parentElement;if(a&&a.tagName==="LI"){const s=On(a);s!==null&&Array.from(o.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(s))})}})},Zn=()=>{if(S.disabled||!S.richText||!g.value)return;Qe(),g.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{it(),fe()});return}const s=a.parentElement;if(!s||s.tagName!=="OL"&&s.tagName!=="UL")return;const i=a.previousElementSibling;if(i&&i.tagName==="LI"){const d=s.tagName.toLowerCase();let u=i.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),i.appendChild(u));const m=On(i);u.appendChild(a),m!==null&&s.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),it();const p=document.createRange();p.selectNodeContents(a),p.collapse(!1),l.removeAllRanges(),l.addRange(p),e.nextTick(()=>{fe(),me()})}else document.execCommand("indent",!1),e.nextTick(()=>{it(),fe(),me()})},Wn=()=>{if(S.disabled||!S.richText||!g.value)return;Qe(),g.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{it(),fe()});return}const s=a.parentElement;if(!s||s.tagName!=="OL"&&s.tagName!=="UL")return;const i=s.parentElement;if(i&&i.tagName==="LI"){const d=i.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){s.tagName==="OL"&&a.removeAttribute("data-parent-num"),d.insertBefore(a,i.nextSibling),s.children.length===0&&s.remove(),it();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),l.removeAllRanges(),l.addRange(u),e.nextTick(()=>{fe(),me()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{it(),fe(),me()})},qe=e.ref(null),Kt=e.ref(null),Mo=e.ref({}),Gt=e.ref(""),Mt=e.ref(null),io=e.ref("");e.ref("");const _t=e.ref(null);e.ref("");const $e=e.ref([]),E=e.ref(!1),De=e.ref(!1),Bt=l=>{if(!l)return"";const o=l.cloneRange(),a=document.createElement("div");return a.appendChild(o.cloneContents()),a.innerHTML},vt=()=>{if(S.disabled||!S.richText||!g.value)return;if(qe.value!==null){qe.value=null,Gt.value="",io.value="",_t.value=null,$e.value=[],wo(!0);return}Qe(),g.value.focus();const l=window.getSelection();if(!l||l.rangeCount===0)return;const o=l.getRangeAt(0);if(o.collapsed||!ko(o))return;io.value=Bt(o)||"",_t.value=ft();const a=o.getBoundingClientRect(),s=g.value.parentElement;if(!s)return;const i=s.getBoundingClientRect(),d=a.bottom-i.top,m=Math.max(d+8,0);Mo.value={top:`${m}px`,bottom:"auto"},qe.value=Date.now(),e.nextTick(()=>{if(Gt.value="",Mt.value){const h=Mt.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const p=s.querySelector(".dss-comment-overlay");if(p&&s){const h=s.querySelector(".dss-text-editor-footer");if(h){const x=s.getBoundingClientRect(),w=p.getBoundingClientRect(),k=h.getBoundingClientRect(),T=w.bottom-x.top,B=k.top-x.top,L=8;if(T>B-L){const F=k.height;Mo.value={bottom:`${F+L}px`,top:"auto"}}else Mo.value={top:`${m}px`,bottom:"auto"}}}})},Jt=()=>{if(!Gt.value.trim())return;const l=Gt.value.trim(),o=new Date,a={text:l,selectionText:io.value,selectionRange:_t.value,commentId:qe.value,user:S.commentUser||null,createdAt:o.toISOString()};$e.value=[...$e.value,a],ie("comment-submitted",a),Ve(a),_t.value&&!Xe(_t.value)&&yo(qe.value,_t.value),Gt.value="",e.nextTick(()=>{if(Mt.value){const s=Mt.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`,s.focus()}Tt("sendComment")})},Be=(l,o)=>{if(!(!S.commentUser||!l.user||l.user.id!==S.commentUser.id)){if($e.value=$e.value.filter((a,s)=>s!==o),qe.value!==null&&g.value){const a=String(qe.value),s=g.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(s&&$e.value.length>0){const i=[],d=new Set;$e.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),i.push(u.user))}),i.length>0?s.setAttribute("data-comment-user",JSON.stringify(i[0])):s.removeAttribute("data-comment-user"),i.length>1?s.setAttribute("data-comment-user-2",JSON.stringify(i[1])):s.removeAttribute("data-comment-user-2"),s.setAttribute("data-comment-count",String($e.value.length))}else s&&$e.value.length===0&&(s.removeAttribute("data-comment-user"),s.removeAttribute("data-comment-user-2"),s.setAttribute("data-comment-count","0"))}if(ie("comment-deleted",{comment:l,index:o,commentId:qe.value}),S.comments&&Array.isArray(S.comments)){const a=S.comments.filter(s=>!(s.commentId===l.commentId&&s.text===l.text&&s.user?.id===l.user?.id));ie("update:comments",a)}e.nextTick(()=>{Tt("deleteComment")})}},Xe=l=>{if(!l||!g.value)return!1;try{const o=Qt(l);if(!o)return!1;const a=o.commonAncestorContainer,s=a.nodeType===3?a.parentElement:a;if(s)return!!s.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Qt=l=>{if(!l||!g.value)return null;try{const o=document.createRange();if(l.type==="element"&&l.element)return g.value.contains(l.element)?(o.setStart(l.element,l.offset),o.collapse(!0),o):null;let a=0;const s=[g.value];let i=null,d=!1,u=!1;for(;!u&&(i=s.pop());)if(i.nodeType===3){const m=a+i.length;!d&&l.start>=a&&l.start<=m&&(o.setStart(i,l.start-a),d=!0),d&&l.end>=a&&l.end<=m&&(o.setEnd(i,l.end-a),u=!0),a=m}else{let m=i.childNodes.length;for(;m--;)s.push(i.childNodes[m])}return d?o:null}catch{return null}},yo=(l,o)=>{if(!(!l||!o||!g.value))try{const a=Qt(o);if(!a||a.collapsed)return;const s=a.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i){const m=i.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(l)&&m.getAttribute("data-fake-comment")!==String(l)&&m.setAttribute("data-comment",String(l));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(l));try{const m=a.startContainer,p=a.endContainer,h=a.startOffset,x=a.endOffset,w=m.nodeType===3?m.parentNode:m,k=p.nodeType===3?p.parentNode:p;if(w===k&&h===0&&x===(p.nodeType===3?p.length:k.childNodes.length)&&(w.tagName==="P"||w.tagName==="DIV"||w.tagName==="H1"||w.tagName==="H2"||w.tagName==="H3"||w.tagName==="H4"||w.tagName==="H5"||w.tagName==="H6")){const B=a.extractContents();d.appendChild(B),a.insertNode(d)}else a.surroundContents(d)}catch{const p=a.extractContents();d.appendChild(p),a.insertNode(d)}const u=g.value.querySelector(`[data-comment="${String(l)}"]`);e.nextTick(()=>{Tt("wrapSelectionWithCommentMarker"),fe()})}catch{}},Ve=l=>{if(!l||!l.commentId)return;const o=Array.isArray(S.comments)?[...S.comments]:[],a=typeof l.commentId=="string"&&l.commentId.startsWith("comment-")?Date.now():Number(l.commentId)||l.commentId;let s=o.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(a)||d.conversation_id===a);const i={text:l.text,user:l.user,createdAt:l.createdAt,created_at:l.createdAt,updated_at:l.createdAt};if(s>=0){const d=o[s];if(d.conversation||(d.conversation=[]),d.conversation.push(i),d.updated_at=l.createdAt,!d.article_id&&o.length>0){const u=o.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=l.selectionRange,u=o.length>0&&o.find(p=>p.article_id)?.article_id||null,m={conversation_id:a,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:l.selectionText||"",conversation:[i],created_by_user:l.user,created_at:l.createdAt,updated_at:l.createdAt,status:"active"};o.push(m)}E.value=!0,ie("update:comments",o)},Se=(l,o=[])=>{if(S.disabled||!S.richText||!g.value)return;const a=g.value;let s=null;try{s=a.querySelector(l)}catch{return}if(!s)return;Qe(),a.focus();const i=document.createRange();i.selectNodeContents(s);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(i)),io.value=s.innerHTML||"",_t.value=ft();const u=i.getBoundingClientRect(),m=a.parentElement;if(m){const x=m.getBoundingClientRect(),w=u.bottom-x.top,T=Math.max(w+8,0);Mo.value={top:`${T}px`,bottom:"auto"}}const p=s.getAttribute("data-comment")||s.getAttribute("data-fake-comment");let h=[];if(p&&S.comments&&Array.isArray(S.comments)){const x=S.comments.find(w=>String(w.conversation_id)===String(p));if(x&&x.conversation&&Array.isArray(x.conversation)){const w=x.conversation.map(k=>({id:k.id||k.commentary_id,commentary_id:k.id||k.commentary_id,conversation_id:x.id||x.conversation_id,text:k.text,user:k.user,createdAt:k.created_at||k.createdAt,updated_at:k.updated_at||k.updatedAt}));h.push(...w)}}h.length===0&&Array.isArray(o)&&o.length>0&&(h=o.slice()),h.sort((x,w)=>{const k=L=>{if(!L)return 0;const F=new Date(L).getTime();return isNaN(F)?0:F},T=k(x.createdAt),B=k(w.createdAt);return T===B?0:T-B}),$e.value=h,wo(!0),qe.value=p||null,s&&(Kt.value=s,s.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Gt.value="",Mt.value){const x=Mt.value;x.style.height="auto",x.style.height=`${x.scrollHeight}px`,x.focus()}if(m){const x=m.querySelector(".dss-comment-overlay");if(x){const w=m.querySelector(".dss-text-editor-footer");if(w){const k=m.getBoundingClientRect(),T=x.getBoundingClientRect(),B=w.getBoundingClientRect(),L=T.bottom-k.top,F=B.top-k.top,Q=8;if(L>F-Q){const Pe=B.height;Mo.value={bottom:`${Pe+Q}px`,top:"auto"}}}}}Tt("openCommentOverlayForSelector")})},ce=e.ref(null),ot=e.ref(0),_o=l=>{if(!(S.disabled||!S.richText)){if(l.key==="Escape"){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!!(i&&g.value&&g.value.contains(i))){l.preventDefault();let u=null;s.nodeType===3?u=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?u=s:u=s.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&i.contains(u)&&u.nextSibling?i.insertBefore(m,u.nextSibling):i.appendChild(m),setTimeout(()=>{kn()},50);return}}}if(l.key.length===1||l.key==="Enter"){const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0),s=a.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i){const d=i.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(i!==u&&!u?.contains(i)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,p=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(p)&&p!==u){l.preventDefault();const h=document.createRange();h.setStartAfter(d),h.collapse(!0),o.removeAllRanges(),o.addRange(h);return}}}}}}if(l.key==="Backspace"||l.key==="Delete"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);let s=null,i=null;if(a.collapsed)if(l.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(s=m,i=s.closest(".dss-image-wrapper"))),i||(i=u.closest(".dss-image-wrapper"),i&&(s=i.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(s=m,i=s.closest(".dss-image-wrapper"))),i||(i=u.closest(".dss-image-wrapper"),i&&(s=i.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(s=d,i=s.closest(".dss-image-wrapper")):(s=d.querySelector("img"),s&&(i=s.closest(".dss-image-wrapper"))),i){const p=i.contains(u)||u===i,h=i.contains(m)||m===i,w=a.cloneContents().textContent?.trim()||"",k=i.textContent?.trim()||"";(!p||!h||w.length>k.length)&&(i=null,s=null)}}if(i){l.preventDefault(),l.stopPropagation();const d=i.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,i),i.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),o.removeAllRanges(),o.addRange(m),e.nextTick(()=>{fe()});return}}}}if(l.key==="Tab"){l.preventDefault(),l.shiftKey?Wn():Zn();return}if(l.key==="Enter"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);if(a.collapsed){const u=a.startContainer,m=p=>{if(!p)return!1;let h=p.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const x=p.parentElement;return x&&x!==g.value?m(x):!1};if(u.nodeType===3){const p=u.parentElement;if(p&&(m(p)||m(u))){const h=p.closest("p, div");if(h&&h!==g.value){l.preventDefault(),l.stopPropagation();let x=null;const w=a.startOffset;w<u.length&&(x=u.splitText(w));const k=document.createElement("p");if(x?k.appendChild(x):k.innerHTML="<br>",u.length===0){const B=u.parentElement;B&&(B.removeChild(u),B.childNodes.length===0&&B.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(k,h.nextSibling):h.parentNode.appendChild(k);const T=document.createRange();x?T.setStart(x,0):T.setStart(k,0),T.collapse(!0),o.removeAllRanges(),o.addRange(T),e.nextTick(()=>{fe()});return}}}}const s=a.commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!!(i&&g.value&&g.value.contains(i))){let u=null;s.nodeType===3?u=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?u=s:u=s.closest("p, div");const m=B=>{if(!B)return!1;const L=B.textContent||"",Q=(B.innerHTML||"").trim(),Pe=Q.replace(/<br\s*\/?>/gi,"").trim();return L.trim()===""||Q===""||Pe===""||Q==="<br>"||Q==="<br/>"||Q==="<p></p>"||Q==="<p><br></p>"||Q==="<p><br/></p>"||Q==="<p> </p>"||Q==="<p><br> </p>"||Q==="<div></div>"||Q==="<div><br></div>"||Q==="<div><br/></div>"},p=i.lastChild,h=p&&p.nodeType===1&&p.tagName==="BR",x=a.startContainer,w=x.nodeType===3?x.parentElement:x,k=w===i||w&&w.parentElement===i;if(u&&m(u)||h&&k){l.preventDefault(),setTimeout(()=>{kn()},50);return}}}}if(l.key===" "){const o=Date.now(),a=o-ot.value;if(ce.value===" "&&a<300){const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0),d=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer.closest("li"):i.commonAncestorContainer.parentElement?.closest("li");if(d){const u=i.startContainer.textContent?.substring(0,i.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){l.preventDefault(),Zn();return}}}}ce.value=" ",ot.value=o}else ce.value=l.key}},Un=l=>{if(S.disabled||!S.richText)return;l.preventDefault();let o=l.clipboardData.getData("text/html"),a=l.clipboardData.getData("text/plain");o&&(o=o.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),ze();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){let m=s.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),i=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const p=new DOMParser().parseFromString(u,"text/html");let h=g.value.querySelector("h1")?1:0;if(p.querySelectorAll("h1").forEach(w=>{if(h>0){const k=p.createElement("p");k.innerHTML=w.innerHTML,w.parentNode.replaceChild(k,w)}else h++}),i){const w=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],k=Array.from(p.body.children).filter(T=>w.includes(T.tagName));if(k.length===1){const T=k[0].tagName,B=i.tagName,L=i.textContent.trim()===""&&!i.querySelector("img");let F=!1;if(["H1","H2","H3","H4","H5","H6"].includes(B)?F=!0:L||(T===B||T==="P")&&(F=!0),F)return k[0].innerHTML.trim()}}return p.body.innerHTML.trim()};if(o){const u=d(o);document.execCommand("insertHTML",!1,u)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=d(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);fe()},Ro=l=>{if(Re.value){const a=l.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Qe()}if(xe.value){const a=l.target,s=a.closest(".dss-floating-toolbar"),i=g.value&&a.closest(".dss-text-editor-content");!s&&!i&&Fo()}if(At.value){const a=l.target,s=a.closest(".dss-floating-toolbar"),i=a.closest(".dss-toolbar-dropdown");!s&&!i&&oo()}const o=l.target;if(!o.closest(".dss-toolbar-dropdown")&&!o.closest(".dss-toolbar-dropdown-submenu")&&(rt.value=null),!g.value||!o.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);Ue.value=!s.collapsed&&ko(s)}else Ue.value=!1}if(qe.value!==null){const a=document.querySelector(".dss-comment-overlay");let s=!1;if(a){const u=a.getBoundingClientRect(),m=l.clientX,p=l.clientY;s=m>=u.left&&m<=u.right&&p>=u.top&&p<=u.bottom}const i=o.closest(".dss-toolbar-button"),d=i&&i.getAttribute("title")==="Comment";!s&&!d&&(qe.value=null,Gt.value="",io.value="",_t.value=null,$e.value=[],wo(!0))}},Jo=(l,o)=>{l&&l.stopPropagation&&l.stopPropagation(),ut.value&&(clearTimeout(ut.value),ut.value=null),rt.value=o},qn=l=>{const o=l.relatedTarget;if(o){const a=o.closest(".dss-toolbar-dropdown-submenu"),s=o.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||s)return}ut.value&&clearTimeout(ut.value),ut.value=setTimeout(()=>{rt.value=null,ut.value=null},150)},Xn=l=>{rt.value=null};let Co=0;const Yn=l=>{if(!l)return;const o=Array.from(l.children);o.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),o.forEach((a,s)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const i=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),d=a.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(i||u){const m=`submenu-auto-${++Co}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let p=null;i?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(i,a.nextSibling),i.classList.add("dss-toolbar-dropdown-submenu"),p=i):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),p=d),p&&(p.setAttribute("data-submenu-id",m),p.setAttribute("data-processed","true"),i&&a.tagName!=="BUTTON"?p.dataset.originalParentRef="inside":p.dataset.originalParentRef="sibling",Array.from(p.children).forEach(x=>{(x.tagName==="BUTTON"||x.tagName==="DIV")&&!x.classList.contains("dss-toolbar-dropdown-item")&&x.classList.add("dss-toolbar-dropdown-item")}))}})},Rt=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(o=>{Yn(o),o.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(i=>{const d=i._subMenuHandlers;d&&(i.removeEventListener("mouseenter",d.enter),i.removeEventListener("mouseleave",d.leave));const u=p=>{const h=i.getAttribute("data-submenu-id");h&&Jo(p,h)},m=qn;i.addEventListener("mouseenter",u),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:u,leave:m}}),o.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(i=>{const d=i._subMenuHandlers;d&&(i.removeEventListener("mouseenter",d.enter),i.removeEventListener("mouseleave",d.leave));const u=h=>{const x=i.getAttribute("data-submenu-id");x&&Jo(h,x)},m=qn;i.addEventListener("mouseenter",u),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:u,leave:m},i.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",Xn)})})})};let Bo=null;const Qo=()=>{if(rt.value){const l=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${rt.value}"]`),o=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${rt.value}"]`);l&&o&&ll(l,o)}if(xe.value&&me(),S.richText){if(Bo!==null)return;Bo=setTimeout(()=>{Bo=null,Tt("handleWindowResize")},150)}},co=()=>{if(!S.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(o=>{Array.from(o.children).filter(s=>s.tagName==="DIV"&&!s.classList.contains("dss-toolbar-button")).forEach(s=>{s.classList.add("dss-toolbar-button")})})},fl=()=>{const l=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),o=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const s=window.getSelection();s.removeAllRanges?s.removeAllRanges():s.empty&&s.empty()}return!1};l.forEach(a=>{a.addEventListener("selectstart",o),a.addEventListener("mousedown",o),a.addEventListener("dragstart",o),a.addEventListener("contextmenu",o),a.addEventListener("click",s=>{if(window.getSelection){const i=window.getSelection();i.removeAllRanges&&i.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Et.value?oe():re(),Zt.value?Me():go()})}),e.nextTick(()=>{fl()}),S.richText&&g.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Ro),window.addEventListener("resize",Qo);let l=null;const o=()=>{l===null&&(l=setTimeout(()=>{l=null,Qo()},150))};window.addEventListener("scroll",o,!0),g.value._windowScrollHandler=o,g.value._windowScrollTimeout=l,g.value.closest(".editor-with-comments"),g.value.closest(".dss-text-editor-content-wrapper");const a=g.value.closest(".dss-text-editor-content");let s=null;const i=()=>{s===null&&(s=setTimeout(()=>{s=null,Qo()},150))};a&&(a.addEventListener("scroll",i),g.value._scrollHandlers={wrapper:null,content:a,handler:i}),e.nextTick(()=>{Rt(),co()}),g.value.addEventListener("click",m=>{const p=m.target;p.closest("a")&&!S.disabled&&m.preventDefault();const x=p.closest(".dss-image-no-alt-icon"),w=p.closest(".dss-image-wrapper");if(x||w&&p===w){m.preventDefault(),m.stopPropagation();const k=window.getSelection(),T=document.createRange();T.setStartAfter(w),T.collapse(!0),k.removeAllRanges(),k.addRange(T)}else w&&p.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const k=window.getSelection();if(k.rangeCount>0){const B=k.getRangeAt(0).commonAncestorContainer,L=B.nodeType===3?B.parentElement:B;if(w.contains(L)&&L!==w.querySelector("img")){const F=document.createRange();F.setStartAfter(w),F.collapse(!0),k.removeAllRanges(),k.addRange(F)}}else{const T=document.createRange();T.setStartAfter(w),T.collapse(!0),k.addRange(T)}}))},!0),g.value.addEventListener("mousedown",m=>{const p=m.target,h=p.closest(".dss-image-no-alt-icon"),x=p.closest(".dss-image-wrapper");if(h||x&&p.tagName!=="IMG"){m.preventDefault();const w=window.getSelection(),k=document.createRange();x&&(k.setStartAfter(x),k.collapse(!0),w.removeAllRanges(),w.addRange(k))}},!0),g.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!g.value)return;g.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const w=h.getAttribute("alt")||h.alt||"";if(w){const k=h.getAttribute("src")||h.src||"",T=k.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),B=w===k||w===T;(w.startsWith("http://")||w.startsWith("https://")||w.startsWith("data:")||B||B)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),Yt()})}),g.value.addEventListener("dragstart",m=>{const p=m.target,h=p.tagName==="IMG"?p:p.closest("img"),x=h?.closest(".dss-image-wrapper");h&&g.value.contains(h)&&(bt.value=x||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),g.value.addEventListener("dragover",m=>{bt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),g.value.addEventListener("dragenter",m=>{bt.value&&(m.preventDefault(),m.stopPropagation())}),g.value.addEventListener("drop",m=>{if(!bt.value||!g.value)return;m.preventDefault(),m.stopPropagation();const p=bt.value,h=p.classList?.contains("dss-image-wrapper"),x=h?p.querySelector("img"):p,w=h?p:x?.closest(".dss-image-wrapper");if(!x||!g.value.contains(x)){bt.value=null;return}let k=null;const T=m.clientX,B=m.clientY;if(document.caretRangeFromPoint)k=document.caretRangeFromPoint(T,B);else{const Te=window.getSelection();Te.rangeCount>0?k=Te.getRangeAt(0).cloneRange():(k=document.createRange(),k.selectNodeContents(g.value),k.collapse(!1))}if(!k){bt.value=null;return}const L=k.commonAncestorContainer,F=L.nodeType===3?L.parentElement:L;if(F?.closest(".dss-image-wrapper")===w||w&&w.contains(F)){bt.value=null;return}if(w&&(F===w||w.contains(F))){bt.value=null;return}const Pe=x.getAttribute("src");let Oe=null;w?Oe=w.cloneNode(!0):Oe=x.cloneNode(!0);try{let Te=k.startContainer;if(Te.nodeType===3&&(Te=Te.parentElement),w&&(Te===w||w.contains(Te))){const be=document.createRange();be.setStartAfter(w),be.collapse(!0),k=be}k.insertNode(Oe);const Ie=document.createRange();Ie.setStartAfter(Oe),Ie.collapse(!0);const _e=window.getSelection();_e.removeAllRanges(),_e.addRange(Ie)}catch{if(g.value.childNodes.length===0){const Ie=document.createElement("p");Ie.appendChild(Oe),g.value.appendChild(Ie)}else{const Ie=g.value.lastChild;if(Ie&&Ie.nodeType===1)Ie.appendChild(Oe);else{const _e=document.createElement("p");_e.appendChild(Oe),g.value.appendChild(_e)}}}w?w.remove():x.remove(),bt.value=null,e.nextTick(()=>{const Te=g.value.querySelectorAll("img");let Ie=!1;Te.forEach(_e=>{if(_e.getAttribute("src")===Pe)if(!Ie)Ie=!0;else{const be=_e.closest(".dss-image-wrapper");be?be.remove():_e.remove()}}),Yt(),fe()})}),g.value.addEventListener("dragend",m=>{bt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(p=>{p.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const x=h.querySelectorAll&&h.querySelectorAll("img");x&&x.forEach(w=>{w.removeAttribute("alt"),w.removeAttribute("data-alt"),w.setAttribute("alt",""),w.setAttribute("data-alt",""),w.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Yt(),co(),d=null},100)});if(u.observe(g.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const p=new MutationObserver(()=>{e.nextTick(()=>{co()})});p.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=p}}),S.modelValue){const m=vn(S.modelValue);g.value.innerHTML=m,gn()}e.nextTick(()=>{const m=g.value.innerHTML||"",p=S.title||"",h=S.description||"";$t.value=m,wt.value=p,dt.value=h,mt.value=p,pt.value=h,it(),Yt(),ro(),eo(),nl(),Vn()}),Le(),to(),g.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Ro),window.removeEventListener("resize",Qo),g.value&&g.value._windowScrollHandler&&window.removeEventListener("scroll",g.value._windowScrollHandler,!0),Bo!==null&&(clearTimeout(Bo),Bo=null),g.value&&g.value._windowScrollTimeout!==null&&clearTimeout(g.value._windowScrollTimeout),te.value&&clearTimeout(te.value),ut.value&&clearTimeout(ut.value),g.value&&g.value._mutationObserver&&g.value._mutationObserver.disconnect(),Dt.value&&Dt.value.disconnect(),It.value!==null&&(cancelAnimationFrame(It.value),It.value=null),Ut.value!==null&&(clearTimeout(Ut.value),Ut.value=null),Vt.value!==null&&(clearTimeout(Vt.value),Vt.value=null),wo(!0),g.value&&g.value._scrollHandlers){const{wrapper:o,content:a,handler:s}=g.value._scrollHandlers;o&&o.removeEventListener("scroll",s),a&&a.removeEventListener("scroll",s)}const l=document.querySelector(".dss-text-editor-toolbar");l&&l._toolbarMutationObserver&&l._toolbarMutationObserver.disconnect()});const jn=l=>{const o=l.target,a=o.closest("a");if(a&&!S.disabled){l.preventDefault();const i=document.createRange();i.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(i)}const s=o.closest(".dss-image-wrapper");s&&o.tagName!=="IMG"?e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const u=i.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(s.contains(m)&&m!==s.querySelector("img")){const p=document.createRange();p.setStartAfter(s),p.collapse(!0),i.removeAllRanges(),i.addRange(p)}}Yt(),Le(),to(),me(),eo()}):e.nextTick(()=>{Yt(),Le(),to(),me(),eo()})},Kn=()=>{Xt();const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0);Ue.value=!a.collapsed&&ko(a),!a.collapsed&&ao.value&&(ao.value=null)}else Ue.value=!1;if(Yt(),Le(),to(),me(),eo(),l&&l.rangeCount>0){const s=l.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i&&i.closest(".dss-text-editor-footer")){l.removeAllRanges(),Ue.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const s=window.getSelection();if(s.rangeCount>0){const i=s.getRangeAt(0);if(!i.collapsed)if(a==="bold"){const d=i.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const p=window.getComputedStyle(u);parseInt(p.fontWeight)>=600&&(m=!0)}catch{}j.value[a]=m}else{const d=document.queryCommandState(a);j.value[a]=d}}}catch{}})},eo=()=>{if(!S.richText||S.disabled||!g.value){Fe.value="p";return}try{const l=window.getSelection();if(!l||l.rangeCount===0){Fe.value="p";return}const a=l.getRangeAt(0).commonAncestorContainer,s=a.nodeType===3?a.parentElement:a;if(!s||!g.value.contains(s)){Fe.value="p";return}const i=s.closest("h1, h2, h3, h4, h5, h6, p");if(!i){Fe.value="p";return}const d=i.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?Fe.value=d:Fe.value="p"}catch{Fe.value="p"}},to=()=>{if(!g.value){Eo.value=!1;return}try{const l=window.getSelection();let o=!1;if(l.rangeCount>0){const s=l.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");o=!!(i&&g.value.contains(i))}Eo.value=o}catch{Eo.value=!1}},ko=l=>{if(!l||!g.value)return!1;const o=l.commonAncestorContainer;if(!o)return!1;const a=o.nodeType===3?o.parentElement:o;return a?g.value.contains(a):!1},Fo=()=>{xe.value=!1},me=()=>{if(!S.floatingToolbar||!S.richText||S.disabled){xe.value=!1;return}const l=window.getSelection();if(!l||l.rangeCount===0){xe.value=!1;return}const o=l.getRangeAt(0);if(o.collapsed||!ko(o)){xe.value=!1;return}const a=o.getBoundingClientRect();if(!a||a.width===0&&a.height===0){xe.value=!1;return}const s=g.value;if(!s){xe.value=!1;return}const i=s.getBoundingClientRect();if(!i||i.width===0){xe.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let p=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let x=0;Ao.value&&(x=Ao.value.getBoundingClientRect().width);const w=(x||320)/2;let k=i.left+w,T=i.right-w;if(T<k){const B=i.left+i.width/2;k=B,T=B}if(h>0){const B=w+u,L=h-w-u;if(k=Math.max(k,B),T=Math.min(T,L),T<k){const F=h/2;k=F,T=F}}p<k?p=k:p>T&&(p=T),rn.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${p}px`,transform:"translate(-50%, -100%)",zIndex:10003},xe.value=!0},uo=l=>{S.disabled||!S.richText||(At.value=At.value===l?null:l,l==="askAi"&&(Re.value=null))},oo=()=>{At.value=null,rt.value=null},he=l=>{jt(l),oo()};let xo=null,ge=null,we=null,To=null;const vl=l=>{if(S.disabled||!S.richText){zo(),ye();return}const o=l.target,a=o.closest("a"),s=o.closest("img");if(xo&&(clearTimeout(xo),xo=null),we&&(clearTimeout(we),we=null),a&&a!==ge){ye(),ge=a;let i=a.getAttribute("href")||"";(!i||i==="#"||i==="")&&(i=a.textContent||""),He.value=a,le.value=i,D.value=!0,gt.value=!0,wn(a)}else!a&&ge?(ge=null,xo=setTimeout(()=>{gt.value||zo()},150)):a&&a===ge&&wn(a);if(s&&s!==To){zo(),To=s;let i=s.getAttribute("alt");i===null&&(i=s.alt||"");let d=s.getAttribute("data-alt");d===null&&(d=i),s.hasAttribute("alt")||s.setAttribute("alt",i),s.hasAttribute("data-alt")||s.setAttribute("data-alt",d),ue.value=s,So.value=i.trim()||H("textEditor.image.noAlt"),Pt.value=!0,We.value=!0,en(s)}else!s&&To?(To=null,we=setTimeout(()=>{We.value||ye()},150)):s&&s===To&&en(s)},xn=l=>{const o=l.relatedTarget;(!o||!o.closest(".dss-text-editor-content")&&!o.closest(".dss-link-popup"))&&(ge=null,To=null,xo&&(clearTimeout(xo),xo=null),we&&(clearTimeout(we),we=null),zo(),ye())},zo=()=>{gt.value=!1,setTimeout(()=>{gt.value||(D.value=!1,le.value="",yt.value||(He.value=null))},100)},wn=l=>{if(!l||!g.value)return;const o=l.getBoundingClientRect(),i=o.top-32-8,d=o.left+o.width/2;ke.value={position:"fixed",top:`${i}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},ye=()=>{We.value=!1,setTimeout(()=>{We.value||(Pt.value=!1,So.value="",lo.value||(ue.value=null))},100)},en=l=>{if(!l||!g.value)return;const o=l.getBoundingClientRect(),i=o.top-32-8,d=o.left+o.width/2;Bn.value={position:"fixed",top:`${i}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Gn=()=>{if(!le.value||!He.value)return;let o=He.value.getAttribute("href")||le.value;!o.startsWith("http://")&&!o.startsWith("https://")&&!o.startsWith("mailto:")&&(o="https://"+o),window.open(o,"_blank","noopener,noreferrer")},bn=()=>{if(He.value){const l=He.value.textContent||"",o=He.value.getAttribute("href")||"",a=He.value;$.value=o,Ye.value=l,ae.value=l,gt.value=!1,D.value=!1,le.value="",He.value=a,yt.value=!0}else if(ct.value){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,s=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(s){const i=s.textContent||"",d=s.getAttribute("href")||"";$.value=d,Ye.value=i,ae.value=i,He.value=s,yt.value=!0}}}else{je.value=ft();const l=window.getSelection();let o="";l.rangeCount>0&&(o=l.getRangeAt(0).toString()),$.value="",Ye.value=o,ae.value="",He.value=null,yt.value=!0}e.nextTick(()=>{Ht.value&&(Ht.value.focus(),Ht.value.select())})},Po=()=>{yt.value=!1,$.value="",Ye.value="",ae.value="",He.value=null,je.value=null},tn=()=>{if(!$.value.trim()){Po();return}if(ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze(),Ye.value.trim()||(Ye.value=$.value.trim()),He.value&&g.value&&g.value.contains(He.value)){const l=window.getSelection();l.rangeCount>0&&l.removeAllRanges();const o=He.value;if(o.setAttribute("href",$.value.trim()),Ye.value.trim()!==ae.value.trim()){for(;o.firstChild;)o.removeChild(o.firstChild);o.textContent=Ye.value.trim()}o.style.color="#60afdf",o.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(o),a.collapse(!1),l.removeAllRanges(),l.addRange(a),fe()}else if(g.value){g.value.focus();const l=window.getSelection();l.removeAllRanges(),je.value&&Nt(je.value);let o=null;if(l.rangeCount>0&&(o=l.getRangeAt(0)),o&&!o.collapsed){o.toString();const a=document.createElement("a");a.href=$.value.trim(),a.textContent=Ye.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",o.deleteContents(),o.insertNode(a);const s=document.createTextNode(" ");o.setStartAfter(a),o.insertNode(s),o.setStartAfter(s),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}else{o||(o=document.createRange(),o.selectNodeContents(g.value),o.collapse(!1));const a=o.startContainer,s=a.nodeType===3,i=s&&o.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=$.value.trim(),d.textContent=Ye.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",i){let u=a.parentElement;for(;u&&u!==g.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==g.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const p=document.createTextNode(" ");m.appendChild(p);const h=document.createRange();h.setStartAfter(d),h.collapse(!0),l.removeAllRanges(),l.addRange(h)}else{if(o.startOffset>0){const h=a.textContent.substring(0,o.startOffset),x=h[h.length-1];if(x&&x!==" "&&x!==" "&&x!==`
|
|
79
|
+
`){const w=document.createTextNode(" ");o.insertNode(w),o.setStartAfter(w)}}o.insertNode(d);const p=document.createTextNode(" ");o.setStartAfter(d),o.insertNode(p),o.setStartAfter(p),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}}}else{if(s&&o.startOffset>0){const m=a.textContent.substring(0,o.startOffset),p=m[m.length-1];if(p&&p!==" "&&p!==" "&&p!==`
|
|
80
|
+
`){const h=document.createTextNode(" ");o.insertNode(h),o.setStartAfter(h)}}o.insertNode(d);const u=document.createTextNode(" ");o.setStartAfter(d),o.insertNode(u),o.setStartAfter(u),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}}fe()}e.nextTick(()=>{Le(),Po()})},En=()=>{if(!g.value||et.value)return;const l=window.getSelection();let o=null;l&&l.rangeCount>0&&(o=ft());const a=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,s=document.createTreeWalker(g.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const p=m.parentElement;return!p||p.closest("a")||p.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),i=[];let d;for(;d=s.nextNode();)i.push(d);let u=!1;for(let m=i.length-1;m>=0;m--){const p=i[m],h=p.textContent;a.lastIndex=0;const x=[...h.matchAll(a)];if(x.length===0)continue;const w=x.filter(B=>{const L=B[0],F=B.index;if(F>0&&h[F-1]==="@"||F+L.length<h.length&&h[F+L.length]==="@")return!1;const Q=p.parentElement;return!(Q&&Q.closest("a"))});if(w.length===0)continue;if(w.length===1&&w[0][0]===h.trim()){const B=w[0][0],L=B.startsWith("http://")||B.startsWith("https://")?B:`https://${B}`,F=document.createElement("a");F.href=L,F.textContent=B,F.style.color="#60afdf",F.style.textDecoration="underline",p.parentNode&&(p.parentNode.replaceChild(F,p),u=!0);continue}let k=0;const T=document.createDocumentFragment();if(w.forEach(B=>{const L=B.index,F=B[0];if(L>k){const Oe=h.substring(k,L);Oe&&T.appendChild(document.createTextNode(Oe))}const Q=F.startsWith("http://")||F.startsWith("https://")?F:`https://${F}`,Pe=document.createElement("a");Pe.href=Q,Pe.textContent=F,Pe.style.color="#60afdf",Pe.style.textDecoration="underline",T.appendChild(Pe),k=L+F.length}),k<h.length){const B=h.substring(k);B&&T.appendChild(document.createTextNode(B))}p.parentNode&&T.childNodes.length>0&&(p.parentNode.replaceChild(T,p),u=!0)}u&&o&&e.nextTick(()=>{Nt(o),Le()})},hl=()=>{if(!g.value)return;const l=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,o=document.createTreeWalker(g.value,NodeFilter.SHOW_TEXT,{acceptNode:i=>{const d=i.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let s;for(;s=o.nextNode();)a.push(s);for(let i=a.length-1;i>=0;i--){const d=a[i],u=d.textContent,m=[...u.matchAll(l)];if(m.length===0)continue;let p=0;const h=document.createDocumentFragment();m.forEach(x=>{const w=x.index,k=x[0].startsWith("<u>")?"u":"ins",T=x[1]||x[2]||"";w>p&&h.appendChild(document.createTextNode(u.substring(p,w)));const B=document.createElement(k);B.textContent=T,h.appendChild(B),p=w+x[0].length}),p<u.length&&h.appendChild(document.createTextNode(u.substring(p))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},Jn=l=>{if(!g.value||et.value)return;if(!l){hl();return}if(!["*","_",">"].includes(l))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const s=a.getRangeAt(0);if(!s.collapsed)return;const i=s.startContainer.nodeType===Node.TEXT_NODE?s.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):s.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!i||i===g.value||!g.value.contains(i))return;const d=()=>{let Oe="",Te=0,Ie=!1;const _e=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:Ft=>Ft.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(i,NodeFilter.SHOW_TEXT,null);let be=0;for(;_e.nextNode();){const Ft=_e.currentNode,mo=Ft.textContent||"",po=be;if(be+=mo.length,Ft===s.startContainer){Oe+=mo.substring(0,s.startOffset),Te=po+s.startOffset,Ie=!0;break}Oe+=mo}return Ie||(Te=Oe.length),{textBeforeCursor:Oe,cursorCharOffset:Te}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,p=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?p="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?p="em":l===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(p=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],x=m[1],w=u.length-h.length,T=(Oe=>{let Te=0;const Ie=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:be=>be.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let _e;for(;_e=Ie.nextNode();){const be=(_e.textContent||"").length;if(Te+be>=Oe)return{node:_e,offset:Oe-Te};Te+=be}return null})(w);if(!T)return;const B=document.createRange();B.setStart(T.node,T.offset),B.setEnd(s.endContainer,s.endOffset);const L=document.createElement(p);L.textContent=x,B.deleteContents(),B.insertNode(L);const F=window.getSelection(),Q=document.createRange();Q.setStartAfter(L),Q.collapse(!0),F.removeAllRanges(),F.addRange(Q);const Pe=ft();e.nextTick(()=>{fe(),Pe&&Nt(Pe)})},Ho=()=>{g.value&&($o.value=ft(),Ct.value="",kt.value="",Ke.value="",Je.value="",Ce.value="",Lo.value=null,ue.value=null,nt.value="upload",lo.value=!0,Qe(),e.nextTick(()=>{Ae.value&&Ae.value.focus(),Lt.value&&(Lt.value.value="")}))},on=l=>{const o=l.target?.files?.[0];if(!o){Lo.value=null,kt.value="";return}Lo.value=o;const a=new FileReader;a.onload=s=>{kt.value=s.target?.result||""},a.readAsDataURL(o)},Qn=()=>{Lt.value&&Lt.value.click()},Oo=()=>{Je.value&&(Ce.value="")},el=()=>{Ce.value&&(Je.value="")},gl=()=>{let l=ue.value;if(!l){const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer;l=s.nodeType===1?s.closest("img"):s.parentElement?.closest("img")}}if(l){const o=l.getAttribute("data-alt")||l.getAttribute("alt")||"";ue.value=l,Ct.value=o.trim()===""||o.trim()==="Image"?"":o;const a=l.getAttribute("src")||l.src||"";a.startsWith("http://")||a.startsWith("https://")?(Ke.value=a,kt.value="",nt.value="url"):(kt.value=a,Ke.value="",nt.value="upload");const i=l.style.width||l.getAttribute("width")||"",d=l.style.height||l.getAttribute("height")||"";Je.value=i.endsWith("px")?i.replace("px",""):i,Ce.value=d.endsWith("px")?d.replace("px",""):d,$o.value=null}else{Ho();return}lo.value=!0,We.value=!1,Pt.value=!1,e.nextTick(()=>{nt.value==="url"&&Vo.value?(Vo.value.focus(),Vo.value.select()):Ae.value&&(Ae.value.focus(),Ae.value.select()),Lt.value&&(Lt.value.value="")})},Zo=()=>{lo.value=!1,Ct.value="",kt.value="",Ke.value="",Je.value="",Ce.value="",Lo.value=null,ue.value=null,$o.value=null,nt.value="upload"},no=()=>{const l=(Ct.value||"").trim(),o=g.value?._mutationObserver;o&&o.disconnect(),ve.value?(te.value&&(clearTimeout(te.value),te.value=null),ze(),ve.value=!1):ze();const a=nt.value==="url"?Ke.value.trim():kt.value;if(ue.value&&g.value&&g.value.contains(ue.value)){a&&(ue.value.src=a),ue.value.setAttribute("alt",l),ue.value.setAttribute("data-alt",l),Je.value?(ue.value.style.width=`${Je.value}px`,ue.value.setAttribute("width",Je.value)):(ue.value.style.removeProperty("width"),ue.value.removeAttribute("width")),Ce.value?(ue.value.style.height=`${Ce.value}px`,ue.value.setAttribute("height",Ce.value)):(ue.value.style.removeProperty("height"),ue.value.removeAttribute("height"));const s=window.getSelection();if(s){s.removeAllRanges();const i=document.createRange();i.setStartAfter(ue.value),i.collapse(!0),s.addRange(i)}fe()}else{if(!a){o&&g.value&&o.observe(g.value,{childList:!0,subtree:!0}),Zo();return}if(g.value){g.value.focus();const s=window.getSelection();s&&s.rangeCount>0&&s.removeAllRanges();const i=window.getSelection();let d=null;if($o.value&&(Nt($o.value),i&&i.rangeCount>0&&(d=i.getRangeAt(0))),!d&&i&&i.rangeCount>0&&(d=i.getRangeAt(0)),!d&&g.value){if(d=document.createRange(),g.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",g.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(g.value),d.collapse(!1);i&&(i.removeAllRanges(),i.addRange(d))}if(!d){Zo();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!g.value.contains(m)){if(d=document.createRange(),g.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",g.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(g.value),d.collapse(!1);i&&(i.removeAllRanges(),i.addRange(d))}const p=document.createElement("img");p.src=a,p.setAttribute("alt",l),p.setAttribute("data-alt",l),Je.value&&(p.style.width=`${Je.value}px`,p.setAttribute("width",Je.value)),Ce.value&&(p.style.height=`${Ce.value}px`,p.setAttribute("height",Ce.value));try{d.insertNode(p),d.setStartAfter(p),d.collapse(!0),i&&(i.removeAllRanges(),i.addRange(d))}catch{if(g.value){if(g.value.childNodes.length===0){const w=document.createElement("p");g.value.appendChild(w),w.appendChild(p)}else{const w=g.value.lastChild;if(w&&w.nodeType===1)w.appendChild(p);else{const k=document.createElement("p");g.value.appendChild(k),k.appendChild(p)}}const x=document.createRange();x.setStartAfter(p),x.collapse(!0),i&&(i.removeAllRanges(),i.addRange(x))}}ue.value=p,fe()}}e.nextTick(()=>{o&&g.value&&o.observe(g.value,{childList:!0,subtree:!0}),Le(),me(),Zo()})};e.watch(()=>S.modelValue,l=>{if(S.richText&&g.value&&!et.value){const o=vn(l||""),s=g.value.innerHTML.replace(/ |\u00A0/g," "),i=o.replace(/ |\u00A0/g," ");if(s!==i){const d=ft();g.value.innerHTML=o,e.nextTick(()=>{gn();const u=g.value.innerHTML||"",m=S.title||"",p=S.description||"";$t.value=u,wt.value=m,dt.value=p,tt.value=u,mt.value=m,pt.value=p,xt.value=[],lt.value=[],te.value&&(clearTimeout(te.value),te.value=null),ve.value=!1,d&&Nt(d),it(),Yt(),ro(),Le(),me(),eo(),Tt("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>S.richText,l=>{l?(me(),e.nextTick(()=>{nl()})):(Fo(),Wt.value=[],Dt.value&&(Dt.value.disconnect(),Dt.value=null)),eo()}),e.watch(()=>S.floatingToolbar,l=>{l?me():Fo()}),e.watch(()=>S.disabled,l=>{l&&Fo(),eo()}),e.watch(()=>S.description,()=>{e.nextTick(()=>{Zt.value?Me():go()})}),e.watch(()=>S.title,()=>{e.nextTick(()=>{Et.value?oe():re()})}),e.watch(()=>S.customToolbarSlots,()=>{e.nextTick(()=>{co()})},{deep:!0}),e.watch(()=>S.comments,(l,o)=>{if(E.value){E.value=!1;return}De.value||S.richText&&g.value&&e.nextTick(()=>{Vn()})},{deep:!0,immediate:!1});const Vn=()=>{if(!De.value&&!(!S.comments||!Array.isArray(S.comments)||S.comments.length===0)&&!(!S.richText||!g.value)){De.value=!0;try{const l=new Set,o=S.comments.filter(u=>{const m=String(u.conversation_id||u.id);return l.has(m)?!1:(l.add(m),!0)}),a=g.value.querySelectorAll("[data-comment], [data-fake-comment]"),s=a.length;a.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let i=0;const d=new Set;o.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const p=String(m);if(d.has(p))return;const h=g.value.querySelector(`[data-comment="${p}"]`);if(h){nn(h,u),d.add(p);return}try{const x=ol(u.selection_range,u.selection_text);if(x&&!x.collapsed){const w=x.commonAncestorContainer,k=w.nodeType===3?w.parentElement:w;if(k){const L=k.closest("[data-comment], [data-fake-comment]");if(L){const F=L.getAttribute("data-comment")||L.getAttribute("data-fake-comment");if(String(F)===String(m)){L.setAttribute("data-comment",p),L.removeAttribute("data-fake-comment"),nn(L,u),d.add(p);return}else return}}const T=g.value.querySelector(`[data-comment="${p}"]`);if(T){nn(T,u),d.add(p);return}const B=document.createElement("span");B.setAttribute("data-comment",p),nn(B,u);try{x.surroundContents(B),i++,d.add(p)}catch{try{const F=document.createRange();F.setStart(x.startContainer,x.startOffset),F.setEnd(x.endContainer,x.endOffset),Sn(F),F.surroundContents(B),i++,d.add(p)}catch{try{const Q=x.extractContents();B.appendChild(Q),x.insertNode(B),i++,d.add(p)}catch(Q){console.warn("Failed to create comment marker:",Q)}}}}}catch{}}),e.nextTick(()=>{Tt("restoreCommentsFromModel"),fe(),De.value=!1})}catch{De.value=!1}}},Sn=l=>{if(!l||!g.value)return l;try{const o=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=l.startContainer,s=l.startOffset;if(a.nodeType===3){const u=a.parentElement;u&&o.includes(u.tagName)&&(s===0&&!tl(a)||l.setStartBefore(u))}else a.nodeType===1&&o.includes(a.tagName)&&s>0&&l.setStartBefore(a);let i=l.endContainer,d=l.endOffset;if(i.nodeType===3){const u=i.parentElement;u&&o.includes(u.tagName)&&(d===i.length&&!yl(i)||l.setEndAfter(u))}else i.nodeType===1&&o.includes(i.tagName)&&d<i.childNodes.length&&l.setEndAfter(i);return l}catch{return l}},tl=l=>{let o=l.previousSibling;for(;o;){if(o.nodeType===3&&o.textContent.trim().length>0||o.nodeType===1&&o.textContent.trim().length>0)return!0;o=o.previousSibling}return!1},yl=l=>{let o=l.nextSibling;for(;o;){if(o.nodeType===3&&o.textContent.trim().length>0||o.nodeType===1&&o.textContent.trim().length>0)return!0;o=o.nextSibling}return!1},ol=(l,o)=>{if(!l||!g.value)return null;try{const a=document.createRange();if(l.type==="text"&&typeof l.start=="number"&&typeof l.end=="number"){let s=0;const i=[g.value];let d=null,u=!1,m=!1;for(;!m&&(d=i.pop());)if(d.nodeType===3){const p=s+d.length;!u&&l.start>=s&&l.start<=p&&(a.setStart(d,l.start-s),u=!0),u&&l.end>=s&&l.end<=p&&(a.setEnd(d,l.end-s),m=!0),s=p}else{let p=d.childNodes.length;for(;p--;)i.push(d.childNodes[p])}return u?Sn(a):null}}catch{return null}return null},nn=(l,o)=>{if(!l||!o)return;const a=o.conversation||[],s=new Set,i=[],d=m=>{m&&m.id&&!s.has(m.id)&&(s.add(m.id),i.push(m))};a.length>0&&a.forEach(m=>{m.user&&d(m.user)}),i.length>0?l.setAttribute("data-comment-user",JSON.stringify(i[0])):l.removeAttribute("data-comment-user"),i.length>1?l.setAttribute("data-comment-user-2",JSON.stringify(i[1])):l.removeAttribute("data-comment-user-2");const u=a.length;u>0?l.setAttribute("data-comment-count",String(u)):l.removeAttribute("data-comment-count")},Tt=(l="unknown")=>{if(!S.richText||!g.value){Wt.value=[];return}Date.now()-Tn.value<al&&It.value!==null||It.value===null&&(It.value=requestAnimationFrame(()=>{if(It.value=null,Tn.value=Date.now(),Do.value)return;Do.value=!0;const a={},s=g.value;if(!s){Do.value=!1;return}const i=s.closest(".editor-with-comments");if(!i){Do.value=!1;return}const d=s.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(k=>{const T=k.getAttribute("data-comment")||k.getAttribute("data-fake-comment");T&&k.tagName==="SPAN"&&(m.has(T)||(u.push(k),m.add(T)))}),d.forEach(k=>{const T=k.getAttribute("data-comment")||k.getAttribute("data-fake-comment");!T||m.has(T)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(k.tagName)?k.querySelector(`span[data-comment="${T}"], span[data-fake-comment="${T}"]`)||(u.push(k),m.add(T)):k.tagName!=="SPAN"&&(u.push(k),m.add(T)))});const p=i.getBoundingClientRect(),h=s.getBoundingClientRect();u.forEach((k,T)=>{let B=k.getAttribute("data-comment")||k.getAttribute("data-fake-comment");if(!B)return;if(typeof B=="string"&&B.startsWith("comment-")){const f=k.textContent?.trim(),C=S.comments?.find(y=>(typeof y.conversation_id=="string"&&y.conversation_id.startsWith("comment-")?null:y.conversation_id)&&y.selection_text?.trim()===f);C?(B=String(C.conversation_id),k.setAttribute("data-comment",B),k.removeAttribute("data-fake-comment")):(B=String(Date.now()),k.setAttribute("data-comment",B),k.removeAttribute("data-fake-comment"))}const L=k.getBoundingClientRect(),F=window.getComputedStyle(k),Q=parseFloat(F.lineHeight)||parseFloat(F.fontSize)*1.2,Te=L.top-h.top+Q/2-15,_e=h.top-p.top+Te;let be=null,Ft=null,mo=0;const po=[],Nn=new Set;if(B&&S.comments){const f=S.comments.find(C=>String(C.conversation_id||C.id)===String(B));if(f){const C=f.conversation||[];C.length>0?(C.forEach(y=>{y.user&&y.user.id&&!Nn.has(y.user.id)&&(Nn.add(y.user.id),po.push(y.user))}),mo=C.length):(mo=0,be=null,Ft=null),po.length>0?be=po[0]:be=null,po.length>1?Ft=po[1]:Ft=null}}const Mn=L.top+Q/2-15,kl=Mn+30,t=5,n=kl>h.top+t&&Mn<h.bottom-t?1:0;Wt.value.find(f=>f.id===B);let c=k;if(!c&&B&&g.value){const f=String(B);c=g.value.querySelector(`[data-comment="${f}"], [data-fake-comment="${f}"]`)}const v=po.length;a[B]?(a[B].top=_e,a[B].opacity=n,a[B].element=c,a[B].firstUser=be,a[B].secondUser=Ft,a[B].totalCount=mo,a[B].uniqueUserCount=v):a[B]={id:B,top:_e,opacity:n,element:c,firstUser:be,secondUser:Ft,totalCount:mo,uniqueUserCount:v}});const x=Object.values(a).map(k=>{const T=Math.max(0,(k.uniqueUserCount??0)-2);if(!k.element&&k.id&&g.value){const L=String(k.id);k.element=g.value.querySelector(`[data-comment="${L}"], [data-fake-comment="${L}"]`)}return{...k,firstUser:k.firstUser||null,secondUser:k.secondUser||null,totalCount:k.totalCount,additionalCount:T}});(Wt.value.length!==x.length||x.some((k,T)=>{const B=Wt.value[T];if(!B)return!0;const L=(B.firstUser?.id||null)!==(k.firstUser?.id||null),F=(B.secondUser?.id||null)!==(k.secondUser?.id||null);return B.id!==k.id||Math.abs(B.top-k.top)>1||B.opacity!==k.opacity||B.totalCount!==k.totalCount||B.additionalCount!==k.additionalCount||L||F||B.element!==k.element}))&&(Wt.value=x),Do.value=!1}))},Wo=l=>{if(!l)return;let o=l.element;if(!o&&l.id&&g.value){const a=String(l.id);o=g.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}o&&(wo(),Kt.value=o,o.classList.add("editor-comment-highlighted"))},wo=(l=!1)=>{!l&&qe.value!==null&&Kt.value&&(Kt.value.getAttribute("data-comment")||Kt.value.getAttribute("data-fake-comment"))===qe.value||(g.value&&g.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Kt.value&&(Kt.value.classList.remove("editor-comment-highlighted"),Kt.value=null))},ln=l=>{if(!l||!l.element)return;wo(!0);const o=l.element.getAttribute("data-comment")||l.element.getAttribute("data-fake-comment");if(!o)return;const a=`[data-comment="${o}"], [data-fake-comment="${o}"]`;ie("comment-marker-clicked",{commentId:o,selector:a,element:l.element})},Cl=()=>{wo()},nl=()=>{!S.richText||!g.value||(Dt.value&&Dt.value.disconnect(),Vt.value!==null&&(clearTimeout(Vt.value),Vt.value=null),Dt.value=new MutationObserver(()=>{Vt.value===null&&(Vt.value=setTimeout(()=>{Vt.value=null,e.nextTick(()=>{Tt("MutationObserver")})},200))}),Dt.value.observe(g.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Tt("setupCommentMarkersObserver-initial"))},ll=(l,o)=>{if(!l||!o)return;const a=o.getBoundingClientRect();let s=a.top,i=a.right+4;l.style.top=`${s}px`,l.style.left=`${i}px`,l.offsetHeight;const d=l.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const p=a.left-d.width-4;l.style.left=`${p}px`}if(d.bottom>m){const p=Math.max(8,m-d.height-8);l.style.top=`${p}px`}d.top<0&&(l.style.top="8px")};return e.watch(()=>rt.value,l=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const s=a.getAttribute("data-submenu-id");if(s===l&&l){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i){if(a.parentNode!==document.body){const d=a.parentNode;a.dataset.originalParentRef=d===i?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{ll(a,i),a.offsetHeight,a.setAttribute("data-active","true"),a.style.visibility="visible",a.style.opacity="1"})})}else a.setAttribute("data-active","true")}else a.setAttribute("data-active","false"),a.style.display="none",a.style.top="",a.style.left="",a.style.visibility="",a.style.opacity=""})})}),e.watch(()=>[Re.value,At.value],()=>{Re.value==="askAi"||At.value==="askAi"?e.nextTick(()=>{Rt()}):(rt.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(o=>{if(o.parentNode===document.body){const a=o.getAttribute("data-submenu-id");if(a){const s=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(s)if(o.dataset.originalParentRef==="inside")s.appendChild(o);else{const d=s.closest(".dss-toolbar-dropdown");d&&d.insertBefore(o,s.nextSibling)}}}})}))}),e.watch(()=>S.locale,l=>{l&&l!==zt.value&&(zt.value=l)},{immediate:!0}),vo({openCommentOverlayForSelector:Se,updateCommentMarkers:Tt,restoreCommentsFromModel:Vn}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",cn.value]),style:e.normalizeStyle(sl.value)},[z.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:o[14]||(o[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Er,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:yn,title:e.unref(H)("textEditor.toolbar.undo")},[...o[45]||(o[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Vr),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Hn.value}]),onClick:Cn,title:e.unref(H)("textEditor.toolbar.redo")},[...o[46]||(o[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Sr),o[73]||(o[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Nr,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[0]||(o[0]=a=>_n("paragraph")),title:e.unref(H)("textEditor.toolbar.paragraphFormat")},[Fe.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Br,[...o[47]||(o[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Tr,[...o[48]||(o[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Hr,[...o[49]||(o[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Ar,[...o[50]||(o[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Lr,[...o[51]||(o[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h6"?(e.openBlock(),e.createElementBlock("svg",$r,[...o[52]||(o[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Dr,[...o[53]||(o[53]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),o[54]||(o[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Mr),Re.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[8]||(o[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[1]||(o[1]=a=>jt("<h1>"))},[o[55]||(o[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[2]||(o[2]=a=>jt("<h2>"))},[o[56]||(o[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[3]||(o[3]=a=>jt("<h3>"))},[o[57]||(o[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[4]||(o[4]=a=>jt("<h4>"))},[o[58]||(o[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[5]||(o[5]=a=>jt("<h5>"))},[o[59]||(o[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[6]||(o[6]=a=>jt("<h6>"))},[o[60]||(o[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[7]||(o[7]=a=>jt("<p>"))},[o[61]||(o[61]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("bold")}]),onClick:o[9]||(o[9]=a=>at("bold")),title:e.unref(H)("textEditor.toolbar.bold")},[...o[62]||(o[62]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Ir),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("italic")}]),onClick:o[10]||(o[10]=a=>at("italic")),title:e.unref(H)("textEditor.toolbar.italic")},[...o[63]||(o[63]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,_r),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("underline")}]),onClick:o[11]||(o[11]=a=>at("underline")),title:e.unref(H)("textEditor.toolbar.underline")},[...o[64]||(o[64]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Rr),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Eo.value}]),onClick:Io,title:e.unref(H)("textEditor.toolbar.citation")},[...o[65]||(o[65]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Fr),o[74]||(o[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ct.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Fn,title:e.unref(H)("textEditor.toolbar.removeLink")},[...o[67]||(o[67]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Pr)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Rn,title:e.unref(H)("textEditor.toolbar.insertLink")},[...o[66]||(o[66]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,zr)),o[75]||(o[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("insertUnorderedList")}]),onClick:zn,title:e.unref(H)("textEditor.toolbar.bulletList")},[...o[68]||(o[68]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Or),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("insertOrderedList")}]),onClick:Pn,title:e.unref(H)("textEditor.toolbar.numberList")},[...o[69]||(o[69]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Zr),o[76]||(o[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Ho,title:e.unref(H)("textEditor.toolbar.image")},[...o[70]||(o[70]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Wr),Ue.value?(e.openBlock(),e.createElementBlock("div",Ur)):e.createCommentVNode("",!0),Ue.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(H)("textEditor.toolbar.comment"),onClick:vt},[...o[71]||(o[71]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,qr)):e.createCommentVNode("",!0),z.askAi?(e.openBlock(),e.createElementBlock("div",Xr)):e.createCommentVNode("",!0),z.askAi?(e.openBlock(),e.createElementBlock("div",Yr,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:o[12]||(o[12]=a=>_n("askAi")),title:e.unref(H)("textEditor.toolbar.askAi")},[o[72]||(o[72]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",Kr,e.toDisplayString(e.unref(H)("textEditor.toolbar.askAi")),1)],8,jr),Re.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[13]||(o[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.customToolbarSlots,(a,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[qt(a)?(e.openBlock(),e.createElementBlock("div",Jr,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),qt(a)&&s<z.customToolbarSlots.length-1&&il(s)?(e.openBlock(),e.createElementBlock("div",Qr)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(Re.value==="paragraph"||Re.value==="askAi")&&z.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Qe})):e.createCommentVNode("",!0),e.createVNode(xl,{showModal:yt.value,width:"500px",height:"55vh",onCloseModal:Po},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(H)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ei,[e.createElementVNode("div",ti,[e.createElementVNode("label",oi,e.toDisplayString(e.unref(H)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ze,type:"text","onUpdate:modelValue":o[15]||(o[15]=a=>Ye.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.link.enterAltText"),onKeyup:e.withKeys(tn,["enter"])},null,40,ni),[[e.vModelText,Ye.value]])]),e.createElementVNode("div",li,[e.createElementVNode("label",ai,e.toDisplayString(e.unref(H)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Ht,type:"text","onUpdate:modelValue":o[16]||(o[16]=a=>$.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.link.enterUrl"),onKeyup:e.withKeys(tn,["enter"])},null,40,si),[[e.vModelText,$.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Po},e.toDisplayString(e.unref(H)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:tn},e.toDisplayString(e.unref(H)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(xl,{showModal:lo.value,width:"500px",height:"80vh",onCloseModal:Zo},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ue.value?e.unref(H)("textEditor.image.editImage"):e.unref(H)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ri,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":nt.value==="upload"}]),onClick:o[17]||(o[17]=a=>nt.value="upload")},e.toDisplayString(e.unref(H)("textEditor.image.upload")),3),o[77]||(o[77]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":nt.value==="url"}]),onClick:o[18]||(o[18]=a=>nt.value="url")},e.toDisplayString(e.unref(H)("textEditor.image.imageLink")),3)]),nt.value==="upload"?(e.openBlock(),e.createElementBlock("div",ii,[e.createElementVNode("div",ci,[e.createElementVNode("div",ui,[mn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",di,e.toDisplayString(e.unref(H)("textEditor.image.uploadImage")),1)),mn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Qn},[e.createElementVNode("img",{src:kt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,mi),o[78]||(o[78]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:Lt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:on},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Lt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:on},null,544))]),e.createElementVNode("div",pi,[e.createElementVNode("label",fi,e.toDisplayString(e.unref(H)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Ae,type:"text","onUpdate:modelValue":o[19]||(o[19]=a=>Ct.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.enterAltText"),onKeyup:e.withKeys(no,["enter"])},null,40,vi),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",hi,[e.createElementVNode("label",gi,e.toDisplayString(e.unref(H)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[20]||(o[20]=a=>Je.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.auto"),onKeyup:e.withKeys(no,["enter"]),onInput:Oo},null,40,yi),[[e.vModelText,Je.value]])]),e.createElementVNode("div",Ci,[e.createElementVNode("label",ki,e.toDisplayString(e.unref(H)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[21]||(o[21]=a=>Ce.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.auto"),onKeyup:e.withKeys(no,["enter"]),onInput:el},null,40,xi),[[e.vModelText,Ce.value]])])])])):e.createCommentVNode("",!0),nt.value==="url"?(e.openBlock(),e.createElementBlock("div",wi,[e.createElementVNode("div",bi,[e.createElementVNode("div",Ei,[e.createElementVNode("label",Vi,e.toDisplayString(e.unref(H)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Vo,type:"text","onUpdate:modelValue":o[22]||(o[22]=a=>Ke.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(no,["enter"])},null,40,Si),[[e.vModelText,Ke.value]])]),e.createElementVNode("div",Ni,[e.createElementVNode("label",Mi,e.toDisplayString(e.unref(H)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":o[23]||(o[23]=a=>Ct.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.enterAltText"),onKeyup:e.withKeys(no,["enter"])},null,40,Bi),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",Ti,[e.createElementVNode("label",Hi,e.toDisplayString(e.unref(H)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[24]||(o[24]=a=>Je.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.auto"),onKeyup:e.withKeys(no,["enter"]),onInput:Oo},null,40,Ai),[[e.vModelText,Je.value]])]),e.createElementVNode("div",Li,[e.createElementVNode("label",$i,e.toDisplayString(e.unref(H)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[25]||(o[25]=a=>Ce.value=a),class:"dss-link-modal-input",placeholder:e.unref(H)("textEditor.image.auto"),onKeyup:e.withKeys(no,["enter"]),onInput:el},null,40,Di),[[e.vModelText,Ce.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Zo},e.toDisplayString(e.unref(H)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:no},e.toDisplayString(e.unref(H)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":fn.value&&Et.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(H)("textEditor.labels.title")),1),e.createElementVNode("div",Ii,[Et.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",_i,[z.title?(e.openBlock(),e.createElementBlock("span",Ri,e.toDisplayString(z.title),1)):(e.openBlock(),e.createElementBlock("span",Fi,e.toDisplayString(pn.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:se,value:z.title,onInput:A,onFocus:so,onBlur:ne,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Et.value}]),placeholder:pn.value,disabled:z.disabled,rows:"1"},null,42,zi)])],2),fn.value&&Et.value?(e.openBlock(),e.createElementBlock("div",Pi,[e.renderSlot(l.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Yo.value&&Zt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(H)("textEditor.labels.description")),1),e.createElementVNode("div",Oi,[Zt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Zi,[z.description?(e.openBlock(),e.createElementBlock("span",Wi,e.toDisplayString(z.description),1)):(e.openBlock(),e.createElementBlock("span",Ui,e.toDisplayString(Ln.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Ne,value:z.description,onInput:No,onFocus:X,onBlur:ul,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!Zt.value}]),placeholder:Ln.value,disabled:z.disabled,rows:"1"},null,42,qi)])],2),Yo.value&&Zt.value?(e.openBlock(),e.createElementBlock("div",Xi,[e.renderSlot(l.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":qe.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:s=>Wo(a),onMouseleave:Cl},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(s=>ln(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Ki)):(e.openBlock(),e.createElementBlock("span",Gi,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,ji)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(s=>ln(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Qi)):(e.openBlock(),e.createElementBlock("span",ec,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Ji)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(s=>ln(a),["stop"])},[e.createElementVNode("span",oc,"+"+e.toDisplayString(a.additionalCount),1)],12,tc)):e.createCommentVNode("",!0)],46,Yi))),128)),z.richText?(e.openBlock(),e.createElementBlock("div",cc,[e.createElementVNode("div",{ref_key:"editorRef",ref:g,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":z.disabled,"dss-text-editor-fixed-height":z.fixedHeight}]),style:e.normalizeStyle(dn.value),onInput:fe,onBlur:dl,onClick:jn,onMouseup:Kn,onKeyup:Kn,onKeydown:_o,onPaste:Un,onMousemove:vl,onMouseleave:xn},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[qe.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(Mo.value)},[io.value||$e.value.length>0?(e.openBlock(),e.createElementBlock("div",uc,[e.createElementVNode("div",dc,[io.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:io.value},null,8,mc)):e.createCommentVNode("",!0)]),e.createElementVNode("div",pc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(a,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",fc,[e.createElementVNode("div",vc,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,hc)):(e.openBlock(),e.createElementBlock("span",gc,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",yc,[e.createElementVNode("div",Cc,[e.createElementVNode("div",kc,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",xc,e.toDisplayString(Ee(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":U(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),S.commentUser&&a.user&&a.user.id===S.commentUser.id&&!U(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(i=>Be(a,s),["stop"]),title:e.unref(H)("textEditor.comment.delete")||"Delete comment"},[...o[80]||(o[80]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,wc)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",bc,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Mt,"onUpdate:modelValue":o[26]||(o[26]=a=>Gt.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(H)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Jt,["prevent","stop"]),["enter"]),onInput:o[27]||(o[27]=()=>{if(Mt.value){const a=Mt.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,Ec),[[e.vModelText,Gt.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Jt,["stop"])},[...o[81]||(o[81]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Vc,[e.createElementVNode("div",Sc,[e.createElementVNode("span",Nc,e.toDisplayString(St.value)+" "+e.toDisplayString(St.value===1?e.unref(H)("textEditor.footer.word"):e.unref(H)("textEditor.footer.words")),1),o[82]||(o[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Mc,e.toDisplayString(qo.value)+" "+e.toDisplayString(qo.value===1?e.unref(H)("textEditor.footer.character"):e.unref(H)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",nc,[e.createElementVNode("textarea",{value:z.modelValue,onInput:hn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":z.fixedHeight}]),placeholder:rl.value,rows:z.rows,disabled:z.disabled,style:e.normalizeStyle(un.value)},null,46,lc),e.createElementVNode("div",ac,[e.createElementVNode("div",sc,[e.createElementVNode("span",rc,e.toDisplayString(St.value)+" "+e.toDisplayString(St.value===1?e.unref(H)("textEditor.footer.word"):e.unref(H)("textEditor.footer.words")),1),o[79]||(o[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",ic,e.toDisplayString(qo.value)+" "+e.toDisplayString(qo.value===1?e.unref(H)("textEditor.footer.character"):e.unref(H)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[D.value&&le.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ke.value),onMouseenter:o[28]||(o[28]=a=>gt.value=!0),onMouseleave:zo},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Gn,["stop"]),title:le.value},e.toDisplayString(le.value),9,Bc),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(bn,["stop"]),title:e.unref(H)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Hc,[...o[83]||(o[83]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Tc)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Pt.value&&So.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Bn.value),onMouseenter:o[29]||(o[29]=a=>We.value=!0),onMouseleave:ye},[e.createElementVNode("div",Ac,[So.value===e.unref(H)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Lc,[...o[84]||(o[84]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:So.value},e.toDisplayString(So.value),9,$c)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(gl,["stop"]),title:e.unref(H)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",Ic,[...o[85]||(o[85]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Dc)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[z.floatingToolbar&&z.richText&&xe.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Ao,class:"dss-floating-toolbar",style:e.normalizeStyle(rn.value),onMousedown:o[44]||(o[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",_c,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(yn,["stop"]),title:e.unref(H)("textEditor.toolbar.undo")},[...o[86]||(o[86]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Rc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Hn.value}]),onClick:e.withModifiers(Cn,["stop"]),title:e.unref(H)("textEditor.toolbar.redo")},[...o[87]||(o[87]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Fc),o[107]||(o[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",zc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[30]||(o[30]=e.withModifiers(a=>uo("paragraph"),["stop"])),title:e.unref(H)("textEditor.toolbar.paragraphFormat")},[Fe.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Oc,[...o[88]||(o[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Zc,[...o[89]||(o[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Wc,[...o[90]||(o[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Uc,[...o[91]||(o[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h5"?(e.openBlock(),e.createElementBlock("svg",qc,[...o[92]||(o[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):Fe.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Xc,[...o[93]||(o[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Yc,[...o[94]||(o[94]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),o[95]||(o[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Pc),At.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[38]||(o[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[31]||(o[31]=a=>he("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[32]||(o[32]=a=>he("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[33]||(o[33]=a=>he("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[34]||(o[34]=a=>he("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[35]||(o[35]=a=>he("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[36]||(o[36]=a=>he("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[37]||(o[37]=a=>he("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(H)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),o[108]||(o[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("bold")}]),onClick:o[39]||(o[39]=e.withModifiers(a=>at("bold"),["stop"])),title:e.unref(H)("textEditor.toolbar.bold")},[...o[96]||(o[96]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,jc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("italic")}]),onClick:o[40]||(o[40]=e.withModifiers(a=>at("italic"),["stop"])),title:e.unref(H)("textEditor.toolbar.italic")},[...o[97]||(o[97]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Kc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("underline")}]),onClick:o[41]||(o[41]=e.withModifiers(a=>at("underline"),["stop"])),title:e.unref(H)("textEditor.toolbar.underline")},[...o[98]||(o[98]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Gc),o[109]||(o[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Eo.value}]),onClick:e.withModifiers(Io,["stop"]),title:e.unref(H)("textEditor.toolbar.citation")},[...o[99]||(o[99]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Jc),o[110]||(o[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ct.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Fn,["stop"]),title:e.unref(H)("textEditor.toolbar.removeLink")},[...o[101]||(o[101]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,eu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Rn,["stop"]),title:e.unref(H)("textEditor.toolbar.insertLink")},[...o[100]||(o[100]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Qc)),o[111]||(o[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("insertUnorderedList")}]),onClick:e.withModifiers(zn,["stop"]),title:e.unref(H)("textEditor.toolbar.bulletList")},[...o[102]||(o[102]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st("insertOrderedList")}]),onClick:e.withModifiers(Pn,["stop"]),title:e.unref(H)("textEditor.toolbar.numberList")},[...o[103]||(o[103]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,ou),o[112]||(o[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Ho,["stop"]),title:e.unref(H)("textEditor.toolbar.image")},[...o[104]||(o[104]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,nu),o[113]||(o[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(H)("textEditor.toolbar.comment"),onClick:e.withModifiers(vt,["stop"])},[...o[105]||(o[105]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,lu),z.askAi?(e.openBlock(),e.createElementBlock("div",au)):e.createCommentVNode("",!0),z.askAi?(e.openBlock(),e.createElementBlock("div",su,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:o[42]||(o[42]=e.withModifiers(a=>uo("askAi"),["stop"])),title:e.unref(H)("textEditor.toolbar.askAi")},[o[106]||(o[106]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",iu,e.toDisplayString(e.unref(H)("textEditor.toolbar.askAi")),1)],8,ru),At.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[43]||(o[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Dn.value?(e.openBlock(),e.createElementBlock("div",cu,[z.askAi&&Dn.value?(e.openBlock(),e.createElementBlock("div",uu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.customToolbarSlots,(a,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[qt(a)&&Xo(a)?(e.openBlock(),e.createElementBlock("div",du,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),qt(a)&&Xo(a)&&s<z.customToolbarSlots.length-1&&$n(s)?(e.openBlock(),e.createElementBlock("div",mu)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),vu={contextMenu:{addMarker:"Add Marker",clearAllMarkers:"Clear All Markers",downloadSvg:"Download SVG",downloadPng:"Download PNG",downloadCsv:"Download CSV"},modalMarker:{editMarker:"Edit Marker",viewMarker:"View Marker",title:"Title",description:"Description",iconType:"Icon Type",defaultIcon:"Default Logo",iconPreview:"Icon Preview",deleteMarker:"Delete Marker",cancel:"Cancel",close:"Close",save:"Save",placeholderTitle:"Enter marker title",placeholderDescription:"Enter marker description (optional)"},zoom:{doubleClickToReset:"(Double-click to reset)"},csv:{chartTitle:"Chart Title",chartSubtitle:"Chart Subtitle",generated:"Generated"},fallback:{item:"Item",axis:"Axis"},tooltip:{flags:"Flags",markers:"Markers",manualFlags:"Manual Flags",autoFlags:"Auto Flags"}},hu={toolbar:{undo:"Undo",redo:"Redo",paragraphFormat:"Paragraph Format",bold:"Bold",italic:"Italic",underline:"Underline",citation:"Citation",insertLink:"Insert Link",removeLink:"Remove Link",bulletList:"Bullet List",numberList:"Number List",image:"Image",comment:"Comment",askAi:"Ask AI"},paragraph:{heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph"},link:{editLink:"Edit Link",altText:"Alt text:",url:"URL:",enterAltText:"Enter alt text...",enterUrl:"Enter URL...",cancel:"Cancel",save:"Save"},image:{addImage:"Add Image",editImage:"Edit Image",upload:"Upload",imageLink:"Image Link",uploadImage:"Upload image:",imageUrl:"Image URL:",altText:"Alt text:",width:"Width (px):",height:"Height (px):",enterAltText:"Enter alt text...",enterImageUrl:"https://example.com/image.jpg",auto:"Auto",noAlt:"No alt",cancel:"Cancel",save:"Save"},comment:{placeholder:"Add a comment",send:"Send",delete:"Delete comment"},started_conversation:"Started conversation",labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},Vl={chart:vu,textEditor:hu},gu={contextMenu:{addMarker:"Ajouter un marqueur",clearAllMarkers:"Effacer tous les marqueurs",downloadSvg:"Télécharger SVG",downloadPng:"Télécharger PNG",downloadCsv:"Télécharger CSV"},modalMarker:{editMarker:"Modifier le marqueur",viewMarker:"Voir le marqueur",title:"Titre",description:"Description",iconType:"Type d'icône",defaultIcon:"Logo par défaut",iconPreview:"Aperçu de l'icône",deleteMarker:"Supprimer le marqueur",cancel:"Annuler",close:"Fermer",save:"Enregistrer",placeholderTitle:"Entrez le titre du marqueur",placeholderDescription:"Entrez la description du marqueur (optionnel)"},zoom:{doubleClickToReset:"(Double-cliquez pour réinitialiser)"},csv:{chartTitle:"Titre du graphique",chartSubtitle:"Sous-titre du graphique",generated:"Généré"},fallback:{item:"Élément",axis:"Axe"},tooltip:{flags:"Drapeaux",markers:"Marqueurs",manualFlags:"Drapeaux manuels",autoFlags:"Drapeaux automatiques"}},yu={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},Sl={chart:gu,textEditor:yu},Cu={contextMenu:{addMarker:"Markering toevoegen",clearAllMarkers:"Alle markeringen wissen",downloadSvg:"SVG downloaden",downloadPng:"PNG downloaden",downloadCsv:"CSV downloaden"},modalMarker:{editMarker:"Markering bewerken",viewMarker:"Markering bekijken",title:"Titel",description:"Beschrijving",iconType:"Pictogramtype",defaultIcon:"Standaard logo",iconPreview:"Pictogramvoorbeeld",deleteMarker:"Markering verwijderen",cancel:"Annuleren",close:"Sluiten",save:"Opslaan",placeholderTitle:"Voer markeringstitel in",placeholderDescription:"Voer markeringsbeschrijving in (optioneel)"},zoom:{doubleClickToReset:"(Dubbelklik om te resetten)"},csv:{chartTitle:"Grafiek titel",chartSubtitle:"Grafiek ondertitel",generated:"Gegenereerd"},fallback:{item:"Item",axis:"As"},tooltip:{flags:"Vlaggen",markers:"Markeringen",manualFlags:"Handmatige vlaggen",autoFlags:"Automatische vlaggen"}},ku={toolbar:{undo:"Ongedaan maken",redo:"Opnieuw",paragraphFormat:"Alineaopmaak",bold:"Vet",italic:"Cursief",underline:"Onderstreept",citation:"Citaat",insertLink:"Link invoegen",removeLink:"Link verwijderen",bulletList:"Lijst met opsommingstekens",numberList:"Genummerde lijst",image:"Afbeelding",comment:"Commentaar",askAi:"Vraag AI"},paragraph:{heading1:"Kop 1",heading2:"Kop 2",heading3:"Kop 3",heading4:"Kop 4",heading5:"Kop 5",heading6:"Kop 6",paragraph:"Alinea"},link:{editLink:"Link bewerken",altText:"Alt-tekst:",url:"URL:",enterAltText:"Voer alt-tekst in...",enterUrl:"Voer URL in...",cancel:"Annuleren",save:"Opslaan"},image:{addImage:"Afbeelding toevoegen",editImage:"Afbeelding bewerken",upload:"Uploaden",imageLink:"Afbeeldingslink",uploadImage:"Afbeelding uploaden:",imageUrl:"Afbeeldings-URL:",altText:"Alt-tekst:",width:"Breedte (px):",height:"Hoogte (px):",enterAltText:"Voer alt-tekst in...",enterImageUrl:"https://voorbeeld.com/afbeelding.jpg",auto:"Auto",noAlt:"Geen alt-tekst",cancel:"Annuleren",save:"Opslaan"},comment:{placeholder:"Voeg een opmerking toe",send:"Verzenden",delete:"Opmerking verwijderen"},started_conversation:"Gesprek gestart",labels:{title:"Titel",description:"Beschrijving"},placeholders:{title:"Voer titel in...",description:"Voer beschrijving in...",startTyping:"Begin met typen..."},footer:{word:"woord",words:"woorden",character:"teken",characters:"tekens"}},Nl={chart:Cu,textEditor:ku},wl={en:Vl,fr:Sl,nl:Nl};function xu(z){if(!z||!z.global)return;const vo=z.global.availableLocales||[];Object.keys(wl).forEach(J=>{vo.includes(J)&&z.global.mergeLocaleMessage(J,wl[J])})}const bl={en:{textEditor:Vl.textEditor},fr:{textEditor:Sl.textEditor},nl:{textEditor:Nl.textEditor}};function wu(z){if(!z||!z.global)return;const vo=z.global.availableLocales||[];Object.keys(bl).forEach(J=>{vo.includes(J)&&z.global.mergeLocaleMessage(J,bl[J])})}const bu={en:{...Vl},fr:{...Sl},nl:{...Nl}};El.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:bu});exports.DSSChart=xr;exports.DSSChartMessages=wl;exports.DSSModal=xl;exports.DSSTextEditor=fu;exports.DSSTextEditorMessages=bl;exports.addDSSChartTranslations=xu;exports.addDSSTextEditorTranslations=wu;
|