dsp-semactic 0.5.49 → 0.5.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/index.cjs.js +10 -10
- package/dist/index.es.js +1085 -1085
- package/package.json +48 -48
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Yn=require("vue-i18n"),Qn=["data-chart-type"],Jn={class:"dss-chart-header"},el={class:"dss-chart-header-titles"},tl={key:0,class:"dss-chart-title"},ol={key:1,class:"dss-chart-subtitle"},nl=["onClick","onMouseenter"],ll={class:"dss-legend-text"},al=["onClick","onMouseenter"],sl={class:"dss-legend-text"},rl=["title"],il=["src"],cl=["width","height","data-smooth","data-animated"],dl={id:"chart-clip"},ul=["x","y","width","height"],ml={key:0},pl={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},fl=["x1","x2","y1","y2"],vl={class:"dss-axes"},gl=["x1","x2","y1","y2"],hl=["x1","x2","y1","y2"],yl={class:"dss-axis-labels"},Cl=["x","y"],kl=["x","y"],xl=["x","y"],wl=["y","transform"],bl={key:1,class:"dss-flag-markers"},El={"clip-path":"url(#chart-clip)"},Vl=["x1","x2","y1","y2","onMouseover"],Sl=["x1","x2","y1","y2","onMouseover"],Nl=["x1","x2","y1","y2","onMouseover"],Ml=["cx","cy","onMouseover"],Bl=["cx","cy","fill","onMouseover"],Hl=["x","y"],Tl={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Al={key:0},Ll={class:"dss-bar-chart"},$l=["d","onMouseover"],Dl=["x","y","width","height","fill","onMouseover"],Il={class:"dss-line-chart"},Rl=["d","stroke","stroke-width"],_l=["d","stroke","stroke-width","opacity"],Fl=["cx","cy","r","fill","onMouseover"],zl={key:1},Pl=["d","stroke","stroke-width"],Ol=["d","stroke","stroke-width"],Zl=["d","stroke","stroke-width","opacity"],Ul=["cx","cy","r","fill","onMouseover"],ql={key:2},Wl=["id"],Xl=["x","y","width","height"],Yl=["d","fill","fill-opacity","mask"],jl=["d","stroke","stroke-width"],Kl={key:3},Gl=["d","fill","onMouseover"],Ql=["x","y","width","height","onMouseover"],Jl={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},ea=["x1","x2","y1","y2","stroke"],ta=["cx","cy","r","fill"],oa={key:1,class:"dss-bubble-chart"},na={key:0,class:"dss-bubble-group"},la=["cx","cy","r","fill","fill-opacity","stroke","stroke-width","onMouseenter","onMouseleave","onClick"],aa=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],sa={key:2,class:"radial-chart"},ra=["cx","cy","r"],ia=["data-chart-type"],ca=["d","fill","fill-opacity","stroke","stroke-width","onMouseover"],da={key:1,class:"dss-radial-labels"},ua=["x1","y1","x2","y2","stroke"],ma=["x1","y1","x2","y2","stroke"],pa=["x","y","text-anchor","font-size"],fa={key:3,class:"dss-spider-chart"},va={key:0,class:"dss-spider-grid"},ga=["cx","cy","r"],ha={class:"dss-spider-grid-labels"},ya=["x","y"],Ca=["x","y"],ka=["x1","x2","y1","y2"],xa={class:"dss-spider-labels"},wa=["x","y","text-anchor","dominant-baseline"],ba=["points","fill","fill-opacity","stroke","stroke-width"],Ea=["cx","cy","r","fill","onMouseover"],Va={class:"dss-chart-logos"},Sa=["cx","cy","r","fill"],Na=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Ma=["onClick","onMouseenter"],Ba=["src"],Ha={class:"dss-marker-tooltip-category"},Ta={key:0,class:"dss-marker-tooltip-description"},Aa={key:0,class:"dss-tooltip-section"},La={key:0,class:"dss-tooltip-title"},$a={class:"dss-tooltip-series-name"},Da={class:"dss-tooltip-series-value"},Ia={key:1,class:"dss-tooltip-section"},Ra={class:"dss-tooltip-title"},_a={class:"dss-tooltip-value"},Fa={key:0,class:"dss-tooltip-section"},za={class:"dss-tooltip-section-title"},Pa={class:"dss-tooltip-group-header"},Oa={class:"dss-tooltip-item-content"},Za={class:"dss-tooltip-item-text"},Ua={key:1,class:"dss-tooltip-section"},qa={class:"dss-tooltip-section-title"},Wa={class:"dss-tooltip-item-content"},Xa={class:"dss-tooltip-item-title"},Ya={key:0,class:"dss-tooltip-item-description"},ja={class:"dss-tooltip-section"},Ka={class:"dss-tooltip-title"},Ga={key:0,class:"dss-bubble-tooltip-data"},Qa={class:"dss-tooltip-series-name"},Ja={class:"dss-tooltip-series-value"},es={key:0,class:"dss-tooltip-section"},ts={class:"dss-tooltip-section-title"},os={class:"dss-tooltip-group-header"},ns={class:"dss-tooltip-item-content"},ls={class:"dss-tooltip-item-text"},as={key:1,class:"dss-tooltip-section"},ss={class:"dss-tooltip-section-title"},rs={class:"dss-tooltip-item-content"},is={class:"dss-tooltip-item-title"},cs={key:0,class:"dss-tooltip-item-description"},ds={key:1,class:"dss-context-menu-separator"},us={key:0,class:"dss-context-menu-separator"},ms={key:0,class:"dss-context-menu-separator"},ps=["onClick"],fs=["innerHTML"],vs={key:0,class:"dss-context-menu-icon"},gs={class:"dss-marker-modal-header"},hs={class:"dss-marker-modal-body"},ys={class:"dss-form-group"},Cs={key:0},ks={key:1},xs=["disabled"],ws=["value"],bs={class:"dss-form-group"},Es={for:"dss-marker-description"},Vs={key:0,class:"dss-form-text-display"},Ss=["placeholder"],Ns={class:"dss-form-group"},Ms={class:"icon-preview"},Bs=["src"],Hs={class:"dss-marker-modal-footer"},Ts={class:"modal-footer-left"},As={class:"dss-modal-footer-right"},Ls=["disabled"],$s={name:"DSSChart"},Ds=Object.assign($s,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==null}},emits:["add-marker","update-marker","delete-marker"],setup(T,{emit:Wt}){const{t:O,locale:V}=Yn.useI18n(),vt=Wt,x=e.ref(null),K=e.ref(null),Bt=e.computed(()=>{if(!x.value||!K.value)return 0;try{const t=x.value.getBoundingClientRect();return K.value.getBoundingClientRect().top-t.top}catch{return 0}}),S=T,g={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 De(t,n){const o=Object.assign({},t);return Qe(t)&&Qe(n)&&Object.keys(n).forEach(s=>{Qe(n[s])?s in t?o[s]=De(t[s],n[s]):Object.assign(o,{[s]:n[s]}):Object.assign(o,{[s]:n[s]})}),o}const ze=()=>{let t=20,n=0,o=0;if(oe.value&&(t+=30),ne.value&&(t+=25),xe.value&&S.series.length>0){const s=S.series.filter((d,u)=>!pe.value.has(u)).length;if(Ae.value==="top"||Ae.value==="bottom"){if(vo.value==="horizontal"){const u=Math.floor(I.value/100);n=Math.ceil(s/u)*25+10}else n=s*25+10;t+=n}else o=150}return{height:t,legendHeight:n,legendWidth:o}};function Qe(t){return t&&typeof t=="object"&&!Array.isArray(t)}const M=e.computed(()=>De(g,S.options)),I=e.computed(()=>{const t=M.value;return t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),X=e.computed(()=>{const t=M.value;return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),W=e.computed(()=>{const t=M.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),st=e.computed(()=>{const t=S.series.map(n=>n.type||W.value);return new Set(t).size>1}),oe=e.computed(()=>{const t=M.value;return t&&t.title&&t.title.text?t.title.text:""}),ne=e.computed(()=>{const t=M.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),rt=e.computed(()=>{const t=M.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Vo=e.computed(()=>{const t=M.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),fe=e.computed(()=>{const t=M.value;if(!t||!t.yAxis)return Nt;const n=t.yAxis.min;return typeof n=="number"||n===Nt?n:Nt}),Ht=e.computed(()=>{const t=M.value;if(!t||!t.yAxis)return Nt;const n=t.yAxis.max;return typeof n=="number"||n===Nt?n:Nt}),Xt=e.computed(()=>{const t=M.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),ro=e.computed(()=>{const t=M.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),q=e.computed(()=>{const t=M.value;return t&&t.grid&&t.grid.show!==!1}),xe=e.computed(()=>{const t=M.value;return t&&t.legend&&t.legend.show!==!1}),Ae=e.computed(()=>{const t=M.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),vo=e.computed(()=>{const t=M.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Le=e.computed(()=>{const t=M.value;if(!t||!t.crosshair)return!1;const n=t.crosshair.show;return n===!0||n==="true"}),go=e.computed(()=>{const t=M.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ue=e.computed(()=>{const t=M.value;return t&&t.zoom&&t.zoom.enabled!==!1}),So=e.computed(()=>{const t=M.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),it=e.computed(()=>{const t=M.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),de=e.computed(()=>{const t=M.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),me=e.computed(()=>{const t=M.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Tt=e.computed(()=>{const{maxX:t}=ye.value;return t===0}),Je=(t,n)=>Tt.value&&n===0?5:n,ho=e.computed(()=>{const t=M.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),G=e.computed(()=>{const t=M.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),At=e.computed(()=>{const t=M.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),yo=e.computed(()=>{const t=M.value;return G.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),io=e.computed(()=>{const t=M.value,n=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return n.length>0?n:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Yt=e.computed(()=>{const t=M.value;return t&&t.animations&&t.animations.enabled!==!1}),jt=e.computed(()=>{const t=M.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Pe=e.computed(()=>{const t=M.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Lt=e.computed(()=>{const t=M.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),We=e.computed(()=>{const t=M.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),we=e.computed(()=>{const t=M.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),ct=e.computed(()=>{const t=M.value;return t&&t.animations&&t.animations.onDataChange!==!1}),co=e.computed(()=>{const t=M.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Z=e.computed(()=>{const t=M.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),ie=e.computed(()=>M.value?.spider?.gridSteps||5),Xe=e.computed(()=>{const t=[],n=ie.value;for(let o=1;o<=n;o++)t.push(Y.value/n*o);return t}),$t=t=>{const n=dt.value;if(n&&Array.isArray(n)&&n[t]!==void 0)return n[t].toString();const o=Xe.value[t];return Math.round(o/Y.value*100)+"%"},dt=e.computed(()=>M.value?.spider?.gridLabels||null);e.computed(()=>{const t=M.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0});const he=e.computed(()=>{const t=M.value,n={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...n,...t.contextMenu.items}:n}),Ye=e.computed(()=>{const t=M.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),et=e.computed(()=>{const t=M.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Co.value}),te=e.computed(()=>{const t=M.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),le=e.computed(()=>{const t=M.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),gt=e.computed(()=>!w.value.isZooming);e.computed(()=>Ee.value.map(t=>{if(t.categoryIndex!==void 0&&(Te.value||Ne.value)){const n=Ce(t.categoryIndex),o=Bt.value+C.value.bottom-le.value/2;return{...t,x:n,y:o}}return t}));function Fo(t,n){const o=new Date(t);let s=0,d=1/0;return n.forEach((u,m)=>{const[f,v,h]=u.split("-"),y=new Date(`20${h}`,v-1,f),k=Math.abs(y-o);k<d&&(d=k,s=m)}),s}const ht=e.computed(()=>{const t=S.markers.map(o=>{const s=Fo(o.marker_date,S.categories),d=Ce(s),u=Bt.value+C.value.bottom-le.value/2;return{...o,x:d,y:u,categoryIndex:s,source:"props"}}),n=Ee.value.map(o=>{if(o.categoryIndex!==void 0&&(Te.value||Ne.value)){const s=Ce(o.categoryIndex),d=Bt.value+C.value.bottom-le.value/2;return{...o,x:s,y:d,source:"internal"}}return{...o,source:"internal"}});return[...t,...n]}),tt=e.computed(()=>{const t=M.value;return t&&t.watermark&&t.watermark.enabled===!0}),ut=e.computed(()=>{const t=M.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),be=e.computed(()=>{const t=M.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:"25%"}),yt=e.computed(()=>{const t=M.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Ct=e.computed(()=>{const t={left:C.value.left,top:C.value.top,width:C.value.width,height:C.value.height};let n,o;const s=String(be.value);if(s.includes("%")){const d=parseFloat(s)/100;n=t.width*d,o=n*(96/499)}else{const d=parseFloat(s)||25;n=Math.min(t.width*.25,200)*(d/25),o=n*(96/499)}return{width:n,height:o,area:t}}),kt=e.computed(()=>{const{width:t,height:n}=Ct.value,o=yt.value;let s,d;const u=C.value.left,m=C.value.right,f=C.value.top,v=C.value.bottom,h=C.value.width,y=C.value.height;switch(o){case"center":s=u+(h-t)/2,d=f+(y-n)/2;break;case"top-left":s=u+15,d=f+90;break;case"top-right":s=m-t-15,d=f+90;break;case"bottom-left":s=u+15,d=v-n+75;break;case"bottom-right":default:s=m-t-15,d=v-n+75;break}return{backgroundPositionX:s+"px",backgroundPositionY:d+"px",backgroundSize:`${t}px ${n}px`}}),Kt=t=>!S.flags||!S.flags.length?[]:S.flags.filter(n=>n.categoryIndex===t),mt=t=>{const n=Kt(t),o=Dn(t),s=n.filter(m=>m.manual),d=n.filter(m=>!m.manual),u=[];return s.length>0&&u.push({type:O("chart.tooltip.manualFlags"),color:"#047395",flags:s.map(m=>({text:m.text,color:"#047395"}))}),d.length>0&&u.push({type:O("chart.tooltip.autoFlags"),color:"#0dbf89",flags:d.map(m=>({text:m.text,color:"#0dbf89"}))}),{flagGroups:u,markers:o.map(m=>({title:m.title,description:m.description,type:O("chart.tooltip.markers"),color:m.color||"#FF6B6B"}))}},Co=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"),Yn=require("vue-i18n"),Qn=["data-chart-type"],Jn={class:"dss-chart-header"},el={class:"dss-chart-header-titles"},tl={key:0,class:"dss-chart-title"},ol={key:1,class:"dss-chart-subtitle"},nl=["onClick","onMouseenter"],ll={class:"dss-legend-text"},al=["onClick","onMouseenter"],sl={class:"dss-legend-text"},rl=["title"],il=["src"],cl=["width","height","data-smooth","data-animated"],dl={id:"chart-clip"},ul=["x","y","width","height"],ml={key:0},pl={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},fl=["x1","x2","y1","y2"],vl={class:"dss-axes"},gl=["x1","x2","y1","y2"],hl=["x1","x2","y1","y2"],yl={class:"dss-axis-labels"},Cl=["x","y"],kl=["x","y"],xl=["x","y"],wl=["y","transform"],bl={key:1,class:"dss-flag-markers"},El={"clip-path":"url(#chart-clip)"},Vl=["x1","x2","y1","y2","onMouseover"],Sl=["x1","x2","y1","y2","onMouseover"],Nl=["x1","x2","y1","y2","onMouseover"],Ml=["cx","cy","onMouseover"],Bl=["cx","cy","fill","onMouseover"],Hl=["x","y"],Tl={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Al={key:0},Ll={class:"dss-bar-chart"},$l=["d","onMouseover"],Dl=["x","y","width","height","fill","onMouseover"],Il={class:"dss-line-chart"},_l=["d","stroke","stroke-width"],Rl=["d","stroke","stroke-width","opacity"],Fl=["cx","cy","r","fill","onMouseover"],zl={key:1},Pl=["d","stroke","stroke-width"],Ol=["d","stroke","stroke-width"],Zl=["d","stroke","stroke-width","opacity"],Ul=["cx","cy","r","fill","onMouseover"],ql={key:2},Wl=["id"],Xl=["x","y","width","height"],Yl=["d","fill","fill-opacity","mask"],jl=["d","stroke","stroke-width"],Kl={key:3},Gl=["d","fill","onMouseover"],Ql=["x","y","width","height","onMouseover"],Jl={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},ea=["x1","x2","y1","y2","stroke"],ta=["cx","cy","r","fill"],oa={key:1,class:"dss-bubble-chart"},na={key:0,class:"dss-bubble-group"},la=["cx","cy","r","fill","fill-opacity","stroke","stroke-width","onMouseenter","onMouseleave","onClick"],aa=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],sa={key:2,class:"radial-chart"},ra=["cx","cy","r"],ia=["data-chart-type"],ca=["d","fill","fill-opacity","stroke","stroke-width","onMouseover"],da={key:1,class:"dss-radial-labels"},ua=["x1","y1","x2","y2","stroke"],ma=["x1","y1","x2","y2","stroke"],pa=["x","y","text-anchor","font-size"],fa={key:3,class:"dss-spider-chart"},va={key:0,class:"dss-spider-grid"},ga=["cx","cy","r"],ha={class:"dss-spider-grid-labels"},ya=["x","y"],Ca=["x","y"],ka=["x1","x2","y1","y2"],xa={class:"dss-spider-labels"},wa=["x","y","text-anchor","dominant-baseline"],ba=["points","fill","fill-opacity","stroke","stroke-width"],Ea=["cx","cy","r","fill","onMouseover"],Va={class:"dss-chart-logos"},Sa=["cx","cy","r","fill"],Na=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Ma=["onClick","onMouseenter"],Ba=["src"],Ha={class:"dss-marker-tooltip-category"},Ta={key:0,class:"dss-marker-tooltip-description"},Aa={key:0,class:"dss-tooltip-section"},La={key:0,class:"dss-tooltip-title"},$a={class:"dss-tooltip-series-name"},Da={class:"dss-tooltip-series-value"},Ia={key:1,class:"dss-tooltip-section"},_a={class:"dss-tooltip-title"},Ra={class:"dss-tooltip-value"},Fa={key:0,class:"dss-tooltip-section"},za={class:"dss-tooltip-section-title"},Pa={class:"dss-tooltip-group-header"},Oa={class:"dss-tooltip-item-content"},Za={class:"dss-tooltip-item-text"},Ua={key:1,class:"dss-tooltip-section"},qa={class:"dss-tooltip-section-title"},Wa={class:"dss-tooltip-item-content"},Xa={class:"dss-tooltip-item-title"},Ya={key:0,class:"dss-tooltip-item-description"},ja={class:"dss-tooltip-section"},Ka={class:"dss-tooltip-title"},Ga={key:0,class:"dss-bubble-tooltip-data"},Qa={class:"dss-tooltip-series-name"},Ja={class:"dss-tooltip-series-value"},es={key:0,class:"dss-tooltip-section"},ts={class:"dss-tooltip-section-title"},os={class:"dss-tooltip-group-header"},ns={class:"dss-tooltip-item-content"},ls={class:"dss-tooltip-item-text"},as={key:1,class:"dss-tooltip-section"},ss={class:"dss-tooltip-section-title"},rs={class:"dss-tooltip-item-content"},is={class:"dss-tooltip-item-title"},cs={key:0,class:"dss-tooltip-item-description"},ds={key:1,class:"dss-context-menu-separator"},us={key:0,class:"dss-context-menu-separator"},ms={key:0,class:"dss-context-menu-separator"},ps=["onClick"],fs=["innerHTML"],vs={key:0,class:"dss-context-menu-icon"},gs={class:"dss-marker-modal-header"},hs={class:"dss-marker-modal-body"},ys={class:"dss-form-group"},Cs={key:0},ks={key:1},xs=["disabled"],ws=["value"],bs={class:"dss-form-group"},Es={for:"dss-marker-description"},Vs={key:0,class:"dss-form-text-display"},Ss=["placeholder"],Ns={class:"dss-form-group"},Ms={class:"icon-preview"},Bs=["src"],Hs={class:"dss-marker-modal-footer"},Ts={class:"modal-footer-left"},As={class:"dss-modal-footer-right"},Ls=["disabled"],$s={name:"DSSChart"},Ds=Object.assign($s,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==null}},emits:["add-marker","update-marker","delete-marker"],setup(T,{emit:Wt}){const{t:O,locale:w}=Yn.useI18n(),vt=Wt,x=e.ref(null),K=e.ref(null),Bt=e.computed(()=>{if(!x.value||!K.value)return 0;try{const t=x.value.getBoundingClientRect();return K.value.getBoundingClientRect().top-t.top}catch{return 0}}),S=T,g={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 De(t,n){const o=Object.assign({},t);return Qe(t)&&Qe(n)&&Object.keys(n).forEach(s=>{Qe(n[s])?s in t?o[s]=De(t[s],n[s]):Object.assign(o,{[s]:n[s]}):Object.assign(o,{[s]:n[s]})}),o}const ze=()=>{let t=20,n=0,o=0;if(oe.value&&(t+=30),ne.value&&(t+=25),xe.value&&S.series.length>0){const s=S.series.filter((d,u)=>!pe.value.has(u)).length;if(Ae.value==="top"||Ae.value==="bottom"){if(vo.value==="horizontal"){const u=Math.floor(I.value/100);n=Math.ceil(s/u)*25+10}else n=s*25+10;t+=n}else o=150}return{height:t,legendHeight:n,legendWidth:o}};function Qe(t){return t&&typeof t=="object"&&!Array.isArray(t)}const M=e.computed(()=>De(g,S.options)),I=e.computed(()=>{const t=M.value;return t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),X=e.computed(()=>{const t=M.value;return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),W=e.computed(()=>{const t=M.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),st=e.computed(()=>{const t=S.series.map(n=>n.type||W.value);return new Set(t).size>1}),oe=e.computed(()=>{const t=M.value;return t&&t.title&&t.title.text?t.title.text:""}),ne=e.computed(()=>{const t=M.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),rt=e.computed(()=>{const t=M.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Vo=e.computed(()=>{const t=M.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),fe=e.computed(()=>{const t=M.value;if(!t||!t.yAxis)return Nt;const n=t.yAxis.min;return typeof n=="number"||n===Nt?n:Nt}),Ht=e.computed(()=>{const t=M.value;if(!t||!t.yAxis)return Nt;const n=t.yAxis.max;return typeof n=="number"||n===Nt?n:Nt}),Xt=e.computed(()=>{const t=M.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),ro=e.computed(()=>{const t=M.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),q=e.computed(()=>{const t=M.value;return t&&t.grid&&t.grid.show!==!1}),xe=e.computed(()=>{const t=M.value;return t&&t.legend&&t.legend.show!==!1}),Ae=e.computed(()=>{const t=M.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),vo=e.computed(()=>{const t=M.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Le=e.computed(()=>{const t=M.value;if(!t||!t.crosshair)return!1;const n=t.crosshair.show;return n===!0||n==="true"}),go=e.computed(()=>{const t=M.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ue=e.computed(()=>{const t=M.value;return t&&t.zoom&&t.zoom.enabled!==!1}),So=e.computed(()=>{const t=M.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),it=e.computed(()=>{const t=M.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),de=e.computed(()=>{const t=M.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),me=e.computed(()=>{const t=M.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Tt=e.computed(()=>{const{maxX:t}=ye.value;return t===0}),Je=(t,n)=>Tt.value&&n===0?5:n,ho=e.computed(()=>{const t=M.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),G=e.computed(()=>{const t=M.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),At=e.computed(()=>{const t=M.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),yo=e.computed(()=>{const t=M.value;return G.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),io=e.computed(()=>{const t=M.value,n=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return n.length>0?n:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Yt=e.computed(()=>{const t=M.value;return t&&t.animations&&t.animations.enabled!==!1}),jt=e.computed(()=>{const t=M.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Pe=e.computed(()=>{const t=M.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Lt=e.computed(()=>{const t=M.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),We=e.computed(()=>{const t=M.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),we=e.computed(()=>{const t=M.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),ct=e.computed(()=>{const t=M.value;return t&&t.animations&&t.animations.onDataChange!==!1}),co=e.computed(()=>{const t=M.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Z=e.computed(()=>{const t=M.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),ie=e.computed(()=>M.value?.spider?.gridSteps||5),Xe=e.computed(()=>{const t=[],n=ie.value;for(let o=1;o<=n;o++)t.push(Y.value/n*o);return t}),$t=t=>{const n=dt.value;if(n&&Array.isArray(n)&&n[t]!==void 0)return n[t].toString();const o=Xe.value[t];return Math.round(o/Y.value*100)+"%"},dt=e.computed(()=>M.value?.spider?.gridLabels||null);e.computed(()=>{const t=M.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0});const he=e.computed(()=>{const t=M.value,n={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...n,...t.contextMenu.items}:n}),Ye=e.computed(()=>{const t=M.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),et=e.computed(()=>{const t=M.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Co.value}),te=e.computed(()=>{const t=M.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),le=e.computed(()=>{const t=M.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),gt=e.computed(()=>!b.value.isZooming);e.computed(()=>Ee.value.map(t=>{if(t.categoryIndex!==void 0&&(Te.value||Ne.value)){const n=Ce(t.categoryIndex),o=Bt.value+C.value.bottom-le.value/2;return{...t,x:n,y:o}}return t}));function Fo(t,n){const o=new Date(t);let s=0,d=1/0;return n.forEach((u,m)=>{const[f,v,h]=u.split("-"),y=new Date(`20${h}`,v-1,f),k=Math.abs(y-o);k<d&&(d=k,s=m)}),s}const ht=e.computed(()=>{const t=S.markers.map(o=>{const s=Fo(o.marker_date,S.categories),d=Ce(s),u=Bt.value+C.value.bottom-le.value/2;return{...o,x:d,y:u,categoryIndex:s,source:"props"}}),n=Ee.value.map(o=>{if(o.categoryIndex!==void 0&&(Te.value||Ne.value)){const s=Ce(o.categoryIndex),d=Bt.value+C.value.bottom-le.value/2;return{...o,x:s,y:d,source:"internal"}}return{...o,source:"internal"}});return[...t,...n]}),tt=e.computed(()=>{const t=M.value;return t&&t.watermark&&t.watermark.enabled===!0}),ut=e.computed(()=>{const t=M.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),be=e.computed(()=>{const t=M.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:"25%"}),yt=e.computed(()=>{const t=M.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Ct=e.computed(()=>{const t={left:C.value.left,top:C.value.top,width:C.value.width,height:C.value.height};let n,o;const s=String(be.value);if(s.includes("%")){const d=parseFloat(s)/100;n=t.width*d,o=n*(96/499)}else{const d=parseFloat(s)||25;n=Math.min(t.width*.25,200)*(d/25),o=n*(96/499)}return{width:n,height:o,area:t}}),kt=e.computed(()=>{const{width:t,height:n}=Ct.value,o=yt.value;let s,d;const u=C.value.left,m=C.value.right,f=C.value.top,v=C.value.bottom,h=C.value.width,y=C.value.height;switch(o){case"center":s=u+(h-t)/2,d=f+(y-n)/2;break;case"top-left":s=u+15,d=f+90;break;case"top-right":s=m-t-15,d=f+90;break;case"bottom-left":s=u+15,d=v-n+75;break;case"bottom-right":default:s=m-t-15,d=v-n+75;break}return{backgroundPositionX:s+"px",backgroundPositionY:d+"px",backgroundSize:`${t}px ${n}px`}}),Kt=t=>!S.flags||!S.flags.length?[]:S.flags.filter(n=>n.categoryIndex===t),mt=t=>{const n=Kt(t),o=Dn(t),s=n.filter(m=>m.manual),d=n.filter(m=>!m.manual),u=[];return s.length>0&&u.push({type:O("chart.tooltip.manualFlags"),color:"#047395",flags:s.map(m=>({text:m.text,color:"#047395"}))}),d.length>0&&u.push({type:O("chart.tooltip.autoFlags"),color:"#0dbf89",flags:d.map(m=>({text:m.text,color:"#0dbf89"}))}),{flagGroups:u,markers:o.map(m=>({title:m.title,description:m.description,type:O("chart.tooltip.markers"),color:m.color||"#FF6B6B"}))}},Co=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"/>
|
|
@@ -19,7 +19,7 @@
|
|
|
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
21
|
</svg>`)}`),tn=e.computed(()=>{const t=M.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),xt=e.computed(()=>{const t=M.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=M.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const Bn=e.computed(()=>{const t=M.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Hn=e.computed(()=>{const t=M.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),Tn=e.computed(()=>{const t=M.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),on=e.computed(()=>{if(!S.flags||!S.flags.length)return[];const t=new Map;return S.flags.forEach(n=>{const o=n.categoryIndex;t.has(o)||t.set(o,[]),t.get(o).push(n)}),Array.from(t.entries()).map(([n,o])=>{const s=Ce(n),d=o.filter(m=>m.manual),u=o.filter(m=>!m.manual);return{categoryIndex:parseInt(n),x:s,flags:o,manualCount:d.length,autoCount:u.length,totalCount:o.length,hasManual:d.length>0,hasAuto:u.length>0,texts:o.map(m=>m.text).join(`
|
|
22
|
-
`)}})}),No=e.ref({show:!1,x:0,y:0,content:"",count:0}),nn=e.computed(()=>M.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Mo=e.computed(()=>{const t=M.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Bo=e.computed(()=>M.value?.bubbles?.tooltip?.formatters||{}),pe=e.ref(new Set),$=e.ref(null),Ho=e.ref(!1),ue=e.ref({show:!1,x:0,y:0,title:"",value:"",spiderSeries:[]}),$e=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),U=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ae=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),
|
|
22
|
+
`)}})}),No=e.ref({show:!1,x:0,y:0,content:"",count:0}),nn=e.computed(()=>M.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Mo=e.computed(()=>{const t=M.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Bo=e.computed(()=>M.value?.bubbles?.tooltip?.formatters||{}),pe=e.ref(new Set),$=e.ref(null),Ho=e.ref(!1),ue=e.ref({show:!1,x:0,y:0,title:"",value:"",spiderSeries:[]}),$e=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),U=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ae=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),b=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Ee=e.ref([]),D=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1});e.computed(()=>{const t=["default"];return te.value&&t.push(...Object.keys(te.value)),t});const ln=e.computed(()=>{if(!S.categories||S.categories.length===0){const{maxX:t}=ye.value;return Array.from({length:t+1},(n,o)=>O("chart.fallback.item",{number:o+1}))}return S.categories}),Gt=e.computed(()=>D.value.editingMarkerId!==null),Qt=e.computed(()=>D.value.readonly),an=t=>{pe.value.has(t)||(so.value=!0,$.value=t)},sn=()=>{so.value=!1,$.value=null},rn=t=>{if(bo.value||nt.value){U.value.show=!1;return}const o=t.currentTarget.getBoundingClientRect(),s=t.clientX-o.left,d=t.clientY-o.top,u=Ne.value?s>=C.value.left-50&&s<=C.value.right+50&&d>=C.value.top-50&&d<=C.value.bottom+100:s>=C.value.left&&s<=C.value.right&&d>=C.value.top&&d<=C.value.bottom;if(Ho.value=u,Ne.value){if(!Le.value||!u||b.value.isDragging||b.value.isZooming){U.value.show=!1;return}if(to.value.find(V=>!V||V.isHidden?!1:Math.sqrt(Math.pow(V.x-s,2)+Math.pow(V.y-d,2))<=V.radius+3))U.value.show=!1;else{const V=to.value.filter(A=>!A||A.isHidden?!1:Math.sqrt(Math.pow(A.x-s,2)+Math.pow(A.y-d,2))<=250);if(V.length>0){let A=V[0],H=Math.sqrt(Math.pow(A.x-s,2)+Math.pow(A.y-d,2));V.forEach(B=>{const L=Math.sqrt(Math.pow(B.x-s,2)+Math.pow(B.y-d,2));L<H&&(H=L,A=B)});const E=30,z=to.value.filter(B=>!B||B.isHidden?!1:Math.abs(B.x-A.x)<=E).sort((B,L)=>B.y-L.y);U.value={show:!0,x:A.x,categoryIndex:Math.round(A.originalX),data:(()=>{const B=nn.value,L=Mo.value,P=[];return z.forEach(F=>{B.forEach(j=>{const ee=L[j]||j,Fe=bn(j,F);Fe&&P.push({seriesName:F.seriesName,label:F.label,value:`${ee}: ${Fe}`,color:F.color,y:F.y})})}),P})()}}else U.value.show=!1}return}if(b.value.isDragging&&b.value.scale>1&&Te.value&&Ue.value){U.value.show=!1;const R=t.clientX-b.value.lastMouseX,{minX:V,maxX:A}=ye.value,H=A-V||1,z=R*.8;b.value.offsetX+=z;const B=H/b.value.scale,L=H-B,P=0,F=-L/H*C.value.width,j=P;b.value.offsetX=Math.max(F,Math.min(j,b.value.offsetX)),b.value.lastMouseX=t.clientX,b.value.lastMouseY=t.clientY;return}if(!Le.value||!Te.value||b.value.isDragging||b.value.isZooming||!u){U.value.show=!1;return}const{minX:m,maxX:f}=ye.value,v=f-m||1,h=v/b.value.scale,y=m-b.value.offsetX/C.value.width*v,k=(s-C.value.left)/C.value.width,N=y+k*h,_=Math.round(N);if(_>=0&&_<=f){const R=Ce(_),V=eo.value.map((A,H)=>{const E=S.series.findIndex(B=>B===A),z=A.data[_];return{seriesName:A.name,value:z!==void 0?z:null,color:ve(E),y:z!==void 0?Be(z):null}}).filter(A=>A.value!==null);U.value={show:!0,x:R,categoryIndex:_,data:V}}},An=()=>{U.value.show=!1,Ho.value=!1,nt.value=!1,bo.value||(No.value.show=!1),b.value.isDragging&&(b.value.isDragging=!1),b.value.zoomTimeout&&(clearTimeout(b.value.zoomTimeout),b.value.zoomTimeout=null),b.value.isZooming=!1,setTimeout(()=>{$.value=null,ue.value.show=!1},150)},Dt=t=>{if(t.preventDefault(),t.stopPropagation(),Se.value)return;const n=t.currentTarget.getBoundingClientRect(),o=t.clientX-n.left,s=t.clientY-n.top,d=Math.max(0,C.value.left-20),u=C.value.right,m=C.value.top,f=C.value.bottom+80;o>=d&&o<=u&&s>=m&&s<=f&&(ae.value.show=!1,e.nextTick(()=>{ae.value.show=!0,ae.value.x=t.clientX,ae.value.y=t.clientY,ae.value.categoryIndex=null;const v=Math.max(C.value.left,Math.min(o,C.value.right))-C.value.left,y=C.value.width/qo.value.length,k=Math.floor(v/y);k>=0&&k<qo.value.length&&(ae.value.categoryIndex=k)}))},Jt=t=>{if(!(t&&t.button===2)){if(ae.value.show&&t&&t.type==="click"){const n=document.querySelector(".dss-context-menu");if(n&&n.contains(t.target))return}ae.value.show=!1}},Ln=t=>{if(typeof t.template=="function"){const n={series:S.series,categories:S.categories,markers:Ee.value},o={chartX:ae.value.chartX,chartY:ae.value.chartY,dataX:ae.value.mouseDataX,dataY:ae.value.mouseDataY,categoryIndex:ae.value.categoryIndex};return t.template(n,o)}return t.template||t.label||""},Po=t=>{const n=["dss-context-menu-item"];return t.cssClass&&n.push(t.cssClass),n},$n=t=>t.style||{},ko=t=>t.type&&te.value[t.type]?te.value[t.type]:t.customIcon?t.customIcon:et.value,cn=t=>t==null?"":S.categories&&S.categories[t]?S.categories[t]:"",Dn=t=>Ee.value.length?Ee.value.filter(n=>n.categoryIndex===t):[],Oo=t=>{if(!Te.value&&!Ne.value)return{x:0,y:0};const n=Ce(t),o=Bt.value+C.value.bottom-le.value/2;return{x:n,y:o}},dn=()=>{Ee.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Te.value||Ne.value)){const n=Oo(t.categoryIndex);t.x=n.x,t.y=n.y}})},wt=()=>{if(D.value.description&&D.value.description.length){if(Gt.value){const t=Ee.value.findIndex(n=>n.id===D.value.editingMarkerId);t!==-1?(Ee.value[t].description=D.value.description||"",Ee.value[t].color=D.value.color||"",Ee.value[t].type=D.value.type||"default",vt("update-marker",Ee.value[t])):vt("update-marker",{id:D.value.editingMarkerId,description:D.value.description||"",color:D.value.color||"",type:D.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let n=Math.max(0,D.value.categoryIndex);if(Ne.value){const{maxX:m}=ye.value;n=Math.max(0,Math.min(n,Math.floor(m)))}else Te.value&&(n=Math.max(0,Math.min(n,ye.value.maxX)));const o=Ce(n),s=Bt.value+C.value.bottom-le.value/2,d=Array.isArray(S.categories)?S.categories[n]:null,u={id:t,title:"",description:D.value.description||"",color:D.value.color||"",type:D.value.type||"default",categoryIndex:n,x:o,y:s,marker_date:d||null};D.value.categoryIndex=n,Ee.value.push(u),vt("add-marker",u)}Oe(),Ao()}},Oe=()=>{D.value.show=!1,D.value.title="",D.value.description="",D.value.color="#FF6B6B",D.value.type="default",D.value.editingMarkerId=null,D.value.readonly=!1,D.value.categoryIndex=null,D.value.fromButton=!1},To=()=>{Gt.value&&(Ve(D.value.editingMarkerId),Oe())},Ve=t=>{const n=Ee.value.findIndex(o=>o.id===t);n!==-1&&(Ee.value.splice(n,1),Ao()),vt("delete-marker",t)},ce=t=>{D.value.show=!0,D.value.title=t?.title??t?.comment??"",D.value.description=t?.description??t?.comment??"",D.value.color=t?.color??"",D.value.type=t?.type??"default",D.value.editingMarkerId=t?.id??t?.marker_id??null,D.value.readonly=t?.readonly??!1,D.value.categoryIndex=t?.categoryIndex??null},Ao=()=>{try{const t=`dss-chart-markers-${S.chartId}`;localStorage.setItem(t,JSON.stringify(Ee.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Zo=()=>{try{const t=`dss-chart-markers-${S.chartId}`,n=localStorage.getItem(t);if(n){const o=JSON.parse(n);Array.isArray(o)&&(Ee.value=o.map(s=>({...s,originalYOffset:s.originalYOffset!==void 0?s.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Ee.value=[]}},ot=t=>{const n=oe.value||"Chart",o=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${n.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${o}.${t}`},un=()=>{const t=U.value.show,n=ue.value.show;return U.value.show=!1,ue.value.show=!1,{originalCrosshair:t,originalTooltip:n}},It=t=>{U.value.show=t.originalCrosshair,ue.value.show=t.originalTooltip},mn=async(t,n=32,o=32)=>new Promise((s,d)=>{if(t.startsWith("data:")){s(t);return}const u=new Image;u.crossOrigin="anonymous";const m=setTimeout(()=>{console.warn("Image conversion timeout for:",t),s(t)},5e3);u.onload=()=>{clearTimeout(m);try{const f=document.createElement("canvas"),v=f.getContext("2d");f.width=n,f.height=o,v.fillStyle="#fafafa",v.fillRect(0,0,n,o),v.drawImage(u,0,0,n,o);const h=f.toDataURL("image/png");s(h)}catch(f){console.warn("Canvas conversion failed:",f),s(t)}},u.onerror=f=>{clearTimeout(m),console.warn("Failed to load image:",t,f),s(t)},u.src=t}),Lo=async()=>{try{const t=un();setTimeout(async()=>{try{const n=document.querySelector(".dss-chart-svg");if(!n){console.error("Chart SVG element not found"),It(t);return}const o=ze(),s=I.value,d=X.value+o.height,u=n.cloneNode(!0);u.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(E=>E.remove());const f=u.querySelectorAll("image"),v=Array.from(f).map(async E=>{const z=E.getAttribute("xlink:href")||E.getAttribute("href");if(z&&!z.startsWith("data:"))try{const B=await mn(z,32,32);E.setAttribute("xlink:href",B),E.setAttribute("href",B)}catch(B){console.warn("Failed to convert logo to base64:",B)}});await Promise.all(v);const y=new XMLSerializer().serializeToString(u).replace(/<svg[^>]*>/,"").replace("</svg>","");let k="",N=30;if(oe.value&&(k+=`
|
|
23
23
|
<text x="24" y="${N}"
|
|
24
24
|
font-family="Arial, sans-serif"
|
|
25
25
|
font-size="18"
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
font-size="14"
|
|
33
33
|
fill="#666">
|
|
34
34
|
${ne.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
35
|
-
</text>`,N+=25),xe.value&&S.series.length>0){let
|
|
35
|
+
</text>`,N+=25),xe.value&&S.series.length>0){let E=s-200,z=oe.value||ne.value?35:25;const B=Math.floor((s-250)/120);let L=0;S.series.forEach((P,F)=>{if(!pe.value.has(F)){const j=ve(F),ee=P.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");k+=`<circle cx="${E+6}" cy="${z-4}" r="6" fill="${j}"/>`,k+=`<text x="${E+18}" y="${z}" font-family="Arial, sans-serif" font-size="12" fill="#333">${ee}</text>`,L++,L%B===0?(E=s-200,z+=20):E+=Math.min(120,ee.length*8+35)}})}let _="";if(tt.value)try{const{width:E,height:z}=Ct.value,B=yt.value,L=C.value.left,P=C.value.right,F=C.value.top,j=C.value.bottom,ee=C.value.width,Fe=C.value.height;let ge,lt;switch(B){case"center":ge=L+(ee-E)/2,lt=F+(Fe-z)/2;break;case"top-left":ge=L+15,lt=F+5;break;case"top-right":ge=P-E-5,lt=F+5;break;case"bottom-left":ge=L+15,lt=j-z-5;break;case"bottom-right":default:ge=P-E-5,lt=j-z-5;break}_=`
|
|
36
36
|
<g opacity="${ut.value}">
|
|
37
|
-
<g transform="translate(${ge}, ${lt}) scale(${
|
|
37
|
+
<g transform="translate(${ge}, ${lt}) scale(${E/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,7 +49,7 @@
|
|
|
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(
|
|
52
|
+
</g>`}catch(E){console.warn("Watermark processing failed, skipping watermark in SVG:",E),_=""}const R=`<?xml version="1.0" encoding="UTF-8"?>
|
|
53
53
|
<svg width="${s}" height="${d}"
|
|
54
54
|
xmlns="http://www.w3.org/2000/svg"
|
|
55
55
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
@@ -64,16 +64,16 @@
|
|
|
64
64
|
${k}
|
|
65
65
|
<g transform="translate(0, ${o.height})">
|
|
66
66
|
${y}
|
|
67
|
-
${
|
|
67
|
+
${_}
|
|
68
68
|
</g>
|
|
69
|
-
</svg>`,
|
|
69
|
+
</svg>`,V=new Blob([R],{type:"image/svg+xml;charset=utf-8"}),A=URL.createObjectURL(V),H=document.createElement("a");H.href=A,H.download=ot("svg"),document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(A),It(t),Jt()}catch(n){console.error("Error downloading SVG:",n),It(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},_t=async()=>{try{const t=un();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(E=>setTimeout(E,300));const n=ze(),o=I.value,s=X.value+n.height,d=document.createElement("canvas"),u=d.getContext("2d"),m=2;d.width=o*m,d.height=s*m,d.style.width=o+"px",d.style.height=s+"px",u.scale(m,m),u.fillStyle="#fafafa",u.fillRect(0,0,o,s);let f=30;if(oe.value&&(u.fillStyle="#333",u.font="bold 18px Arial, sans-serif",u.fillText(oe.value,24,f),f+=30),ne.value&&(u.fillStyle="#666",u.font="14px Arial, sans-serif",u.fillText(ne.value,24,f),f+=25),xe.value&&S.series.length>0){let E=o-200,z=oe.value||ne.value?35:25;const B=Math.floor((o-250)/120);let L=0;u.font="12px Arial, sans-serif",S.series.forEach((P,F)=>{if(!pe.value.has(F)){const j=ve(F);u.beginPath(),u.arc(E+6,z-4,6,0,2*Math.PI),u.fillStyle=j,u.fill(),u.fillStyle="#333",u.fillText(P.name,E+18,z),L++,L%B===0?(E=o-200,z+=20):E+=Math.min(120,P.name.length*8+35)}})}const h=document.querySelector(".dss-chart-svg").cloneNode(!0),y=h.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),k=h.querySelectorAll(".dss-crosshair"),N=h.querySelectorAll('[class*="tooltip"]');y.forEach(E=>E.remove()),k.forEach(E=>E.remove()),N.forEach(E=>E.remove()),h.querySelectorAll("image").forEach((E,z)=>{const B=E.getAttribute("xlink:href")||E.getAttribute("href");if(B&&!B.startsWith("data:")){const L=ao.value[z],P=L?ve(L.seriesIndex):"#3B82F6",F=E.getAttribute("x")||0,j=E.getAttribute("y")||0,ee=E.getAttribute("width")||32,Fe=E.getAttribute("height")||32,ge=document.createElementNS("http://www.w3.org/2000/svg","circle");ge.setAttribute("cx",parseFloat(F)+parseFloat(ee)/2),ge.setAttribute("cy",parseFloat(j)+parseFloat(Fe)/2),ge.setAttribute("r",Math.min(parseFloat(ee),parseFloat(Fe))/2-1),ge.setAttribute("fill",P),ge.setAttribute("stroke","#fafafa"),ge.setAttribute("stroke-width","2"),E.parentNode.replaceChild(ge,E)}});const R=new XMLSerializer().serializeToString(h),V=new Blob([R],{type:"image/svg+xml;charset=utf-8"}),A=URL.createObjectURL(V),H=new Image;return new Promise((E,z)=>{H.onload=async()=>{try{if(u.drawImage(H,0,n.height),ao.value.forEach(B=>{const L=B.x,P=B.y+n.height,F=(B.width||32)/2,j=ve(B.seriesIndex);u.save(),u.beginPath(),u.arc(L,P,F-1,0,2*Math.PI),u.fillStyle=j,u.fill(),u.strokeStyle="#fafafa",u.lineWidth=2,u.stroke(),u.restore()}),tt.value){const B=new Image,L=()=>{const{width:F,height:j}=Ct.value,ee=yt.value,Fe=C.value.left,ge=C.value.right,lt=C.value.top,ft=C.value.bottom,Mt=C.value.width,at=C.value.height;let Eo,Ro;switch(ee){case"center":Eo=Fe+(Mt-F)/2,Ro=lt+n.height+(at-j)/2;break;case"top-left":Eo=Fe+15,Ro=lt+n.height+10;break;case"top-right":Eo=ge-F-5,Ro=lt+n.height+10;break;case"bottom-left":Eo=Fe+15,Ro=ft+n.height-j-5;break;case"bottom-right":default:Eo=ge-F-5,Ro=ft+n.height-j-5;break}u.globalAlpha=ut.value,u.drawImage(B,Eo,Ro,F,j),u.globalAlpha=1,P()},P=()=>{d.toBlob(F=>{const j=URL.createObjectURL(F),ee=document.createElement("a");ee.href=j,ee.download=ot("png"),document.body.appendChild(ee),ee.click(),document.body.removeChild(ee),URL.revokeObjectURL(j),URL.revokeObjectURL(A),It(t),Jt(),E()},"image/png")};B.onload=L,B.onerror=P,B.src=zo.value}else d.toBlob(B=>{const L=URL.createObjectURL(B),P=document.createElement("a");P.href=L,P.download=ot("png"),document.body.appendChild(P),P.click(),document.body.removeChild(P),URL.revokeObjectURL(L),URL.revokeObjectURL(A),It(t),Jt(),E()},"image/png")}catch(B){URL.revokeObjectURL(A),It(t),z(B)}},H.onerror=()=>{URL.revokeObjectURL(A),It(t),z(new Error("Failed to load SVG image"))},H.src=A})}catch(t){console.error("Error downloading PNG:",t)}},In=()=>{try{let t="";oe.value&&(t+=`# ${O("chart.csv.chartTitle")}: ${oe.value}
|
|
70
70
|
`),ne.value&&(t+=`# ${O("chart.csv.chartSubtitle")}: ${ne.value}
|
|
71
71
|
`),t+=`# ${O("chart.csv.generated")}: ${new Date().toLocaleString()}
|
|
72
72
|
|
|
73
73
|
`,t+="Category",S.series.forEach(u=>{const m=u.name.replace(/"/g,'""');t+=',"'+m+'"'}),t+=`
|
|
74
74
|
`;const n=Math.max(...S.series.map(u=>u.data?.length||0));for(let u=0;u<n;u++){let v='"'+(S.categories[u]||O("chart.fallback.item",{number:u+1})).toString().replace(/"/g,'""')+'"';S.series.forEach(h=>{const y=h.data&&h.data[u]!==void 0?h.data[u]:"";v+=","+y}),t+=v+`
|
|
75
|
-
`}const o=new Blob([t],{type:"text/csv;charset=utf-8;"}),s=URL.createObjectURL(o),d=document.createElement("a");d.href=s,d.download=ot("csv"),document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(s),Jt()}catch(t){console.error("Error downloading CSV:",t)}},Rn=t=>{if(typeof t.action=="function"){const n={series:S.series,categories:S.categories,markers:Ee.value},o={chartX:ae.value.chartX,chartY:ae.value.chartY,dataX:ae.value.mouseDataX,dataY:ae.value.mouseDataY,categoryIndex:clampedCategoryIndex||ae.value.categoryIndex};t.action(n,o)}Jt()},_t=()=>{Oe(),D.value.show=!0,D.value.categoryIndex=ae.value.categoryIndex,D.value.fromButton=!1,Jt()},Ze=()=>{Oe(),D.value.show=!0,D.value.categoryIndex=0,D.value.fromButton=!0},Uo=t=>{if(ae.value.show){const n=document.querySelector(".dss-context-menu");n&&!n.contains(t.target)&&(ae.value.show=!1)}},He=t=>{ae.value.show&&!t.target.closest(".context-menu")&&(ae.value.show=!1)},bt=t=>{if(!Te.value||!Ue.value)return;t.preventDefault(),t.stopPropagation(),w.value.isZooming=!0,U.value.show=!1,w.value.zoomTimeout&&clearTimeout(w.value.zoomTimeout);const o=t.currentTarget.getBoundingClientRect(),s=t.clientX-o.left,d=t.clientY-o.top;if(s<C.value.left-50||s>C.value.right+50||d<C.value.top-50||d>C.value.bottom+100){w.value.isZooming=!1;return}const u=t.deltaY>0?.9:1.1,m=Math.max(w.value.minScale,Math.min(w.value.maxScale,w.value.scale*u));if(m!==w.value.scale){const{minX:f,maxX:v}=ye.value,h=v-f||1,y=h/w.value.scale,k=f-w.value.offsetX/C.value.width*h,N=(s-C.value.left)/C.value.width,R=k+N*y;w.value.scale=m;const _=h/w.value.scale,E=R-N*_;w.value.offsetX=-(E-f)/h*C.value.width,w.value.scale<=1.01&&(w.value.scale=1,w.value.offsetX=0)}w.value.zoomTimeout=setTimeout(()=>{w.value.isZooming=!1,w.value.zoomTimeout=null},300)},_n=t=>{if(!Te.value||!Ue.value||w.value.scale<=1)return;U.value.show=!1;const o=t.currentTarget.getBoundingClientRect();t.clientX-o.left,t.clientY-o.top,w.value.isDragging=!0,w.value.lastMouseX=t.clientX,w.value.lastMouseY=t.clientY,t.preventDefault()},pn=()=>{w.value.isDragging=!1},$o=()=>{!Te.value||!Ue.value||(w.value.scale=1,w.value.offsetX=0,w.value.isDragging=!1,w.value.zoomTimeout&&(clearTimeout(w.value.zoomTimeout),w.value.zoomTimeout=null),w.value.isZooming=!1)},qe=()=>!Te.value||!Ho.value||!Ue.value?"default":w.value.isDragging?"grabbing":w.value.scale>1?"grab":"dss-crosshair",Do=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 s=t[Math.max(o-1,0)],d=t[o],u=t[o+1],m=t[Math.min(o+2,t.length-1)],f=d.x+(u.x-s.x)/6*At.value,v=d.y+(u.y-s.y)/6*At.value,h=u.x-(m.x-d.x)/6*At.value,y=u.y-(m.y-d.y)/6*At.value;n+=` C ${f} ${v} ${h} ${y} ${u.x} ${u.y}`}return n},Et=e.computed(()=>{let n=50+(rt.value?30:0)+60;if(Vt.value)return{left:90,top:90,right:90,bottom:90};if(Se.value){let m=0;oe.value&&(m+=15),ne.value&&(m+=10);const f=ze();let v=66,h=50;return xe.value&&Ae.value==="left"?v+=f.legendWidth||150:xe.value&&Ae.value==="right"&&(h+=f.legendWidth||150),{left:v,top:50+m,right:h,bottom:130}}let o=0;oe.value&&(o+=15),ne.value&&(o+=10);const s=ze();let d=66,u=50;return xe.value&&Ae.value==="left"?d+=s.legendWidth||150:xe.value&&Ae.value==="right"&&(u+=s.legendWidth||150),xe.value&&Ae.value==="bottom"&&(n+=s.legendHeight||0),{left:d,top:50+o,right:u,bottom:n}}),C=e.computed(()=>({left:Et.value.left,top:Et.value.top,right:I.value-Et.value.right,bottom:X.value-Et.value.bottom,width:I.value-(Et.value.left+Et.value.right),height:X.value-(Et.value.top+Et.value.bottom)})),Te=e.computed(()=>["line","area","bar"].includes(W.value)||st.value),je=e.computed(()=>st.value),Se=e.computed(()=>["radial","semi-radial"].includes(W.value)),Vt=e.computed(()=>W.value==="spider"),Ne=e.computed(()=>W.value==="bubble"),Q=e.computed(()=>M.value?.chart?.orientation==="horizontal"&&(W.value==="bar"||je.value)),Ie=t=>{const{minY:n,maxY:o}=ye.value,s=o-n||1;return C.value.left+(t-n)/s*C.value.width},Ke=t=>{const{maxX:n}=ye.value,o=n+1,d=C.value.height/o;return C.value.top+(t+.5)*d},se=e.computed(()=>I.value/2),re=e.computed(()=>Vt.value?X.value/2-40:X.value/2),Y=e.computed(()=>{if(Vt.value){const t=C.value.width-80,n=C.value.height-80;return Math.min(t,n)/2}return Math.min(C.value.width,C.value.height)/2}),Me=e.computed(()=>Y.value*.45),Re=e.computed(()=>M.value?.bubbles?.minSize||8),Io=e.computed(()=>M.value?.bubbles?.maxSize||50),uo=e.computed(()=>M.value?.bubbles?.opacity||.7),fn=(t,n)=>{const o=[15,20,25,18,22],s=o[t%o.length]||20,d=1+Math.sin(n*.5)*.2;return Math.max(5,s*d)},vn=t=>{const n=document.querySelector(`.dss-bubble-image-${t}`);n&&(n.style.opacity="1")},gn=t=>{const n=document.querySelector(`.dss-bubble-image-${t}`);n&&(n.style.display="none")},St=e.computed(()=>S.series),eo=e.computed(()=>S.series.filter((t,n)=>!pe.value.has(n))),Nt="auto",ye=e.computed(()=>{if(Ne.value)return Fn();if(!eo.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,n=-1/0,o=0;eo.value.forEach(f=>{f.data&&f.data.length&&(o=Math.max(o,f.data.length-1),f.data.forEach(v=>{typeof v=="number"&&(t=Math.min(t,v),n=Math.max(n,v))}))}),S.categories.length>0&&(o=Math.max(o,S.categories.length-1)),t===1/0&&(t=0,n=100);const s=fe.value,d=Ht.value;let u,m;if(s===Nt){const f=n-t,v=f>0?f*.1:1;u=Math.max(0,t-v)}else if(typeof s=="number")u=s;else{const f=n-t,v=f>0?f*.1:1;u=Math.max(0,t-v)}if(d===Nt){const f=n-t,v=f>0?f*.1:2;m=n+v}else if(typeof d=="number")m=d;else{const f=n-t,v=f>0?f*.1:2;m=n+v}return{minX:0,maxX:o,minY:u,maxY:m}}),Fn=()=>{if(!eo.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,s=-1/0,d=1/0,u=-1/0,m=!1;if(eo.value.forEach((R,_)=>{R?.data?.length&&R.data.forEach((E,A)=>{let H,b,z;if(typeof E=="object"&&E!==null&&!Array.isArray(E))H=typeof E.x=="number"?E.x:A,b=typeof E.y=="number"?E.y:0,z=typeof E.size=="number"?E.size:20;else if(Array.isArray(E)&&E.length>=3)H=typeof E[0]=="number"?E[0]:A,b=typeof E[1]=="number"?E[1]:0,z=typeof E[2]=="number"?E[2]:20;else if(typeof E=="number")H=A,b=E,z=fn(_,A);else return;isFinite(H)&&isFinite(b)&&isFinite(z)&&(t=Math.min(t,H),n=Math.max(n,H),o=Math.min(o,b),s=Math.max(s,b),d=Math.min(d,z),u=Math.max(u,z),m=!0)})}),!m)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===n&&(t=Math.min(t,0),n=Math.max(n,S.categories?.length-1||8)),o===s&&(o=Math.max(0,o-10),s=o+20);const f=n-t,v=s-o;let h,y,k,N;return Xt.value!==null?h=Xt.value:h=t-f*.1,ro.value!==null?y=ro.value:y=n+f*.1,fe.value!==null&&typeof fe.value=="number"?k=fe.value:k=Math.max(0,o-v*.1),Ht.value!==null&&typeof Ht.value=="number"?N=Ht.value:N=s+v*.1,{minX:h,maxX:y,minY:k,maxY:N,minSize:d,maxSize:u}},Ce=t=>{if(Ne.value){const{minX:f,maxX:v}=ye.value,h=v-f||1;return C.value.left+(t-f)/h*C.value.width}const{minX:n,maxX:o}=ye.value,s=o-n;if(o===0||s===0)return C.value.left+C.value.width/2;const d=s/w.value.scale,u=n-w.value.offsetX/C.value.width*s,m=(t-u)/d;return C.value.left+m*C.value.width},Be=t=>{const{minY:n,maxY:o}=ye.value,s=o-n||1;return C.value.bottom-(t-n)/s*C.value.height},hn=t=>{if(!Ne.value)return me.value||4;const{minSize:n,maxSize:o}=ye.value,s=o-n||1;if(s===0)return(Re.value+Io.value)/2;const d=(t-n)/s;return Re.value+d*(Io.value-Re.value)},zn=e.computed(()=>Wo.value.map(t=>({y:t.y}))),qo=e.computed(()=>{if(Ne.value)return yn();if(W.value==="bar"){if(Q.value){const B=[],{minY:L,maxY:P}=ye.value,F=5,j=P-L||1;for(let ee=0;ee<=F;ee++){const Fe=L+j*(ee/F),ge=Ie(Fe);B.push({x:ge,y:C.value.bottom+20,text:Math.round(Fe).toString()})}return B}const _=[],{maxX:E}=ye.value,A=E+1,H=5,z=(C.value.width-H*2)/A;for(let B=0;B<=E;B++){const L=C.value.left+H+(B+.5)*z;_.push({x:L,y:C.value.bottom+20,text:S.categories[B]||O("chart.fallback.item",{number:B+1})})}return _}const t=[],{minX:n,maxX:o}=ye.value,s=o-n||1,d=s/w.value.scale,u=n-w.value.offsetX/C.value.width*s,m=u+d,f=Math.max(0,Math.floor(u-2)),v=Math.min(o,Math.ceil(m+2)),h=v-f,y=C.value.width,N=Math.floor(y/60);let R=1;h>N&&(R=Math.ceil(h/N));for(let _=f;_<=v;_+=R)if(_>=0&&_<=o){const E=Ce(_);E>=C.value.left-100&&E<=C.value.right+100&&t.push({x:E,y:C.value.bottom+20,text:S.categories[_]||`Item ${_+1}`})}return t}),yn=()=>{const t=[],{minX:n,maxX:o}=ye.value,s=o-n||1,d=Math.min(8,Math.max(4,Math.floor(C.value.width/80)));for(let u=0;u<=d;u++){const m=n+s*u/d,f=Ce(m);if(f>=C.value.left-10&&f<=C.value.right+10){const v=Math.round(m),h=S.categories?.[v];t.push({x:f,y:C.value.bottom+20,text:h||(Number.isInteger(m)?m.toString():m.toFixed(1))})}}return t},Wo=e.computed(()=>{if(Q.value){const d=[],{maxX:u}=ye.value;for(let m=0;m<=u;m++)d.push({x:C.value.left-10,y:Ke(m),text:S.categories[m]||`Item ${m+1}`});return d}const t=[],{minY:n,maxY:o}=ye.value,s=5;for(let d=0;d<=s;d++){const u=n+(o-n)*(d/s),m=Math.round(u);t.push({x:C.value.left-10,y:Be(u),text:m.toString()})}return t}),ve=t=>{const n=io.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]},Xo=t=>{let n=0;for(let o=1;o<t.length;o++){const s=t[o].x-t[o-1].x,d=t[o].y-t[o-1].y;n+=Math.sqrt(s*s+d*d)}return n},Cn=e.computed(()=>W.value==="line"||je.value?(je.value?S.series.filter(n=>(n.type||W.value)==="line"):St.value).map((n,o)=>{const s=S.series.findIndex(k=>k===n),d=[];let u=[];n.data.forEach((k,N)=>{k==null?u.length>0&&(d.push([...u]),u=[]):u.push({x:Q.value?Ie(k):Ce(N),y:Q.value?Ke(N):Be(k),index:N})}),u.length>0&&d.push(u);let m="";d.forEach(k=>{if(k.length>0){let N="";G.value?N=Do(k):N=`M ${k[0].x} ${k[0].y}`+k.slice(1).map(R=>` L ${R.x} ${R.y}`).join(""),m+=(m?" ":"")+N}});const f=d.reduce((k,N)=>k+Xo(N),0),v=pe.value.has(s),h=$.value===s,y=$.value!==null&&$.value!==s;return{path:m,color:ve(s),pathLength:f,seriesIndex:s,animationDelay:o*we.value,isHighlighted:h,isDimmed:y,isHidden:v}}):[]),kn=e.computed(()=>{if(!(W.value==="line"||je.value))return[];const t=je.value?S.series.filter(o=>(o.type||W.value)==="line"):St.value,n=[];return t.forEach((o,s)=>{const d=S.series.findIndex(u=>u===o);for(let u=0;u<o.data.length-1;u++){const m=o.data[u];if(m!=null){let f=-1,v=0;for(let h=u+1;h<o.data.length;h++){const y=o.data[h];if(y==null)v++;else{f=h;break}}if(v>0&&f!==-1){const h=o.data[f],y=Q.value?Ie(m):Ce(u),k=Q.value?Ke(u):Be(m),N=Q.value?Ie(h):Ce(f),R=Q.value?Ke(f):Be(h),_=pe.value.has(d),E=$.value===d,A=$.value!==null&&$.value!==d;n.push({path:`M ${y} ${k} L ${N} ${R}`,color:ve(d),seriesIndex:d,animationDelay:s*we.value,isHighlighted:E,isDimmed:A,isHidden:_,gapSize:v}),u=f-1}}}}),n}),xn=e.computed(()=>W.value==="line"||je.value?!Yt.value||qt.value||J.value.hasAnimated?[]:(je.value?S.series.filter(n=>(n.type||W.value)==="line"):St.value).map((n,o)=>{const s=S.series.findIndex(v=>v===n);let d="",u=null;n.data.forEach((v,h)=>{if(v!=null){const y={x:Q.value?Ie(v):Ce(h),y:Q.value?Ke(h):Be(v)};u===null?d+=`M ${y.x} ${y.y}`:d+=` L ${y.x} ${y.y}`,u=y}else if(u!==null){const y=n.data.findIndex((k,N)=>N>h&&k!==null&&k!==void 0);if(y!==-1){const k={x:Q.value?Ie(n.data[y]):Ce(y),y:Q.value?Ke(y):Be(n.data[y])};d+=` L ${k.x} ${k.y}`,u=k}}});const m=n.data.map((v,h)=>v==null?null:{x:Q.value?Ie(v):Ce(h),y:Q.value?Ke(h):Be(v)}).filter(v=>v!==null),f=Xo(m);return{path:d,pathLength:f,color:ve(s),animationDelay:o*we.value,seriesIndex:s}}):[]),mo=e.computed(()=>{if(W.value!=="line")return[];const t=[];return St.value.forEach((n,o)=>{const s=$.value===o,d=$.value!==null&&$.value!==o,u=pe.value.has(o);n.data.forEach((m,f)=>{m!=null&&t.push({x:Ce(f),y:Be(m),color:ve(o),value:m,label:S.categories[f]||f.toString(),seriesName:n.name,categoryIndex:f,dataIndex:f,animationDelay:(o*n.data.length+f)*(we.value/8),isHighlighted:s,isDimmed:d,isHidden:u})})}),t}),Ro=e.computed(()=>{if(!je.value)return[];const t=[];return S.series.filter(o=>(o.type||W.value)==="line").forEach((o,s)=>{const d=S.series.findIndex(v=>v===o),u=$.value===d,m=$.value!==null&&$.value!==d,f=pe.value.has(d);o.data.forEach((v,h)=>{v!=null&&t.push({x:Ce(h),y:Be(v),color:ve(d),value:v,label:S.categories[h]||h.toString(),seriesName:o.name,categoryIndex:h,dataIndex:h,animationDelay:(s*o.data.length+h)*(we.value/8),isHighlighted:u,isDimmed:m,isHidden:f})})}),t}),to=e.computed(()=>{if(!Ne.value)return[];const t=[];return St.value.forEach((n,o)=>{if(!n?.data?.length)return;const s=$.value,d=s!==null&&s===o,u=s!==null&&s!==o,m=pe.value.has(o);n.data.forEach((f,v)=>{let h,y,k,N,R;if(typeof f=="object"&&f!==null&&!Array.isArray(f))h=typeof f.x=="number"?f.x:v,y=typeof f.y=="number"?f.y:0,k=typeof f.size=="number"?f.size:20,N=f.label||S.categories?.[v]||`Point ${v+1}`,R=f.image||f.imageUrl;else if(Array.isArray(f)&&f.length>=3)h=typeof f[0]=="number"?f[0]:v,y=typeof f[1]=="number"?f[1]:0,k=typeof f[2]=="number"?f[2]:20,N=f[3]||S.categories?.[v]||`Point ${v+1}`,R=f[4];else if(typeof f=="number")h=v,y=f,k=fn(o,v),N=S.categories?.[v]||`Point ${v+1}`;else return;!isFinite(h)||!isFinite(y)||!isFinite(k)||t.push({x:Ce(h),y:Be(y),radius:hn(k),originalX:h,originalY:y,originalSize:k,color:ve(o),seriesName:n.name||`Series ${o+1}`,label:N,imageUrl:R,seriesIndex:o,dataIndex:v,categoryIndex:Math.round(h),isHighlighted:d,isDimmed:u,isHidden:m,opacity:uo.value})})}),t}),Yo=e.computed(()=>W.value!=="area"?[]:St.value.map((t,n)=>{const o=[];let s=[];if(t.data.forEach((k,N)=>{k==null?s.length>0&&(o.push([...s]),s=[]):s.push({x:Ce(N),y:Be(k),index:N})}),s.length>0&&o.push(s),o.length===0)return{linePath:"",areaPath:"",color:ve(n),isHidden:pe.value.has(n)};const d=C.value.bottom+1;let u="",m="";o.forEach((k,N)=>{if(k.length===0)return;let R=`M ${k[0].x} ${k[0].y}`;G.value&&k.length>1?R=Do(k):k.slice(1).forEach(E=>{R+=` L ${E.x} ${E.y}`}),u+=(u?" ":"")+R;let _=`M ${k[0].x} ${d}`;if(_+=` L ${k[0].x} ${k[0].y}`,G.value&&k.length>1){const E=Do(k),A=E.substring(E.indexOf("C")||E.indexOf("Q")||E.indexOf("L"));A?_+=" "+A:k.slice(1).forEach(H=>{_+=` L ${H.x} ${H.y}`})}else k.slice(1).forEach(E=>{_+=` L ${E.x} ${E.y}`});_+=` L ${k[k.length-1].x} ${d} Z`,m+=(m?" ":"")+_});const f=$.value===n,v=$.value!==null&&$.value!==n,h=pe.value.has(n),y=o.reduce((k,N)=>k+Xo(N),0);return{linePath:u,areaPath:m,color:ve(n),pathLength:y,isHighlighted:f,isDimmed:v,isHidden:h}})),wn=e.computed(()=>{if(!(["bar"].includes(W.value)||je.value))return[];const t=[],{maxX:n}=ye.value,o=je.value?S.series.filter(d=>(d.type||W.value)==="bar"):St.value,s=o.length;if(Q.value){const d=n+1,m=C.value.height/d,f=m*(2/3),v=f/s,h=v*.02,y=s===d?Math.max(12,f-h*s):Math.max(12,v-h);o.forEach((k,N)=>{const R=S.series.findIndex(H=>H===k),_=$.value===R,E=$.value!==null&&$.value!==R,A=pe.value.has(R);k.data.forEach((H,b)=>{if(H==null||typeof H!="number"||!isFinite(H))return;const L=C.value.top+(b+.5)*m-f/2+N*v+h/2,P=C.value.left,F=Math.abs(Ie(H)-C.value.left);let j="";if(G.value&&F>0){const ee=Math.min(yo.value,y/2,F/2);j=[`M ${P} ${L}`,`L ${P+F-ee} ${L}`,`Q ${P+F} ${L} ${P+F} ${L+ee}`,`L ${P+F} ${L+y-ee}`,`Q ${P+F} ${L+y} ${P+F-ee} ${L+y}`,`L ${P} ${L+y}`,"Z"].join(" ")}t.push({x:P,y:L,width:F,height:y,color:ve(R),value:H,label:S.categories[b]||b.toString(),seriesName:k.name,animationDelay:(N*o.length+b)*(we.value/4),isHighlighted:_,isDimmed:E,isHidden:A,barPath:j,isSmooth:G.value&&F>0})})})}else{const d=n+1,m=C.value.width/d,f=m*.8,v=f/s,h=v*.05,y=v-h;o.forEach((k,N)=>{const R=S.series.findIndex(H=>H===k),_=$.value===R,E=$.value!==null&&$.value!==R,A=pe.value.has(R);k.data.forEach((H,b)=>{if(H==null||typeof H!="number"||!isFinite(H))return;const L=C.value.left+(b+.5)*m-f/2+N*v+h/2,P=Be(Math.max(0,H)),F=Math.abs(Be(0)-Be(H));let j="";if(G.value&&F>0){const ee=Math.min(yo.value,y/2,F/2);j=[`M ${L} ${P+F}`,`L ${L} ${P+ee}`,`Q ${L} ${P} ${L+ee} ${P}`,`L ${L+y-ee} ${P}`,`Q ${L+y} ${P} ${L+y} ${P+ee}`,`L ${L+y} ${P+F}`,"Z"].join(" ")}t.push({x:L,y:P,width:y,height:F,color:ve(R),value:H,label:S.categories[b]||b.toString(),seriesName:k.name,animationDelay:(N*o.length+b)*(we.value/4),isHighlighted:_,isDimmed:E,isHidden:A,barPath:j,isSmooth:G.value&&F>0})})})}return t}),jo=e.computed(()=>{if(!Se.value)return[];const t=St.value.map((u,m)=>({series:u,originalIndex:m})).filter(({originalIndex:u})=>!pe.value.has(u));if(t.length===0)return[];let n=W.value==="semi-radial"?Math.PI:-Math.PI/2;const o=W.value==="semi-radial"?Math.PI:Math.PI*2,s=[];if(t.length===1){const{series:u,originalIndex:m}=t[0],f=u.data[0]||0,v=n,h=n+o-.001,y=v+o/2,k=se.value+Math.cos(v)*Me.value,N=re.value+Math.sin(v)*Me.value,R=se.value+Math.cos(h)*Me.value,_=re.value+Math.sin(h)*Me.value,E=se.value+Math.cos(h)*Y.value,A=re.value+Math.sin(h)*Y.value,H=se.value+Math.cos(v)*Y.value,b=re.value+Math.sin(v)*Y.value,z=1,B=[`M ${k} ${N}`,`A ${Me.value} ${Me.value} 0 ${z} 1 ${R} ${_}`,`L ${E} ${A}`,`A ${Y.value} ${Y.value} 0 ${z} 0 ${H} ${b}`,"Z"].join(" ");return s.push({path:B,color:ve(m),value:f,seriesName:u.name,opacity:.8,isHighlighted:$.value===m,isDimmed:!1,isHidden:!1,startAngle:v,endAngle:h,midAngle:y}),s}const d=t.reduce((u,{series:m})=>u+(m.data[0]||0),0);return d===0?[]:(t.forEach(({series:u,originalIndex:m})=>{const f=u.data[0]||0,v=f/d*o,h=n,y=n+v,k=h+v/2,N=se.value+Math.cos(h)*Me.value,R=re.value+Math.sin(h)*Me.value,_=se.value+Math.cos(y)*Me.value,E=re.value+Math.sin(y)*Me.value,A=se.value+Math.cos(y)*Y.value,H=re.value+Math.sin(y)*Y.value,b=se.value+Math.cos(h)*Y.value,z=re.value+Math.sin(h)*Y.value,B=v>Math.PI?1:0,L=[`M ${N} ${R}`,`A ${Me.value} ${Me.value} 0 ${B} 1 ${_} ${E}`,`L ${A} ${H}`,`A ${Y.value} ${Y.value} 0 ${B} 0 ${b} ${z}`,"Z"].join(" ");s.push({path:L,color:ve(m),value:f,seriesName:u.name,opacity:.8,isHighlighted:$.value===m,isDimmed:$.value!==null&&$.value!==m,isHidden:!1,startAngle:h,endAngle:y,midAngle:k}),n=y}),s)}),Ft=e.computed(()=>!tn.value||!Se.value?[]:jo.value.map((t,n)=>{if(t.isHidden)return null;const o=Bn.value,s=Hn.value,d=Tn.value,u=se.value+Math.cos(t.midAngle)*Y.value,m=re.value+Math.sin(t.midAngle)*Y.value,f=se.value+Math.cos(t.midAngle)*(Y.value+o),v=re.value+Math.sin(t.midAngle)*(Y.value+o),h=Math.cos(t.midAngle)>=0,k=f+s*(h?1:-1),N=v,R=h?f+15:f-15,_=N-d,E=h?"start":"end";return{pointerStartX:u,pointerStartY:m,pointerEndX:f,pointerEndY:v,horizontalEndX:k,horizontalEndY:N,textX:R,textY:_,text:`${t.seriesName}: ${t.value}`,color:t.color,textAnchor:E,isRightSide:h,isHighlighted:t.isHighlighted,isDimmed:t.isDimmed}}).filter(Boolean)),zt=t=>{if(!t||t.isHidden)return 0;const n=t.opacity||uo.value||.7;return $.value===null||$.value===void 0?n:$.value!==null?t.seriesIndex===$.value?Math.min(1,n+.1):Math.max(.5,n*.8):n},oo=t=>{if(!t||t.isHidden)return 0;const n=t.radius>20?.9:.8;return $.value!==null?t.seriesIndex===$.value?Math.min(1,n+.1):n*.7:n},po=(t,n)=>{if(t)try{if($.value===t.seriesIndex?$.value=null:$.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const o=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:n,chartId:S.chartId}});window.dispatchEvent(o)}}catch(o){console.error("Error in onBubbleClick:",o)}},ke=(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(" ")},Ko=(t,n)=>{t&&(n.stopPropagation(),nt.value=!0,$.value=t.seriesIndex,U.value.show=!1)},bn=(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 s=Bo.value[t];return typeof s=="function"?s(o,n):typeof o=="number"?o.toFixed(1):o?.toString()||""},no=()=>{if(!Ne.value||!U.value.data||U.value.data.length===0)return"Bubbles";const t=[],n=new Set;return U.value.data.forEach(o=>{if(o.seriesName&&o.label){const s=`${o.seriesName} - ${o.label}`;n.has(s)||(t.push(s),n.add(s))}else o.seriesName&&(n.has(o.seriesName)||(t.push(o.seriesName),n.add(o.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},Pt=(t,n)=>{t&&(nt.value=!1,$.value=null)},fo=(t,n)=>{const o=n.target.closest(".dss-custom-chart-container");if(!o)return;const s=o.getBoundingClientRect(),d=cn(t.categoryIndex),u=t.description||t.comment||"";let m=n.clientX-s.left+15,f=n.clientY-s.top-10;const v=200,h=u?80:50;m+v>I.value&&(m=n.clientX-s.left-v-15),f+h>X.value&&(f=n.clientY-s.top-h-10),m<0&&(m=10),f<0&&(f=10),$e.value={show:!0,x:m,y:f,categoryValue:d,description:u}},lo=()=>{$e.value.show=!1},pt=e.computed(()=>S.categories.length||Math.max(...eo.value.map(t=>t.data.length))),Pn=e.computed(()=>{let t=0;return eo.value.forEach(n=>{n.data.forEach(o=>{typeof o=="number"&&(t=Math.max(t,o))})}),t||100}),En=e.computed(()=>{const t=[],n=pt.value;for(let o=0;o<n;o++){const s=o*2*Math.PI/n-Math.PI/2,d=se.value+Math.cos(s)*Y.value,u=re.value+Math.sin(s)*Y.value;t.push({x:d,y:u,angle:s,index:o})}return t}),xo=e.computed(()=>{const t=[],n=pt.value;return En.value.forEach((o,s)=>{const d=Y.value+15,u=s*2*Math.PI/n-Math.PI/2,m=se.value+Math.cos(u)*d,f=re.value+Math.sin(u)*d+5;let v="middle",h="middle";Math.abs(Math.cos(u))>.5&&(v=Math.cos(u)>0?"start":"end"),Math.abs(Math.sin(u))>.5&&(h=Math.sin(u)>0?"hanging":"auto"),t.push({x:m,y:f,text:S.categories[s]||`Axis ${s+1}`,anchor:v,baseline:h})}),t}),Vn=e.ref(new Set),wo=(t,n,o)=>{const s=`current-${o}`,d=Vn.value.has(s);return!d&&$.value===null?n.fillOpacity||Z.value:n.isHighlighted||d?(n.fillOpacity||Z.value)+.15:n.isDimmed?(n.fillOpacity||Z.value)*.3:n.fillOpacity||Z.value},Go=e.computed(()=>{if(!Vt.value)return[];const t=[],n=pt.value;return St.value.forEach((o,s)=>{const d=[],u=[],m=[],f=$.value===s,v=$.value!==null&&$.value!==s,h=pe.value.has(s);for(let y=0;y<n;y++){const k=o.data[y]||0,R=k/Pn.value*Y.value,_=y*2*Math.PI/n-Math.PI/2,E=se.value+Math.cos(_)*R,A=re.value+Math.sin(_)*R;d.push(`${E},${A}`),u.push({x:E,y:A}),m.push({x:E,y:A,value:k,label:S.categories[y]||`Axis ${y+1}`,seriesName:o.name})}t.push({points:d.join(" "),polygonPoints:u,dataPoints:m,color:ve(s),fillOpacity:Z.value,seriesName:o.name,value:`${o.name}: ${o.data.join(", ")}`,isHighlighted:f,isDimmed:v,isHidden:h,seriesIndex:s})}),t}),On=(t,n)=>{if(!n||n.length<3)return!1;let o=!1;for(let s=0,d=n.length-1;s<n.length;d=s++){const u=n[s].x,m=n[s].y,f=n[d].x,v=n[d].y;m>t.y!=v>t.y&&t.x<(f-u)*(t.y-m)/(v-m)+u&&(o=!o)}return o},Zn=t=>{if(!Vt.value)return;const n=t.currentTarget.closest(".dss-custom-chart-container");if(!n)return;const o=n.getBoundingClientRect(),s=K.value?.getBoundingClientRect();if(!s)return;const d=t.clientX-s.left,u=t.clientY-s.top,m=Go.value.filter(f=>f.isHidden?!1:On({x:d,y:u},f.polygonPoints));if(m.length>0){m.length,$.value=m[0].seriesIndex;const f=t.clientX-o.left+10,v=t.clientY-o.top-10,h=200,y=50+m.length*25;let k=f,N=v;k+h>I.value&&(k=t.clientX-o.left-h-10),N+y>X.value&&(N=t.clientY-o.top-y-10),k<0&&(k=10),N<0&&(N=10);const R=m.map(_=>{let E=_.dataPoints[0],A=1/0;return _.dataPoints.forEach(H=>{const b=Math.sqrt(Math.pow(H.x-d,2)+Math.pow(H.y-u,2));b<A&&(A=b,E=H)}),{seriesName:_.seriesName,color:_.color,value:E.value!==void 0?E.value:_.value}});ue.value={show:!0,x:k,y:N,title:m.length===1?m[0].seriesName:"",value:"",spiderSeries:R}}else Ge()},ao=e.computed(()=>{const t=M.value;return t.logos.map((n,o)=>{const s=S.series[n.seriesIndex];if(!s||!s.data||s.data.length===0||pe.value.has(n.seriesIndex))return null;let d,u;if(Te.value){let f=-1,v=null;for(let y=s.data.length-1;y>=0;y--)if(s.data[y]!==null&&s.data[y]!==void 0){f=y,v=s.data[y];break}if(f===-1||v===null)return null;const h=s.data.map((y,k)=>y==null?null:{x:Ce(k),y:Be(y),index:k}).filter(y=>y!==null);if(t.animations.enabled&&!qt.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(J.value.isAnimating||!J.value.hasAnimated))if(J.value.isAnimating){const y=J.value.currentFrame/J.value.totalFrames,k=Ut(t.animations.easing,Math.min(y,1)),N=p(h,k);d=N.x+(n.offsetX||0),u=N.y+(n.offsetY||0)}else d=h[0].x+(n.offsetX||0),u=h[0].y+(n.offsetY||0);else d=Ce(f)+(n.offsetX||0),u=Be(v)+(n.offsetY||0)}else if(Se.value||Vt.value){const f=Math.PI*2/t.logos.length*o;d=se.value+Math.cos(f)*(Y.value+30)+(n.offsetX||0),u=re.value+Math.sin(f)*(Y.value+30)+(n.offsetY||0)}return{...n,x:d,y:u,seriesIndex:n.seriesIndex}}).filter(Boolean)}),Qo=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=>{pe.value.has(t)?pe.value.delete(t):pe.value.add(t)},Un=e.computed(()=>{if(!ue.value.show&&!(Le.value&&U.value.show&&!w.value.isZooming))return{display:"none"};let t,n;if(Le.value&&U.value.show&&!w.value.isZooming){t=U.value.x+15,n=C.value.top;const o=Ne.value?200:150;t+o>I.value&&(t=U.value.x-o-15),t<0&&(t=10),n<10&&(n=10)}else t=ue.value.x,n=ue.value.y;return{left:t+"px",top:n+"px"}}),Ot=(t,n)=>{if(bo.value)return;const s=n.target.closest(".dss-custom-chart-container").getBoundingClientRect();let d=n.clientX-s.left+10,u=n.clientY-s.top-10;const m=200,f=120,v=I.value,h=X.value;d+m>v&&(d=n.clientX-s.left-m-10),u+f>h&&(u=n.clientY-s.top-f-10),d<0&&(d=10),u<0&&(u=10);let y;typeof t.categoryIndex=="number"?y=t.categoryIndex:typeof t.dataIndex=="number"?y=t.dataIndex:t.label&&S.categories.includes(t.label)&&(y=S.categories.indexOf(t.label));const k=(Q.value||W.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";ue.value={show:!0,x:d,y:u,title:k,value:t.value?.toString()||"",categoryIndex:y,spiderSeries:[]}},so=e.ref(!1),nt=e.ref(!1),Ge=()=>{ue.value.show=!1,ue.value.spiderSeries=[],U.value.show=!1,so.value||($.value=null)},bo=e.ref(!1),Zt=(t,n)=>{bo.value=!0,ue.value.show=!1,U.value.show=!1;const s=n.target.closest(".dss-custom-chart-container").getBoundingClientRect();let d=n.clientX-s.left+15,u=n.clientY-s.top-10;const m=250;d+m>I.value&&(d=n.clientX-s.left-m-15),d<0&&(d=10),u<0&&(u=10),No.value={show:!0,x:d,y:u,content:t.texts,count:t.totalCount}},_e=()=>{bo.value=!1,No.value.show=!1},J=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Ut=(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}},qt=e.computed(()=>co.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Sn=()=>{if(!Yt.value||qt.value){J.value.hasAnimated=!0;return}J.value.isAnimating=!0,J.value.currentFrame=0,J.value.totalFrames=Math.ceil(Pe.value/16.67);const t=()=>{const n=J.value.currentFrame/J.value.totalFrames,o=Ut(We.value,Math.min(n,1));Nn(o),n<1?(J.value.currentFrame++,J.value.animationId=requestAnimationFrame(t)):Mn()};J.value.animationId=requestAnimationFrame(t)},Nn=t=>{const n=document.querySelector(".dss-custom-chart-container");n&&n.style.setProperty("--dss-animation-progress",t)},Mn=()=>{J.value.isAnimating=!1,J.value.hasAnimated=!0,J.value.animationId&&(cancelAnimationFrame(J.value.animationId),J.value.animationId=null)},a=e.computed(()=>{if(!Yt.value||qt.value||J.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Pe.value}ms`,t["--dss-animation-easing"]=l(We.value),t["--dss-stagger-delay"]=`${we.value}ms`,t}),l=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",r=()=>{if(!Yt.value||qt.value)return"";const t=["dss-chart-animated"];return J.value.hasAnimated||t.push(`dss-animate-${jt.value}`),J.value.hasAnimated||(Se.value?t.push("dss-animate-fill"):t.push(`dss-animate-${jt.value}`)),J.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>S.series,(t,n)=>{ct.value&&n&&J.value.hasAnimated&&(J.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Sn(),Lt.value)}))},{deep:!0}),e.watch(()=>w.value.isZooming,(t,n)=>{n&&!t&&setTimeout(()=>{dn()},50)}),e.watch(()=>[w.value.scale,w.value.offsetX],()=>{!w.value.isZooming&&!w.value.isDragging&&dn()},{flush:"post"}),e.watch([So,it],([t,n])=>{w.value.minScale=t,w.value.maxScale=n,(w.value.scale<t||w.value.scale>n)&&$o()},{immediate:!0}),e.watch(()=>S.locale,t=>{t&&t!==V.value&&(V.value=t)},{immediate:!0}),e.watch(()=>ae.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",He)}):document.removeEventListener("click",He)}),e.onMounted(()=>{$.value=null,Zo(),Yt.value&&!qt.value?setTimeout(()=>Sn(),Lt.value):J.value.hasAnimated=!0,document.addEventListener("mousemove",i),document.addEventListener("mouseup",c),document.addEventListener("click",Uo)}),e.onUnmounted(()=>{J.value.animationId&&cancelAnimationFrame(J.value.animationId),w.value.zoomTimeout&&clearTimeout(w.value.zoomTimeout),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c),document.removeEventListener("click",Uo),document.removeEventListener("click",He)});const i=t=>{if(w.value.isDragging&&w.value.scale>1&&Te.value){U.value.show=!1;const n=t.clientX-w.value.lastMouseX,{minX:o,maxX:s}=ye.value,d=s-o||1,m=n*.8;w.value.offsetX+=m;const f=d/w.value.scale,v=d-f,h=0,y=-v/d*C.value.width,k=h;w.value.offsetX=Math.max(y,Math.min(k,w.value.offsetX)),w.value.lastMouseX=t.clientX,w.value.lastMouseY=t.clientY}},c=()=>{w.value.isDragging&&(w.value.isDragging=!1,setTimeout(()=>{!w.value.isDragging&&w.value.isZooming},100))},p=(t,n)=>{const o=t.filter(f=>f!=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 s=0;const d=[];for(let f=1;f<o.length;f++){const v=o[f].x-o[f-1].x,h=o[f].y-o[f-1].y,y=Math.sqrt(v*v+h*h);d.push(y),s+=y}const u=s*n;let m=0;for(let f=0;f<d.length;f++){const v=m+d[f];if(u<=v){const h=(u-m)/d[f],y=o[f],k=o[f+1];return{x:y.x+(k.x-y.x)*h,y:y.y+(k.y-y.y)*h}}m=v}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",r()]),style:e.normalizeStyle({width:I.value+"px",height:X.value+20+"px",...a.value,cursor:qe()}),"data-chart-type":W.value,ref_key:"containerEl",ref:x,onWheel:bt,onMousedown:_n,onMousemove:rn,onMouseup:pn,onMouseleave:An,onDblclick:$o,onContextmenu:e.withModifiers(Dt,["prevent"]),onClick:e.withModifiers(Jt,["left"]),onWheelCapture:bt},[e.createElementVNode("div",Jn,[e.createElementVNode("div",el,[oe.value?(e.openBlock(),e.createElementBlock("div",tl,e.toDisplayString(oe.value),1)):e.createCommentVNode("",!0),ne.value?(e.openBlock(),e.createElementBlock("div",ol,e.toDisplayString(ne.value),1)):e.createCommentVNode("",!0)]),xe.value&&(Ae.value==="top"||Ae.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":vo.value==="horizontal","dss-legend-vertical":vo.value==="vertical","dss-legend-top":Ae.value==="top","dss-legend-bottom":Ae.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.series,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${s}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":pe.value.has(s),"dss-legend-hovered":$.value===s,"dss-legend-dimmed":$.value!==null&&$.value!==s}]),onClick:d=>en(s),onMouseenter:d=>an(s),onMouseleave:sn,style:e.normalizeStyle({animationDelay:`${s*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:ve(s)})},null,4),e.createElementVNode("span",ll,e.toDisplayString(o.name),1)],46,nl))),128))],2)):e.createCommentVNode("",!0),xe.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(S.series,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${s}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":pe.value.has(s),"dss-legend-hovered":$.value===s,"dss-legend-dimmed":$.value!==null&&$.value!==s}]),onClick:d=>en(s),onMouseenter:d=>an(s),onMouseleave:sn,style:e.normalizeStyle({animationDelay:`${s*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:ve(s)})},null,4),e.createElementVNode("span",sl,e.toDisplayString(o.name),1)],46,al))),128))],2)):e.createCommentVNode("",!0)]),T.showAddMarkerButton&&he.value.addMarker&&(Te.value||Ne.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Ze,title:e.unref(O)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:et.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,il),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,rl)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:I.value,height:X.value,class:"dss-chart-svg","data-smooth":G.value,"data-animated":Yt.value,ref_key:"svgEl",ref:K},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",dl,[e.createElementVNode("rect",{x:C.value.left,y:C.value.top,width:C.value.width,height:C.value.height*4},null,8,ul)])]),Te.value||Ne.value?(e.openBlock(),e.createElementBlock("g",ml,[q.value?(e.openBlock(),e.createElementBlock("g",pl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zn.value,(o,s)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${s}`,x1:C.value.left,x2:C.value.right,y1:o.y,y2:o.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${s*50}ms`})},null,12,fl))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",vl,[e.createElementVNode("line",{x1:C.value.left,x2:C.value.right,y1:C.value.bottom,y2:C.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,gl),e.createElementVNode("line",{x1:C.value.left,x2:C.value.left,y1:C.value.top,y2:C.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,hl)]),e.createElementVNode("g",yl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qo.value,(o,s)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${s}`,x:o.x,y:o.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${s*100}ms`})},e.toDisplayString(o.text),13,Cl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wo.value,(o,s)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${s}`,x:o.x,y:o.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${s*80}ms`})},e.toDisplayString(o.text),13,kl))),128)),rt.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:C.value.left+C.value.width/2,y:C.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(rt.value),9,xl)):e.createCommentVNode("",!0),Vo.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:C.value.top+12+C.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${C.value.top+C.value.height/2})`},e.toDisplayString(Vo.value),9,wl)):e.createCommentVNode("",!0)]),on.value.length>0?(e.openBlock(),e.createElementBlock("g",bl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,o=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${o.categoryIndex}`},[e.createElementVNode("g",El,[o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x,y1:C.value.bottom,y2:C.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:s=>Zt(o,s),onMouseleave:_e},null,40,Vl)):e.createCommentVNode("",!0),o.hasAuto&&!o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x,y1:C.value.bottom,y2:C.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:s=>Zt(o,s),onMouseleave:_e},null,40,Sl)):e.createCommentVNode("",!0),o.hasAuto&&o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x,y1:C.value.bottom,y2:C.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:s=>Zt(o,s),onMouseleave:_e},null,40,Nl)):e.createCommentVNode("",!0)]),o.hasManual&&o.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:o.x+8,cy:Math.max(15,C.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:s=>Zt(o,s),onMouseleave:_e},null,40,Ml)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:o.x,cy:Math.max(15,C.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:s=>Zt(o,s),onMouseleave:_e},null,40,Bl),e.createElementVNode("text",{x:o.x,y:Math.max(15,C.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,Hl)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Tl,[je.value?(e.openBlock(),e.createElementBlock("g",Al,[e.createElementVNode("g",Ll,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wn.value,(o,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${s}`},[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:d=>Ot(o,d),onMouseleave:Ge},null,46,$l)):(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:d=>Ot(o,d),onMouseleave:Ge},null,46,Dl))],64))),128))]),e.createElementVNode("g",Il,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cn.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${s}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?de.value+2:de.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,Rl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kn.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${s}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?de.value+2:de.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,_l))),128)),me.value>0||Tt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ro.value,(o,s)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${s}`,cx:o.x,cy:o.y,r:o.isHighlighted?Je(o,me.value)+2:Je(o,me.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:d=>Ot(o,d),onMouseleave:Ge},null,46,Fl))),128)):e.createCommentVNode("",!0)])])):W.value==="line"?(e.openBlock(),e.createElementBlock("g",zl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xn.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${s}`,d:o.path,stroke:o.color,"stroke-width":de.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":J.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${o.animationDelay}ms`})},null,14,Pl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cn.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${s}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?de.value+2:de.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(kn.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${s}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?de.value+2:de.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,Zl))),128)),me.value>0||Tt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(mo.value,(o,s)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${s}`,cx:o.x,cy:o.y,r:o.isHighlighted?Je(o,me.value)+2:Je(o,me.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:d=>Ot(o,d),onMouseleave:Ge},null,46,Ul))),128)):e.createCommentVNode("",!0)])):W.value==="area"?(e.openBlock(),e.createElementBlock("g",ql,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yo.value,(o,s)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${s}`,id:`area-mask-${s}-${T.chartId}`},[e.createElementVNode("rect",{x:C.value.left-10,y:C.value.top-10,width:C.value.width+20,height:C.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${C.value.width+20}px`})},null,12,Xl)],8,Wl))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yo.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${s}`,d:o.areaPath,fill:o.color,"fill-opacity":o.isHighlighted?ho.value+.2:ho.value,mask:`url(#area-mask-${s}-${T.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,Yl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yo.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${s}`,d:o.linePath,stroke:o.color,"stroke-width":o.isHighlighted?de.value+1:de.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:`${s*we.value}ms`})},null,14,jl))),128))])):W.value==="bar"?(e.openBlock(),e.createElementBlock("g",Kl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wn.value,(o,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${s}`},[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:d=>Ot(o,d),onMouseleave:Ge},null,46,Gl)):(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:d=>Ot(o,d),onMouseleave:Ge},null,46,Ql))],64))),128))])):e.createCommentVNode("",!0)]),Le.value&&U.value.show&&!w.value.isZooming?(e.openBlock(),e.createElementBlock("g",Jl,[e.createElementVNode("line",{x1:U.value.x,x2:U.value.x,y1:C.value.top,y2:C.value.bottom,stroke:go.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,ea),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value.data,(o,s)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${s}`,cx:U.value.x,cy:o.y,r:me.value+2,fill:o.color,stroke:"#fafafa","stroke-width":"2",opacity:"0.9"},null,8,ta))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ne.value?(e.openBlock(),e.createElementBlock("g",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,(o,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${s}`},[o?(e.openBlock(),e.createElementBlock("g",na,[e.createElementVNode("circle",{cx:o.x,cy:o.y,r:o.radius,fill:o.color,"fill-opacity":zt(o),stroke:o.color,"stroke-width":o.isHighlighted?3:1,"stroke-opacity":"0.8",class:e.normalizeClass(ke(o,s)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:d=>Ko(o,d),onMouseleave:d=>Pt(o),onClick:d=>po(o,d)},null,42,la),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-${s} ${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:oo(o)}),onLoad:d=>vn(s),onError:d=>gn(s),onMouseenter:d=>Ko(o,d),onMouseleave:d=>Pt(o),onClick:d=>po(o,d)},null,46,aa)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),Se.value?(e.openBlock(),e.createElementBlock("g",sa,[W.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:se.value,cy:re.value,r:Y.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,ra)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":W.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jo.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${s}`,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:d=>Ot(o,d),onMouseleave:Ge},null,42,ca))),128))],8,ia),tn.value?(e.openBlock(),e.createElementBlock("g",da,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ft.value,(o,s)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${s}`,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:`${s*100}ms`})},null,12,ua),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:`${s*120}ms`})},null,12,ma),e.createElementVNode("text",{x:o.textX,y:o.textY,"text-anchor":o.textAnchor,"font-size":xt.value,"dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${s*150}ms`})},e.toDisplayString(o.text),13,pa)],2))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Vt.value?(e.openBlock(),e.createElementBlock("g",fa,[q.value?(e.openBlock(),e.createElementBlock("g",va,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,(o,s)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${s}`,cx:se.value,cy:re.value,r:o,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${s*150}ms`})},null,12,ga))),128)),e.createElementVNode("g",ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,(o,s)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${s}`},[e.createElementVNode("rect",{x:se.value-16,y:re.value-o-7,width:"32",height:"16",fill:"#fafafa",stroke:"none"},null,8,ya),e.createElementVNode("text",{x:se.value,y:re.value-o+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString($t(s)),9,Ca)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(En.value,(o,s)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${s}`,x1:se.value,x2:o.x,y1:re.value,y2:o.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${s*100}ms`})},null,12,ka))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(o,s)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${s}`,x:o.x+Math.cos(s*2*Math.PI/pt.value-Math.PI/2)*16,y:o.y+Math.sin(s*2*Math.PI/pt.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:`${s*120}ms`})},e.toDisplayString(o.text.charAt(0).toUpperCase()+o.text.slice(1)),13,wa))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Zn,onMouseleave:Ge},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Go.value,(o,s)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${s}`},[e.createElementVNode("polygon",{points:o.points,fill:o.color,"fill-opacity":wo("current",o,s),stroke:o.color,"stroke-width":o.isHighlighted?de.value+1:de.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:`${s*we.value}ms`,transition:"all 0.2s ease"})},null,14,ba),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.dataPoints,(d,u)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${s}-${u}`,cx:d.x,cy:d.y,r:o.isHighlighted?me.value+1:me.value>0?me.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:`${s*we.value+u*50}ms`,transition:"all 0.2s ease"}),onMouseover:m=>Ot(d,m),onMouseleave:Ge},null,46,Ea))),128))]))),128))],32)])):e.createCommentVNode("",!0),e.createElementVNode("g",Va,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ao.value,(o,s)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${s}`,cx:o.x,cy:o.y,r:o.width/2,fill:ve(o.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${s}`),style:e.normalizeStyle({animationDelay:`${s*200}ms`})},null,14,Sa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ao.value,(o,s)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${s}`,x:o.x-o.width/2,y:o.y-o.height/2,width:o.width,height:o.height,"xlink:href":o.url,onLoad:d=>Qo(s),onError:d=>Jo(s),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${s}`),"clip-path":`circle(${o.width/2}px at ${o.width/2}px ${o.height/2}px)`,style:e.normalizeStyle({animationDelay:`${s*200}ms`})},null,46,Na))),128))])],8,cl)),tt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:I.value+"px",height:X.value+"px",backgroundImage:`url('${zo.value}')`,backgroundRepeat:"no-repeat",...kt.value,opacity:ut.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value,(o,s)=>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:le.value+"px",height:le.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(d=>ce(o),["stop"]),onMouseenter:d=>fo(o,d),onMouseleave:lo},[e.createElementVNode("img",{src:ko(o),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Ba)],44,Ma)),[[e.vShow,gt.value]])),128)),$e.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:$e.value.x+"px",top:$e.value.y+"px"})},[e.createElementVNode("div",Ha,e.toDisplayString($e.value.categoryValue),1),$e.value.description?(e.openBlock(),e.createElementBlock("div",Ta,e.toDisplayString($e.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),ue.value.show||Le.value&&U.value.show&&!w.value.isZooming?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Le.value&&U.value.show&&!w.value.isZooming}]),style:e.normalizeStyle(Un.value)},[!Le.value||!U.value.show||w.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Vt.value&&ue.value.spiderSeries&&ue.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Aa,[ue.value.title?(e.openBlock(),e.createElementBlock("div",La,e.toDisplayString(ue.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ue.value.spiderSeries,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${s}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",$a,e.toDisplayString(o.seriesName)+":",1),e.createElementVNode("span",Da,e.toDisplayString(o.value),1)]))),128))])):(e.openBlock(),e.createElementBlock("div",Ia,[e.createElementVNode("div",Ra,e.toDisplayString(ue.value.title),1),e.createElementVNode("div",_a,e.toDisplayString(ue.value.value),1)])),ue.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[mt(ue.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Fa,[n[6]||(n[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",za,e.toDisplayString(e.unref(O)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt(ue.value.categoryIndex).flagGroups,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${s}`},[e.createElementVNode("div",Pa,[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,(d,u)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${s}-${u}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Oa,[e.createElementVNode("div",Za,e.toDisplayString(d.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),mt(ue.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ua,[n[7]||(n[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",qa,e.toDisplayString(e.unref(O)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt(ue.value.categoryIndex).markers,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${s}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("div",Wa,[e.createElementVNode("div",Xa,e.toDisplayString(o.title),1),o.description?(e.openBlock(),e.createElementBlock("div",Ya,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",ja,[e.createElementVNode("div",Ka,e.toDisplayString(Ne.value?no():T.categories[U.value.categoryIndex]||`Category ${U.value.categoryIndex+1}`),1),Ne.value?(e.openBlock(),e.createElementBlock("div",Ga,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value.data,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${s}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(o.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(U.value.data,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${s}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",Qa,e.toDisplayString(o.seriesName)+":",1),e.createElementVNode("span",Ja,e.toDisplayString(o.value),1)]))),128))]),mt(U.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",es,[n[8]||(n[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ts,e.toDisplayString(e.unref(O)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt(U.value.categoryIndex).flagGroups,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${s}`},[e.createElementVNode("div",os,[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,(d,u)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${s}-${u}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",ns,[e.createElementVNode("div",ls,e.toDisplayString(d.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),mt(U.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",as,[n[9]||(n[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ss,e.toDisplayString(e.unref(O)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt(U.value.categoryIndex).markers,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${s}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("div",rs,[e.createElementVNode("div",is,e.toDisplayString(o.title),1),o.description?(e.openBlock(),e.createElementBlock("div",cs,e.toDisplayString(o.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Te.value&&Ue.value&&w.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:$o},[n[10]||(n[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(w.value.scale*100))+"% "+e.toDisplayString(e.unref(O)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Qn),ae.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ae.value.x+"px",top:ae.value.y+"px"}),onClick:n[0]||(n[0]=e.withModifiers(()=>{},["stop"]))},[he.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:_t},e.toDisplayString(e.unref(O)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),he.value.addMarker&&(he.value.downloadSvg||he.value.downloadPng||he.value.downloadCsv||Ye.value.length>0)?(e.openBlock(),e.createElementBlock("div",ds)):e.createCommentVNode("",!0),he.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Lo},e.toDisplayString(e.unref(O)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),he.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Rt},e.toDisplayString(e.unref(O)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),he.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:In},e.toDisplayString(e.unref(O)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Ye.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[he.value.downloadSvg||he.value.downloadPng||he.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",us)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,(o,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+s},[o.separator?(e.openBlock(),e.createElementBlock("div",ms)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Po(o)),style:e.normalizeStyle($n(o)),onClick:d=>Rn(o)},[o.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Ln(o),class:"dss-custom-menu-content"},null,8,fs)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.icon?(e.openBlock(),e.createElementBlock("span",vs,e.toDisplayString(o.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(o.label),1)],64))],14,ps)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),D.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:Oe},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:n[4]||(n[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",gs,[e.createElementVNode("h3",null,e.toDisplayString(Qt.value?e.unref(O)("chart.modalMarker.viewMarker"):Gt.value?e.unref(O)("chart.modalMarker.editMarker"):e.unref(O)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Oe},"×")]),e.createElementVNode("div",hs,[e.createElementVNode("div",ys,[D.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Cs,e.toDisplayString(cn(D.value.categoryIndex)||""),1)),D.value.fromButton?(e.openBlock(),e.createElementBlock("div",ks,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":n[1]||(n[1]=o=>D.value.categoryIndex=o),class:"dss-form-select",disabled:Qt.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ln.value,(o,s)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${s}`,value:s},e.toDisplayString(o),9,ws))),128))],8,xs),[[e.vModelSelect,D.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",bs,[e.createElementVNode("label",Es,e.toDisplayString(e.unref(O)("chart.modalMarker.description")),1),Qt.value?(e.openBlock(),e.createElementBlock("div",Vs,e.toDisplayString(D.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":n[2]||(n[2]=o=>D.value.description=o),placeholder:e.unref(O)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,Ss)),[[e.vModelText,D.value.description]])]),e.createElementVNode("div",Ns,[e.createElementVNode("label",null,e.toDisplayString(e.unref(O)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",Ms,[e.createElementVNode("img",{src:ko({type:D.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,Bs)])])]),e.createElementVNode("div",Hs,[e.createElementVNode("div",Ts,[Gt.value&&!Qt.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:To},e.toDisplayString(e.unref(O)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",As,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Oe},e.toDisplayString(Qt.value?e.unref(O)("chart.modalMarker.close"):e.unref(O)("chart.modalMarker.cancel")),1),Qt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:wt,disabled:!(D.value.description&&D.value.description.length)},e.toDisplayString(Gt.value?e.unref(O)("chart.modalMarker.save"):e.unref(O)("chart.contextMenu.addMarker")),9,Ls))])])])])):e.createCommentVNode("",!0)],64))}}),Is={class:"dss-modal-title"},Rs={class:"dss-modal-actions"},qn={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(T,{emit:Wt}){const O=T,V=Wt,vt=e.ref(null),x=e.ref(null),K=e.computed(()=>{const I={"max-width":O.width};return O.height!=="auto"&&(I.height=O.height,I["min-height"]="0"),I}),Bt=e.computed(()=>({}));function S(){V("close-modal")}function g(){O.backDrop&&!vt.value&&V("close-modal")}function De(I){I.target.tagName==="INPUT"&&(vt.value=I.target.tagName)}function ze(){setTimeout(()=>{vt.value=null},300)}function Qe(){const I=document.body,X=document.documentElement;x.value={bodyOverflow:I.style.overflow,bodyPosition:I.style.position,bodyTop:I.style.top,bodyWidth:I.style.width,htmlOverflow:X.style.overflow,scrollY:window.scrollY},I.style.overflow="hidden",I.style.position="fixed",I.style.top=`-${x.value.scrollY}px`,I.style.width="100%",I.style.left="0",X.style.overflow="hidden"}function M(){if(!x.value)return;const I=document.body,X=document.documentElement,{bodyOverflow:W,bodyPosition:st,bodyTop:oe,bodyWidth:ne,htmlOverflow:rt,scrollY:Vo}=x.value;I.style.overflow=W||"",I.style.position=st||"",I.style.top=oe||"",I.style.width=ne||"",I.style.left="",X.style.overflow=rt||"",window.scrollTo(0,Vo||0)}return e.watch(()=>O.showModal,I=>{if(I)Qe(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const X=document.getElementById("dss-modal-backdrop");X&&(X.addEventListener("focusin",De),X.addEventListener("focusout",ze))},100);else{M(),document.body.classList.remove("dss-modal-open");const X=document.getElementById("dss-modal-backdrop");X&&(X.removeEventListener("focusin",De),X.removeEventListener("focusout",ze))}},{immediate:!0}),e.onUnmounted(()=>{O.showModal&&M()}),(I,X)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.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(K.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:X[0]||(X[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":T.headerType,"font-size":T.titleSize})},[e.createElementVNode("h1",Is,[e.renderSlot(I.$slots,"title",{},()=>[X[1]||(X[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(I.$slots,"title-data"),T.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:S,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(Bt.value)},[e.renderSlot(I.$slots,"content",{},()=>[X[2]||(X[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Rs,[e.renderSlot(I.$slots,"actions")])])],4),[[e.vShow,T.showModal]])])):e.createCommentVNode("",!0)]))}},_s={class:"dss-toolbar-left"},Fs=["title"],zs=["title"],Ps={class:"dss-toolbar-dropdown-wrapper"},Os=["title"],Zs={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"},Us={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"},qs={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"},Ws={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"},Xs={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"},Ys={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"},js={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Ks=["title"],Gs=["title"],Qs=["title"],Js=["title"],er=["title"],tr=["title"],or=["title"],nr=["title"],lr=["title"],ar={key:2,class:"dss-toolbar-separator"},sr=["title"],rr={key:4,class:"dss-toolbar-separator"},ir={key:5,class:"dss-toolbar-dropdown-wrapper"},cr=["title"],dr={class:"dss-toolbar-dropdown-ai"},ur={class:"dss-toolbar-right"},mr={key:0,class:"dss-toolbar-custom-group"},pr={key:1,class:"dss-toolbar-separator"},fr={class:"dss-link-modal-content"},vr={class:"dss-link-modal-field"},gr={class:"dss-link-modal-field"},hr={class:"dss-link-modal-label"},yr=["placeholder"],Cr={class:"dss-image-modal-tabs"},kr={key:0,class:"dss-image-tab-content"},xr={class:"dss-link-modal-content"},wr={class:"dss-link-modal-field"},br={key:0,class:"dss-link-modal-label"},Er=["src"],Vr={class:"dss-link-modal-field"},Sr={class:"dss-link-modal-label"},Nr={class:"dss-link-modal-field"},Mr={class:"dss-link-modal-label"},Br={class:"dss-link-modal-field"},Hr={class:"dss-link-modal-label"},Tr={key:1,class:"dss-image-tab-content"},Ar={class:"dss-link-modal-content"},Lr={class:"dss-link-modal-field"},$r={class:"dss-link-modal-field"},Dr={class:"dss-link-modal-label"},Ir={class:"dss-link-modal-field"},Rr={class:"dss-link-modal-label"},_r={class:"dss-link-modal-field"},Fr={class:"dss-link-modal-label"},zr={class:"dss-text-editor-title-input-container"},Pr={key:0,class:"dss-text-editor-title-preview"},Or={key:0},Zr={key:1,class:"dss-text-editor-preview-placeholder"},Ur=["value","placeholder","disabled"],qr={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Wr={class:"dss-text-editor-description-input-container"},Xr={key:0,class:"dss-text-editor-description-preview"},Yr={key:0},jr={key:1,class:"dss-text-editor-preview-placeholder"},Kr=["value","placeholder","disabled"],Gr={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Qr=["data-comment-id","onMouseenter"],Jr=["onClick"],ei=["src","alt"],ti={key:1},oi=["onClick"],ni=["src","alt"],li={key:1},ai=["data-has-second-user","onClick"],si={class:"editor-comment-marker-count"},ri={key:4,class:"dss-text-editor-textarea-wrapper"},ii=["value","placeholder","rows","disabled"],ci={class:"dss-text-editor-footer"},di={class:"dss-text-editor-footer-content"},ui={class:"dss-text-editor-footer-stat"},mi={class:"dss-text-editor-footer-stat"},pi={key:5,class:"dss-text-editor-content-wrapper"},fi={key:0,class:"dss-comment-overlay-body"},vi={class:"dss-comment-selection-wrapper"},gi=["innerHTML"],hi={key:0,class:"dss-comment-avatar-wrapper"},yi={class:"dss-comment-avatar"},Ci=["src","alt"],ki={key:1},xi={class:"dss-comment-header"},wi={class:"dss-comment-header-text"},bi={class:"dss-comment-author"},Ei={key:0,class:"dss-comment-date"},Vi=["onClick","title"],Si={class:"dss-comment-overlay-inner"},Ni=["placeholder","onKeydown"],Mi={class:"dss-text-editor-footer"},Bi={class:"dss-text-editor-footer-content"},Hi={class:"dss-text-editor-footer-stat"},Ti={class:"dss-text-editor-footer-stat"},Ai=["title"],Li=["title"],$i={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:""},Di={class:"dss-image-popup-content"},Ii={key:0,class:"dss-image-popup-no-alt-icon"},Ri=["title"],_i=["title"],Fi={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:""},zi={class:"dss-toolbar-left"},Pi=["title"],Oi=["title"],Zi={class:"dss-toolbar-dropdown-wrapper"},Ui=["title"],qi={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"},Wi={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"},Xi={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"},Yi={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"},ji={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"},Ki={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"},Gi={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Qi=["title"],Ji=["title"],ec=["title"],tc=["title"],oc=["title"],nc=["title"],lc=["title"],ac=["title"],sc=["title"],rc=["title"],ic={key:2,class:"dss-toolbar-separator"},cc={key:3,class:"dss-toolbar-dropdown-wrapper"},dc=["title"],uc={class:"dss-toolbar-dropdown-ai"},mc={key:0,class:"dss-toolbar-right"},pc={key:0,class:"dss-toolbar-separator"},fc={key:0,class:"dss-toolbar-custom-group"},vc={key:1,class:"dss-toolbar-separator"},gc={name:"DSSTextEditor"},hc=Object.assign(gc,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(T,{expose:Wt,emit:O}){const{t:V,locale:vt}=Yn.useI18n(),x=T,K=O,Bt=e.useSlots(),S=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
75
|
+
`}const o=new Blob([t],{type:"text/csv;charset=utf-8;"}),s=URL.createObjectURL(o),d=document.createElement("a");d.href=s,d.download=ot("csv"),document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(s),Jt()}catch(t){console.error("Error downloading CSV:",t)}},_n=t=>{if(typeof t.action=="function"){const n={series:S.series,categories:S.categories,markers:Ee.value},o={chartX:ae.value.chartX,chartY:ae.value.chartY,dataX:ae.value.mouseDataX,dataY:ae.value.mouseDataY,categoryIndex:clampedCategoryIndex||ae.value.categoryIndex};t.action(n,o)}Jt()},Rt=()=>{Oe(),D.value.show=!0,D.value.categoryIndex=ae.value.categoryIndex,D.value.fromButton=!1,Jt()},Ze=()=>{Oe(),D.value.show=!0,D.value.categoryIndex=0,D.value.fromButton=!0},Uo=t=>{if(ae.value.show){const n=document.querySelector(".dss-context-menu");n&&!n.contains(t.target)&&(ae.value.show=!1)}},He=t=>{ae.value.show&&!t.target.closest(".context-menu")&&(ae.value.show=!1)},bt=t=>{if(!Te.value||!Ue.value)return;t.preventDefault(),t.stopPropagation(),b.value.isZooming=!0,U.value.show=!1,b.value.zoomTimeout&&clearTimeout(b.value.zoomTimeout);const o=t.currentTarget.getBoundingClientRect(),s=t.clientX-o.left,d=t.clientY-o.top;if(s<C.value.left-50||s>C.value.right+50||d<C.value.top-50||d>C.value.bottom+100){b.value.isZooming=!1;return}const u=t.deltaY>0?.9:1.1,m=Math.max(b.value.minScale,Math.min(b.value.maxScale,b.value.scale*u));if(m!==b.value.scale){const{minX:f,maxX:v}=ye.value,h=v-f||1,y=h/b.value.scale,k=f-b.value.offsetX/C.value.width*h,N=(s-C.value.left)/C.value.width,_=k+N*y;b.value.scale=m;const R=h/b.value.scale,V=_-N*R;b.value.offsetX=-(V-f)/h*C.value.width,b.value.scale<=1.01&&(b.value.scale=1,b.value.offsetX=0)}b.value.zoomTimeout=setTimeout(()=>{b.value.isZooming=!1,b.value.zoomTimeout=null},300)},Rn=t=>{if(!Te.value||!Ue.value||b.value.scale<=1)return;U.value.show=!1;const o=t.currentTarget.getBoundingClientRect();t.clientX-o.left,t.clientY-o.top,b.value.isDragging=!0,b.value.lastMouseX=t.clientX,b.value.lastMouseY=t.clientY,t.preventDefault()},pn=()=>{b.value.isDragging=!1},$o=()=>{!Te.value||!Ue.value||(b.value.scale=1,b.value.offsetX=0,b.value.isDragging=!1,b.value.zoomTimeout&&(clearTimeout(b.value.zoomTimeout),b.value.zoomTimeout=null),b.value.isZooming=!1)},qe=()=>!Te.value||!Ho.value||!Ue.value?"default":b.value.isDragging?"grabbing":b.value.scale>1?"grab":"dss-crosshair",Do=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 s=t[Math.max(o-1,0)],d=t[o],u=t[o+1],m=t[Math.min(o+2,t.length-1)],f=d.x+(u.x-s.x)/6*At.value,v=d.y+(u.y-s.y)/6*At.value,h=u.x-(m.x-d.x)/6*At.value,y=u.y-(m.y-d.y)/6*At.value;n+=` C ${f} ${v} ${h} ${y} ${u.x} ${u.y}`}return n},Et=e.computed(()=>{let n=50+(rt.value?30:0)+60;if(Vt.value)return{left:90,top:90,right:90,bottom:90};if(Se.value){let m=0;oe.value&&(m+=15),ne.value&&(m+=10);const f=ze();let v=66,h=50;return xe.value&&Ae.value==="left"?v+=f.legendWidth||150:xe.value&&Ae.value==="right"&&(h+=f.legendWidth||150),{left:v,top:50+m,right:h,bottom:130}}let o=0;oe.value&&(o+=15),ne.value&&(o+=10);const s=ze();let d=66,u=50;return xe.value&&Ae.value==="left"?d+=s.legendWidth||150:xe.value&&Ae.value==="right"&&(u+=s.legendWidth||150),xe.value&&Ae.value==="bottom"&&(n+=s.legendHeight||0),{left:d,top:50+o,right:u,bottom:n}}),C=e.computed(()=>({left:Et.value.left,top:Et.value.top,right:I.value-Et.value.right,bottom:X.value-Et.value.bottom,width:I.value-(Et.value.left+Et.value.right),height:X.value-(Et.value.top+Et.value.bottom)})),Te=e.computed(()=>["line","area","bar"].includes(W.value)||st.value),je=e.computed(()=>st.value),Se=e.computed(()=>["radial","semi-radial"].includes(W.value)),Vt=e.computed(()=>W.value==="spider"),Ne=e.computed(()=>W.value==="bubble"),Q=e.computed(()=>M.value?.chart?.orientation==="horizontal"&&(W.value==="bar"||je.value)),Ie=t=>{const{minY:n,maxY:o}=ye.value,s=o-n||1;return C.value.left+(t-n)/s*C.value.width},Ke=t=>{const{maxX:n}=ye.value,o=n+1,d=C.value.height/o;return C.value.top+(t+.5)*d},se=e.computed(()=>I.value/2),re=e.computed(()=>Vt.value?X.value/2-40:X.value/2),Y=e.computed(()=>{if(Vt.value){const t=C.value.width-80,n=C.value.height-80;return Math.min(t,n)/2}return Math.min(C.value.width,C.value.height)/2}),Me=e.computed(()=>Y.value*.45),_e=e.computed(()=>M.value?.bubbles?.minSize||8),Io=e.computed(()=>M.value?.bubbles?.maxSize||50),uo=e.computed(()=>M.value?.bubbles?.opacity||.7),fn=(t,n)=>{const o=[15,20,25,18,22],s=o[t%o.length]||20,d=1+Math.sin(n*.5)*.2;return Math.max(5,s*d)},vn=t=>{const n=document.querySelector(`.dss-bubble-image-${t}`);n&&(n.style.opacity="1")},gn=t=>{const n=document.querySelector(`.dss-bubble-image-${t}`);n&&(n.style.display="none")},St=e.computed(()=>S.series),eo=e.computed(()=>S.series.filter((t,n)=>!pe.value.has(n))),Nt="auto",ye=e.computed(()=>{if(Ne.value)return Fn();if(!eo.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,n=-1/0,o=0;eo.value.forEach(f=>{f.data&&f.data.length&&(o=Math.max(o,f.data.length-1),f.data.forEach(v=>{typeof v=="number"&&(t=Math.min(t,v),n=Math.max(n,v))}))}),S.categories.length>0&&(o=Math.max(o,S.categories.length-1)),t===1/0&&(t=0,n=100);const s=fe.value,d=Ht.value;let u,m;if(s===Nt){const f=n-t,v=f>0?f*.1:1;u=Math.max(0,t-v)}else if(typeof s=="number")u=s;else{const f=n-t,v=f>0?f*.1:1;u=Math.max(0,t-v)}if(d===Nt){const f=n-t,v=f>0?f*.1:2;m=n+v}else if(typeof d=="number")m=d;else{const f=n-t,v=f>0?f*.1:2;m=n+v}return{minX:0,maxX:o,minY:u,maxY:m}}),Fn=()=>{if(!eo.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,s=-1/0,d=1/0,u=-1/0,m=!1;if(eo.value.forEach((_,R)=>{_?.data?.length&&_.data.forEach((V,A)=>{let H,E,z;if(typeof V=="object"&&V!==null&&!Array.isArray(V))H=typeof V.x=="number"?V.x:A,E=typeof V.y=="number"?V.y:0,z=typeof V.size=="number"?V.size:20;else if(Array.isArray(V)&&V.length>=3)H=typeof V[0]=="number"?V[0]:A,E=typeof V[1]=="number"?V[1]:0,z=typeof V[2]=="number"?V[2]:20;else if(typeof V=="number")H=A,E=V,z=fn(R,A);else return;isFinite(H)&&isFinite(E)&&isFinite(z)&&(t=Math.min(t,H),n=Math.max(n,H),o=Math.min(o,E),s=Math.max(s,E),d=Math.min(d,z),u=Math.max(u,z),m=!0)})}),!m)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===n&&(t=Math.min(t,0),n=Math.max(n,S.categories?.length-1||8)),o===s&&(o=Math.max(0,o-10),s=o+20);const f=n-t,v=s-o;let h,y,k,N;return Xt.value!==null?h=Xt.value:h=t-f*.1,ro.value!==null?y=ro.value:y=n+f*.1,fe.value!==null&&typeof fe.value=="number"?k=fe.value:k=Math.max(0,o-v*.1),Ht.value!==null&&typeof Ht.value=="number"?N=Ht.value:N=s+v*.1,{minX:h,maxX:y,minY:k,maxY:N,minSize:d,maxSize:u}},Ce=t=>{if(Ne.value){const{minX:f,maxX:v}=ye.value,h=v-f||1;return C.value.left+(t-f)/h*C.value.width}const{minX:n,maxX:o}=ye.value,s=o-n;if(o===0||s===0)return C.value.left+C.value.width/2;const d=s/b.value.scale,u=n-b.value.offsetX/C.value.width*s,m=(t-u)/d;return C.value.left+m*C.value.width},Be=t=>{const{minY:n,maxY:o}=ye.value,s=o-n||1;return C.value.bottom-(t-n)/s*C.value.height},hn=t=>{if(!Ne.value)return me.value||4;const{minSize:n,maxSize:o}=ye.value,s=o-n||1;if(s===0)return(_e.value+Io.value)/2;const d=(t-n)/s;return _e.value+d*(Io.value-_e.value)},zn=e.computed(()=>Wo.value.map(t=>({y:t.y}))),qo=e.computed(()=>{if(Ne.value)return yn();if(W.value==="bar"){if(Q.value){const B=[],{minY:L,maxY:P}=ye.value,F=5,j=P-L||1;for(let ee=0;ee<=F;ee++){const Fe=L+j*(ee/F),ge=Ie(Fe);B.push({x:ge,y:C.value.bottom+20,text:Math.round(Fe).toString()})}return B}const R=[],{maxX:V}=ye.value,A=V+1,H=5,z=(C.value.width-H*2)/A;for(let B=0;B<=V;B++){const L=C.value.left+H+(B+.5)*z;R.push({x:L,y:C.value.bottom+20,text:S.categories[B]||O("chart.fallback.item",{number:B+1})})}return R}const t=[],{minX:n,maxX:o}=ye.value,s=o-n||1,d=s/b.value.scale,u=n-b.value.offsetX/C.value.width*s,m=u+d,f=Math.max(0,Math.floor(u-2)),v=Math.min(o,Math.ceil(m+2)),h=v-f,y=C.value.width,N=Math.floor(y/60);let _=1;h>N&&(_=Math.ceil(h/N));for(let R=f;R<=v;R+=_)if(R>=0&&R<=o){const V=Ce(R);V>=C.value.left-100&&V<=C.value.right+100&&t.push({x:V,y:C.value.bottom+20,text:S.categories[R]||`Item ${R+1}`})}return t}),yn=()=>{const t=[],{minX:n,maxX:o}=ye.value,s=o-n||1,d=Math.min(8,Math.max(4,Math.floor(C.value.width/80)));for(let u=0;u<=d;u++){const m=n+s*u/d,f=Ce(m);if(f>=C.value.left-10&&f<=C.value.right+10){const v=Math.round(m),h=S.categories?.[v];t.push({x:f,y:C.value.bottom+20,text:h||(Number.isInteger(m)?m.toString():m.toFixed(1))})}}return t},Wo=e.computed(()=>{if(Q.value){const d=[],{maxX:u}=ye.value;for(let m=0;m<=u;m++)d.push({x:C.value.left-10,y:Ke(m),text:S.categories[m]||`Item ${m+1}`});return d}const t=[],{minY:n,maxY:o}=ye.value,s=5;for(let d=0;d<=s;d++){const u=n+(o-n)*(d/s),m=Math.round(u);t.push({x:C.value.left-10,y:Be(u),text:m.toString()})}return t}),ve=t=>{const n=io.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]},Xo=t=>{let n=0;for(let o=1;o<t.length;o++){const s=t[o].x-t[o-1].x,d=t[o].y-t[o-1].y;n+=Math.sqrt(s*s+d*d)}return n},Cn=e.computed(()=>W.value==="line"||je.value?(je.value?S.series.filter(n=>(n.type||W.value)==="line"):St.value).map((n,o)=>{const s=S.series.findIndex(k=>k===n),d=[];let u=[];n.data.forEach((k,N)=>{k==null?u.length>0&&(d.push([...u]),u=[]):u.push({x:Q.value?Ie(k):Ce(N),y:Q.value?Ke(N):Be(k),index:N})}),u.length>0&&d.push(u);let m="";d.forEach(k=>{if(k.length>0){let N="";G.value?N=Do(k):N=`M ${k[0].x} ${k[0].y}`+k.slice(1).map(_=>` L ${_.x} ${_.y}`).join(""),m+=(m?" ":"")+N}});const f=d.reduce((k,N)=>k+Xo(N),0),v=pe.value.has(s),h=$.value===s,y=$.value!==null&&$.value!==s;return{path:m,color:ve(s),pathLength:f,seriesIndex:s,animationDelay:o*we.value,isHighlighted:h,isDimmed:y,isHidden:v}}):[]),kn=e.computed(()=>{if(!(W.value==="line"||je.value))return[];const t=je.value?S.series.filter(o=>(o.type||W.value)==="line"):St.value,n=[];return t.forEach((o,s)=>{const d=S.series.findIndex(u=>u===o);for(let u=0;u<o.data.length-1;u++){const m=o.data[u];if(m!=null){let f=-1,v=0;for(let h=u+1;h<o.data.length;h++){const y=o.data[h];if(y==null)v++;else{f=h;break}}if(v>0&&f!==-1){const h=o.data[f],y=Q.value?Ie(m):Ce(u),k=Q.value?Ke(u):Be(m),N=Q.value?Ie(h):Ce(f),_=Q.value?Ke(f):Be(h),R=pe.value.has(d),V=$.value===d,A=$.value!==null&&$.value!==d;n.push({path:`M ${y} ${k} L ${N} ${_}`,color:ve(d),seriesIndex:d,animationDelay:s*we.value,isHighlighted:V,isDimmed:A,isHidden:R,gapSize:v}),u=f-1}}}}),n}),xn=e.computed(()=>W.value==="line"||je.value?!Yt.value||qt.value||J.value.hasAnimated?[]:(je.value?S.series.filter(n=>(n.type||W.value)==="line"):St.value).map((n,o)=>{const s=S.series.findIndex(v=>v===n);let d="",u=null;n.data.forEach((v,h)=>{if(v!=null){const y={x:Q.value?Ie(v):Ce(h),y:Q.value?Ke(h):Be(v)};u===null?d+=`M ${y.x} ${y.y}`:d+=` L ${y.x} ${y.y}`,u=y}else if(u!==null){const y=n.data.findIndex((k,N)=>N>h&&k!==null&&k!==void 0);if(y!==-1){const k={x:Q.value?Ie(n.data[y]):Ce(y),y:Q.value?Ke(y):Be(n.data[y])};d+=` L ${k.x} ${k.y}`,u=k}}});const m=n.data.map((v,h)=>v==null?null:{x:Q.value?Ie(v):Ce(h),y:Q.value?Ke(h):Be(v)}).filter(v=>v!==null),f=Xo(m);return{path:d,pathLength:f,color:ve(s),animationDelay:o*we.value,seriesIndex:s}}):[]),mo=e.computed(()=>{if(W.value!=="line")return[];const t=[];return St.value.forEach((n,o)=>{const s=$.value===o,d=$.value!==null&&$.value!==o,u=pe.value.has(o);n.data.forEach((m,f)=>{m!=null&&t.push({x:Ce(f),y:Be(m),color:ve(o),value:m,label:S.categories[f]||f.toString(),seriesName:n.name,categoryIndex:f,dataIndex:f,animationDelay:(o*n.data.length+f)*(we.value/8),isHighlighted:s,isDimmed:d,isHidden:u})})}),t}),_o=e.computed(()=>{if(!je.value)return[];const t=[];return S.series.filter(o=>(o.type||W.value)==="line").forEach((o,s)=>{const d=S.series.findIndex(v=>v===o),u=$.value===d,m=$.value!==null&&$.value!==d,f=pe.value.has(d);o.data.forEach((v,h)=>{v!=null&&t.push({x:Ce(h),y:Be(v),color:ve(d),value:v,label:S.categories[h]||h.toString(),seriesName:o.name,categoryIndex:h,dataIndex:h,animationDelay:(s*o.data.length+h)*(we.value/8),isHighlighted:u,isDimmed:m,isHidden:f})})}),t}),to=e.computed(()=>{if(!Ne.value)return[];const t=[];return St.value.forEach((n,o)=>{if(!n?.data?.length)return;const s=$.value,d=s!==null&&s===o,u=s!==null&&s!==o,m=pe.value.has(o);n.data.forEach((f,v)=>{let h,y,k,N,_;if(typeof f=="object"&&f!==null&&!Array.isArray(f))h=typeof f.x=="number"?f.x:v,y=typeof f.y=="number"?f.y:0,k=typeof f.size=="number"?f.size:20,N=f.label||S.categories?.[v]||`Point ${v+1}`,_=f.image||f.imageUrl;else if(Array.isArray(f)&&f.length>=3)h=typeof f[0]=="number"?f[0]:v,y=typeof f[1]=="number"?f[1]:0,k=typeof f[2]=="number"?f[2]:20,N=f[3]||S.categories?.[v]||`Point ${v+1}`,_=f[4];else if(typeof f=="number")h=v,y=f,k=fn(o,v),N=S.categories?.[v]||`Point ${v+1}`;else return;!isFinite(h)||!isFinite(y)||!isFinite(k)||t.push({x:Ce(h),y:Be(y),radius:hn(k),originalX:h,originalY:y,originalSize:k,color:ve(o),seriesName:n.name||`Series ${o+1}`,label:N,imageUrl:_,seriesIndex:o,dataIndex:v,categoryIndex:Math.round(h),isHighlighted:d,isDimmed:u,isHidden:m,opacity:uo.value})})}),t}),Yo=e.computed(()=>W.value!=="area"?[]:St.value.map((t,n)=>{const o=[];let s=[];if(t.data.forEach((k,N)=>{k==null?s.length>0&&(o.push([...s]),s=[]):s.push({x:Ce(N),y:Be(k),index:N})}),s.length>0&&o.push(s),o.length===0)return{linePath:"",areaPath:"",color:ve(n),isHidden:pe.value.has(n)};const d=C.value.bottom+1;let u="",m="";o.forEach((k,N)=>{if(k.length===0)return;let _=`M ${k[0].x} ${k[0].y}`;G.value&&k.length>1?_=Do(k):k.slice(1).forEach(V=>{_+=` L ${V.x} ${V.y}`}),u+=(u?" ":"")+_;let R=`M ${k[0].x} ${d}`;if(R+=` L ${k[0].x} ${k[0].y}`,G.value&&k.length>1){const V=Do(k),A=V.substring(V.indexOf("C")||V.indexOf("Q")||V.indexOf("L"));A?R+=" "+A:k.slice(1).forEach(H=>{R+=` L ${H.x} ${H.y}`})}else k.slice(1).forEach(V=>{R+=` L ${V.x} ${V.y}`});R+=` L ${k[k.length-1].x} ${d} Z`,m+=(m?" ":"")+R});const f=$.value===n,v=$.value!==null&&$.value!==n,h=pe.value.has(n),y=o.reduce((k,N)=>k+Xo(N),0);return{linePath:u,areaPath:m,color:ve(n),pathLength:y,isHighlighted:f,isDimmed:v,isHidden:h}})),wn=e.computed(()=>{if(!(["bar"].includes(W.value)||je.value))return[];const t=[],{maxX:n}=ye.value,o=je.value?S.series.filter(d=>(d.type||W.value)==="bar"):St.value,s=o.length;if(Q.value){const d=n+1,m=C.value.height/d,f=m*(2/3),v=f/s,h=v*.02,y=s===d?Math.max(12,f-h*s):Math.max(12,v-h);o.forEach((k,N)=>{const _=S.series.findIndex(H=>H===k),R=$.value===_,V=$.value!==null&&$.value!==_,A=pe.value.has(_);k.data.forEach((H,E)=>{if(H==null||typeof H!="number"||!isFinite(H))return;const L=C.value.top+(E+.5)*m-f/2+N*v+h/2,P=C.value.left,F=Math.abs(Ie(H)-C.value.left);let j="";if(G.value&&F>0){const ee=Math.min(yo.value,y/2,F/2);j=[`M ${P} ${L}`,`L ${P+F-ee} ${L}`,`Q ${P+F} ${L} ${P+F} ${L+ee}`,`L ${P+F} ${L+y-ee}`,`Q ${P+F} ${L+y} ${P+F-ee} ${L+y}`,`L ${P} ${L+y}`,"Z"].join(" ")}t.push({x:P,y:L,width:F,height:y,color:ve(_),value:H,label:S.categories[E]||E.toString(),seriesName:k.name,animationDelay:(N*o.length+E)*(we.value/4),isHighlighted:R,isDimmed:V,isHidden:A,barPath:j,isSmooth:G.value&&F>0})})})}else{const d=n+1,m=C.value.width/d,f=m*.8,v=f/s,h=v*.05,y=v-h;o.forEach((k,N)=>{const _=S.series.findIndex(H=>H===k),R=$.value===_,V=$.value!==null&&$.value!==_,A=pe.value.has(_);k.data.forEach((H,E)=>{if(H==null||typeof H!="number"||!isFinite(H))return;const L=C.value.left+(E+.5)*m-f/2+N*v+h/2,P=Be(Math.max(0,H)),F=Math.abs(Be(0)-Be(H));let j="";if(G.value&&F>0){const ee=Math.min(yo.value,y/2,F/2);j=[`M ${L} ${P+F}`,`L ${L} ${P+ee}`,`Q ${L} ${P} ${L+ee} ${P}`,`L ${L+y-ee} ${P}`,`Q ${L+y} ${P} ${L+y} ${P+ee}`,`L ${L+y} ${P+F}`,"Z"].join(" ")}t.push({x:L,y:P,width:y,height:F,color:ve(_),value:H,label:S.categories[E]||E.toString(),seriesName:k.name,animationDelay:(N*o.length+E)*(we.value/4),isHighlighted:R,isDimmed:V,isHidden:A,barPath:j,isSmooth:G.value&&F>0})})})}return t}),jo=e.computed(()=>{if(!Se.value)return[];const t=St.value.map((u,m)=>({series:u,originalIndex:m})).filter(({originalIndex:u})=>!pe.value.has(u));if(t.length===0)return[];let n=W.value==="semi-radial"?Math.PI:-Math.PI/2;const o=W.value==="semi-radial"?Math.PI:Math.PI*2,s=[];if(t.length===1){const{series:u,originalIndex:m}=t[0],f=u.data[0]||0,v=n,h=n+o-.001,y=v+o/2,k=se.value+Math.cos(v)*Me.value,N=re.value+Math.sin(v)*Me.value,_=se.value+Math.cos(h)*Me.value,R=re.value+Math.sin(h)*Me.value,V=se.value+Math.cos(h)*Y.value,A=re.value+Math.sin(h)*Y.value,H=se.value+Math.cos(v)*Y.value,E=re.value+Math.sin(v)*Y.value,z=1,B=[`M ${k} ${N}`,`A ${Me.value} ${Me.value} 0 ${z} 1 ${_} ${R}`,`L ${V} ${A}`,`A ${Y.value} ${Y.value} 0 ${z} 0 ${H} ${E}`,"Z"].join(" ");return s.push({path:B,color:ve(m),value:f,seriesName:u.name,opacity:.8,isHighlighted:$.value===m,isDimmed:!1,isHidden:!1,startAngle:v,endAngle:h,midAngle:y}),s}const d=t.reduce((u,{series:m})=>u+(m.data[0]||0),0);return d===0?[]:(t.forEach(({series:u,originalIndex:m})=>{const f=u.data[0]||0,v=f/d*o,h=n,y=n+v,k=h+v/2,N=se.value+Math.cos(h)*Me.value,_=re.value+Math.sin(h)*Me.value,R=se.value+Math.cos(y)*Me.value,V=re.value+Math.sin(y)*Me.value,A=se.value+Math.cos(y)*Y.value,H=re.value+Math.sin(y)*Y.value,E=se.value+Math.cos(h)*Y.value,z=re.value+Math.sin(h)*Y.value,B=v>Math.PI?1:0,L=[`M ${N} ${_}`,`A ${Me.value} ${Me.value} 0 ${B} 1 ${R} ${V}`,`L ${A} ${H}`,`A ${Y.value} ${Y.value} 0 ${B} 0 ${E} ${z}`,"Z"].join(" ");s.push({path:L,color:ve(m),value:f,seriesName:u.name,opacity:.8,isHighlighted:$.value===m,isDimmed:$.value!==null&&$.value!==m,isHidden:!1,startAngle:h,endAngle:y,midAngle:k}),n=y}),s)}),Ft=e.computed(()=>!tn.value||!Se.value?[]:jo.value.map((t,n)=>{if(t.isHidden)return null;const o=Bn.value,s=Hn.value,d=Tn.value,u=se.value+Math.cos(t.midAngle)*Y.value,m=re.value+Math.sin(t.midAngle)*Y.value,f=se.value+Math.cos(t.midAngle)*(Y.value+o),v=re.value+Math.sin(t.midAngle)*(Y.value+o),h=Math.cos(t.midAngle)>=0,k=f+s*(h?1:-1),N=v,_=h?f+15:f-15,R=N-d,V=h?"start":"end";return{pointerStartX:u,pointerStartY:m,pointerEndX:f,pointerEndY:v,horizontalEndX:k,horizontalEndY:N,textX:_,textY:R,text:`${t.seriesName}: ${t.value}`,color:t.color,textAnchor:V,isRightSide:h,isHighlighted:t.isHighlighted,isDimmed:t.isDimmed}}).filter(Boolean)),zt=t=>{if(!t||t.isHidden)return 0;const n=t.opacity||uo.value||.7;return $.value===null||$.value===void 0?n:$.value!==null?t.seriesIndex===$.value?Math.min(1,n+.1):Math.max(.5,n*.8):n},oo=t=>{if(!t||t.isHidden)return 0;const n=t.radius>20?.9:.8;return $.value!==null?t.seriesIndex===$.value?Math.min(1,n+.1):n*.7:n},po=(t,n)=>{if(t)try{if($.value===t.seriesIndex?$.value=null:$.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const o=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:n,chartId:S.chartId}});window.dispatchEvent(o)}}catch(o){console.error("Error in onBubbleClick:",o)}},ke=(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(" ")},Ko=(t,n)=>{t&&(n.stopPropagation(),nt.value=!0,$.value=t.seriesIndex,U.value.show=!1)},bn=(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 s=Bo.value[t];return typeof s=="function"?s(o,n):typeof o=="number"?o.toFixed(1):o?.toString()||""},no=()=>{if(!Ne.value||!U.value.data||U.value.data.length===0)return"Bubbles";const t=[],n=new Set;return U.value.data.forEach(o=>{if(o.seriesName&&o.label){const s=`${o.seriesName} - ${o.label}`;n.has(s)||(t.push(s),n.add(s))}else o.seriesName&&(n.has(o.seriesName)||(t.push(o.seriesName),n.add(o.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},Pt=(t,n)=>{t&&(nt.value=!1,$.value=null)},fo=(t,n)=>{const o=n.target.closest(".dss-custom-chart-container");if(!o)return;const s=o.getBoundingClientRect(),d=cn(t.categoryIndex),u=t.description||t.comment||"";let m=n.clientX-s.left+15,f=n.clientY-s.top-10;const v=200,h=u?80:50;m+v>I.value&&(m=n.clientX-s.left-v-15),f+h>X.value&&(f=n.clientY-s.top-h-10),m<0&&(m=10),f<0&&(f=10),$e.value={show:!0,x:m,y:f,categoryValue:d,description:u}},lo=()=>{$e.value.show=!1},pt=e.computed(()=>S.categories.length||Math.max(...eo.value.map(t=>t.data.length))),Pn=e.computed(()=>{let t=0;return eo.value.forEach(n=>{n.data.forEach(o=>{typeof o=="number"&&(t=Math.max(t,o))})}),t||100}),En=e.computed(()=>{const t=[],n=pt.value;for(let o=0;o<n;o++){const s=o*2*Math.PI/n-Math.PI/2,d=se.value+Math.cos(s)*Y.value,u=re.value+Math.sin(s)*Y.value;t.push({x:d,y:u,angle:s,index:o})}return t}),xo=e.computed(()=>{const t=[],n=pt.value;return En.value.forEach((o,s)=>{const d=Y.value+15,u=s*2*Math.PI/n-Math.PI/2,m=se.value+Math.cos(u)*d,f=re.value+Math.sin(u)*d+5;let v="middle",h="middle";Math.abs(Math.cos(u))>.5&&(v=Math.cos(u)>0?"start":"end"),Math.abs(Math.sin(u))>.5&&(h=Math.sin(u)>0?"hanging":"auto"),t.push({x:m,y:f,text:S.categories[s]||`Axis ${s+1}`,anchor:v,baseline:h})}),t}),Vn=e.ref(new Set),wo=(t,n,o)=>{const s=`current-${o}`,d=Vn.value.has(s);return!d&&$.value===null?n.fillOpacity||Z.value:n.isHighlighted||d?(n.fillOpacity||Z.value)+.15:n.isDimmed?(n.fillOpacity||Z.value)*.3:n.fillOpacity||Z.value},Go=e.computed(()=>{if(!Vt.value)return[];const t=[],n=pt.value;return St.value.forEach((o,s)=>{const d=[],u=[],m=[],f=$.value===s,v=$.value!==null&&$.value!==s,h=pe.value.has(s);for(let y=0;y<n;y++){const k=o.data[y]||0,_=k/Pn.value*Y.value,R=y*2*Math.PI/n-Math.PI/2,V=se.value+Math.cos(R)*_,A=re.value+Math.sin(R)*_;d.push(`${V},${A}`),u.push({x:V,y:A}),m.push({x:V,y:A,value:k,label:S.categories[y]||`Axis ${y+1}`,seriesName:o.name})}t.push({points:d.join(" "),polygonPoints:u,dataPoints:m,color:ve(s),fillOpacity:Z.value,seriesName:o.name,value:`${o.name}: ${o.data.join(", ")}`,isHighlighted:f,isDimmed:v,isHidden:h,seriesIndex:s})}),t}),On=(t,n)=>{if(!n||n.length<3)return!1;let o=!1;for(let s=0,d=n.length-1;s<n.length;d=s++){const u=n[s].x,m=n[s].y,f=n[d].x,v=n[d].y;m>t.y!=v>t.y&&t.x<(f-u)*(t.y-m)/(v-m)+u&&(o=!o)}return o},Zn=t=>{if(!Vt.value)return;const n=t.currentTarget.closest(".dss-custom-chart-container");if(!n)return;const o=n.getBoundingClientRect(),s=K.value?.getBoundingClientRect();if(!s)return;const d=t.clientX-s.left,u=t.clientY-s.top,m=Go.value.filter(f=>f.isHidden?!1:On({x:d,y:u},f.polygonPoints));if(m.length>0){m.length,$.value=m[0].seriesIndex;const f=t.clientX-o.left+10,v=t.clientY-o.top-10,h=200,y=50+m.length*25;let k=f,N=v;k+h>I.value&&(k=t.clientX-o.left-h-10),N+y>X.value&&(N=t.clientY-o.top-y-10),k<0&&(k=10),N<0&&(N=10);const _=m.map(R=>{let V=R.dataPoints[0],A=1/0;return R.dataPoints.forEach(H=>{const E=Math.sqrt(Math.pow(H.x-d,2)+Math.pow(H.y-u,2));E<A&&(A=E,V=H)}),{seriesName:R.seriesName,color:R.color,value:V.value!==void 0?V.value:R.value}});ue.value={show:!0,x:k,y:N,title:m.length===1?m[0].seriesName:"",value:"",spiderSeries:_}}else Ge()},ao=e.computed(()=>{const t=M.value;return t.logos.map((n,o)=>{const s=S.series[n.seriesIndex];if(!s||!s.data||s.data.length===0||pe.value.has(n.seriesIndex))return null;let d,u;if(Te.value){let f=-1,v=null;for(let y=s.data.length-1;y>=0;y--)if(s.data[y]!==null&&s.data[y]!==void 0){f=y,v=s.data[y];break}if(f===-1||v===null)return null;const h=s.data.map((y,k)=>y==null?null:{x:Ce(k),y:Be(y),index:k}).filter(y=>y!==null);if(t.animations.enabled&&!qt.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(J.value.isAnimating||!J.value.hasAnimated))if(J.value.isAnimating){const y=J.value.currentFrame/J.value.totalFrames,k=Ut(t.animations.easing,Math.min(y,1)),N=p(h,k);d=N.x+(n.offsetX||0),u=N.y+(n.offsetY||0)}else d=h[0].x+(n.offsetX||0),u=h[0].y+(n.offsetY||0);else d=Ce(f)+(n.offsetX||0),u=Be(v)+(n.offsetY||0)}else if(Se.value||Vt.value){const f=Math.PI*2/t.logos.length*o;d=se.value+Math.cos(f)*(Y.value+30)+(n.offsetX||0),u=re.value+Math.sin(f)*(Y.value+30)+(n.offsetY||0)}return{...n,x:d,y:u,seriesIndex:n.seriesIndex}}).filter(Boolean)}),Qo=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=>{pe.value.has(t)?pe.value.delete(t):pe.value.add(t)},Un=e.computed(()=>{if(!ue.value.show&&!(Le.value&&U.value.show&&!b.value.isZooming))return{display:"none"};let t,n;if(Le.value&&U.value.show&&!b.value.isZooming){t=U.value.x+15,n=C.value.top;const o=Ne.value?200:150;t+o>I.value&&(t=U.value.x-o-15),t<0&&(t=10),n<10&&(n=10)}else t=ue.value.x,n=ue.value.y;return{left:t+"px",top:n+"px"}}),Ot=(t,n)=>{if(bo.value)return;const s=n.target.closest(".dss-custom-chart-container").getBoundingClientRect();let d=n.clientX-s.left+10,u=n.clientY-s.top-10;const m=200,f=120,v=I.value,h=X.value;d+m>v&&(d=n.clientX-s.left-m-10),u+f>h&&(u=n.clientY-s.top-f-10),d<0&&(d=10),u<0&&(u=10);let y;typeof t.categoryIndex=="number"?y=t.categoryIndex:typeof t.dataIndex=="number"?y=t.dataIndex:t.label&&S.categories.includes(t.label)&&(y=S.categories.indexOf(t.label));const k=(Q.value||W.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";ue.value={show:!0,x:d,y:u,title:k,value:t.value?.toString()||"",categoryIndex:y,spiderSeries:[]}},so=e.ref(!1),nt=e.ref(!1),Ge=()=>{ue.value.show=!1,ue.value.spiderSeries=[],U.value.show=!1,so.value||($.value=null)},bo=e.ref(!1),Zt=(t,n)=>{bo.value=!0,ue.value.show=!1,U.value.show=!1;const s=n.target.closest(".dss-custom-chart-container").getBoundingClientRect();let d=n.clientX-s.left+15,u=n.clientY-s.top-10;const m=250;d+m>I.value&&(d=n.clientX-s.left-m-15),d<0&&(d=10),u<0&&(u=10),No.value={show:!0,x:d,y:u,content:t.texts,count:t.totalCount}},Re=()=>{bo.value=!1,No.value.show=!1},J=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Ut=(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}},qt=e.computed(()=>co.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Sn=()=>{if(!Yt.value||qt.value){J.value.hasAnimated=!0;return}J.value.isAnimating=!0,J.value.currentFrame=0,J.value.totalFrames=Math.ceil(Pe.value/16.67);const t=()=>{const n=J.value.currentFrame/J.value.totalFrames,o=Ut(We.value,Math.min(n,1));Nn(o),n<1?(J.value.currentFrame++,J.value.animationId=requestAnimationFrame(t)):Mn()};J.value.animationId=requestAnimationFrame(t)},Nn=t=>{const n=document.querySelector(".dss-custom-chart-container");n&&n.style.setProperty("--dss-animation-progress",t)},Mn=()=>{J.value.isAnimating=!1,J.value.hasAnimated=!0,J.value.animationId&&(cancelAnimationFrame(J.value.animationId),J.value.animationId=null)},a=e.computed(()=>{if(!Yt.value||qt.value||J.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Pe.value}ms`,t["--dss-animation-easing"]=l(We.value),t["--dss-stagger-delay"]=`${we.value}ms`,t}),l=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",r=()=>{if(!Yt.value||qt.value)return"";const t=["dss-chart-animated"];return J.value.hasAnimated||t.push(`dss-animate-${jt.value}`),J.value.hasAnimated||(Se.value?t.push("dss-animate-fill"):t.push(`dss-animate-${jt.value}`)),J.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>S.series,(t,n)=>{ct.value&&n&&J.value.hasAnimated&&(J.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Sn(),Lt.value)}))},{deep:!0}),e.watch(()=>b.value.isZooming,(t,n)=>{n&&!t&&setTimeout(()=>{dn()},50)}),e.watch(()=>[b.value.scale,b.value.offsetX],()=>{!b.value.isZooming&&!b.value.isDragging&&dn()},{flush:"post"}),e.watch([So,it],([t,n])=>{b.value.minScale=t,b.value.maxScale=n,(b.value.scale<t||b.value.scale>n)&&$o()},{immediate:!0}),e.watch(()=>S.locale,t=>{t&&t!==w.value&&(w.value=t)},{immediate:!0}),e.watch(()=>ae.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",He)}):document.removeEventListener("click",He)}),e.onMounted(()=>{$.value=null,Zo(),Yt.value&&!qt.value?setTimeout(()=>Sn(),Lt.value):J.value.hasAnimated=!0,document.addEventListener("mousemove",i),document.addEventListener("mouseup",c),document.addEventListener("click",Uo)}),e.onUnmounted(()=>{J.value.animationId&&cancelAnimationFrame(J.value.animationId),b.value.zoomTimeout&&clearTimeout(b.value.zoomTimeout),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c),document.removeEventListener("click",Uo),document.removeEventListener("click",He)});const i=t=>{if(b.value.isDragging&&b.value.scale>1&&Te.value){U.value.show=!1;const n=t.clientX-b.value.lastMouseX,{minX:o,maxX:s}=ye.value,d=s-o||1,m=n*.8;b.value.offsetX+=m;const f=d/b.value.scale,v=d-f,h=0,y=-v/d*C.value.width,k=h;b.value.offsetX=Math.max(y,Math.min(k,b.value.offsetX)),b.value.lastMouseX=t.clientX,b.value.lastMouseY=t.clientY}},c=()=>{b.value.isDragging&&(b.value.isDragging=!1,setTimeout(()=>{!b.value.isDragging&&b.value.isZooming},100))},p=(t,n)=>{const o=t.filter(f=>f!=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 s=0;const d=[];for(let f=1;f<o.length;f++){const v=o[f].x-o[f-1].x,h=o[f].y-o[f-1].y,y=Math.sqrt(v*v+h*h);d.push(y),s+=y}const u=s*n;let m=0;for(let f=0;f<d.length;f++){const v=m+d[f];if(u<=v){const h=(u-m)/d[f],y=o[f],k=o[f+1];return{x:y.x+(k.x-y.x)*h,y:y.y+(k.y-y.y)*h}}m=v}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",r()]),style:e.normalizeStyle({width:I.value+"px",height:X.value+20+"px",...a.value,cursor:qe()}),"data-chart-type":W.value,ref_key:"containerEl",ref:x,onWheel:bt,onMousedown:Rn,onMousemove:rn,onMouseup:pn,onMouseleave:An,onDblclick:$o,onContextmenu:e.withModifiers(Dt,["prevent"]),onClick:e.withModifiers(Jt,["left"]),onWheelCapture:bt},[e.createElementVNode("div",Jn,[e.createElementVNode("div",el,[oe.value?(e.openBlock(),e.createElementBlock("div",tl,e.toDisplayString(oe.value),1)):e.createCommentVNode("",!0),ne.value?(e.openBlock(),e.createElementBlock("div",ol,e.toDisplayString(ne.value),1)):e.createCommentVNode("",!0)]),xe.value&&(Ae.value==="top"||Ae.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":vo.value==="horizontal","dss-legend-vertical":vo.value==="vertical","dss-legend-top":Ae.value==="top","dss-legend-bottom":Ae.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.series,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${s}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":pe.value.has(s),"dss-legend-hovered":$.value===s,"dss-legend-dimmed":$.value!==null&&$.value!==s}]),onClick:d=>en(s),onMouseenter:d=>an(s),onMouseleave:sn,style:e.normalizeStyle({animationDelay:`${s*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:ve(s)})},null,4),e.createElementVNode("span",ll,e.toDisplayString(o.name),1)],46,nl))),128))],2)):e.createCommentVNode("",!0),xe.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(S.series,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${s}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":pe.value.has(s),"dss-legend-hovered":$.value===s,"dss-legend-dimmed":$.value!==null&&$.value!==s}]),onClick:d=>en(s),onMouseenter:d=>an(s),onMouseleave:sn,style:e.normalizeStyle({animationDelay:`${s*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:ve(s)})},null,4),e.createElementVNode("span",sl,e.toDisplayString(o.name),1)],46,al))),128))],2)):e.createCommentVNode("",!0)]),T.showAddMarkerButton&&he.value.addMarker&&(Te.value||Ne.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Ze,title:e.unref(O)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:et.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,il),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,rl)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:I.value,height:X.value,class:"dss-chart-svg","data-smooth":G.value,"data-animated":Yt.value,ref_key:"svgEl",ref:K},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",dl,[e.createElementVNode("rect",{x:C.value.left,y:C.value.top,width:C.value.width,height:C.value.height*4},null,8,ul)])]),Te.value||Ne.value?(e.openBlock(),e.createElementBlock("g",ml,[q.value?(e.openBlock(),e.createElementBlock("g",pl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zn.value,(o,s)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${s}`,x1:C.value.left,x2:C.value.right,y1:o.y,y2:o.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${s*50}ms`})},null,12,fl))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",vl,[e.createElementVNode("line",{x1:C.value.left,x2:C.value.right,y1:C.value.bottom,y2:C.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,gl),e.createElementVNode("line",{x1:C.value.left,x2:C.value.left,y1:C.value.top,y2:C.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,hl)]),e.createElementVNode("g",yl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qo.value,(o,s)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${s}`,x:o.x,y:o.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${s*100}ms`})},e.toDisplayString(o.text),13,Cl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wo.value,(o,s)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${s}`,x:o.x,y:o.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${s*80}ms`})},e.toDisplayString(o.text),13,kl))),128)),rt.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:C.value.left+C.value.width/2,y:C.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(rt.value),9,xl)):e.createCommentVNode("",!0),Vo.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:C.value.top+12+C.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${C.value.top+C.value.height/2})`},e.toDisplayString(Vo.value),9,wl)):e.createCommentVNode("",!0)]),on.value.length>0?(e.openBlock(),e.createElementBlock("g",bl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,o=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${o.categoryIndex}`},[e.createElementVNode("g",El,[o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x,y1:C.value.bottom,y2:C.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:s=>Zt(o,s),onMouseleave:Re},null,40,Vl)):e.createCommentVNode("",!0),o.hasAuto&&!o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x,y1:C.value.bottom,y2:C.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:s=>Zt(o,s),onMouseleave:Re},null,40,Sl)):e.createCommentVNode("",!0),o.hasAuto&&o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x,y1:C.value.bottom,y2:C.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:s=>Zt(o,s),onMouseleave:Re},null,40,Nl)):e.createCommentVNode("",!0)]),o.hasManual&&o.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:o.x+8,cy:Math.max(15,C.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:s=>Zt(o,s),onMouseleave:Re},null,40,Ml)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:o.x,cy:Math.max(15,C.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:s=>Zt(o,s),onMouseleave:Re},null,40,Bl),e.createElementVNode("text",{x:o.x,y:Math.max(15,C.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,Hl)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Tl,[je.value?(e.openBlock(),e.createElementBlock("g",Al,[e.createElementVNode("g",Ll,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wn.value,(o,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${s}`},[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:d=>Ot(o,d),onMouseleave:Ge},null,46,$l)):(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:d=>Ot(o,d),onMouseleave:Ge},null,46,Dl))],64))),128))]),e.createElementVNode("g",Il,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cn.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${s}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?de.value+2:de.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,_l))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kn.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${s}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?de.value+2:de.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,Rl))),128)),me.value>0||Tt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(_o.value,(o,s)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${s}`,cx:o.x,cy:o.y,r:o.isHighlighted?Je(o,me.value)+2:Je(o,me.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:d=>Ot(o,d),onMouseleave:Ge},null,46,Fl))),128)):e.createCommentVNode("",!0)])])):W.value==="line"?(e.openBlock(),e.createElementBlock("g",zl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xn.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${s}`,d:o.path,stroke:o.color,"stroke-width":de.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":J.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${o.animationDelay}ms`})},null,14,Pl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cn.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${s}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?de.value+2:de.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(kn.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${s}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?de.value+2:de.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,Zl))),128)),me.value>0||Tt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(mo.value,(o,s)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${s}`,cx:o.x,cy:o.y,r:o.isHighlighted?Je(o,me.value)+2:Je(o,me.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:d=>Ot(o,d),onMouseleave:Ge},null,46,Ul))),128)):e.createCommentVNode("",!0)])):W.value==="area"?(e.openBlock(),e.createElementBlock("g",ql,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yo.value,(o,s)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${s}`,id:`area-mask-${s}-${T.chartId}`},[e.createElementVNode("rect",{x:C.value.left-10,y:C.value.top-10,width:C.value.width+20,height:C.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${C.value.width+20}px`})},null,12,Xl)],8,Wl))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yo.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${s}`,d:o.areaPath,fill:o.color,"fill-opacity":o.isHighlighted?ho.value+.2:ho.value,mask:`url(#area-mask-${s}-${T.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,Yl))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yo.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${s}`,d:o.linePath,stroke:o.color,"stroke-width":o.isHighlighted?de.value+1:de.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:`${s*we.value}ms`})},null,14,jl))),128))])):W.value==="bar"?(e.openBlock(),e.createElementBlock("g",Kl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wn.value,(o,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${s}`},[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:d=>Ot(o,d),onMouseleave:Ge},null,46,Gl)):(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:d=>Ot(o,d),onMouseleave:Ge},null,46,Ql))],64))),128))])):e.createCommentVNode("",!0)]),Le.value&&U.value.show&&!b.value.isZooming?(e.openBlock(),e.createElementBlock("g",Jl,[e.createElementVNode("line",{x1:U.value.x,x2:U.value.x,y1:C.value.top,y2:C.value.bottom,stroke:go.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,ea),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value.data,(o,s)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${s}`,cx:U.value.x,cy:o.y,r:me.value+2,fill:o.color,stroke:"#fafafa","stroke-width":"2",opacity:"0.9"},null,8,ta))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ne.value?(e.openBlock(),e.createElementBlock("g",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,(o,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${s}`},[o?(e.openBlock(),e.createElementBlock("g",na,[e.createElementVNode("circle",{cx:o.x,cy:o.y,r:o.radius,fill:o.color,"fill-opacity":zt(o),stroke:o.color,"stroke-width":o.isHighlighted?3:1,"stroke-opacity":"0.8",class:e.normalizeClass(ke(o,s)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:d=>Ko(o,d),onMouseleave:d=>Pt(o),onClick:d=>po(o,d)},null,42,la),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-${s} ${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:oo(o)}),onLoad:d=>vn(s),onError:d=>gn(s),onMouseenter:d=>Ko(o,d),onMouseleave:d=>Pt(o),onClick:d=>po(o,d)},null,46,aa)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),Se.value?(e.openBlock(),e.createElementBlock("g",sa,[W.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:se.value,cy:re.value,r:Y.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,ra)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":W.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jo.value,(o,s)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${s}`,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:d=>Ot(o,d),onMouseleave:Ge},null,42,ca))),128))],8,ia),tn.value?(e.openBlock(),e.createElementBlock("g",da,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ft.value,(o,s)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${s}`,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:`${s*100}ms`})},null,12,ua),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:`${s*120}ms`})},null,12,ma),e.createElementVNode("text",{x:o.textX,y:o.textY,"text-anchor":o.textAnchor,"font-size":xt.value,"dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${s*150}ms`})},e.toDisplayString(o.text),13,pa)],2))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Vt.value?(e.openBlock(),e.createElementBlock("g",fa,[q.value?(e.openBlock(),e.createElementBlock("g",va,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,(o,s)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${s}`,cx:se.value,cy:re.value,r:o,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${s*150}ms`})},null,12,ga))),128)),e.createElementVNode("g",ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,(o,s)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${s}`},[e.createElementVNode("rect",{x:se.value-16,y:re.value-o-7,width:"32",height:"16",fill:"#fafafa",stroke:"none"},null,8,ya),e.createElementVNode("text",{x:se.value,y:re.value-o+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString($t(s)),9,Ca)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(En.value,(o,s)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${s}`,x1:se.value,x2:o.x,y1:re.value,y2:o.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${s*100}ms`})},null,12,ka))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(o,s)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${s}`,x:o.x+Math.cos(s*2*Math.PI/pt.value-Math.PI/2)*16,y:o.y+Math.sin(s*2*Math.PI/pt.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:`${s*120}ms`})},e.toDisplayString(o.text.charAt(0).toUpperCase()+o.text.slice(1)),13,wa))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Zn,onMouseleave:Ge},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Go.value,(o,s)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${s}`},[e.createElementVNode("polygon",{points:o.points,fill:o.color,"fill-opacity":wo("current",o,s),stroke:o.color,"stroke-width":o.isHighlighted?de.value+1:de.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:`${s*we.value}ms`,transition:"all 0.2s ease"})},null,14,ba),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.dataPoints,(d,u)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${s}-${u}`,cx:d.x,cy:d.y,r:o.isHighlighted?me.value+1:me.value>0?me.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:`${s*we.value+u*50}ms`,transition:"all 0.2s ease"}),onMouseover:m=>Ot(d,m),onMouseleave:Ge},null,46,Ea))),128))]))),128))],32)])):e.createCommentVNode("",!0),e.createElementVNode("g",Va,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ao.value,(o,s)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${s}`,cx:o.x,cy:o.y,r:o.width/2,fill:ve(o.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${s}`),style:e.normalizeStyle({animationDelay:`${s*200}ms`})},null,14,Sa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ao.value,(o,s)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${s}`,x:o.x-o.width/2,y:o.y-o.height/2,width:o.width,height:o.height,"xlink:href":o.url,onLoad:d=>Qo(s),onError:d=>Jo(s),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${s}`),"clip-path":`circle(${o.width/2}px at ${o.width/2}px ${o.height/2}px)`,style:e.normalizeStyle({animationDelay:`${s*200}ms`})},null,46,Na))),128))])],8,cl)),tt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:I.value+"px",height:X.value+"px",backgroundImage:`url('${zo.value}')`,backgroundRepeat:"no-repeat",...kt.value,opacity:ut.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value,(o,s)=>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:le.value+"px",height:le.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(d=>ce(o),["stop"]),onMouseenter:d=>fo(o,d),onMouseleave:lo},[e.createElementVNode("img",{src:ko(o),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Ba)],44,Ma)),[[e.vShow,gt.value]])),128)),$e.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:$e.value.x+"px",top:$e.value.y+"px"})},[e.createElementVNode("div",Ha,e.toDisplayString($e.value.categoryValue),1),$e.value.description?(e.openBlock(),e.createElementBlock("div",Ta,e.toDisplayString($e.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),ue.value.show||Le.value&&U.value.show&&!b.value.isZooming?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Le.value&&U.value.show&&!b.value.isZooming}]),style:e.normalizeStyle(Un.value)},[!Le.value||!U.value.show||b.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Vt.value&&ue.value.spiderSeries&&ue.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Aa,[ue.value.title?(e.openBlock(),e.createElementBlock("div",La,e.toDisplayString(ue.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ue.value.spiderSeries,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${s}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",$a,e.toDisplayString(o.seriesName)+":",1),e.createElementVNode("span",Da,e.toDisplayString(o.value),1)]))),128))])):(e.openBlock(),e.createElementBlock("div",Ia,[e.createElementVNode("div",_a,e.toDisplayString(ue.value.title),1),e.createElementVNode("div",Ra,e.toDisplayString(ue.value.value),1)])),ue.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[mt(ue.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Fa,[n[6]||(n[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",za,e.toDisplayString(e.unref(O)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt(ue.value.categoryIndex).flagGroups,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${s}`},[e.createElementVNode("div",Pa,[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,(d,u)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${s}-${u}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Oa,[e.createElementVNode("div",Za,e.toDisplayString(d.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),mt(ue.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ua,[n[7]||(n[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",qa,e.toDisplayString(e.unref(O)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt(ue.value.categoryIndex).markers,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${s}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("div",Wa,[e.createElementVNode("div",Xa,e.toDisplayString(o.title),1),o.description?(e.openBlock(),e.createElementBlock("div",Ya,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",ja,[e.createElementVNode("div",Ka,e.toDisplayString(Ne.value?no():T.categories[U.value.categoryIndex]||`Category ${U.value.categoryIndex+1}`),1),Ne.value?(e.openBlock(),e.createElementBlock("div",Ga,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value.data,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${s}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(o.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(U.value.data,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${s}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",Qa,e.toDisplayString(o.seriesName)+":",1),e.createElementVNode("span",Ja,e.toDisplayString(o.value),1)]))),128))]),mt(U.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",es,[n[8]||(n[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ts,e.toDisplayString(e.unref(O)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt(U.value.categoryIndex).flagGroups,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${s}`},[e.createElementVNode("div",os,[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,(d,u)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${s}-${u}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",ns,[e.createElementVNode("div",ls,e.toDisplayString(d.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),mt(U.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",as,[n[9]||(n[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ss,e.toDisplayString(e.unref(O)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt(U.value.categoryIndex).markers,(o,s)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${s}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("div",rs,[e.createElementVNode("div",is,e.toDisplayString(o.title),1),o.description?(e.openBlock(),e.createElementBlock("div",cs,e.toDisplayString(o.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Te.value&&Ue.value&&b.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:$o},[n[10]||(n[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(b.value.scale*100))+"% "+e.toDisplayString(e.unref(O)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Qn),ae.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ae.value.x+"px",top:ae.value.y+"px"}),onClick:n[0]||(n[0]=e.withModifiers(()=>{},["stop"]))},[he.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Rt},e.toDisplayString(e.unref(O)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),he.value.addMarker&&(he.value.downloadSvg||he.value.downloadPng||he.value.downloadCsv||Ye.value.length>0)?(e.openBlock(),e.createElementBlock("div",ds)):e.createCommentVNode("",!0),he.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Lo},e.toDisplayString(e.unref(O)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),he.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:_t},e.toDisplayString(e.unref(O)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),he.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:In},e.toDisplayString(e.unref(O)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Ye.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[he.value.downloadSvg||he.value.downloadPng||he.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",us)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,(o,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+s},[o.separator?(e.openBlock(),e.createElementBlock("div",ms)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Po(o)),style:e.normalizeStyle($n(o)),onClick:d=>_n(o)},[o.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Ln(o),class:"dss-custom-menu-content"},null,8,fs)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.icon?(e.openBlock(),e.createElementBlock("span",vs,e.toDisplayString(o.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(o.label),1)],64))],14,ps)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),D.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:Oe},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:n[4]||(n[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",gs,[e.createElementVNode("h3",null,e.toDisplayString(Qt.value?e.unref(O)("chart.modalMarker.viewMarker"):Gt.value?e.unref(O)("chart.modalMarker.editMarker"):e.unref(O)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Oe},"×")]),e.createElementVNode("div",hs,[e.createElementVNode("div",ys,[D.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Cs,e.toDisplayString(cn(D.value.categoryIndex)||""),1)),D.value.fromButton?(e.openBlock(),e.createElementBlock("div",ks,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":n[1]||(n[1]=o=>D.value.categoryIndex=o),class:"dss-form-select",disabled:Qt.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ln.value,(o,s)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${s}`,value:s},e.toDisplayString(o),9,ws))),128))],8,xs),[[e.vModelSelect,D.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",bs,[e.createElementVNode("label",Es,e.toDisplayString(e.unref(O)("chart.modalMarker.description")),1),Qt.value?(e.openBlock(),e.createElementBlock("div",Vs,e.toDisplayString(D.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":n[2]||(n[2]=o=>D.value.description=o),placeholder:e.unref(O)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,Ss)),[[e.vModelText,D.value.description]])]),e.createElementVNode("div",Ns,[e.createElementVNode("label",null,e.toDisplayString(e.unref(O)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",Ms,[e.createElementVNode("img",{src:ko({type:D.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,Bs)])])]),e.createElementVNode("div",Hs,[e.createElementVNode("div",Ts,[Gt.value&&!Qt.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:To},e.toDisplayString(e.unref(O)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",As,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Oe},e.toDisplayString(Qt.value?e.unref(O)("chart.modalMarker.close"):e.unref(O)("chart.modalMarker.cancel")),1),Qt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:wt,disabled:!(D.value.description&&D.value.description.length)},e.toDisplayString(Gt.value?e.unref(O)("chart.modalMarker.save"):e.unref(O)("chart.contextMenu.addMarker")),9,Ls))])])])])):e.createCommentVNode("",!0)],64))}}),Is={class:"dss-modal-title"},_s={class:"dss-modal-actions"},qn={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(T,{emit:Wt}){const O=T,w=Wt,vt=e.ref(null),x=e.ref(null),K=e.computed(()=>{const I={"max-width":O.width};return O.height!=="auto"&&(I.height=O.height,I["min-height"]="0"),I}),Bt=e.computed(()=>({}));function S(){w("close-modal")}function g(){O.backDrop&&!vt.value&&w("close-modal")}function De(I){I.target.tagName==="INPUT"&&(vt.value=I.target.tagName)}function ze(){setTimeout(()=>{vt.value=null},300)}function Qe(){const I=document.body,X=document.documentElement;x.value={bodyOverflow:I.style.overflow,bodyPosition:I.style.position,bodyTop:I.style.top,bodyWidth:I.style.width,htmlOverflow:X.style.overflow,scrollY:window.scrollY},I.style.overflow="hidden",I.style.position="fixed",I.style.top=`-${x.value.scrollY}px`,I.style.width="100%",I.style.left="0",X.style.overflow="hidden"}function M(){if(!x.value)return;const I=document.body,X=document.documentElement,{bodyOverflow:W,bodyPosition:st,bodyTop:oe,bodyWidth:ne,htmlOverflow:rt,scrollY:Vo}=x.value;I.style.overflow=W||"",I.style.position=st||"",I.style.top=oe||"",I.style.width=ne||"",I.style.left="",X.style.overflow=rt||"",window.scrollTo(0,Vo||0)}return e.watch(()=>O.showModal,I=>{if(I)Qe(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const X=document.getElementById("dss-modal-backdrop");X&&(X.addEventListener("focusin",De),X.addEventListener("focusout",ze))},100);else{M(),document.body.classList.remove("dss-modal-open");const X=document.getElementById("dss-modal-backdrop");X&&(X.removeEventListener("focusin",De),X.removeEventListener("focusout",ze))}},{immediate:!0}),e.onUnmounted(()=>{O.showModal&&M()}),(I,X)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.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(K.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:X[0]||(X[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":T.headerType,"font-size":T.titleSize})},[e.createElementVNode("h1",Is,[e.renderSlot(I.$slots,"title",{},()=>[X[1]||(X[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(I.$slots,"title-data"),T.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:S,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(Bt.value)},[e.renderSlot(I.$slots,"content",{},()=>[X[2]||(X[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",_s,[e.renderSlot(I.$slots,"actions")])])],4),[[e.vShow,T.showModal]])])):e.createCommentVNode("",!0)]))}},Rs={class:"dss-toolbar-left"},Fs=["title"],zs=["title"],Ps={class:"dss-toolbar-dropdown-wrapper"},Os=["title"],Zs={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"},Us={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"},qs={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"},Ws={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"},Xs={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"},Ys={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"},js={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Ks=["title"],Gs=["title"],Qs=["title"],Js=["title"],er=["title"],tr=["title"],or=["title"],nr=["title"],lr=["title"],ar={key:2,class:"dss-toolbar-separator"},sr=["title"],rr={key:4,class:"dss-toolbar-separator"},ir={key:5,class:"dss-toolbar-dropdown-wrapper"},cr=["title"],dr={class:"dss-toolbar-dropdown-ai"},ur={class:"dss-toolbar-right"},mr={key:0,class:"dss-toolbar-custom-group"},pr={key:1,class:"dss-toolbar-separator"},fr={class:"dss-link-modal-content"},vr={class:"dss-link-modal-field"},gr={class:"dss-link-modal-label"},hr=["placeholder"],yr={class:"dss-link-modal-field"},Cr={class:"dss-link-modal-label"},kr=["placeholder"],xr={class:"dss-image-modal-tabs"},wr={key:0,class:"dss-image-tab-content"},br={class:"dss-link-modal-content"},Er={class:"dss-link-modal-field"},Vr={key:0,class:"dss-link-modal-label"},Sr=["src"],Nr={class:"dss-link-modal-field"},Mr={class:"dss-link-modal-label"},Br=["placeholder"],Hr={class:"dss-link-modal-field"},Tr={class:"dss-link-modal-label"},Ar=["placeholder"],Lr={class:"dss-link-modal-field"},$r={class:"dss-link-modal-label"},Dr=["placeholder"],Ir={key:1,class:"dss-image-tab-content"},_r={class:"dss-link-modal-content"},Rr={class:"dss-link-modal-field"},Fr={class:"dss-link-modal-label"},zr=["placeholder"],Pr={class:"dss-link-modal-field"},Or={class:"dss-link-modal-label"},Zr=["placeholder"],Ur={class:"dss-link-modal-field"},qr={class:"dss-link-modal-label"},Wr=["placeholder"],Xr={class:"dss-link-modal-field"},Yr={class:"dss-link-modal-label"},jr=["placeholder"],Kr={class:"dss-text-editor-title-input-container"},Gr={key:0,class:"dss-text-editor-title-preview"},Qr={key:0},Jr={key:1,class:"dss-text-editor-preview-placeholder"},ei=["value","placeholder","disabled"],ti={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},oi={class:"dss-text-editor-description-input-container"},ni={key:0,class:"dss-text-editor-description-preview"},li={key:0},ai={key:1,class:"dss-text-editor-preview-placeholder"},si=["value","placeholder","disabled"],ri={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},ii=["data-comment-id","onMouseenter"],ci=["onClick"],di=["src","alt"],ui={key:1},mi=["onClick"],pi=["src","alt"],fi={key:1},vi=["data-has-second-user","onClick"],gi={class:"editor-comment-marker-count"},hi={key:4,class:"dss-text-editor-textarea-wrapper"},yi=["value","placeholder","rows","disabled"],Ci={class:"dss-text-editor-footer"},ki={class:"dss-text-editor-footer-content"},xi={class:"dss-text-editor-footer-stat"},wi={class:"dss-text-editor-footer-stat"},bi={key:5,class:"dss-text-editor-content-wrapper"},Ei={key:0,class:"dss-comment-overlay-body"},Vi={class:"dss-comment-selection-wrapper"},Si=["innerHTML"],Ni={key:0,class:"dss-comment-avatar-wrapper"},Mi={class:"dss-comment-avatar"},Bi=["src","alt"],Hi={key:1},Ti={class:"dss-comment-header"},Ai={class:"dss-comment-header-text"},Li={class:"dss-comment-author"},$i={key:0,class:"dss-comment-date"},Di=["onClick","title"],Ii={class:"dss-comment-overlay-inner"},_i=["placeholder","onKeydown"],Ri={class:"dss-text-editor-footer"},Fi={class:"dss-text-editor-footer-content"},zi={class:"dss-text-editor-footer-stat"},Pi={class:"dss-text-editor-footer-stat"},Oi=["title"],Zi=["title"],Ui={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:""},qi={class:"dss-image-popup-content"},Wi={key:0,class:"dss-image-popup-no-alt-icon"},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-toolbar-left"},Gi=["title"],Qi=["title"],Ji={class:"dss-toolbar-dropdown-wrapper"},ec=["title"],tc={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"},oc={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"},nc={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"},lc={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"},ac={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"},sc={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"},rc={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},ic=["title"],cc=["title"],dc=["title"],uc=["title"],mc=["title"],pc=["title"],fc=["title"],vc=["title"],gc=["title"],hc=["title"],yc={key:2,class:"dss-toolbar-separator"},Cc={key:3,class:"dss-toolbar-dropdown-wrapper"},kc=["title"],xc={class:"dss-toolbar-dropdown-ai"},wc={key:0,class:"dss-toolbar-right"},bc={key:0,class:"dss-toolbar-separator"},Ec={key:0,class:"dss-toolbar-custom-group"},Vc={key:1,class:"dss-toolbar-separator"},Sc={name:"DSSTextEditor"},Nc=Object.assign(Sc,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(T,{expose:Wt,emit:O}){const{t:w,locale:vt}=Yn.useI18n(),x=T,K=O,Bt=e.useSlots(),S=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
76
76
|
<path d="M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z" fill="#c13340"/>
|
|
77
|
-
</svg>`,g=e.ref(null),De=e.ref(null),ze=e.ref(!1),Qe=e.ref(!1),M=e.ref(!1),I=e.ref(""),X=e.ref({}),W=e.ref(!1),st=e.ref(!1),oe=e.ref(""),ne=e.ref(""),rt=e.ref(null),Vo=e.ref(null),fe=e.ref(null),Ht=e.ref(null),Xt=e.ref(""),ro=e.ref(!1),q=e.ref({}),xe=e.ref(!1),Ae=e.ref({}),vo=e.ref(null),Le=e.ref(null),go=e.ref(!1),Ue=e.ref(""),So=e.ref(null),it=e.ref(""),de=e.ref(""),me=e.ref(""),Tt=e.ref(null),Je=e.ref(null),ho=e.ref(null),G=e.ref(null),At=e.ref(null),yo=e.ref(!1),io=e.ref(""),Yt=e.ref({}),jt=e.ref(!1),Pe=e.ref("upload"),Lt=e.ref(""),We=e.ref(null),we=e.ref(null),ct=e.ref([]),co=e.ref([]),Z=e.ref(null),ie=e.ref(!1),Xe=e.ref(""),$t=e.ref(""),dt=e.ref(""),he=e.ref(""),Ye=e.ref(""),et=e.ref(""),te=e.ref(null),le=e.ref(null),gt=e.ref(null),Fo=e.ref(!1),ht=e.ref(!1),tt=e.ref(!1),ut=e.ref(null),be=e.ref("p"),yt=e.ref(!1),Ct=e.ref([]),kt=e.ref(null),Kt=e.ref(null),mt=e.ref(null),Co=e.ref(!1),zo=e.ref(0),tn=100,xt=e.ref(null),Bn=e.computed(()=>({"dss-text-editor-no-border":!x.border,"dss-text-editor-rounded":x.rounded,"dss-text-editor-full-height":x.fullHeight,"dss-comment-overlay-open":Q.value!==null})),Hn=e.computed(()=>({})),Tn=e.computed(()=>!x.fixedHeight||x.fullHeight?{}:{height:`${1.6*14*x.rows+24+2}px`,resize:"none",overflowY:"auto"}),on=e.computed(()=>!x.fixedHeight||x.fullHeight?{}:{height:`${1.6*14*x.rows+32}px`,overflowY:"auto"}),No=e.computed(()=>x.richText&&co.value.length>0),nn=e.computed(()=>{if(!x.modelValue)return"";if(x.richText){let a=x.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return a=a.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),a=a.replace(/<[^>]+>/g,""),a=a.replace(/ /g," "),a=a.replace(/&/g,"&"),a=a.replace(/</g,"<"),a=a.replace(/>/g,">"),a=a.replace(/"/g,'"'),a=a.replace(/'/g,"'"),a=a.replace(/\s+/g," ").trim(),a}return x.modelValue}),Mo=e.computed(()=>{const a=nn.value.trim();return a?a.split(/\s+/).filter(l=>l.length>0).length:0}),Bo=e.computed(()=>nn.value.length),pe=e.computed(()=>G.value!==null&&Pe.value==="upload"&&it.value&&it.value.startsWith("data:")),$=e.computed(()=>x.titlePlaceholder||V("textEditor.placeholders.title")),Ho=e.computed(()=>x.descriptionPlaceholder||V("textEditor.placeholders.description")),ue=e.computed(()=>x.placeholder||V("textEditor.placeholders.startTyping")),$e=a=>Bt&&Bt[a]!==void 0,U=a=>{for(let l=a+1;l<x.customToolbarSlots.length;l++)if($e(x.customToolbarSlots[l]))return!0;return!1},ae=a=>{for(let l=a+1;l<x.customToolbarSlots.length;l++){const r=x.customToolbarSlots[l];if($e(r)&&w(r))return!0}return!1},w=a=>x.customToolbarFloatingMap.hasOwnProperty(a)?x.customToolbarFloatingMap[a]===!0:!0,Ee=e.computed(()=>x.customToolbarSlots.some(a=>$e(a)&&w(a))),D=e.computed(()=>$e("title-slot")),ln=e.computed(()=>$e("description-slot")),Gt=a=>{if(!a||a.trim()==="")return"<html></html>";const l=a.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?a:`<html>${a}</html>`},Qt=a=>{if(!a||a.trim()==="")return"";const l=a.replace(/<!--[\s\S]*?-->/g,""),r=l.trim();return r.startsWith("<html>")&&r.endsWith("</html>")?r.slice(6,-7).trim():l},an=a=>{if(!a)return;const l=document.createTreeWalker(a,NodeFilter.SHOW_COMMENT,null,!1),r=[];let i=l.nextNode();for(;i;)r.push(i),i=l.nextNode();r.forEach(c=>c.remove())},sn=a=>{try{const l=String(a.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()],c=a.getFullYear();return`${l} ${i} ${c}`}catch{return""}},rn=a=>{if(!a||typeof a!="string")return!1;const l=a.trim();if(!l)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(l))return!0;try{const c=V("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const i=l.toLowerCase();return i.includes("started conversation")||i.includes("démarré la conversation")||i==="started conversation"||i==="a démarré la conversation"},An=a=>{const l=a.target.value;K("update:modelValue",l),K("change",l)},Dt=()=>{if(!te.value)return;const a=te.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const r=a.scrollHeight;a.style.setProperty("height",`${r}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},Jt=()=>{ht.value=!0,Dt()},Ln=()=>{ht.value=!1,Po()},Po=()=>{if(!te.value)return;const a=te.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const l=a.value;a.value="M";const r=a.scrollHeight;a.value=l,a.offsetHeight,a.style.setProperty("height",`${r}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},$n=a=>{const r=a.target.value;ht.value&&Dt(),K("update:title",r),K("title-change",r),gt.value="title",x.richText&&(ie.value||($t.value=Xe.value,Ye.value=dt.value,et.value=he.value),Z.value&&clearTimeout(Z.value),ie.value=!0,Z.value=setTimeout(()=>{ie.value=!1,Ve()},500))},ko=()=>{if(!le.value)return;const a=le.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const r=a.scrollHeight;a.style.setProperty("height",`${r}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},cn=()=>{tt.value=!0,ko()},Dn=()=>{tt.value=!1,Oo()},Oo=()=>{if(!le.value)return;const a=le.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const l=a.value;a.value="M";const r=a.scrollHeight;a.value=l,a.offsetHeight,a.style.setProperty("height",`${r}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},dn=a=>{const r=a.target.value;tt.value&&ko(),K("update:description",r),K("description-change",r),gt.value="description",x.richText&&(ie.value||($t.value=Xe.value,Ye.value=dt.value,et.value=he.value),Z.value&&clearTimeout(Z.value),ie.value=!0,Z.value=setTimeout(()=>{ie.value=!1,Ve()},500))},wt=()=>{const a=window.getSelection();if(a.rangeCount===0)return null;const l=a.getRangeAt(0);if(l.startContainer.nodeType===1)return{type:"element",element:l.startContainer,offset:l.startOffset};const r=l.cloneRange();return r.selectNodeContents(g.value),r.setEnd(l.startContainer,l.startOffset),{type:"text",start:r.toString().length,end:r.toString().length+l.toString().length}},Oe=a=>{if(!(!a||!g.value))try{const l=window.getSelection(),r=document.createRange();if(a.type==="element"&&a.element)if(g.value.contains(a.element)){r.setStart(a.element,a.offset),r.collapse(!0),l.removeAllRanges(),l.addRange(r);return}else{g.value.focus();return}let i=0;const c=[g.value];let p=null,t=!1,n=!1;for(;!n&&(p=c.pop());)if(p.nodeType===3){const o=i+p.length;!t&&a.start>=i&&a.start<=o&&(r.setStart(p,a.start-i),t=!0),t&&a.end>=i&&a.end<=o&&(r.setEnd(p,a.end-i),n=!0),i=o}else{let o=p.childNodes.length;for(;o--;)c.push(p.childNodes[o])}l.removeAllRanges(),l.addRange(r)}catch{g.value.focus()}},To=()=>{if(!g.value)return;g.value.focus();const a=window.getSelection(),l=document.createRange(),r=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let p=c.childNodes.length-1;p>=0;p--){const t=c.childNodes[p],n=r(t);if(n)return n}return c},i=r(g.value);if(i.nodeType===3)l.setStart(i,i.length),l.setEnd(i,i.length);else if(i.childNodes.length>0){const c=r(i);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(i),l.collapse(!1))}else l.setStart(i,0),l.setEnd(i,0);a.removeAllRanges(),a.addRange(l)},Ve=(a=!1)=>{if(!g.value)return;const l=g.value.innerHTML,r=x.title||"",i=x.description||"";if(!a&&l===Xe.value&&r===dt.value&&i===he.value)return;const c={content:$t.value||Xe.value,title:Ye.value!==void 0?Ye.value:dt.value,description:et.value!==void 0?et.value:he.value},p=ct.value.length>0?ct.value[ct.value.length-1]:null;let t=!0;p&&(typeof p=="string"?t=c.content!==p:t=c.content!==p.content||c.title!==p.title||c.description!==p.description),t&&(ct.value.push(c),ct.value.length>50&&ct.value.shift(),co.value=[]),Xe.value=l,dt.value=r,he.value=i,$t.value=l,Ye.value=r,et.value=i},ce=a=>{if(!g.value)return;Ao(),g.value&&an(g.value);let l=null;g.value&&(g.value.querySelector("p")||(l=wt(),Zo())),a&&a.inputType&&(a.inputType==="insertText"||a.inputType==="insertCompositionText"||a.inputType==="deleteContentBackward"||a.inputType==="deleteContentForward")&&ut.value&&(ut.value=null),Qe.value=!0;const i=g.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=Gt(i);K("update:modelValue",c),K("change",c),gt.value="editor",ie.value||($t.value=Xe.value,Ye.value=dt.value,et.value=he.value),Z.value&&clearTimeout(Z.value),ie.value=!0,Z.value=setTimeout(()=>{ie.value=!1,Ve()},500),e.nextTick(()=>{l&&Oe(l),Ao();const p=["bold","italic","underline"],t=window.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null,o=n&&n.collapsed;p.forEach(s=>{try{if(o&&ut.value?.command===s){q.value[s]=ut.value.state;return}if(s==="bold")if(n){const d=n.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 f=window.getComputedStyle(u);parseInt(f.fontWeight)>=600&&(m=!0)}catch{}q.value[s]=m}else q.value.hasOwnProperty(s)||(q.value[s]=!1);else if(s==="italic")if(n){const d=n.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d,m=u&&(u.tagName==="EM"||u.tagName==="I"||u.closest&&u.closest("em, i"));q.value[s]=!!m}else{const d=document.queryCommandState(s);q.value[s]=d}else{const d=document.queryCommandState(s);q.value[s]=d}}catch{}}),Se(),ot(),Rt(),ke(),Ft(),_e("handleRichTextInput"),Qe.value=!1})},Ao=()=>{if(!g.value)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const l=a.getRangeAt(0),r=l.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(!i)return;const c=i.closest(".dss-image-wrapper");if(c){const p=c.querySelector("img");if(i!==p&&!p?.contains(i)){const t=l.startContainer.nodeType===3?l.startContainer.parentElement:l.startContainer,n=l.endContainer.nodeType===3?l.endContainer.parentElement:l.endContainer;if(c.contains(t)&&t!==p||c.contains(n)&&n!==p){const o=document.createRange();o.setStartAfter(c),o.collapse(!0),a.removeAllRanges(),a.addRange(o)}}}},Zo=()=>{if(!g.value)return;const a=g.value;if(a.querySelector&&a.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),r=Array.from(a.childNodes);let i=null;r.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===a&&a.removeChild(c);return}i||(i=document.createElement("p"),a.insertBefore(i,c)),i.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const p=c,t=p.tagName;if(t==="BR"){i=null;return}if(l.has(t)){i=null;return}i||(i=document.createElement("p"),a.insertBefore(i,p)),i.appendChild(p)}})},ot=()=>{if(g.value&&!Fo.value){Fo.value=!0;try{g.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),g.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const c=i.parentElement;!c||!c.classList.contains("dss-image-wrapper")?i.remove():c.querySelector("img")||i.remove()}),g.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const p=i.getAttribute("src")||i.src||"";if(c){const s=p.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),d=c===p||c===s;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||d||d)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const t=!c||c.trim()==="";let n=i.parentElement;const o=n&&n.classList.contains("dss-image-wrapper");if(o){const s=n.querySelector(".dss-image-no-alt-icon");s&&s.remove()}else{const s=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;s&&s.remove()}if(t){o?n.setAttribute("contenteditable","false"):(n=document.createElement("span"),n.className="dss-image-wrapper",n.setAttribute("contenteditable","false"),i.parentNode.insertBefore(n,i),n.appendChild(i));const s=document.createElement("div");s.className="dss-image-no-alt-icon",s.setAttribute("contenteditable","false"),s.innerHTML=S,n.appendChild(s)}else if(o&&n.children.length===1){const s=n.parentNode;s.insertBefore(i,n),s.removeChild(n)}})}finally{Fo.value=!1}}},un=a=>{K("blur",a),po()},It=()=>{if(x.disabled||!x.richText||!g.value)return;He(),Z.value&&(clearTimeout(Z.value),Z.value=null),ie.value&&(Ve(),ie.value=!1);const a=gt.value==="title",l=gt.value==="description",r=gt.value==="editor";if(ct.value.length===0){a&&te.value?te.value.focus():l&&le.value?le.value.focus():g.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{ce()});return}const i={content:g.value.innerHTML,title:x.title||"",description:x.description||""};co.value.push(i);const c=ct.value.pop();if(c!==void 0){Qe.value=!0;const p=typeof c=="string"?c:c.content,t=typeof c=="object"&&c.title||"",n=typeof c=="object"&&c.description||"";g.value.innerHTML=p,Xe.value=p,dt.value=t,he.value=n,$t.value=p,Ye.value=t,et.value=n,e.nextTick(()=>{Se(),qe(),zt(),ke();const o=Gt(p);K("update:modelValue",o),K("update:title",t),K("update:description",n),K("change",o),K("title-change",t),K("description-change",n),Qe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(te.value){te.value.focus();const s=t.length;te.value.setSelectionRange&&te.value.setSelectionRange(s,s),Dt()}}else if(l){if(le.value){le.value.focus();const s=n.length;le.value.setSelectionRange(s,s)}}else if(r)To();else if(te.value&&document.activeElement===te.value){const s=t.length;te.value.setSelectionRange&&te.value.setSelectionRange(s,s),Dt()}else if(le.value&&document.activeElement===le.value){const s=n.length;le.value.setSelectionRange(s,s)}else g.value&&To()},10)})})}},mn=()=>{if(x.disabled||!x.richText||!g.value)return;He();const a=gt.value==="title",l=gt.value==="description",r=gt.value==="editor";if(co.value.length===0){a&&te.value?te.value.focus():l&&le.value?le.value.focus():g.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{ce()});return}const i={content:g.value.innerHTML,title:x.title||"",description:x.description||""};ct.value.push(i);const c=co.value.pop();if(c!==void 0){Qe.value=!0;const p=typeof c=="string"?c:c.content,t=typeof c=="object"&&c.title||"",n=typeof c=="object"&&c.description||"";g.value.innerHTML=p,Xe.value=p,dt.value=t,he.value=n,$t.value=p,Ye.value=t,et.value=n,e.nextTick(()=>{Se(),qe(),zt(),ke();const o=Gt(p);K("update:modelValue",o),K("update:title",t),K("update:description",n),K("change",o),K("title-change",t),K("description-change",n),Qe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(te.value){te.value.focus();const s=t.length;te.value.setSelectionRange&&te.value.setSelectionRange(s,s),Dt()}}else if(l){if(le.value){le.value.focus();const s=n.length;le.value.setSelectionRange(s,s)}}else if(r)To();else if(te.value&&document.activeElement===te.value){const s=t.length;te.value.setSelectionRange&&te.value.setSelectionRange(s,s),Dt()}else if(le.value&&document.activeElement===le.value){const s=n.length;le.value.setSelectionRange(s,s)}else g.value&&To()},10)})})}},Lo=()=>{if(!g.value)return;g.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const p=document.createDocumentFragment();for(;i.firstChild;)p.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(p,i)}}),g.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const p=document.createElement("b");for(p.style.fontWeight="600";i.firstChild;)p.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(p,i)}}),g.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},Rt=()=>{if(!g.value)return;g.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},In=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const l=a.getRangeAt(0);let r=!1;if(l.collapsed){const i=l.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==g.value;){if(c.tagName==="EM"||c.tagName==="I"){r=!0;break}if(c.style&&c.style.fontStyle==="italic"){r=!0;break}c=c.parentElement}}else{const i=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let p;for(;p=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(p))){if(p.nodeType===3){let t=p.parentElement;for(;t&&t!==g.value;){if(t.tagName==="EM"||t.tagName==="I"){r=!0;break}if(t.style&&t.style.fontStyle==="italic"){r=!0;break}t=t.parentElement}}else if(p.nodeType===1){const t=p;if(t.tagName==="EM"||t.tagName==="I"){r=!0;break}if(t.style&&t.style.fontStyle==="italic"){r=!0;break}}if(r)break}}}if(r)return document.execCommand("italic",!1),e.nextTick(()=>{Rt()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Rt()});else try{const i=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(i),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),a.removeAllRanges(),a.addRange(l),e.nextTick(()=>{Rt()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Rt()})}return!0},Rn=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const l=a.getRangeAt(0);let r=!1;if(l.collapsed){const i=l.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==g.value;){if(c.tagName==="STRONG"||c.tagName==="B"){r=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){r=!0;break}c=c.parentElement}}else{const i=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let p;for(;p=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(p))){if(p.nodeType===3){let t=p.parentElement;for(;t&&t!==g.value;){if(t.tagName==="STRONG"||t.tagName==="B"){r=!0;break}if(t.style&&parseInt(t.style.fontWeight)>=600){r=!0;break}t=t.parentElement}}else if(p.nodeType===1){const t=p;if(t.tagName==="STRONG"||t.tagName==="B"){r=!0;break}if(t.style&&parseInt(t.style.fontWeight)>=600){r=!0;break}}if(r)break}}}if(r)return document.execCommand("bold",!1),e.nextTick(()=>{Lo()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),p=c.startContainer;let t=p.nodeType===3?p.parentElement:p;for(;t&&t!==g.value;){if(t.tagName==="SPAN"&&t.style.fontWeight){const n=t.style.fontWeight;if(n==="normal"||n==="400"){const o=document.createElement("b");o.style.fontWeight="600";const s=document.createDocumentFragment();for(;t.firstChild;)s.appendChild(t.firstChild);o.appendChild(s),t.parentNode&&t.parentNode.replaceChild(o,t),c.setStart(o,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c);break}}else if(t.tagName==="STRONG"||t.tagName==="B"){t.style.fontWeight="600";break}t=t.parentElement}if(!t||t===g.value){const n=document.createElement("b");n.style.fontWeight="600",n.innerHTML="<br>",c.insertNode(n),c.setStart(n,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}Lo()});else try{const i=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(i),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),a.removeAllRanges(),a.addRange(l),e.nextTick(()=>{Lo()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Lo()})}return!0},_t=(a,l=null)=>{if(x.disabled||!x.richText||!g.value)return;ie.value?(Z.value&&(clearTimeout(Z.value),Z.value=null),Ve(),ie.value=!1):Ve(),He(),g.value.focus();const r=window.getSelection();let i=null;if(r&&r.rangeCount>0){const p=r.getRangeAt(0);!p.collapsed&&oo(p)&&(i=wt())}if(a==="createLink"&&l){const p=window.getSelection();if(p.rangeCount>0){const t=p.getRangeAt(0);if(t.collapsed)try{t.expand("word")}catch{const o=document.createTextNode(l);t.insertNode(o),t.selectNodeContents(o)}}}if(a==="bold"){const p=Rn();q.value.bold=p;const t=window.getSelection();t.rangeCount>0&&t.getRangeAt(0).collapsed&&(ut.value={command:"bold",state:p}),e.nextTick(()=>{i&&(Oe(i),e.nextTick(()=>{const n=Ze("bold");q.value.bold=n})),ce(),qe(),ke()});return}if(a==="italic"){const p=In();q.value.italic=p;const t=window.getSelection();t.rangeCount>0&&t.getRangeAt(0).collapsed&&(ut.value={command:"italic",state:p}),e.nextTick(()=>{i&&(Oe(i),e.nextTick(()=>{const n=Ze("italic");q.value.italic=n})),ce(),Rt(),qe(),ke()});return}let c=!1;try{c=document.execCommand(a,!1,l)}catch{}e.nextTick(()=>{if(i&&Oe(i),["bold","italic","underline"].includes(a))try{if(a==="bold")i&&e.nextTick(()=>{const t=Ze("bold");q.value.bold=t});else if(a==="italic")if(i)e.nextTick(()=>{const t=Ze("italic");q.value.italic=t});else{const t=document.queryCommandState(a);q.value[a]=t}else{const t=document.queryCommandState(a);q.value[a]=t}}catch{q.value.hasOwnProperty(a)?q.value[a]=!q.value[a]:q.value[a]=!0}if(a==="createLink"&&l){const t=window.getSelection();if(t.rangeCount>0){const o=t.getRangeAt(0),s=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("a"):o.commonAncestorContainer.parentElement?.closest("a");s&&(!s.getAttribute("href")||s.getAttribute("href")==="")&&s.setAttribute("href",l)}g.value.querySelectorAll("a").forEach(o=>{const s=o.getAttribute("href");(!s||s===""||s==="#")&&o.setAttribute("href",l)})}ce(),qe(),ke()})},Ze=(a,l=null)=>{if(x.disabled||!g.value)return!1;try{if(a==="formatBlock"&&l){const i=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=i.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const p=window.getSelection();if(p.rangeCount>0){const n=p.getRangeAt(0).commonAncestorContainer;return!!(n.nodeType===1?n.tagName==="BLOCKQUOTE"?n:n.closest("blockquote"):n.parentElement?.closest("blockquote"))}}return i===l||i.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(a))try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(a==="bold"){let t=!1;if(c.collapsed){const n=c.commonAncestorContainer,o=n.nodeType===3?n.parentElement:n;if(o&&((o.tagName==="STRONG"||o.tagName==="B"||o.closest&&o.closest("strong, b"))&&(t=!0),!t&&o.style&&parseInt(o.style.fontWeight)>=600&&(t=!0),!t))try{const s=window.getComputedStyle(o);parseInt(s.fontWeight)>=600&&(t=!0)}catch{}return q.value.hasOwnProperty(a)?q.value[a]:(q.value[a]=t,t)}else{const n=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let o=!1;if(n){const s=document.createTreeWalker(n,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=s.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(d))){if(d.nodeType===3){if(!(d.textContent||"").trim())continue;o=!0;let m=d.parentElement;for(;m&&m!==g.value;){if(m.tagName==="STRONG"||m.tagName==="B"){t=!0;break}if(m.style&&parseInt(m.style.fontWeight)>=600){t=!0;break}m=m.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){t=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){t=!0;break}}if(t)break}}return q.value[a]=t&&o,t&&o}}if(a==="italic"){let t=!1;if(c.collapsed){const n=c.commonAncestorContainer,o=n.nodeType===3?n.parentElement:n;if(o&&((o.tagName==="EM"||o.tagName==="I"||o.closest&&o.closest("em, i"))&&(t=!0),!t&&o.style&&o.style.fontStyle==="italic"&&(t=!0),!t))try{window.getComputedStyle(o).fontStyle==="italic"&&(t=!0)}catch{}return q.value.hasOwnProperty(a)?q.value[a]:(q.value[a]=t,t)}else{const n=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let o=!1;if(n){const s=document.createTreeWalker(n,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=s.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(d))){if(d.nodeType===3){if(!(d.textContent||"").trim())continue;o=!0;let m=d.parentElement;for(;m&&m!==g.value;){if(m.tagName==="EM"||m.tagName==="I"){t=!0;break}if(m.style&&m.style.fontStyle==="italic"){t=!0;break}m=m.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){t=!0;break}if(u.style&&u.style.fontStyle==="italic"){t=!0;break}}if(t)break}}return q.value[a]=t&&o,t&&o}}const p=document.queryCommandState(a);return c.collapsed&&q.value.hasOwnProperty(a)?q.value[a]:(q.value[a]=p,p)}return q.value.hasOwnProperty(a)?q.value[a]:!1}catch{return q.value.hasOwnProperty(a)?q.value[a]:!1}try{return document.queryCommandState(a)}catch{return!1}}catch{return!1}},Uo=a=>{x.disabled||!x.richText||(De.value=De.value===a?null:a,a==="askAi"&&(Le.value=null))},He=()=>{De.value=null,We.value=null},bt=a=>{_t("formatBlock",a),He()},_n=a=>{if(!a||!g.value)return a;const l=h=>{let y=h.nodeType===Node.TEXT_NODE?h.parentElement:h;for(;y&&y!==g.value;){const k=y.tagName;if(k==="P"){const N=y.parentElement;if(N===g.value||N.tagName==="BLOCKQUOTE")return y}if(k==="BLOCKQUOTE")break;y=y.parentElement}return null},r=l(a.startContainer),i=l(a.endContainer);if(!r||!i)return a;const c=[],p=document.createTreeWalker(g.value,NodeFilter.SHOW_ELEMENT,{acceptNode:h=>{const y=h.tagName;if(y==="P"){const k=h.parentElement;if(k===g.value||k.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return y==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let t;for(;t=p.nextNode();)c.push(t);const n=c.indexOf(r),o=c.indexOf(i);if(n===-1||o===-1)return a;const s=Math.min(n,o),d=Math.max(n,o),u=c.slice(s,d+1);if(u.length===0)return a;const m=u[0],f=u[u.length-1],v=document.createRange();return v.setStartBefore(m),v.setEndAfter(f),v},pn=()=>{if(x.disabled||!x.richText||!g.value)return;ie.value?(Z.value&&(clearTimeout(Z.value),Z.value=null),Ve(),ie.value=!1):Ve(),He(),g.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;let l=a.getRangeAt(0);!l.collapsed&&oo(l)&&(l=_n(l),a.removeAllRanges(),a.addRange(l));let r=null;!l.collapsed&&oo(l)&&(r=wt());const i=l.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&g.value.contains(c))){if(c){const t=c.parentNode;Array.from(c.childNodes).forEach(o=>{if(o.nodeType===Node.ELEMENT_NODE)if(o.tagName==="P"||o.tagName==="DIV")t.insertBefore(o,c);else{const s=document.createElement("p");s.appendChild(o.cloneNode(!0)),t.insertBefore(s,c)}else if(o.nodeType===Node.TEXT_NODE&&o.textContent.trim()){const s=document.createElement("p");s.appendChild(o.cloneNode(!0)),t.insertBefore(s,c)}}),c.remove()}}else if(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const t=document.createElement("blockquote"),n=l.extractContents();t.appendChild(n),l.insertNode(t);const o=[],s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:m=>m.parentNode===t&&m.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let d;for(;d=s.nextNode();)o.push(d);if(o.forEach(m=>{const f=document.createElement("p");m.parentNode.insertBefore(f,m),f.appendChild(m)}),t.querySelectorAll("p, div").forEach(m=>{m.textContent.trim()===""&&!m.querySelector("img")&&(m.innerHTML="<br>")}),t.children.length===0&&t.textContent.trim()===""){const m=document.createElement("p");m.innerHTML="<br>",t.appendChild(m)}}e.nextTick(()=>{r&&Oe(r),zt(),ce(),ke()})},$o=()=>{if(!g.value)return;const a=window.getSelection();if(a.rangeCount===0)return;const r=a.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!i||!g.value.contains(i))return;const c=d=>{if(!d)return!1;const u=d.textContent||"",f=(d.innerHTML||"").trim();return u.trim()===""||f===""||f==="<br>"||f==="<br/>"||f==="<p></p>"||f==="<p><br></p>"||f==="<p><br/></p>"||f==="<p> </p>"||f==="<p><br> </p>"||f==="<div></div>"||f==="<div><br></div>"||f==="<div><br/></div>"};let p=null;for(r.nodeType===3?p=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?p=r:p=r.closest("p, div"),p&&i.contains(p)&&c(p)&&p.remove();i.lastChild;){const d=i.lastChild;if(d.nodeType===1&&d.tagName==="BR")d.remove();else if(d.nodeType===3)if((d.textContent||"").trim()==="")d.remove();else break;else break}if(i.children.length>0)for(let d=i.children.length-1;d>=0;d--){const u=i.children[d];if((u.tagName==="P"||u.tagName==="DIV")&&c(u))u.remove();else break}let t=i.innerHTML;const n=t;t=t.replace(/(<br\s*\/?>)+$/gi,""),t!==n&&(i.innerHTML=t);const o=document.createElement("p");o.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(o,i.nextSibling):i.parentNode.appendChild(o):g.value&&g.value.appendChild(o);const s=document.createRange();s.selectNodeContents(o),s.collapse(!0),a.removeAllRanges(),a.addRange(s),e.nextTick(()=>{zt(),ce()})},qe=()=>{if(!g.value){ze.value=!1;return}try{const a=window.getSelection();if(a.rangeCount>0){const r=a.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a");ze.value=!!i}else ze.value=!1}catch{ze.value=!1}},Do=()=>{if(!g.value)return;const a=window.getSelection();a&&a.rangeCount>0&&a.getRangeAt(0),Ht.value=wt();const l=window.getSelection();let r="";l.rangeCount>0&&(r=l.getRangeAt(0).toString()),oe.value="",ne.value=r,Xt.value="",fe.value=null,st.value=!0,He(),e.nextTick(()=>{rt.value&&rt.value.focus()})},Et=()=>{if(!g.value)return;ie.value?(Z.value&&(clearTimeout(Z.value),Z.value=null),Ve(),ie.value=!1):Ve();const a=window.getSelection();let l=null;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer;l=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!l&&fe.value&&(l=fe.value),l&&l.parentNode){const r=document.createDocumentFragment();for(;l.firstChild;)r.appendChild(l.firstChild);if(l.parentNode.replaceChild(r,l),r.firstChild){const i=document.createRange();i.setStartBefore(r.firstChild),i.setEndAfter(r.lastChild||r.firstChild),a.removeAllRanges(),a.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),a.removeAllRanges(),a.addRange(i)}fe.value=null}else _t("unlink");ze.value=!1,He(),e.nextTick(()=>{ce(),qe()})},C=()=>{x.disabled||!x.richText||g.value&&(ie.value?(Z.value&&(clearTimeout(Z.value),Z.value=null),Ve(),ie.value=!1):Ve(),He(),g.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Se(),ce(),ke()}))},Te=()=>{x.disabled||!x.richText||g.value&&(ie.value?(Z.value&&(clearTimeout(Z.value),Z.value=null),Ve(),ie.value=!1):Ve(),He(),g.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Se(),ce(),ke()}))},je=a=>{const l=a.parentElement;if(!l||l.tagName!=="OL")return null;let r=0,i=a.previousElementSibling;for(;i;)i.tagName==="LI"&&r++,i=i.previousElementSibling;return r+1},Se=()=>{if(!g.value)return;g.value.querySelectorAll("li > ol").forEach(l=>{const r=l.parentElement;if(r&&r.tagName==="LI"){const i=je(r);i!==null&&Array.from(l.children).filter(p=>p.tagName==="LI").forEach(p=>{p.setAttribute("data-parent-num",String(i))})}})},Vt=()=>{if(x.disabled||!x.richText||!g.value)return;He(),g.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const l=a.getRangeAt(0),r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!r){document.execCommand("indent",!1),e.nextTick(()=>{Se(),ce()});return}const i=r.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=r.previousElementSibling;if(c&&c.tagName==="LI"){const p=i.tagName.toLowerCase();let t=c.querySelector(`:scope > ${p}`);t||(t=document.createElement(p),c.appendChild(t));const n=je(c);t.appendChild(r),n!==null&&i.tagName==="OL"&&r.setAttribute("data-parent-num",String(n)),Se();const o=document.createRange();o.selectNodeContents(r),o.collapse(!1),a.removeAllRanges(),a.addRange(o),e.nextTick(()=>{ce(),ke()})}else document.execCommand("indent",!1),e.nextTick(()=>{Se(),ce(),ke()})},Ne=()=>{if(x.disabled||!x.richText||!g.value)return;He(),g.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const l=a.getRangeAt(0),r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!r){document.execCommand("outdent",!1),e.nextTick(()=>{Se(),ce()});return}const i=r.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const p=c.parentElement;if(p&&(p.tagName==="OL"||p.tagName==="UL")){i.tagName==="OL"&&r.removeAttribute("data-parent-num"),p.insertBefore(r,c.nextSibling),i.children.length===0&&i.remove(),Se();const t=document.createRange();t.selectNodeContents(r),t.collapse(!1),a.removeAllRanges(),a.addRange(t),e.nextTick(()=>{ce(),ke()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Se(),ce(),ke()})},Q=e.ref(null),Ie=e.ref(null),Ke=e.ref({}),se=e.ref(""),re=e.ref(null),Y=e.ref("");e.ref("");const Me=e.ref(null);e.ref("");const Re=e.ref([]),Io=e.ref(!1),uo=e.ref(!1),fn=a=>{if(!a)return"";const l=a.cloneRange(),r=document.createElement("div");return r.appendChild(l.cloneContents()),r.innerHTML},vn=()=>{if(x.disabled||!x.richText||!g.value)return;if(Q.value!==null){Q.value=null,se.value="",Y.value="",Me.value=null,Re.value=[],Ut(!0);return}He(),g.value.focus();const a=window.getSelection();if(!a||a.rangeCount===0)return;const l=a.getRangeAt(0);if(l.collapsed||!oo(l))return;Y.value=fn(l)||"",Me.value=wt();const r=l.getBoundingClientRect(),i=g.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),p=r.bottom-c.top,n=Math.max(p+8,0);Ke.value={top:`${n}px`,bottom:"auto"},Q.value=Date.now(),e.nextTick(()=>{if(se.value="",re.value){const s=re.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`,s.focus()}const o=i.querySelector(".dss-comment-overlay");if(o&&i){const s=i.querySelector(".dss-text-editor-footer");if(s){const d=i.getBoundingClientRect(),u=o.getBoundingClientRect(),m=s.getBoundingClientRect(),f=u.bottom-d.top,v=m.top-d.top,h=8;if(f>v-h){const y=m.height;Ke.value={bottom:`${y+h}px`,top:"auto"}}else Ke.value={top:`${n}px`,bottom:"auto"}}}})},gn=()=>{if(!se.value.trim())return;const a=se.value.trim(),l=new Date,r={text:a,selectionText:Y.value,selectionRange:Me.value,commentId:Q.value,user:x.commentUser||null,createdAt:l.toISOString()};Re.value=[...Re.value,r],K("comment-submitted",r),Fn(r),Me.value&&!eo(Me.value)&&ye(Q.value,Me.value),se.value="",e.nextTick(()=>{if(re.value){const i=re.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}_e("sendComment")})},St=(a,l)=>{if(!(!x.commentUser||!a.user||a.user.id!==x.commentUser.id)){if(Re.value=Re.value.filter((r,i)=>i!==l),Q.value!==null&&g.value){const r=String(Q.value),i=g.value.querySelector(`[data-comment="${r}"], [data-fake-comment="${r}"]`);if(i&&Re.value.length>0){const c=[],p=new Set;Re.value.forEach(t=>{t.user&&t.user.id&&!p.has(t.user.id)&&(p.add(t.user.id),c.push(t.user))}),c.length>0?i.setAttribute("data-comment-user",JSON.stringify(c[0])):i.removeAttribute("data-comment-user"),c.length>1?i.setAttribute("data-comment-user-2",JSON.stringify(c[1])):i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count",String(Re.value.length))}else i&&Re.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(K("comment-deleted",{comment:a,index:l,commentId:Q.value}),x.comments&&Array.isArray(x.comments)){const r=x.comments.filter(i=>!(i.commentId===a.commentId&&i.text===a.text&&i.user?.id===a.user?.id));K("update:comments",r)}e.nextTick(()=>{_e("deleteComment")})}},eo=a=>{if(!a||!g.value)return!1;try{const l=Nt(a);if(!l)return!1;const r=l.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i)return!!i.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Nt=a=>{if(!a||!g.value)return null;try{const l=document.createRange();if(a.type==="element"&&a.element)return g.value.contains(a.element)?(l.setStart(a.element,a.offset),l.collapse(!0),l):null;let r=0;const i=[g.value];let c=null,p=!1,t=!1;for(;!t&&(c=i.pop());)if(c.nodeType===3){const n=r+c.length;!p&&a.start>=r&&a.start<=n&&(l.setStart(c,a.start-r),p=!0),p&&a.end>=r&&a.end<=n&&(l.setEnd(c,a.end-r),t=!0),r=n}else{let n=c.childNodes.length;for(;n--;)i.push(c.childNodes[n])}return p?l:null}catch{return null}},ye=(a,l)=>{if(!(!a||!l||!g.value))try{const r=Nt(l);if(!r||r.collapsed)return;const i=r.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const n=c.closest("[data-comment], [data-fake-comment]");if(n){n.getAttribute("data-comment")!==String(a)&&n.getAttribute("data-fake-comment")!==String(a)&&n.setAttribute("data-comment",String(a));return}}const p=document.createElement("span");p.setAttribute("data-comment",String(a));try{const n=r.startContainer,o=r.endContainer,s=r.startOffset,d=r.endOffset,u=n.nodeType===3?n.parentNode:n,m=o.nodeType===3?o.parentNode:o;if(u===m&&s===0&&d===(o.nodeType===3?o.length:m.childNodes.length)&&(u.tagName==="P"||u.tagName==="DIV"||u.tagName==="H1"||u.tagName==="H2"||u.tagName==="H3"||u.tagName==="H4"||u.tagName==="H5"||u.tagName==="H6")){const v=r.extractContents();p.appendChild(v),r.insertNode(p)}else r.surroundContents(p)}catch{const o=r.extractContents();p.appendChild(o),r.insertNode(p)}const t=g.value.querySelector(`[data-comment="${String(a)}"]`);e.nextTick(()=>{_e("wrapSelectionWithCommentMarker"),ce()})}catch{}},Fn=a=>{if(!a||!a.commentId)return;const l=Array.isArray(x.comments)?[...x.comments]:[],r=typeof a.commentId=="string"&&a.commentId.startsWith("comment-")?Date.now():Number(a.commentId)||a.commentId;let i=l.findIndex(p=>typeof p.conversation_id=="string"&&p.conversation_id.startsWith("comment-")?null:Number(p.conversation_id)===Number(r)||p.conversation_id===r);const c={text:a.text,user:a.user,createdAt:a.createdAt,created_at:a.createdAt,updated_at:a.createdAt};if(i>=0){const p=l[i];if(p.conversation||(p.conversation=[]),p.conversation.push(c),p.updated_at=a.createdAt,!p.article_id&&l.length>0){const t=l.find(n=>n.article_id);t&&(p.article_id=t.article_id)}}else{const p=a.selectionRange,t=l.length>0&&l.find(o=>o.article_id)?.article_id||null,n={conversation_id:r,article_id:t,selection_range:p?{start:p.start||0,end:p.end||0,type:p.type||"text"}:null,selection_text:a.selectionText||"",conversation:[c],created_by_user:a.user,created_at:a.createdAt,updated_at:a.createdAt,status:"active"};l.push(n)}Io.value=!0,K("update:comments",l)},Ce=(a,l=[])=>{if(x.disabled||!x.richText||!g.value)return;const r=g.value;let i=null;try{i=r.querySelector(a)}catch{return}if(!i)return;He(),r.focus();const c=document.createRange();c.selectNodeContents(i);const p=window.getSelection();p&&(p.removeAllRanges(),p.addRange(c)),Y.value=i.innerHTML||"",Me.value=wt();const t=c.getBoundingClientRect(),n=r.parentElement;if(n){const d=n.getBoundingClientRect(),u=t.bottom-d.top,f=Math.max(u+8,0);Ke.value={top:`${f}px`,bottom:"auto"}}const o=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let s=[];if(o&&x.comments&&Array.isArray(x.comments)){const d=x.comments.find(u=>String(u.conversation_id)===String(o));if(d&&d.conversation&&Array.isArray(d.conversation)){const u=d.conversation.map(m=>({id:m.id||m.commentary_id,commentary_id:m.id||m.commentary_id,conversation_id:d.id||d.conversation_id,text:m.text,user:m.user,createdAt:m.created_at||m.createdAt,updated_at:m.updated_at||m.updatedAt}));s.push(...u)}}s.length===0&&Array.isArray(l)&&l.length>0&&(s=l.slice()),s.sort((d,u)=>{const m=h=>{if(!h)return 0;const y=new Date(h).getTime();return isNaN(y)?0:y},f=m(d.createdAt),v=m(u.createdAt);return f===v?0:f-v}),Re.value=s,Ut(!0),Q.value=o||null,i&&(Ie.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(se.value="",re.value){const d=re.value;d.style.height="auto",d.style.height=`${d.scrollHeight}px`,d.focus()}if(n){const d=n.querySelector(".dss-comment-overlay");if(d){const u=n.querySelector(".dss-text-editor-footer");if(u){const m=n.getBoundingClientRect(),f=d.getBoundingClientRect(),v=u.getBoundingClientRect(),h=f.bottom-m.top,y=v.top-m.top,k=8;if(h>y-k){const N=v.height;Ke.value={bottom:`${N+k}px`,top:"auto"}}}}}_e("openCommentOverlayForSelector")})},Be=e.ref(null),hn=e.ref(0),zn=a=>{if(!(x.disabled||!x.richText)){if(a.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const i=l.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&g.value&&g.value.contains(c))){a.preventDefault();let t=null;i.nodeType===3?t=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?t=i:t=i.closest("p, div");const n=document.createElement("p");n.innerHTML="<br>",t&&c.contains(t)&&t.nextSibling?c.insertBefore(n,t.nextSibling):c.appendChild(n),setTimeout(()=>{$o()},50);return}}}if(a.key.length===1||a.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const r=l.getRangeAt(0),i=r.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const p=c.closest(".dss-image-wrapper");if(p){const t=p.querySelector("img");if(c!==t&&!t?.contains(c)){const n=r.startContainer.nodeType===3?r.startContainer.parentElement:r.startContainer,o=r.endContainer.nodeType===3?r.endContainer.parentElement:r.endContainer;if(p.contains(n)&&n!==t||p.contains(o)&&o!==t){a.preventDefault();const s=document.createRange();s.setStartAfter(p),s.collapse(!0),l.removeAllRanges(),l.addRange(s);return}}}}}}if(a.key==="Backspace"||a.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0);let i=null,c=null;if(r.collapsed)if(a.key==="Backspace"){const p=r.startContainer;let t=p;p.nodeType===3&&(r.startOffset===0?t=p.previousSibling||p.parentNode:t=p.parentNode);const n=t.previousSibling;n&&(n.classList&&n.classList.contains("dss-image-wrapper")?c=n:n.tagName==="IMG"&&(i=n,c=i.closest(".dss-image-wrapper"))),c||(c=t.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const p=r.startContainer;let t=p;p.nodeType===3&&(r.startOffset===p.length?t=p.nextSibling||p.parentNode:t=p.parentNode);const n=t.nextSibling;n&&(n.classList&&n.classList.contains("dss-image-wrapper")?c=n:n.tagName==="IMG"&&(i=n,c=i.closest(".dss-image-wrapper"))),c||(c=t.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const p=r.commonAncestorContainer,t=r.startContainer.nodeType===3?r.startContainer.parentElement:r.startContainer,n=r.endContainer.nodeType===3?r.endContainer.parentElement:r.endContainer;if(p.nodeType===1&&p.tagName==="IMG"?(i=p,c=i.closest(".dss-image-wrapper")):(i=p.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const o=c.contains(t)||t===c,s=c.contains(n)||n===c,u=r.cloneContents().textContent?.trim()||"",m=c.textContent?.trim()||"";(!o||!s||u.length>m.length)&&(c=null,i=null)}}if(c){a.preventDefault(),a.stopPropagation();const p=c.parentNode;if(p){const t=document.createTextNode("");p.insertBefore(t,c),c.remove();const n=document.createRange();n.setStartAfter(t),n.collapse(!0),l.removeAllRanges(),l.addRange(n),e.nextTick(()=>{ce()});return}}}}if(a.key==="Tab"){a.preventDefault(),a.shiftKey?Ne():Vt();return}if(a.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0);if(r.collapsed){const t=r.startContainer,n=o=>{if(!o)return!1;let s=o.previousSibling;for(;s;){if(s.classList&&s.classList.contains("dss-image-wrapper")||s.tagName==="IMG"||s.querySelector&&s.querySelector(".dss-image-wrapper")||s.querySelector&&s.querySelector("img"))return!0;s=s.previousSibling}const d=o.parentElement;return d&&d!==g.value?n(d):!1};if(t.nodeType===3){const o=t.parentElement;if(o&&(n(o)||n(t))){const s=o.closest("p, div");if(s&&s!==g.value){a.preventDefault(),a.stopPropagation();let d=null;const u=r.startOffset;u<t.length&&(d=t.splitText(u));const m=document.createElement("p");if(d?m.appendChild(d):m.innerHTML="<br>",t.length===0){const v=t.parentElement;v&&(v.removeChild(t),v.childNodes.length===0&&v.appendChild(document.createElement("br")))}s.nextSibling?s.parentNode.insertBefore(m,s.nextSibling):s.parentNode.appendChild(m);const f=document.createRange();d?f.setStart(d,0):f.setStart(m,0),f.collapse(!0),l.removeAllRanges(),l.addRange(f),e.nextTick(()=>{ce()});return}}}}const i=r.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&g.value&&g.value.contains(c))){let t=null;i.nodeType===3?t=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?t=i:t=i.closest("p, div");const n=v=>{if(!v)return!1;const h=v.textContent||"",k=(v.innerHTML||"").trim(),N=k.replace(/<br\s*\/?>/gi,"").trim();return h.trim()===""||k===""||N===""||k==="<br>"||k==="<br/>"||k==="<p></p>"||k==="<p><br></p>"||k==="<p><br/></p>"||k==="<p> </p>"||k==="<p><br> </p>"||k==="<div></div>"||k==="<div><br></div>"||k==="<div><br/></div>"},o=c.lastChild,s=o&&o.nodeType===1&&o.tagName==="BR",d=r.startContainer,u=d.nodeType===3?d.parentElement:d,m=u===c||u&&u.parentElement===c;if(t&&n(t)||s&&m){a.preventDefault(),setTimeout(()=>{$o()},50);return}}}}if(a.key===" "){const l=Date.now(),r=l-hn.value;if(Be.value===" "&&r<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(p){const t=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((p.textContent||"").indexOf(t.trim())<=10||t.trim().length<=2){a.preventDefault(),Vt();return}}}}Be.value=" ",hn.value=l}else Be.value=a.key}},qo=a=>{if(x.disabled||!x.richText)return;a.preventDefault();let l=a.clipboardData.getData("text/html"),r=a.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),r&&(r=r.replace(/<!--[\s\S]*?-->/g,"")),Ve();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let n=i.getRangeAt(0).commonAncestorContainer;n.nodeType===3&&(n=n.parentNode),c=n.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const p=t=>{const o=new DOMParser().parseFromString(t,"text/html");let s=g.value.querySelector("h1")?1:0;if(o.querySelectorAll("h1").forEach(u=>{if(s>0){const m=o.createElement("p");m.innerHTML=u.innerHTML,u.parentNode.replaceChild(m,u)}else s++}),c){const u=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],m=Array.from(o.body.children).filter(f=>u.includes(f.tagName));if(m.length===1){const f=m[0].tagName,v=c.tagName,h=c.textContent.trim()===""&&!c.querySelector("img");let y=!1;if(["H1","H2","H3","H4","H5","H6"].includes(v)?y=!0:h||(f===v||f==="P")&&(y=!0),y)return m[0].innerHTML.trim()}}return o.body.innerHTML.trim()};if(l){const t=p(l);document.execCommand("insertHTML",!1,t)}else if(r)if(/<[a-z][\s\S]*>/i.test(r)){const n=p(r);document.execCommand("insertHTML",!1,n)}else document.execCommand("insertText",!1,r);ce()},yn=a=>{if(De.value){const r=a.target;!r.closest(".dss-toolbar-dropdown")&&!r.closest(".dss-toolbar-dropdown-toggle")&&He()}if(xe.value){const r=a.target,i=r.closest(".dss-floating-toolbar"),c=g.value&&r.closest(".dss-text-editor-content");!i&&!c&&po()}if(Le.value){const r=a.target,i=r.closest(".dss-floating-toolbar"),c=r.closest(".dss-toolbar-dropdown");!i&&!c&&bn()}const l=a.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(We.value=null),!g.value||!l.closest(".dss-text-editor-content")){const r=window.getSelection();if(r&&r.rangeCount>0){const i=r.getRangeAt(0);yt.value=!i.collapsed&&oo(i)}else yt.value=!1}if(Q.value!==null){const r=document.querySelector(".dss-comment-overlay");let i=!1;if(r){const t=r.getBoundingClientRect(),n=a.clientX,o=a.clientY;i=n>=t.left&&n<=t.right&&o>=t.top&&o<=t.bottom}const c=l.closest(".dss-toolbar-button"),p=c&&c.getAttribute("title")==="Comment";!i&&!p&&(Q.value=null,se.value="",Y.value="",Me.value=null,Re.value=[],Ut(!0))}},Wo=(a,l)=>{a&&a.stopPropagation&&a.stopPropagation(),we.value&&(clearTimeout(we.value),we.value=null),We.value=l},ve=a=>{const l=a.relatedTarget;if(l){const r=l.closest(".dss-toolbar-dropdown-submenu"),i=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(r||i)return}we.value&&clearTimeout(we.value),we.value=setTimeout(()=>{We.value=null,we.value=null},150)},Xo=a=>{We.value=null};let Cn=0;const kn=a=>{if(!a)return;const l=Array.from(a.children);l.forEach(r=>{r.classList.contains("dss-toolbar-dropdown-submenu")||r.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(r.tagName==="BUTTON"||r.tagName==="DIV")&&!r.classList.contains("dss-toolbar-dropdown-item")&&r.classList.add("dss-toolbar-dropdown-item")}),l.forEach((r,i)=>{if(r.classList.contains("dss-toolbar-dropdown-item-has-submenu")||r.classList.contains("dss-toolbar-dropdown-submenu")||!r.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(r.children).find(n=>n.tagName==="DIV"?n.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(n.children).filter(s=>s.tagName==="BUTTON"||s.tagName==="DIV").length>0:!1),p=r.nextElementSibling,t=p&&!p.classList.contains("dss-toolbar-dropdown-submenu")&&!p.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&p.tagName==="DIV"&&!p.classList.contains("dss-toolbar-dropdown-item")&&Array.from(p.children).some(n=>n.tagName==="BUTTON"||n.tagName==="DIV");if(c||t){const n=`submenu-auto-${++Cn}`;r.classList.add("dss-toolbar-dropdown-item-has-submenu"),r.setAttribute("data-submenu-id",n);let o=null;c?(r.tagName==="BUTTON"&&r.parentNode.insertBefore(c,r.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),o=c):t&&(p.classList.add("dss-toolbar-dropdown-submenu"),o=p),o&&(o.setAttribute("data-submenu-id",n),o.setAttribute("data-processed","true"),c&&r.tagName!=="BUTTON"?o.dataset.originalParentRef="inside":o.dataset.originalParentRef="sibling",Array.from(o.children).forEach(d=>{(d.tagName==="BUTTON"||d.tagName==="DIV")&&!d.classList.contains("dss-toolbar-dropdown-item")&&d.classList.add("dss-toolbar-dropdown-item")}))}})},xn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{kn(l),l.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const p=c._subMenuHandlers;p&&(c.removeEventListener("mouseenter",p.enter),c.removeEventListener("mouseleave",p.leave));const t=o=>{const s=c.getAttribute("data-submenu-id");s&&Wo(o,s)},n=ve;c.addEventListener("mouseenter",t),c.addEventListener("mouseleave",n),c._subMenuHandlers={enter:t,leave:n}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const p=c._subMenuHandlers;p&&(c.removeEventListener("mouseenter",p.enter),c.removeEventListener("mouseleave",p.leave));const t=s=>{const d=c.getAttribute("data-submenu-id");d&&Wo(s,d)},n=ve;c.addEventListener("mouseenter",t),c.addEventListener("mouseleave",n),c._subMenuHandlers={enter:t,leave:n},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(s=>{s.addEventListener("click",Xo)})})})};let mo=null;const Ro=()=>{if(We.value){const a=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${We.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${We.value}"]`);a&&l&&Mn(a,l)}if(xe.value&&ke(),x.richText){if(mo!==null)return;mo=setTimeout(()=>{mo=null,_e("handleWindowResize")},150)}},to=()=>{if(!x.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(i=>i.tagName==="DIV"&&!i.classList.contains("dss-toolbar-button")).forEach(i=>{i.classList.add("dss-toolbar-button")})})},Yo=()=>{const a=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=r=>{if(r.preventDefault(),r.stopPropagation(),window.getSelection){const i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};a.forEach(r=>{r.addEventListener("selectstart",l),r.addEventListener("mousedown",l),r.addEventListener("dragstart",l),r.addEventListener("contextmenu",l),r.addEventListener("click",i=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{ht.value?Dt():Po(),tt.value?ko():Oo()})}),e.nextTick(()=>{Yo()}),x.richText&&g.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",yn),window.addEventListener("resize",Ro);let a=null;const l=()=>{a===null&&(a=setTimeout(()=>{a=null,Ro()},150))};window.addEventListener("scroll",l,!0),g.value._windowScrollHandler=l,g.value._windowScrollTimeout=a,g.value.closest(".editor-with-comments"),g.value.closest(".dss-text-editor-content-wrapper");const r=g.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,Ro()},150))};r&&(r.addEventListener("scroll",c),g.value._scrollHandlers={wrapper:null,content:r,handler:c}),e.nextTick(()=>{xn(),to()}),g.value.addEventListener("click",n=>{const o=n.target;o.closest("a")&&!x.disabled&&n.preventDefault();const d=o.closest(".dss-image-no-alt-icon"),u=o.closest(".dss-image-wrapper");if(d||u&&o===u){n.preventDefault(),n.stopPropagation();const m=window.getSelection(),f=document.createRange();f.setStartAfter(u),f.collapse(!0),m.removeAllRanges(),m.addRange(f)}else u&&o.tagName!=="IMG"&&(n.preventDefault(),e.nextTick(()=>{const m=window.getSelection();if(m.rangeCount>0){const v=m.getRangeAt(0).commonAncestorContainer,h=v.nodeType===3?v.parentElement:v;if(u.contains(h)&&h!==u.querySelector("img")){const y=document.createRange();y.setStartAfter(u),y.collapse(!0),m.removeAllRanges(),m.addRange(y)}}else{const f=document.createRange();f.setStartAfter(u),f.collapse(!0),m.addRange(f)}}))},!0),g.value.addEventListener("mousedown",n=>{const o=n.target,s=o.closest(".dss-image-no-alt-icon"),d=o.closest(".dss-image-wrapper");if(s||d&&o.tagName!=="IMG"){n.preventDefault();const u=window.getSelection(),m=document.createRange();d&&(m.setStartAfter(d),m.collapse(!0),u.removeAllRanges(),u.addRange(m))}},!0),g.value.addEventListener("paste",n=>{e.nextTick(()=>{if(!g.value)return;g.value.querySelectorAll("img").forEach(s=>{if(!s.closest(".dss-image-wrapper"))s.removeAttribute("alt"),s.removeAttribute("data-alt"),s.setAttribute("alt",""),s.setAttribute("data-alt",""),s.alt="";else{const u=s.getAttribute("alt")||s.alt||"";if(u){const m=s.getAttribute("src")||s.src||"",f=m.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),v=u===m||u===f;(u.startsWith("http://")||u.startsWith("https://")||u.startsWith("data:")||v||v)&&(s.setAttribute("alt",""),s.setAttribute("data-alt",""),s.alt="")}}}),ot()})});let p=null;const t=new MutationObserver(n=>{n.forEach(o=>{o.addedNodes.forEach(s=>{if(s.nodeType===1){s.tagName==="IMG"&&(s.removeAttribute("alt"),s.removeAttribute("data-alt"),s.setAttribute("alt",""),s.setAttribute("data-alt",""),s.alt="");const d=s.querySelectorAll&&s.querySelectorAll("img");d&&d.forEach(u=>{u.removeAttribute("alt"),u.removeAttribute("data-alt"),u.setAttribute("alt",""),u.setAttribute("data-alt",""),u.alt=""})}})}),p&&clearTimeout(p),p=setTimeout(()=>{ot(),to(),p=null},100)});if(t.observe(g.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const n=document.querySelector(".dss-text-editor-toolbar");if(n){const o=new MutationObserver(()=>{e.nextTick(()=>{to()})});o.observe(n,{childList:!0,subtree:!0}),n._toolbarMutationObserver=o}}),x.modelValue){const n=Qt(x.modelValue);g.value.innerHTML=n,Zo()}e.nextTick(()=>{const n=g.value.innerHTML||"",o=x.title||"",s=x.description||"";Xe.value=n,dt.value=o,he.value=s,Ye.value=o,et.value=s,Se(),ot(),Rt(),Ft(),Nn(),Ge()}),qe(),zt(),g.value._mutationObserver=t}}),e.onUnmounted(()=>{if(document.removeEventListener("click",yn),window.removeEventListener("resize",Ro),g.value&&g.value._windowScrollHandler&&window.removeEventListener("scroll",g.value._windowScrollHandler,!0),mo!==null&&(clearTimeout(mo),mo=null),g.value&&g.value._windowScrollTimeout!==null&&clearTimeout(g.value._windowScrollTimeout),Z.value&&clearTimeout(Z.value),we.value&&clearTimeout(we.value),g.value&&g.value._mutationObserver&&g.value._mutationObserver.disconnect(),kt.value&&kt.value.disconnect(),Kt.value!==null&&(cancelAnimationFrame(Kt.value),Kt.value=null),mt.value!==null&&(clearTimeout(mt.value),mt.value=null),xt.value!==null&&(clearTimeout(xt.value),xt.value=null),Ut(!0),g.value&&g.value._scrollHandlers){const{wrapper:l,content:r,handler:i}=g.value._scrollHandlers;l&&l.removeEventListener("scroll",i),r&&r.removeEventListener("scroll",i)}const a=document.querySelector(".dss-text-editor-toolbar");a&&a._toolbarMutationObserver&&a._toolbarMutationObserver.disconnect()});const wn=a=>{const l=a.target,r=l.closest("a");if(r&&!x.disabled){a.preventDefault();const c=document.createRange();c.selectNodeContents(r);const p=window.getSelection();p.removeAllRanges(),p.addRange(c)}const i=l.closest(".dss-image-wrapper");i&&l.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const t=c.getRangeAt(0).commonAncestorContainer,n=t.nodeType===3?t.parentElement:t;if(i.contains(n)&&n!==i.querySelector("img")){const o=document.createRange();o.setStartAfter(i),o.collapse(!0),c.removeAllRanges(),c.addRange(o)}}ot(),qe(),zt(),ke(),Ft()}):e.nextTick(()=>{ot(),qe(),zt(),ke(),Ft()})},jo=()=>{Ao();const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);yt.value=!r.collapsed&&oo(r),!r.collapsed&&ut.value&&(ut.value=null)}else yt.value=!1;if(ot(),qe(),zt(),ke(),Ft(),a&&a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){a.removeAllRanges(),yt.value=!1;return}}["bold","italic","underline"].forEach(r=>{try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(!c.collapsed)if(r==="bold"){const p=c.commonAncestorContainer,t=p.nodeType===3?p.parentElement:p;let n=!1;if(t&&((t.tagName==="STRONG"||t.tagName==="B"||t.closest&&t.closest("strong, b"))&&(n=!0),!n&&t.style&&parseInt(t.style.fontWeight)>=600&&(n=!0),!n))try{const o=window.getComputedStyle(t);parseInt(o.fontWeight)>=600&&(n=!0)}catch{}q.value[r]=n}else{const p=document.queryCommandState(r);q.value[r]=p}}}catch{}})},Ft=()=>{if(!x.richText||x.disabled||!g.value){be.value="p";return}try{const a=window.getSelection();if(!a||a.rangeCount===0){be.value="p";return}const r=a.getRangeAt(0).commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(!i||!g.value.contains(i)){be.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){be.value="p";return}const p=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(p)?be.value=p:be.value="p"}catch{be.value="p"}},zt=()=>{if(!g.value){ro.value=!1;return}try{const a=window.getSelection();let l=!1;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");l=!!(c&&g.value.contains(c))}ro.value=l}catch{ro.value=!1}},oo=a=>{if(!a||!g.value)return!1;const l=a.commonAncestorContainer;if(!l)return!1;const r=l.nodeType===3?l.parentElement:l;return r?g.value.contains(r):!1},po=()=>{xe.value=!1},ke=()=>{if(!x.floatingToolbar||!x.richText||x.disabled){xe.value=!1;return}const a=window.getSelection();if(!a||a.rangeCount===0){xe.value=!1;return}const l=a.getRangeAt(0);if(l.collapsed||!oo(l)){xe.value=!1;return}const r=l.getBoundingClientRect();if(!r||r.width===0&&r.height===0){xe.value=!1;return}const i=g.value;if(!i){xe.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){xe.value=!1;return}const p=40,t=8,n=r.top-p/2+15;let o=r.left+r.width/2;const s=window.innerWidth||document.documentElement.clientWidth||0;let d=0;vo.value&&(d=vo.value.getBoundingClientRect().width);const u=(d||320)/2;let m=c.left+u,f=c.right-u;if(f<m){const v=c.left+c.width/2;m=v,f=v}if(s>0){const v=u+t,h=s-u-t;if(m=Math.max(m,v),f=Math.min(f,h),f<m){const y=s/2;m=y,f=y}}o<m?o=m:o>f&&(o=f),Ae.value={position:"fixed",top:`${Math.max(n,8)}px`,left:`${o}px`,transform:"translate(-50%, -100%)",zIndex:10003},xe.value=!0},Ko=a=>{x.disabled||!x.richText||(Le.value=Le.value===a?null:a,a==="askAi"&&(De.value=null))},bn=()=>{Le.value=null,We.value=null},no=a=>{bt(a),bn()};let Pt=null,fo=null,lo=null,pt=null;const Pn=a=>{if(x.disabled||!x.richText){xo(),wo();return}const l=a.target,r=l.closest("a"),i=l.closest("img");if(Pt&&(clearTimeout(Pt),Pt=null),lo&&(clearTimeout(lo),lo=null),r&&r!==fo){wo(),fo=r;let c=r.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=r.textContent||""),fe.value=r,I.value=c,M.value=!0,W.value=!0,Vn(r)}else!r&&fo?(fo=null,Pt=setTimeout(()=>{W.value||xo()},150)):r&&r===fo&&Vn(r);if(i&&i!==pt){xo(),pt=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let p=i.getAttribute("data-alt");p===null&&(p=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",p),G.value=i,io.value=c.trim()||V("textEditor.image.noAlt"),yo.value=!0,jt.value=!0,Go(i)}else!i&&pt?(pt=null,lo=setTimeout(()=>{jt.value||wo()},150)):i&&i===pt&&Go(i)},En=a=>{const l=a.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(fo=null,pt=null,Pt&&(clearTimeout(Pt),Pt=null),lo&&(clearTimeout(lo),lo=null),xo(),wo())},xo=()=>{W.value=!1,setTimeout(()=>{W.value||(M.value=!1,I.value="",st.value||(fe.value=null))},100)},Vn=a=>{if(!a||!g.value)return;const l=a.getBoundingClientRect(),c=l.top-32-8,p=l.left+l.width/2;X.value={position:"fixed",top:`${c}px`,left:`${p}px`,transform:"translateX(-50%)",zIndex:10002}},wo=()=>{jt.value=!1,setTimeout(()=>{jt.value||(yo.value=!1,io.value="",go.value||(G.value=null))},100)},Go=a=>{if(!a||!g.value)return;const l=a.getBoundingClientRect(),c=l.top-32-8,p=l.left+l.width/2;Yt.value={position:"fixed",top:`${c}px`,left:`${p}px`,transform:"translateX(-50%)",zIndex:10002}},On=()=>{if(!I.value||!fe.value)return;let l=fe.value.getAttribute("href")||I.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Zn=()=>{if(fe.value){const a=fe.value.textContent||"",l=fe.value.getAttribute("href")||"",r=fe.value;oe.value=l,ne.value=a,Xt.value=a,W.value=!1,M.value=!1,I.value="",fe.value=r,st.value=!0}else if(ze.value){const a=window.getSelection();if(a.rangeCount>0){const r=a.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a");if(i){const c=i.textContent||"",p=i.getAttribute("href")||"";oe.value=p,ne.value=c,Xt.value=c,fe.value=i,st.value=!0}}}else{Ht.value=wt();const a=window.getSelection();let l="";a.rangeCount>0&&(l=a.getRangeAt(0).toString()),oe.value="",ne.value=l,Xt.value="",fe.value=null,st.value=!0}e.nextTick(()=>{rt.value&&(rt.value.focus(),rt.value.select())})},ao=()=>{st.value=!1,oe.value="",ne.value="",Xt.value="",fe.value=null,Ht.value=null},Qo=()=>{if(!oe.value.trim()){ao();return}if(ie.value?(Z.value&&(clearTimeout(Z.value),Z.value=null),Ve(),ie.value=!1):Ve(),ne.value.trim()||(ne.value=oe.value.trim()),fe.value&&g.value&&g.value.contains(fe.value)){const a=window.getSelection();a.rangeCount>0&&a.removeAllRanges();const l=fe.value;if(l.setAttribute("href",oe.value.trim()),ne.value.trim()!==Xt.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=ne.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const r=document.createRange();r.selectNodeContents(l),r.collapse(!1),a.removeAllRanges(),a.addRange(r),ce()}else if(g.value){g.value.focus();const a=window.getSelection();a.removeAllRanges(),Ht.value&&Oe(Ht.value);let l=null;if(a.rangeCount>0&&(l=a.getRangeAt(0)),l&&!l.collapsed){l.toString();let r=l.endContainer;r.nodeType===3&&(r=r.parentElement);const i=r.closest("p, div, h1, h2, h3, h4, h5, h6"),c=document.createElement("a");if(c.href=oe.value.trim(),c.textContent=ne.value.trim(),c.style.color="#60afdf",c.style.textDecoration="underline",i&&i!==g.value){i.textContent="",i.appendChild(c);const p=document.createTextNode(" ");i.appendChild(p);const t=document.createRange();t.setStartAfter(p),t.collapse(!0),a.removeAllRanges(),a.addRange(t)}else{l.deleteContents(),l.insertNode(c);const p=document.createTextNode(" ");l.setStartAfter(c),l.insertNode(p),l.setStartAfter(p),l.collapse(!0),a.removeAllRanges(),a.addRange(l)}}else{l||(l=document.createRange(),l.selectNodeContents(g.value),l.collapse(!1));const r=l.startContainer,i=r.nodeType===3,c=i&&l.startOffset===r.textContent.length,p=document.createElement("a");if(p.href=oe.value.trim(),p.textContent=ne.value.trim(),p.style.color="#60afdf",p.style.textDecoration="underline",c){let t=r.parentElement;for(;t&&t!==g.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(t.tagName);)t=t.parentElement;if(t&&t!==g.value){let n=t.nextElementSibling;if(n&&(n.innerHTML==="<br>"||n.innerHTML==="<br/>"||n.textContent.trim()==="")){n.textContent="",n.appendChild(p);const o=document.createTextNode(" ");n.appendChild(o);const s=document.createRange();s.setStartAfter(p),s.collapse(!0),a.removeAllRanges(),a.addRange(s)}else{if(l.startOffset>0){const s=r.textContent.substring(0,l.startOffset),d=s[s.length-1];if(d&&d!==" "&&d!==" "&&d!==`
|
|
77
|
+
</svg>`,g=e.ref(null),De=e.ref(null),ze=e.ref(!1),Qe=e.ref(!1),M=e.ref(!1),I=e.ref(""),X=e.ref({}),W=e.ref(!1),st=e.ref(!1),oe=e.ref(""),ne=e.ref(""),rt=e.ref(null),Vo=e.ref(null),fe=e.ref(null),Ht=e.ref(null),Xt=e.ref(""),ro=e.ref(!1),q=e.ref({}),xe=e.ref(!1),Ae=e.ref({}),vo=e.ref(null),Le=e.ref(null),go=e.ref(!1),Ue=e.ref(""),So=e.ref(null),it=e.ref(""),de=e.ref(""),me=e.ref(""),Tt=e.ref(null),Je=e.ref(null),ho=e.ref(null),G=e.ref(null),At=e.ref(null),yo=e.ref(!1),io=e.ref(""),Yt=e.ref({}),jt=e.ref(!1),Pe=e.ref("upload"),Lt=e.ref(""),We=e.ref(null),we=e.ref(null),ct=e.ref([]),co=e.ref([]),Z=e.ref(null),ie=e.ref(!1),Xe=e.ref(""),$t=e.ref(""),dt=e.ref(""),he=e.ref(""),Ye=e.ref(""),et=e.ref(""),te=e.ref(null),le=e.ref(null),gt=e.ref(null),Fo=e.ref(!1),ht=e.ref(!1),tt=e.ref(!1),ut=e.ref(null),be=e.ref("p"),yt=e.ref(!1),Ct=e.ref([]),kt=e.ref(null),Kt=e.ref(null),mt=e.ref(null),Co=e.ref(!1),zo=e.ref(0),tn=100,xt=e.ref(null),Bn=e.computed(()=>({"dss-text-editor-no-border":!x.border,"dss-text-editor-rounded":x.rounded,"dss-text-editor-full-height":x.fullHeight,"dss-comment-overlay-open":Q.value!==null})),Hn=e.computed(()=>({})),Tn=e.computed(()=>!x.fixedHeight||x.fullHeight?{}:{height:`${1.6*14*x.rows+24+2}px`,resize:"none",overflowY:"auto"}),on=e.computed(()=>!x.fixedHeight||x.fullHeight?{}:{height:`${1.6*14*x.rows+32}px`,overflowY:"auto"}),No=e.computed(()=>x.richText&&co.value.length>0),nn=e.computed(()=>{if(!x.modelValue)return"";if(x.richText){let a=x.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return a=a.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),a=a.replace(/<[^>]+>/g,""),a=a.replace(/ /g," "),a=a.replace(/&/g,"&"),a=a.replace(/</g,"<"),a=a.replace(/>/g,">"),a=a.replace(/"/g,'"'),a=a.replace(/'/g,"'"),a=a.replace(/\s+/g," ").trim(),a}return x.modelValue}),Mo=e.computed(()=>{const a=nn.value.trim();return a?a.split(/\s+/).filter(l=>l.length>0).length:0}),Bo=e.computed(()=>nn.value.length),pe=e.computed(()=>G.value!==null&&Pe.value==="upload"&&it.value&&it.value.startsWith("data:")),$=e.computed(()=>x.titlePlaceholder||w("textEditor.placeholders.title")),Ho=e.computed(()=>x.descriptionPlaceholder||w("textEditor.placeholders.description")),ue=e.computed(()=>x.placeholder||w("textEditor.placeholders.startTyping")),$e=a=>Bt&&Bt[a]!==void 0,U=a=>{for(let l=a+1;l<x.customToolbarSlots.length;l++)if($e(x.customToolbarSlots[l]))return!0;return!1},ae=a=>{for(let l=a+1;l<x.customToolbarSlots.length;l++){const r=x.customToolbarSlots[l];if($e(r)&&b(r))return!0}return!1},b=a=>x.customToolbarFloatingMap.hasOwnProperty(a)?x.customToolbarFloatingMap[a]===!0:!0,Ee=e.computed(()=>x.customToolbarSlots.some(a=>$e(a)&&b(a))),D=e.computed(()=>$e("title-slot")),ln=e.computed(()=>$e("description-slot")),Gt=a=>{if(!a||a.trim()==="")return"<html></html>";const l=a.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?a:`<html>${a}</html>`},Qt=a=>{if(!a||a.trim()==="")return"";const l=a.replace(/<!--[\s\S]*?-->/g,""),r=l.trim();return r.startsWith("<html>")&&r.endsWith("</html>")?r.slice(6,-7).trim():l},an=a=>{if(!a)return;const l=document.createTreeWalker(a,NodeFilter.SHOW_COMMENT,null,!1),r=[];let i=l.nextNode();for(;i;)r.push(i),i=l.nextNode();r.forEach(c=>c.remove())},sn=a=>{try{const l=String(a.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()],c=a.getFullYear();return`${l} ${i} ${c}`}catch{return""}},rn=a=>{if(!a||typeof a!="string")return!1;const l=a.trim();if(!l)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(l))return!0;try{const c=w("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const i=l.toLowerCase();return i.includes("started conversation")||i.includes("démarré la conversation")||i==="started conversation"||i==="a démarré la conversation"},An=a=>{const l=a.target.value;K("update:modelValue",l),K("change",l)},Dt=()=>{if(!te.value)return;const a=te.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const r=a.scrollHeight;a.style.setProperty("height",`${r}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},Jt=()=>{ht.value=!0,Dt()},Ln=()=>{ht.value=!1,Po()},Po=()=>{if(!te.value)return;const a=te.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const l=a.value;a.value="M";const r=a.scrollHeight;a.value=l,a.offsetHeight,a.style.setProperty("height",`${r}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},$n=a=>{const r=a.target.value;ht.value&&Dt(),K("update:title",r),K("title-change",r),gt.value="title",x.richText&&(ie.value||($t.value=Xe.value,Ye.value=dt.value,et.value=he.value),Z.value&&clearTimeout(Z.value),ie.value=!0,Z.value=setTimeout(()=>{ie.value=!1,Ve()},500))},ko=()=>{if(!le.value)return;const a=le.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const r=a.scrollHeight;a.style.setProperty("height",`${r}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},cn=()=>{tt.value=!0,ko()},Dn=()=>{tt.value=!1,Oo()},Oo=()=>{if(!le.value)return;const a=le.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const l=a.value;a.value="M";const r=a.scrollHeight;a.value=l,a.offsetHeight,a.style.setProperty("height",`${r}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},dn=a=>{const r=a.target.value;tt.value&&ko(),K("update:description",r),K("description-change",r),gt.value="description",x.richText&&(ie.value||($t.value=Xe.value,Ye.value=dt.value,et.value=he.value),Z.value&&clearTimeout(Z.value),ie.value=!0,Z.value=setTimeout(()=>{ie.value=!1,Ve()},500))},wt=()=>{const a=window.getSelection();if(a.rangeCount===0)return null;const l=a.getRangeAt(0);if(l.startContainer.nodeType===1)return{type:"element",element:l.startContainer,offset:l.startOffset};const r=l.cloneRange();return r.selectNodeContents(g.value),r.setEnd(l.startContainer,l.startOffset),{type:"text",start:r.toString().length,end:r.toString().length+l.toString().length}},Oe=a=>{if(!(!a||!g.value))try{const l=window.getSelection(),r=document.createRange();if(a.type==="element"&&a.element)if(g.value.contains(a.element)){r.setStart(a.element,a.offset),r.collapse(!0),l.removeAllRanges(),l.addRange(r);return}else{g.value.focus();return}let i=0;const c=[g.value];let p=null,t=!1,n=!1;for(;!n&&(p=c.pop());)if(p.nodeType===3){const o=i+p.length;!t&&a.start>=i&&a.start<=o&&(r.setStart(p,a.start-i),t=!0),t&&a.end>=i&&a.end<=o&&(r.setEnd(p,a.end-i),n=!0),i=o}else{let o=p.childNodes.length;for(;o--;)c.push(p.childNodes[o])}l.removeAllRanges(),l.addRange(r)}catch{g.value.focus()}},To=()=>{if(!g.value)return;g.value.focus();const a=window.getSelection(),l=document.createRange(),r=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let p=c.childNodes.length-1;p>=0;p--){const t=c.childNodes[p],n=r(t);if(n)return n}return c},i=r(g.value);if(i.nodeType===3)l.setStart(i,i.length),l.setEnd(i,i.length);else if(i.childNodes.length>0){const c=r(i);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(i),l.collapse(!1))}else l.setStart(i,0),l.setEnd(i,0);a.removeAllRanges(),a.addRange(l)},Ve=(a=!1)=>{if(!g.value)return;const l=g.value.innerHTML,r=x.title||"",i=x.description||"";if(!a&&l===Xe.value&&r===dt.value&&i===he.value)return;const c={content:$t.value||Xe.value,title:Ye.value!==void 0?Ye.value:dt.value,description:et.value!==void 0?et.value:he.value},p=ct.value.length>0?ct.value[ct.value.length-1]:null;let t=!0;p&&(typeof p=="string"?t=c.content!==p:t=c.content!==p.content||c.title!==p.title||c.description!==p.description),t&&(ct.value.push(c),ct.value.length>50&&ct.value.shift(),co.value=[]),Xe.value=l,dt.value=r,he.value=i,$t.value=l,Ye.value=r,et.value=i},ce=a=>{if(!g.value)return;Ao(),g.value&&an(g.value);let l=null;g.value&&(g.value.querySelector("p")||(l=wt(),Zo())),a&&a.inputType&&(a.inputType==="insertText"||a.inputType==="insertCompositionText"||a.inputType==="deleteContentBackward"||a.inputType==="deleteContentForward")&&ut.value&&(ut.value=null),Qe.value=!0;const i=g.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=Gt(i);K("update:modelValue",c),K("change",c),gt.value="editor",ie.value||($t.value=Xe.value,Ye.value=dt.value,et.value=he.value),Z.value&&clearTimeout(Z.value),ie.value=!0,Z.value=setTimeout(()=>{ie.value=!1,Ve()},500),e.nextTick(()=>{l&&Oe(l),Ao();const p=["bold","italic","underline"],t=window.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null,o=n&&n.collapsed;p.forEach(s=>{try{if(o&&ut.value?.command===s){q.value[s]=ut.value.state;return}if(s==="bold")if(n){const d=n.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 f=window.getComputedStyle(u);parseInt(f.fontWeight)>=600&&(m=!0)}catch{}q.value[s]=m}else q.value.hasOwnProperty(s)||(q.value[s]=!1);else if(s==="italic")if(n){const d=n.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d,m=u&&(u.tagName==="EM"||u.tagName==="I"||u.closest&&u.closest("em, i"));q.value[s]=!!m}else{const d=document.queryCommandState(s);q.value[s]=d}else{const d=document.queryCommandState(s);q.value[s]=d}}catch{}}),Se(),ot(),_t(),ke(),Ft(),Re("handleRichTextInput"),Qe.value=!1})},Ao=()=>{if(!g.value)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const l=a.getRangeAt(0),r=l.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(!i)return;const c=i.closest(".dss-image-wrapper");if(c){const p=c.querySelector("img");if(i!==p&&!p?.contains(i)){const t=l.startContainer.nodeType===3?l.startContainer.parentElement:l.startContainer,n=l.endContainer.nodeType===3?l.endContainer.parentElement:l.endContainer;if(c.contains(t)&&t!==p||c.contains(n)&&n!==p){const o=document.createRange();o.setStartAfter(c),o.collapse(!0),a.removeAllRanges(),a.addRange(o)}}}},Zo=()=>{if(!g.value)return;const a=g.value;if(a.querySelector&&a.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),r=Array.from(a.childNodes);let i=null;r.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===a&&a.removeChild(c);return}i||(i=document.createElement("p"),a.insertBefore(i,c)),i.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const p=c,t=p.tagName;if(t==="BR"){i=null;return}if(l.has(t)){i=null;return}i||(i=document.createElement("p"),a.insertBefore(i,p)),i.appendChild(p)}})},ot=()=>{if(g.value&&!Fo.value){Fo.value=!0;try{g.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),g.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const c=i.parentElement;!c||!c.classList.contains("dss-image-wrapper")?i.remove():c.querySelector("img")||i.remove()}),g.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const p=i.getAttribute("src")||i.src||"";if(c){const s=p.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),d=c===p||c===s;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||d||d)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const t=!c||c.trim()==="";let n=i.parentElement;const o=n&&n.classList.contains("dss-image-wrapper");if(o){const s=n.querySelector(".dss-image-no-alt-icon");s&&s.remove()}else{const s=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;s&&s.remove()}if(t){o?n.setAttribute("contenteditable","false"):(n=document.createElement("span"),n.className="dss-image-wrapper",n.setAttribute("contenteditable","false"),i.parentNode.insertBefore(n,i),n.appendChild(i));const s=document.createElement("div");s.className="dss-image-no-alt-icon",s.setAttribute("contenteditable","false"),s.innerHTML=S,n.appendChild(s)}else if(o&&n.children.length===1){const s=n.parentNode;s.insertBefore(i,n),s.removeChild(n)}})}finally{Fo.value=!1}}},un=a=>{K("blur",a),po()},It=()=>{if(x.disabled||!x.richText||!g.value)return;He(),Z.value&&(clearTimeout(Z.value),Z.value=null),ie.value&&(Ve(),ie.value=!1);const a=gt.value==="title",l=gt.value==="description",r=gt.value==="editor";if(ct.value.length===0){a&&te.value?te.value.focus():l&&le.value?le.value.focus():g.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{ce()});return}const i={content:g.value.innerHTML,title:x.title||"",description:x.description||""};co.value.push(i);const c=ct.value.pop();if(c!==void 0){Qe.value=!0;const p=typeof c=="string"?c:c.content,t=typeof c=="object"&&c.title||"",n=typeof c=="object"&&c.description||"";g.value.innerHTML=p,Xe.value=p,dt.value=t,he.value=n,$t.value=p,Ye.value=t,et.value=n,e.nextTick(()=>{Se(),qe(),zt(),ke();const o=Gt(p);K("update:modelValue",o),K("update:title",t),K("update:description",n),K("change",o),K("title-change",t),K("description-change",n),Qe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(te.value){te.value.focus();const s=t.length;te.value.setSelectionRange&&te.value.setSelectionRange(s,s),Dt()}}else if(l){if(le.value){le.value.focus();const s=n.length;le.value.setSelectionRange(s,s)}}else if(r)To();else if(te.value&&document.activeElement===te.value){const s=t.length;te.value.setSelectionRange&&te.value.setSelectionRange(s,s),Dt()}else if(le.value&&document.activeElement===le.value){const s=n.length;le.value.setSelectionRange(s,s)}else g.value&&To()},10)})})}},mn=()=>{if(x.disabled||!x.richText||!g.value)return;He();const a=gt.value==="title",l=gt.value==="description",r=gt.value==="editor";if(co.value.length===0){a&&te.value?te.value.focus():l&&le.value?le.value.focus():g.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{ce()});return}const i={content:g.value.innerHTML,title:x.title||"",description:x.description||""};ct.value.push(i);const c=co.value.pop();if(c!==void 0){Qe.value=!0;const p=typeof c=="string"?c:c.content,t=typeof c=="object"&&c.title||"",n=typeof c=="object"&&c.description||"";g.value.innerHTML=p,Xe.value=p,dt.value=t,he.value=n,$t.value=p,Ye.value=t,et.value=n,e.nextTick(()=>{Se(),qe(),zt(),ke();const o=Gt(p);K("update:modelValue",o),K("update:title",t),K("update:description",n),K("change",o),K("title-change",t),K("description-change",n),Qe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(te.value){te.value.focus();const s=t.length;te.value.setSelectionRange&&te.value.setSelectionRange(s,s),Dt()}}else if(l){if(le.value){le.value.focus();const s=n.length;le.value.setSelectionRange(s,s)}}else if(r)To();else if(te.value&&document.activeElement===te.value){const s=t.length;te.value.setSelectionRange&&te.value.setSelectionRange(s,s),Dt()}else if(le.value&&document.activeElement===le.value){const s=n.length;le.value.setSelectionRange(s,s)}else g.value&&To()},10)})})}},Lo=()=>{if(!g.value)return;g.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const p=document.createDocumentFragment();for(;i.firstChild;)p.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(p,i)}}),g.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const p=document.createElement("b");for(p.style.fontWeight="600";i.firstChild;)p.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(p,i)}}),g.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},_t=()=>{if(!g.value)return;g.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},In=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const l=a.getRangeAt(0);let r=!1;if(l.collapsed){const i=l.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==g.value;){if(c.tagName==="EM"||c.tagName==="I"){r=!0;break}if(c.style&&c.style.fontStyle==="italic"){r=!0;break}c=c.parentElement}}else{const i=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let p;for(;p=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(p))){if(p.nodeType===3){let t=p.parentElement;for(;t&&t!==g.value;){if(t.tagName==="EM"||t.tagName==="I"){r=!0;break}if(t.style&&t.style.fontStyle==="italic"){r=!0;break}t=t.parentElement}}else if(p.nodeType===1){const t=p;if(t.tagName==="EM"||t.tagName==="I"){r=!0;break}if(t.style&&t.style.fontStyle==="italic"){r=!0;break}}if(r)break}}}if(r)return document.execCommand("italic",!1),e.nextTick(()=>{_t()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{_t()});else try{const i=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(i),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),a.removeAllRanges(),a.addRange(l),e.nextTick(()=>{_t()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{_t()})}return!0},_n=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const l=a.getRangeAt(0);let r=!1;if(l.collapsed){const i=l.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==g.value;){if(c.tagName==="STRONG"||c.tagName==="B"){r=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){r=!0;break}c=c.parentElement}}else{const i=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let p;for(;p=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(p))){if(p.nodeType===3){let t=p.parentElement;for(;t&&t!==g.value;){if(t.tagName==="STRONG"||t.tagName==="B"){r=!0;break}if(t.style&&parseInt(t.style.fontWeight)>=600){r=!0;break}t=t.parentElement}}else if(p.nodeType===1){const t=p;if(t.tagName==="STRONG"||t.tagName==="B"){r=!0;break}if(t.style&&parseInt(t.style.fontWeight)>=600){r=!0;break}}if(r)break}}}if(r)return document.execCommand("bold",!1),e.nextTick(()=>{Lo()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),p=c.startContainer;let t=p.nodeType===3?p.parentElement:p;for(;t&&t!==g.value;){if(t.tagName==="SPAN"&&t.style.fontWeight){const n=t.style.fontWeight;if(n==="normal"||n==="400"){const o=document.createElement("b");o.style.fontWeight="600";const s=document.createDocumentFragment();for(;t.firstChild;)s.appendChild(t.firstChild);o.appendChild(s),t.parentNode&&t.parentNode.replaceChild(o,t),c.setStart(o,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c);break}}else if(t.tagName==="STRONG"||t.tagName==="B"){t.style.fontWeight="600";break}t=t.parentElement}if(!t||t===g.value){const n=document.createElement("b");n.style.fontWeight="600",n.innerHTML="<br>",c.insertNode(n),c.setStart(n,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}Lo()});else try{const i=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(i),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),a.removeAllRanges(),a.addRange(l),e.nextTick(()=>{Lo()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Lo()})}return!0},Rt=(a,l=null)=>{if(x.disabled||!x.richText||!g.value)return;ie.value?(Z.value&&(clearTimeout(Z.value),Z.value=null),Ve(),ie.value=!1):Ve(),He(),g.value.focus();const r=window.getSelection();let i=null;if(r&&r.rangeCount>0){const p=r.getRangeAt(0);!p.collapsed&&oo(p)&&(i=wt())}if(a==="createLink"&&l){const p=window.getSelection();if(p.rangeCount>0){const t=p.getRangeAt(0);if(t.collapsed)try{t.expand("word")}catch{const o=document.createTextNode(l);t.insertNode(o),t.selectNodeContents(o)}}}if(a==="bold"){const p=_n();q.value.bold=p;const t=window.getSelection();t.rangeCount>0&&t.getRangeAt(0).collapsed&&(ut.value={command:"bold",state:p}),e.nextTick(()=>{i&&(Oe(i),e.nextTick(()=>{const n=Ze("bold");q.value.bold=n})),ce(),qe(),ke()});return}if(a==="italic"){const p=In();q.value.italic=p;const t=window.getSelection();t.rangeCount>0&&t.getRangeAt(0).collapsed&&(ut.value={command:"italic",state:p}),e.nextTick(()=>{i&&(Oe(i),e.nextTick(()=>{const n=Ze("italic");q.value.italic=n})),ce(),_t(),qe(),ke()});return}let c=!1;try{c=document.execCommand(a,!1,l)}catch{}e.nextTick(()=>{if(i&&Oe(i),["bold","italic","underline"].includes(a))try{if(a==="bold")i&&e.nextTick(()=>{const t=Ze("bold");q.value.bold=t});else if(a==="italic")if(i)e.nextTick(()=>{const t=Ze("italic");q.value.italic=t});else{const t=document.queryCommandState(a);q.value[a]=t}else{const t=document.queryCommandState(a);q.value[a]=t}}catch{q.value.hasOwnProperty(a)?q.value[a]=!q.value[a]:q.value[a]=!0}if(a==="createLink"&&l){const t=window.getSelection();if(t.rangeCount>0){const o=t.getRangeAt(0),s=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("a"):o.commonAncestorContainer.parentElement?.closest("a");s&&(!s.getAttribute("href")||s.getAttribute("href")==="")&&s.setAttribute("href",l)}g.value.querySelectorAll("a").forEach(o=>{const s=o.getAttribute("href");(!s||s===""||s==="#")&&o.setAttribute("href",l)})}ce(),qe(),ke()})},Ze=(a,l=null)=>{if(x.disabled||!g.value)return!1;try{if(a==="formatBlock"&&l){const i=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=i.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const p=window.getSelection();if(p.rangeCount>0){const n=p.getRangeAt(0).commonAncestorContainer;return!!(n.nodeType===1?n.tagName==="BLOCKQUOTE"?n:n.closest("blockquote"):n.parentElement?.closest("blockquote"))}}return i===l||i.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(a))try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(a==="bold"){let t=!1;if(c.collapsed){const n=c.commonAncestorContainer,o=n.nodeType===3?n.parentElement:n;if(o&&((o.tagName==="STRONG"||o.tagName==="B"||o.closest&&o.closest("strong, b"))&&(t=!0),!t&&o.style&&parseInt(o.style.fontWeight)>=600&&(t=!0),!t))try{const s=window.getComputedStyle(o);parseInt(s.fontWeight)>=600&&(t=!0)}catch{}return q.value.hasOwnProperty(a)?q.value[a]:(q.value[a]=t,t)}else{const n=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let o=!1;if(n){const s=document.createTreeWalker(n,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=s.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(d))){if(d.nodeType===3){if(!(d.textContent||"").trim())continue;o=!0;let m=d.parentElement;for(;m&&m!==g.value;){if(m.tagName==="STRONG"||m.tagName==="B"){t=!0;break}if(m.style&&parseInt(m.style.fontWeight)>=600){t=!0;break}m=m.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){t=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){t=!0;break}}if(t)break}}return q.value[a]=t&&o,t&&o}}if(a==="italic"){let t=!1;if(c.collapsed){const n=c.commonAncestorContainer,o=n.nodeType===3?n.parentElement:n;if(o&&((o.tagName==="EM"||o.tagName==="I"||o.closest&&o.closest("em, i"))&&(t=!0),!t&&o.style&&o.style.fontStyle==="italic"&&(t=!0),!t))try{window.getComputedStyle(o).fontStyle==="italic"&&(t=!0)}catch{}return q.value.hasOwnProperty(a)?q.value[a]:(q.value[a]=t,t)}else{const n=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let o=!1;if(n){const s=document.createTreeWalker(n,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=s.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(d))){if(d.nodeType===3){if(!(d.textContent||"").trim())continue;o=!0;let m=d.parentElement;for(;m&&m!==g.value;){if(m.tagName==="EM"||m.tagName==="I"){t=!0;break}if(m.style&&m.style.fontStyle==="italic"){t=!0;break}m=m.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){t=!0;break}if(u.style&&u.style.fontStyle==="italic"){t=!0;break}}if(t)break}}return q.value[a]=t&&o,t&&o}}const p=document.queryCommandState(a);return c.collapsed&&q.value.hasOwnProperty(a)?q.value[a]:(q.value[a]=p,p)}return q.value.hasOwnProperty(a)?q.value[a]:!1}catch{return q.value.hasOwnProperty(a)?q.value[a]:!1}try{return document.queryCommandState(a)}catch{return!1}}catch{return!1}},Uo=a=>{x.disabled||!x.richText||(De.value=De.value===a?null:a,a==="askAi"&&(Le.value=null))},He=()=>{De.value=null,We.value=null},bt=a=>{Rt("formatBlock",a),He()},Rn=a=>{if(!a||!g.value)return a;const l=h=>{let y=h.nodeType===Node.TEXT_NODE?h.parentElement:h;for(;y&&y!==g.value;){const k=y.tagName;if(k==="P"){const N=y.parentElement;if(N===g.value||N.tagName==="BLOCKQUOTE")return y}if(k==="BLOCKQUOTE")break;y=y.parentElement}return null},r=l(a.startContainer),i=l(a.endContainer);if(!r||!i)return a;const c=[],p=document.createTreeWalker(g.value,NodeFilter.SHOW_ELEMENT,{acceptNode:h=>{const y=h.tagName;if(y==="P"){const k=h.parentElement;if(k===g.value||k.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return y==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let t;for(;t=p.nextNode();)c.push(t);const n=c.indexOf(r),o=c.indexOf(i);if(n===-1||o===-1)return a;const s=Math.min(n,o),d=Math.max(n,o),u=c.slice(s,d+1);if(u.length===0)return a;const m=u[0],f=u[u.length-1],v=document.createRange();return v.setStartBefore(m),v.setEndAfter(f),v},pn=()=>{if(x.disabled||!x.richText||!g.value)return;ie.value?(Z.value&&(clearTimeout(Z.value),Z.value=null),Ve(),ie.value=!1):Ve(),He(),g.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;let l=a.getRangeAt(0);!l.collapsed&&oo(l)&&(l=Rn(l),a.removeAllRanges(),a.addRange(l));let r=null;!l.collapsed&&oo(l)&&(r=wt());const i=l.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&g.value.contains(c))){if(c){const t=c.parentNode;Array.from(c.childNodes).forEach(o=>{if(o.nodeType===Node.ELEMENT_NODE)if(o.tagName==="P"||o.tagName==="DIV")t.insertBefore(o,c);else{const s=document.createElement("p");s.appendChild(o.cloneNode(!0)),t.insertBefore(s,c)}else if(o.nodeType===Node.TEXT_NODE&&o.textContent.trim()){const s=document.createElement("p");s.appendChild(o.cloneNode(!0)),t.insertBefore(s,c)}}),c.remove()}}else if(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const t=document.createElement("blockquote"),n=l.extractContents();t.appendChild(n),l.insertNode(t);const o=[],s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:m=>m.parentNode===t&&m.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let d;for(;d=s.nextNode();)o.push(d);if(o.forEach(m=>{const f=document.createElement("p");m.parentNode.insertBefore(f,m),f.appendChild(m)}),t.querySelectorAll("p, div").forEach(m=>{m.textContent.trim()===""&&!m.querySelector("img")&&(m.innerHTML="<br>")}),t.children.length===0&&t.textContent.trim()===""){const m=document.createElement("p");m.innerHTML="<br>",t.appendChild(m)}}e.nextTick(()=>{r&&Oe(r),zt(),ce(),ke()})},$o=()=>{if(!g.value)return;const a=window.getSelection();if(a.rangeCount===0)return;const r=a.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!i||!g.value.contains(i))return;const c=d=>{if(!d)return!1;const u=d.textContent||"",f=(d.innerHTML||"").trim();return u.trim()===""||f===""||f==="<br>"||f==="<br/>"||f==="<p></p>"||f==="<p><br></p>"||f==="<p><br/></p>"||f==="<p> </p>"||f==="<p><br> </p>"||f==="<div></div>"||f==="<div><br></div>"||f==="<div><br/></div>"};let p=null;for(r.nodeType===3?p=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?p=r:p=r.closest("p, div"),p&&i.contains(p)&&c(p)&&p.remove();i.lastChild;){const d=i.lastChild;if(d.nodeType===1&&d.tagName==="BR")d.remove();else if(d.nodeType===3)if((d.textContent||"").trim()==="")d.remove();else break;else break}if(i.children.length>0)for(let d=i.children.length-1;d>=0;d--){const u=i.children[d];if((u.tagName==="P"||u.tagName==="DIV")&&c(u))u.remove();else break}let t=i.innerHTML;const n=t;t=t.replace(/(<br\s*\/?>)+$/gi,""),t!==n&&(i.innerHTML=t);const o=document.createElement("p");o.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(o,i.nextSibling):i.parentNode.appendChild(o):g.value&&g.value.appendChild(o);const s=document.createRange();s.selectNodeContents(o),s.collapse(!0),a.removeAllRanges(),a.addRange(s),e.nextTick(()=>{zt(),ce()})},qe=()=>{if(!g.value){ze.value=!1;return}try{const a=window.getSelection();if(a.rangeCount>0){const r=a.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a");ze.value=!!i}else ze.value=!1}catch{ze.value=!1}},Do=()=>{if(!g.value)return;const a=window.getSelection();a&&a.rangeCount>0&&a.getRangeAt(0),Ht.value=wt();const l=window.getSelection();let r="";l.rangeCount>0&&(r=l.getRangeAt(0).toString()),oe.value="",ne.value=r,Xt.value="",fe.value=null,st.value=!0,He(),e.nextTick(()=>{rt.value&&rt.value.focus()})},Et=()=>{if(!g.value)return;ie.value?(Z.value&&(clearTimeout(Z.value),Z.value=null),Ve(),ie.value=!1):Ve();const a=window.getSelection();let l=null;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer;l=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!l&&fe.value&&(l=fe.value),l&&l.parentNode){const r=document.createDocumentFragment();for(;l.firstChild;)r.appendChild(l.firstChild);if(l.parentNode.replaceChild(r,l),r.firstChild){const i=document.createRange();i.setStartBefore(r.firstChild),i.setEndAfter(r.lastChild||r.firstChild),a.removeAllRanges(),a.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),a.removeAllRanges(),a.addRange(i)}fe.value=null}else Rt("unlink");ze.value=!1,He(),e.nextTick(()=>{ce(),qe()})},C=()=>{x.disabled||!x.richText||g.value&&(ie.value?(Z.value&&(clearTimeout(Z.value),Z.value=null),Ve(),ie.value=!1):Ve(),He(),g.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Se(),ce(),ke()}))},Te=()=>{x.disabled||!x.richText||g.value&&(ie.value?(Z.value&&(clearTimeout(Z.value),Z.value=null),Ve(),ie.value=!1):Ve(),He(),g.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Se(),ce(),ke()}))},je=a=>{const l=a.parentElement;if(!l||l.tagName!=="OL")return null;let r=0,i=a.previousElementSibling;for(;i;)i.tagName==="LI"&&r++,i=i.previousElementSibling;return r+1},Se=()=>{if(!g.value)return;g.value.querySelectorAll("li > ol").forEach(l=>{const r=l.parentElement;if(r&&r.tagName==="LI"){const i=je(r);i!==null&&Array.from(l.children).filter(p=>p.tagName==="LI").forEach(p=>{p.setAttribute("data-parent-num",String(i))})}})},Vt=()=>{if(x.disabled||!x.richText||!g.value)return;He(),g.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const l=a.getRangeAt(0),r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!r){document.execCommand("indent",!1),e.nextTick(()=>{Se(),ce()});return}const i=r.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=r.previousElementSibling;if(c&&c.tagName==="LI"){const p=i.tagName.toLowerCase();let t=c.querySelector(`:scope > ${p}`);t||(t=document.createElement(p),c.appendChild(t));const n=je(c);t.appendChild(r),n!==null&&i.tagName==="OL"&&r.setAttribute("data-parent-num",String(n)),Se();const o=document.createRange();o.selectNodeContents(r),o.collapse(!1),a.removeAllRanges(),a.addRange(o),e.nextTick(()=>{ce(),ke()})}else document.execCommand("indent",!1),e.nextTick(()=>{Se(),ce(),ke()})},Ne=()=>{if(x.disabled||!x.richText||!g.value)return;He(),g.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const l=a.getRangeAt(0),r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!r){document.execCommand("outdent",!1),e.nextTick(()=>{Se(),ce()});return}const i=r.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const p=c.parentElement;if(p&&(p.tagName==="OL"||p.tagName==="UL")){i.tagName==="OL"&&r.removeAttribute("data-parent-num"),p.insertBefore(r,c.nextSibling),i.children.length===0&&i.remove(),Se();const t=document.createRange();t.selectNodeContents(r),t.collapse(!1),a.removeAllRanges(),a.addRange(t),e.nextTick(()=>{ce(),ke()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Se(),ce(),ke()})},Q=e.ref(null),Ie=e.ref(null),Ke=e.ref({}),se=e.ref(""),re=e.ref(null),Y=e.ref("");e.ref("");const Me=e.ref(null);e.ref("");const _e=e.ref([]),Io=e.ref(!1),uo=e.ref(!1),fn=a=>{if(!a)return"";const l=a.cloneRange(),r=document.createElement("div");return r.appendChild(l.cloneContents()),r.innerHTML},vn=()=>{if(x.disabled||!x.richText||!g.value)return;if(Q.value!==null){Q.value=null,se.value="",Y.value="",Me.value=null,_e.value=[],Ut(!0);return}He(),g.value.focus();const a=window.getSelection();if(!a||a.rangeCount===0)return;const l=a.getRangeAt(0);if(l.collapsed||!oo(l))return;Y.value=fn(l)||"",Me.value=wt();const r=l.getBoundingClientRect(),i=g.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),p=r.bottom-c.top,n=Math.max(p+8,0);Ke.value={top:`${n}px`,bottom:"auto"},Q.value=Date.now(),e.nextTick(()=>{if(se.value="",re.value){const s=re.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`,s.focus()}const o=i.querySelector(".dss-comment-overlay");if(o&&i){const s=i.querySelector(".dss-text-editor-footer");if(s){const d=i.getBoundingClientRect(),u=o.getBoundingClientRect(),m=s.getBoundingClientRect(),f=u.bottom-d.top,v=m.top-d.top,h=8;if(f>v-h){const y=m.height;Ke.value={bottom:`${y+h}px`,top:"auto"}}else Ke.value={top:`${n}px`,bottom:"auto"}}}})},gn=()=>{if(!se.value.trim())return;const a=se.value.trim(),l=new Date,r={text:a,selectionText:Y.value,selectionRange:Me.value,commentId:Q.value,user:x.commentUser||null,createdAt:l.toISOString()};_e.value=[..._e.value,r],K("comment-submitted",r),Fn(r),Me.value&&!eo(Me.value)&&ye(Q.value,Me.value),se.value="",e.nextTick(()=>{if(re.value){const i=re.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}Re("sendComment")})},St=(a,l)=>{if(!(!x.commentUser||!a.user||a.user.id!==x.commentUser.id)){if(_e.value=_e.value.filter((r,i)=>i!==l),Q.value!==null&&g.value){const r=String(Q.value),i=g.value.querySelector(`[data-comment="${r}"], [data-fake-comment="${r}"]`);if(i&&_e.value.length>0){const c=[],p=new Set;_e.value.forEach(t=>{t.user&&t.user.id&&!p.has(t.user.id)&&(p.add(t.user.id),c.push(t.user))}),c.length>0?i.setAttribute("data-comment-user",JSON.stringify(c[0])):i.removeAttribute("data-comment-user"),c.length>1?i.setAttribute("data-comment-user-2",JSON.stringify(c[1])):i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count",String(_e.value.length))}else i&&_e.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(K("comment-deleted",{comment:a,index:l,commentId:Q.value}),x.comments&&Array.isArray(x.comments)){const r=x.comments.filter(i=>!(i.commentId===a.commentId&&i.text===a.text&&i.user?.id===a.user?.id));K("update:comments",r)}e.nextTick(()=>{Re("deleteComment")})}},eo=a=>{if(!a||!g.value)return!1;try{const l=Nt(a);if(!l)return!1;const r=l.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i)return!!i.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Nt=a=>{if(!a||!g.value)return null;try{const l=document.createRange();if(a.type==="element"&&a.element)return g.value.contains(a.element)?(l.setStart(a.element,a.offset),l.collapse(!0),l):null;let r=0;const i=[g.value];let c=null,p=!1,t=!1;for(;!t&&(c=i.pop());)if(c.nodeType===3){const n=r+c.length;!p&&a.start>=r&&a.start<=n&&(l.setStart(c,a.start-r),p=!0),p&&a.end>=r&&a.end<=n&&(l.setEnd(c,a.end-r),t=!0),r=n}else{let n=c.childNodes.length;for(;n--;)i.push(c.childNodes[n])}return p?l:null}catch{return null}},ye=(a,l)=>{if(!(!a||!l||!g.value))try{const r=Nt(l);if(!r||r.collapsed)return;const i=r.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const n=c.closest("[data-comment], [data-fake-comment]");if(n){n.getAttribute("data-comment")!==String(a)&&n.getAttribute("data-fake-comment")!==String(a)&&n.setAttribute("data-comment",String(a));return}}const p=document.createElement("span");p.setAttribute("data-comment",String(a));try{const n=r.startContainer,o=r.endContainer,s=r.startOffset,d=r.endOffset,u=n.nodeType===3?n.parentNode:n,m=o.nodeType===3?o.parentNode:o;if(u===m&&s===0&&d===(o.nodeType===3?o.length:m.childNodes.length)&&(u.tagName==="P"||u.tagName==="DIV"||u.tagName==="H1"||u.tagName==="H2"||u.tagName==="H3"||u.tagName==="H4"||u.tagName==="H5"||u.tagName==="H6")){const v=r.extractContents();p.appendChild(v),r.insertNode(p)}else r.surroundContents(p)}catch{const o=r.extractContents();p.appendChild(o),r.insertNode(p)}const t=g.value.querySelector(`[data-comment="${String(a)}"]`);e.nextTick(()=>{Re("wrapSelectionWithCommentMarker"),ce()})}catch{}},Fn=a=>{if(!a||!a.commentId)return;const l=Array.isArray(x.comments)?[...x.comments]:[],r=typeof a.commentId=="string"&&a.commentId.startsWith("comment-")?Date.now():Number(a.commentId)||a.commentId;let i=l.findIndex(p=>typeof p.conversation_id=="string"&&p.conversation_id.startsWith("comment-")?null:Number(p.conversation_id)===Number(r)||p.conversation_id===r);const c={text:a.text,user:a.user,createdAt:a.createdAt,created_at:a.createdAt,updated_at:a.createdAt};if(i>=0){const p=l[i];if(p.conversation||(p.conversation=[]),p.conversation.push(c),p.updated_at=a.createdAt,!p.article_id&&l.length>0){const t=l.find(n=>n.article_id);t&&(p.article_id=t.article_id)}}else{const p=a.selectionRange,t=l.length>0&&l.find(o=>o.article_id)?.article_id||null,n={conversation_id:r,article_id:t,selection_range:p?{start:p.start||0,end:p.end||0,type:p.type||"text"}:null,selection_text:a.selectionText||"",conversation:[c],created_by_user:a.user,created_at:a.createdAt,updated_at:a.createdAt,status:"active"};l.push(n)}Io.value=!0,K("update:comments",l)},Ce=(a,l=[])=>{if(x.disabled||!x.richText||!g.value)return;const r=g.value;let i=null;try{i=r.querySelector(a)}catch{return}if(!i)return;He(),r.focus();const c=document.createRange();c.selectNodeContents(i);const p=window.getSelection();p&&(p.removeAllRanges(),p.addRange(c)),Y.value=i.innerHTML||"",Me.value=wt();const t=c.getBoundingClientRect(),n=r.parentElement;if(n){const d=n.getBoundingClientRect(),u=t.bottom-d.top,f=Math.max(u+8,0);Ke.value={top:`${f}px`,bottom:"auto"}}const o=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let s=[];if(o&&x.comments&&Array.isArray(x.comments)){const d=x.comments.find(u=>String(u.conversation_id)===String(o));if(d&&d.conversation&&Array.isArray(d.conversation)){const u=d.conversation.map(m=>({id:m.id||m.commentary_id,commentary_id:m.id||m.commentary_id,conversation_id:d.id||d.conversation_id,text:m.text,user:m.user,createdAt:m.created_at||m.createdAt,updated_at:m.updated_at||m.updatedAt}));s.push(...u)}}s.length===0&&Array.isArray(l)&&l.length>0&&(s=l.slice()),s.sort((d,u)=>{const m=h=>{if(!h)return 0;const y=new Date(h).getTime();return isNaN(y)?0:y},f=m(d.createdAt),v=m(u.createdAt);return f===v?0:f-v}),_e.value=s,Ut(!0),Q.value=o||null,i&&(Ie.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(se.value="",re.value){const d=re.value;d.style.height="auto",d.style.height=`${d.scrollHeight}px`,d.focus()}if(n){const d=n.querySelector(".dss-comment-overlay");if(d){const u=n.querySelector(".dss-text-editor-footer");if(u){const m=n.getBoundingClientRect(),f=d.getBoundingClientRect(),v=u.getBoundingClientRect(),h=f.bottom-m.top,y=v.top-m.top,k=8;if(h>y-k){const N=v.height;Ke.value={bottom:`${N+k}px`,top:"auto"}}}}}Re("openCommentOverlayForSelector")})},Be=e.ref(null),hn=e.ref(0),zn=a=>{if(!(x.disabled||!x.richText)){if(a.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const i=l.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&g.value&&g.value.contains(c))){a.preventDefault();let t=null;i.nodeType===3?t=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?t=i:t=i.closest("p, div");const n=document.createElement("p");n.innerHTML="<br>",t&&c.contains(t)&&t.nextSibling?c.insertBefore(n,t.nextSibling):c.appendChild(n),setTimeout(()=>{$o()},50);return}}}if(a.key.length===1||a.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const r=l.getRangeAt(0),i=r.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const p=c.closest(".dss-image-wrapper");if(p){const t=p.querySelector("img");if(c!==t&&!t?.contains(c)){const n=r.startContainer.nodeType===3?r.startContainer.parentElement:r.startContainer,o=r.endContainer.nodeType===3?r.endContainer.parentElement:r.endContainer;if(p.contains(n)&&n!==t||p.contains(o)&&o!==t){a.preventDefault();const s=document.createRange();s.setStartAfter(p),s.collapse(!0),l.removeAllRanges(),l.addRange(s);return}}}}}}if(a.key==="Backspace"||a.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0);let i=null,c=null;if(r.collapsed)if(a.key==="Backspace"){const p=r.startContainer;let t=p;p.nodeType===3&&(r.startOffset===0?t=p.previousSibling||p.parentNode:t=p.parentNode);const n=t.previousSibling;n&&(n.classList&&n.classList.contains("dss-image-wrapper")?c=n:n.tagName==="IMG"&&(i=n,c=i.closest(".dss-image-wrapper"))),c||(c=t.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const p=r.startContainer;let t=p;p.nodeType===3&&(r.startOffset===p.length?t=p.nextSibling||p.parentNode:t=p.parentNode);const n=t.nextSibling;n&&(n.classList&&n.classList.contains("dss-image-wrapper")?c=n:n.tagName==="IMG"&&(i=n,c=i.closest(".dss-image-wrapper"))),c||(c=t.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const p=r.commonAncestorContainer,t=r.startContainer.nodeType===3?r.startContainer.parentElement:r.startContainer,n=r.endContainer.nodeType===3?r.endContainer.parentElement:r.endContainer;if(p.nodeType===1&&p.tagName==="IMG"?(i=p,c=i.closest(".dss-image-wrapper")):(i=p.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const o=c.contains(t)||t===c,s=c.contains(n)||n===c,u=r.cloneContents().textContent?.trim()||"",m=c.textContent?.trim()||"";(!o||!s||u.length>m.length)&&(c=null,i=null)}}if(c){a.preventDefault(),a.stopPropagation();const p=c.parentNode;if(p){const t=document.createTextNode("");p.insertBefore(t,c),c.remove();const n=document.createRange();n.setStartAfter(t),n.collapse(!0),l.removeAllRanges(),l.addRange(n),e.nextTick(()=>{ce()});return}}}}if(a.key==="Tab"){a.preventDefault(),a.shiftKey?Ne():Vt();return}if(a.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0);if(r.collapsed){const t=r.startContainer,n=o=>{if(!o)return!1;let s=o.previousSibling;for(;s;){if(s.classList&&s.classList.contains("dss-image-wrapper")||s.tagName==="IMG"||s.querySelector&&s.querySelector(".dss-image-wrapper")||s.querySelector&&s.querySelector("img"))return!0;s=s.previousSibling}const d=o.parentElement;return d&&d!==g.value?n(d):!1};if(t.nodeType===3){const o=t.parentElement;if(o&&(n(o)||n(t))){const s=o.closest("p, div");if(s&&s!==g.value){a.preventDefault(),a.stopPropagation();let d=null;const u=r.startOffset;u<t.length&&(d=t.splitText(u));const m=document.createElement("p");if(d?m.appendChild(d):m.innerHTML="<br>",t.length===0){const v=t.parentElement;v&&(v.removeChild(t),v.childNodes.length===0&&v.appendChild(document.createElement("br")))}s.nextSibling?s.parentNode.insertBefore(m,s.nextSibling):s.parentNode.appendChild(m);const f=document.createRange();d?f.setStart(d,0):f.setStart(m,0),f.collapse(!0),l.removeAllRanges(),l.addRange(f),e.nextTick(()=>{ce()});return}}}}const i=r.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&g.value&&g.value.contains(c))){let t=null;i.nodeType===3?t=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?t=i:t=i.closest("p, div");const n=v=>{if(!v)return!1;const h=v.textContent||"",k=(v.innerHTML||"").trim(),N=k.replace(/<br\s*\/?>/gi,"").trim();return h.trim()===""||k===""||N===""||k==="<br>"||k==="<br/>"||k==="<p></p>"||k==="<p><br></p>"||k==="<p><br/></p>"||k==="<p> </p>"||k==="<p><br> </p>"||k==="<div></div>"||k==="<div><br></div>"||k==="<div><br/></div>"},o=c.lastChild,s=o&&o.nodeType===1&&o.tagName==="BR",d=r.startContainer,u=d.nodeType===3?d.parentElement:d,m=u===c||u&&u.parentElement===c;if(t&&n(t)||s&&m){a.preventDefault(),setTimeout(()=>{$o()},50);return}}}}if(a.key===" "){const l=Date.now(),r=l-hn.value;if(Be.value===" "&&r<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(p){const t=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((p.textContent||"").indexOf(t.trim())<=10||t.trim().length<=2){a.preventDefault(),Vt();return}}}}Be.value=" ",hn.value=l}else Be.value=a.key}},qo=a=>{if(x.disabled||!x.richText)return;a.preventDefault();let l=a.clipboardData.getData("text/html"),r=a.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),r&&(r=r.replace(/<!--[\s\S]*?-->/g,"")),Ve();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let n=i.getRangeAt(0).commonAncestorContainer;n.nodeType===3&&(n=n.parentNode),c=n.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const p=t=>{const o=new DOMParser().parseFromString(t,"text/html");let s=g.value.querySelector("h1")?1:0;if(o.querySelectorAll("h1").forEach(u=>{if(s>0){const m=o.createElement("p");m.innerHTML=u.innerHTML,u.parentNode.replaceChild(m,u)}else s++}),c){const u=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],m=Array.from(o.body.children).filter(f=>u.includes(f.tagName));if(m.length===1){const f=m[0].tagName,v=c.tagName,h=c.textContent.trim()===""&&!c.querySelector("img");let y=!1;if(["H1","H2","H3","H4","H5","H6"].includes(v)?y=!0:h||(f===v||f==="P")&&(y=!0),y)return m[0].innerHTML.trim()}}return o.body.innerHTML.trim()};if(l){const t=p(l);document.execCommand("insertHTML",!1,t)}else if(r)if(/<[a-z][\s\S]*>/i.test(r)){const n=p(r);document.execCommand("insertHTML",!1,n)}else document.execCommand("insertText",!1,r);ce()},yn=a=>{if(De.value){const r=a.target;!r.closest(".dss-toolbar-dropdown")&&!r.closest(".dss-toolbar-dropdown-toggle")&&He()}if(xe.value){const r=a.target,i=r.closest(".dss-floating-toolbar"),c=g.value&&r.closest(".dss-text-editor-content");!i&&!c&&po()}if(Le.value){const r=a.target,i=r.closest(".dss-floating-toolbar"),c=r.closest(".dss-toolbar-dropdown");!i&&!c&&bn()}const l=a.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(We.value=null),!g.value||!l.closest(".dss-text-editor-content")){const r=window.getSelection();if(r&&r.rangeCount>0){const i=r.getRangeAt(0);yt.value=!i.collapsed&&oo(i)}else yt.value=!1}if(Q.value!==null){const r=document.querySelector(".dss-comment-overlay");let i=!1;if(r){const t=r.getBoundingClientRect(),n=a.clientX,o=a.clientY;i=n>=t.left&&n<=t.right&&o>=t.top&&o<=t.bottom}const c=l.closest(".dss-toolbar-button"),p=c&&c.getAttribute("title")==="Comment";!i&&!p&&(Q.value=null,se.value="",Y.value="",Me.value=null,_e.value=[],Ut(!0))}},Wo=(a,l)=>{a&&a.stopPropagation&&a.stopPropagation(),we.value&&(clearTimeout(we.value),we.value=null),We.value=l},ve=a=>{const l=a.relatedTarget;if(l){const r=l.closest(".dss-toolbar-dropdown-submenu"),i=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(r||i)return}we.value&&clearTimeout(we.value),we.value=setTimeout(()=>{We.value=null,we.value=null},150)},Xo=a=>{We.value=null};let Cn=0;const kn=a=>{if(!a)return;const l=Array.from(a.children);l.forEach(r=>{r.classList.contains("dss-toolbar-dropdown-submenu")||r.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(r.tagName==="BUTTON"||r.tagName==="DIV")&&!r.classList.contains("dss-toolbar-dropdown-item")&&r.classList.add("dss-toolbar-dropdown-item")}),l.forEach((r,i)=>{if(r.classList.contains("dss-toolbar-dropdown-item-has-submenu")||r.classList.contains("dss-toolbar-dropdown-submenu")||!r.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(r.children).find(n=>n.tagName==="DIV"?n.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(n.children).filter(s=>s.tagName==="BUTTON"||s.tagName==="DIV").length>0:!1),p=r.nextElementSibling,t=p&&!p.classList.contains("dss-toolbar-dropdown-submenu")&&!p.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&p.tagName==="DIV"&&!p.classList.contains("dss-toolbar-dropdown-item")&&Array.from(p.children).some(n=>n.tagName==="BUTTON"||n.tagName==="DIV");if(c||t){const n=`submenu-auto-${++Cn}`;r.classList.add("dss-toolbar-dropdown-item-has-submenu"),r.setAttribute("data-submenu-id",n);let o=null;c?(r.tagName==="BUTTON"&&r.parentNode.insertBefore(c,r.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),o=c):t&&(p.classList.add("dss-toolbar-dropdown-submenu"),o=p),o&&(o.setAttribute("data-submenu-id",n),o.setAttribute("data-processed","true"),c&&r.tagName!=="BUTTON"?o.dataset.originalParentRef="inside":o.dataset.originalParentRef="sibling",Array.from(o.children).forEach(d=>{(d.tagName==="BUTTON"||d.tagName==="DIV")&&!d.classList.contains("dss-toolbar-dropdown-item")&&d.classList.add("dss-toolbar-dropdown-item")}))}})},xn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{kn(l),l.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const p=c._subMenuHandlers;p&&(c.removeEventListener("mouseenter",p.enter),c.removeEventListener("mouseleave",p.leave));const t=o=>{const s=c.getAttribute("data-submenu-id");s&&Wo(o,s)},n=ve;c.addEventListener("mouseenter",t),c.addEventListener("mouseleave",n),c._subMenuHandlers={enter:t,leave:n}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const p=c._subMenuHandlers;p&&(c.removeEventListener("mouseenter",p.enter),c.removeEventListener("mouseleave",p.leave));const t=s=>{const d=c.getAttribute("data-submenu-id");d&&Wo(s,d)},n=ve;c.addEventListener("mouseenter",t),c.addEventListener("mouseleave",n),c._subMenuHandlers={enter:t,leave:n},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(s=>{s.addEventListener("click",Xo)})})})};let mo=null;const _o=()=>{if(We.value){const a=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${We.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${We.value}"]`);a&&l&&Mn(a,l)}if(xe.value&&ke(),x.richText){if(mo!==null)return;mo=setTimeout(()=>{mo=null,Re("handleWindowResize")},150)}},to=()=>{if(!x.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(i=>i.tagName==="DIV"&&!i.classList.contains("dss-toolbar-button")).forEach(i=>{i.classList.add("dss-toolbar-button")})})},Yo=()=>{const a=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=r=>{if(r.preventDefault(),r.stopPropagation(),window.getSelection){const i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};a.forEach(r=>{r.addEventListener("selectstart",l),r.addEventListener("mousedown",l),r.addEventListener("dragstart",l),r.addEventListener("contextmenu",l),r.addEventListener("click",i=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{ht.value?Dt():Po(),tt.value?ko():Oo()})}),e.nextTick(()=>{Yo()}),x.richText&&g.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",yn),window.addEventListener("resize",_o);let a=null;const l=()=>{a===null&&(a=setTimeout(()=>{a=null,_o()},150))};window.addEventListener("scroll",l,!0),g.value._windowScrollHandler=l,g.value._windowScrollTimeout=a,g.value.closest(".editor-with-comments"),g.value.closest(".dss-text-editor-content-wrapper");const r=g.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,_o()},150))};r&&(r.addEventListener("scroll",c),g.value._scrollHandlers={wrapper:null,content:r,handler:c}),e.nextTick(()=>{xn(),to()}),g.value.addEventListener("click",n=>{const o=n.target;o.closest("a")&&!x.disabled&&n.preventDefault();const d=o.closest(".dss-image-no-alt-icon"),u=o.closest(".dss-image-wrapper");if(d||u&&o===u){n.preventDefault(),n.stopPropagation();const m=window.getSelection(),f=document.createRange();f.setStartAfter(u),f.collapse(!0),m.removeAllRanges(),m.addRange(f)}else u&&o.tagName!=="IMG"&&(n.preventDefault(),e.nextTick(()=>{const m=window.getSelection();if(m.rangeCount>0){const v=m.getRangeAt(0).commonAncestorContainer,h=v.nodeType===3?v.parentElement:v;if(u.contains(h)&&h!==u.querySelector("img")){const y=document.createRange();y.setStartAfter(u),y.collapse(!0),m.removeAllRanges(),m.addRange(y)}}else{const f=document.createRange();f.setStartAfter(u),f.collapse(!0),m.addRange(f)}}))},!0),g.value.addEventListener("mousedown",n=>{const o=n.target,s=o.closest(".dss-image-no-alt-icon"),d=o.closest(".dss-image-wrapper");if(s||d&&o.tagName!=="IMG"){n.preventDefault();const u=window.getSelection(),m=document.createRange();d&&(m.setStartAfter(d),m.collapse(!0),u.removeAllRanges(),u.addRange(m))}},!0),g.value.addEventListener("paste",n=>{e.nextTick(()=>{if(!g.value)return;g.value.querySelectorAll("img").forEach(s=>{if(!s.closest(".dss-image-wrapper"))s.removeAttribute("alt"),s.removeAttribute("data-alt"),s.setAttribute("alt",""),s.setAttribute("data-alt",""),s.alt="";else{const u=s.getAttribute("alt")||s.alt||"";if(u){const m=s.getAttribute("src")||s.src||"",f=m.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),v=u===m||u===f;(u.startsWith("http://")||u.startsWith("https://")||u.startsWith("data:")||v||v)&&(s.setAttribute("alt",""),s.setAttribute("data-alt",""),s.alt="")}}}),ot()})});let p=null;const t=new MutationObserver(n=>{n.forEach(o=>{o.addedNodes.forEach(s=>{if(s.nodeType===1){s.tagName==="IMG"&&(s.removeAttribute("alt"),s.removeAttribute("data-alt"),s.setAttribute("alt",""),s.setAttribute("data-alt",""),s.alt="");const d=s.querySelectorAll&&s.querySelectorAll("img");d&&d.forEach(u=>{u.removeAttribute("alt"),u.removeAttribute("data-alt"),u.setAttribute("alt",""),u.setAttribute("data-alt",""),u.alt=""})}})}),p&&clearTimeout(p),p=setTimeout(()=>{ot(),to(),p=null},100)});if(t.observe(g.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const n=document.querySelector(".dss-text-editor-toolbar");if(n){const o=new MutationObserver(()=>{e.nextTick(()=>{to()})});o.observe(n,{childList:!0,subtree:!0}),n._toolbarMutationObserver=o}}),x.modelValue){const n=Qt(x.modelValue);g.value.innerHTML=n,Zo()}e.nextTick(()=>{const n=g.value.innerHTML||"",o=x.title||"",s=x.description||"";Xe.value=n,dt.value=o,he.value=s,Ye.value=o,et.value=s,Se(),ot(),_t(),Ft(),Nn(),Ge()}),qe(),zt(),g.value._mutationObserver=t}}),e.onUnmounted(()=>{if(document.removeEventListener("click",yn),window.removeEventListener("resize",_o),g.value&&g.value._windowScrollHandler&&window.removeEventListener("scroll",g.value._windowScrollHandler,!0),mo!==null&&(clearTimeout(mo),mo=null),g.value&&g.value._windowScrollTimeout!==null&&clearTimeout(g.value._windowScrollTimeout),Z.value&&clearTimeout(Z.value),we.value&&clearTimeout(we.value),g.value&&g.value._mutationObserver&&g.value._mutationObserver.disconnect(),kt.value&&kt.value.disconnect(),Kt.value!==null&&(cancelAnimationFrame(Kt.value),Kt.value=null),mt.value!==null&&(clearTimeout(mt.value),mt.value=null),xt.value!==null&&(clearTimeout(xt.value),xt.value=null),Ut(!0),g.value&&g.value._scrollHandlers){const{wrapper:l,content:r,handler:i}=g.value._scrollHandlers;l&&l.removeEventListener("scroll",i),r&&r.removeEventListener("scroll",i)}const a=document.querySelector(".dss-text-editor-toolbar");a&&a._toolbarMutationObserver&&a._toolbarMutationObserver.disconnect()});const wn=a=>{const l=a.target,r=l.closest("a");if(r&&!x.disabled){a.preventDefault();const c=document.createRange();c.selectNodeContents(r);const p=window.getSelection();p.removeAllRanges(),p.addRange(c)}const i=l.closest(".dss-image-wrapper");i&&l.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const t=c.getRangeAt(0).commonAncestorContainer,n=t.nodeType===3?t.parentElement:t;if(i.contains(n)&&n!==i.querySelector("img")){const o=document.createRange();o.setStartAfter(i),o.collapse(!0),c.removeAllRanges(),c.addRange(o)}}ot(),qe(),zt(),ke(),Ft()}):e.nextTick(()=>{ot(),qe(),zt(),ke(),Ft()})},jo=()=>{Ao();const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);yt.value=!r.collapsed&&oo(r),!r.collapsed&&ut.value&&(ut.value=null)}else yt.value=!1;if(ot(),qe(),zt(),ke(),Ft(),a&&a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){a.removeAllRanges(),yt.value=!1;return}}["bold","italic","underline"].forEach(r=>{try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(!c.collapsed)if(r==="bold"){const p=c.commonAncestorContainer,t=p.nodeType===3?p.parentElement:p;let n=!1;if(t&&((t.tagName==="STRONG"||t.tagName==="B"||t.closest&&t.closest("strong, b"))&&(n=!0),!n&&t.style&&parseInt(t.style.fontWeight)>=600&&(n=!0),!n))try{const o=window.getComputedStyle(t);parseInt(o.fontWeight)>=600&&(n=!0)}catch{}q.value[r]=n}else{const p=document.queryCommandState(r);q.value[r]=p}}}catch{}})},Ft=()=>{if(!x.richText||x.disabled||!g.value){be.value="p";return}try{const a=window.getSelection();if(!a||a.rangeCount===0){be.value="p";return}const r=a.getRangeAt(0).commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(!i||!g.value.contains(i)){be.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){be.value="p";return}const p=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(p)?be.value=p:be.value="p"}catch{be.value="p"}},zt=()=>{if(!g.value){ro.value=!1;return}try{const a=window.getSelection();let l=!1;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");l=!!(c&&g.value.contains(c))}ro.value=l}catch{ro.value=!1}},oo=a=>{if(!a||!g.value)return!1;const l=a.commonAncestorContainer;if(!l)return!1;const r=l.nodeType===3?l.parentElement:l;return r?g.value.contains(r):!1},po=()=>{xe.value=!1},ke=()=>{if(!x.floatingToolbar||!x.richText||x.disabled){xe.value=!1;return}const a=window.getSelection();if(!a||a.rangeCount===0){xe.value=!1;return}const l=a.getRangeAt(0);if(l.collapsed||!oo(l)){xe.value=!1;return}const r=l.getBoundingClientRect();if(!r||r.width===0&&r.height===0){xe.value=!1;return}const i=g.value;if(!i){xe.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){xe.value=!1;return}const p=40,t=8,n=r.top-p/2+15;let o=r.left+r.width/2;const s=window.innerWidth||document.documentElement.clientWidth||0;let d=0;vo.value&&(d=vo.value.getBoundingClientRect().width);const u=(d||320)/2;let m=c.left+u,f=c.right-u;if(f<m){const v=c.left+c.width/2;m=v,f=v}if(s>0){const v=u+t,h=s-u-t;if(m=Math.max(m,v),f=Math.min(f,h),f<m){const y=s/2;m=y,f=y}}o<m?o=m:o>f&&(o=f),Ae.value={position:"fixed",top:`${Math.max(n,8)}px`,left:`${o}px`,transform:"translate(-50%, -100%)",zIndex:10003},xe.value=!0},Ko=a=>{x.disabled||!x.richText||(Le.value=Le.value===a?null:a,a==="askAi"&&(De.value=null))},bn=()=>{Le.value=null,We.value=null},no=a=>{bt(a),bn()};let Pt=null,fo=null,lo=null,pt=null;const Pn=a=>{if(x.disabled||!x.richText){xo(),wo();return}const l=a.target,r=l.closest("a"),i=l.closest("img");if(Pt&&(clearTimeout(Pt),Pt=null),lo&&(clearTimeout(lo),lo=null),r&&r!==fo){wo(),fo=r;let c=r.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=r.textContent||""),fe.value=r,I.value=c,M.value=!0,W.value=!0,Vn(r)}else!r&&fo?(fo=null,Pt=setTimeout(()=>{W.value||xo()},150)):r&&r===fo&&Vn(r);if(i&&i!==pt){xo(),pt=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let p=i.getAttribute("data-alt");p===null&&(p=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",p),G.value=i,io.value=c.trim()||w("textEditor.image.noAlt"),yo.value=!0,jt.value=!0,Go(i)}else!i&&pt?(pt=null,lo=setTimeout(()=>{jt.value||wo()},150)):i&&i===pt&&Go(i)},En=a=>{const l=a.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(fo=null,pt=null,Pt&&(clearTimeout(Pt),Pt=null),lo&&(clearTimeout(lo),lo=null),xo(),wo())},xo=()=>{W.value=!1,setTimeout(()=>{W.value||(M.value=!1,I.value="",st.value||(fe.value=null))},100)},Vn=a=>{if(!a||!g.value)return;const l=a.getBoundingClientRect(),c=l.top-32-8,p=l.left+l.width/2;X.value={position:"fixed",top:`${c}px`,left:`${p}px`,transform:"translateX(-50%)",zIndex:10002}},wo=()=>{jt.value=!1,setTimeout(()=>{jt.value||(yo.value=!1,io.value="",go.value||(G.value=null))},100)},Go=a=>{if(!a||!g.value)return;const l=a.getBoundingClientRect(),c=l.top-32-8,p=l.left+l.width/2;Yt.value={position:"fixed",top:`${c}px`,left:`${p}px`,transform:"translateX(-50%)",zIndex:10002}},On=()=>{if(!I.value||!fe.value)return;let l=fe.value.getAttribute("href")||I.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Zn=()=>{if(fe.value){const a=fe.value.textContent||"",l=fe.value.getAttribute("href")||"",r=fe.value;oe.value=l,ne.value=a,Xt.value=a,W.value=!1,M.value=!1,I.value="",fe.value=r,st.value=!0}else if(ze.value){const a=window.getSelection();if(a.rangeCount>0){const r=a.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a");if(i){const c=i.textContent||"",p=i.getAttribute("href")||"";oe.value=p,ne.value=c,Xt.value=c,fe.value=i,st.value=!0}}}else{Ht.value=wt();const a=window.getSelection();let l="";a.rangeCount>0&&(l=a.getRangeAt(0).toString()),oe.value="",ne.value=l,Xt.value="",fe.value=null,st.value=!0}e.nextTick(()=>{rt.value&&(rt.value.focus(),rt.value.select())})},ao=()=>{st.value=!1,oe.value="",ne.value="",Xt.value="",fe.value=null,Ht.value=null},Qo=()=>{if(!oe.value.trim()){ao();return}if(ie.value?(Z.value&&(clearTimeout(Z.value),Z.value=null),Ve(),ie.value=!1):Ve(),ne.value.trim()||(ne.value=oe.value.trim()),fe.value&&g.value&&g.value.contains(fe.value)){const a=window.getSelection();a.rangeCount>0&&a.removeAllRanges();const l=fe.value;if(l.setAttribute("href",oe.value.trim()),ne.value.trim()!==Xt.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=ne.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const r=document.createRange();r.selectNodeContents(l),r.collapse(!1),a.removeAllRanges(),a.addRange(r),ce()}else if(g.value){g.value.focus();const a=window.getSelection();a.removeAllRanges(),Ht.value&&Oe(Ht.value);let l=null;if(a.rangeCount>0&&(l=a.getRangeAt(0)),l&&!l.collapsed){l.toString();let r=l.endContainer;r.nodeType===3&&(r=r.parentElement);const i=r.closest("p, div, h1, h2, h3, h4, h5, h6"),c=document.createElement("a");if(c.href=oe.value.trim(),c.textContent=ne.value.trim(),c.style.color="#60afdf",c.style.textDecoration="underline",i&&i!==g.value){i.textContent="",i.appendChild(c);const p=document.createTextNode(" ");i.appendChild(p);const t=document.createRange();t.setStartAfter(p),t.collapse(!0),a.removeAllRanges(),a.addRange(t)}else{l.deleteContents(),l.insertNode(c);const p=document.createTextNode(" ");l.setStartAfter(c),l.insertNode(p),l.setStartAfter(p),l.collapse(!0),a.removeAllRanges(),a.addRange(l)}}else{l||(l=document.createRange(),l.selectNodeContents(g.value),l.collapse(!1));const r=l.startContainer,i=r.nodeType===3,c=i&&l.startOffset===r.textContent.length,p=document.createElement("a");if(p.href=oe.value.trim(),p.textContent=ne.value.trim(),p.style.color="#60afdf",p.style.textDecoration="underline",c){let t=r.parentElement;for(;t&&t!==g.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(t.tagName);)t=t.parentElement;if(t&&t!==g.value){let n=t.nextElementSibling;if(n&&(n.innerHTML==="<br>"||n.innerHTML==="<br/>"||n.textContent.trim()==="")){n.textContent="",n.appendChild(p);const o=document.createTextNode(" ");n.appendChild(o);const s=document.createRange();s.setStartAfter(p),s.collapse(!0),a.removeAllRanges(),a.addRange(s)}else{if(l.startOffset>0){const s=r.textContent.substring(0,l.startOffset),d=s[s.length-1];if(d&&d!==" "&&d!==" "&&d!==`
|
|
78
78
|
`){const u=document.createTextNode(" ");l.insertNode(u),l.setStartAfter(u)}}l.insertNode(p);const o=document.createTextNode(" ");l.setStartAfter(p),l.insertNode(o),l.setStartAfter(o),l.collapse(!0),a.removeAllRanges(),a.addRange(l)}}}else{if(i&&l.startOffset>0){const n=r.textContent.substring(0,l.startOffset),o=n[n.length-1];if(o&&o!==" "&&o!==" "&&o!==`
|
|
79
|
-
`){const s=document.createTextNode(" ");l.insertNode(s),l.setStartAfter(s)}}l.insertNode(p);const t=document.createTextNode(" ");l.setStartAfter(p),l.insertNode(t),l.setStartAfter(t),l.collapse(!0),a.removeAllRanges(),a.addRange(l)}}ce()}e.nextTick(()=>{qe(),ao()})},Jo=()=>{g.value&&(At.value=wt(),Ue.value="",it.value="",Lt.value="",de.value="",me.value="",So.value=null,G.value=null,Pe.value="upload",go.value=!0,He(),e.nextTick(()=>{Tt.value&&Tt.value.focus(),Je.value&&(Je.value.value="")}))},en=a=>{const l=a.target?.files?.[0];if(!l){So.value=null,it.value="";return}So.value=l;const r=new FileReader;r.onload=i=>{it.value=i.target?.result||""},r.readAsDataURL(l)},Un=()=>{Je.value&&Je.value.click()},Ot=()=>{let a=G.value;if(!a){const l=window.getSelection();if(l&&l.rangeCount>0){const i=l.getRangeAt(0).commonAncestorContainer;a=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(a){const l=a.getAttribute("data-alt")||a.getAttribute("alt")||"";G.value=a,Ue.value=l.trim()===""||l.trim()==="Image"?"":l;const r=a.getAttribute("src")||a.src||"";r.startsWith("http://")||r.startsWith("https://")?(Lt.value=r,it.value="",Pe.value="url"):(it.value=r,Lt.value="",Pe.value="upload");const c=a.style.width||a.getAttribute("width")||"",p=a.style.height||a.getAttribute("height")||"";de.value=c.endsWith("px")?c.replace("px",""):c,me.value=p.endsWith("px")?p.replace("px",""):p,At.value=null}else{Jo();return}go.value=!0,jt.value=!1,yo.value=!1,e.nextTick(()=>{Pe.value==="url"&&ho.value?(ho.value.focus(),ho.value.select()):Tt.value&&(Tt.value.focus(),Tt.value.select()),Je.value&&(Je.value.value="")})},so=()=>{go.value=!1,Ue.value="",it.value="",Lt.value="",de.value="",me.value="",So.value=null,G.value=null,At.value=null,Pe.value="upload"},nt=()=>{const a=(Ue.value||"").trim(),l=g.value?._mutationObserver;l&&l.disconnect(),ie.value?(Z.value&&(clearTimeout(Z.value),Z.value=null),Ve(),ie.value=!1):Ve();const r=Pe.value==="url"?Lt.value.trim():it.value;if(G.value&&g.value&&g.value.contains(G.value)){r&&(G.value.src=r),G.value.setAttribute("alt",a),G.value.setAttribute("data-alt",a),de.value?(G.value.style.width=`${de.value}px`,G.value.setAttribute("width",de.value)):(G.value.style.removeProperty("width"),G.value.removeAttribute("width")),me.value?(G.value.style.height=`${me.value}px`,G.value.setAttribute("height",me.value)):(G.value.style.removeProperty("height"),G.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(G.value),c.collapse(!0),i.addRange(c)}ce()}else{if(!r){l&&g.value&&l.observe(g.value,{childList:!0,subtree:!0}),so();return}if(g.value){g.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let p=null;if(At.value&&(Oe(At.value),c&&c.rangeCount>0&&(p=c.getRangeAt(0))),!p&&c&&c.rangeCount>0&&(p=c.getRangeAt(0)),!p&&g.value){if(p=document.createRange(),g.value.childNodes.length===0){const s=document.createElement("p");s.innerHTML="<br>",g.value.appendChild(s),p.setStart(s,0),p.collapse(!0)}else p.selectNodeContents(g.value),p.collapse(!1);c&&(c.removeAllRanges(),c.addRange(p))}if(!p){so();return}const t=p.commonAncestorContainer,n=t.nodeType===3?t.parentElement:t;if(!g.value.contains(n)){if(p=document.createRange(),g.value.childNodes.length===0){const s=document.createElement("p");s.innerHTML="<br>",g.value.appendChild(s),p.setStart(s,0),p.collapse(!0)}else p.selectNodeContents(g.value),p.collapse(!1);c&&(c.removeAllRanges(),c.addRange(p))}const o=document.createElement("img");o.src=r,o.setAttribute("alt",a),o.setAttribute("data-alt",a),de.value&&(o.style.width=`${de.value}px`,o.setAttribute("width",de.value)),me.value&&(o.style.height=`${me.value}px`,o.setAttribute("height",me.value));try{p.insertNode(o),p.setStartAfter(o),p.collapse(!0),c&&(c.removeAllRanges(),c.addRange(p))}catch{if(g.value){if(g.value.childNodes.length===0){const u=document.createElement("p");g.value.appendChild(u),u.appendChild(o)}else{const u=g.value.lastChild;if(u&&u.nodeType===1)u.appendChild(o);else{const m=document.createElement("p");g.value.appendChild(m),m.appendChild(o)}}const d=document.createRange();d.setStartAfter(o),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}}G.value=o,ce()}}e.nextTick(()=>{l&&g.value&&l.observe(g.value,{childList:!0,subtree:!0}),qe(),ke(),so()})};e.watch(()=>x.modelValue,a=>{if(x.richText&&g.value&&!Qe.value){const l=Qt(a||""),i=g.value.innerHTML.replace(/ |\u00A0/g," "),c=l.replace(/ |\u00A0/g," ");if(i!==c){const p=wt();g.value.innerHTML=l,e.nextTick(()=>{Zo();const t=g.value.innerHTML||"",n=x.title||"",o=x.description||"";Xe.value=t,dt.value=n,he.value=o,$t.value=t,Ye.value=n,et.value=o,ct.value=[],co.value=[],Z.value&&(clearTimeout(Z.value),Z.value=null),ie.value=!1,p&&Oe(p),Se(),ot(),Rt(),qe(),ke(),Ft(),_e("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>x.richText,a=>{a?(ke(),e.nextTick(()=>{Nn()})):(po(),Ct.value=[],kt.value&&(kt.value.disconnect(),kt.value=null)),Ft()}),e.watch(()=>x.floatingToolbar,a=>{a?ke():po()}),e.watch(()=>x.disabled,a=>{a&&po(),Ft()}),e.watch(()=>x.description,()=>{e.nextTick(()=>{tt.value?ko():Oo()})}),e.watch(()=>x.title,()=>{e.nextTick(()=>{ht.value?Dt():Po()})}),e.watch(()=>x.customToolbarSlots,()=>{e.nextTick(()=>{to()})},{deep:!0}),e.watch(()=>x.comments,(a,l)=>{if(Io.value){Io.value=!1;return}uo.value||x.richText&&g.value&&e.nextTick(()=>{Ge()})},{deep:!0,immediate:!1});const Ge=()=>{if(!uo.value&&!(!x.comments||!Array.isArray(x.comments)||x.comments.length===0)&&!(!x.richText||!g.value)){uo.value=!0;try{const a=new Set,l=x.comments.filter(t=>{const n=String(t.conversation_id||t.id);return a.has(n)?!1:(a.add(n),!0)}),r=g.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=r.length;r.forEach(t=>{const n=t.parentNode;if(n){for(;t.firstChild;)n.insertBefore(t.firstChild,t);n.removeChild(t)}});let c=0;const p=new Set;l.forEach(t=>{if(!t.conversation_id||!t.selection_range)return;const n=typeof t.conversation_id=="string"&&t.conversation_id.startsWith("comment-")?null:Number(t.conversation_id)||t.conversation_id;if(!n)return;const o=String(n);if(p.has(o))return;const s=g.value.querySelector(`[data-comment="${o}"]`);if(s){Zt(s,t),p.add(o);return}try{const d=bo(t.selection_range,t.selection_text);if(d&&!d.collapsed){const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(m){const h=m.closest("[data-comment], [data-fake-comment]");if(h){const y=h.getAttribute("data-comment")||h.getAttribute("data-fake-comment");if(String(y)===String(n)){h.setAttribute("data-comment",o),h.removeAttribute("data-fake-comment"),Zt(h,t),p.add(o);return}else return}}const f=g.value.querySelector(`[data-comment="${o}"]`);if(f){Zt(f,t),p.add(o);return}const v=document.createElement("span");v.setAttribute("data-comment",o),Zt(v,t);try{d.surroundContents(v),c++,p.add(o)}catch{const y=d.extractContents();v.appendChild(y),d.insertNode(v),c++,p.add(o)}}}catch{}}),e.nextTick(()=>{_e("restoreCommentsFromModel"),ce(),uo.value=!1})}catch{uo.value=!1}}},bo=(a,l)=>{if(!a||!g.value)return null;try{const r=document.createRange();if(a.type==="text"&&typeof a.start=="number"&&typeof a.end=="number"){let i=0;const c=[g.value];let p=null,t=!1,n=!1;for(;!n&&(p=c.pop());)if(p.nodeType===3){const o=i+p.length;!t&&a.start>=i&&a.start<=o&&(r.setStart(p,a.start-i),t=!0),t&&a.end>=i&&a.end<=o&&(r.setEnd(p,a.end-i),n=!0),i=o}else{let o=p.childNodes.length;for(;o--;)c.push(p.childNodes[o])}return t?r:null}}catch{return null}return null},Zt=(a,l)=>{if(!a||!l)return;const r=l.conversation||[],i=new Set,c=[],p=n=>{n&&n.id&&!i.has(n.id)&&(i.add(n.id),c.push(n))};r.length>0&&r.forEach(n=>{n.user&&p(n.user)}),c.length>0?a.setAttribute("data-comment-user",JSON.stringify(c[0])):a.removeAttribute("data-comment-user"),c.length>1?a.setAttribute("data-comment-user-2",JSON.stringify(c[1])):a.removeAttribute("data-comment-user-2");const t=r.length;t>0?a.setAttribute("data-comment-count",String(t)):a.removeAttribute("data-comment-count")},_e=(a="unknown")=>{if(!x.richText||!g.value){Ct.value=[];return}Date.now()-zo.value<tn&&Kt.value!==null||Kt.value===null&&(Kt.value=requestAnimationFrame(()=>{if(Kt.value=null,zo.value=Date.now(),Co.value)return;Co.value=!0;const r={},i=g.value;if(!i){Co.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Co.value=!1;return}const p=i.querySelectorAll("[data-comment], [data-fake-comment]"),t=[],n=new Set;p.forEach(m=>{const f=m.getAttribute("data-comment")||m.getAttribute("data-fake-comment");f&&m.tagName==="SPAN"&&(n.has(f)||(t.push(m),n.add(f)))}),p.forEach(m=>{const f=m.getAttribute("data-comment")||m.getAttribute("data-fake-comment");!f||n.has(f)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(m.tagName)?m.querySelector(`span[data-comment="${f}"], span[data-fake-comment="${f}"]`)||(t.push(m),n.add(f)):m.tagName!=="SPAN"&&(t.push(m),n.add(f)))});const o=c.getBoundingClientRect(),s=i.getBoundingClientRect();t.forEach((m,f)=>{let v=m.getAttribute("data-comment")||m.getAttribute("data-fake-comment");if(!v)return;if(typeof v=="string"&&v.startsWith("comment-")){const ft=m.textContent?.trim(),Mt=x.comments?.find(at=>(typeof at.conversation_id=="string"&&at.conversation_id.startsWith("comment-")?null:at.conversation_id)&&at.selection_text?.trim()===ft);Mt?(v=String(Mt.conversation_id),m.setAttribute("data-comment",v),m.removeAttribute("data-fake-comment")):(v=String(Date.now()),m.setAttribute("data-comment",v),m.removeAttribute("data-fake-comment"))}const h=m.getBoundingClientRect(),y=window.getComputedStyle(m),k=parseFloat(y.lineHeight)||parseFloat(y.fontSize)*1.2,_=h.top-s.top+k/2-15,A=s.top-o.top+_;let H=null,b=null,z=0;const B=[],L=new Set;if(v&&x.comments){const ft=x.comments.find(Mt=>String(Mt.conversation_id||Mt.id)===String(v));if(ft){const Mt=ft.conversation||[];Mt.length>0?(Mt.forEach(at=>{at.user&&at.user.id&&!L.has(at.user.id)&&(L.add(at.user.id),B.push(at.user))}),z=Mt.length):(z=0,H=null,b=null),B.length>0?H=B[0]:H=null,B.length>1?b=B[1]:b=null}}const P=h.top+k/2-15,F=P+30,j=5,Fe=F>s.top+j&&P<s.bottom-j?1:0;Ct.value.find(ft=>ft.id===v);let ge=m;if(!ge&&v&&g.value){const ft=String(v);ge=g.value.querySelector(`[data-comment="${ft}"], [data-fake-comment="${ft}"]`)}const lt=B.length;r[v]?(r[v].top=A,r[v].opacity=Fe,r[v].element=ge,r[v].firstUser=H,r[v].secondUser=b,r[v].totalCount=z,r[v].uniqueUserCount=lt):r[v]={id:v,top:A,opacity:Fe,element:ge,firstUser:H,secondUser:b,totalCount:z,uniqueUserCount:lt}});const d=Object.values(r).map(m=>{const f=Math.max(0,(m.uniqueUserCount??0)-2);if(!m.element&&m.id&&g.value){const h=String(m.id);m.element=g.value.querySelector(`[data-comment="${h}"], [data-fake-comment="${h}"]`)}return{...m,firstUser:m.firstUser||null,secondUser:m.secondUser||null,totalCount:m.totalCount,additionalCount:f}});(Ct.value.length!==d.length||d.some((m,f)=>{const v=Ct.value[f];if(!v)return!0;const h=(v.firstUser?.id||null)!==(m.firstUser?.id||null),y=(v.secondUser?.id||null)!==(m.secondUser?.id||null);return v.id!==m.id||Math.abs(v.top-m.top)>1||v.opacity!==m.opacity||v.totalCount!==m.totalCount||v.additionalCount!==m.additionalCount||h||y||v.element!==m.element}))&&(Ct.value=d),Co.value=!1}))},J=a=>{if(!a)return;let l=a.element;if(!l&&a.id&&g.value){const r=String(a.id);l=g.value.querySelector(`[data-comment="${r}"], [data-fake-comment="${r}"]`)}l&&(Ut(),Ie.value=l,l.classList.add("editor-comment-highlighted"))},Ut=(a=!1)=>{!a&&Q.value!==null&&Ie.value&&(Ie.value.getAttribute("data-comment")||Ie.value.getAttribute("data-fake-comment"))===Q.value||(g.value&&g.value.querySelectorAll(".editor-comment-highlighted").forEach(r=>{r.classList.remove("editor-comment-highlighted")}),Ie.value&&(Ie.value.classList.remove("editor-comment-highlighted"),Ie.value=null))},qt=a=>{if(!a||!a.element)return;Ut(!0);const l=a.element.getAttribute("data-comment")||a.element.getAttribute("data-fake-comment");if(!l)return;const r=`[data-comment="${l}"], [data-fake-comment="${l}"]`;K("comment-marker-clicked",{commentId:l,selector:r,element:a.element})},Sn=()=>{Ut()},Nn=()=>{!x.richText||!g.value||(kt.value&&kt.value.disconnect(),xt.value!==null&&(clearTimeout(xt.value),xt.value=null),kt.value=new MutationObserver(()=>{xt.value===null&&(xt.value=setTimeout(()=>{xt.value=null,e.nextTick(()=>{_e("MutationObserver")})},200))}),kt.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"]}),_e("setupCommentMarkersObserver-initial"))},Mn=(a,l)=>{if(!a||!l)return;const r=l.getBoundingClientRect();let i=r.top,c=r.right+4;a.style.top=`${i}px`,a.style.left=`${c}px`,a.offsetHeight;const p=a.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight;if(p.right>t){const o=r.left-p.width-4;a.style.left=`${o}px`}if(p.bottom>n){const o=Math.max(8,n-p.height-8);a.style.top=`${o}px`}p.top<0&&(a.style.top="8px")};return e.watch(()=>We.value,a=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(r=>{const i=r.getAttribute("data-submenu-id");if(i===a&&a){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);if(c){if(r.parentNode!==document.body){const p=r.parentNode;r.dataset.originalParentRef=p===c?"inside":"sibling",document.body.appendChild(r)}r.style.display="block",r.style.visibility="hidden",r.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Mn(r,c),r.offsetHeight,r.setAttribute("data-active","true"),r.style.visibility="visible",r.style.opacity="1"})})}else r.setAttribute("data-active","true")}else r.setAttribute("data-active","false"),r.style.display="none",r.style.top="",r.style.left="",r.style.visibility="",r.style.opacity=""})})}),e.watch(()=>[De.value,Le.value],()=>{De.value==="askAi"||Le.value==="askAi"?e.nextTick(()=>{xn()}):(We.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const r=l.getAttribute("data-submenu-id");if(r){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(i)if(l.dataset.originalParentRef==="inside")i.appendChild(l);else{const p=i.closest(".dss-toolbar-dropdown");p&&p.insertBefore(l,i.nextSibling)}}}})}))}),e.watch(()=>x.locale,a=>{a&&a!==vt.value&&(vt.value=a)},{immediate:!0}),Wt({openCommentOverlayForSelector:Ce,updateCommentMarkers:_e,restoreCommentsFromModel:Ge}),(a,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",Bn.value]),style:e.normalizeStyle(Hn.value)},[T.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",_s,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:It,title:e.unref(V)("textEditor.toolbar.undo")},[...l[45]||(l[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Fs),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!No.value}]),onClick:mn,title:e.unref(V)("textEditor.toolbar.redo")},[...l[46]||(l[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,zs),l[73]||(l[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Ps,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=r=>Uo("paragraph")),title:e.unref(V)("textEditor.toolbar.paragraphFormat")},[be.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Zs,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):be.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Us,[...l[48]||(l[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):be.value==="h3"?(e.openBlock(),e.createElementBlock("svg",qs,[...l[49]||(l[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):be.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Ws,[...l[50]||(l[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):be.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Xs,[...l[51]||(l[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):be.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Ys,[...l[52]||(l[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",js,[...l[53]||(l[53]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[54]||(l[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Os),De.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[1]||(l[1]=r=>bt("<h1>"))},[...l[55]||(l[55]=[e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1),e.createElementVNode("h1",null,"Heading 1",-1)])]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=r=>bt("<h2>"))},[...l[56]||(l[56]=[e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1),e.createElementVNode("h2",null,"Heading 2",-1)])]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=r=>bt("<h3>"))},[...l[57]||(l[57]=[e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1),e.createElementVNode("h3",null,"Heading 3",-1)])]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=r=>bt("<h4>"))},[...l[58]||(l[58]=[e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1),e.createElementVNode("h4",null,"Heading 4",-1)])]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=r=>bt("<h5>"))},[...l[59]||(l[59]=[e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1),e.createElementVNode("h5",null,"Heading 5",-1)])]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=r=>bt("<h6>"))},[...l[60]||(l[60]=[e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1),e.createElementVNode("h6",null,"Heading 6",-1)])]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=r=>bt("<p>"))},[...l[61]||(l[61]=[e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1),e.createElementVNode("p",null,"Paragraph",-1)])])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("bold")}]),onClick:l[9]||(l[9]=r=>_t("bold")),title:e.unref(V)("textEditor.toolbar.bold")},[...l[62]||(l[62]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Ks),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("italic")}]),onClick:l[10]||(l[10]=r=>_t("italic")),title:e.unref(V)("textEditor.toolbar.italic")},[...l[63]||(l[63]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Gs),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("underline")}]),onClick:l[11]||(l[11]=r=>_t("underline")),title:e.unref(V)("textEditor.toolbar.underline")},[...l[64]||(l[64]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Qs),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ro.value}]),onClick:pn,title:e.unref(V)("textEditor.toolbar.citation")},[...l[65]||(l[65]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Js),l[74]||(l[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ze.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Et,title:e.unref(V)("textEditor.toolbar.removeLink")},[...l[67]||(l[67]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,tr)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Do,title:e.unref(V)("textEditor.toolbar.insertLink")},[...l[66]||(l[66]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,er)),l[75]||(l[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("insertUnorderedList")}]),onClick:C,title:e.unref(V)("textEditor.toolbar.bulletList")},[...l[68]||(l[68]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,or),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("insertOrderedList")}]),onClick:Te,title:e.unref(V)("textEditor.toolbar.numberList")},[...l[69]||(l[69]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,nr),l[76]||(l[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Jo,title:e.unref(V)("textEditor.toolbar.image")},[...l[70]||(l[70]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,lr),yt.value?(e.openBlock(),e.createElementBlock("div",ar)):e.createCommentVNode("",!0),yt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(V)("textEditor.toolbar.comment"),onClick:vn},[...l[71]||(l[71]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,sr)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",rr)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",ir,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=r=>Uo("askAi")),title:e.unref(V)("textEditor.toolbar.askAi")},[l[72]||(l[72]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",dr,e.toDisplayString(e.unref(V)("textEditor.toolbar.askAi")),1)],8,cr),De.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[13]||(l[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.customToolbarSlots,(r,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$e(r)?(e.openBlock(),e.createElementBlock("div",mr,[e.renderSlot(a.$slots,r)])):e.createCommentVNode("",!0),$e(r)&&i<T.customToolbarSlots.length-1&&U(i)?(e.openBlock(),e.createElementBlock("div",pr)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(De.value==="paragraph"||De.value==="askAi")&&T.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:He})):e.createCommentVNode("",!0),e.createVNode(qn,{showModal:st.value,width:"500px",height:"55vh",onCloseModal:ao},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(V)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",fr,[e.createElementVNode("div",vr,[l[77]||(l[77]=e.createElementVNode("label",{class:"dss-link-modal-label"},"Alt text:",-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Vo,type:"text","onUpdate:modelValue":l[15]||(l[15]=r=>ne.value=r),class:"dss-link-modal-input",placeholder:"Enter alt text...",onKeyup:e.withKeys(Qo,["enter"])},null,544),[[e.vModelText,ne.value]])]),e.createElementVNode("div",gr,[e.createElementVNode("label",hr,e.toDisplayString(e.unref(V)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:rt,type:"text","onUpdate:modelValue":l[16]||(l[16]=r=>oe.value=r),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Qo,["enter"])},null,40,yr),[[e.vModelText,oe.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:ao},e.toDisplayString(e.unref(V)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Qo},e.toDisplayString(e.unref(V)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(qn,{showModal:go.value,width:"500px",height:"80vh",onCloseModal:so},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(G.value?e.unref(V)("textEditor.image.editImage"):e.unref(V)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Cr,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Pe.value==="upload"}]),onClick:l[17]||(l[17]=r=>Pe.value="upload")},e.toDisplayString(e.unref(V)("textEditor.image.upload")),3),l[78]||(l[78]=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":Pe.value==="url"}]),onClick:l[18]||(l[18]=r=>Pe.value="url")},e.toDisplayString(e.unref(V)("textEditor.image.imageLink")),3)]),Pe.value==="upload"?(e.openBlock(),e.createElementBlock("div",kr,[e.createElementVNode("div",xr,[e.createElementVNode("div",wr,[pe.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",br,e.toDisplayString(e.unref(V)("textEditor.image.uploadImage")),1)),pe.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Un},[e.createElementVNode("img",{src:it.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Er),l[79]||(l[79]=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:Je,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:en},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Je,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:en},null,544))]),e.createElementVNode("div",Vr,[e.createElementVNode("label",Sr,e.toDisplayString(e.unref(V)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Tt,type:"text","onUpdate:modelValue":l[19]||(l[19]=r=>Ue.value=r),class:"dss-link-modal-input",placeholder:"Enter alt text...",onKeyup:e.withKeys(nt,["enter"])},null,544),[[e.vModelText,Ue.value]])]),e.createElementVNode("div",Nr,[e.createElementVNode("label",Mr,e.toDisplayString(e.unref(V)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=r=>de.value=r),class:"dss-link-modal-input",placeholder:"Auto",onKeyup:e.withKeys(nt,["enter"])},null,544),[[e.vModelText,de.value]])]),e.createElementVNode("div",Br,[e.createElementVNode("label",Hr,e.toDisplayString(e.unref(V)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=r=>me.value=r),class:"dss-link-modal-input",placeholder:"Auto",onKeyup:e.withKeys(nt,["enter"])},null,544),[[e.vModelText,me.value]])])])])):e.createCommentVNode("",!0),Pe.value==="url"?(e.openBlock(),e.createElementBlock("div",Tr,[e.createElementVNode("div",Ar,[e.createElementVNode("div",Lr,[l[80]||(l[80]=e.createElementVNode("label",{class:"dss-link-modal-label"},"Image URL:",-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:ho,type:"text","onUpdate:modelValue":l[22]||(l[22]=r=>Lt.value=r),class:"dss-link-modal-input",placeholder:"https://example.com/image.jpg",onKeyup:e.withKeys(nt,["enter"])},null,544),[[e.vModelText,Lt.value]])]),e.createElementVNode("div",$r,[e.createElementVNode("label",Dr,e.toDisplayString(e.unref(V)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=r=>Ue.value=r),class:"dss-link-modal-input",placeholder:"Enter alt text...",onKeyup:e.withKeys(nt,["enter"])},null,544),[[e.vModelText,Ue.value]])]),e.createElementVNode("div",Ir,[e.createElementVNode("label",Rr,e.toDisplayString(e.unref(V)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=r=>de.value=r),class:"dss-link-modal-input",placeholder:"Auto",onKeyup:e.withKeys(nt,["enter"])},null,544),[[e.vModelText,de.value]])]),e.createElementVNode("div",_r,[e.createElementVNode("label",Fr,e.toDisplayString(e.unref(V)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=r=>me.value=r),class:"dss-link-modal-input",placeholder:"Auto",onKeyup:e.withKeys(nt,["enter"])},null,544),[[e.vModelText,me.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:so}," Cancel "),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:nt}," Save ")]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":D.value&&ht.value}])},[l[81]||(l[81]=e.createElementVNode("p",null," Title ",-1)),e.createElementVNode("div",zr,[ht.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Pr,[T.title?(e.openBlock(),e.createElementBlock("span",Or,e.toDisplayString(T.title),1)):(e.openBlock(),e.createElementBlock("span",Zr,e.toDisplayString($.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:te,value:T.title,onInput:$n,onFocus:Jt,onBlur:Ln,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!ht.value}]),placeholder:$.value,disabled:T.disabled,rows:"1"},null,42,Ur)])],2),D.value&&ht.value?(e.openBlock(),e.createElementBlock("div",qr,[e.renderSlot(a.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":ln.value&&tt.value}])},[l[82]||(l[82]=e.createElementVNode("p",null," Description ",-1)),e.createElementVNode("div",Wr,[tt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Xr,[T.description?(e.openBlock(),e.createElementBlock("span",Yr,e.toDisplayString(T.description),1)):(e.openBlock(),e.createElementBlock("span",jr,e.toDisplayString(Ho.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:le,value:T.description,onInput:dn,onFocus:cn,onBlur:Dn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!tt.value}]),placeholder:Ho.value,disabled:T.disabled,rows:"1"},null,42,Kr)])],2),ln.value&&tt.value?(e.openBlock(),e.createElementBlock("div",Gr,[e.renderSlot(a.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ct.value,r=>(e.openBlock(),e.createElementBlock("div",{key:r.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Q.value===r.id,"editor-comment-marker-group-out-of-view":r.opacity===0}]),"data-comment-id":r.id,style:e.normalizeStyle({top:r.top+"px"}),onMouseenter:i=>J(r),onMouseleave:Sn},[r.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>qt(r),["stop"])},[r.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.firstUser.avatar,alt:r.firstUser.name||"avatar"},null,8,ei)):(e.openBlock(),e.createElementBlock("span",ti,e.toDisplayString(r.firstUser.initials||(r.firstUser.name?r.firstUser.name.charAt(0):"")),1))],8,Jr)):e.createCommentVNode("",!0),r.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>qt(r),["stop"])},[r.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.secondUser.avatar,alt:r.secondUser.name||"avatar"},null,8,ni)):(e.openBlock(),e.createElementBlock("span",li,e.toDisplayString(r.secondUser.initials||(r.secondUser.name?r.secondUser.name.charAt(0):"")),1))],8,oi)):e.createCommentVNode("",!0),r.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:r.secondUser?"30px":"15px"}),"data-has-second-user":r.secondUser?"true":"false",onClick:e.withModifiers(i=>qt(r),["stop"])},[e.createElementVNode("span",si,"+"+e.toDisplayString(r.additionalCount),1)],12,ai)):e.createCommentVNode("",!0)],46,Qr))),128)),T.richText?(e.openBlock(),e.createElementBlock("div",pi,[e.createElementVNode("div",{ref_key:"editorRef",ref:g,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":T.disabled,"dss-text-editor-fixed-height":T.fixedHeight}]),style:e.normalizeStyle(on.value),onInput:ce,onBlur:un,onClick:wn,onMouseup:jo,onKeyup:jo,onKeydown:zn,onPaste:qo,onMousemove:Pn,onMouseleave:En},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Q.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(Ke.value)},[Y.value||Re.value.length>0?(e.openBlock(),e.createElementBlock("div",fi,[e.createElementVNode("div",vi,[Y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Y.value},null,8,gi)):e.createCommentVNode("",!0)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(r,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"dss-comment-message"},[r.user&&(r.user.avatar||r.user.initials||r.user.name)?(e.openBlock(),e.createElementBlock("div",hi,[e.createElementVNode("div",yi,[r.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.user.avatar,alt:r.user.name||"avatar"},null,8,Ci)):(e.openBlock(),e.createElementBlock("span",ki,e.toDisplayString(r.user.initials||(r.user.name?r.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",xi,[e.createElementVNode("div",wi,[e.createElementVNode("div",bi,e.toDisplayString(r.user&&r.user.name||"Comment"),1),r.createdAt?(e.openBlock(),e.createElementBlock("div",Ei,e.toDisplayString(sn(new Date(r.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":rn(r.text)||r.class==="comment-started"}])},e.toDisplayString(r.text||""),3)]),x.commentUser&&r.user&&r.user.id===x.commentUser.id&&!rn(r.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>St(r,i),["stop"]),title:e.unref(V)("textEditor.comment.delete")||"Delete comment"},[...l[84]||(l[84]=[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,Vi)):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Si,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:re,"onUpdate:modelValue":l[26]||(l[26]=r=>se.value=r),class:"dss-comment-input",rows:"1",placeholder:e.unref(V)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(gn,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(re.value){const r=re.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`}})},null,40,Ni),[[e.vModelText,se.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(gn,["stop"])},[...l[85]||(l[85]=[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",Mi,[e.createElementVNode("div",Bi,[e.createElementVNode("span",Hi,e.toDisplayString(Mo.value)+" "+e.toDisplayString(Mo.value===1?e.unref(V)("textEditor.footer.word"):e.unref(V)("textEditor.footer.words")),1),l[86]||(l[86]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Ti,e.toDisplayString(Bo.value)+" "+e.toDisplayString(Bo.value===1?e.unref(V)("textEditor.footer.character"):e.unref(V)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",ri,[e.createElementVNode("textarea",{value:T.modelValue,onInput:An,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":T.fixedHeight}]),placeholder:ue.value,rows:T.rows,disabled:T.disabled,style:e.normalizeStyle(Tn.value)},null,46,ii),e.createElementVNode("div",ci,[e.createElementVNode("div",di,[e.createElementVNode("span",ui,e.toDisplayString(Mo.value)+" "+e.toDisplayString(Mo.value===1?e.unref(V)("textEditor.footer.word"):e.unref(V)("textEditor.footer.words")),1),l[83]||(l[83]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",mi,e.toDisplayString(Bo.value)+" "+e.toDisplayString(Bo.value===1?e.unref(V)("textEditor.footer.character"):e.unref(V)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[M.value&&I.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(X.value),onMouseenter:l[28]||(l[28]=r=>W.value=!0),onMouseleave:xo},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(On,["stop"]),title:I.value},e.toDisplayString(I.value),9,Ai),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Zn,["stop"]),title:e.unref(V)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",$i,[...l[87]||(l[87]=[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,Li)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[yo.value&&io.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Yt.value),onMouseenter:l[29]||(l[29]=r=>jt.value=!0),onMouseleave:wo},[e.createElementVNode("div",Di,[io.value===e.unref(V)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Ii,[...l[88]||(l[88]=[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:io.value},e.toDisplayString(io.value),9,Ri)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ot,["stop"]),title:e.unref(V)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",Fi,[...l[89]||(l[89]=[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,_i)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.floatingToolbar&&T.richText&&xe.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:vo,class:"dss-floating-toolbar",style:e.normalizeStyle(Ae.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",zi,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(It,["stop"]),title:e.unref(V)("textEditor.toolbar.undo")},[...l[90]||(l[90]=[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,Pi),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!No.value}]),onClick:e.withModifiers(mn,["stop"]),title:e.unref(V)("textEditor.toolbar.redo")},[...l[91]||(l[91]=[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,Oi),l[111]||(l[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Zi,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(r=>Ko("paragraph"),["stop"])),title:e.unref(V)("textEditor.toolbar.paragraphFormat")},[be.value==="h1"?(e.openBlock(),e.createElementBlock("svg",qi,[...l[92]||(l[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"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)])])):be.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Wi,[...l[93]||(l[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"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)])])):be.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Xi,[...l[94]||(l[94]=[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)])])):be.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Yi,[...l[95]||(l[95]=[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)])])):be.value==="h5"?(e.openBlock(),e.createElementBlock("svg",ji,[...l[96]||(l[96]=[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)])])):be.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Ki,[...l[97]||(l[97]=[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",Gi,[...l[98]||(l[98]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[99]||(l[99]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Ui),Le.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[38]||(l[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[31]||(l[31]=r=>no("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=r=>no("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=r=>no("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=r=>no("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=r=>no("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=r=>no("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=r=>no("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[112]||(l[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(r=>_t("bold"),["stop"])),title:e.unref(V)("textEditor.toolbar.bold")},[...l[100]||(l[100]=[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,Qi),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(r=>_t("italic"),["stop"])),title:e.unref(V)("textEditor.toolbar.italic")},[...l[101]||(l[101]=[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,Ji),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(r=>_t("underline"),["stop"])),title:e.unref(V)("textEditor.toolbar.underline")},[...l[102]||(l[102]=[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,ec),l[113]||(l[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ro.value}]),onClick:e.withModifiers(pn,["stop"]),title:e.unref(V)("textEditor.toolbar.citation")},[...l[103]||(l[103]=[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,tc),l[114]||(l[114]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ze.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Et,["stop"]),title:e.unref(V)("textEditor.toolbar.removeLink")},[...l[105]||(l[105]=[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,nc)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Do,["stop"]),title:e.unref(V)("textEditor.toolbar.insertLink")},[...l[104]||(l[104]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,oc)),l[115]||(l[115]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("insertUnorderedList")}]),onClick:e.withModifiers(C,["stop"]),title:e.unref(V)("textEditor.toolbar.bulletList")},[...l[106]||(l[106]=[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,lc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("insertOrderedList")}]),onClick:e.withModifiers(Te,["stop"]),title:e.unref(V)("textEditor.toolbar.numberList")},[...l[107]||(l[107]=[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,ac),l[116]||(l[116]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Jo,["stop"]),title:e.unref(V)("textEditor.toolbar.image")},[...l[108]||(l[108]=[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,sc),l[117]||(l[117]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(V)("textEditor.toolbar.comment"),onClick:e.withModifiers(vn,["stop"])},[...l[109]||(l[109]=[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,rc),T.askAi?(e.openBlock(),e.createElementBlock("div",ic)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",cc,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(r=>Ko("askAi"),["stop"])),title:e.unref(V)("textEditor.toolbar.askAi")},[l[110]||(l[110]=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",uc,e.toDisplayString(e.unref(V)("textEditor.toolbar.askAi")),1)],8,dc),Le.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[43]||(l[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Ee.value?(e.openBlock(),e.createElementBlock("div",mc,[T.askAi&&Ee.value?(e.openBlock(),e.createElementBlock("div",pc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.customToolbarSlots,(r,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$e(r)&&w(r)?(e.openBlock(),e.createElementBlock("div",fc,[e.renderSlot(a.$slots,r)])):e.createCommentVNode("",!0),$e(r)&&w(r)&&i<T.customToolbarSlots.length-1&&ae(i)?(e.openBlock(),e.createElementBlock("div",vc)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),yc={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"}},Cc={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"},labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},jn={chart:yc,textEditor:Cc},kc={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"}},xc={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:"Titre 1",heading2:"Titre 2",heading3:"Titre 3",heading4:"Titre 4",heading5:"Titre 5",heading6:"Titre 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"},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"}},Kn={chart:kc,textEditor:xc},wc={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"}},bc={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"},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"}},Gn={chart:wc,textEditor:bc},Wn={en:jn,fr:Kn,nl:Gn};function Ec(T){if(!T||!T.global)return;const Wt=T.global.availableLocales||[];Object.keys(Wn).forEach(O=>{Wt.includes(O)&&T.global.mergeLocaleMessage(O,Wn[O])})}const Xn={en:{textEditor:jn.textEditor},fr:{textEditor:Kn.textEditor},nl:{textEditor:Gn.textEditor}};function Vc(T){if(!T||!T.global)return;const Wt=T.global.availableLocales||[];Object.keys(Xn).forEach(O=>{Wt.includes(O)&&T.global.mergeLocaleMessage(O,Xn[O])})}const Sc={en:{...jn},fr:{...Kn},nl:{...Gn}};Yn.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:Sc});exports.DSSChart=Ds;exports.DSSChartMessages=Wn;exports.DSSModal=qn;exports.DSSTextEditor=hc;exports.DSSTextEditorMessages=Xn;exports.addDSSChartTranslations=Ec;exports.addDSSTextEditorTranslations=Vc;
|
|
79
|
+
`){const s=document.createTextNode(" ");l.insertNode(s),l.setStartAfter(s)}}l.insertNode(p);const t=document.createTextNode(" ");l.setStartAfter(p),l.insertNode(t),l.setStartAfter(t),l.collapse(!0),a.removeAllRanges(),a.addRange(l)}}ce()}e.nextTick(()=>{qe(),ao()})},Jo=()=>{g.value&&(At.value=wt(),Ue.value="",it.value="",Lt.value="",de.value="",me.value="",So.value=null,G.value=null,Pe.value="upload",go.value=!0,He(),e.nextTick(()=>{Tt.value&&Tt.value.focus(),Je.value&&(Je.value.value="")}))},en=a=>{const l=a.target?.files?.[0];if(!l){So.value=null,it.value="";return}So.value=l;const r=new FileReader;r.onload=i=>{it.value=i.target?.result||""},r.readAsDataURL(l)},Un=()=>{Je.value&&Je.value.click()},Ot=()=>{let a=G.value;if(!a){const l=window.getSelection();if(l&&l.rangeCount>0){const i=l.getRangeAt(0).commonAncestorContainer;a=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(a){const l=a.getAttribute("data-alt")||a.getAttribute("alt")||"";G.value=a,Ue.value=l.trim()===""||l.trim()==="Image"?"":l;const r=a.getAttribute("src")||a.src||"";r.startsWith("http://")||r.startsWith("https://")?(Lt.value=r,it.value="",Pe.value="url"):(it.value=r,Lt.value="",Pe.value="upload");const c=a.style.width||a.getAttribute("width")||"",p=a.style.height||a.getAttribute("height")||"";de.value=c.endsWith("px")?c.replace("px",""):c,me.value=p.endsWith("px")?p.replace("px",""):p,At.value=null}else{Jo();return}go.value=!0,jt.value=!1,yo.value=!1,e.nextTick(()=>{Pe.value==="url"&&ho.value?(ho.value.focus(),ho.value.select()):Tt.value&&(Tt.value.focus(),Tt.value.select()),Je.value&&(Je.value.value="")})},so=()=>{go.value=!1,Ue.value="",it.value="",Lt.value="",de.value="",me.value="",So.value=null,G.value=null,At.value=null,Pe.value="upload"},nt=()=>{const a=(Ue.value||"").trim(),l=g.value?._mutationObserver;l&&l.disconnect(),ie.value?(Z.value&&(clearTimeout(Z.value),Z.value=null),Ve(),ie.value=!1):Ve();const r=Pe.value==="url"?Lt.value.trim():it.value;if(G.value&&g.value&&g.value.contains(G.value)){r&&(G.value.src=r),G.value.setAttribute("alt",a),G.value.setAttribute("data-alt",a),de.value?(G.value.style.width=`${de.value}px`,G.value.setAttribute("width",de.value)):(G.value.style.removeProperty("width"),G.value.removeAttribute("width")),me.value?(G.value.style.height=`${me.value}px`,G.value.setAttribute("height",me.value)):(G.value.style.removeProperty("height"),G.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(G.value),c.collapse(!0),i.addRange(c)}ce()}else{if(!r){l&&g.value&&l.observe(g.value,{childList:!0,subtree:!0}),so();return}if(g.value){g.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let p=null;if(At.value&&(Oe(At.value),c&&c.rangeCount>0&&(p=c.getRangeAt(0))),!p&&c&&c.rangeCount>0&&(p=c.getRangeAt(0)),!p&&g.value){if(p=document.createRange(),g.value.childNodes.length===0){const s=document.createElement("p");s.innerHTML="<br>",g.value.appendChild(s),p.setStart(s,0),p.collapse(!0)}else p.selectNodeContents(g.value),p.collapse(!1);c&&(c.removeAllRanges(),c.addRange(p))}if(!p){so();return}const t=p.commonAncestorContainer,n=t.nodeType===3?t.parentElement:t;if(!g.value.contains(n)){if(p=document.createRange(),g.value.childNodes.length===0){const s=document.createElement("p");s.innerHTML="<br>",g.value.appendChild(s),p.setStart(s,0),p.collapse(!0)}else p.selectNodeContents(g.value),p.collapse(!1);c&&(c.removeAllRanges(),c.addRange(p))}const o=document.createElement("img");o.src=r,o.setAttribute("alt",a),o.setAttribute("data-alt",a),de.value&&(o.style.width=`${de.value}px`,o.setAttribute("width",de.value)),me.value&&(o.style.height=`${me.value}px`,o.setAttribute("height",me.value));try{p.insertNode(o),p.setStartAfter(o),p.collapse(!0),c&&(c.removeAllRanges(),c.addRange(p))}catch{if(g.value){if(g.value.childNodes.length===0){const u=document.createElement("p");g.value.appendChild(u),u.appendChild(o)}else{const u=g.value.lastChild;if(u&&u.nodeType===1)u.appendChild(o);else{const m=document.createElement("p");g.value.appendChild(m),m.appendChild(o)}}const d=document.createRange();d.setStartAfter(o),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}}G.value=o,ce()}}e.nextTick(()=>{l&&g.value&&l.observe(g.value,{childList:!0,subtree:!0}),qe(),ke(),so()})};e.watch(()=>x.modelValue,a=>{if(x.richText&&g.value&&!Qe.value){const l=Qt(a||""),i=g.value.innerHTML.replace(/ |\u00A0/g," "),c=l.replace(/ |\u00A0/g," ");if(i!==c){const p=wt();g.value.innerHTML=l,e.nextTick(()=>{Zo();const t=g.value.innerHTML||"",n=x.title||"",o=x.description||"";Xe.value=t,dt.value=n,he.value=o,$t.value=t,Ye.value=n,et.value=o,ct.value=[],co.value=[],Z.value&&(clearTimeout(Z.value),Z.value=null),ie.value=!1,p&&Oe(p),Se(),ot(),_t(),qe(),ke(),Ft(),Re("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>x.richText,a=>{a?(ke(),e.nextTick(()=>{Nn()})):(po(),Ct.value=[],kt.value&&(kt.value.disconnect(),kt.value=null)),Ft()}),e.watch(()=>x.floatingToolbar,a=>{a?ke():po()}),e.watch(()=>x.disabled,a=>{a&&po(),Ft()}),e.watch(()=>x.description,()=>{e.nextTick(()=>{tt.value?ko():Oo()})}),e.watch(()=>x.title,()=>{e.nextTick(()=>{ht.value?Dt():Po()})}),e.watch(()=>x.customToolbarSlots,()=>{e.nextTick(()=>{to()})},{deep:!0}),e.watch(()=>x.comments,(a,l)=>{if(Io.value){Io.value=!1;return}uo.value||x.richText&&g.value&&e.nextTick(()=>{Ge()})},{deep:!0,immediate:!1});const Ge=()=>{if(!uo.value&&!(!x.comments||!Array.isArray(x.comments)||x.comments.length===0)&&!(!x.richText||!g.value)){uo.value=!0;try{const a=new Set,l=x.comments.filter(t=>{const n=String(t.conversation_id||t.id);return a.has(n)?!1:(a.add(n),!0)}),r=g.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=r.length;r.forEach(t=>{const n=t.parentNode;if(n){for(;t.firstChild;)n.insertBefore(t.firstChild,t);n.removeChild(t)}});let c=0;const p=new Set;l.forEach(t=>{if(!t.conversation_id||!t.selection_range)return;const n=typeof t.conversation_id=="string"&&t.conversation_id.startsWith("comment-")?null:Number(t.conversation_id)||t.conversation_id;if(!n)return;const o=String(n);if(p.has(o))return;const s=g.value.querySelector(`[data-comment="${o}"]`);if(s){Zt(s,t),p.add(o);return}try{const d=bo(t.selection_range,t.selection_text);if(d&&!d.collapsed){const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(m){const h=m.closest("[data-comment], [data-fake-comment]");if(h){const y=h.getAttribute("data-comment")||h.getAttribute("data-fake-comment");if(String(y)===String(n)){h.setAttribute("data-comment",o),h.removeAttribute("data-fake-comment"),Zt(h,t),p.add(o);return}else return}}const f=g.value.querySelector(`[data-comment="${o}"]`);if(f){Zt(f,t),p.add(o);return}const v=document.createElement("span");v.setAttribute("data-comment",o),Zt(v,t);try{d.surroundContents(v),c++,p.add(o)}catch{const y=d.extractContents();v.appendChild(y),d.insertNode(v),c++,p.add(o)}}}catch{}}),e.nextTick(()=>{Re("restoreCommentsFromModel"),ce(),uo.value=!1})}catch{uo.value=!1}}},bo=(a,l)=>{if(!a||!g.value)return null;try{const r=document.createRange();if(a.type==="text"&&typeof a.start=="number"&&typeof a.end=="number"){let i=0;const c=[g.value];let p=null,t=!1,n=!1;for(;!n&&(p=c.pop());)if(p.nodeType===3){const o=i+p.length;!t&&a.start>=i&&a.start<=o&&(r.setStart(p,a.start-i),t=!0),t&&a.end>=i&&a.end<=o&&(r.setEnd(p,a.end-i),n=!0),i=o}else{let o=p.childNodes.length;for(;o--;)c.push(p.childNodes[o])}return t?r:null}}catch{return null}return null},Zt=(a,l)=>{if(!a||!l)return;const r=l.conversation||[],i=new Set,c=[],p=n=>{n&&n.id&&!i.has(n.id)&&(i.add(n.id),c.push(n))};r.length>0&&r.forEach(n=>{n.user&&p(n.user)}),c.length>0?a.setAttribute("data-comment-user",JSON.stringify(c[0])):a.removeAttribute("data-comment-user"),c.length>1?a.setAttribute("data-comment-user-2",JSON.stringify(c[1])):a.removeAttribute("data-comment-user-2");const t=r.length;t>0?a.setAttribute("data-comment-count",String(t)):a.removeAttribute("data-comment-count")},Re=(a="unknown")=>{if(!x.richText||!g.value){Ct.value=[];return}Date.now()-zo.value<tn&&Kt.value!==null||Kt.value===null&&(Kt.value=requestAnimationFrame(()=>{if(Kt.value=null,zo.value=Date.now(),Co.value)return;Co.value=!0;const r={},i=g.value;if(!i){Co.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Co.value=!1;return}const p=i.querySelectorAll("[data-comment], [data-fake-comment]"),t=[],n=new Set;p.forEach(m=>{const f=m.getAttribute("data-comment")||m.getAttribute("data-fake-comment");f&&m.tagName==="SPAN"&&(n.has(f)||(t.push(m),n.add(f)))}),p.forEach(m=>{const f=m.getAttribute("data-comment")||m.getAttribute("data-fake-comment");!f||n.has(f)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(m.tagName)?m.querySelector(`span[data-comment="${f}"], span[data-fake-comment="${f}"]`)||(t.push(m),n.add(f)):m.tagName!=="SPAN"&&(t.push(m),n.add(f)))});const o=c.getBoundingClientRect(),s=i.getBoundingClientRect();t.forEach((m,f)=>{let v=m.getAttribute("data-comment")||m.getAttribute("data-fake-comment");if(!v)return;if(typeof v=="string"&&v.startsWith("comment-")){const ft=m.textContent?.trim(),Mt=x.comments?.find(at=>(typeof at.conversation_id=="string"&&at.conversation_id.startsWith("comment-")?null:at.conversation_id)&&at.selection_text?.trim()===ft);Mt?(v=String(Mt.conversation_id),m.setAttribute("data-comment",v),m.removeAttribute("data-fake-comment")):(v=String(Date.now()),m.setAttribute("data-comment",v),m.removeAttribute("data-fake-comment"))}const h=m.getBoundingClientRect(),y=window.getComputedStyle(m),k=parseFloat(y.lineHeight)||parseFloat(y.fontSize)*1.2,R=h.top-s.top+k/2-15,A=s.top-o.top+R;let H=null,E=null,z=0;const B=[],L=new Set;if(v&&x.comments){const ft=x.comments.find(Mt=>String(Mt.conversation_id||Mt.id)===String(v));if(ft){const Mt=ft.conversation||[];Mt.length>0?(Mt.forEach(at=>{at.user&&at.user.id&&!L.has(at.user.id)&&(L.add(at.user.id),B.push(at.user))}),z=Mt.length):(z=0,H=null,E=null),B.length>0?H=B[0]:H=null,B.length>1?E=B[1]:E=null}}const P=h.top+k/2-15,F=P+30,j=5,Fe=F>s.top+j&&P<s.bottom-j?1:0;Ct.value.find(ft=>ft.id===v);let ge=m;if(!ge&&v&&g.value){const ft=String(v);ge=g.value.querySelector(`[data-comment="${ft}"], [data-fake-comment="${ft}"]`)}const lt=B.length;r[v]?(r[v].top=A,r[v].opacity=Fe,r[v].element=ge,r[v].firstUser=H,r[v].secondUser=E,r[v].totalCount=z,r[v].uniqueUserCount=lt):r[v]={id:v,top:A,opacity:Fe,element:ge,firstUser:H,secondUser:E,totalCount:z,uniqueUserCount:lt}});const d=Object.values(r).map(m=>{const f=Math.max(0,(m.uniqueUserCount??0)-2);if(!m.element&&m.id&&g.value){const h=String(m.id);m.element=g.value.querySelector(`[data-comment="${h}"], [data-fake-comment="${h}"]`)}return{...m,firstUser:m.firstUser||null,secondUser:m.secondUser||null,totalCount:m.totalCount,additionalCount:f}});(Ct.value.length!==d.length||d.some((m,f)=>{const v=Ct.value[f];if(!v)return!0;const h=(v.firstUser?.id||null)!==(m.firstUser?.id||null),y=(v.secondUser?.id||null)!==(m.secondUser?.id||null);return v.id!==m.id||Math.abs(v.top-m.top)>1||v.opacity!==m.opacity||v.totalCount!==m.totalCount||v.additionalCount!==m.additionalCount||h||y||v.element!==m.element}))&&(Ct.value=d),Co.value=!1}))},J=a=>{if(!a)return;let l=a.element;if(!l&&a.id&&g.value){const r=String(a.id);l=g.value.querySelector(`[data-comment="${r}"], [data-fake-comment="${r}"]`)}l&&(Ut(),Ie.value=l,l.classList.add("editor-comment-highlighted"))},Ut=(a=!1)=>{!a&&Q.value!==null&&Ie.value&&(Ie.value.getAttribute("data-comment")||Ie.value.getAttribute("data-fake-comment"))===Q.value||(g.value&&g.value.querySelectorAll(".editor-comment-highlighted").forEach(r=>{r.classList.remove("editor-comment-highlighted")}),Ie.value&&(Ie.value.classList.remove("editor-comment-highlighted"),Ie.value=null))},qt=a=>{if(!a||!a.element)return;Ut(!0);const l=a.element.getAttribute("data-comment")||a.element.getAttribute("data-fake-comment");if(!l)return;const r=`[data-comment="${l}"], [data-fake-comment="${l}"]`;K("comment-marker-clicked",{commentId:l,selector:r,element:a.element})},Sn=()=>{Ut()},Nn=()=>{!x.richText||!g.value||(kt.value&&kt.value.disconnect(),xt.value!==null&&(clearTimeout(xt.value),xt.value=null),kt.value=new MutationObserver(()=>{xt.value===null&&(xt.value=setTimeout(()=>{xt.value=null,e.nextTick(()=>{Re("MutationObserver")})},200))}),kt.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"]}),Re("setupCommentMarkersObserver-initial"))},Mn=(a,l)=>{if(!a||!l)return;const r=l.getBoundingClientRect();let i=r.top,c=r.right+4;a.style.top=`${i}px`,a.style.left=`${c}px`,a.offsetHeight;const p=a.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight;if(p.right>t){const o=r.left-p.width-4;a.style.left=`${o}px`}if(p.bottom>n){const o=Math.max(8,n-p.height-8);a.style.top=`${o}px`}p.top<0&&(a.style.top="8px")};return e.watch(()=>We.value,a=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(r=>{const i=r.getAttribute("data-submenu-id");if(i===a&&a){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);if(c){if(r.parentNode!==document.body){const p=r.parentNode;r.dataset.originalParentRef=p===c?"inside":"sibling",document.body.appendChild(r)}r.style.display="block",r.style.visibility="hidden",r.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Mn(r,c),r.offsetHeight,r.setAttribute("data-active","true"),r.style.visibility="visible",r.style.opacity="1"})})}else r.setAttribute("data-active","true")}else r.setAttribute("data-active","false"),r.style.display="none",r.style.top="",r.style.left="",r.style.visibility="",r.style.opacity=""})})}),e.watch(()=>[De.value,Le.value],()=>{De.value==="askAi"||Le.value==="askAi"?e.nextTick(()=>{xn()}):(We.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const r=l.getAttribute("data-submenu-id");if(r){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(i)if(l.dataset.originalParentRef==="inside")i.appendChild(l);else{const p=i.closest(".dss-toolbar-dropdown");p&&p.insertBefore(l,i.nextSibling)}}}})}))}),e.watch(()=>x.locale,a=>{a&&a!==vt.value&&(vt.value=a)},{immediate:!0}),Wt({openCommentOverlayForSelector:Ce,updateCommentMarkers:Re,restoreCommentsFromModel:Ge}),(a,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",Bn.value]),style:e.normalizeStyle(Hn.value)},[T.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Rs,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:It,title:e.unref(w)("textEditor.toolbar.undo")},[...l[45]||(l[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Fs),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!No.value}]),onClick:mn,title:e.unref(w)("textEditor.toolbar.redo")},[...l[46]||(l[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,zs),l[73]||(l[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Ps,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=r=>Uo("paragraph")),title:e.unref(w)("textEditor.toolbar.paragraphFormat")},[be.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Zs,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):be.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Us,[...l[48]||(l[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):be.value==="h3"?(e.openBlock(),e.createElementBlock("svg",qs,[...l[49]||(l[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):be.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Ws,[...l[50]||(l[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):be.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Xs,[...l[51]||(l[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):be.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Ys,[...l[52]||(l[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",js,[...l[53]||(l[53]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[54]||(l[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Os),De.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[1]||(l[1]=r=>bt("<h1>"))},[l[55]||(l[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(w)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=r=>bt("<h2>"))},[l[56]||(l[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(w)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=r=>bt("<h3>"))},[l[57]||(l[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(w)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=r=>bt("<h4>"))},[l[58]||(l[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(w)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=r=>bt("<h5>"))},[l[59]||(l[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(w)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=r=>bt("<h6>"))},[l[60]||(l[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(w)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=r=>bt("<p>"))},[l[61]||(l[61]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(w)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("bold")}]),onClick:l[9]||(l[9]=r=>Rt("bold")),title:e.unref(w)("textEditor.toolbar.bold")},[...l[62]||(l[62]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Ks),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("italic")}]),onClick:l[10]||(l[10]=r=>Rt("italic")),title:e.unref(w)("textEditor.toolbar.italic")},[...l[63]||(l[63]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Gs),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("underline")}]),onClick:l[11]||(l[11]=r=>Rt("underline")),title:e.unref(w)("textEditor.toolbar.underline")},[...l[64]||(l[64]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Qs),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ro.value}]),onClick:pn,title:e.unref(w)("textEditor.toolbar.citation")},[...l[65]||(l[65]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Js),l[74]||(l[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ze.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Et,title:e.unref(w)("textEditor.toolbar.removeLink")},[...l[67]||(l[67]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,tr)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Do,title:e.unref(w)("textEditor.toolbar.insertLink")},[...l[66]||(l[66]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,er)),l[75]||(l[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("insertUnorderedList")}]),onClick:C,title:e.unref(w)("textEditor.toolbar.bulletList")},[...l[68]||(l[68]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,or),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("insertOrderedList")}]),onClick:Te,title:e.unref(w)("textEditor.toolbar.numberList")},[...l[69]||(l[69]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,nr),l[76]||(l[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Jo,title:e.unref(w)("textEditor.toolbar.image")},[...l[70]||(l[70]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,lr),yt.value?(e.openBlock(),e.createElementBlock("div",ar)):e.createCommentVNode("",!0),yt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(w)("textEditor.toolbar.comment"),onClick:vn},[...l[71]||(l[71]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,sr)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",rr)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",ir,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=r=>Uo("askAi")),title:e.unref(w)("textEditor.toolbar.askAi")},[l[72]||(l[72]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",dr,e.toDisplayString(e.unref(w)("textEditor.toolbar.askAi")),1)],8,cr),De.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[13]||(l[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.customToolbarSlots,(r,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$e(r)?(e.openBlock(),e.createElementBlock("div",mr,[e.renderSlot(a.$slots,r)])):e.createCommentVNode("",!0),$e(r)&&i<T.customToolbarSlots.length-1&&U(i)?(e.openBlock(),e.createElementBlock("div",pr)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(De.value==="paragraph"||De.value==="askAi")&&T.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:He})):e.createCommentVNode("",!0),e.createVNode(qn,{showModal:st.value,width:"500px",height:"55vh",onCloseModal:ao},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(w)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",fr,[e.createElementVNode("div",vr,[e.createElementVNode("label",gr,e.toDisplayString(e.unref(w)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Vo,type:"text","onUpdate:modelValue":l[15]||(l[15]=r=>ne.value=r),class:"dss-link-modal-input",placeholder:e.unref(w)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Qo,["enter"])},null,40,hr),[[e.vModelText,ne.value]])]),e.createElementVNode("div",yr,[e.createElementVNode("label",Cr,e.toDisplayString(e.unref(w)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:rt,type:"text","onUpdate:modelValue":l[16]||(l[16]=r=>oe.value=r),class:"dss-link-modal-input",placeholder:e.unref(w)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Qo,["enter"])},null,40,kr),[[e.vModelText,oe.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:ao},e.toDisplayString(e.unref(w)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Qo},e.toDisplayString(e.unref(w)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(qn,{showModal:go.value,width:"500px",height:"80vh",onCloseModal:so},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(G.value?e.unref(w)("textEditor.image.editImage"):e.unref(w)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",xr,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Pe.value==="upload"}]),onClick:l[17]||(l[17]=r=>Pe.value="upload")},e.toDisplayString(e.unref(w)("textEditor.image.upload")),3),l[77]||(l[77]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Pe.value==="url"}]),onClick:l[18]||(l[18]=r=>Pe.value="url")},e.toDisplayString(e.unref(w)("textEditor.image.imageLink")),3)]),Pe.value==="upload"?(e.openBlock(),e.createElementBlock("div",wr,[e.createElementVNode("div",br,[e.createElementVNode("div",Er,[pe.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Vr,e.toDisplayString(e.unref(w)("textEditor.image.uploadImage")),1)),pe.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Un},[e.createElementVNode("img",{src:it.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Sr),l[78]||(l[78]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:Je,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:en},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Je,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:en},null,544))]),e.createElementVNode("div",Nr,[e.createElementVNode("label",Mr,e.toDisplayString(e.unref(w)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Tt,type:"text","onUpdate:modelValue":l[19]||(l[19]=r=>Ue.value=r),class:"dss-link-modal-input",placeholder:e.unref(w)("textEditor.image.enterAltText"),onKeyup:e.withKeys(nt,["enter"])},null,40,Br),[[e.vModelText,Ue.value]])]),e.createElementVNode("div",Hr,[e.createElementVNode("label",Tr,e.toDisplayString(e.unref(w)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=r=>de.value=r),class:"dss-link-modal-input",placeholder:e.unref(w)("textEditor.image.auto"),onKeyup:e.withKeys(nt,["enter"])},null,40,Ar),[[e.vModelText,de.value]])]),e.createElementVNode("div",Lr,[e.createElementVNode("label",$r,e.toDisplayString(e.unref(w)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=r=>me.value=r),class:"dss-link-modal-input",placeholder:e.unref(w)("textEditor.image.auto"),onKeyup:e.withKeys(nt,["enter"])},null,40,Dr),[[e.vModelText,me.value]])])])])):e.createCommentVNode("",!0),Pe.value==="url"?(e.openBlock(),e.createElementBlock("div",Ir,[e.createElementVNode("div",_r,[e.createElementVNode("div",Rr,[e.createElementVNode("label",Fr,e.toDisplayString(e.unref(w)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:ho,type:"text","onUpdate:modelValue":l[22]||(l[22]=r=>Lt.value=r),class:"dss-link-modal-input",placeholder:e.unref(w)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(nt,["enter"])},null,40,zr),[[e.vModelText,Lt.value]])]),e.createElementVNode("div",Pr,[e.createElementVNode("label",Or,e.toDisplayString(e.unref(w)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=r=>Ue.value=r),class:"dss-link-modal-input",placeholder:e.unref(w)("textEditor.image.enterAltText"),onKeyup:e.withKeys(nt,["enter"])},null,40,Zr),[[e.vModelText,Ue.value]])]),e.createElementVNode("div",Ur,[e.createElementVNode("label",qr,e.toDisplayString(e.unref(w)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=r=>de.value=r),class:"dss-link-modal-input",placeholder:e.unref(w)("textEditor.image.auto"),onKeyup:e.withKeys(nt,["enter"])},null,40,Wr),[[e.vModelText,de.value]])]),e.createElementVNode("div",Xr,[e.createElementVNode("label",Yr,e.toDisplayString(e.unref(w)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=r=>me.value=r),class:"dss-link-modal-input",placeholder:e.unref(w)("textEditor.image.auto"),onKeyup:e.withKeys(nt,["enter"])},null,40,jr),[[e.vModelText,me.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:so},e.toDisplayString(e.unref(w)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:nt},e.toDisplayString(e.unref(w)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":D.value&&ht.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(w)("textEditor.labels.title")),1),e.createElementVNode("div",Kr,[ht.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Gr,[T.title?(e.openBlock(),e.createElementBlock("span",Qr,e.toDisplayString(T.title),1)):(e.openBlock(),e.createElementBlock("span",Jr,e.toDisplayString($.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:te,value:T.title,onInput:$n,onFocus:Jt,onBlur:Ln,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!ht.value}]),placeholder:$.value,disabled:T.disabled,rows:"1"},null,42,ei)])],2),D.value&&ht.value?(e.openBlock(),e.createElementBlock("div",ti,[e.renderSlot(a.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":ln.value&&tt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(w)("textEditor.labels.description")),1),e.createElementVNode("div",oi,[tt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ni,[T.description?(e.openBlock(),e.createElementBlock("span",li,e.toDisplayString(T.description),1)):(e.openBlock(),e.createElementBlock("span",ai,e.toDisplayString(Ho.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:le,value:T.description,onInput:dn,onFocus:cn,onBlur:Dn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!tt.value}]),placeholder:Ho.value,disabled:T.disabled,rows:"1"},null,42,si)])],2),ln.value&&tt.value?(e.openBlock(),e.createElementBlock("div",ri,[e.renderSlot(a.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ct.value,r=>(e.openBlock(),e.createElementBlock("div",{key:r.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Q.value===r.id,"editor-comment-marker-group-out-of-view":r.opacity===0}]),"data-comment-id":r.id,style:e.normalizeStyle({top:r.top+"px"}),onMouseenter:i=>J(r),onMouseleave:Sn},[r.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>qt(r),["stop"])},[r.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.firstUser.avatar,alt:r.firstUser.name||"avatar"},null,8,di)):(e.openBlock(),e.createElementBlock("span",ui,e.toDisplayString(r.firstUser.initials||(r.firstUser.name?r.firstUser.name.charAt(0):"")),1))],8,ci)):e.createCommentVNode("",!0),r.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>qt(r),["stop"])},[r.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.secondUser.avatar,alt:r.secondUser.name||"avatar"},null,8,pi)):(e.openBlock(),e.createElementBlock("span",fi,e.toDisplayString(r.secondUser.initials||(r.secondUser.name?r.secondUser.name.charAt(0):"")),1))],8,mi)):e.createCommentVNode("",!0),r.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:r.secondUser?"30px":"15px"}),"data-has-second-user":r.secondUser?"true":"false",onClick:e.withModifiers(i=>qt(r),["stop"])},[e.createElementVNode("span",gi,"+"+e.toDisplayString(r.additionalCount),1)],12,vi)):e.createCommentVNode("",!0)],46,ii))),128)),T.richText?(e.openBlock(),e.createElementBlock("div",bi,[e.createElementVNode("div",{ref_key:"editorRef",ref:g,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":T.disabled,"dss-text-editor-fixed-height":T.fixedHeight}]),style:e.normalizeStyle(on.value),onInput:ce,onBlur:un,onClick:wn,onMouseup:jo,onKeyup:jo,onKeydown:zn,onPaste:qo,onMousemove:Pn,onMouseleave:En},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Q.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(Ke.value)},[Y.value||_e.value.length>0?(e.openBlock(),e.createElementBlock("div",Ei,[e.createElementVNode("div",Vi,[Y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Y.value},null,8,Si)):e.createCommentVNode("",!0)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,(r,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"dss-comment-message"},[r.user&&(r.user.avatar||r.user.initials||r.user.name)?(e.openBlock(),e.createElementBlock("div",Ni,[e.createElementVNode("div",Mi,[r.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.user.avatar,alt:r.user.name||"avatar"},null,8,Bi)):(e.openBlock(),e.createElementBlock("span",Hi,e.toDisplayString(r.user.initials||(r.user.name?r.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ti,[e.createElementVNode("div",Ai,[e.createElementVNode("div",Li,e.toDisplayString(r.user&&r.user.name||"Comment"),1),r.createdAt?(e.openBlock(),e.createElementBlock("div",$i,e.toDisplayString(sn(new Date(r.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":rn(r.text)||r.class==="comment-started"}])},e.toDisplayString(r.text||""),3)]),x.commentUser&&r.user&&r.user.id===x.commentUser.id&&!rn(r.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>St(r,i),["stop"]),title:e.unref(w)("textEditor.comment.delete")||"Delete comment"},[...l[80]||(l[80]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,Di)):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ii,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:re,"onUpdate:modelValue":l[26]||(l[26]=r=>se.value=r),class:"dss-comment-input",rows:"1",placeholder:e.unref(w)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(gn,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(re.value){const r=re.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`}})},null,40,_i),[[e.vModelText,se.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(gn,["stop"])},[...l[81]||(l[81]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Ri,[e.createElementVNode("div",Fi,[e.createElementVNode("span",zi,e.toDisplayString(Mo.value)+" "+e.toDisplayString(Mo.value===1?e.unref(w)("textEditor.footer.word"):e.unref(w)("textEditor.footer.words")),1),l[82]||(l[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Pi,e.toDisplayString(Bo.value)+" "+e.toDisplayString(Bo.value===1?e.unref(w)("textEditor.footer.character"):e.unref(w)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",hi,[e.createElementVNode("textarea",{value:T.modelValue,onInput:An,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":T.fixedHeight}]),placeholder:ue.value,rows:T.rows,disabled:T.disabled,style:e.normalizeStyle(Tn.value)},null,46,yi),e.createElementVNode("div",Ci,[e.createElementVNode("div",ki,[e.createElementVNode("span",xi,e.toDisplayString(Mo.value)+" "+e.toDisplayString(Mo.value===1?e.unref(w)("textEditor.footer.word"):e.unref(w)("textEditor.footer.words")),1),l[79]||(l[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",wi,e.toDisplayString(Bo.value)+" "+e.toDisplayString(Bo.value===1?e.unref(w)("textEditor.footer.character"):e.unref(w)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[M.value&&I.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(X.value),onMouseenter:l[28]||(l[28]=r=>W.value=!0),onMouseleave:xo},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(On,["stop"]),title:I.value},e.toDisplayString(I.value),9,Oi),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Zn,["stop"]),title:e.unref(w)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Ui,[...l[83]||(l[83]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Zi)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[yo.value&&io.value&&g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Yt.value),onMouseenter:l[29]||(l[29]=r=>jt.value=!0),onMouseleave:wo},[e.createElementVNode("div",qi,[io.value===e.unref(w)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Wi,[...l[84]||(l[84]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:io.value},e.toDisplayString(io.value),9,Xi)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ot,["stop"]),title:e.unref(w)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",ji,[...l[85]||(l[85]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Yi)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.floatingToolbar&&T.richText&&xe.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:vo,class:"dss-floating-toolbar",style:e.normalizeStyle(Ae.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Ki,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(It,["stop"]),title:e.unref(w)("textEditor.toolbar.undo")},[...l[86]||(l[86]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Gi),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!No.value}]),onClick:e.withModifiers(mn,["stop"]),title:e.unref(w)("textEditor.toolbar.redo")},[...l[87]||(l[87]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Qi),l[107]||(l[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Ji,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(r=>Ko("paragraph"),["stop"])),title:e.unref(w)("textEditor.toolbar.paragraphFormat")},[be.value==="h1"?(e.openBlock(),e.createElementBlock("svg",tc,[...l[88]||(l[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):be.value==="h2"?(e.openBlock(),e.createElementBlock("svg",oc,[...l[89]||(l[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):be.value==="h3"?(e.openBlock(),e.createElementBlock("svg",nc,[...l[90]||(l[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):be.value==="h4"?(e.openBlock(),e.createElementBlock("svg",lc,[...l[91]||(l[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):be.value==="h5"?(e.openBlock(),e.createElementBlock("svg",ac,[...l[92]||(l[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):be.value==="h6"?(e.openBlock(),e.createElementBlock("svg",sc,[...l[93]||(l[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",rc,[...l[94]||(l[94]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[95]||(l[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,ec),Le.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[38]||(l[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[31]||(l[31]=r=>no("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(w)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=r=>no("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(w)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=r=>no("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(w)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=r=>no("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(w)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=r=>no("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(w)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=r=>no("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(w)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=r=>no("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(w)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[108]||(l[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(r=>Rt("bold"),["stop"])),title:e.unref(w)("textEditor.toolbar.bold")},[...l[96]||(l[96]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,ic),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(r=>Rt("italic"),["stop"])),title:e.unref(w)("textEditor.toolbar.italic")},[...l[97]||(l[97]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,cc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(r=>Rt("underline"),["stop"])),title:e.unref(w)("textEditor.toolbar.underline")},[...l[98]||(l[98]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,dc),l[109]||(l[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ro.value}]),onClick:e.withModifiers(pn,["stop"]),title:e.unref(w)("textEditor.toolbar.citation")},[...l[99]||(l[99]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,uc),l[110]||(l[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ze.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Et,["stop"]),title:e.unref(w)("textEditor.toolbar.removeLink")},[...l[101]||(l[101]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,pc)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Do,["stop"]),title:e.unref(w)("textEditor.toolbar.insertLink")},[...l[100]||(l[100]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,mc)),l[111]||(l[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("insertUnorderedList")}]),onClick:e.withModifiers(C,["stop"]),title:e.unref(w)("textEditor.toolbar.bulletList")},[...l[102]||(l[102]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,fc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ze("insertOrderedList")}]),onClick:e.withModifiers(Te,["stop"]),title:e.unref(w)("textEditor.toolbar.numberList")},[...l[103]||(l[103]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,vc),l[112]||(l[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Jo,["stop"]),title:e.unref(w)("textEditor.toolbar.image")},[...l[104]||(l[104]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,gc),l[113]||(l[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(w)("textEditor.toolbar.comment"),onClick:e.withModifiers(vn,["stop"])},[...l[105]||(l[105]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,hc),T.askAi?(e.openBlock(),e.createElementBlock("div",yc)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",Cc,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(r=>Ko("askAi"),["stop"])),title:e.unref(w)("textEditor.toolbar.askAi")},[l[106]||(l[106]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",xc,e.toDisplayString(e.unref(w)("textEditor.toolbar.askAi")),1)],8,kc),Le.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[43]||(l[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Ee.value?(e.openBlock(),e.createElementBlock("div",wc,[T.askAi&&Ee.value?(e.openBlock(),e.createElementBlock("div",bc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.customToolbarSlots,(r,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$e(r)&&b(r)?(e.openBlock(),e.createElementBlock("div",Ec,[e.renderSlot(a.$slots,r)])):e.createCommentVNode("",!0),$e(r)&&b(r)&&i<T.customToolbarSlots.length-1&&ae(i)?(e.openBlock(),e.createElementBlock("div",Vc)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Mc={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"}},Bc={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"}},jn={chart:Mc,textEditor:Bc},Hc={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"}},Tc={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"}},Kn={chart:Hc,textEditor:Tc},Ac={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"}},Lc={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"}},Gn={chart:Ac,textEditor:Lc},Wn={en:jn,fr:Kn,nl:Gn};function $c(T){if(!T||!T.global)return;const Wt=T.global.availableLocales||[];Object.keys(Wn).forEach(O=>{Wt.includes(O)&&T.global.mergeLocaleMessage(O,Wn[O])})}const Xn={en:{textEditor:jn.textEditor},fr:{textEditor:Kn.textEditor},nl:{textEditor:Gn.textEditor}};function Dc(T){if(!T||!T.global)return;const Wt=T.global.availableLocales||[];Object.keys(Xn).forEach(O=>{Wt.includes(O)&&T.global.mergeLocaleMessage(O,Xn[O])})}const Ic={en:{...jn},fr:{...Kn},nl:{...Gn}};Yn.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:Ic});exports.DSSChart=Ds;exports.DSSChartMessages=Wn;exports.DSSModal=qn;exports.DSSTextEditor=Nc;exports.DSSTextEditorMessages=Xn;exports.addDSSChartTranslations=$c;exports.addDSSTextEditorTranslations=Dc;
|