dsp-semactic 0.6.11 → 0.6.13
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/dsp-semactic.css +1 -1
- package/dist/index.cjs.js +9 -9
- package/dist/index.es.js +364 -364
- 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"),cl=require("vue-i18n"),Gl=["data-chart-type"],Ql={class:"dss-chart-header-titles"},Jl={key:0,class:"dss-chart-title"},ea={key:1,class:"dss-chart-subtitle"},ta=["onClick","onMouseenter"],na={class:"dss-legend-text"},oa=["onClick","onMouseenter"],la={class:"dss-legend-text"},aa=["title"],sa=["src"],ra={class:"dss-chart-area-wrapper"},ia={key:0,class:"dss-chart-z-axis-label"},ca=["width","height","data-smooth","data-animated"],da={id:"chart-clip"},ua=["x","y","width","height"],ma=["id"],pa=["d"],va=["id"],fa=["d"],ga={key:0},ha={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},ya=["x1","x2","y1","y2"],ka={class:"dss-axes"},Ca=["x1","x2","y1","y2"],ba=["x1","x2","y1","y2"],wa={class:"dss-axis-labels"},xa=["x","y"],Ea=["x","y"],Va=["x","y"],Sa=["y","transform"],Na={key:1,class:"dss-flag-markers"},Ba={"clip-path":"url(#chart-clip)"},Ma=["x1","x2","y1","y2","onMouseover"],_a=["x1","x2","y1","y2","onMouseover"],Ta=["x1","x2","y1","y2","onMouseover"],$a=["cx","cy","onMouseover"],La=["cx","cy","fill","onMouseover"],Ha=["x","y"],Aa={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Da={key:0},Ra=["d","onMouseover"],Ia=["x","y","width","height","fill","onMouseover"],Fa={class:"dss-line-chart"},za=["d","stroke","stroke-width"],Pa=["d","stroke","stroke-width","opacity"],Oa=["cx","cy","r","fill","onMouseover"],Wa={key:1},Za=["d","stroke","stroke-width"],qa=["d","stroke","stroke-width"],Ua=["d","stroke","stroke-width","opacity"],Xa=["cx","cy","r","fill","onMouseover"],Ya={key:2},ja=["id"],Ka=["x","y","width","height"],Ga=["d","fill","fill-opacity","mask"],Qa=["d","stroke","stroke-width"],Ja=["d","fill","onMouseover"],es=["x","y","width","height","onMouseover"],ts={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},ns=["x1","x2","y1","y2","stroke"],os=["cx","cy","r","fill"],ls={key:1,class:"dss-bubble-chart"},as={key:0,class:"dss-bubble-group"},ss=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],rs=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],is=["transform"],cs=["cx","cy","r"],ds=["data-chart-type","clip-path"],us=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],ms={key:1,class:"dss-radial-segment-data-labels"},ps=["x","y"],vs=["x","y","font-size","fill"],fs=["x1","y1","x2","y2","stroke"],gs=["x1","y1","x2","y2","stroke"],hs=["x","y","text-anchor","font-size"],ys=["transform"],ks={key:0,class:"dss-spider-grid"},Cs=["cx","cy","r"],bs={class:"dss-spider-grid-labels"},ws=["x","y"],xs=["x","y"],Es=["x1","x2","y1","y2"],Vs={class:"dss-spider-labels"},Ss=["x","y","text-anchor","dominant-baseline"],Ns=["points","fill","fill-opacity","stroke","stroke-width"],Bs=["cx","cy","r","fill","onMouseover"],Ms={class:"dss-chart-logos"},_s=["cx","cy","r","fill"],Ts=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],$s=["onClick","onMouseenter"],Ls=["src"],Hs={class:"dss-marker-tooltip-category"},As={key:0,class:"dss-marker-tooltip-description"},Ds={key:0,class:"dss-tooltip-section"},Rs={key:0,class:"dss-tooltip-title"},Is={class:"dss-tooltip-series-name"},Fs={class:"dss-tooltip-series-value"},zs={key:1,class:"dss-tooltip-section"},Ps={key:0,class:"dss-tooltip-title"},Os={class:"dss-bubble-tooltip-data"},Ws={key:2,class:"dss-tooltip-section"},Zs={class:"dss-tooltip-title"},qs={class:"dss-tooltip-value"},Us={key:0,class:"dss-tooltip-section"},Xs={class:"dss-tooltip-section-title"},Ys={class:"dss-tooltip-group-header"},js={class:"dss-tooltip-item-content"},Ks={class:"dss-tooltip-item-text"},Gs={key:1,class:"dss-tooltip-section"},Qs={class:"dss-tooltip-section-title"},Js={class:"dss-tooltip-item-content"},er={class:"dss-tooltip-item-title"},tr={key:0,class:"dss-tooltip-item-description"},nr={class:"dss-tooltip-section"},or={class:"dss-tooltip-title"},lr={key:0,class:"dss-bubble-tooltip-data"},ar={class:"dss-tooltip-series-name"},sr={class:"dss-tooltip-series-value"},rr={key:0,class:"dss-tooltip-section"},ir={class:"dss-tooltip-section-title"},cr={class:"dss-tooltip-group-header"},dr={class:"dss-tooltip-item-content"},ur={class:"dss-tooltip-item-text"},mr={key:1,class:"dss-tooltip-section"},pr={class:"dss-tooltip-section-title"},vr={class:"dss-tooltip-item-content"},fr={class:"dss-tooltip-item-title"},gr={key:0,class:"dss-tooltip-item-description"},hr={key:1,class:"dss-context-menu-separator"},yr={key:0,class:"dss-context-menu-separator"},kr={key:0,class:"dss-context-menu-separator"},Cr=["onClick"],br=["innerHTML"],wr={key:0,class:"dss-context-menu-icon"},xr={class:"dss-marker-modal-header"},Er={class:"dss-marker-modal-body"},Vr={class:"dss-form-group"},Sr={key:0},Nr={key:1},Br=["disabled"],Mr=["value"],_r={class:"dss-form-group"},Tr={for:"dss-marker-description"},$r={key:0,class:"dss-form-text-display"},Lr=["placeholder"],Hr={class:"dss-form-group"},Ar={class:"icon-preview"},Dr=["src"],Rr={class:"dss-marker-modal-footer"},Ir={class:"modal-footer-left"},Fr={class:"dss-modal-footer-right"},zr=["disabled"],Pr={name:"DSSChart"},Or=Object.assign(Pr,{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:H=>typeof H=="object"&&H!==null},innerSize:{type:Number,default:null}},emits:["add-marker","update-marker","delete-marker"],setup(H,{emit:he}){const{t:D,locale:F}=cl.useI18n(),we=he,k=e.ref(null),Me=e.ref(null),ne=e.ref(null),Fe=e.ref(0),p=e.ref(0);let ie=null,be=null;const fe=20,j=e.computed(()=>{if(!k.value||!Me.value)return 0;try{const t=k.value.getBoundingClientRect();return Me.value.getBoundingClientRect().top-t.top}catch{return 0}}),_=H,_e={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!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},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function Pe(t,s){const n=Object.assign({},t);return Ke(t)&&Ke(s)&&Object.keys(s).forEach(c=>{Ke(s[c])?c in t?n[c]=Pe(t[c],s[c]):Object.assign(n,{[c]:s[c]}):Object.assign(n,{[c]:s[c]})}),n}const Le=()=>{let t=20,s=0,n=0;if(rt.value&&(t+=30),Qe.value&&(t+=25),Ze.value&&_.series.length>0){const c=_.series.filter((f,g)=>!kt.value.has(g)).length;if(Ve.value==="top"||Ve.value==="bottom"){if(Ot.value==="horizontal"){const g=Math.floor(ye.value/100);s=Math.ceil(c/g)*25+10}else s=c*25+10;t+=s}else n=150}return{height:t,legendHeight:s,legendWidth:n}};function Ke(t){return t&&typeof t=="object"&&!Array.isArray(t)}const z=e.computed(()=>Pe(_e,_.options)),dt=e.computed(()=>{const t=z.value;return t&&t.chart&&t.chart.width==="auto"}),ut=e.computed(()=>{const t=z.value;return t&&t.chart&&t.chart.height==="auto"}),ye=e.computed(()=>{const t=z.value;return dt.value?Fe.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Dt=e.ref(fe),xt=e.computed(()=>{if(ut.value){const t=xt.value;return t??Math.max(0,(p.value||400)-Dt.value*5)}}),nt=e.computed(()=>{const t=z.value;if(ut.value){const s=xt.value;return s??Math.max(0,(p.value||400)-Dt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Be=e.computed(()=>ut.value&&te.value==="semi-radial"&&xt.value!=null?Dt.value+nt.value+"px":ut.value?"100%":mn.value?Dt.value+nt.value+"px":nt.value+(Ze.value?20:0)+"px"),te=e.computed(()=>{const t=z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),pn=e.computed(()=>{const t=_.series.map(s=>s.type||te.value);return new Set(t).size>1}),rt=e.computed(()=>{const t=z.value;return t&&t.title&&t.title.text?t.title.text:""}),Qe=e.computed(()=>{const t=z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),sn=e.computed(()=>{const t=z.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Xt=e.computed(()=>{const t=z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),se=e.computed(()=>{const t=z.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),xe=e.computed(()=>{const t=z.value;if(!t||!t.yAxis)return In;const s=t.yAxis.min;return typeof s=="number"||s===In?s:In}),J=e.computed(()=>{const t=z.value;if(!t||!t.yAxis)return In;const s=t.yAxis.max;return typeof s=="number"||s===In?s:In}),oe=e.computed(()=>{const t=z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Ye=e.computed(()=>{const t=z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ct=e.computed(()=>{const t=z.value;return t&&t.grid&&t.grid.show!==!1}),Ze=e.computed(()=>{const t=z.value;return t&&t.legend&&t.legend.show!==!1}),Ve=e.computed(()=>{const t=z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ot=e.computed(()=>{const t=z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),_t=e.computed(()=>{const t=z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),ot=e.computed(()=>{const t=z.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),tn=e.computed(()=>{const t=z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Rt=e.computed(()=>{const t=z.value;return t&&t.zoom&&t.zoom.enabled!==!1}),ht=e.computed(()=>{const t=z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Tt=e.computed(()=>{const t=z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),st=e.computed(()=>{const t=z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),nn=e.computed(()=>{if(!mn.value)return 0;const t=z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),tt=e.computed(()=>{const t=z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),yt=e.computed(()=>{const{maxX:t}=Mt.value;return t===0}),Te=(t,s)=>yt.value&&s===0?5:s,Ue=e.computed(()=>{const t=z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),O=e.computed(()=>{const t=z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Z=e.computed(()=>{const t=z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),X=e.computed(()=>{const t=z.value;return O.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),Q=e.computed(()=>{const t=z.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),ge=e.computed(()=>{const t=z.value;return t&&t.animations&&t.animations.enabled!==!1}),et=e.computed(()=>{const t=z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Se=e.computed(()=>{const t=z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Oe=e.computed(()=>{const t=z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),mt=e.computed(()=>{const t=z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Et=e.computed(()=>{const t=z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Nt=e.computed(()=>{const t=z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),$t=e.computed(()=>{const t=z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Ae=e.computed(()=>{const t=z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),It=e.computed(()=>z.value?.spider?.gridSteps||5),gt=e.computed(()=>{const t=[],s=It.value;for(let n=1;n<=s;n++)t.push(Je.value/s*n);return t}),Sn=t=>{const s=Wt.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const n=gt.value[t];return Math.round(n/Je.value*100)+"%"},Wt=e.computed(()=>z.value?.spider?.gridLabels||null),Vt=e.computed(()=>{const t=z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Bt=e.computed(()=>{const t=z.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),_n=e.computed(()=>{const t=z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Tn=e.computed(()=>{const t=z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:St.value}),rn=e.computed(()=>{const t=z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),cn=e.computed(()=>{const t=z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Yt=e.computed(()=>{const s=z.value?.valueFormat?.extension;return typeof s=="string"?s:""}),dn=t=>{const s=Yt.value;if(t==null)return"";const n=String(t);return s?n+s:n},On=e.computed(()=>!I.value.isZooming);e.computed(()=>Ct.value.map(t=>{if(t.categoryIndex!==void 0&&(Qt.value||Lt.value)){const s=zt(t.categoryIndex),n=j.value+L.value.bottom-cn.value/2;return{...t,x:s,y:n}}return t}));function mo(t,s){const n=new Date(t);let c=0,f=1/0;return s.forEach((g,x)=>{const[b,M,B]=g.split("-"),T=new Date(`20${B}`,M-1,b),E=Math.abs(T-n);E<f&&(f=E,c=x)}),c}const $=e.computed(()=>{const t=_.markers.map(n=>{const c=mo(n.marker_date,_.categories),f=zt(c),g=j.value+L.value.bottom-cn.value/2;return{...n,x:f,y:g,categoryIndex:c,source:"props"}}),s=Ct.value.map(n=>{if(n.categoryIndex!==void 0&&(Qt.value||Lt.value)){const c=zt(n.categoryIndex),f=j.value+L.value.bottom-cn.value/2;return{...n,x:c,y:f,source:"internal"}}return{...n,source:"internal"}});return[...t,...s]}),P=e.computed(()=>{const t=z.value;return t&&t.watermark&&t.watermark.enabled===!0}),A=e.computed(()=>{const t=z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),G=e.computed(()=>{const t=z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),ke=e.computed(()=>{const t=z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),We=e.computed(()=>{const t={left:L.value.left,top:L.value.top,width:L.value.width,height:L.value.height};let s,n;const c=String(G.value);if(c.includes("%")){const f=parseFloat(c)/100;s=t.width*f,n=s*(96/499)}else{const f=parseFloat(c)||25;s=Math.min(t.width*.25,200)*(f/25),n=s*(96/499)}return{width:s,height:n,area:t}}),Xe=e.computed(()=>{const{width:t,height:s}=We.value,n=ke.value;let c,f;const g=L.value.left,x=L.value.right,b=L.value.top,M=L.value.bottom,B=L.value.width,T=L.value.height;switch(n){case"center":c=g+(B-t)/2,f=b+(T-s)/2;break;case"top-left":c=g+15,f=b+90;break;case"top-right":c=x-t-15,f=b+90;break;case"bottom-left":c=g+15,f=M-s+75;break;case"bottom-right":default:c=x-t-15,f=M-s+75;break}return{backgroundPositionX:c+"px",backgroundPositionY:f+"px",backgroundSize:`${t}px ${s}px`}}),Ie=t=>!_.flags||!_.flags.length?[]:_.flags.filter(s=>s.categoryIndex===t),je=t=>{const s=Ie(t),n=pl(t),c=s.filter(x=>x.manual),f=s.filter(x=>!x.manual),g=[];return c.length>0&&g.push({type:D("chart.tooltip.manualFlags"),color:"#047395",flags:c.map(x=>({text:x.text,color:"#047395"}))}),f.length>0&&g.push({type:D("chart.tooltip.autoFlags"),color:"#0dbf89",flags:f.map(x=>({text:x.text,color:"#0dbf89"}))}),{flagGroups:g,markers:n.map(x=>({title:x.title,description:x.description,type:D("chart.tooltip.markers"),color:x.color||"#FF6B6B"}))}},St=e.computed(()=>`data:image/svg+xml;base64,${btoa(`<svg viewBox="0 0 57 57" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),cl=require("vue-i18n"),Gl=["data-chart-type"],Ql={class:"dss-chart-header-titles"},Jl={key:0,class:"dss-chart-title"},ea={key:1,class:"dss-chart-subtitle"},ta=["onClick","onMouseenter"],na={class:"dss-legend-text"},oa=["onClick","onMouseenter"],la={class:"dss-legend-text"},aa=["title"],sa=["src"],ra={class:"dss-chart-area-wrapper"},ia={key:0,class:"dss-chart-z-axis-label"},ca=["width","height","data-smooth","data-animated"],da={id:"chart-clip"},ua=["y","width","height"],ma=["id"],pa=["d"],va=["id"],fa=["d"],ga={key:0},ha={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},ya=["x1","x2","y1","y2"],ka={class:"dss-axes"},Ca=["x1","x2","y1","y2"],ba=["x1","x2","y1","y2"],wa={class:"dss-axis-labels"},xa=["x","y"],Ea=["x","y"],Va=["x","y"],Sa=["y","transform"],Na={key:1,class:"dss-flag-markers"},Ba={"clip-path":"url(#chart-clip)"},Ma=["x1","x2","y1","y2","onMouseover"],_a=["x1","x2","y1","y2","onMouseover"],Ta=["x1","x2","y1","y2","onMouseover"],$a=["cx","cy","onMouseover"],La=["cx","cy","fill","onMouseover"],Ha=["x","y"],Aa={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Da={key:0},Ra=["d","onMouseover"],Ia=["x","y","width","height","fill","onMouseover"],Fa={class:"dss-line-chart"},za=["d","stroke","stroke-width"],Pa=["d","stroke","stroke-width","opacity"],Oa=["cx","cy","r","fill","onMouseover"],Wa={key:1},Za=["d","stroke","stroke-width"],qa=["d","stroke","stroke-width"],Ua=["d","stroke","stroke-width","opacity"],Xa=["cx","cy","r","fill","onMouseover"],Ya={key:2},ja=["id"],Ka=["x","y","width","height"],Ga=["d","fill","fill-opacity","mask"],Qa=["d","stroke","stroke-width"],Ja=["d","fill","onMouseover"],es=["x","y","width","height","onMouseover"],ts={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},ns=["x1","x2","y1","y2","stroke"],os=["cx","cy","r","fill"],ls={key:1,class:"dss-bubble-chart"},as={key:0,class:"dss-bubble-group"},ss=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],rs=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],is=["transform"],cs=["cx","cy","r"],ds=["data-chart-type","clip-path"],us=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],ms={key:1,class:"dss-radial-segment-data-labels"},ps=["x","y"],vs=["x","y","font-size","fill"],fs=["x1","y1","x2","y2","stroke"],gs=["x1","y1","x2","y2","stroke"],hs=["x","y","text-anchor","font-size"],ys=["transform"],ks={key:0,class:"dss-spider-grid"},Cs=["cx","cy","r"],bs={class:"dss-spider-grid-labels"},ws=["x","y"],xs=["x","y"],Es=["x1","x2","y1","y2"],Vs={class:"dss-spider-labels"},Ss=["x","y","text-anchor","dominant-baseline"],Ns=["points","fill","fill-opacity","stroke","stroke-width"],Bs=["cx","cy","r","fill","onMouseover"],Ms={class:"dss-chart-logos"},_s=["cx","cy","r","fill"],Ts=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],$s=["onClick","onMouseenter"],Ls=["src"],Hs={class:"dss-marker-tooltip-category"},As={key:0,class:"dss-marker-tooltip-description"},Ds={key:0,class:"dss-tooltip-section"},Rs={key:0,class:"dss-tooltip-title"},Is={class:"dss-tooltip-series-name"},Fs={class:"dss-tooltip-series-value"},zs={key:1,class:"dss-tooltip-section"},Ps={key:0,class:"dss-tooltip-title"},Os={class:"dss-bubble-tooltip-data"},Ws={key:2,class:"dss-tooltip-section"},Zs={class:"dss-tooltip-title"},qs={class:"dss-tooltip-value"},Us={key:0,class:"dss-tooltip-section"},Xs={class:"dss-tooltip-section-title"},Ys={class:"dss-tooltip-group-header"},js={class:"dss-tooltip-item-content"},Ks={class:"dss-tooltip-item-text"},Gs={key:1,class:"dss-tooltip-section"},Qs={class:"dss-tooltip-section-title"},Js={class:"dss-tooltip-item-content"},er={class:"dss-tooltip-item-title"},tr={key:0,class:"dss-tooltip-item-description"},nr={class:"dss-tooltip-section"},or={class:"dss-tooltip-title"},lr={key:0,class:"dss-bubble-tooltip-data"},ar={class:"dss-tooltip-series-name"},sr={class:"dss-tooltip-series-value"},rr={key:0,class:"dss-tooltip-section"},ir={class:"dss-tooltip-section-title"},cr={class:"dss-tooltip-group-header"},dr={class:"dss-tooltip-item-content"},ur={class:"dss-tooltip-item-text"},mr={key:1,class:"dss-tooltip-section"},pr={class:"dss-tooltip-section-title"},vr={class:"dss-tooltip-item-content"},fr={class:"dss-tooltip-item-title"},gr={key:0,class:"dss-tooltip-item-description"},hr={key:1,class:"dss-context-menu-separator"},yr={key:0,class:"dss-context-menu-separator"},kr={key:0,class:"dss-context-menu-separator"},Cr=["onClick"],br=["innerHTML"],wr={key:0,class:"dss-context-menu-icon"},xr={class:"dss-marker-modal-header"},Er={class:"dss-marker-modal-body"},Vr={class:"dss-form-group"},Sr={key:0},Nr={key:1},Br=["disabled"],Mr=["value"],_r={class:"dss-form-group"},Tr={for:"dss-marker-description"},$r={key:0,class:"dss-form-text-display"},Lr=["placeholder"],Hr={class:"dss-form-group"},Ar={class:"icon-preview"},Dr=["src"],Rr={class:"dss-marker-modal-footer"},Ir={class:"modal-footer-left"},Fr={class:"dss-modal-footer-right"},zr=["disabled"],Pr={name:"DSSChart"},Or=Object.assign(Pr,{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:L=>typeof L=="object"&&L!==null},innerSize:{type:Number,default:null}},emits:["add-marker","update-marker","delete-marker"],setup(L,{emit:fe}){const{t:D,locale:F}=cl.useI18n(),we=fe,k=e.ref(null),Me=e.ref(null),ne=e.ref(null),Fe=e.ref(0),p=e.ref(0);let ie=null,be=null;const ge=20,j=e.computed(()=>{if(!k.value||!Me.value)return 0;try{const t=k.value.getBoundingClientRect();return Me.value.getBoundingClientRect().top-t.top}catch{return 0}}),_=L,_e={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!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},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function Pe(t,s){const n=Object.assign({},t);return Ke(t)&&Ke(s)&&Object.keys(s).forEach(c=>{Ke(s[c])?c in t?n[c]=Pe(t[c],s[c]):Object.assign(n,{[c]:s[c]}):Object.assign(n,{[c]:s[c]})}),n}const Le=()=>{let t=20,s=0,n=0;if(rt.value&&(t+=30),Qe.value&&(t+=25),Ze.value&&_.series.length>0){const c=_.series.filter((f,g)=>!kt.value.has(g)).length;if(Ve.value==="top"||Ve.value==="bottom"){if(Ot.value==="horizontal"){const g=Math.floor(he.value/100);s=Math.ceil(c/g)*25+10}else s=c*25+10;t+=s}else n=150}return{height:t,legendHeight:s,legendWidth:n}};function Ke(t){return t&&typeof t=="object"&&!Array.isArray(t)}const z=e.computed(()=>Pe(_e,_.options)),dt=e.computed(()=>{const t=z.value;return t&&t.chart&&t.chart.width==="auto"}),ut=e.computed(()=>{const t=z.value;return t&&t.chart&&t.chart.height==="auto"}),he=e.computed(()=>{const t=z.value;return dt.value?Fe.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Dt=e.ref(ge),xt=e.computed(()=>{if(ut.value){const t=xt.value;return t??Math.max(0,(p.value||400)-Dt.value*5)}}),nt=e.computed(()=>{const t=z.value;if(ut.value){const s=xt.value;return s??Math.max(0,(p.value||400)-Dt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Be=e.computed(()=>ut.value&&te.value==="semi-radial"&&xt.value!=null?Dt.value+nt.value+"px":ut.value?"100%":mn.value?Dt.value+nt.value+"px":nt.value+(Ze.value?20:0)+"px"),te=e.computed(()=>{const t=z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),pn=e.computed(()=>{const t=_.series.map(s=>s.type||te.value);return new Set(t).size>1}),rt=e.computed(()=>{const t=z.value;return t&&t.title&&t.title.text?t.title.text:""}),Qe=e.computed(()=>{const t=z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),sn=e.computed(()=>{const t=z.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Xt=e.computed(()=>{const t=z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),se=e.computed(()=>{const t=z.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),xe=e.computed(()=>{const t=z.value;if(!t||!t.yAxis)return In;const s=t.yAxis.min;return typeof s=="number"||s===In?s:In}),J=e.computed(()=>{const t=z.value;if(!t||!t.yAxis)return In;const s=t.yAxis.max;return typeof s=="number"||s===In?s:In}),oe=e.computed(()=>{const t=z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Ye=e.computed(()=>{const t=z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ct=e.computed(()=>{const t=z.value;return t&&t.grid&&t.grid.show!==!1}),Ze=e.computed(()=>{const t=z.value;return t&&t.legend&&t.legend.show!==!1}),Ve=e.computed(()=>{const t=z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ot=e.computed(()=>{const t=z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),_t=e.computed(()=>{const t=z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),ot=e.computed(()=>{const t=z.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),tn=e.computed(()=>{const t=z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Rt=e.computed(()=>{const t=z.value;return t&&t.zoom&&t.zoom.enabled!==!1}),ht=e.computed(()=>{const t=z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Tt=e.computed(()=>{const t=z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),st=e.computed(()=>{const t=z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),nn=e.computed(()=>{if(!mn.value)return 0;const t=z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),tt=e.computed(()=>{const t=z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),yt=e.computed(()=>{const{maxX:t}=Mt.value;return t===0}),Te=(t,s)=>yt.value&&s===0?5:s,Ue=e.computed(()=>{const t=z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),O=e.computed(()=>{const t=z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Z=e.computed(()=>{const t=z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),X=e.computed(()=>{const t=z.value;return O.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),Q=e.computed(()=>{const t=z.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),ye=e.computed(()=>{const t=z.value;return t&&t.animations&&t.animations.enabled!==!1}),et=e.computed(()=>{const t=z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Se=e.computed(()=>{const t=z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Oe=e.computed(()=>{const t=z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),mt=e.computed(()=>{const t=z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Et=e.computed(()=>{const t=z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Nt=e.computed(()=>{const t=z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),$t=e.computed(()=>{const t=z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Ae=e.computed(()=>{const t=z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),It=e.computed(()=>z.value?.spider?.gridSteps||5),gt=e.computed(()=>{const t=[],s=It.value;for(let n=1;n<=s;n++)t.push(Je.value/s*n);return t}),Sn=t=>{const s=Wt.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const n=gt.value[t];return Math.round(n/Je.value*100)+"%"},Wt=e.computed(()=>z.value?.spider?.gridLabels||null),Vt=e.computed(()=>{const t=z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Bt=e.computed(()=>{const t=z.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),_n=e.computed(()=>{const t=z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Tn=e.computed(()=>{const t=z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:St.value}),rn=e.computed(()=>{const t=z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),cn=e.computed(()=>{const t=z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Yt=e.computed(()=>{const s=z.value?.valueFormat?.extension;return typeof s=="string"?s:""}),dn=t=>{const s=Yt.value;if(t==null)return"";const n=String(t);return s?n+s:n},On=e.computed(()=>!I.value.isZooming);e.computed(()=>Ct.value.map(t=>{if(t.categoryIndex!==void 0&&(Qt.value||Lt.value)){const s=zt(t.categoryIndex),n=j.value+H.value.bottom-cn.value/2;return{...t,x:s,y:n}}return t}));function mo(t,s){const n=new Date(t);let c=0,f=1/0;return s.forEach((g,x)=>{const[b,M,B]=g.split("-"),T=new Date(`20${B}`,M-1,b),E=Math.abs(T-n);E<f&&(f=E,c=x)}),c}const $=e.computed(()=>{const t=_.markers.map(n=>{const c=mo(n.marker_date,_.categories),f=zt(c),g=j.value+H.value.bottom-cn.value/2;return{...n,x:f,y:g,categoryIndex:c,source:"props"}}),s=Ct.value.map(n=>{if(n.categoryIndex!==void 0&&(Qt.value||Lt.value)){const c=zt(n.categoryIndex),f=j.value+H.value.bottom-cn.value/2;return{...n,x:c,y:f,source:"internal"}}return{...n,source:"internal"}});return[...t,...s]}),P=e.computed(()=>{const t=z.value;return t&&t.watermark&&t.watermark.enabled===!0}),A=e.computed(()=>{const t=z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),G=e.computed(()=>{const t=z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),ke=e.computed(()=>{const t=z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),We=e.computed(()=>{const t={left:H.value.left,top:H.value.top,width:H.value.width,height:H.value.height};let s,n;const c=String(G.value);if(c.includes("%")){const f=parseFloat(c)/100;s=t.width*f,n=s*(96/499)}else{const f=parseFloat(c)||25;s=Math.min(t.width*.25,200)*(f/25),n=s*(96/499)}return{width:s,height:n,area:t}}),Xe=e.computed(()=>{const{width:t,height:s}=We.value,n=ke.value;let c,f;const g=H.value.left,x=H.value.right,b=H.value.top,M=H.value.bottom,B=H.value.width,T=H.value.height;switch(n){case"center":c=g+(B-t)/2,f=b+(T-s)/2;break;case"top-left":c=g+15,f=b+90;break;case"top-right":c=x-t-15,f=b+90;break;case"bottom-left":c=g+15,f=M-s+75;break;case"bottom-right":default:c=x-t-15,f=M-s+75;break}return{backgroundPositionX:c+"px",backgroundPositionY:f+"px",backgroundSize:`${t}px ${s}px`}}),Ie=t=>!_.flags||!_.flags.length?[]:_.flags.filter(s=>s.categoryIndex===t),je=t=>{const s=Ie(t),n=pl(t),c=s.filter(x=>x.manual),f=s.filter(x=>!x.manual),g=[];return c.length>0&&g.push({type:D("chart.tooltip.manualFlags"),color:"#047395",flags:c.map(x=>({text:x.text,color:"#047395"}))}),f.length>0&&g.push({type:D("chart.tooltip.autoFlags"),color:"#0dbf89",flags:f.map(x=>({text:x.text,color:"#0dbf89"}))}),{flagGroups:g,markers:n.map(x=>({title:x.title,description:x.description,type:D("chart.tooltip.markers"),color:x.color||"#FF6B6B"}))}},St=e.computed(()=>`data:image/svg+xml;base64,${btoa(`<svg viewBox="0 0 57 57" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<g clip-path="url(#clip0_332_8537)">
|
|
3
3
|
<path d="M49.8925 0H7.10745C3.18212 0 0 3.18212 0 7.10745V49.8925C0 53.8179 3.18212 57 7.10745 57H49.8925C53.8179 57 57 53.8179 57 49.8925V7.10745C57 3.18212 53.8179 0 49.8925 0Z" fill="#393939"/>
|
|
4
4
|
<path d="M39.5601 6.88449H17.4395C16.073 6.85889 14.7151 7.10594 13.4451 7.61119C12.1751 8.11645 11.0186 8.86978 10.0431 9.82714C9.06767 10.7845 8.29281 11.9267 7.76385 13.187C7.2349 14.4473 6.96246 15.8004 6.96246 17.1671C6.96246 18.5339 7.2349 19.887 7.76385 21.1473C8.29281 22.4076 9.06767 23.5498 10.0431 24.5071C11.0186 25.4645 12.1751 26.2178 13.4451 26.7231C14.7151 27.2283 16.073 27.4754 17.4395 27.4498H39.5601C40.9267 27.4754 42.2846 27.2283 43.5546 26.7231C44.8245 26.2178 45.9811 25.4645 46.9565 24.5071C47.932 23.5498 48.7069 22.4076 49.2358 21.1473C49.7648 19.887 50.0372 18.5339 50.0372 17.1671C50.0372 15.8004 49.7648 14.4473 49.2358 13.187C48.7069 11.9267 47.932 10.7845 46.9565 9.82714C45.9811 8.86978 44.8245 8.11645 43.5546 7.61119C42.2846 7.10594 40.9267 6.85889 39.5601 6.88449ZM39.5601 25.0826C37.9946 25.0822 36.4643 24.6176 35.1629 23.7476C33.8614 22.8775 32.8471 21.6411 32.2483 20.1946C31.6496 18.7481 31.4932 17.1565 31.799 15.6211C32.1047 14.0858 32.8589 12.6756 33.9662 11.5688C35.0734 10.4621 36.484 9.70853 38.0195 9.40346C39.555 9.09839 41.1465 9.25551 42.5927 9.85494C44.0389 10.4544 45.2749 11.4692 46.1444 12.7711C47.0138 14.0729 47.4777 15.6034 47.4773 17.1689C47.4772 18.2084 47.2724 19.2378 46.8744 20.1981C46.4765 21.1584 45.8932 22.0309 45.158 22.7658C44.4228 23.5006 43.55 24.0835 42.5895 24.481C41.629 24.8785 40.5996 25.0829 39.5601 25.0826Z" fill="white"/>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</defs>
|
|
24
24
|
</svg>
|
|
25
25
|
`)}`),xn=e.computed(()=>{const t=z.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),on=e.computed(()=>{const t=z.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=z.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const to=e.computed(()=>{const t=z.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Ln=e.computed(()=>{const t=z.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),un=e.computed(()=>{const t=z.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),vn=e.computed(()=>{const s=z.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),Wn=e.computed(()=>{const s=z.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),ko=e.computed(()=>{const s=z.value?.radialBar?.dataCenter;return io.value&&s&&(s.show===!0||s.enabled===!0)}),jo=e.computed(()=>{if(!ko.value||!yo.value.length)return"";const n=z.value?.radialBar?.dataCenter?.showValueOnly===!0?yo.value[0]?.value??0:yo.value.reduce((c,f)=>c+(f.value??0),0);return dn(n)}),Co=e.computed(()=>{const s=z.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),bo=e.computed(()=>({x:vt.value,y:ft.value-Co.value/2})),yn=e.computed(()=>{const s=z.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),fn=e.computed(()=>{if(!vn.value||!mn.value||!yo.value.length)return[];const t=Wn.value*Math.PI/180,s=(wt.value+Je.value)/2;return yo.value.map(n=>{const f=n.endAngle-n.startAngle>=t&&!n.isHidden,g=vt.value+Math.cos(n.midAngle)*s,x=ft.value+Math.sin(n.midAngle)*s;return{value:dn(n.value),x:g,y:x,show:f,color:n.color,contrastColor:Ao(n.color)}})}),Io=e.computed(()=>{if(!_.flags||!_.flags.length)return[];const t=new Map;return _.flags.forEach(s=>{const n=s.categoryIndex;t.has(n)||t.set(n,[]),t.get(n).push(s)}),Array.from(t.entries()).map(([s,n])=>{const c=zt(s),f=n.filter(x=>x.manual),g=n.filter(x=>!x.manual);return{categoryIndex:parseInt(s),x:c,flags:n,manualCount:f.length,autoCount:g.length,totalCount:n.length,hasManual:f.length>0,hasAuto:g.length>0,texts:n.map(x=>x.text).join(`
|
|
26
|
-
`)}})}),no=e.ref({show:!1,x:0,y:0,content:"",count:0}),Hn=e.computed(()=>z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),po=e.computed(()=>{const t=z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),_o=e.computed(()=>z.value?.bubbles?.tooltip?.formatters||{}),kt=e.ref(new Set),ce=e.ref(null),To=e.ref(!1),ze=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),jt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),He=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),$e=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),I=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Ct=e.ref([]),de=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1});e.computed(()=>{const t=["default"];return rn.value&&t.push(...Object.keys(rn.value)),t});const Nn=e.computed(()=>{if(!_.categories||_.categories.length===0){const{maxX:t}=Mt.value;return Array.from({length:t+1},(s,n)=>D("chart.fallback.item",{number:n+1}))}return _.categories}),oo=e.computed(()=>de.value.editingMarkerId!==null),C=e.computed(()=>de.value.readonly),y=t=>{kt.value.has(t)||(Un.value=!0,ce.value=t)},V=()=>{Un.value=!1,ce.value=null},R=t=>{if(Bo.value||zn.value){He.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),c=t.clientX-n.left,f=t.clientY-n.top,g=Lt.value?c>=
|
|
26
|
+
`)}})}),no=e.ref({show:!1,x:0,y:0,content:"",count:0}),Hn=e.computed(()=>z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),po=e.computed(()=>{const t=z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),_o=e.computed(()=>z.value?.bubbles?.tooltip?.formatters||{}),kt=e.ref(new Set),ce=e.ref(null),To=e.ref(!1),ze=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),jt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),He=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),$e=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),I=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Ct=e.ref([]),de=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1});e.computed(()=>{const t=["default"];return rn.value&&t.push(...Object.keys(rn.value)),t});const Nn=e.computed(()=>{if(!_.categories||_.categories.length===0){const{maxX:t}=Mt.value;return Array.from({length:t+1},(s,n)=>D("chart.fallback.item",{number:n+1}))}return _.categories}),oo=e.computed(()=>de.value.editingMarkerId!==null),C=e.computed(()=>de.value.readonly),y=t=>{kt.value.has(t)||(Un.value=!0,ce.value=t)},V=()=>{Un.value=!1,ce.value=null},R=t=>{if(Bo.value||zn.value){He.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),c=t.clientX-n.left,f=t.clientY-n.top,g=Lt.value?c>=H.value.left-50&&c<=H.value.right+50&&f>=H.value.top-50&&f<=H.value.bottom+100:c>=H.value.left&&c<=H.value.right&&f>=H.value.top&&f<=H.value.bottom;if(To.value=g,Lt.value){if(!ot.value||!g||I.value.isDragging||I.value.isZooming){He.value.show=!1;return}if(Zo.value.find(Y=>!Y||Y.isHidden?!1:Math.sqrt(Math.pow(Y.x-c,2)+Math.pow(Y.y-f,2))<=Y.radius+3))He.value.show=!1;else{const Y=Zo.value.filter(ae=>!ae||ae.isHidden?!1:Math.sqrt(Math.pow(ae.x-c,2)+Math.pow(ae.y-f,2))<=250);if(Y.length>0){let ae=Y[0],re=Math.sqrt(Math.pow(ae.x-c,2)+Math.pow(ae.y-f,2));Y.forEach(me=>{const pe=Math.sqrt(Math.pow(me.x-c,2)+Math.pow(me.y-f,2));pe<re&&(re=pe,ae=me)});const K=30,Re=Zo.value.filter(me=>!me||me.isHidden?!1:Math.abs(me.x-ae.x)<=K).sort((me,pe)=>me.y-pe.y);He.value={show:!0,x:ae.x,categoryIndex:Math.round(ae.originalX),data:(()=>{const me=Hn.value,pe=po.value,Ne=[];return Re.forEach(Ee=>{me.forEach(lt=>{const at=pe[lt]||lt,wn=u(lt,Ee);wn&&Ne.push({seriesName:Ee.seriesName,label:Ee.label,value:`${at}: ${wn}`,color:Ee.color,y:Ee.y})})}),Ne})()}}else He.value.show=!1}return}if(I.value.isDragging&&I.value.scale>1&&Qt.value&&Rt.value){He.value.show=!1;const ve=t.clientX-I.value.lastMouseX,{minX:Y,maxX:ae}=Mt.value,re=ae-Y||1,Re=ve*.8;I.value.offsetX+=Re;const me=re/I.value.scale,pe=re-me,Ne=0,Ee=-pe/re*H.value.width,lt=Ne;I.value.offsetX=Math.max(Ee,Math.min(lt,I.value.offsetX)),I.value.lastMouseX=t.clientX,I.value.lastMouseY=t.clientY;return}if(!ot.value||!Qt.value||I.value.isDragging||I.value.isZooming||!g){He.value.show=!1;return}const{minX:x,maxX:b}=Mt.value,M=b-x||1,B=M/I.value.scale,T=x-I.value.offsetX/H.value.width*M,E=(c-H.value.left)/H.value.width,q=T+E*B,ee=Math.round(q);if(ee>=0&&ee<=b){const ve=zt(ee),Y=ho.value.map((ae,re)=>{const K=_.series.findIndex(me=>me===ae),Re=ae.data[ee];return{seriesName:ae.name,value:Re!==void 0?Re:null,color:Ht(K),y:Re!==void 0?Jt(Re):null}}).filter(ae=>ae.value!==null);He.value={show:!0,x:ve,categoryIndex:ee,data:Y}}},ue=()=>{He.value.show=!1,To.value=!1,zn.value=!1,Bo.value||(no.value.show=!1),I.value.isDragging&&(I.value.isDragging=!1),I.value.zoomTimeout&&(clearTimeout(I.value.zoomTimeout),I.value.zoomTimeout=null),I.value.isZooming=!1,setTimeout(()=>{ce.value=null,ze.value.show=!1},150)},qe=t=>{if(t.preventDefault(),t.stopPropagation(),!Vt.value)return;const s=t.currentTarget.getBoundingClientRect(),n=t.clientX-s.left,c=t.clientY-s.top;if(mn.value){$e.value.show=!1,e.nextTick(()=>{$e.value.show=!0,$e.value.x=t.clientX,$e.value.y=t.clientY,$e.value.categoryIndex=null});return}const f=Math.max(0,H.value.left-20),g=H.value.right,x=H.value.top,b=H.value.bottom+80;n>=f&&n<=g&&c>=x&&c<=b&&($e.value.show=!1,e.nextTick(()=>{$e.value.show=!0,$e.value.x=t.clientX,$e.value.y=t.clientY,$e.value.categoryIndex=null;const M=Math.max(H.value.left,Math.min(n,H.value.right))-H.value.left,T=H.value.width/sl.value.length,E=Math.floor(M/T);E>=0&&E<sl.value.length&&($e.value.categoryIndex=E)}))},De=t=>{if(!(t&&t.button===2)){if($e.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}$e.value.show=!1}},pt=t=>{if(typeof t.template=="function"){const s={series:_.series,categories:_.categories,markers:Ct.value},n={chartX:$e.value.chartX,chartY:$e.value.chartY,dataX:$e.value.mouseDataX,dataY:$e.value.mouseDataY,categoryIndex:$e.value.categoryIndex};return t.template(s,n)}return t.template||t.label||""},lo=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},bt=t=>t.style||{},An=t=>t.type&&rn.value[t.type]?rn.value[t.type]:t.customIcon?t.customIcon:Tn.value,Fo=t=>t==null?"":_.categories&&_.categories[t]?_.categories[t]:"",pl=t=>Ct.value.length?Ct.value.filter(s=>s.categoryIndex===t):[],vl=t=>{if(!Qt.value&&!Lt.value)return{x:0,y:0};const s=zt(t),n=j.value+H.value.bottom-cn.value/2;return{x:s,y:n}},gn=()=>{Ct.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Qt.value||Lt.value)){const s=vl(t.categoryIndex);t.x=s.x,t.y=s.y}})},fl=()=>{if(de.value.description&&de.value.description.length){if(oo.value){const t=Ct.value.findIndex(s=>s.id===de.value.editingMarkerId);t!==-1?(Ct.value[t].description=de.value.description||"",Ct.value[t].color=de.value.color||"",Ct.value[t].type=de.value.type||"default",we("update-marker",Ct.value[t])):we("update-marker",{id:de.value.editingMarkerId,description:de.value.description||"",color:de.value.color||"",type:de.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=Math.max(0,de.value.categoryIndex);if(Lt.value){const{maxX:x}=Mt.value;s=Math.max(0,Math.min(s,Math.floor(x)))}else Qt.value&&(s=Math.max(0,Math.min(s,Mt.value.maxX)));const n=zt(s),c=j.value+H.value.bottom-cn.value/2,f=Array.isArray(_.categories)?_.categories[s]:null,g={id:t,title:"",description:de.value.description||"",color:de.value.color||"",type:de.value.type||"default",categoryIndex:s,x:n,y:c,marker_date:f||null};de.value.categoryIndex=s,Ct.value.push(g),we("add-marker",g)}ao(),kn()}},ao=()=>{de.value.show=!1,de.value.title="",de.value.description="",de.value.color="#FF6B6B",de.value.type="default",de.value.editingMarkerId=null,de.value.readonly=!1,de.value.categoryIndex=null,de.value.fromButton=!1},gl=()=>{oo.value&&(hl(de.value.editingMarkerId),ao())},hl=t=>{const s=Ct.value.findIndex(n=>n.id===t);s!==-1&&(Ct.value.splice(s,1),kn()),we("delete-marker",t)},yl=t=>{de.value.show=!0,de.value.title=t?.title??t?.comment??"",de.value.description=t?.description??t?.comment??"",de.value.color=t?.color??"",de.value.type=t?.type??"default",de.value.editingMarkerId=t?.id??t?.marker_id??null,de.value.readonly=t?.readonly??!1,de.value.categoryIndex=t?.categoryIndex??null},kn=()=>{try{const t=`dss-chart-markers-${_.chartId}`;localStorage.setItem(t,JSON.stringify(Ct.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},kl=()=>{try{const t=`dss-chart-markers-${_.chartId}`,s=localStorage.getItem(t);if(s){const n=JSON.parse(s);Array.isArray(n)&&(Ct.value=n.map(c=>({...c,originalYOffset:c.originalYOffset!==void 0?c.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Ct.value=[]}},zo=t=>{const s=rt.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${s.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},ln=()=>{const t=He.value.show,s=ze.value.show;return He.value.show=!1,ze.value.show=!1,{originalCrosshair:t,originalTooltip:s}},Cn=t=>{He.value.show=t.originalCrosshair,ze.value.show=t.originalTooltip},wo=async(t,s=32,n=32)=>new Promise((c,f)=>{if(t.startsWith("data:")){c(t);return}const g=new Image;g.crossOrigin="anonymous";const x=setTimeout(()=>{console.warn("Image conversion timeout for:",t),c(t)},5e3);g.onload=()=>{clearTimeout(x);try{const b=document.createElement("canvas"),M=b.getContext("2d");b.width=s,b.height=n,M.fillStyle="#fafafa",M.fillRect(0,0,s,n),M.drawImage(g,0,0,s,n);const B=b.toDataURL("image/png");c(B)}catch(b){console.warn("Canvas conversion failed:",b),c(t)}},g.onerror=b=>{clearTimeout(x),console.warn("Failed to load image:",t,b),c(t)},g.src=t}),Xn=async()=>{try{const t=ln();setTimeout(async()=>{try{const s=document.querySelector(".dss-chart-svg");if(!s){console.error("Chart SVG element not found"),Cn(t);return}const n=Le(),c=he.value,f=nt.value+n.height,g=s.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(K=>K.remove());const b=g.querySelectorAll("image"),M=Array.from(b).map(async K=>{const Re=K.getAttribute("xlink:href")||K.getAttribute("href");if(Re&&!Re.startsWith("data:"))try{const me=await wo(Re,32,32);K.setAttribute("xlink:href",me),K.setAttribute("href",me)}catch(me){console.warn("Failed to convert logo to base64:",me)}});await Promise.all(M);const T=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let E="",q=30;if(rt.value&&(E+=`
|
|
27
27
|
<text x="24" y="${q}"
|
|
28
28
|
font-family="Arial, sans-serif"
|
|
29
29
|
font-size="18"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
font-size="14"
|
|
37
37
|
fill="#666">
|
|
38
38
|
${Qe.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
39
|
-
</text>`,q+=25),Ze.value&&_.series.length>0){let K=c-200,Re=rt.value||Qe.value?35:25;const me=Math.floor((c-250)/120);let pe=0;_.series.forEach((Ne,Ee)=>{if(!kt.value.has(Ee)){const lt=Ht(Ee),at=Ne.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");E+=`<circle cx="${K+6}" cy="${Re-4}" r="6" fill="${lt}"/>`,E+=`<text x="${K+18}" y="${Re}" font-family="Arial, sans-serif" font-size="12" fill="#333">${at}</text>`,pe++,pe%me===0?(K=c-200,Re+=20):K+=Math.min(120,at.length*8+35)}})}let ee="";if(P.value)try{const{width:K,height:Re}=We.value,me=ke.value,pe=
|
|
39
|
+
</text>`,q+=25),Ze.value&&_.series.length>0){let K=c-200,Re=rt.value||Qe.value?35:25;const me=Math.floor((c-250)/120);let pe=0;_.series.forEach((Ne,Ee)=>{if(!kt.value.has(Ee)){const lt=Ht(Ee),at=Ne.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");E+=`<circle cx="${K+6}" cy="${Re-4}" r="6" fill="${lt}"/>`,E+=`<text x="${K+18}" y="${Re}" font-family="Arial, sans-serif" font-size="12" fill="#333">${at}</text>`,pe++,pe%me===0?(K=c-200,Re+=20):K+=Math.min(120,at.length*8+35)}})}let ee="";if(P.value)try{const{width:K,height:Re}=We.value,me=ke.value,pe=H.value.left,Ne=H.value.right,Ee=H.value.top,lt=H.value.bottom,at=H.value.width,wn=H.value.height;let Ut,uo;switch(me){case"center":Ut=pe+(at-K)/2,uo=Ee+(wn-Re)/2;break;case"top-left":Ut=pe+15,uo=Ee+5;break;case"top-right":Ut=Ne-K-5,uo=Ee+5;break;case"bottom-left":Ut=pe+15,uo=lt-Re-5;break;case"bottom-right":default:Ut=Ne-K-5,uo=lt-Re-5;break}ee=`
|
|
40
40
|
<g opacity="${A.value}">
|
|
41
41
|
<g transform="translate(${Ut}, ${uo}) scale(${K/499})">
|
|
42
42
|
<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"/>
|
|
@@ -70,18 +70,18 @@
|
|
|
70
70
|
${T}
|
|
71
71
|
${ee}
|
|
72
72
|
</g>
|
|
73
|
-
</svg>`,Y=new Blob([ve],{type:"image/svg+xml;charset=utf-8"}),ae=URL.createObjectURL(Y),re=document.createElement("a");re.href=ae,re.download=zo("svg"),document.body.appendChild(re),re.click(),document.body.removeChild(re),URL.revokeObjectURL(ae),Cn(t),De()}catch(s){console.error("Error downloading SVG:",s),Cn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Yn=async()=>{try{const t=ln();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(K=>setTimeout(K,300));const s=Le(),n=
|
|
73
|
+
</svg>`,Y=new Blob([ve],{type:"image/svg+xml;charset=utf-8"}),ae=URL.createObjectURL(Y),re=document.createElement("a");re.href=ae,re.download=zo("svg"),document.body.appendChild(re),re.click(),document.body.removeChild(re),URL.revokeObjectURL(ae),Cn(t),De()}catch(s){console.error("Error downloading SVG:",s),Cn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Yn=async()=>{try{const t=ln();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(K=>setTimeout(K,300));const s=Le(),n=he.value,c=nt.value+s.height,f=document.createElement("canvas"),g=f.getContext("2d"),x=2;f.width=n*x,f.height=c*x,f.style.width=n+"px",f.style.height=c+"px",g.scale(x,x),g.fillStyle="#fafafa",g.fillRect(0,0,n,c);let b=30;if(rt.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(rt.value,24,b),b+=30),Qe.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(Qe.value,24,b),b+=25),Ze.value&&_.series.length>0){let K=n-200,Re=rt.value||Qe.value?35:25;const me=Math.floor((n-250)/120);let pe=0;g.font="12px Arial, sans-serif",_.series.forEach((Ne,Ee)=>{if(!kt.value.has(Ee)){const lt=Ht(Ee);g.beginPath(),g.arc(K+6,Re-4,6,0,2*Math.PI),g.fillStyle=lt,g.fill(),g.fillStyle="#333",g.fillText(Ne.name,K+18,Re),pe++,pe%me===0?(K=n-200,Re+=20):K+=Math.min(120,Ne.name.length*8+35)}})}const B=document.querySelector(".dss-chart-svg").cloneNode(!0),T=B.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),E=B.querySelectorAll(".dss-crosshair"),q=B.querySelectorAll('[class*="tooltip"]');T.forEach(K=>K.remove()),E.forEach(K=>K.remove()),q.forEach(K=>K.remove()),B.querySelectorAll("image").forEach((K,Re)=>{const me=K.getAttribute("xlink:href")||K.getAttribute("href");if(me&&!me.startsWith("data:")){const pe=At.value[Re],Ne=pe?Ht(pe.seriesIndex):"#3B82F6",Ee=K.getAttribute("x")||0,lt=K.getAttribute("y")||0,at=K.getAttribute("width")||32,wn=K.getAttribute("height")||32,Ut=document.createElementNS("http://www.w3.org/2000/svg","circle");Ut.setAttribute("cx",parseFloat(Ee)+parseFloat(at)/2),Ut.setAttribute("cy",parseFloat(lt)+parseFloat(wn)/2),Ut.setAttribute("r",Math.min(parseFloat(at),parseFloat(wn))/2-1),Ut.setAttribute("fill",Ne),Ut.setAttribute("stroke","#fafafa"),Ut.setAttribute("stroke-width","2"),K.parentNode.replaceChild(Ut,K)}});const ve=new XMLSerializer().serializeToString(B),Y=new Blob([ve],{type:"image/svg+xml;charset=utf-8"}),ae=URL.createObjectURL(Y),re=new Image;return new Promise((K,Re)=>{re.onload=async()=>{try{if(g.drawImage(re,0,s.height),At.value.forEach(me=>{const pe=me.x,Ne=me.y+s.height,Ee=(me.width||32)/2,lt=Ht(me.seriesIndex);g.save(),g.beginPath(),g.arc(pe,Ne,Ee-1,0,2*Math.PI),g.fillStyle=lt,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),P.value){const me=new Image,pe=()=>{const{width:Ee,height:lt}=We.value,at=ke.value,wn=H.value.left,Ut=H.value.right,uo=H.value.top,Ol=H.value.bottom,jl=H.value.width,Kl=H.value.height;let Xo,Yo;switch(at){case"center":Xo=wn+(jl-Ee)/2,Yo=uo+s.height+(Kl-lt)/2;break;case"top-left":Xo=wn+15,Yo=uo+s.height+10;break;case"top-right":Xo=Ut-Ee-5,Yo=uo+s.height+10;break;case"bottom-left":Xo=wn+15,Yo=Ol+s.height-lt-5;break;case"bottom-right":default:Xo=Ut-Ee-5,Yo=Ol+s.height-lt-5;break}g.globalAlpha=A.value,g.drawImage(me,Xo,Yo,Ee,lt),g.globalAlpha=1,Ne()},Ne=()=>{f.toBlob(Ee=>{const lt=URL.createObjectURL(Ee),at=document.createElement("a");at.href=lt,at.download=zo("png"),document.body.appendChild(at),at.click(),document.body.removeChild(at),URL.revokeObjectURL(lt),URL.revokeObjectURL(ae),Cn(t),De(),K()},"image/png")};me.onload=pe,me.onerror=Ne,me.src=$n.value}else f.toBlob(me=>{const pe=URL.createObjectURL(me),Ne=document.createElement("a");Ne.href=pe,Ne.download=zo("png"),document.body.appendChild(Ne),Ne.click(),document.body.removeChild(Ne),URL.revokeObjectURL(pe),URL.revokeObjectURL(ae),Cn(t),De(),K()},"image/png")}catch(me){URL.revokeObjectURL(ae),Cn(t),Re(me)}},re.onerror=()=>{URL.revokeObjectURL(ae),Cn(t),Re(new Error("Failed to load SVG image"))},re.src=ae})}catch(t){console.error("Error downloading PNG:",t)}},so=()=>{try{let t="";rt.value&&(t+=`# ${D("chart.csv.chartTitle")}: ${rt.value}
|
|
74
74
|
`),Qe.value&&(t+=`# ${D("chart.csv.chartSubtitle")}: ${Qe.value}
|
|
75
75
|
`),t+=`# ${D("chart.csv.generated")}: ${new Date().toLocaleString()}
|
|
76
76
|
|
|
77
77
|
`,t+="Category",_.series.forEach(g=>{const x=g.name.replace(/"/g,'""');t+=',"'+x+'"'}),t+=`
|
|
78
78
|
`;const s=Math.max(..._.series.map(g=>g.data?.length||0));for(let g=0;g<s;g++){let M='"'+(_.categories[g]||D("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';_.series.forEach(B=>{const T=B.data&&B.data[g]!==void 0?B.data[g]:"";M+=","+T}),t+=M+`
|
|
79
|
-
`}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(n),f=document.createElement("a");f.href=c,f.download=zo("csv"),document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(c),De()}catch(t){console.error("Error downloading CSV:",t)}},ro=t=>{if(typeof t.action=="function"){const s={series:_.series,categories:_.categories,markers:Ct.value},n={chartX:$e.value.chartX,chartY:$e.value.chartY,dataX:$e.value.mouseDataX,dataY:$e.value.mouseDataY,categoryIndex:clampedCategoryIndex||$e.value.categoryIndex};t.action(s,n)}De()},En=()=>{ao(),de.value.show=!0,de.value.categoryIndex=$e.value.categoryIndex,de.value.fromButton=!1,De()},Ko=()=>{ao(),de.value.show=!0,de.value.categoryIndex=0,de.value.fromButton=!0},xo=t=>{if($e.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&($e.value.show=!1)}},Go=t=>{$e.value.show&&!t.target.closest(".context-menu")&&($e.value.show=!1)},Qo=t=>{if(!Qt.value||!Rt.value)return;t.preventDefault(),t.stopPropagation(),I.value.isZooming=!0,He.value.show=!1,I.value.zoomTimeout&&clearTimeout(I.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),c=t.clientX-n.left,f=t.clientY-n.top;if(c<L.value.left-50||c>L.value.right+50||f<L.value.top-50||f>L.value.bottom+100){I.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,x=Math.max(I.value.minScale,Math.min(I.value.maxScale,I.value.scale*g));if(x!==I.value.scale){const{minX:b,maxX:M}=Mt.value,B=M-b||1,T=B/I.value.scale,E=b-I.value.offsetX/L.value.width*B,q=(c-L.value.left)/L.value.width,ee=E+q*T;I.value.scale=x;const ve=B/I.value.scale,Y=ee-q*ve;I.value.offsetX=-(Y-b)/B*L.value.width,I.value.scale<=1.01&&(I.value.scale=1,I.value.offsetX=0)}I.value.zoomTimeout=setTimeout(()=>{I.value.isZooming=!1,I.value.zoomTimeout=null},300)},Cl=t=>{if(!Qt.value||!Rt.value||I.value.scale<=1)return;He.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,I.value.isDragging=!0,I.value.lastMouseX=t.clientX,I.value.lastMouseY=t.clientY,t.preventDefault()},Tl=()=>{I.value.isDragging=!1},Jo=()=>{!Qt.value||!Rt.value||(I.value.scale=1,I.value.offsetX=0,I.value.isDragging=!1,I.value.zoomTimeout&&(clearTimeout(I.value.zoomTimeout),I.value.zoomTimeout=null),I.value.isZooming=!1)},bl=()=>!Qt.value||!To.value||!Rt.value?"default":I.value.isDragging?"grabbing":I.value.scale>1?"grab":"dss-crosshair",el=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 s=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const c=t[Math.max(n-1,0)],f=t[n],g=t[n+1],x=t[Math.min(n+2,t.length-1)],b=f.x+(g.x-c.x)/6*Z.value,M=f.y+(g.y-c.y)/6*Z.value,B=g.x-(x.x-f.x)/6*Z.value,T=g.y-(x.y-f.y)/6*Z.value;s+=` C ${b} ${M} ${B} ${T} ${g.x} ${g.y}`}return s},bn=e.computed(()=>{const s=z.value?.chart?.padding,n=typeof s=="number"?s:null,c=s&&typeof s=="object"?s:null,f=50;let g=f+(Xt.value?30:0)+60;if(jn.value){const E={left:f+40,top:f+40,right:f+40,bottom:f+40};return n!=null?{left:n,top:n,right:n,bottom:n}:c?{left:c.left??E.left,top:c.top??E.top,right:c.right??E.right,bottom:c.bottom??E.bottom}:E}if(mn.value){const E=!Ze.value,q=xn.value,ee=q?to.value+Ln.value+Math.max(24,on.value+16):0,ve=E?12:f;let Y=0;rt.value&&(Y+=E?8:15),Qe.value&&(Y+=E?6:10);const ae=Le();let re=ve+(E?4:16)+(q?ee:0),K=ve+(q?ee:0);Ze.value&&Ve.value==="left"?re+=ae.legendWidth||150:Ze.value&&Ve.value==="right"&&(K+=ae.legendWidth||150);const me=te.value==="semi-radial"?q?ee:8:q?ee:E?8:f+80,pe=q?14:0,Ne=ve+Y+pe,Ee={left:re,top:Ne,right:K,bottom:me};return n!=null?{left:n,top:n,right:n,bottom:n}:c?{left:c.left??Ee.left,top:c.top??Ee.top,right:c.right??Ee.right,bottom:c.bottom??Ee.bottom}:Ee}let x=0;rt.value&&(x+=15),Qe.value&&(x+=10);const b=Le();let M=f+16,B=f;Ze.value&&Ve.value==="left"?M+=b.legendWidth||150:Ze.value&&Ve.value==="right"&&(B+=b.legendWidth||150),Ze.value&&Ve.value==="bottom"&&(g+=b.legendHeight||0);const T={left:M,top:f+x,right:B,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:c?{left:c.left??T.left,top:c.top??T.top,right:c.right??T.right,bottom:c.bottom??T.bottom}:T}),L=e.computed(()=>({left:bn.value.left,top:bn.value.top,right:ye.value-bn.value.right,bottom:nt.value-bn.value.bottom,width:ye.value-(bn.value.left+bn.value.right),height:nt.value-(bn.value.top+bn.value.bottom)})),Qt=e.computed(()=>["line","area","bar"].includes(te.value)||pn.value),Bn=e.computed(()=>pn.value),mn=e.computed(()=>["radial","semi-radial"].includes(te.value)),jn=e.computed(()=>te.value==="spider"),Lt=e.computed(()=>te.value==="bubble"),Kt=e.computed(()=>z.value?.chart?.orientation==="horizontal"&&(te.value==="bar"||Bn.value)),Kn=t=>{const{minY:s,maxY:n}=Mt.value,c=n-s||1;return L.value.left+(t-s)/c*L.value.width},vo=t=>{const{maxX:s}=Mt.value,n=s+1,f=L.value.height/n;return L.value.top+(t+.5)*f},vt=e.computed(()=>mn.value?bn.value.left+(ye.value-bn.value.left-bn.value.right)/2:ye.value/2),ft=e.computed(()=>jn.value?nt.value/2-40:mn.value?bn.value.top+(nt.value-bn.value.top-bn.value.bottom)/2:nt.value/2),Je=e.computed(()=>{if(jn.value){const t=L.value.width-80,s=L.value.height-80;return Math.min(t,s)/2}return Math.min(L.value.width,L.value.height)/2}),wt=e.computed(()=>{const t=z.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof s=="number"&&s>=0&&s<=1?s:.45;return Je.value*n}),Po=e.computed(()=>{const t=z.value,s=typeof _.innerSize=="number"?_.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(mn.value||jn.value)?1:1+s/100}),$o=e.computed(()=>{const t=Po.value;if(t===1||t<=0)return;const s=vt.value,n=ft.value;return`translate(${s}, ${n}) scale(${t}) translate(${-s}, ${-n})`}),Lo=e.ref(0),tl=e.computed(()=>`semi-radial-fill-clip-${_.chartId}`),io=e.computed(()=>te.value==="semi-radial"),Zn=e.computed(()=>io.value&&ge.value&&!Mn.value),Dn=e.computed(()=>io.value&&ge.value&&!Mn.value&&et.value==="fill"),fo=e.computed(()=>{const t=Zn.value?Lo.value:1,s=vt.value,n=ft.value,c=wt.value,f=Je.value,g=Math.PI,x=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;const b=s+f*Math.cos(g),M=n+f*Math.sin(g),B=s+f*Math.cos(x),T=n+f*Math.sin(x),E=s+c*Math.cos(x),q=n+c*Math.sin(x),ee=s+c*Math.cos(g),ve=n+c*Math.sin(g),Y=t>.5?1:0;return`M ${s} ${n} L ${b} ${M} A ${f} ${f} 0 ${Y} 1 ${B} ${T} L ${E} ${q} A ${c} ${c} 0 ${Y} 1 ${ee} ${ve} Z`}),Eo=e.computed(()=>{if(!(!io.value||!Zn.value)&&!Dn.value)return`url(#${tl.value})`}),Ft=t=>{if(!(!Dn.value||t!==0))return`url(#${tl.value})`},co=e.ref(0),nl=e.computed(()=>`radial-reveal-clip-${_.chartId}`),hn=e.computed(()=>te.value==="radial"),go=e.computed(()=>{const t=hn.value?co.value:1,s=vt.value,n=ft.value,c=Math.max(Je.value*1.5,ye.value,nt.value);if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;if(t>=1){const E=s-c,q=s+c;return`M ${E} ${n} A ${c} ${c} 0 0 1 ${q} ${n} A ${c} ${c} 0 0 1 ${E} ${n} Z`}const f=-Math.PI/2,g=f+t*Math.PI*2,x=s+c*Math.cos(f),b=n+c*Math.sin(f),M=s+c*Math.cos(g),B=n+c*Math.sin(g),T=t>=.5?1:0;return`M ${s} ${n} L ${x} ${b} A ${c} ${c} 0 ${T} 1 ${M} ${B} Z`}),Vo=e.computed(()=>{if(Eo.value)return Eo.value;if(hn.value)return`url(#${nl.value})`});let Rn=null;const So=()=>{if(!Zn.value)return;Lo.value=0;const t=Se.value,s=performance.now(),n=c=>{const f=c-s,g=Math.min(1,f/t);Lo.value=Uo(mt.value,g),g<1&&(Rn=requestAnimationFrame(n))};Rn=requestAnimationFrame(n)},wl=e.computed(()=>z.value?.bubbles?.minSize||8),$l=e.computed(()=>z.value?.bubbles?.maxSize||50),No=e.computed(()=>z.value?.bubbles?.opacity||.7),ol=(t,s)=>{const n=[15,20,25,18,22],c=n[t%n.length]||20,f=1+Math.sin(s*.5)*.2;return Math.max(5,c*f)},Ho=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},xl=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Gn=e.computed(()=>_.series),ho=e.computed(()=>_.series.filter((t,s)=>!kt.value.has(s))),In="auto",Mt=e.computed(()=>{if(Lt.value)return ll();if(!ho.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,n=0;ho.value.forEach(b=>{b.data&&b.data.length&&(n=Math.max(n,b.data.length-1),b.data.forEach(M=>{typeof M=="number"&&(t=Math.min(t,M),s=Math.max(s,M))}))}),_.categories.length>0&&(n=Math.max(n,_.categories.length-1)),t===1/0&&(t=0,s=100);const c=xe.value,f=J.value;let g,x;if(c===In){const b=s-t,M=b>0?b*.1:1;g=Math.max(0,t-M)}else if(typeof c=="number")g=c;else{const b=s-t,M=b>0?b*.1:1;g=Math.max(0,t-M)}if(f===In){const b=s-t,M=b>0?b*.1:2;x=s+M}else if(typeof f=="number")x=f;else{const b=s-t,M=b>0?b*.1:2;x=s+M}return{minX:0,maxX:n,minY:g,maxY:x}}),ll=()=>{if(!ho.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,n=1/0,c=-1/0,f=1/0,g=-1/0,x=!1;if(ho.value.forEach((ee,ve)=>{ee?.data?.length&&ee.data.forEach((Y,ae)=>{let re,K,Re;if(typeof Y=="object"&&Y!==null&&!Array.isArray(Y))re=typeof Y.x=="number"?Y.x:ae,K=typeof Y.y=="number"?Y.y:0,Re=typeof Y.size=="number"?Y.size:20;else if(Array.isArray(Y)&&Y.length>=3)re=typeof Y[0]=="number"?Y[0]:ae,K=typeof Y[1]=="number"?Y[1]:0,Re=typeof Y[2]=="number"?Y[2]:20;else if(typeof Y=="number")re=ae,K=Y,Re=ol(ve,ae);else return;isFinite(re)&&isFinite(K)&&isFinite(Re)&&(t=Math.min(t,re),s=Math.max(s,re),n=Math.min(n,K),c=Math.max(c,K),f=Math.min(f,Re),g=Math.max(g,Re),x=!0)})}),!x)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,_.categories?.length-1||8)),n===c&&(n=Math.max(0,n-10),c=n+20);const b=s-t,M=c-n;let B,T,E,q;return oe.value!==null?B=oe.value:B=t-b*.1,Ye.value!==null?T=Ye.value:T=s+b*.1,xe.value!==null&&typeof xe.value=="number"?E=xe.value:E=Math.max(0,n-M*.1),J.value!==null&&typeof J.value=="number"?q=J.value:q=c+M*.1,{minX:B,maxX:T,minY:E,maxY:q,minSize:f,maxSize:g}},zt=t=>{if(Lt.value){const{minX:b,maxX:M}=Mt.value,B=M-b||1;return L.value.left+(t-b)/B*L.value.width}const{minX:s,maxX:n}=Mt.value,c=n-s;if(n===0||c===0)return L.value.left+L.value.width/2;const f=c/I.value.scale,g=s-I.value.offsetX/L.value.width*c,x=(t-g)/f;return L.value.left+x*L.value.width},Jt=t=>{const{minY:s,maxY:n}=Mt.value,c=n-s||1;return L.value.bottom-(t-s)/c*L.value.height},al=t=>{if(!Lt.value)return tt.value||4;const{maxSize:s}=Mt.value,n=Math.max(1,s),c=Math.min(1,Math.max(0,t/n));return wl.value+c*($l.value-wl.value)},El=e.computed(()=>rl.value.map(t=>({y:t.y}))),sl=e.computed(()=>{if(Lt.value)return Vl();if(te.value==="bar"){if(Kt.value){const me=[],{minY:pe,maxY:Ne}=Mt.value,Ee=5,lt=Ne-pe||1;for(let at=0;at<=Ee;at++){const wn=pe+lt*(at/Ee),Ut=Kn(wn);me.push({x:Ut,y:L.value.bottom+20,text:dn(Math.round(wn))})}return me}const ve=[],{maxX:Y}=Mt.value,ae=Y+1,re=5,Re=(L.value.width-re*2)/ae;for(let me=0;me<=Y;me++){const pe=L.value.left+re+(me+.5)*Re;ve.push({x:pe,y:L.value.bottom+20,text:_.categories[me]||D("chart.fallback.item",{number:me+1})})}return ve}const t=[],{minX:s,maxX:n}=Mt.value,c=n-s||1,f=c/I.value.scale,g=s-I.value.offsetX/L.value.width*c,x=g+f,b=Math.max(0,Math.floor(g-2)),M=Math.min(n,Math.ceil(x+2)),B=M-b,T=L.value.width,q=Math.floor(T/60);let ee=1;B>q&&(ee=Math.ceil(B/q));for(let ve=b;ve<=M;ve+=ee)if(ve>=0&&ve<=n){const Y=zt(ve);Y>=L.value.left-100&&Y<=L.value.right+100&&t.push({x:Y,y:L.value.bottom+20,text:_.categories[ve]||`Item ${ve+1}`})}return t}),Vl=()=>{const t=[],{minX:s,maxX:n}=Mt.value,c=n-s||1,f=Math.min(8,Math.max(4,Math.floor(L.value.width/80)));for(let g=0;g<=f;g++){const x=s+c*g/f,b=zt(x);if(b>=L.value.left-10&&b<=L.value.right+10){const M=Math.round(x),B=_.categories?.[M];t.push({x:b,y:L.value.bottom+20,text:B||(Number.isInteger(x)?x.toString():x.toFixed(1))})}}return t},rl=e.computed(()=>{if(Kt.value){const f=[],{maxX:g}=Mt.value;for(let x=0;x<=g;x++)f.push({x:L.value.left-10,y:vo(x),text:_.categories[x]||`Item ${x+1}`});return f}const t=[],{minY:s,maxY:n}=Mt.value,c=5;for(let f=0;f<=c;f++){const g=s+(n-s)*(f/c),x=Math.round(g);t.push({x:L.value.left-10,y:Jt(g),text:dn(x)})}return t}),Ht=t=>{const s=Q.value;if(!s||s.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return s[t%s.length]},Ao=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let n=0,c=0,f=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,c=Number(g[2])/255,f=Number(g[3])/255;else{const b=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)n=Number(b[1])/255,c=Number(b[2])/255,f=Number(b[3])/255;else{const M=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(M){let B=M[1];B.length===3&&(B=B[0]+B[0]+B[1]+B[1]+B[2]+B[2]),n=parseInt(B.slice(0,2),16)/255,c=parseInt(B.slice(2,4),16)/255,f=parseInt(B.slice(4,6),16)/255}else if(typeof document<"u"){const B=document.createElement("span");B.style.color=s,B.style.display="none",document.body.appendChild(B);const T=getComputedStyle(B).color;document.body.removeChild(B);const E=T.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(E)n=Number(E[1])/255,c=Number(E[2])/255,f=Number(E[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*c+.0722*f>.5?"#3a3a3a":"#fafafa"},qn=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),n=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const g=Math.max(0,Math.floor(Number(n[1])*.65)),x=Math.max(0,Math.floor(Number(n[2])*.65)),b=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${x}, ${b})`}const c=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(c){const g=Math.max(0,Math.floor(Number(c[1])*.65)),x=Math.max(0,Math.floor(Number(c[2])*.65)),b=Math.max(0,Math.floor(Number(c[3])*.65));return`rgba(${g}, ${x}, ${b}, ${c[4]})`}const f=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(f){let g=f[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const x=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),M=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[x,b,M].map(B=>B.toString(16).padStart(2,"0")).join("")}`}return s},Do=(t,s)=>{const c=z.value?.stroke?.color;return c==null?qn(s):typeof c=="string"?c:Array.isArray(c)&&c.length?c[t%c.length]??qn(s):qn(s)},Oo=t=>{let s=0;for(let n=1;n<t.length;n++){const c=t[n].x-t[n-1].x,f=t[n].y-t[n-1].y;s+=Math.sqrt(c*c+f*f)}return s},Sl=e.computed(()=>te.value==="line"||Bn.value?(Bn.value?_.series.filter(s=>(s.type||te.value)==="line"):Gn.value).map((s,n)=>{const c=_.series.findIndex(E=>E===s),f=[];let g=[];s.data.forEach((E,q)=>{E==null?g.length>0&&(f.push([...g]),g=[]):g.push({x:Kt.value?Kn(E):zt(q),y:Kt.value?vo(q):Jt(E),index:q})}),g.length>0&&f.push(g);let x="";f.forEach(E=>{if(E.length>0){let q="";O.value?q=el(E):q=`M ${E[0].x} ${E[0].y}`+E.slice(1).map(ee=>` L ${ee.x} ${ee.y}`).join(""),x+=(x?" ":"")+q}});const b=f.reduce((E,q)=>E+Oo(q),0),M=kt.value.has(c),B=ce.value===c,T=ce.value!==null&&ce.value!==c;return{path:x,color:Ht(c),pathLength:b,seriesIndex:c,animationDelay:n*Et.value,isHighlighted:B,isDimmed:T,isHidden:M}}):[]),Nl=e.computed(()=>{if(!(te.value==="line"||Bn.value))return[];const t=Bn.value?_.series.filter(n=>(n.type||te.value)==="line"):Gn.value,s=[];return t.forEach((n,c)=>{const f=_.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const x=n.data[g];if(x!=null){let b=-1,M=0;for(let B=g+1;B<n.data.length;B++){const T=n.data[B];if(T==null)M++;else{b=B;break}}if(M>0&&b!==-1){const B=n.data[b],T=Kt.value?Kn(x):zt(g),E=Kt.value?vo(g):Jt(x),q=Kt.value?Kn(B):zt(b),ee=Kt.value?vo(b):Jt(B),ve=kt.value.has(f),Y=ce.value===f,ae=ce.value!==null&&ce.value!==f;s.push({path:`M ${T} ${E} L ${q} ${ee}`,color:Ht(f),seriesIndex:f,animationDelay:c*Et.value,isHighlighted:Y,isDimmed:ae,isHidden:ve,gapSize:M}),g=b-1}}}}),s}),Ll=e.computed(()=>te.value==="line"||Bn.value?!ge.value||Mn.value||it.value.hasAnimated?[]:(Bn.value?_.series.filter(s=>(s.type||te.value)==="line"):Gn.value).map((s,n)=>{const c=_.series.findIndex(M=>M===s);let f="",g=null;s.data.forEach((M,B)=>{if(M!=null){const T={x:Kt.value?Kn(M):zt(B),y:Kt.value?vo(B):Jt(M)};g===null?f+=`M ${T.x} ${T.y}`:f+=` L ${T.x} ${T.y}`,g=T}else if(g!==null){const T=s.data.findIndex((E,q)=>q>B&&E!==null&&E!==void 0);if(T!==-1){const E={x:Kt.value?Kn(s.data[T]):zt(T),y:Kt.value?vo(T):Jt(s.data[T])};f+=` L ${E.x} ${E.y}`,g=E}}});const x=s.data.map((M,B)=>M==null?null:{x:Kt.value?Kn(M):zt(B),y:Kt.value?vo(B):Jt(M)}).filter(M=>M!==null),b=Oo(x);return{path:f,pathLength:b,color:Ht(c),animationDelay:n*Et.value,seriesIndex:c}}):[]),Wo=e.computed(()=>{if(te.value!=="line")return[];const t=[];return Gn.value.forEach((s,n)=>{const c=ce.value===n,f=ce.value!==null&&ce.value!==n,g=kt.value.has(n);s.data.forEach((x,b)=>{x!=null&&t.push({x:zt(b),y:Jt(x),color:Ht(n),value:x,label:_.categories[b]||b.toString(),seriesName:s.name,categoryIndex:b,dataIndex:b,animationDelay:(n*s.data.length+b)*(Et.value/8),isHighlighted:c,isDimmed:f,isHidden:g})})}),t}),Fn=e.computed(()=>{if(!Bn.value)return[];const t=[];return _.series.filter(n=>(n.type||te.value)==="line").forEach((n,c)=>{const f=_.series.findIndex(M=>M===n),g=ce.value===f,x=ce.value!==null&&ce.value!==f,b=kt.value.has(f);n.data.forEach((M,B)=>{M!=null&&t.push({x:zt(B),y:Jt(M),color:Ht(f),value:M,label:_.categories[B]||B.toString(),seriesName:n.name,categoryIndex:B,dataIndex:B,animationDelay:(c*n.data.length+B)*(Et.value/8),isHighlighted:g,isDimmed:x,isHidden:b})})}),t}),Zo=e.computed(()=>{if(!Lt.value)return[];const t=[];return Gn.value.forEach((s,n)=>{if(!s?.data?.length)return;const c=ce.value,f=c!==null&&c===n,g=c!==null&&c!==n,x=kt.value.has(n);s.data.forEach((b,M)=>{let B,T,E,q,ee;if(typeof b=="object"&&b!==null&&!Array.isArray(b))B=typeof b.x=="number"?b.x:M,T=typeof b.y=="number"?b.y:0,E=typeof b.size=="number"?b.size:20,q=b.label||_.categories?.[M]||`Point ${M+1}`,ee=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)B=typeof b[0]=="number"?b[0]:M,T=typeof b[1]=="number"?b[1]:0,E=typeof b[2]=="number"?b[2]:20,q=b[3]||_.categories?.[M]||`Point ${M+1}`,ee=b[4];else if(typeof b=="number")B=M,T=b,E=ol(n,M),q=_.categories?.[M]||`Point ${M+1}`;else return;!isFinite(B)||!isFinite(T)||!isFinite(E)||t.push({x:zt(B),y:Jt(T),radius:al(E),originalX:B,originalY:T,originalSize:E,color:Ht(n),seriesName:s.name||`Series ${n+1}`,label:q,imageUrl:ee,seriesIndex:n,dataIndex:M,categoryIndex:Math.round(B),isHighlighted:f,isDimmed:g,isHidden:x,opacity:No.value})})}),t}),Qn=e.computed(()=>te.value!=="area"?[]:Gn.value.map((t,s)=>{const n=[];let c=[];if(t.data.forEach((E,q)=>{E==null?c.length>0&&(n.push([...c]),c=[]):c.push({x:zt(q),y:Jt(E),index:q})}),c.length>0&&n.push(c),n.length===0)return{linePath:"",areaPath:"",color:Ht(s),isHidden:kt.value.has(s)};const f=L.value.bottom+1;let g="",x="";n.forEach((E,q)=>{if(E.length===0)return;let ee=`M ${E[0].x} ${E[0].y}`;O.value&&E.length>1?ee=el(E):E.slice(1).forEach(Y=>{ee+=` L ${Y.x} ${Y.y}`}),g+=(g?" ":"")+ee;let ve=`M ${E[0].x} ${f}`;if(ve+=` L ${E[0].x} ${E[0].y}`,O.value&&E.length>1){const Y=el(E),ae=Y.substring(Y.indexOf("C")||Y.indexOf("Q")||Y.indexOf("L"));ae?ve+=" "+ae:E.slice(1).forEach(re=>{ve+=` L ${re.x} ${re.y}`})}else E.slice(1).forEach(Y=>{ve+=` L ${Y.x} ${Y.y}`});ve+=` L ${E[E.length-1].x} ${f} Z`,x+=(x?" ":"")+ve});const b=ce.value===s,M=ce.value!==null&&ce.value!==s,B=kt.value.has(s),T=n.reduce((E,q)=>E+Oo(q),0);return{linePath:g,areaPath:x,color:Ht(s),pathLength:T,isHighlighted:b,isDimmed:M,isHidden:B}})),qo=e.computed(()=>{if(!(["bar"].includes(te.value)||Bn.value))return[];const t=[],{maxX:s}=Mt.value,n=Bn.value?_.series.filter(f=>(f.type||te.value)==="bar"):Gn.value,c=n.length;if(Kt.value){const f=s+1,x=L.value.height/f,b=x*(2/3),M=Math.min(4,b/c*.15),B=b-(c-1)*M,T=Math.max(4,B/c);n.forEach((E,q)=>{const ee=_.series.findIndex(re=>re===E),ve=ce.value===ee,Y=ce.value!==null&&ce.value!==ee,ae=kt.value.has(ee);E.data.forEach((re,K)=>{if(re==null||typeof re!="number"||!isFinite(re))return;const pe=L.value.top+(K+.5)*x-b/2+q*(T+M),Ne=L.value.left,Ee=Math.abs(Kn(re)-L.value.left);let lt="";if(O.value&&Ee>0){const at=Math.min(X.value,T/2,Ee/2);lt=[`M ${Ne} ${pe}`,`L ${Ne+Ee-at} ${pe}`,`Q ${Ne+Ee} ${pe} ${Ne+Ee} ${pe+at}`,`L ${Ne+Ee} ${pe+T-at}`,`Q ${Ne+Ee} ${pe+T} ${Ne+Ee-at} ${pe+T}`,`L ${Ne} ${pe+T}`,"Z"].join(" ")}t.push({x:Ne,y:pe,width:Ee,height:T,color:Ht(c===1?K:ee),value:re,label:_.categories[K]||K.toString(),seriesName:E.name,animationDelay:(q*n.length+K)*(Et.value/4),isHighlighted:ve,isDimmed:Y,isHidden:ae,barPath:lt,isSmooth:O.value&&Ee>0})})})}else{const f=s+1,x=L.value.width/f,b=x*.8,M=b/c,B=M*.05,T=M-B;n.forEach((E,q)=>{const ee=_.series.findIndex(re=>re===E),ve=ce.value===ee,Y=ce.value!==null&&ce.value!==ee,ae=kt.value.has(ee);E.data.forEach((re,K)=>{if(re==null||typeof re!="number"||!isFinite(re))return;const pe=L.value.left+(K+.5)*x-b/2+q*M+B/2,Ne=Jt(Math.max(0,re)),Ee=Math.abs(Jt(0)-Jt(re));let lt="";if(O.value&&Ee>0){const at=Math.min(X.value,T/2,Ee/2);lt=[`M ${pe} ${Ne+Ee}`,`L ${pe} ${Ne+at}`,`Q ${pe} ${Ne} ${pe+at} ${Ne}`,`L ${pe+T-at} ${Ne}`,`Q ${pe+T} ${Ne} ${pe+T} ${Ne+at}`,`L ${pe+T} ${Ne+Ee}`,"Z"].join(" ")}t.push({x:pe,y:Ne,width:T,height:Ee,color:Ht(c===1?K:ee),value:re,label:_.categories[K]||K.toString(),seriesName:E.name,animationDelay:(q*n.length+K)*(Et.value/4),isHighlighted:ve,isDimmed:Y,isHidden:ae,barPath:lt,isSmooth:O.value&&Ee>0})})})}return t}),yo=e.computed(()=>{if(!mn.value)return[];const t=Gn.value.map((g,x)=>({series:g,originalIndex:x})).filter(({originalIndex:g})=>!kt.value.has(g));if(t.length===0)return[];let s=te.value==="semi-radial"?Math.PI:-Math.PI/2;const n=te.value==="semi-radial"?Math.PI:Math.PI*2,c=[];if(t.length===1){const{series:g,originalIndex:x}=t[0],b=g.data[0]||0,M=s,B=s+n-.001,T=M+n/2,E=vt.value+Math.cos(M)*wt.value,q=ft.value+Math.sin(M)*wt.value,ee=vt.value+Math.cos(B)*wt.value,ve=ft.value+Math.sin(B)*wt.value,Y=vt.value+Math.cos(B)*Je.value,ae=ft.value+Math.sin(B)*Je.value,re=vt.value+Math.cos(M)*Je.value,K=ft.value+Math.sin(M)*Je.value,Re=1,me=[`M ${E} ${q}`,`A ${wt.value} ${wt.value} 0 ${Re} 1 ${ee} ${ve}`,`L ${Y} ${ae}`,`A ${Je.value} ${Je.value} 0 ${Re} 0 ${re} ${K}`,"Z"].join(" "),pe=Ht(x);return c.push({path:me,color:pe,strokeWidth:nn.value,strokeColor:Do(0,pe),value:b,seriesName:g.name,opacity:.8,isHighlighted:ce.value===x,isDimmed:!1,isHidden:!1,startAngle:M,endAngle:B,midAngle:T}),c}if(Dn.value&&t.length===2){const g=t[0],x=t[1],b=Math.min(100,Math.max(0,g.series.data[0]||0)),M=b/100*n,B=(T,E,q,ee,ve)=>{const Y=T+(E-T)/2,ae=E-T,re=vt.value+Math.cos(T)*wt.value,K=ft.value+Math.sin(T)*wt.value,Re=vt.value+Math.cos(E)*wt.value,me=ft.value+Math.sin(E)*wt.value,pe=vt.value+Math.cos(E)*Je.value,Ne=ft.value+Math.sin(E)*Je.value,Ee=vt.value+Math.cos(T)*Je.value,lt=ft.value+Math.sin(T)*Je.value,at=ae>Math.PI?1:0,wn=[`M ${re} ${K}`,`A ${wt.value} ${wt.value} 0 ${at} 1 ${Re} ${me}`,`L ${pe} ${Ne}`,`A ${Je.value} ${Je.value} 0 ${at} 0 ${Ee} ${lt}`,"Z"].join(" "),Ut=Ht(ee);return{path:wn,color:Ut,strokeWidth:nn.value,strokeColor:Do(c.length,Ut),value:ve,seriesName:q.name,opacity:.8,isHighlighted:ce.value===ee,isDimmed:ce.value!==null&&ce.value!==ee,isHidden:!1,startAngle:T,endAngle:E,midAngle:Y}};return c.push(B(s,s+M,g.series,g.originalIndex,b)),c.push(B(s,s+n,x.series,x.originalIndex,100)),c}const f=t.reduce((g,{series:x})=>g+(x.data[0]||0),0);return f===0?[]:(t.forEach(({series:g,originalIndex:x})=>{const b=g.data[0]||0,M=b/f*n,B=s,T=s+M,E=B+M/2,q=vt.value+Math.cos(B)*wt.value,ee=ft.value+Math.sin(B)*wt.value,ve=vt.value+Math.cos(T)*wt.value,Y=ft.value+Math.sin(T)*wt.value,ae=vt.value+Math.cos(T)*Je.value,re=ft.value+Math.sin(T)*Je.value,K=vt.value+Math.cos(B)*Je.value,Re=ft.value+Math.sin(B)*Je.value,me=M>Math.PI?1:0,pe=[`M ${q} ${ee}`,`A ${wt.value} ${wt.value} 0 ${me} 1 ${ve} ${Y}`,`L ${ae} ${re}`,`A ${Je.value} ${Je.value} 0 ${me} 0 ${K} ${Re}`,"Z"].join(" "),Ne=Ht(x);c.push({path:pe,color:Ne,strokeWidth:nn.value,strokeColor:Do(c.length,Ne),value:b,seriesName:g.name,opacity:.8,isHighlighted:ce.value===x,isDimmed:ce.value!==null&&ce.value!==x,isHidden:!1,startAngle:B,endAngle:T,midAngle:E}),s=T}),c)}),Bl=e.computed(()=>{const t=yo.value;return Dn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,n)=>({segment:s,originalIndex:n}))}),Ml=e.computed(()=>{if(!xn.value||!mn.value)return[];const t=on.value,s=to.value,n=Ln.value,c=un.value,f=15,g=t*1.3,x=.55,b=(E,q)=>{const ee=vt.value+Math.cos(E.midAngle)*Je.value,ve=ft.value+Math.sin(E.midAngle)*Je.value,Y=vt.value+Math.cos(E.midAngle)*(Je.value+s),ae=ft.value+Math.sin(E.midAngle)*(Je.value+s),K=Y+n*(q?1:-1),Re=q?Y+f:Y-f,me=ae-c,pe=`${E.seriesName}: ${dn(E.value)}`,Ne=pe.length*t*x;return{pointerStartX:ee,pointerStartY:ve,pointerEndX:Y,pointerEndY:ae,horizontalEndX:K,horizontalEndY:ae,textX:Re,textY:me,text:pe,textWidth:Ne,textAnchor:q?"start":"end",isRightSide:q,pointerLineLength:Math.hypot(Y-ee,ae-ve),horizontalLineLength:Math.hypot(K-Y,0)}},M=(E,q)=>{const ee=Math.abs(E.textY-q.textY)<g,ve=E.isRightSide?E.textX:E.textX-E.textWidth,Y=E.isRightSide?E.textX+E.textWidth:E.textX,ae=q.isRightSide?q.textX:q.textX-q.textWidth,re=q.isRightSide?q.textX+q.textWidth:q.textX,K=ve<re&&ae<Y;return ee&&K},B=yo.value.filter(E=>!E.isHidden),T=[];for(let E=0;E<B.length;E++){const q=B[E];let ee=Math.cos(q.midAngle)>=0;if(E>0){const Y=T[E-1],ae=b(q,ee);M(Y,ae)&&(ee=!ee)}const ve=b(q,ee);T.push({...ve,color:q.color,isHighlighted:q.isHighlighted,isDimmed:q.isDimmed})}return T}),l=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||No.value||.7;return ce.value===null||ce.value===void 0?s:ce.value!==null?t.seriesIndex===ce.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},o=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return ce.value!==null?t.seriesIndex===ce.value?Math.min(1,s+.1):s*.7:s},a=(t,s)=>{if(t)try{if(ce.value===t.seriesIndex?ce.value=null:ce.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:_.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},r=(t,s)=>{const n=[`dss-bubble-fallback-${s}`];return t.isHighlighted&&n.push("dss-bubble-highlighted"),t.isDimmed&&n.push("dss-bubble-dimmed"),t.isHidden&&n.push("dss-bubble-hidden"),n.push(`dss-bubble-series-${t.seriesIndex}`),n.join(" ")},i=(t,s)=>{if(!t||(s.stopPropagation(),zn.value=!0,ce.value=t.seriesIndex,He.value.show=!1,!_t.value))return;const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const c=n.getBoundingClientRect();let f=s.clientX-c.left+10,g=s.clientY-c.top-10;const x=200,b=120;f+x>ye.value&&(f=s.clientX-c.left-x-10),g+b>c.height&&(g=s.clientY-c.top-b-10),f<0&&(f=10),g<0&&(g=10);const M=Hn.value,B=po.value,T=M.map(E=>{const q=B[E]||E,ee=u(E,t);return ee?{seriesName:t.seriesName,label:t.label,value:`${q}: ${ee}`,color:t.color}:null}).filter(Boolean);ze.value={show:!0,x:f,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:T,categoryIndex:void 0,spiderSeries:[]}},u=(t,s)=>{let n;switch(t){case"x":n=s.originalX;break;case"y":n=s.originalY;break;case"size":n=s.originalSize;break;case"label":n=s.label;break;case"seriesName":n=s.seriesName;break;default:n=s[t]||""}const c=_o.value[t];if(typeof c=="function")return c(n,s);if(typeof n=="number"){const f=n.toFixed(1);return Yt.value?f+Yt.value:f}return n?.toString()||""},d=()=>{if(!Lt.value||!He.value.data||He.value.data.length===0)return"Bubbles";const t=[],s=new Set;return He.value.data.forEach(n=>{if(n.seriesName&&n.label){const c=`${n.seriesName} - ${n.label}`;s.has(c)||(t.push(c),s.add(c))}else n.seriesName&&(s.has(n.seriesName)||(t.push(n.seriesName),s.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},m=(t,s)=>{t&&(zn.value=!1,ce.value=null,ze.value.show=!1,ze.value.bubbleData=[])},v=(t,s)=>{const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const c=n.getBoundingClientRect(),f=Fo(t.categoryIndex),g=t.description||t.comment||"";let x=s.clientX-c.left+15,b=s.clientY-c.top-10;const M=200,B=g?80:50;x+M>ye.value&&(x=s.clientX-c.left-M-15),b+B>nt.value&&(b=s.clientY-c.top-B-10),x<0&&(x=10),b<0&&(b=10),jt.value={show:!0,x,y:b,categoryValue:f,description:g}},h=()=>{jt.value.show=!1},S=e.computed(()=>_.categories.length||Math.max(...ho.value.map(t=>t.data.length))),N=e.computed(()=>{let t=0;return ho.value.forEach(s=>{s.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),w=e.computed(()=>{const t=[],s=S.value;for(let n=0;n<s;n++){const c=n*2*Math.PI/s-Math.PI/2,f=vt.value+Math.cos(c)*Je.value,g=ft.value+Math.sin(c)*Je.value;t.push({x:f,y:g,angle:c,index:n})}return t}),U=e.computed(()=>{const t=[],s=S.value;return w.value.forEach((n,c)=>{const f=Je.value+15,g=c*2*Math.PI/s-Math.PI/2,x=vt.value+Math.cos(g)*f,b=ft.value+Math.sin(g)*f+5;let M="middle",B="middle";Math.abs(Math.cos(g))>.5&&(M=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(B=Math.sin(g)>0?"hanging":"auto"),t.push({x,y:b,text:_.categories[c]||`Axis ${c+1}`,anchor:M,baseline:B})}),t}),W=e.ref(new Set),Ce=(t,s,n)=>{const c=`current-${n}`,f=W.value.has(c);return!f&&ce.value===null?s.fillOpacity||Ae.value:s.isHighlighted||f?(s.fillOpacity||Ae.value)+.15:s.isDimmed?(s.fillOpacity||Ae.value)*.3:s.fillOpacity||Ae.value},le=e.computed(()=>{if(!jn.value)return[];const t=[],s=S.value;return Gn.value.forEach((n,c)=>{const f=[],g=[],x=[],b=ce.value===c,M=ce.value!==null&&ce.value!==c,B=kt.value.has(c);for(let T=0;T<s;T++){const E=n.data[T]||0,ee=E/N.value*Je.value,ve=T*2*Math.PI/s-Math.PI/2,Y=vt.value+Math.cos(ve)*ee,ae=ft.value+Math.sin(ve)*ee;f.push(`${Y},${ae}`),g.push({x:Y,y:ae}),x.push({x:Y,y:ae,value:E,label:_.categories[T]||`Axis ${T+1}`,seriesName:n.name})}t.push({points:f.join(" "),polygonPoints:g,dataPoints:x,color:Ht(c),fillOpacity:Ae.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:b,isDimmed:M,isHidden:B,seriesIndex:c})}),t}),Ge=(t,s)=>{if(!s||s.length<3)return!1;let n=!1;for(let c=0,f=s.length-1;c<s.length;f=c++){const g=s[c].x,x=s[c].y,b=s[f].x,M=s[f].y;x>t.y!=M>t.y&&t.x<(b-g)*(t.y-x)/(M-x)+g&&(n=!n)}return n},en=t=>{if(!jn.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const n=s.getBoundingClientRect(),c=Me.value?.getBoundingClientRect();if(!c)return;const f=t.clientX-c.left,g=t.clientY-c.top,x=le.value.filter(b=>b.isHidden?!1:Ge({x:f,y:g},b.polygonPoints));if(x.length>0){x.length,ce.value=x[0].seriesIndex;const b=t.clientX-n.left+10,M=t.clientY-n.top-10,B=200,T=50+x.length*25;let E=b,q=M;E+B>ye.value&&(E=t.clientX-n.left-B-10),q+T>nt.value&&(q=t.clientY-n.top-T-10),E<0&&(E=10),q<0&&(q=10);const ee=x.map(ve=>{let Y=ve.dataPoints[0],ae=1/0;return ve.dataPoints.forEach(re=>{const K=Math.sqrt(Math.pow(re.x-f,2)+Math.pow(re.y-g,2));K<ae&&(ae=K,Y=re)}),{seriesName:ve.seriesName,color:ve.color,value:dn(Y.value!==void 0?Y.value:ve.value)}});ze.value={show:!0,x:E,y:q,title:x.length===1?x[0].seriesName:"",value:"",bubbleData:[],spiderSeries:ee}}else Pn()},At=e.computed(()=>{const t=z.value;return t.logos.map((s,n)=>{const c=_.series[s.seriesIndex];if(!c||!c.data||c.data.length===0||kt.value.has(s.seriesIndex))return null;let f,g;if(Qt.value){let b=-1,M=null;for(let T=c.data.length-1;T>=0;T--)if(c.data[T]!==null&&c.data[T]!==void 0){b=T,M=c.data[T];break}if(b===-1||M===null)return null;const B=c.data.map((T,E)=>T==null?null:{x:zt(E),y:Jt(T),index:E}).filter(T=>T!==null);if(t.animations.enabled&&!Mn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(it.value.isAnimating||!it.value.hasAnimated))if(it.value.isAnimating){const T=it.value.currentFrame/it.value.totalFrames,E=Uo(t.animations.easing,Math.min(T,1)),q=Yl(B,E);f=q.x+(s.offsetX||0),g=q.y+(s.offsetY||0)}else f=B[0].x+(s.offsetX||0),g=B[0].y+(s.offsetY||0);else f=zt(b)+(s.offsetX||0),g=Jt(M)+(s.offsetY||0)}else if(mn.value||jn.value){const b=Math.PI*2/t.logos.length*n;f=vt.value+Math.cos(b)*(Je.value+30)+(s.offsetX||0),g=ft.value+Math.sin(b)*(Je.value+30)+(s.offsetY||0)}return{...s,x:f,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),Pt=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),n&&(n.style.opacity="1")},Gt=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Zt=t=>{kt.value.has(t)?kt.value.delete(t):kt.value.add(t)},qt=e.computed(()=>{if(!ze.value.show&&!(ot.value&&He.value.show&&!I.value.isZooming))return{display:"none"};let t,s;if(ot.value&&He.value.show&&!I.value.isZooming){t=He.value.x+15,s=L.value.top;const n=Lt.value?200:150;t+n>ye.value&&(t=He.value.x-n-15),t<0&&(t=10),s<10&&(s=10)}else t=ze.value.x,s=ze.value.y;return{left:t+"px",top:s+"px"}}),an=(t,s)=>{if(!_t.value||Bo.value)return;const c=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-c.left+10,g=s.clientY-c.top-10;const x=200,b=120,M=ye.value,B=nt.value;f+x>M&&(f=s.clientX-c.left-x-10),g+b>B&&(g=s.clientY-c.top-b-10),f<0&&(f=10),g<0&&(g=10);let T;typeof t.categoryIndex=="number"?T=t.categoryIndex:typeof t.dataIndex=="number"?T=t.dataIndex:t.label&&_.categories.includes(t.label)&&(T=_.categories.indexOf(t.label));const E=(Kt.value||te.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";ze.value={show:!0,x:f,y:g,title:E,value:dn(t.value)||"",categoryIndex:T,spiderSeries:[]}},Un=e.ref(!1),zn=e.ref(!1),Pn=()=>{ze.value.show=!1,ze.value.spiderSeries=[],ze.value.bubbleData=[],He.value.show=!1,Un.value||(ce.value=null)},Bo=e.ref(!1),Ro=(t,s)=>{Bo.value=!0,ze.value.show=!1,He.value.show=!1;const c=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-c.left+15,g=s.clientY-c.top-10;const x=250;f+x>ye.value&&(f=s.clientX-c.left-x-15),f<0&&(f=10),g<0&&(g=10),no.value={show:!0,x:f,y:g,content:t.texts,count:t.totalCount}},Mo=()=>{Bo.value=!1,no.value.show=!1},it=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Uo=(t,s)=>{switch(t){case"linear":return s;case"ease":return s<.5?2*s*s:-1+(4-2*s)*s;case"ease-in":return s*s;case"ease-out":return s*(2-s);case"ease-in-out":return s<.5?2*s*s:-1+(4-2*s)*s;default:return s}},Mn=e.computed(()=>$t.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),il=()=>{if(!ge.value||Mn.value){it.value.hasAnimated=!0,hn.value&&(co.value=1);return}hn.value&&(co.value=0),it.value.isAnimating=!0,it.value.currentFrame=0,it.value.totalFrames=Math.ceil(Se.value/16.67);const t=()=>{const s=it.value.currentFrame/it.value.totalFrames,n=Uo(mt.value,Math.min(s,1));Jn(n),hn.value&&(co.value=n),s<1?(it.value.currentFrame++,it.value.animationId=requestAnimationFrame(t)):eo()};it.value.animationId=requestAnimationFrame(t)},Jn=t=>{const s=document.querySelector(".dss-custom-chart-container");s&&s.style.setProperty("--dss-animation-progress",t)},eo=()=>{it.value.isAnimating=!1,it.value.hasAnimated=!0,hn.value&&(co.value=1),it.value.animationId&&(cancelAnimationFrame(it.value.animationId),it.value.animationId=null)},Vn=e.computed(()=>!mn.value||it.value.hasAnimated?!0:hn.value?co.value>=1:io.value?Lo.value>=1:!0),Hl=e.computed(()=>xn.value&&Vn.value),_l=e.ref(!1);e.watch(Hl,t=>{t?(_l.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{_l.value=!0})})):_l.value=!1},{immediate:!0});const ql=e.computed(()=>{if(!ge.value||Mn.value||it.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Se.value}ms`,t["--dss-animation-easing"]=Ul(mt.value),t["--dss-stagger-delay"]=`${Et.value}ms`,t}),Ul=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Xl=()=>{if(!ge.value||Mn.value)return"";const t=["dss-chart-animated"];return it.value.hasAnimated||t.push(`dss-animate-${et.value}`),it.value.hasAnimated||(mn.value&&te.value!=="semi-radial"?t.push("dss-animate-fill"):mn.value||t.push(`dss-animate-${et.value}`)),it.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>_.series,(t,s)=>{Nt.value&&s&&it.value.hasAnimated&&(it.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>il(),Oe.value)}))},{deep:!0}),e.watch(()=>I.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{gn()},50)}),e.watch(()=>[I.value.scale,I.value.offsetX],()=>{!I.value.isZooming&&!I.value.isDragging&&gn()},{flush:"post"}),e.watch([ht,Tt],([t,s])=>{I.value.minScale=t,I.value.maxScale=s,(I.value.scale<t||I.value.scale>s)&&Jo()},{immediate:!0}),e.watch(()=>_.locale,t=>{t&&t!==F.value&&(F.value=t)},{immediate:!0}),e.watch(()=>$e.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Go)}):document.removeEventListener("click",Go)}),e.onMounted(()=>{ce.value=null,hn.value&&(!ge.value||Mn.value)&&(co.value=1),kl(),k.value&&typeof ResizeObserver<"u"&&(ie=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(be&&cancelAnimationFrame(be),be=requestAnimationFrame(()=>{be=null;const{width:n,height:c}=s.contentRect;Fe.value=Math.round(n),p.value=Math.round(c),ne.value&&(Dt.value=ne.value.offsetHeight||fe)}))}),ie.observe(k.value)),ge.value&&!Mn.value?te.value==="semi-radial"?setTimeout(()=>So(),Oe.value):setTimeout(()=>il(),Oe.value):(it.value.hasAnimated=!0,te.value==="semi-radial"&&(Lo.value=1)),document.addEventListener("mousemove",zl),document.addEventListener("mouseup",Pl),document.addEventListener("click",xo)}),e.onUnmounted(()=>{be&&cancelAnimationFrame(be),ie&&k.value&&(ie.unobserve(k.value),ie.disconnect(),ie=null),it.value.animationId&&cancelAnimationFrame(it.value.animationId),Rn&&(cancelAnimationFrame(Rn),Rn=null),I.value.zoomTimeout&&clearTimeout(I.value.zoomTimeout),document.removeEventListener("mousemove",zl),document.removeEventListener("mouseup",Pl),document.removeEventListener("click",xo),document.removeEventListener("click",Go)});const zl=t=>{if(I.value.isDragging&&I.value.scale>1&&Qt.value){He.value.show=!1;const s=t.clientX-I.value.lastMouseX,{minX:n,maxX:c}=Mt.value,f=c-n||1,x=s*.8;I.value.offsetX+=x;const b=f/I.value.scale,M=f-b,B=0,T=-M/f*L.value.width,E=B;I.value.offsetX=Math.max(T,Math.min(E,I.value.offsetX)),I.value.lastMouseX=t.clientX,I.value.lastMouseY=t.clientY}},Pl=()=>{I.value.isDragging&&(I.value.isDragging=!1,setTimeout(()=>{!I.value.isDragging&&I.value.isZooming},100))},Yl=(t,s)=>{const n=t.filter(b=>b!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||s<=0)return n[0];if(s>=1)return n[n.length-1];let c=0;const f=[];for(let b=1;b<n.length;b++){const M=n[b].x-n[b-1].x,B=n[b].y-n[b-1].y,T=Math.sqrt(M*M+B*B);f.push(T),c+=T}const g=c*s;let x=0;for(let b=0;b<f.length;b++){const M=x+f[b];if(g<=M){const B=(g-x)/f[b],T=n[b],E=n[b+1];return{x:T.x+(E.x-T.x)*B,y:T.y+(E.y-T.y)*B}}x=M}return n[n.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[Xl(),{"dss-chart-fill-width":dt.value,"dss-chart-fill-height":ut.value,"dss-chart-compact":mn.value&&!Ze.value}]]),style:e.normalizeStyle({width:dt.value?"100%":ye.value+"px",height:Be.value,...dt.value||ut.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...ql.value,cursor:bl()}),"data-chart-type":te.value,ref_key:"containerEl",ref:k,onWheel:Qo,onMousedown:Cl,onMousemove:R,onMouseup:Tl,onMouseleave:ue,onDblclick:Jo,onContextmenu:e.withModifiers(qe,["prevent"]),onClick:e.withModifiers(De,["left"]),onWheelCapture:Qo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ne},[e.createElementVNode("div",Ql,[rt.value?(e.openBlock(),e.createElementBlock("div",Jl,e.toDisplayString(rt.value),1)):e.createCommentVNode("",!0),Qe.value?(e.openBlock(),e.createElementBlock("div",ea,e.toDisplayString(Qe.value),1)):e.createCommentVNode("",!0)]),Ze.value&&(Ve.value==="top"||Ve.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ot.value==="horizontal","dss-legend-vertical":Ot.value==="vertical","dss-legend-top":Ve.value==="top","dss-legend-bottom":Ve.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.series,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":kt.value.has(c),"dss-legend-hovered":ce.value===c,"dss-legend-dimmed":ce.value!==null&&ce.value!==c}]),onClick:f=>Zt(c),onMouseenter:f=>y(c),onMouseleave:V,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ht(c)})},null,4),e.createElementVNode("span",na,e.toDisplayString(n.name),1)],46,ta))),128))],2)):e.createCommentVNode("",!0),Ze.value&&(Ve.value==="left"||Ve.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Ve.value==="left","dss-legend-right":Ve.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.series,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":kt.value.has(c),"dss-legend-hovered":ce.value===c,"dss-legend-dimmed":ce.value!==null&&ce.value!==c}]),onClick:f=>Zt(c),onMouseenter:f=>y(c),onMouseleave:V,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ht(c)})},null,4),e.createElementVNode("span",la,e.toDisplayString(n.name),1)],46,oa))),128))],2)):e.createCommentVNode("",!0)],512),H.showAddMarkerButton&&Bt.value.addMarker&&(Qt.value||Lt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Ko,title:e.unref(D)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Tn.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,sa),s[5]||(s[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,aa)):e.createCommentVNode("",!0),e.createElementVNode("div",ra,[Lt.value&&sn.value?(e.openBlock(),e.createElementBlock("div",ia,"Bubble size: "+e.toDisplayString(sn.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:ye.value,height:nt.value,class:"dss-chart-svg","data-smooth":O.value,"data-animated":ge.value,ref_key:"svgEl",ref:Me},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",da,[e.createElementVNode("rect",{x:L.value.left,y:L.value.top,width:L.value.width,height:L.value.height*4},null,8,ua)]),io.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:tl.value},[e.createElementVNode("path",{d:fo.value},null,8,pa)],8,ma)):e.createCommentVNode("",!0),hn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:nl.value},[e.createElementVNode("path",{d:go.value},null,8,fa)],8,va)):e.createCommentVNode("",!0)]),Qt.value||Lt.value?(e.openBlock(),e.createElementBlock("g",ga,[ct.value?(e.openBlock(),e.createElementBlock("g",ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(El.value,(n,c)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${c}`,x1:L.value.left,x2:L.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${c*50}ms`})},null,12,ya))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ka,[e.createElementVNode("line",{x1:L.value.left,x2:L.value.right,y1:L.value.bottom,y2:L.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Ca),e.createElementVNode("line",{x1:L.value.left,x2:L.value.left,y1:L.value.top,y2:L.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ba)]),e.createElementVNode("g",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(sl.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${c}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},e.toDisplayString(n.text),13,xa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rl.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${c}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${c*80}ms`})},e.toDisplayString(n.text),13,Ea))),128)),Xt.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:L.value.left+L.value.width/2,y:L.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Xt.value),9,Va)):e.createCommentVNode("",!0),se.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:L.value.top+12+L.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${L.value.top+L.value.height/2})`},e.toDisplayString(se.value),9,Sa)):e.createCommentVNode("",!0)]),Io.value.length>0?(e.openBlock(),e.createElementBlock("g",Na,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Io.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",Ba,[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:L.value.bottom,y2:L.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>Ro(n,c),onMouseleave:Mo},null,40,Ma)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:L.value.bottom,y2:L.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>Ro(n,c),onMouseleave:Mo},null,40,_a)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:L.value.bottom,y2:L.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>Ro(n,c),onMouseleave:Mo},null,40,Ta)):e.createCommentVNode("",!0)]),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,L.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:c=>Ro(n,c),onMouseleave:Mo},null,40,$a)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,L.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:c=>Ro(n,c),onMouseleave:Mo},null,40,La),e.createElementVNode("text",{x:n.x,y:Math.max(15,L.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(n.totalCount),9,Ha)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Aa,[Bn.value?(e.openBlock(),e.createElementBlock("g",Da,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Kt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qo.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${c}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>an(n,f),onMouseleave:Pn},null,46,Ra)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>an(n,f),onMouseleave:Pn},null,46,Ia))],64))),128))],2),e.createElementVNode("g",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Sl.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?st.value+2:st.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,za))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nl.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?st.value+2:st.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Pa))),128)),tt.value>0||yt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Fn.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${c}`,cx:n.x,cy:n.y,r:n.isHighlighted?Te(n,tt.value)+2:Te(n,tt.value),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>an(n,f),onMouseleave:Pn},null,46,Oa))),128)):e.createCommentVNode("",!0)])])):te.value==="line"?(e.openBlock(),e.createElementBlock("g",Wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ll.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${c}`,d:n.path,stroke:n.color,"stroke-width":st.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":it.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Za))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Sl.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?st.value+2:st.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,qa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nl.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?st.value+2:st.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Ua))),128)),tt.value>0||yt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Wo.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:n.x,cy:n.y,r:n.isHighlighted?Te(n,tt.value)+2:Te(n,tt.value),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>an(n,f),onMouseleave:Pn},null,46,Xa))),128)):e.createCommentVNode("",!0)])):te.value==="area"?(e.openBlock(),e.createElementBlock("g",Ya,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qn.value,(n,c)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${c}`,id:`area-mask-${c}-${H.chartId}`},[e.createElementVNode("rect",{x:L.value.left-10,y:L.value.top-10,width:L.value.width+20,height:L.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${L.value.width+20}px`})},null,12,Ka)],8,ja))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qn.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${c}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?Ue.value+.2:Ue.value,mask:`url(#area-mask-${c}-${H.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden})},null,10,Ga))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qn.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${c}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?st.value+1:st.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${c*Et.value}ms`})},null,14,Qa))),128))])):te.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Kt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qo.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${c}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>an(n,f),onMouseleave:Pn},null,46,Ja)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>an(n,f),onMouseleave:Pn},null,46,es))],64))),128))],2)):e.createCommentVNode("",!0)]),ot.value&&He.value.show&&!I.value.isZooming?(e.openBlock(),e.createElementBlock("g",ts,[e.createElementVNode("line",{x1:He.value.x,x2:He.value.x,y1:L.value.top,y2:L.value.bottom,stroke:tn.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,ns),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${c}`,cx:He.value.x,cy:n.y,r:tt.value+2,fill:n.color,stroke:"none",opacity:"0.9"},null,8,os))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Lt.value?(e.openBlock(),e.createElementBlock("g",ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zo.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${c}`},[n?(e.openBlock(),e.createElementBlock("g",as,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:n.radius,fill:n.color,"fill-opacity":l(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(r(n,c)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:f=>i(n,f),onMouseleave:f=>m(n),onClick:f=>a(n,f)},null,42,ss),n.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:n.x-n.radius*.65,y:n.y-n.radius*.65,width:n.radius*1.3,height:n.radius*1.3,"xlink:href":n.imageUrl,class:e.normalizeClass(`dss-bubble-image-${c} ${n.isHighlighted?"dss-bubble-highlighted":""} ${n.isDimmed?"dss-bubble-dimmed":""} ${n.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${n.radius*.65}px at ${n.radius*.65}px ${n.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:o(n)}),onLoad:f=>Ho(c),onError:f=>xl(c),onMouseenter:f=>i(n,f),onMouseleave:f=>m(n),onClick:f=>a(n,f)},null,46,rs)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),mn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:$o.value},[te.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:vt.value,cy:ft.value,r:Je.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,cs)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":te.value,"clip-path":Vo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bl.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${c}`,d:n.segment.path,fill:n.segment.color,"fill-opacity":n.segment.isHighlighted?(n.segment.opacity||.8)+.2:n.segment.opacity||.8,stroke:n.segment.strokeWidth?n.segment.strokeColor||n.segment.color:"none","stroke-width":n.segment.strokeWidth||0,"clip-path":Ft(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:f=>an(n.segment,f),onMouseleave:Pn},null,42,us))),128))],8,ds),vn.value&&Vn.value?(e.openBlock(),e.createElementBlock("g",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.value,(n,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${c}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:n.contrastColor})},e.toDisplayString(n.value),13,ps)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),ko.value&&(Vn.value||io.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:bo.value.x,y:bo.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Co.value,fill:yn.value,class:"dss-radial-data-center"},e.toDisplayString(jo.value),9,vs)):e.createCommentVNode("",!0),Hl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":_l.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ml.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${c}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${c*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:n.pointerStartX,y1:n.pointerStartY,x2:n.pointerEndX,y2:n.pointerEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.pointerLineLength})},null,12,fs),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:n.pointerEndX,y1:n.pointerEndY,x2:n.horizontalEndX,y2:n.horizontalEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.horizontalLineLength})},null,12,gs),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":on.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,hs)],6))),128))],2)):e.createCommentVNode("",!0)],8,is)):e.createCommentVNode("",!0),jn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:$o.value},[ct.value?(e.openBlock(),e.createElementBlock("g",ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${c}`,cx:vt.value,cy:ft.value,r:n,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*150}ms`})},null,12,Cs))),128)),e.createElementVNode("g",bs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${c}`},[e.createElementVNode("rect",{x:vt.value-16,y:ft.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,ws),e.createElementVNode("text",{x:vt.value,y:ft.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Sn(c)),9,xs)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(n,c)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${c}`,x1:vt.value,x2:n.x,y1:ft.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},null,12,Es))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${c}`,x:n.x+Math.cos(c*2*Math.PI/S.value-Math.PI/2)*16,y:n.y+Math.sin(c*2*Math.PI/S.value-Math.PI/2)*16,"text-anchor":n.anchor,"dominant-baseline":n.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${c*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,Ss))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:en,onMouseleave:Pn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(le.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${c}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":Ce("current",n,c),stroke:n.color,"stroke-width":n.isHighlighted?st.value+1:st.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${c*Et.value}ms`,transition:"all 0.2s ease"})},null,14,Ns),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(f,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${c}-${g}`,cx:f.x,cy:f.y,r:n.isHighlighted?tt.value+1:tt.value>0?tt.value:0,fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${c*Et.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:x=>an(f,x),onMouseleave:Pn},null,46,Bs))),128))]))),128))],32)],8,ys)):e.createCommentVNode("",!0),e.createElementVNode("g",Ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${c}`,cx:n.x,cy:n.y,r:n.width/2,fill:Ht(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${c}`),style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,14,_s))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At.value,(n,c)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${c}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:f=>Pt(c),onError:f=>Gt(c),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${c}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,46,Ts))),128))])],8,ca))]),P.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:ye.value+"px",height:nt.value+"px",backgroundImage:`url('${$n.value}')`,backgroundRepeat:"no-repeat",...Xe.value,opacity:A.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(n,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+n.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:n.x+"px",top:n.y+"px",width:cn.value+"px",height:cn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(f=>yl(n),["stop"]),onMouseenter:f=>v(n,f),onMouseleave:h},[e.createElementVNode("img",{src:An(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Ls)],44,$s)),[[e.vShow,On.value]])),128)),jt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:jt.value.x+"px",top:jt.value.y+"px"})},[e.createElementVNode("div",Hs,e.toDisplayString(jt.value.categoryValue),1),jt.value.description?(e.openBlock(),e.createElementBlock("div",As,e.toDisplayString(jt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),_t.value&&(ze.value.show||ot.value&&He.value.show&&!I.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":ot.value&&He.value.show&&!I.value.isZooming}]),style:e.normalizeStyle(qt.value)},[!ot.value||!He.value.show||I.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[jn.value&&ze.value.spiderSeries&&ze.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Ds,[ze.value.title?(e.openBlock(),e.createElementBlock("div",Rs,e.toDisplayString(ze.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value.spiderSeries,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Is,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Fs,e.toDisplayString(n.value),1)]))),128))])):Lt.value&&ze.value.bubbleData&&ze.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",zs,[ze.value.title?(e.openBlock(),e.createElementBlock("div",Ps,e.toDisplayString(ze.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Os,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value.bubbleData,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Ws,[e.createElementVNode("div",Zs,e.toDisplayString(ze.value.title),1),e.createElementVNode("div",qs,e.toDisplayString(ze.value.value),1)])),ze.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[je(ze.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Us,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Xs,e.toDisplayString(e.unref(D)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je(ze.value.categoryIndex).flagGroups,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${c}`},[e.createElementVNode("div",Ys,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${c}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",js,[e.createElementVNode("div",Ks,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),je(ze.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Gs,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Qs,e.toDisplayString(e.unref(D)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je(ze.value.categoryIndex).markers,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Js,[e.createElementVNode("div",er,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",tr,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",nr,[e.createElementVNode("div",or,e.toDisplayString(Lt.value?d():H.categories[He.value.categoryIndex]||`Category ${He.value.categoryIndex+1}`),1),Lt.value?(e.openBlock(),e.createElementBlock("div",lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(He.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",ar,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",sr,e.toDisplayString(dn(n.value)),1)]))),128))]),je(He.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",rr,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ir,e.toDisplayString(e.unref(D)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je(He.value.categoryIndex).flagGroups,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${c}`},[e.createElementVNode("div",cr,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${c}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",dr,[e.createElementVNode("div",ur,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),je(He.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",mr,[s[9]||(s[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",pr,e.toDisplayString(e.unref(D)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je(He.value.categoryIndex).markers,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",vr,[e.createElementVNode("div",fr,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",gr,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Qt.value&&Rt.value&&I.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Jo},[s[10]||(s[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(I.value.scale*100))+"% "+e.toDisplayString(e.unref(D)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Gl),$e.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:$e.value.x+"px",top:$e.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[Bt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:En},e.toDisplayString(e.unref(D)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Bt.value.addMarker&&(Bt.value.downloadSvg||Bt.value.downloadPng||Bt.value.downloadCsv||_n.value.length>0)?(e.openBlock(),e.createElementBlock("div",hr)):e.createCommentVNode("",!0),Bt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Xn},e.toDisplayString(e.unref(D)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Bt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Yn},e.toDisplayString(e.unref(D)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Bt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:so},e.toDisplayString(e.unref(D)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),_n.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Bt.value.downloadSvg||Bt.value.downloadPng||Bt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",yr)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_n.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+c},[n.separator?(e.openBlock(),e.createElementBlock("div",kr)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(lo(n)),style:e.normalizeStyle(bt(n)),onClick:f=>ro(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:pt(n),class:"dss-custom-menu-content"},null,8,br)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",wr,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,Cr)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),de.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:ao},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[4]||(s[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",xr,[e.createElementVNode("h3",null,e.toDisplayString(C.value?e.unref(D)("chart.modalMarker.viewMarker"):oo.value?e.unref(D)("chart.modalMarker.editMarker"):e.unref(D)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:ao},"×")]),e.createElementVNode("div",Er,[e.createElementVNode("div",Vr,[de.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Sr,e.toDisplayString(Fo(de.value.categoryIndex)||""),1)),de.value.fromButton?(e.openBlock(),e.createElementBlock("div",Nr,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":s[1]||(s[1]=n=>de.value.categoryIndex=n),class:"dss-form-select",disabled:C.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nn.value,(n,c)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${c}`,value:c},e.toDisplayString(n),9,Mr))),128))],8,Br),[[e.vModelSelect,de.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",_r,[e.createElementVNode("label",Tr,e.toDisplayString(e.unref(D)("chart.modalMarker.description")),1),C.value?(e.openBlock(),e.createElementBlock("div",$r,e.toDisplayString(de.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=n=>de.value.description=n),placeholder:e.unref(D)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,Lr)),[[e.vModelText,de.value.description]])]),e.createElementVNode("div",Hr,[e.createElementVNode("label",null,e.toDisplayString(e.unref(D)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",Ar,[e.createElementVNode("img",{src:An({type:de.value.type}),alt:"Marker Icon Preview",class:"preview-icon",style:{width:"32px",height:"32px","border-radius":"50%",border:"2px solid #ddd"},onError:s[3]||(s[3]=n=>n.target.style.display="none")},null,40,Dr)])])]),e.createElementVNode("div",Rr,[e.createElementVNode("div",Ir,[oo.value&&!C.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:gl},e.toDisplayString(e.unref(D)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fr,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:ao},e.toDisplayString(C.value?e.unref(D)("chart.modalMarker.close"):e.unref(D)("chart.modalMarker.cancel")),1),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:fl,disabled:!(de.value.description&&de.value.description.length)},e.toDisplayString(oo.value?e.unref(D)("chart.modalMarker.save"):e.unref(D)("chart.contextMenu.addMarker")),9,zr))])])])])):e.createCommentVNode("",!0)],64))}}),Wr={class:"dss-modal-title"},Zr={class:"dss-modal-actions"},Al={__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(H,{emit:he}){const D=H,F=he,we=e.ref(null),k=e.ref(null),Me=e.computed(()=>{const _={"max-width":D.width};return D.height!=="auto"&&(_.height=D.height,_["min-height"]="0"),_}),ne=e.computed(()=>({}));function Fe(){F("close-modal")}function p(){D.backDrop&&!we.value&&F("close-modal")}function ie(_){_.target.tagName==="INPUT"&&(we.value=_.target.tagName)}function be(){setTimeout(()=>{we.value=null},300)}function fe(){const _=document.body,_e=document.documentElement;k.value={bodyOverflow:_.style.overflow,bodyPosition:_.style.position,bodyTop:_.style.top,bodyWidth:_.style.width,htmlOverflow:_e.style.overflow,scrollY:window.scrollY},_.style.overflow="hidden",_.style.position="fixed",_.style.top=`-${k.value.scrollY}px`,_.style.width="100%",_.style.left="0",_e.style.overflow="hidden"}function j(){if(!k.value)return;const _=document.body,_e=document.documentElement,{bodyOverflow:Pe,bodyPosition:Le,bodyTop:Ke,bodyWidth:z,htmlOverflow:dt,scrollY:ut}=k.value;_.style.overflow=Pe||"",_.style.position=Le||"",_.style.top=Ke||"",_.style.width=z||"",_.style.left="",_e.style.overflow=dt||"",window.scrollTo(0,ut||0)}return e.watch(()=>D.showModal,_=>{if(_)fe(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const _e=document.getElementById("dss-modal-backdrop");_e&&(_e.addEventListener("focusin",ie),_e.addEventListener("focusout",be))},100);else{j(),document.body.classList.remove("dss-modal-open");const _e=document.getElementById("dss-modal-backdrop");_e&&(_e.removeEventListener("focusin",ie),_e.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{D.showModal&&j()}),(_,_e)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[H.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:p},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Me.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:_e[0]||(_e[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":H.headerType,"font-size":H.titleSize})},[e.createElementVNode("h1",Wr,[e.renderSlot(_.$slots,"title",{},()=>[_e[1]||(_e[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(_.$slots,"title-data"),H.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:Fe,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(ne.value)},[e.renderSlot(_.$slots,"content",{},()=>[_e[2]||(_e[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Zr,[e.renderSlot(_.$slots,"actions")])])],4),[[e.vShow,H.showModal]])])):e.createCommentVNode("",!0)]))}},qr={key:0,class:"dss-table-toolbar"},Ur={class:"dss-table-toolbar-left"},Xr=["aria-expanded"],Yr={class:"dss-pagination-select-dropdown",role:"listbox"},jr={class:"dss-table-column-visibility-label"},Kr={class:"dss-table-checkbox-wrapper"},Gr=["checked","onChange"],Qr={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Jr={class:"dss-table-column-visibility-text"},ei={class:"dss-table-toolbar-right"},ti=["placeholder"],ni=["aria-expanded"],oi={key:1,class:"dss-table-toolbar-extra"},li={class:"dss-table-thead"},ai={key:0,class:"dss-table-th dss-table-selection-column"},si={key:0,class:"dss-table-checkbox-wrapper"},ri=["checked","indeterminate"],ii={key:0,class:"dss-table-checkbox__indeterminate"},ci={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},di={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},ui=["onClick"],mi={class:"dss-table-th-content"},pi={class:"dss-table-th-text"},vi={key:0},fi={key:1},gi={key:2},hi=["data-filter-column-key","aria-expanded","onClick"],yi={class:"dss-table-tbody"},ki=["onClick"],Ci={class:"dss-table-checkbox-wrapper"},bi=["type","name","checked","onChange"],wi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},xi={key:1,class:"dss-table-checkbox__dot"},Ei=["onClick"],Vi=["aria-expanded","aria-label"],Si={key:0,class:"dss-table-expansion-row"},Ni=["colspan"],Bi=["colspan"],Mi={key:1,class:"dss-table-pagination"},_i={class:"dss-pagination-center"},Ti={class:"dss-pagination-controls"},$i=["disabled","title"],Li=["disabled","title"],Hi={class:"dss-pagination-pages"},Ai=["onClick"],Di={key:1,class:"dss-pagination-ellipsis"},Ri=["disabled","title"],Ii=["disabled","title"],Fi=["aria-expanded"],zi={class:"dss-pagination-select-dropdown",role:"listbox"},Pi=["aria-selected","onClick"],Oi={key:0,class:"dss-table-filter-row"},Wi=["value","placeholder"],Zi=["min","max","value"],qi=["min","max","value"],Ui={class:"dss-table-filter-double-range-values"},Xi={key:2,class:"dss-table-filter-daterange"},Yi={class:"dss-table-filter-daterange-row"},ji={class:"dss-table-filter-daterange-label"},Ki=["value"],Gi={class:"dss-table-filter-daterange-row"},Qi={class:"dss-table-filter-daterange-label"},Ji=["value"],ec=["value","placeholder"],tc={class:"dss-table-filter-list"},nc=["checked","onChange"],oc={class:"dss-table-filter-actions"},lc={name:"DSSTable"},ac=Object.assign(lc,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:H=>typeof H=="object"&&H!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(H,{emit:he}){const{t:D,locale:F}=cl.useI18n(),we=H,k=he,Me={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single"},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100]},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:"No data available"};function ne(C,y){const V=Object.assign({},C);return Fe(C)&&Fe(y)&&Object.keys(y).forEach(R=>{Fe(y[R])?R in C?V[R]=ne(C[R],y[R]):Object.assign(V,{[R]:y[R]}):Object.assign(V,{[R]:y[R]})}),V}function Fe(C){return C&&typeof C=="object"&&!Array.isArray(C)}const p=e.computed(()=>ne(Me,we.options)),ie=e.computed(()=>{const C=p.value.table.width;return C==="auto"?null:typeof C=="number"?C:null}),be=e.computed(()=>p.value.table.height),fe=e.computed(()=>p.value.table.rowHeight??"auto"),j=e.computed(()=>({height:fe.value})),_=e.computed(()=>p.value.table.expandable===!0),_e=e.computed(()=>p.value.table.truncated===!0),Pe=e.computed(()=>p.value.table.striped),Le=e.computed(()=>p.value.table.bordered),Ke=e.computed(()=>p.value.table.hoverable),z=e.computed(()=>p.value.table.size),dt=e.computed(()=>p.value.table.align||"left");e.computed(()=>p.value.title.text),e.computed(()=>p.value.subtitle.text);const ut=e.computed(()=>p.value.selection.enabled),ye=e.computed(()=>p.value.selection.mode),Dt=e.computed(()=>p.value.sorting.enabled),xt=e.computed(()=>p.value.sorting.mode),nt=e.computed(()=>p.value.pagination.enabled),Be=e.computed(()=>p.value.pagination.rows),te=e.computed(()=>p.value.pagination.rowsPerPageOptions),pn=e.computed(()=>p.value.scrollable),rt=e.computed(()=>p.value.emptyMessage),Qe=e.computed(()=>p.value.toolbar?.downloads?.pdf!==!1),sn=e.computed(()=>p.value.toolbar?.downloads?.excel!==!1),Xt=e.computed(()=>p.value.toolbar?.search!==!1),se=e.computed(()=>Qe.value||sn.value||Xt.value||xe.value),xe=e.computed(()=>p.value.toolbar?.columnVisibility!==!1),J=e.ref(""),oe=e.ref(!1),Ye=e.ref(null);let ct=null;function Ze(){oe.value?(ct&&(clearTimeout(ct),ct=null),oe.value=!1,J.value="",k("search",""),Ye.value?.blur()):(oe.value=!0,ct=setTimeout(()=>{ct=null,Ye.value?.focus()},80))}function Ve(){J.value||(oe.value=!1)}function Ot(){J.value="",k("search",""),Ye.value?.focus()}const _t=e.computed(()=>({"dss-table-striped":Pe.value,"dss-table-bordered":Le.value,"dss-table-hoverable":Ke.value,[`dss-table-${z.value}`]:z.value!=="default","dss-table-truncated":_e.value})),ot=(C,y)=>C?.field??C?.key??y,tn=e.ref(new Set);function Rt(){const C=new Set;we.columns.forEach((y,V)=>{y?.hidden!==!0&&C.add(ot(y,V))}),tn.value=C}const ht=e.computed(()=>we.columns.filter((C,y)=>tn.value.has(ot(C,y)))),Tt=C=>{const y=we.columns.findIndex(V=>V===C);return ot(C,y>=0?y:0)},st=(C,y)=>tn.value.has(ot(C,y));function nn(C,y){const V=ot(C,y),R=new Set(tn.value);R.has(V)?R.delete(V):R.add(V),tn.value=R}const tt=e.ref(null),yt=e.ref(!1);function Te(C){tt.value&&!tt.value.contains(C.target)&&(yt.value=!1)}const Ue=e.computed(()=>ht.value.length+(ut.value?1:0)+(_.value?1:0)),O=(C,y)=>C?.id??C?.key??y,Z=e.ref(new Set),X=e.ref(null),Q=(C,y)=>Z.value.has(O(C,y)),ge=(C,y,V)=>{V&&V.stopPropagation();const R=O(C,y),ue=new Set(Z.value);ue.has(R)?(ue.delete(R),k("row-collapse",{data:C,index:y})):(ue.add(R),k("row-expand",{data:C,index:y})),Z.value=ue},et=(C,y)=>{if(!_e.value)return;const V=O(C,y);X.value!==V&&(X.value=V)},Se=e.ref(null),Oe=e.ref(0),mt=e.ref([]),Et=C=>{if(xt.value==="single")return Se.value===C.field?Oe.value:0;{const y=mt.value.find(V=>V.field===C.field);return y?y.order:0}},Nt=C=>{const y=Et(C);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},$t=e.ref({}),Ae=e.ref(null),It=e.ref(null),gt=220,Sn=e.ref(null),Wt=e.computed(()=>ht.value.find(C=>Tt(C)===Ae.value)??null),Vt=e.computed(()=>{if(!Wt.value||Wt.value.filter!=="range")return null;const C=Wt.value,y=Ae.value,{min:V,max:R}=G(C),ue=C.filterMin??V,qe=C.filterMax??R,De=rn(y),pt=De.min??ue,lo=De.max??qe,bt=qe-ue,An=bt===0?0:(pt-ue)/bt*100,Fo=bt===0?100:(lo-ue)/bt*100;return{rangeMin:ue,rangeMax:qe,currentMin:pt,currentMax:lo,minPct:An,maxPct:Fo}}),Bt=e.ref(null),_n=e.ref("max");function Tn(C){const y=Bt.value,V=Vt.value;if(!y||!V)return;const R=y.getBoundingClientRect(),qe=(C.clientX-R.left)/R.width*100,De=(V.minPct+V.maxPct)/2;_n.value=qe<De?"min":"max"}function rn(C){return $t.value[C]??{}}function cn(C,y){$t.value={...$t.value,[C]:y}}function Yt(C){const y=$t.value[C];return y?y.type==="string"?!!y.value?.trim():y.type==="range"?y.min!=null||y.max!=null:y.type==="dateRange"?!!(y.from||y.to):y.type==="list"?y.selected?.length>0:!1:!1}function dn(C){const y={...$t.value};delete y[C],$t.value=y,Ae.value=null,It.value=null}function On(){if(!Ae.value){It.value=null;return}const C=Sn.value;if(!C)return;const y=C.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Ae.value}"]`);if(!y)return;const V=y.getBoundingClientRect();It.value={top:V.bottom+6,left:Math.max(8,V.right-gt)}}const mo=e.computed(()=>{let C=[...we.data];return ht.value.forEach(y=>{const V=Tt(y),R=$t.value[V];if(!R)return;const ue=y.field;if(ue){if(R.type==="string"&&R.value?.trim()){const qe=R.value.trim().toLowerCase();C=C.filter(De=>{const pt=Ct(De,y);return String(pt??"").toLowerCase().includes(qe)})}else if(R.type==="range")C=C.filter(qe=>{const De=de(qe,ue),pt=Number(De);return!(Number.isNaN(pt)||R.min!=null&&pt<R.min||R.max!=null&&pt>R.max)});else if(R.type==="dateRange"){const qe=R.from?new Date(R.from).getTime():null,De=R.to?new Date(R.to).getTime():null;C=C.filter(pt=>{const lo=de(pt,ue),bt=lo?new Date(lo).getTime():NaN;return!(Number.isNaN(bt)||qe!=null&&bt<qe||De!=null&&bt>De)})}else if(R.type==="list"&&R.selected?.length){const qe=new Set(R.selected);C=C.filter(De=>{const pt=Ct(De,y);return qe.has(pt!=null?String(pt):"")})}}}),C});function $(C){const y=new Set;return we.data.forEach(V=>{const R=Ct(V,C);y.add(R!=null?String(R):"")}),Array.from(y).sort((V,R)=>String(V).localeCompare(String(R)))}function P(C,y){if(Ae.value===C){Ae.value=null,It.value=null;return}if(Ae.value=C,y?.currentTarget){const V=y.currentTarget.getBoundingClientRect();It.value={top:V.bottom+6,left:Math.max(8,V.right-gt)}}else On()}function A(C,y){cn(C,{type:"string",value:y})}function G(C){const y=C.field;if(!y)return{min:0,max:100};let V=1/0,R=-1/0;return we.data.forEach(ue=>{const qe=de(ue,y),De=Number(qe);Number.isNaN(De)||(V=Math.min(V,De),R=Math.max(R,De))}),{min:V===1/0?0:V,max:R===-1/0?100:R}}function ke(C,y,V){const R={...rn(C),type:"range"},ue=V===""?null:Number(V),qe=ue===null||Number.isNaN(ue)?null:ue;R[y]=qe,qe!=null&&(y==="min"&&R.max!=null&&qe>R.max&&(R.max=qe),y==="max"&&R.min!=null&&qe<R.min&&(R.min=qe)),cn(C,R)}function We(C,y,V){const R={...rn(C),type:"dateRange"};R[y]=V||"",cn(C,R)}const Xe=e.reactive({});function Ie(C,y){Xe[C]=y}function je(C){const y=Tt(C),V=(Xe[y]??"").trim().toLowerCase(),R=$(C);return V?R.filter(ue=>String(ue).toLowerCase().includes(V)):R}function St(C,y){return(rn(C).selected??[]).includes(y!=null?String(y):"")}function $n(C,y){const R=[...rn(C).selected??[]],ue=y!=null?String(y):"",qe=R.indexOf(ue);qe>=0?R.splice(qe,1):R.push(ue),cn(C,{type:"list",selected:R})}function xn(C){Ae.value&&!C.target.closest(".dss-table-filter-wrap")&&!C.target.closest(".dss-table-filter-dropdown")&&(Ae.value=null,It.value=null)}function on(){On()}const to=C=>{if(!(C.sortable===!1||!Dt.value))if(xt.value==="single")Se.value===C.field?Oe.value=Oe.value===1?-1:Oe.value===-1?0:1:(Se.value=C.field,Oe.value=1),Oe.value===0&&(Se.value=null),k("sort",{field:Se.value,order:Oe.value});else{const y=mt.value.findIndex(V=>V.field===C.field);y>=0?mt.value[y].order===1?mt.value[y].order=-1:mt.value.splice(y,1):mt.value.push({field:C.field,order:1}),k("sort",{multiSortMeta:mt.value})}},Ln=e.computed(()=>{if(!Dt.value)return mo.value;let C=[...mo.value];return xt.value==="single"&&Se.value&&Oe.value!==0?C.sort((y,V)=>{const R=de(y,Se.value),ue=de(V,Se.value);return R===ue?0:R==null?1:ue==null?-1:(R<ue?-1:R>ue?1:0)*Oe.value}):xt.value==="multiple"&&mt.value.length>0&&C.sort((y,V)=>{for(const R of mt.value){const ue=de(y,R.field),qe=de(V,R.field);if(ue===qe)continue;if(ue==null)return 1;if(qe==null)return-1;const De=ue<qe?-1:ue>qe?1:0;if(De!==0)return De*R.order}return 0}),C}),un=e.ref(0),vn=e.ref(Be.value),Wn=e.ref(!1),ko=e.ref(null),jo=C=>{vn.value=C,Wn.value=!1,un.value=0,k("page",{page:0,rows:vn.value})};function Co(C){ko.value&&!ko.value.contains(C.target)&&(Wn.value=!1)}const bo=e.computed(()=>Ln.value.length),yn=e.computed(()=>Math.ceil(bo.value/vn.value)),fn=e.computed(()=>nt.value?un.value*vn.value:0),Io=e.computed(()=>nt.value?Math.min((un.value+1)*vn.value,bo.value):bo.value),no=e.computed(()=>{if(!nt.value)return Ln.value;const C=fn.value,y=Io.value;return Ln.value.slice(C,y)}),Hn=e.ref(new Set),po=e.computed(()=>Ln.value.filter((C,y)=>Hn.value.has(O(C,y)))),_o=e.computed(()=>{const C=Ln.value.length;return C>0&&Hn.value.size===C}),kt=e.computed(()=>{const C=Ln.value.length,y=Hn.value.size;return y>0&&y<C}),ce=(C,y)=>Hn.value.has(O(C,y)),To=()=>{if(_o.value)Hn.value=new Set,k("unselect-all");else{const C=new Set;Ln.value.forEach((y,V)=>C.add(O(y,V))),Hn.value=C,k("select-all",po.value)}},ze=(C,y)=>{const V=O(C,y),R=new Set(Hn.value),ue=R.has(V);ye.value==="single"?ue?(R.delete(V),k("row-unselect",C)):(R.clear(),R.add(V),k("row-select",C)):ue?(R.delete(V),k("row-unselect",C)):(R.add(V),k("row-select",C)),Hn.value=R},jt=e.computed(()=>{const C=yn.value,y=un.value+1,V=2,R=[],ue=[];let qe;for(let De=1;De<=C;De++)(De===1||De===C||De>=y-V&&De<=y+V)&&R.push(De);for(const De of R)qe&&(De-qe===2?ue.push(qe+1):De-qe!==1&&ue.push("...")),ue.push(De),qe=De;return ue}),He=C=>{C<0||C>=yn.value||(un.value=C,k("page",{page:C,rows:vn.value}))},$e=(C,y,V)=>{k("row-click",{data:C,index:y,originalEvent:V}),et(C,fn.value+y)},I=(C,y)=>{const V=fn.value+y;return{"dss-table-row-selected":ce(C,V),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":_e.value,"dss-table-row-truncated-expanded":X.value===O(C,V)}},Ct=(C,y)=>y.field?de(C,y.field):"",de=(C,y)=>y.split(".").reduce((V,R)=>V&&V[R],C),Nn=C=>{const y=C.align??dt.value;return{"dss-table-sortable":C.sortable!==!1&&Dt.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[C.className]:C.className}},oo=C=>{const y={};return C.width&&(y.width=typeof C.width=="number"?`${C.width}px`:C.width),C.minWidth&&(y.minWidth=typeof C.minWidth=="number"?`${C.minWidth}px`:C.minWidth),C.maxWidth&&(y.maxWidth=typeof C.maxWidth=="number"?`${C.maxWidth}px`:C.maxWidth),y};return e.watch(()=>we.locale,C=>{C&&C!==F.value&&(F.value=C)},{immediate:!0}),e.watch(Be,C=>{vn.value=C,un.value=0}),e.watch(J,C=>{k("search",C??"")}),e.watch(()=>we.columns,()=>{Rt()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Co),document.addEventListener("click",Te),document.addEventListener("click",xn),window.addEventListener("resize",on),window.addEventListener("scroll",on,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Co),document.removeEventListener("click",Te),document.removeEventListener("click",xn),window.removeEventListener("resize",on),window.removeEventListener("scroll",on,!0)}),(C,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Sn,style:e.normalizeStyle({width:ie.value+"px",height:be.value?be.value+"px":"auto"})},[se.value?(e.openBlock(),e.createElementBlock("div",qr,[e.createElementVNode("div",Ur,[Qe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=V=>k("download-pdf"))},[y[21]||(y[21]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(D)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),sn.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=V=>k("download-excel"))},[y[22]||(y[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(D)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),xe.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:tt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":yt.value}]),onClick:y[2]||(y[2]=V=>yt.value=!yt.value),"aria-expanded":yt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(D)("table.columnVisibility"))+" ",1),y[23]||(y[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Xr),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Yr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.columns,(V,R)=>(e.openBlock(),e.createElementBlock("li",{key:ot(V,R),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",jr,[e.createElementVNode("span",Kr,[e.createElementVNode("input",{type:"checkbox",checked:st(V,R),onChange:ue=>nn(V,R),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Gr),st(V,R)?(e.openBlock(),e.createElementBlock("span",Qr,[...y[24]||(y[24]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Jr,e.toDisplayString(V.header),1)])]))),128))],512),[[e.vShow,yt.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ei,[Xt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":oe.value||J.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Ye,"onUpdate:modelValue":y[4]||(y[4]=V=>J.value=V),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(D)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:y[5]||(y[5]=V=>oe.value=!0),onBlur:Ve},null,40,ti),[[e.vModelText,J.value]]),J.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:Ot},[...y[25]||(y[25]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":"Search","aria-expanded":oe.value||!!J.value,onMousedown:e.withModifiers(Ze,["prevent"])},[...y[26]||(y[26]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,ni)],2)):e.createCommentVNode("",!0),C.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",oi,[e.renderSlot(C.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":pn.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",_t.value])},[e.createElementVNode("thead",li,[e.createElementVNode("tr",null,[ut.value?(e.openBlock(),e.createElementBlock("th",ai,[ye.value==="multiple"?(e.openBlock(),e.createElementBlock("span",si,[e.createElementVNode("input",{type:"checkbox",checked:_o.value,indeterminate:kt.value,onChange:To,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,ri),kt.value?(e.openBlock(),e.createElementBlock("span",ii)):_o.value?(e.openBlock(),e.createElementBlock("span",ci,[...y[27]||(y[27]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("th",di)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value,(V,R)=>(e.openBlock(),e.createElementBlock("th",{key:Tt(V),class:e.normalizeClass(["dss-table-th",Nn(V)]),style:e.normalizeStyle(oo(V)),onClick:ue=>to(V)},[e.createElementVNode("div",mi,[e.createElementVNode("span",pi,e.toDisplayString(V.header),1),V.sortable!==!1&&Dt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Nt(V)])},[Et(V)===0?(e.openBlock(),e.createElementBlock("span",vi,[...y[28]||(y[28]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):Et(V)===1?(e.openBlock(),e.createElementBlock("span",fi,[...y[29]||(y[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):Et(V)===-1?(e.openBlock(),e.createElementBlock("span",gi,[...y[30]||(y[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),V.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Ae.value===Tt(V)}]),onClick:y[6]||(y[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Yt(Tt(V))}]),"data-filter-column-key":Tt(V),"aria-expanded":Ae.value===Tt(V),"aria-label":"Filter column",onClick:ue=>P(Tt(V),ue)},[...y[31]||(y[31]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,hi)],2)):e.createCommentVNode("",!0)])],14,ui))),128))])]),e.createElementVNode("tbody",yi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(no.value,(V,R)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:O(V,fn.value+R)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",I(V,R)]),style:e.normalizeStyle(j.value),onClick:ue=>$e(V,R,ue)},[ut.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:y[7]||(y[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",Ci,[e.createElementVNode("input",{type:ye.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${H.tableId}`,checked:ce(V,fn.value+R),onChange:ue=>ze(V,fn.value+R),class:e.normalizeClass(["dss-table-checkbox",ye.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,bi),ye.value==="multiple"&&ce(V,fn.value+R)?(e.openBlock(),e.createElementBlock("span",wi,[...y[32]||(y[32]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):ye.value==="single"&&ce(V,fn.value+R)?(e.openBlock(),e.createElementBlock("span",xi)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ue=>ge(V,fn.value+R,ue),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":Q(V,fn.value+R),"aria-label":Q(V,fn.value+R)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":Q(V,fn.value+R)}]),"aria-hidden":"true"},[...y[33]||(y[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Vi)],8,Ei)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value,(ue,qe)=>(e.openBlock(),e.createElementBlock("td",{key:Tt(ue),class:e.normalizeClass(["dss-table-td",Nn(ue)]),style:e.normalizeStyle(oo(ue))},[e.renderSlot(C.$slots,`cell-${ue.field}`,{data:V,column:ue,rowIndex:R},()=>[e.createTextVNode(e.toDisplayString(Ct(V,ue)),1)])],6))),128))],14,ki),_.value&&Q(V,fn.value+R)?(e.openBlock(),e.createElementBlock("tr",Si,[e.createElementVNode("td",{colspan:Ue.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(C.$slots,"expansion",{data:V,rowIndex:R})],8,Ni)])):e.createCommentVNode("",!0)],64))),128)),no.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(j.value)},[e.createElementVNode("td",{colspan:Ue.value,class:"dss-table-empty-cell"},[e.renderSlot(C.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(rt.value),1)])],8,Bi)],4))])],2)],2),nt.value?(e.openBlock(),e.createElementBlock("div",Mi,[e.createElementVNode("div",_i,[e.createElementVNode("div",Ti,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:un.value===0,onClick:y[8]||(y[8]=V=>He(0)),title:e.unref(D)("table.firstPage")},[...y[34]||(y[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,$i),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:un.value===0,onClick:y[9]||(y[9]=V=>He(un.value-1)),title:e.unref(D)("table.previousPage")}," ‹ ",8,Li),e.createElementVNode("span",Hi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jt.value,V=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V},[V!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":V===un.value+1}]),onClick:R=>He(V-1)},e.toDisplayString(V),11,Ai)):(e.openBlock(),e.createElementBlock("span",Di,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:un.value>=yn.value-1,onClick:y[10]||(y[10]=V=>He(un.value+1)),title:e.unref(D)("table.nextPage")}," › ",8,Ri),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:un.value>=yn.value-1,onClick:y[11]||(y[11]=V=>He(yn.value-1)),title:e.unref(D)("table.lastPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Ii)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:ko},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Wn.value}]),onClick:y[12]||(y[12]=V=>Wn.value=!Wn.value),"aria-expanded":Wn.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(vn.value)+" ",1),y[36]||(y[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Fi),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",zi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V,role:"option","aria-selected":V===vn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":V===vn.value}]),onClick:R=>jo(V)},e.toDisplayString(V),11,Pi))),128))],512),[[e.vShow,Wn.value]])]),_:1})],512)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(It.value?{top:It.value.top+"px",left:It.value.left+"px",width:gt+"px"}:void 0),onClick:y[20]||(y[20]=e.withModifiers(()=>{},["stop"]))},[Wt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Wt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Oi,[e.createElementVNode("input",{type:"text",value:rn(Ae.value).value??"",onInput:y[13]||(y[13]=V=>A(Ae.value,V.target.value)),class:"dss-table-filter-input",placeholder:e.unref(D)("table.search")||"Search..."},null,40,Wi)])):Wt.value.filter==="range"&&Vt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Vt.value.minPct+"%","--range-max-pct":Vt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Bt,class:"dss-table-filter-double-range-track",onMousemove:Tn,onMouseenter:Tn},[e.createElementVNode("input",{type:"range",min:Vt.value.rangeMin,max:Vt.value.rangeMax,value:Vt.value.currentMin,onInput:y[14]||(y[14]=V=>ke(Ae.value,"min",V.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:_n.value==="min"?2:1})},null,44,Zi),e.createElementVNode("input",{type:"range",min:Vt.value.rangeMin,max:Vt.value.rangeMax,value:Vt.value.currentMax,onInput:y[15]||(y[15]=V=>ke(Ae.value,"max",V.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:_n.value==="max"?2:1})},null,44,qi)],544),e.createElementVNode("div",Ui,e.toDisplayString(Vt.value.currentMin)+" – "+e.toDisplayString(Vt.value.currentMax),1)],4)):Wt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Xi,[e.createElementVNode("div",Yi,[e.createElementVNode("label",ji,e.toDisplayString(e.unref(D)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:rn(Ae.value).from??"",onInput:y[16]||(y[16]=V=>We(Ae.value,"from",V.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Ki)]),e.createElementVNode("div",Gi,[e.createElementVNode("label",Qi,e.toDisplayString(e.unref(D)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:rn(Ae.value).to??"",onInput:y[17]||(y[17]=V=>We(Ae.value,"to",V.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Ji)])])):Wt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:Xe[Ae.value]??"",onInput:y[18]||(y[18]=V=>Ie(Ae.value,V.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(D)("table.search")||"Search..."},null,40,ec),e.createElementVNode("div",tc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je(Wt.value),V=>(e.openBlock(),e.createElementBlock("label",{key:V,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:St(Ae.value,V),onChange:R=>$n(Ae.value,V)},null,40,nc),e.createElementVNode("span",null,e.toDisplayString(V),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",oc,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[19]||(y[19]=V=>dn(Ae.value))},e.toDisplayString(e.unref(D)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Ae.value&&Wt.value&&It.value]])]),_:1})]))],64))}}),sc={class:"dss-toolbar-left"},rc=["title"],ic=["title"],cc={class:"dss-toolbar-dropdown-wrapper"},dc=["title"],uc={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"},mc={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"},pc={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"},vc={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"},fc={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"},gc={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"},hc={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},yc=["title"],kc=["title"],Cc=["title"],bc=["title"],wc=["title"],xc=["title"],Ec=["title"],Vc=["title"],Sc=["title"],Nc={key:2,class:"dss-toolbar-separator"},Bc=["title"],Mc={key:4,class:"dss-toolbar-separator"},_c={key:5,class:"dss-toolbar-dropdown-wrapper"},Tc=["title"],$c={class:"dss-toolbar-dropdown-ai"},Lc={class:"dss-toolbar-right"},Hc={key:0,class:"dss-toolbar-custom-group"},Ac={key:1,class:"dss-toolbar-separator"},Dc={class:"dss-link-modal-content"},Rc={class:"dss-link-modal-field"},Ic={class:"dss-link-modal-label"},Fc=["placeholder"],zc={class:"dss-link-modal-field"},Pc={class:"dss-link-modal-label"},Oc=["placeholder"],Wc={class:"dss-image-modal-tabs"},Zc={key:0,class:"dss-image-tab-content"},qc={class:"dss-link-modal-content"},Uc={class:"dss-link-modal-field"},Xc={key:0,class:"dss-link-modal-label"},Yc=["src"],jc={class:"dss-link-modal-field"},Kc={class:"dss-link-modal-label"},Gc=["placeholder"],Qc={class:"dss-link-modal-field"},Jc={class:"dss-link-modal-label"},ed=["placeholder"],td={class:"dss-link-modal-field"},nd={class:"dss-link-modal-label"},od=["placeholder"],ld={key:1,class:"dss-image-tab-content"},ad={class:"dss-link-modal-content"},sd={class:"dss-link-modal-field"},rd={class:"dss-link-modal-label"},id=["placeholder"],cd={class:"dss-link-modal-field"},dd={class:"dss-link-modal-label"},ud=["placeholder"],md={class:"dss-link-modal-field"},pd={class:"dss-link-modal-label"},vd=["placeholder"],fd={class:"dss-link-modal-field"},gd={class:"dss-link-modal-label"},hd=["placeholder"],yd={class:"dss-text-editor-title-input-container"},kd={key:0,class:"dss-text-editor-title-preview"},Cd={key:0},bd={key:1,class:"dss-text-editor-preview-placeholder"},wd=["value","placeholder","disabled"],xd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Ed={class:"dss-text-editor-description-input-container"},Vd={key:0,class:"dss-text-editor-description-preview"},Sd={key:0},Nd={key:1,class:"dss-text-editor-preview-placeholder"},Bd=["value","placeholder","disabled"],Md={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},_d=["data-comment-id","onMouseenter"],Td=["onClick"],$d=["src","alt"],Ld={key:1},Hd=["onClick"],Ad=["src","alt"],Dd={key:1},Rd=["data-has-second-user","onClick"],Id={class:"editor-comment-marker-count"},Fd={key:4,class:"dss-text-editor-textarea-wrapper"},zd=["value","placeholder","rows","disabled"],Pd={class:"dss-text-editor-footer"},Od={class:"dss-text-editor-footer-content"},Wd={class:"dss-text-editor-footer-stat"},Zd={class:"dss-text-editor-footer-stat"},qd={key:5,class:"dss-text-editor-content-wrapper"},Ud={key:0,class:"dss-comment-overlay-body"},Xd={class:"dss-comment-selection-wrapper"},Yd=["innerHTML"],jd={class:"dss-comment-messages-wrapper"},Kd={key:0,class:"dss-comment-avatar-wrapper"},Gd={class:"dss-comment-avatar"},Qd=["src","alt"],Jd={key:1},eu={class:"dss-comment-header"},tu={class:"dss-comment-header-text"},nu={class:"dss-comment-author"},ou={key:0,class:"dss-comment-date"},lu=["onClick","title"],au={class:"dss-comment-overlay-inner"},su=["placeholder","onKeydown"],ru={class:"dss-text-editor-footer"},iu={class:"dss-text-editor-footer-content"},cu={class:"dss-text-editor-footer-stat"},du={class:"dss-text-editor-footer-stat"},uu=["title"],mu=["title"],pu={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:""},vu={class:"dss-image-popup-content"},fu={key:0,class:"dss-image-popup-no-alt-icon"},gu=["title"],hu=["title"],yu={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:""},ku={class:"dss-toolbar-left"},Cu=["title"],bu=["title"],wu={class:"dss-toolbar-dropdown-wrapper"},xu=["title"],Eu={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"},Vu={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"},Su={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"},Nu={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"},Bu={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"},Mu={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"},_u={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Tu=["title"],$u=["title"],Lu=["title"],Hu=["title"],Au=["title"],Du=["title"],Ru=["title"],Iu=["title"],Fu=["title"],zu=["title"],Pu={key:2,class:"dss-toolbar-separator"},Ou={key:3,class:"dss-toolbar-dropdown-wrapper"},Wu=["title"],Zu={class:"dss-toolbar-dropdown-ai"},qu={key:0,class:"dss-toolbar-right"},Uu={key:0,class:"dss-toolbar-separator"},Xu={key:0,class:"dss-toolbar-custom-group"},Yu={key:1,class:"dss-toolbar-separator"},ju={name:"DSSTextEditor"},Ku=Object.assign(ju,{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:H=>typeof H=="object"&&H!==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:H=>typeof H=="object"&&H!==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(H,{expose:he,emit:D}){const{t:F,locale:we}=cl.useI18n(),k=H,Me=D,ne=e.useSlots(),Fe=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
79
|
+
`}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(n),f=document.createElement("a");f.href=c,f.download=zo("csv"),document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(c),De()}catch(t){console.error("Error downloading CSV:",t)}},ro=t=>{if(typeof t.action=="function"){const s={series:_.series,categories:_.categories,markers:Ct.value},n={chartX:$e.value.chartX,chartY:$e.value.chartY,dataX:$e.value.mouseDataX,dataY:$e.value.mouseDataY,categoryIndex:clampedCategoryIndex||$e.value.categoryIndex};t.action(s,n)}De()},En=()=>{ao(),de.value.show=!0,de.value.categoryIndex=$e.value.categoryIndex,de.value.fromButton=!1,De()},Ko=()=>{ao(),de.value.show=!0,de.value.categoryIndex=0,de.value.fromButton=!0},xo=t=>{if($e.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&($e.value.show=!1)}},Go=t=>{$e.value.show&&!t.target.closest(".context-menu")&&($e.value.show=!1)},Qo=t=>{if(!Qt.value||!Rt.value)return;t.preventDefault(),t.stopPropagation(),I.value.isZooming=!0,He.value.show=!1,I.value.zoomTimeout&&clearTimeout(I.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),c=t.clientX-n.left,f=t.clientY-n.top;if(c<H.value.left-50||c>H.value.right+50||f<H.value.top-50||f>H.value.bottom+100){I.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,x=Math.max(I.value.minScale,Math.min(I.value.maxScale,I.value.scale*g));if(x!==I.value.scale){const{minX:b,maxX:M}=Mt.value,B=M-b||1,T=B/I.value.scale,E=b-I.value.offsetX/H.value.width*B,q=(c-H.value.left)/H.value.width,ee=E+q*T;I.value.scale=x;const ve=B/I.value.scale,Y=ee-q*ve;I.value.offsetX=-(Y-b)/B*H.value.width,I.value.scale<=1.01&&(I.value.scale=1,I.value.offsetX=0)}I.value.zoomTimeout=setTimeout(()=>{I.value.isZooming=!1,I.value.zoomTimeout=null},300)},Cl=t=>{if(!Qt.value||!Rt.value||I.value.scale<=1)return;He.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,I.value.isDragging=!0,I.value.lastMouseX=t.clientX,I.value.lastMouseY=t.clientY,t.preventDefault()},Tl=()=>{I.value.isDragging=!1},Jo=()=>{!Qt.value||!Rt.value||(I.value.scale=1,I.value.offsetX=0,I.value.isDragging=!1,I.value.zoomTimeout&&(clearTimeout(I.value.zoomTimeout),I.value.zoomTimeout=null),I.value.isZooming=!1)},bl=()=>!Qt.value||!To.value||!Rt.value?"default":I.value.isDragging?"grabbing":I.value.scale>1?"grab":"dss-crosshair",el=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 s=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const c=t[Math.max(n-1,0)],f=t[n],g=t[n+1],x=t[Math.min(n+2,t.length-1)],b=f.x+(g.x-c.x)/6*Z.value,M=f.y+(g.y-c.y)/6*Z.value,B=g.x-(x.x-f.x)/6*Z.value,T=g.y-(x.y-f.y)/6*Z.value;s+=` C ${b} ${M} ${B} ${T} ${g.x} ${g.y}`}return s},bn=e.computed(()=>{const s=z.value?.chart?.padding,n=typeof s=="number"?s:null,c=s&&typeof s=="object"?s:null,f=50;let g=f+(Xt.value?30:0)+60;if(jn.value){const E={left:f+40,top:f+40,right:f+40,bottom:f+40};return n!=null?{left:n,top:n,right:n,bottom:n}:c?{left:c.left??E.left,top:c.top??E.top,right:c.right??E.right,bottom:c.bottom??E.bottom}:E}if(mn.value){const E=!Ze.value,q=xn.value,ee=q?to.value+Ln.value+Math.max(24,on.value+16):0,ve=E?12:f;let Y=0;rt.value&&(Y+=E?8:15),Qe.value&&(Y+=E?6:10);const ae=Le();let re=ve+(E?4:16)+(q?ee:0),K=ve+(q?ee:0);Ze.value&&Ve.value==="left"?re+=ae.legendWidth||150:Ze.value&&Ve.value==="right"&&(K+=ae.legendWidth||150);const me=te.value==="semi-radial"?q?ee:8:q?ee:E?8:f+80,pe=q?14:0,Ne=ve+Y+pe,Ee={left:re,top:Ne,right:K,bottom:me};return n!=null?{left:n,top:n,right:n,bottom:n}:c?{left:c.left??Ee.left,top:c.top??Ee.top,right:c.right??Ee.right,bottom:c.bottom??Ee.bottom}:Ee}let x=0;rt.value&&(x+=15),Qe.value&&(x+=10);const b=Le();let M=f+16,B=f;Ze.value&&Ve.value==="left"?M+=b.legendWidth||150:Ze.value&&Ve.value==="right"&&(B+=b.legendWidth||150),Ze.value&&Ve.value==="bottom"&&(g+=b.legendHeight||0);const T={left:M,top:f+x,right:B,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:c?{left:c.left??T.left,top:c.top??T.top,right:c.right??T.right,bottom:c.bottom??T.bottom}:T}),H=e.computed(()=>({left:bn.value.left,top:bn.value.top,right:he.value-bn.value.right,bottom:nt.value-bn.value.bottom,width:he.value-(bn.value.left+bn.value.right),height:nt.value-(bn.value.top+bn.value.bottom)})),Qt=e.computed(()=>["line","area","bar"].includes(te.value)||pn.value),Bn=e.computed(()=>pn.value),mn=e.computed(()=>["radial","semi-radial"].includes(te.value)),jn=e.computed(()=>te.value==="spider"),Lt=e.computed(()=>te.value==="bubble"),Kt=e.computed(()=>z.value?.chart?.orientation==="horizontal"&&(te.value==="bar"||Bn.value)),Kn=t=>{const{minY:s,maxY:n}=Mt.value,c=n-s||1;return H.value.left+(t-s)/c*H.value.width},vo=t=>{const{maxX:s}=Mt.value,n=s+1,f=H.value.height/n;return H.value.top+(t+.5)*f},vt=e.computed(()=>mn.value?bn.value.left+(he.value-bn.value.left-bn.value.right)/2:he.value/2),ft=e.computed(()=>jn.value?nt.value/2-40:mn.value?bn.value.top+(nt.value-bn.value.top-bn.value.bottom)/2:nt.value/2),Je=e.computed(()=>{if(jn.value){const t=H.value.width-80,s=H.value.height-80;return Math.min(t,s)/2}return Math.min(H.value.width,H.value.height)/2}),wt=e.computed(()=>{const t=z.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof s=="number"&&s>=0&&s<=1?s:.45;return Je.value*n}),Po=e.computed(()=>{const t=z.value,s=typeof _.innerSize=="number"?_.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(mn.value||jn.value)?1:1+s/100}),$o=e.computed(()=>{const t=Po.value;if(t===1||t<=0)return;const s=vt.value,n=ft.value;return`translate(${s}, ${n}) scale(${t}) translate(${-s}, ${-n})`}),Lo=e.ref(0),tl=e.computed(()=>`semi-radial-fill-clip-${_.chartId}`),io=e.computed(()=>te.value==="semi-radial"),Zn=e.computed(()=>io.value&&ye.value&&!Mn.value),Dn=e.computed(()=>io.value&&ye.value&&!Mn.value&&et.value==="fill"),fo=e.computed(()=>{const t=Zn.value?Lo.value:1,s=vt.value,n=ft.value,c=wt.value,f=Je.value,g=Math.PI,x=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;const b=s+f*Math.cos(g),M=n+f*Math.sin(g),B=s+f*Math.cos(x),T=n+f*Math.sin(x),E=s+c*Math.cos(x),q=n+c*Math.sin(x),ee=s+c*Math.cos(g),ve=n+c*Math.sin(g),Y=t>.5?1:0;return`M ${s} ${n} L ${b} ${M} A ${f} ${f} 0 ${Y} 1 ${B} ${T} L ${E} ${q} A ${c} ${c} 0 ${Y} 1 ${ee} ${ve} Z`}),Eo=e.computed(()=>{if(!(!io.value||!Zn.value)&&!Dn.value)return`url(#${tl.value})`}),Ft=t=>{if(!(!Dn.value||t!==0))return`url(#${tl.value})`},co=e.ref(0),nl=e.computed(()=>`radial-reveal-clip-${_.chartId}`),hn=e.computed(()=>te.value==="radial"),go=e.computed(()=>{const t=hn.value?co.value:1,s=vt.value,n=ft.value,c=Math.max(Je.value*1.5,he.value,nt.value);if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;if(t>=1){const E=s-c,q=s+c;return`M ${E} ${n} A ${c} ${c} 0 0 1 ${q} ${n} A ${c} ${c} 0 0 1 ${E} ${n} Z`}const f=-Math.PI/2,g=f+t*Math.PI*2,x=s+c*Math.cos(f),b=n+c*Math.sin(f),M=s+c*Math.cos(g),B=n+c*Math.sin(g),T=t>=.5?1:0;return`M ${s} ${n} L ${x} ${b} A ${c} ${c} 0 ${T} 1 ${M} ${B} Z`}),Vo=e.computed(()=>{if(Eo.value)return Eo.value;if(hn.value)return`url(#${nl.value})`});let Rn=null;const So=()=>{if(!Zn.value)return;Lo.value=0;const t=Se.value,s=performance.now(),n=c=>{const f=c-s,g=Math.min(1,f/t);Lo.value=Uo(mt.value,g),g<1&&(Rn=requestAnimationFrame(n))};Rn=requestAnimationFrame(n)},wl=e.computed(()=>z.value?.bubbles?.minSize||8),$l=e.computed(()=>z.value?.bubbles?.maxSize||50),No=e.computed(()=>z.value?.bubbles?.opacity||.7),ol=(t,s)=>{const n=[15,20,25,18,22],c=n[t%n.length]||20,f=1+Math.sin(s*.5)*.2;return Math.max(5,c*f)},Ho=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},xl=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Gn=e.computed(()=>_.series),ho=e.computed(()=>_.series.filter((t,s)=>!kt.value.has(s))),In="auto",Mt=e.computed(()=>{if(Lt.value)return ll();if(!ho.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,n=0;ho.value.forEach(b=>{b.data&&b.data.length&&(n=Math.max(n,b.data.length-1),b.data.forEach(M=>{typeof M=="number"&&(t=Math.min(t,M),s=Math.max(s,M))}))}),_.categories.length>0&&(n=Math.max(n,_.categories.length-1)),t===1/0&&(t=0,s=100);const c=xe.value,f=J.value;let g,x;if(c===In){const b=s-t,M=b>0?b*.1:1;g=Math.max(0,t-M)}else if(typeof c=="number")g=c;else{const b=s-t,M=b>0?b*.1:1;g=Math.max(0,t-M)}if(f===In){const b=s-t,M=b>0?b*.1:2;x=s+M}else if(typeof f=="number")x=f;else{const b=s-t,M=b>0?b*.1:2;x=s+M}return{minX:0,maxX:n,minY:g,maxY:x}}),ll=()=>{if(!ho.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,n=1/0,c=-1/0,f=1/0,g=-1/0,x=!1;if(ho.value.forEach((ee,ve)=>{ee?.data?.length&&ee.data.forEach((Y,ae)=>{let re,K,Re;if(typeof Y=="object"&&Y!==null&&!Array.isArray(Y))re=typeof Y.x=="number"?Y.x:ae,K=typeof Y.y=="number"?Y.y:0,Re=typeof Y.size=="number"?Y.size:20;else if(Array.isArray(Y)&&Y.length>=3)re=typeof Y[0]=="number"?Y[0]:ae,K=typeof Y[1]=="number"?Y[1]:0,Re=typeof Y[2]=="number"?Y[2]:20;else if(typeof Y=="number")re=ae,K=Y,Re=ol(ve,ae);else return;isFinite(re)&&isFinite(K)&&isFinite(Re)&&(t=Math.min(t,re),s=Math.max(s,re),n=Math.min(n,K),c=Math.max(c,K),f=Math.min(f,Re),g=Math.max(g,Re),x=!0)})}),!x)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,_.categories?.length-1||8)),n===c&&(n=Math.max(0,n-10),c=n+20);const b=s-t,M=c-n;let B,T,E,q;return oe.value!==null?B=oe.value:B=t-b*.1,Ye.value!==null?T=Ye.value:T=s+b*.1,xe.value!==null&&typeof xe.value=="number"?E=xe.value:E=Math.max(0,n-M*.1),J.value!==null&&typeof J.value=="number"?q=J.value:q=c+M*.1,{minX:B,maxX:T,minY:E,maxY:q,minSize:f,maxSize:g}},zt=t=>{if(Lt.value){const{minX:b,maxX:M}=Mt.value,B=M-b||1;return H.value.left+(t-b)/B*H.value.width}const{minX:s,maxX:n}=Mt.value,c=n-s;if(n===0||c===0)return H.value.left+H.value.width/2;const f=c/I.value.scale,g=s-I.value.offsetX/H.value.width*c,x=(t-g)/f;return H.value.left+x*H.value.width},Jt=t=>{const{minY:s,maxY:n}=Mt.value,c=n-s||1;return H.value.bottom-(t-s)/c*H.value.height},al=t=>{if(!Lt.value)return tt.value||4;const{maxSize:s}=Mt.value,n=Math.max(1,s),c=Math.min(1,Math.max(0,t/n));return wl.value+c*($l.value-wl.value)},El=e.computed(()=>rl.value.map(t=>({y:t.y}))),sl=e.computed(()=>{if(Lt.value)return Vl();if(te.value==="bar"){if(Kt.value){const me=[],{minY:pe,maxY:Ne}=Mt.value,Ee=5,lt=Ne-pe||1;for(let at=0;at<=Ee;at++){const wn=pe+lt*(at/Ee),Ut=Kn(wn);me.push({x:Ut,y:H.value.bottom+20,text:dn(Math.round(wn))})}return me}const ve=[],{maxX:Y}=Mt.value,ae=Y+1,re=5,Re=(H.value.width-re*2)/ae;for(let me=0;me<=Y;me++){const pe=H.value.left+re+(me+.5)*Re;ve.push({x:pe,y:H.value.bottom+20,text:_.categories[me]||D("chart.fallback.item",{number:me+1})})}return ve}const t=[],{minX:s,maxX:n}=Mt.value,c=n-s||1,f=c/I.value.scale,g=s-I.value.offsetX/H.value.width*c,x=g+f,b=Math.max(0,Math.floor(g-2)),M=Math.min(n,Math.ceil(x+2)),B=M-b,T=H.value.width,q=Math.floor(T/60);let ee=1;B>q&&(ee=Math.ceil(B/q));for(let ve=b;ve<=M;ve+=ee)if(ve>=0&&ve<=n){const Y=zt(ve);Y>=H.value.left-100&&Y<=H.value.right+100&&t.push({x:Y,y:H.value.bottom+20,text:_.categories[ve]||`Item ${ve+1}`})}return t}),Vl=()=>{const t=[],{minX:s,maxX:n}=Mt.value,c=n-s||1,f=Math.min(8,Math.max(4,Math.floor(H.value.width/80)));for(let g=0;g<=f;g++){const x=s+c*g/f,b=zt(x);if(b>=H.value.left-10&&b<=H.value.right+10){const M=Math.round(x),B=_.categories?.[M];t.push({x:b,y:H.value.bottom+20,text:B||(Number.isInteger(x)?x.toString():x.toFixed(1))})}}return t},rl=e.computed(()=>{if(Kt.value){const f=[],{maxX:g}=Mt.value;for(let x=0;x<=g;x++)f.push({x:H.value.left-10,y:vo(x),text:_.categories[x]||`Item ${x+1}`});return f}const t=[],{minY:s,maxY:n}=Mt.value,c=5;for(let f=0;f<=c;f++){const g=s+(n-s)*(f/c),x=Math.round(g);t.push({x:H.value.left-10,y:Jt(g),text:dn(x)})}return t}),Ht=t=>{const s=Q.value;if(!s||s.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return s[t%s.length]},Ao=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let n=0,c=0,f=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,c=Number(g[2])/255,f=Number(g[3])/255;else{const b=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)n=Number(b[1])/255,c=Number(b[2])/255,f=Number(b[3])/255;else{const M=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(M){let B=M[1];B.length===3&&(B=B[0]+B[0]+B[1]+B[1]+B[2]+B[2]),n=parseInt(B.slice(0,2),16)/255,c=parseInt(B.slice(2,4),16)/255,f=parseInt(B.slice(4,6),16)/255}else if(typeof document<"u"){const B=document.createElement("span");B.style.color=s,B.style.display="none",document.body.appendChild(B);const T=getComputedStyle(B).color;document.body.removeChild(B);const E=T.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(E)n=Number(E[1])/255,c=Number(E[2])/255,f=Number(E[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*c+.0722*f>.5?"#3a3a3a":"#fafafa"},qn=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),n=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const g=Math.max(0,Math.floor(Number(n[1])*.65)),x=Math.max(0,Math.floor(Number(n[2])*.65)),b=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${x}, ${b})`}const c=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(c){const g=Math.max(0,Math.floor(Number(c[1])*.65)),x=Math.max(0,Math.floor(Number(c[2])*.65)),b=Math.max(0,Math.floor(Number(c[3])*.65));return`rgba(${g}, ${x}, ${b}, ${c[4]})`}const f=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(f){let g=f[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const x=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),M=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[x,b,M].map(B=>B.toString(16).padStart(2,"0")).join("")}`}return s},Do=(t,s)=>{const c=z.value?.stroke?.color;return c==null?qn(s):typeof c=="string"?c:Array.isArray(c)&&c.length?c[t%c.length]??qn(s):qn(s)},Oo=t=>{let s=0;for(let n=1;n<t.length;n++){const c=t[n].x-t[n-1].x,f=t[n].y-t[n-1].y;s+=Math.sqrt(c*c+f*f)}return s},Sl=e.computed(()=>te.value==="line"||Bn.value?(Bn.value?_.series.filter(s=>(s.type||te.value)==="line"):Gn.value).map((s,n)=>{const c=_.series.findIndex(E=>E===s),f=[];let g=[];s.data.forEach((E,q)=>{E==null?g.length>0&&(f.push([...g]),g=[]):g.push({x:Kt.value?Kn(E):zt(q),y:Kt.value?vo(q):Jt(E),index:q})}),g.length>0&&f.push(g);let x="";f.forEach(E=>{if(E.length>0){let q="";O.value?q=el(E):q=`M ${E[0].x} ${E[0].y}`+E.slice(1).map(ee=>` L ${ee.x} ${ee.y}`).join(""),x+=(x?" ":"")+q}});const b=f.reduce((E,q)=>E+Oo(q),0),M=kt.value.has(c),B=ce.value===c,T=ce.value!==null&&ce.value!==c;return{path:x,color:Ht(c),pathLength:b,seriesIndex:c,animationDelay:n*Et.value,isHighlighted:B,isDimmed:T,isHidden:M}}):[]),Nl=e.computed(()=>{if(!(te.value==="line"||Bn.value))return[];const t=Bn.value?_.series.filter(n=>(n.type||te.value)==="line"):Gn.value,s=[];return t.forEach((n,c)=>{const f=_.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const x=n.data[g];if(x!=null){let b=-1,M=0;for(let B=g+1;B<n.data.length;B++){const T=n.data[B];if(T==null)M++;else{b=B;break}}if(M>0&&b!==-1){const B=n.data[b],T=Kt.value?Kn(x):zt(g),E=Kt.value?vo(g):Jt(x),q=Kt.value?Kn(B):zt(b),ee=Kt.value?vo(b):Jt(B),ve=kt.value.has(f),Y=ce.value===f,ae=ce.value!==null&&ce.value!==f;s.push({path:`M ${T} ${E} L ${q} ${ee}`,color:Ht(f),seriesIndex:f,animationDelay:c*Et.value,isHighlighted:Y,isDimmed:ae,isHidden:ve,gapSize:M}),g=b-1}}}}),s}),Ll=e.computed(()=>te.value==="line"||Bn.value?!ye.value||Mn.value||it.value.hasAnimated?[]:(Bn.value?_.series.filter(s=>(s.type||te.value)==="line"):Gn.value).map((s,n)=>{const c=_.series.findIndex(M=>M===s);let f="",g=null;s.data.forEach((M,B)=>{if(M!=null){const T={x:Kt.value?Kn(M):zt(B),y:Kt.value?vo(B):Jt(M)};g===null?f+=`M ${T.x} ${T.y}`:f+=` L ${T.x} ${T.y}`,g=T}else if(g!==null){const T=s.data.findIndex((E,q)=>q>B&&E!==null&&E!==void 0);if(T!==-1){const E={x:Kt.value?Kn(s.data[T]):zt(T),y:Kt.value?vo(T):Jt(s.data[T])};f+=` L ${E.x} ${E.y}`,g=E}}});const x=s.data.map((M,B)=>M==null?null:{x:Kt.value?Kn(M):zt(B),y:Kt.value?vo(B):Jt(M)}).filter(M=>M!==null),b=Oo(x);return{path:f,pathLength:b,color:Ht(c),animationDelay:n*Et.value,seriesIndex:c}}):[]),Wo=e.computed(()=>{if(te.value!=="line")return[];const t=[];return Gn.value.forEach((s,n)=>{const c=ce.value===n,f=ce.value!==null&&ce.value!==n,g=kt.value.has(n);s.data.forEach((x,b)=>{x!=null&&t.push({x:zt(b),y:Jt(x),color:Ht(n),value:x,label:_.categories[b]||b.toString(),seriesName:s.name,categoryIndex:b,dataIndex:b,animationDelay:(n*s.data.length+b)*(Et.value/8),isHighlighted:c,isDimmed:f,isHidden:g})})}),t}),Fn=e.computed(()=>{if(!Bn.value)return[];const t=[];return _.series.filter(n=>(n.type||te.value)==="line").forEach((n,c)=>{const f=_.series.findIndex(M=>M===n),g=ce.value===f,x=ce.value!==null&&ce.value!==f,b=kt.value.has(f);n.data.forEach((M,B)=>{M!=null&&t.push({x:zt(B),y:Jt(M),color:Ht(f),value:M,label:_.categories[B]||B.toString(),seriesName:n.name,categoryIndex:B,dataIndex:B,animationDelay:(c*n.data.length+B)*(Et.value/8),isHighlighted:g,isDimmed:x,isHidden:b})})}),t}),Zo=e.computed(()=>{if(!Lt.value)return[];const t=[];return Gn.value.forEach((s,n)=>{if(!s?.data?.length)return;const c=ce.value,f=c!==null&&c===n,g=c!==null&&c!==n,x=kt.value.has(n);s.data.forEach((b,M)=>{let B,T,E,q,ee;if(typeof b=="object"&&b!==null&&!Array.isArray(b))B=typeof b.x=="number"?b.x:M,T=typeof b.y=="number"?b.y:0,E=typeof b.size=="number"?b.size:20,q=b.label||_.categories?.[M]||`Point ${M+1}`,ee=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)B=typeof b[0]=="number"?b[0]:M,T=typeof b[1]=="number"?b[1]:0,E=typeof b[2]=="number"?b[2]:20,q=b[3]||_.categories?.[M]||`Point ${M+1}`,ee=b[4];else if(typeof b=="number")B=M,T=b,E=ol(n,M),q=_.categories?.[M]||`Point ${M+1}`;else return;!isFinite(B)||!isFinite(T)||!isFinite(E)||t.push({x:zt(B),y:Jt(T),radius:al(E),originalX:B,originalY:T,originalSize:E,color:Ht(n),seriesName:s.name||`Series ${n+1}`,label:q,imageUrl:ee,seriesIndex:n,dataIndex:M,categoryIndex:Math.round(B),isHighlighted:f,isDimmed:g,isHidden:x,opacity:No.value})})}),t}),Qn=e.computed(()=>te.value!=="area"?[]:Gn.value.map((t,s)=>{const n=[];let c=[];if(t.data.forEach((E,q)=>{E==null?c.length>0&&(n.push([...c]),c=[]):c.push({x:zt(q),y:Jt(E),index:q})}),c.length>0&&n.push(c),n.length===0)return{linePath:"",areaPath:"",color:Ht(s),isHidden:kt.value.has(s)};const f=H.value.bottom+1;let g="",x="";n.forEach((E,q)=>{if(E.length===0)return;let ee=`M ${E[0].x} ${E[0].y}`;O.value&&E.length>1?ee=el(E):E.slice(1).forEach(Y=>{ee+=` L ${Y.x} ${Y.y}`}),g+=(g?" ":"")+ee;let ve=`M ${E[0].x} ${f}`;if(ve+=` L ${E[0].x} ${E[0].y}`,O.value&&E.length>1){const Y=el(E),ae=Y.substring(Y.indexOf("C")||Y.indexOf("Q")||Y.indexOf("L"));ae?ve+=" "+ae:E.slice(1).forEach(re=>{ve+=` L ${re.x} ${re.y}`})}else E.slice(1).forEach(Y=>{ve+=` L ${Y.x} ${Y.y}`});ve+=` L ${E[E.length-1].x} ${f} Z`,x+=(x?" ":"")+ve});const b=ce.value===s,M=ce.value!==null&&ce.value!==s,B=kt.value.has(s),T=n.reduce((E,q)=>E+Oo(q),0);return{linePath:g,areaPath:x,color:Ht(s),pathLength:T,isHighlighted:b,isDimmed:M,isHidden:B}})),qo=e.computed(()=>{if(!(["bar"].includes(te.value)||Bn.value))return[];const t=[],{maxX:s}=Mt.value,n=Bn.value?_.series.filter(f=>(f.type||te.value)==="bar"):Gn.value,c=n.length;if(Kt.value){const f=s+1,x=H.value.height/f,b=x*(2/3),M=Math.min(4,b/c*.15),B=b-(c-1)*M,T=Math.max(4,B/c);n.forEach((E,q)=>{const ee=_.series.findIndex(re=>re===E),ve=ce.value===ee,Y=ce.value!==null&&ce.value!==ee,ae=kt.value.has(ee);E.data.forEach((re,K)=>{if(re==null||typeof re!="number"||!isFinite(re))return;const pe=H.value.top+(K+.5)*x-b/2+q*(T+M),Ne=H.value.left,Ee=Math.abs(Kn(re)-H.value.left);let lt="";if(O.value&&Ee>0){const at=Math.min(X.value,T/2,Ee/2);lt=[`M ${Ne} ${pe}`,`L ${Ne+Ee-at} ${pe}`,`Q ${Ne+Ee} ${pe} ${Ne+Ee} ${pe+at}`,`L ${Ne+Ee} ${pe+T-at}`,`Q ${Ne+Ee} ${pe+T} ${Ne+Ee-at} ${pe+T}`,`L ${Ne} ${pe+T}`,"Z"].join(" ")}t.push({x:Ne,y:pe,width:Ee,height:T,color:Ht(c===1?K:ee),value:re,label:_.categories[K]||K.toString(),seriesName:E.name,animationDelay:(q*n.length+K)*(Et.value/4),isHighlighted:ve,isDimmed:Y,isHidden:ae,barPath:lt,isSmooth:O.value&&Ee>0})})})}else{const f=s+1,x=H.value.width/f,b=x*.8,M=b/c,B=M*.05,T=M-B;n.forEach((E,q)=>{const ee=_.series.findIndex(re=>re===E),ve=ce.value===ee,Y=ce.value!==null&&ce.value!==ee,ae=kt.value.has(ee);E.data.forEach((re,K)=>{if(re==null||typeof re!="number"||!isFinite(re))return;const pe=H.value.left+(K+.5)*x-b/2+q*M+B/2,Ne=Jt(Math.max(0,re)),Ee=Math.abs(Jt(0)-Jt(re));let lt="";if(O.value&&Ee>0){const at=Math.min(X.value,T/2,Ee/2);lt=[`M ${pe} ${Ne+Ee}`,`L ${pe} ${Ne+at}`,`Q ${pe} ${Ne} ${pe+at} ${Ne}`,`L ${pe+T-at} ${Ne}`,`Q ${pe+T} ${Ne} ${pe+T} ${Ne+at}`,`L ${pe+T} ${Ne+Ee}`,"Z"].join(" ")}t.push({x:pe,y:Ne,width:T,height:Ee,color:Ht(c===1?K:ee),value:re,label:_.categories[K]||K.toString(),seriesName:E.name,animationDelay:(q*n.length+K)*(Et.value/4),isHighlighted:ve,isDimmed:Y,isHidden:ae,barPath:lt,isSmooth:O.value&&Ee>0})})})}return t}),yo=e.computed(()=>{if(!mn.value)return[];const t=Gn.value.map((g,x)=>({series:g,originalIndex:x})).filter(({originalIndex:g})=>!kt.value.has(g));if(t.length===0)return[];let s=te.value==="semi-radial"?Math.PI:-Math.PI/2;const n=te.value==="semi-radial"?Math.PI:Math.PI*2,c=[];if(t.length===1){const{series:g,originalIndex:x}=t[0],b=g.data[0]||0,M=s,B=s+n-.001,T=M+n/2,E=vt.value+Math.cos(M)*wt.value,q=ft.value+Math.sin(M)*wt.value,ee=vt.value+Math.cos(B)*wt.value,ve=ft.value+Math.sin(B)*wt.value,Y=vt.value+Math.cos(B)*Je.value,ae=ft.value+Math.sin(B)*Je.value,re=vt.value+Math.cos(M)*Je.value,K=ft.value+Math.sin(M)*Je.value,Re=1,me=[`M ${E} ${q}`,`A ${wt.value} ${wt.value} 0 ${Re} 1 ${ee} ${ve}`,`L ${Y} ${ae}`,`A ${Je.value} ${Je.value} 0 ${Re} 0 ${re} ${K}`,"Z"].join(" "),pe=Ht(x);return c.push({path:me,color:pe,strokeWidth:nn.value,strokeColor:Do(0,pe),value:b,seriesName:g.name,opacity:.8,isHighlighted:ce.value===x,isDimmed:!1,isHidden:!1,startAngle:M,endAngle:B,midAngle:T}),c}if(Dn.value&&t.length===2){const g=t[0],x=t[1],b=Math.min(100,Math.max(0,g.series.data[0]||0)),M=b/100*n,B=(T,E,q,ee,ve)=>{const Y=T+(E-T)/2,ae=E-T,re=vt.value+Math.cos(T)*wt.value,K=ft.value+Math.sin(T)*wt.value,Re=vt.value+Math.cos(E)*wt.value,me=ft.value+Math.sin(E)*wt.value,pe=vt.value+Math.cos(E)*Je.value,Ne=ft.value+Math.sin(E)*Je.value,Ee=vt.value+Math.cos(T)*Je.value,lt=ft.value+Math.sin(T)*Je.value,at=ae>Math.PI?1:0,wn=[`M ${re} ${K}`,`A ${wt.value} ${wt.value} 0 ${at} 1 ${Re} ${me}`,`L ${pe} ${Ne}`,`A ${Je.value} ${Je.value} 0 ${at} 0 ${Ee} ${lt}`,"Z"].join(" "),Ut=Ht(ee);return{path:wn,color:Ut,strokeWidth:nn.value,strokeColor:Do(c.length,Ut),value:ve,seriesName:q.name,opacity:.8,isHighlighted:ce.value===ee,isDimmed:ce.value!==null&&ce.value!==ee,isHidden:!1,startAngle:T,endAngle:E,midAngle:Y}};return c.push(B(s,s+M,g.series,g.originalIndex,b)),c.push(B(s,s+n,x.series,x.originalIndex,100)),c}const f=t.reduce((g,{series:x})=>g+(x.data[0]||0),0);return f===0?[]:(t.forEach(({series:g,originalIndex:x})=>{const b=g.data[0]||0,M=b/f*n,B=s,T=s+M,E=B+M/2,q=vt.value+Math.cos(B)*wt.value,ee=ft.value+Math.sin(B)*wt.value,ve=vt.value+Math.cos(T)*wt.value,Y=ft.value+Math.sin(T)*wt.value,ae=vt.value+Math.cos(T)*Je.value,re=ft.value+Math.sin(T)*Je.value,K=vt.value+Math.cos(B)*Je.value,Re=ft.value+Math.sin(B)*Je.value,me=M>Math.PI?1:0,pe=[`M ${q} ${ee}`,`A ${wt.value} ${wt.value} 0 ${me} 1 ${ve} ${Y}`,`L ${ae} ${re}`,`A ${Je.value} ${Je.value} 0 ${me} 0 ${K} ${Re}`,"Z"].join(" "),Ne=Ht(x);c.push({path:pe,color:Ne,strokeWidth:nn.value,strokeColor:Do(c.length,Ne),value:b,seriesName:g.name,opacity:.8,isHighlighted:ce.value===x,isDimmed:ce.value!==null&&ce.value!==x,isHidden:!1,startAngle:B,endAngle:T,midAngle:E}),s=T}),c)}),Bl=e.computed(()=>{const t=yo.value;return Dn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,n)=>({segment:s,originalIndex:n}))}),Ml=e.computed(()=>{if(!xn.value||!mn.value)return[];const t=on.value,s=to.value,n=Ln.value,c=un.value,f=15,g=t*1.3,x=.55,b=(E,q)=>{const ee=vt.value+Math.cos(E.midAngle)*Je.value,ve=ft.value+Math.sin(E.midAngle)*Je.value,Y=vt.value+Math.cos(E.midAngle)*(Je.value+s),ae=ft.value+Math.sin(E.midAngle)*(Je.value+s),K=Y+n*(q?1:-1),Re=q?Y+f:Y-f,me=ae-c,pe=`${E.seriesName}: ${dn(E.value)}`,Ne=pe.length*t*x;return{pointerStartX:ee,pointerStartY:ve,pointerEndX:Y,pointerEndY:ae,horizontalEndX:K,horizontalEndY:ae,textX:Re,textY:me,text:pe,textWidth:Ne,textAnchor:q?"start":"end",isRightSide:q,pointerLineLength:Math.hypot(Y-ee,ae-ve),horizontalLineLength:Math.hypot(K-Y,0)}},M=(E,q)=>{const ee=Math.abs(E.textY-q.textY)<g,ve=E.isRightSide?E.textX:E.textX-E.textWidth,Y=E.isRightSide?E.textX+E.textWidth:E.textX,ae=q.isRightSide?q.textX:q.textX-q.textWidth,re=q.isRightSide?q.textX+q.textWidth:q.textX,K=ve<re&&ae<Y;return ee&&K},B=yo.value.filter(E=>!E.isHidden),T=[];for(let E=0;E<B.length;E++){const q=B[E];let ee=Math.cos(q.midAngle)>=0;if(E>0){const Y=T[E-1],ae=b(q,ee);M(Y,ae)&&(ee=!ee)}const ve=b(q,ee);T.push({...ve,color:q.color,isHighlighted:q.isHighlighted,isDimmed:q.isDimmed})}return T}),l=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||No.value||.7;return ce.value===null||ce.value===void 0?s:ce.value!==null?t.seriesIndex===ce.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},o=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return ce.value!==null?t.seriesIndex===ce.value?Math.min(1,s+.1):s*.7:s},a=(t,s)=>{if(t)try{if(ce.value===t.seriesIndex?ce.value=null:ce.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:_.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},r=(t,s)=>{const n=[`dss-bubble-fallback-${s}`];return t.isHighlighted&&n.push("dss-bubble-highlighted"),t.isDimmed&&n.push("dss-bubble-dimmed"),t.isHidden&&n.push("dss-bubble-hidden"),n.push(`dss-bubble-series-${t.seriesIndex}`),n.join(" ")},i=(t,s)=>{if(!t||(s.stopPropagation(),zn.value=!0,ce.value=t.seriesIndex,He.value.show=!1,!_t.value))return;const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const c=n.getBoundingClientRect();let f=s.clientX-c.left+10,g=s.clientY-c.top-10;const x=200,b=120;f+x>he.value&&(f=s.clientX-c.left-x-10),g+b>c.height&&(g=s.clientY-c.top-b-10),f<0&&(f=10),g<0&&(g=10);const M=Hn.value,B=po.value,T=M.map(E=>{const q=B[E]||E,ee=u(E,t);return ee?{seriesName:t.seriesName,label:t.label,value:`${q}: ${ee}`,color:t.color}:null}).filter(Boolean);ze.value={show:!0,x:f,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:T,categoryIndex:void 0,spiderSeries:[]}},u=(t,s)=>{let n;switch(t){case"x":n=s.originalX;break;case"y":n=s.originalY;break;case"size":n=s.originalSize;break;case"label":n=s.label;break;case"seriesName":n=s.seriesName;break;default:n=s[t]||""}const c=_o.value[t];if(typeof c=="function")return c(n,s);if(typeof n=="number"){const f=n.toFixed(1);return Yt.value?f+Yt.value:f}return n?.toString()||""},d=()=>{if(!Lt.value||!He.value.data||He.value.data.length===0)return"Bubbles";const t=[],s=new Set;return He.value.data.forEach(n=>{if(n.seriesName&&n.label){const c=`${n.seriesName} - ${n.label}`;s.has(c)||(t.push(c),s.add(c))}else n.seriesName&&(s.has(n.seriesName)||(t.push(n.seriesName),s.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},m=(t,s)=>{t&&(zn.value=!1,ce.value=null,ze.value.show=!1,ze.value.bubbleData=[])},v=(t,s)=>{const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const c=n.getBoundingClientRect(),f=Fo(t.categoryIndex),g=t.description||t.comment||"";let x=s.clientX-c.left+15,b=s.clientY-c.top-10;const M=200,B=g?80:50;x+M>he.value&&(x=s.clientX-c.left-M-15),b+B>nt.value&&(b=s.clientY-c.top-B-10),x<0&&(x=10),b<0&&(b=10),jt.value={show:!0,x,y:b,categoryValue:f,description:g}},h=()=>{jt.value.show=!1},S=e.computed(()=>_.categories.length||Math.max(...ho.value.map(t=>t.data.length))),N=e.computed(()=>{let t=0;return ho.value.forEach(s=>{s.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),w=e.computed(()=>{const t=[],s=S.value;for(let n=0;n<s;n++){const c=n*2*Math.PI/s-Math.PI/2,f=vt.value+Math.cos(c)*Je.value,g=ft.value+Math.sin(c)*Je.value;t.push({x:f,y:g,angle:c,index:n})}return t}),U=e.computed(()=>{const t=[],s=S.value;return w.value.forEach((n,c)=>{const f=Je.value+15,g=c*2*Math.PI/s-Math.PI/2,x=vt.value+Math.cos(g)*f,b=ft.value+Math.sin(g)*f+5;let M="middle",B="middle";Math.abs(Math.cos(g))>.5&&(M=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(B=Math.sin(g)>0?"hanging":"auto"),t.push({x,y:b,text:_.categories[c]||`Axis ${c+1}`,anchor:M,baseline:B})}),t}),W=e.ref(new Set),Ce=(t,s,n)=>{const c=`current-${n}`,f=W.value.has(c);return!f&&ce.value===null?s.fillOpacity||Ae.value:s.isHighlighted||f?(s.fillOpacity||Ae.value)+.15:s.isDimmed?(s.fillOpacity||Ae.value)*.3:s.fillOpacity||Ae.value},le=e.computed(()=>{if(!jn.value)return[];const t=[],s=S.value;return Gn.value.forEach((n,c)=>{const f=[],g=[],x=[],b=ce.value===c,M=ce.value!==null&&ce.value!==c,B=kt.value.has(c);for(let T=0;T<s;T++){const E=n.data[T]||0,ee=E/N.value*Je.value,ve=T*2*Math.PI/s-Math.PI/2,Y=vt.value+Math.cos(ve)*ee,ae=ft.value+Math.sin(ve)*ee;f.push(`${Y},${ae}`),g.push({x:Y,y:ae}),x.push({x:Y,y:ae,value:E,label:_.categories[T]||`Axis ${T+1}`,seriesName:n.name})}t.push({points:f.join(" "),polygonPoints:g,dataPoints:x,color:Ht(c),fillOpacity:Ae.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:b,isDimmed:M,isHidden:B,seriesIndex:c})}),t}),Ge=(t,s)=>{if(!s||s.length<3)return!1;let n=!1;for(let c=0,f=s.length-1;c<s.length;f=c++){const g=s[c].x,x=s[c].y,b=s[f].x,M=s[f].y;x>t.y!=M>t.y&&t.x<(b-g)*(t.y-x)/(M-x)+g&&(n=!n)}return n},en=t=>{if(!jn.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const n=s.getBoundingClientRect(),c=Me.value?.getBoundingClientRect();if(!c)return;const f=t.clientX-c.left,g=t.clientY-c.top,x=le.value.filter(b=>b.isHidden?!1:Ge({x:f,y:g},b.polygonPoints));if(x.length>0){x.length,ce.value=x[0].seriesIndex;const b=t.clientX-n.left+10,M=t.clientY-n.top-10,B=200,T=50+x.length*25;let E=b,q=M;E+B>he.value&&(E=t.clientX-n.left-B-10),q+T>nt.value&&(q=t.clientY-n.top-T-10),E<0&&(E=10),q<0&&(q=10);const ee=x.map(ve=>{let Y=ve.dataPoints[0],ae=1/0;return ve.dataPoints.forEach(re=>{const K=Math.sqrt(Math.pow(re.x-f,2)+Math.pow(re.y-g,2));K<ae&&(ae=K,Y=re)}),{seriesName:ve.seriesName,color:ve.color,value:dn(Y.value!==void 0?Y.value:ve.value)}});ze.value={show:!0,x:E,y:q,title:x.length===1?x[0].seriesName:"",value:"",bubbleData:[],spiderSeries:ee}}else Pn()},At=e.computed(()=>{const t=z.value;return t.logos.map((s,n)=>{const c=_.series[s.seriesIndex];if(!c||!c.data||c.data.length===0||kt.value.has(s.seriesIndex))return null;let f,g;if(Qt.value){let b=-1,M=null;for(let T=c.data.length-1;T>=0;T--)if(c.data[T]!==null&&c.data[T]!==void 0){b=T,M=c.data[T];break}if(b===-1||M===null)return null;const B=c.data.map((T,E)=>T==null?null:{x:zt(E),y:Jt(T),index:E}).filter(T=>T!==null);if(t.animations.enabled&&!Mn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(it.value.isAnimating||!it.value.hasAnimated))if(it.value.isAnimating){const T=it.value.currentFrame/it.value.totalFrames,E=Uo(t.animations.easing,Math.min(T,1)),q=Yl(B,E);f=q.x+(s.offsetX||0),g=q.y+(s.offsetY||0)}else f=B[0].x+(s.offsetX||0),g=B[0].y+(s.offsetY||0);else f=zt(b)+(s.offsetX||0),g=Jt(M)+(s.offsetY||0)}else if(mn.value||jn.value){const b=Math.PI*2/t.logos.length*n;f=vt.value+Math.cos(b)*(Je.value+30)+(s.offsetX||0),g=ft.value+Math.sin(b)*(Je.value+30)+(s.offsetY||0)}return{...s,x:f,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),Pt=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),n&&(n.style.opacity="1")},Gt=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Zt=t=>{kt.value.has(t)?kt.value.delete(t):kt.value.add(t)},qt=e.computed(()=>{if(!ze.value.show&&!(ot.value&&He.value.show&&!I.value.isZooming))return{display:"none"};let t,s;if(ot.value&&He.value.show&&!I.value.isZooming){t=He.value.x+15,s=H.value.top;const n=Lt.value?200:150;t+n>he.value&&(t=He.value.x-n-15),t<0&&(t=10),s<10&&(s=10)}else t=ze.value.x,s=ze.value.y;return{left:t+"px",top:s+"px"}}),an=(t,s)=>{if(!_t.value||Bo.value)return;const c=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-c.left+10,g=s.clientY-c.top-10;const x=200,b=120,M=he.value,B=nt.value;f+x>M&&(f=s.clientX-c.left-x-10),g+b>B&&(g=s.clientY-c.top-b-10),f<0&&(f=10),g<0&&(g=10);let T;typeof t.categoryIndex=="number"?T=t.categoryIndex:typeof t.dataIndex=="number"?T=t.dataIndex:t.label&&_.categories.includes(t.label)&&(T=_.categories.indexOf(t.label));const E=(Kt.value||te.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";ze.value={show:!0,x:f,y:g,title:E,value:dn(t.value)||"",categoryIndex:T,spiderSeries:[]}},Un=e.ref(!1),zn=e.ref(!1),Pn=()=>{ze.value.show=!1,ze.value.spiderSeries=[],ze.value.bubbleData=[],He.value.show=!1,Un.value||(ce.value=null)},Bo=e.ref(!1),Ro=(t,s)=>{Bo.value=!0,ze.value.show=!1,He.value.show=!1;const c=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-c.left+15,g=s.clientY-c.top-10;const x=250;f+x>he.value&&(f=s.clientX-c.left-x-15),f<0&&(f=10),g<0&&(g=10),no.value={show:!0,x:f,y:g,content:t.texts,count:t.totalCount}},Mo=()=>{Bo.value=!1,no.value.show=!1},it=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Uo=(t,s)=>{switch(t){case"linear":return s;case"ease":return s<.5?2*s*s:-1+(4-2*s)*s;case"ease-in":return s*s;case"ease-out":return s*(2-s);case"ease-in-out":return s<.5?2*s*s:-1+(4-2*s)*s;default:return s}},Mn=e.computed(()=>$t.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),il=()=>{if(!ye.value||Mn.value){it.value.hasAnimated=!0,hn.value&&(co.value=1);return}hn.value&&(co.value=0),it.value.isAnimating=!0,it.value.currentFrame=0,it.value.totalFrames=Math.ceil(Se.value/16.67);const t=()=>{const s=it.value.currentFrame/it.value.totalFrames,n=Uo(mt.value,Math.min(s,1));Jn(n),hn.value&&(co.value=n),s<1?(it.value.currentFrame++,it.value.animationId=requestAnimationFrame(t)):eo()};it.value.animationId=requestAnimationFrame(t)},Jn=t=>{const s=document.querySelector(".dss-custom-chart-container");s&&s.style.setProperty("--dss-animation-progress",t)},eo=()=>{it.value.isAnimating=!1,it.value.hasAnimated=!0,hn.value&&(co.value=1),it.value.animationId&&(cancelAnimationFrame(it.value.animationId),it.value.animationId=null)},Vn=e.computed(()=>!mn.value||it.value.hasAnimated?!0:hn.value?co.value>=1:io.value?Lo.value>=1:!0),Hl=e.computed(()=>xn.value&&Vn.value),_l=e.ref(!1);e.watch(Hl,t=>{t?(_l.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{_l.value=!0})})):_l.value=!1},{immediate:!0});const ql=e.computed(()=>{if(!ye.value||Mn.value||it.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Se.value}ms`,t["--dss-animation-easing"]=Ul(mt.value),t["--dss-stagger-delay"]=`${Et.value}ms`,t}),Ul=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Xl=()=>{if(!ye.value||Mn.value)return"";const t=["dss-chart-animated"];return it.value.hasAnimated||t.push(`dss-animate-${et.value}`),it.value.hasAnimated||(mn.value&&te.value!=="semi-radial"?t.push("dss-animate-fill"):mn.value||t.push(`dss-animate-${et.value}`)),it.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>_.series,(t,s)=>{Nt.value&&s&&it.value.hasAnimated&&(it.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>il(),Oe.value)}))},{deep:!0}),e.watch(()=>I.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{gn()},50)}),e.watch(()=>[I.value.scale,I.value.offsetX],()=>{!I.value.isZooming&&!I.value.isDragging&&gn()},{flush:"post"}),e.watch([ht,Tt],([t,s])=>{I.value.minScale=t,I.value.maxScale=s,(I.value.scale<t||I.value.scale>s)&&Jo()},{immediate:!0}),e.watch(()=>_.locale,t=>{t&&t!==F.value&&(F.value=t)},{immediate:!0}),e.watch(()=>$e.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Go)}):document.removeEventListener("click",Go)}),e.onMounted(()=>{ce.value=null,hn.value&&(!ye.value||Mn.value)&&(co.value=1),kl(),k.value&&typeof ResizeObserver<"u"&&(ie=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(be&&cancelAnimationFrame(be),be=requestAnimationFrame(()=>{be=null;const{width:n,height:c}=s.contentRect;Fe.value=Math.round(n),p.value=Math.round(c),ne.value&&(Dt.value=ne.value.offsetHeight||ge)}))}),ie.observe(k.value)),ye.value&&!Mn.value?te.value==="semi-radial"?setTimeout(()=>So(),Oe.value):setTimeout(()=>il(),Oe.value):(it.value.hasAnimated=!0,te.value==="semi-radial"&&(Lo.value=1)),document.addEventListener("mousemove",zl),document.addEventListener("mouseup",Pl),document.addEventListener("click",xo)}),e.onUnmounted(()=>{be&&cancelAnimationFrame(be),ie&&k.value&&(ie.unobserve(k.value),ie.disconnect(),ie=null),it.value.animationId&&cancelAnimationFrame(it.value.animationId),Rn&&(cancelAnimationFrame(Rn),Rn=null),I.value.zoomTimeout&&clearTimeout(I.value.zoomTimeout),document.removeEventListener("mousemove",zl),document.removeEventListener("mouseup",Pl),document.removeEventListener("click",xo),document.removeEventListener("click",Go)});const zl=t=>{if(I.value.isDragging&&I.value.scale>1&&Qt.value){He.value.show=!1;const s=t.clientX-I.value.lastMouseX,{minX:n,maxX:c}=Mt.value,f=c-n||1,x=s*.8;I.value.offsetX+=x;const b=f/I.value.scale,M=f-b,B=0,T=-M/f*H.value.width,E=B;I.value.offsetX=Math.max(T,Math.min(E,I.value.offsetX)),I.value.lastMouseX=t.clientX,I.value.lastMouseY=t.clientY}},Pl=()=>{I.value.isDragging&&(I.value.isDragging=!1,setTimeout(()=>{!I.value.isDragging&&I.value.isZooming},100))},Yl=(t,s)=>{const n=t.filter(b=>b!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||s<=0)return n[0];if(s>=1)return n[n.length-1];let c=0;const f=[];for(let b=1;b<n.length;b++){const M=n[b].x-n[b-1].x,B=n[b].y-n[b-1].y,T=Math.sqrt(M*M+B*B);f.push(T),c+=T}const g=c*s;let x=0;for(let b=0;b<f.length;b++){const M=x+f[b];if(g<=M){const B=(g-x)/f[b],T=n[b],E=n[b+1];return{x:T.x+(E.x-T.x)*B,y:T.y+(E.y-T.y)*B}}x=M}return n[n.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[Xl(),{"dss-chart-fill-width":dt.value,"dss-chart-fill-height":ut.value,"dss-chart-compact":mn.value&&!Ze.value}]]),style:e.normalizeStyle({width:dt.value?"100%":he.value+"px",height:Be.value,...dt.value||ut.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...ql.value,cursor:bl()}),"data-chart-type":te.value,ref_key:"containerEl",ref:k,onWheel:Qo,onMousedown:Cl,onMousemove:R,onMouseup:Tl,onMouseleave:ue,onDblclick:Jo,onContextmenu:e.withModifiers(qe,["prevent"]),onClick:e.withModifiers(De,["left"]),onWheelCapture:Qo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ne},[e.createElementVNode("div",Ql,[rt.value?(e.openBlock(),e.createElementBlock("div",Jl,e.toDisplayString(rt.value),1)):e.createCommentVNode("",!0),Qe.value?(e.openBlock(),e.createElementBlock("div",ea,e.toDisplayString(Qe.value),1)):e.createCommentVNode("",!0)]),Ze.value&&(Ve.value==="top"||Ve.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ot.value==="horizontal","dss-legend-vertical":Ot.value==="vertical","dss-legend-top":Ve.value==="top","dss-legend-bottom":Ve.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.series,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":kt.value.has(c),"dss-legend-hovered":ce.value===c,"dss-legend-dimmed":ce.value!==null&&ce.value!==c}]),onClick:f=>Zt(c),onMouseenter:f=>y(c),onMouseleave:V,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ht(c)})},null,4),e.createElementVNode("span",na,e.toDisplayString(n.name),1)],46,ta))),128))],2)):e.createCommentVNode("",!0),Ze.value&&(Ve.value==="left"||Ve.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Ve.value==="left","dss-legend-right":Ve.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.series,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":kt.value.has(c),"dss-legend-hovered":ce.value===c,"dss-legend-dimmed":ce.value!==null&&ce.value!==c}]),onClick:f=>Zt(c),onMouseenter:f=>y(c),onMouseleave:V,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ht(c)})},null,4),e.createElementVNode("span",la,e.toDisplayString(n.name),1)],46,oa))),128))],2)):e.createCommentVNode("",!0)],512),L.showAddMarkerButton&&Bt.value.addMarker&&(Qt.value||Lt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Ko,title:e.unref(D)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Tn.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,sa),s[5]||(s[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,aa)):e.createCommentVNode("",!0),e.createElementVNode("div",ra,[Lt.value&&sn.value?(e.openBlock(),e.createElementBlock("div",ia,"Bubble size: "+e.toDisplayString(sn.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:he.value,height:nt.value,class:"dss-chart-svg","data-smooth":O.value,"data-animated":ye.value,ref_key:"svgEl",ref:Me},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",da,[e.createElementVNode("rect",{x:0,y:H.value.top,width:he.value,height:H.value.height*4},null,8,ua)]),io.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:tl.value},[e.createElementVNode("path",{d:fo.value},null,8,pa)],8,ma)):e.createCommentVNode("",!0),hn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:nl.value},[e.createElementVNode("path",{d:go.value},null,8,fa)],8,va)):e.createCommentVNode("",!0)]),Qt.value||Lt.value?(e.openBlock(),e.createElementBlock("g",ga,[ct.value?(e.openBlock(),e.createElementBlock("g",ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(El.value,(n,c)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${c}`,x1:H.value.left,x2:H.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${c*50}ms`})},null,12,ya))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ka,[e.createElementVNode("line",{x1:H.value.left,x2:H.value.right,y1:H.value.bottom,y2:H.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Ca),e.createElementVNode("line",{x1:H.value.left,x2:H.value.left,y1:H.value.top,y2:H.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ba)]),e.createElementVNode("g",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(sl.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${c}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},e.toDisplayString(n.text),13,xa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rl.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${c}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${c*80}ms`})},e.toDisplayString(n.text),13,Ea))),128)),Xt.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:H.value.left+H.value.width/2,y:H.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Xt.value),9,Va)):e.createCommentVNode("",!0),se.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:H.value.top+12+H.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${H.value.top+H.value.height/2})`},e.toDisplayString(se.value),9,Sa)):e.createCommentVNode("",!0)]),Io.value.length>0?(e.openBlock(),e.createElementBlock("g",Na,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Io.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",Ba,[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:H.value.bottom,y2:H.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>Ro(n,c),onMouseleave:Mo},null,40,Ma)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:H.value.bottom,y2:H.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>Ro(n,c),onMouseleave:Mo},null,40,_a)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:H.value.bottom,y2:H.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>Ro(n,c),onMouseleave:Mo},null,40,Ta)):e.createCommentVNode("",!0)]),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,H.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:c=>Ro(n,c),onMouseleave:Mo},null,40,$a)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,H.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:c=>Ro(n,c),onMouseleave:Mo},null,40,La),e.createElementVNode("text",{x:n.x,y:Math.max(15,H.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(n.totalCount),9,Ha)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Aa,[Bn.value?(e.openBlock(),e.createElementBlock("g",Da,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Kt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qo.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${c}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>an(n,f),onMouseleave:Pn},null,46,Ra)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>an(n,f),onMouseleave:Pn},null,46,Ia))],64))),128))],2),e.createElementVNode("g",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Sl.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?st.value+2:st.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,za))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nl.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?st.value+2:st.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Pa))),128)),tt.value>0||yt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Fn.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${c}`,cx:n.x,cy:n.y,r:n.isHighlighted?Te(n,tt.value)+2:Te(n,tt.value),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>an(n,f),onMouseleave:Pn},null,46,Oa))),128)):e.createCommentVNode("",!0)])])):te.value==="line"?(e.openBlock(),e.createElementBlock("g",Wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ll.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${c}`,d:n.path,stroke:n.color,"stroke-width":st.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":it.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Za))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Sl.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?st.value+2:st.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,qa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nl.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?st.value+2:st.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Ua))),128)),tt.value>0||yt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Wo.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:n.x,cy:n.y,r:n.isHighlighted?Te(n,tt.value)+2:Te(n,tt.value),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>an(n,f),onMouseleave:Pn},null,46,Xa))),128)):e.createCommentVNode("",!0)])):te.value==="area"?(e.openBlock(),e.createElementBlock("g",Ya,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qn.value,(n,c)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${c}`,id:`area-mask-${c}-${L.chartId}`},[e.createElementVNode("rect",{x:H.value.left-10,y:H.value.top-10,width:H.value.width+20,height:H.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${H.value.width+20}px`})},null,12,Ka)],8,ja))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qn.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${c}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?Ue.value+.2:Ue.value,mask:`url(#area-mask-${c}-${L.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden})},null,10,Ga))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qn.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${c}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?st.value+1:st.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${c*Et.value}ms`})},null,14,Qa))),128))])):te.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Kt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qo.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${c}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>an(n,f),onMouseleave:Pn},null,46,Ja)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>an(n,f),onMouseleave:Pn},null,46,es))],64))),128))],2)):e.createCommentVNode("",!0)]),ot.value&&He.value.show&&!I.value.isZooming?(e.openBlock(),e.createElementBlock("g",ts,[e.createElementVNode("line",{x1:He.value.x,x2:He.value.x,y1:H.value.top,y2:H.value.bottom,stroke:tn.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,ns),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${c}`,cx:He.value.x,cy:n.y,r:tt.value+2,fill:n.color,stroke:"none",opacity:"0.9"},null,8,os))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Lt.value?(e.openBlock(),e.createElementBlock("g",ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zo.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${c}`},[n?(e.openBlock(),e.createElementBlock("g",as,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:n.radius,fill:n.color,"fill-opacity":l(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(r(n,c)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:f=>i(n,f),onMouseleave:f=>m(n),onClick:f=>a(n,f)},null,42,ss),n.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:n.x-n.radius*.65,y:n.y-n.radius*.65,width:n.radius*1.3,height:n.radius*1.3,"xlink:href":n.imageUrl,class:e.normalizeClass(`dss-bubble-image-${c} ${n.isHighlighted?"dss-bubble-highlighted":""} ${n.isDimmed?"dss-bubble-dimmed":""} ${n.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${n.radius*.65}px at ${n.radius*.65}px ${n.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:o(n)}),onLoad:f=>Ho(c),onError:f=>xl(c),onMouseenter:f=>i(n,f),onMouseleave:f=>m(n),onClick:f=>a(n,f)},null,46,rs)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),mn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:$o.value},[te.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:vt.value,cy:ft.value,r:Je.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,cs)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":te.value,"clip-path":Vo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bl.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${c}`,d:n.segment.path,fill:n.segment.color,"fill-opacity":n.segment.isHighlighted?(n.segment.opacity||.8)+.2:n.segment.opacity||.8,stroke:n.segment.strokeWidth?n.segment.strokeColor||n.segment.color:"none","stroke-width":n.segment.strokeWidth||0,"clip-path":Ft(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:f=>an(n.segment,f),onMouseleave:Pn},null,42,us))),128))],8,ds),vn.value&&Vn.value?(e.openBlock(),e.createElementBlock("g",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.value,(n,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${c}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:n.contrastColor})},e.toDisplayString(n.value),13,ps)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),ko.value&&(Vn.value||io.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:bo.value.x,y:bo.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Co.value,fill:yn.value,class:"dss-radial-data-center"},e.toDisplayString(jo.value),9,vs)):e.createCommentVNode("",!0),Hl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":_l.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ml.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${c}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${c*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:n.pointerStartX,y1:n.pointerStartY,x2:n.pointerEndX,y2:n.pointerEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.pointerLineLength})},null,12,fs),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:n.pointerEndX,y1:n.pointerEndY,x2:n.horizontalEndX,y2:n.horizontalEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.horizontalLineLength})},null,12,gs),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":on.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,hs)],6))),128))],2)):e.createCommentVNode("",!0)],8,is)):e.createCommentVNode("",!0),jn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:$o.value},[ct.value?(e.openBlock(),e.createElementBlock("g",ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${c}`,cx:vt.value,cy:ft.value,r:n,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*150}ms`})},null,12,Cs))),128)),e.createElementVNode("g",bs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${c}`},[e.createElementVNode("rect",{x:vt.value-16,y:ft.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,ws),e.createElementVNode("text",{x:vt.value,y:ft.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Sn(c)),9,xs)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(n,c)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${c}`,x1:vt.value,x2:n.x,y1:ft.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},null,12,Es))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${c}`,x:n.x+Math.cos(c*2*Math.PI/S.value-Math.PI/2)*16,y:n.y+Math.sin(c*2*Math.PI/S.value-Math.PI/2)*16,"text-anchor":n.anchor,"dominant-baseline":n.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${c*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,Ss))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:en,onMouseleave:Pn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(le.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${c}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":Ce("current",n,c),stroke:n.color,"stroke-width":n.isHighlighted?st.value+1:st.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${c*Et.value}ms`,transition:"all 0.2s ease"})},null,14,Ns),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(f,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${c}-${g}`,cx:f.x,cy:f.y,r:n.isHighlighted?tt.value+1:tt.value>0?tt.value:0,fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${c*Et.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:x=>an(f,x),onMouseleave:Pn},null,46,Bs))),128))]))),128))],32)],8,ys)):e.createCommentVNode("",!0),e.createElementVNode("g",Ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${c}`,cx:n.x,cy:n.y,r:n.width/2,fill:Ht(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${c}`),style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,14,_s))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At.value,(n,c)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${c}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:f=>Pt(c),onError:f=>Gt(c),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${c}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,46,Ts))),128))])],8,ca))]),P.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:he.value+"px",height:nt.value+"px",backgroundImage:`url('${$n.value}')`,backgroundRepeat:"no-repeat",...Xe.value,opacity:A.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(n,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+n.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:n.x+"px",top:n.y+"px",width:cn.value+"px",height:cn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(f=>yl(n),["stop"]),onMouseenter:f=>v(n,f),onMouseleave:h},[e.createElementVNode("img",{src:An(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Ls)],44,$s)),[[e.vShow,On.value]])),128)),jt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:jt.value.x+"px",top:jt.value.y+"px"})},[e.createElementVNode("div",Hs,e.toDisplayString(jt.value.categoryValue),1),jt.value.description?(e.openBlock(),e.createElementBlock("div",As,e.toDisplayString(jt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),_t.value&&(ze.value.show||ot.value&&He.value.show&&!I.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":ot.value&&He.value.show&&!I.value.isZooming}]),style:e.normalizeStyle(qt.value)},[!ot.value||!He.value.show||I.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[jn.value&&ze.value.spiderSeries&&ze.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Ds,[ze.value.title?(e.openBlock(),e.createElementBlock("div",Rs,e.toDisplayString(ze.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value.spiderSeries,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Is,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Fs,e.toDisplayString(n.value),1)]))),128))])):Lt.value&&ze.value.bubbleData&&ze.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",zs,[ze.value.title?(e.openBlock(),e.createElementBlock("div",Ps,e.toDisplayString(ze.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Os,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value.bubbleData,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Ws,[e.createElementVNode("div",Zs,e.toDisplayString(ze.value.title),1),e.createElementVNode("div",qs,e.toDisplayString(ze.value.value),1)])),ze.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[je(ze.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Us,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Xs,e.toDisplayString(e.unref(D)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je(ze.value.categoryIndex).flagGroups,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${c}`},[e.createElementVNode("div",Ys,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${c}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",js,[e.createElementVNode("div",Ks,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),je(ze.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Gs,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Qs,e.toDisplayString(e.unref(D)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je(ze.value.categoryIndex).markers,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Js,[e.createElementVNode("div",er,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",tr,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",nr,[e.createElementVNode("div",or,e.toDisplayString(Lt.value?d():L.categories[He.value.categoryIndex]||`Category ${He.value.categoryIndex+1}`),1),Lt.value?(e.openBlock(),e.createElementBlock("div",lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(He.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",ar,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",sr,e.toDisplayString(dn(n.value)),1)]))),128))]),je(He.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",rr,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ir,e.toDisplayString(e.unref(D)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je(He.value.categoryIndex).flagGroups,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${c}`},[e.createElementVNode("div",cr,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${c}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",dr,[e.createElementVNode("div",ur,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),je(He.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",mr,[s[9]||(s[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",pr,e.toDisplayString(e.unref(D)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je(He.value.categoryIndex).markers,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",vr,[e.createElementVNode("div",fr,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",gr,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Qt.value&&Rt.value&&I.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Jo},[s[10]||(s[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(I.value.scale*100))+"% "+e.toDisplayString(e.unref(D)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Gl),$e.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:$e.value.x+"px",top:$e.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[Bt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:En},e.toDisplayString(e.unref(D)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Bt.value.addMarker&&(Bt.value.downloadSvg||Bt.value.downloadPng||Bt.value.downloadCsv||_n.value.length>0)?(e.openBlock(),e.createElementBlock("div",hr)):e.createCommentVNode("",!0),Bt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Xn},e.toDisplayString(e.unref(D)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Bt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Yn},e.toDisplayString(e.unref(D)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Bt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:so},e.toDisplayString(e.unref(D)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),_n.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Bt.value.downloadSvg||Bt.value.downloadPng||Bt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",yr)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_n.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+c},[n.separator?(e.openBlock(),e.createElementBlock("div",kr)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(lo(n)),style:e.normalizeStyle(bt(n)),onClick:f=>ro(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:pt(n),class:"dss-custom-menu-content"},null,8,br)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",wr,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,Cr)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),de.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:ao},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[4]||(s[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",xr,[e.createElementVNode("h3",null,e.toDisplayString(C.value?e.unref(D)("chart.modalMarker.viewMarker"):oo.value?e.unref(D)("chart.modalMarker.editMarker"):e.unref(D)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:ao},"×")]),e.createElementVNode("div",Er,[e.createElementVNode("div",Vr,[de.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Sr,e.toDisplayString(Fo(de.value.categoryIndex)||""),1)),de.value.fromButton?(e.openBlock(),e.createElementBlock("div",Nr,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":s[1]||(s[1]=n=>de.value.categoryIndex=n),class:"dss-form-select",disabled:C.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nn.value,(n,c)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${c}`,value:c},e.toDisplayString(n),9,Mr))),128))],8,Br),[[e.vModelSelect,de.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",_r,[e.createElementVNode("label",Tr,e.toDisplayString(e.unref(D)("chart.modalMarker.description")),1),C.value?(e.openBlock(),e.createElementBlock("div",$r,e.toDisplayString(de.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=n=>de.value.description=n),placeholder:e.unref(D)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,Lr)),[[e.vModelText,de.value.description]])]),e.createElementVNode("div",Hr,[e.createElementVNode("label",null,e.toDisplayString(e.unref(D)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",Ar,[e.createElementVNode("img",{src:An({type:de.value.type}),alt:"Marker Icon Preview",class:"preview-icon",style:{width:"32px",height:"32px","border-radius":"50%",border:"2px solid #ddd"},onError:s[3]||(s[3]=n=>n.target.style.display="none")},null,40,Dr)])])]),e.createElementVNode("div",Rr,[e.createElementVNode("div",Ir,[oo.value&&!C.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:gl},e.toDisplayString(e.unref(D)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fr,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:ao},e.toDisplayString(C.value?e.unref(D)("chart.modalMarker.close"):e.unref(D)("chart.modalMarker.cancel")),1),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:fl,disabled:!(de.value.description&&de.value.description.length)},e.toDisplayString(oo.value?e.unref(D)("chart.modalMarker.save"):e.unref(D)("chart.contextMenu.addMarker")),9,zr))])])])])):e.createCommentVNode("",!0)],64))}}),Wr={class:"dss-modal-title"},Zr={class:"dss-modal-actions"},Al={__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(L,{emit:fe}){const D=L,F=fe,we=e.ref(null),k=e.ref(null),Me=e.computed(()=>{const _={"max-width":D.width};return D.height!=="auto"&&(_.height=D.height,_["min-height"]="0"),_}),ne=e.computed(()=>({}));function Fe(){F("close-modal")}function p(){D.backDrop&&!we.value&&F("close-modal")}function ie(_){_.target.tagName==="INPUT"&&(we.value=_.target.tagName)}function be(){setTimeout(()=>{we.value=null},300)}function ge(){const _=document.body,_e=document.documentElement;k.value={bodyOverflow:_.style.overflow,bodyPosition:_.style.position,bodyTop:_.style.top,bodyWidth:_.style.width,htmlOverflow:_e.style.overflow,scrollY:window.scrollY},_.style.overflow="hidden",_.style.position="fixed",_.style.top=`-${k.value.scrollY}px`,_.style.width="100%",_.style.left="0",_e.style.overflow="hidden"}function j(){if(!k.value)return;const _=document.body,_e=document.documentElement,{bodyOverflow:Pe,bodyPosition:Le,bodyTop:Ke,bodyWidth:z,htmlOverflow:dt,scrollY:ut}=k.value;_.style.overflow=Pe||"",_.style.position=Le||"",_.style.top=Ke||"",_.style.width=z||"",_.style.left="",_e.style.overflow=dt||"",window.scrollTo(0,ut||0)}return e.watch(()=>D.showModal,_=>{if(_)ge(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const _e=document.getElementById("dss-modal-backdrop");_e&&(_e.addEventListener("focusin",ie),_e.addEventListener("focusout",be))},100);else{j(),document.body.classList.remove("dss-modal-open");const _e=document.getElementById("dss-modal-backdrop");_e&&(_e.removeEventListener("focusin",ie),_e.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{D.showModal&&j()}),(_,_e)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:p},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Me.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:_e[0]||(_e[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":L.headerType,"font-size":L.titleSize})},[e.createElementVNode("h1",Wr,[e.renderSlot(_.$slots,"title",{},()=>[_e[1]||(_e[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(_.$slots,"title-data"),L.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:Fe,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(ne.value)},[e.renderSlot(_.$slots,"content",{},()=>[_e[2]||(_e[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Zr,[e.renderSlot(_.$slots,"actions")])])],4),[[e.vShow,L.showModal]])])):e.createCommentVNode("",!0)]))}},qr={key:0,class:"dss-table-toolbar"},Ur={class:"dss-table-toolbar-left"},Xr=["aria-expanded"],Yr={class:"dss-pagination-select-dropdown",role:"listbox"},jr={class:"dss-table-column-visibility-label"},Kr={class:"dss-table-checkbox-wrapper"},Gr=["checked","onChange"],Qr={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Jr={class:"dss-table-column-visibility-text"},ei={class:"dss-table-toolbar-right"},ti=["placeholder"],ni=["aria-expanded"],oi={key:1,class:"dss-table-toolbar-extra"},li={class:"dss-table-thead"},ai={key:0,class:"dss-table-th dss-table-selection-column"},si={key:0,class:"dss-table-checkbox-wrapper"},ri=["checked","indeterminate"],ii={key:0,class:"dss-table-checkbox__indeterminate"},ci={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},di={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},ui=["onClick"],mi={class:"dss-table-th-content"},pi={class:"dss-table-th-text"},vi={key:0},fi={key:1},gi={key:2},hi=["data-filter-column-key","aria-expanded","onClick"],yi={class:"dss-table-tbody"},ki=["onClick"],Ci={class:"dss-table-checkbox-wrapper"},bi=["type","name","checked","onChange"],wi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},xi={key:1,class:"dss-table-checkbox__dot"},Ei=["onClick"],Vi=["aria-expanded","aria-label"],Si={key:0,class:"dss-table-expansion-row"},Ni=["colspan"],Bi=["colspan"],Mi={key:1,class:"dss-table-pagination"},_i={class:"dss-pagination-center"},Ti={class:"dss-pagination-controls"},$i=["disabled","title"],Li=["disabled","title"],Hi={class:"dss-pagination-pages"},Ai=["onClick"],Di={key:1,class:"dss-pagination-ellipsis"},Ri=["disabled","title"],Ii=["disabled","title"],Fi=["aria-expanded"],zi={class:"dss-pagination-select-dropdown",role:"listbox"},Pi=["aria-selected","onClick"],Oi={key:0,class:"dss-table-filter-row"},Wi=["value","placeholder"],Zi=["min","max","value"],qi=["min","max","value"],Ui={class:"dss-table-filter-double-range-values"},Xi={key:2,class:"dss-table-filter-daterange"},Yi={class:"dss-table-filter-daterange-row"},ji={class:"dss-table-filter-daterange-label"},Ki=["value"],Gi={class:"dss-table-filter-daterange-row"},Qi={class:"dss-table-filter-daterange-label"},Ji=["value"],ec=["value","placeholder"],tc={class:"dss-table-filter-list"},nc=["checked","onChange"],oc={class:"dss-table-filter-actions"},lc={name:"DSSTable"},ac=Object.assign(lc,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(L,{emit:fe}){const{t:D,locale:F}=cl.useI18n(),we=L,k=fe,Me={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single"},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100]},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:"No data available"};function ne(C,y){const V=Object.assign({},C);return Fe(C)&&Fe(y)&&Object.keys(y).forEach(R=>{Fe(y[R])?R in C?V[R]=ne(C[R],y[R]):Object.assign(V,{[R]:y[R]}):Object.assign(V,{[R]:y[R]})}),V}function Fe(C){return C&&typeof C=="object"&&!Array.isArray(C)}const p=e.computed(()=>ne(Me,we.options)),ie=e.computed(()=>{const C=p.value.table.width;return C==="auto"?null:typeof C=="number"?C:null}),be=e.computed(()=>p.value.table.height),ge=e.computed(()=>p.value.table.rowHeight??"auto"),j=e.computed(()=>({height:ge.value})),_=e.computed(()=>p.value.table.expandable===!0),_e=e.computed(()=>p.value.table.truncated===!0),Pe=e.computed(()=>p.value.table.striped),Le=e.computed(()=>p.value.table.bordered),Ke=e.computed(()=>p.value.table.hoverable),z=e.computed(()=>p.value.table.size),dt=e.computed(()=>p.value.table.align||"left");e.computed(()=>p.value.title.text),e.computed(()=>p.value.subtitle.text);const ut=e.computed(()=>p.value.selection.enabled),he=e.computed(()=>p.value.selection.mode),Dt=e.computed(()=>p.value.sorting.enabled),xt=e.computed(()=>p.value.sorting.mode),nt=e.computed(()=>p.value.pagination.enabled),Be=e.computed(()=>p.value.pagination.rows),te=e.computed(()=>p.value.pagination.rowsPerPageOptions),pn=e.computed(()=>p.value.scrollable),rt=e.computed(()=>p.value.emptyMessage),Qe=e.computed(()=>p.value.toolbar?.downloads?.pdf!==!1),sn=e.computed(()=>p.value.toolbar?.downloads?.excel!==!1),Xt=e.computed(()=>p.value.toolbar?.search!==!1),se=e.computed(()=>Qe.value||sn.value||Xt.value||xe.value),xe=e.computed(()=>p.value.toolbar?.columnVisibility!==!1),J=e.ref(""),oe=e.ref(!1),Ye=e.ref(null);let ct=null;function Ze(){oe.value?(ct&&(clearTimeout(ct),ct=null),oe.value=!1,J.value="",k("search",""),Ye.value?.blur()):(oe.value=!0,ct=setTimeout(()=>{ct=null,Ye.value?.focus()},80))}function Ve(){J.value||(oe.value=!1)}function Ot(){J.value="",k("search",""),Ye.value?.focus()}const _t=e.computed(()=>({"dss-table-striped":Pe.value,"dss-table-bordered":Le.value,"dss-table-hoverable":Ke.value,[`dss-table-${z.value}`]:z.value!=="default","dss-table-truncated":_e.value})),ot=(C,y)=>C?.field??C?.key??y,tn=e.ref(new Set);function Rt(){const C=new Set;we.columns.forEach((y,V)=>{y?.hidden!==!0&&C.add(ot(y,V))}),tn.value=C}const ht=e.computed(()=>we.columns.filter((C,y)=>tn.value.has(ot(C,y)))),Tt=C=>{const y=we.columns.findIndex(V=>V===C);return ot(C,y>=0?y:0)},st=(C,y)=>tn.value.has(ot(C,y));function nn(C,y){const V=ot(C,y),R=new Set(tn.value);R.has(V)?R.delete(V):R.add(V),tn.value=R}const tt=e.ref(null),yt=e.ref(!1);function Te(C){tt.value&&!tt.value.contains(C.target)&&(yt.value=!1)}const Ue=e.computed(()=>ht.value.length+(ut.value?1:0)+(_.value?1:0)),O=(C,y)=>C?.id??C?.key??y,Z=e.ref(new Set),X=e.ref(null),Q=(C,y)=>Z.value.has(O(C,y)),ye=(C,y,V)=>{V&&V.stopPropagation();const R=O(C,y),ue=new Set(Z.value);ue.has(R)?(ue.delete(R),k("row-collapse",{data:C,index:y})):(ue.add(R),k("row-expand",{data:C,index:y})),Z.value=ue},et=(C,y)=>{if(!_e.value)return;const V=O(C,y);X.value!==V&&(X.value=V)},Se=e.ref(null),Oe=e.ref(0),mt=e.ref([]),Et=C=>{if(xt.value==="single")return Se.value===C.field?Oe.value:0;{const y=mt.value.find(V=>V.field===C.field);return y?y.order:0}},Nt=C=>{const y=Et(C);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},$t=e.ref({}),Ae=e.ref(null),It=e.ref(null),gt=220,Sn=e.ref(null),Wt=e.computed(()=>ht.value.find(C=>Tt(C)===Ae.value)??null),Vt=e.computed(()=>{if(!Wt.value||Wt.value.filter!=="range")return null;const C=Wt.value,y=Ae.value,{min:V,max:R}=G(C),ue=C.filterMin??V,qe=C.filterMax??R,De=rn(y),pt=De.min??ue,lo=De.max??qe,bt=qe-ue,An=bt===0?0:(pt-ue)/bt*100,Fo=bt===0?100:(lo-ue)/bt*100;return{rangeMin:ue,rangeMax:qe,currentMin:pt,currentMax:lo,minPct:An,maxPct:Fo}}),Bt=e.ref(null),_n=e.ref("max");function Tn(C){const y=Bt.value,V=Vt.value;if(!y||!V)return;const R=y.getBoundingClientRect(),qe=(C.clientX-R.left)/R.width*100,De=(V.minPct+V.maxPct)/2;_n.value=qe<De?"min":"max"}function rn(C){return $t.value[C]??{}}function cn(C,y){$t.value={...$t.value,[C]:y}}function Yt(C){const y=$t.value[C];return y?y.type==="string"?!!y.value?.trim():y.type==="range"?y.min!=null||y.max!=null:y.type==="dateRange"?!!(y.from||y.to):y.type==="list"?y.selected?.length>0:!1:!1}function dn(C){const y={...$t.value};delete y[C],$t.value=y,Ae.value=null,It.value=null}function On(){if(!Ae.value){It.value=null;return}const C=Sn.value;if(!C)return;const y=C.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Ae.value}"]`);if(!y)return;const V=y.getBoundingClientRect();It.value={top:V.bottom+6,left:Math.max(8,V.right-gt)}}const mo=e.computed(()=>{let C=[...we.data];return ht.value.forEach(y=>{const V=Tt(y),R=$t.value[V];if(!R)return;const ue=y.field;if(ue){if(R.type==="string"&&R.value?.trim()){const qe=R.value.trim().toLowerCase();C=C.filter(De=>{const pt=Ct(De,y);return String(pt??"").toLowerCase().includes(qe)})}else if(R.type==="range")C=C.filter(qe=>{const De=de(qe,ue),pt=Number(De);return!(Number.isNaN(pt)||R.min!=null&&pt<R.min||R.max!=null&&pt>R.max)});else if(R.type==="dateRange"){const qe=R.from?new Date(R.from).getTime():null,De=R.to?new Date(R.to).getTime():null;C=C.filter(pt=>{const lo=de(pt,ue),bt=lo?new Date(lo).getTime():NaN;return!(Number.isNaN(bt)||qe!=null&&bt<qe||De!=null&&bt>De)})}else if(R.type==="list"&&R.selected?.length){const qe=new Set(R.selected);C=C.filter(De=>{const pt=Ct(De,y);return qe.has(pt!=null?String(pt):"")})}}}),C});function $(C){const y=new Set;return we.data.forEach(V=>{const R=Ct(V,C);y.add(R!=null?String(R):"")}),Array.from(y).sort((V,R)=>String(V).localeCompare(String(R)))}function P(C,y){if(Ae.value===C){Ae.value=null,It.value=null;return}if(Ae.value=C,y?.currentTarget){const V=y.currentTarget.getBoundingClientRect();It.value={top:V.bottom+6,left:Math.max(8,V.right-gt)}}else On()}function A(C,y){cn(C,{type:"string",value:y})}function G(C){const y=C.field;if(!y)return{min:0,max:100};let V=1/0,R=-1/0;return we.data.forEach(ue=>{const qe=de(ue,y),De=Number(qe);Number.isNaN(De)||(V=Math.min(V,De),R=Math.max(R,De))}),{min:V===1/0?0:V,max:R===-1/0?100:R}}function ke(C,y,V){const R={...rn(C),type:"range"},ue=V===""?null:Number(V),qe=ue===null||Number.isNaN(ue)?null:ue;R[y]=qe,qe!=null&&(y==="min"&&R.max!=null&&qe>R.max&&(R.max=qe),y==="max"&&R.min!=null&&qe<R.min&&(R.min=qe)),cn(C,R)}function We(C,y,V){const R={...rn(C),type:"dateRange"};R[y]=V||"",cn(C,R)}const Xe=e.reactive({});function Ie(C,y){Xe[C]=y}function je(C){const y=Tt(C),V=(Xe[y]??"").trim().toLowerCase(),R=$(C);return V?R.filter(ue=>String(ue).toLowerCase().includes(V)):R}function St(C,y){return(rn(C).selected??[]).includes(y!=null?String(y):"")}function $n(C,y){const R=[...rn(C).selected??[]],ue=y!=null?String(y):"",qe=R.indexOf(ue);qe>=0?R.splice(qe,1):R.push(ue),cn(C,{type:"list",selected:R})}function xn(C){Ae.value&&!C.target.closest(".dss-table-filter-wrap")&&!C.target.closest(".dss-table-filter-dropdown")&&(Ae.value=null,It.value=null)}function on(){On()}const to=C=>{if(!(C.sortable===!1||!Dt.value))if(xt.value==="single")Se.value===C.field?Oe.value=Oe.value===1?-1:Oe.value===-1?0:1:(Se.value=C.field,Oe.value=1),Oe.value===0&&(Se.value=null),k("sort",{field:Se.value,order:Oe.value});else{const y=mt.value.findIndex(V=>V.field===C.field);y>=0?mt.value[y].order===1?mt.value[y].order=-1:mt.value.splice(y,1):mt.value.push({field:C.field,order:1}),k("sort",{multiSortMeta:mt.value})}},Ln=e.computed(()=>{if(!Dt.value)return mo.value;let C=[...mo.value];return xt.value==="single"&&Se.value&&Oe.value!==0?C.sort((y,V)=>{const R=de(y,Se.value),ue=de(V,Se.value);return R===ue?0:R==null?1:ue==null?-1:(R<ue?-1:R>ue?1:0)*Oe.value}):xt.value==="multiple"&&mt.value.length>0&&C.sort((y,V)=>{for(const R of mt.value){const ue=de(y,R.field),qe=de(V,R.field);if(ue===qe)continue;if(ue==null)return 1;if(qe==null)return-1;const De=ue<qe?-1:ue>qe?1:0;if(De!==0)return De*R.order}return 0}),C}),un=e.ref(0),vn=e.ref(Be.value),Wn=e.ref(!1),ko=e.ref(null),jo=C=>{vn.value=C,Wn.value=!1,un.value=0,k("page",{page:0,rows:vn.value})};function Co(C){ko.value&&!ko.value.contains(C.target)&&(Wn.value=!1)}const bo=e.computed(()=>Ln.value.length),yn=e.computed(()=>Math.ceil(bo.value/vn.value)),fn=e.computed(()=>nt.value?un.value*vn.value:0),Io=e.computed(()=>nt.value?Math.min((un.value+1)*vn.value,bo.value):bo.value),no=e.computed(()=>{if(!nt.value)return Ln.value;const C=fn.value,y=Io.value;return Ln.value.slice(C,y)}),Hn=e.ref(new Set),po=e.computed(()=>Ln.value.filter((C,y)=>Hn.value.has(O(C,y)))),_o=e.computed(()=>{const C=Ln.value.length;return C>0&&Hn.value.size===C}),kt=e.computed(()=>{const C=Ln.value.length,y=Hn.value.size;return y>0&&y<C}),ce=(C,y)=>Hn.value.has(O(C,y)),To=()=>{if(_o.value)Hn.value=new Set,k("unselect-all");else{const C=new Set;Ln.value.forEach((y,V)=>C.add(O(y,V))),Hn.value=C,k("select-all",po.value)}},ze=(C,y)=>{const V=O(C,y),R=new Set(Hn.value),ue=R.has(V);he.value==="single"?ue?(R.delete(V),k("row-unselect",C)):(R.clear(),R.add(V),k("row-select",C)):ue?(R.delete(V),k("row-unselect",C)):(R.add(V),k("row-select",C)),Hn.value=R},jt=e.computed(()=>{const C=yn.value,y=un.value+1,V=2,R=[],ue=[];let qe;for(let De=1;De<=C;De++)(De===1||De===C||De>=y-V&&De<=y+V)&&R.push(De);for(const De of R)qe&&(De-qe===2?ue.push(qe+1):De-qe!==1&&ue.push("...")),ue.push(De),qe=De;return ue}),He=C=>{C<0||C>=yn.value||(un.value=C,k("page",{page:C,rows:vn.value}))},$e=(C,y,V)=>{k("row-click",{data:C,index:y,originalEvent:V}),et(C,fn.value+y)},I=(C,y)=>{const V=fn.value+y;return{"dss-table-row-selected":ce(C,V),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":_e.value,"dss-table-row-truncated-expanded":X.value===O(C,V)}},Ct=(C,y)=>y.field?de(C,y.field):"",de=(C,y)=>y.split(".").reduce((V,R)=>V&&V[R],C),Nn=C=>{const y=C.align??dt.value;return{"dss-table-sortable":C.sortable!==!1&&Dt.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[C.className]:C.className}},oo=C=>{const y={};return C.width&&(y.width=typeof C.width=="number"?`${C.width}px`:C.width),C.minWidth&&(y.minWidth=typeof C.minWidth=="number"?`${C.minWidth}px`:C.minWidth),C.maxWidth&&(y.maxWidth=typeof C.maxWidth=="number"?`${C.maxWidth}px`:C.maxWidth),y};return e.watch(()=>we.locale,C=>{C&&C!==F.value&&(F.value=C)},{immediate:!0}),e.watch(Be,C=>{vn.value=C,un.value=0}),e.watch(J,C=>{k("search",C??"")}),e.watch(()=>we.columns,()=>{Rt()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Co),document.addEventListener("click",Te),document.addEventListener("click",xn),window.addEventListener("resize",on),window.addEventListener("scroll",on,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Co),document.removeEventListener("click",Te),document.removeEventListener("click",xn),window.removeEventListener("resize",on),window.removeEventListener("scroll",on,!0)}),(C,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Sn,style:e.normalizeStyle({width:ie.value+"px",height:be.value?be.value+"px":"auto"})},[se.value?(e.openBlock(),e.createElementBlock("div",qr,[e.createElementVNode("div",Ur,[Qe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=V=>k("download-pdf"))},[y[21]||(y[21]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(D)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),sn.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=V=>k("download-excel"))},[y[22]||(y[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(D)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),xe.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:tt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":yt.value}]),onClick:y[2]||(y[2]=V=>yt.value=!yt.value),"aria-expanded":yt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(D)("table.columnVisibility"))+" ",1),y[23]||(y[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Xr),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Yr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,(V,R)=>(e.openBlock(),e.createElementBlock("li",{key:ot(V,R),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",jr,[e.createElementVNode("span",Kr,[e.createElementVNode("input",{type:"checkbox",checked:st(V,R),onChange:ue=>nn(V,R),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Gr),st(V,R)?(e.openBlock(),e.createElementBlock("span",Qr,[...y[24]||(y[24]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Jr,e.toDisplayString(V.header),1)])]))),128))],512),[[e.vShow,yt.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ei,[Xt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":oe.value||J.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Ye,"onUpdate:modelValue":y[4]||(y[4]=V=>J.value=V),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(D)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:y[5]||(y[5]=V=>oe.value=!0),onBlur:Ve},null,40,ti),[[e.vModelText,J.value]]),J.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:Ot},[...y[25]||(y[25]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":"Search","aria-expanded":oe.value||!!J.value,onMousedown:e.withModifiers(Ze,["prevent"])},[...y[26]||(y[26]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,ni)],2)):e.createCommentVNode("",!0),C.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",oi,[e.renderSlot(C.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":pn.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",_t.value])},[e.createElementVNode("thead",li,[e.createElementVNode("tr",null,[ut.value?(e.openBlock(),e.createElementBlock("th",ai,[he.value==="multiple"?(e.openBlock(),e.createElementBlock("span",si,[e.createElementVNode("input",{type:"checkbox",checked:_o.value,indeterminate:kt.value,onChange:To,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,ri),kt.value?(e.openBlock(),e.createElementBlock("span",ii)):_o.value?(e.openBlock(),e.createElementBlock("span",ci,[...y[27]||(y[27]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("th",di)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value,(V,R)=>(e.openBlock(),e.createElementBlock("th",{key:Tt(V),class:e.normalizeClass(["dss-table-th",Nn(V)]),style:e.normalizeStyle(oo(V)),onClick:ue=>to(V)},[e.createElementVNode("div",mi,[e.createElementVNode("span",pi,e.toDisplayString(V.header),1),V.sortable!==!1&&Dt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Nt(V)])},[Et(V)===0?(e.openBlock(),e.createElementBlock("span",vi,[...y[28]||(y[28]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):Et(V)===1?(e.openBlock(),e.createElementBlock("span",fi,[...y[29]||(y[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):Et(V)===-1?(e.openBlock(),e.createElementBlock("span",gi,[...y[30]||(y[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),V.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Ae.value===Tt(V)}]),onClick:y[6]||(y[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Yt(Tt(V))}]),"data-filter-column-key":Tt(V),"aria-expanded":Ae.value===Tt(V),"aria-label":"Filter column",onClick:ue=>P(Tt(V),ue)},[...y[31]||(y[31]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,hi)],2)):e.createCommentVNode("",!0)])],14,ui))),128))])]),e.createElementVNode("tbody",yi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(no.value,(V,R)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:O(V,fn.value+R)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",I(V,R)]),style:e.normalizeStyle(j.value),onClick:ue=>$e(V,R,ue)},[ut.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:y[7]||(y[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",Ci,[e.createElementVNode("input",{type:he.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${L.tableId}`,checked:ce(V,fn.value+R),onChange:ue=>ze(V,fn.value+R),class:e.normalizeClass(["dss-table-checkbox",he.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,bi),he.value==="multiple"&&ce(V,fn.value+R)?(e.openBlock(),e.createElementBlock("span",wi,[...y[32]||(y[32]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):he.value==="single"&&ce(V,fn.value+R)?(e.openBlock(),e.createElementBlock("span",xi)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ue=>ye(V,fn.value+R,ue),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":Q(V,fn.value+R),"aria-label":Q(V,fn.value+R)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":Q(V,fn.value+R)}]),"aria-hidden":"true"},[...y[33]||(y[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Vi)],8,Ei)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value,(ue,qe)=>(e.openBlock(),e.createElementBlock("td",{key:Tt(ue),class:e.normalizeClass(["dss-table-td",Nn(ue)]),style:e.normalizeStyle(oo(ue))},[e.renderSlot(C.$slots,`cell-${ue.field}`,{data:V,column:ue,rowIndex:R},()=>[e.createTextVNode(e.toDisplayString(Ct(V,ue)),1)])],6))),128))],14,ki),_.value&&Q(V,fn.value+R)?(e.openBlock(),e.createElementBlock("tr",Si,[e.createElementVNode("td",{colspan:Ue.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(C.$slots,"expansion",{data:V,rowIndex:R})],8,Ni)])):e.createCommentVNode("",!0)],64))),128)),no.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(j.value)},[e.createElementVNode("td",{colspan:Ue.value,class:"dss-table-empty-cell"},[e.renderSlot(C.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(rt.value),1)])],8,Bi)],4))])],2)],2),nt.value?(e.openBlock(),e.createElementBlock("div",Mi,[e.createElementVNode("div",_i,[e.createElementVNode("div",Ti,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:un.value===0,onClick:y[8]||(y[8]=V=>He(0)),title:e.unref(D)("table.firstPage")},[...y[34]||(y[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,$i),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:un.value===0,onClick:y[9]||(y[9]=V=>He(un.value-1)),title:e.unref(D)("table.previousPage")}," ‹ ",8,Li),e.createElementVNode("span",Hi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jt.value,V=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V},[V!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":V===un.value+1}]),onClick:R=>He(V-1)},e.toDisplayString(V),11,Ai)):(e.openBlock(),e.createElementBlock("span",Di,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:un.value>=yn.value-1,onClick:y[10]||(y[10]=V=>He(un.value+1)),title:e.unref(D)("table.nextPage")}," › ",8,Ri),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:un.value>=yn.value-1,onClick:y[11]||(y[11]=V=>He(yn.value-1)),title:e.unref(D)("table.lastPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Ii)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:ko},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Wn.value}]),onClick:y[12]||(y[12]=V=>Wn.value=!Wn.value),"aria-expanded":Wn.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(vn.value)+" ",1),y[36]||(y[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Fi),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",zi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V,role:"option","aria-selected":V===vn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":V===vn.value}]),onClick:R=>jo(V)},e.toDisplayString(V),11,Pi))),128))],512),[[e.vShow,Wn.value]])]),_:1})],512)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(It.value?{top:It.value.top+"px",left:It.value.left+"px",width:gt+"px"}:void 0),onClick:y[20]||(y[20]=e.withModifiers(()=>{},["stop"]))},[Wt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Wt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Oi,[e.createElementVNode("input",{type:"text",value:rn(Ae.value).value??"",onInput:y[13]||(y[13]=V=>A(Ae.value,V.target.value)),class:"dss-table-filter-input",placeholder:e.unref(D)("table.search")||"Search..."},null,40,Wi)])):Wt.value.filter==="range"&&Vt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Vt.value.minPct+"%","--range-max-pct":Vt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Bt,class:"dss-table-filter-double-range-track",onMousemove:Tn,onMouseenter:Tn},[e.createElementVNode("input",{type:"range",min:Vt.value.rangeMin,max:Vt.value.rangeMax,value:Vt.value.currentMin,onInput:y[14]||(y[14]=V=>ke(Ae.value,"min",V.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:_n.value==="min"?2:1})},null,44,Zi),e.createElementVNode("input",{type:"range",min:Vt.value.rangeMin,max:Vt.value.rangeMax,value:Vt.value.currentMax,onInput:y[15]||(y[15]=V=>ke(Ae.value,"max",V.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:_n.value==="max"?2:1})},null,44,qi)],544),e.createElementVNode("div",Ui,e.toDisplayString(Vt.value.currentMin)+" – "+e.toDisplayString(Vt.value.currentMax),1)],4)):Wt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Xi,[e.createElementVNode("div",Yi,[e.createElementVNode("label",ji,e.toDisplayString(e.unref(D)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:rn(Ae.value).from??"",onInput:y[16]||(y[16]=V=>We(Ae.value,"from",V.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Ki)]),e.createElementVNode("div",Gi,[e.createElementVNode("label",Qi,e.toDisplayString(e.unref(D)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:rn(Ae.value).to??"",onInput:y[17]||(y[17]=V=>We(Ae.value,"to",V.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Ji)])])):Wt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:Xe[Ae.value]??"",onInput:y[18]||(y[18]=V=>Ie(Ae.value,V.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(D)("table.search")||"Search..."},null,40,ec),e.createElementVNode("div",tc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je(Wt.value),V=>(e.openBlock(),e.createElementBlock("label",{key:V,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:St(Ae.value,V),onChange:R=>$n(Ae.value,V)},null,40,nc),e.createElementVNode("span",null,e.toDisplayString(V),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",oc,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[19]||(y[19]=V=>dn(Ae.value))},e.toDisplayString(e.unref(D)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Ae.value&&Wt.value&&It.value]])]),_:1})]))],64))}}),sc={class:"dss-toolbar-left"},rc=["title"],ic=["title"],cc={class:"dss-toolbar-dropdown-wrapper"},dc=["title"],uc={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"},mc={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"},pc={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"},vc={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"},fc={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"},gc={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"},hc={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},yc=["title"],kc=["title"],Cc=["title"],bc=["title"],wc=["title"],xc=["title"],Ec=["title"],Vc=["title"],Sc=["title"],Nc={key:2,class:"dss-toolbar-separator"},Bc=["title"],Mc={key:4,class:"dss-toolbar-separator"},_c={key:5,class:"dss-toolbar-dropdown-wrapper"},Tc=["title"],$c={class:"dss-toolbar-dropdown-ai"},Lc={class:"dss-toolbar-right"},Hc={key:0,class:"dss-toolbar-custom-group"},Ac={key:1,class:"dss-toolbar-separator"},Dc={class:"dss-link-modal-content"},Rc={class:"dss-link-modal-field"},Ic={class:"dss-link-modal-label"},Fc=["placeholder"],zc={class:"dss-link-modal-field"},Pc={class:"dss-link-modal-label"},Oc=["placeholder"],Wc={class:"dss-image-modal-tabs"},Zc={key:0,class:"dss-image-tab-content"},qc={class:"dss-link-modal-content"},Uc={class:"dss-link-modal-field"},Xc={key:0,class:"dss-link-modal-label"},Yc=["src"],jc={class:"dss-link-modal-field"},Kc={class:"dss-link-modal-label"},Gc=["placeholder"],Qc={class:"dss-link-modal-field"},Jc={class:"dss-link-modal-label"},ed=["placeholder"],td={class:"dss-link-modal-field"},nd={class:"dss-link-modal-label"},od=["placeholder"],ld={key:1,class:"dss-image-tab-content"},ad={class:"dss-link-modal-content"},sd={class:"dss-link-modal-field"},rd={class:"dss-link-modal-label"},id=["placeholder"],cd={class:"dss-link-modal-field"},dd={class:"dss-link-modal-label"},ud=["placeholder"],md={class:"dss-link-modal-field"},pd={class:"dss-link-modal-label"},vd=["placeholder"],fd={class:"dss-link-modal-field"},gd={class:"dss-link-modal-label"},hd=["placeholder"],yd={class:"dss-text-editor-title-input-container"},kd={key:0,class:"dss-text-editor-title-preview"},Cd={key:0},bd={key:1,class:"dss-text-editor-preview-placeholder"},wd=["value","placeholder","disabled"],xd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Ed={class:"dss-text-editor-description-input-container"},Vd={key:0,class:"dss-text-editor-description-preview"},Sd={key:0},Nd={key:1,class:"dss-text-editor-preview-placeholder"},Bd=["value","placeholder","disabled"],Md={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},_d=["data-comment-id","onMouseenter"],Td=["onClick"],$d=["src","alt"],Ld={key:1},Hd=["onClick"],Ad=["src","alt"],Dd={key:1},Rd=["data-has-second-user","onClick"],Id={class:"editor-comment-marker-count"},Fd={key:4,class:"dss-text-editor-textarea-wrapper"},zd=["value","placeholder","rows","disabled"],Pd={class:"dss-text-editor-footer"},Od={class:"dss-text-editor-footer-content"},Wd={class:"dss-text-editor-footer-stat"},Zd={class:"dss-text-editor-footer-stat"},qd={key:5,class:"dss-text-editor-content-wrapper"},Ud={key:0,class:"dss-comment-overlay-body"},Xd={class:"dss-comment-selection-wrapper"},Yd=["innerHTML"],jd={class:"dss-comment-messages-wrapper"},Kd={key:0,class:"dss-comment-avatar-wrapper"},Gd={class:"dss-comment-avatar"},Qd=["src","alt"],Jd={key:1},eu={class:"dss-comment-header"},tu={class:"dss-comment-header-text"},nu={class:"dss-comment-author"},ou={key:0,class:"dss-comment-date"},lu=["onClick","title"],au={class:"dss-comment-overlay-inner"},su=["placeholder","onKeydown"],ru={class:"dss-text-editor-footer"},iu={class:"dss-text-editor-footer-content"},cu={class:"dss-text-editor-footer-stat"},du={class:"dss-text-editor-footer-stat"},uu=["title"],mu=["title"],pu={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:""},vu={class:"dss-image-popup-content"},fu={key:0,class:"dss-image-popup-no-alt-icon"},gu=["title"],hu=["title"],yu={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:""},ku={class:"dss-toolbar-left"},Cu=["title"],bu=["title"],wu={class:"dss-toolbar-dropdown-wrapper"},xu=["title"],Eu={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"},Vu={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"},Su={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"},Nu={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"},Bu={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"},Mu={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"},_u={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Tu=["title"],$u=["title"],Lu=["title"],Hu=["title"],Au=["title"],Du=["title"],Ru=["title"],Iu=["title"],Fu=["title"],zu=["title"],Pu={key:2,class:"dss-toolbar-separator"},Ou={key:3,class:"dss-toolbar-dropdown-wrapper"},Wu=["title"],Zu={class:"dss-toolbar-dropdown-ai"},qu={key:0,class:"dss-toolbar-right"},Uu={key:0,class:"dss-toolbar-separator"},Xu={key:0,class:"dss-toolbar-custom-group"},Yu={key:1,class:"dss-toolbar-separator"},ju={name:"DSSTextEditor"},Ku=Object.assign(ju,{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:L=>typeof L=="object"&&L!==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:L=>typeof L=="object"&&L!==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(L,{expose:fe,emit:D}){const{t:F,locale:we}=cl.useI18n(),k=L,Me=D,ne=e.useSlots(),Fe=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
80
80
|
<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"/>
|
|
81
|
-
</svg>`,p=e.ref(null),ie=e.ref(null),be=e.ref(!1),fe=e.ref(!1),j=e.ref(!1),_=e.ref(""),_e=e.ref({}),Pe=e.ref(!1),Le=e.ref(!1),Ke=e.ref(""),z=e.ref(""),dt=e.ref(null),ut=e.ref(null),ye=e.ref(null),Dt=e.ref(null),xt=e.ref(""),nt=e.ref(!1),Be=e.ref({}),te=e.ref(!1),pn=e.ref({}),rt=e.ref(null),Qe=e.ref(null),sn=e.ref(!1),Xt=e.ref(""),se=e.ref(null),xe=e.ref(""),J=e.ref(""),oe=e.ref(""),Ye=e.ref(null),ct=e.ref(null),Ze=e.ref(null),Ve=e.ref(null),Ot=e.ref(null),_t=e.ref(!1),ot=e.ref(""),tn=e.ref({}),Rt=e.ref(!1),ht=e.ref("upload"),Tt=e.ref(""),st=e.ref(null),nn=e.ref(null),tt=e.ref([]),yt=e.ref([]),Te=e.ref(null),Ue=e.ref(!1),O=e.ref(""),Z=e.ref(""),X=e.ref(""),Q=e.ref(""),ge=e.ref(""),et=e.ref(""),Se=e.ref(null),Oe=e.ref(null),mt=e.ref(null),Et=e.ref(!1),Nt=e.ref(null),$t=e.ref(!1),Ae=e.ref(!1),It=e.ref(null),gt=e.ref("p"),Sn=e.ref(!1),Wt=e.ref([]),Vt=e.ref(null),Bt=e.ref(null),_n=e.ref(null),Tn=e.ref(!1),rn=e.ref(0),cn=100,Yt=e.ref(null),dn=e.computed(()=>({"dss-text-editor-no-border":!k.border,"dss-text-editor-rounded":k.rounded,"dss-text-editor-full-height":k.fullHeight,"dss-comment-overlay-open":ln.value!==null})),On=e.computed(()=>({})),mo=e.computed(()=>!k.fixedHeight||k.fullHeight?{}:{height:`${1.6*14*k.rows+24+2}px`,resize:"none",overflowY:"auto"}),$=e.computed(()=>!k.fixedHeight||k.fullHeight?{}:{height:`${1.6*14*k.rows+32}px`,overflowY:"auto"}),P=e.computed(()=>k.richText&&yt.value.length>0),A=e.computed(()=>{if(!k.modelValue)return"";if(k.richText){let l=k.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return l=l.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),l=l.replace(/<[^>]+>/g,""),l=l.replace(/ /g," "),l=l.replace(/&/g,"&"),l=l.replace(/</g,"<"),l=l.replace(/>/g,">"),l=l.replace(/"/g,'"'),l=l.replace(/'/g,"'"),l=l.replace(/\s+/g," ").trim(),l}return k.modelValue}),G=e.computed(()=>{const l=A.value.trim();return l?l.split(/\s+/).filter(o=>o.length>0).length:0}),ke=e.computed(()=>A.value.length),We=e.computed(()=>Ve.value!==null&&ht.value==="upload"&&xe.value&&xe.value.startsWith("data:")),Xe=e.computed(()=>k.titlePlaceholder||F("textEditor.placeholders.title")),Ie=e.computed(()=>k.descriptionPlaceholder||F("textEditor.placeholders.description")),je=e.computed(()=>k.placeholder||F("textEditor.placeholders.startTyping")),St=l=>ne&&ne[l]!==void 0,$n=l=>{for(let o=l+1;o<k.customToolbarSlots.length;o++)if(St(k.customToolbarSlots[o]))return!0;return!1},xn=l=>{for(let o=l+1;o<k.customToolbarSlots.length;o++){const a=k.customToolbarSlots[o];if(St(a)&&on(a))return!0}return!1},on=l=>k.customToolbarFloatingMap.hasOwnProperty(l)?k.customToolbarFloatingMap[l]===!0:!0,to=e.computed(()=>k.customToolbarSlots.some(l=>St(l)&&on(l))),Ln=e.computed(()=>St("title-slot")),un=e.computed(()=>St("description-slot")),vn=l=>{if(!l||l.trim()==="")return"<html></html>";const o=l.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?l:`<html>${l}</html>`},Wn=l=>{if(!l||l.trim()==="")return"";const o=l.replace(/<!--[\s\S]*?-->/g,""),a=o.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():o},ko=l=>{if(!l)return;const o=document.createTreeWalker(l,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=o.nextNode();for(;r;)a.push(r),r=o.nextNode();a.forEach(i=>i.remove())},jo=l=>{try{const o=String(l.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][l.getMonth()],i=l.getFullYear();return`${o} ${r} ${i}`}catch{return""}},Co=l=>{if(!l||typeof l!="string")return!1;const o=l.trim();if(!o)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(o))return!0;try{const i=F("textEditor.started_conversation");if(i&&o===i)return!0}catch{}const r=o.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},bo=l=>{const o=l.target.value;Me("update:modelValue",o),Me("change",o)},yn=()=>{if(!Se.value)return;const l=Se.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const r=l.value;l.value="M";const i=l.scrollHeight;l.value=r,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},fn=()=>{$t.value=!0,yn()},Io=()=>{$t.value=!1,no()},no=()=>{if(!Se.value)return;const l=Se.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const o=l.value;l.value="M";const a=l.scrollHeight;l.value=o,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},Hn=l=>{const a=l.target.value;$t.value&&yn(),Me("update:title",a),Me("title-change",a),mt.value="title",k.richText&&(Ue.value||(Z.value=O.value,ge.value=X.value,et.value=Q.value),Te.value&&clearTimeout(Te.value),Ue.value=!0,Te.value=setTimeout(()=>{Ue.value=!1,$e()},500))},po=()=>{if(!Oe.value)return;const l=Oe.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const r=l.value;l.value="M";const i=l.scrollHeight;l.value=r,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},_o=()=>{Ae.value=!0,po()},kt=()=>{Ae.value=!1,ce()},ce=()=>{if(!Oe.value)return;const l=Oe.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const o=l.value;l.value="M";const a=l.scrollHeight;l.value=o,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},To=l=>{const a=l.target.value;Ae.value&&po(),Me("update:description",a),Me("description-change",a),mt.value="description",k.richText&&(Ue.value||(Z.value=O.value,ge.value=X.value,et.value=Q.value),Te.value&&clearTimeout(Te.value),Ue.value=!0,Te.value=setTimeout(()=>{Ue.value=!1,$e()},500))},ze=()=>{const l=window.getSelection();if(l.rangeCount===0)return null;const o=l.getRangeAt(0);if(o.startContainer.nodeType===1)return{type:"element",element:o.startContainer,offset:o.startOffset};const a=o.cloneRange();return a.selectNodeContents(p.value),a.setEnd(o.startContainer,o.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+o.toString().length}},jt=l=>{if(!(!l||!p.value))try{const o=window.getSelection(),a=document.createRange();if(l.type==="element"&&l.element)if(p.value.contains(l.element)){a.setStart(l.element,l.offset),a.collapse(!0),o.removeAllRanges(),o.addRange(a);return}else{p.value.focus();return}let r=0;const i=[p.value];let u=null,d=!1,m=!1;for(;!m&&(u=i.pop());)if(u.nodeType===3){const v=r+u.length;!d&&l.start>=r&&l.start<=v&&(a.setStart(u,l.start-r),d=!0),d&&l.end>=r&&l.end<=v&&(a.setEnd(u,l.end-r),m=!0),r=v}else{let v=u.childNodes.length;for(;v--;)i.push(u.childNodes[v])}o.removeAllRanges(),o.addRange(a)}catch{p.value.focus()}},He=()=>{if(!p.value)return;p.value.focus();const l=window.getSelection(),o=document.createRange(),a=i=>{if(i.nodeType===3||i.childNodes.length===0)return i;for(let u=i.childNodes.length-1;u>=0;u--){const d=i.childNodes[u],m=a(d);if(m)return m}return i},r=a(p.value);if(r.nodeType===3)o.setStart(r,r.length),o.setEnd(r,r.length);else if(r.childNodes.length>0){const i=a(r);i&&i.nodeType===3?(o.setStart(i,i.length),o.setEnd(i,i.length)):(o.selectNodeContents(r),o.collapse(!1))}else o.setStart(r,0),o.setEnd(r,0);l.removeAllRanges(),l.addRange(o)},$e=(l=!1)=>{if(!p.value)return;const o=p.value.innerHTML,a=k.title||"",r=k.description||"";if(!l&&o===O.value&&a===X.value&&r===Q.value)return;const i={content:Z.value||O.value,title:ge.value!==void 0?ge.value:X.value,description:et.value!==void 0?et.value:Q.value},u=tt.value.length>0?tt.value[tt.value.length-1]:null;let d=!0;u&&(typeof u=="string"?d=i.content!==u:d=i.content!==u.content||i.title!==u.title||i.description!==u.description),d&&(tt.value.push(i),tt.value.length>50&&tt.value.shift(),yt.value=[]),O.value=o,X.value=a,Q.value=r,Z.value=o,ge.value=a,et.value=r},I=l=>{if(!p.value)return;Ct(),p.value&&ko(p.value);let o=null;p.value&&(p.value.querySelector("p")||(o=ze(),de()));const a=l&&l.inputType&&(l.inputType==="insertText"||l.inputType==="insertCompositionText"||l.inputType==="deleteContentBackward"||l.inputType==="deleteContentForward");a&&It.value&&(It.value=null),fe.value=!0;const r=p.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),i=vn(r);Me("update:modelValue",i),Me("change",i),mt.value="editor",Ue.value||(Z.value=O.value,ge.value=X.value,et.value=Q.value),Te.value&&clearTimeout(Te.value),Ue.value=!0,Te.value=setTimeout(()=>{Ue.value=!1,$e(),ll(),Jt()},500),e.nextTick(()=>{o&&jt(o),Ct();const u=["bold","italic","underline"],d=window.getSelection(),m=d.rangeCount>0?d.getRangeAt(0):null,v=m&&m.collapsed;if(u.forEach(h=>{try{if(v&&It.value?.command===h){Be.value[h]=It.value.state;return}if(h==="bold")if(m){const S=m.commonAncestorContainer,N=S.nodeType===3?S.parentElement:S;let w=!1;if(N&&((N.tagName==="STRONG"||N.tagName==="B"||N.closest&&N.closest("strong, b"))&&(w=!0),!w&&N.style&&parseInt(N.style.fontWeight)>=600&&(w=!0),!w))try{const U=window.getComputedStyle(N);parseInt(U.fontWeight)>=600&&(w=!0)}catch{}Be.value[h]=w}else Be.value.hasOwnProperty(h)||(Be.value[h]=!1);else if(h==="italic")if(m){const S=m.commonAncestorContainer,N=S.nodeType===3?S.parentElement:S,w=N&&(N.tagName==="EM"||N.tagName==="I"||N.closest&&N.closest("em, i"));Be.value[h]=!!w}else{const S=document.queryCommandState(h);Be.value[h]=S}else{const S=document.queryCommandState(h);Be.value[h]=S}}catch{}}),kn(),Nn(),R(),Ft(),Zn(),Fn("handleRichTextInput"),a&&(l.inputType==="insertText"||l.inputType==="insertCompositionText")){const h=l.data||"";h&&h.length===1&&setTimeout(()=>Jt(h),0),(h===" "||h===`
|
|
82
|
-
`||/[.,;:!?]/.test(h))&&setTimeout(()=>{ll()},100)}fe.value=!1})},Ct=()=>{if(!p.value)return;const l=window.getSelection();if(!l||l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const i=r.closest(".dss-image-wrapper");if(i){const u=i.querySelector("img");if(r!==u&&!u?.contains(r)){const d=o.startContainer.nodeType===3?o.startContainer.parentElement:o.startContainer,m=o.endContainer.nodeType===3?o.endContainer.parentElement:o.endContainer;if(i.contains(d)&&d!==u||i.contains(m)&&m!==u){const v=document.createRange();v.setStartAfter(i),v.collapse(!0),l.removeAllRanges(),l.addRange(v)}}}},de=()=>{if(!p.value)return;const l=p.value;if(l.querySelector&&l.querySelector("p"))return;const o=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(l.childNodes);let r=null;a.forEach(i=>{if(i.nodeType===Node.TEXT_NODE){if((i.textContent||"").trim()===""){i.parentNode===l&&l.removeChild(i);return}r||(r=document.createElement("p"),l.insertBefore(r,i)),r.appendChild(i);return}if(i.nodeType===Node.ELEMENT_NODE){const u=i,d=u.tagName;if(d==="BR"){r=null;return}if(o.has(d)){r=null;return}r||(r=document.createElement("p"),l.insertBefore(r,u)),r.appendChild(u)}})},Nn=()=>{if(p.value&&!Et.value){Et.value=!0;try{p.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),p.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const i=r.parentElement;!i||!i.classList.contains("dss-image-wrapper")?r.remove():i.querySelector("img")||r.remove()}),p.value.querySelectorAll("img").forEach(r=>{let i=r.getAttribute("alt");i===null&&(i=r.alt||"");const u=r.getAttribute("src")||r.src||"";if(i){const h=u.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),S=i===u||i===h;(i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")||S||S)&&(i="")}r.setAttribute("alt",i),r.setAttribute("data-alt",i);const d=!i||i.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;h&&h.remove()}if(d){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=Fe,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{Et.value=!1}}},oo=l=>{ll(),Me("blur",l),Eo()},C=()=>{if(k.disabled||!k.richText||!p.value)return;bt(),Te.value&&(clearTimeout(Te.value),Te.value=null),Ue.value&&($e(),Ue.value=!1);const l=mt.value==="title",o=mt.value==="description",a=mt.value==="editor";if(tt.value.length===0){l&&Se.value?Se.value.focus():o&&Oe.value?Oe.value.focus():p.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{I()});return}const r={content:p.value.innerHTML,title:k.title||"",description:k.description||""};yt.value.push(r);const i=tt.value.pop();if(i!==void 0){fe.value=!0;const u=typeof i=="string"?i:i.content,d=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";p.value.innerHTML=u,O.value=u,X.value=d,Q.value=m,Z.value=u,ge.value=d,et.value=m,e.nextTick(()=>{kn(),gn(),Dn(),Ft();const v=vn(u);Me("update:modelValue",v),Me("update:title",d),Me("update:description",m),Me("change",v),Me("title-change",d),Me("description-change",m),fe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(Se.value){Se.value.focus();const h=d.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(h,h),yn()}}else if(o){if(Oe.value){Oe.value.focus();const h=m.length;Oe.value.setSelectionRange(h,h)}}else if(a)He();else if(Se.value&&document.activeElement===Se.value){const h=d.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(h,h),yn()}else if(Oe.value&&document.activeElement===Oe.value){const h=m.length;Oe.value.setSelectionRange(h,h)}else p.value&&He()},10)})})}},y=()=>{if(k.disabled||!k.richText||!p.value)return;bt();const l=mt.value==="title",o=mt.value==="description",a=mt.value==="editor";if(yt.value.length===0){l&&Se.value?Se.value.focus():o&&Oe.value?Oe.value.focus():p.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{I()});return}const r={content:p.value.innerHTML,title:k.title||"",description:k.description||""};tt.value.push(r);const i=yt.value.pop();if(i!==void 0){fe.value=!0;const u=typeof i=="string"?i:i.content,d=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";p.value.innerHTML=u,O.value=u,X.value=d,Q.value=m,Z.value=u,ge.value=d,et.value=m,e.nextTick(()=>{kn(),gn(),Dn(),Ft();const v=vn(u);Me("update:modelValue",v),Me("update:title",d),Me("update:description",m),Me("change",v),Me("title-change",d),Me("description-change",m),fe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(Se.value){Se.value.focus();const h=d.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(h,h),yn()}}else if(o){if(Oe.value){Oe.value.focus();const h=m.length;Oe.value.setSelectionRange(h,h)}}else if(a)He();else if(Se.value&&document.activeElement===Se.value){const h=d.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(h,h),yn()}else if(Oe.value&&document.activeElement===Oe.value){const h=m.length;Oe.value.setSelectionRange(h,h)}else p.value&&He()},10)})})}},V=()=>{if(!p.value)return;p.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const i=r.style.fontWeight;if(i==="normal"||i==="400"){const u=document.createDocumentFragment();for(;r.firstChild;)u.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(u,r)}}),p.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const u=document.createElement("b");for(u.style.fontWeight="600";r.firstChild;)u.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(u,r)}}),p.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},R=()=>{if(!p.value)return;p.value.querySelectorAll("i, em").forEach(o=>{o.style.fontStyle="italic"})},ue=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const o=l.getRangeAt(0);let a=!1;if(o.collapsed){const r=o.startContainer;let i=r.nodeType===3?r.parentElement:r;for(;i&&i!==p.value;){if(i.tagName==="EM"||i.tagName==="I"){a=!0;break}if(i.style&&i.style.fontStyle==="italic"){a=!0;break}i=i.parentElement}}else{const r=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(r){const i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=i.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==p.value;){if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{R()}),!1;if(o.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{R()});else try{const r=o.extractContents(),i=document.createElement("em");i.style.fontStyle="italic",i.appendChild(r),o.insertNode(i),o.setStartAfter(i),o.collapse(!0),l.removeAllRanges(),l.addRange(o),e.nextTick(()=>{R()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{R()})}return!0},qe=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const o=l.getRangeAt(0);let a=!1;if(o.collapsed){const r=o.startContainer;let i=r.nodeType===3?r.parentElement:r;for(;i&&i!==p.value;){if(i.tagName==="STRONG"||i.tagName==="B"){a=!0;break}if(i.style&&parseInt(i.style.fontWeight)>=600){a=!0;break}i=i.parentElement}}else{const r=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(r){const i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=i.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==p.value;){if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{V()}),!1;if(o.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0),u=i.startContainer;let d=u.nodeType===3?u.parentElement:u;for(;d&&d!==p.value;){if(d.tagName==="SPAN"&&d.style.fontWeight){const m=d.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const h=document.createDocumentFragment();for(;d.firstChild;)h.appendChild(d.firstChild);v.appendChild(h),d.parentNode&&d.parentNode.replaceChild(v,d),i.setStart(v,0),i.collapse(!0),r.removeAllRanges(),r.addRange(i);break}}else if(d.tagName==="STRONG"||d.tagName==="B"){d.style.fontWeight="600";break}d=d.parentElement}if(!d||d===p.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",i.insertNode(m),i.setStart(m,0),i.collapse(!0),r.removeAllRanges(),r.addRange(i)}}V()});else try{const r=o.extractContents(),i=document.createElement("b");i.style.fontWeight="600",i.appendChild(r),o.insertNode(i),o.setStartAfter(i),o.collapse(!0),l.removeAllRanges(),l.addRange(o),e.nextTick(()=>{V()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{V()})}return!0},De=(l,o=null)=>{if(k.disabled||!k.richText||!p.value)return;Ue.value?(Te.value&&(clearTimeout(Te.value),Te.value=null),$e(),Ue.value=!1):$e(),bt(),p.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const u=a.getRangeAt(0);!u.collapsed&&fo(u)&&(r=ze())}if(l==="createLink"&&o){const u=window.getSelection();if(u.rangeCount>0){const d=u.getRangeAt(0);if(d.collapsed)try{d.expand("word")}catch{const v=document.createTextNode(o);d.insertNode(v),d.selectNodeContents(v)}}}if(l==="bold"){const u=qe();Be.value.bold=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(It.value={command:"bold",state:u}),e.nextTick(()=>{r&&(jt(r),e.nextTick(()=>{const m=pt("bold");Be.value.bold=m})),I(),gn(),Ft()});return}if(l==="italic"){const u=ue();Be.value.italic=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(It.value={command:"italic",state:u}),e.nextTick(()=>{r&&(jt(r),e.nextTick(()=>{const m=pt("italic");Be.value.italic=m})),I(),R(),gn(),Ft()});return}let i=!1;try{i=document.execCommand(l,!1,o)}catch{}e.nextTick(()=>{if(r&&jt(r),["bold","italic","underline"].includes(l))try{if(l==="bold")r&&e.nextTick(()=>{const d=pt("bold");Be.value.bold=d});else if(l==="italic")if(r)e.nextTick(()=>{const d=pt("italic");Be.value.italic=d});else{const d=document.queryCommandState(l);Be.value[l]=d}else{const d=document.queryCommandState(l);Be.value[l]=d}}catch{Be.value.hasOwnProperty(l)?Be.value[l]=!Be.value[l]:Be.value[l]=!0}if(l==="createLink"&&o){const d=window.getSelection();if(d.rangeCount>0){const v=d.getRangeAt(0),h=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",o)}p.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",o)})}I(),gn(),Ft()})},pt=(l,o=null)=>{if(k.disabled||!p.value)return!1;try{if(l==="formatBlock"&&o){const r=document.queryCommandValue("formatBlock");if(o==="<blockquote>"){const i=r.toLowerCase();if(i==="blockquote"||i==="<blockquote>")return!0;const u=window.getSelection();if(u.rangeCount>0){const m=u.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===o||r.toLowerCase()===o.toLowerCase()}if(["bold","italic","underline"].includes(l))try{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0);if(l==="bold"){let d=!1;if(i.collapsed){const m=i.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(d=!0),!d&&v.style&&parseInt(v.style.fontWeight)>=600&&(d=!0),!d))try{const h=window.getComputedStyle(v);parseInt(h.fontWeight)>=600&&(d=!0)}catch{}return Be.value.hasOwnProperty(l)?Be.value[l]:(Be.value[l]=d,d)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let S;for(;S=h.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(S))){if(S.nodeType===3){if(!(S.textContent||"").trim())continue;v=!0;let w=S.parentElement;for(;w&&w!==p.value;){if(w.tagName==="STRONG"||w.tagName==="B"){d=!0;break}if(w.style&&parseInt(w.style.fontWeight)>=600){d=!0;break}w=w.parentElement}}else if(S.nodeType===1){const N=S;if(N.tagName==="STRONG"||N.tagName==="B"){d=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){d=!0;break}}if(d)break}}return Be.value[l]=d&&v,d&&v}}if(l==="italic"){let d=!1;if(i.collapsed){const m=i.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(d=!0),!d&&v.style&&v.style.fontStyle==="italic"&&(d=!0),!d))try{window.getComputedStyle(v).fontStyle==="italic"&&(d=!0)}catch{}return Be.value.hasOwnProperty(l)?Be.value[l]:(Be.value[l]=d,d)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let S;for(;S=h.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(S))){if(S.nodeType===3){if(!(S.textContent||"").trim())continue;v=!0;let w=S.parentElement;for(;w&&w!==p.value;){if(w.tagName==="EM"||w.tagName==="I"){d=!0;break}if(w.style&&w.style.fontStyle==="italic"){d=!0;break}w=w.parentElement}}else if(S.nodeType===1){const N=S;if(N.tagName==="EM"||N.tagName==="I"){d=!0;break}if(N.style&&N.style.fontStyle==="italic"){d=!0;break}}if(d)break}}return Be.value[l]=d&&v,d&&v}}const u=document.queryCommandState(l);return i.collapsed&&Be.value.hasOwnProperty(l)?Be.value[l]:(Be.value[l]=u,u)}return Be.value.hasOwnProperty(l)?Be.value[l]:!1}catch{return Be.value.hasOwnProperty(l)?Be.value[l]:!1}try{return document.queryCommandState(l)}catch{return!1}}catch{return!1}},lo=l=>{k.disabled||!k.richText||(ie.value=ie.value===l?null:l,l==="askAi"&&(Qe.value=null))},bt=()=>{ie.value=null,st.value=null},An=l=>{De("formatBlock",l),bt()},Fo=l=>{if(!l||!p.value)return l;const o=Ce=>{let le=Ce.nodeType===Node.TEXT_NODE?Ce.parentElement:Ce;for(;le&&le!==p.value;){const Ge=le.tagName;if(Ge==="P"){const en=le.parentElement;if(en===p.value||en.tagName==="BLOCKQUOTE")return le}if(Ge==="BLOCKQUOTE")break;le=le.parentElement}return null},a=o(l.startContainer),r=o(l.endContainer);if(!a||!r)return l;const i=[],u=document.createTreeWalker(p.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Ce=>{const le=Ce.tagName;if(le==="P"){const Ge=Ce.parentElement;if(Ge===p.value||Ge.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return le==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let d;for(;d=u.nextNode();)i.push(d);const m=i.indexOf(a),v=i.indexOf(r);if(m===-1||v===-1)return l;const h=Math.min(m,v),S=Math.max(m,v),N=i.slice(h,S+1);if(N.length===0)return l;const w=N[0],U=N[N.length-1],W=document.createRange();return W.setStartBefore(w),W.setEndAfter(U),W},pl=()=>{if(k.disabled||!k.richText||!p.value)return;Ue.value?(Te.value&&(clearTimeout(Te.value),Te.value=null),$e(),Ue.value=!1):$e(),bt(),p.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;let o=l.getRangeAt(0);!o.collapsed&&fo(o)&&(o=Fo(o),l.removeAllRanges(),l.addRange(o));let a=null;!o.collapsed&&fo(o)&&(a=ze());const r=o.commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&p.value.contains(i))){if(i){const d=i.parentNode;Array.from(i.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")d.insertBefore(v,i);else{const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),d.insertBefore(h,i)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),d.insertBefore(h,i)}}),i.remove()}}else if(o.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const d=document.createElement("blockquote"),m=o.extractContents();d.appendChild(m),o.insertNode(d);const v=[],h=document.createTreeWalker(d,NodeFilter.SHOW_TEXT,{acceptNode:w=>w.parentNode===d&&w.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let S;for(;S=h.nextNode();)v.push(S);if(v.forEach(w=>{const U=document.createElement("p");w.parentNode.insertBefore(U,w),U.appendChild(w)}),d.querySelectorAll("p, div").forEach(w=>{w.textContent.trim()===""&&!w.querySelector("img")&&(w.innerHTML="<br>")}),d.children.length===0&&d.textContent.trim()===""){const w=document.createElement("p");w.innerHTML="<br>",d.appendChild(w)}}e.nextTick(()=>{a&&jt(a),Dn(),I(),Ft()})},vl=()=>{if(!p.value)return;const l=window.getSelection();if(l.rangeCount===0)return;const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!p.value.contains(r))return;const i=S=>{if(!S)return!1;const N=S.textContent||"",U=(S.innerHTML||"").trim();return N.trim()===""||U===""||U==="<br>"||U==="<br/>"||U==="<p></p>"||U==="<p><br></p>"||U==="<p><br/></p>"||U==="<p> </p>"||U==="<p><br> </p>"||U==="<div></div>"||U==="<div><br></div>"||U==="<div><br/></div>"};let u=null;for(a.nodeType===3?u=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?u=a:u=a.closest("p, div"),u&&r.contains(u)&&i(u)&&u.remove();r.lastChild;){const S=r.lastChild;if(S.nodeType===1&&S.tagName==="BR")S.remove();else if(S.nodeType===3)if((S.textContent||"").trim()==="")S.remove();else break;else break}if(r.children.length>0)for(let S=r.children.length-1;S>=0;S--){const N=r.children[S];if((N.tagName==="P"||N.tagName==="DIV")&&i(N))N.remove();else break}let d=r.innerHTML;const m=d;d=d.replace(/(<br\s*\/?>)+$/gi,""),d!==m&&(r.innerHTML=d);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):p.value&&p.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),l.removeAllRanges(),l.addRange(h),e.nextTick(()=>{Dn(),I()})},gn=()=>{if(!p.value){be.value=!1;return}try{const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");be.value=!!r}else be.value=!1}catch{be.value=!1}},fl=()=>{if(!p.value)return;const l=window.getSelection();l&&l.rangeCount>0&&l.getRangeAt(0),Dt.value=ze();const o=window.getSelection();let a="";o.rangeCount>0&&(a=o.getRangeAt(0).toString()),Ke.value="",z.value=a,xt.value="",ye.value=null,Le.value=!0,bt(),e.nextTick(()=>{dt.value&&dt.value.focus()})},ao=()=>{if(!p.value)return;Ue.value?(Te.value&&(clearTimeout(Te.value),Te.value=null),$e(),Ue.value=!1):$e();const l=window.getSelection();let o=null;if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!o&&ye.value&&(o=ye.value),o&&o.parentNode){const a=document.createDocumentFragment();for(;o.firstChild;)a.appendChild(o.firstChild);if(o.parentNode.replaceChild(a,o),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),l.removeAllRanges(),l.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),l.removeAllRanges(),l.addRange(r)}ye.value=null}else De("unlink");be.value=!1,bt(),e.nextTick(()=>{I(),gn()})},gl=()=>{k.disabled||!k.richText||p.value&&(Ue.value?(Te.value&&(clearTimeout(Te.value),Te.value=null),$e(),Ue.value=!1):$e(),bt(),p.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{kn(),I(),Ft()}))},hl=()=>{k.disabled||!k.richText||p.value&&(Ue.value?(Te.value&&(clearTimeout(Te.value),Te.value=null),$e(),Ue.value=!1):$e(),bt(),p.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{kn(),I(),Ft()}))},yl=l=>{const o=l.parentElement;if(!o||o.tagName!=="OL")return null;let a=0,r=l.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},kn=()=>{if(!p.value)return;p.value.querySelectorAll("li > ol").forEach(o=>{const a=o.parentElement;if(a&&a.tagName==="LI"){const r=yl(a);r!==null&&Array.from(o.children).filter(u=>u.tagName==="LI").forEach(u=>{u.setAttribute("data-parent-num",String(r))})}})},kl=()=>{if(k.disabled||!k.richText||!p.value)return;bt(),p.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{kn(),I()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const i=a.previousElementSibling;if(i&&i.tagName==="LI"){const u=r.tagName.toLowerCase();let d=i.querySelector(`:scope > ${u}`);d||(d=document.createElement(u),i.appendChild(d));const m=yl(i);d.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),kn();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),l.removeAllRanges(),l.addRange(v),e.nextTick(()=>{I(),Ft()})}else document.execCommand("indent",!1),e.nextTick(()=>{kn(),I(),Ft()})},zo=()=>{if(k.disabled||!k.richText||!p.value)return;bt(),p.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{kn(),I()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const i=r.parentElement;if(i&&i.tagName==="LI"){const u=i.parentElement;if(u&&(u.tagName==="OL"||u.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),u.insertBefore(a,i.nextSibling),r.children.length===0&&r.remove(),kn();const d=document.createRange();d.selectNodeContents(a),d.collapse(!1),l.removeAllRanges(),l.addRange(d),e.nextTick(()=>{I(),Ft()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{kn(),I(),Ft()})},ln=e.ref(null),Cn=e.ref(null),wo=e.ref({}),Xn=e.ref(""),Yn=e.ref(null),so=e.ref("");e.ref("");const ro=e.ref(null);e.ref("");const En=e.ref([]),Ko=e.ref(!1),xo=e.ref(!1),Go=l=>{if(!l)return"";const o=l.cloneRange(),a=document.createElement("div");return a.appendChild(o.cloneContents()),a.innerHTML},Qo=()=>{if(k.disabled||!k.richText||!p.value)return;if(ln.value!==null){ln.value=null,Xn.value="",so.value="",ro.value=null,En.value=[],Qn(!0);return}bt(),p.value.focus();const l=window.getSelection();if(!l||l.rangeCount===0)return;const o=l.getRangeAt(0);if(o.collapsed||!fo(o))return;so.value=Go(o)||"",ro.value=ze();const a=o.getBoundingClientRect(),r=p.value.parentElement;if(!r)return;const i=r.getBoundingClientRect(),u=a.bottom-i.top,m=Math.max(u+8,0);wo.value={top:`${m}px`,bottom:"auto"},ln.value=Date.now(),e.nextTick(()=>{if(Xn.value="",Yn.value){const h=Yn.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const h=r.querySelector(".dss-text-editor-footer");if(h){const S=r.getBoundingClientRect(),N=v.getBoundingClientRect(),w=h.getBoundingClientRect(),U=N.bottom-S.top,W=w.top-S.top,Ce=8;if(U>W-Ce){const le=w.height;wo.value={bottom:`${le+Ce}px`,top:"auto"}}else wo.value={top:`${m}px`,bottom:"auto"}}}})},Cl=()=>{if(!Xn.value.trim())return;const l=Xn.value.trim(),o=new Date,a={text:l,selectionText:so.value,selectionRange:ro.value,commentId:ln.value,user:k.commentUser||null,createdAt:o.toISOString()};En.value=[...En.value,a],Me("comment-submitted",a),bn(a),ro.value&&!Jo(ro.value)&&el(ln.value,ro.value),Xn.value="",e.nextTick(()=>{if(Yn.value){const r=Yn.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Fn("sendComment")})},Tl=(l,o)=>{if(!(!k.commentUser||!l.user||l.user.id!==k.commentUser.id)){if(En.value=En.value.filter((a,r)=>r!==o),ln.value!==null&&p.value){const a=String(ln.value),r=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&En.value.length>0){const i=[],u=new Set;En.value.forEach(d=>{d.user&&d.user.id&&!u.has(d.user.id)&&(u.add(d.user.id),i.push(d.user))}),i.length>0?r.setAttribute("data-comment-user",JSON.stringify(i[0])):r.removeAttribute("data-comment-user"),i.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(i[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(En.value.length))}else r&&En.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Me("comment-deleted",{comment:l,index:o,commentId:ln.value}),k.comments&&Array.isArray(k.comments)){const a=k.comments.filter(r=>!(r.commentId===l.commentId&&r.text===l.text&&r.user?.id===l.user?.id));Me("update:comments",a)}e.nextTick(()=>{Fn("deleteComment")})}},Jo=l=>{if(!l||!p.value)return!1;try{const o=bl(l);if(!o)return!1;const a=o.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},bl=l=>{if(!l||!p.value)return null;try{const o=document.createRange();if(l.type==="element"&&l.element)return p.value.contains(l.element)?(o.setStart(l.element,l.offset),o.collapse(!0),o):null;let a=0;const r=[p.value];let i=null,u=!1,d=!1;for(;!d&&(i=r.pop());)if(i.nodeType===3){const m=a+i.length;!u&&l.start>=a&&l.start<=m&&(o.setStart(i,l.start-a),u=!0),u&&l.end>=a&&l.end<=m&&(o.setEnd(i,l.end-a),d=!0),a=m}else{let m=i.childNodes.length;for(;m--;)r.push(i.childNodes[m])}return u?o:null}catch{return null}},el=(l,o)=>{if(!(!l||!o||!p.value))try{const a=bl(o);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i){const m=i.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(l)&&m.getAttribute("data-fake-comment")!==String(l)&&m.setAttribute("data-comment",String(l));return}}const u=document.createElement("span");u.setAttribute("data-comment",String(l));try{const m=a.startContainer,v=a.endContainer,h=a.startOffset,S=a.endOffset,N=m.nodeType===3?m.parentNode:m,w=v.nodeType===3?v.parentNode:v;if(N===w&&h===0&&S===(v.nodeType===3?v.length:w.childNodes.length)&&(N.tagName==="P"||N.tagName==="DIV"||N.tagName==="H1"||N.tagName==="H2"||N.tagName==="H3"||N.tagName==="H4"||N.tagName==="H5"||N.tagName==="H6")){const W=a.extractContents();u.appendChild(W),a.insertNode(u)}else a.surroundContents(u)}catch{const v=a.extractContents();u.appendChild(v),a.insertNode(u)}const d=p.value.querySelector(`[data-comment="${String(l)}"]`);e.nextTick(()=>{Fn("wrapSelectionWithCommentMarker"),I()})}catch{}},bn=l=>{if(!l||!l.commentId)return;const o=Array.isArray(k.comments)?[...k.comments]:[],a=typeof l.commentId=="string"&&l.commentId.startsWith("comment-")?Date.now():Number(l.commentId)||l.commentId;let r=o.findIndex(u=>typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)===Number(a)||u.conversation_id===a);const i={text:l.text,user:l.user,createdAt:l.createdAt,created_at:l.createdAt,updated_at:l.createdAt};if(r>=0){const u=o[r];if(u.conversation||(u.conversation=[]),u.conversation.push(i),u.updated_at=l.createdAt,!u.article_id&&o.length>0){const d=o.find(m=>m.article_id);d&&(u.article_id=d.article_id)}}else{const u=l.selectionRange,d=o.length>0&&o.find(v=>v.article_id)?.article_id||null,m={conversation_id:a,article_id:d,selection_range:u?{start:u.start||0,end:u.end||0,type:u.type||"text"}:null,selection_text:l.selectionText||"",conversation:[i],created_by_user:l.user,created_at:l.createdAt,updated_at:l.createdAt,status:"active"};o.push(m)}Ko.value=!0,Me("update:comments",o)},L=(l,o=[])=>{if(k.disabled||!k.richText||!p.value)return;const a=p.value;let r=null;try{r=a.querySelector(l)}catch{return}if(!r)return;bt(),a.focus();const i=document.createRange();i.selectNodeContents(r);const u=window.getSelection();u&&(u.removeAllRanges(),u.addRange(i)),so.value=r.innerHTML||"",ro.value=ze();const d=i.getBoundingClientRect(),m=a.parentElement;if(m){const S=m.getBoundingClientRect(),N=d.bottom-S.top,U=Math.max(N+8,0);wo.value={top:`${U}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(v&&k.comments&&Array.isArray(k.comments)){const S=k.comments.find(N=>String(N.conversation_id)===String(v));if(S&&S.conversation&&Array.isArray(S.conversation)){const N=S.conversation.map(w=>({id:w.id||w.commentary_id,commentary_id:w.id||w.commentary_id,conversation_id:S.id||S.conversation_id,text:w.text,user:w.user,createdAt:w.created_at||w.createdAt,updated_at:w.updated_at||w.updatedAt}));h.push(...N)}}h.length===0&&Array.isArray(o)&&o.length>0&&(h=o.slice()),h.sort((S,N)=>{const w=Ce=>{if(!Ce)return 0;const le=new Date(Ce).getTime();return isNaN(le)?0:le},U=w(S.createdAt),W=w(N.createdAt);return U===W?0:U-W}),En.value=h,Qn(!0),ln.value=v||null,r&&(Cn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Xn.value="",Yn.value){const S=Yn.value;S.style.height="auto",S.style.height=`${S.scrollHeight}px`,S.focus()}if(m){const S=m.querySelector(".dss-comment-overlay");if(S){const N=m.querySelector(".dss-text-editor-footer");if(N){const w=m.getBoundingClientRect(),U=S.getBoundingClientRect(),W=N.getBoundingClientRect(),Ce=U.bottom-w.top,le=W.top-w.top,Ge=8;if(Ce>le-Ge){const en=W.height;wo.value={bottom:`${en+Ge}px`,top:"auto"}}}}}Fn("openCommentOverlayForSelector")})},Qt=e.ref(null),Bn=e.ref(0),mn=l=>{if(!(k.disabled||!k.richText)){if(l.key==="Escape"){const o=window.getSelection();if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&p.value&&p.value.contains(i))){l.preventDefault();let d=null;r.nodeType===3?d=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?d=r:d=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",d&&i.contains(d)&&d.nextSibling?i.insertBefore(m,d.nextSibling):i.appendChild(m),setTimeout(()=>{vl()},50);return}}}if(l.key.length===1||l.key==="Enter"){const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0),r=a.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i){const u=i.closest(".dss-image-wrapper");if(u){const d=u.querySelector("img");if(i!==d&&!d?.contains(i)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,v=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.contains(m)&&m!==d||u.contains(v)&&v!==d){l.preventDefault();const h=document.createRange();h.setStartAfter(u),h.collapse(!0),o.removeAllRanges(),o.addRange(h);return}}}}}}if(l.key==="Backspace"||l.key==="Delete"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);let r=null,i=null;if(a.collapsed)if(l.key==="Backspace"){const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===0?d=u.previousSibling||u.parentNode:d=u.parentNode);const m=d.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(r=m,i=r.closest(".dss-image-wrapper"))),i||(i=d.closest(".dss-image-wrapper"),i&&(r=i.querySelector("img")))}else{const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===u.length?d=u.nextSibling||u.parentNode:d=u.parentNode);const m=d.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(r=m,i=r.closest(".dss-image-wrapper"))),i||(i=d.closest(".dss-image-wrapper"),i&&(r=i.querySelector("img")))}else{const u=a.commonAncestorContainer,d=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.nodeType===1&&u.tagName==="IMG"?(r=u,i=r.closest(".dss-image-wrapper")):(r=u.querySelector("img"),r&&(i=r.closest(".dss-image-wrapper"))),i){const v=i.contains(d)||d===i,h=i.contains(m)||m===i,N=a.cloneContents().textContent?.trim()||"",w=i.textContent?.trim()||"";(!v||!h||N.length>w.length)&&(i=null,r=null)}}if(i){l.preventDefault(),l.stopPropagation();const u=i.parentNode;if(u){const d=document.createTextNode("");u.insertBefore(d,i),i.remove();const m=document.createRange();m.setStartAfter(d),m.collapse(!0),o.removeAllRanges(),o.addRange(m),e.nextTick(()=>{I()});return}}}}if(l.key==="Tab"){l.preventDefault(),l.shiftKey?zo():kl();return}if(l.key==="Enter"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);if(a.collapsed){const d=a.startContainer,m=v=>{if(!v)return!1;let h=v.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const S=v.parentElement;return S&&S!==p.value?m(S):!1};if(d.nodeType===3){const v=d.parentElement;if(v&&(m(v)||m(d))){const h=v.closest("p, div");if(h&&h!==p.value){l.preventDefault(),l.stopPropagation();let S=null;const N=a.startOffset;N<d.length&&(S=d.splitText(N));const w=document.createElement("p");if(S?w.appendChild(S):w.innerHTML="<br>",d.length===0){const W=d.parentElement;W&&(W.removeChild(d),W.childNodes.length===0&&W.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(w,h.nextSibling):h.parentNode.appendChild(w);const U=document.createRange();S?U.setStart(S,0):U.setStart(w,0),U.collapse(!0),o.removeAllRanges(),o.addRange(U),e.nextTick(()=>{I()});return}}}}const r=a.commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&p.value&&p.value.contains(i))){let d=null;r.nodeType===3?d=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?d=r:d=r.closest("p, div");const m=W=>{if(!W)return!1;const Ce=W.textContent||"",Ge=(W.innerHTML||"").trim(),en=Ge.replace(/<br\s*\/?>/gi,"").trim();return Ce.trim()===""||Ge===""||en===""||Ge==="<br>"||Ge==="<br/>"||Ge==="<p></p>"||Ge==="<p><br></p>"||Ge==="<p><br/></p>"||Ge==="<p> </p>"||Ge==="<p><br> </p>"||Ge==="<div></div>"||Ge==="<div><br></div>"||Ge==="<div><br/></div>"},v=i.lastChild,h=v&&v.nodeType===1&&v.tagName==="BR",S=a.startContainer,N=S.nodeType===3?S.parentElement:S,w=N===i||N&&N.parentElement===i;if(d&&m(d)||h&&w){l.preventDefault(),setTimeout(()=>{vl()},50);return}}}}if(l.key===" "){const o=Date.now(),a=o-Bn.value;if(Qt.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0),u=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer.closest("li"):i.commonAncestorContainer.parentElement?.closest("li");if(u){const d=i.startContainer.textContent?.substring(0,i.startOffset)||"";if((u.textContent||"").indexOf(d.trim())<=10||d.trim().length<=2){l.preventDefault(),kl();return}}}}Qt.value=" ",Bn.value=o}else Qt.value=l.key}},jn=l=>{if(k.disabled||!k.richText)return;l.preventDefault();let o=l.clipboardData.getData("text/html"),a=l.clipboardData.getData("text/plain");o&&(o=o.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),$e();const r=window.getSelection();let i=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),i=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const u=d=>{const v=new DOMParser().parseFromString(d,"text/html");let h=p.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(N=>{if(h>0){const w=v.createElement("p");w.innerHTML=N.innerHTML,N.parentNode.replaceChild(w,N)}else h++}),i){const N=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],w=Array.from(v.body.children).filter(U=>N.includes(U.tagName));if(w.length===1){const U=w[0].tagName,W=i.tagName,Ce=i.textContent.trim()===""&&!i.querySelector("img");let le=!1;if(["H1","H2","H3","H4","H5","H6"].includes(W)?le=!0:Ce||(U===W||U==="P")&&(le=!0),le)return w[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(o){const d=u(o);document.execCommand("insertHTML",!1,d)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=u(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);I()},Lt=l=>{if(ie.value){const a=l.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&bt()}if(te.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),i=p.value&&a.closest(".dss-text-editor-content");!r&&!i&&Eo()}if(Qe.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),i=a.closest(".dss-toolbar-dropdown");!r&&!i&&nl()}const o=l.target;if(!o.closest(".dss-toolbar-dropdown")&&!o.closest(".dss-toolbar-dropdown-submenu")&&(st.value=null),!p.value||!o.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);Sn.value=!r.collapsed&&fo(r)}else Sn.value=!1}if(ln.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const d=a.getBoundingClientRect(),m=l.clientX,v=l.clientY;r=m>=d.left&&m<=d.right&&v>=d.top&&v<=d.bottom}const i=o.closest(".dss-toolbar-button"),u=i&&i.getAttribute("title")==="Comment";!r&&!u&&(ln.value=null,Xn.value="",so.value="",ro.value=null,En.value=[],Qn(!0))}},Kt=(l,o)=>{l&&l.stopPropagation&&l.stopPropagation(),nn.value&&(clearTimeout(nn.value),nn.value=null),st.value=o},Kn=l=>{const o=l.relatedTarget;if(o){const a=o.closest(".dss-toolbar-dropdown-submenu"),r=o.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}nn.value&&clearTimeout(nn.value),nn.value=setTimeout(()=>{st.value=null,nn.value=null},150)},vo=l=>{st.value=null};let vt=0;const ft=l=>{if(!l)return;const o=Array.from(l.children);o.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),o.forEach((a,r)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const i=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),u=a.nextElementSibling,d=u&&!u.classList.contains("dss-toolbar-dropdown-submenu")&&!u.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&u.tagName==="DIV"&&!u.classList.contains("dss-toolbar-dropdown-item")&&Array.from(u.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(i||d){const m=`submenu-auto-${++vt}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let v=null;i?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(i,a.nextSibling),i.classList.add("dss-toolbar-dropdown-submenu"),v=i):d&&(u.classList.add("dss-toolbar-dropdown-submenu"),v=u),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),i&&a.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(S=>{(S.tagName==="BUTTON"||S.tagName==="DIV")&&!S.classList.contains("dss-toolbar-dropdown-item")&&S.classList.add("dss-toolbar-dropdown-item")}))}})},Je=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(o=>{ft(o),o.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(i=>{const u=i._subMenuHandlers;u&&(i.removeEventListener("mouseenter",u.enter),i.removeEventListener("mouseleave",u.leave));const d=v=>{const h=i.getAttribute("data-submenu-id");h&&Kt(v,h)},m=Kn;i.addEventListener("mouseenter",d),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:d,leave:m}}),o.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(i=>{const u=i._subMenuHandlers;u&&(i.removeEventListener("mouseenter",u.enter),i.removeEventListener("mouseleave",u.leave));const d=h=>{const S=i.getAttribute("data-submenu-id");S&&Kt(h,S)},m=Kn;i.addEventListener("mouseenter",d),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:d,leave:m},i.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",vo)})})})};let wt=null;const Po=()=>{if(st.value){const l=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${st.value}"]`),o=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${st.value}"]`);l&&o&&Ml(l,o)}if(te.value&&Ft(),k.richText){if(wt!==null)return;wt=setTimeout(()=>{wt=null,Fn("handleWindowResize")},150)}},$o=()=>{if(!k.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(o=>{Array.from(o.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},Lo=()=>{const l=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),o=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};l.forEach(a=>{a.addEventListener("selectstart",o),a.addEventListener("mousedown",o),a.addEventListener("dragstart",o),a.addEventListener("contextmenu",o),a.addEventListener("click",r=>{if(window.getSelection){const i=window.getSelection();i.removeAllRanges&&i.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{$t.value?yn():no(),Ae.value?po():ce()})}),e.nextTick(()=>{Lo()}),k.richText&&p.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Lt),window.addEventListener("resize",Po);let l=null;const o=()=>{l===null&&(l=setTimeout(()=>{l=null,Po()},150))};window.addEventListener("scroll",o,!0),p.value._windowScrollHandler=o,p.value._windowScrollTimeout=l,p.value.closest(".editor-with-comments"),p.value.closest(".dss-text-editor-content-wrapper");const a=p.value.closest(".dss-text-editor-content");let r=null;const i=()=>{r===null&&(r=setTimeout(()=>{r=null,Po()},150))};a&&(a.addEventListener("scroll",i),p.value._scrollHandlers={wrapper:null,content:a,handler:i}),e.nextTick(()=>{Je(),$o()}),p.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!k.disabled&&m.preventDefault();const S=v.closest(".dss-image-no-alt-icon"),N=v.closest(".dss-image-wrapper");if(S||N&&v===N){m.preventDefault(),m.stopPropagation();const w=window.getSelection(),U=document.createRange();U.setStartAfter(N),U.collapse(!0),w.removeAllRanges(),w.addRange(U)}else N&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const w=window.getSelection();if(w.rangeCount>0){const W=w.getRangeAt(0).commonAncestorContainer,Ce=W.nodeType===3?W.parentElement:W;if(N.contains(Ce)&&Ce!==N.querySelector("img")){const le=document.createRange();le.setStartAfter(N),le.collapse(!0),w.removeAllRanges(),w.addRange(le)}}else{const U=document.createRange();U.setStartAfter(N),U.collapse(!0),w.addRange(U)}}))},!0),p.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),S=v.closest(".dss-image-wrapper");if(h||S&&v.tagName!=="IMG"){m.preventDefault();const N=window.getSelection(),w=document.createRange();S&&(w.setStartAfter(S),w.collapse(!0),N.removeAllRanges(),N.addRange(w))}},!0),p.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!p.value)return;p.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const N=h.getAttribute("alt")||h.alt||"";if(N){const w=h.getAttribute("src")||h.src||"",U=w.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),W=N===w||N===U;(N.startsWith("http://")||N.startsWith("https://")||N.startsWith("data:")||W||W)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),Nn()})}),p.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),S=h?.closest(".dss-image-wrapper");h&&p.value.contains(h)&&(Nt.value=S||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),p.value.addEventListener("dragover",m=>{Nt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),p.value.addEventListener("dragenter",m=>{Nt.value&&(m.preventDefault(),m.stopPropagation())}),p.value.addEventListener("drop",m=>{if(!Nt.value||!p.value)return;m.preventDefault(),m.stopPropagation();const v=Nt.value,h=v.classList?.contains("dss-image-wrapper"),S=h?v.querySelector("img"):v,N=h?v:S?.closest(".dss-image-wrapper");if(!S||!p.value.contains(S)){Nt.value=null;return}let w=null;const U=m.clientX,W=m.clientY;if(document.caretRangeFromPoint)w=document.caretRangeFromPoint(U,W);else{const Pt=window.getSelection();Pt.rangeCount>0?w=Pt.getRangeAt(0).cloneRange():(w=document.createRange(),w.selectNodeContents(p.value),w.collapse(!1))}if(!w){Nt.value=null;return}const Ce=w.commonAncestorContainer,le=Ce.nodeType===3?Ce.parentElement:Ce;if(le?.closest(".dss-image-wrapper")===N||N&&N.contains(le)){Nt.value=null;return}if(N&&(le===N||N.contains(le))){Nt.value=null;return}const en=S.getAttribute("src");let At=null;N?At=N.cloneNode(!0):At=S.cloneNode(!0);try{let Pt=w.startContainer;if(Pt.nodeType===3&&(Pt=Pt.parentElement),N&&(Pt===N||N.contains(Pt))){const qt=document.createRange();qt.setStartAfter(N),qt.collapse(!0),w=qt}w.insertNode(At);const Gt=document.createRange();Gt.setStartAfter(At),Gt.collapse(!0);const Zt=window.getSelection();Zt.removeAllRanges(),Zt.addRange(Gt)}catch{if(p.value.childNodes.length===0){const Gt=document.createElement("p");Gt.appendChild(At),p.value.appendChild(Gt)}else{const Gt=p.value.lastChild;if(Gt&&Gt.nodeType===1)Gt.appendChild(At);else{const Zt=document.createElement("p");Zt.appendChild(At),p.value.appendChild(Zt)}}}N?N.remove():S.remove(),Nt.value=null,e.nextTick(()=>{const Pt=p.value.querySelectorAll("img");let Gt=!1;Pt.forEach(Zt=>{if(Zt.getAttribute("src")===en)if(!Gt)Gt=!0;else{const qt=Zt.closest(".dss-image-wrapper");qt?qt.remove():Zt.remove()}}),Nn(),I()})}),p.value.addEventListener("dragend",m=>{Nt.value=null});let u=null;const d=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const S=h.querySelectorAll&&h.querySelectorAll("img");S&&S.forEach(N=>{N.removeAttribute("alt"),N.removeAttribute("data-alt"),N.setAttribute("alt",""),N.setAttribute("data-alt",""),N.alt=""})}})}),u&&clearTimeout(u),u=setTimeout(()=>{Nn(),$o(),u=null},100)});if(d.observe(p.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{$o()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),k.modelValue){const m=Wn(k.modelValue);p.value.innerHTML=m,de()}e.nextTick(()=>{const m=p.value.innerHTML||"",v=k.title||"",h=k.description||"";O.value=m,X.value=v,Q.value=h,ge.value=v,et.value=h,kn(),Nn(),R(),Zn(),Bl(),Do()}),gn(),Dn(),p.value._mutationObserver=d}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Lt),window.removeEventListener("resize",Po),p.value&&p.value._windowScrollHandler&&window.removeEventListener("scroll",p.value._windowScrollHandler,!0),wt!==null&&(clearTimeout(wt),wt=null),p.value&&p.value._windowScrollTimeout!==null&&clearTimeout(p.value._windowScrollTimeout),Te.value&&clearTimeout(Te.value),nn.value&&clearTimeout(nn.value),p.value&&p.value._mutationObserver&&p.value._mutationObserver.disconnect(),Vt.value&&Vt.value.disconnect(),Bt.value!==null&&(cancelAnimationFrame(Bt.value),Bt.value=null),_n.value!==null&&(clearTimeout(_n.value),_n.value=null),Yt.value!==null&&(clearTimeout(Yt.value),Yt.value=null),Qn(!0),p.value&&p.value._scrollHandlers){const{wrapper:o,content:a,handler:r}=p.value._scrollHandlers;o&&o.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const l=document.querySelector(".dss-text-editor-toolbar");l&&l._toolbarMutationObserver&&l._toolbarMutationObserver.disconnect()});const tl=l=>{const o=l.target,a=o.closest("a");if(a&&!k.disabled){l.preventDefault();const i=document.createRange();i.selectNodeContents(a);const u=window.getSelection();u.removeAllRanges(),u.addRange(i)}const r=o.closest(".dss-image-wrapper");r&&o.tagName!=="IMG"?e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const d=i.getRangeAt(0).commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),i.removeAllRanges(),i.addRange(v)}}Nn(),gn(),Dn(),Ft(),Zn()}):e.nextTick(()=>{Nn(),gn(),Dn(),Ft(),Zn()})},io=()=>{Ct();const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0);Sn.value=!a.collapsed&&fo(a),!a.collapsed&&It.value&&(It.value=null)}else Sn.value=!1;if(Nn(),gn(),Dn(),Ft(),Zn(),l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i&&i.closest(".dss-text-editor-footer")){l.removeAllRanges(),Sn.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0);if(!i.collapsed)if(a==="bold"){const u=i.commonAncestorContainer,d=u.nodeType===3?u.parentElement:u;let m=!1;if(d&&((d.tagName==="STRONG"||d.tagName==="B"||d.closest&&d.closest("strong, b"))&&(m=!0),!m&&d.style&&parseInt(d.style.fontWeight)>=600&&(m=!0),!m))try{const v=window.getComputedStyle(d);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}Be.value[a]=m}else{const u=document.queryCommandState(a);Be.value[a]=u}}}catch{}})},Zn=()=>{if(!k.richText||k.disabled||!p.value){gt.value="p";return}try{const l=window.getSelection();if(!l||l.rangeCount===0){gt.value="p";return}const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!p.value.contains(r)){gt.value="p";return}const i=r.closest("h1, h2, h3, h4, h5, h6, p");if(!i){gt.value="p";return}const u=i.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(u)?gt.value=u:gt.value="p"}catch{gt.value="p"}},Dn=()=>{if(!p.value){nt.value=!1;return}try{const l=window.getSelection();let o=!1;if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");o=!!(i&&p.value.contains(i))}nt.value=o}catch{nt.value=!1}},fo=l=>{if(!l||!p.value)return!1;const o=l.commonAncestorContainer;if(!o)return!1;const a=o.nodeType===3?o.parentElement:o;return a?p.value.contains(a):!1},Eo=()=>{te.value=!1},Ft=()=>{if(!k.floatingToolbar||!k.richText||k.disabled){te.value=!1;return}const l=window.getSelection();if(!l||l.rangeCount===0){te.value=!1;return}const o=l.getRangeAt(0);if(o.collapsed||!fo(o)){te.value=!1;return}const a=o.getBoundingClientRect();if(!a||a.width===0&&a.height===0){te.value=!1;return}const r=p.value;if(!r){te.value=!1;return}const i=r.getBoundingClientRect();if(!i||i.width===0){te.value=!1;return}const u=40,d=8,m=a.top-u/2+15;let v=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let S=0;rt.value&&(S=rt.value.getBoundingClientRect().width);const N=(S||320)/2;let w=i.left+N,U=i.right-N;if(U<w){const W=i.left+i.width/2;w=W,U=W}if(h>0){const W=N+d,Ce=h-N-d;if(w=Math.max(w,W),U=Math.min(U,Ce),U<w){const le=h/2;w=le,U=le}}v<w?v=w:v>U&&(v=U),pn.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},te.value=!0},co=l=>{k.disabled||!k.richText||(Qe.value=Qe.value===l?null:l,l==="askAi"&&(ie.value=null))},nl=()=>{Qe.value=null,st.value=null},hn=l=>{An(l),nl()};let go=null,Vo=null,Rn=null,So=null;const wl=l=>{if(k.disabled||!k.richText){No(),Ho();return}const o=l.target,a=o.closest("a"),r=o.closest("img");if(go&&(clearTimeout(go),go=null),Rn&&(clearTimeout(Rn),Rn=null),a&&a!==Vo){Ho(),Vo=a;let i=a.getAttribute("href")||"";(!i||i==="#"||i==="")&&(i=a.textContent||""),ye.value=a,_.value=i,j.value=!0,Pe.value=!0,ol(a)}else!a&&Vo?(Vo=null,go=setTimeout(()=>{Pe.value||No()},150)):a&&a===Vo&&ol(a);if(r&&r!==So){No(),So=r;let i=r.getAttribute("alt");i===null&&(i=r.alt||"");let u=r.getAttribute("data-alt");u===null&&(u=i),r.hasAttribute("alt")||r.setAttribute("alt",i),r.hasAttribute("data-alt")||r.setAttribute("data-alt",u),Ve.value=r,ot.value=i.trim()||F("textEditor.image.noAlt"),_t.value=!0,Rt.value=!0,xl(r)}else!r&&So?(So=null,Rn=setTimeout(()=>{Rt.value||Ho()},150)):r&&r===So&&xl(r)},$l=l=>{const o=l.relatedTarget;(!o||!o.closest(".dss-text-editor-content")&&!o.closest(".dss-link-popup"))&&(Vo=null,So=null,go&&(clearTimeout(go),go=null),Rn&&(clearTimeout(Rn),Rn=null),No(),Ho())},No=()=>{Pe.value=!1,setTimeout(()=>{Pe.value||(j.value=!1,_.value="",Le.value||(ye.value=null))},100)},ol=l=>{if(!l||!p.value)return;const o=l.getBoundingClientRect(),i=o.top-32-8,u=o.left+o.width/2;_e.value={position:"fixed",top:`${i}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},Ho=()=>{Rt.value=!1,setTimeout(()=>{Rt.value||(_t.value=!1,ot.value="",sn.value||(Ve.value=null))},100)},xl=l=>{if(!l||!p.value)return;const o=l.getBoundingClientRect(),i=o.top-32-8,u=o.left+o.width/2;tn.value={position:"fixed",top:`${i}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},Gn=()=>{if(!_.value||!ye.value)return;let o=ye.value.getAttribute("href")||_.value;!o.startsWith("http://")&&!o.startsWith("https://")&&!o.startsWith("mailto:")&&(o="https://"+o),window.open(o,"_blank","noopener,noreferrer")},ho=()=>{if(ye.value){const l=ye.value.textContent||"",o=ye.value.getAttribute("href")||"",a=ye.value;Ke.value=o,z.value=l,xt.value=l,Pe.value=!1,j.value=!1,_.value="",ye.value=a,Le.value=!0}else if(be.value){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const i=r.textContent||"",u=r.getAttribute("href")||"";Ke.value=u,z.value=i,xt.value=i,ye.value=r,Le.value=!0}}}else{Dt.value=ze();const l=window.getSelection();let o="";l.rangeCount>0&&(o=l.getRangeAt(0).toString()),Ke.value="",z.value=o,xt.value="",ye.value=null,Le.value=!0}e.nextTick(()=>{dt.value&&(dt.value.focus(),dt.value.select())})},In=()=>{Le.value=!1,Ke.value="",z.value="",xt.value="",ye.value=null,Dt.value=null},Mt=()=>{if(!Ke.value.trim()){In();return}if(Ue.value?(Te.value&&(clearTimeout(Te.value),Te.value=null),$e(),Ue.value=!1):$e(),z.value.trim()||(z.value=Ke.value.trim()),ye.value&&p.value&&p.value.contains(ye.value)){const l=window.getSelection();l.rangeCount>0&&l.removeAllRanges();const o=ye.value;if(o.setAttribute("href",Ke.value.trim()),z.value.trim()!==xt.value.trim()){for(;o.firstChild;)o.removeChild(o.firstChild);o.textContent=z.value.trim()}o.style.color="#60afdf",o.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(o),a.collapse(!1),l.removeAllRanges(),l.addRange(a),I()}else if(p.value){p.value.focus();const l=window.getSelection();l.removeAllRanges(),Dt.value&&jt(Dt.value);let o=null;if(l.rangeCount>0&&(o=l.getRangeAt(0)),o&&!o.collapsed){o.toString();const a=document.createElement("a");a.href=Ke.value.trim(),a.textContent=z.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",o.deleteContents(),o.insertNode(a);const r=document.createTextNode(" ");o.setStartAfter(a),o.insertNode(r),o.setStartAfter(r),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}else{o||(o=document.createRange(),o.selectNodeContents(p.value),o.collapse(!1));const a=o.startContainer,r=a.nodeType===3,i=r&&o.startOffset===a.textContent.length,u=document.createElement("a");if(u.href=Ke.value.trim(),u.textContent=z.value.trim(),u.style.color="#60afdf",u.style.textDecoration="underline",i){let d=a.parentElement;for(;d&&d!==p.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(d.tagName);)d=d.parentElement;if(d&&d!==p.value){let m=d.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(u);const v=document.createTextNode(" ");m.appendChild(v);const h=document.createRange();h.setStartAfter(u),h.collapse(!0),l.removeAllRanges(),l.addRange(h)}else{if(o.startOffset>0){const h=a.textContent.substring(0,o.startOffset),S=h[h.length-1];if(S&&S!==" "&&S!==" "&&S!==`
|
|
81
|
+
</svg>`,p=e.ref(null),ie=e.ref(null),be=e.ref(!1),ge=e.ref(!1),j=e.ref(!1),_=e.ref(""),_e=e.ref({}),Pe=e.ref(!1),Le=e.ref(!1),Ke=e.ref(""),z=e.ref(""),dt=e.ref(null),ut=e.ref(null),he=e.ref(null),Dt=e.ref(null),xt=e.ref(""),nt=e.ref(!1),Be=e.ref({}),te=e.ref(!1),pn=e.ref({}),rt=e.ref(null),Qe=e.ref(null),sn=e.ref(!1),Xt=e.ref(""),se=e.ref(null),xe=e.ref(""),J=e.ref(""),oe=e.ref(""),Ye=e.ref(null),ct=e.ref(null),Ze=e.ref(null),Ve=e.ref(null),Ot=e.ref(null),_t=e.ref(!1),ot=e.ref(""),tn=e.ref({}),Rt=e.ref(!1),ht=e.ref("upload"),Tt=e.ref(""),st=e.ref(null),nn=e.ref(null),tt=e.ref([]),yt=e.ref([]),Te=e.ref(null),Ue=e.ref(!1),O=e.ref(""),Z=e.ref(""),X=e.ref(""),Q=e.ref(""),ye=e.ref(""),et=e.ref(""),Se=e.ref(null),Oe=e.ref(null),mt=e.ref(null),Et=e.ref(!1),Nt=e.ref(null),$t=e.ref(!1),Ae=e.ref(!1),It=e.ref(null),gt=e.ref("p"),Sn=e.ref(!1),Wt=e.ref([]),Vt=e.ref(null),Bt=e.ref(null),_n=e.ref(null),Tn=e.ref(!1),rn=e.ref(0),cn=100,Yt=e.ref(null),dn=e.computed(()=>({"dss-text-editor-no-border":!k.border,"dss-text-editor-rounded":k.rounded,"dss-text-editor-full-height":k.fullHeight,"dss-comment-overlay-open":ln.value!==null})),On=e.computed(()=>({})),mo=e.computed(()=>!k.fixedHeight||k.fullHeight?{}:{height:`${1.6*14*k.rows+24+2}px`,resize:"none",overflowY:"auto"}),$=e.computed(()=>!k.fixedHeight||k.fullHeight?{}:{height:`${1.6*14*k.rows+32}px`,overflowY:"auto"}),P=e.computed(()=>k.richText&&yt.value.length>0),A=e.computed(()=>{if(!k.modelValue)return"";if(k.richText){let l=k.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return l=l.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),l=l.replace(/<[^>]+>/g,""),l=l.replace(/ /g," "),l=l.replace(/&/g,"&"),l=l.replace(/</g,"<"),l=l.replace(/>/g,">"),l=l.replace(/"/g,'"'),l=l.replace(/'/g,"'"),l=l.replace(/\s+/g," ").trim(),l}return k.modelValue}),G=e.computed(()=>{const l=A.value.trim();return l?l.split(/\s+/).filter(o=>o.length>0).length:0}),ke=e.computed(()=>A.value.length),We=e.computed(()=>Ve.value!==null&&ht.value==="upload"&&xe.value&&xe.value.startsWith("data:")),Xe=e.computed(()=>k.titlePlaceholder||F("textEditor.placeholders.title")),Ie=e.computed(()=>k.descriptionPlaceholder||F("textEditor.placeholders.description")),je=e.computed(()=>k.placeholder||F("textEditor.placeholders.startTyping")),St=l=>ne&&ne[l]!==void 0,$n=l=>{for(let o=l+1;o<k.customToolbarSlots.length;o++)if(St(k.customToolbarSlots[o]))return!0;return!1},xn=l=>{for(let o=l+1;o<k.customToolbarSlots.length;o++){const a=k.customToolbarSlots[o];if(St(a)&&on(a))return!0}return!1},on=l=>k.customToolbarFloatingMap.hasOwnProperty(l)?k.customToolbarFloatingMap[l]===!0:!0,to=e.computed(()=>k.customToolbarSlots.some(l=>St(l)&&on(l))),Ln=e.computed(()=>St("title-slot")),un=e.computed(()=>St("description-slot")),vn=l=>{if(!l||l.trim()==="")return"<html></html>";const o=l.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?l:`<html>${l}</html>`},Wn=l=>{if(!l||l.trim()==="")return"";const o=l.replace(/<!--[\s\S]*?-->/g,""),a=o.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():o},ko=l=>{if(!l)return;const o=document.createTreeWalker(l,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=o.nextNode();for(;r;)a.push(r),r=o.nextNode();a.forEach(i=>i.remove())},jo=l=>{try{const o=String(l.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][l.getMonth()],i=l.getFullYear();return`${o} ${r} ${i}`}catch{return""}},Co=l=>{if(!l||typeof l!="string")return!1;const o=l.trim();if(!o)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(o))return!0;try{const i=F("textEditor.started_conversation");if(i&&o===i)return!0}catch{}const r=o.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},bo=l=>{const o=l.target.value;Me("update:modelValue",o),Me("change",o)},yn=()=>{if(!Se.value)return;const l=Se.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const r=l.value;l.value="M";const i=l.scrollHeight;l.value=r,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},fn=()=>{$t.value=!0,yn()},Io=()=>{$t.value=!1,no()},no=()=>{if(!Se.value)return;const l=Se.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const o=l.value;l.value="M";const a=l.scrollHeight;l.value=o,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},Hn=l=>{const a=l.target.value;$t.value&&yn(),Me("update:title",a),Me("title-change",a),mt.value="title",k.richText&&(Ue.value||(Z.value=O.value,ye.value=X.value,et.value=Q.value),Te.value&&clearTimeout(Te.value),Ue.value=!0,Te.value=setTimeout(()=>{Ue.value=!1,$e()},500))},po=()=>{if(!Oe.value)return;const l=Oe.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const r=l.value;l.value="M";const i=l.scrollHeight;l.value=r,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},_o=()=>{Ae.value=!0,po()},kt=()=>{Ae.value=!1,ce()},ce=()=>{if(!Oe.value)return;const l=Oe.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const o=l.value;l.value="M";const a=l.scrollHeight;l.value=o,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},To=l=>{const a=l.target.value;Ae.value&&po(),Me("update:description",a),Me("description-change",a),mt.value="description",k.richText&&(Ue.value||(Z.value=O.value,ye.value=X.value,et.value=Q.value),Te.value&&clearTimeout(Te.value),Ue.value=!0,Te.value=setTimeout(()=>{Ue.value=!1,$e()},500))},ze=()=>{const l=window.getSelection();if(l.rangeCount===0)return null;const o=l.getRangeAt(0);if(o.startContainer.nodeType===1)return{type:"element",element:o.startContainer,offset:o.startOffset};const a=o.cloneRange();return a.selectNodeContents(p.value),a.setEnd(o.startContainer,o.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+o.toString().length}},jt=l=>{if(!(!l||!p.value))try{const o=window.getSelection(),a=document.createRange();if(l.type==="element"&&l.element)if(p.value.contains(l.element)){a.setStart(l.element,l.offset),a.collapse(!0),o.removeAllRanges(),o.addRange(a);return}else{p.value.focus();return}let r=0;const i=[p.value];let u=null,d=!1,m=!1;for(;!m&&(u=i.pop());)if(u.nodeType===3){const v=r+u.length;!d&&l.start>=r&&l.start<=v&&(a.setStart(u,l.start-r),d=!0),d&&l.end>=r&&l.end<=v&&(a.setEnd(u,l.end-r),m=!0),r=v}else{let v=u.childNodes.length;for(;v--;)i.push(u.childNodes[v])}o.removeAllRanges(),o.addRange(a)}catch{p.value.focus()}},He=()=>{if(!p.value)return;p.value.focus();const l=window.getSelection(),o=document.createRange(),a=i=>{if(i.nodeType===3||i.childNodes.length===0)return i;for(let u=i.childNodes.length-1;u>=0;u--){const d=i.childNodes[u],m=a(d);if(m)return m}return i},r=a(p.value);if(r.nodeType===3)o.setStart(r,r.length),o.setEnd(r,r.length);else if(r.childNodes.length>0){const i=a(r);i&&i.nodeType===3?(o.setStart(i,i.length),o.setEnd(i,i.length)):(o.selectNodeContents(r),o.collapse(!1))}else o.setStart(r,0),o.setEnd(r,0);l.removeAllRanges(),l.addRange(o)},$e=(l=!1)=>{if(!p.value)return;const o=p.value.innerHTML,a=k.title||"",r=k.description||"";if(!l&&o===O.value&&a===X.value&&r===Q.value)return;const i={content:Z.value||O.value,title:ye.value!==void 0?ye.value:X.value,description:et.value!==void 0?et.value:Q.value},u=tt.value.length>0?tt.value[tt.value.length-1]:null;let d=!0;u&&(typeof u=="string"?d=i.content!==u:d=i.content!==u.content||i.title!==u.title||i.description!==u.description),d&&(tt.value.push(i),tt.value.length>50&&tt.value.shift(),yt.value=[]),O.value=o,X.value=a,Q.value=r,Z.value=o,ye.value=a,et.value=r},I=l=>{if(!p.value)return;Ct(),p.value&&ko(p.value);let o=null;p.value&&(p.value.querySelector("p")||(o=ze(),de()));const a=l&&l.inputType&&(l.inputType==="insertText"||l.inputType==="insertCompositionText"||l.inputType==="deleteContentBackward"||l.inputType==="deleteContentForward");a&&It.value&&(It.value=null),ge.value=!0;const r=p.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),i=vn(r);Me("update:modelValue",i),Me("change",i),mt.value="editor",Ue.value||(Z.value=O.value,ye.value=X.value,et.value=Q.value),Te.value&&clearTimeout(Te.value),Ue.value=!0,Te.value=setTimeout(()=>{Ue.value=!1,$e(),ll(),Jt()},500),e.nextTick(()=>{o&&jt(o),Ct();const u=["bold","italic","underline"],d=window.getSelection(),m=d.rangeCount>0?d.getRangeAt(0):null,v=m&&m.collapsed;if(u.forEach(h=>{try{if(v&&It.value?.command===h){Be.value[h]=It.value.state;return}if(h==="bold")if(m){const S=m.commonAncestorContainer,N=S.nodeType===3?S.parentElement:S;let w=!1;if(N&&((N.tagName==="STRONG"||N.tagName==="B"||N.closest&&N.closest("strong, b"))&&(w=!0),!w&&N.style&&parseInt(N.style.fontWeight)>=600&&(w=!0),!w))try{const U=window.getComputedStyle(N);parseInt(U.fontWeight)>=600&&(w=!0)}catch{}Be.value[h]=w}else Be.value.hasOwnProperty(h)||(Be.value[h]=!1);else if(h==="italic")if(m){const S=m.commonAncestorContainer,N=S.nodeType===3?S.parentElement:S,w=N&&(N.tagName==="EM"||N.tagName==="I"||N.closest&&N.closest("em, i"));Be.value[h]=!!w}else{const S=document.queryCommandState(h);Be.value[h]=S}else{const S=document.queryCommandState(h);Be.value[h]=S}}catch{}}),kn(),Nn(),R(),Ft(),Zn(),Fn("handleRichTextInput"),a&&(l.inputType==="insertText"||l.inputType==="insertCompositionText")){const h=l.data||"";h&&h.length===1&&setTimeout(()=>Jt(h),0),(h===" "||h===`
|
|
82
|
+
`||/[.,;:!?]/.test(h))&&setTimeout(()=>{ll()},100)}ge.value=!1})},Ct=()=>{if(!p.value)return;const l=window.getSelection();if(!l||l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const i=r.closest(".dss-image-wrapper");if(i){const u=i.querySelector("img");if(r!==u&&!u?.contains(r)){const d=o.startContainer.nodeType===3?o.startContainer.parentElement:o.startContainer,m=o.endContainer.nodeType===3?o.endContainer.parentElement:o.endContainer;if(i.contains(d)&&d!==u||i.contains(m)&&m!==u){const v=document.createRange();v.setStartAfter(i),v.collapse(!0),l.removeAllRanges(),l.addRange(v)}}}},de=()=>{if(!p.value)return;const l=p.value;if(l.querySelector&&l.querySelector("p"))return;const o=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(l.childNodes);let r=null;a.forEach(i=>{if(i.nodeType===Node.TEXT_NODE){if((i.textContent||"").trim()===""){i.parentNode===l&&l.removeChild(i);return}r||(r=document.createElement("p"),l.insertBefore(r,i)),r.appendChild(i);return}if(i.nodeType===Node.ELEMENT_NODE){const u=i,d=u.tagName;if(d==="BR"){r=null;return}if(o.has(d)){r=null;return}r||(r=document.createElement("p"),l.insertBefore(r,u)),r.appendChild(u)}})},Nn=()=>{if(p.value&&!Et.value){Et.value=!0;try{p.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),p.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const i=r.parentElement;!i||!i.classList.contains("dss-image-wrapper")?r.remove():i.querySelector("img")||r.remove()}),p.value.querySelectorAll("img").forEach(r=>{let i=r.getAttribute("alt");i===null&&(i=r.alt||"");const u=r.getAttribute("src")||r.src||"";if(i){const h=u.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),S=i===u||i===h;(i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")||S||S)&&(i="")}r.setAttribute("alt",i),r.setAttribute("data-alt",i);const d=!i||i.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;h&&h.remove()}if(d){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=Fe,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{Et.value=!1}}},oo=l=>{ll(),Me("blur",l),Eo()},C=()=>{if(k.disabled||!k.richText||!p.value)return;bt(),Te.value&&(clearTimeout(Te.value),Te.value=null),Ue.value&&($e(),Ue.value=!1);const l=mt.value==="title",o=mt.value==="description",a=mt.value==="editor";if(tt.value.length===0){l&&Se.value?Se.value.focus():o&&Oe.value?Oe.value.focus():p.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{I()});return}const r={content:p.value.innerHTML,title:k.title||"",description:k.description||""};yt.value.push(r);const i=tt.value.pop();if(i!==void 0){ge.value=!0;const u=typeof i=="string"?i:i.content,d=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";p.value.innerHTML=u,O.value=u,X.value=d,Q.value=m,Z.value=u,ye.value=d,et.value=m,e.nextTick(()=>{kn(),gn(),Dn(),Ft();const v=vn(u);Me("update:modelValue",v),Me("update:title",d),Me("update:description",m),Me("change",v),Me("title-change",d),Me("description-change",m),ge.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(Se.value){Se.value.focus();const h=d.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(h,h),yn()}}else if(o){if(Oe.value){Oe.value.focus();const h=m.length;Oe.value.setSelectionRange(h,h)}}else if(a)He();else if(Se.value&&document.activeElement===Se.value){const h=d.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(h,h),yn()}else if(Oe.value&&document.activeElement===Oe.value){const h=m.length;Oe.value.setSelectionRange(h,h)}else p.value&&He()},10)})})}},y=()=>{if(k.disabled||!k.richText||!p.value)return;bt();const l=mt.value==="title",o=mt.value==="description",a=mt.value==="editor";if(yt.value.length===0){l&&Se.value?Se.value.focus():o&&Oe.value?Oe.value.focus():p.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{I()});return}const r={content:p.value.innerHTML,title:k.title||"",description:k.description||""};tt.value.push(r);const i=yt.value.pop();if(i!==void 0){ge.value=!0;const u=typeof i=="string"?i:i.content,d=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";p.value.innerHTML=u,O.value=u,X.value=d,Q.value=m,Z.value=u,ye.value=d,et.value=m,e.nextTick(()=>{kn(),gn(),Dn(),Ft();const v=vn(u);Me("update:modelValue",v),Me("update:title",d),Me("update:description",m),Me("change",v),Me("title-change",d),Me("description-change",m),ge.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(Se.value){Se.value.focus();const h=d.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(h,h),yn()}}else if(o){if(Oe.value){Oe.value.focus();const h=m.length;Oe.value.setSelectionRange(h,h)}}else if(a)He();else if(Se.value&&document.activeElement===Se.value){const h=d.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(h,h),yn()}else if(Oe.value&&document.activeElement===Oe.value){const h=m.length;Oe.value.setSelectionRange(h,h)}else p.value&&He()},10)})})}},V=()=>{if(!p.value)return;p.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const i=r.style.fontWeight;if(i==="normal"||i==="400"){const u=document.createDocumentFragment();for(;r.firstChild;)u.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(u,r)}}),p.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const u=document.createElement("b");for(u.style.fontWeight="600";r.firstChild;)u.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(u,r)}}),p.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},R=()=>{if(!p.value)return;p.value.querySelectorAll("i, em").forEach(o=>{o.style.fontStyle="italic"})},ue=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const o=l.getRangeAt(0);let a=!1;if(o.collapsed){const r=o.startContainer;let i=r.nodeType===3?r.parentElement:r;for(;i&&i!==p.value;){if(i.tagName==="EM"||i.tagName==="I"){a=!0;break}if(i.style&&i.style.fontStyle==="italic"){a=!0;break}i=i.parentElement}}else{const r=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(r){const i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=i.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==p.value;){if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{R()}),!1;if(o.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{R()});else try{const r=o.extractContents(),i=document.createElement("em");i.style.fontStyle="italic",i.appendChild(r),o.insertNode(i),o.setStartAfter(i),o.collapse(!0),l.removeAllRanges(),l.addRange(o),e.nextTick(()=>{R()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{R()})}return!0},qe=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const o=l.getRangeAt(0);let a=!1;if(o.collapsed){const r=o.startContainer;let i=r.nodeType===3?r.parentElement:r;for(;i&&i!==p.value;){if(i.tagName==="STRONG"||i.tagName==="B"){a=!0;break}if(i.style&&parseInt(i.style.fontWeight)>=600){a=!0;break}i=i.parentElement}}else{const r=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(r){const i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=i.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==p.value;){if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{V()}),!1;if(o.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0),u=i.startContainer;let d=u.nodeType===3?u.parentElement:u;for(;d&&d!==p.value;){if(d.tagName==="SPAN"&&d.style.fontWeight){const m=d.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const h=document.createDocumentFragment();for(;d.firstChild;)h.appendChild(d.firstChild);v.appendChild(h),d.parentNode&&d.parentNode.replaceChild(v,d),i.setStart(v,0),i.collapse(!0),r.removeAllRanges(),r.addRange(i);break}}else if(d.tagName==="STRONG"||d.tagName==="B"){d.style.fontWeight="600";break}d=d.parentElement}if(!d||d===p.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",i.insertNode(m),i.setStart(m,0),i.collapse(!0),r.removeAllRanges(),r.addRange(i)}}V()});else try{const r=o.extractContents(),i=document.createElement("b");i.style.fontWeight="600",i.appendChild(r),o.insertNode(i),o.setStartAfter(i),o.collapse(!0),l.removeAllRanges(),l.addRange(o),e.nextTick(()=>{V()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{V()})}return!0},De=(l,o=null)=>{if(k.disabled||!k.richText||!p.value)return;Ue.value?(Te.value&&(clearTimeout(Te.value),Te.value=null),$e(),Ue.value=!1):$e(),bt(),p.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const u=a.getRangeAt(0);!u.collapsed&&fo(u)&&(r=ze())}if(l==="createLink"&&o){const u=window.getSelection();if(u.rangeCount>0){const d=u.getRangeAt(0);if(d.collapsed)try{d.expand("word")}catch{const v=document.createTextNode(o);d.insertNode(v),d.selectNodeContents(v)}}}if(l==="bold"){const u=qe();Be.value.bold=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(It.value={command:"bold",state:u}),e.nextTick(()=>{r&&(jt(r),e.nextTick(()=>{const m=pt("bold");Be.value.bold=m})),I(),gn(),Ft()});return}if(l==="italic"){const u=ue();Be.value.italic=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(It.value={command:"italic",state:u}),e.nextTick(()=>{r&&(jt(r),e.nextTick(()=>{const m=pt("italic");Be.value.italic=m})),I(),R(),gn(),Ft()});return}let i=!1;try{i=document.execCommand(l,!1,o)}catch{}e.nextTick(()=>{if(r&&jt(r),["bold","italic","underline"].includes(l))try{if(l==="bold")r&&e.nextTick(()=>{const d=pt("bold");Be.value.bold=d});else if(l==="italic")if(r)e.nextTick(()=>{const d=pt("italic");Be.value.italic=d});else{const d=document.queryCommandState(l);Be.value[l]=d}else{const d=document.queryCommandState(l);Be.value[l]=d}}catch{Be.value.hasOwnProperty(l)?Be.value[l]=!Be.value[l]:Be.value[l]=!0}if(l==="createLink"&&o){const d=window.getSelection();if(d.rangeCount>0){const v=d.getRangeAt(0),h=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",o)}p.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",o)})}I(),gn(),Ft()})},pt=(l,o=null)=>{if(k.disabled||!p.value)return!1;try{if(l==="formatBlock"&&o){const r=document.queryCommandValue("formatBlock");if(o==="<blockquote>"){const i=r.toLowerCase();if(i==="blockquote"||i==="<blockquote>")return!0;const u=window.getSelection();if(u.rangeCount>0){const m=u.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===o||r.toLowerCase()===o.toLowerCase()}if(["bold","italic","underline"].includes(l))try{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0);if(l==="bold"){let d=!1;if(i.collapsed){const m=i.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(d=!0),!d&&v.style&&parseInt(v.style.fontWeight)>=600&&(d=!0),!d))try{const h=window.getComputedStyle(v);parseInt(h.fontWeight)>=600&&(d=!0)}catch{}return Be.value.hasOwnProperty(l)?Be.value[l]:(Be.value[l]=d,d)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let S;for(;S=h.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(S))){if(S.nodeType===3){if(!(S.textContent||"").trim())continue;v=!0;let w=S.parentElement;for(;w&&w!==p.value;){if(w.tagName==="STRONG"||w.tagName==="B"){d=!0;break}if(w.style&&parseInt(w.style.fontWeight)>=600){d=!0;break}w=w.parentElement}}else if(S.nodeType===1){const N=S;if(N.tagName==="STRONG"||N.tagName==="B"){d=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){d=!0;break}}if(d)break}}return Be.value[l]=d&&v,d&&v}}if(l==="italic"){let d=!1;if(i.collapsed){const m=i.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(d=!0),!d&&v.style&&v.style.fontStyle==="italic"&&(d=!0),!d))try{window.getComputedStyle(v).fontStyle==="italic"&&(d=!0)}catch{}return Be.value.hasOwnProperty(l)?Be.value[l]:(Be.value[l]=d,d)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let S;for(;S=h.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(S))){if(S.nodeType===3){if(!(S.textContent||"").trim())continue;v=!0;let w=S.parentElement;for(;w&&w!==p.value;){if(w.tagName==="EM"||w.tagName==="I"){d=!0;break}if(w.style&&w.style.fontStyle==="italic"){d=!0;break}w=w.parentElement}}else if(S.nodeType===1){const N=S;if(N.tagName==="EM"||N.tagName==="I"){d=!0;break}if(N.style&&N.style.fontStyle==="italic"){d=!0;break}}if(d)break}}return Be.value[l]=d&&v,d&&v}}const u=document.queryCommandState(l);return i.collapsed&&Be.value.hasOwnProperty(l)?Be.value[l]:(Be.value[l]=u,u)}return Be.value.hasOwnProperty(l)?Be.value[l]:!1}catch{return Be.value.hasOwnProperty(l)?Be.value[l]:!1}try{return document.queryCommandState(l)}catch{return!1}}catch{return!1}},lo=l=>{k.disabled||!k.richText||(ie.value=ie.value===l?null:l,l==="askAi"&&(Qe.value=null))},bt=()=>{ie.value=null,st.value=null},An=l=>{De("formatBlock",l),bt()},Fo=l=>{if(!l||!p.value)return l;const o=Ce=>{let le=Ce.nodeType===Node.TEXT_NODE?Ce.parentElement:Ce;for(;le&&le!==p.value;){const Ge=le.tagName;if(Ge==="P"){const en=le.parentElement;if(en===p.value||en.tagName==="BLOCKQUOTE")return le}if(Ge==="BLOCKQUOTE")break;le=le.parentElement}return null},a=o(l.startContainer),r=o(l.endContainer);if(!a||!r)return l;const i=[],u=document.createTreeWalker(p.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Ce=>{const le=Ce.tagName;if(le==="P"){const Ge=Ce.parentElement;if(Ge===p.value||Ge.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return le==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let d;for(;d=u.nextNode();)i.push(d);const m=i.indexOf(a),v=i.indexOf(r);if(m===-1||v===-1)return l;const h=Math.min(m,v),S=Math.max(m,v),N=i.slice(h,S+1);if(N.length===0)return l;const w=N[0],U=N[N.length-1],W=document.createRange();return W.setStartBefore(w),W.setEndAfter(U),W},pl=()=>{if(k.disabled||!k.richText||!p.value)return;Ue.value?(Te.value&&(clearTimeout(Te.value),Te.value=null),$e(),Ue.value=!1):$e(),bt(),p.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;let o=l.getRangeAt(0);!o.collapsed&&fo(o)&&(o=Fo(o),l.removeAllRanges(),l.addRange(o));let a=null;!o.collapsed&&fo(o)&&(a=ze());const r=o.commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&p.value.contains(i))){if(i){const d=i.parentNode;Array.from(i.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")d.insertBefore(v,i);else{const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),d.insertBefore(h,i)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),d.insertBefore(h,i)}}),i.remove()}}else if(o.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const d=document.createElement("blockquote"),m=o.extractContents();d.appendChild(m),o.insertNode(d);const v=[],h=document.createTreeWalker(d,NodeFilter.SHOW_TEXT,{acceptNode:w=>w.parentNode===d&&w.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let S;for(;S=h.nextNode();)v.push(S);if(v.forEach(w=>{const U=document.createElement("p");w.parentNode.insertBefore(U,w),U.appendChild(w)}),d.querySelectorAll("p, div").forEach(w=>{w.textContent.trim()===""&&!w.querySelector("img")&&(w.innerHTML="<br>")}),d.children.length===0&&d.textContent.trim()===""){const w=document.createElement("p");w.innerHTML="<br>",d.appendChild(w)}}e.nextTick(()=>{a&&jt(a),Dn(),I(),Ft()})},vl=()=>{if(!p.value)return;const l=window.getSelection();if(l.rangeCount===0)return;const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!p.value.contains(r))return;const i=S=>{if(!S)return!1;const N=S.textContent||"",U=(S.innerHTML||"").trim();return N.trim()===""||U===""||U==="<br>"||U==="<br/>"||U==="<p></p>"||U==="<p><br></p>"||U==="<p><br/></p>"||U==="<p> </p>"||U==="<p><br> </p>"||U==="<div></div>"||U==="<div><br></div>"||U==="<div><br/></div>"};let u=null;for(a.nodeType===3?u=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?u=a:u=a.closest("p, div"),u&&r.contains(u)&&i(u)&&u.remove();r.lastChild;){const S=r.lastChild;if(S.nodeType===1&&S.tagName==="BR")S.remove();else if(S.nodeType===3)if((S.textContent||"").trim()==="")S.remove();else break;else break}if(r.children.length>0)for(let S=r.children.length-1;S>=0;S--){const N=r.children[S];if((N.tagName==="P"||N.tagName==="DIV")&&i(N))N.remove();else break}let d=r.innerHTML;const m=d;d=d.replace(/(<br\s*\/?>)+$/gi,""),d!==m&&(r.innerHTML=d);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):p.value&&p.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),l.removeAllRanges(),l.addRange(h),e.nextTick(()=>{Dn(),I()})},gn=()=>{if(!p.value){be.value=!1;return}try{const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");be.value=!!r}else be.value=!1}catch{be.value=!1}},fl=()=>{if(!p.value)return;const l=window.getSelection();l&&l.rangeCount>0&&l.getRangeAt(0),Dt.value=ze();const o=window.getSelection();let a="";o.rangeCount>0&&(a=o.getRangeAt(0).toString()),Ke.value="",z.value=a,xt.value="",he.value=null,Le.value=!0,bt(),e.nextTick(()=>{dt.value&&dt.value.focus()})},ao=()=>{if(!p.value)return;Ue.value?(Te.value&&(clearTimeout(Te.value),Te.value=null),$e(),Ue.value=!1):$e();const l=window.getSelection();let o=null;if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!o&&he.value&&(o=he.value),o&&o.parentNode){const a=document.createDocumentFragment();for(;o.firstChild;)a.appendChild(o.firstChild);if(o.parentNode.replaceChild(a,o),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),l.removeAllRanges(),l.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),l.removeAllRanges(),l.addRange(r)}he.value=null}else De("unlink");be.value=!1,bt(),e.nextTick(()=>{I(),gn()})},gl=()=>{k.disabled||!k.richText||p.value&&(Ue.value?(Te.value&&(clearTimeout(Te.value),Te.value=null),$e(),Ue.value=!1):$e(),bt(),p.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{kn(),I(),Ft()}))},hl=()=>{k.disabled||!k.richText||p.value&&(Ue.value?(Te.value&&(clearTimeout(Te.value),Te.value=null),$e(),Ue.value=!1):$e(),bt(),p.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{kn(),I(),Ft()}))},yl=l=>{const o=l.parentElement;if(!o||o.tagName!=="OL")return null;let a=0,r=l.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},kn=()=>{if(!p.value)return;p.value.querySelectorAll("li > ol").forEach(o=>{const a=o.parentElement;if(a&&a.tagName==="LI"){const r=yl(a);r!==null&&Array.from(o.children).filter(u=>u.tagName==="LI").forEach(u=>{u.setAttribute("data-parent-num",String(r))})}})},kl=()=>{if(k.disabled||!k.richText||!p.value)return;bt(),p.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{kn(),I()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const i=a.previousElementSibling;if(i&&i.tagName==="LI"){const u=r.tagName.toLowerCase();let d=i.querySelector(`:scope > ${u}`);d||(d=document.createElement(u),i.appendChild(d));const m=yl(i);d.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),kn();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),l.removeAllRanges(),l.addRange(v),e.nextTick(()=>{I(),Ft()})}else document.execCommand("indent",!1),e.nextTick(()=>{kn(),I(),Ft()})},zo=()=>{if(k.disabled||!k.richText||!p.value)return;bt(),p.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{kn(),I()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const i=r.parentElement;if(i&&i.tagName==="LI"){const u=i.parentElement;if(u&&(u.tagName==="OL"||u.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),u.insertBefore(a,i.nextSibling),r.children.length===0&&r.remove(),kn();const d=document.createRange();d.selectNodeContents(a),d.collapse(!1),l.removeAllRanges(),l.addRange(d),e.nextTick(()=>{I(),Ft()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{kn(),I(),Ft()})},ln=e.ref(null),Cn=e.ref(null),wo=e.ref({}),Xn=e.ref(""),Yn=e.ref(null),so=e.ref("");e.ref("");const ro=e.ref(null);e.ref("");const En=e.ref([]),Ko=e.ref(!1),xo=e.ref(!1),Go=l=>{if(!l)return"";const o=l.cloneRange(),a=document.createElement("div");return a.appendChild(o.cloneContents()),a.innerHTML},Qo=()=>{if(k.disabled||!k.richText||!p.value)return;if(ln.value!==null){ln.value=null,Xn.value="",so.value="",ro.value=null,En.value=[],Qn(!0);return}bt(),p.value.focus();const l=window.getSelection();if(!l||l.rangeCount===0)return;const o=l.getRangeAt(0);if(o.collapsed||!fo(o))return;so.value=Go(o)||"",ro.value=ze();const a=o.getBoundingClientRect(),r=p.value.parentElement;if(!r)return;const i=r.getBoundingClientRect(),u=a.bottom-i.top,m=Math.max(u+8,0);wo.value={top:`${m}px`,bottom:"auto"},ln.value=Date.now(),e.nextTick(()=>{if(Xn.value="",Yn.value){const h=Yn.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const h=r.querySelector(".dss-text-editor-footer");if(h){const S=r.getBoundingClientRect(),N=v.getBoundingClientRect(),w=h.getBoundingClientRect(),U=N.bottom-S.top,W=w.top-S.top,Ce=8;if(U>W-Ce){const le=w.height;wo.value={bottom:`${le+Ce}px`,top:"auto"}}else wo.value={top:`${m}px`,bottom:"auto"}}}})},Cl=()=>{if(!Xn.value.trim())return;const l=Xn.value.trim(),o=new Date,a={text:l,selectionText:so.value,selectionRange:ro.value,commentId:ln.value,user:k.commentUser||null,createdAt:o.toISOString()};En.value=[...En.value,a],Me("comment-submitted",a),bn(a),ro.value&&!Jo(ro.value)&&el(ln.value,ro.value),Xn.value="",e.nextTick(()=>{if(Yn.value){const r=Yn.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Fn("sendComment")})},Tl=(l,o)=>{if(!(!k.commentUser||!l.user||l.user.id!==k.commentUser.id)){if(En.value=En.value.filter((a,r)=>r!==o),ln.value!==null&&p.value){const a=String(ln.value),r=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&En.value.length>0){const i=[],u=new Set;En.value.forEach(d=>{d.user&&d.user.id&&!u.has(d.user.id)&&(u.add(d.user.id),i.push(d.user))}),i.length>0?r.setAttribute("data-comment-user",JSON.stringify(i[0])):r.removeAttribute("data-comment-user"),i.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(i[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(En.value.length))}else r&&En.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Me("comment-deleted",{comment:l,index:o,commentId:ln.value}),k.comments&&Array.isArray(k.comments)){const a=k.comments.filter(r=>!(r.commentId===l.commentId&&r.text===l.text&&r.user?.id===l.user?.id));Me("update:comments",a)}e.nextTick(()=>{Fn("deleteComment")})}},Jo=l=>{if(!l||!p.value)return!1;try{const o=bl(l);if(!o)return!1;const a=o.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},bl=l=>{if(!l||!p.value)return null;try{const o=document.createRange();if(l.type==="element"&&l.element)return p.value.contains(l.element)?(o.setStart(l.element,l.offset),o.collapse(!0),o):null;let a=0;const r=[p.value];let i=null,u=!1,d=!1;for(;!d&&(i=r.pop());)if(i.nodeType===3){const m=a+i.length;!u&&l.start>=a&&l.start<=m&&(o.setStart(i,l.start-a),u=!0),u&&l.end>=a&&l.end<=m&&(o.setEnd(i,l.end-a),d=!0),a=m}else{let m=i.childNodes.length;for(;m--;)r.push(i.childNodes[m])}return u?o:null}catch{return null}},el=(l,o)=>{if(!(!l||!o||!p.value))try{const a=bl(o);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i){const m=i.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(l)&&m.getAttribute("data-fake-comment")!==String(l)&&m.setAttribute("data-comment",String(l));return}}const u=document.createElement("span");u.setAttribute("data-comment",String(l));try{const m=a.startContainer,v=a.endContainer,h=a.startOffset,S=a.endOffset,N=m.nodeType===3?m.parentNode:m,w=v.nodeType===3?v.parentNode:v;if(N===w&&h===0&&S===(v.nodeType===3?v.length:w.childNodes.length)&&(N.tagName==="P"||N.tagName==="DIV"||N.tagName==="H1"||N.tagName==="H2"||N.tagName==="H3"||N.tagName==="H4"||N.tagName==="H5"||N.tagName==="H6")){const W=a.extractContents();u.appendChild(W),a.insertNode(u)}else a.surroundContents(u)}catch{const v=a.extractContents();u.appendChild(v),a.insertNode(u)}const d=p.value.querySelector(`[data-comment="${String(l)}"]`);e.nextTick(()=>{Fn("wrapSelectionWithCommentMarker"),I()})}catch{}},bn=l=>{if(!l||!l.commentId)return;const o=Array.isArray(k.comments)?[...k.comments]:[],a=typeof l.commentId=="string"&&l.commentId.startsWith("comment-")?Date.now():Number(l.commentId)||l.commentId;let r=o.findIndex(u=>typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)===Number(a)||u.conversation_id===a);const i={text:l.text,user:l.user,createdAt:l.createdAt,created_at:l.createdAt,updated_at:l.createdAt};if(r>=0){const u=o[r];if(u.conversation||(u.conversation=[]),u.conversation.push(i),u.updated_at=l.createdAt,!u.article_id&&o.length>0){const d=o.find(m=>m.article_id);d&&(u.article_id=d.article_id)}}else{const u=l.selectionRange,d=o.length>0&&o.find(v=>v.article_id)?.article_id||null,m={conversation_id:a,article_id:d,selection_range:u?{start:u.start||0,end:u.end||0,type:u.type||"text"}:null,selection_text:l.selectionText||"",conversation:[i],created_by_user:l.user,created_at:l.createdAt,updated_at:l.createdAt,status:"active"};o.push(m)}Ko.value=!0,Me("update:comments",o)},H=(l,o=[])=>{if(k.disabled||!k.richText||!p.value)return;const a=p.value;let r=null;try{r=a.querySelector(l)}catch{return}if(!r)return;bt(),a.focus();const i=document.createRange();i.selectNodeContents(r);const u=window.getSelection();u&&(u.removeAllRanges(),u.addRange(i)),so.value=r.innerHTML||"",ro.value=ze();const d=i.getBoundingClientRect(),m=a.parentElement;if(m){const S=m.getBoundingClientRect(),N=d.bottom-S.top,U=Math.max(N+8,0);wo.value={top:`${U}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(v&&k.comments&&Array.isArray(k.comments)){const S=k.comments.find(N=>String(N.conversation_id)===String(v));if(S&&S.conversation&&Array.isArray(S.conversation)){const N=S.conversation.map(w=>({id:w.id||w.commentary_id,commentary_id:w.id||w.commentary_id,conversation_id:S.id||S.conversation_id,text:w.text,user:w.user,createdAt:w.created_at||w.createdAt,updated_at:w.updated_at||w.updatedAt}));h.push(...N)}}h.length===0&&Array.isArray(o)&&o.length>0&&(h=o.slice()),h.sort((S,N)=>{const w=Ce=>{if(!Ce)return 0;const le=new Date(Ce).getTime();return isNaN(le)?0:le},U=w(S.createdAt),W=w(N.createdAt);return U===W?0:U-W}),En.value=h,Qn(!0),ln.value=v||null,r&&(Cn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Xn.value="",Yn.value){const S=Yn.value;S.style.height="auto",S.style.height=`${S.scrollHeight}px`,S.focus()}if(m){const S=m.querySelector(".dss-comment-overlay");if(S){const N=m.querySelector(".dss-text-editor-footer");if(N){const w=m.getBoundingClientRect(),U=S.getBoundingClientRect(),W=N.getBoundingClientRect(),Ce=U.bottom-w.top,le=W.top-w.top,Ge=8;if(Ce>le-Ge){const en=W.height;wo.value={bottom:`${en+Ge}px`,top:"auto"}}}}}Fn("openCommentOverlayForSelector")})},Qt=e.ref(null),Bn=e.ref(0),mn=l=>{if(!(k.disabled||!k.richText)){if(l.key==="Escape"){const o=window.getSelection();if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&p.value&&p.value.contains(i))){l.preventDefault();let d=null;r.nodeType===3?d=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?d=r:d=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",d&&i.contains(d)&&d.nextSibling?i.insertBefore(m,d.nextSibling):i.appendChild(m),setTimeout(()=>{vl()},50);return}}}if(l.key.length===1||l.key==="Enter"){const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0),r=a.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i){const u=i.closest(".dss-image-wrapper");if(u){const d=u.querySelector("img");if(i!==d&&!d?.contains(i)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,v=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.contains(m)&&m!==d||u.contains(v)&&v!==d){l.preventDefault();const h=document.createRange();h.setStartAfter(u),h.collapse(!0),o.removeAllRanges(),o.addRange(h);return}}}}}}if(l.key==="Backspace"||l.key==="Delete"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);let r=null,i=null;if(a.collapsed)if(l.key==="Backspace"){const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===0?d=u.previousSibling||u.parentNode:d=u.parentNode);const m=d.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(r=m,i=r.closest(".dss-image-wrapper"))),i||(i=d.closest(".dss-image-wrapper"),i&&(r=i.querySelector("img")))}else{const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===u.length?d=u.nextSibling||u.parentNode:d=u.parentNode);const m=d.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(r=m,i=r.closest(".dss-image-wrapper"))),i||(i=d.closest(".dss-image-wrapper"),i&&(r=i.querySelector("img")))}else{const u=a.commonAncestorContainer,d=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.nodeType===1&&u.tagName==="IMG"?(r=u,i=r.closest(".dss-image-wrapper")):(r=u.querySelector("img"),r&&(i=r.closest(".dss-image-wrapper"))),i){const v=i.contains(d)||d===i,h=i.contains(m)||m===i,N=a.cloneContents().textContent?.trim()||"",w=i.textContent?.trim()||"";(!v||!h||N.length>w.length)&&(i=null,r=null)}}if(i){l.preventDefault(),l.stopPropagation();const u=i.parentNode;if(u){const d=document.createTextNode("");u.insertBefore(d,i),i.remove();const m=document.createRange();m.setStartAfter(d),m.collapse(!0),o.removeAllRanges(),o.addRange(m),e.nextTick(()=>{I()});return}}}}if(l.key==="Tab"){l.preventDefault(),l.shiftKey?zo():kl();return}if(l.key==="Enter"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);if(a.collapsed){const d=a.startContainer,m=v=>{if(!v)return!1;let h=v.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const S=v.parentElement;return S&&S!==p.value?m(S):!1};if(d.nodeType===3){const v=d.parentElement;if(v&&(m(v)||m(d))){const h=v.closest("p, div");if(h&&h!==p.value){l.preventDefault(),l.stopPropagation();let S=null;const N=a.startOffset;N<d.length&&(S=d.splitText(N));const w=document.createElement("p");if(S?w.appendChild(S):w.innerHTML="<br>",d.length===0){const W=d.parentElement;W&&(W.removeChild(d),W.childNodes.length===0&&W.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(w,h.nextSibling):h.parentNode.appendChild(w);const U=document.createRange();S?U.setStart(S,0):U.setStart(w,0),U.collapse(!0),o.removeAllRanges(),o.addRange(U),e.nextTick(()=>{I()});return}}}}const r=a.commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&p.value&&p.value.contains(i))){let d=null;r.nodeType===3?d=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?d=r:d=r.closest("p, div");const m=W=>{if(!W)return!1;const Ce=W.textContent||"",Ge=(W.innerHTML||"").trim(),en=Ge.replace(/<br\s*\/?>/gi,"").trim();return Ce.trim()===""||Ge===""||en===""||Ge==="<br>"||Ge==="<br/>"||Ge==="<p></p>"||Ge==="<p><br></p>"||Ge==="<p><br/></p>"||Ge==="<p> </p>"||Ge==="<p><br> </p>"||Ge==="<div></div>"||Ge==="<div><br></div>"||Ge==="<div><br/></div>"},v=i.lastChild,h=v&&v.nodeType===1&&v.tagName==="BR",S=a.startContainer,N=S.nodeType===3?S.parentElement:S,w=N===i||N&&N.parentElement===i;if(d&&m(d)||h&&w){l.preventDefault(),setTimeout(()=>{vl()},50);return}}}}if(l.key===" "){const o=Date.now(),a=o-Bn.value;if(Qt.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0),u=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer.closest("li"):i.commonAncestorContainer.parentElement?.closest("li");if(u){const d=i.startContainer.textContent?.substring(0,i.startOffset)||"";if((u.textContent||"").indexOf(d.trim())<=10||d.trim().length<=2){l.preventDefault(),kl();return}}}}Qt.value=" ",Bn.value=o}else Qt.value=l.key}},jn=l=>{if(k.disabled||!k.richText)return;l.preventDefault();let o=l.clipboardData.getData("text/html"),a=l.clipboardData.getData("text/plain");o&&(o=o.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),$e();const r=window.getSelection();let i=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),i=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const u=d=>{const v=new DOMParser().parseFromString(d,"text/html");let h=p.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(N=>{if(h>0){const w=v.createElement("p");w.innerHTML=N.innerHTML,N.parentNode.replaceChild(w,N)}else h++}),i){const N=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],w=Array.from(v.body.children).filter(U=>N.includes(U.tagName));if(w.length===1){const U=w[0].tagName,W=i.tagName,Ce=i.textContent.trim()===""&&!i.querySelector("img");let le=!1;if(["H1","H2","H3","H4","H5","H6"].includes(W)?le=!0:Ce||(U===W||U==="P")&&(le=!0),le)return w[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(o){const d=u(o);document.execCommand("insertHTML",!1,d)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=u(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);I()},Lt=l=>{if(ie.value){const a=l.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&bt()}if(te.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),i=p.value&&a.closest(".dss-text-editor-content");!r&&!i&&Eo()}if(Qe.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),i=a.closest(".dss-toolbar-dropdown");!r&&!i&&nl()}const o=l.target;if(!o.closest(".dss-toolbar-dropdown")&&!o.closest(".dss-toolbar-dropdown-submenu")&&(st.value=null),!p.value||!o.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);Sn.value=!r.collapsed&&fo(r)}else Sn.value=!1}if(ln.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const d=a.getBoundingClientRect(),m=l.clientX,v=l.clientY;r=m>=d.left&&m<=d.right&&v>=d.top&&v<=d.bottom}const i=o.closest(".dss-toolbar-button"),u=i&&i.getAttribute("title")==="Comment";!r&&!u&&(ln.value=null,Xn.value="",so.value="",ro.value=null,En.value=[],Qn(!0))}},Kt=(l,o)=>{l&&l.stopPropagation&&l.stopPropagation(),nn.value&&(clearTimeout(nn.value),nn.value=null),st.value=o},Kn=l=>{const o=l.relatedTarget;if(o){const a=o.closest(".dss-toolbar-dropdown-submenu"),r=o.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}nn.value&&clearTimeout(nn.value),nn.value=setTimeout(()=>{st.value=null,nn.value=null},150)},vo=l=>{st.value=null};let vt=0;const ft=l=>{if(!l)return;const o=Array.from(l.children);o.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),o.forEach((a,r)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const i=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),u=a.nextElementSibling,d=u&&!u.classList.contains("dss-toolbar-dropdown-submenu")&&!u.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&u.tagName==="DIV"&&!u.classList.contains("dss-toolbar-dropdown-item")&&Array.from(u.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(i||d){const m=`submenu-auto-${++vt}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let v=null;i?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(i,a.nextSibling),i.classList.add("dss-toolbar-dropdown-submenu"),v=i):d&&(u.classList.add("dss-toolbar-dropdown-submenu"),v=u),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),i&&a.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(S=>{(S.tagName==="BUTTON"||S.tagName==="DIV")&&!S.classList.contains("dss-toolbar-dropdown-item")&&S.classList.add("dss-toolbar-dropdown-item")}))}})},Je=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(o=>{ft(o),o.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(i=>{const u=i._subMenuHandlers;u&&(i.removeEventListener("mouseenter",u.enter),i.removeEventListener("mouseleave",u.leave));const d=v=>{const h=i.getAttribute("data-submenu-id");h&&Kt(v,h)},m=Kn;i.addEventListener("mouseenter",d),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:d,leave:m}}),o.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(i=>{const u=i._subMenuHandlers;u&&(i.removeEventListener("mouseenter",u.enter),i.removeEventListener("mouseleave",u.leave));const d=h=>{const S=i.getAttribute("data-submenu-id");S&&Kt(h,S)},m=Kn;i.addEventListener("mouseenter",d),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:d,leave:m},i.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",vo)})})})};let wt=null;const Po=()=>{if(st.value){const l=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${st.value}"]`),o=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${st.value}"]`);l&&o&&Ml(l,o)}if(te.value&&Ft(),k.richText){if(wt!==null)return;wt=setTimeout(()=>{wt=null,Fn("handleWindowResize")},150)}},$o=()=>{if(!k.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(o=>{Array.from(o.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},Lo=()=>{const l=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),o=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};l.forEach(a=>{a.addEventListener("selectstart",o),a.addEventListener("mousedown",o),a.addEventListener("dragstart",o),a.addEventListener("contextmenu",o),a.addEventListener("click",r=>{if(window.getSelection){const i=window.getSelection();i.removeAllRanges&&i.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{$t.value?yn():no(),Ae.value?po():ce()})}),e.nextTick(()=>{Lo()}),k.richText&&p.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Lt),window.addEventListener("resize",Po);let l=null;const o=()=>{l===null&&(l=setTimeout(()=>{l=null,Po()},150))};window.addEventListener("scroll",o,!0),p.value._windowScrollHandler=o,p.value._windowScrollTimeout=l,p.value.closest(".editor-with-comments"),p.value.closest(".dss-text-editor-content-wrapper");const a=p.value.closest(".dss-text-editor-content");let r=null;const i=()=>{r===null&&(r=setTimeout(()=>{r=null,Po()},150))};a&&(a.addEventListener("scroll",i),p.value._scrollHandlers={wrapper:null,content:a,handler:i}),e.nextTick(()=>{Je(),$o()}),p.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!k.disabled&&m.preventDefault();const S=v.closest(".dss-image-no-alt-icon"),N=v.closest(".dss-image-wrapper");if(S||N&&v===N){m.preventDefault(),m.stopPropagation();const w=window.getSelection(),U=document.createRange();U.setStartAfter(N),U.collapse(!0),w.removeAllRanges(),w.addRange(U)}else N&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const w=window.getSelection();if(w.rangeCount>0){const W=w.getRangeAt(0).commonAncestorContainer,Ce=W.nodeType===3?W.parentElement:W;if(N.contains(Ce)&&Ce!==N.querySelector("img")){const le=document.createRange();le.setStartAfter(N),le.collapse(!0),w.removeAllRanges(),w.addRange(le)}}else{const U=document.createRange();U.setStartAfter(N),U.collapse(!0),w.addRange(U)}}))},!0),p.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),S=v.closest(".dss-image-wrapper");if(h||S&&v.tagName!=="IMG"){m.preventDefault();const N=window.getSelection(),w=document.createRange();S&&(w.setStartAfter(S),w.collapse(!0),N.removeAllRanges(),N.addRange(w))}},!0),p.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!p.value)return;p.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const N=h.getAttribute("alt")||h.alt||"";if(N){const w=h.getAttribute("src")||h.src||"",U=w.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),W=N===w||N===U;(N.startsWith("http://")||N.startsWith("https://")||N.startsWith("data:")||W||W)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),Nn()})}),p.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),S=h?.closest(".dss-image-wrapper");h&&p.value.contains(h)&&(Nt.value=S||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),p.value.addEventListener("dragover",m=>{Nt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),p.value.addEventListener("dragenter",m=>{Nt.value&&(m.preventDefault(),m.stopPropagation())}),p.value.addEventListener("drop",m=>{if(!Nt.value||!p.value)return;m.preventDefault(),m.stopPropagation();const v=Nt.value,h=v.classList?.contains("dss-image-wrapper"),S=h?v.querySelector("img"):v,N=h?v:S?.closest(".dss-image-wrapper");if(!S||!p.value.contains(S)){Nt.value=null;return}let w=null;const U=m.clientX,W=m.clientY;if(document.caretRangeFromPoint)w=document.caretRangeFromPoint(U,W);else{const Pt=window.getSelection();Pt.rangeCount>0?w=Pt.getRangeAt(0).cloneRange():(w=document.createRange(),w.selectNodeContents(p.value),w.collapse(!1))}if(!w){Nt.value=null;return}const Ce=w.commonAncestorContainer,le=Ce.nodeType===3?Ce.parentElement:Ce;if(le?.closest(".dss-image-wrapper")===N||N&&N.contains(le)){Nt.value=null;return}if(N&&(le===N||N.contains(le))){Nt.value=null;return}const en=S.getAttribute("src");let At=null;N?At=N.cloneNode(!0):At=S.cloneNode(!0);try{let Pt=w.startContainer;if(Pt.nodeType===3&&(Pt=Pt.parentElement),N&&(Pt===N||N.contains(Pt))){const qt=document.createRange();qt.setStartAfter(N),qt.collapse(!0),w=qt}w.insertNode(At);const Gt=document.createRange();Gt.setStartAfter(At),Gt.collapse(!0);const Zt=window.getSelection();Zt.removeAllRanges(),Zt.addRange(Gt)}catch{if(p.value.childNodes.length===0){const Gt=document.createElement("p");Gt.appendChild(At),p.value.appendChild(Gt)}else{const Gt=p.value.lastChild;if(Gt&&Gt.nodeType===1)Gt.appendChild(At);else{const Zt=document.createElement("p");Zt.appendChild(At),p.value.appendChild(Zt)}}}N?N.remove():S.remove(),Nt.value=null,e.nextTick(()=>{const Pt=p.value.querySelectorAll("img");let Gt=!1;Pt.forEach(Zt=>{if(Zt.getAttribute("src")===en)if(!Gt)Gt=!0;else{const qt=Zt.closest(".dss-image-wrapper");qt?qt.remove():Zt.remove()}}),Nn(),I()})}),p.value.addEventListener("dragend",m=>{Nt.value=null});let u=null;const d=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const S=h.querySelectorAll&&h.querySelectorAll("img");S&&S.forEach(N=>{N.removeAttribute("alt"),N.removeAttribute("data-alt"),N.setAttribute("alt",""),N.setAttribute("data-alt",""),N.alt=""})}})}),u&&clearTimeout(u),u=setTimeout(()=>{Nn(),$o(),u=null},100)});if(d.observe(p.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{$o()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),k.modelValue){const m=Wn(k.modelValue);p.value.innerHTML=m,de()}e.nextTick(()=>{const m=p.value.innerHTML||"",v=k.title||"",h=k.description||"";O.value=m,X.value=v,Q.value=h,ye.value=v,et.value=h,kn(),Nn(),R(),Zn(),Bl(),Do()}),gn(),Dn(),p.value._mutationObserver=d}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Lt),window.removeEventListener("resize",Po),p.value&&p.value._windowScrollHandler&&window.removeEventListener("scroll",p.value._windowScrollHandler,!0),wt!==null&&(clearTimeout(wt),wt=null),p.value&&p.value._windowScrollTimeout!==null&&clearTimeout(p.value._windowScrollTimeout),Te.value&&clearTimeout(Te.value),nn.value&&clearTimeout(nn.value),p.value&&p.value._mutationObserver&&p.value._mutationObserver.disconnect(),Vt.value&&Vt.value.disconnect(),Bt.value!==null&&(cancelAnimationFrame(Bt.value),Bt.value=null),_n.value!==null&&(clearTimeout(_n.value),_n.value=null),Yt.value!==null&&(clearTimeout(Yt.value),Yt.value=null),Qn(!0),p.value&&p.value._scrollHandlers){const{wrapper:o,content:a,handler:r}=p.value._scrollHandlers;o&&o.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const l=document.querySelector(".dss-text-editor-toolbar");l&&l._toolbarMutationObserver&&l._toolbarMutationObserver.disconnect()});const tl=l=>{const o=l.target,a=o.closest("a");if(a&&!k.disabled){l.preventDefault();const i=document.createRange();i.selectNodeContents(a);const u=window.getSelection();u.removeAllRanges(),u.addRange(i)}const r=o.closest(".dss-image-wrapper");r&&o.tagName!=="IMG"?e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const d=i.getRangeAt(0).commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),i.removeAllRanges(),i.addRange(v)}}Nn(),gn(),Dn(),Ft(),Zn()}):e.nextTick(()=>{Nn(),gn(),Dn(),Ft(),Zn()})},io=()=>{Ct();const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0);Sn.value=!a.collapsed&&fo(a),!a.collapsed&&It.value&&(It.value=null)}else Sn.value=!1;if(Nn(),gn(),Dn(),Ft(),Zn(),l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i&&i.closest(".dss-text-editor-footer")){l.removeAllRanges(),Sn.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0);if(!i.collapsed)if(a==="bold"){const u=i.commonAncestorContainer,d=u.nodeType===3?u.parentElement:u;let m=!1;if(d&&((d.tagName==="STRONG"||d.tagName==="B"||d.closest&&d.closest("strong, b"))&&(m=!0),!m&&d.style&&parseInt(d.style.fontWeight)>=600&&(m=!0),!m))try{const v=window.getComputedStyle(d);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}Be.value[a]=m}else{const u=document.queryCommandState(a);Be.value[a]=u}}}catch{}})},Zn=()=>{if(!k.richText||k.disabled||!p.value){gt.value="p";return}try{const l=window.getSelection();if(!l||l.rangeCount===0){gt.value="p";return}const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!p.value.contains(r)){gt.value="p";return}const i=r.closest("h1, h2, h3, h4, h5, h6, p");if(!i){gt.value="p";return}const u=i.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(u)?gt.value=u:gt.value="p"}catch{gt.value="p"}},Dn=()=>{if(!p.value){nt.value=!1;return}try{const l=window.getSelection();let o=!1;if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");o=!!(i&&p.value.contains(i))}nt.value=o}catch{nt.value=!1}},fo=l=>{if(!l||!p.value)return!1;const o=l.commonAncestorContainer;if(!o)return!1;const a=o.nodeType===3?o.parentElement:o;return a?p.value.contains(a):!1},Eo=()=>{te.value=!1},Ft=()=>{if(!k.floatingToolbar||!k.richText||k.disabled){te.value=!1;return}const l=window.getSelection();if(!l||l.rangeCount===0){te.value=!1;return}const o=l.getRangeAt(0);if(o.collapsed||!fo(o)){te.value=!1;return}const a=o.getBoundingClientRect();if(!a||a.width===0&&a.height===0){te.value=!1;return}const r=p.value;if(!r){te.value=!1;return}const i=r.getBoundingClientRect();if(!i||i.width===0){te.value=!1;return}const u=40,d=8,m=a.top-u/2+15;let v=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let S=0;rt.value&&(S=rt.value.getBoundingClientRect().width);const N=(S||320)/2;let w=i.left+N,U=i.right-N;if(U<w){const W=i.left+i.width/2;w=W,U=W}if(h>0){const W=N+d,Ce=h-N-d;if(w=Math.max(w,W),U=Math.min(U,Ce),U<w){const le=h/2;w=le,U=le}}v<w?v=w:v>U&&(v=U),pn.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},te.value=!0},co=l=>{k.disabled||!k.richText||(Qe.value=Qe.value===l?null:l,l==="askAi"&&(ie.value=null))},nl=()=>{Qe.value=null,st.value=null},hn=l=>{An(l),nl()};let go=null,Vo=null,Rn=null,So=null;const wl=l=>{if(k.disabled||!k.richText){No(),Ho();return}const o=l.target,a=o.closest("a"),r=o.closest("img");if(go&&(clearTimeout(go),go=null),Rn&&(clearTimeout(Rn),Rn=null),a&&a!==Vo){Ho(),Vo=a;let i=a.getAttribute("href")||"";(!i||i==="#"||i==="")&&(i=a.textContent||""),he.value=a,_.value=i,j.value=!0,Pe.value=!0,ol(a)}else!a&&Vo?(Vo=null,go=setTimeout(()=>{Pe.value||No()},150)):a&&a===Vo&&ol(a);if(r&&r!==So){No(),So=r;let i=r.getAttribute("alt");i===null&&(i=r.alt||"");let u=r.getAttribute("data-alt");u===null&&(u=i),r.hasAttribute("alt")||r.setAttribute("alt",i),r.hasAttribute("data-alt")||r.setAttribute("data-alt",u),Ve.value=r,ot.value=i.trim()||F("textEditor.image.noAlt"),_t.value=!0,Rt.value=!0,xl(r)}else!r&&So?(So=null,Rn=setTimeout(()=>{Rt.value||Ho()},150)):r&&r===So&&xl(r)},$l=l=>{const o=l.relatedTarget;(!o||!o.closest(".dss-text-editor-content")&&!o.closest(".dss-link-popup"))&&(Vo=null,So=null,go&&(clearTimeout(go),go=null),Rn&&(clearTimeout(Rn),Rn=null),No(),Ho())},No=()=>{Pe.value=!1,setTimeout(()=>{Pe.value||(j.value=!1,_.value="",Le.value||(he.value=null))},100)},ol=l=>{if(!l||!p.value)return;const o=l.getBoundingClientRect(),i=o.top-32-8,u=o.left+o.width/2;_e.value={position:"fixed",top:`${i}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},Ho=()=>{Rt.value=!1,setTimeout(()=>{Rt.value||(_t.value=!1,ot.value="",sn.value||(Ve.value=null))},100)},xl=l=>{if(!l||!p.value)return;const o=l.getBoundingClientRect(),i=o.top-32-8,u=o.left+o.width/2;tn.value={position:"fixed",top:`${i}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},Gn=()=>{if(!_.value||!he.value)return;let o=he.value.getAttribute("href")||_.value;!o.startsWith("http://")&&!o.startsWith("https://")&&!o.startsWith("mailto:")&&(o="https://"+o),window.open(o,"_blank","noopener,noreferrer")},ho=()=>{if(he.value){const l=he.value.textContent||"",o=he.value.getAttribute("href")||"",a=he.value;Ke.value=o,z.value=l,xt.value=l,Pe.value=!1,j.value=!1,_.value="",he.value=a,Le.value=!0}else if(be.value){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const i=r.textContent||"",u=r.getAttribute("href")||"";Ke.value=u,z.value=i,xt.value=i,he.value=r,Le.value=!0}}}else{Dt.value=ze();const l=window.getSelection();let o="";l.rangeCount>0&&(o=l.getRangeAt(0).toString()),Ke.value="",z.value=o,xt.value="",he.value=null,Le.value=!0}e.nextTick(()=>{dt.value&&(dt.value.focus(),dt.value.select())})},In=()=>{Le.value=!1,Ke.value="",z.value="",xt.value="",he.value=null,Dt.value=null},Mt=()=>{if(!Ke.value.trim()){In();return}if(Ue.value?(Te.value&&(clearTimeout(Te.value),Te.value=null),$e(),Ue.value=!1):$e(),z.value.trim()||(z.value=Ke.value.trim()),he.value&&p.value&&p.value.contains(he.value)){const l=window.getSelection();l.rangeCount>0&&l.removeAllRanges();const o=he.value;if(o.setAttribute("href",Ke.value.trim()),z.value.trim()!==xt.value.trim()){for(;o.firstChild;)o.removeChild(o.firstChild);o.textContent=z.value.trim()}o.style.color="#60afdf",o.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(o),a.collapse(!1),l.removeAllRanges(),l.addRange(a),I()}else if(p.value){p.value.focus();const l=window.getSelection();l.removeAllRanges(),Dt.value&&jt(Dt.value);let o=null;if(l.rangeCount>0&&(o=l.getRangeAt(0)),o&&!o.collapsed){o.toString();const a=document.createElement("a");a.href=Ke.value.trim(),a.textContent=z.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",o.deleteContents(),o.insertNode(a);const r=document.createTextNode(" ");o.setStartAfter(a),o.insertNode(r),o.setStartAfter(r),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}else{o||(o=document.createRange(),o.selectNodeContents(p.value),o.collapse(!1));const a=o.startContainer,r=a.nodeType===3,i=r&&o.startOffset===a.textContent.length,u=document.createElement("a");if(u.href=Ke.value.trim(),u.textContent=z.value.trim(),u.style.color="#60afdf",u.style.textDecoration="underline",i){let d=a.parentElement;for(;d&&d!==p.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(d.tagName);)d=d.parentElement;if(d&&d!==p.value){let m=d.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(u);const v=document.createTextNode(" ");m.appendChild(v);const h=document.createRange();h.setStartAfter(u),h.collapse(!0),l.removeAllRanges(),l.addRange(h)}else{if(o.startOffset>0){const h=a.textContent.substring(0,o.startOffset),S=h[h.length-1];if(S&&S!==" "&&S!==" "&&S!==`
|
|
83
83
|
`){const N=document.createTextNode(" ");o.insertNode(N),o.setStartAfter(N)}}o.insertNode(u);const v=document.createTextNode(" ");o.setStartAfter(u),o.insertNode(v),o.setStartAfter(v),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}}}else{if(r&&o.startOffset>0){const m=a.textContent.substring(0,o.startOffset),v=m[m.length-1];if(v&&v!==" "&&v!==" "&&v!==`
|
|
84
|
-
`){const h=document.createTextNode(" ");o.insertNode(h),o.setStartAfter(h)}}o.insertNode(u);const d=document.createTextNode(" ");o.setStartAfter(u),o.insertNode(d),o.setStartAfter(d),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}}I()}e.nextTick(()=>{gn(),In()})},ll=()=>{if(!p.value||fe.value)return;const l=window.getSelection();let o=null;l&&l.rangeCount>0&&(o=ze());const a=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(p.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),i=[];let u;for(;u=r.nextNode();)i.push(u);let d=!1;for(let m=i.length-1;m>=0;m--){const v=i[m],h=v.textContent;a.lastIndex=0;const S=[...h.matchAll(a)];if(S.length===0)continue;const N=S.filter(W=>{const Ce=W[0],le=W.index;if(le>0&&h[le-1]==="@"||le+Ce.length<h.length&&h[le+Ce.length]==="@")return!1;const Ge=v.parentElement;return!(Ge&&Ge.closest("a"))});if(N.length===0)continue;if(N.length===1&&N[0][0]===h.trim()){const W=N[0][0],Ce=W.startsWith("http://")||W.startsWith("https://")?W:`https://${W}`,le=document.createElement("a");le.href=Ce,le.textContent=W,le.style.color="#60afdf",le.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(le,v),d=!0);continue}let w=0;const U=document.createDocumentFragment();if(N.forEach(W=>{const Ce=W.index,le=W[0];if(Ce>w){const At=h.substring(w,Ce);At&&U.appendChild(document.createTextNode(At))}const Ge=le.startsWith("http://")||le.startsWith("https://")?le:`https://${le}`,en=document.createElement("a");en.href=Ge,en.textContent=le,en.style.color="#60afdf",en.style.textDecoration="underline",U.appendChild(en),w=Ce+le.length}),w<h.length){const W=h.substring(w);W&&U.appendChild(document.createTextNode(W))}v.parentNode&&U.childNodes.length>0&&(v.parentNode.replaceChild(U,v),d=!0)}d&&o&&e.nextTick(()=>{jt(o),gn()})},zt=()=>{if(!p.value)return;const l=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,o=document.createTreeWalker(p.value,NodeFilter.SHOW_TEXT,{acceptNode:i=>{const u=i.parentElement;return!u||u.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=o.nextNode();)a.push(r);for(let i=a.length-1;i>=0;i--){const u=a[i],d=u.textContent,m=[...d.matchAll(l)];if(m.length===0)continue;let v=0;const h=document.createDocumentFragment();m.forEach(S=>{const N=S.index,w=S[0].startsWith("<u>")?"u":"ins",U=S[1]||S[2]||"";N>v&&h.appendChild(document.createTextNode(d.substring(v,N)));const W=document.createElement(w);W.textContent=U,h.appendChild(W),v=N+S[0].length}),v<d.length&&h.appendChild(document.createTextNode(d.substring(v))),u.parentNode&&h.childNodes.length>0&&u.parentNode.replaceChild(h,u)}},Jt=l=>{if(!p.value||fe.value)return;if(!l){zt();return}if(!["*","_",">"].includes(l))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const i=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!i||i===p.value||!p.value.contains(i))return;const u=()=>{let At="",Pt=0,Gt=!1;const Zt=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:an=>an.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(i,NodeFilter.SHOW_TEXT,null);let qt=0;for(;Zt.nextNode();){const an=Zt.currentNode,Un=an.textContent||"",zn=qt;if(qt+=Un.length,an===r.startContainer){At+=Un.substring(0,r.startOffset),Pt=zn+r.startOffset,Gt=!0;break}At+=Un}return Gt||(Pt=At.length),{textBeforeCursor:At,cursorCharOffset:Pt}},{textBeforeCursor:d}=u();if(!d.length)return;let m=null,v=null;if(d.endsWith("**")&&(m=d.match(/\*\*(.+?)\*\*$/s))||d.endsWith("__")&&(m=d.match(/__(.+?)__$/s))?v="strong":d.endsWith("*")&&!d.endsWith("**")&&(m=d.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||d.endsWith("_")&&!d.endsWith("__")&&(m=d.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":l===">"&&((m=d.match(/<u>(.+?)<\/u>$/s))||(m=d.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],S=m[1],N=d.length-h.length,U=(At=>{let Pt=0;const Gt=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:qt=>qt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Zt;for(;Zt=Gt.nextNode();){const qt=(Zt.textContent||"").length;if(Pt+qt>=At)return{node:Zt,offset:At-Pt};Pt+=qt}return null})(N);if(!U)return;const W=document.createRange();W.setStart(U.node,U.offset),W.setEnd(r.endContainer,r.endOffset);const Ce=document.createElement(v);Ce.textContent=S,W.deleteContents(),W.insertNode(Ce);const le=window.getSelection(),Ge=document.createRange();Ge.setStartAfter(Ce),Ge.collapse(!0),le.removeAllRanges(),le.addRange(Ge);const en=ze();e.nextTick(()=>{I(),en&&jt(en)})},al=()=>{p.value&&(Ot.value=ze(),Xt.value="",xe.value="",Tt.value="",J.value="",oe.value="",se.value=null,Ve.value=null,ht.value="upload",sn.value=!0,bt(),e.nextTick(()=>{Ye.value&&Ye.value.focus(),ct.value&&(ct.value.value="")}))},El=l=>{const o=l.target?.files?.[0];if(!o){se.value=null,xe.value="";return}se.value=o;const a=new FileReader;a.onload=r=>{xe.value=r.target?.result||""},a.readAsDataURL(o)},sl=()=>{ct.value&&ct.value.click()},Vl=()=>{J.value&&(oe.value="")},rl=()=>{oe.value&&(J.value="")},Ht=()=>{let l=Ve.value;if(!l){const o=window.getSelection();if(o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(l){const o=l.getAttribute("data-alt")||l.getAttribute("alt")||"";Ve.value=l,Xt.value=o.trim()===""||o.trim()==="Image"?"":o;const a=l.getAttribute("src")||l.src||"";a.startsWith("http://")||a.startsWith("https://")?(Tt.value=a,xe.value="",ht.value="url"):(xe.value=a,Tt.value="",ht.value="upload");const i=l.style.width||l.getAttribute("width")||"",u=l.style.height||l.getAttribute("height")||"";J.value=i.endsWith("px")?i.replace("px",""):i,oe.value=u.endsWith("px")?u.replace("px",""):u,Ot.value=null}else{al();return}sn.value=!0,Rt.value=!1,_t.value=!1,e.nextTick(()=>{ht.value==="url"&&Ze.value?(Ze.value.focus(),Ze.value.select()):Ye.value&&(Ye.value.focus(),Ye.value.select()),ct.value&&(ct.value.value="")})},Ao=()=>{sn.value=!1,Xt.value="",xe.value="",Tt.value="",J.value="",oe.value="",se.value=null,Ve.value=null,Ot.value=null,ht.value="upload"},qn=()=>{const l=(Xt.value||"").trim(),o=p.value?._mutationObserver;o&&o.disconnect(),Ue.value?(Te.value&&(clearTimeout(Te.value),Te.value=null),$e(),Ue.value=!1):$e();const a=ht.value==="url"?Tt.value.trim():xe.value;if(Ve.value&&p.value&&p.value.contains(Ve.value)){a&&(Ve.value.src=a),Ve.value.setAttribute("alt",l),Ve.value.setAttribute("data-alt",l),J.value?(Ve.value.style.width=`${J.value}px`,Ve.value.setAttribute("width",J.value)):(Ve.value.style.removeProperty("width"),Ve.value.removeAttribute("width")),oe.value?(Ve.value.style.height=`${oe.value}px`,Ve.value.setAttribute("height",oe.value)):(Ve.value.style.removeProperty("height"),Ve.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const i=document.createRange();i.setStartAfter(Ve.value),i.collapse(!0),r.addRange(i)}I()}else{if(!a){o&&p.value&&o.observe(p.value,{childList:!0,subtree:!0}),Ao();return}if(p.value){p.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const i=window.getSelection();let u=null;if(Ot.value&&(jt(Ot.value),i&&i.rangeCount>0&&(u=i.getRangeAt(0))),!u&&i&&i.rangeCount>0&&(u=i.getRangeAt(0)),!u&&p.value){if(u=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),u.setStart(h,0),u.collapse(!0)}else u.selectNodeContents(p.value),u.collapse(!1);i&&(i.removeAllRanges(),i.addRange(u))}if(!u){Ao();return}const d=u.commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(!p.value.contains(m)){if(u=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),u.setStart(h,0),u.collapse(!0)}else u.selectNodeContents(p.value),u.collapse(!1);i&&(i.removeAllRanges(),i.addRange(u))}const v=document.createElement("img");v.src=a,v.setAttribute("alt",l),v.setAttribute("data-alt",l),J.value&&(v.style.width=`${J.value}px`,v.setAttribute("width",J.value)),oe.value&&(v.style.height=`${oe.value}px`,v.setAttribute("height",oe.value));try{u.insertNode(v),u.setStartAfter(v),u.collapse(!0),i&&(i.removeAllRanges(),i.addRange(u))}catch{if(p.value){if(p.value.childNodes.length===0){const N=document.createElement("p");p.value.appendChild(N),N.appendChild(v)}else{const N=p.value.lastChild;if(N&&N.nodeType===1)N.appendChild(v);else{const w=document.createElement("p");p.value.appendChild(w),w.appendChild(v)}}const S=document.createRange();S.setStartAfter(v),S.collapse(!0),i&&(i.removeAllRanges(),i.addRange(S))}}Ve.value=v,I()}}e.nextTick(()=>{o&&p.value&&o.observe(p.value,{childList:!0,subtree:!0}),gn(),Ft(),Ao()})};e.watch(()=>k.modelValue,l=>{if(k.richText&&p.value&&!fe.value){const o=Wn(l||""),r=p.value.innerHTML.replace(/ |\u00A0/g," "),i=o.replace(/ |\u00A0/g," ");if(r!==i){const u=ze();p.value.innerHTML=o,e.nextTick(()=>{de();const d=p.value.innerHTML||"",m=k.title||"",v=k.description||"";O.value=d,X.value=m,Q.value=v,Z.value=d,ge.value=m,et.value=v,tt.value=[],yt.value=[],Te.value&&(clearTimeout(Te.value),Te.value=null),Ue.value=!1,u&&jt(u),kn(),Nn(),R(),gn(),Ft(),Zn(),Fn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>k.richText,l=>{l?(Ft(),e.nextTick(()=>{Bl()})):(Eo(),Wt.value=[],Vt.value&&(Vt.value.disconnect(),Vt.value=null)),Zn()}),e.watch(()=>k.floatingToolbar,l=>{l?Ft():Eo()}),e.watch(()=>k.disabled,l=>{l&&Eo(),Zn()}),e.watch(()=>k.description,()=>{e.nextTick(()=>{Ae.value?po():ce()})}),e.watch(()=>k.title,()=>{e.nextTick(()=>{$t.value?yn():no()})}),e.watch(()=>k.customToolbarSlots,()=>{e.nextTick(()=>{$o()})},{deep:!0}),e.watch(()=>k.comments,(l,o)=>{if(Ko.value){Ko.value=!1;return}xo.value||k.richText&&p.value&&e.nextTick(()=>{Do()})},{deep:!0,immediate:!1});const Do=()=>{if(!xo.value&&!(!k.comments||!Array.isArray(k.comments)||k.comments.length===0)&&!(!k.richText||!p.value)){xo.value=!0;try{const l=new Set,o=k.comments.filter(d=>{const m=String(d.conversation_id||d.id);return l.has(m)?!1:(l.add(m),!0)}),a=p.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(d=>{const m=d.parentNode;if(m){for(;d.firstChild;)m.insertBefore(d.firstChild,d);m.removeChild(d)}});let i=0;const u=new Set;o.forEach(d=>{if(!d.conversation_id||!d.selection_range)return;const m=typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)||d.conversation_id;if(!m)return;const v=String(m);if(u.has(v))return;const h=p.value.querySelector(`[data-comment="${v}"]`);if(h){Wo(h,d),u.add(v);return}try{const S=Ll(d.selection_range,d.selection_text);if(S&&!S.collapsed){const N=S.commonAncestorContainer,w=N.nodeType===3?N.parentElement:N;if(w){const Ce=w.closest("[data-comment], [data-fake-comment]");if(Ce){const le=Ce.getAttribute("data-comment")||Ce.getAttribute("data-fake-comment");if(String(le)===String(m)){Ce.setAttribute("data-comment",v),Ce.removeAttribute("data-fake-comment"),Wo(Ce,d),u.add(v);return}else return}}const U=p.value.querySelector(`[data-comment="${v}"]`);if(U){Wo(U,d),u.add(v);return}const W=document.createElement("span");W.setAttribute("data-comment",v),Wo(W,d);try{S.surroundContents(W),i++,u.add(v)}catch{try{const le=document.createRange();le.setStart(S.startContainer,S.startOffset),le.setEnd(S.endContainer,S.endOffset),Oo(le),le.surroundContents(W),i++,u.add(v)}catch{try{const Ge=S.extractContents();W.appendChild(Ge),S.insertNode(W),i++,u.add(v)}catch(Ge){console.warn("Failed to create comment marker:",Ge)}}}}}catch{}}),e.nextTick(()=>{Fn("restoreCommentsFromModel"),I(),xo.value=!1})}catch{xo.value=!1}}},Oo=l=>{if(!l||!p.value)return l;try{const o=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=l.startContainer,r=l.startOffset;if(a.nodeType===3){const d=a.parentElement;d&&o.includes(d.tagName)&&(r===0&&!Sl(a)||l.setStartBefore(d))}else a.nodeType===1&&o.includes(a.tagName)&&r>0&&l.setStartBefore(a);let i=l.endContainer,u=l.endOffset;if(i.nodeType===3){const d=i.parentElement;d&&o.includes(d.tagName)&&(u===i.length&&!Nl(i)||l.setEndAfter(d))}else i.nodeType===1&&o.includes(i.tagName)&&u<i.childNodes.length&&l.setEndAfter(i);return l}catch{return l}},Sl=l=>{let o=l.previousSibling;for(;o;){if(o.nodeType===3&&o.textContent.trim().length>0||o.nodeType===1&&o.textContent.trim().length>0)return!0;o=o.previousSibling}return!1},Nl=l=>{let o=l.nextSibling;for(;o;){if(o.nodeType===3&&o.textContent.trim().length>0||o.nodeType===1&&o.textContent.trim().length>0)return!0;o=o.nextSibling}return!1},Ll=(l,o)=>{if(!l||!p.value)return null;try{const a=document.createRange();if(l.type==="text"&&typeof l.start=="number"&&typeof l.end=="number"){let r=0;const i=[p.value];let u=null,d=!1,m=!1;for(;!m&&(u=i.pop());)if(u.nodeType===3){const v=r+u.length;!d&&l.start>=r&&l.start<=v&&(a.setStart(u,l.start-r),d=!0),d&&l.end>=r&&l.end<=v&&(a.setEnd(u,l.end-r),m=!0),r=v}else{let v=u.childNodes.length;for(;v--;)i.push(u.childNodes[v])}return d?Oo(a):null}}catch{return null}return null},Wo=(l,o)=>{if(!l||!o)return;const a=o.conversation||[],r=new Set,i=[],u=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),i.push(m))};a.length>0&&a.forEach(m=>{m.user&&u(m.user)}),i.length>0?l.setAttribute("data-comment-user",JSON.stringify(i[0])):l.removeAttribute("data-comment-user"),i.length>1?l.setAttribute("data-comment-user-2",JSON.stringify(i[1])):l.removeAttribute("data-comment-user-2");const d=a.length;d>0?l.setAttribute("data-comment-count",String(d)):l.removeAttribute("data-comment-count")},Fn=(l="unknown")=>{if(!k.richText||!p.value){Wt.value=[];return}Date.now()-rn.value<cn&&Bt.value!==null||Bt.value===null&&(Bt.value=requestAnimationFrame(()=>{if(Bt.value=null,rn.value=Date.now(),Tn.value)return;Tn.value=!0;const a={},r=p.value;if(!r){Tn.value=!1;return}const i=r.closest(".editor-with-comments");if(!i){Tn.value=!1;return}const u=r.querySelectorAll("[data-comment], [data-fake-comment]"),d=[],m=new Set;u.forEach(w=>{const U=w.getAttribute("data-comment")||w.getAttribute("data-fake-comment");U&&w.tagName==="SPAN"&&(m.has(U)||(d.push(w),m.add(U)))}),u.forEach(w=>{const U=w.getAttribute("data-comment")||w.getAttribute("data-fake-comment");!U||m.has(U)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(w.tagName)?w.querySelector(`span[data-comment="${U}"], span[data-fake-comment="${U}"]`)||(d.push(w),m.add(U)):w.tagName!=="SPAN"&&(d.push(w),m.add(U)))});const v=i.getBoundingClientRect(),h=r.getBoundingClientRect();d.forEach((w,U)=>{let W=w.getAttribute("data-comment")||w.getAttribute("data-fake-comment");if(!W)return;if(typeof W=="string"&&W.startsWith("comment-")){const Jn=w.textContent?.trim(),eo=k.comments?.find(Vn=>(typeof Vn.conversation_id=="string"&&Vn.conversation_id.startsWith("comment-")?null:Vn.conversation_id)&&Vn.selection_text?.trim()===Jn);eo?(W=String(eo.conversation_id),w.setAttribute("data-comment",W),w.removeAttribute("data-fake-comment")):(W=String(Date.now()),w.setAttribute("data-comment",W),w.removeAttribute("data-fake-comment"))}const Ce=w.getBoundingClientRect(),le=window.getComputedStyle(w),Ge=parseFloat(le.lineHeight)||parseFloat(le.fontSize)*1.2,Pt=Ce.top-h.top+Ge/2-15,Zt=h.top-v.top+Pt;let qt=null,an=null,Un=0;const zn=[],Pn=new Set;if(W&&k.comments){const Jn=k.comments.find(eo=>String(eo.conversation_id||eo.id)===String(W));if(Jn){const eo=Jn.conversation||[];eo.length>0?(eo.forEach(Vn=>{Vn.user&&Vn.user.id&&!Pn.has(Vn.user.id)&&(Pn.add(Vn.user.id),zn.push(Vn.user))}),Un=eo.length):(Un=0,qt=null,an=null),zn.length>0?qt=zn[0]:qt=null,zn.length>1?an=zn[1]:an=null}}const Bo=Ce.top+Ge/2-15,Ro=Bo+30,Mo=5,Uo=Ro>h.top+Mo&&Bo<h.bottom-Mo?1:0;Wt.value.find(Jn=>Jn.id===W);let Mn=w;if(!Mn&&W&&p.value){const Jn=String(W);Mn=p.value.querySelector(`[data-comment="${Jn}"], [data-fake-comment="${Jn}"]`)}const il=zn.length;a[W]?(a[W].top=Zt,a[W].opacity=Uo,a[W].element=Mn,a[W].firstUser=qt,a[W].secondUser=an,a[W].totalCount=Un,a[W].uniqueUserCount=il):a[W]={id:W,top:Zt,opacity:Uo,element:Mn,firstUser:qt,secondUser:an,totalCount:Un,uniqueUserCount:il}});const S=Object.values(a).map(w=>{const U=Math.max(0,(w.uniqueUserCount??0)-2);if(!w.element&&w.id&&p.value){const Ce=String(w.id);w.element=p.value.querySelector(`[data-comment="${Ce}"], [data-fake-comment="${Ce}"]`)}return{...w,firstUser:w.firstUser||null,secondUser:w.secondUser||null,totalCount:w.totalCount,additionalCount:U}});(Wt.value.length!==S.length||S.some((w,U)=>{const W=Wt.value[U];if(!W)return!0;const Ce=(W.firstUser?.id||null)!==(w.firstUser?.id||null),le=(W.secondUser?.id||null)!==(w.secondUser?.id||null);return W.id!==w.id||Math.abs(W.top-w.top)>1||W.opacity!==w.opacity||W.totalCount!==w.totalCount||W.additionalCount!==w.additionalCount||Ce||le||W.element!==w.element}))&&(Wt.value=S),Tn.value=!1}))},Zo=l=>{if(!l)return;let o=l.element;if(!o&&l.id&&p.value){const a=String(l.id);o=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}o&&(Qn(),Cn.value=o,o.classList.add("editor-comment-highlighted"))},Qn=(l=!1)=>{!l&&ln.value!==null&&Cn.value&&(Cn.value.getAttribute("data-comment")||Cn.value.getAttribute("data-fake-comment"))===ln.value||(p.value&&p.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Cn.value&&(Cn.value.classList.remove("editor-comment-highlighted"),Cn.value=null))},qo=l=>{if(!l||!l.element)return;Qn(!0);const o=l.element.getAttribute("data-comment")||l.element.getAttribute("data-fake-comment");if(!o)return;const a=`[data-comment="${o}"], [data-fake-comment="${o}"]`;Me("comment-marker-clicked",{commentId:o,selector:a,element:l.element})},yo=()=>{Qn()},Bl=()=>{!k.richText||!p.value||(Vt.value&&Vt.value.disconnect(),Yt.value!==null&&(clearTimeout(Yt.value),Yt.value=null),Vt.value=new MutationObserver(()=>{Yt.value===null&&(Yt.value=setTimeout(()=>{Yt.value=null,e.nextTick(()=>{Fn("MutationObserver")})},200))}),Vt.value.observe(p.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Fn("setupCommentMarkersObserver-initial"))},Ml=(l,o)=>{if(!l||!o)return;const a=o.getBoundingClientRect();let r=a.top,i=a.right+4;l.style.top=`${r}px`,l.style.left=`${i}px`,l.offsetHeight;const u=l.getBoundingClientRect(),d=window.innerWidth,m=window.innerHeight;if(u.right>d){const v=a.left-u.width-4;l.style.left=`${v}px`}if(u.bottom>m){const v=Math.max(8,m-u.height-8);l.style.top=`${v}px`}u.top<0&&(l.style.top="8px")};return e.watch(()=>st.value,l=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===l&&l){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(i){if(a.parentNode!==document.body){const u=a.parentNode;a.dataset.originalParentRef=u===i?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ml(a,i),a.offsetHeight,a.setAttribute("data-active","true"),a.style.visibility="visible",a.style.opacity="1"})})}else a.setAttribute("data-active","true")}else a.setAttribute("data-active","false"),a.style.display="none",a.style.top="",a.style.left="",a.style.visibility="",a.style.opacity=""})})}),e.watch(()=>[ie.value,Qe.value],()=>{ie.value==="askAi"||Qe.value==="askAi"?e.nextTick(()=>{Je()}):(st.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(o=>{if(o.parentNode===document.body){const a=o.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(o.dataset.originalParentRef==="inside")r.appendChild(o);else{const u=r.closest(".dss-toolbar-dropdown");u&&u.insertBefore(o,r.nextSibling)}}}})}))}),e.watch(()=>k.locale,l=>{l&&l!==we.value&&(we.value=l)},{immediate:!0}),he({openCommentOverlayForSelector:L,updateCommentMarkers:Fn,restoreCommentsFromModel:Do}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",dn.value]),style:e.normalizeStyle(On.value)},[H.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:o[14]||(o[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",sc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:C,title:e.unref(F)("textEditor.toolbar.undo")},[...o[45]||(o[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,rc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!P.value}]),onClick:y,title:e.unref(F)("textEditor.toolbar.redo")},[...o[46]||(o[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,ic),o[73]||(o[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",cc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[0]||(o[0]=a=>lo("paragraph")),title:e.unref(F)("textEditor.toolbar.paragraphFormat")},[gt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",uc,[...o[47]||(o[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):gt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",mc,[...o[48]||(o[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):gt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",pc,[...o[49]||(o[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):gt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",vc,[...o[50]||(o[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):gt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",fc,[...o[51]||(o[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):gt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",gc,[...o[52]||(o[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",hc,[...o[53]||(o[53]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),o[54]||(o[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,dc),ie.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[8]||(o[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[1]||(o[1]=a=>An("<h1>"))},[o[55]||(o[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[2]||(o[2]=a=>An("<h2>"))},[o[56]||(o[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[3]||(o[3]=a=>An("<h3>"))},[o[57]||(o[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[4]||(o[4]=a=>An("<h4>"))},[o[58]||(o[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[5]||(o[5]=a=>An("<h5>"))},[o[59]||(o[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[6]||(o[6]=a=>An("<h6>"))},[o[60]||(o[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[7]||(o[7]=a=>An("<p>"))},[o[61]||(o[61]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("bold")}]),onClick:o[9]||(o[9]=a=>De("bold")),title:e.unref(F)("textEditor.toolbar.bold")},[...o[62]||(o[62]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,yc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("italic")}]),onClick:o[10]||(o[10]=a=>De("italic")),title:e.unref(F)("textEditor.toolbar.italic")},[...o[63]||(o[63]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,kc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("underline")}]),onClick:o[11]||(o[11]=a=>De("underline")),title:e.unref(F)("textEditor.toolbar.underline")},[...o[64]||(o[64]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Cc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":nt.value}]),onClick:pl,title:e.unref(F)("textEditor.toolbar.citation")},[...o[65]||(o[65]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,bc),o[74]||(o[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:ao,title:e.unref(F)("textEditor.toolbar.removeLink")},[...o[67]||(o[67]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,xc)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:fl,title:e.unref(F)("textEditor.toolbar.insertLink")},[...o[66]||(o[66]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,wc)),o[75]||(o[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("insertUnorderedList")}]),onClick:gl,title:e.unref(F)("textEditor.toolbar.bulletList")},[...o[68]||(o[68]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Ec),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("insertOrderedList")}]),onClick:hl,title:e.unref(F)("textEditor.toolbar.numberList")},[...o[69]||(o[69]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Vc),o[76]||(o[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:al,title:e.unref(F)("textEditor.toolbar.image")},[...o[70]||(o[70]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Sc),Sn.value?(e.openBlock(),e.createElementBlock("div",Nc)):e.createCommentVNode("",!0),Sn.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(F)("textEditor.toolbar.comment"),onClick:Qo},[...o[71]||(o[71]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,Bc)):e.createCommentVNode("",!0),H.askAi?(e.openBlock(),e.createElementBlock("div",Mc)):e.createCommentVNode("",!0),H.askAi?(e.openBlock(),e.createElementBlock("div",_c,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:o[12]||(o[12]=a=>lo("askAi")),title:e.unref(F)("textEditor.toolbar.askAi")},[o[72]||(o[72]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",$c,e.toDisplayString(e.unref(F)("textEditor.toolbar.askAi")),1)],8,Tc),ie.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[13]||(o[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[St(a)?(e.openBlock(),e.createElementBlock("div",Hc,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),St(a)&&r<H.customToolbarSlots.length-1&&$n(r)?(e.openBlock(),e.createElementBlock("div",Ac)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ie.value==="paragraph"||ie.value==="askAi")&&H.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:bt})):e.createCommentVNode("",!0),e.createVNode(Al,{showModal:Le.value,width:"500px",height:"55vh",onCloseModal:In},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(F)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Dc,[e.createElementVNode("div",Rc,[e.createElementVNode("label",Ic,e.toDisplayString(e.unref(F)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:ut,type:"text","onUpdate:modelValue":o[15]||(o[15]=a=>z.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Mt,["enter"])},null,40,Fc),[[e.vModelText,z.value]])]),e.createElementVNode("div",zc,[e.createElementVNode("label",Pc,e.toDisplayString(e.unref(F)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:dt,type:"text","onUpdate:modelValue":o[16]||(o[16]=a=>Ke.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Mt,["enter"])},null,40,Oc),[[e.vModelText,Ke.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:In},e.toDisplayString(e.unref(F)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Mt},e.toDisplayString(e.unref(F)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Al,{showModal:sn.value,width:"500px",height:"80vh",onCloseModal:Ao},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Ve.value?e.unref(F)("textEditor.image.editImage"):e.unref(F)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Wc,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":ht.value==="upload"}]),onClick:o[17]||(o[17]=a=>ht.value="upload")},e.toDisplayString(e.unref(F)("textEditor.image.upload")),3),o[77]||(o[77]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":ht.value==="url"}]),onClick:o[18]||(o[18]=a=>ht.value="url")},e.toDisplayString(e.unref(F)("textEditor.image.imageLink")),3)]),ht.value==="upload"?(e.openBlock(),e.createElementBlock("div",Zc,[e.createElementVNode("div",qc,[e.createElementVNode("div",Uc,[We.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Xc,e.toDisplayString(e.unref(F)("textEditor.image.uploadImage")),1)),We.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:sl},[e.createElementVNode("img",{src:xe.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Yc),o[78]||(o[78]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:ct,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:El},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:ct,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:El},null,544))]),e.createElementVNode("div",jc,[e.createElementVNode("label",Kc,e.toDisplayString(e.unref(F)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Ye,type:"text","onUpdate:modelValue":o[19]||(o[19]=a=>Xt.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.image.enterAltText"),onKeyup:e.withKeys(qn,["enter"])},null,40,Gc),[[e.vModelText,Xt.value]])]),e.createElementVNode("div",Qc,[e.createElementVNode("label",Jc,e.toDisplayString(e.unref(F)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[20]||(o[20]=a=>J.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.image.auto"),onKeyup:e.withKeys(qn,["enter"]),onInput:Vl},null,40,ed),[[e.vModelText,J.value]])]),e.createElementVNode("div",td,[e.createElementVNode("label",nd,e.toDisplayString(e.unref(F)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[21]||(o[21]=a=>oe.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.image.auto"),onKeyup:e.withKeys(qn,["enter"]),onInput:rl},null,40,od),[[e.vModelText,oe.value]])])])])):e.createCommentVNode("",!0),ht.value==="url"?(e.openBlock(),e.createElementBlock("div",ld,[e.createElementVNode("div",ad,[e.createElementVNode("div",sd,[e.createElementVNode("label",rd,e.toDisplayString(e.unref(F)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Ze,type:"text","onUpdate:modelValue":o[22]||(o[22]=a=>Tt.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(qn,["enter"])},null,40,id),[[e.vModelText,Tt.value]])]),e.createElementVNode("div",cd,[e.createElementVNode("label",dd,e.toDisplayString(e.unref(F)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":o[23]||(o[23]=a=>Xt.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.image.enterAltText"),onKeyup:e.withKeys(qn,["enter"])},null,40,ud),[[e.vModelText,Xt.value]])]),e.createElementVNode("div",md,[e.createElementVNode("label",pd,e.toDisplayString(e.unref(F)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[24]||(o[24]=a=>J.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.image.auto"),onKeyup:e.withKeys(qn,["enter"]),onInput:Vl},null,40,vd),[[e.vModelText,J.value]])]),e.createElementVNode("div",fd,[e.createElementVNode("label",gd,e.toDisplayString(e.unref(F)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[25]||(o[25]=a=>oe.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.image.auto"),onKeyup:e.withKeys(qn,["enter"]),onInput:rl},null,40,hd),[[e.vModelText,oe.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Ao},e.toDisplayString(e.unref(F)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:qn},e.toDisplayString(e.unref(F)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Ln.value&&$t.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(F)("textEditor.labels.title")),1),e.createElementVNode("div",yd,[$t.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",kd,[H.title?(e.openBlock(),e.createElementBlock("span",Cd,e.toDisplayString(H.title),1)):(e.openBlock(),e.createElementBlock("span",bd,e.toDisplayString(Xe.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Se,value:H.title,onInput:Hn,onFocus:fn,onBlur:Io,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!$t.value}]),placeholder:Xe.value,disabled:H.disabled,rows:"1"},null,42,wd)])],2),Ln.value&&$t.value?(e.openBlock(),e.createElementBlock("div",xd,[e.renderSlot(l.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":un.value&&Ae.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(F)("textEditor.labels.description")),1),e.createElementVNode("div",Ed,[Ae.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Vd,[H.description?(e.openBlock(),e.createElementBlock("span",Sd,e.toDisplayString(H.description),1)):(e.openBlock(),e.createElementBlock("span",Nd,e.toDisplayString(Ie.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Oe,value:H.description,onInput:To,onFocus:_o,onBlur:kt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!Ae.value}]),placeholder:Ie.value,disabled:H.disabled,rows:"1"},null,42,Bd)])],2),un.value&&Ae.value?(e.openBlock(),e.createElementBlock("div",Md,[e.renderSlot(l.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":ln.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:r=>Zo(a),onMouseleave:yo},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>qo(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,$d)):(e.openBlock(),e.createElementBlock("span",Ld,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,Td)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>qo(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Ad)):(e.openBlock(),e.createElementBlock("span",Dd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Hd)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(r=>qo(a),["stop"])},[e.createElementVNode("span",Id,"+"+e.toDisplayString(a.additionalCount),1)],12,Rd)):e.createCommentVNode("",!0)],46,_d))),128)),H.richText?(e.openBlock(),e.createElementBlock("div",qd,[e.createElementVNode("div",{ref_key:"editorRef",ref:p,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":H.disabled,"dss-text-editor-fixed-height":H.fixedHeight}]),style:e.normalizeStyle($.value),onInput:I,onBlur:oo,onClick:tl,onMouseup:io,onKeyup:io,onKeydown:mn,onPaste:jn,onMousemove:wl,onMouseleave:$l},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[ln.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(wo.value)},[so.value||En.value.length>0?(e.openBlock(),e.createElementBlock("div",Ud,[e.createElementVNode("div",Xd,[so.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:so.value},null,8,Yd)):e.createCommentVNode("",!0)]),e.createElementVNode("div",jd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(En.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",Kd,[e.createElementVNode("div",Gd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Qd)):(e.openBlock(),e.createElementBlock("span",Jd,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",eu,[e.createElementVNode("div",tu,[e.createElementVNode("div",nu,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",ou,e.toDisplayString(jo(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Co(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),k.commentUser&&a.user&&a.user.id===k.commentUser.id&&!Co(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(i=>Tl(a,r),["stop"]),title:e.unref(F)("textEditor.comment.delete")||"Delete comment"},[...o[80]||(o[80]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,lu)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",au,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Yn,"onUpdate:modelValue":o[26]||(o[26]=a=>Xn.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(F)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Cl,["prevent","stop"]),["enter"]),onInput:o[27]||(o[27]=()=>{if(Yn.value){const a=Yn.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,su),[[e.vModelText,Xn.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Cl,["stop"])},[...o[81]||(o[81]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",ru,[e.createElementVNode("div",iu,[e.createElementVNode("span",cu,e.toDisplayString(G.value)+" "+e.toDisplayString(G.value===1?e.unref(F)("textEditor.footer.word"):e.unref(F)("textEditor.footer.words")),1),o[82]||(o[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",du,e.toDisplayString(ke.value)+" "+e.toDisplayString(ke.value===1?e.unref(F)("textEditor.footer.character"):e.unref(F)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Fd,[e.createElementVNode("textarea",{value:H.modelValue,onInput:bo,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":H.fixedHeight}]),placeholder:je.value,rows:H.rows,disabled:H.disabled,style:e.normalizeStyle(mo.value)},null,46,zd),e.createElementVNode("div",Pd,[e.createElementVNode("div",Od,[e.createElementVNode("span",Wd,e.toDisplayString(G.value)+" "+e.toDisplayString(G.value===1?e.unref(F)("textEditor.footer.word"):e.unref(F)("textEditor.footer.words")),1),o[79]||(o[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Zd,e.toDisplayString(ke.value)+" "+e.toDisplayString(ke.value===1?e.unref(F)("textEditor.footer.character"):e.unref(F)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[j.value&&_.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(_e.value),onMouseenter:o[28]||(o[28]=a=>Pe.value=!0),onMouseleave:No},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Gn,["stop"]),title:_.value},e.toDisplayString(_.value),9,uu),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(ho,["stop"]),title:e.unref(F)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",pu,[...o[83]||(o[83]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,mu)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_t.value&&ot.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(tn.value),onMouseenter:o[29]||(o[29]=a=>Rt.value=!0),onMouseleave:Ho},[e.createElementVNode("div",vu,[ot.value===e.unref(F)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",fu,[...o[84]||(o[84]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:ot.value},e.toDisplayString(ot.value),9,gu)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ht,["stop"]),title:e.unref(F)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",yu,[...o[85]||(o[85]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,hu)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[H.floatingToolbar&&H.richText&&te.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:rt,class:"dss-floating-toolbar",style:e.normalizeStyle(pn.value),onMousedown:o[44]||(o[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",ku,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(C,["stop"]),title:e.unref(F)("textEditor.toolbar.undo")},[...o[86]||(o[86]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Cu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!P.value}]),onClick:e.withModifiers(y,["stop"]),title:e.unref(F)("textEditor.toolbar.redo")},[...o[87]||(o[87]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,bu),o[107]||(o[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",wu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[30]||(o[30]=e.withModifiers(a=>co("paragraph"),["stop"])),title:e.unref(F)("textEditor.toolbar.paragraphFormat")},[gt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Eu,[...o[88]||(o[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):gt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Vu,[...o[89]||(o[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):gt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Su,[...o[90]||(o[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):gt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Nu,[...o[91]||(o[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):gt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Bu,[...o[92]||(o[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):gt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Mu,[...o[93]||(o[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",_u,[...o[94]||(o[94]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),o[95]||(o[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,xu),Qe.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[38]||(o[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[31]||(o[31]=a=>hn("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[32]||(o[32]=a=>hn("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[33]||(o[33]=a=>hn("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[34]||(o[34]=a=>hn("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[35]||(o[35]=a=>hn("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[36]||(o[36]=a=>hn("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[37]||(o[37]=a=>hn("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),o[108]||(o[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("bold")}]),onClick:o[39]||(o[39]=e.withModifiers(a=>De("bold"),["stop"])),title:e.unref(F)("textEditor.toolbar.bold")},[...o[96]||(o[96]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("italic")}]),onClick:o[40]||(o[40]=e.withModifiers(a=>De("italic"),["stop"])),title:e.unref(F)("textEditor.toolbar.italic")},[...o[97]||(o[97]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,$u),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("underline")}]),onClick:o[41]||(o[41]=e.withModifiers(a=>De("underline"),["stop"])),title:e.unref(F)("textEditor.toolbar.underline")},[...o[98]||(o[98]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Lu),o[109]||(o[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":nt.value}]),onClick:e.withModifiers(pl,["stop"]),title:e.unref(F)("textEditor.toolbar.citation")},[...o[99]||(o[99]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Hu),o[110]||(o[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(ao,["stop"]),title:e.unref(F)("textEditor.toolbar.removeLink")},[...o[101]||(o[101]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Du)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(fl,["stop"]),title:e.unref(F)("textEditor.toolbar.insertLink")},[...o[100]||(o[100]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Au)),o[111]||(o[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("insertUnorderedList")}]),onClick:e.withModifiers(gl,["stop"]),title:e.unref(F)("textEditor.toolbar.bulletList")},[...o[102]||(o[102]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Ru),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("insertOrderedList")}]),onClick:e.withModifiers(hl,["stop"]),title:e.unref(F)("textEditor.toolbar.numberList")},[...o[103]||(o[103]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Iu),o[112]||(o[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(al,["stop"]),title:e.unref(F)("textEditor.toolbar.image")},[...o[104]||(o[104]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Fu),o[113]||(o[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(F)("textEditor.toolbar.comment"),onClick:e.withModifiers(Qo,["stop"])},[...o[105]||(o[105]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,zu),H.askAi?(e.openBlock(),e.createElementBlock("div",Pu)):e.createCommentVNode("",!0),H.askAi?(e.openBlock(),e.createElementBlock("div",Ou,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:o[42]||(o[42]=e.withModifiers(a=>co("askAi"),["stop"])),title:e.unref(F)("textEditor.toolbar.askAi")},[o[106]||(o[106]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",Zu,e.toDisplayString(e.unref(F)("textEditor.toolbar.askAi")),1)],8,Wu),Qe.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[43]||(o[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),to.value?(e.openBlock(),e.createElementBlock("div",qu,[H.askAi&&to.value?(e.openBlock(),e.createElementBlock("div",Uu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[St(a)&&on(a)?(e.openBlock(),e.createElementBlock("div",Xu,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),St(a)&&on(a)&&r<H.customToolbarSlots.length-1&&xn(r)?(e.openBlock(),e.createElementBlock("div",Yu)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Gu={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Qu=["value"],Ju=["placeholder","value","disabled"],e1=["placeholder","value"],t1={key:0,class:"dss-datepicker__double-wrap"},n1={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},o1=["onClick"],l1={class:"dss-datepicker__double-calendars"},a1={class:"dss-datepicker__double-calendar"},s1={class:"dss-datepicker__calendar-header"},r1=["aria-label"],i1={class:"dss-datepicker__month-year-row"},c1=["aria-label"],d1={class:"dss-datepicker__weekdays"},u1={class:"dss-datepicker__grid"},m1=["disabled","onClick","onMouseenter"],p1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},v1={class:"dss-datepicker__double-calendar"},f1={class:"dss-datepicker__calendar-header"},g1=["aria-label"],h1={class:"dss-datepicker__month-year-row"},y1=["aria-label"],k1={class:"dss-datepicker__weekdays"},C1={class:"dss-datepicker__grid"},b1=["disabled","onClick","onMouseenter"],w1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},x1={class:"dss-datepicker__calendar-header"},E1=["aria-label"],V1={class:"dss-datepicker__month-year-row"},S1=["aria-label"],N1={class:"dss-datepicker__weekdays"},B1={class:"dss-datepicker__grid"},M1=["disabled","onClick","onMouseenter"],_1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},T1={class:"dss-datepicker__calendar-header"},$1={class:"dss-datepicker__month-year-row"},L1={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},H1={class:"dss-datepicker__months-grid"},A1=["onClick"],D1={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},R1={class:"dss-datepicker__month-year"},I1={class:"dss-datepicker__years-grid"},F1=["onClick"],Wl=15,z1={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:H=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(H)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(H,{emit:he}){const D=H,F=he,{t:we,locale:k}=cl.useI18n(),Me=e.ref(!1),ne=e.ref("days"),Fe=e.ref(new Date().getMonth()),p=e.ref(new Date().getFullYear()),ie=e.ref(new Date().getMonth()),be=e.ref(new Date().getFullYear()),fe=e.ref(new Date().getMonth()),j=e.ref(new Date().getFullYear()),_=e.ref("start"),_e=e.ref(null),Pe=e.ref(null),Le=new Date;function Ke(){const $=Le.getMonth(),P=Le.getFullYear(),A=$===11?0:$+1,G=$===11?P+1:P;return{left:{month:$,year:P},right:{month:A,year:G}}}const z=e.ref(null),dt=e.ref(null),ut=e.ref(null),ye=e.ref(null),Dt=e.ref(null),xt=e.ref(null),nt=new Date().getFullYear(),Be=e.computed(()=>["single","singleFromAvailable"].includes(D.mode)),te=e.computed(()=>["range","rangeFromAvailable"].includes(D.mode)),pn=e.computed(()=>{if(D.mode!=="single"&&D.mode!=="singleFromAvailable")return null;const $=D.modelValue;return $ instanceof Date?$:null}),rt=e.computed(()=>{if(!te.value)return{start:null,end:null};const $=D.modelValue;return!$||typeof $!="object"?{start:null,end:null}:{start:$.start instanceof Date?$.start:null,end:$.end instanceof Date?$.end:null}});function Qe($){if(!$||!($ instanceof Date))return"";const P=$.getDate(),A=$.getMonth()+1,G=$.getFullYear(),ke=We=>String(We).padStart(2,"0");return`${ke(P)}/${ke(A)}/${G}`}const sn=e.computed(()=>Qe(pn.value)),Xt=e.computed(()=>{const{start:$,end:P}=rt.value;if(!$&&!P)return"";const A=!P||$&&$<=P?$:P,G=!$||P&&P>=$?P:$;return Ue(A,G)?Qe(A):`${Qe(A)} - ${Qe(G)}`}),se=e.computed(()=>{if(D.mode!=="readonly")return"—";const $=D.modelValue;if($ instanceof Date)return Qe($)||"—";if($&&typeof $=="object"&&("start"in $||"end"in $)){const P=$.start instanceof Date?$.start:null,A=$.end instanceof Date?$.end:null;if(!P&&!A)return"—";const G=!A||P&&P<=A?P:A,ke=!P||A&&A>=P?A:P;return Ue(G,ke)?Qe(G):`${Qe(G)} - ${Qe(ke)}`}return"—"});e.computed(()=>{const $=new Date(p.value,Fe.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format($)});const xe=e.computed(()=>Pe.value==="left"?ie.value:Pe.value==="right"?fe.value:Fe.value),J=e.computed(()=>Pe.value==="left"?be.value:Pe.value==="right"?j.value:p.value),oe=e.computed(()=>{const $=new Date(p.value,Fe.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format($)}),Ye=e.computed(()=>{const $=new Date(J.value,xe.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format($)}),ct=e.computed(()=>{const $=new Intl.DateTimeFormat(k.value,{month:"short"});return Array.from({length:12},(P,A)=>$.format(new Date(2024,A,1)))}),Ze=e.computed(()=>{const P=(Pe.value?J.value:p.value)-Math.floor(Wl/2);return Array.from({length:Wl},(A,G)=>P+G)}),Ve=e.computed(()=>{const $=Ze.value;return $.length?`${$[0]} – ${$[$.length-1]}`:""}),Ot=e.computed(()=>{const $=new Intl.DateTimeFormat(k.value,{weekday:"short"}),P=new Date(2024,0,1),A=[];for(let G=0;G<7;G++){const ke=new Date(P);ke.setDate(P.getDate()+G),A.push($.format(ke).slice(0,2))}return A});function _t($,P){const A=new Date($,P,1),G=new Date($,P+1,0),ke=A.getDay(),We=G.getDate(),Xe=[];for(let Ie=0;Ie<ke;Ie++)Xe.push(null);for(let Ie=1;Ie<=We;Ie++)Xe.push(new Date($,P,Ie));return Xe}const ot=e.computed(()=>_t(p.value,Fe.value)),tn=e.computed(()=>_t(be.value,ie.value)),Rt=e.computed(()=>_t(j.value,fe.value));e.computed(()=>{const $=new Date(be.value,ie.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format($)}),e.computed(()=>{const $=new Date(j.value,fe.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format($)});const ht=e.computed(()=>{const $=new Date(be.value,ie.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format($)}),Tt=e.computed(()=>{const $=new Date(j.value,fe.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format($)}),st=e.computed(()=>D.availableDates&&D.availableDates.length>0),nn=e.computed(()=>st.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),tt=e.ref({top:0,left:0});function yt(){if(!ye.value||!Me.value)return;const $=ye.value.getBoundingClientRect(),P=window.innerWidth||document.documentElement.clientWidth,A=window.innerHeight||document.documentElement.clientHeight;let G=$.left,ke=$.bottom+4;const We=Dt.value;if(We){const Xe=We.offsetWidth,Ie=We.offsetHeight;if(G+Xe>P-8&&(G=$.right-Xe,G<8&&(G=8)),ke+Ie>A-8){const je=$.top-4-Ie;je>=8?ke=je:ke=Math.max(8,A-Ie-8)}}tt.value={top:ke,left:G}}const Te=e.computed(()=>!ye.value||!Me.value?{}:{position:"fixed",left:`${tt.value.left}px`,top:`${tt.value.top}px`,zIndex:1002});function Ue($,P){return!$||!P?!1:$.getFullYear()===P.getFullYear()&&$.getMonth()===P.getMonth()&&$.getDate()===P.getDate()}function O($){return new Date($.getFullYear(),$.getMonth(),$.getDate()).getTime()}function Z($){return!D.availableDates||!D.availableDates.length?!0:D.availableDates.some(P=>P instanceof Date&&Ue(P,$))}function X($){const P=O($);return!(D.minDate instanceof Date&&P<O(D.minDate)||D.maxDate instanceof Date&&P>O(D.maxDate))}function Q($){return!D.exceptDates||!D.exceptDates.length?!1:D.exceptDates.some(P=>P instanceof Date&&Ue(P,$))}function ge($){return Q($)?!1:["singleFromAvailable","rangeFromAvailable"].includes(D.mode)?Z($):X($)}function et($){const P=pn.value,A=rt.value,G=O($),ke=te.value&&A.start&&A.end&&G>O(A.start)&&G<O(A.end),We=te.value&&A.start&&Ue($,A.start),Xe=te.value&&A.end&&Ue($,A.end),Ie=We&&Xe,je=Be.value&&P&&Ue($,P)||We||Xe;let St=!1;if(te.value&&A.start&&!A.end&&_e.value){const $n=O(A.start),xn=O(_e.value),on=Math.min($n,xn),to=Math.max($n,xn);St=G>on&&G<to}return{"dss-datepicker__day--selected":je&&!Ie,"dss-datepicker__day--range-start":We&&!Ie,"dss-datepicker__day--range-end":Xe&&!Ie,"dss-datepicker__day--range-single":Ie,"dss-datepicker__day--in-range":ke&&!We&&!Xe,"dss-datepicker__day--in-range-preview":St&&!We&&!Xe&&!ke,"dss-datepicker__day--disabled":!ge($)}}function Se($){if(!te.value)return;const P=rt.value;if(!P.start||P.end){_e.value=null;return}if(!ge($)){_e.value=null;return}_e.value=new Date($.getFullYear(),$.getMonth(),$.getDate())}function Oe(){_e.value=null}function mt(){if(!D.doubleCalendar||!te.value)return;const $=rt.value,{start:P,end:A}=$;if(P&&A){const We=P<=A?P:A,Xe=P<=A?A:P,Ie=We.getMonth(),je=We.getFullYear(),St=Xe.getMonth(),$n=Xe.getFullYear();if(Ie!==St||je!==$n){const xn=ie.value===Ie&&be.value===je,on=fe.value===St&&j.value===$n;if(xn&&on)return;ie.value=Ie,be.value=je,fe.value=St,j.value=$n}else{const xn=Ie===0?11:Ie-1,on=Ie===0?je-1:je;ie.value===xn&&be.value===on&&fe.value===Ie&&j.value===je||(ie.value=Ie,be.value=je,Ie===11?(fe.value=0,j.value=je+1):(fe.value=Ie+1,j.value=je))}return}const G=P||A;if(G){const We=G.getMonth(),Xe=G.getFullYear(),Ie=ie.value===We&&be.value===Xe,je=fe.value===We&&j.value===Xe;if(Ie||je)return;ie.value=We,be.value=Xe,We===11?(fe.value=0,j.value=Xe+1):(fe.value=We+1,j.value=Xe);return}const ke=Ke();ie.value=ke.left.month,be.value=ke.left.year,fe.value=ke.right.month,j.value=ke.right.year}function Et($="start"){if(D.mode==="readonly")return;_.value=$;const P=pn.value,A=rt.value;if(Be.value&&P)Fe.value=P.getMonth(),p.value=P.getFullYear();else if(te.value)if(D.doubleCalendar)mt();else{const G=$==="start"&&A.start?A.start:A.end||A.start;G&&(Fe.value=G.getMonth(),p.value=G.getFullYear())}ye.value=Be.value?z.value?.closest(".dss-datepicker__input-wrap"):dt.value,ne.value="days",Pe.value=null,Me.value=!0,e.nextTick(()=>{yt()})}function Nt(){ne.value="days",Pe.value=null,_e.value=null,Me.value=!1}function $t($,P){Pe.value=$,ne.value=P}function Ae(){ne.value="days",Pe.value=null}function It($){const P=new Date,A=P.getFullYear(),G=P.getMonth(),ke=P.getDate();let We,Xe;if(st.value){const Ie=[...D.availableDates].filter(je=>je instanceof Date).map(je=>new Date(je.getFullYear(),je.getMonth(),je.getDate()));if(Ie.sort((je,St)=>je.getTime()-St.getTime()),Ie.length===0)return;if($==="all")We=Ie[0],Xe=Ie[Ie.length-1];else{const je=parseInt($.replace("last",""),10);if(je<2||je>5)return;const St=Ie.slice(-je);We=St[0],Xe=St[St.length-1]}}else{const Ie=new Date(A,G,ke);switch($){case"today":We=Ie,Xe=Ie;break;case"lastWeek":We=new Date(A,G,ke-6),Xe=Ie;break;case"last15Days":We=new Date(A,G,ke-14),Xe=Ie;break;case"last30Days":We=new Date(A,G,ke-29),Xe=Ie;break;case"thisMonth":We=new Date(A,G,1),Xe=Ie;break;case"last3Months":We=new Date(A,G-3,1),Xe=new Date(A,G,0);break;case"last6Months":We=new Date(A,G-6,1),Xe=new Date(A,G,0);break;case"last12Months":We=new Date(A,G-12,1),Xe=new Date(A,G,0);break;case"lastYear":We=new Date(A-1,0,1),Xe=new Date(A-1,11,31);break;default:return}}F("update:modelValue",{start:We,end:Xe}),mt()}function gt($){Pe.value==="left"?ie.value=$:Pe.value==="right"?fe.value=$:Fe.value=$,Ae()}function Sn($){Pe.value==="left"?be.value=$:Pe.value==="right"?j.value=$:p.value=$,Ae()}function Wt(){Fe.value===0?(Fe.value=11,p.value--):Fe.value--}function Vt(){Fe.value===11?(Fe.value=0,p.value++):Fe.value++}function Bt(){ie.value===0?(ie.value=11,be.value--):ie.value--}function _n(){ie.value===11?(ie.value=0,be.value++):ie.value++}function Tn(){fe.value===0?(fe.value=11,j.value--):fe.value--}function rn(){fe.value===11?(fe.value=0,j.value++):fe.value++}function cn($){if(!ge($))return;const P=new Date($.getFullYear(),$.getMonth(),$.getDate());if(Be.value){F("update:modelValue",P),Nt();return}const A=rt.value;if(!A.start&&!A.end){F("update:modelValue",{start:P,end:null}),_.value="end";return}if(A.start&&A.end){F("update:modelValue",{start:P,end:null}),_.value="end";return}if(_.value==="start"){let G=P,ke=A.end;G&&ke&&G>ke&&([G,ke]=[ke,G]),F("update:modelValue",{start:G||ke,end:ke||G}),_.value="end"}else{let G=A.start,ke=P;G&&ke&&ke<G&&([G,ke]=[ke,G]),F("update:modelValue",{start:G||ke,end:ke||G}),_.value="start"}}e.watch(rt,()=>{D.doubleCalendar&&te.value&&Me.value&&mt()},{deep:!0});let Yt=null,dn=null,On=null;function mo(){Yt&&(document.removeEventListener("keydown",Yt),Yt=null),dn&&(window.removeEventListener("resize",dn),dn=null),On&&(window.removeEventListener("scroll",On,!0),On=null)}return e.watch(Me,$=>{mo(),$&&(Yt=P=>{P.key==="Escape"&&(ne.value==="years"||ne.value==="months"?Ae():Nt())},dn=()=>{yt()},On=()=>{yt()},document.addEventListener("keydown",Yt),window.addEventListener("resize",dn),window.addEventListener("scroll",On,!0))}),e.onBeforeUnmount(()=>{mo()}),($,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":H.mode==="readonly"}])},[H.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Gu,[P[9]||(P[9]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:se.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Qu)])):Be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:P[0]||(P[0]=A=>Et("start"))},[P[10]||(P[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:z,type:"text",class:"dss-datepicker__input",placeholder:e.unref(we)("datepicker.selectDate"),value:sn.value,readonly:"",disabled:H.mode==="readonly"},null,8,Ju)])):te.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:dt,onClick:P[1]||(P[1]=A=>Et("start"))},[P[11]||(P[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:ut,type:"text",class:"dss-datepicker__input",placeholder:e.unref(we)("datepicker.selectRange"),value:Xt.value,readonly:""},null,8,e1)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Me.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Nt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Dt,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":H.doubleCalendar&&te.value&&ne.value==="days","dss-datepicker__dropdown--quick-select":H.doubleCalendar&&te.value&&ne.value==="days"&&H.quickSelect}]),style:e.normalizeStyle(Te.value)},[ne.value==="days"&&H.doubleCalendar&&te.value?(e.openBlock(),e.createElementBlock("div",t1,[H.quickSelect?(e.openBlock(),e.createElementBlock("nav",n1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nn.value,A=>(e.openBlock(),e.createElementBlock("button",{key:A.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:G=>It(A.id)},e.toDisplayString(e.unref(we)(A.labelKey)),9,o1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",l1,[e.createElementVNode("div",a1,[e.createElementVNode("div",s1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.prevMonth"),onClick:Bt}," ‹ ",8,r1),e.createElementVNode("div",i1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[2]||(P[2]=A=>$t("left","months"))},e.toDisplayString(ht.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[3]||(P[3]=A=>$t("left","years"))},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.nextMonth"),onClick:_n}," › ",8,c1)]),e.createElementVNode("div",d1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ot.value,A=>(e.openBlock(),e.createElementBlock("span",{key:A,class:"dss-datepicker__weekday"},e.toDisplayString(A),1))),128))]),e.createElementVNode("div",u1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn.value,(A,G)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+G},[A?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",et(A)]),disabled:!ge(A),onClick:ke=>cn(A),onMouseenter:ke=>Se(A),onMouseleave:Oe},e.toDisplayString(A.getDate()),43,m1)):(e.openBlock(),e.createElementBlock("span",p1))],64))),128))])]),e.createElementVNode("div",v1,[e.createElementVNode("div",f1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.prevMonth"),onClick:Tn}," ‹ ",8,g1),e.createElementVNode("div",h1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[4]||(P[4]=A=>$t("right","months"))},e.toDisplayString(Tt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[5]||(P[5]=A=>$t("right","years"))},e.toDisplayString(j.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.nextMonth"),onClick:rn}," › ",8,y1)]),e.createElementVNode("div",k1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ot.value,A=>(e.openBlock(),e.createElementBlock("span",{key:A,class:"dss-datepicker__weekday"},e.toDisplayString(A),1))),128))]),e.createElementVNode("div",C1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt.value,(A,G)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+G},[A?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",et(A)]),disabled:!ge(A),onClick:ke=>cn(A),onMouseenter:ke=>Se(A),onMouseleave:Oe},e.toDisplayString(A.getDate()),43,b1)):(e.openBlock(),e.createElementBlock("span",w1))],64))),128))])])])])):ne.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",x1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.prevMonth"),onClick:Wt}," ‹ ",8,E1),e.createElementVNode("div",V1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[6]||(P[6]=A=>ne.value="months")},e.toDisplayString(oe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[7]||(P[7]=A=>ne.value="years")},e.toDisplayString(p.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.nextMonth"),onClick:Vt}," › ",8,S1)]),e.createElementVNode("div",N1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ot.value,A=>(e.openBlock(),e.createElementBlock("span",{key:A,class:"dss-datepicker__weekday"},e.toDisplayString(A),1))),128))]),e.createElementVNode("div",B1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value,(A,G)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:G},[A?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",et(A)]),disabled:!ge(A),onClick:ke=>cn(A),onMouseenter:ke=>Se(A),onMouseleave:Oe},e.toDisplayString(A.getDate()),43,M1)):(e.openBlock(),e.createElementBlock("span",_1))],64))),128))])],64)):ne.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",T1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:Ae}," ‹ "),e.createElementVNode("div",$1,[e.createElementVNode("span",L1,e.toDisplayString(Ye.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[8]||(P[8]=A=>ne.value="years")},e.toDisplayString(J.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:Ae}," › ")]),e.createElementVNode("div",H1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ct.value,(A,G)=>(e.openBlock(),e.createElementBlock("button",{key:G,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":G===xe.value}]),onClick:ke=>gt(G)},e.toDisplayString(A),11,A1))),128))])],64)):ne.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",D1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:Ae}," ‹ "),e.createElementVNode("span",R1,e.toDisplayString(Ve.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:Ae}," › ")]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:xt},[e.createElementVNode("div",I1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,A=>(e.openBlock(),e.createElementBlock("button",{key:A,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":A===J.value,"dss-datepicker__year-cell--current":A===e.unref(nt)}]),onClick:G=>Sn(A)},e.toDisplayString(A),11,F1))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},P1={class:"dss-color-picker__section-title"},O1={class:"dss-color-picker__presets-row"},W1=["title","onClick"],Z1={key:1,class:"dss-color-picker__section"},q1={class:"dss-color-picker__presets-row"},U1=["title","onClick"],X1={class:"dss-color-picker__section"},Y1={class:"dss-color-picker__section-header"},j1={class:"dss-color-picker__presets-row"},K1=["title","onClick"],G1=["onClick"],Q1={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},J1=["title","onClick"],em={class:"dss-color-picker__input-row"},tm=["value"],nm={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null}},emits:["update:modelValue","update:presetColors"],setup(H,{emit:he}){function D(O){const Z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(O);if(!Z)return{h:0,s:0,l:50};const X=parseInt(Z[1],16)/255,Q=parseInt(Z[2],16)/255,ge=parseInt(Z[3],16)/255,et=Math.max(X,Q,ge),Se=Math.min(X,Q,ge);let Oe=0,mt=0;const Et=(et+Se)/2;if(et!==Se){const Nt=et-Se;switch(mt=Et>.5?Nt/(2-et-Se):Nt/(et+Se),et){case X:Oe=((Q-ge)/Nt+(Q<ge?6:0))/6;break;case Q:Oe=((ge-X)/Nt+2)/6;break;case ge:Oe=((X-Q)/Nt+4)/6;break}}return{h:Oe*360,s:mt*100,l:Et*100}}function F(O,Z,X){Z/=100,X/=100;const Q=Z*Math.min(X,1-X),ge=et=>{const Se=(et+O/30)%12,Oe=X-Q*Math.max(Math.min(Se-3,9-Se,1),-1);return Math.round(255*Oe).toString(16).padStart(2,"0")};return`#${ge(0)}${ge(8)}${ge(4)}`}function we(O){const Z=O.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Z)return null;let X=Z[1];return X.length===3&&(X=X.split("").map(Q=>Q+Q).join("")),"#"+X}function k(O,Z,X){Z/=100,X/=100;const Q=X+Z*Math.min(X,1-X),ge=Q===0?0:2-2*X/Q;return{h:O,s:ge*100,v:Q*100}}function Me(O,Z,X){Z/=100,X/=100;const Q=X*(1-Z/2),ge=Q===0||Q===1?0:(X-Q)/Math.min(Q,1-Q);return{h:O,s:ge*100,l:Q*100}}const ne=H,Fe=he,p=e.ref(!1),ie=e.ref(!1),be=e.ref(!1),fe=e.ref(-1),j=e.ref(-1),_=e.ref(null),_e=e.ref(null),Pe=e.ref(null),Le=e.ref(null),Ke=e.ref({top:0,left:0}),z=e.ref(D(ne.modelValue||"#b8a5de")),dt=e.computed(()=>Array.isArray(ne.presetGroups)&&ne.presetGroups.length>0),ut=e.computed(()=>dt.value?0:ne.initialPresetCount!=null?ne.initialPresetCount:j.value<0?null:j.value),ye=e.computed(()=>{const O=ut.value;return O==null?!0:Math.max(0,ne.presetColors.length-O)<ne.max}),Dt=e.computed(()=>!!(ie.value||fe.value>=0||!xt.value&&ne.presetColors.length===0));e.computed(()=>{const O=ut.value;return O!=null&&ne.presetColors.length>O});const xt=e.computed(()=>dt.value||ut.value!=null),nt=e.computed(()=>{const O=ut.value;return O==null?[]:ne.presetColors.slice(0,O)}),Be=e.computed(()=>{const O=ut.value;return O==null?[]:ne.presetColors.slice(O)});function te(O){const Z=ut.value;return Z!=null?Z+O:-1}function pn(O){const Z=ut.value;return Z!=null&&O>=Z}function rt(O){pn(O)&&(fe.value=O,z.value=D(ne.presetColors[O]),ie.value=!0,e.nextTick(()=>Le.value?.focus()))}function Qe(O){if(!pn(O))return;const Z=ne.presetColors.filter((ge,et)=>et!==O);Fe("update:presetColors",Z);const X=we(ne.modelValue),Q=we(ne.presetColors[O]);if(X&&Q&&X.toLowerCase()===Q.toLowerCase()){const ge=Z[Math.max(0,O-1)]||Z[0];ge&&Fe("update:modelValue",ge)}}function sn(){be.value=!be.value,be.value||(fe.value=-1,ie.value=!1)}function Xt(){if(fe.value<0)return;const O=oe.value,Z=we(O);if(Z){const X=[...ne.presetColors];X[fe.value]=Z,Fe("update:presetColors",X),Fe("update:modelValue",Z),fe.value=-1,ie.value=!1}}function se(){ne.disabled||(fe.value=-1,ie.value=!ie.value,ie.value&&(ot(),e.nextTick(()=>Le.value?.focus())))}function xe(O){const Z=we(O),X=we(ne.modelValue);return Z&&X&&Z.toLowerCase()===X.toLowerCase()}function J(){if(ne.disabled||!ye.value)return;const O=oe.value,Z=we(O);if(Z){const X=[...ne.presetColors,Z];Fe("update:presetColors",X),Fe("update:modelValue",Z);const Q=ut.value??j.value;Q>=0&&X.length-Q>=ne.max&&(ie.value=!1)}}const oe=e.computed(()=>{const{h:O,s:Z,l:X}=z.value;return F(O,Z,X)}),Ye=e.computed(()=>oe.value.toLowerCase()),ct=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${z.value.h}, 100%, 50%))`})),Ze=e.computed(()=>{const O=k(z.value.h,z.value.s,z.value.l);return{left:`${O.s}%`,bottom:`${O.v}%`,transform:"translate(-50%, 50%)"}}),Ve=e.computed(()=>({left:`${z.value.h/360*100}%`,transform:"translateX(-50%)"})),Ot=e.computed(()=>({position:"fixed",left:`${Ke.value.left}px`,top:`${Ke.value.top}px`,zIndex:1002}));function _t(){if(!_.value||!p.value)return;const O=_.value.getBoundingClientRect(),Z=window.innerHeight||document.documentElement.clientHeight;let X=O.bottom+4;const Q=_e.value;Q&&X+Q.offsetHeight>Z-8&&(X=O.top-4-Q.offsetHeight),Ke.value={top:X,left:O.left}}function ot(){const O=ne.modelValue||"#b8a5de";we(O)&&(z.value=D(O))}function tn(){Fe("update:modelValue",oe.value)}function Rt(){ne.disabled||(p.value=!p.value,p.value&&(ot(),e.nextTick(()=>{_t(),Le.value?.focus()})))}function ht(){const O=oe.value,Z=we(O);if(Z){if(fe.value>=0){const X=[...ne.presetColors];X[fe.value]=Z,Fe("update:presetColors",X),Fe("update:modelValue",Z)}else if((ne.presetColors.length>0||dt.value)&&ie.value&&ye.value&&!ne.presetColors.some(Q=>we(Q)?.toLowerCase()===Z.toLowerCase())){const Q=[...ne.presetColors,Z];Fe("update:presetColors",Q),Fe("update:modelValue",Z)}}p.value=!1,ie.value=!1,be.value=!1,fe.value=-1}function Tt(O){if(!Pe.value)return;const Z=Pe.value.getBoundingClientRect(),X=Q=>{const ge=Math.max(0,Math.min(1,(Q.clientX-Z.left)/Z.width)),et=Math.max(0,Math.min(1,1-(Q.clientY-Z.top)/Z.height)),Se={h:z.value.h,s:ge*100,v:et*100};z.value=Me(Se.h,Se.s,Se.v)};X(O),document.addEventListener("mousemove",X),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",X),tn()},{once:!0})}function st(O){if(!O.currentTarget)return;const X=O.currentTarget.getBoundingClientRect(),Q=ge=>{const et=Math.max(0,Math.min(1,(ge.clientX-X.left)/X.width));z.value={...z.value,h:et*360}};Q(O),document.addEventListener("mousemove",Q),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",Q),tn()},{once:!0})}function nn(O){const Z=O.target.value,X=we(Z);X&&(z.value=D(X),Fe("update:modelValue",X))}function tt(O){if(ne.disabled)return;const Z=we(O);Z&&(z.value=D(Z),Fe("update:modelValue",Z))}let yt=null,Te=null;function Ue(){yt&&(document.removeEventListener("keydown",yt),yt=null),Te&&(window.removeEventListener("resize",Te),Te=null)}return e.watch(p,O=>{if(Ue(),O){if(!dt.value&&ne.initialPresetCount==null){const Z=ne.presetColors.length;Z>0&&(j.value<0||Z<j.value)&&(j.value=Z)}yt=Z=>{Z.key==="Escape"&&ht()},Te=_t,document.addEventListener("keydown",yt),window.addEventListener("resize",Te)}}),e.watch(()=>ne.modelValue,()=>{p.value&&ot()},{immediate:!1}),e.watch(Be,O=>{O.length===0&&(be.value=!1,fe.value=-1,ie.value=!1)}),e.onBeforeUnmount(Ue),(O,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":H.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:_,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":p.value}]),onClick:Rt},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:oe.value})},[...Z[0]||(Z[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(ht,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:_e,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Ot.value)},[xt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[dt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(H.presetGroups,(X,Q)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+Q,class:"dss-color-picker__section"},[e.createElementVNode("span",P1,e.toDisplayString(X.title),1),e.createElementVNode("div",O1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.colors,(ge,et)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+Q+"-"+et,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xe(ge)}]),style:e.normalizeStyle({backgroundColor:ge}),title:ge,onClick:e.withModifiers(Se=>tt(ge),["stop"])},null,14,W1))),128))])]))),128)):nt.value.length?(e.openBlock(),e.createElementBlock("div",Z1,[Z[1]||(Z[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",q1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value,(X,Q)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+Q,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xe(X)}]),style:e.normalizeStyle({backgroundColor:X}),title:X,onClick:e.withModifiers(ge=>tt(X),["stop"])},null,14,U1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",X1,[e.createElementVNode("div",Y1,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Be.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":be.value}]),title:"Manage custom colors",onClick:e.withModifiers(sn,["stop"])},[...Z[2]||(Z[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",j1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value,(X,Q)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+Q,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":be.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!be.value&&xe(X),"dss-color-picker__preset-bubble--editing":be.value&&fe.value===te(Q)}]),style:e.normalizeStyle({backgroundColor:fe.value===te(Q)?oe.value:X}),title:fe.value===te(Q)?oe.value:X,onClick:e.withModifiers(ge=>be.value?rt(te(Q)):tt(X),["stop"])},null,14,K1),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(ge=>Qe(te(Q)),["stop"])},[...Z[4]||(Z[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,G1)):e.createCommentVNode("",!0)],2))),128)),ye.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ie.value}]),onClick:e.withModifiers(se,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):H.presetColors.length?(e.openBlock(),e.createElementBlock("div",Q1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.presetColors,(X,Q)=>(e.openBlock(),e.createElementBlock("button",{key:Q,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xe(X)}]),style:e.normalizeStyle({backgroundColor:X}),title:X,onClick:e.withModifiers(ge=>tt(X),["stop"])},null,14,J1))),128)),ye.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ie.value}]),onClick:e.withModifiers(se,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Dt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Pe,onMousedown:Tt},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(ct.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Ze.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:st},[Z[5]||(Z[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Ve.value)},null,4)],32),e.createElementVNode("div",em,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Le,type:"text",class:"dss-color-picker__hex-input",value:Ye.value,onInput:nn},null,40,tm)]),xt.value&&(H.presetColors.length||dt.value)&&ye.value&&fe.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:J}," Save color ")):e.createCommentVNode("",!0),xt.value&&fe.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Xt}," Save color ")):e.createCommentVNode("",!0),xt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:ht}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},om={key:0,class:"dss-loader"},lm={key:0,class:"dss-loader-label"},am={key:1,class:"dss-loader"},sm={key:0,class:"dss-loader-label"},rm={key:2,class:"dss-loader"},im={key:0,class:"dss-loader-label"},cm={key:3,class:"dss-loader"},dm={key:0,class:"dss-loader-label"},um={key:4,class:"dss-loader"},mm={key:0,class:"dss-loader-label"},pm={key:5,class:"dss-loader dss-loader--inline"},vm={class:"dss-loader-inline-text"},fm={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"}},setup(H){const he=H,D=e.computed(()=>he.size==="small"?"dss-loaders--size-small":he.size==="large"?"dss-loaders--size-large":he.size==="medium"||he.size==null?"dss-loaders--size-medium":null),F=e.computed(()=>he.size==="small"||he.size==="medium"||he.size==="large"||he.size==null?{}:{"--dss-loader-size":typeof he.size=="number"?`${he.size}px`:String(he.size)});return(we,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",D.value]),style:e.normalizeStyle(F.value)},[H.type==="spinner"?(e.openBlock(),e.createElementBlock("div",om,[k[0]||(k[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),H.label?(e.openBlock(),e.createElementBlock("span",lm,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="dots"?(e.openBlock(),e.createElementBlock("div",am,[k[1]||(k[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),H.label?(e.openBlock(),e.createElementBlock("span",sm,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="battery"?(e.openBlock(),e.createElementBlock("div",rm,[k[2]||(k[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),H.label?(e.openBlock(),e.createElementBlock("span",im,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",cm,[k[3]||(k[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),H.label?(e.openBlock(),e.createElementBlock("span",dm,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="bars"?(e.openBlock(),e.createElementBlock("div",um,[k[4]||(k[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),H.label?(e.openBlock(),e.createElementBlock("span",mm,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="inline"?(e.openBlock(),e.createElementBlock("div",pm,[k[5]||(k[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",vm,[e.renderSlot(we.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(H.label),1)])])])):e.createCommentVNode("",!0)],6))}},Zl="dss-skeleton-item",gm={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:H=>["single","multiple"].includes(H)},targetClass:{type:String,default:Zl},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(H){const he=H,D=e.computed(()=>{const k={"dss-skeleton--loading":he.loading,"dss-skeleton--static":!he.shimmer,"dss-skeleton--multiple":he.mode==="multiple","dss-skeleton--dark":he.darkMode};return he.mode==="multiple"&&he.targetClass!==Zl&&(k[`dss-skeleton--target-${he.targetClass}`]=!0),k}),F=e.computed(()=>{const k={};return he.borderRadius&&(k.borderRadius=he.borderRadius),k}),we=e.computed(()=>{const k={};return he.darkMode?(k["--dss-skeleton-bg"]=he.bgDark||"#322c3f",k["--dss-skeleton-shimmer"]=he.shimmerDark||"#3e3f41",k):(he.bgColor&&(k["--dss-skeleton-bg"]=he.bgColor),he.shimmerColor&&(k["--dss-skeleton-shimmer"]=he.shimmerColor),k)});return(k,Me)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",D.value]),style:e.normalizeStyle(we.value)},[H.loading&&H.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(F.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":H.loading&&H.mode==="single"}])},[e.renderSlot(k.$slots,"default")],2)],6))}},hm={key:0,class:"dss-dnd-column-header"},ym={class:"dss-dnd-column-title"},km={class:"dss-dnd-column-count"},Cm=["data-column"],bm={key:0,class:"dss-dnd-indicator"},wm=["onPointerdown"],xm=["onPointerdown"],Em={class:"dss-dnd-item-content"},Vm={class:"dss-dnd-item-default"},Sm={key:0,class:"dss-dnd-empty"},Nm={name:"DSSDnd"},Bm=Object.assign(Nm,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move"],setup(H,{emit:he}){const D=H,F=he,we={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1},k=e.computed(()=>({...we,...D.options})),Me=e.computed(()=>({"--dss-dnd-col-min-w":k.value.columnMinWidth,"--dss-dnd-col-max-w":k.value.columnMaxWidth,"--dss-dnd-col-gap":k.value.columnGap,"--dss-dnd-indicator-color":k.value.indicatorColor,"--dss-dnd-body-max-h":k.value.columnBodyMaxHeight})),ne=e.ref(null),Fe=e.ref(null),p=e.ref(-1),ie=e.ref(null);let be=null,fe=null,j=null,_=null,_e=0,Pe=0;const Le=e.computed(()=>{const se={};for(const xe of D.columns)se[xe.value]=D.items.filter(J=>J[D.columnKey]===xe.value).sort((J,oe)=>(J[D.positionKey]??0)-(oe[D.positionKey]??0));return se}),Ke=e.computed(()=>{const se={},xe=!!ne.value,J=ne.value?.[D.itemKey],oe=Fe.value,Ye=p.value;for(const ct of D.columns){const Ze=Le.value[ct.value]||[],Ve=[],Ot=oe===ct.value;let _t=0;for(let ot=0;ot<Ze.length;ot++){const tn=Ze[ot],Rt=xe&&tn[D.itemKey]===J;!Rt&&Ot&&Ye===_t&&Ve.push({type:"indicator",key:`ind-${_t}`}),Rt||_t++,Ve.push({type:"item",item:tn,isDragged:Rt,key:`item-${tn[D.itemKey]}`})}Ot&&Ye>=_t&&Ve.push({type:"indicator",key:"ind-end"}),se[ct.value]=Ve}return se});function z(se,xe){const oe=(Le.value[se]||[]).filter(Ze=>Ze[D.itemKey]!==ne.value?.[D.itemKey]);if(oe.length===0)return 1;if(xe<=0){const Ze=oe[0][D.positionKey];return Ze!=null&&Ze>0?Ze/2:.5}if(xe>=oe.length){const Ze=oe[oe.length-1][D.positionKey];return(Ze??0)+1}const Ye=oe[xe-1][D.positionKey]??0,ct=oe[xe][D.positionKey]??0;return(Ye+ct)/2}function dt(se,xe,J){j&&j.remove();const oe=se.getBoundingClientRect(),Ye=se.cloneNode(!0);Ye.classList.add("dss-dnd-ghost"),Ye.style.cssText=`
|
|
84
|
+
`){const h=document.createTextNode(" ");o.insertNode(h),o.setStartAfter(h)}}o.insertNode(u);const d=document.createTextNode(" ");o.setStartAfter(u),o.insertNode(d),o.setStartAfter(d),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}}I()}e.nextTick(()=>{gn(),In()})},ll=()=>{if(!p.value||ge.value)return;const l=window.getSelection();let o=null;l&&l.rangeCount>0&&(o=ze());const a=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(p.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),i=[];let u;for(;u=r.nextNode();)i.push(u);let d=!1;for(let m=i.length-1;m>=0;m--){const v=i[m],h=v.textContent;a.lastIndex=0;const S=[...h.matchAll(a)];if(S.length===0)continue;const N=S.filter(W=>{const Ce=W[0],le=W.index;if(le>0&&h[le-1]==="@"||le+Ce.length<h.length&&h[le+Ce.length]==="@")return!1;const Ge=v.parentElement;return!(Ge&&Ge.closest("a"))});if(N.length===0)continue;if(N.length===1&&N[0][0]===h.trim()){const W=N[0][0],Ce=W.startsWith("http://")||W.startsWith("https://")?W:`https://${W}`,le=document.createElement("a");le.href=Ce,le.textContent=W,le.style.color="#60afdf",le.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(le,v),d=!0);continue}let w=0;const U=document.createDocumentFragment();if(N.forEach(W=>{const Ce=W.index,le=W[0];if(Ce>w){const At=h.substring(w,Ce);At&&U.appendChild(document.createTextNode(At))}const Ge=le.startsWith("http://")||le.startsWith("https://")?le:`https://${le}`,en=document.createElement("a");en.href=Ge,en.textContent=le,en.style.color="#60afdf",en.style.textDecoration="underline",U.appendChild(en),w=Ce+le.length}),w<h.length){const W=h.substring(w);W&&U.appendChild(document.createTextNode(W))}v.parentNode&&U.childNodes.length>0&&(v.parentNode.replaceChild(U,v),d=!0)}d&&o&&e.nextTick(()=>{jt(o),gn()})},zt=()=>{if(!p.value)return;const l=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,o=document.createTreeWalker(p.value,NodeFilter.SHOW_TEXT,{acceptNode:i=>{const u=i.parentElement;return!u||u.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=o.nextNode();)a.push(r);for(let i=a.length-1;i>=0;i--){const u=a[i],d=u.textContent,m=[...d.matchAll(l)];if(m.length===0)continue;let v=0;const h=document.createDocumentFragment();m.forEach(S=>{const N=S.index,w=S[0].startsWith("<u>")?"u":"ins",U=S[1]||S[2]||"";N>v&&h.appendChild(document.createTextNode(d.substring(v,N)));const W=document.createElement(w);W.textContent=U,h.appendChild(W),v=N+S[0].length}),v<d.length&&h.appendChild(document.createTextNode(d.substring(v))),u.parentNode&&h.childNodes.length>0&&u.parentNode.replaceChild(h,u)}},Jt=l=>{if(!p.value||ge.value)return;if(!l){zt();return}if(!["*","_",">"].includes(l))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const i=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!i||i===p.value||!p.value.contains(i))return;const u=()=>{let At="",Pt=0,Gt=!1;const Zt=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:an=>an.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(i,NodeFilter.SHOW_TEXT,null);let qt=0;for(;Zt.nextNode();){const an=Zt.currentNode,Un=an.textContent||"",zn=qt;if(qt+=Un.length,an===r.startContainer){At+=Un.substring(0,r.startOffset),Pt=zn+r.startOffset,Gt=!0;break}At+=Un}return Gt||(Pt=At.length),{textBeforeCursor:At,cursorCharOffset:Pt}},{textBeforeCursor:d}=u();if(!d.length)return;let m=null,v=null;if(d.endsWith("**")&&(m=d.match(/\*\*(.+?)\*\*$/s))||d.endsWith("__")&&(m=d.match(/__(.+?)__$/s))?v="strong":d.endsWith("*")&&!d.endsWith("**")&&(m=d.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||d.endsWith("_")&&!d.endsWith("__")&&(m=d.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":l===">"&&((m=d.match(/<u>(.+?)<\/u>$/s))||(m=d.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],S=m[1],N=d.length-h.length,U=(At=>{let Pt=0;const Gt=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:qt=>qt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Zt;for(;Zt=Gt.nextNode();){const qt=(Zt.textContent||"").length;if(Pt+qt>=At)return{node:Zt,offset:At-Pt};Pt+=qt}return null})(N);if(!U)return;const W=document.createRange();W.setStart(U.node,U.offset),W.setEnd(r.endContainer,r.endOffset);const Ce=document.createElement(v);Ce.textContent=S,W.deleteContents(),W.insertNode(Ce);const le=window.getSelection(),Ge=document.createRange();Ge.setStartAfter(Ce),Ge.collapse(!0),le.removeAllRanges(),le.addRange(Ge);const en=ze();e.nextTick(()=>{I(),en&&jt(en)})},al=()=>{p.value&&(Ot.value=ze(),Xt.value="",xe.value="",Tt.value="",J.value="",oe.value="",se.value=null,Ve.value=null,ht.value="upload",sn.value=!0,bt(),e.nextTick(()=>{Ye.value&&Ye.value.focus(),ct.value&&(ct.value.value="")}))},El=l=>{const o=l.target?.files?.[0];if(!o){se.value=null,xe.value="";return}se.value=o;const a=new FileReader;a.onload=r=>{xe.value=r.target?.result||""},a.readAsDataURL(o)},sl=()=>{ct.value&&ct.value.click()},Vl=()=>{J.value&&(oe.value="")},rl=()=>{oe.value&&(J.value="")},Ht=()=>{let l=Ve.value;if(!l){const o=window.getSelection();if(o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(l){const o=l.getAttribute("data-alt")||l.getAttribute("alt")||"";Ve.value=l,Xt.value=o.trim()===""||o.trim()==="Image"?"":o;const a=l.getAttribute("src")||l.src||"";a.startsWith("http://")||a.startsWith("https://")?(Tt.value=a,xe.value="",ht.value="url"):(xe.value=a,Tt.value="",ht.value="upload");const i=l.style.width||l.getAttribute("width")||"",u=l.style.height||l.getAttribute("height")||"";J.value=i.endsWith("px")?i.replace("px",""):i,oe.value=u.endsWith("px")?u.replace("px",""):u,Ot.value=null}else{al();return}sn.value=!0,Rt.value=!1,_t.value=!1,e.nextTick(()=>{ht.value==="url"&&Ze.value?(Ze.value.focus(),Ze.value.select()):Ye.value&&(Ye.value.focus(),Ye.value.select()),ct.value&&(ct.value.value="")})},Ao=()=>{sn.value=!1,Xt.value="",xe.value="",Tt.value="",J.value="",oe.value="",se.value=null,Ve.value=null,Ot.value=null,ht.value="upload"},qn=()=>{const l=(Xt.value||"").trim(),o=p.value?._mutationObserver;o&&o.disconnect(),Ue.value?(Te.value&&(clearTimeout(Te.value),Te.value=null),$e(),Ue.value=!1):$e();const a=ht.value==="url"?Tt.value.trim():xe.value;if(Ve.value&&p.value&&p.value.contains(Ve.value)){a&&(Ve.value.src=a),Ve.value.setAttribute("alt",l),Ve.value.setAttribute("data-alt",l),J.value?(Ve.value.style.width=`${J.value}px`,Ve.value.setAttribute("width",J.value)):(Ve.value.style.removeProperty("width"),Ve.value.removeAttribute("width")),oe.value?(Ve.value.style.height=`${oe.value}px`,Ve.value.setAttribute("height",oe.value)):(Ve.value.style.removeProperty("height"),Ve.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const i=document.createRange();i.setStartAfter(Ve.value),i.collapse(!0),r.addRange(i)}I()}else{if(!a){o&&p.value&&o.observe(p.value,{childList:!0,subtree:!0}),Ao();return}if(p.value){p.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const i=window.getSelection();let u=null;if(Ot.value&&(jt(Ot.value),i&&i.rangeCount>0&&(u=i.getRangeAt(0))),!u&&i&&i.rangeCount>0&&(u=i.getRangeAt(0)),!u&&p.value){if(u=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),u.setStart(h,0),u.collapse(!0)}else u.selectNodeContents(p.value),u.collapse(!1);i&&(i.removeAllRanges(),i.addRange(u))}if(!u){Ao();return}const d=u.commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(!p.value.contains(m)){if(u=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),u.setStart(h,0),u.collapse(!0)}else u.selectNodeContents(p.value),u.collapse(!1);i&&(i.removeAllRanges(),i.addRange(u))}const v=document.createElement("img");v.src=a,v.setAttribute("alt",l),v.setAttribute("data-alt",l),J.value&&(v.style.width=`${J.value}px`,v.setAttribute("width",J.value)),oe.value&&(v.style.height=`${oe.value}px`,v.setAttribute("height",oe.value));try{u.insertNode(v),u.setStartAfter(v),u.collapse(!0),i&&(i.removeAllRanges(),i.addRange(u))}catch{if(p.value){if(p.value.childNodes.length===0){const N=document.createElement("p");p.value.appendChild(N),N.appendChild(v)}else{const N=p.value.lastChild;if(N&&N.nodeType===1)N.appendChild(v);else{const w=document.createElement("p");p.value.appendChild(w),w.appendChild(v)}}const S=document.createRange();S.setStartAfter(v),S.collapse(!0),i&&(i.removeAllRanges(),i.addRange(S))}}Ve.value=v,I()}}e.nextTick(()=>{o&&p.value&&o.observe(p.value,{childList:!0,subtree:!0}),gn(),Ft(),Ao()})};e.watch(()=>k.modelValue,l=>{if(k.richText&&p.value&&!ge.value){const o=Wn(l||""),r=p.value.innerHTML.replace(/ |\u00A0/g," "),i=o.replace(/ |\u00A0/g," ");if(r!==i){const u=ze();p.value.innerHTML=o,e.nextTick(()=>{de();const d=p.value.innerHTML||"",m=k.title||"",v=k.description||"";O.value=d,X.value=m,Q.value=v,Z.value=d,ye.value=m,et.value=v,tt.value=[],yt.value=[],Te.value&&(clearTimeout(Te.value),Te.value=null),Ue.value=!1,u&&jt(u),kn(),Nn(),R(),gn(),Ft(),Zn(),Fn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>k.richText,l=>{l?(Ft(),e.nextTick(()=>{Bl()})):(Eo(),Wt.value=[],Vt.value&&(Vt.value.disconnect(),Vt.value=null)),Zn()}),e.watch(()=>k.floatingToolbar,l=>{l?Ft():Eo()}),e.watch(()=>k.disabled,l=>{l&&Eo(),Zn()}),e.watch(()=>k.description,()=>{e.nextTick(()=>{Ae.value?po():ce()})}),e.watch(()=>k.title,()=>{e.nextTick(()=>{$t.value?yn():no()})}),e.watch(()=>k.customToolbarSlots,()=>{e.nextTick(()=>{$o()})},{deep:!0}),e.watch(()=>k.comments,(l,o)=>{if(Ko.value){Ko.value=!1;return}xo.value||k.richText&&p.value&&e.nextTick(()=>{Do()})},{deep:!0,immediate:!1});const Do=()=>{if(!xo.value&&!(!k.comments||!Array.isArray(k.comments)||k.comments.length===0)&&!(!k.richText||!p.value)){xo.value=!0;try{const l=new Set,o=k.comments.filter(d=>{const m=String(d.conversation_id||d.id);return l.has(m)?!1:(l.add(m),!0)}),a=p.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(d=>{const m=d.parentNode;if(m){for(;d.firstChild;)m.insertBefore(d.firstChild,d);m.removeChild(d)}});let i=0;const u=new Set;o.forEach(d=>{if(!d.conversation_id||!d.selection_range)return;const m=typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)||d.conversation_id;if(!m)return;const v=String(m);if(u.has(v))return;const h=p.value.querySelector(`[data-comment="${v}"]`);if(h){Wo(h,d),u.add(v);return}try{const S=Ll(d.selection_range,d.selection_text);if(S&&!S.collapsed){const N=S.commonAncestorContainer,w=N.nodeType===3?N.parentElement:N;if(w){const Ce=w.closest("[data-comment], [data-fake-comment]");if(Ce){const le=Ce.getAttribute("data-comment")||Ce.getAttribute("data-fake-comment");if(String(le)===String(m)){Ce.setAttribute("data-comment",v),Ce.removeAttribute("data-fake-comment"),Wo(Ce,d),u.add(v);return}else return}}const U=p.value.querySelector(`[data-comment="${v}"]`);if(U){Wo(U,d),u.add(v);return}const W=document.createElement("span");W.setAttribute("data-comment",v),Wo(W,d);try{S.surroundContents(W),i++,u.add(v)}catch{try{const le=document.createRange();le.setStart(S.startContainer,S.startOffset),le.setEnd(S.endContainer,S.endOffset),Oo(le),le.surroundContents(W),i++,u.add(v)}catch{try{const Ge=S.extractContents();W.appendChild(Ge),S.insertNode(W),i++,u.add(v)}catch(Ge){console.warn("Failed to create comment marker:",Ge)}}}}}catch{}}),e.nextTick(()=>{Fn("restoreCommentsFromModel"),I(),xo.value=!1})}catch{xo.value=!1}}},Oo=l=>{if(!l||!p.value)return l;try{const o=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=l.startContainer,r=l.startOffset;if(a.nodeType===3){const d=a.parentElement;d&&o.includes(d.tagName)&&(r===0&&!Sl(a)||l.setStartBefore(d))}else a.nodeType===1&&o.includes(a.tagName)&&r>0&&l.setStartBefore(a);let i=l.endContainer,u=l.endOffset;if(i.nodeType===3){const d=i.parentElement;d&&o.includes(d.tagName)&&(u===i.length&&!Nl(i)||l.setEndAfter(d))}else i.nodeType===1&&o.includes(i.tagName)&&u<i.childNodes.length&&l.setEndAfter(i);return l}catch{return l}},Sl=l=>{let o=l.previousSibling;for(;o;){if(o.nodeType===3&&o.textContent.trim().length>0||o.nodeType===1&&o.textContent.trim().length>0)return!0;o=o.previousSibling}return!1},Nl=l=>{let o=l.nextSibling;for(;o;){if(o.nodeType===3&&o.textContent.trim().length>0||o.nodeType===1&&o.textContent.trim().length>0)return!0;o=o.nextSibling}return!1},Ll=(l,o)=>{if(!l||!p.value)return null;try{const a=document.createRange();if(l.type==="text"&&typeof l.start=="number"&&typeof l.end=="number"){let r=0;const i=[p.value];let u=null,d=!1,m=!1;for(;!m&&(u=i.pop());)if(u.nodeType===3){const v=r+u.length;!d&&l.start>=r&&l.start<=v&&(a.setStart(u,l.start-r),d=!0),d&&l.end>=r&&l.end<=v&&(a.setEnd(u,l.end-r),m=!0),r=v}else{let v=u.childNodes.length;for(;v--;)i.push(u.childNodes[v])}return d?Oo(a):null}}catch{return null}return null},Wo=(l,o)=>{if(!l||!o)return;const a=o.conversation||[],r=new Set,i=[],u=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),i.push(m))};a.length>0&&a.forEach(m=>{m.user&&u(m.user)}),i.length>0?l.setAttribute("data-comment-user",JSON.stringify(i[0])):l.removeAttribute("data-comment-user"),i.length>1?l.setAttribute("data-comment-user-2",JSON.stringify(i[1])):l.removeAttribute("data-comment-user-2");const d=a.length;d>0?l.setAttribute("data-comment-count",String(d)):l.removeAttribute("data-comment-count")},Fn=(l="unknown")=>{if(!k.richText||!p.value){Wt.value=[];return}Date.now()-rn.value<cn&&Bt.value!==null||Bt.value===null&&(Bt.value=requestAnimationFrame(()=>{if(Bt.value=null,rn.value=Date.now(),Tn.value)return;Tn.value=!0;const a={},r=p.value;if(!r){Tn.value=!1;return}const i=r.closest(".editor-with-comments");if(!i){Tn.value=!1;return}const u=r.querySelectorAll("[data-comment], [data-fake-comment]"),d=[],m=new Set;u.forEach(w=>{const U=w.getAttribute("data-comment")||w.getAttribute("data-fake-comment");U&&w.tagName==="SPAN"&&(m.has(U)||(d.push(w),m.add(U)))}),u.forEach(w=>{const U=w.getAttribute("data-comment")||w.getAttribute("data-fake-comment");!U||m.has(U)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(w.tagName)?w.querySelector(`span[data-comment="${U}"], span[data-fake-comment="${U}"]`)||(d.push(w),m.add(U)):w.tagName!=="SPAN"&&(d.push(w),m.add(U)))});const v=i.getBoundingClientRect(),h=r.getBoundingClientRect();d.forEach((w,U)=>{let W=w.getAttribute("data-comment")||w.getAttribute("data-fake-comment");if(!W)return;if(typeof W=="string"&&W.startsWith("comment-")){const Jn=w.textContent?.trim(),eo=k.comments?.find(Vn=>(typeof Vn.conversation_id=="string"&&Vn.conversation_id.startsWith("comment-")?null:Vn.conversation_id)&&Vn.selection_text?.trim()===Jn);eo?(W=String(eo.conversation_id),w.setAttribute("data-comment",W),w.removeAttribute("data-fake-comment")):(W=String(Date.now()),w.setAttribute("data-comment",W),w.removeAttribute("data-fake-comment"))}const Ce=w.getBoundingClientRect(),le=window.getComputedStyle(w),Ge=parseFloat(le.lineHeight)||parseFloat(le.fontSize)*1.2,Pt=Ce.top-h.top+Ge/2-15,Zt=h.top-v.top+Pt;let qt=null,an=null,Un=0;const zn=[],Pn=new Set;if(W&&k.comments){const Jn=k.comments.find(eo=>String(eo.conversation_id||eo.id)===String(W));if(Jn){const eo=Jn.conversation||[];eo.length>0?(eo.forEach(Vn=>{Vn.user&&Vn.user.id&&!Pn.has(Vn.user.id)&&(Pn.add(Vn.user.id),zn.push(Vn.user))}),Un=eo.length):(Un=0,qt=null,an=null),zn.length>0?qt=zn[0]:qt=null,zn.length>1?an=zn[1]:an=null}}const Bo=Ce.top+Ge/2-15,Ro=Bo+30,Mo=5,Uo=Ro>h.top+Mo&&Bo<h.bottom-Mo?1:0;Wt.value.find(Jn=>Jn.id===W);let Mn=w;if(!Mn&&W&&p.value){const Jn=String(W);Mn=p.value.querySelector(`[data-comment="${Jn}"], [data-fake-comment="${Jn}"]`)}const il=zn.length;a[W]?(a[W].top=Zt,a[W].opacity=Uo,a[W].element=Mn,a[W].firstUser=qt,a[W].secondUser=an,a[W].totalCount=Un,a[W].uniqueUserCount=il):a[W]={id:W,top:Zt,opacity:Uo,element:Mn,firstUser:qt,secondUser:an,totalCount:Un,uniqueUserCount:il}});const S=Object.values(a).map(w=>{const U=Math.max(0,(w.uniqueUserCount??0)-2);if(!w.element&&w.id&&p.value){const Ce=String(w.id);w.element=p.value.querySelector(`[data-comment="${Ce}"], [data-fake-comment="${Ce}"]`)}return{...w,firstUser:w.firstUser||null,secondUser:w.secondUser||null,totalCount:w.totalCount,additionalCount:U}});(Wt.value.length!==S.length||S.some((w,U)=>{const W=Wt.value[U];if(!W)return!0;const Ce=(W.firstUser?.id||null)!==(w.firstUser?.id||null),le=(W.secondUser?.id||null)!==(w.secondUser?.id||null);return W.id!==w.id||Math.abs(W.top-w.top)>1||W.opacity!==w.opacity||W.totalCount!==w.totalCount||W.additionalCount!==w.additionalCount||Ce||le||W.element!==w.element}))&&(Wt.value=S),Tn.value=!1}))},Zo=l=>{if(!l)return;let o=l.element;if(!o&&l.id&&p.value){const a=String(l.id);o=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}o&&(Qn(),Cn.value=o,o.classList.add("editor-comment-highlighted"))},Qn=(l=!1)=>{!l&&ln.value!==null&&Cn.value&&(Cn.value.getAttribute("data-comment")||Cn.value.getAttribute("data-fake-comment"))===ln.value||(p.value&&p.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Cn.value&&(Cn.value.classList.remove("editor-comment-highlighted"),Cn.value=null))},qo=l=>{if(!l||!l.element)return;Qn(!0);const o=l.element.getAttribute("data-comment")||l.element.getAttribute("data-fake-comment");if(!o)return;const a=`[data-comment="${o}"], [data-fake-comment="${o}"]`;Me("comment-marker-clicked",{commentId:o,selector:a,element:l.element})},yo=()=>{Qn()},Bl=()=>{!k.richText||!p.value||(Vt.value&&Vt.value.disconnect(),Yt.value!==null&&(clearTimeout(Yt.value),Yt.value=null),Vt.value=new MutationObserver(()=>{Yt.value===null&&(Yt.value=setTimeout(()=>{Yt.value=null,e.nextTick(()=>{Fn("MutationObserver")})},200))}),Vt.value.observe(p.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Fn("setupCommentMarkersObserver-initial"))},Ml=(l,o)=>{if(!l||!o)return;const a=o.getBoundingClientRect();let r=a.top,i=a.right+4;l.style.top=`${r}px`,l.style.left=`${i}px`,l.offsetHeight;const u=l.getBoundingClientRect(),d=window.innerWidth,m=window.innerHeight;if(u.right>d){const v=a.left-u.width-4;l.style.left=`${v}px`}if(u.bottom>m){const v=Math.max(8,m-u.height-8);l.style.top=`${v}px`}u.top<0&&(l.style.top="8px")};return e.watch(()=>st.value,l=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===l&&l){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(i){if(a.parentNode!==document.body){const u=a.parentNode;a.dataset.originalParentRef=u===i?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ml(a,i),a.offsetHeight,a.setAttribute("data-active","true"),a.style.visibility="visible",a.style.opacity="1"})})}else a.setAttribute("data-active","true")}else a.setAttribute("data-active","false"),a.style.display="none",a.style.top="",a.style.left="",a.style.visibility="",a.style.opacity=""})})}),e.watch(()=>[ie.value,Qe.value],()=>{ie.value==="askAi"||Qe.value==="askAi"?e.nextTick(()=>{Je()}):(st.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(o=>{if(o.parentNode===document.body){const a=o.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(o.dataset.originalParentRef==="inside")r.appendChild(o);else{const u=r.closest(".dss-toolbar-dropdown");u&&u.insertBefore(o,r.nextSibling)}}}})}))}),e.watch(()=>k.locale,l=>{l&&l!==we.value&&(we.value=l)},{immediate:!0}),fe({openCommentOverlayForSelector:H,updateCommentMarkers:Fn,restoreCommentsFromModel:Do}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",dn.value]),style:e.normalizeStyle(On.value)},[L.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:o[14]||(o[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",sc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:C,title:e.unref(F)("textEditor.toolbar.undo")},[...o[45]||(o[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,rc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!P.value}]),onClick:y,title:e.unref(F)("textEditor.toolbar.redo")},[...o[46]||(o[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,ic),o[73]||(o[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",cc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[0]||(o[0]=a=>lo("paragraph")),title:e.unref(F)("textEditor.toolbar.paragraphFormat")},[gt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",uc,[...o[47]||(o[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):gt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",mc,[...o[48]||(o[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):gt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",pc,[...o[49]||(o[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):gt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",vc,[...o[50]||(o[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):gt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",fc,[...o[51]||(o[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):gt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",gc,[...o[52]||(o[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",hc,[...o[53]||(o[53]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),o[54]||(o[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,dc),ie.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[8]||(o[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[1]||(o[1]=a=>An("<h1>"))},[o[55]||(o[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[2]||(o[2]=a=>An("<h2>"))},[o[56]||(o[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[3]||(o[3]=a=>An("<h3>"))},[o[57]||(o[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[4]||(o[4]=a=>An("<h4>"))},[o[58]||(o[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[5]||(o[5]=a=>An("<h5>"))},[o[59]||(o[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[6]||(o[6]=a=>An("<h6>"))},[o[60]||(o[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[7]||(o[7]=a=>An("<p>"))},[o[61]||(o[61]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("bold")}]),onClick:o[9]||(o[9]=a=>De("bold")),title:e.unref(F)("textEditor.toolbar.bold")},[...o[62]||(o[62]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,yc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("italic")}]),onClick:o[10]||(o[10]=a=>De("italic")),title:e.unref(F)("textEditor.toolbar.italic")},[...o[63]||(o[63]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,kc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("underline")}]),onClick:o[11]||(o[11]=a=>De("underline")),title:e.unref(F)("textEditor.toolbar.underline")},[...o[64]||(o[64]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Cc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":nt.value}]),onClick:pl,title:e.unref(F)("textEditor.toolbar.citation")},[...o[65]||(o[65]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,bc),o[74]||(o[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:ao,title:e.unref(F)("textEditor.toolbar.removeLink")},[...o[67]||(o[67]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,xc)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:fl,title:e.unref(F)("textEditor.toolbar.insertLink")},[...o[66]||(o[66]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,wc)),o[75]||(o[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("insertUnorderedList")}]),onClick:gl,title:e.unref(F)("textEditor.toolbar.bulletList")},[...o[68]||(o[68]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Ec),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("insertOrderedList")}]),onClick:hl,title:e.unref(F)("textEditor.toolbar.numberList")},[...o[69]||(o[69]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Vc),o[76]||(o[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:al,title:e.unref(F)("textEditor.toolbar.image")},[...o[70]||(o[70]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Sc),Sn.value?(e.openBlock(),e.createElementBlock("div",Nc)):e.createCommentVNode("",!0),Sn.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(F)("textEditor.toolbar.comment"),onClick:Qo},[...o[71]||(o[71]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,Bc)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",Mc)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",_c,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:o[12]||(o[12]=a=>lo("askAi")),title:e.unref(F)("textEditor.toolbar.askAi")},[o[72]||(o[72]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",$c,e.toDisplayString(e.unref(F)("textEditor.toolbar.askAi")),1)],8,Tc),ie.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[13]||(o[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[St(a)?(e.openBlock(),e.createElementBlock("div",Hc,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),St(a)&&r<L.customToolbarSlots.length-1&&$n(r)?(e.openBlock(),e.createElementBlock("div",Ac)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ie.value==="paragraph"||ie.value==="askAi")&&L.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:bt})):e.createCommentVNode("",!0),e.createVNode(Al,{showModal:Le.value,width:"500px",height:"55vh",onCloseModal:In},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(F)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Dc,[e.createElementVNode("div",Rc,[e.createElementVNode("label",Ic,e.toDisplayString(e.unref(F)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:ut,type:"text","onUpdate:modelValue":o[15]||(o[15]=a=>z.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Mt,["enter"])},null,40,Fc),[[e.vModelText,z.value]])]),e.createElementVNode("div",zc,[e.createElementVNode("label",Pc,e.toDisplayString(e.unref(F)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:dt,type:"text","onUpdate:modelValue":o[16]||(o[16]=a=>Ke.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Mt,["enter"])},null,40,Oc),[[e.vModelText,Ke.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:In},e.toDisplayString(e.unref(F)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Mt},e.toDisplayString(e.unref(F)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Al,{showModal:sn.value,width:"500px",height:"80vh",onCloseModal:Ao},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Ve.value?e.unref(F)("textEditor.image.editImage"):e.unref(F)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Wc,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":ht.value==="upload"}]),onClick:o[17]||(o[17]=a=>ht.value="upload")},e.toDisplayString(e.unref(F)("textEditor.image.upload")),3),o[77]||(o[77]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":ht.value==="url"}]),onClick:o[18]||(o[18]=a=>ht.value="url")},e.toDisplayString(e.unref(F)("textEditor.image.imageLink")),3)]),ht.value==="upload"?(e.openBlock(),e.createElementBlock("div",Zc,[e.createElementVNode("div",qc,[e.createElementVNode("div",Uc,[We.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Xc,e.toDisplayString(e.unref(F)("textEditor.image.uploadImage")),1)),We.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:sl},[e.createElementVNode("img",{src:xe.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Yc),o[78]||(o[78]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:ct,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:El},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:ct,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:El},null,544))]),e.createElementVNode("div",jc,[e.createElementVNode("label",Kc,e.toDisplayString(e.unref(F)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Ye,type:"text","onUpdate:modelValue":o[19]||(o[19]=a=>Xt.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.image.enterAltText"),onKeyup:e.withKeys(qn,["enter"])},null,40,Gc),[[e.vModelText,Xt.value]])]),e.createElementVNode("div",Qc,[e.createElementVNode("label",Jc,e.toDisplayString(e.unref(F)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[20]||(o[20]=a=>J.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.image.auto"),onKeyup:e.withKeys(qn,["enter"]),onInput:Vl},null,40,ed),[[e.vModelText,J.value]])]),e.createElementVNode("div",td,[e.createElementVNode("label",nd,e.toDisplayString(e.unref(F)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[21]||(o[21]=a=>oe.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.image.auto"),onKeyup:e.withKeys(qn,["enter"]),onInput:rl},null,40,od),[[e.vModelText,oe.value]])])])])):e.createCommentVNode("",!0),ht.value==="url"?(e.openBlock(),e.createElementBlock("div",ld,[e.createElementVNode("div",ad,[e.createElementVNode("div",sd,[e.createElementVNode("label",rd,e.toDisplayString(e.unref(F)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Ze,type:"text","onUpdate:modelValue":o[22]||(o[22]=a=>Tt.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(qn,["enter"])},null,40,id),[[e.vModelText,Tt.value]])]),e.createElementVNode("div",cd,[e.createElementVNode("label",dd,e.toDisplayString(e.unref(F)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":o[23]||(o[23]=a=>Xt.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.image.enterAltText"),onKeyup:e.withKeys(qn,["enter"])},null,40,ud),[[e.vModelText,Xt.value]])]),e.createElementVNode("div",md,[e.createElementVNode("label",pd,e.toDisplayString(e.unref(F)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[24]||(o[24]=a=>J.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.image.auto"),onKeyup:e.withKeys(qn,["enter"]),onInput:Vl},null,40,vd),[[e.vModelText,J.value]])]),e.createElementVNode("div",fd,[e.createElementVNode("label",gd,e.toDisplayString(e.unref(F)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[25]||(o[25]=a=>oe.value=a),class:"dss-link-modal-input",placeholder:e.unref(F)("textEditor.image.auto"),onKeyup:e.withKeys(qn,["enter"]),onInput:rl},null,40,hd),[[e.vModelText,oe.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Ao},e.toDisplayString(e.unref(F)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:qn},e.toDisplayString(e.unref(F)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Ln.value&&$t.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(F)("textEditor.labels.title")),1),e.createElementVNode("div",yd,[$t.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",kd,[L.title?(e.openBlock(),e.createElementBlock("span",Cd,e.toDisplayString(L.title),1)):(e.openBlock(),e.createElementBlock("span",bd,e.toDisplayString(Xe.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Se,value:L.title,onInput:Hn,onFocus:fn,onBlur:Io,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!$t.value}]),placeholder:Xe.value,disabled:L.disabled,rows:"1"},null,42,wd)])],2),Ln.value&&$t.value?(e.openBlock(),e.createElementBlock("div",xd,[e.renderSlot(l.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":un.value&&Ae.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(F)("textEditor.labels.description")),1),e.createElementVNode("div",Ed,[Ae.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Vd,[L.description?(e.openBlock(),e.createElementBlock("span",Sd,e.toDisplayString(L.description),1)):(e.openBlock(),e.createElementBlock("span",Nd,e.toDisplayString(Ie.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Oe,value:L.description,onInput:To,onFocus:_o,onBlur:kt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!Ae.value}]),placeholder:Ie.value,disabled:L.disabled,rows:"1"},null,42,Bd)])],2),un.value&&Ae.value?(e.openBlock(),e.createElementBlock("div",Md,[e.renderSlot(l.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":ln.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:r=>Zo(a),onMouseleave:yo},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>qo(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,$d)):(e.openBlock(),e.createElementBlock("span",Ld,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,Td)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>qo(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Ad)):(e.openBlock(),e.createElementBlock("span",Dd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Hd)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(r=>qo(a),["stop"])},[e.createElementVNode("span",Id,"+"+e.toDisplayString(a.additionalCount),1)],12,Rd)):e.createCommentVNode("",!0)],46,_d))),128)),L.richText?(e.openBlock(),e.createElementBlock("div",qd,[e.createElementVNode("div",{ref_key:"editorRef",ref:p,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":L.disabled,"dss-text-editor-fixed-height":L.fixedHeight}]),style:e.normalizeStyle($.value),onInput:I,onBlur:oo,onClick:tl,onMouseup:io,onKeyup:io,onKeydown:mn,onPaste:jn,onMousemove:wl,onMouseleave:$l},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[ln.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(wo.value)},[so.value||En.value.length>0?(e.openBlock(),e.createElementBlock("div",Ud,[e.createElementVNode("div",Xd,[so.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:so.value},null,8,Yd)):e.createCommentVNode("",!0)]),e.createElementVNode("div",jd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(En.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",Kd,[e.createElementVNode("div",Gd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Qd)):(e.openBlock(),e.createElementBlock("span",Jd,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",eu,[e.createElementVNode("div",tu,[e.createElementVNode("div",nu,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",ou,e.toDisplayString(jo(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Co(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),k.commentUser&&a.user&&a.user.id===k.commentUser.id&&!Co(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(i=>Tl(a,r),["stop"]),title:e.unref(F)("textEditor.comment.delete")||"Delete comment"},[...o[80]||(o[80]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,lu)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",au,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Yn,"onUpdate:modelValue":o[26]||(o[26]=a=>Xn.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(F)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Cl,["prevent","stop"]),["enter"]),onInput:o[27]||(o[27]=()=>{if(Yn.value){const a=Yn.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,su),[[e.vModelText,Xn.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Cl,["stop"])},[...o[81]||(o[81]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",ru,[e.createElementVNode("div",iu,[e.createElementVNode("span",cu,e.toDisplayString(G.value)+" "+e.toDisplayString(G.value===1?e.unref(F)("textEditor.footer.word"):e.unref(F)("textEditor.footer.words")),1),o[82]||(o[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",du,e.toDisplayString(ke.value)+" "+e.toDisplayString(ke.value===1?e.unref(F)("textEditor.footer.character"):e.unref(F)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Fd,[e.createElementVNode("textarea",{value:L.modelValue,onInput:bo,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":L.fixedHeight}]),placeholder:je.value,rows:L.rows,disabled:L.disabled,style:e.normalizeStyle(mo.value)},null,46,zd),e.createElementVNode("div",Pd,[e.createElementVNode("div",Od,[e.createElementVNode("span",Wd,e.toDisplayString(G.value)+" "+e.toDisplayString(G.value===1?e.unref(F)("textEditor.footer.word"):e.unref(F)("textEditor.footer.words")),1),o[79]||(o[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Zd,e.toDisplayString(ke.value)+" "+e.toDisplayString(ke.value===1?e.unref(F)("textEditor.footer.character"):e.unref(F)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[j.value&&_.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(_e.value),onMouseenter:o[28]||(o[28]=a=>Pe.value=!0),onMouseleave:No},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Gn,["stop"]),title:_.value},e.toDisplayString(_.value),9,uu),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(ho,["stop"]),title:e.unref(F)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",pu,[...o[83]||(o[83]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,mu)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_t.value&&ot.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(tn.value),onMouseenter:o[29]||(o[29]=a=>Rt.value=!0),onMouseleave:Ho},[e.createElementVNode("div",vu,[ot.value===e.unref(F)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",fu,[...o[84]||(o[84]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:ot.value},e.toDisplayString(ot.value),9,gu)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ht,["stop"]),title:e.unref(F)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",yu,[...o[85]||(o[85]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,hu)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.floatingToolbar&&L.richText&&te.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:rt,class:"dss-floating-toolbar",style:e.normalizeStyle(pn.value),onMousedown:o[44]||(o[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",ku,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(C,["stop"]),title:e.unref(F)("textEditor.toolbar.undo")},[...o[86]||(o[86]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Cu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!P.value}]),onClick:e.withModifiers(y,["stop"]),title:e.unref(F)("textEditor.toolbar.redo")},[...o[87]||(o[87]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,bu),o[107]||(o[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",wu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[30]||(o[30]=e.withModifiers(a=>co("paragraph"),["stop"])),title:e.unref(F)("textEditor.toolbar.paragraphFormat")},[gt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Eu,[...o[88]||(o[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):gt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Vu,[...o[89]||(o[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):gt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Su,[...o[90]||(o[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):gt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Nu,[...o[91]||(o[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):gt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Bu,[...o[92]||(o[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):gt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",Mu,[...o[93]||(o[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",_u,[...o[94]||(o[94]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),o[95]||(o[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,xu),Qe.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[38]||(o[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[31]||(o[31]=a=>hn("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[32]||(o[32]=a=>hn("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[33]||(o[33]=a=>hn("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[34]||(o[34]=a=>hn("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[35]||(o[35]=a=>hn("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[36]||(o[36]=a=>hn("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[37]||(o[37]=a=>hn("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(F)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),o[108]||(o[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("bold")}]),onClick:o[39]||(o[39]=e.withModifiers(a=>De("bold"),["stop"])),title:e.unref(F)("textEditor.toolbar.bold")},[...o[96]||(o[96]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("italic")}]),onClick:o[40]||(o[40]=e.withModifiers(a=>De("italic"),["stop"])),title:e.unref(F)("textEditor.toolbar.italic")},[...o[97]||(o[97]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,$u),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("underline")}]),onClick:o[41]||(o[41]=e.withModifiers(a=>De("underline"),["stop"])),title:e.unref(F)("textEditor.toolbar.underline")},[...o[98]||(o[98]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Lu),o[109]||(o[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":nt.value}]),onClick:e.withModifiers(pl,["stop"]),title:e.unref(F)("textEditor.toolbar.citation")},[...o[99]||(o[99]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Hu),o[110]||(o[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(ao,["stop"]),title:e.unref(F)("textEditor.toolbar.removeLink")},[...o[101]||(o[101]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Du)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(fl,["stop"]),title:e.unref(F)("textEditor.toolbar.insertLink")},[...o[100]||(o[100]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Au)),o[111]||(o[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("insertUnorderedList")}]),onClick:e.withModifiers(gl,["stop"]),title:e.unref(F)("textEditor.toolbar.bulletList")},[...o[102]||(o[102]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Ru),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt("insertOrderedList")}]),onClick:e.withModifiers(hl,["stop"]),title:e.unref(F)("textEditor.toolbar.numberList")},[...o[103]||(o[103]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Iu),o[112]||(o[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(al,["stop"]),title:e.unref(F)("textEditor.toolbar.image")},[...o[104]||(o[104]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Fu),o[113]||(o[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(F)("textEditor.toolbar.comment"),onClick:e.withModifiers(Qo,["stop"])},[...o[105]||(o[105]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,zu),L.askAi?(e.openBlock(),e.createElementBlock("div",Pu)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",Ou,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:o[42]||(o[42]=e.withModifiers(a=>co("askAi"),["stop"])),title:e.unref(F)("textEditor.toolbar.askAi")},[o[106]||(o[106]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",Zu,e.toDisplayString(e.unref(F)("textEditor.toolbar.askAi")),1)],8,Wu),Qe.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[43]||(o[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),to.value?(e.openBlock(),e.createElementBlock("div",qu,[L.askAi&&to.value?(e.openBlock(),e.createElementBlock("div",Uu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[St(a)&&on(a)?(e.openBlock(),e.createElementBlock("div",Xu,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),St(a)&&on(a)&&r<L.customToolbarSlots.length-1&&xn(r)?(e.openBlock(),e.createElementBlock("div",Yu)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Gu={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Qu=["value"],Ju=["placeholder","value","disabled"],e1=["placeholder","value"],t1={key:0,class:"dss-datepicker__double-wrap"},n1={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},o1=["onClick"],l1={class:"dss-datepicker__double-calendars"},a1={class:"dss-datepicker__double-calendar"},s1={class:"dss-datepicker__calendar-header"},r1=["aria-label"],i1={class:"dss-datepicker__month-year-row"},c1=["aria-label"],d1={class:"dss-datepicker__weekdays"},u1={class:"dss-datepicker__grid"},m1=["disabled","onClick","onMouseenter"],p1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},v1={class:"dss-datepicker__double-calendar"},f1={class:"dss-datepicker__calendar-header"},g1=["aria-label"],h1={class:"dss-datepicker__month-year-row"},y1=["aria-label"],k1={class:"dss-datepicker__weekdays"},C1={class:"dss-datepicker__grid"},b1=["disabled","onClick","onMouseenter"],w1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},x1={class:"dss-datepicker__calendar-header"},E1=["aria-label"],V1={class:"dss-datepicker__month-year-row"},S1=["aria-label"],N1={class:"dss-datepicker__weekdays"},B1={class:"dss-datepicker__grid"},M1=["disabled","onClick","onMouseenter"],_1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},T1={class:"dss-datepicker__calendar-header"},$1={class:"dss-datepicker__month-year-row"},L1={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},H1={class:"dss-datepicker__months-grid"},A1=["onClick"],D1={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},R1={class:"dss-datepicker__month-year"},I1={class:"dss-datepicker__years-grid"},F1=["onClick"],Wl=15,z1={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:L=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(L)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(L,{emit:fe}){const D=L,F=fe,{t:we,locale:k}=cl.useI18n(),Me=e.ref(!1),ne=e.ref("days"),Fe=e.ref(new Date().getMonth()),p=e.ref(new Date().getFullYear()),ie=e.ref(new Date().getMonth()),be=e.ref(new Date().getFullYear()),ge=e.ref(new Date().getMonth()),j=e.ref(new Date().getFullYear()),_=e.ref("start"),_e=e.ref(null),Pe=e.ref(null),Le=new Date;function Ke(){const $=Le.getMonth(),P=Le.getFullYear(),A=$===11?0:$+1,G=$===11?P+1:P;return{left:{month:$,year:P},right:{month:A,year:G}}}const z=e.ref(null),dt=e.ref(null),ut=e.ref(null),he=e.ref(null),Dt=e.ref(null),xt=e.ref(null),nt=new Date().getFullYear(),Be=e.computed(()=>["single","singleFromAvailable"].includes(D.mode)),te=e.computed(()=>["range","rangeFromAvailable"].includes(D.mode)),pn=e.computed(()=>{if(D.mode!=="single"&&D.mode!=="singleFromAvailable")return null;const $=D.modelValue;return $ instanceof Date?$:null}),rt=e.computed(()=>{if(!te.value)return{start:null,end:null};const $=D.modelValue;return!$||typeof $!="object"?{start:null,end:null}:{start:$.start instanceof Date?$.start:null,end:$.end instanceof Date?$.end:null}});function Qe($){if(!$||!($ instanceof Date))return"";const P=$.getDate(),A=$.getMonth()+1,G=$.getFullYear(),ke=We=>String(We).padStart(2,"0");return`${ke(P)}/${ke(A)}/${G}`}const sn=e.computed(()=>Qe(pn.value)),Xt=e.computed(()=>{const{start:$,end:P}=rt.value;if(!$&&!P)return"";const A=!P||$&&$<=P?$:P,G=!$||P&&P>=$?P:$;return Ue(A,G)?Qe(A):`${Qe(A)} - ${Qe(G)}`}),se=e.computed(()=>{if(D.mode!=="readonly")return"—";const $=D.modelValue;if($ instanceof Date)return Qe($)||"—";if($&&typeof $=="object"&&("start"in $||"end"in $)){const P=$.start instanceof Date?$.start:null,A=$.end instanceof Date?$.end:null;if(!P&&!A)return"—";const G=!A||P&&P<=A?P:A,ke=!P||A&&A>=P?A:P;return Ue(G,ke)?Qe(G):`${Qe(G)} - ${Qe(ke)}`}return"—"});e.computed(()=>{const $=new Date(p.value,Fe.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format($)});const xe=e.computed(()=>Pe.value==="left"?ie.value:Pe.value==="right"?ge.value:Fe.value),J=e.computed(()=>Pe.value==="left"?be.value:Pe.value==="right"?j.value:p.value),oe=e.computed(()=>{const $=new Date(p.value,Fe.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format($)}),Ye=e.computed(()=>{const $=new Date(J.value,xe.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format($)}),ct=e.computed(()=>{const $=new Intl.DateTimeFormat(k.value,{month:"short"});return Array.from({length:12},(P,A)=>$.format(new Date(2024,A,1)))}),Ze=e.computed(()=>{const P=(Pe.value?J.value:p.value)-Math.floor(Wl/2);return Array.from({length:Wl},(A,G)=>P+G)}),Ve=e.computed(()=>{const $=Ze.value;return $.length?`${$[0]} – ${$[$.length-1]}`:""}),Ot=e.computed(()=>{const $=new Intl.DateTimeFormat(k.value,{weekday:"short"}),P=new Date(2024,0,1),A=[];for(let G=0;G<7;G++){const ke=new Date(P);ke.setDate(P.getDate()+G),A.push($.format(ke).slice(0,2))}return A});function _t($,P){const A=new Date($,P,1),G=new Date($,P+1,0),ke=A.getDay(),We=G.getDate(),Xe=[];for(let Ie=0;Ie<ke;Ie++)Xe.push(null);for(let Ie=1;Ie<=We;Ie++)Xe.push(new Date($,P,Ie));return Xe}const ot=e.computed(()=>_t(p.value,Fe.value)),tn=e.computed(()=>_t(be.value,ie.value)),Rt=e.computed(()=>_t(j.value,ge.value));e.computed(()=>{const $=new Date(be.value,ie.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format($)}),e.computed(()=>{const $=new Date(j.value,ge.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format($)});const ht=e.computed(()=>{const $=new Date(be.value,ie.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format($)}),Tt=e.computed(()=>{const $=new Date(j.value,ge.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format($)}),st=e.computed(()=>D.availableDates&&D.availableDates.length>0),nn=e.computed(()=>st.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),tt=e.ref({top:0,left:0});function yt(){if(!he.value||!Me.value)return;const $=he.value.getBoundingClientRect(),P=window.innerWidth||document.documentElement.clientWidth,A=window.innerHeight||document.documentElement.clientHeight;let G=$.left,ke=$.bottom+4;const We=Dt.value;if(We){const Xe=We.offsetWidth,Ie=We.offsetHeight;if(G+Xe>P-8&&(G=$.right-Xe,G<8&&(G=8)),ke+Ie>A-8){const je=$.top-4-Ie;je>=8?ke=je:ke=Math.max(8,A-Ie-8)}}tt.value={top:ke,left:G}}const Te=e.computed(()=>!he.value||!Me.value?{}:{position:"fixed",left:`${tt.value.left}px`,top:`${tt.value.top}px`,zIndex:1002});function Ue($,P){return!$||!P?!1:$.getFullYear()===P.getFullYear()&&$.getMonth()===P.getMonth()&&$.getDate()===P.getDate()}function O($){return new Date($.getFullYear(),$.getMonth(),$.getDate()).getTime()}function Z($){return!D.availableDates||!D.availableDates.length?!0:D.availableDates.some(P=>P instanceof Date&&Ue(P,$))}function X($){const P=O($);return!(D.minDate instanceof Date&&P<O(D.minDate)||D.maxDate instanceof Date&&P>O(D.maxDate))}function Q($){return!D.exceptDates||!D.exceptDates.length?!1:D.exceptDates.some(P=>P instanceof Date&&Ue(P,$))}function ye($){return Q($)?!1:["singleFromAvailable","rangeFromAvailable"].includes(D.mode)?Z($):X($)}function et($){const P=pn.value,A=rt.value,G=O($),ke=te.value&&A.start&&A.end&&G>O(A.start)&&G<O(A.end),We=te.value&&A.start&&Ue($,A.start),Xe=te.value&&A.end&&Ue($,A.end),Ie=We&&Xe,je=Be.value&&P&&Ue($,P)||We||Xe;let St=!1;if(te.value&&A.start&&!A.end&&_e.value){const $n=O(A.start),xn=O(_e.value),on=Math.min($n,xn),to=Math.max($n,xn);St=G>on&&G<to}return{"dss-datepicker__day--selected":je&&!Ie,"dss-datepicker__day--range-start":We&&!Ie,"dss-datepicker__day--range-end":Xe&&!Ie,"dss-datepicker__day--range-single":Ie,"dss-datepicker__day--in-range":ke&&!We&&!Xe,"dss-datepicker__day--in-range-preview":St&&!We&&!Xe&&!ke,"dss-datepicker__day--disabled":!ye($)}}function Se($){if(!te.value)return;const P=rt.value;if(!P.start||P.end){_e.value=null;return}if(!ye($)){_e.value=null;return}_e.value=new Date($.getFullYear(),$.getMonth(),$.getDate())}function Oe(){_e.value=null}function mt(){if(!D.doubleCalendar||!te.value)return;const $=rt.value,{start:P,end:A}=$;if(P&&A){const We=P<=A?P:A,Xe=P<=A?A:P,Ie=We.getMonth(),je=We.getFullYear(),St=Xe.getMonth(),$n=Xe.getFullYear();if(Ie!==St||je!==$n){const xn=ie.value===Ie&&be.value===je,on=ge.value===St&&j.value===$n;if(xn&&on)return;ie.value=Ie,be.value=je,ge.value=St,j.value=$n}else{const xn=Ie===0?11:Ie-1,on=Ie===0?je-1:je;ie.value===xn&&be.value===on&&ge.value===Ie&&j.value===je||(ie.value=Ie,be.value=je,Ie===11?(ge.value=0,j.value=je+1):(ge.value=Ie+1,j.value=je))}return}const G=P||A;if(G){const We=G.getMonth(),Xe=G.getFullYear(),Ie=ie.value===We&&be.value===Xe,je=ge.value===We&&j.value===Xe;if(Ie||je)return;ie.value=We,be.value=Xe,We===11?(ge.value=0,j.value=Xe+1):(ge.value=We+1,j.value=Xe);return}const ke=Ke();ie.value=ke.left.month,be.value=ke.left.year,ge.value=ke.right.month,j.value=ke.right.year}function Et($="start"){if(D.mode==="readonly")return;_.value=$;const P=pn.value,A=rt.value;if(Be.value&&P)Fe.value=P.getMonth(),p.value=P.getFullYear();else if(te.value)if(D.doubleCalendar)mt();else{const G=$==="start"&&A.start?A.start:A.end||A.start;G&&(Fe.value=G.getMonth(),p.value=G.getFullYear())}he.value=Be.value?z.value?.closest(".dss-datepicker__input-wrap"):dt.value,ne.value="days",Pe.value=null,Me.value=!0,e.nextTick(()=>{yt()})}function Nt(){ne.value="days",Pe.value=null,_e.value=null,Me.value=!1}function $t($,P){Pe.value=$,ne.value=P}function Ae(){ne.value="days",Pe.value=null}function It($){const P=new Date,A=P.getFullYear(),G=P.getMonth(),ke=P.getDate();let We,Xe;if(st.value){const Ie=[...D.availableDates].filter(je=>je instanceof Date).map(je=>new Date(je.getFullYear(),je.getMonth(),je.getDate()));if(Ie.sort((je,St)=>je.getTime()-St.getTime()),Ie.length===0)return;if($==="all")We=Ie[0],Xe=Ie[Ie.length-1];else{const je=parseInt($.replace("last",""),10);if(je<2||je>5)return;const St=Ie.slice(-je);We=St[0],Xe=St[St.length-1]}}else{const Ie=new Date(A,G,ke);switch($){case"today":We=Ie,Xe=Ie;break;case"lastWeek":We=new Date(A,G,ke-6),Xe=Ie;break;case"last15Days":We=new Date(A,G,ke-14),Xe=Ie;break;case"last30Days":We=new Date(A,G,ke-29),Xe=Ie;break;case"thisMonth":We=new Date(A,G,1),Xe=Ie;break;case"last3Months":We=new Date(A,G-3,1),Xe=new Date(A,G,0);break;case"last6Months":We=new Date(A,G-6,1),Xe=new Date(A,G,0);break;case"last12Months":We=new Date(A,G-12,1),Xe=new Date(A,G,0);break;case"lastYear":We=new Date(A-1,0,1),Xe=new Date(A-1,11,31);break;default:return}}F("update:modelValue",{start:We,end:Xe}),mt()}function gt($){Pe.value==="left"?ie.value=$:Pe.value==="right"?ge.value=$:Fe.value=$,Ae()}function Sn($){Pe.value==="left"?be.value=$:Pe.value==="right"?j.value=$:p.value=$,Ae()}function Wt(){Fe.value===0?(Fe.value=11,p.value--):Fe.value--}function Vt(){Fe.value===11?(Fe.value=0,p.value++):Fe.value++}function Bt(){ie.value===0?(ie.value=11,be.value--):ie.value--}function _n(){ie.value===11?(ie.value=0,be.value++):ie.value++}function Tn(){ge.value===0?(ge.value=11,j.value--):ge.value--}function rn(){ge.value===11?(ge.value=0,j.value++):ge.value++}function cn($){if(!ye($))return;const P=new Date($.getFullYear(),$.getMonth(),$.getDate());if(Be.value){F("update:modelValue",P),Nt();return}const A=rt.value;if(!A.start&&!A.end){F("update:modelValue",{start:P,end:null}),_.value="end";return}if(A.start&&A.end){F("update:modelValue",{start:P,end:null}),_.value="end";return}if(_.value==="start"){let G=P,ke=A.end;G&&ke&&G>ke&&([G,ke]=[ke,G]),F("update:modelValue",{start:G||ke,end:ke||G}),_.value="end"}else{let G=A.start,ke=P;G&&ke&&ke<G&&([G,ke]=[ke,G]),F("update:modelValue",{start:G||ke,end:ke||G}),_.value="start"}}e.watch(rt,()=>{D.doubleCalendar&&te.value&&Me.value&&mt()},{deep:!0});let Yt=null,dn=null,On=null;function mo(){Yt&&(document.removeEventListener("keydown",Yt),Yt=null),dn&&(window.removeEventListener("resize",dn),dn=null),On&&(window.removeEventListener("scroll",On,!0),On=null)}return e.watch(Me,$=>{mo(),$&&(Yt=P=>{P.key==="Escape"&&(ne.value==="years"||ne.value==="months"?Ae():Nt())},dn=()=>{yt()},On=()=>{yt()},document.addEventListener("keydown",Yt),window.addEventListener("resize",dn),window.addEventListener("scroll",On,!0))}),e.onBeforeUnmount(()=>{mo()}),($,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":L.mode==="readonly"}])},[L.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Gu,[P[9]||(P[9]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:se.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Qu)])):Be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:P[0]||(P[0]=A=>Et("start"))},[P[10]||(P[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:z,type:"text",class:"dss-datepicker__input",placeholder:e.unref(we)("datepicker.selectDate"),value:sn.value,readonly:"",disabled:L.mode==="readonly"},null,8,Ju)])):te.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:dt,onClick:P[1]||(P[1]=A=>Et("start"))},[P[11]||(P[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:ut,type:"text",class:"dss-datepicker__input",placeholder:e.unref(we)("datepicker.selectRange"),value:Xt.value,readonly:""},null,8,e1)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Me.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Nt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Dt,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":L.doubleCalendar&&te.value&&ne.value==="days","dss-datepicker__dropdown--quick-select":L.doubleCalendar&&te.value&&ne.value==="days"&&L.quickSelect}]),style:e.normalizeStyle(Te.value)},[ne.value==="days"&&L.doubleCalendar&&te.value?(e.openBlock(),e.createElementBlock("div",t1,[L.quickSelect?(e.openBlock(),e.createElementBlock("nav",n1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nn.value,A=>(e.openBlock(),e.createElementBlock("button",{key:A.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:G=>It(A.id)},e.toDisplayString(e.unref(we)(A.labelKey)),9,o1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",l1,[e.createElementVNode("div",a1,[e.createElementVNode("div",s1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.prevMonth"),onClick:Bt}," ‹ ",8,r1),e.createElementVNode("div",i1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[2]||(P[2]=A=>$t("left","months"))},e.toDisplayString(ht.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[3]||(P[3]=A=>$t("left","years"))},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.nextMonth"),onClick:_n}," › ",8,c1)]),e.createElementVNode("div",d1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ot.value,A=>(e.openBlock(),e.createElementBlock("span",{key:A,class:"dss-datepicker__weekday"},e.toDisplayString(A),1))),128))]),e.createElementVNode("div",u1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn.value,(A,G)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+G},[A?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",et(A)]),disabled:!ye(A),onClick:ke=>cn(A),onMouseenter:ke=>Se(A),onMouseleave:Oe},e.toDisplayString(A.getDate()),43,m1)):(e.openBlock(),e.createElementBlock("span",p1))],64))),128))])]),e.createElementVNode("div",v1,[e.createElementVNode("div",f1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.prevMonth"),onClick:Tn}," ‹ ",8,g1),e.createElementVNode("div",h1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[4]||(P[4]=A=>$t("right","months"))},e.toDisplayString(Tt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[5]||(P[5]=A=>$t("right","years"))},e.toDisplayString(j.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.nextMonth"),onClick:rn}," › ",8,y1)]),e.createElementVNode("div",k1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ot.value,A=>(e.openBlock(),e.createElementBlock("span",{key:A,class:"dss-datepicker__weekday"},e.toDisplayString(A),1))),128))]),e.createElementVNode("div",C1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt.value,(A,G)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+G},[A?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",et(A)]),disabled:!ye(A),onClick:ke=>cn(A),onMouseenter:ke=>Se(A),onMouseleave:Oe},e.toDisplayString(A.getDate()),43,b1)):(e.openBlock(),e.createElementBlock("span",w1))],64))),128))])])])])):ne.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",x1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.prevMonth"),onClick:Wt}," ‹ ",8,E1),e.createElementVNode("div",V1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[6]||(P[6]=A=>ne.value="months")},e.toDisplayString(oe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[7]||(P[7]=A=>ne.value="years")},e.toDisplayString(p.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.nextMonth"),onClick:Vt}," › ",8,S1)]),e.createElementVNode("div",N1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ot.value,A=>(e.openBlock(),e.createElementBlock("span",{key:A,class:"dss-datepicker__weekday"},e.toDisplayString(A),1))),128))]),e.createElementVNode("div",B1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value,(A,G)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:G},[A?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",et(A)]),disabled:!ye(A),onClick:ke=>cn(A),onMouseenter:ke=>Se(A),onMouseleave:Oe},e.toDisplayString(A.getDate()),43,M1)):(e.openBlock(),e.createElementBlock("span",_1))],64))),128))])],64)):ne.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",T1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:Ae}," ‹ "),e.createElementVNode("div",$1,[e.createElementVNode("span",L1,e.toDisplayString(Ye.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[8]||(P[8]=A=>ne.value="years")},e.toDisplayString(J.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:Ae}," › ")]),e.createElementVNode("div",H1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ct.value,(A,G)=>(e.openBlock(),e.createElementBlock("button",{key:G,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":G===xe.value}]),onClick:ke=>gt(G)},e.toDisplayString(A),11,A1))),128))])],64)):ne.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",D1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:Ae}," ‹ "),e.createElementVNode("span",R1,e.toDisplayString(Ve.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:Ae}," › ")]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:xt},[e.createElementVNode("div",I1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,A=>(e.openBlock(),e.createElementBlock("button",{key:A,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":A===J.value,"dss-datepicker__year-cell--current":A===e.unref(nt)}]),onClick:G=>Sn(A)},e.toDisplayString(A),11,F1))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},P1={class:"dss-color-picker__section-title"},O1={class:"dss-color-picker__presets-row"},W1=["title","onClick"],Z1={key:1,class:"dss-color-picker__section"},q1={class:"dss-color-picker__presets-row"},U1=["title","onClick"],X1={class:"dss-color-picker__section"},Y1={class:"dss-color-picker__section-header"},j1={class:"dss-color-picker__presets-row"},K1=["title","onClick"],G1=["onClick"],Q1={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},J1=["title","onClick"],em={class:"dss-color-picker__input-row"},tm=["value"],nm={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null}},emits:["update:modelValue","update:presetColors"],setup(L,{emit:fe}){function D(O){const Z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(O);if(!Z)return{h:0,s:0,l:50};const X=parseInt(Z[1],16)/255,Q=parseInt(Z[2],16)/255,ye=parseInt(Z[3],16)/255,et=Math.max(X,Q,ye),Se=Math.min(X,Q,ye);let Oe=0,mt=0;const Et=(et+Se)/2;if(et!==Se){const Nt=et-Se;switch(mt=Et>.5?Nt/(2-et-Se):Nt/(et+Se),et){case X:Oe=((Q-ye)/Nt+(Q<ye?6:0))/6;break;case Q:Oe=((ye-X)/Nt+2)/6;break;case ye:Oe=((X-Q)/Nt+4)/6;break}}return{h:Oe*360,s:mt*100,l:Et*100}}function F(O,Z,X){Z/=100,X/=100;const Q=Z*Math.min(X,1-X),ye=et=>{const Se=(et+O/30)%12,Oe=X-Q*Math.max(Math.min(Se-3,9-Se,1),-1);return Math.round(255*Oe).toString(16).padStart(2,"0")};return`#${ye(0)}${ye(8)}${ye(4)}`}function we(O){const Z=O.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Z)return null;let X=Z[1];return X.length===3&&(X=X.split("").map(Q=>Q+Q).join("")),"#"+X}function k(O,Z,X){Z/=100,X/=100;const Q=X+Z*Math.min(X,1-X),ye=Q===0?0:2-2*X/Q;return{h:O,s:ye*100,v:Q*100}}function Me(O,Z,X){Z/=100,X/=100;const Q=X*(1-Z/2),ye=Q===0||Q===1?0:(X-Q)/Math.min(Q,1-Q);return{h:O,s:ye*100,l:Q*100}}const ne=L,Fe=fe,p=e.ref(!1),ie=e.ref(!1),be=e.ref(!1),ge=e.ref(-1),j=e.ref(-1),_=e.ref(null),_e=e.ref(null),Pe=e.ref(null),Le=e.ref(null),Ke=e.ref({top:0,left:0}),z=e.ref(D(ne.modelValue||"#b8a5de")),dt=e.computed(()=>Array.isArray(ne.presetGroups)&&ne.presetGroups.length>0),ut=e.computed(()=>dt.value?0:ne.initialPresetCount!=null?ne.initialPresetCount:j.value<0?null:j.value),he=e.computed(()=>{const O=ut.value;return O==null?!0:Math.max(0,ne.presetColors.length-O)<ne.max}),Dt=e.computed(()=>!!(ie.value||ge.value>=0||!xt.value&&ne.presetColors.length===0));e.computed(()=>{const O=ut.value;return O!=null&&ne.presetColors.length>O});const xt=e.computed(()=>dt.value||ut.value!=null),nt=e.computed(()=>{const O=ut.value;return O==null?[]:ne.presetColors.slice(0,O)}),Be=e.computed(()=>{const O=ut.value;return O==null?[]:ne.presetColors.slice(O)});function te(O){const Z=ut.value;return Z!=null?Z+O:-1}function pn(O){const Z=ut.value;return Z!=null&&O>=Z}function rt(O){pn(O)&&(ge.value=O,z.value=D(ne.presetColors[O]),ie.value=!0,e.nextTick(()=>Le.value?.focus()))}function Qe(O){if(!pn(O))return;const Z=ne.presetColors.filter((ye,et)=>et!==O);Fe("update:presetColors",Z);const X=we(ne.modelValue),Q=we(ne.presetColors[O]);if(X&&Q&&X.toLowerCase()===Q.toLowerCase()){const ye=Z[Math.max(0,O-1)]||Z[0];ye&&Fe("update:modelValue",ye)}}function sn(){be.value=!be.value,be.value||(ge.value=-1,ie.value=!1)}function Xt(){if(ge.value<0)return;const O=oe.value,Z=we(O);if(Z){const X=[...ne.presetColors];X[ge.value]=Z,Fe("update:presetColors",X),Fe("update:modelValue",Z),ge.value=-1,ie.value=!1}}function se(){ne.disabled||(ge.value=-1,ie.value=!ie.value,ie.value&&(ot(),e.nextTick(()=>Le.value?.focus())))}function xe(O){const Z=we(O),X=we(ne.modelValue);return Z&&X&&Z.toLowerCase()===X.toLowerCase()}function J(){if(ne.disabled||!he.value)return;const O=oe.value,Z=we(O);if(Z){const X=[...ne.presetColors,Z];Fe("update:presetColors",X),Fe("update:modelValue",Z);const Q=ut.value??j.value;Q>=0&&X.length-Q>=ne.max&&(ie.value=!1)}}const oe=e.computed(()=>{const{h:O,s:Z,l:X}=z.value;return F(O,Z,X)}),Ye=e.computed(()=>oe.value.toLowerCase()),ct=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${z.value.h}, 100%, 50%))`})),Ze=e.computed(()=>{const O=k(z.value.h,z.value.s,z.value.l);return{left:`${O.s}%`,bottom:`${O.v}%`,transform:"translate(-50%, 50%)"}}),Ve=e.computed(()=>({left:`${z.value.h/360*100}%`,transform:"translateX(-50%)"})),Ot=e.computed(()=>({position:"fixed",left:`${Ke.value.left}px`,top:`${Ke.value.top}px`,zIndex:1002}));function _t(){if(!_.value||!p.value)return;const O=_.value.getBoundingClientRect(),Z=window.innerHeight||document.documentElement.clientHeight;let X=O.bottom+4;const Q=_e.value;Q&&X+Q.offsetHeight>Z-8&&(X=O.top-4-Q.offsetHeight),Ke.value={top:X,left:O.left}}function ot(){const O=ne.modelValue||"#b8a5de";we(O)&&(z.value=D(O))}function tn(){Fe("update:modelValue",oe.value)}function Rt(){ne.disabled||(p.value=!p.value,p.value&&(ot(),e.nextTick(()=>{_t(),Le.value?.focus()})))}function ht(){const O=oe.value,Z=we(O);if(Z){if(ge.value>=0){const X=[...ne.presetColors];X[ge.value]=Z,Fe("update:presetColors",X),Fe("update:modelValue",Z)}else if((ne.presetColors.length>0||dt.value)&&ie.value&&he.value&&!ne.presetColors.some(Q=>we(Q)?.toLowerCase()===Z.toLowerCase())){const Q=[...ne.presetColors,Z];Fe("update:presetColors",Q),Fe("update:modelValue",Z)}}p.value=!1,ie.value=!1,be.value=!1,ge.value=-1}function Tt(O){if(!Pe.value)return;const Z=Pe.value.getBoundingClientRect(),X=Q=>{const ye=Math.max(0,Math.min(1,(Q.clientX-Z.left)/Z.width)),et=Math.max(0,Math.min(1,1-(Q.clientY-Z.top)/Z.height)),Se={h:z.value.h,s:ye*100,v:et*100};z.value=Me(Se.h,Se.s,Se.v)};X(O),document.addEventListener("mousemove",X),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",X),tn()},{once:!0})}function st(O){if(!O.currentTarget)return;const X=O.currentTarget.getBoundingClientRect(),Q=ye=>{const et=Math.max(0,Math.min(1,(ye.clientX-X.left)/X.width));z.value={...z.value,h:et*360}};Q(O),document.addEventListener("mousemove",Q),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",Q),tn()},{once:!0})}function nn(O){const Z=O.target.value,X=we(Z);X&&(z.value=D(X),Fe("update:modelValue",X))}function tt(O){if(ne.disabled)return;const Z=we(O);Z&&(z.value=D(Z),Fe("update:modelValue",Z))}let yt=null,Te=null;function Ue(){yt&&(document.removeEventListener("keydown",yt),yt=null),Te&&(window.removeEventListener("resize",Te),Te=null)}return e.watch(p,O=>{if(Ue(),O){if(!dt.value&&ne.initialPresetCount==null){const Z=ne.presetColors.length;Z>0&&(j.value<0||Z<j.value)&&(j.value=Z)}yt=Z=>{Z.key==="Escape"&&ht()},Te=_t,document.addEventListener("keydown",yt),window.addEventListener("resize",Te)}}),e.watch(()=>ne.modelValue,()=>{p.value&&ot()},{immediate:!1}),e.watch(Be,O=>{O.length===0&&(be.value=!1,ge.value=-1,ie.value=!1)}),e.onBeforeUnmount(Ue),(O,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":L.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:_,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":p.value}]),onClick:Rt},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:oe.value})},[...Z[0]||(Z[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(ht,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:_e,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Ot.value)},[xt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[dt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(L.presetGroups,(X,Q)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+Q,class:"dss-color-picker__section"},[e.createElementVNode("span",P1,e.toDisplayString(X.title),1),e.createElementVNode("div",O1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.colors,(ye,et)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+Q+"-"+et,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xe(ye)}]),style:e.normalizeStyle({backgroundColor:ye}),title:ye,onClick:e.withModifiers(Se=>tt(ye),["stop"])},null,14,W1))),128))])]))),128)):nt.value.length?(e.openBlock(),e.createElementBlock("div",Z1,[Z[1]||(Z[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",q1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value,(X,Q)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+Q,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xe(X)}]),style:e.normalizeStyle({backgroundColor:X}),title:X,onClick:e.withModifiers(ye=>tt(X),["stop"])},null,14,U1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",X1,[e.createElementVNode("div",Y1,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Be.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":be.value}]),title:"Manage custom colors",onClick:e.withModifiers(sn,["stop"])},[...Z[2]||(Z[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",j1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value,(X,Q)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+Q,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":be.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!be.value&&xe(X),"dss-color-picker__preset-bubble--editing":be.value&&ge.value===te(Q)}]),style:e.normalizeStyle({backgroundColor:ge.value===te(Q)?oe.value:X}),title:ge.value===te(Q)?oe.value:X,onClick:e.withModifiers(ye=>be.value?rt(te(Q)):tt(X),["stop"])},null,14,K1),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(ye=>Qe(te(Q)),["stop"])},[...Z[4]||(Z[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,G1)):e.createCommentVNode("",!0)],2))),128)),he.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ie.value}]),onClick:e.withModifiers(se,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):L.presetColors.length?(e.openBlock(),e.createElementBlock("div",Q1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.presetColors,(X,Q)=>(e.openBlock(),e.createElementBlock("button",{key:Q,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xe(X)}]),style:e.normalizeStyle({backgroundColor:X}),title:X,onClick:e.withModifiers(ye=>tt(X),["stop"])},null,14,J1))),128)),he.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ie.value}]),onClick:e.withModifiers(se,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Dt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Pe,onMousedown:Tt},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(ct.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Ze.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:st},[Z[5]||(Z[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Ve.value)},null,4)],32),e.createElementVNode("div",em,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Le,type:"text",class:"dss-color-picker__hex-input",value:Ye.value,onInput:nn},null,40,tm)]),xt.value&&(L.presetColors.length||dt.value)&&he.value&&ge.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:J}," Save color ")):e.createCommentVNode("",!0),xt.value&&ge.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Xt}," Save color ")):e.createCommentVNode("",!0),xt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:ht}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},om={key:0,class:"dss-loader"},lm={key:0,class:"dss-loader-label"},am={key:1,class:"dss-loader"},sm={key:0,class:"dss-loader-label"},rm={key:2,class:"dss-loader"},im={key:0,class:"dss-loader-label"},cm={key:3,class:"dss-loader"},dm={key:0,class:"dss-loader-label"},um={key:4,class:"dss-loader"},mm={key:0,class:"dss-loader-label"},pm={key:5,class:"dss-loader dss-loader--inline"},vm={class:"dss-loader-inline-text"},fm={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"}},setup(L){const fe=L,D=e.computed(()=>fe.size==="small"?"dss-loaders--size-small":fe.size==="large"?"dss-loaders--size-large":fe.size==="medium"||fe.size==null?"dss-loaders--size-medium":null),F=e.computed(()=>fe.size==="small"||fe.size==="medium"||fe.size==="large"||fe.size==null?{}:{"--dss-loader-size":typeof fe.size=="number"?`${fe.size}px`:String(fe.size)});return(we,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",D.value]),style:e.normalizeStyle(F.value)},[L.type==="spinner"?(e.openBlock(),e.createElementBlock("div",om,[k[0]||(k[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",lm,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="dots"?(e.openBlock(),e.createElementBlock("div",am,[k[1]||(k[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",sm,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="battery"?(e.openBlock(),e.createElementBlock("div",rm,[k[2]||(k[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",im,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",cm,[k[3]||(k[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",dm,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="bars"?(e.openBlock(),e.createElementBlock("div",um,[k[4]||(k[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",mm,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="inline"?(e.openBlock(),e.createElementBlock("div",pm,[k[5]||(k[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",vm,[e.renderSlot(we.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(L.label),1)])])])):e.createCommentVNode("",!0)],6))}},Zl="dss-skeleton-item",gm={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:L=>["single","multiple"].includes(L)},targetClass:{type:String,default:Zl},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(L){const fe=L,D=e.computed(()=>{const k={"dss-skeleton--loading":fe.loading,"dss-skeleton--static":!fe.shimmer,"dss-skeleton--multiple":fe.mode==="multiple","dss-skeleton--dark":fe.darkMode};return fe.mode==="multiple"&&fe.targetClass!==Zl&&(k[`dss-skeleton--target-${fe.targetClass}`]=!0),k}),F=e.computed(()=>{const k={};return fe.borderRadius&&(k.borderRadius=fe.borderRadius),k}),we=e.computed(()=>{const k={};return fe.borderRadius&&(k["--dss-skeleton-border-radius"]=fe.borderRadius),fe.darkMode?(k["--dss-skeleton-bg"]=fe.bgDark||"#322c3f",k["--dss-skeleton-shimmer"]=fe.shimmerDark||"#3e3f41",k):(fe.bgColor&&(k["--dss-skeleton-bg"]=fe.bgColor),fe.shimmerColor&&(k["--dss-skeleton-shimmer"]=fe.shimmerColor),k)});return(k,Me)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",D.value]),style:e.normalizeStyle(we.value)},[L.loading&&L.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(F.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":L.loading&&L.mode==="single"}])},[e.renderSlot(k.$slots,"default")],2)],6))}},hm={key:0,class:"dss-dnd-column-header"},ym={class:"dss-dnd-column-title"},km={class:"dss-dnd-column-count"},Cm=["data-column"],bm={key:0,class:"dss-dnd-indicator"},wm=["onPointerdown"],xm=["onPointerdown"],Em={class:"dss-dnd-item-content"},Vm={class:"dss-dnd-item-default"},Sm={key:0,class:"dss-dnd-empty"},Nm={name:"DSSDnd"},Bm=Object.assign(Nm,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move"],setup(L,{emit:fe}){const D=L,F=fe,we={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1},k=e.computed(()=>({...we,...D.options})),Me=e.computed(()=>({"--dss-dnd-col-min-w":k.value.columnMinWidth,"--dss-dnd-col-max-w":k.value.columnMaxWidth,"--dss-dnd-col-gap":k.value.columnGap,"--dss-dnd-indicator-color":k.value.indicatorColor,"--dss-dnd-body-max-h":k.value.columnBodyMaxHeight})),ne=e.ref(null),Fe=e.ref(null),p=e.ref(-1),ie=e.ref(null);let be=null,ge=null,j=null,_=null,_e=0,Pe=0;const Le=e.computed(()=>{const se={};for(const xe of D.columns)se[xe.value]=D.items.filter(J=>J[D.columnKey]===xe.value).sort((J,oe)=>(J[D.positionKey]??0)-(oe[D.positionKey]??0));return se}),Ke=e.computed(()=>{const se={},xe=!!ne.value,J=ne.value?.[D.itemKey],oe=Fe.value,Ye=p.value;for(const ct of D.columns){const Ze=Le.value[ct.value]||[],Ve=[],Ot=oe===ct.value;let _t=0;for(let ot=0;ot<Ze.length;ot++){const tn=Ze[ot],Rt=xe&&tn[D.itemKey]===J;!Rt&&Ot&&Ye===_t&&Ve.push({type:"indicator",key:`ind-${_t}`}),Rt||_t++,Ve.push({type:"item",item:tn,isDragged:Rt,key:`item-${tn[D.itemKey]}`})}Ot&&Ye>=_t&&Ve.push({type:"indicator",key:"ind-end"}),se[ct.value]=Ve}return se});function z(se,xe){const oe=(Le.value[se]||[]).filter(Ze=>Ze[D.itemKey]!==ne.value?.[D.itemKey]);if(oe.length===0)return 1;if(xe<=0){const Ze=oe[0][D.positionKey];return Ze!=null&&Ze>0?Ze/2:.5}if(xe>=oe.length){const Ze=oe[oe.length-1][D.positionKey];return(Ze??0)+1}const Ye=oe[xe-1][D.positionKey]??0,ct=oe[xe][D.positionKey]??0;return(Ye+ct)/2}function dt(se,xe,J){j&&j.remove();const oe=se.getBoundingClientRect(),Ye=se.cloneNode(!0);Ye.classList.add("dss-dnd-ghost"),Ye.style.cssText=`
|
|
85
85
|
position: fixed;
|
|
86
86
|
left: ${xe-_e}px;
|
|
87
87
|
top: ${J-Pe}px;
|
|
@@ -94,4 +94,4 @@
|
|
|
94
94
|
box-shadow: 0 8px 24px rgba(0,0,0,0.15);
|
|
95
95
|
background-color: #fafafa;
|
|
96
96
|
font-family: 'Work Sans', sans-serif;
|
|
97
|
-
`,document.body.appendChild(Ye),j=Ye}function ut(se,xe){j&&(j.style.left=`${se-_e}px`,j.style.top=`${xe-Pe}px`)}function ye(se){se.classList.add("dss-dnd-item--dragging"),se.style.background=k.value.dragSourceBackground,se.style.borderColor=k.value.dragSourceBorder,se.style.transform="scale(0.97)"}function Dt(se){se.classList.remove("dss-dnd-item--dragging"),se.style.background="",se.style.borderColor="",se.style.transform=""}function xt(se,xe){return document.elementFromPoint(se,xe)?.closest(".dss-dnd-column-body")??null}function nt(se,xe){const J=xt(se,xe),oe=J?.getAttribute("data-column")??null;if(!oe){Fe.value=null,p.value=-1;return}Fe.value=oe;const Ye=J.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let ct=Ye.length;for(let Ze=0;Ze<Ye.length;Ze++){const Ve=Ye[Ze].getBoundingClientRect();if(xe<Ve.top+Ve.height/2){ct=Ze;break}}p.value=ct}function Be(se){se.preventDefault(),ut(se.clientX,se.clientY),!be&&(be=requestAnimationFrame(()=>{be=null,nt(se.clientX,se.clientY)}))}function te(se){window.removeEventListener("pointermove",Be),window.removeEventListener("pointerup",te),window.removeEventListener("pointercancel",te),_?.releasePointerCapture?.(se.pointerId),Dt(_),_=null;const J=xt(se.clientX,se.clientY)?.getAttribute("data-column")??null;if(ne.value&&J){const oe=ne.value[D.columnKey],Ye=J,Ze=(Le.value[Ye]||[]).filter(ot=>ot[D.itemKey]!==ne.value[D.itemKey]),Ve=Math.max(0,Math.min(p.value,Ze.length)),Ot=z(Ye,Ve),_t=ne.value[D.itemKey];F("move",{item:ne.value,from:oe,to:Ye,position:Ot,index:Ve}),fe&&clearTimeout(fe),ie.value={id:_t,from:oe,to:Ye},fe=setTimeout(()=>{ie.value=null},3500)}j&&(j.remove(),j=null),Xt()}function pn(se,xe){se.preventDefault();const J=se.target.closest(".dss-dnd-item");if(!J)return;const oe=J.getBoundingClientRect();_e=se.clientX-oe.left,Pe=se.clientY-oe.top,ne.value=xe,_=J,dt(J,se.clientX,se.clientY),requestAnimationFrame(()=>ye(J)),J.setPointerCapture?.(se.pointerId),window.addEventListener("pointermove",Be),window.addEventListener("pointerup",te,{once:!0}),window.addEventListener("pointercancel",te,{once:!0})}function rt(se,xe){k.value.useHandle||pn(se,xe)}function Qe(se,xe){pn(se,xe)}function sn(){be&&(cancelAnimationFrame(be),be=null)}function Xt(){sn(),ne.value=null,Fe.value=null,p.value=-1}return e.onBeforeUnmount(()=>{sn(),fe&&clearTimeout(fe),j&&(j.remove(),j=null)}),(se,xe)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":k.value.unstyled}]),style:e.normalizeStyle(Me.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.columns,J=>(e.openBlock(),e.createElementBlock("div",{key:J.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":Fe.value===J.value},J.class||""]])},[k.value.showHeader?(e.openBlock(),e.createElementBlock("div",hm,[e.renderSlot(se.$slots,"column-header",{column:J,items:Le.value[J.value]||[]},()=>[e.createElementVNode("span",ym,e.toDisplayString(J.title||J.value),1),e.createElementVNode("span",km,e.toDisplayString((Le.value[J.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":J.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value[J.value],oe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:oe.key},[oe.type==="indicator"?(e.openBlock(),e.createElementBlock("div",bm)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":oe.isDragged,"dss-dnd-item--no-handle":!k.value.useHandle}]),onPointerdown:Ye=>rt(Ye,oe.item)},[k.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ye=>Qe(Ye,oe.item),["stop"])},[e.renderSlot(se.$slots,"handle",{},()=>[xe[0]||(xe[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,xm)):e.createCommentVNode("",!0),e.createElementVNode("div",Em,[e.renderSlot(se.$slots,"item",{item:oe.item,column:J,justDropped:ie.value?.id===oe.item[H.itemKey],droppedFrom:ie.value?.id===oe.item[H.itemKey]?ie.value.from:null,droppedTo:ie.value?.id===oe.item[H.itemKey]?ie.value.to:null},()=>[e.createElementVNode("div",Vm,e.toDisplayString(oe.item[H.itemKey]),1)])])],42,wm))],64))),128)),(Le.value[J.value]||[]).length===0&&Fe.value!==J.value?(e.openBlock(),e.createElementBlock("div",Sm,[e.renderSlot(se.$slots,"empty",{column:J},()=>[xe[1]||(xe[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,Cm)],2))),128))],6))}}),Mm={name:"DSSConfetti"},_m=Object.assign(Mm,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(H){const he=H,D=e.ref(null),F=e.ref(!1);let we=[],k=null,Me=null;function ne(j,_){const _e=[];for(let Pe=0;Pe<he.count;Pe++)_e.push(Fe(j));return _e}function Fe(j,_){return{x:Math.random()*j,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:he.colors[Math.floor(Math.random()*he.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function p(j,_,_e,Pe){j.clearRect(0,0,_,_e);for(const Le of we)j.save(),j.globalAlpha=Le.opacity*Pe,j.beginPath(),j.lineWidth=Le.r,j.strokeStyle=Le.color,j.moveTo(Le.x+Le.tilt+Le.r/2,Le.y),j.lineTo(Le.x+Le.tilt,Le.y+Le.tilt+Le.r/2),j.stroke(),j.restore()}function ie(j,_,_e){const Pe=.3+_e*.7;for(let Le=0;Le<we.length;Le++){const Ke=we[Le];Ke.tiltAngle+=Ke.tiltInc,Ke.y+=Ke.speed*Pe,Ke.x+=Math.sin(Ke.d)*.5*Pe,Ke.tilt=Math.sin(Ke.tiltAngle)*15,_e>=.99&&Ke.y>_+20&&(we[Le]=Fe(j))}}function be(){F.value=!0,e.nextTick(()=>{const j=D.value;if(!j)return;const _=j.getContext("2d"),_e=j.parentElement;if(!_e)return;const Pe=_e.getBoundingClientRect();j.width=Pe.width,j.height=Pe.height,we=ne(j.width,j.height);const Le=Date.now(),Ke=Le+he.duration,z=()=>{const dt=Date.now(),ut=dt-Le;if(dt<Ke){let ye=1;ut>he.fadeStart&&(ye=1-(ut-he.fadeStart)/(he.duration-he.fadeStart)),p(_,j.width,j.height,ye),ie(j.width,j.height,ye),k=requestAnimationFrame(z)}else fe()};z()})}function fe(){k&&(cancelAnimationFrame(k),k=null),we=[],F.value=!1}return e.watch(()=>he.trigger,j=>{j&&(Me&&clearTimeout(Me),Me=setTimeout(be,he.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{fe(),Me&&clearTimeout(Me)}),(j,_)=>F.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:D,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Tm={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"}},$m={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy"},Lm={selectDate:"Select Date",selectRange:"Select range",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},Hm={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"}},dl={chart:Tm,table:$m,datepicker:Lm,textEditor:Hm},Am={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"}},Dm={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa"},Rm={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},Im={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},ul={chart:Am,table:Dm,datepicker:Rm,textEditor:Im},Fm={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"}},zm={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj"},Pm={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},Om={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"}},ml={chart:Fm,table:zm,datepicker:Pm,textEditor:Om},Dl={en:dl,fr:ul,nl:ml};function Wm(H){if(!H||!H.global)return;const he=H.global.availableLocales||[];Object.keys(Dl).forEach(D=>{he.includes(D)&&H.global.mergeLocaleMessage(D,Dl[D])})}const Rl={en:{textEditor:dl.textEditor},fr:{textEditor:ul.textEditor},nl:{textEditor:ml.textEditor}};function Zm(H){if(!H||!H.global)return;const he=H.global.availableLocales||[];Object.keys(Rl).forEach(D=>{he.includes(D)&&H.global.mergeLocaleMessage(D,Rl[D])})}const Il={en:{table:dl.table},fr:{table:ul.table},nl:{table:ml.table}};function qm(H){if(!H||!H.global)return;const he=H.global.availableLocales||[];Object.keys(Il).forEach(D=>{he.includes(D)&&H.global.mergeLocaleMessage(D,Il[D])})}const Fl={en:{datepicker:dl.datepicker},fr:{datepicker:ul.datepicker},nl:{datepicker:ml.datepicker}};function Um(H){if(!H||!H.global)return;const he=H.global.availableLocales||[];Object.keys(Fl).forEach(D=>{he.includes(D)&&H.global.mergeLocaleMessage(D,Fl[D])})}const Xm={en:{...dl},fr:{...ul},nl:{...ml}};cl.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:Xm});exports.DSSChart=Or;exports.DSSChartMessages=Dl;exports.DSSColorPicker=nm;exports.DSSConfetti=_m;exports.DSSDatepicker=z1;exports.DSSDatepickerMessages=Fl;exports.DSSDnd=Bm;exports.DSSLoader=fm;exports.DSSModal=Al;exports.DSSSkeleton=gm;exports.DSSTable=ac;exports.DSSTableMessages=Il;exports.DSSTextEditor=Ku;exports.DSSTextEditorMessages=Rl;exports.addDSSChartTranslations=Wm;exports.addDSSDatepickerTranslations=Um;exports.addDSSTableTranslations=qm;exports.addDSSTextEditorTranslations=Zm;
|
|
97
|
+
`,document.body.appendChild(Ye),j=Ye}function ut(se,xe){j&&(j.style.left=`${se-_e}px`,j.style.top=`${xe-Pe}px`)}function he(se){se.classList.add("dss-dnd-item--dragging"),se.style.background=k.value.dragSourceBackground,se.style.borderColor=k.value.dragSourceBorder,se.style.transform="scale(0.97)"}function Dt(se){se.classList.remove("dss-dnd-item--dragging"),se.style.background="",se.style.borderColor="",se.style.transform=""}function xt(se,xe){return document.elementFromPoint(se,xe)?.closest(".dss-dnd-column-body")??null}function nt(se,xe){const J=xt(se,xe),oe=J?.getAttribute("data-column")??null;if(!oe){Fe.value=null,p.value=-1;return}Fe.value=oe;const Ye=J.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let ct=Ye.length;for(let Ze=0;Ze<Ye.length;Ze++){const Ve=Ye[Ze].getBoundingClientRect();if(xe<Ve.top+Ve.height/2){ct=Ze;break}}p.value=ct}function Be(se){se.preventDefault(),ut(se.clientX,se.clientY),!be&&(be=requestAnimationFrame(()=>{be=null,nt(se.clientX,se.clientY)}))}function te(se){window.removeEventListener("pointermove",Be),window.removeEventListener("pointerup",te),window.removeEventListener("pointercancel",te),_?.releasePointerCapture?.(se.pointerId),Dt(_),_=null;const J=xt(se.clientX,se.clientY)?.getAttribute("data-column")??null;if(ne.value&&J){const oe=ne.value[D.columnKey],Ye=J,Ze=(Le.value[Ye]||[]).filter(ot=>ot[D.itemKey]!==ne.value[D.itemKey]),Ve=Math.max(0,Math.min(p.value,Ze.length)),Ot=z(Ye,Ve),_t=ne.value[D.itemKey];F("move",{item:ne.value,from:oe,to:Ye,position:Ot,index:Ve}),ge&&clearTimeout(ge),ie.value={id:_t,from:oe,to:Ye},ge=setTimeout(()=>{ie.value=null},3500)}j&&(j.remove(),j=null),Xt()}function pn(se,xe){se.preventDefault();const J=se.target.closest(".dss-dnd-item");if(!J)return;const oe=J.getBoundingClientRect();_e=se.clientX-oe.left,Pe=se.clientY-oe.top,ne.value=xe,_=J,dt(J,se.clientX,se.clientY),requestAnimationFrame(()=>he(J)),J.setPointerCapture?.(se.pointerId),window.addEventListener("pointermove",Be),window.addEventListener("pointerup",te,{once:!0}),window.addEventListener("pointercancel",te,{once:!0})}function rt(se,xe){k.value.useHandle||pn(se,xe)}function Qe(se,xe){pn(se,xe)}function sn(){be&&(cancelAnimationFrame(be),be=null)}function Xt(){sn(),ne.value=null,Fe.value=null,p.value=-1}return e.onBeforeUnmount(()=>{sn(),ge&&clearTimeout(ge),j&&(j.remove(),j=null)}),(se,xe)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":k.value.unstyled}]),style:e.normalizeStyle(Me.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,J=>(e.openBlock(),e.createElementBlock("div",{key:J.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":Fe.value===J.value},J.class||""]])},[k.value.showHeader?(e.openBlock(),e.createElementBlock("div",hm,[e.renderSlot(se.$slots,"column-header",{column:J,items:Le.value[J.value]||[]},()=>[e.createElementVNode("span",ym,e.toDisplayString(J.title||J.value),1),e.createElementVNode("span",km,e.toDisplayString((Le.value[J.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":J.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value[J.value],oe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:oe.key},[oe.type==="indicator"?(e.openBlock(),e.createElementBlock("div",bm)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":oe.isDragged,"dss-dnd-item--no-handle":!k.value.useHandle}]),onPointerdown:Ye=>rt(Ye,oe.item)},[k.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ye=>Qe(Ye,oe.item),["stop"])},[e.renderSlot(se.$slots,"handle",{},()=>[xe[0]||(xe[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,xm)):e.createCommentVNode("",!0),e.createElementVNode("div",Em,[e.renderSlot(se.$slots,"item",{item:oe.item,column:J,justDropped:ie.value?.id===oe.item[L.itemKey],droppedFrom:ie.value?.id===oe.item[L.itemKey]?ie.value.from:null,droppedTo:ie.value?.id===oe.item[L.itemKey]?ie.value.to:null},()=>[e.createElementVNode("div",Vm,e.toDisplayString(oe.item[L.itemKey]),1)])])],42,wm))],64))),128)),(Le.value[J.value]||[]).length===0&&Fe.value!==J.value?(e.openBlock(),e.createElementBlock("div",Sm,[e.renderSlot(se.$slots,"empty",{column:J},()=>[xe[1]||(xe[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,Cm)],2))),128))],6))}}),Mm={name:"DSSConfetti"},_m=Object.assign(Mm,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(L){const fe=L,D=e.ref(null),F=e.ref(!1);let we=[],k=null,Me=null;function ne(j,_){const _e=[];for(let Pe=0;Pe<fe.count;Pe++)_e.push(Fe(j));return _e}function Fe(j,_){return{x:Math.random()*j,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:fe.colors[Math.floor(Math.random()*fe.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function p(j,_,_e,Pe){j.clearRect(0,0,_,_e);for(const Le of we)j.save(),j.globalAlpha=Le.opacity*Pe,j.beginPath(),j.lineWidth=Le.r,j.strokeStyle=Le.color,j.moveTo(Le.x+Le.tilt+Le.r/2,Le.y),j.lineTo(Le.x+Le.tilt,Le.y+Le.tilt+Le.r/2),j.stroke(),j.restore()}function ie(j,_,_e){const Pe=.3+_e*.7;for(let Le=0;Le<we.length;Le++){const Ke=we[Le];Ke.tiltAngle+=Ke.tiltInc,Ke.y+=Ke.speed*Pe,Ke.x+=Math.sin(Ke.d)*.5*Pe,Ke.tilt=Math.sin(Ke.tiltAngle)*15,_e>=.99&&Ke.y>_+20&&(we[Le]=Fe(j))}}function be(){F.value=!0,e.nextTick(()=>{const j=D.value;if(!j)return;const _=j.getContext("2d"),_e=j.parentElement;if(!_e)return;const Pe=_e.getBoundingClientRect();j.width=Pe.width,j.height=Pe.height,we=ne(j.width,j.height);const Le=Date.now(),Ke=Le+fe.duration,z=()=>{const dt=Date.now(),ut=dt-Le;if(dt<Ke){let he=1;ut>fe.fadeStart&&(he=1-(ut-fe.fadeStart)/(fe.duration-fe.fadeStart)),p(_,j.width,j.height,he),ie(j.width,j.height,he),k=requestAnimationFrame(z)}else ge()};z()})}function ge(){k&&(cancelAnimationFrame(k),k=null),we=[],F.value=!1}return e.watch(()=>fe.trigger,j=>{j&&(Me&&clearTimeout(Me),Me=setTimeout(be,fe.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ge(),Me&&clearTimeout(Me)}),(j,_)=>F.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:D,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Tm={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"}},$m={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy"},Lm={selectDate:"Select Date",selectRange:"Select range",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},Hm={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"}},dl={chart:Tm,table:$m,datepicker:Lm,textEditor:Hm},Am={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"}},Dm={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa"},Rm={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},Im={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},ul={chart:Am,table:Dm,datepicker:Rm,textEditor:Im},Fm={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"}},zm={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj"},Pm={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},Om={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"}},ml={chart:Fm,table:zm,datepicker:Pm,textEditor:Om},Dl={en:dl,fr:ul,nl:ml};function Wm(L){if(!L||!L.global)return;const fe=L.global.availableLocales||[];Object.keys(Dl).forEach(D=>{fe.includes(D)&&L.global.mergeLocaleMessage(D,Dl[D])})}const Rl={en:{textEditor:dl.textEditor},fr:{textEditor:ul.textEditor},nl:{textEditor:ml.textEditor}};function Zm(L){if(!L||!L.global)return;const fe=L.global.availableLocales||[];Object.keys(Rl).forEach(D=>{fe.includes(D)&&L.global.mergeLocaleMessage(D,Rl[D])})}const Il={en:{table:dl.table},fr:{table:ul.table},nl:{table:ml.table}};function qm(L){if(!L||!L.global)return;const fe=L.global.availableLocales||[];Object.keys(Il).forEach(D=>{fe.includes(D)&&L.global.mergeLocaleMessage(D,Il[D])})}const Fl={en:{datepicker:dl.datepicker},fr:{datepicker:ul.datepicker},nl:{datepicker:ml.datepicker}};function Um(L){if(!L||!L.global)return;const fe=L.global.availableLocales||[];Object.keys(Fl).forEach(D=>{fe.includes(D)&&L.global.mergeLocaleMessage(D,Fl[D])})}const Xm={en:{...dl},fr:{...ul},nl:{...ml}};cl.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:Xm});exports.DSSChart=Or;exports.DSSChartMessages=Dl;exports.DSSColorPicker=nm;exports.DSSConfetti=_m;exports.DSSDatepicker=z1;exports.DSSDatepickerMessages=Fl;exports.DSSDnd=Bm;exports.DSSLoader=fm;exports.DSSModal=Al;exports.DSSSkeleton=gm;exports.DSSTable=ac;exports.DSSTableMessages=Il;exports.DSSTextEditor=Ku;exports.DSSTextEditorMessages=Rl;exports.addDSSChartTranslations=Wm;exports.addDSSDatepickerTranslations=Um;exports.addDSSTableTranslations=qm;exports.addDSSTextEditorTranslations=Zm;
|