dsp-semactic 0.6.15 → 0.6.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dsp-semactic.css +1 -1
- package/dist/index.cjs.js +55 -35
- package/dist/index.es.js +11778 -10891
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
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"],$a=["x1","x2","y1","y2","onMouseover"],Ta=["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"],$s=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Ts=["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"},$r={for:"dss-marker-description"},Tr={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:I}=cl.useI18n(),be=fe,k=e.ref(null),Me=e.ref(null),oe=e.ref(null),Fe=e.ref(0),p=e.ref(0);let ce=null,we=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 je(t)&&je(s)&&Object.keys(s).forEach(c=>{je(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),Ge.value&&(t+=25),Ze.value&&_.series.length>0){const c=_.series.filter((f,g)=>!bt.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 je(t){return t&&typeof t=="object"&&!Array.isArray(t)}const F=e.computed(()=>Pe(_e,_.options)),dt=e.computed(()=>{const t=F.value;return t&&t.chart&&t.chart.width==="auto"}),ut=e.computed(()=>{const t=F.value;return t&&t.chart&&t.chart.height==="auto"}),he=e.computed(()=>{const t=F.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=F.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&&ne.value==="semi-radial"&&xt.value!=null?Dt.value+nt.value+"px":ut.value?"100%":pn.value?Dt.value+nt.value+"px":nt.value+(Ze.value?20:0)+"px"),ne=e.computed(()=>{const t=F.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),vn=e.computed(()=>{const t=_.series.map(s=>s.type||ne.value);return new Set(t).size>1}),rt=e.computed(()=>{const t=F.value;return t&&t.title&&t.title.text?t.title.text:""}),Ge=e.computed(()=>{const t=F.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),sn=e.computed(()=>{const t=F.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=F.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),re=e.computed(()=>{const t=F.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),xe=e.computed(()=>{const t=F.value;if(!t||!t.yAxis)return Fn;const s=t.yAxis.min;return typeof s=="number"||s===Fn?s:Fn}),ee=e.computed(()=>{const t=F.value;if(!t||!t.yAxis)return Fn;const s=t.yAxis.max;return typeof s=="number"||s===Fn?s:Fn}),le=e.computed(()=>{const t=F.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Xe=e.computed(()=>{const t=F.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ct=e.computed(()=>{const t=F.value;return t&&t.grid&&t.grid.show!==!1}),Ze=e.computed(()=>{const t=F.value;return t&&t.legend&&t.legend.show!==!1}),Ve=e.computed(()=>{const t=F.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ot=e.computed(()=>{const t=F.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),_t=e.computed(()=>{const t=F.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),ot=e.computed(()=>{const t=F.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),tn=e.computed(()=>{const t=F.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Rt=e.computed(()=>{const t=F.value;return t&&t.zoom&&t.zoom.enabled!==!1}),yt=e.computed(()=>{const t=F.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),$t=e.computed(()=>{const t=F.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),st=e.computed(()=>{const t=F.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),nn=e.computed(()=>{if(!pn.value)return 0;const t=F.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),tt=e.computed(()=>{const t=F.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),kt=e.computed(()=>{const{maxX:t}=Mt.value;return t===0}),$e=(t,s)=>kt.value&&s===0?5:s,qe=e.computed(()=>{const t=F.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),O=e.computed(()=>{const t=F.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Z=e.computed(()=>{const t=F.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),X=e.computed(()=>{const t=F.value;return O.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),J=e.computed(()=>{const t=F.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=F.value;return t&&t.animations&&t.animations.enabled!==!1}),et=e.computed(()=>{const t=F.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Se=e.computed(()=>{const t=F.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Oe=e.computed(()=>{const t=F.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),mt=e.computed(()=>{const t=F.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Et=e.computed(()=>{const t=F.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Nt=e.computed(()=>{const t=F.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Tt=e.computed(()=>{const t=F.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Ae=e.computed(()=>{const t=F.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),It=e.computed(()=>F.value?.spider?.gridSteps||5),ft=e.computed(()=>{const t=[],s=It.value;for(let n=1;n<=s;n++)t.push(Je.value/s*n);return t}),Bn=t=>{const s=Wt.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const n=ft.value[t];return Math.round(n/Je.value*100)+"%"},Wt=e.computed(()=>F.value?.spider?.gridLabels||null),Ct=e.computed(()=>{const t=F.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Bt=e.computed(()=>{const t=F.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),Tn=e.computed(()=>{const t=F.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Ln=e.computed(()=>{const t=F.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Vt.value}),rn=e.computed(()=>{const t=F.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),cn=e.computed(()=>{const t=F.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Yt=e.computed(()=>{const s=F.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},Wn=e.computed(()=>!R.value.isZooming);e.computed(()=>gt.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("-"),$=new Date(`20${B}`,M-1,b),V=Math.abs($-n);V<f&&(f=V,c=x)}),c}const T=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=gt.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=F.value;return t&&t.watermark&&t.watermark.enabled===!0}),A=e.computed(()=>{const t=F.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),G=e.computed(()=>{const t=F.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),ke=e.computed(()=>{const t=F.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}}),Ue=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,$=H.value.height;switch(n){case"center":c=g+(B-t)/2,f=b+($-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),Ye=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"}))}},Vt=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"),no=require("vue-i18n"),Jo={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ea=["value"],ta=["placeholder","value","disabled"],na=["placeholder","value"],la={key:0,class:"dss-datepicker__double-wrap"},oa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},aa=["onClick"],sa={class:"dss-datepicker__double-calendars"},ra={class:"dss-datepicker__double-calendar"},ia={class:"dss-datepicker__calendar-header"},ca=["aria-label"],ua={class:"dss-datepicker__month-year-row"},da=["aria-label"],ma={class:"dss-datepicker__weekdays"},pa={class:"dss-datepicker__grid"},fa=["disabled","onClick","onMouseenter"],va={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},ga={class:"dss-datepicker__double-calendar"},ha={class:"dss-datepicker__calendar-header"},ya=["aria-label"],Ca={class:"dss-datepicker__month-year-row"},ka=["aria-label"],ba={class:"dss-datepicker__weekdays"},wa={class:"dss-datepicker__grid"},xa=["disabled","onClick","onMouseenter"],Ea={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Va={class:"dss-datepicker__calendar-header"},Na=["aria-label"],Sa={class:"dss-datepicker__month-year-row"},Ba=["aria-label"],Ma={class:"dss-datepicker__weekdays"},_a={class:"dss-datepicker__grid"},$a=["disabled","onClick","onMouseenter"],Ta={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},La={class:"dss-datepicker__calendar-header"},Ha={class:"dss-datepicker__month-year-row"},Aa={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Da={class:"dss-datepicker__months-grid"},Ra=["onClick"],Fa={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Ia={class:"dss-datepicker__month-year"},za={class:"dss-datepicker__years-grid"},Pa=["data-year","onClick"],qo=27,zo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:D=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(D)},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(D,{emit:ke}){const z=D,R=ke,{t:Me,locale:C}=no.useI18n(),Te=e.ref(!1),ie=e.ref("days"),nt=new Date,f=e.computed(()=>z.minDate instanceof Date?z.minDate:nt),ue=e.ref(f.value.getMonth()),ve=e.ref(f.value.getFullYear()),de=e.ref(f.value.getMonth()),te=e.ref(f.value.getFullYear()),S=e.ref(f.value.getMonth()),ae=e.ref(f.value.getFullYear()),Ze=e.ref("start"),He=e.ref(null),Ve=e.ref(null);function O(){const A=f.value,q=A.getMonth(),I=A.getFullYear(),ne=q===11?0:q+1,Be=q===11?I+1:I;return{left:{month:q,year:I},right:{month:ne,year:Be}}}const lt=e.ref(null),je=e.ref(null),Ne=e.ref(null),Ht=e.ref(null),Bt=e.ref(null),pt=e.ref(null),Re=new Date().getFullYear(),ge=e.computed(()=>["single","singleFromAvailable"].includes(z.mode)),gt=e.computed(()=>["range","rangeFromAvailable"].includes(z.mode)),wt=e.computed(()=>{if(z.mode!=="single"&&z.mode!=="singleFromAvailable")return null;const A=z.modelValue;return A instanceof Date?A:null}),tt=e.computed(()=>{if(!gt.value)return{start:null,end:null};const A=z.modelValue;return!A||typeof A!="object"?{start:null,end:null}:{start:A.start instanceof Date?A.start:null,end:A.end instanceof Date?A.end:null}});function Mt(A){if(!A||!(A instanceof Date))return"";const q=A.getDate(),I=A.getMonth()+1,ne=A.getFullYear(),Be=Je=>String(Je).padStart(2,"0");return`${Be(q)}/${Be(I)}/${ne}`}const Ft=e.computed(()=>Mt(wt.value)),on=e.computed(()=>{const{start:A,end:q}=tt.value;if(!A&&!q)return"";const I=!q||A&&A<=q?A:q,ne=!A||q&&q>=A?q:A;return X(I,ne)?Mt(I):`${Mt(I)} - ${Mt(ne)}`}),xt=e.computed(()=>{if(z.mode!=="readonly")return"—";const A=z.modelValue;if(A instanceof Date)return Mt(A)||"—";if(A&&typeof A=="object"&&("start"in A||"end"in A)){const q=A.start instanceof Date?A.start:null,I=A.end instanceof Date?A.end:null;if(!q&&!I)return"—";const ne=!I||q&&q<=I?q:I,Be=!q||I&&I>=q?I:q;return X(ne,Be)?Mt(ne):`${Mt(ne)} - ${Mt(Be)}`}return"—"});e.computed(()=>{const A=new Date(ve.value,ue.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(A)});const Ke=e.computed(()=>Ve.value==="left"?de.value:Ve.value==="right"?S.value:ue.value),Ge=e.computed(()=>Ve.value==="left"?te.value:Ve.value==="right"?ae.value:ve.value),Zt=e.computed(()=>{const A=new Date(ve.value,ue.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(A)}),At=e.computed(()=>{const A=new Date(Ge.value,Ke.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(A)}),_t=e.computed(()=>{const A=new Intl.DateTimeFormat(C.value,{month:"short"});return Array.from({length:12},(q,I)=>A.format(new Date(2024,I,1)))}),U=e.computed(()=>{const q=(Ve.value?Ge.value:ve.value)-Math.floor(qo/2);return Array.from({length:qo},(I,ne)=>q+ne)}),Ie=e.computed(()=>{const A=U.value;return A.length?`${A[0]} – ${A[A.length-1]}`:""}),_e=e.computed(()=>{const A=new Intl.DateTimeFormat(C.value,{weekday:"short"}),q=new Date(2024,0,1),I=[];for(let ne=0;ne<7;ne++){const Be=new Date(q);Be.setDate(q.getDate()+ne),I.push(A.format(Be).slice(0,2))}return I});function fe(A,q){const I=new Date(A,q,1),ne=new Date(A,q+1,0),Be=I.getDay(),Je=ne.getDate(),rt=[];for(let Fe=0;Fe<Be;Fe++)rt.push(null);for(let Fe=1;Fe<=Je;Fe++)rt.push(new Date(A,q,Fe));return rt}const ct=e.computed(()=>fe(ve.value,ue.value)),Et=e.computed(()=>fe(te.value,de.value)),We=e.computed(()=>fe(ae.value,S.value));e.computed(()=>{const A=new Date(te.value,de.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(A)}),e.computed(()=>{const A=new Date(ae.value,S.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(A)});const ft=e.computed(()=>{const A=new Date(te.value,de.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(A)}),dt=e.computed(()=>{const A=new Date(ae.value,S.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(A)}),$t=e.computed(()=>z.availableDates&&z.availableDates.length>0),ot=e.computed(()=>$t.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"}]),bt=e.ref({top:0,left:0});function Se(){if(!Ht.value||!Te.value)return;const A=Ht.value.getBoundingClientRect(),q=window.innerWidth||document.documentElement.clientWidth,I=window.innerHeight||document.documentElement.clientHeight;let ne=A.left,Be=A.bottom+4;const Je=Bt.value;if(Je){const rt=Je.offsetWidth,Fe=Je.offsetHeight;if(ne+rt>q-8&&(ne=A.right-rt,ne<8&&(ne=8)),Be+Fe>I-8){const at=A.top-4-Fe;at>=8?Be=at:Be=Math.max(8,I-Fe-8)}}bt.value={top:Be,left:ne}}const ut=e.computed(()=>!Ht.value||!Te.value?{}:{position:"fixed",left:`${bt.value.left}px`,top:`${bt.value.top}px`,zIndex:1002});function X(A,q){return!A||!q?!1:A.getFullYear()===q.getFullYear()&&A.getMonth()===q.getMonth()&&A.getDate()===q.getDate()}function j(A){return new Date(A.getFullYear(),A.getMonth(),A.getDate()).getTime()}function Q(A){return!z.availableDates||!z.availableDates.length?!0:z.availableDates.some(q=>q instanceof Date&&X(q,A))}function re(A){const q=j(A);return!(z.minDate instanceof Date&&q<j(z.minDate)||z.maxDate instanceof Date&&q>j(z.maxDate))}function x(A){return!z.exceptDates||!z.exceptDates.length?!1:z.exceptDates.some(q=>q instanceof Date&&X(q,A))}function k(A){return x(A)?!1:["singleFromAvailable","rangeFromAvailable"].includes(z.mode)?Q(A):re(A)}function V(A){const q=wt.value,I=tt.value,ne=j(A),Be=gt.value&&I.start&&I.end&&ne>j(I.start)&&ne<j(I.end),Je=gt.value&&I.start&&X(A,I.start),rt=gt.value&&I.end&&X(A,I.end),Fe=Je&&rt,at=ge.value&&q&&X(A,q)||Je||rt;let sn=!1;if(gt.value&&I.start&&!I.end&&He.value){const Nn=j(I.start),nn=j(He.value),Hn=Math.min(Nn,nn),Cn=Math.max(Nn,nn);sn=ne>Hn&&ne<Cn}return{"dss-datepicker__day--selected":at&&!Fe,"dss-datepicker__day--range-start":Je&&!Fe,"dss-datepicker__day--range-end":rt&&!Fe,"dss-datepicker__day--range-single":Fe,"dss-datepicker__day--in-range":Be&&!Je&&!rt,"dss-datepicker__day--in-range-preview":sn&&!Je&&!rt&&!Be,"dss-datepicker__day--disabled":!k(A)}}function P(A){if(!gt.value)return;const q=tt.value;if(!q.start||q.end){He.value=null;return}if(!k(A)){He.value=null;return}He.value=new Date(A.getFullYear(),A.getMonth(),A.getDate())}function Y(){He.value=null}function xe(){if(!z.doubleCalendar||!gt.value)return;const A=tt.value,{start:q,end:I}=A;if(q&&I){const Je=q<=I?q:I,rt=q<=I?I:q,Fe=Je.getMonth(),at=Je.getFullYear(),sn=rt.getMonth(),Nn=rt.getFullYear();if(Fe!==sn||at!==Nn){const nn=de.value===Fe&&te.value===at,Hn=S.value===sn&&ae.value===Nn;if(nn&&Hn)return;de.value=Fe,te.value=at,S.value=sn,ae.value=Nn}else{const nn=Fe===0?11:Fe-1,Hn=Fe===0?at-1:at;de.value===nn&&te.value===Hn&&S.value===Fe&&ae.value===at||(de.value=Fe,te.value=at,Fe===11?(S.value=0,ae.value=at+1):(S.value=Fe+1,ae.value=at))}return}const ne=q||I;if(ne){const Je=ne.getMonth(),rt=ne.getFullYear(),Fe=de.value===Je&&te.value===rt,at=S.value===Je&&ae.value===rt;if(Fe||at)return;de.value=Je,te.value=rt,Je===11?(S.value=0,ae.value=rt+1):(S.value=Je+1,ae.value=rt);return}const Be=O();de.value=Be.left.month,te.value=Be.left.year,S.value=Be.right.month,ae.value=Be.right.year}function Ye(A="start"){if(z.mode==="readonly")return;Ze.value=A;const q=wt.value,I=tt.value;if(ge.value&&q)ue.value=q.getMonth(),ve.value=q.getFullYear();else if(gt.value)if(z.doubleCalendar)xe();else{const ne=A==="start"&&I.start?I.start:I.end||I.start;ne&&(ue.value=ne.getMonth(),ve.value=ne.getFullYear())}Ht.value=ge.value?lt.value?.closest(".dss-datepicker__input-wrap"):je.value,ie.value="days",Ve.value=null,Te.value=!0,e.nextTick(()=>{Se()})}function Le(){ie.value="days",Ve.value=null,He.value=null,Te.value=!1}function le(A,q){Ve.value=A,ie.value=q}function Qe(){ie.value="days",Ve.value=null}function qe(A){const q=new Date,I=q.getFullYear(),ne=q.getMonth(),Be=q.getDate();let Je,rt;if($t.value){const Fe=[...z.availableDates].filter(at=>at instanceof Date).map(at=>new Date(at.getFullYear(),at.getMonth(),at.getDate()));if(Fe.sort((at,sn)=>at.getTime()-sn.getTime()),Fe.length===0)return;if(A==="all")Je=Fe[0],rt=Fe[Fe.length-1];else{const at=parseInt(A.replace("last",""),10);if(at<2||at>5)return;const sn=Fe.slice(-at);Je=sn[0],rt=sn[sn.length-1]}}else{const Fe=new Date(I,ne,Be);switch(A){case"today":Je=Fe,rt=Fe;break;case"lastWeek":Je=new Date(I,ne,Be-6),rt=Fe;break;case"last15Days":Je=new Date(I,ne,Be-14),rt=Fe;break;case"last30Days":Je=new Date(I,ne,Be-29),rt=Fe;break;case"thisMonth":Je=new Date(I,ne,1),rt=Fe;break;case"last3Months":Je=new Date(I,ne-3,1),rt=new Date(I,ne,0);break;case"last6Months":Je=new Date(I,ne-6,1),rt=new Date(I,ne,0);break;case"last12Months":Je=new Date(I,ne-12,1),rt=new Date(I,ne,0);break;case"lastYear":Je=new Date(I-1,0,1),rt=new Date(I-1,11,31);break;default:return}}R("update:modelValue",{start:Je,end:rt}),xe()}function Vt(A){Ve.value==="left"?de.value=A:Ve.value==="right"?S.value=A:ue.value=A,Qe()}function vt(A){Ve.value==="left"?te.value=A:Ve.value==="right"?ae.value=A:ve.value=A,Qe()}function Ue(){ue.value===0?(ue.value=11,ve.value--):ue.value--}function Dt(){ue.value===11?(ue.value=0,ve.value++):ue.value++}function $n(){de.value===0?(de.value=11,te.value--):de.value--}function Tn(){de.value===11?(de.value=0,te.value++):de.value++}function cn(){S.value===0?(S.value=11,ae.value--):S.value--}function yn(){S.value===11?(S.value=0,ae.value++):S.value++}function an(A){if(!k(A))return;const q=new Date(A.getFullYear(),A.getMonth(),A.getDate());if(ge.value){R("update:modelValue",q),Le();return}const I=tt.value;if(!I.start&&!I.end){R("update:modelValue",{start:q,end:null}),Ze.value="end";return}if(I.start&&I.end){R("update:modelValue",{start:q,end:null}),Ze.value="end";return}if(Ze.value==="start"){let ne=q,Be=I.end;ne&&Be&&ne>Be&&([ne,Be]=[Be,ne]),R("update:modelValue",{start:ne||Be,end:Be||ne}),Ze.value="end"}else{let ne=I.start,Be=q;ne&&Be&&Be<ne&&([ne,Be]=[Be,ne]),R("update:modelValue",{start:ne||Be,end:Be||ne}),Ze.value="start"}}e.watch(tt,()=>{z.doubleCalendar&>.value&&Te.value&&xe()},{deep:!0});let un=null,zn=null,Ln=null;function hl(){un&&(document.removeEventListener("keydown",un),un=null),zn&&(window.removeEventListener("resize",zn),zn=null),Ln&&(window.removeEventListener("scroll",Ln,!0),Ln=null)}return e.watch(ie,A=>{A==="years"&&e.nextTick(()=>{pt.value?.querySelector(`[data-year="${Ge.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(Te,A=>{hl(),A&&(un=q=>{q.key==="Escape"&&(ie.value==="years"||ie.value==="months"?Qe():Le())},zn=()=>{Se()},Ln=()=>{Se()},document.addEventListener("keydown",un),window.addEventListener("resize",zn),window.addEventListener("scroll",Ln,!0))}),e.onBeforeUnmount(()=>{hl()}),(A,q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":D.mode==="readonly"}])},[D.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Jo,[q[10]||(q[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",{type:"text",class:"dss-datepicker__input",value:xt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ea)])):ge.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:q[0]||(q[0]=I=>Ye("start"))},[q[11]||(q[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:"inputSingleRef",ref:lt,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Me)("datepicker.selectDate"),value:Ft.value,readonly:"",disabled:D.mode==="readonly"},null,8,ta)])):gt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:je,onClick:q[1]||(q[1]=I=>Ye("start"))},[q[12]||(q[12]=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:Ne,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Me)("datepicker.selectRange"),value:on.value,readonly:""},null,8,na)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Te.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Le,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Bt,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":D.doubleCalendar&>.value&&ie.value==="days","dss-datepicker__dropdown--quick-select":D.doubleCalendar&>.value&&ie.value==="days"&&D.quickSelect}]),onClick:q[9]||(q[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(ut.value)},[ie.value==="days"&&D.doubleCalendar&>.value?(e.openBlock(),e.createElementBlock("div",la,[D.quickSelect?(e.openBlock(),e.createElementBlock("nav",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value,I=>(e.openBlock(),e.createElementBlock("button",{key:I.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:ne=>qe(I.id)},e.toDisplayString(e.unref(Me)(I.labelKey)),9,aa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",sa,[e.createElementVNode("div",ra,[e.createElementVNode("div",ia,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.prevMonth"),onClick:$n}," ‹ ",8,ca),e.createElementVNode("div",ua,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[2]||(q[2]=I=>le("left","months"))},e.toDisplayString(ft.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[3]||(q[3]=I=>le("left","years"))},e.toDisplayString(te.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.nextMonth"),onClick:Tn}," › ",8,da)]),e.createElementVNode("div",ma,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Et.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(I)]),disabled:!k(I),onClick:Be=>an(I),onMouseenter:Be=>P(I),onMouseleave:Y},e.toDisplayString(I.getDate()),43,fa)):(e.openBlock(),e.createElementBlock("span",va))],64))),128))])]),e.createElementVNode("div",ga,[e.createElementVNode("div",ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.prevMonth"),onClick:cn}," ‹ ",8,ya),e.createElementVNode("div",Ca,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[4]||(q[4]=I=>le("right","months"))},e.toDisplayString(dt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[5]||(q[5]=I=>le("right","years"))},e.toDisplayString(ae.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.nextMonth"),onClick:yn}," › ",8,ka)]),e.createElementVNode("div",ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(I)]),disabled:!k(I),onClick:Be=>an(I),onMouseenter:Be=>P(I),onMouseleave:Y},e.toDisplayString(I.getDate()),43,xa)):(e.openBlock(),e.createElementBlock("span",Ea))],64))),128))])])])])):ie.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Va,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.prevMonth"),onClick:Ue}," ‹ ",8,Na),e.createElementVNode("div",Sa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[6]||(q[6]=I=>ie.value="months")},e.toDisplayString(Zt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[7]||(q[7]=I=>ie.value="years")},e.toDisplayString(ve.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.nextMonth"),onClick:Dt}," › ",8,Ba)]),e.createElementVNode("div",Ma,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ct.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(I)]),disabled:!k(I),onClick:Be=>an(I),onMouseenter:Be=>P(I),onMouseleave:Y},e.toDisplayString(I.getDate()),43,$a)):(e.openBlock(),e.createElementBlock("span",Ta))],64))),128))])],64)):ie.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",La,[e.createElementVNode("div",Ha,[e.createElementVNode("span",Aa,e.toDisplayString(At.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[8]||(q[8]=I=>ie.value="years")},e.toDisplayString(Ge.value),1)])]),e.createElementVNode("div",Da,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_t.value,(I,ne)=>(e.openBlock(),e.createElementBlock("button",{key:ne,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ne===Ke.value}]),onClick:Be=>Vt(ne)},e.toDisplayString(I),11,Ra))),128))])],64)):ie.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Fa,[e.createElementVNode("span",Ia,e.toDisplayString(Ie.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:pt},[e.createElementVNode("div",za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,I=>(e.openBlock(),e.createElementBlock("button",{key:I,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":I===Ge.value,"dss-datepicker__year-cell--current":I===e.unref(Re)}]),"data-year":I,onClick:ne=>vt(I)},e.toDisplayString(I),11,Pa))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Oa=["data-chart-type"],Za={class:"dss-chart-header-titles"},Wa={key:0,class:"dss-chart-title"},qa={key:1,class:"dss-chart-subtitle"},Ua=["onClick","onMouseenter"],Xa={class:"dss-legend-text"},Ya=["onClick","onMouseenter"],ja={class:"dss-legend-text"},Ka=["title"],Ga=["src"],Qa={class:"dss-chart-area-wrapper"},Ja={key:0,class:"dss-chart-z-axis-label"},es=["width","height","data-smooth","data-animated"],ts={id:"chart-clip"},ns=["y","width","height"],ls=["id"],os=["d"],as=["id"],ss=["d"],rs={key:0},is={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},cs=["x1","x2","y1","y2"],us={class:"dss-axes"},ds=["x1","x2","y1","y2"],ms=["x1","x2","y1","y2"],ps={class:"dss-axis-labels"},fs=["x","y"],vs=["x","y"],gs=["x","y"],hs=["y","transform"],ys={key:1,class:"dss-flag-markers"},Cs={"clip-path":"url(#chart-clip)"},ks=["x1","x2","y1","y2","onMouseover"],bs=["x1","x2","y1","y2","onMouseover"],ws=["x1","x2","y1","y2","onMouseover"],xs=["cx","cy","onMouseover"],Es=["cx","cy","fill","onMouseover"],Vs=["x","y"],Ns={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Ss={key:0},Bs=["d","onMouseover"],Ms=["x","y","width","height","fill","onMouseover"],_s={class:"dss-line-chart"},$s=["d","stroke","stroke-width"],Ts=["d","stroke","stroke-width","opacity"],Ls=["cx","cy","r","fill","onMouseover"],Hs={key:1},As=["d","stroke","stroke-width"],Ds=["d","stroke","stroke-width"],Rs=["d","stroke","stroke-width","opacity"],Fs=["cx","cy","r","fill","onMouseover"],Is={key:2},zs=["id"],Ps=["x","y","width","height"],Os=["d","fill","fill-opacity","mask"],Zs=["d","stroke","stroke-width"],Ws=["d","fill","onMouseover"],qs=["x","y","width","height","onMouseover"],Us={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},Xs=["x1","x2","y1","y2","stroke"],Ys=["cx","cy","r","fill"],js={key:1,class:"dss-bubble-chart"},Ks={key:0,class:"dss-bubble-group"},Gs=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Qs=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Js=["transform"],er=["cx","cy","r"],tr=["data-chart-type","clip-path"],nr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],lr={key:1,class:"dss-radial-segment-data-labels"},or=["x","y"],ar=["x","y","font-size","fill"],sr=["x1","y1","x2","y2","stroke"],rr=["x1","y1","x2","y2","stroke"],ir=["x","y","text-anchor","font-size"],cr=["transform"],ur={key:0,class:"dss-spider-grid"},dr=["cx","cy","r"],mr={class:"dss-spider-grid-labels"},pr=["x","y"],fr=["x","y"],vr=["x1","x2","y1","y2"],gr={class:"dss-spider-labels"},hr=["x","y","text-anchor","dominant-baseline"],yr=["points","fill","fill-opacity","stroke","stroke-width"],Cr=["cx","cy","r","fill","onMouseover"],kr={class:"dss-chart-logos"},br=["cx","cy","r","fill"],wr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],xr=["onClick","onMouseenter"],Er=["src"],Vr={class:"dss-marker-tooltip-category"},Nr={key:0,class:"dss-marker-tooltip-description"},Sr={key:0,class:"dss-tooltip-section"},Br={key:0,class:"dss-tooltip-title"},Mr={class:"dss-tooltip-series-name"},_r={class:"dss-tooltip-series-value"},$r={key:1,class:"dss-tooltip-section"},Tr={key:0,class:"dss-tooltip-title"},Lr={class:"dss-bubble-tooltip-data"},Hr={key:2,class:"dss-tooltip-section"},Ar={class:"dss-tooltip-title"},Dr={class:"dss-tooltip-value"},Rr={key:0,class:"dss-tooltip-section"},Fr={class:"dss-tooltip-section-title"},Ir={class:"dss-tooltip-group-header"},zr={class:"dss-tooltip-item-content"},Pr={class:"dss-tooltip-item-text"},Or={key:1,class:"dss-tooltip-section"},Zr={class:"dss-tooltip-section-title"},Wr={class:"dss-tooltip-item-content"},qr={class:"dss-tooltip-item-title"},Ur={key:0,class:"dss-tooltip-item-description"},Xr={class:"dss-tooltip-section"},Yr={class:"dss-tooltip-title"},jr={key:0,class:"dss-bubble-tooltip-data"},Kr={class:"dss-tooltip-series-name"},Gr={class:"dss-tooltip-series-value"},Qr={key:0,class:"dss-tooltip-section"},Jr={class:"dss-tooltip-section-title"},ei={class:"dss-tooltip-group-header"},ti={class:"dss-tooltip-item-content"},ni={class:"dss-tooltip-item-text"},li={key:1,class:"dss-tooltip-section"},oi={class:"dss-tooltip-section-title"},ai={class:"dss-tooltip-item-content"},si={class:"dss-tooltip-item-title"},ri={key:0,class:"dss-tooltip-item-description"},ii={key:1,class:"dss-context-menu-separator"},ci={key:0,class:"dss-context-menu-separator"},ui={key:0,class:"dss-context-menu-separator"},di=["onClick"],mi=["innerHTML"],pi={key:0,class:"dss-context-menu-icon"},fi={class:"dss-marker-modal-header"},vi={class:"dss-marker-modal-body"},gi={class:"dss-form-group"},hi={class:"dss-form-group"},yi={for:"dss-marker-description"},Ci={key:0,class:"dss-form-text-display"},ki=["placeholder"],bi={class:"dss-marker-modal-footer"},wi={class:"modal-footer-left"},xi={class:"dss-modal-footer-right"},Ei=["disabled"],Vi={name:"DSSChart"},Ni=Object.assign(Vi,{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:D=>typeof D=="object"&&D!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(D,{emit:ke}){const{t:z,locale:R}=no.useI18n(),Me=ke,C=e.ref(null),Te=e.ref(null),ie=e.ref(null),nt=e.ref(0),f=e.ref(0);let ue=null,ve=null;const de=20,te=e.computed(()=>{if(f.value,nt.value,!C.value||!Te.value)return 0;try{const t=C.value.getBoundingClientRect();return Te.value.getBoundingClientRect().top-t.top}catch{return 0}}),S=D,ae={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:!1,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 Ze(t,s){const n=Object.assign({},t);return Ve(t)&&Ve(s)&&Object.keys(s).forEach(i=>{Ve(s[i])?i in t?n[i]=Ze(t[i],s[i]):Object.assign(n,{[i]:s[i]}):Object.assign(n,{[i]:s[i]})}),n}const He=()=>{let t=20,s=0,n=0;if(wt.value&&(t+=30),tt.value&&(t+=25),_t.value&&S.series.length>0){const i=S.series.filter((p,g)=>!Rt.value.has(g)).length;if(U.value==="top"||U.value==="bottom"){if(Ie.value==="horizontal"){const g=Math.floor(Ne.value/100);s=Math.ceil(i/g)*25+10}else s=i*25+10;t+=s}else n=150}return{height:t,legendHeight:s,legendWidth:n}};function Ve(t){return t&&typeof t=="object"&&!Array.isArray(t)}const O=e.computed(()=>Ze(ae,S.options)),lt=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.width==="auto"}),je=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.height==="auto"}),Ne=e.computed(()=>{const t=O.value;return lt.value?nt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Ht=e.ref(de),Bt=e.computed(()=>{if(je.value){const t=Bt.value;return t??Math.max(0,(f.value||400)-Ht.value*5)}}),pt=e.computed(()=>{const t=O.value;if(je.value){const s=Bt.value;return s??Math.max(0,(f.value||400)-Ht.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Re=e.computed(()=>je.value&&ge.value==="semi-radial"&&Bt.value!=null?Ht.value+pt.value+"px":je.value?"100%":pn.value?Ht.value+pt.value+"px":pt.value+(_t.value?20:0)+"px"),ge=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),gt=e.computed(()=>{const t=S.series.map(s=>s.type||ge.value);return new Set(t).size>1}),wt=e.computed(()=>{const t=O.value;return t&&t.title&&t.title.text?t.title.text:""}),tt=e.computed(()=>{const t=O.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Mt=e.computed(()=>{const t=O.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Ft=e.computed(()=>{const t=O.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),on=e.computed(()=>{const t=O.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),xt=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Xn;const s=t.yAxis.min;return typeof s=="number"||s===Xn?s:Xn}),Ke=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Xn;const s=t.yAxis.max;return typeof s=="number"||s===Xn?s:Xn}),Ge=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Zt=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),At=e.computed(()=>{const t=O.value;return t&&t.grid&&t.grid.show!==!1}),_t=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.show!==!1}),U=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ie=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),_e=e.computed(()=>{const t=O.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),fe=e.computed(()=>{const t=O.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),ct=e.computed(()=>{const t=O.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Et=e.computed(()=>{const t=O.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),We=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),ft=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),dt=e.computed(()=>{const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),$t=e.computed(()=>{if(!pn.value)return 0;const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),ot=e.computed(()=>{const t=O.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),bt=e.computed(()=>{const{maxX:t}=Ot.value;return t===0}),Se=(t,s)=>bt.value&&s===0?5:s,ut=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),X=e.computed(()=>{const t=O.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),j=e.computed(()=>{const t=O.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Q=e.computed(()=>{const t=O.value;return X.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),re=e.computed(()=>{const t=O.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),x=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.enabled!==!1}),k=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),V=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),P=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Y=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),xe=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Ye=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Le=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),le=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),Qe=e.computed(()=>O.value?.spider?.gridSteps||5),qe=e.computed(()=>{const t=[],s=Qe.value;for(let n=1;n<=s;n++)t.push(st.value/s*n);return t}),Vt=t=>{const s=vt.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const n=qe.value[t];return Math.round(n/st.value*100)+"%"},vt=e.computed(()=>O.value?.spider?.gridLabels||null),Ue=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Dt=e.computed(()=>{const t=O.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=O.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Tn=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.icon?t.markers.icon:at.value}),cn=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),yn=e.computed(()=>{const t=O.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),an=e.computed(()=>{const s=O.value?.valueFormat?.extension;return typeof s=="string"?s:""}),un=t=>{const s=an.value;if(t==null)return"";const n=String(t);return s?n+s:n},zn=e.computed(()=>!Z.value.isZooming);e.computed(()=>Tt.value.map(t=>{if(t.categoryIndex!==void 0&&(rn.value||Wt.value)){const s=Ut(t.categoryIndex),n=te.value+F.value.bottom-yn.value/2;return{...t,x:s,y:n}}return t}));function Ln(t,s){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,E,b]=t.split("-"),L=Number(b?.length===2?`20${b}`:b);n=new Date(L,Number(E)-1,Number(g))}else return 0;let i=0,p=1/0;return s.forEach((g,E)=>{const[b,L,T]=g.split("-"),H=Number(T?.length===2?`20${T}`:T),M=new Date(H,Number(L)-1,Number(b)),G=Math.abs(M-n);G<p&&(p=G,i=E)}),i}const hl=e.computed(()=>{const t=S.markers.map(n=>{const i=Ln(n.marker_date,S.categories),p=Ut(i),g=te.value+F.value.bottom-yn.value/2;return{...n,x:p,y:g,categoryIndex:i,source:"props"}}),s=Tt.value.map(n=>{if(n.categoryIndex!==void 0&&(rn.value||Wt.value)){const i=Ut(n.categoryIndex),p=te.value+F.value.bottom-yn.value/2;return{...n,x:i,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...s]}),A=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.enabled===!0}),q=e.computed(()=>{const t=O.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),I=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),ne=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Be=e.computed(()=>{const t={left:F.value.left,top:F.value.top,width:F.value.width,height:F.value.height};let s,n;const i=String(I.value);if(i.includes("%")){const p=parseFloat(i)/100;s=t.width*p,n=s*(96/499)}else{const p=parseFloat(i)||25;s=Math.min(t.width*.25,200)*(p/25),n=s*(96/499)}return{width:s,height:n,area:t}}),Je=e.computed(()=>{const{width:t,height:s}=Be.value,n=ne.value;let i,p;const g=F.value.left,E=F.value.right,b=F.value.top,L=F.value.bottom,T=F.value.width,H=F.value.height;switch(n){case"center":i=g+(T-t)/2,p=b+(H-s)/2;break;case"top-left":i=g+15,p=b+5;break;case"top-right":i=E-t-15,p=b+5;break;case"bottom-left":i=g+15,p=L-s-5;break;case"bottom-right":default:i=E-t-15,p=L-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${s}px`}}),rt=t=>!S.flags||!S.flags.length?[]:S.flags.filter(s=>s.categoryIndex===t),Fe=t=>{const s=rt(t),n=ro(t),i=s.filter(E=>E.manual),p=s.filter(E=>!E.manual),g=[];return i.length>0&&g.push({type:z("chart.tooltip.manualFlags"),color:"#047395",flags:i.map(E=>({text:E.text,color:"#047395"}))}),p.length>0&&g.push({type:z("chart.tooltip.autoFlags"),color:"#0dbf89",flags:p.map(E=>({text:E.text,color:"#0dbf89"}))}),{flagGroups:g,markers:n.map(E=>({title:E.title,description:E.description,type:z("chart.tooltip.markers"),color:E.color||"#FF6B6B"}))}},at=e.computed(()=>{const t=S.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M55 51.841V4.14647C55 1.86149 53.1797 0.00915527 50.9343 0.00915527L4.06568 0.00915527C1.82027 0.00915527 0 1.86149 0 4.14647V51.841C0 54.126 1.82027 55.9783 4.06568 55.9783H50.9343C53.1797 55.9783 55 54.126 55 51.841Z" fill="#020203"/>
|
|
3
|
+
<path d="M27.7145 10.8883H16.9591C12.7639 10.8883 9.3623 14.3498 9.3623 18.619C9.3623 22.8882 12.7639 26.3497 16.9591 26.3497H27.8036C28.3624 26.3497 28.816 25.8881 28.816 25.3112L28.7188 11.9103C28.7188 11.3416 28.2653 10.8883 27.7064 10.8883H27.7145Z" fill="#FFC230"/>
|
|
4
|
+
<path d="M38.6799 25.649C42.5176 25.649 45.6288 22.483 45.6288 18.5776C45.6288 14.6722 42.5176 11.5063 38.6799 11.5063C34.8421 11.5063 31.731 14.6722 31.731 18.5776C31.731 22.483 34.8421 25.649 38.6799 25.649Z" fill="white"/>
|
|
5
|
+
<path d="M27.2846 45.1083H38.04C42.2352 45.1083 45.6368 41.6468 45.6368 37.3776C45.6368 33.1084 42.2352 29.6469 38.04 29.6469H27.1955C26.6366 29.6469 26.1831 30.1084 26.1831 30.6854L26.2803 44.0863C26.2803 44.655 26.7338 45.1083 27.2927 45.1083H27.2846Z" fill="#07A9DA"/>
|
|
6
|
+
<path d="M16.3198 44.4813C20.1575 44.4813 23.2687 41.3153 23.2687 37.4099C23.2687 33.5045 20.1575 30.3386 16.3198 30.3386C12.482 30.3386 9.37085 33.5045 9.37085 37.4099C9.37085 41.3153 12.482 44.4813 16.3198 44.4813Z" fill="white"/>
|
|
7
|
+
</svg>`:`<svg viewBox="0 0 57 57" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
8
|
<g clip-path="url(#clip0_332_8537)">
|
|
3
9
|
<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
10
|
<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"/>
|
|
@@ -9,7 +15,21 @@
|
|
|
9
15
|
<rect width="57" height="57" fill="white"/>
|
|
10
16
|
</clipPath>
|
|
11
17
|
</defs>
|
|
12
|
-
</svg
|
|
18
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),sn=e.computed(()=>{const t=S.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
19
|
+
<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"/>
|
|
20
|
+
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
21
|
+
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
22
|
+
<path d="M344.78 67.3499C344.78 68.7099 345.21 69.7199 346.08 70.3699C346.95 71.0199 348.09 71.3399 349.51 71.3399C350.13 71.3399 350.76 71.2899 351.41 71.1999C352.06 71.1099 352.82 70.9699 353.68 70.7799V80.9899C352.07 81.2399 350.77 81.3899 349.78 81.4499C348.79 81.5099 347.89 81.5399 347.09 81.5399C344.24 81.5399 342.05 81.1799 340.5 80.4699C338.95 79.7599 337.65 78.5099 336.6 76.7099C336.17 77.0199 335.55 77.4699 334.74 78.0599C333.94 78.6499 332.95 79.2199 331.77 79.7799C330.59 80.3399 329.2 80.8299 327.59 81.2599C325.98 81.6899 324.16 81.9099 322.11 81.9099C319.51 81.9099 317.1 81.4899 314.87 80.6599C312.64 79.8299 310.72 78.6999 309.12 77.2699C307.51 75.8499 306.24 74.2099 305.32 72.3499C304.39 70.4899 303.93 68.5499 303.93 66.4999C303.93 61.2399 305.96 57.4499 310.01 55.1299C314.06 52.8099 319.27 51.6499 325.65 51.6499H334.56V49.4199C334.56 46.9499 333.68 44.9399 331.92 43.3899C330.16 41.8399 327.88 41.0699 325.1 41.0699C322.32 41.0699 320.09 41.7799 318.6 43.1999C317.12 44.6199 316.37 46.6999 316.37 49.4199H305.05C305.05 46.9499 305.58 44.7199 306.63 42.7399C307.68 40.7599 309.12 39.1099 310.94 37.7799C312.76 36.4499 314.91 35.4299 317.39 34.7199C319.86 34.0099 322.52 33.6499 325.37 33.6499C327.97 33.6499 330.44 33.9399 332.79 34.5299C335.14 35.1199 337.2 36.0299 338.96 37.2699C340.72 38.5099 342.13 40.0499 343.18 41.9099C344.23 43.7699 344.76 45.9299 344.76 48.4099V67.3399L344.78 67.3499ZM315.45 67.6299C315.45 69.4899 316.19 71.0999 317.68 72.4599C319.16 73.8199 321.14 74.4999 323.62 74.4999C325.54 74.4999 327.18 74.1399 328.54 73.4299C329.9 72.7199 331.03 71.8399 331.93 70.7899C332.83 69.7399 333.49 68.6199 333.93 67.4499C334.36 66.2799 334.58 65.2199 334.58 64.2899V59.6499C330.56 59.4599 327.29 59.5399 324.79 59.8799C322.29 60.2199 320.35 60.7599 318.99 61.4999C317.63 62.2399 316.7 63.1399 316.21 64.1899C315.71 65.2399 315.47 66.3899 315.47 67.6199L315.45 67.6299Z" fill="#020203"/>
|
|
23
|
+
<path d="M356.47 58.1699C356.47 54.5799 357.01 51.2899 358.09 48.2899C359.17 45.2899 360.67 42.7099 362.59 40.5399C364.51 38.3799 366.8 36.6899 369.46 35.4799C372.12 34.2699 375.03 33.6699 378.18 33.6699C382.2 33.6699 385.51 34.4399 388.11 35.9899C390.71 37.5399 392.78 39.3799 394.33 41.5099C395.88 43.6399 397.02 45.8899 397.76 48.2399C398.5 50.5899 399.03 52.5399 399.34 54.0899H388.58C388.15 51.2499 387.11 48.8299 385.47 46.8499C383.83 44.8699 381.28 43.8799 377.81 43.8799C374.78 43.8799 372.16 45.0399 369.97 47.3599C367.77 49.6799 366.68 53.1599 366.68 57.7999C366.68 62.6899 367.89 66.2299 370.3 68.4299C372.71 70.6299 375.47 71.7199 378.56 71.7199C380.29 71.7199 381.78 71.4399 383.01 70.8899C384.25 70.3299 385.27 69.6099 386.07 68.7099C386.87 67.8099 387.54 66.8099 388.07 65.6899C388.59 64.5799 389.07 63.4899 389.51 62.4399H399.16C399.16 64.3599 398.73 66.4599 397.86 68.7499C396.99 71.0399 395.68 73.1599 393.92 75.1099C392.16 77.0599 389.91 78.6799 387.19 79.9799C384.47 81.2799 381.28 81.9299 377.63 81.9299C374.47 81.9299 371.58 81.2799 368.95 79.9799C366.32 78.6799 364.09 76.9499 362.27 74.7799C360.44 72.6099 359.02 70.0899 358 67.2199C356.98 64.3499 356.47 61.3299 356.47 58.1699Z" fill="#020203"/>
|
|
24
|
+
<path d="M410.11 17.8899H420.32V34.5899H426.82V44.7999H420.32V68.7399C420.32 70.0999 420.71 71.0299 421.48 71.5199C422.25 72.0199 423.1 72.2599 424.03 72.2599C424.83 72.2599 425.53 72.1799 426.12 72.0299C426.71 71.8799 427.16 71.6999 427.47 71.5199V80.7999C427.04 80.9199 426.23 81.1399 425.06 81.4499C423.88 81.7599 422.24 81.9099 420.14 81.9099C416.61 81.9099 414.06 81.0099 412.48 79.2199C410.9 77.4299 410.11 75.4199 410.11 73.1899V44.7899H404.54V34.5799H410.11V17.8799V17.8899Z" fill="#020203"/>
|
|
25
|
+
<path d="M435.81 16.96H446.39V28.1H435.81V16.96ZM435.81 34.59H446.39V80.99H435.81V34.59Z" fill="#020203"/>
|
|
26
|
+
<path d="M455.67 58.1699C455.67 54.5799 456.21 51.2899 457.29 48.2899C458.37 45.2899 459.87 42.7099 461.79 40.5399C463.71 38.3799 466 36.6899 468.66 35.4799C471.32 34.2699 474.23 33.6699 477.38 33.6699C481.4 33.6699 484.71 34.4399 487.31 35.9899C489.91 37.5399 491.98 39.3799 493.53 41.5099C495.08 43.6399 496.22 45.8899 496.96 48.2399C497.7 50.5899 498.23 52.5399 498.54 54.0899H487.78C487.35 51.2499 486.31 48.8299 484.67 46.8499C483.03 44.8699 480.48 43.8799 477.01 43.8799C473.98 43.8799 471.36 45.0399 469.17 47.3599C466.97 49.6799 465.88 53.1599 465.88 57.7999C465.88 62.6899 467.09 66.2299 469.5 68.4299C471.91 70.6299 474.67 71.7199 477.76 71.7199C479.49 71.7199 480.98 71.4399 482.21 70.8899C483.45 70.3299 484.47 69.6099 485.27 68.7099C486.07 67.8099 486.74 66.8099 487.27 65.6899C487.79 64.5799 488.27 63.4899 488.71 62.4399H498.36C498.36 64.3599 497.93 66.4599 497.06 68.7499C496.19 71.0399 494.88 73.1599 493.12 75.1099C491.36 77.0599 489.11 78.6799 486.39 79.9799C483.67 81.2799 480.48 81.9299 476.83 81.9299C473.67 81.9299 470.78 81.2799 468.15 79.9799C465.52 78.6799 463.29 76.9499 461.47 74.7799C459.64 72.6099 458.22 70.0899 457.2 67.2199C456.18 64.3499 455.67 61.3299 455.67 58.1699Z" fill="#020203"/>
|
|
27
|
+
<path d="M95.8 88.71V7.09C95.8 3.1743 92.6258 0 88.7101 0L7.09004 0C3.17435 0 4.57764e-05 3.1743 4.57764e-05 7.09V88.71C4.57764e-05 92.6257 3.17435 95.8 7.09004 95.8H88.7101C92.6258 95.8 95.8 92.6257 95.8 88.71Z" fill="#020203"/>
|
|
28
|
+
<path d="M48.2801 18.61H29.5501C22.2401 18.61 16.3201 24.53 16.3201 31.84C16.3201 39.15 22.2401 45.07 29.5501 45.07H48.4401C49.4201 45.07 50.2101 44.27 50.2001 43.29L50.0401 20.35C50.0401 19.38 49.2501 18.6 48.2801 18.6V18.61Z" fill="#FFC530"/>
|
|
29
|
+
<path d="M67.37 43.9C74.0582 43.9 79.48 38.4782 79.48 31.79C79.48 25.1018 74.0582 19.68 67.37 19.68C60.6818 19.68 55.26 25.1018 55.26 31.79C55.26 38.4782 60.6818 43.9 67.37 43.9Z" fill="white"/>
|
|
30
|
+
<path d="M47.5201 77.18H66.2501C73.5601 77.18 79.4801 71.26 79.4801 63.95C79.4801 56.64 73.5601 50.72 66.2501 50.72H47.3601C46.3801 50.72 45.5901 51.52 45.6001 52.5L45.7601 75.44C45.7601 76.41 46.5501 77.19 47.5201 77.19V77.18Z" fill="#07ACDD"/>
|
|
31
|
+
<path d="M28.4201 76.12C35.1082 76.12 40.5301 70.6982 40.5301 64.01C40.5301 57.3218 35.1082 51.9 28.4201 51.9C21.7319 51.9 16.3101 57.3218 16.3101 64.01C16.3101 70.6982 21.7319 76.12 28.4201 76.12Z" fill="white"/>
|
|
32
|
+
</svg>`:`<svg width="235" height="47" viewBox="0 0 235 47" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
13
33
|
<g clip-path="url(#clip0_588_8371)">
|
|
14
34
|
<path d="M39.3889 1H5.61115C2.5122 1 0 3.5122 0 6.61115V40.3889C0 43.4878 2.5122 46 5.61115 46H39.3889C42.4878 46 45 43.4878 45 40.3889V6.61115C45 3.5122 42.4878 1 39.3889 1Z" fill="#393939"/>
|
|
15
35
|
<path d="M31.2311 6.43508H13.7675C12.6886 6.41487 11.6166 6.6099 10.614 7.00879C9.61135 7.40767 8.69831 8.00241 7.9282 8.75822C7.1581 9.51404 6.54637 10.4158 6.12877 11.4107C5.71118 12.4057 5.49609 13.4739 5.49609 14.553C5.49609 15.632 5.71118 16.7002 6.12877 17.6952C6.54637 18.6901 7.1581 19.5919 7.9282 20.3477C8.69831 21.1035 9.61135 21.6982 10.614 22.0971C11.6166 22.496 12.6886 22.691 13.7675 22.6708H31.2311C32.3099 22.691 33.382 22.496 34.3846 22.0971C35.3872 21.6982 36.3002 21.1035 37.0704 20.3477C37.8405 19.5919 38.4522 18.6901 38.8698 17.6952C39.2874 16.7002 39.5025 15.632 39.5025 14.553C39.5025 13.4739 39.2874 12.4057 38.8698 11.4107C38.4522 10.4158 37.8405 9.51404 37.0704 8.75822C36.3002 8.00241 35.3872 7.40767 34.3846 7.00879C33.382 6.6099 32.3099 6.41487 31.2311 6.43508ZM31.2311 20.802C29.9951 20.8017 28.787 20.4349 27.7596 19.748C26.7321 19.0611 25.9313 18.085 25.4586 16.943C24.9859 15.8011 24.8625 14.5446 25.1038 13.3324C25.3452 12.1203 25.9407 11.007 26.8148 10.1332C27.6889 9.25949 28.8025 8.66458 30.0148 8.42374C31.227 8.18289 32.4835 8.30693 33.6252 8.78017C34.767 9.2534 35.7427 10.0546 36.4292 11.0824C37.1156 12.1102 37.4818 13.3184 37.4815 14.5544C37.4814 15.375 37.3197 16.1877 37.0055 16.9458C36.6913 17.7039 36.2309 18.3928 35.6505 18.9729C35.07 19.5531 34.381 20.0132 33.6227 20.3271C32.8644 20.6409 32.0517 20.8023 31.2311 20.802Z" fill="#FAFAFA"/>
|
|
@@ -21,24 +41,23 @@
|
|
|
21
41
|
<rect width="45" height="45" fill="white" transform="translate(0 1)"/>
|
|
22
42
|
</clipPath>
|
|
23
43
|
</defs>
|
|
24
|
-
</svg>
|
|
25
|
-
`)}`),Vn=e.computed(()=>{const t=F.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),on=e.computed(()=>{const t=F.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=F.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const no=e.computed(()=>{const t=F.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),An=e.computed(()=>{const t=F.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),un=e.computed(()=>{const t=F.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),fn=e.computed(()=>{const s=F.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),Zn=e.computed(()=>{const s=F.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),ko=e.computed(()=>{const s=F.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=F.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=F.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),bo=e.computed(()=>({x:pt.value,y:vt.value-Co.value/2})),Cn=e.computed(()=>{const s=F.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),gn=e.computed(()=>{if(!fn.value||!pn.value||!yo.value.length)return[];const t=Zn.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=pt.value+Math.cos(n.midAngle)*s,x=vt.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
|
-
|
|
27
|
-
<text x="24" y="${q}"
|
|
44
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Nn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),nn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const Hn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Cn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),dn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),fn=e.computed(()=>{const s=O.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),Pn=e.computed(()=>{const s=O.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),yl=e.computed(()=>{const s=O.value?.radialBar?.dataCenter;return En.value&&s&&(s.show===!0||s.enabled===!0)}),Xl=e.computed(()=>{if(!yl.value||!ml.value.length)return"";const n=O.value?.radialBar?.dataCenter?.showValueOnly===!0?ml.value[0]?.value??0:ml.value.reduce((i,p)=>i+(p.value??0),0);return un(n)}),Cl=e.computed(()=>{const s=O.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),kl=e.computed(()=>({x:St.value,y:Nt.value-Cl.value/2})),kn=e.computed(()=>{const s=O.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),vn=e.computed(()=>{if(!fn.value||!pn.value||!ml.value.length)return[];const t=Pn.value*Math.PI/180,s=(Pt.value+st.value)/2;return ml.value.map(n=>{const p=n.endAngle-n.startAngle>=t&&!n.isHidden,g=St.value+Math.cos(n.midAngle)*s,E=Nt.value+Math.sin(n.midAngle)*s;return{value:un(n.value),x:g,y:E,show:p,color:n.color,contrastColor:dl(n.color)}})}),Al=e.computed(()=>{if(!S.flags||!S.flags.length)return[];const t=new Map;return S.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 i=Ut(s),p=n.filter(E=>E.manual),g=n.filter(E=>!E.manual);return{categoryIndex:parseInt(s),x:i,flags:n,manualCount:p.length,autoCount:g.length,totalCount:n.length,hasManual:p.length>0,hasAuto:g.length>0,texts:n.map(E=>E.text).join(`
|
|
45
|
+
`)}})}),ol=e.ref({show:!1,x:0,y:0,content:"",count:0}),An=e.computed(()=>O.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),fl=e.computed(()=>{const t=O.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Vl=e.computed(()=>O.value?.bubbles?.tooltip?.formatters||{}),Rt=e.ref(new Set),Ce=e.ref(null),Nl=e.ref(!1),Xe=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),jt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Pe=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ze=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),Z=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Tt=e.ref([]),he=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return cn.value&&t.push(...Object.keys(cn.value)),t}),e.computed(()=>{if(!S.categories||S.categories.length===0){const{maxX:t}=Ot.value;return Array.from({length:t+1},(s,n)=>z("chart.fallback.item",{number:n+1}))}return S.categories});const Mn=e.computed(()=>{if(!S.categories||S.categories.length===0)return null;const t=S.categories[0],[s,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;return!g||!n||!p?null:new Date(p,E,g)}),Dl=e.computed(()=>{if(!S.categories||S.categories.length===0)return null;const t=S.categories[S.categories.length-1],[s,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;return!g||!n||!p?null:new Date(p,E,g)}),w=e.computed(()=>he.value.editingMarkerId!==null),y=e.computed(()=>he.value.readonly),B=t=>{Rt.value.has(t)||(Kn.value=!0,Ce.value=t)},W=()=>{Kn.value=!1,Ce.value=null},se=t=>{if(Hl.value||Ll.value){Pe.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top,g=Wt.value?i>=F.value.left-50&&i<=F.value.right+50&&p>=F.value.top-50&&p<=F.value.bottom+100:i>=F.value.left&&i<=F.value.right&&p>=F.value.top&&p<=F.value.bottom;if(Nl.value=g,Wt.value){if(!fe.value||!g||Z.value.isDragging||Z.value.isZooming){Pe.value.show=!1;return}if(Yn.value.find(ee=>!ee||ee.isHidden?!1:Math.sqrt(Math.pow(ee.x-i,2)+Math.pow(ee.y-p,2))<=ee.radius+3))Pe.value.show=!1;else{const ee=Yn.value.filter(pe=>!pe||pe.isHidden?!1:Math.sqrt(Math.pow(pe.x-i,2)+Math.pow(pe.y-p,2))<=250);if(ee.length>0){let pe=ee[0],ye=Math.sqrt(Math.pow(pe.x-i,2)+Math.pow(pe.y-p,2));ee.forEach(be=>{const we=Math.sqrt(Math.pow(be.x-i,2)+Math.pow(be.y-p,2));we<ye&&(ye=we,pe=be)});const oe=30,Oe=Yn.value.filter(be=>!be||be.isHidden?!1:Math.abs(be.x-pe.x)<=oe).sort((be,we)=>be.y-we.y);Pe.value={show:!0,x:pe.x,categoryIndex:Math.round(pe.originalX),data:(()=>{const be=An.value,we=fl.value,De=[];return Oe.forEach(Ae=>{be.forEach(Ct=>{const kt=we[Ct]||Ct,Vn=u(Ct,Ae);Vn&&De.push({seriesName:Ae.seriesName,label:Ae.label,value:`${kt}: ${Vn}`,color:Ae.color,y:Ae.y})})}),De})()}}else Pe.value.show=!1}return}if(Z.value.isDragging&&Z.value.scale>1&&rn.value&&Et.value){Pe.value.show=!1;const Ee=t.clientX-Z.value.lastMouseX,{minX:ee,maxX:pe}=Ot.value,ye=pe-ee||1,Oe=Ee*.8;Z.value.offsetX+=Oe;const be=ye/Z.value.scale,we=ye-be,De=0,Ae=-we/ye*F.value.width,Ct=De;Z.value.offsetX=Math.max(Ae,Math.min(Ct,Z.value.offsetX)),Z.value.lastMouseX=t.clientX,Z.value.lastMouseY=t.clientY;return}if(!fe.value||!rn.value||Z.value.isDragging||Z.value.isZooming||!g){Pe.value.show=!1;return}const{minX:E,maxX:b}=Ot.value,L=b-E||1,T=L/Z.value.scale,H=E-Z.value.offsetX/F.value.width*L,M=(i-F.value.left)/F.value.width,G=H+M*T,ce=Math.round(G);if(ce>=0&&ce<=b){const Ee=Ut(ce),ee=Un.value.map((pe,ye)=>{const oe=S.series.findIndex(be=>be===pe),Oe=pe.data[ce];return{seriesName:pe.name,value:Oe!==void 0?Oe:null,color:Lt(oe),y:Oe!==void 0?Qt(Oe):null}}).filter(pe=>pe.value!==null);Pe.value={show:!0,x:Ee,categoryIndex:ce,data:ee}}},mt=()=>{Pe.value.show=!1,Nl.value=!1,Ll.value=!1,Hl.value||(ol.value.show=!1),Z.value.isDragging&&(Z.value.isDragging=!1),Z.value.zoomTimeout&&(clearTimeout(Z.value.zoomTimeout),Z.value.zoomTimeout=null),Z.value.isZooming=!1,setTimeout(()=>{Ce.value=null,Xe.value.show=!1},150)},et=t=>{if(t.preventDefault(),t.stopPropagation(),!Ue.value)return;const s=t.currentTarget.getBoundingClientRect(),n=t.clientX-s.left,i=t.clientY-s.top;if(pn.value){ze.value.show=!1,e.nextTick(()=>{ze.value.show=!0,ze.value.x=t.clientX,ze.value.y=t.clientY,ze.value.categoryIndex=null});return}const p=Math.max(0,F.value.left-20),g=F.value.right,E=F.value.top,b=F.value.bottom+80;n>=p&&n<=g&&i>=E&&i<=b&&(ze.value.show=!1,e.nextTick(()=>{ze.value.show=!0,ze.value.x=t.clientX,ze.value.y=t.clientY,ze.value.categoryIndex=null;const L=Math.max(F.value.left,Math.min(n,F.value.right))-F.value.left,H=F.value.width/Pl.value.length,M=Math.floor(L/H);M>=0&&M<Pl.value.length&&(ze.value.categoryIndex=M)}))},ht=t=>{if(!(t&&t.button===2)){if(ze.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}ze.value.show=!1}},mn=t=>{if(typeof t.template=="function"){const s={series:S.series,categories:S.categories,markers:Tt.value},n={chartX:ze.value.chartX,chartY:ze.value.chartY,dataX:ze.value.mouseDataX,dataY:ze.value.mouseDataY,categoryIndex:ze.value.categoryIndex};return t.template(s,n)}return t.template||t.label||""},It=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},bn=t=>t.style||{},Yl=t=>t.type&&cn.value[t.type]?cn.value[t.type]:t.customIcon?t.customIcon:Tn.value,so=t=>t==null?"":S.categories&&S.categories[t]?S.categories[t]:"",ro=t=>Tt.value.length?Tt.value.filter(s=>s.categoryIndex===t):[],wn=t=>{if(!rn.value&&!Wt.value)return{x:0,y:0};const s=Ut(t),n=te.value+F.value.bottom-yn.value/2;return{x:s,y:n}},jl=()=>{Tt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(rn.value||Wt.value)){const s=wn(t.categoryIndex);t.x=s.x,t.y=s.y}})},io=()=>{if(he.value.description&&he.value.description.length&&he.value.date){if(w.value){const t=Tt.value.findIndex(s=>s.id===he.value.editingMarkerId);t!==-1?(Tt.value[t].description=he.value.description||"",Tt.value[t].color=he.value.color||"",Tt.value[t].type=he.value.type||"default",Me("update-marker",Tt.value[t])):Me("update-marker",{id:he.value.editingMarkerId,description:he.value.description||"",color:he.value.color||"",type:he.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=Ln(he.value.date,S.categories||[]);if(Wt.value){const{maxX:E}=Ot.value;s=Math.max(0,Math.min(s,Math.floor(E)))}else rn.value&&(s=Math.max(0,Math.min(s,Ot.value.maxX)));const n=Ut(s),i=te.value+F.value.bottom-yn.value/2,p=Array.isArray(S.categories)?S.categories[s]:null,g={id:t,title:"",description:he.value.description||"",color:he.value.color||"",type:he.value.type||"default",categoryIndex:s,x:n,y:i,marker_date:p||null};he.value.categoryIndex=s,Tt.value.push(g),Me("add-marker",g)}al(),Kl()}},al=()=>{he.value.show=!1,he.value.title="",he.value.description="",he.value.color="#FF6B6B",he.value.type="default",he.value.editingMarkerId=null,he.value.readonly=!1,he.value.categoryIndex=null,he.value.fromButton=!1,he.value.date=null},co=()=>{w.value&&(uo(he.value.editingMarkerId),al())},uo=t=>{const s=Tt.value.findIndex(n=>n.id===t);s!==-1&&(Tt.value.splice(s,1),Kl()),Me("delete-marker",t)},Sn=t=>{if(he.value.show=!0,he.value.title=t?.title??t?.comment??"",he.value.description=t?.description??t?.comment??"",he.value.color=t?.color??"",he.value.type=t?.type??"default",he.value.editingMarkerId=t?.id??t?.marker_id??null,he.value.readonly=t?.readonly??!1,he.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,n,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;g&&n&&p?he.value.date=new Date(p,E,g):he.value.date=null}else he.value.date=null},Kl=()=>{try{const t=`dss-chart-markers-${S.chartId}`;localStorage.setItem(t,JSON.stringify(Tt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},No=()=>{try{const t=`dss-chart-markers-${S.chartId}`,s=localStorage.getItem(t);if(s){const n=JSON.parse(s);Array.isArray(n)&&(Tt.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Tt.value=[]}},Kt=t=>{const s=wt.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}`},Jn=()=>{const t=Pe.value.show,s=Xe.value.show;return Pe.value.show=!1,Xe.value.show=!1,{originalCrosshair:t,originalTooltip:s}},_n=t=>{Pe.value.show=t.originalCrosshair,Xe.value.show=t.originalTooltip},el=async(t,s=32,n=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const E=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(E);try{const b=document.createElement("canvas"),L=b.getContext("2d");b.width=s,b.height=n,L.fillStyle="#fafafa",L.fillRect(0,0,s,n),L.drawImage(g,0,0,s,n);const T=b.toDataURL("image/png");i(T)}catch(b){console.warn("Canvas conversion failed:",b),i(t)}},g.onerror=b=>{clearTimeout(E),console.warn("Failed to load image:",t,b),i(t)},g.src=t}),tl=async()=>{try{const t=Jn();setTimeout(async()=>{try{const s=document.querySelector(".dss-chart-svg");if(!s){console.error("Chart SVG element not found"),_n(t);return}const n=He(),i=Ne.value,p=pt.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(oe=>oe.remove());const b=g.querySelectorAll("image"),L=Array.from(b).map(async oe=>{const Oe=oe.getAttribute("xlink:href")||oe.getAttribute("href");if(Oe&&!Oe.startsWith("data:"))try{const be=await el(Oe,32,32);oe.setAttribute("xlink:href",be),oe.setAttribute("href",be)}catch(be){console.warn("Failed to convert logo to base64:",be)}});await Promise.all(L);const H=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let M="",G=30;if(wt.value&&(M+=`
|
|
46
|
+
<text x="24" y="${G}"
|
|
28
47
|
font-family="Arial, sans-serif"
|
|
29
48
|
font-size="18"
|
|
30
49
|
font-weight="bold"
|
|
31
50
|
fill="#333">
|
|
32
|
-
${
|
|
33
|
-
</text>`,
|
|
34
|
-
<text x="24" y="${
|
|
51
|
+
${wt.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
52
|
+
</text>`,G+=30),tt.value&&(M+=`
|
|
53
|
+
<text x="24" y="${G}"
|
|
35
54
|
font-family="Arial, sans-serif"
|
|
36
55
|
font-size="14"
|
|
37
56
|
fill="#666">
|
|
38
|
-
${
|
|
39
|
-
</text>`,
|
|
40
|
-
<g opacity="${
|
|
41
|
-
<g transform="translate(${
|
|
57
|
+
${tt.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
58
|
+
</text>`,G+=25),_t.value&&S.series.length>0){let oe=i-200,Oe=wt.value||tt.value?35:25;const be=Math.floor((i-250)/120);let we=0;S.series.forEach((De,Ae)=>{if(!Rt.value.has(Ae)){const Ct=Lt(Ae),kt=De.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");M+=`<circle cx="${oe+6}" cy="${Oe-4}" r="6" fill="${Ct}"/>`,M+=`<text x="${oe+18}" y="${Oe}" font-family="Arial, sans-serif" font-size="12" fill="#333">${kt}</text>`,we++,we%be===0?(oe=i-200,Oe+=20):oe+=Math.min(120,kt.length*8+35)}})}let ce="";if(A.value)try{const{width:oe,height:Oe}=Be.value,be=ne.value,we=F.value.left,De=F.value.right,Ae=F.value.top,Ct=F.value.bottom,kt=F.value.width,Vn=F.value.height;let Yt,pl;switch(be){case"center":Yt=we+(kt-oe)/2,pl=Ae+(Vn-Oe)/2;break;case"top-left":Yt=we+15,pl=Ae+5;break;case"top-right":Yt=De-oe-5,pl=Ae+5;break;case"bottom-left":Yt=we+15,pl=Ct-Oe-5;break;case"bottom-right":default:Yt=De-oe-5,pl=Ct-Oe-5;break}ce=`
|
|
59
|
+
<g opacity="${q.value}">
|
|
60
|
+
<g transform="translate(${Yt}, ${pl}) scale(${oe/499})">
|
|
42
61
|
<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"/>
|
|
43
62
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
44
63
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -53,8 +72,8 @@
|
|
|
53
72
|
<path d="M47.5201 77.18H66.2501C73.5601 77.18 79.4801 71.26 79.4801 63.95C79.4801 56.64 73.5601 50.72 66.2501 50.72H47.3601C46.3801 50.72 45.5901 51.52 45.6001 52.5L45.7601 75.44C45.7601 76.41 46.5501 77.19 47.5201 77.19V77.18Z" fill="#07ACDD"/>
|
|
54
73
|
<path d="M28.4201 76.12C35.1082 76.12 40.5301 70.6982 40.5301 64.01C40.5301 57.3218 35.1082 51.9 28.4201 51.9C21.7319 51.9 16.3101 57.3218 16.3101 64.01C16.3101 70.6982 21.7319 76.12 28.4201 76.12Z" fill="#fafafa"/>
|
|
55
74
|
</g>
|
|
56
|
-
</g>`}catch(
|
|
57
|
-
<svg width="${
|
|
75
|
+
</g>`}catch(oe){console.warn("Watermark processing failed, skipping watermark in SVG:",oe),ce=""}const Ee=`<?xml version="1.0" encoding="UTF-8"?>
|
|
76
|
+
<svg width="${i}" height="${p}"
|
|
58
77
|
xmlns="http://www.w3.org/2000/svg"
|
|
59
78
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
60
79
|
<defs>
|
|
@@ -65,33 +84,34 @@
|
|
|
65
84
|
</style>
|
|
66
85
|
</defs>
|
|
67
86
|
<rect width="100%" height="100%" fill="#fafafa"/>
|
|
68
|
-
${
|
|
87
|
+
${M}
|
|
69
88
|
<g transform="translate(0, ${n.height})">
|
|
70
|
-
${
|
|
71
|
-
${
|
|
89
|
+
${H}
|
|
90
|
+
${ce}
|
|
72
91
|
</g>
|
|
73
|
-
</svg>`,
|
|
74
|
-
`),
|
|
75
|
-
`),t+=`# ${
|
|
92
|
+
</svg>`,ee=new Blob([Ee],{type:"image/svg+xml;charset=utf-8"}),pe=URL.createObjectURL(ee),ye=document.createElement("a");ye.href=pe,ye.download=Kt("svg"),document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),URL.revokeObjectURL(pe),_n(t),ht()}catch(s){console.error("Error downloading SVG:",s),_n(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},sl=async()=>{try{const t=Jn();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(oe=>setTimeout(oe,300));const s=He(),n=Ne.value,i=pt.value+s.height,p=document.createElement("canvas"),g=p.getContext("2d"),E=2;p.width=n*E,p.height=i*E,p.style.width=n+"px",p.style.height=i+"px",g.scale(E,E),g.fillStyle="#fafafa",g.fillRect(0,0,n,i);let b=30;if(wt.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(wt.value,24,b),b+=30),tt.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(tt.value,24,b),b+=25),_t.value&&S.series.length>0){let oe=n-200,Oe=wt.value||tt.value?35:25;const be=Math.floor((n-250)/120);let we=0;g.font="12px Arial, sans-serif",S.series.forEach((De,Ae)=>{if(!Rt.value.has(Ae)){const Ct=Lt(Ae);g.beginPath(),g.arc(oe+6,Oe-4,6,0,2*Math.PI),g.fillStyle=Ct,g.fill(),g.fillStyle="#333",g.fillText(De.name,oe+18,Oe),we++,we%be===0?(oe=n-200,Oe+=20):oe+=Math.min(120,De.name.length*8+35)}})}const T=document.querySelector(".dss-chart-svg").cloneNode(!0),H=T.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),M=T.querySelectorAll(".dss-crosshair"),G=T.querySelectorAll('[class*="tooltip"]');H.forEach(oe=>oe.remove()),M.forEach(oe=>oe.remove()),G.forEach(oe=>oe.remove()),T.querySelectorAll("image").forEach((oe,Oe)=>{const be=oe.getAttribute("xlink:href")||oe.getAttribute("href");if(be&&!be.startsWith("data:")){const we=zt.value[Oe],De=we?Lt(we.seriesIndex):"#3B82F6",Ae=oe.getAttribute("x")||0,Ct=oe.getAttribute("y")||0,kt=oe.getAttribute("width")||32,Vn=oe.getAttribute("height")||32,Yt=document.createElementNS("http://www.w3.org/2000/svg","circle");Yt.setAttribute("cx",parseFloat(Ae)+parseFloat(kt)/2),Yt.setAttribute("cy",parseFloat(Ct)+parseFloat(Vn)/2),Yt.setAttribute("r",Math.min(parseFloat(kt),parseFloat(Vn))/2-1),Yt.setAttribute("fill",De),Yt.setAttribute("stroke","#fafafa"),Yt.setAttribute("stroke-width","2"),oe.parentNode.replaceChild(Yt,oe)}});const Ee=new XMLSerializer().serializeToString(T),ee=new Blob([Ee],{type:"image/svg+xml;charset=utf-8"}),pe=URL.createObjectURL(ee),ye=new Image;return new Promise((oe,Oe)=>{ye.onload=async()=>{try{if(g.drawImage(ye,0,s.height),zt.value.forEach(be=>{const we=be.x,De=be.y+s.height,Ae=(be.width||32)/2,Ct=Lt(be.seriesIndex);g.save(),g.beginPath(),g.arc(we,De,Ae-1,0,2*Math.PI),g.fillStyle=Ct,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),A.value){const be=new Image,we=()=>{const{width:Ae,height:Ct}=Be.value,kt=ne.value,Vn=F.value.left,Yt=F.value.right,pl=F.value.top,Wo=F.value.bottom,Go=F.value.width,Qo=F.value.height;let ql,Ul;switch(kt){case"center":ql=Vn+(Go-Ae)/2,Ul=pl+s.height+(Qo-Ct)/2;break;case"top-left":ql=Vn+15,Ul=pl+s.height+10;break;case"top-right":ql=Yt-Ae-5,Ul=pl+s.height+10;break;case"bottom-left":ql=Vn+15,Ul=Wo+s.height-Ct-5;break;case"bottom-right":default:ql=Yt-Ae-5,Ul=Wo+s.height-Ct-5;break}g.globalAlpha=q.value,g.drawImage(be,ql,Ul,Ae,Ct),g.globalAlpha=1,De()},De=()=>{p.toBlob(Ae=>{const Ct=URL.createObjectURL(Ae),kt=document.createElement("a");kt.href=Ct,kt.download=Kt("png"),document.body.appendChild(kt),kt.click(),document.body.removeChild(kt),URL.revokeObjectURL(Ct),URL.revokeObjectURL(pe),_n(t),ht(),oe()},"image/png")};be.onload=we,be.onerror=De,be.src=sn.value}else p.toBlob(be=>{const we=URL.createObjectURL(be),De=document.createElement("a");De.href=we,De.download=Kt("png"),document.body.appendChild(De),De.click(),document.body.removeChild(De),URL.revokeObjectURL(we),URL.revokeObjectURL(pe),_n(t),ht(),oe()},"image/png")}catch(be){URL.revokeObjectURL(pe),_n(t),Oe(be)}},ye.onerror=()=>{URL.revokeObjectURL(pe),_n(t),Oe(new Error("Failed to load SVG image"))},ye.src=pe})}catch(t){console.error("Error downloading PNG:",t)}},rl=()=>{try{let t="";wt.value&&(t+=`# ${z("chart.csv.chartTitle")}: ${wt.value}
|
|
93
|
+
`),tt.value&&(t+=`# ${z("chart.csv.chartSubtitle")}: ${tt.value}
|
|
94
|
+
`),t+=`# ${z("chart.csv.generated")}: ${new Date().toLocaleString()}
|
|
76
95
|
|
|
77
|
-
`,t+="Category",
|
|
78
|
-
`;const s=Math.max(...
|
|
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:gt.value},n={chartX:Te.value.chartX,chartY:Te.value.chartY,dataX:Te.value.mouseDataX,dataY:Te.value.mouseDataY,categoryIndex:clampedCategoryIndex||Te.value.categoryIndex};t.action(s,n)}De()},Sn=()=>{ao(),ue.value.show=!0,ue.value.categoryIndex=Te.value.categoryIndex,ue.value.fromButton=!1,De()},Ko=()=>{ao(),ue.value.show=!0,ue.value.categoryIndex=0,ue.value.fromButton=!0},xo=t=>{if(Te.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(Te.value.show=!1)}},Go=t=>{Te.value.show&&!t.target.closest(".context-menu")&&(Te.value.show=!1)},Qo=t=>{if(!Qt.value||!Rt.value)return;t.preventDefault(),t.stopPropagation(),R.value.isZooming=!0,He.value.show=!1,R.value.zoomTimeout&&clearTimeout(R.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){R.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,x=Math.max(R.value.minScale,Math.min(R.value.maxScale,R.value.scale*g));if(x!==R.value.scale){const{minX:b,maxX:M}=Mt.value,B=M-b||1,$=B/R.value.scale,V=b-R.value.offsetX/H.value.width*B,q=(c-H.value.left)/H.value.width,te=V+q*$;R.value.scale=x;const ve=B/R.value.scale,Y=te-q*ve;R.value.offsetX=-(Y-b)/B*H.value.width,R.value.scale<=1.01&&(R.value.scale=1,R.value.offsetX=0)}R.value.zoomTimeout=setTimeout(()=>{R.value.isZooming=!1,R.value.zoomTimeout=null},300)},Cl=t=>{if(!Qt.value||!Rt.value||R.value.scale<=1)return;He.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,R.value.isDragging=!0,R.value.lastMouseX=t.clientX,R.value.lastMouseY=t.clientY,t.preventDefault()},$l=()=>{R.value.isDragging=!1},Jo=()=>{!Qt.value||!Rt.value||(R.value.scale=1,R.value.offsetX=0,R.value.isDragging=!1,R.value.zoomTimeout&&(clearTimeout(R.value.zoomTimeout),R.value.zoomTimeout=null),R.value.isZooming=!1)},bl=()=>!Qt.value||!$o.value||!Rt.value?"default":R.value.isDragging?"grabbing":R.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,$=g.y-(x.y-f.y)/6*Z.value;s+=` C ${b} ${M} ${B} ${$} ${g.x} ${g.y}`}return s},xn=e.computed(()=>{const s=F.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(Kn.value){const V={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??V.left,top:c.top??V.top,right:c.right??V.right,bottom:c.bottom??V.bottom}:V}if(pn.value){const V=!Ze.value,q=Vn.value,te=q?no.value+An.value+Math.max(24,on.value+16):0,ve=V?12:f;let Y=0;rt.value&&(Y+=V?8:15),Ge.value&&(Y+=V?6:10);const se=Le();let ie=ve+(V?4:16)+(q?te:0),K=ve+(q?te:0);Ze.value&&Ve.value==="left"?ie+=se.legendWidth||150:Ze.value&&Ve.value==="right"&&(K+=se.legendWidth||150);const me=ne.value==="semi-radial"?q?te:8:q?te:V?8:f+80,pe=q?14:0,Ne=ve+Y+pe,Ee={left:ie,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),Ge.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 $={left:M,top:f+x,right:B,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:c?{left:c.left??$.left,top:c.top??$.top,right:c.right??$.right,bottom:c.bottom??$.bottom}:$}),H=e.computed(()=>({left:xn.value.left,top:xn.value.top,right:he.value-xn.value.right,bottom:nt.value-xn.value.bottom,width:he.value-(xn.value.left+xn.value.right),height:nt.value-(xn.value.top+xn.value.bottom)})),Qt=e.computed(()=>["line","area","bar"].includes(ne.value)||vn.value),_n=e.computed(()=>vn.value),pn=e.computed(()=>["radial","semi-radial"].includes(ne.value)),Kn=e.computed(()=>ne.value==="spider"),Lt=e.computed(()=>ne.value==="bubble"),Kt=e.computed(()=>F.value?.chart?.orientation==="horizontal"&&(ne.value==="bar"||_n.value)),Gn=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},pt=e.computed(()=>pn.value?xn.value.left+(he.value-xn.value.left-xn.value.right)/2:he.value/2),vt=e.computed(()=>Kn.value?nt.value/2-40:pn.value?xn.value.top+(nt.value-xn.value.top-xn.value.bottom)/2:nt.value/2),Je=e.computed(()=>{if(Kn.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=F.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=F.value,s=typeof _.innerSize=="number"?_.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(pn.value||Kn.value)?1:1+s/100}),To=e.computed(()=>{const t=Po.value;if(t===1||t<=0)return;const s=pt.value,n=vt.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(()=>ne.value==="semi-radial"),qn=e.computed(()=>io.value&&ye.value&&!$n.value),Rn=e.computed(()=>io.value&&ye.value&&!$n.value&&et.value==="fill"),fo=e.computed(()=>{const t=qn.value?Lo.value:1,s=pt.value,n=vt.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),$=n+f*Math.sin(x),V=s+c*Math.cos(x),q=n+c*Math.sin(x),te=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} ${$} L ${V} ${q} A ${c} ${c} 0 ${Y} 1 ${te} ${ve} Z`}),Eo=e.computed(()=>{if(!(!io.value||!qn.value)&&!Rn.value)return`url(#${tl.value})`}),Ft=t=>{if(!(!Rn.value||t!==0))return`url(#${tl.value})`},co=e.ref(0),nl=e.computed(()=>`radial-reveal-clip-${_.chartId}`),kn=e.computed(()=>ne.value==="radial"),go=e.computed(()=>{const t=kn.value?co.value:1,s=pt.value,n=vt.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 V=s-c,q=s+c;return`M ${V} ${n} A ${c} ${c} 0 0 1 ${q} ${n} A ${c} ${c} 0 0 1 ${V} ${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>=.5?1:0;return`M ${s} ${n} L ${x} ${b} A ${c} ${c} 0 ${$} 1 ${M} ${B} Z`}),Vo=e.computed(()=>{if(Eo.value)return Eo.value;if(kn.value)return`url(#${nl.value})`});let In=null;const So=()=>{if(!qn.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&&(In=requestAnimationFrame(n))};In=requestAnimationFrame(n)},wl=e.computed(()=>F.value?.bubbles?.minSize||8),Tl=e.computed(()=>F.value?.bubbles?.maxSize||50),No=e.computed(()=>F.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")},Qn=e.computed(()=>_.series),ho=e.computed(()=>_.series.filter((t,s)=>!bt.value.has(s))),Fn="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=ee.value;let g,x;if(c===Fn){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===Fn){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((te,ve)=>{te?.data?.length&&te.data.forEach((Y,se)=>{let ie,K,Re;if(typeof Y=="object"&&Y!==null&&!Array.isArray(Y))ie=typeof Y.x=="number"?Y.x:se,K=typeof Y.y=="number"?Y.y:0,Re=typeof Y.size=="number"?Y.size:20;else if(Array.isArray(Y)&&Y.length>=3)ie=typeof Y[0]=="number"?Y[0]:se,K=typeof Y[1]=="number"?Y[1]:0,Re=typeof Y[2]=="number"?Y[2]:20;else if(typeof Y=="number")ie=se,K=Y,Re=ol(ve,se);else return;isFinite(ie)&&isFinite(K)&&isFinite(Re)&&(t=Math.min(t,ie),s=Math.max(s,ie),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,$,V,q;return le.value!==null?B=le.value:B=t-b*.1,Xe.value!==null?$=Xe.value:$=s+b*.1,xe.value!==null&&typeof xe.value=="number"?V=xe.value:V=Math.max(0,n-M*.1),ee.value!==null&&typeof ee.value=="number"?q=ee.value:q=c+M*.1,{minX:B,maxX:$,minY:V,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/R.value.scale,g=s-R.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*(Tl.value-wl.value)},El=e.computed(()=>rl.value.map(t=>({y:t.y}))),sl=e.computed(()=>{if(Lt.value)return Vl();if(ne.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 En=pe+lt*(at/Ee),Ut=Gn(En);me.push({x:Ut,y:H.value.bottom+20,text:dn(Math.round(En))})}return me}const ve=[],{maxX:Y}=Mt.value,se=Y+1,ie=5,Re=(H.value.width-ie*2)/se;for(let me=0;me<=Y;me++){const pe=H.value.left+ie+(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/R.value.scale,g=s-R.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,$=H.value.width,q=Math.floor($/60);let te=1;B>q&&(te=Math.ceil(B/q));for(let ve=b;ve<=M;ve+=te)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=J.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 $=getComputedStyle(B).color;document.body.removeChild(B);const V=$.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(V)n=Number(V[1])/255,c=Number(V[2])/255,f=Number(V[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*c+.0722*f>.5?"#3a3a3a":"#fafafa"},Un=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=F.value?.stroke?.color;return c==null?Un(s):typeof c=="string"?c:Array.isArray(c)&&c.length?c[t%c.length]??Un(s):Un(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(()=>ne.value==="line"||_n.value?(_n.value?_.series.filter(s=>(s.type||ne.value)==="line"):Qn.value).map((s,n)=>{const c=_.series.findIndex(V=>V===s),f=[];let g=[];s.data.forEach((V,q)=>{V==null?g.length>0&&(f.push([...g]),g=[]):g.push({x:Kt.value?Gn(V):zt(q),y:Kt.value?vo(q):Jt(V),index:q})}),g.length>0&&f.push(g);let x="";f.forEach(V=>{if(V.length>0){let q="";O.value?q=el(V):q=`M ${V[0].x} ${V[0].y}`+V.slice(1).map(te=>` L ${te.x} ${te.y}`).join(""),x+=(x?" ":"")+q}});const b=f.reduce((V,q)=>V+Oo(q),0),M=bt.value.has(c),B=de.value===c,$=de.value!==null&&de.value!==c;return{path:x,color:Ht(c),pathLength:b,seriesIndex:c,animationDelay:n*Et.value,isHighlighted:B,isDimmed:$,isHidden:M}}):[]),Nl=e.computed(()=>{if(!(ne.value==="line"||_n.value))return[];const t=_n.value?_.series.filter(n=>(n.type||ne.value)==="line"):Qn.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 $=n.data[B];if($==null)M++;else{b=B;break}}if(M>0&&b!==-1){const B=n.data[b],$=Kt.value?Gn(x):zt(g),V=Kt.value?vo(g):Jt(x),q=Kt.value?Gn(B):zt(b),te=Kt.value?vo(b):Jt(B),ve=bt.value.has(f),Y=de.value===f,se=de.value!==null&&de.value!==f;s.push({path:`M ${$} ${V} L ${q} ${te}`,color:Ht(f),seriesIndex:f,animationDelay:c*Et.value,isHighlighted:Y,isDimmed:se,isHidden:ve,gapSize:M}),g=b-1}}}}),s}),Ll=e.computed(()=>ne.value==="line"||_n.value?!ye.value||$n.value||it.value.hasAnimated?[]:(_n.value?_.series.filter(s=>(s.type||ne.value)==="line"):Qn.value).map((s,n)=>{const c=_.series.findIndex(M=>M===s);let f="",g=null;s.data.forEach((M,B)=>{if(M!=null){const $={x:Kt.value?Gn(M):zt(B),y:Kt.value?vo(B):Jt(M)};g===null?f+=`M ${$.x} ${$.y}`:f+=` L ${$.x} ${$.y}`,g=$}else if(g!==null){const $=s.data.findIndex((V,q)=>q>B&&V!==null&&V!==void 0);if($!==-1){const V={x:Kt.value?Gn(s.data[$]):zt($),y:Kt.value?vo($):Jt(s.data[$])};f+=` L ${V.x} ${V.y}`,g=V}}});const x=s.data.map((M,B)=>M==null?null:{x:Kt.value?Gn(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(ne.value!=="line")return[];const t=[];return Qn.value.forEach((s,n)=>{const c=de.value===n,f=de.value!==null&&de.value!==n,g=bt.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}),zn=e.computed(()=>{if(!_n.value)return[];const t=[];return _.series.filter(n=>(n.type||ne.value)==="line").forEach((n,c)=>{const f=_.series.findIndex(M=>M===n),g=de.value===f,x=de.value!==null&&de.value!==f,b=bt.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 Qn.value.forEach((s,n)=>{if(!s?.data?.length)return;const c=de.value,f=c!==null&&c===n,g=c!==null&&c!==n,x=bt.value.has(n);s.data.forEach((b,M)=>{let B,$,V,q,te;if(typeof b=="object"&&b!==null&&!Array.isArray(b))B=typeof b.x=="number"?b.x:M,$=typeof b.y=="number"?b.y:0,V=typeof b.size=="number"?b.size:20,q=b.label||_.categories?.[M]||`Point ${M+1}`,te=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)B=typeof b[0]=="number"?b[0]:M,$=typeof b[1]=="number"?b[1]:0,V=typeof b[2]=="number"?b[2]:20,q=b[3]||_.categories?.[M]||`Point ${M+1}`,te=b[4];else if(typeof b=="number")B=M,$=b,V=ol(n,M),q=_.categories?.[M]||`Point ${M+1}`;else return;!isFinite(B)||!isFinite($)||!isFinite(V)||t.push({x:zt(B),y:Jt($),radius:al(V),originalX:B,originalY:$,originalSize:V,color:Ht(n),seriesName:s.name||`Series ${n+1}`,label:q,imageUrl:te,seriesIndex:n,dataIndex:M,categoryIndex:Math.round(B),isHighlighted:f,isDimmed:g,isHidden:x,opacity:No.value})})}),t}),Jn=e.computed(()=>ne.value!=="area"?[]:Qn.value.map((t,s)=>{const n=[];let c=[];if(t.data.forEach((V,q)=>{V==null?c.length>0&&(n.push([...c]),c=[]):c.push({x:zt(q),y:Jt(V),index:q})}),c.length>0&&n.push(c),n.length===0)return{linePath:"",areaPath:"",color:Ht(s),isHidden:bt.value.has(s)};const f=H.value.bottom+1;let g="",x="";n.forEach((V,q)=>{if(V.length===0)return;let te=`M ${V[0].x} ${V[0].y}`;O.value&&V.length>1?te=el(V):V.slice(1).forEach(Y=>{te+=` L ${Y.x} ${Y.y}`}),g+=(g?" ":"")+te;let ve=`M ${V[0].x} ${f}`;if(ve+=` L ${V[0].x} ${V[0].y}`,O.value&&V.length>1){const Y=el(V),se=Y.substring(Y.indexOf("C")||Y.indexOf("Q")||Y.indexOf("L"));se?ve+=" "+se:V.slice(1).forEach(ie=>{ve+=` L ${ie.x} ${ie.y}`})}else V.slice(1).forEach(Y=>{ve+=` L ${Y.x} ${Y.y}`});ve+=` L ${V[V.length-1].x} ${f} Z`,x+=(x?" ":"")+ve});const b=de.value===s,M=de.value!==null&&de.value!==s,B=bt.value.has(s),$=n.reduce((V,q)=>V+Oo(q),0);return{linePath:g,areaPath:x,color:Ht(s),pathLength:$,isHighlighted:b,isDimmed:M,isHidden:B}})),qo=e.computed(()=>{if(!(["bar"].includes(ne.value)||_n.value))return[];const t=[],{maxX:s}=Mt.value,n=_n.value?_.series.filter(f=>(f.type||ne.value)==="bar"):Qn.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,$=Math.max(4,B/c);n.forEach((V,q)=>{const te=_.series.findIndex(ie=>ie===V),ve=de.value===te,Y=de.value!==null&&de.value!==te,se=bt.value.has(te);V.data.forEach((ie,K)=>{if(ie==null||typeof ie!="number"||!isFinite(ie))return;const pe=H.value.top+(K+.5)*x-b/2+q*($+M),Ne=H.value.left,Ee=Math.abs(Gn(ie)-H.value.left);let lt="";if(O.value&&Ee>0){const at=Math.min(X.value,$/2,Ee/2);lt=[`M ${Ne} ${pe}`,`L ${Ne+Ee-at} ${pe}`,`Q ${Ne+Ee} ${pe} ${Ne+Ee} ${pe+at}`,`L ${Ne+Ee} ${pe+$-at}`,`Q ${Ne+Ee} ${pe+$} ${Ne+Ee-at} ${pe+$}`,`L ${Ne} ${pe+$}`,"Z"].join(" ")}t.push({x:Ne,y:pe,width:Ee,height:$,color:Ht(c===1?K:te),value:ie,label:_.categories[K]||K.toString(),seriesName:V.name,animationDelay:(q*n.length+K)*(Et.value/4),isHighlighted:ve,isDimmed:Y,isHidden:se,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,$=M-B;n.forEach((V,q)=>{const te=_.series.findIndex(ie=>ie===V),ve=de.value===te,Y=de.value!==null&&de.value!==te,se=bt.value.has(te);V.data.forEach((ie,K)=>{if(ie==null||typeof ie!="number"||!isFinite(ie))return;const pe=H.value.left+(K+.5)*x-b/2+q*M+B/2,Ne=Jt(Math.max(0,ie)),Ee=Math.abs(Jt(0)-Jt(ie));let lt="";if(O.value&&Ee>0){const at=Math.min(X.value,$/2,Ee/2);lt=[`M ${pe} ${Ne+Ee}`,`L ${pe} ${Ne+at}`,`Q ${pe} ${Ne} ${pe+at} ${Ne}`,`L ${pe+$-at} ${Ne}`,`Q ${pe+$} ${Ne} ${pe+$} ${Ne+at}`,`L ${pe+$} ${Ne+Ee}`,"Z"].join(" ")}t.push({x:pe,y:Ne,width:$,height:Ee,color:Ht(c===1?K:te),value:ie,label:_.categories[K]||K.toString(),seriesName:V.name,animationDelay:(q*n.length+K)*(Et.value/4),isHighlighted:ve,isDimmed:Y,isHidden:se,barPath:lt,isSmooth:O.value&&Ee>0})})})}return t}),yo=e.computed(()=>{if(!pn.value)return[];const t=Qn.value.map((g,x)=>({series:g,originalIndex:x})).filter(({originalIndex:g})=>!bt.value.has(g));if(t.length===0)return[];let s=ne.value==="semi-radial"?Math.PI:-Math.PI/2;const n=ne.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,$=M+n/2,V=pt.value+Math.cos(M)*wt.value,q=vt.value+Math.sin(M)*wt.value,te=pt.value+Math.cos(B)*wt.value,ve=vt.value+Math.sin(B)*wt.value,Y=pt.value+Math.cos(B)*Je.value,se=vt.value+Math.sin(B)*Je.value,ie=pt.value+Math.cos(M)*Je.value,K=vt.value+Math.sin(M)*Je.value,Re=1,me=[`M ${V} ${q}`,`A ${wt.value} ${wt.value} 0 ${Re} 1 ${te} ${ve}`,`L ${Y} ${se}`,`A ${Je.value} ${Je.value} 0 ${Re} 0 ${ie} ${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:de.value===x,isDimmed:!1,isHidden:!1,startAngle:M,endAngle:B,midAngle:$}),c}if(Rn.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=($,V,q,te,ve)=>{const Y=$+(V-$)/2,se=V-$,ie=pt.value+Math.cos($)*wt.value,K=vt.value+Math.sin($)*wt.value,Re=pt.value+Math.cos(V)*wt.value,me=vt.value+Math.sin(V)*wt.value,pe=pt.value+Math.cos(V)*Je.value,Ne=vt.value+Math.sin(V)*Je.value,Ee=pt.value+Math.cos($)*Je.value,lt=vt.value+Math.sin($)*Je.value,at=se>Math.PI?1:0,En=[`M ${ie} ${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(te);return{path:En,color:Ut,strokeWidth:nn.value,strokeColor:Do(c.length,Ut),value:ve,seriesName:q.name,opacity:.8,isHighlighted:de.value===te,isDimmed:de.value!==null&&de.value!==te,isHidden:!1,startAngle:$,endAngle:V,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,$=s+M,V=B+M/2,q=pt.value+Math.cos(B)*wt.value,te=vt.value+Math.sin(B)*wt.value,ve=pt.value+Math.cos($)*wt.value,Y=vt.value+Math.sin($)*wt.value,se=pt.value+Math.cos($)*Je.value,ie=vt.value+Math.sin($)*Je.value,K=pt.value+Math.cos(B)*Je.value,Re=vt.value+Math.sin(B)*Je.value,me=M>Math.PI?1:0,pe=[`M ${q} ${te}`,`A ${wt.value} ${wt.value} 0 ${me} 1 ${ve} ${Y}`,`L ${se} ${ie}`,`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:de.value===x,isDimmed:de.value!==null&&de.value!==x,isHidden:!1,startAngle:B,endAngle:$,midAngle:V}),s=$}),c)}),Bl=e.computed(()=>{const t=yo.value;return Rn.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(!Vn.value||!pn.value)return[];const t=on.value,s=no.value,n=An.value,c=un.value,f=15,g=t*1.3,x=.55,b=(V,q)=>{const te=pt.value+Math.cos(V.midAngle)*Je.value,ve=vt.value+Math.sin(V.midAngle)*Je.value,Y=pt.value+Math.cos(V.midAngle)*(Je.value+s),se=vt.value+Math.sin(V.midAngle)*(Je.value+s),K=Y+n*(q?1:-1),Re=q?Y+f:Y-f,me=se-c,pe=`${V.seriesName}: ${dn(V.value)}`,Ne=pe.length*t*x;return{pointerStartX:te,pointerStartY:ve,pointerEndX:Y,pointerEndY:se,horizontalEndX:K,horizontalEndY:se,textX:Re,textY:me,text:pe,textWidth:Ne,textAnchor:q?"start":"end",isRightSide:q,pointerLineLength:Math.hypot(Y-te,se-ve),horizontalLineLength:Math.hypot(K-Y,0)}},M=(V,q)=>{const te=Math.abs(V.textY-q.textY)<g,ve=V.isRightSide?V.textX:V.textX-V.textWidth,Y=V.isRightSide?V.textX+V.textWidth:V.textX,se=q.isRightSide?q.textX:q.textX-q.textWidth,ie=q.isRightSide?q.textX+q.textWidth:q.textX,K=ve<ie&&se<Y;return te&&K},B=yo.value.filter(V=>!V.isHidden),$=[];for(let V=0;V<B.length;V++){const q=B[V];let te=Math.cos(q.midAngle)>=0;if(V>0){const Y=$[V-1],se=b(q,te);M(Y,se)&&(te=!te)}const ve=b(q,te);$.push({...ve,color:q.color,isHighlighted:q.isHighlighted,isDimmed:q.isDimmed})}return $}),l=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||No.value||.7;return de.value===null||de.value===void 0?s:de.value!==null?t.seriesIndex===de.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 de.value!==null?t.seriesIndex===de.value?Math.min(1,s+.1):s*.7:s},a=(t,s)=>{if(t)try{if(de.value===t.seriesIndex?de.value=null:de.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(),Pn.value=!0,de.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=Dn.value,B=po.value,$=M.map(V=>{const q=B[V]||V,te=u(V,t);return te?{seriesName:t.seriesName,label:t.label,value:`${q}: ${te}`,color:t.color}:null}).filter(Boolean);ze.value={show:!0,x:f,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:$,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&&(Pn.value=!1,de.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=pt.value+Math.cos(c)*Je.value,g=vt.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=pt.value+Math.cos(g)*f,b=vt.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&&de.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},ae=e.computed(()=>{if(!Kn.value)return[];const t=[],s=S.value;return Qn.value.forEach((n,c)=>{const f=[],g=[],x=[],b=de.value===c,M=de.value!==null&&de.value!==c,B=bt.value.has(c);for(let $=0;$<s;$++){const V=n.data[$]||0,te=V/N.value*Je.value,ve=$*2*Math.PI/s-Math.PI/2,Y=pt.value+Math.cos(ve)*te,se=vt.value+Math.sin(ve)*te;f.push(`${Y},${se}`),g.push({x:Y,y:se}),x.push({x:Y,y:se,value:V,label:_.categories[$]||`Axis ${$+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}),Ke=(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(!Kn.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=ae.value.filter(b=>b.isHidden?!1:Ke({x:f,y:g},b.polygonPoints));if(x.length>0){x.length,de.value=x[0].seriesIndex;const b=t.clientX-n.left+10,M=t.clientY-n.top-10,B=200,$=50+x.length*25;let V=b,q=M;V+B>he.value&&(V=t.clientX-n.left-B-10),q+$>nt.value&&(q=t.clientY-n.top-$-10),V<0&&(V=10),q<0&&(q=10);const te=x.map(ve=>{let Y=ve.dataPoints[0],se=1/0;return ve.dataPoints.forEach(ie=>{const K=Math.sqrt(Math.pow(ie.x-f,2)+Math.pow(ie.y-g,2));K<se&&(se=K,Y=ie)}),{seriesName:ve.seriesName,color:ve.color,value:dn(Y.value!==void 0?Y.value:ve.value)}});ze.value={show:!0,x:V,y:q,title:x.length===1?x[0].seriesName:"",value:"",bubbleData:[],spiderSeries:te}}else On()},At=e.computed(()=>{const t=F.value;return t.logos.map((s,n)=>{const c=_.series[s.seriesIndex];if(!c||!c.data||c.data.length===0||bt.value.has(s.seriesIndex))return null;let f,g;if(Qt.value){let b=-1,M=null;for(let $=c.data.length-1;$>=0;$--)if(c.data[$]!==null&&c.data[$]!==void 0){b=$,M=c.data[$];break}if(b===-1||M===null)return null;const B=c.data.map(($,V)=>$==null?null:{x:zt(V),y:Jt($),index:V}).filter($=>$!==null);if(t.animations.enabled&&!$n.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(it.value.isAnimating||!it.value.hasAnimated))if(it.value.isAnimating){const $=it.value.currentFrame/it.value.totalFrames,V=Uo(t.animations.easing,Math.min($,1)),q=Yl(B,V);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(pn.value||Kn.value){const b=Math.PI*2/t.logos.length*n;f=pt.value+Math.cos(b)*(Je.value+30)+(s.offsetX||0),g=vt.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=>{bt.value.has(t)?bt.value.delete(t):bt.value.add(t)},qt=e.computed(()=>{if(!ze.value.show&&!(ot.value&&He.value.show&&!R.value.isZooming))return{display:"none"};let t,s;if(ot.value&&He.value.show&&!R.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 $;typeof t.categoryIndex=="number"?$=t.categoryIndex:typeof t.dataIndex=="number"?$=t.dataIndex:t.label&&_.categories.includes(t.label)&&($=_.categories.indexOf(t.label));const V=(Kt.value||ne.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";ze.value={show:!0,x:f,y:g,title:V,value:dn(t.value)||"",categoryIndex:$,spiderSeries:[]}},Xn=e.ref(!1),Pn=e.ref(!1),On=()=>{ze.value.show=!1,ze.value.spiderSeries=[],ze.value.bubbleData=[],He.value.show=!1,Xn.value||(de.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),oo.value={show:!0,x:f,y:g,content:t.texts,count:t.totalCount}},Mo=()=>{Bo.value=!1,oo.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}},$n=e.computed(()=>Tt.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),il=()=>{if(!ye.value||$n.value){it.value.hasAnimated=!0,kn.value&&(co.value=1);return}kn.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));eo(n),kn.value&&(co.value=n),s<1?(it.value.currentFrame++,it.value.animationId=requestAnimationFrame(t)):to()};it.value.animationId=requestAnimationFrame(t)},eo=t=>{const s=document.querySelector(".dss-custom-chart-container");s&&s.style.setProperty("--dss-animation-progress",t)},to=()=>{it.value.isAnimating=!1,it.value.hasAnimated=!0,kn.value&&(co.value=1),it.value.animationId&&(cancelAnimationFrame(it.value.animationId),it.value.animationId=null)},Nn=e.computed(()=>!pn.value||it.value.hasAnimated?!0:kn.value?co.value>=1:io.value?Lo.value>=1:!0),Hl=e.computed(()=>Vn.value&&Nn.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||$n.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||$n.value)return"";const t=["dss-chart-animated"];return it.value.hasAnimated||t.push(`dss-animate-${et.value}`),it.value.hasAnimated||(pn.value&&ne.value!=="semi-radial"?t.push("dss-animate-fill"):pn.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(()=>R.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{yn()},50)}),e.watch(()=>[R.value.scale,R.value.offsetX],()=>{!R.value.isZooming&&!R.value.isDragging&&yn()},{flush:"post"}),e.watch([yt,$t],([t,s])=>{R.value.minScale=t,R.value.maxScale=s,(R.value.scale<t||R.value.scale>s)&&Jo()},{immediate:!0}),e.watch(()=>_.locale,t=>{t&&t!==I.value&&(I.value=t)},{immediate:!0}),e.watch(()=>Te.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Go)}):document.removeEventListener("click",Go)}),e.onMounted(()=>{de.value=null,kn.value&&(!ye.value||$n.value)&&(co.value=1),kl(),k.value&&typeof ResizeObserver<"u"&&(ce=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(we&&cancelAnimationFrame(we),we=requestAnimationFrame(()=>{we=null;const{width:n,height:c}=s.contentRect;Fe.value=Math.round(n),p.value=Math.round(c),oe.value&&(Dt.value=oe.value.offsetHeight||ge)}))}),ce.observe(k.value)),ye.value&&!$n.value?ne.value==="semi-radial"?setTimeout(()=>So(),Oe.value):setTimeout(()=>il(),Oe.value):(it.value.hasAnimated=!0,ne.value==="semi-radial"&&(Lo.value=1)),document.addEventListener("mousemove",zl),document.addEventListener("mouseup",Pl),document.addEventListener("click",xo)}),e.onUnmounted(()=>{we&&cancelAnimationFrame(we),ce&&k.value&&(ce.unobserve(k.value),ce.disconnect(),ce=null),it.value.animationId&&cancelAnimationFrame(it.value.animationId),In&&(cancelAnimationFrame(In),In=null),R.value.zoomTimeout&&clearTimeout(R.value.zoomTimeout),document.removeEventListener("mousemove",zl),document.removeEventListener("mouseup",Pl),document.removeEventListener("click",xo),document.removeEventListener("click",Go)});const zl=t=>{if(R.value.isDragging&&R.value.scale>1&&Qt.value){He.value.show=!1;const s=t.clientX-R.value.lastMouseX,{minX:n,maxX:c}=Mt.value,f=c-n||1,x=s*.8;R.value.offsetX+=x;const b=f/R.value.scale,M=f-b,B=0,$=-M/f*H.value.width,V=B;R.value.offsetX=Math.max($,Math.min(V,R.value.offsetX)),R.value.lastMouseX=t.clientX,R.value.lastMouseY=t.clientY}},Pl=()=>{R.value.isDragging&&(R.value.isDragging=!1,setTimeout(()=>{!R.value.isDragging&&R.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,$=Math.sqrt(M*M+B*B);f.push($),c+=$}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],$=n[b],V=n[b+1];return{x:$.x+(V.x-$.x)*B,y:$.y+(V.y-$.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":pn.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":ne.value,ref_key:"containerEl",ref:k,onWheel:Qo,onMousedown:Cl,onMousemove:z,onMouseup:$l,onMouseleave:Q,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:oe},[e.createElementVNode("div",Ql,[rt.value?(e.openBlock(),e.createElementBlock("div",Jl,e.toDisplayString(rt.value),1)):e.createCommentVNode("",!0),Ge.value?(e.openBlock(),e.createElementBlock("div",ea,e.toDisplayString(Ge.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":bt.value.has(c),"dss-legend-hovered":de.value===c,"dss-legend-dimmed":de.value!==null&&de.value!==c}]),onClick:f=>Zt(c),onMouseenter:f=>y(c),onMouseleave:E,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":bt.value.has(c),"dss-legend-hovered":de.value===c,"dss-legend-dimmed":de.value!==null&&de.value!==c}]),onClick:f=>Zt(c),onMouseenter:f=>y(c),onMouseleave:E,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&&Ct.value&&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:Ln.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),kn.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),re.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(re.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,$a)):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,Ta)):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,[_n.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:On},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:On},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||kt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(zn.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${c}`,cx:n.x,cy:n.y,r:n.isHighlighted?$e(n,tt.value)+2:$e(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:On},null,46,Oa))),128)):e.createCommentVNode("",!0)])])):ne.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||kt.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?$e(n,tt.value)+2:$e(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:On},null,46,Xa))),128)):e.createCommentVNode("",!0)])):ne.value==="area"?(e.openBlock(),e.createElementBlock("g",Ya,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jn.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(Jn.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${c}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?qe.value+.2:qe.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(Jn.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))])):ne.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:On},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:On},null,46,es))],64))),128))],2)):e.createCommentVNode("",!0)]),ot.value&&He.value.show&&!R.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),pn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:To.value},[ne.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:pt.value,cy:vt.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":ne.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:On},null,42,us))),128))],8,ds),fn.value&&Nn.value?(e.openBlock(),e.createElementBlock("g",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gn.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&&(Nn.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:Cn.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),Kn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:To.value},[ct.value?(e.openBlock(),e.createElementBlock("g",ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ft.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${c}`,cx:pt.value,cy:vt.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(ft.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${c}`},[e.createElementVNode("rect",{x:pt.value-16,y:vt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,ws),e.createElementVNode("text",{x:pt.value,y:vt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Bn(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:pt.value,x2:n.x,y1:vt.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:On},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.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:On},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,$s))),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('${Hn.value}')`,backgroundRepeat:"no-repeat",...Ue.value,opacity:A.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.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:hn(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,Ts)),[[e.vShow,Wn.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&&!R.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":ot.value&&He.value.show&&!R.value.isZooming}]),style:e.normalizeStyle(qt.value)},[!ot.value||!He.value.show||R.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Kn.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},[Ye(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(Ye(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),Ye(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(Ye(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))]),Ye(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(Ye(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),Ye(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(Ye(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&&R.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(R.value.scale*100))+"% "+e.toDisplayString(e.unref(D)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Gl),Te.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:Te.value.x+"px",top:Te.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:Sn},e.toDisplayString(e.unref(D)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Bt.value.addMarker&&(Bt.value.downloadSvg||Bt.value.downloadPng||Bt.value.downloadCsv||Tn.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:Yn},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:jn},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),Tn.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(Tn.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(mn(n)),style:e.normalizeStyle(St(n)),onClick:f=>ro(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:ht(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),ue.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"):lo.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,[ue.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Sr,e.toDisplayString(Fo(ue.value.categoryIndex)||""),1)),ue.value.fromButton?(e.openBlock(),e.createElementBlock("div",Nr,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":s[1]||(s[1]=n=>ue.value.categoryIndex=n),class:"dss-form-select",disabled:C.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mn.value,(n,c)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${c}`,value:c},e.toDisplayString(n),9,Mr))),128))],8,Br),[[e.vModelSelect,ue.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",_r,[e.createElementVNode("label",$r,e.toDisplayString(e.unref(D)("chart.modalMarker.description")),1),C.value?(e.openBlock(),e.createElementBlock("div",Tr,e.toDisplayString(ue.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=n=>ue.value.description=n),placeholder:e.unref(D)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,Lr)),[[e.vModelText,ue.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:hn({type:ue.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,[lo.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:!(ue.value.description&&ue.value.description.length)},e.toDisplayString(lo.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,I=fe,be=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"),_}),oe=e.computed(()=>({}));function Fe(){I("close-modal")}function p(){D.backDrop&&!be.value&&I("close-modal")}function ce(_){_.target.tagName==="INPUT"&&(be.value=_.target.tagName)}function we(){setTimeout(()=>{be.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:je,bodyWidth:F,htmlOverflow:dt,scrollY:ut}=k.value;_.style.overflow=Pe||"",_.style.position=Le||"",_.style.top=je||"",_.style.width=F||"",_.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",ce),_e.addEventListener("focusout",we))},100);else{j(),document.body.classList.remove("dss-modal-open");const _e=document.getElementById("dss-modal-backdrop");_e&&(_e.removeEventListener("focusin",ce),_e.removeEventListener("focusout",we))}},{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(oe.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"},$i={class:"dss-pagination-controls"},Ti=["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:I}=cl.useI18n(),be=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 oe(C,y){const E=Object.assign({},C);return Fe(C)&&Fe(y)&&Object.keys(y).forEach(z=>{Fe(y[z])?z in C?E[z]=oe(C[z],y[z]):Object.assign(E,{[z]:y[z]}):Object.assign(E,{[z]:y[z]})}),E}function Fe(C){return C&&typeof C=="object"&&!Array.isArray(C)}const p=e.computed(()=>oe(Me,be.options)),ce=e.computed(()=>{const C=p.value.table.width;return C==="auto"?null:typeof C=="number"?C:null}),we=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),je=e.computed(()=>p.value.table.hoverable),F=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),ne=e.computed(()=>p.value.pagination.rowsPerPageOptions),vn=e.computed(()=>p.value.scrollable),rt=e.computed(()=>p.value.emptyMessage),Ge=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),re=e.computed(()=>Ge.value||sn.value||Xt.value||xe.value),xe=e.computed(()=>p.value.toolbar?.columnVisibility!==!1),ee=e.ref(""),le=e.ref(!1),Xe=e.ref(null);let ct=null;function Ze(){le.value?(ct&&(clearTimeout(ct),ct=null),le.value=!1,ee.value="",k("search",""),Xe.value?.blur()):(le.value=!0,ct=setTimeout(()=>{ct=null,Xe.value?.focus()},80))}function Ve(){ee.value||(le.value=!1)}function Ot(){ee.value="",k("search",""),Xe.value?.focus()}const _t=e.computed(()=>({"dss-table-striped":Pe.value,"dss-table-bordered":Le.value,"dss-table-hoverable":je.value,[`dss-table-${F.value}`]:F.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;be.columns.forEach((y,E)=>{y?.hidden!==!0&&C.add(ot(y,E))}),tn.value=C}const yt=e.computed(()=>be.columns.filter((C,y)=>tn.value.has(ot(C,y)))),$t=C=>{const y=be.columns.findIndex(E=>E===C);return ot(C,y>=0?y:0)},st=(C,y)=>tn.value.has(ot(C,y));function nn(C,y){const E=ot(C,y),z=new Set(tn.value);z.has(E)?z.delete(E):z.add(E),tn.value=z}const tt=e.ref(null),kt=e.ref(!1);function $e(C){tt.value&&!tt.value.contains(C.target)&&(kt.value=!1)}const qe=e.computed(()=>yt.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),J=(C,y)=>Z.value.has(O(C,y)),ye=(C,y,E)=>{E&&E.stopPropagation();const z=O(C,y),Q=new Set(Z.value);Q.has(z)?(Q.delete(z),k("row-collapse",{data:C,index:y})):(Q.add(z),k("row-expand",{data:C,index:y})),Z.value=Q},et=(C,y)=>{if(!_e.value)return;const E=O(C,y);X.value!==E&&(X.value=E)},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(E=>E.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}},Tt=e.ref({}),Ae=e.ref(null),It=e.ref(null),ft=220,Bn=e.ref(null),Wt=e.computed(()=>yt.value.find(C=>$t(C)===Ae.value)??null),Ct=e.computed(()=>{if(!Wt.value||Wt.value.filter!=="range")return null;const C=Wt.value,y=Ae.value,{min:E,max:z}=G(C),Q=C.filterMin??E,Qe=C.filterMax??z,De=rn(y),ht=De.min??Q,mn=De.max??Qe,St=Qe-Q,hn=St===0?0:(ht-Q)/St*100,Fo=St===0?100:(mn-Q)/St*100;return{rangeMin:Q,rangeMax:Qe,currentMin:ht,currentMax:mn,minPct:hn,maxPct:Fo}}),Bt=e.ref(null),Tn=e.ref("max");function Ln(C){const y=Bt.value,E=Ct.value;if(!y||!E)return;const z=y.getBoundingClientRect(),Qe=(C.clientX-z.left)/z.width*100,De=(E.minPct+E.maxPct)/2;Tn.value=Qe<De?"min":"max"}function rn(C){return Tt.value[C]??{}}function cn(C,y){Tt.value={...Tt.value,[C]:y}}function Yt(C){const y=Tt.value[C];return y?y.type==="string"?!!y.value?.trim():y.type==="range"?y.min!=null||y.max!=null:y.type==="dateRange"?!!(y.from||y.to):y.type==="list"?y.selected?.length>0:!1:!1}function dn(C){const y={...Tt.value};delete y[C],Tt.value=y,Ae.value=null,It.value=null}function Wn(){if(!Ae.value){It.value=null;return}const C=Bn.value;if(!C)return;const y=C.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Ae.value}"]`);if(!y)return;const E=y.getBoundingClientRect();It.value={top:E.bottom+6,left:Math.max(8,E.right-ft)}}const mo=e.computed(()=>{let C=[...be.data];const y=(ee.value??"").trim().toLowerCase();return y&&(C=C.filter(E=>be.columns.some(z=>{if(!z||!z.field)return!1;const Q=gt(E,z);return String(Q??"").toLowerCase().includes(y)}))),yt.value.forEach(E=>{const z=$t(E),Q=Tt.value[z];if(!Q)return;const Qe=E.field;if(Qe){if(Q.type==="string"&&Q.value?.trim()){const De=Q.value.trim().toLowerCase();C=C.filter(ht=>{const mn=gt(ht,E);return String(mn??"").toLowerCase().includes(De)})}else if(Q.type==="range")C=C.filter(De=>{const ht=ue(De,Qe),mn=Number(ht);return!(Number.isNaN(mn)||Q.min!=null&&mn<Q.min||Q.max!=null&&mn>Q.max)});else if(Q.type==="dateRange"){const De=Q.from?new Date(Q.from).getTime():null,ht=Q.to?new Date(Q.to).getTime():null;C=C.filter(mn=>{const St=ue(mn,Qe),hn=St?new Date(St).getTime():NaN;return!(Number.isNaN(hn)||De!=null&&hn<De||ht!=null&&hn>ht)})}else if(Q.type==="list"&&Q.selected?.length){const De=new Set(Q.selected);C=C.filter(ht=>{const mn=gt(ht,E);return De.has(mn!=null?String(mn):"")})}}}),C});function T(C){const y=new Set;return be.data.forEach(E=>{const z=gt(E,C);y.add(z!=null?String(z):"")}),Array.from(y).sort((E,z)=>String(E).localeCompare(String(z)))}function P(C,y){if(Ae.value===C){Ae.value=null,It.value=null;return}if(Ae.value=C,y?.currentTarget){const E=y.currentTarget.getBoundingClientRect();It.value={top:E.bottom+6,left:Math.max(8,E.right-ft)}}else Wn()}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 E=1/0,z=-1/0;return be.data.forEach(Q=>{const Qe=ue(Q,y),De=Number(Qe);Number.isNaN(De)||(E=Math.min(E,De),z=Math.max(z,De))}),{min:E===1/0?0:E,max:z===-1/0?100:z}}function ke(C,y,E){const z={...rn(C),type:"range"},Q=E===""?null:Number(E),Qe=Q===null||Number.isNaN(Q)?null:Q;z[y]=Qe,Qe!=null&&(y==="min"&&z.max!=null&&Qe>z.max&&(z.max=Qe),y==="max"&&z.min!=null&&Qe<z.min&&(z.min=Qe)),cn(C,z)}function We(C,y,E){const z={...rn(C),type:"dateRange"};z[y]=E||"",cn(C,z)}const Ue=e.reactive({});function Ie(C,y){Ue[C]=y}function Ye(C){const y=$t(C),E=(Ue[y]??"").trim().toLowerCase(),z=T(C);return E?z.filter(Q=>String(Q).toLowerCase().includes(E)):z}function Vt(C,y){return(rn(C).selected??[]).includes(y!=null?String(y):"")}function Hn(C,y){const z=[...rn(C).selected??[]],Q=y!=null?String(y):"",Qe=z.indexOf(Q);Qe>=0?z.splice(Qe,1):z.push(Q),cn(C,{type:"list",selected:z})}function Vn(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(){Wn()}const no=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(E=>E.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})}},An=e.computed(()=>{if(!Dt.value)return mo.value;let C=[...mo.value];return xt.value==="single"&&Se.value&&Oe.value!==0?C.sort((y,E)=>{const z=ue(y,Se.value),Q=ue(E,Se.value);return z===Q?0:z==null?1:Q==null?-1:(z<Q?-1:z>Q?1:0)*Oe.value}):xt.value==="multiple"&&mt.value.length>0&&C.sort((y,E)=>{for(const z of mt.value){const Q=ue(y,z.field),Qe=ue(E,z.field);if(Q===Qe)continue;if(Q==null)return 1;if(Qe==null)return-1;const De=Q<Qe?-1:Q>Qe?1:0;if(De!==0)return De*z.order}return 0}),C}),un=e.ref(0),fn=e.ref(Be.value),Zn=e.ref(!1),ko=e.ref(null),jo=C=>{fn.value=C,Zn.value=!1,un.value=0,k("page",{page:0,rows:fn.value})};function Co(C){ko.value&&!ko.value.contains(C.target)&&(Zn.value=!1)}const bo=e.computed(()=>An.value.length),Cn=e.computed(()=>Math.ceil(bo.value/fn.value)),gn=e.computed(()=>nt.value?un.value*fn.value:0),Io=e.computed(()=>nt.value?Math.min((un.value+1)*fn.value,bo.value):bo.value),oo=e.computed(()=>{if(!nt.value)return An.value;const C=gn.value,y=Io.value;return An.value.slice(C,y)}),Dn=e.ref(new Set),po=e.computed(()=>An.value.filter((C,y)=>Dn.value.has(O(C,y)))),_o=e.computed(()=>{const C=An.value.length;return C>0&&Dn.value.size===C}),bt=e.computed(()=>{const C=An.value.length,y=Dn.value.size;return y>0&&y<C}),de=(C,y)=>Dn.value.has(O(C,y)),$o=()=>{if(_o.value)Dn.value=new Set,k("unselect-all");else{const C=new Set;An.value.forEach((y,E)=>C.add(O(y,E))),Dn.value=C,k("select-all",po.value)}},ze=(C,y)=>{const E=O(C,y),z=new Set(Dn.value),Q=z.has(E);he.value==="single"?Q?(z.delete(E),k("row-unselect",C)):(z.clear(),z.add(E),k("row-select",C)):Q?(z.delete(E),k("row-unselect",C)):(z.add(E),k("row-select",C)),Dn.value=z},jt=e.computed(()=>{const C=Cn.value,y=un.value+1,E=2,z=[],Q=[];let Qe;for(let De=1;De<=C;De++)(De===1||De===C||De>=y-E&&De<=y+E)&&z.push(De);for(const De of z)Qe&&(De-Qe===2?Q.push(Qe+1):De-Qe!==1&&Q.push("...")),Q.push(De),Qe=De;return Q}),He=C=>{C<0||C>=Cn.value||(un.value=C,k("page",{page:C,rows:fn.value}))},Te=(C,y,E)=>{k("row-click",{data:C,index:y,originalEvent:E}),et(C,gn.value+y)},R=(C,y)=>{const E=gn.value+y;return{"dss-table-row-selected":de(C,E),"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,E)}},gt=(C,y)=>y.field?ue(C,y.field):"",ue=(C,y)=>y.split(".").reduce((E,z)=>E&&E[z],C),Mn=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}},lo=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(()=>be.locale,C=>{C&&C!==I.value&&(I.value=C)},{immediate:!0}),e.watch(Be,C=>{fn.value=C,un.value=0}),e.watch(ee,C=>{k("search",C??"")}),e.watch(()=>be.columns,()=>{Rt()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Co),document.addEventListener("click",$e),document.addEventListener("click",Vn),window.addEventListener("resize",on),window.addEventListener("scroll",on,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Co),document.removeEventListener("click",$e),document.removeEventListener("click",Vn),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:Bn,style:e.normalizeStyle({width:ce.value+"px",height:we.value?we.value+"px":"auto"})},[re.value?(e.openBlock(),e.createElementBlock("div",qr,[e.createElementVNode("div",Ur,[Ge.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=E=>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]=E=>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":kt.value}]),onClick:y[2]||(y[2]=E=>kt.value=!kt.value),"aria-expanded":kt.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,(E,z)=>(e.openBlock(),e.createElementBlock("li",{key:ot(E,z),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(E,z),onChange:Q=>nn(E,z),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Gr),st(E,z)?(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(E.header),1)])]))),128))],512),[[e.vShow,kt.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":le.value||ee.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Xe,"onUpdate:modelValue":y[4]||(y[4]=E=>ee.value=E),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(D)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:y[5]||(y[5]=E=>le.value=!0),onBlur:Ve},null,40,ti),[[e.vModelText,ee.value]]),ee.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":le.value||!!ee.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":vn.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:bt.value,onChange:$o,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,ri),bt.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(yt.value,(E,z)=>(e.openBlock(),e.createElementBlock("th",{key:$t(E),class:e.normalizeClass(["dss-table-th",Mn(E)]),style:e.normalizeStyle(lo(E)),onClick:Q=>no(E)},[e.createElementVNode("div",mi,[e.createElementVNode("span",pi,e.toDisplayString(E.header),1),E.sortable!==!1&&Dt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Nt(E)])},[Et(E)===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(E)===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(E)===-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),E.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Ae.value===$t(E)}]),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($t(E))}]),"data-filter-column-key":$t(E),"aria-expanded":Ae.value===$t(E),"aria-label":"Filter column",onClick:Q=>P($t(E),Q)},[...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(oo.value,(E,z)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:O(E,gn.value+z)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",R(E,z)]),style:e.normalizeStyle(j.value),onClick:Q=>Te(E,z,Q)},[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:de(E,gn.value+z),onChange:Q=>ze(E,gn.value+z),class:e.normalizeClass(["dss-table-checkbox",he.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,bi),he.value==="multiple"&&de(E,gn.value+z)?(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"&&de(E,gn.value+z)?(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(Q=>ye(E,gn.value+z,Q),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":J(E,gn.value+z),"aria-label":J(E,gn.value+z)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":J(E,gn.value+z)}]),"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(yt.value,(Q,Qe)=>(e.openBlock(),e.createElementBlock("td",{key:$t(Q),class:e.normalizeClass(["dss-table-td",Mn(Q)]),style:e.normalizeStyle(lo(Q))},[e.renderSlot(C.$slots,`cell-${Q.field}`,{data:E,column:Q,rowIndex:z},()=>[e.createTextVNode(e.toDisplayString(gt(E,Q)),1)])],6))),128))],14,ki),_.value&&J(E,gn.value+z)?(e.openBlock(),e.createElementBlock("tr",Si,[e.createElementVNode("td",{colspan:qe.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(C.$slots,"expansion",{data:E,rowIndex:z})],8,Ni)])):e.createCommentVNode("",!0)],64))),128)),oo.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:qe.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",$i,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:un.value===0,onClick:y[8]||(y[8]=E=>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,Ti),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:un.value===0,onClick:y[9]||(y[9]=E=>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,E=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E},[E!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":E===un.value+1}]),onClick:z=>He(E-1)},e.toDisplayString(E),11,Ai)):(e.openBlock(),e.createElementBlock("span",Di,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:un.value>=Cn.value-1,onClick:y[10]||(y[10]=E=>He(un.value+1)),title:e.unref(D)("table.nextPage")}," › ",8,Ri),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:un.value>=Cn.value-1,onClick:y[11]||(y[11]=E=>He(Cn.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":Zn.value}]),onClick:y[12]||(y[12]=E=>Zn.value=!Zn.value),"aria-expanded":Zn.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(fn.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(ne.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E,role:"option","aria-selected":E===fn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":E===fn.value}]),onClick:z=>jo(E)},e.toDisplayString(E),11,Pi))),128))],512),[[e.vShow,Zn.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:ft+"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]=E=>A(Ae.value,E.target.value)),class:"dss-table-filter-input",placeholder:e.unref(D)("table.search")||"Search..."},null,40,Wi)])):Wt.value.filter==="range"&&Ct.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Ct.value.minPct+"%","--range-max-pct":Ct.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Bt,class:"dss-table-filter-double-range-track",onMousemove:Ln,onMouseenter:Ln},[e.createElementVNode("input",{type:"range",min:Ct.value.rangeMin,max:Ct.value.rangeMax,value:Ct.value.currentMin,onInput:y[14]||(y[14]=E=>ke(Ae.value,"min",E.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:Tn.value==="min"?2:1})},null,44,Zi),e.createElementVNode("input",{type:"range",min:Ct.value.rangeMin,max:Ct.value.rangeMax,value:Ct.value.currentMax,onInput:y[15]||(y[15]=E=>ke(Ae.value,"max",E.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:Tn.value==="max"?2:1})},null,44,qi)],544),e.createElementVNode("div",Ui,e.toDisplayString(Ct.value.currentMin)+" – "+e.toDisplayString(Ct.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]=E=>We(Ae.value,"from",E.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]=E=>We(Ae.value,"to",E.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:Ue[Ae.value]??"",onInput:y[18]||(y[18]=E=>Ie(Ae.value,E.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(Ye(Wt.value),E=>(e.openBlock(),e.createElementBlock("label",{key:E,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Vt(Ae.value,E),onChange:z=>Hn(Ae.value,E)},null,40,nc),e.createElementVNode("span",null,e.toDisplayString(E),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]=E=>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"},$c=["title"],Tc={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"],$d=["onClick"],Td=["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"},$u=["title"],Tu=["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:I,locale:be}=cl.useI18n(),k=L,Me=D,oe=e.useSlots(),Fe=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
96
|
+
`,t+="Category",S.series.forEach(g=>{const E=g.name.replace(/"/g,'""');t+=',"'+E+'"'}),t+=`
|
|
97
|
+
`;const s=Math.max(...S.series.map(g=>g.data?.length||0));for(let g=0;g<s;g++){let L='"'+(S.categories[g]||z("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';S.series.forEach(T=>{const H=T.data&&T.data[g]!==void 0?T.data[g]:"";L+=","+H}),t+=L+`
|
|
98
|
+
`}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n),p=document.createElement("a");p.href=i,p.download=Kt("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),ht()}catch(t){console.error("Error downloading CSV:",t)}},Bn=t=>{if(typeof t.action=="function"){const s={series:S.series,categories:S.categories,markers:Tt.value},n={chartX:ze.value.chartX,chartY:ze.value.chartY,dataX:ze.value.mouseDataX,dataY:ze.value.mouseDataY,categoryIndex:clampedCategoryIndex||ze.value.categoryIndex};t.action(s,n)}ht()},Gl=()=>{al(),he.value.show=!0,he.value.categoryIndex=ze.value.categoryIndex,he.value.fromButton=!1,ht()},Sl=()=>{al(),he.value.show=!0,he.value.categoryIndex=0,he.value.fromButton=!0},mo=t=>{if(ze.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(ze.value.show=!1)}},Rl=t=>{ze.value.show&&!t.target.closest(".context-menu")&&(ze.value.show=!1)},Ql=t=>{if(!rn.value||!Et.value)return;t.preventDefault(),t.stopPropagation(),Z.value.isZooming=!0,Pe.value.show=!1,Z.value.zoomTimeout&&clearTimeout(Z.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top;if(i<F.value.left-50||i>F.value.right+50||p<F.value.top-50||p>F.value.bottom+100){Z.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,E=Math.max(Z.value.minScale,Math.min(Z.value.maxScale,Z.value.scale*g));if(E!==Z.value.scale){const{minX:b,maxX:L}=Ot.value,T=L-b||1,H=T/Z.value.scale,M=b-Z.value.offsetX/F.value.width*T,G=(i-F.value.left)/F.value.width,ce=M+G*H;Z.value.scale=E;const Ee=T/Z.value.scale,ee=ce-G*Ee;Z.value.offsetX=-(ee-b)/T*F.value.width,Z.value.scale<=1.01&&(Z.value.scale=1,Z.value.offsetX=0)}Z.value.zoomTimeout=setTimeout(()=>{Z.value.isZooming=!1,Z.value.zoomTimeout=null},300)},So=t=>{if(!rn.value||!Et.value||Z.value.scale<=1)return;Pe.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,Z.value.isDragging=!0,Z.value.lastMouseX=t.clientX,Z.value.lastMouseY=t.clientY,t.preventDefault()},Bo=()=>{Z.value.isDragging=!1},Fl=()=>{!rn.value||!Et.value||(Z.value.scale=1,Z.value.offsetX=0,Z.value.isDragging=!1,Z.value.zoomTimeout&&(clearTimeout(Z.value.zoomTimeout),Z.value.zoomTimeout=null),Z.value.isZooming=!1)},Mo=()=>!rn.value||!Nl.value||!Et.value?"default":Z.value.isDragging?"grabbing":Z.value.scale>1?"grab":"dss-crosshair",Jl=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 i=t[Math.max(n-1,0)],p=t[n],g=t[n+1],E=t[Math.min(n+2,t.length-1)],b=p.x+(g.x-i.x)/6*j.value,L=p.y+(g.y-i.y)/6*j.value,T=g.x-(E.x-p.x)/6*j.value,H=g.y-(E.y-p.y)/6*j.value;s+=` C ${b} ${L} ${T} ${H} ${g.x} ${g.y}`}return s},xn=e.computed(()=>{const s=O.value?.chart?.padding,n=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,p=50;let g=p+(Ft.value?30:0)+60;if(On.value){const M={left:p+40,top:p+40,right:p+40,bottom:p+40};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??M.left,top:i.top??M.top,right:i.right??M.right,bottom:i.bottom??M.bottom}:M}if(pn.value){const M=!_t.value,G=Nn.value,ce=G?Hn.value+Cn.value+Math.max(24,nn.value+16):0,Ee=M?12:p;let ee=0;wt.value&&(ee+=M?8:15),tt.value&&(ee+=M?6:10);const pe=He();let ye=Ee+(M?4:16)+(G?ce:0),oe=Ee+(G?ce:0);_t.value&&U.value==="left"?ye+=pe.legendWidth||150:_t.value&&U.value==="right"&&(oe+=pe.legendWidth||150);const be=ge.value==="semi-radial"?G?ce:8:G?ce:M?8:p+80,we=G?14:0,De=Ee+ee+we,Ae={left:ye,top:De,right:oe,bottom:be};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??Ae.left,top:i.top??Ae.top,right:i.right??Ae.right,bottom:i.bottom??Ae.bottom}:Ae}let E=0;wt.value&&(E+=15),tt.value&&(E+=10);const b=He();let L=p+16,T=p;_t.value&&U.value==="left"?L+=b.legendWidth||150:_t.value&&U.value==="right"&&(T+=b.legendWidth||150),_t.value&&U.value==="bottom"&&(g+=b.legendHeight||0);const H={left:L,top:p+E,right:T,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??H.left,top:i.top??H.top,right:i.right??H.right,bottom:i.bottom??H.bottom}:H}),F=e.computed(()=>({left:xn.value.left,top:xn.value.top,right:Ne.value-xn.value.right,bottom:pt.value-xn.value.bottom,width:Ne.value-(xn.value.left+xn.value.right),height:pt.value-(xn.value.top+xn.value.bottom)})),rn=e.computed(()=>["line","area","bar"].includes(ge.value)||gt.value),Dn=e.computed(()=>gt.value),pn=e.computed(()=>["radial","semi-radial"].includes(ge.value)),On=e.computed(()=>ge.value==="spider"),Wt=e.computed(()=>ge.value==="bubble"),Gt=e.computed(()=>O.value?.chart?.orientation==="horizontal"&&(ge.value==="bar"||Dn.value)),il=t=>{const{minY:s,maxY:n}=Ot.value,i=n-s||1;return F.value.left+(t-s)/i*F.value.width},vl=t=>{const{maxX:s}=Ot.value,n=s+1,p=F.value.height/n;return F.value.top+(t+.5)*p},St=e.computed(()=>pn.value?xn.value.left+(Ne.value-xn.value.left-xn.value.right)/2:Ne.value/2),Nt=e.computed(()=>On.value?pt.value/2-40:pn.value?xn.value.top+(pt.value-xn.value.top-xn.value.bottom)/2:pt.value/2),st=e.computed(()=>{if(On.value){const t=F.value.width-80,s=F.value.height-80;return Math.min(t,s)/2}return Math.min(F.value.width,F.value.height)/2}),Pt=e.computed(()=>{const t=O.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof s=="number"&&s>=0&&s<=1?s:.45;return st.value*n}),Il=e.computed(()=>{const t=O.value,s=typeof S.innerSize=="number"?S.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(pn.value||On.value)?1:1+s/100}),po=e.computed(()=>{const t=Il.value;if(t===1||t<=0)return;const s=St.value,n=Nt.value;return`translate(${s}, ${n}) scale(${t}) translate(${-s}, ${-n})`}),Bl=e.ref(0),zl=e.computed(()=>`semi-radial-fill-clip-${S.chartId}`),En=e.computed(()=>ge.value==="semi-radial"),Zn=e.computed(()=>En.value&&x.value&&!Gn.value),Wn=e.computed(()=>En.value&&x.value&&!Gn.value&&k.value==="fill"),Ml=e.computed(()=>{const t=Zn.value?Bl.value:1,s=St.value,n=Nt.value,i=Pt.value,p=st.value,g=Math.PI,E=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;const b=s+p*Math.cos(g),L=n+p*Math.sin(g),T=s+p*Math.cos(E),H=n+p*Math.sin(E),M=s+i*Math.cos(E),G=n+i*Math.sin(E),ce=s+i*Math.cos(g),Ee=n+i*Math.sin(g),ee=t>.5?1:0;return`M ${s} ${n} L ${b} ${L} A ${p} ${p} 0 ${ee} 1 ${T} ${H} L ${M} ${G} A ${i} ${i} 0 ${ee} 1 ${ce} ${Ee} Z`}),qt=e.computed(()=>{if(!(!En.value||!Zn.value)&&!Wn.value)return`url(#${zl.value})`}),fo=t=>{if(!(!Wn.value||t!==0))return`url(#${zl.value})`},cl=e.ref(0),ul=e.computed(()=>`radial-reveal-clip-${S.chartId}`),gn=e.computed(()=>ge.value==="radial"),bl=e.computed(()=>{const t=gn.value?cl.value:1,s=St.value,n=Nt.value,i=Math.max(st.value*1.5,Ne.value,pt.value);if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;if(t>=1){const M=s-i,G=s+i;return`M ${M} ${n} A ${i} ${i} 0 0 1 ${G} ${n} A ${i} ${i} 0 0 1 ${M} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,E=s+i*Math.cos(p),b=n+i*Math.sin(p),L=s+i*Math.cos(g),T=n+i*Math.sin(g),H=t>=.5?1:0;return`M ${s} ${n} L ${E} ${b} A ${i} ${i} 0 ${H} 1 ${L} ${T} Z`}),gl=e.computed(()=>{if(qt.value)return qt.value;if(gn.value)return`url(#${ul.value})`});let qn=null;const _o=()=>{if(!Zn.value)return;Bl.value=0;const t=V.value,s=performance.now(),n=i=>{const p=i-s,g=Math.min(1,p/t);Bl.value=El(Y.value,g),g<1&&(qn=requestAnimationFrame(n))};qn=requestAnimationFrame(n)},vo=e.computed(()=>O.value?.bubbles?.minSize||8),_l=e.computed(()=>O.value?.bubbles?.maxSize||50),eo=e.computed(()=>O.value?.bubbles?.opacity||.7),wl=(t,s)=>{const n=[15,20,25,18,22],i=n[t%n.length]||20,p=1+Math.sin(s*.5)*.2;return Math.max(5,i*p)},go=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},$o=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},nl=e.computed(()=>S.series),Un=e.computed(()=>S.series.filter((t,s)=>!Rt.value.has(s))),Xn="auto",Ot=e.computed(()=>{if(Wt.value)return To();if(!Un.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,n=0;Un.value.forEach(b=>{b.data&&b.data.length&&(n=Math.max(n,b.data.length-1),b.data.forEach(L=>{typeof L=="number"&&(t=Math.min(t,L),s=Math.max(s,L))}))}),S.categories.length>0&&(n=Math.max(n,S.categories.length-1)),t===1/0&&(t=0,s=100);const i=xt.value,p=Ke.value;let g,E;if(i===Xn){const b=s-t,L=b>0?b*.1:1;g=Math.max(0,t-L)}else if(typeof i=="number")g=i;else{const b=s-t,L=b>0?b*.1:1;g=Math.max(0,t-L)}if(p===Xn){const b=s-t,L=b>0?b*.1:2;E=s+L}else if(typeof p=="number")E=p;else{const b=s-t,L=b>0?b*.1:2;E=s+L}return{minX:0,maxX:n,minY:g,maxY:E}}),To=()=>{if(!Un.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,i=-1/0,p=1/0,g=-1/0,E=!1;if(Un.value.forEach((ce,Ee)=>{ce?.data?.length&&ce.data.forEach((ee,pe)=>{let ye,oe,Oe;if(typeof ee=="object"&&ee!==null&&!Array.isArray(ee))ye=typeof ee.x=="number"?ee.x:pe,oe=typeof ee.y=="number"?ee.y:0,Oe=typeof ee.size=="number"?ee.size:20;else if(Array.isArray(ee)&&ee.length>=3)ye=typeof ee[0]=="number"?ee[0]:pe,oe=typeof ee[1]=="number"?ee[1]:0,Oe=typeof ee[2]=="number"?ee[2]:20;else if(typeof ee=="number")ye=pe,oe=ee,Oe=wl(Ee,pe);else return;isFinite(ye)&&isFinite(oe)&&isFinite(Oe)&&(t=Math.min(t,ye),s=Math.max(s,ye),n=Math.min(n,oe),i=Math.max(i,oe),p=Math.min(p,Oe),g=Math.max(g,Oe),E=!0)})}),!E)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,S.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const b=s-t,L=i-n;let T,H,M,G;return Ge.value!==null?T=Ge.value:T=t-b*.1,Zt.value!==null?H=Zt.value:H=s+b*.1,xt.value!==null&&typeof xt.value=="number"?M=xt.value:M=Math.max(0,n-L*.1),Ke.value!==null&&typeof Ke.value=="number"?G=Ke.value:G=i+L*.1,{minX:T,maxX:H,minY:M,maxY:G,minSize:p,maxSize:g}},Ut=t=>{if(Wt.value){const{minX:b,maxX:L}=Ot.value,T=L-b||1;return F.value.left+(t-b)/T*F.value.width}const{minX:s,maxX:n}=Ot.value,i=n-s;if(n===0||i===0)return F.value.left+F.value.width/2;const p=i/Z.value.scale,g=s-Z.value.offsetX/F.value.width*i,E=(t-g)/p;return F.value.left+E*F.value.width},Qt=t=>{const{minY:s,maxY:n}=Ot.value,i=n-s||1;return F.value.bottom-(t-s)/i*F.value.height},ho=t=>{if(!Wt.value)return ot.value||4;const{maxSize:s}=Ot.value,n=Math.max(1,s),i=Math.min(1,Math.max(0,t/n));return vo.value+i*(_l.value-vo.value)},Lo=e.computed(()=>Co.value.map(t=>({y:t.y}))),Pl=e.computed(()=>{if(Wt.value)return yo();if(ge.value==="bar"){if(Gt.value){const be=[],{minY:we,maxY:De}=Ot.value,Ae=5,Ct=De-we||1;for(let kt=0;kt<=Ae;kt++){const Vn=we+Ct*(kt/Ae),Yt=il(Vn);be.push({x:Yt,y:F.value.bottom+20,text:un(Math.round(Vn))})}return be}const Ee=[],{maxX:ee}=Ot.value,pe=ee+1,ye=5,Oe=(F.value.width-ye*2)/pe;for(let be=0;be<=ee;be++){const we=F.value.left+ye+(be+.5)*Oe;Ee.push({x:we,y:F.value.bottom+20,text:S.categories[be]||z("chart.fallback.item",{number:be+1})})}return Ee}const t=[],{minX:s,maxX:n}=Ot.value,i=n-s||1,p=i/Z.value.scale,g=s-Z.value.offsetX/F.value.width*i,E=g+p,b=Math.max(0,Math.floor(g-2)),L=Math.min(n,Math.ceil(E+2)),T=L-b,H=F.value.width,G=Math.floor(H/60);let ce=1;T>G&&(ce=Math.ceil(T/G));for(let Ee=b;Ee<=L;Ee+=ce)if(Ee>=0&&Ee<=n){const ee=Ut(Ee);ee>=F.value.left-100&&ee<=F.value.right+100&&t.push({x:ee,y:F.value.bottom+20,text:S.categories[Ee]||`Item ${Ee+1}`})}return t}),yo=()=>{const t=[],{minX:s,maxX:n}=Ot.value,i=n-s||1,p=Math.min(8,Math.max(4,Math.floor(F.value.width/80)));for(let g=0;g<=p;g++){const E=s+i*g/p,b=Ut(E);if(b>=F.value.left-10&&b<=F.value.right+10){const L=Math.round(E),T=S.categories?.[L];t.push({x:b,y:F.value.bottom+20,text:T||(Number.isInteger(E)?E.toString():E.toFixed(1))})}}return t},Co=e.computed(()=>{if(Gt.value){const p=[],{maxX:g}=Ot.value;for(let E=0;E<=g;E++)p.push({x:F.value.left-10,y:vl(E),text:S.categories[E]||`Item ${E+1}`});return p}const t=[],{minY:s,maxY:n}=Ot.value,i=5;for(let p=0;p<=i;p++){const g=s+(n-s)*(p/i),E=Math.round(g);t.push({x:F.value.left-10,y:Qt(g),text:un(E)})}return t}),Lt=t=>{const s=re.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]},dl=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let n=0,i=0,p=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,i=Number(g[2])/255,p=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,i=Number(b[2])/255,p=Number(b[3])/255;else{const L=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(L){let T=L[1];T.length===3&&(T=T[0]+T[0]+T[1]+T[1]+T[2]+T[2]),n=parseInt(T.slice(0,2),16)/255,i=parseInt(T.slice(2,4),16)/255,p=parseInt(T.slice(4,6),16)/255}else if(typeof document<"u"){const T=document.createElement("span");T.style.color=s,T.style.display="none",document.body.appendChild(T);const H=getComputedStyle(T).color;document.body.removeChild(T);const M=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(M)n=Number(M[1])/255,i=Number(M[2])/255,p=Number(M[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},$l=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)),E=Math.max(0,Math.floor(Number(n[2])*.65)),b=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${E}, ${b})`}const i=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),E=Math.max(0,Math.floor(Number(i[2])*.65)),b=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${E}, ${b}, ${i[4]})`}const p=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const E=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))),L=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[E,b,L].map(T=>T.toString(16).padStart(2,"0")).join("")}`}return s},Ol=(t,s)=>{const i=O.value?.stroke?.color;return i==null?$l(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??$l(s):$l(s)},to=t=>{let s=0;for(let n=1;n<t.length;n++){const i=t[n].x-t[n-1].x,p=t[n].y-t[n-1].y;s+=Math.sqrt(i*i+p*p)}return s},ko=e.computed(()=>ge.value==="line"||Dn.value?(Dn.value?S.series.filter(s=>(s.type||ge.value)==="line"):nl.value).map((s,n)=>{const i=S.series.findIndex(M=>M===s),p=[];let g=[];s.data.forEach((M,G)=>{M==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:Gt.value?il(M):Ut(G),y:Gt.value?vl(G):Qt(M),index:G})}),g.length>0&&p.push(g);let E="";p.forEach(M=>{if(M.length>0){let G="";X.value?G=Jl(M):G=`M ${M[0].x} ${M[0].y}`+M.slice(1).map(ce=>` L ${ce.x} ${ce.y}`).join(""),E+=(E?" ":"")+G}});const b=p.reduce((M,G)=>M+to(G),0),L=Rt.value.has(i),T=Ce.value===i,H=Ce.value!==null&&Ce.value!==i;return{path:E,color:Lt(i),pathLength:b,seriesIndex:i,animationDelay:n*xe.value,isHighlighted:T,isDimmed:H,isHidden:L}}):[]),bo=e.computed(()=>{if(!(ge.value==="line"||Dn.value))return[];const t=Dn.value?S.series.filter(n=>(n.type||ge.value)==="line"):nl.value,s=[];return t.forEach((n,i)=>{const p=S.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const E=n.data[g];if(E!=null){let b=-1,L=0;for(let T=g+1;T<n.data.length;T++){const H=n.data[T];if(H==null)L++;else{b=T;break}}if(L>0&&b!==-1){const T=n.data[b],H=Gt.value?il(E):Ut(g),M=Gt.value?vl(g):Qt(E),G=Gt.value?il(T):Ut(b),ce=Gt.value?vl(b):Qt(T),Ee=Rt.value.has(p),ee=Ce.value===p,pe=Ce.value!==null&&Ce.value!==p;s.push({path:`M ${H} ${M} L ${G} ${ce}`,color:Lt(p),seriesIndex:p,animationDelay:i*xe.value,isHighlighted:ee,isDimmed:pe,isHidden:Ee,gapSize:L}),g=b-1}}}}),s}),Zl=e.computed(()=>ge.value==="line"||Dn.value?!x.value||Gn.value||yt.value.hasAnimated?[]:(Dn.value?S.series.filter(s=>(s.type||ge.value)==="line"):nl.value).map((s,n)=>{const i=S.series.findIndex(L=>L===s);let p="",g=null;s.data.forEach((L,T)=>{if(L!=null){const H={x:Gt.value?il(L):Ut(T),y:Gt.value?vl(T):Qt(L)};g===null?p+=`M ${H.x} ${H.y}`:p+=` L ${H.x} ${H.y}`,g=H}else if(g!==null){const H=s.data.findIndex((M,G)=>G>T&&M!==null&&M!==void 0);if(H!==-1){const M={x:Gt.value?il(s.data[H]):Ut(H),y:Gt.value?vl(H):Qt(s.data[H])};p+=` L ${M.x} ${M.y}`,g=M}}});const E=s.data.map((L,T)=>L==null?null:{x:Gt.value?il(L):Ut(T),y:Gt.value?vl(T):Qt(L)}).filter(L=>L!==null),b=to(E);return{path:p,pathLength:b,color:Lt(i),animationDelay:n*xe.value,seriesIndex:i}}):[]),Rn=e.computed(()=>{if(ge.value!=="line")return[];const t=[];return nl.value.forEach((s,n)=>{const i=Ce.value===n,p=Ce.value!==null&&Ce.value!==n,g=Rt.value.has(n);s.data.forEach((E,b)=>{E!=null&&t.push({x:Ut(b),y:Qt(E),color:Lt(n),value:E,label:S.categories[b]||b.toString(),seriesName:s.name,categoryIndex:b,dataIndex:b,animationDelay:(n*s.data.length+b)*(xe.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),Ho=e.computed(()=>{if(!Dn.value)return[];const t=[];return S.series.filter(n=>(n.type||ge.value)==="line").forEach((n,i)=>{const p=S.series.findIndex(L=>L===n),g=Ce.value===p,E=Ce.value!==null&&Ce.value!==p,b=Rt.value.has(p);n.data.forEach((L,T)=>{L!=null&&t.push({x:Ut(T),y:Qt(L),color:Lt(p),value:L,label:S.categories[T]||T.toString(),seriesName:n.name,categoryIndex:T,dataIndex:T,animationDelay:(i*n.data.length+T)*(xe.value/8),isHighlighted:g,isDimmed:E,isHidden:b})})}),t}),Yn=e.computed(()=>{if(!Wt.value)return[];const t=[];return nl.value.forEach((s,n)=>{if(!s?.data?.length)return;const i=Ce.value,p=i!==null&&i===n,g=i!==null&&i!==n,E=Rt.value.has(n);s.data.forEach((b,L)=>{let T,H,M,G,ce;if(typeof b=="object"&&b!==null&&!Array.isArray(b))T=typeof b.x=="number"?b.x:L,H=typeof b.y=="number"?b.y:0,M=typeof b.size=="number"?b.size:20,G=b.label||S.categories?.[L]||`Point ${L+1}`,ce=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)T=typeof b[0]=="number"?b[0]:L,H=typeof b[1]=="number"?b[1]:0,M=typeof b[2]=="number"?b[2]:20,G=b[3]||S.categories?.[L]||`Point ${L+1}`,ce=b[4];else if(typeof b=="number")T=L,H=b,M=wl(n,L),G=S.categories?.[L]||`Point ${L+1}`;else return;!isFinite(T)||!isFinite(H)||!isFinite(M)||t.push({x:Ut(T),y:Qt(H),radius:ho(M),originalX:T,originalY:H,originalSize:M,color:Lt(n),seriesName:s.name||`Series ${n+1}`,label:G,imageUrl:ce,seriesIndex:n,dataIndex:L,categoryIndex:Math.round(T),isHighlighted:p,isDimmed:g,isHidden:E,opacity:eo.value})})}),t}),Tl=e.computed(()=>ge.value!=="area"?[]:nl.value.map((t,s)=>{const n=[];let i=[];if(t.data.forEach((M,G)=>{M==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:Ut(G),y:Qt(M),index:G})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:Lt(s),isHidden:Rt.value.has(s)};const p=F.value.bottom+1;let g="",E="";n.forEach((M,G)=>{if(M.length===0)return;let ce=`M ${M[0].x} ${M[0].y}`;X.value&&M.length>1?ce=Jl(M):M.slice(1).forEach(ee=>{ce+=` L ${ee.x} ${ee.y}`}),g+=(g?" ":"")+ce;let Ee=`M ${M[0].x} ${p}`;if(Ee+=` L ${M[0].x} ${M[0].y}`,X.value&&M.length>1){const ee=Jl(M),pe=ee.substring(ee.indexOf("C")||ee.indexOf("Q")||ee.indexOf("L"));pe?Ee+=" "+pe:M.slice(1).forEach(ye=>{Ee+=` L ${ye.x} ${ye.y}`})}else M.slice(1).forEach(ee=>{Ee+=` L ${ee.x} ${ee.y}`});Ee+=` L ${M[M.length-1].x} ${p} Z`,E+=(E?" ":"")+Ee});const b=Ce.value===s,L=Ce.value!==null&&Ce.value!==s,T=Rt.value.has(s),H=n.reduce((M,G)=>M+to(G),0);return{linePath:g,areaPath:E,color:Lt(s),pathLength:H,isHighlighted:b,isDimmed:L,isHidden:T}})),wo=e.computed(()=>{if(!(["bar"].includes(ge.value)||Dn.value))return[];const t=[],{maxX:s}=Ot.value,n=Dn.value?S.series.filter(p=>(p.type||ge.value)==="bar"):nl.value,i=n.length;if(Gt.value){const p=s+1,E=F.value.height/p,b=E*(2/3),L=Math.min(4,b/i*.15),T=b-(i-1)*L,H=Math.max(4,T/i);n.forEach((M,G)=>{const ce=S.series.findIndex(ye=>ye===M),Ee=Ce.value===ce,ee=Ce.value!==null&&Ce.value!==ce,pe=Rt.value.has(ce);M.data.forEach((ye,oe)=>{if(ye==null||typeof ye!="number"||!isFinite(ye))return;const we=F.value.top+(oe+.5)*E-b/2+G*(H+L),De=F.value.left,Ae=Math.abs(il(ye)-F.value.left);let Ct="";if(X.value&&Ae>0){const kt=Math.min(Q.value,H/2,Ae/2);Ct=[`M ${De} ${we}`,`L ${De+Ae-kt} ${we}`,`Q ${De+Ae} ${we} ${De+Ae} ${we+kt}`,`L ${De+Ae} ${we+H-kt}`,`Q ${De+Ae} ${we+H} ${De+Ae-kt} ${we+H}`,`L ${De} ${we+H}`,"Z"].join(" ")}t.push({x:De,y:we,width:Ae,height:H,color:Lt(i===1?oe:ce),value:ye,label:S.categories[oe]||oe.toString(),seriesName:M.name,animationDelay:(G*n.length+oe)*(xe.value/4),isHighlighted:Ee,isDimmed:ee,isHidden:pe,barPath:Ct,isSmooth:X.value&&Ae>0})})})}else{const p=s+1,E=F.value.width/p,b=E*.8,L=b/i,T=L*.05,H=L-T;n.forEach((M,G)=>{const ce=S.series.findIndex(ye=>ye===M),Ee=Ce.value===ce,ee=Ce.value!==null&&Ce.value!==ce,pe=Rt.value.has(ce);M.data.forEach((ye,oe)=>{if(ye==null||typeof ye!="number"||!isFinite(ye))return;const we=F.value.left+(oe+.5)*E-b/2+G*L+T/2,De=Qt(Math.max(0,ye)),Ae=Math.abs(Qt(0)-Qt(ye));let Ct="";if(X.value&&Ae>0){const kt=Math.min(Q.value,H/2,Ae/2);Ct=[`M ${we} ${De+Ae}`,`L ${we} ${De+kt}`,`Q ${we} ${De} ${we+kt} ${De}`,`L ${we+H-kt} ${De}`,`Q ${we+H} ${De} ${we+H} ${De+kt}`,`L ${we+H} ${De+Ae}`,"Z"].join(" ")}t.push({x:we,y:De,width:H,height:Ae,color:Lt(i===1?oe:ce),value:ye,label:S.categories[oe]||oe.toString(),seriesName:M.name,animationDelay:(G*n.length+oe)*(xe.value/4),isHighlighted:Ee,isDimmed:ee,isHidden:pe,barPath:Ct,isSmooth:X.value&&Ae>0})})})}return t}),ml=e.computed(()=>{if(!pn.value)return[];const t=nl.value.map((g,E)=>({series:g,originalIndex:E})).filter(({originalIndex:g})=>!Rt.value.has(g));if(t.length===0)return[];let s=ge.value==="semi-radial"?Math.PI:-Math.PI/2;const n=ge.value==="semi-radial"?Math.PI:Math.PI*2,i=[];if(t.length===1){const{series:g,originalIndex:E}=t[0],b=g.data[0]||0,L=s,T=s+n-.001,H=L+n/2,M=St.value+Math.cos(L)*Pt.value,G=Nt.value+Math.sin(L)*Pt.value,ce=St.value+Math.cos(T)*Pt.value,Ee=Nt.value+Math.sin(T)*Pt.value,ee=St.value+Math.cos(T)*st.value,pe=Nt.value+Math.sin(T)*st.value,ye=St.value+Math.cos(L)*st.value,oe=Nt.value+Math.sin(L)*st.value,Oe=1,be=[`M ${M} ${G}`,`A ${Pt.value} ${Pt.value} 0 ${Oe} 1 ${ce} ${Ee}`,`L ${ee} ${pe}`,`A ${st.value} ${st.value} 0 ${Oe} 0 ${ye} ${oe}`,"Z"].join(" "),we=Lt(E);return i.push({path:be,color:we,strokeWidth:$t.value,strokeColor:Ol(0,we),value:b,seriesName:g.name,opacity:.8,isHighlighted:Ce.value===E,isDimmed:!1,isHidden:!1,startAngle:L,endAngle:T,midAngle:H}),i}if(Wn.value&&t.length===2){const g=t[0],E=t[1],b=Math.min(100,Math.max(0,g.series.data[0]||0)),L=b/100*n,T=(H,M,G,ce,Ee)=>{const ee=H+(M-H)/2,pe=M-H,ye=St.value+Math.cos(H)*Pt.value,oe=Nt.value+Math.sin(H)*Pt.value,Oe=St.value+Math.cos(M)*Pt.value,be=Nt.value+Math.sin(M)*Pt.value,we=St.value+Math.cos(M)*st.value,De=Nt.value+Math.sin(M)*st.value,Ae=St.value+Math.cos(H)*st.value,Ct=Nt.value+Math.sin(H)*st.value,kt=pe>Math.PI?1:0,Vn=[`M ${ye} ${oe}`,`A ${Pt.value} ${Pt.value} 0 ${kt} 1 ${Oe} ${be}`,`L ${we} ${De}`,`A ${st.value} ${st.value} 0 ${kt} 0 ${Ae} ${Ct}`,"Z"].join(" "),Yt=Lt(ce);return{path:Vn,color:Yt,strokeWidth:$t.value,strokeColor:Ol(i.length,Yt),value:Ee,seriesName:G.name,opacity:.8,isHighlighted:Ce.value===ce,isDimmed:Ce.value!==null&&Ce.value!==ce,isHidden:!1,startAngle:H,endAngle:M,midAngle:ee}};return i.push(T(s,s+L,g.series,g.originalIndex,b)),i.push(T(s,s+n,E.series,E.originalIndex,100)),i}const p=t.reduce((g,{series:E})=>g+(E.data[0]||0),0);return p===0?[]:(t.forEach(({series:g,originalIndex:E})=>{const b=g.data[0]||0,L=b/p*n,T=s,H=s+L,M=T+L/2,G=St.value+Math.cos(T)*Pt.value,ce=Nt.value+Math.sin(T)*Pt.value,Ee=St.value+Math.cos(H)*Pt.value,ee=Nt.value+Math.sin(H)*Pt.value,pe=St.value+Math.cos(H)*st.value,ye=Nt.value+Math.sin(H)*st.value,oe=St.value+Math.cos(T)*st.value,Oe=Nt.value+Math.sin(T)*st.value,be=L>Math.PI?1:0,we=[`M ${G} ${ce}`,`A ${Pt.value} ${Pt.value} 0 ${be} 1 ${Ee} ${ee}`,`L ${pe} ${ye}`,`A ${st.value} ${st.value} 0 ${be} 0 ${oe} ${Oe}`,"Z"].join(" "),De=Lt(E);i.push({path:we,color:De,strokeWidth:$t.value,strokeColor:Ol(i.length,De),value:b,seriesName:g.name,opacity:.8,isHighlighted:Ce.value===E,isDimmed:Ce.value!==null&&Ce.value!==E,isHidden:!1,startAngle:T,endAngle:H,midAngle:M}),s=H}),i)}),xo=e.computed(()=>{const t=ml.value;return Wn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,n)=>({segment:s,originalIndex:n}))}),o=e.computed(()=>{if(!Nn.value||!pn.value)return[];const t=nn.value,s=Hn.value,n=Cn.value,i=dn.value,p=15,g=t*1.3,E=.55,b=(M,G)=>{const ce=St.value+Math.cos(M.midAngle)*st.value,Ee=Nt.value+Math.sin(M.midAngle)*st.value,ee=St.value+Math.cos(M.midAngle)*(st.value+s),pe=Nt.value+Math.sin(M.midAngle)*(st.value+s),oe=ee+n*(G?1:-1),Oe=G?ee+p:ee-p,be=pe-i,we=`${M.seriesName}: ${un(M.value)}`,De=we.length*t*E;return{pointerStartX:ce,pointerStartY:Ee,pointerEndX:ee,pointerEndY:pe,horizontalEndX:oe,horizontalEndY:pe,textX:Oe,textY:be,text:we,textWidth:De,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(ee-ce,pe-Ee),horizontalLineLength:Math.hypot(oe-ee,0)}},L=(M,G)=>{const ce=Math.abs(M.textY-G.textY)<g,Ee=M.isRightSide?M.textX:M.textX-M.textWidth,ee=M.isRightSide?M.textX+M.textWidth:M.textX,pe=G.isRightSide?G.textX:G.textX-G.textWidth,ye=G.isRightSide?G.textX+G.textWidth:G.textX,oe=Ee<ye&&pe<ee;return ce&&oe},T=ml.value.filter(M=>!M.isHidden),H=[];for(let M=0;M<T.length;M++){const G=T[M];let ce=Math.cos(G.midAngle)>=0;if(M>0){const ee=H[M-1],pe=b(G,ce);L(ee,pe)&&(ce=!ce)}const Ee=b(G,ce);H.push({...Ee,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return H}),l=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||eo.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},a=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},r=(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:S.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},c=(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(" ")},d=(t,s)=>{if(!t||(s.stopPropagation(),Ll.value=!0,Ce.value=t.seriesIndex,Pe.value.show=!1,!_e.value))return;const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const E=200,b=120;p+E>Ne.value&&(p=s.clientX-i.left-E-10),g+b>i.height&&(g=s.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);const L=An.value,T=fl.value,H=L.map(M=>{const G=T[M]||M,ce=u(M,t);return ce?{seriesName:t.seriesName,label:t.label,value:`${G}: ${ce}`,color:t.color}:null}).filter(Boolean);Xe.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:H,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 i=Vl.value[t];if(typeof i=="function")return i(n,s);if(typeof n=="number"){const p=n.toFixed(1);return an.value?p+an.value:p}return n?.toString()||""},m=()=>{if(!Wt.value||!Pe.value.data||Pe.value.data.length===0)return"Bubbles";const t=[],s=new Set;return Pe.value.data.forEach(n=>{if(n.seriesName&&n.label){const i=`${n.seriesName} - ${n.label}`;s.has(i)||(t.push(i),s.add(i))}else n.seriesName&&(s.has(n.seriesName)||(t.push(n.seriesName),s.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},v=(t,s)=>{t&&(Ll.value=!1,Ce.value=null,Xe.value.show=!1,Xe.value.bubbleData=[])},h=(t,s)=>{const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),p=so(t.categoryIndex),g=t.description||t.comment||"";let E=s.clientX-i.left+15,b=s.clientY-i.top-10;const L=200,T=g?80:50;E+L>Ne.value&&(E=s.clientX-i.left-L-15),b+T>pt.value&&(b=s.clientY-i.top-T-10),E<0&&(E=10),b<0&&(b=10),jt.value={show:!0,x:E,y:b,categoryValue:p,description:g}},_=()=>{jt.value.show=!1},$=e.computed(()=>S.categories.length||Math.max(...Un.value.map(t=>t.data.length))),N=e.computed(()=>{let t=0;return Un.value.forEach(s=>{s.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),J=e.computed(()=>{const t=[],s=$.value;for(let n=0;n<s;n++){const i=n*2*Math.PI/s-Math.PI/2,p=St.value+Math.cos(i)*st.value,g=Nt.value+Math.sin(i)*st.value;t.push({x:p,y:g,angle:i,index:n})}return t}),K=e.computed(()=>{const t=[],s=$.value;return J.value.forEach((n,i)=>{const p=st.value+15,g=i*2*Math.PI/s-Math.PI/2,E=St.value+Math.cos(g)*p,b=Nt.value+Math.sin(g)*p+5;let L="middle",T="middle";Math.abs(Math.cos(g))>.5&&(L=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(T=Math.sin(g)>0?"hanging":"auto"),t.push({x:E,y:b,text:S.categories[i]||`Axis ${i+1}`,anchor:L,baseline:T})}),t}),$e=e.ref(new Set),me=(t,s,n)=>{const i=`current-${n}`,p=$e.value.has(i);return!p&&Ce.value===null?s.fillOpacity||le.value:s.isHighlighted||p?(s.fillOpacity||le.value)+.15:s.isDimmed?(s.fillOpacity||le.value)*.3:s.fillOpacity||le.value},it=e.computed(()=>{if(!On.value)return[];const t=[],s=$.value;return nl.value.forEach((n,i)=>{const p=[],g=[],E=[],b=Ce.value===i,L=Ce.value!==null&&Ce.value!==i,T=Rt.value.has(i);for(let H=0;H<s;H++){const M=n.data[H]||0,ce=M/N.value*st.value,Ee=H*2*Math.PI/s-Math.PI/2,ee=St.value+Math.cos(Ee)*ce,pe=Nt.value+Math.sin(Ee)*ce;p.push(`${ee},${pe}`),g.push({x:ee,y:pe}),E.push({x:ee,y:pe,value:M,label:S.categories[H]||`Axis ${H+1}`,seriesName:n.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:E,color:Lt(i),fillOpacity:le.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:b,isDimmed:L,isHidden:T,seriesIndex:i})}),t}),ln=(t,s)=>{if(!s||s.length<3)return!1;let n=!1;for(let i=0,p=s.length-1;i<s.length;p=i++){const g=s[i].x,E=s[i].y,b=s[p].x,L=s[p].y;E>t.y!=L>t.y&&t.x<(b-g)*(t.y-E)/(L-E)+g&&(n=!n)}return n},Jt=t=>{if(!On.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const n=s.getBoundingClientRect(),i=Te.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,E=it.value.filter(b=>b.isHidden?!1:ln({x:p,y:g},b.polygonPoints));if(E.length>0){E.length,Ce.value=E[0].seriesIndex;const b=t.clientX-n.left+10,L=t.clientY-n.top-10,T=200,H=50+E.length*25;let M=b,G=L;M+T>Ne.value&&(M=t.clientX-n.left-T-10),G+H>pt.value&&(G=t.clientY-n.top-H-10),M<0&&(M=10),G<0&&(G=10);const ce=E.map(Ee=>{let ee=Ee.dataPoints[0],pe=1/0;return Ee.dataPoints.forEach(ye=>{const oe=Math.sqrt(Math.pow(ye.x-p,2)+Math.pow(ye.y-g,2));oe<pe&&(pe=oe,ee=ye)}),{seriesName:Ee.seriesName,color:Ee.color,value:un(ee.value!==void 0?ee.value:Ee.value)}});Xe.value={show:!0,x:M,y:G,title:E.length===1?E[0].seriesName:"",value:"",bubbleData:[],spiderSeries:ce}}else Fn()},zt=e.computed(()=>{const t=O.value;return t.logos.map((s,n)=>{const i=S.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||Rt.value.has(s.seriesIndex))return null;let p,g;if(rn.value){let b=-1,L=null;for(let H=i.data.length-1;H>=0;H--)if(i.data[H]!==null&&i.data[H]!==void 0){b=H,L=i.data[H];break}if(b===-1||L===null)return null;const T=i.data.map((H,M)=>H==null?null:{x:Ut(M),y:Qt(H),index:M}).filter(H=>H!==null);if(t.animations.enabled&&!Gn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(yt.value.isAnimating||!yt.value.hasAnimated))if(yt.value.isAnimating){const H=yt.value.currentFrame/yt.value.totalFrames,M=El(t.animations.easing,Math.min(H,1)),G=Ko(T,M);p=G.x+(s.offsetX||0),g=G.y+(s.offsetY||0)}else p=T[0].x+(s.offsetX||0),g=T[0].y+(s.offsetY||0);else p=Ut(b)+(s.offsetX||0),g=Qt(L)+(s.offsetY||0)}else if(pn.value||On.value){const b=Math.PI*2/t.logos.length*n;p=St.value+Math.cos(b)*(st.value+30)+(s.offsetX||0),g=Nt.value+Math.sin(b)*(st.value+30)+(s.offsetY||0)}return{...s,x:p,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),en=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")},tn=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Xt=t=>{Rt.value.has(t)?Rt.value.delete(t):Rt.value.add(t)},jn=e.computed(()=>{if(!Xe.value.show&&!(fe.value&&Pe.value.show&&!Z.value.isZooming))return{display:"none"};let t,s;if(fe.value&&Pe.value.show&&!Z.value.isZooming){t=Pe.value.x+15,s=F.value.top;const n=Wt.value?200:150;t+n>Ne.value&&(t=Pe.value.x-n-15),t<0&&(t=10),s<10&&(s=10)}else t=Xe.value.x,s=Xe.value.y;return{left:t+"px",top:s+"px"}}),hn=(t,s)=>{if(!_e.value||Hl.value)return;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const E=200,b=120,L=Ne.value,T=pt.value;p+E>L&&(p=s.clientX-i.left-E-10),g+b>T&&(g=s.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&S.categories.includes(t.label)&&(H=S.categories.indexOf(t.label));const M=(Gt.value||ge.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";Xe.value={show:!0,x:p,y:g,title:M,value:un(t.value)||"",categoryIndex:H,spiderSeries:[]}},Kn=e.ref(!1),Ll=e.ref(!1),Fn=()=>{Xe.value.show=!1,Xe.value.spiderSeries=[],Xe.value.bubbleData=[],Pe.value.show=!1,Kn.value||(Ce.value=null)},Hl=e.ref(!1),xl=(t,s)=>{Hl.value=!0,Xe.value.show=!1,Pe.value.show=!1;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+15,g=s.clientY-i.top-10;const E=250;p+E>Ne.value&&(p=s.clientX-i.left-E-15),p<0&&(p=10),g<0&&(g=10),ol.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},Wl=()=>{Hl.value=!1,ol.value.show=!1},yt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),El=(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}},Gn=e.computed(()=>Le.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Qn=()=>{if(!x.value||Gn.value){yt.value.hasAnimated=!0,gn.value&&(cl.value=1);return}gn.value&&(cl.value=0),yt.value.isAnimating=!0,yt.value.currentFrame=0,yt.value.totalFrames=Math.ceil(V.value/16.67);const t=()=>{const s=yt.value.currentFrame/yt.value.totalFrames,n=El(Y.value,Math.min(s,1));ll(n),gn.value&&(cl.value=n),s<1?(yt.value.currentFrame++,yt.value.animationId=requestAnimationFrame(t)):In()};yt.value.animationId=requestAnimationFrame(t)},ll=t=>{const s=document.querySelector(".dss-custom-chart-container");s&&s.style.setProperty("--dss-animation-progress",t)},In=()=>{yt.value.isAnimating=!1,yt.value.hasAnimated=!0,gn.value&&(cl.value=1),yt.value.animationId&&(cancelAnimationFrame(yt.value.animationId),yt.value.animationId=null)},Eo=e.computed(()=>!pn.value||yt.value.hasAnimated?!0:gn.value?cl.value>=1:En.value?Bl.value>=1:!0),Po=e.computed(()=>Nn.value&&Eo.value),Vo=e.ref(!1);e.watch(Po,t=>{t?(Vo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Vo.value=!0})})):Vo.value=!1},{immediate:!0});const Xo=e.computed(()=>{if(!x.value||Gn.value||yt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${V.value}ms`,t["--dss-animation-easing"]=Yo(Y.value),t["--dss-stagger-delay"]=`${xe.value}ms`,t}),Yo=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",jo=()=>{if(!x.value||Gn.value)return"";const t=["dss-chart-animated"];return yt.value.hasAnimated||t.push(`dss-animate-${k.value}`),yt.value.hasAnimated||(pn.value&&ge.value!=="semi-radial"?t.push("dss-animate-fill"):pn.value||t.push(`dss-animate-${k.value}`)),yt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>S.series,(t,s)=>{Ye.value&&s&&yt.value.hasAnimated&&(yt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Qn(),P.value)}))},{deep:!0}),e.watch(()=>Z.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{jl()},50)}),e.watch(()=>[Z.value.scale,Z.value.offsetX],()=>{!Z.value.isZooming&&!Z.value.isDragging&&jl()},{flush:"post"}),e.watch([We,ft],([t,s])=>{Z.value.minScale=t,Z.value.maxScale=s,(Z.value.scale<t||Z.value.scale>s)&&Fl()},{immediate:!0}),e.watch(()=>S.locale,t=>{t&&t!==R.value&&(R.value=t)},{immediate:!0}),e.watch(()=>ze.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Rl)}):document.removeEventListener("click",Rl)}),e.onMounted(()=>{Ce.value=null,gn.value&&(!x.value||Gn.value)&&(cl.value=1),No(),C.value&&typeof ResizeObserver<"u"&&(ue=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(ve&&cancelAnimationFrame(ve),ve=requestAnimationFrame(()=>{ve=null;const{width:n,height:i}=s.contentRect;nt.value=Math.round(n),f.value=Math.round(i),ie.value&&(Ht.value=ie.value.offsetHeight||de)}))}),ue.observe(C.value)),x.value&&!Gn.value?ge.value==="semi-radial"?setTimeout(()=>_o(),P.value):setTimeout(()=>Qn(),P.value):(yt.value.hasAnimated=!0,ge.value==="semi-radial"&&(Bl.value=1)),document.addEventListener("mousemove",Oo),document.addEventListener("mouseup",Zo),document.addEventListener("click",mo)}),e.onUnmounted(()=>{ve&&cancelAnimationFrame(ve),ue&&C.value&&(ue.unobserve(C.value),ue.disconnect(),ue=null),yt.value.animationId&&cancelAnimationFrame(yt.value.animationId),qn&&(cancelAnimationFrame(qn),qn=null),Z.value.zoomTimeout&&clearTimeout(Z.value.zoomTimeout),document.removeEventListener("mousemove",Oo),document.removeEventListener("mouseup",Zo),document.removeEventListener("click",mo),document.removeEventListener("click",Rl)});const Oo=t=>{if(Z.value.isDragging&&Z.value.scale>1&&rn.value){Pe.value.show=!1;const s=t.clientX-Z.value.lastMouseX,{minX:n,maxX:i}=Ot.value,p=i-n||1,E=s*.8;Z.value.offsetX+=E;const b=p/Z.value.scale,L=p-b,T=0,H=-L/p*F.value.width,M=T;Z.value.offsetX=Math.max(H,Math.min(M,Z.value.offsetX)),Z.value.lastMouseX=t.clientX,Z.value.lastMouseY=t.clientY}},Zo=()=>{Z.value.isDragging&&(Z.value.isDragging=!1,setTimeout(()=>{!Z.value.isDragging&&Z.value.isZooming},100))},Ko=(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 i=0;const p=[];for(let b=1;b<n.length;b++){const L=n[b].x-n[b-1].x,T=n[b].y-n[b-1].y,H=Math.sqrt(L*L+T*T);p.push(H),i+=H}const g=i*s;let E=0;for(let b=0;b<p.length;b++){const L=E+p[b];if(g<=L){const T=(g-E)/p[b],H=n[b],M=n[b+1];return{x:H.x+(M.x-H.x)*T,y:H.y+(M.y-H.y)*T}}E=L}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",[jo(),{"dss-chart-fill-width":lt.value,"dss-chart-fill-height":je.value,"dss-chart-compact":pn.value&&!_t.value}]]),style:e.normalizeStyle({width:lt.value?"100%":Ne.value+"px",height:Re.value,...lt.value||je.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Xo.value,cursor:Mo()}),"data-chart-type":ge.value,ref_key:"containerEl",ref:C,onWheel:Ql,onMousedown:So,onMousemove:se,onMouseup:Bo,onMouseleave:mt,onDblclick:Fl,onContextmenu:e.withModifiers(et,["prevent"]),onClick:e.withModifiers(ht,["left"]),onWheelCapture:Ql},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ie},[e.createElementVNode("div",Za,[wt.value?(e.openBlock(),e.createElementBlock("div",Wa,e.toDisplayString(wt.value),1)):e.createCommentVNode("",!0),tt.value?(e.openBlock(),e.createElementBlock("div",qa,e.toDisplayString(tt.value),1)):e.createCommentVNode("",!0)]),_t.value&&(U.value==="top"||U.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ie.value==="horizontal","dss-legend-vertical":Ie.value==="vertical","dss-legend-top":U.value==="top","dss-legend-bottom":U.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Rt.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:p=>Xt(i),onMouseenter:p=>B(i),onMouseleave:W,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Lt(i)})},null,4),e.createElementVNode("span",Xa,e.toDisplayString(n.name),1)],46,Ua))),128))],2)):e.createCommentVNode("",!0),_t.value&&(U.value==="left"||U.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":U.value==="left","dss-legend-right":U.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Rt.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:p=>Xt(i),onMouseenter:p=>B(i),onMouseleave:W,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Lt(i)})},null,4),e.createElementVNode("span",ja,e.toDisplayString(n.name),1)],46,Ya))),128))],2)):e.createCommentVNode("",!0)],512),D.showAddMarkerButton&&Ue.value&&Dt.value.addMarker&&(rn.value||Wt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Sl,title:e.unref(z)("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,Ga),s[4]||(s[4]=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,Ka)):e.createCommentVNode("",!0),e.createElementVNode("div",Qa,[Wt.value&&Mt.value?(e.openBlock(),e.createElementBlock("div",Ja,"Bubble size: "+e.toDisplayString(Mt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ne.value,height:pt.value,class:"dss-chart-svg","data-smooth":X.value,"data-animated":x.value,ref_key:"svgEl",ref:Te},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",ts,[e.createElementVNode("rect",{x:0,y:F.value.top,width:Ne.value,height:F.value.height*4},null,8,ns)]),En.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:zl.value},[e.createElementVNode("path",{d:Ml.value},null,8,os)],8,ls)):e.createCommentVNode("",!0),gn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:ul.value},[e.createElementVNode("path",{d:bl.value},null,8,ss)],8,as)):e.createCommentVNode("",!0)]),rn.value||Wt.value?(e.openBlock(),e.createElementBlock("g",rs,[At.value?(e.openBlock(),e.createElementBlock("g",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:F.value.left,x2:F.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,cs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",us,[e.createElementVNode("line",{x1:F.value.left,x2:F.value.right,y1:F.value.bottom,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ds),e.createElementVNode("line",{x1:F.value.left,x2:F.value.left,y1:F.value.top,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ms)]),e.createElementVNode("g",ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(n.text),13,fs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Co.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,vs))),128)),Ft.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:F.value.left+F.value.width/2,y:F.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Ft.value),9,gs)):e.createCommentVNode("",!0),on.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:F.value.top+12+F.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${F.value.top+F.value.height/2})`},e.toDisplayString(on.value),9,hs)):e.createCommentVNode("",!0)]),Al.value.length>0?(e.openBlock(),e.createElementBlock("g",ys,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Al.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",Cs,[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>xl(n,i),onMouseleave:Wl},null,40,ks)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>xl(n,i),onMouseleave:Wl},null,40,bs)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>xl(n,i),onMouseleave:Wl},null,40,ws)):e.createCommentVNode("",!0)]),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,F.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>xl(n,i),onMouseleave:Wl},null,40,xs)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,F.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:i=>xl(n,i),onMouseleave:Wl},null,40,Es),e.createElementVNode("text",{x:n.x,y:Math.max(15,F.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,Vs)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ns,[Dn.value?(e.openBlock(),e.createElementBlock("g",Ss,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Gt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[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:p=>hn(n,p),onMouseleave:Fn},null,46,Bs)):(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:p=>hn(n,p),onMouseleave:Fn},null,46,Ms))],64))),128))],2),e.createElementVNode("g",_s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ko.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?dt.value+2:dt.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,$s))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?dt.value+2:dt.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,Ts))),128)),ot.value>0||bt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ho.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:n.isHighlighted?Se(n,ot.value)+2:Se(n,ot.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:p=>hn(n,p),onMouseleave:Fn},null,46,Ls))),128)):e.createCommentVNode("",!0)])])):ge.value==="line"?(e.openBlock(),e.createElementBlock("g",Hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":dt.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":yt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,As))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ko.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?dt.value+2:dt.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,Ds))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?dt.value+2:dt.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,Rs))),128)),ot.value>0||bt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Rn.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:n.isHighlighted?Se(n,ot.value)+2:Se(n,ot.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:p=>hn(n,p),onMouseleave:Fn},null,46,Fs))),128)):e.createCommentVNode("",!0)])):ge.value==="area"?(e.openBlock(),e.createElementBlock("g",Is,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tl.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${D.chartId}`},[e.createElementVNode("rect",{x:F.value.left-10,y:F.value.top-10,width:F.value.width+20,height:F.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${F.value.width+20}px`})},null,12,Ps)],8,zs))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?ut.value+.2:ut.value,mask:`url(#area-mask-${i}-${D.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,Os))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?dt.value+1:dt.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:`${i*xe.value}ms`})},null,14,Zs))),128))])):ge.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Gt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[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:p=>hn(n,p),onMouseleave:Fn},null,46,Ws)):(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:p=>hn(n,p),onMouseleave:Fn},null,46,qs))],64))),128))],2)):e.createCommentVNode("",!0)]),fe.value&&Pe.value.show&&!Z.value.isZooming?(e.openBlock(),e.createElementBlock("g",Us,[e.createElementVNode("line",{x1:Pe.value.x,x2:Pe.value.x,y1:F.value.top,y2:F.value.bottom,stroke:ct.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Xs),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:Pe.value.x,cy:n.y,r:ot.value+2,fill:n.color,stroke:"none",opacity:"0.9"},null,8,Ys))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Wt.value?(e.openBlock(),e.createElementBlock("g",js,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yn.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Ks,[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(c(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>d(n,p),onMouseleave:p=>v(n),onClick:p=>r(n,p)},null,42,Gs),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-${i} ${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:a(n)}),onLoad:p=>go(i),onError:p=>$o(i),onMouseenter:p=>d(n,p),onMouseleave:p=>v(n),onClick:p=>r(n,p)},null,46,Qs)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),pn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:po.value},[ge.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:St.value,cy:Nt.value,r:st.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,er)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ge.value,"clip-path":gl.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${i}`,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":fo(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:p=>hn(n.segment,p),onMouseleave:Fn},null,42,nr))),128))],8,tr),fn.value&&Eo.value?(e.openBlock(),e.createElementBlock("g",lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vn.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,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,or)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),yl.value&&(Eo.value||En.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:kl.value.x,y:kl.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Cl.value,fill:kn.value,class:"dss-radial-data-center"},e.toDisplayString(Xl.value),9,ar)):e.createCommentVNode("",!0),Po.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Vo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.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,sr),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,rr),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":nn.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,ir)],6))),128))],2)):e.createCommentVNode("",!0)],8,Js)):e.createCommentVNode("",!0),On.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:po.value},[At.value?(e.openBlock(),e.createElementBlock("g",ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:St.value,cy:Nt.value,r:n,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,dr))),128)),e.createElementVNode("g",mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:St.value-16,y:Nt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,pr),e.createElementVNode("text",{x:St.value,y:Nt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Vt(i)),9,fr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:St.value,x2:n.x,y1:Nt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,vr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/$.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/$.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:`${i*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,hr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Jt,onMouseleave:Fn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(it.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":me("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?dt.value+1:dt.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:`${i*xe.value}ms`,transition:"all 0.2s ease"})},null,14,yr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:p.x,cy:p.y,r:n.isHighlighted?ot.value+1:ot.value>0?ot.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:`${i*xe.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:E=>hn(p,E),onMouseleave:Fn},null,46,Cr))),128))]))),128))],32)],8,cr)):e.createCommentVNode("",!0),e.createElementVNode("g",kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:n.width/2,fill:Lt(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt.value,(n,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:p=>en(i),onError:p=>tn(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,wr))),128))])],8,es))]),A.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ne.value+"px",height:pt.value+"px",backgroundImage:`url('${sn.value}')`,backgroundRepeat:"no-repeat",...Je.value,opacity:q.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hl.value,(n,i)=>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:yn.value+"px",height:yn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>Sn(n),["stop"]),onMouseenter:p=>h(n,p),onMouseleave:_},[e.createElementVNode("img",{src:Yl(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Er)],44,xr)),[[e.vShow,zn.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",Vr,e.toDisplayString(jt.value.categoryValue),1),jt.value.description?(e.openBlock(),e.createElementBlock("div",Nr,e.toDisplayString(jt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),_e.value&&(Xe.value.show||fe.value&&Pe.value.show&&!Z.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":fe.value&&Pe.value.show&&!Z.value.isZooming}]),style:e.normalizeStyle(jn.value)},[!fe.value||!Pe.value.show||Z.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[On.value&&Xe.value.spiderSeries&&Xe.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Sr,[Xe.value.title?(e.openBlock(),e.createElementBlock("div",Br,e.toDisplayString(Xe.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value.spiderSeries,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Mr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",_r,e.toDisplayString(n.value),1)]))),128))])):Wt.value&&Xe.value.bubbleData&&Xe.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",$r,[Xe.value.title?(e.openBlock(),e.createElementBlock("div",Tr,e.toDisplayString(Xe.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value.bubbleData,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Hr,[e.createElementVNode("div",Ar,e.toDisplayString(Xe.value.title),1),e.createElementVNode("div",Dr,e.toDisplayString(Xe.value.value),1)])),Xe.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Fe(Xe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Rr,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Fr,e.toDisplayString(e.unref(z)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe(Xe.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",Ir,[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,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",zr,[e.createElementVNode("div",Pr,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Fe(Xe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Or,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Zr,e.toDisplayString(e.unref(z)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe(Xe.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Wr,[e.createElementVNode("div",qr,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Ur,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",Xr,[e.createElementVNode("div",Yr,e.toDisplayString(Wt.value?m():D.categories[Pe.value.categoryIndex]||`Category ${Pe.value.categoryIndex+1}`),1),Wt.value?(e.openBlock(),e.createElementBlock("div",jr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Pe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Kr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Gr,e.toDisplayString(un(n.value)),1)]))),128))]),Fe(Pe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Qr,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Jr,e.toDisplayString(e.unref(z)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe(Pe.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",ei,[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,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",ti,[e.createElementVNode("div",ni,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Fe(Pe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",li,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",oi,e.toDisplayString(e.unref(z)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe(Pe.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",ai,[e.createElementVNode("div",si,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",ri,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),rn.value&&Et.value&&Z.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Fl},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(Z.value.scale*100))+"% "+e.toDisplayString(e.unref(z)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Oa),ze.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ze.value.x+"px",top:ze.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[Dt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Gl},e.toDisplayString(e.unref(z)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Dt.value.addMarker&&(Dt.value.downloadSvg||Dt.value.downloadPng||Dt.value.downloadCsv||$n.value.length>0)?(e.openBlock(),e.createElementBlock("div",ii)):e.createCommentVNode("",!0),Dt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:tl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Dt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:sl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Dt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:rl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),$n.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Dt.value.downloadSvg||Dt.value.downloadPng||Dt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",ci)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($n.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",ui)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(It(n)),style:e.normalizeStyle(bn(n)),onClick:p=>Bn(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:mn(n),class:"dss-custom-menu-content"},null,8,mi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",pi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,di)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),he.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:al},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",fi,[e.createElementVNode("h3",null,e.toDisplayString(y.value?e.unref(z)("chart.modalMarker.viewMarker"):w.value?e.unref(z)("chart.modalMarker.editMarker"):e.unref(z)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:al},"×")]),e.createElementVNode("div",vi,[e.createElementVNode("div",gi,[e.createVNode(zo,{id:"dss-marker-date",mode:"single",modelValue:he.value.date,"onUpdate:modelValue":s[1]||(s[1]=n=>he.value.date=n),"min-date":Mn.value,"max-date":Dl.value,disabled:y.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",hi,[e.createElementVNode("label",yi,e.toDisplayString(e.unref(z)("chart.modalMarker.description")),1),y.value?(e.openBlock(),e.createElementBlock("div",Ci,e.toDisplayString(he.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=n=>he.value.description=n),placeholder:e.unref(z)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,ki)),[[e.vModelText,he.value.description]])])]),e.createElementVNode("div",bi,[e.createElementVNode("div",wi,[w.value&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:co},e.toDisplayString(e.unref(z)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",xi,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:al},e.toDisplayString(y.value?e.unref(z)("chart.modalMarker.close"):e.unref(z)("chart.modalMarker.cancel")),1),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:io,disabled:!(he.value.description&&he.value.description.length)},e.toDisplayString(w.value?e.unref(z)("chart.modalMarker.save"):e.unref(z)("chart.contextMenu.addMarker")),9,Ei))])])])])):e.createCommentVNode("",!0)],64))}}),Si={class:"dss-modal-title"},Bi={class:"dss-modal-actions"},Ao={__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(D,{emit:ke}){const z=D,R=ke,Me=e.ref(null),C=e.ref(null),Te=e.computed(()=>{const S={"max-width":z.width};return z.height!=="auto"&&(S.height=z.height,S["min-height"]="0"),S}),ie=e.computed(()=>({}));function nt(){R("close-modal")}function f(){z.backDrop&&!Me.value&&R("close-modal")}function ue(S){S.target.tagName==="INPUT"&&(Me.value=S.target.tagName)}function ve(){setTimeout(()=>{Me.value=null},300)}function de(){const S=document.body,ae=document.documentElement;C.value={bodyOverflow:S.style.overflow,bodyPosition:S.style.position,bodyTop:S.style.top,bodyWidth:S.style.width,htmlOverflow:ae.style.overflow,scrollY:window.scrollY},S.style.overflow="hidden",S.style.position="fixed",S.style.top=`-${C.value.scrollY}px`,S.style.width="100%",S.style.left="0",ae.style.overflow="hidden"}function te(){if(!C.value)return;const S=document.body,ae=document.documentElement,{bodyOverflow:Ze,bodyPosition:He,bodyTop:Ve,bodyWidth:O,htmlOverflow:lt,scrollY:je}=C.value;S.style.overflow=Ze||"",S.style.position=He||"",S.style.top=Ve||"",S.style.width=O||"",S.style.left="",ae.style.overflow=lt||"",window.scrollTo(0,je||0)}return e.watch(()=>z.showModal,S=>{if(S)de(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ae=document.getElementById("dss-modal-backdrop");ae&&(ae.addEventListener("focusin",ue),ae.addEventListener("focusout",ve))},100);else{te(),document.body.classList.remove("dss-modal-open");const ae=document.getElementById("dss-modal-backdrop");ae&&(ae.removeEventListener("focusin",ue),ae.removeEventListener("focusout",ve))}},{immediate:!0}),e.onUnmounted(()=>{z.showModal&&te()}),(S,ae)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[D.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:f},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Te.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ae[0]||(ae[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":D.headerType,"font-size":D.titleSize})},[e.createElementVNode("h1",Si,[e.renderSlot(S.$slots,"title",{},()=>[ae[1]||(ae[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(S.$slots,"title-data"),D.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:nt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(ie.value)},[e.renderSlot(S.$slots,"content",{},()=>[ae[2]||(ae[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Bi,[e.renderSlot(S.$slots,"actions")])])],4),[[e.vShow,D.showModal]])])):e.createCommentVNode("",!0)]))}},Mi={key:0,class:"dss-table-toolbar"},_i={class:"dss-table-toolbar-left"},$i=["aria-expanded"],Ti={class:"dss-pagination-select-dropdown",role:"listbox"},Li={class:"dss-table-column-visibility-label"},Hi={class:"dss-table-checkbox-wrapper"},Ai=["checked","onChange"],Di={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Ri={class:"dss-table-column-visibility-text"},Fi={class:"dss-table-toolbar-right"},Ii=["placeholder"],zi=["aria-expanded"],Pi={key:1,class:"dss-table-toolbar-extra"},Oi={class:"dss-table-thead"},Zi={key:0,class:"dss-table-th dss-table-selection-column"},Wi={key:0,class:"dss-table-checkbox-wrapper"},qi=["checked","indeterminate"],Ui={key:0,class:"dss-table-checkbox__indeterminate"},Xi={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Yi={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},ji=["onClick"],Ki={class:"dss-table-th-content"},Gi={class:"dss-table-th-text"},Qi={key:0},Ji={key:1},ec={key:2},tc=["data-filter-column-key","aria-expanded","onClick"],nc={class:"dss-table-tbody"},lc=["onClick"],oc={class:"dss-table-checkbox-wrapper"},ac=["type","name","checked","onChange"],sc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},rc={key:1,class:"dss-table-checkbox__dot"},ic=["onClick"],cc=["aria-expanded","aria-label"],uc={key:0,class:"dss-table-expansion-row"},dc=["colspan"],mc=["colspan"],pc={key:1,class:"dss-table-pagination"},fc={class:"dss-pagination-center"},vc={class:"dss-pagination-controls"},gc=["disabled","title"],hc=["disabled","title"],yc={class:"dss-pagination-pages"},Cc=["onClick"],kc={key:1,class:"dss-pagination-ellipsis"},bc=["disabled","title"],wc=["disabled","title"],xc=["aria-expanded"],Ec={class:"dss-pagination-select-dropdown",role:"listbox"},Vc=["aria-selected","onClick"],Nc={key:0,class:"dss-table-filter-row"},Sc=["value","placeholder"],Bc=["min","max","value"],Mc=["min","max","value"],_c={class:"dss-table-filter-double-range-values"},$c={key:2,class:"dss-table-filter-daterange"},Tc={class:"dss-table-filter-daterange-row"},Lc={class:"dss-table-filter-daterange-label"},Hc=["value"],Ac={class:"dss-table-filter-daterange-row"},Dc={class:"dss-table-filter-daterange-label"},Rc=["value"],Fc=["value","placeholder"],Ic={class:"dss-table-filter-list"},zc=["checked","onChange"],Pc={class:"dss-table-filter-actions"},Oc={name:"DSSTable"},Zc=Object.assign(Oc,{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:D=>typeof D=="object"&&D!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(D,{emit:ke}){const{t:z,locale:R}=no.useI18n(),Me=D,C=ke,Te={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 ie(w,y){const B=Object.assign({},w);return nt(w)&&nt(y)&&Object.keys(y).forEach(W=>{nt(y[W])?W in w?B[W]=ie(w[W],y[W]):Object.assign(B,{[W]:y[W]}):Object.assign(B,{[W]:y[W]})}),B}function nt(w){return w&&typeof w=="object"&&!Array.isArray(w)}const f=e.computed(()=>ie(Te,Me.options)),ue=e.computed(()=>{const w=f.value.table.width;return w==="auto"?null:typeof w=="number"?w:null}),ve=e.computed(()=>f.value.table.height),de=e.computed(()=>f.value.table.rowHeight??"auto"),te=e.computed(()=>({height:de.value})),S=e.computed(()=>f.value.table.expandable===!0),ae=e.computed(()=>f.value.table.truncated===!0),Ze=e.computed(()=>f.value.table.striped),He=e.computed(()=>f.value.table.bordered),Ve=e.computed(()=>f.value.table.hoverable),O=e.computed(()=>f.value.table.size),lt=e.computed(()=>f.value.table.align||"left");e.computed(()=>f.value.title.text),e.computed(()=>f.value.subtitle.text);const je=e.computed(()=>f.value.selection.enabled),Ne=e.computed(()=>f.value.selection.mode),Ht=e.computed(()=>f.value.sorting.enabled),Bt=e.computed(()=>f.value.sorting.mode),pt=e.computed(()=>f.value.pagination.enabled),Re=e.computed(()=>f.value.pagination.rows),ge=e.computed(()=>f.value.pagination.rowsPerPageOptions),gt=e.computed(()=>f.value.scrollable),wt=e.computed(()=>f.value.emptyMessage),tt=e.computed(()=>f.value.toolbar?.downloads?.pdf!==!1),Mt=e.computed(()=>f.value.toolbar?.downloads?.excel!==!1),Ft=e.computed(()=>f.value.toolbar?.search!==!1),on=e.computed(()=>tt.value||Mt.value||Ft.value||xt.value),xt=e.computed(()=>f.value.toolbar?.columnVisibility!==!1),Ke=e.ref(""),Ge=e.ref(!1),Zt=e.ref(null);let At=null;function _t(){Ge.value?(At&&(clearTimeout(At),At=null),Ge.value=!1,Ke.value="",C("search",""),Zt.value?.blur()):(Ge.value=!0,At=setTimeout(()=>{At=null,Zt.value?.focus()},80))}function U(){Ke.value||(Ge.value=!1)}function Ie(){Ke.value="",C("search",""),Zt.value?.focus()}const _e=e.computed(()=>({"dss-table-striped":Ze.value,"dss-table-bordered":He.value,"dss-table-hoverable":Ve.value,[`dss-table-${O.value}`]:O.value!=="default","dss-table-truncated":ae.value})),fe=(w,y)=>w?.field??w?.key??y,ct=e.ref(new Set);function Et(){const w=new Set;Me.columns.forEach((y,B)=>{y?.hidden!==!0&&w.add(fe(y,B))}),ct.value=w}const We=e.computed(()=>Me.columns.filter((w,y)=>ct.value.has(fe(w,y)))),ft=w=>{const y=Me.columns.findIndex(B=>B===w);return fe(w,y>=0?y:0)},dt=(w,y)=>ct.value.has(fe(w,y));function $t(w,y){const B=fe(w,y),W=new Set(ct.value);W.has(B)?W.delete(B):W.add(B),ct.value=W}const ot=e.ref(null),bt=e.ref(!1);function Se(w){ot.value&&!ot.value.contains(w.target)&&(bt.value=!1)}const ut=e.computed(()=>We.value.length+(je.value?1:0)+(S.value?1:0)),X=(w,y)=>w?.id??w?.key??y,j=e.ref(new Set),Q=e.ref(null),re=(w,y)=>j.value.has(X(w,y)),x=(w,y,B)=>{B&&B.stopPropagation();const W=X(w,y),se=new Set(j.value);se.has(W)?(se.delete(W),C("row-collapse",{data:w,index:y})):(se.add(W),C("row-expand",{data:w,index:y})),j.value=se},k=(w,y)=>{if(!ae.value)return;const B=X(w,y);Q.value!==B&&(Q.value=B)},V=e.ref(null),P=e.ref(0),Y=e.ref([]),xe=w=>{if(Bt.value==="single")return V.value===w.field?P.value:0;{const y=Y.value.find(B=>B.field===w.field);return y?y.order:0}},Ye=w=>{const y=xe(w);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},Le=e.ref({}),le=e.ref(null),Qe=e.ref(null),qe=220,Vt=e.ref(null),vt=e.computed(()=>We.value.find(w=>ft(w)===le.value)??null),Ue=e.computed(()=>{if(!vt.value||vt.value.filter!=="range")return null;const w=vt.value,y=le.value,{min:B,max:W}=I(w),se=w.filterMin??B,mt=w.filterMax??W,et=cn(y),ht=et.min??se,mn=et.max??mt,It=mt-se,bn=It===0?0:(ht-se)/It*100,Yl=It===0?100:(mn-se)/It*100;return{rangeMin:se,rangeMax:mt,currentMin:ht,currentMax:mn,minPct:bn,maxPct:Yl}}),Dt=e.ref(null),$n=e.ref("max");function Tn(w){const y=Dt.value,B=Ue.value;if(!y||!B)return;const W=y.getBoundingClientRect(),mt=(w.clientX-W.left)/W.width*100,et=(B.minPct+B.maxPct)/2;$n.value=mt<et?"min":"max"}function cn(w){return Le.value[w]??{}}function yn(w,y){Le.value={...Le.value,[w]:y}}function an(w){const y=Le.value[w];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 un(w){const y={...Le.value};delete y[w],Le.value=y,le.value=null,Qe.value=null}function zn(){if(!le.value){Qe.value=null;return}const w=Vt.value;if(!w)return;const y=w.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${le.value}"]`);if(!y)return;const B=y.getBoundingClientRect();Qe.value={top:B.bottom+6,left:Math.max(8,B.right-qe)}}const Ln=e.computed(()=>{let w=[...Me.data];const y=(Ke.value??"").trim().toLowerCase();return y&&(w=w.filter(B=>Me.columns.some(W=>{if(!W||!W.field)return!1;const se=Tt(B,W);return String(se??"").toLowerCase().includes(y)}))),We.value.forEach(B=>{const W=ft(B),se=Le.value[W];if(!se)return;const mt=B.field;if(mt){if(se.type==="string"&&se.value?.trim()){const et=se.value.trim().toLowerCase();w=w.filter(ht=>{const mn=Tt(ht,B);return String(mn??"").toLowerCase().includes(et)})}else if(se.type==="range")w=w.filter(et=>{const ht=he(et,mt),mn=Number(ht);return!(Number.isNaN(mn)||se.min!=null&&mn<se.min||se.max!=null&&mn>se.max)});else if(se.type==="dateRange"){const et=se.from?new Date(se.from).getTime():null,ht=se.to?new Date(se.to).getTime():null;w=w.filter(mn=>{const It=he(mn,mt),bn=It?new Date(It).getTime():NaN;return!(Number.isNaN(bn)||et!=null&&bn<et||ht!=null&&bn>ht)})}else if(se.type==="list"&&se.selected?.length){const et=new Set(se.selected);w=w.filter(ht=>{const mn=Tt(ht,B);return et.has(mn!=null?String(mn):"")})}}}),w});function hl(w){const y=new Set;return Me.data.forEach(B=>{const W=Tt(B,w);y.add(W!=null?String(W):"")}),Array.from(y).sort((B,W)=>String(B).localeCompare(String(W)))}function A(w,y){if(le.value===w){le.value=null,Qe.value=null;return}if(le.value=w,y?.currentTarget){const B=y.currentTarget.getBoundingClientRect();Qe.value={top:B.bottom+6,left:Math.max(8,B.right-qe)}}else zn()}function q(w,y){yn(w,{type:"string",value:y})}function I(w){const y=w.field;if(!y)return{min:0,max:100};let B=1/0,W=-1/0;return Me.data.forEach(se=>{const mt=he(se,y),et=Number(mt);Number.isNaN(et)||(B=Math.min(B,et),W=Math.max(W,et))}),{min:B===1/0?0:B,max:W===-1/0?100:W}}function ne(w,y,B){const W={...cn(w),type:"range"},se=B===""?null:Number(B),mt=se===null||Number.isNaN(se)?null:se;W[y]=mt,mt!=null&&(y==="min"&&W.max!=null&&mt>W.max&&(W.max=mt),y==="max"&&W.min!=null&&mt<W.min&&(W.min=mt)),yn(w,W)}function Be(w,y,B){const W={...cn(w),type:"dateRange"};W[y]=B||"",yn(w,W)}const Je=e.reactive({});function rt(w,y){Je[w]=y}function Fe(w){const y=ft(w),B=(Je[y]??"").trim().toLowerCase(),W=hl(w);return B?W.filter(se=>String(se).toLowerCase().includes(B)):W}function at(w,y){return(cn(w).selected??[]).includes(y!=null?String(y):"")}function sn(w,y){const W=[...cn(w).selected??[]],se=y!=null?String(y):"",mt=W.indexOf(se);mt>=0?W.splice(mt,1):W.push(se),yn(w,{type:"list",selected:W})}function Nn(w){le.value&&!w.target.closest(".dss-table-filter-wrap")&&!w.target.closest(".dss-table-filter-dropdown")&&(le.value=null,Qe.value=null)}function nn(){zn()}const Hn=w=>{if(!(w.sortable===!1||!Ht.value))if(Bt.value==="single")V.value===w.field?P.value=P.value===1?-1:P.value===-1?0:1:(V.value=w.field,P.value=1),P.value===0&&(V.value=null),C("sort",{field:V.value,order:P.value});else{const y=Y.value.findIndex(B=>B.field===w.field);y>=0?Y.value[y].order===1?Y.value[y].order=-1:Y.value.splice(y,1):Y.value.push({field:w.field,order:1}),C("sort",{multiSortMeta:Y.value})}},Cn=e.computed(()=>{if(!Ht.value)return Ln.value;let w=[...Ln.value];return Bt.value==="single"&&V.value&&P.value!==0?w.sort((y,B)=>{const W=he(y,V.value),se=he(B,V.value);return W===se?0:W==null?1:se==null?-1:(W<se?-1:W>se?1:0)*P.value}):Bt.value==="multiple"&&Y.value.length>0&&w.sort((y,B)=>{for(const W of Y.value){const se=he(y,W.field),mt=he(B,W.field);if(se===mt)continue;if(se==null)return 1;if(mt==null)return-1;const et=se<mt?-1:se>mt?1:0;if(et!==0)return et*W.order}return 0}),w}),dn=e.ref(0),fn=e.ref(Re.value),Pn=e.ref(!1),yl=e.ref(null),Xl=w=>{fn.value=w,Pn.value=!1,dn.value=0,C("page",{page:0,rows:fn.value})};function Cl(w){yl.value&&!yl.value.contains(w.target)&&(Pn.value=!1)}const kl=e.computed(()=>Cn.value.length),kn=e.computed(()=>Math.ceil(kl.value/fn.value)),vn=e.computed(()=>pt.value?dn.value*fn.value:0),Al=e.computed(()=>pt.value?Math.min((dn.value+1)*fn.value,kl.value):kl.value),ol=e.computed(()=>{if(!pt.value)return Cn.value;const w=vn.value,y=Al.value;return Cn.value.slice(w,y)}),An=e.ref(new Set),fl=e.computed(()=>Cn.value.filter((w,y)=>An.value.has(X(w,y)))),Vl=e.computed(()=>{const w=Cn.value.length;return w>0&&An.value.size===w}),Rt=e.computed(()=>{const w=Cn.value.length,y=An.value.size;return y>0&&y<w}),Ce=(w,y)=>An.value.has(X(w,y)),Nl=()=>{if(Vl.value)An.value=new Set,C("unselect-all");else{const w=new Set;Cn.value.forEach((y,B)=>w.add(X(y,B))),An.value=w,C("select-all",fl.value)}},Xe=(w,y)=>{const B=X(w,y),W=new Set(An.value),se=W.has(B);Ne.value==="single"?se?(W.delete(B),C("row-unselect",w)):(W.clear(),W.add(B),C("row-select",w)):se?(W.delete(B),C("row-unselect",w)):(W.add(B),C("row-select",w)),An.value=W},jt=e.computed(()=>{const w=kn.value,y=dn.value+1,B=2,W=[],se=[];let mt;for(let et=1;et<=w;et++)(et===1||et===w||et>=y-B&&et<=y+B)&&W.push(et);for(const et of W)mt&&(et-mt===2?se.push(mt+1):et-mt!==1&&se.push("...")),se.push(et),mt=et;return se}),Pe=w=>{w<0||w>=kn.value||(dn.value=w,C("page",{page:w,rows:fn.value}))},ze=(w,y,B)=>{C("row-click",{data:w,index:y,originalEvent:B}),k(w,vn.value+y)},Z=(w,y)=>{const B=vn.value+y;return{"dss-table-row-selected":Ce(w,B),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":ae.value,"dss-table-row-truncated-expanded":Q.value===X(w,B)}},Tt=(w,y)=>y.field?he(w,y.field):"",he=(w,y)=>y.split(".").reduce((B,W)=>B&&B[W],w),Mn=w=>{const y=w.align??lt.value;return{"dss-table-sortable":w.sortable!==!1&&Ht.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[w.className]:w.className}},Dl=w=>{const y={};return w.width&&(y.width=typeof w.width=="number"?`${w.width}px`:w.width),w.minWidth&&(y.minWidth=typeof w.minWidth=="number"?`${w.minWidth}px`:w.minWidth),w.maxWidth&&(y.maxWidth=typeof w.maxWidth=="number"?`${w.maxWidth}px`:w.maxWidth),y};return e.watch(()=>Me.locale,w=>{w&&w!==R.value&&(R.value=w)},{immediate:!0}),e.watch(Re,w=>{fn.value=w,dn.value=0}),e.watch(Ke,w=>{C("search",w??"")}),e.watch(()=>Me.columns,()=>{Et()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Cl),document.addEventListener("click",Se),document.addEventListener("click",Nn),window.addEventListener("resize",nn),window.addEventListener("scroll",nn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Cl),document.removeEventListener("click",Se),document.removeEventListener("click",Nn),window.removeEventListener("resize",nn),window.removeEventListener("scroll",nn,!0)}),(w,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Vt,style:e.normalizeStyle({width:ue.value+"px",height:ve.value?ve.value+"px":"auto"})},[on.value?(e.openBlock(),e.createElementBlock("div",Mi,[e.createElementVNode("div",_i,[tt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=B=>C("download-pdf"))},[y[21]||(y[21]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(z)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),Mt.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=B=>C("download-excel"))},[y[22]||(y[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(z)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),xt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:ot},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":bt.value}]),onClick:y[2]||(y[2]=B=>bt.value=!bt.value),"aria-expanded":bt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(z)("table.columnVisibility"))+" ",1),y[23]||(y[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,$i),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ti,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.columns,(B,W)=>(e.openBlock(),e.createElementBlock("li",{key:fe(B,W),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Li,[e.createElementVNode("span",Hi,[e.createElementVNode("input",{type:"checkbox",checked:dt(B,W),onChange:se=>$t(B,W),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ai),dt(B,W)?(e.openBlock(),e.createElementBlock("span",Di,[...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",Ri,e.toDisplayString(B.header),1)])]))),128))],512),[[e.vShow,bt.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fi,[Ft.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Ge.value||Ke.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Zt,"onUpdate:modelValue":y[4]||(y[4]=B=>Ke.value=B),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(z)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:y[5]||(y[5]=B=>Ge.value=!0),onBlur:U},null,40,Ii),[[e.vModelText,Ke.value]]),Ke.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:Ie},[...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":Ge.value||!!Ke.value,onMousedown:e.withModifiers(_t,["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,zi)],2)):e.createCommentVNode("",!0),w.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Pi,[e.renderSlot(w.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":gt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",_e.value])},[e.createElementVNode("thead",Oi,[e.createElementVNode("tr",null,[je.value?(e.openBlock(),e.createElementBlock("th",Zi,[Ne.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Wi,[e.createElementVNode("input",{type:"checkbox",checked:Vl.value,indeterminate:Rt.value,onChange:Nl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,qi),Rt.value?(e.openBlock(),e.createElementBlock("span",Ui)):Vl.value?(e.openBlock(),e.createElementBlock("span",Xi,[...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),S.value?(e.openBlock(),e.createElementBlock("th",Yi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,(B,W)=>(e.openBlock(),e.createElementBlock("th",{key:ft(B),class:e.normalizeClass(["dss-table-th",Mn(B)]),style:e.normalizeStyle(Dl(B)),onClick:se=>Hn(B)},[e.createElementVNode("div",Ki,[e.createElementVNode("span",Gi,e.toDisplayString(B.header),1),B.sortable!==!1&&Ht.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Ye(B)])},[xe(B)===0?(e.openBlock(),e.createElementBlock("span",Qi,[...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)])])):xe(B)===1?(e.openBlock(),e.createElementBlock("span",Ji,[...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)])])):xe(B)===-1?(e.openBlock(),e.createElementBlock("span",ec,[...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),B.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":le.value===ft(B)}]),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":an(ft(B))}]),"data-filter-column-key":ft(B),"aria-expanded":le.value===ft(B),"aria-label":"Filter column",onClick:se=>A(ft(B),se)},[...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,tc)],2)):e.createCommentVNode("",!0)])],14,ji))),128))])]),e.createElementVNode("tbody",nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ol.value,(B,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:X(B,vn.value+W)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Z(B,W)]),style:e.normalizeStyle(te.value),onClick:se=>ze(B,W,se)},[je.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",oc,[e.createElementVNode("input",{type:Ne.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${D.tableId}`,checked:Ce(B,vn.value+W),onChange:se=>Xe(B,vn.value+W),class:e.normalizeClass(["dss-table-checkbox",Ne.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,ac),Ne.value==="multiple"&&Ce(B,vn.value+W)?(e.openBlock(),e.createElementBlock("span",sc,[...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)])])):Ne.value==="single"&&Ce(B,vn.value+W)?(e.openBlock(),e.createElementBlock("span",rc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(se=>x(B,vn.value+W,se),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":re(B,vn.value+W),"aria-label":re(B,vn.value+W)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":re(B,vn.value+W)}]),"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,cc)],8,ic)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,(se,mt)=>(e.openBlock(),e.createElementBlock("td",{key:ft(se),class:e.normalizeClass(["dss-table-td",Mn(se)]),style:e.normalizeStyle(Dl(se))},[e.renderSlot(w.$slots,`cell-${se.field}`,{data:B,column:se,rowIndex:W},()=>[e.createTextVNode(e.toDisplayString(Tt(B,se)),1)])],6))),128))],14,lc),S.value&&re(B,vn.value+W)?(e.openBlock(),e.createElementBlock("tr",uc,[e.createElementVNode("td",{colspan:ut.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(w.$slots,"expansion",{data:B,rowIndex:W})],8,dc)])):e.createCommentVNode("",!0)],64))),128)),ol.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(te.value)},[e.createElementVNode("td",{colspan:ut.value,class:"dss-table-empty-cell"},[e.renderSlot(w.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(wt.value),1)])],8,mc)],4))])],2)],2),pt.value?(e.openBlock(),e.createElementBlock("div",pc,[e.createElementVNode("div",fc,[e.createElementVNode("div",vc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dn.value===0,onClick:y[8]||(y[8]=B=>Pe(0)),title:e.unref(z)("table.firstPage")},[...y[34]||(y[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,gc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dn.value===0,onClick:y[9]||(y[9]=B=>Pe(dn.value-1)),title:e.unref(z)("table.previousPage")}," ‹ ",8,hc),e.createElementVNode("span",yc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jt.value,B=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B},[B!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":B===dn.value+1}]),onClick:W=>Pe(B-1)},e.toDisplayString(B),11,Cc)):(e.openBlock(),e.createElementBlock("span",kc,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dn.value>=kn.value-1,onClick:y[10]||(y[10]=B=>Pe(dn.value+1)),title:e.unref(z)("table.nextPage")}," › ",8,bc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dn.value>=kn.value-1,onClick:y[11]||(y[11]=B=>Pe(kn.value-1)),title:e.unref(z)("table.lastPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,wc)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:yl},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Pn.value}]),onClick:y[12]||(y[12]=B=>Pn.value=!Pn.value),"aria-expanded":Pn.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(fn.value)+" ",1),y[36]||(y[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,xc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ec,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B,role:"option","aria-selected":B===fn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":B===fn.value}]),onClick:W=>Xl(B)},e.toDisplayString(B),11,Vc))),128))],512),[[e.vShow,Pn.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(Qe.value?{top:Qe.value.top+"px",left:Qe.value.left+"px",width:qe+"px"}:void 0),onClick:y[20]||(y[20]=e.withModifiers(()=>{},["stop"]))},[vt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[vt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Nc,[e.createElementVNode("input",{type:"text",value:cn(le.value).value??"",onInput:y[13]||(y[13]=B=>q(le.value,B.target.value)),class:"dss-table-filter-input",placeholder:e.unref(z)("table.search")||"Search..."},null,40,Sc)])):vt.value.filter==="range"&&Ue.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Ue.value.minPct+"%","--range-max-pct":Ue.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Dt,class:"dss-table-filter-double-range-track",onMousemove:Tn,onMouseenter:Tn},[e.createElementVNode("input",{type:"range",min:Ue.value.rangeMin,max:Ue.value.rangeMax,value:Ue.value.currentMin,onInput:y[14]||(y[14]=B=>ne(le.value,"min",B.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,Bc),e.createElementVNode("input",{type:"range",min:Ue.value.rangeMin,max:Ue.value.rangeMax,value:Ue.value.currentMax,onInput:y[15]||(y[15]=B=>ne(le.value,"max",B.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,Mc)],544),e.createElementVNode("div",_c,e.toDisplayString(Ue.value.currentMin)+" – "+e.toDisplayString(Ue.value.currentMax),1)],4)):vt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("div",Tc,[e.createElementVNode("label",Lc,e.toDisplayString(e.unref(z)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:cn(le.value).from??"",onInput:y[16]||(y[16]=B=>Be(le.value,"from",B.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Hc)]),e.createElementVNode("div",Ac,[e.createElementVNode("label",Dc,e.toDisplayString(e.unref(z)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:cn(le.value).to??"",onInput:y[17]||(y[17]=B=>Be(le.value,"to",B.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Rc)])])):vt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:Je[le.value]??"",onInput:y[18]||(y[18]=B=>rt(le.value,B.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(z)("table.search")||"Search..."},null,40,Fc),e.createElementVNode("div",Ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe(vt.value),B=>(e.openBlock(),e.createElementBlock("label",{key:B,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:at(le.value,B),onChange:W=>sn(le.value,B)},null,40,zc),e.createElementVNode("span",null,e.toDisplayString(B),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Pc,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[19]||(y[19]=B=>un(le.value))},e.toDisplayString(e.unref(z)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,le.value&&vt.value&&Qe.value]])]),_:1})]))],64))}}),Wc={class:"dss-toolbar-left"},qc=["title"],Uc=["title"],Xc={class:"dss-toolbar-dropdown-wrapper"},Yc=["title"],jc={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"},Kc={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"},Gc={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"},Qc={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"},Jc={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"},eu={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"},tu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},nu=["title"],lu=["title"],ou=["title"],au=["title"],su=["title"],ru=["title"],iu=["title"],cu=["title"],uu=["title"],du={key:2,class:"dss-toolbar-separator"},mu=["title"],pu={key:4,class:"dss-toolbar-separator"},fu={key:5,class:"dss-toolbar-dropdown-wrapper"},vu=["title"],gu={class:"dss-toolbar-dropdown-ai"},hu={class:"dss-toolbar-right"},yu={key:0,class:"dss-toolbar-custom-group"},Cu={key:1,class:"dss-toolbar-separator"},ku={class:"dss-link-modal-content"},bu={class:"dss-link-modal-field"},wu={class:"dss-link-modal-label"},xu=["placeholder"],Eu={class:"dss-link-modal-field"},Vu={class:"dss-link-modal-label"},Nu=["placeholder"],Su={class:"dss-image-modal-tabs"},Bu={key:0,class:"dss-image-tab-content"},Mu={class:"dss-link-modal-content"},_u={class:"dss-link-modal-field"},$u={key:0,class:"dss-link-modal-label"},Tu=["src"],Lu={class:"dss-link-modal-field"},Hu={class:"dss-link-modal-label"},Au=["placeholder"],Du={class:"dss-link-modal-field"},Ru={class:"dss-link-modal-label"},Fu=["placeholder"],Iu={class:"dss-link-modal-field"},zu={class:"dss-link-modal-label"},Pu=["placeholder"],Ou={key:1,class:"dss-image-tab-content"},Zu={class:"dss-link-modal-content"},Wu={class:"dss-link-modal-field"},qu={class:"dss-link-modal-label"},Uu=["placeholder"],Xu={class:"dss-link-modal-field"},Yu={class:"dss-link-modal-label"},ju=["placeholder"],Ku={class:"dss-link-modal-field"},Gu={class:"dss-link-modal-label"},Qu=["placeholder"],Ju={class:"dss-link-modal-field"},ed={class:"dss-link-modal-label"},td=["placeholder"],nd={class:"dss-text-editor-title-input-container"},ld={key:0,class:"dss-text-editor-title-preview"},od={key:0},ad={key:1,class:"dss-text-editor-preview-placeholder"},sd=["value","placeholder","disabled"],rd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},id={class:"dss-text-editor-description-input-container"},cd={key:0,class:"dss-text-editor-description-preview"},ud={key:0},dd={key:1,class:"dss-text-editor-preview-placeholder"},md=["value","placeholder","disabled"],pd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},fd=["data-comment-id","onMouseenter"],vd=["onClick"],gd=["src","alt"],hd={key:1},yd=["onClick"],Cd=["src","alt"],kd={key:1},bd=["data-has-second-user","onClick"],wd={class:"editor-comment-marker-count"},xd={key:4,class:"dss-text-editor-textarea-wrapper"},Ed=["value","placeholder","rows","disabled"],Vd={class:"dss-text-editor-footer"},Nd={class:"dss-text-editor-footer-content"},Sd={class:"dss-text-editor-footer-stat"},Bd={class:"dss-text-editor-footer-stat"},Md={key:5,class:"dss-text-editor-content-wrapper"},_d={key:0,class:"dss-comment-overlay-body"},$d={class:"dss-comment-selection-wrapper"},Td=["innerHTML"],Ld={class:"dss-comment-messages-wrapper"},Hd={key:0,class:"dss-comment-avatar-wrapper"},Ad={class:"dss-comment-avatar"},Dd=["src","alt"],Rd={key:1},Fd={class:"dss-comment-header"},Id={class:"dss-comment-header-text"},zd={class:"dss-comment-author"},Pd={key:0,class:"dss-comment-date"},Od=["onClick","title"],Zd={class:"dss-comment-overlay-inner"},Wd=["placeholder","onKeydown"],qd={class:"dss-text-editor-footer"},Ud={class:"dss-text-editor-footer-content"},Xd={class:"dss-text-editor-footer-stat"},Yd={class:"dss-text-editor-footer-stat"},jd=["title"],Kd=["title"],Gd={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:""},Qd={class:"dss-image-popup-content"},Jd={key:0,class:"dss-image-popup-no-alt-icon"},e1=["title"],t1=["title"],n1={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:""},l1={class:"dss-toolbar-left"},o1=["title"],a1=["title"],s1={class:"dss-toolbar-dropdown-wrapper"},r1=["title"],i1={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"},c1={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"},u1={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"},d1={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"},m1={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"},p1={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"},f1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},v1=["title"],g1=["title"],h1=["title"],y1=["title"],C1=["title"],k1=["title"],b1=["title"],w1=["title"],x1=["title"],E1=["title"],V1={key:2,class:"dss-toolbar-separator"},N1={key:3,class:"dss-toolbar-dropdown-wrapper"},S1=["title"],B1={class:"dss-toolbar-dropdown-ai"},M1={key:0,class:"dss-toolbar-right"},_1={key:0,class:"dss-toolbar-separator"},$1={key:0,class:"dss-toolbar-custom-group"},T1={key:1,class:"dss-toolbar-separator"},L1={name:"DSSTextEditor"},H1=Object.assign(L1,{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:D=>typeof D=="object"&&D!==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:D=>typeof D=="object"&&D!==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(D,{expose:ke,emit:z}){const{t:R,locale:Me}=no.useI18n(),C=D,Te=z,ie=e.useSlots(),nt=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
80
99
|
<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),ce=e.ref(null),we=e.ref(!1),ge=e.ref(!1),j=e.ref(!1),_=e.ref(""),_e=e.ref({}),Pe=e.ref(!1),Le=e.ref(!1),je=e.ref(""),F=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({}),ne=e.ref(!1),vn=e.ref({}),rt=e.ref(null),Ge=e.ref(null),sn=e.ref(!1),Xt=e.ref(""),re=e.ref(null),xe=e.ref(""),ee=e.ref(""),le=e.ref(""),Xe=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),yt=e.ref("upload"),$t=e.ref(""),st=e.ref(null),nn=e.ref(null),tt=e.ref([]),kt=e.ref([]),$e=e.ref(null),qe=e.ref(!1),O=e.ref(""),Z=e.ref(""),X=e.ref(""),J=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),Tt=e.ref(!1),Ae=e.ref(!1),It=e.ref(null),ft=e.ref("p"),Bn=e.ref(!1),Wt=e.ref([]),Ct=e.ref(null),Bt=e.ref(null),Tn=e.ref(null),Ln=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})),Wn=e.computed(()=>({})),mo=e.computed(()=>!k.fixedHeight||k.fullHeight?{}:{height:`${1.6*14*k.rows+24+2}px`,resize:"none",overflowY:"auto"}),T=e.computed(()=>!k.fixedHeight||k.fullHeight?{}:{height:`${1.6*14*k.rows+32}px`,overflowY:"auto"}),P=e.computed(()=>k.richText&&kt.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&&yt.value==="upload"&&xe.value&&xe.value.startsWith("data:")),Ue=e.computed(()=>k.titlePlaceholder||I("textEditor.placeholders.title")),Ie=e.computed(()=>k.descriptionPlaceholder||I("textEditor.placeholders.description")),Ye=e.computed(()=>k.placeholder||I("textEditor.placeholders.startTyping")),Vt=l=>oe&&oe[l]!==void 0,Hn=l=>{for(let o=l+1;o<k.customToolbarSlots.length;o++)if(Vt(k.customToolbarSlots[o]))return!0;return!1},Vn=l=>{for(let o=l+1;o<k.customToolbarSlots.length;o++){const a=k.customToolbarSlots[o];if(Vt(a)&&on(a))return!0}return!1},on=l=>k.customToolbarFloatingMap.hasOwnProperty(l)?k.customToolbarFloatingMap[l]===!0:!0,no=e.computed(()=>k.customToolbarSlots.some(l=>Vt(l)&&on(l))),An=e.computed(()=>Vt("title-slot")),un=e.computed(()=>Vt("description-slot")),fn=l=>{if(!l||l.trim()==="")return"<html></html>";const o=l.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?l:`<html>${l}</html>`},Zn=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=I("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)},Cn=()=>{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")},gn=()=>{Tt.value=!0,Cn()},Io=()=>{Tt.value=!1,oo()},oo=()=>{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")},Dn=l=>{const a=l.target.value;Tt.value&&Cn(),Me("update:title",a),Me("title-change",a),mt.value="title",k.richText&&(qe.value||(Z.value=O.value,ye.value=X.value,et.value=J.value),$e.value&&clearTimeout($e.value),qe.value=!0,$e.value=setTimeout(()=>{qe.value=!1,Te()},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()},bt=()=>{Ae.value=!1,de()},de=()=>{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")},$o=l=>{const a=l.target.value;Ae.value&&po(),Me("update:description",a),Me("description-change",a),mt.value="description",k.richText&&(qe.value||(Z.value=O.value,ye.value=X.value,et.value=J.value),$e.value&&clearTimeout($e.value),qe.value=!0,$e.value=setTimeout(()=>{qe.value=!1,Te()},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)},Te=(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===J.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:J.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(),kt.value=[]),O.value=o,X.value=a,J.value=r,Z.value=o,ye.value=a,et.value=r},R=l=>{if(!p.value)return;gt(),p.value&&ko(p.value);let o=null;p.value&&(p.value.querySelector("p")||(o=ze(),ue()));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=fn(r);Me("update:modelValue",i),Me("change",i),mt.value="editor",qe.value||(Z.value=O.value,ye.value=X.value,et.value=J.value),$e.value&&clearTimeout($e.value),qe.value=!0,$e.value=setTimeout(()=>{qe.value=!1,Te(),ll(),Jt()},500),e.nextTick(()=>{o&&jt(o),gt();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{}}),bn(),Mn(),z(),Ft(),qn(),zn("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})},gt=()=>{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)}}}},ue=()=>{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)}})},Mn=()=>{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}}},lo=l=>{ll(),Me("blur",l),Eo()},C=()=>{if(k.disabled||!k.richText||!p.value)return;St(),$e.value&&(clearTimeout($e.value),$e.value=null),qe.value&&(Te(),qe.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(()=>{R()});return}const r={content:p.value.innerHTML,title:k.title||"",description:k.description||""};kt.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,J.value=m,Z.value=u,ye.value=d,et.value=m,e.nextTick(()=>{bn(),yn(),Rn(),Ft();const v=fn(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),Cn()}}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),Cn()}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;St();const l=mt.value==="title",o=mt.value==="description",a=mt.value==="editor";if(kt.value.length===0){l&&Se.value?Se.value.focus():o&&Oe.value?Oe.value.focus():p.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{R()});return}const r={content:p.value.innerHTML,title:k.title||"",description:k.description||""};tt.value.push(r);const i=kt.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,J.value=m,Z.value=u,ye.value=d,et.value=m,e.nextTick(()=>{bn(),yn(),Rn(),Ft();const v=fn(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),Cn()}}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),Cn()}else if(Oe.value&&document.activeElement===Oe.value){const h=m.length;Oe.value.setSelectionRange(h,h)}else p.value&&He()},10)})})}},E=()=>{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"})},z=()=>{if(!p.value)return;p.value.querySelectorAll("i, em").forEach(o=>{o.style.fontStyle="italic"})},Q=()=>{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(()=>{z()}),!1;if(o.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{z()});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(()=>{z()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{z()})}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(()=>{E()}),!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)}}E()});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(()=>{E()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{E()})}return!0},De=(l,o=null)=>{if(k.disabled||!k.richText||!p.value)return;qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Te(),qe.value=!1):Te(),St(),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=ht("bold");Be.value.bold=m})),R(),yn(),Ft()});return}if(l==="italic"){const u=Q();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=ht("italic");Be.value.italic=m})),R(),z(),yn(),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=ht("bold");Be.value.bold=d});else if(l==="italic")if(r)e.nextTick(()=>{const d=ht("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)})}R(),yn(),Ft()})},ht=(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}},mn=l=>{k.disabled||!k.richText||(ce.value=ce.value===l?null:l,l==="askAi"&&(Ge.value=null))},St=()=>{ce.value=null,st.value=null},hn=l=>{De("formatBlock",l),St()},Fo=l=>{if(!l||!p.value)return l;const o=Ce=>{let ae=Ce.nodeType===Node.TEXT_NODE?Ce.parentElement:Ce;for(;ae&&ae!==p.value;){const Ke=ae.tagName;if(Ke==="P"){const en=ae.parentElement;if(en===p.value||en.tagName==="BLOCKQUOTE")return ae}if(Ke==="BLOCKQUOTE")break;ae=ae.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 ae=Ce.tagName;if(ae==="P"){const Ke=Ce.parentElement;if(Ke===p.value||Ke.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return ae==="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;qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Te(),qe.value=!1):Te(),St(),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),Rn(),R(),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(()=>{Rn(),R()})},yn=()=>{if(!p.value){we.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");we.value=!!r}else we.value=!1}catch{we.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()),je.value="",F.value=a,xt.value="",he.value=null,Le.value=!0,St(),e.nextTick(()=>{dt.value&&dt.value.focus()})},ao=()=>{if(!p.value)return;qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Te(),qe.value=!1):Te();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");we.value=!1,St(),e.nextTick(()=>{R(),yn()})},gl=()=>{k.disabled||!k.richText||p.value&&(qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Te(),qe.value=!1):Te(),St(),p.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{bn(),R(),Ft()}))},hl=()=>{k.disabled||!k.richText||p.value&&(qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Te(),qe.value=!1):Te(),St(),p.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{bn(),R(),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},bn=()=>{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;St(),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(()=>{bn(),R()});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)),bn();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),l.removeAllRanges(),l.addRange(v),e.nextTick(()=>{R(),Ft()})}else document.execCommand("indent",!1),e.nextTick(()=>{bn(),R(),Ft()})},zo=()=>{if(k.disabled||!k.richText||!p.value)return;St(),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(()=>{bn(),R()});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(),bn();const d=document.createRange();d.selectNodeContents(a),d.collapse(!1),l.removeAllRanges(),l.addRange(d),e.nextTick(()=>{R(),Ft()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{bn(),R(),Ft()})},ln=e.ref(null),wn=e.ref(null),wo=e.ref({}),Yn=e.ref(""),jn=e.ref(null),so=e.ref("");e.ref("");const ro=e.ref(null);e.ref("");const Sn=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,Yn.value="",so.value="",ro.value=null,Sn.value=[],Jn(!0);return}St(),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(Yn.value="",jn.value){const h=jn.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 ae=w.height;wo.value={bottom:`${ae+Ce}px`,top:"auto"}}else wo.value={top:`${m}px`,bottom:"auto"}}}})},Cl=()=>{if(!Yn.value.trim())return;const l=Yn.value.trim(),o=new Date,a={text:l,selectionText:so.value,selectionRange:ro.value,commentId:ln.value,user:k.commentUser||null,createdAt:o.toISOString()};Sn.value=[...Sn.value,a],Me("comment-submitted",a),xn(a),ro.value&&!Jo(ro.value)&&el(ln.value,ro.value),Yn.value="",e.nextTick(()=>{if(jn.value){const r=jn.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}zn("sendComment")})},$l=(l,o)=>{if(!(!k.commentUser||!l.user||l.user.id!==k.commentUser.id)){if(Sn.value=Sn.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&&Sn.value.length>0){const i=[],u=new Set;Sn.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(Sn.value.length))}else r&&Sn.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(()=>{zn("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(()=>{zn("wrapSelectionWithCommentMarker"),R()})}catch{}},xn=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;St(),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 ae=new Date(Ce).getTime();return isNaN(ae)?0:ae},U=w(S.createdAt),W=w(N.createdAt);return U===W?0:U-W}),Sn.value=h,Jn(!0),ln.value=v||null,r&&(wn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Yn.value="",jn.value){const S=jn.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,ae=W.top-w.top,Ke=8;if(Ce>ae-Ke){const en=W.height;wo.value={bottom:`${en+Ke}px`,top:"auto"}}}}}zn("openCommentOverlayForSelector")})},Qt=e.ref(null),_n=e.ref(0),pn=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(()=>{R()});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(()=>{R()});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||"",Ke=(W.innerHTML||"").trim(),en=Ke.replace(/<br\s*\/?>/gi,"").trim();return Ce.trim()===""||Ke===""||en===""||Ke==="<br>"||Ke==="<br/>"||Ke==="<p></p>"||Ke==="<p><br></p>"||Ke==="<p><br/></p>"||Ke==="<p> </p>"||Ke==="<p><br> </p>"||Ke==="<div></div>"||Ke==="<div><br></div>"||Ke==="<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-_n.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=" ",_n.value=o}else Qt.value=l.key}},Kn=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,"")),Te();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 ae=!1;if(["H1","H2","H3","H4","H5","H6"].includes(W)?ae=!0:Ce||(U===W||U==="P")&&(ae=!0),ae)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);R()},Lt=l=>{if(ce.value){const a=l.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&St()}if(ne.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),i=p.value&&a.closest(".dss-text-editor-content");!r&&!i&&Eo()}if(Ge.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);Bn.value=!r.collapsed&&fo(r)}else Bn.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,Yn.value="",so.value="",ro.value=null,Sn.value=[],Jn(!0))}},Kt=(l,o)=>{l&&l.stopPropagation&&l.stopPropagation(),nn.value&&(clearTimeout(nn.value),nn.value=null),st.value=o},Gn=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 pt=0;const vt=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-${++pt}`;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=>{vt(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=Gn;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=Gn;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(ne.value&&Ft(),k.richText){if(wt!==null)return;wt=setTimeout(()=>{wt=null,zn("handleWindowResize")},150)}},To=()=>{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(()=>{Tt.value?Cn():oo(),Ae.value?po():de()})}),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(),To()}),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 ae=document.createRange();ae.setStartAfter(N),ae.collapse(!0),w.removeAllRanges(),w.addRange(ae)}}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="")}}}),Mn()})}),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,ae=Ce.nodeType===3?Ce.parentElement:Ce;if(ae?.closest(".dss-image-wrapper")===N||N&&N.contains(ae)){Nt.value=null;return}if(N&&(ae===N||N.contains(ae))){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()}}),Mn(),R()})}),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(()=>{Mn(),To(),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(()=>{To()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),k.modelValue){const m=Zn(k.modelValue);p.value.innerHTML=m,ue()}e.nextTick(()=>{const m=p.value.innerHTML||"",v=k.title||"",h=k.description||"";O.value=m,X.value=v,J.value=h,ye.value=v,et.value=h,bn(),Mn(),z(),qn(),Bl(),Do()}),yn(),Rn(),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),$e.value&&clearTimeout($e.value),nn.value&&clearTimeout(nn.value),p.value&&p.value._mutationObserver&&p.value._mutationObserver.disconnect(),Ct.value&&Ct.value.disconnect(),Bt.value!==null&&(cancelAnimationFrame(Bt.value),Bt.value=null),Tn.value!==null&&(clearTimeout(Tn.value),Tn.value=null),Yt.value!==null&&(clearTimeout(Yt.value),Yt.value=null),Jn(!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)}}Mn(),yn(),Rn(),Ft(),qn()}):e.nextTick(()=>{Mn(),yn(),Rn(),Ft(),qn()})},io=()=>{gt();const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0);Bn.value=!a.collapsed&&fo(a),!a.collapsed&&It.value&&(It.value=null)}else Bn.value=!1;if(Mn(),yn(),Rn(),Ft(),qn(),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(),Bn.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{}})},qn=()=>{if(!k.richText||k.disabled||!p.value){ft.value="p";return}try{const l=window.getSelection();if(!l||l.rangeCount===0){ft.value="p";return}const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!p.value.contains(r)){ft.value="p";return}const i=r.closest("h1, h2, h3, h4, h5, h6, p");if(!i){ft.value="p";return}const u=i.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(u)?ft.value=u:ft.value="p"}catch{ft.value="p"}},Rn=()=>{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=()=>{ne.value=!1},Ft=()=>{if(!k.floatingToolbar||!k.richText||k.disabled){ne.value=!1;return}const l=window.getSelection();if(!l||l.rangeCount===0){ne.value=!1;return}const o=l.getRangeAt(0);if(o.collapsed||!fo(o)){ne.value=!1;return}const a=o.getBoundingClientRect();if(!a||a.width===0&&a.height===0){ne.value=!1;return}const r=p.value;if(!r){ne.value=!1;return}const i=r.getBoundingClientRect();if(!i||i.width===0){ne.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 ae=h/2;w=ae,U=ae}}v<w?v=w:v>U&&(v=U),vn.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},ne.value=!0},co=l=>{k.disabled||!k.richText||(Ge.value=Ge.value===l?null:l,l==="askAi"&&(ce.value=null))},nl=()=>{Ge.value=null,st.value=null},kn=l=>{hn(l),nl()};let go=null,Vo=null,In=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),In&&(clearTimeout(In),In=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()||I("textEditor.image.noAlt"),_t.value=!0,Rt.value=!0,xl(r)}else!r&&So?(So=null,In=setTimeout(()=>{Rt.value||Ho()},150)):r&&r===So&&xl(r)},Tl=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),In&&(clearTimeout(In),In=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}},Qn=()=>{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;je.value=o,F.value=l,xt.value=l,Pe.value=!1,j.value=!1,_.value="",he.value=a,Le.value=!0}else if(we.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")||"";je.value=u,F.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()),je.value="",F.value=o,xt.value="",he.value=null,Le.value=!0}e.nextTick(()=>{dt.value&&(dt.value.focus(),dt.value.select())})},Fn=()=>{Le.value=!1,je.value="",F.value="",xt.value="",he.value=null,Dt.value=null},Mt=()=>{if(!je.value.trim()){Fn();return}if(qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Te(),qe.value=!1):Te(),F.value.trim()||(F.value=je.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",je.value.trim()),F.value.trim()!==xt.value.trim()){for(;o.firstChild;)o.removeChild(o.firstChild);o.textContent=F.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),R()}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=je.value.trim(),a.textContent=F.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=je.value.trim(),u.textContent=F.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
|
-
`){const
|
|
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)}}R()}e.nextTick(()=>{yn(),Fn()})},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],ae=W.index;if(ae>0&&h[ae-1]==="@"||ae+Ce.length<h.length&&h[ae+Ce.length]==="@")return!1;const Ke=v.parentElement;return!(Ke&&Ke.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}`,ae=document.createElement("a");ae.href=Ce,ae.textContent=W,ae.style.color="#60afdf",ae.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(ae,v),d=!0);continue}let w=0;const U=document.createDocumentFragment();if(N.forEach(W=>{const Ce=W.index,ae=W[0];if(Ce>w){const At=h.substring(w,Ce);At&&U.appendChild(document.createTextNode(At))}const Ke=ae.startsWith("http://")||ae.startsWith("https://")?ae:`https://${ae}`,en=document.createElement("a");en.href=Ke,en.textContent=ae,en.style.color="#60afdf",en.style.textDecoration="underline",U.appendChild(en),w=Ce+ae.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),yn()})},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,Xn=an.textContent||"",Pn=qt;if(qt+=Xn.length,an===r.startContainer){At+=Xn.substring(0,r.startOffset),Pt=Pn+r.startOffset,Gt=!0;break}At+=Xn}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 ae=window.getSelection(),Ke=document.createRange();Ke.setStartAfter(Ce),Ke.collapse(!0),ae.removeAllRanges(),ae.addRange(Ke);const en=ze();e.nextTick(()=>{R(),en&&jt(en)})},al=()=>{p.value&&(Ot.value=ze(),Xt.value="",xe.value="",$t.value="",ee.value="",le.value="",re.value=null,Ve.value=null,yt.value="upload",sn.value=!0,St(),e.nextTick(()=>{Xe.value&&Xe.value.focus(),ct.value&&(ct.value.value="")}))},El=l=>{const o=l.target?.files?.[0];if(!o){re.value=null,xe.value="";return}re.value=o;const a=new FileReader;a.onload=r=>{xe.value=r.target?.result||""},a.readAsDataURL(o)},sl=()=>{ct.value&&ct.value.click()},Vl=()=>{ee.value&&(le.value="")},rl=()=>{le.value&&(ee.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://")?($t.value=a,xe.value="",yt.value="url"):(xe.value=a,$t.value="",yt.value="upload");const i=l.style.width||l.getAttribute("width")||"",u=l.style.height||l.getAttribute("height")||"";ee.value=i.endsWith("px")?i.replace("px",""):i,le.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(()=>{yt.value==="url"&&Ze.value?(Ze.value.focus(),Ze.value.select()):Xe.value&&(Xe.value.focus(),Xe.value.select()),ct.value&&(ct.value.value="")})},Ao=()=>{sn.value=!1,Xt.value="",xe.value="",$t.value="",ee.value="",le.value="",re.value=null,Ve.value=null,Ot.value=null,yt.value="upload"},Un=()=>{const l=(Xt.value||"").trim(),o=p.value?._mutationObserver;o&&o.disconnect(),qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Te(),qe.value=!1):Te();const a=yt.value==="url"?$t.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),ee.value?(Ve.value.style.width=`${ee.value}px`,Ve.value.setAttribute("width",ee.value)):(Ve.value.style.removeProperty("width"),Ve.value.removeAttribute("width")),le.value?(Ve.value.style.height=`${le.value}px`,Ve.value.setAttribute("height",le.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)}R()}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),ee.value&&(v.style.width=`${ee.value}px`,v.setAttribute("width",ee.value)),le.value&&(v.style.height=`${le.value}px`,v.setAttribute("height",le.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,R()}}e.nextTick(()=>{o&&p.value&&o.observe(p.value,{childList:!0,subtree:!0}),yn(),Ft(),Ao()})};e.watch(()=>k.modelValue,l=>{if(k.richText&&p.value&&!ge.value){const o=Zn(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(()=>{ue();const d=p.value.innerHTML||"",m=k.title||"",v=k.description||"";O.value=d,X.value=m,J.value=v,Z.value=d,ye.value=m,et.value=v,tt.value=[],kt.value=[],$e.value&&(clearTimeout($e.value),$e.value=null),qe.value=!1,u&&jt(u),bn(),Mn(),z(),yn(),Ft(),qn(),zn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>k.richText,l=>{l?(Ft(),e.nextTick(()=>{Bl()})):(Eo(),Wt.value=[],Ct.value&&(Ct.value.disconnect(),Ct.value=null)),qn()}),e.watch(()=>k.floatingToolbar,l=>{l?Ft():Eo()}),e.watch(()=>k.disabled,l=>{l&&Eo(),qn()}),e.watch(()=>k.description,()=>{e.nextTick(()=>{Ae.value?po():de()})}),e.watch(()=>k.title,()=>{e.nextTick(()=>{Tt.value?Cn():oo()})}),e.watch(()=>k.customToolbarSlots,()=>{e.nextTick(()=>{To()})},{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 ae=Ce.getAttribute("data-comment")||Ce.getAttribute("data-fake-comment");if(String(ae)===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 ae=document.createRange();ae.setStart(S.startContainer,S.startOffset),ae.setEnd(S.endContainer,S.endOffset),Oo(ae),ae.surroundContents(W),i++,u.add(v)}catch{try{const Ke=S.extractContents();W.appendChild(Ke),S.insertNode(W),i++,u.add(v)}catch(Ke){console.warn("Failed to create comment marker:",Ke)}}}}}catch{}}),e.nextTick(()=>{zn("restoreCommentsFromModel"),R(),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")},zn=(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(),Ln.value)return;Ln.value=!0;const a={},r=p.value;if(!r){Ln.value=!1;return}const i=r.closest(".editor-with-comments");if(!i){Ln.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 eo=w.textContent?.trim(),to=k.comments?.find(Nn=>(typeof Nn.conversation_id=="string"&&Nn.conversation_id.startsWith("comment-")?null:Nn.conversation_id)&&Nn.selection_text?.trim()===eo);to?(W=String(to.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(),ae=window.getComputedStyle(w),Ke=parseFloat(ae.lineHeight)||parseFloat(ae.fontSize)*1.2,Pt=Ce.top-h.top+Ke/2-15,Zt=h.top-v.top+Pt;let qt=null,an=null,Xn=0;const Pn=[],On=new Set;if(W&&k.comments){const eo=k.comments.find(to=>String(to.conversation_id||to.id)===String(W));if(eo){const to=eo.conversation||[];to.length>0?(to.forEach(Nn=>{Nn.user&&Nn.user.id&&!On.has(Nn.user.id)&&(On.add(Nn.user.id),Pn.push(Nn.user))}),Xn=to.length):(Xn=0,qt=null,an=null),Pn.length>0?qt=Pn[0]:qt=null,Pn.length>1?an=Pn[1]:an=null}}const Bo=Ce.top+Ke/2-15,Ro=Bo+30,Mo=5,Uo=Ro>h.top+Mo&&Bo<h.bottom-Mo?1:0;Wt.value.find(eo=>eo.id===W);let $n=w;if(!$n&&W&&p.value){const eo=String(W);$n=p.value.querySelector(`[data-comment="${eo}"], [data-fake-comment="${eo}"]`)}const il=Pn.length;a[W]?(a[W].top=Zt,a[W].opacity=Uo,a[W].element=$n,a[W].firstUser=qt,a[W].secondUser=an,a[W].totalCount=Xn,a[W].uniqueUserCount=il):a[W]={id:W,top:Zt,opacity:Uo,element:$n,firstUser:qt,secondUser:an,totalCount:Xn,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),ae=(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||ae||W.element!==w.element}))&&(Wt.value=S),Ln.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&&(Jn(),wn.value=o,o.classList.add("editor-comment-highlighted"))},Jn=(l=!1)=>{!l&&ln.value!==null&&wn.value&&(wn.value.getAttribute("data-comment")||wn.value.getAttribute("data-fake-comment"))===ln.value||(p.value&&p.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),wn.value&&(wn.value.classList.remove("editor-comment-highlighted"),wn.value=null))},qo=l=>{if(!l||!l.element)return;Jn(!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=()=>{Jn()},Bl=()=>{!k.richText||!p.value||(Ct.value&&Ct.value.disconnect(),Yt.value!==null&&(clearTimeout(Yt.value),Yt.value=null),Ct.value=new MutationObserver(()=>{Yt.value===null&&(Yt.value=setTimeout(()=>{Yt.value=null,e.nextTick(()=>{zn("MutationObserver")})},200))}),Ct.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"]}),zn("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(()=>[ce.value,Ge.value],()=>{ce.value==="askAi"||Ge.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!==be.value&&(be.value=l)},{immediate:!0}),fe({openCommentOverlayForSelector:H,updateCommentMarkers:zn,restoreCommentsFromModel:Do}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",dn.value]),style:e.normalizeStyle(Wn.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(I)("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(I)("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=>mn("paragraph")),title:e.unref(I)("textEditor.toolbar.paragraphFormat")},[ft.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)])])):ft.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)])])):ft.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)])])):ft.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)])])):ft.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)])])):ft.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),ce.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=>hn("<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(I)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[2]||(o[2]=a=>hn("<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(I)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[3]||(o[3]=a=>hn("<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(I)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[4]||(o[4]=a=>hn("<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(I)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[5]||(o[5]=a=>hn("<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(I)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[6]||(o[6]=a=>hn("<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(I)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[7]||(o[7]=a=>hn("<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(I)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("bold")}]),onClick:o[9]||(o[9]=a=>De("bold")),title:e.unref(I)("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":ht("italic")}]),onClick:o[10]||(o[10]=a=>De("italic")),title:e.unref(I)("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":ht("underline")}]),onClick:o[11]||(o[11]=a=>De("underline")),title:e.unref(I)("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(I)("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)),we.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:ao,title:e.unref(I)("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(I)("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":ht("insertUnorderedList")}]),onClick:gl,title:e.unref(I)("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":ht("insertOrderedList")}]),onClick:hl,title:e.unref(I)("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(I)("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),Bn.value?(e.openBlock(),e.createElementBlock("div",Nc)):e.createCommentVNode("",!0),Bn.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(I)("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=>mn("askAi")),title:e.unref(I)("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",Tc,e.toDisplayString(e.unref(I)("textEditor.toolbar.askAi")),1)],8,$c),ce.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},[Vt(a)?(e.openBlock(),e.createElementBlock("div",Hc,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),Vt(a)&&r<L.customToolbarSlots.length-1&&Hn(r)?(e.openBlock(),e.createElementBlock("div",Ac)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ce.value==="paragraph"||ce.value==="askAi")&&L.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:St})):e.createCommentVNode("",!0),e.createVNode(Al,{showModal:Le.value,width:"500px",height:"55vh",onCloseModal:Fn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(I)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Dc,[e.createElementVNode("div",Rc,[e.createElementVNode("label",Ic,e.toDisplayString(e.unref(I)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:ut,type:"text","onUpdate:modelValue":o[15]||(o[15]=a=>F.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Mt,["enter"])},null,40,Fc),[[e.vModelText,F.value]])]),e.createElementVNode("div",zc,[e.createElementVNode("label",Pc,e.toDisplayString(e.unref(I)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:dt,type:"text","onUpdate:modelValue":o[16]||(o[16]=a=>je.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Mt,["enter"])},null,40,Oc),[[e.vModelText,je.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Fn},e.toDisplayString(e.unref(I)("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(I)("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(I)("textEditor.image.editImage"):e.unref(I)("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":yt.value==="upload"}]),onClick:o[17]||(o[17]=a=>yt.value="upload")},e.toDisplayString(e.unref(I)("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":yt.value==="url"}]),onClick:o[18]||(o[18]=a=>yt.value="url")},e.toDisplayString(e.unref(I)("textEditor.image.imageLink")),3)]),yt.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(I)("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(I)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Xe,type:"text","onUpdate:modelValue":o[19]||(o[19]=a=>Xt.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Un,["enter"])},null,40,Gc),[[e.vModelText,Xt.value]])]),e.createElementVNode("div",Qc,[e.createElementVNode("label",Jc,e.toDisplayString(e.unref(I)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[20]||(o[20]=a=>ee.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.image.auto"),onKeyup:e.withKeys(Un,["enter"]),onInput:Vl},null,40,ed),[[e.vModelText,ee.value]])]),e.createElementVNode("div",td,[e.createElementVNode("label",nd,e.toDisplayString(e.unref(I)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[21]||(o[21]=a=>le.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.image.auto"),onKeyup:e.withKeys(Un,["enter"]),onInput:rl},null,40,od),[[e.vModelText,le.value]])])])])):e.createCommentVNode("",!0),yt.value==="url"?(e.openBlock(),e.createElementBlock("div",ld,[e.createElementVNode("div",ad,[e.createElementVNode("div",sd,[e.createElementVNode("label",rd,e.toDisplayString(e.unref(I)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Ze,type:"text","onUpdate:modelValue":o[22]||(o[22]=a=>$t.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Un,["enter"])},null,40,id),[[e.vModelText,$t.value]])]),e.createElementVNode("div",cd,[e.createElementVNode("label",dd,e.toDisplayString(e.unref(I)("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(I)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Un,["enter"])},null,40,ud),[[e.vModelText,Xt.value]])]),e.createElementVNode("div",md,[e.createElementVNode("label",pd,e.toDisplayString(e.unref(I)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[24]||(o[24]=a=>ee.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.image.auto"),onKeyup:e.withKeys(Un,["enter"]),onInput:Vl},null,40,vd),[[e.vModelText,ee.value]])]),e.createElementVNode("div",fd,[e.createElementVNode("label",gd,e.toDisplayString(e.unref(I)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[25]||(o[25]=a=>le.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.image.auto"),onKeyup:e.withKeys(Un,["enter"]),onInput:rl},null,40,hd),[[e.vModelText,le.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(I)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Un},e.toDisplayString(e.unref(I)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":An.value&&Tt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(I)("textEditor.labels.title")),1),e.createElementVNode("div",yd,[Tt.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(Ue.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Se,value:L.title,onInput:Dn,onFocus:gn,onBlur:Io,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Tt.value}]),placeholder:Ue.value,disabled:L.disabled,rows:"1"},null,42,wd)])],2),An.value&&Tt.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(I)("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:$o,onFocus:_o,onBlur:bt,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,Td)):(e.openBlock(),e.createElementBlock("span",Ld,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,$d)):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(T.value),onInput:R,onBlur:lo,onClick:tl,onMouseup:io,onKeyup:io,onKeydown:pn,onPaste:Kn,onMousemove:wl,onMouseleave:Tl},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||Sn.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(Sn.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=>$l(a,r),["stop"]),title:e.unref(I)("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:jn,"onUpdate:modelValue":o[26]||(o[26]=a=>Yn.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(I)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Cl,["prevent","stop"]),["enter"]),onInput:o[27]||(o[27]=()=>{if(jn.value){const a=jn.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,su),[[e.vModelText,Yn.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(I)("textEditor.footer.word"):e.unref(I)("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(I)("textEditor.footer.character"):e.unref(I)("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:Ye.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(I)("textEditor.footer.word"):e.unref(I)("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(I)("textEditor.footer.character"):e.unref(I)("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(Qn,["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(I)("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(I)("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(I)("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&&ne.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:rt,class:"dss-floating-toolbar",style:e.normalizeStyle(vn.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(I)("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(I)("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(I)("textEditor.toolbar.paragraphFormat")},[ft.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)])])):ft.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)])])):ft.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)])])):ft.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)])])):ft.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)])])):ft.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),Ge.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=>kn("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(I)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[32]||(o[32]=a=>kn("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(I)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[33]||(o[33]=a=>kn("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(I)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[34]||(o[34]=a=>kn("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(I)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[35]||(o[35]=a=>kn("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(I)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[36]||(o[36]=a=>kn("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(I)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[37]||(o[37]=a=>kn("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(I)("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":ht("bold")}]),onClick:o[39]||(o[39]=e.withModifiers(a=>De("bold"),["stop"])),title:e.unref(I)("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,$u),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("italic")}]),onClick:o[40]||(o[40]=e.withModifiers(a=>De("italic"),["stop"])),title:e.unref(I)("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,Tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("underline")}]),onClick:o[41]||(o[41]=e.withModifiers(a=>De("underline"),["stop"])),title:e.unref(I)("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(I)("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)),we.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(ao,["stop"]),title:e.unref(I)("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(I)("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":ht("insertUnorderedList")}]),onClick:e.withModifiers(gl,["stop"]),title:e.unref(I)("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":ht("insertOrderedList")}]),onClick:e.withModifiers(hl,["stop"]),title:e.unref(I)("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(I)("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(I)("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(I)("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(I)("textEditor.toolbar.askAi")),1)],8,Wu),Ge.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)]),no.value?(e.openBlock(),e.createElementBlock("div",qu,[L.askAi&&no.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},[Vt(a)&&on(a)?(e.openBlock(),e.createElementBlock("div",Xu,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),Vt(a)&&on(a)&&r<L.customToolbarSlots.length-1&&Vn(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"},$1={class:"dss-datepicker__calendar-header"},T1={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,I=fe,{t:be,locale:k}=cl.useI18n(),Me=e.ref(!1),oe=e.ref("days"),Fe=e.ref(new Date().getMonth()),p=e.ref(new Date().getFullYear()),ce=e.ref(new Date().getMonth()),we=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 je(){const T=Le.getMonth(),P=Le.getFullYear(),A=T===11?0:T+1,G=T===11?P+1:P;return{left:{month:T,year:P},right:{month:A,year:G}}}const F=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)),ne=e.computed(()=>["range","rangeFromAvailable"].includes(D.mode)),vn=e.computed(()=>{if(D.mode!=="single"&&D.mode!=="singleFromAvailable")return null;const T=D.modelValue;return T instanceof Date?T:null}),rt=e.computed(()=>{if(!ne.value)return{start:null,end:null};const T=D.modelValue;return!T||typeof T!="object"?{start:null,end:null}:{start:T.start instanceof Date?T.start:null,end:T.end instanceof Date?T.end:null}});function Ge(T){if(!T||!(T instanceof Date))return"";const P=T.getDate(),A=T.getMonth()+1,G=T.getFullYear(),ke=We=>String(We).padStart(2,"0");return`${ke(P)}/${ke(A)}/${G}`}const sn=e.computed(()=>Ge(vn.value)),Xt=e.computed(()=>{const{start:T,end:P}=rt.value;if(!T&&!P)return"";const A=!P||T&&T<=P?T:P,G=!T||P&&P>=T?P:T;return qe(A,G)?Ge(A):`${Ge(A)} - ${Ge(G)}`}),re=e.computed(()=>{if(D.mode!=="readonly")return"—";const T=D.modelValue;if(T instanceof Date)return Ge(T)||"—";if(T&&typeof T=="object"&&("start"in T||"end"in T)){const P=T.start instanceof Date?T.start:null,A=T.end instanceof Date?T.end:null;if(!P&&!A)return"—";const G=!A||P&&P<=A?P:A,ke=!P||A&&A>=P?A:P;return qe(G,ke)?Ge(G):`${Ge(G)} - ${Ge(ke)}`}return"—"});e.computed(()=>{const T=new Date(p.value,Fe.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format(T)});const xe=e.computed(()=>Pe.value==="left"?ce.value:Pe.value==="right"?ge.value:Fe.value),ee=e.computed(()=>Pe.value==="left"?we.value:Pe.value==="right"?j.value:p.value),le=e.computed(()=>{const T=new Date(p.value,Fe.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format(T)}),Xe=e.computed(()=>{const T=new Date(ee.value,xe.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format(T)}),ct=e.computed(()=>{const T=new Intl.DateTimeFormat(k.value,{month:"short"});return Array.from({length:12},(P,A)=>T.format(new Date(2024,A,1)))}),Ze=e.computed(()=>{const P=(Pe.value?ee.value:p.value)-Math.floor(Wl/2);return Array.from({length:Wl},(A,G)=>P+G)}),Ve=e.computed(()=>{const T=Ze.value;return T.length?`${T[0]} – ${T[T.length-1]}`:""}),Ot=e.computed(()=>{const T=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(T.format(ke).slice(0,2))}return A});function _t(T,P){const A=new Date(T,P,1),G=new Date(T,P+1,0),ke=A.getDay(),We=G.getDate(),Ue=[];for(let Ie=0;Ie<ke;Ie++)Ue.push(null);for(let Ie=1;Ie<=We;Ie++)Ue.push(new Date(T,P,Ie));return Ue}const ot=e.computed(()=>_t(p.value,Fe.value)),tn=e.computed(()=>_t(we.value,ce.value)),Rt=e.computed(()=>_t(j.value,ge.value));e.computed(()=>{const T=new Date(we.value,ce.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format(T)}),e.computed(()=>{const T=new Date(j.value,ge.value,1);return new Intl.DateTimeFormat(k.value,{month:"long",year:"numeric"}).format(T)});const yt=e.computed(()=>{const T=new Date(we.value,ce.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format(T)}),$t=e.computed(()=>{const T=new Date(j.value,ge.value,1);return new Intl.DateTimeFormat(k.value,{month:"long"}).format(T)}),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 kt(){if(!he.value||!Me.value)return;const T=he.value.getBoundingClientRect(),P=window.innerWidth||document.documentElement.clientWidth,A=window.innerHeight||document.documentElement.clientHeight;let G=T.left,ke=T.bottom+4;const We=Dt.value;if(We){const Ue=We.offsetWidth,Ie=We.offsetHeight;if(G+Ue>P-8&&(G=T.right-Ue,G<8&&(G=8)),ke+Ie>A-8){const Ye=T.top-4-Ie;Ye>=8?ke=Ye:ke=Math.max(8,A-Ie-8)}}tt.value={top:ke,left:G}}const $e=e.computed(()=>!he.value||!Me.value?{}:{position:"fixed",left:`${tt.value.left}px`,top:`${tt.value.top}px`,zIndex:1002});function qe(T,P){return!T||!P?!1:T.getFullYear()===P.getFullYear()&&T.getMonth()===P.getMonth()&&T.getDate()===P.getDate()}function O(T){return new Date(T.getFullYear(),T.getMonth(),T.getDate()).getTime()}function Z(T){return!D.availableDates||!D.availableDates.length?!0:D.availableDates.some(P=>P instanceof Date&&qe(P,T))}function X(T){const P=O(T);return!(D.minDate instanceof Date&&P<O(D.minDate)||D.maxDate instanceof Date&&P>O(D.maxDate))}function J(T){return!D.exceptDates||!D.exceptDates.length?!1:D.exceptDates.some(P=>P instanceof Date&&qe(P,T))}function ye(T){return J(T)?!1:["singleFromAvailable","rangeFromAvailable"].includes(D.mode)?Z(T):X(T)}function et(T){const P=vn.value,A=rt.value,G=O(T),ke=ne.value&&A.start&&A.end&&G>O(A.start)&&G<O(A.end),We=ne.value&&A.start&&qe(T,A.start),Ue=ne.value&&A.end&&qe(T,A.end),Ie=We&&Ue,Ye=Be.value&&P&&qe(T,P)||We||Ue;let Vt=!1;if(ne.value&&A.start&&!A.end&&_e.value){const Hn=O(A.start),Vn=O(_e.value),on=Math.min(Hn,Vn),no=Math.max(Hn,Vn);Vt=G>on&&G<no}return{"dss-datepicker__day--selected":Ye&&!Ie,"dss-datepicker__day--range-start":We&&!Ie,"dss-datepicker__day--range-end":Ue&&!Ie,"dss-datepicker__day--range-single":Ie,"dss-datepicker__day--in-range":ke&&!We&&!Ue,"dss-datepicker__day--in-range-preview":Vt&&!We&&!Ue&&!ke,"dss-datepicker__day--disabled":!ye(T)}}function Se(T){if(!ne.value)return;const P=rt.value;if(!P.start||P.end){_e.value=null;return}if(!ye(T)){_e.value=null;return}_e.value=new Date(T.getFullYear(),T.getMonth(),T.getDate())}function Oe(){_e.value=null}function mt(){if(!D.doubleCalendar||!ne.value)return;const T=rt.value,{start:P,end:A}=T;if(P&&A){const We=P<=A?P:A,Ue=P<=A?A:P,Ie=We.getMonth(),Ye=We.getFullYear(),Vt=Ue.getMonth(),Hn=Ue.getFullYear();if(Ie!==Vt||Ye!==Hn){const Vn=ce.value===Ie&&we.value===Ye,on=ge.value===Vt&&j.value===Hn;if(Vn&&on)return;ce.value=Ie,we.value=Ye,ge.value=Vt,j.value=Hn}else{const Vn=Ie===0?11:Ie-1,on=Ie===0?Ye-1:Ye;ce.value===Vn&&we.value===on&&ge.value===Ie&&j.value===Ye||(ce.value=Ie,we.value=Ye,Ie===11?(ge.value=0,j.value=Ye+1):(ge.value=Ie+1,j.value=Ye))}return}const G=P||A;if(G){const We=G.getMonth(),Ue=G.getFullYear(),Ie=ce.value===We&&we.value===Ue,Ye=ge.value===We&&j.value===Ue;if(Ie||Ye)return;ce.value=We,we.value=Ue,We===11?(ge.value=0,j.value=Ue+1):(ge.value=We+1,j.value=Ue);return}const ke=je();ce.value=ke.left.month,we.value=ke.left.year,ge.value=ke.right.month,j.value=ke.right.year}function Et(T="start"){if(D.mode==="readonly")return;_.value=T;const P=vn.value,A=rt.value;if(Be.value&&P)Fe.value=P.getMonth(),p.value=P.getFullYear();else if(ne.value)if(D.doubleCalendar)mt();else{const G=T==="start"&&A.start?A.start:A.end||A.start;G&&(Fe.value=G.getMonth(),p.value=G.getFullYear())}he.value=Be.value?F.value?.closest(".dss-datepicker__input-wrap"):dt.value,oe.value="days",Pe.value=null,Me.value=!0,e.nextTick(()=>{kt()})}function Nt(){oe.value="days",Pe.value=null,_e.value=null,Me.value=!1}function Tt(T,P){Pe.value=T,oe.value=P}function Ae(){oe.value="days",Pe.value=null}function It(T){const P=new Date,A=P.getFullYear(),G=P.getMonth(),ke=P.getDate();let We,Ue;if(st.value){const Ie=[...D.availableDates].filter(Ye=>Ye instanceof Date).map(Ye=>new Date(Ye.getFullYear(),Ye.getMonth(),Ye.getDate()));if(Ie.sort((Ye,Vt)=>Ye.getTime()-Vt.getTime()),Ie.length===0)return;if(T==="all")We=Ie[0],Ue=Ie[Ie.length-1];else{const Ye=parseInt(T.replace("last",""),10);if(Ye<2||Ye>5)return;const Vt=Ie.slice(-Ye);We=Vt[0],Ue=Vt[Vt.length-1]}}else{const Ie=new Date(A,G,ke);switch(T){case"today":We=Ie,Ue=Ie;break;case"lastWeek":We=new Date(A,G,ke-6),Ue=Ie;break;case"last15Days":We=new Date(A,G,ke-14),Ue=Ie;break;case"last30Days":We=new Date(A,G,ke-29),Ue=Ie;break;case"thisMonth":We=new Date(A,G,1),Ue=Ie;break;case"last3Months":We=new Date(A,G-3,1),Ue=new Date(A,G,0);break;case"last6Months":We=new Date(A,G-6,1),Ue=new Date(A,G,0);break;case"last12Months":We=new Date(A,G-12,1),Ue=new Date(A,G,0);break;case"lastYear":We=new Date(A-1,0,1),Ue=new Date(A-1,11,31);break;default:return}}I("update:modelValue",{start:We,end:Ue}),mt()}function ft(T){Pe.value==="left"?ce.value=T:Pe.value==="right"?ge.value=T:Fe.value=T,Ae()}function Bn(T){Pe.value==="left"?we.value=T:Pe.value==="right"?j.value=T:p.value=T,Ae()}function Wt(){Fe.value===0?(Fe.value=11,p.value--):Fe.value--}function Ct(){Fe.value===11?(Fe.value=0,p.value++):Fe.value++}function Bt(){ce.value===0?(ce.value=11,we.value--):ce.value--}function Tn(){ce.value===11?(ce.value=0,we.value++):ce.value++}function Ln(){ge.value===0?(ge.value=11,j.value--):ge.value--}function rn(){ge.value===11?(ge.value=0,j.value++):ge.value++}function cn(T){if(!ye(T))return;const P=new Date(T.getFullYear(),T.getMonth(),T.getDate());if(Be.value){I("update:modelValue",P),Nt();return}const A=rt.value;if(!A.start&&!A.end){I("update:modelValue",{start:P,end:null}),_.value="end";return}if(A.start&&A.end){I("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]),I("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]),I("update:modelValue",{start:G||ke,end:ke||G}),_.value="start"}}e.watch(rt,()=>{D.doubleCalendar&&ne.value&&Me.value&&mt()},{deep:!0});let Yt=null,dn=null,Wn=null;function mo(){Yt&&(document.removeEventListener("keydown",Yt),Yt=null),dn&&(window.removeEventListener("resize",dn),dn=null),Wn&&(window.removeEventListener("scroll",Wn,!0),Wn=null)}return e.watch(Me,T=>{mo(),T&&(Yt=P=>{P.key==="Escape"&&(oe.value==="years"||oe.value==="months"?Ae():Nt())},dn=()=>{kt()},Wn=()=>{kt()},document.addEventListener("keydown",Yt),window.addEventListener("resize",dn),window.addEventListener("scroll",Wn,!0))}),e.onBeforeUnmount(()=>{mo()}),(T,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:re.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:F,type:"text",class:"dss-datepicker__input",placeholder:e.unref(be)("datepicker.selectDate"),value:sn.value,readonly:"",disabled:L.mode==="readonly"},null,8,Ju)])):ne.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(be)("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&&ne.value&&oe.value==="days","dss-datepicker__dropdown--quick-select":L.doubleCalendar&&ne.value&&oe.value==="days"&&L.quickSelect}]),style:e.normalizeStyle($e.value)},[oe.value==="days"&&L.doubleCalendar&&ne.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(be)(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(be)("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=>Tt("left","months"))},e.toDisplayString(yt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[3]||(P[3]=A=>Tt("left","years"))},e.toDisplayString(we.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(be)("datepicker.nextMonth"),onClick:Tn}," › ",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(be)("datepicker.prevMonth"),onClick:Ln}," ‹ ",8,g1),e.createElementVNode("div",h1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[4]||(P[4]=A=>Tt("right","months"))},e.toDisplayString($t.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[5]||(P[5]=A=>Tt("right","years"))},e.toDisplayString(j.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(be)("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))])])])])):oe.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(be)("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=>oe.value="months")},e.toDisplayString(le.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[7]||(P[7]=A=>oe.value="years")},e.toDisplayString(p.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(be)("datepicker.nextMonth"),onClick:Ct}," › ",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)):oe.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",$1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:Ae}," ‹ "),e.createElementVNode("div",T1,[e.createElementVNode("span",L1,e.toDisplayString(Xe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[8]||(P[8]=A=>oe.value="years")},e.toDisplayString(ee.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=>ft(G)},e.toDisplayString(A),11,A1))),128))])],64)):oe.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===ee.value,"dss-datepicker__year-cell--current":A===e.unref(nt)}]),onClick:G=>Bn(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,J=parseInt(Z[2],16)/255,ye=parseInt(Z[3],16)/255,et=Math.max(X,J,ye),Se=Math.min(X,J,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=((J-ye)/Nt+(J<ye?6:0))/6;break;case J:Oe=((ye-X)/Nt+2)/6;break;case ye:Oe=((X-J)/Nt+4)/6;break}}return{h:Oe*360,s:mt*100,l:Et*100}}function I(O,Z,X){Z/=100,X/=100;const J=Z*Math.min(X,1-X),ye=et=>{const Se=(et+O/30)%12,Oe=X-J*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 be(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(J=>J+J).join("")),"#"+X}function k(O,Z,X){Z/=100,X/=100;const J=X+Z*Math.min(X,1-X),ye=J===0?0:2-2*X/J;return{h:O,s:ye*100,v:J*100}}function Me(O,Z,X){Z/=100,X/=100;const J=X*(1-Z/2),ye=J===0||J===1?0:(X-J)/Math.min(J,1-J);return{h:O,s:ye*100,l:J*100}}const oe=L,Fe=fe,p=e.ref(!1),ce=e.ref(!1),we=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),je=e.ref({top:0,left:0}),F=e.ref(D(oe.modelValue||"#b8a5de")),dt=e.computed(()=>Array.isArray(oe.presetGroups)&&oe.presetGroups.length>0),ut=e.computed(()=>dt.value?0:oe.initialPresetCount!=null?oe.initialPresetCount:j.value<0?null:j.value),he=e.computed(()=>{const O=ut.value;return O==null?!0:Math.max(0,oe.presetColors.length-O)<oe.max}),Dt=e.computed(()=>!!(ce.value||ge.value>=0||!xt.value&&oe.presetColors.length===0));e.computed(()=>{const O=ut.value;return O!=null&&oe.presetColors.length>O});const xt=e.computed(()=>dt.value||ut.value!=null),nt=e.computed(()=>{const O=ut.value;return O==null?[]:oe.presetColors.slice(0,O)}),Be=e.computed(()=>{const O=ut.value;return O==null?[]:oe.presetColors.slice(O)});function ne(O){const Z=ut.value;return Z!=null?Z+O:-1}function vn(O){const Z=ut.value;return Z!=null&&O>=Z}function rt(O){vn(O)&&(ge.value=O,F.value=D(oe.presetColors[O]),ce.value=!0,e.nextTick(()=>Le.value?.focus()))}function Ge(O){if(!vn(O))return;const Z=oe.presetColors.filter((ye,et)=>et!==O);Fe("update:presetColors",Z);const X=be(oe.modelValue),J=be(oe.presetColors[O]);if(X&&J&&X.toLowerCase()===J.toLowerCase()){const ye=Z[Math.max(0,O-1)]||Z[0];ye&&Fe("update:modelValue",ye)}}function sn(){we.value=!we.value,we.value||(ge.value=-1,ce.value=!1)}function Xt(){if(ge.value<0)return;const O=le.value,Z=be(O);if(Z){const X=[...oe.presetColors];X[ge.value]=Z,Fe("update:presetColors",X),Fe("update:modelValue",Z),ge.value=-1,ce.value=!1}}function re(){oe.disabled||(ge.value=-1,ce.value=!ce.value,ce.value&&(ot(),e.nextTick(()=>Le.value?.focus())))}function xe(O){const Z=be(O),X=be(oe.modelValue);return Z&&X&&Z.toLowerCase()===X.toLowerCase()}function ee(){if(oe.disabled||!he.value)return;const O=le.value,Z=be(O);if(Z){const X=[...oe.presetColors,Z];Fe("update:presetColors",X),Fe("update:modelValue",Z);const J=ut.value??j.value;J>=0&&X.length-J>=oe.max&&(ce.value=!1)}}const le=e.computed(()=>{const{h:O,s:Z,l:X}=F.value;return I(O,Z,X)}),Xe=e.computed(()=>le.value.toLowerCase()),ct=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${F.value.h}, 100%, 50%))`})),Ze=e.computed(()=>{const O=k(F.value.h,F.value.s,F.value.l);return{left:`${O.s}%`,bottom:`${O.v}%`,transform:"translate(-50%, 50%)"}}),Ve=e.computed(()=>({left:`${F.value.h/360*100}%`,transform:"translateX(-50%)"})),Ot=e.computed(()=>({position:"fixed",left:`${je.value.left}px`,top:`${je.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 J=_e.value;J&&X+J.offsetHeight>Z-8&&(X=O.top-4-J.offsetHeight),je.value={top:X,left:O.left}}function ot(){const O=oe.modelValue||"#b8a5de";be(O)&&(F.value=D(O))}function tn(){Fe("update:modelValue",le.value)}function Rt(){oe.disabled||(p.value=!p.value,p.value&&(ot(),e.nextTick(()=>{_t(),Le.value?.focus()})))}function yt(){const O=le.value,Z=be(O);if(Z){if(ge.value>=0){const X=[...oe.presetColors];X[ge.value]=Z,Fe("update:presetColors",X),Fe("update:modelValue",Z)}else if((oe.presetColors.length>0||dt.value)&&ce.value&&he.value&&!oe.presetColors.some(J=>be(J)?.toLowerCase()===Z.toLowerCase())){const J=[...oe.presetColors,Z];Fe("update:presetColors",J),Fe("update:modelValue",Z)}}p.value=!1,ce.value=!1,we.value=!1,ge.value=-1}function $t(O){if(!Pe.value)return;const Z=Pe.value.getBoundingClientRect(),X=J=>{const ye=Math.max(0,Math.min(1,(J.clientX-Z.left)/Z.width)),et=Math.max(0,Math.min(1,1-(J.clientY-Z.top)/Z.height)),Se={h:F.value.h,s:ye*100,v:et*100};F.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(),J=ye=>{const et=Math.max(0,Math.min(1,(ye.clientX-X.left)/X.width));F.value={...F.value,h:et*360}};J(O),document.addEventListener("mousemove",J),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",J),tn()},{once:!0})}function nn(O){const Z=O.target.value,X=be(Z);X&&(F.value=D(X),Fe("update:modelValue",X))}function tt(O){if(oe.disabled)return;const Z=be(O);Z&&(F.value=D(Z),Fe("update:modelValue",Z))}let kt=null,$e=null;function qe(){kt&&(document.removeEventListener("keydown",kt),kt=null),$e&&(window.removeEventListener("resize",$e),$e=null)}return e.watch(p,O=>{if(qe(),O){if(!dt.value&&oe.initialPresetCount==null){const Z=oe.presetColors.length;Z>0&&(j.value<0||Z<j.value)&&(j.value=Z)}kt=Z=>{Z.key==="Escape"&&yt()},$e=_t,document.addEventListener("keydown",kt),window.addEventListener("resize",$e)}}),e.watch(()=>oe.modelValue,()=>{p.value&&ot()},{immediate:!1}),e.watch(Be,O=>{O.length===0&&(we.value=!1,ge.value=-1,ce.value=!1)}),e.onBeforeUnmount(qe),(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:le.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(yt,["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,J)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+J,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-"+J+"-"+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,J)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+J,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":we.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,J)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+J,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":we.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!we.value&&xe(X),"dss-color-picker__preset-bubble--editing":we.value&&ge.value===ne(J)}]),style:e.normalizeStyle({backgroundColor:ge.value===ne(J)?le.value:X}),title:ge.value===ne(J)?le.value:X,onClick:e.withModifiers(ye=>we.value?rt(ne(J)):tt(X),["stop"])},null,14,K1),we.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=>Ge(ne(J)),["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":ce.value}]),onClick:e.withModifiers(re,["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,J)=>(e.openBlock(),e.createElementBlock("button",{key:J,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":ce.value}]),onClick:e.withModifiers(re,["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:$t},[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:Xe.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:ee}," 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:yt}," 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),I=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(be,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",D.value]),style:e.normalizeStyle(I.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(be.$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}),I=e.computed(()=>{const k={};return fe.borderRadius&&(k.borderRadius=fe.borderRadius),k}),be=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(be.value)},[L.loading&&L.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(I.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,I=fe,be={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(()=>({...be,...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})),oe=e.ref(null),Fe=e.ref(null),p=e.ref(-1),ce=e.ref(null);let we=null,ge=null,j=null,_=null,_e=0,Pe=0;const Le=e.computed(()=>{const re={};for(const xe of D.columns)re[xe.value]=D.items.filter(ee=>ee[D.columnKey]===xe.value).sort((ee,le)=>(ee[D.positionKey]??0)-(le[D.positionKey]??0));return re}),je=e.computed(()=>{const re={},xe=!!oe.value,ee=oe.value?.[D.itemKey],le=Fe.value,Xe=p.value;for(const ct of D.columns){const Ze=Le.value[ct.value]||[],Ve=[],Ot=le==ct.value;let _t=0;for(let ot=0;ot<Ze.length;ot++){const tn=Ze[ot],Rt=xe&&tn[D.itemKey]===ee;!Rt&&Ot&&Xe===_t&&Ve.push({type:"indicator",key:`ind-${_t}`}),Rt||_t++,Ve.push({type:"item",item:tn,isDragged:Rt,key:`item-${tn[D.itemKey]}`})}Ot&&Xe>=_t&&Ve.push({type:"indicator",key:"ind-end"}),re[ct.value]=Ve}return re});function F(re,xe){const le=(Le.value[re]||[]).filter(Ze=>Ze[D.itemKey]!==oe.value?.[D.itemKey]);if(le.length===0)return 1;if(xe<=0){const Ze=le[0][D.positionKey];return Ze!=null&&Ze>0?Ze/2:.5}if(xe>=le.length){const Ze=le[le.length-1][D.positionKey];return(Ze??0)+1}const Xe=le[xe-1][D.positionKey]??0,ct=le[xe][D.positionKey]??0;return(Xe+ct)/2}function dt(re,xe,ee){j&&j.remove();const le=re.getBoundingClientRect(),Xe=re.cloneNode(!0);Xe.classList.add("dss-dnd-ghost"),Xe.style.cssText=`
|
|
100
|
+
</svg>`,f=e.ref(null),ue=e.ref(null),ve=e.ref(!1),de=e.ref(!1),te=e.ref(!1),S=e.ref(""),ae=e.ref({}),Ze=e.ref(!1),He=e.ref(!1),Ve=e.ref(""),O=e.ref(""),lt=e.ref(null),je=e.ref(null),Ne=e.ref(null),Ht=e.ref(null),Bt=e.ref(""),pt=e.ref(!1),Re=e.ref({}),ge=e.ref(!1),gt=e.ref({}),wt=e.ref(null),tt=e.ref(null),Mt=e.ref(!1),Ft=e.ref(""),on=e.ref(null),xt=e.ref(""),Ke=e.ref(""),Ge=e.ref(""),Zt=e.ref(null),At=e.ref(null),_t=e.ref(null),U=e.ref(null),Ie=e.ref(null),_e=e.ref(!1),fe=e.ref(""),ct=e.ref({}),Et=e.ref(!1),We=e.ref("upload"),ft=e.ref(""),dt=e.ref(null),$t=e.ref(null),ot=e.ref([]),bt=e.ref([]),Se=e.ref(null),ut=e.ref(!1),X=e.ref(""),j=e.ref(""),Q=e.ref(""),re=e.ref(""),x=e.ref(""),k=e.ref(""),V=e.ref(null),P=e.ref(null),Y=e.ref(null),xe=e.ref(!1),Ye=e.ref(null),Le=e.ref(!1),le=e.ref(!1),Qe=e.ref(null),qe=e.ref("p"),Vt=e.ref(!1),vt=e.ref([]),Ue=e.ref(null),Dt=e.ref(null),$n=e.ref(null),Tn=e.ref(!1),cn=e.ref(0),yn=100,an=e.ref(null),un=e.computed(()=>({"dss-text-editor-no-border":!C.border,"dss-text-editor-rounded":C.rounded,"dss-text-editor-full-height":C.fullHeight,"dss-comment-overlay-open":Kt.value!==null})),zn=e.computed(()=>({})),Ln=e.computed(()=>!C.fixedHeight||C.fullHeight?{}:{height:`${1.6*14*C.rows+24+2}px`,resize:"none",overflowY:"auto"}),hl=e.computed(()=>!C.fixedHeight||C.fullHeight?{}:{height:`${1.6*14*C.rows+32}px`,overflowY:"auto"}),A=e.computed(()=>C.richText&&bt.value.length>0),q=e.computed(()=>{if(!C.modelValue)return"";if(C.richText){let o=C.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/ /g," "),o=o.replace(/&/g,"&"),o=o.replace(/</g,"<"),o=o.replace(/>/g,">"),o=o.replace(/"/g,'"'),o=o.replace(/'/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return C.modelValue}),I=e.computed(()=>{const o=q.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),ne=e.computed(()=>q.value.length),Be=e.computed(()=>U.value!==null&&We.value==="upload"&&xt.value&&xt.value.startsWith("data:")),Je=e.computed(()=>C.titlePlaceholder||R("textEditor.placeholders.title")),rt=e.computed(()=>C.descriptionPlaceholder||R("textEditor.placeholders.description")),Fe=e.computed(()=>C.placeholder||R("textEditor.placeholders.startTyping")),at=o=>ie&&ie[o]!==void 0,sn=o=>{for(let l=o+1;l<C.customToolbarSlots.length;l++)if(at(C.customToolbarSlots[l]))return!0;return!1},Nn=o=>{for(let l=o+1;l<C.customToolbarSlots.length;l++){const a=C.customToolbarSlots[l];if(at(a)&&nn(a))return!0}return!1},nn=o=>C.customToolbarFloatingMap.hasOwnProperty(o)?C.customToolbarFloatingMap[o]===!0:!0,Hn=e.computed(()=>C.customToolbarSlots.some(o=>at(o)&&nn(o))),Cn=e.computed(()=>at("title-slot")),dn=e.computed(()=>at("description-slot")),fn=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},Pn=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),a=l.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():l},yl=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=l.nextNode();for(;r;)a.push(r),r=l.nextNode();a.forEach(c=>c.remove())},Xl=o=>{try{const l=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${r} ${c}`}catch{return""}},Cl=o=>{if(!o||typeof o!="string")return!1;const l=o.trim();if(!l)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(l))return!0;try{const c=R("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const r=l.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},kl=o=>{const l=o.target.value;Te("update:modelValue",l),Te("change",l)},kn=()=>{if(!V.value)return;const o=V.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},vn=()=>{Le.value=!0,kn()},Al=()=>{Le.value=!1,ol()},ol=()=>{if(!V.value)return;const o=V.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const a=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},An=o=>{const a=o.target.value;Le.value&&kn(),Te("update:title",a),Te("title-change",a),Y.value="title",C.richText&&(ut.value||(j.value=X.value,x.value=Q.value,k.value=re.value),Se.value&&clearTimeout(Se.value),ut.value=!0,Se.value=setTimeout(()=>{ut.value=!1,ze()},500))},fl=()=>{if(!P.value)return;const o=P.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},Vl=()=>{le.value=!0,fl()},Rt=()=>{le.value=!1,Ce()},Ce=()=>{if(!P.value)return;const o=P.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const a=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},Nl=o=>{const a=o.target.value;le.value&&fl(),Te("update:description",a),Te("description-change",a),Y.value="description",C.richText&&(ut.value||(j.value=X.value,x.value=Q.value,k.value=re.value),Se.value&&clearTimeout(Se.value),ut.value=!0,Se.value=setTimeout(()=>{ut.value=!1,ze()},500))},Xe=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const l=o.getRangeAt(0);if(l.startContainer.nodeType===1)return{type:"element",element:l.startContainer,offset:l.startOffset};const a=l.cloneRange();return a.selectNodeContents(f.value),a.setEnd(l.startContainer,l.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+l.toString().length}},jt=o=>{if(!(!o||!f.value))try{const l=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),l.removeAllRanges(),l.addRange(a);return}else{f.value.focus();return}let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}l.removeAllRanges(),l.addRange(a)}catch{f.value.focus()}},Pe=()=>{if(!f.value)return;f.value.focus();const o=window.getSelection(),l=document.createRange(),a=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],m=a(u);if(m)return m}return c},r=a(f.value);if(r.nodeType===3)l.setStart(r,r.length),l.setEnd(r,r.length);else if(r.childNodes.length>0){const c=a(r);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(r),l.collapse(!1))}else l.setStart(r,0),l.setEnd(r,0);o.removeAllRanges(),o.addRange(l)},ze=(o=!1)=>{if(!f.value)return;const l=f.value.innerHTML,a=C.title||"",r=C.description||"";if(!o&&l===X.value&&a===Q.value&&r===re.value)return;const c={content:j.value||X.value,title:x.value!==void 0?x.value:Q.value,description:k.value!==void 0?k.value:re.value},d=ot.value.length>0?ot.value[ot.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(ot.value.push(c),ot.value.length>50&&ot.value.shift(),bt.value=[]),X.value=l,Q.value=a,re.value=r,j.value=l,x.value=a,k.value=r},Z=o=>{if(!f.value)return;Tt(),f.value&&yl(f.value);let l=null;f.value&&(f.value.querySelector("p")||(l=Xe(),he()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&Qe.value&&(Qe.value=null),de.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=fn(r);Te("update:modelValue",c),Te("change",c),Y.value="editor",ut.value||(j.value=X.value,x.value=Q.value,k.value=re.value),Se.value&&clearTimeout(Se.value),ut.value=!0,Se.value=setTimeout(()=>{ut.value=!1,ze(),Ot(),Ut()},500),e.nextTick(()=>{l&&jt(l),Tt();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(h=>{try{if(v&&Qe.value?.command===h){Re.value[h]=Qe.value.state;return}if(h==="bold")if(m){const _=m.commonAncestorContainer,$=_.nodeType===3?_.parentElement:_;let N=!1;if($&&(($.tagName==="STRONG"||$.tagName==="B"||$.closest&&$.closest("strong, b"))&&(N=!0),!N&&$.style&&parseInt($.style.fontWeight)>=600&&(N=!0),!N))try{const J=window.getComputedStyle($);parseInt(J.fontWeight)>=600&&(N=!0)}catch{}Re.value[h]=N}else Re.value.hasOwnProperty(h)||(Re.value[h]=!1);else if(h==="italic")if(m){const _=m.commonAncestorContainer,$=_.nodeType===3?_.parentElement:_,N=$&&($.tagName==="EM"||$.tagName==="I"||$.closest&&$.closest("em, i"));Re.value[h]=!!N}else{const _=document.queryCommandState(h);Re.value[h]=_}else{const _=document.queryCommandState(h);Re.value[h]=_}}catch{}}),Sn(),Mn(),W(),qt(),En(),Rn("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>Ut(h),0),(h===" "||h===`
|
|
101
|
+
`||/[.,;:!?]/.test(h))&&setTimeout(()=>{Ot()},100)}de.value=!1})},Tt=()=>{if(!f.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=l.startContainer.nodeType===3?l.startContainer.parentElement:l.startContainer,m=l.endContainer.nodeType===3?l.endContainer.parentElement:l.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},he=()=>{if(!f.value)return;const o=f.value;if(o.querySelector&&o.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(o.childNodes);let r=null;a.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(l.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},Mn=()=>{if(f.value&&!xe.value){xe.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),_=c===d||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||_||_)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.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(u){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=nt,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{xe.value=!1}}},Dl=o=>{Ot(),Te("blur",o),Ml()},w=()=>{if(C.disabled||!C.richText||!f.value)return;It(),Se.value&&(clearTimeout(Se.value),Se.value=null),ut.value&&(ze(),ut.value=!1);const o=Y.value==="title",l=Y.value==="description",a=Y.value==="editor";if(ot.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{Z()});return}const r={content:f.value.innerHTML,title:C.title||"",description:C.description||""};bt.value.push(r);const c=ot.value.pop();if(c!==void 0){de.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,X.value=d,Q.value=u,re.value=m,j.value=d,x.value=u,k.value=m,e.nextTick(()=>{Sn(),wn(),Zn(),qt();const v=fn(d);Te("update:modelValue",v),Te("update:title",u),Te("update:description",m),Te("change",v),Te("title-change",u),Te("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),kn()}}else if(l){if(P.value){P.value.focus();const h=m.length;P.value.setSelectionRange(h,h)}}else if(a)Pe();else if(V.value&&document.activeElement===V.value){const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),kn()}else if(P.value&&document.activeElement===P.value){const h=m.length;P.value.setSelectionRange(h,h)}else f.value&&Pe()},10)})})}},y=()=>{if(C.disabled||!C.richText||!f.value)return;It();const o=Y.value==="title",l=Y.value==="description",a=Y.value==="editor";if(bt.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{Z()});return}const r={content:f.value.innerHTML,title:C.title||"",description:C.description||""};ot.value.push(r);const c=bt.value.pop();if(c!==void 0){de.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,X.value=d,Q.value=u,re.value=m,j.value=d,x.value=u,k.value=m,e.nextTick(()=>{Sn(),wn(),Zn(),qt();const v=fn(d);Te("update:modelValue",v),Te("update:title",u),Te("update:description",m),Te("change",v),Te("title-change",u),Te("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),kn()}}else if(l){if(P.value){P.value.focus();const h=m.length;P.value.setSelectionRange(h,h)}}else if(a)Pe();else if(V.value&&document.activeElement===V.value){const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),kn()}else if(P.value&&document.activeElement===P.value){const h=m.length;P.value.setSelectionRange(h,h)}else f.value&&Pe()},10)})})}},B=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},W=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},se=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){a=!0;break}if(c.style&&c.style.fontStyle==="italic"){a=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{W()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{W()});else try{const r=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{W()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{W()})}return!0},mt=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){a=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){a=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{B()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const h=document.createDocumentFragment();for(;u.firstChild;)h.appendChild(u.firstChild);v.appendChild(h),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}B()});else try{const r=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{B()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{B()})}return!0},et=(o,l=null)=>{if(C.disabled||!C.richText||!f.value)return;ut.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),ze(),ut.value=!1):ze(),It(),f.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&Wn(d)&&(r=Xe())}if(o==="createLink"&&l){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const v=document.createTextNode(l);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=mt();Re.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(Qe.value={command:"bold",state:d}),e.nextTick(()=>{r&&(jt(r),e.nextTick(()=>{const m=ht("bold");Re.value.bold=m})),Z(),wn(),qt()});return}if(o==="italic"){const d=se();Re.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(Qe.value={command:"italic",state:d}),e.nextTick(()=>{r&&(jt(r),e.nextTick(()=>{const m=ht("italic");Re.value.italic=m})),Z(),W(),wn(),qt()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&jt(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=ht("bold");Re.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=ht("italic");Re.value.italic=u});else{const u=document.queryCommandState(o);Re.value[o]=u}else{const u=document.queryCommandState(o);Re.value[o]=u}}catch{Re.value.hasOwnProperty(o)?Re.value[o]=!Re.value[o]:Re.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const v=u.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",l)}f.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",l)})}Z(),wn(),qt()})},ht=(o,l=null)=>{if(C.disabled||!f.value)return!1;try{if(o==="formatBlock"&&l){const r=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===l||r.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const h=window.getComputedStyle(v);parseInt(h.fontWeight)>=600&&(u=!0)}catch{}return Re.value.hasOwnProperty(o)?Re.value[o]:(Re.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let N=_.parentElement;for(;N&&N!==f.value;){if(N.tagName==="STRONG"||N.tagName==="B"){u=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){u=!0;break}N=N.parentElement}}else if(_.nodeType===1){const $=_;if($.tagName==="STRONG"||$.tagName==="B"){u=!0;break}if($.style&&parseInt($.style.fontWeight)>=600){u=!0;break}}if(u)break}}return Re.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return Re.value.hasOwnProperty(o)?Re.value[o]:(Re.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let N=_.parentElement;for(;N&&N!==f.value;){if(N.tagName==="EM"||N.tagName==="I"){u=!0;break}if(N.style&&N.style.fontStyle==="italic"){u=!0;break}N=N.parentElement}}else if(_.nodeType===1){const $=_;if($.tagName==="EM"||$.tagName==="I"){u=!0;break}if($.style&&$.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return Re.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&Re.value.hasOwnProperty(o)?Re.value[o]:(Re.value[o]=d,d)}return Re.value.hasOwnProperty(o)?Re.value[o]:!1}catch{return Re.value.hasOwnProperty(o)?Re.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},mn=o=>{C.disabled||!C.richText||(ue.value=ue.value===o?null:o,o==="askAi"&&(tt.value=null))},It=()=>{ue.value=null,dt.value=null},bn=o=>{et("formatBlock",o),It()},Yl=o=>{if(!o||!f.value)return o;const l=$e=>{let me=$e.nodeType===Node.TEXT_NODE?$e.parentElement:$e;for(;me&&me!==f.value;){const it=me.tagName;if(it==="P"){const ln=me.parentElement;if(ln===f.value||ln.tagName==="BLOCKQUOTE")return me}if(it==="BLOCKQUOTE")break;me=me.parentElement}return null},a=l(o.startContainer),r=l(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:$e=>{const me=$e.tagName;if(me==="P"){const it=$e.parentElement;if(it===f.value||it.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return me==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(a),v=c.indexOf(r);if(m===-1||v===-1)return o;const h=Math.min(m,v),_=Math.max(m,v),$=c.slice(h,_+1);if($.length===0)return o;const N=$[0],J=$[$.length-1],K=document.createRange();return K.setStartBefore(N),K.setEndAfter(J),K},so=()=>{if(C.disabled||!C.richText||!f.value)return;ut.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),ze(),ut.value=!1):ze(),It(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&Wn(l)&&(l=Yl(l),o.removeAllRanges(),o.addRange(l));let a=null;!l.collapsed&&Wn(l)&&(a=Xe());const r=l.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}}),c.remove()}}else if(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=l.extractContents();u.appendChild(m),l.insertNode(u);const v=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:N=>N.parentNode===u&&N.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let _;for(;_=h.nextNode();)v.push(_);if(v.forEach(N=>{const J=document.createElement("p");N.parentNode.insertBefore(J,N),J.appendChild(N)}),u.querySelectorAll("p, div").forEach(N=>{N.textContent.trim()===""&&!N.querySelector("img")&&(N.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const N=document.createElement("p");N.innerHTML="<br>",u.appendChild(N)}}e.nextTick(()=>{a&&jt(a),Zn(),Z(),qt()})},ro=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=_=>{if(!_)return!1;const $=_.textContent||"",J=(_.innerHTML||"").trim();return $.trim()===""||J===""||J==="<br>"||J==="<br/>"||J==="<p></p>"||J==="<p><br></p>"||J==="<p><br/></p>"||J==="<p> </p>"||J==="<p><br> </p>"||J==="<div></div>"||J==="<div><br></div>"||J==="<div><br/></div>"};let d=null;for(a.nodeType===3?d=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?d=a:d=a.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const _=r.lastChild;if(_.nodeType===1&&_.tagName==="BR")_.remove();else if(_.nodeType===3)if((_.textContent||"").trim()==="")_.remove();else break;else break}if(r.children.length>0)for(let _=r.children.length-1;_>=0;_--){const $=r.children[_];if(($.tagName==="P"||$.tagName==="DIV")&&c($))$.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):f.value&&f.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Zn(),Z()})},wn=()=>{if(!f.value){ve.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");ve.value=!!r}else ve.value=!1}catch{ve.value=!1}},jl=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Ht.value=Xe();const l=window.getSelection();let a="";l.rangeCount>0&&(a=l.getRangeAt(0).toString()),Ve.value="",O.value=a,Bt.value="",Ne.value=null,He.value=!0,It(),e.nextTick(()=>{lt.value&<.value.focus()})},io=()=>{if(!f.value)return;ut.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),ze(),ut.value=!1):ze();const o=window.getSelection();let l=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!l&&Ne.value&&(l=Ne.value),l&&l.parentNode){const a=document.createDocumentFragment();for(;l.firstChild;)a.appendChild(l.firstChild);if(l.parentNode.replaceChild(a,l),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}Ne.value=null}else et("unlink");ve.value=!1,It(),e.nextTick(()=>{Z(),wn()})},al=()=>{C.disabled||!C.richText||f.value&&(ut.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),ze(),ut.value=!1):ze(),It(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Sn(),Z(),qt()}))},co=()=>{C.disabled||!C.richText||f.value&&(ut.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),ze(),ut.value=!1):ze(),It(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Sn(),Z(),qt()}))},uo=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let a=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},Sn=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(l=>{const a=l.parentElement;if(a&&a.tagName==="LI"){const r=uo(a);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},Kl=()=>{if(C.disabled||!C.richText||!f.value)return;It(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{Sn(),Z()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=a.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=uo(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),Sn();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{Z(),qt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Sn(),Z(),qt()})},No=()=>{if(C.disabled||!C.richText||!f.value)return;It(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{Sn(),Z()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),d.insertBefore(a,c.nextSibling),r.children.length===0&&r.remove(),Sn();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{Z(),qt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Sn(),Z(),qt()})},Kt=e.ref(null),Jn=e.ref(null),_n=e.ref({}),el=e.ref(""),tl=e.ref(null),sl=e.ref("");e.ref("");const rl=e.ref(null);e.ref("");const Bn=e.ref([]),Gl=e.ref(!1),Sl=e.ref(!1),mo=o=>{if(!o)return"";const l=o.cloneRange(),a=document.createElement("div");return a.appendChild(l.cloneContents()),a.innerHTML},Rl=()=>{if(C.disabled||!C.richText||!f.value)return;if(Kt.value!==null){Kt.value=null,el.value="",sl.value="",rl.value=null,Bn.value=[],Yn(!0);return}It(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!Wn(l))return;sl.value=mo(l)||"",rl.value=Xe();const a=l.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);_n.value={top:`${m}px`,bottom:"auto"},Kt.value=Date.now(),e.nextTick(()=>{if(el.value="",tl.value){const h=tl.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 _=r.getBoundingClientRect(),$=v.getBoundingClientRect(),N=h.getBoundingClientRect(),J=$.bottom-_.top,K=N.top-_.top,$e=8;if(J>K-$e){const me=N.height;_n.value={bottom:`${me+$e}px`,top:"auto"}}else _n.value={top:`${m}px`,bottom:"auto"}}}})},Ql=()=>{if(!el.value.trim())return;const o=el.value.trim(),l=new Date,a={text:o,selectionText:sl.value,selectionRange:rl.value,commentId:Kt.value,user:C.commentUser||null,createdAt:l.toISOString()};Bn.value=[...Bn.value,a],Te("comment-submitted",a),Jl(a),rl.value&&!Bo(rl.value)&&Mo(Kt.value,rl.value),el.value="",e.nextTick(()=>{if(tl.value){const r=tl.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Rn("sendComment")})},So=(o,l)=>{if(!(!C.commentUser||!o.user||o.user.id!==C.commentUser.id)){if(Bn.value=Bn.value.filter((a,r)=>r!==l),Kt.value!==null&&f.value){const a=String(Kt.value),r=f.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&Bn.value.length>0){const c=[],d=new Set;Bn.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?r.setAttribute("data-comment-user",JSON.stringify(c[0])):r.removeAttribute("data-comment-user"),c.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(c[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(Bn.value.length))}else r&&Bn.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Te("comment-deleted",{comment:o,index:l,commentId:Kt.value}),C.comments&&Array.isArray(C.comments)){const a=C.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));Te("update:comments",a)}e.nextTick(()=>{Rn("deleteComment")})}},Bo=o=>{if(!o||!f.value)return!1;try{const l=Fl(o);if(!l)return!1;const a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Fl=o=>{if(!o||!f.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return f.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let a=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!d&&o.start>=a&&o.start<=m&&(l.setStart(c,o.start-a),d=!0),d&&o.end>=a&&o.end<=m&&(l.setEnd(c,o.end-a),u=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?l:null}catch{return null}},Mo=(o,l)=>{if(!(!o||!l||!f.value))try{const a=Fl(l);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=a.startContainer,v=a.endContainer,h=a.startOffset,_=a.endOffset,$=m.nodeType===3?m.parentNode:m,N=v.nodeType===3?v.parentNode:v;if($===N&&h===0&&_===(v.nodeType===3?v.length:N.childNodes.length)&&($.tagName==="P"||$.tagName==="DIV"||$.tagName==="H1"||$.tagName==="H2"||$.tagName==="H3"||$.tagName==="H4"||$.tagName==="H5"||$.tagName==="H6")){const K=a.extractContents();d.appendChild(K),a.insertNode(d)}else a.surroundContents(d)}catch{const v=a.extractContents();d.appendChild(v),a.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Rn("wrapSelectionWithCommentMarker"),Z()})}catch{}},Jl=o=>{if(!o||!o.commentId)return;const l=Array.isArray(C.comments)?[...C.comments]:[],a=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=l.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(a)||d.conversation_id===a);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(r>=0){const d=l[r];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&l.length>0){const u=l.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=l.length>0&&l.find(v=>v.article_id)?.article_id||null,m={conversation_id:a,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};l.push(m)}Gl.value=!0,Te("update:comments",l)},xn=(o,l=[])=>{if(C.disabled||!C.richText||!f.value)return;const a=f.value;let r=null;try{r=a.querySelector(o)}catch{return}if(!r)return;It(),a.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),sl.value=r.innerHTML||"",rl.value=Xe();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const _=m.getBoundingClientRect(),$=u.bottom-_.top,J=Math.max($+8,0);_n.value={top:`${J}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(v&&C.comments&&Array.isArray(C.comments)){const _=C.comments.find($=>String($.conversation_id)===String(v));if(_&&_.conversation&&Array.isArray(_.conversation)){const $=_.conversation.map(N=>({id:N.id||N.commentary_id,commentary_id:N.id||N.commentary_id,conversation_id:_.id||_.conversation_id,text:N.text,user:N.user,createdAt:N.created_at||N.createdAt,updated_at:N.updated_at||N.updatedAt}));h.push(...$)}}h.length===0&&Array.isArray(l)&&l.length>0&&(h=l.slice()),h.sort((_,$)=>{const N=$e=>{if(!$e)return 0;const me=new Date($e).getTime();return isNaN(me)?0:me},J=N(_.createdAt),K=N($.createdAt);return J===K?0:J-K}),Bn.value=h,Yn(!0),Kt.value=v||null,r&&(Jn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(el.value="",tl.value){const _=tl.value;_.style.height="auto",_.style.height=`${_.scrollHeight}px`,_.focus()}if(m){const _=m.querySelector(".dss-comment-overlay");if(_){const $=m.querySelector(".dss-text-editor-footer");if($){const N=m.getBoundingClientRect(),J=_.getBoundingClientRect(),K=$.getBoundingClientRect(),$e=J.bottom-N.top,me=K.top-N.top,it=8;if($e>me-it){const ln=K.height;_n.value={bottom:`${ln+it}px`,top:"auto"}}}}}Rn("openCommentOverlayForSelector")})},F=e.ref(null),rn=e.ref(0),Dn=o=>{if(!(C.disabled||!C.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{ro()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0),r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,v=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const h=document.createRange();h.setStartAfter(d),h.collapse(!0),l.removeAllRanges(),l.addRange(h);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);let r=null,c=null;if(a.collapsed)if(o.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,h=c.contains(m)||m===c,$=a.cloneContents().textContent?.trim()||"",N=c.textContent?.trim()||"";(!v||!h||$.length>N.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),l.removeAllRanges(),l.addRange(m),e.nextTick(()=>{Z()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?No():Kl();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);if(a.collapsed){const u=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 _=v.parentElement;return _&&_!==f.value?m(_):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const h=v.closest("p, div");if(h&&h!==f.value){o.preventDefault(),o.stopPropagation();let _=null;const $=a.startOffset;$<u.length&&(_=u.splitText($));const N=document.createElement("p");if(_?N.appendChild(_):N.innerHTML="<br>",u.length===0){const K=u.parentElement;K&&(K.removeChild(u),K.childNodes.length===0&&K.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(N,h.nextSibling):h.parentNode.appendChild(N);const J=document.createRange();_?J.setStart(_,0):J.setStart(N,0),J.collapse(!0),l.removeAllRanges(),l.addRange(J),e.nextTick(()=>{Z()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=K=>{if(!K)return!1;const $e=K.textContent||"",it=(K.innerHTML||"").trim(),ln=it.replace(/<br\s*\/?>/gi,"").trim();return $e.trim()===""||it===""||ln===""||it==="<br>"||it==="<br/>"||it==="<p></p>"||it==="<p><br></p>"||it==="<p><br/></p>"||it==="<p> </p>"||it==="<p><br> </p>"||it==="<div></div>"||it==="<div><br></div>"||it==="<div><br/></div>"},v=c.lastChild,h=v&&v.nodeType===1&&v.tagName==="BR",_=a.startContainer,$=_.nodeType===3?_.parentElement:_,N=$===c||$&&$.parentElement===c;if(u&&m(u)||h&&N){o.preventDefault(),setTimeout(()=>{ro()},50);return}}}}if(o.key===" "){const l=Date.now(),a=l-rn.value;if(F.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),Kl();return}}}}F.value=" ",rn.value=l}else F.value=o.key}},pn=o=>{if(C.disabled||!C.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),a=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),ze();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const v=new DOMParser().parseFromString(u,"text/html");let h=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach($=>{if(h>0){const N=v.createElement("p");N.innerHTML=$.innerHTML,$.parentNode.replaceChild(N,$)}else h++}),c){const $=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],N=Array.from(v.body.children).filter(J=>$.includes(J.tagName));if(N.length===1){const J=N[0].tagName,K=c.tagName,$e=c.textContent.trim()===""&&!c.querySelector("img");let me=!1;if(["H1","H2","H3","H4","H5","H6"].includes(K)?me=!0:$e||(J===K||J==="P")&&(me=!0),me)return N[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=d(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);Z()},On=o=>{if(ue.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&It()}if(ge.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=f.value&&a.closest(".dss-text-editor-content");!r&&!c&&Ml()}if(tt.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&cl()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(dt.value=null),!f.value||!l.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);Vt.value=!r.collapsed&&Wn(r)}else Vt.value=!1}if(Kt.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const u=a.getBoundingClientRect(),m=o.clientX,v=o.clientY;r=m>=u.left&&m<=u.right&&v>=u.top&&v<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(Kt.value=null,el.value="",sl.value="",rl.value=null,Bn.value=[],Yn(!0))}},Wt=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),$t.value&&(clearTimeout($t.value),$t.value=null),dt.value=l},Gt=o=>{const l=o.relatedTarget;if(l){const a=l.closest(".dss-toolbar-dropdown-submenu"),r=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}$t.value&&clearTimeout($t.value),$t.value=setTimeout(()=>{dt.value=null,$t.value=null},150)},il=o=>{dt.value=null};let vl=0;const St=o=>{if(!o)return;const l=Array.from(o.children);l.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")}),l.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 c=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),d=a.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(c||u){const m=`submenu-auto-${++vl}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let v=null;c?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(c,a.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&a.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(_=>{(_.tagName==="BUTTON"||_.tagName==="DIV")&&!_.classList.contains("dss-toolbar-dropdown-item")&&_.classList.add("dss-toolbar-dropdown-item")}))}})},Nt=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{St(l),l.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=v=>{const h=c.getAttribute("data-submenu-id");h&&Wt(v,h)},m=Gt;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=h=>{const _=c.getAttribute("data-submenu-id");_&&Wt(h,_)},m=Gt;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",il)})})})};let st=null;const Pt=()=>{if(dt.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${dt.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${dt.value}"]`);o&&l&&xo(o,l)}if(ge.value&&qt(),C.richText){if(st!==null)return;st=setTimeout(()=>{st=null,Rn("handleWindowResize")},150)}},Il=()=>{if(!C.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},po=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(a=>{a.addEventListener("selectstart",l),a.addEventListener("mousedown",l),a.addEventListener("dragstart",l),a.addEventListener("contextmenu",l),a.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Le.value?kn():ol(),le.value?fl():Ce()})}),e.nextTick(()=>{po()}),C.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",On),window.addEventListener("resize",Pt);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,Pt()},150))};window.addEventListener("scroll",l,!0),f.value._windowScrollHandler=l,f.value._windowScrollTimeout=o,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const a=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,Pt()},150))};a&&(a.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{Nt(),Il()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!C.disabled&&m.preventDefault();const _=v.closest(".dss-image-no-alt-icon"),$=v.closest(".dss-image-wrapper");if(_||$&&v===$){m.preventDefault(),m.stopPropagation();const N=window.getSelection(),J=document.createRange();J.setStartAfter($),J.collapse(!0),N.removeAllRanges(),N.addRange(J)}else $&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const N=window.getSelection();if(N.rangeCount>0){const K=N.getRangeAt(0).commonAncestorContainer,$e=K.nodeType===3?K.parentElement:K;if($.contains($e)&&$e!==$.querySelector("img")){const me=document.createRange();me.setStartAfter($),me.collapse(!0),N.removeAllRanges(),N.addRange(me)}}else{const J=document.createRange();J.setStartAfter($),J.collapse(!0),N.addRange(J)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),_=v.closest(".dss-image-wrapper");if(h||_&&v.tagName!=="IMG"){m.preventDefault();const $=window.getSelection(),N=document.createRange();_&&(N.setStartAfter(_),N.collapse(!0),$.removeAllRanges(),$.addRange(N))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.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 $=h.getAttribute("alt")||h.alt||"";if($){const N=h.getAttribute("src")||h.src||"",J=N.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),K=$===N||$===J;($.startsWith("http://")||$.startsWith("https://")||$.startsWith("data:")||K||K)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),Mn()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),_=h?.closest(".dss-image-wrapper");h&&f.value.contains(h)&&(Ye.value=_||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{Ye.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{Ye.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!Ye.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=Ye.value,h=v.classList?.contains("dss-image-wrapper"),_=h?v.querySelector("img"):v,$=h?v:_?.closest(".dss-image-wrapper");if(!_||!f.value.contains(_)){Ye.value=null;return}let N=null;const J=m.clientX,K=m.clientY;if(document.caretRangeFromPoint)N=document.caretRangeFromPoint(J,K);else{const zt=window.getSelection();zt.rangeCount>0?N=zt.getRangeAt(0).cloneRange():(N=document.createRange(),N.selectNodeContents(f.value),N.collapse(!1))}if(!N){Ye.value=null;return}const $e=N.commonAncestorContainer,me=$e.nodeType===3?$e.parentElement:$e;if(me?.closest(".dss-image-wrapper")===$||$&&$.contains(me)){Ye.value=null;return}if($&&(me===$||$.contains(me))){Ye.value=null;return}const ln=_.getAttribute("src");let Jt=null;$?Jt=$.cloneNode(!0):Jt=_.cloneNode(!0);try{let zt=N.startContainer;if(zt.nodeType===3&&(zt=zt.parentElement),$&&(zt===$||$.contains(zt))){const Xt=document.createRange();Xt.setStartAfter($),Xt.collapse(!0),N=Xt}N.insertNode(Jt);const en=document.createRange();en.setStartAfter(Jt),en.collapse(!0);const tn=window.getSelection();tn.removeAllRanges(),tn.addRange(en)}catch{if(f.value.childNodes.length===0){const en=document.createElement("p");en.appendChild(Jt),f.value.appendChild(en)}else{const en=f.value.lastChild;if(en&&en.nodeType===1)en.appendChild(Jt);else{const tn=document.createElement("p");tn.appendChild(Jt),f.value.appendChild(tn)}}}$?$.remove():_.remove(),Ye.value=null,e.nextTick(()=>{const zt=f.value.querySelectorAll("img");let en=!1;zt.forEach(tn=>{if(tn.getAttribute("src")===ln)if(!en)en=!0;else{const Xt=tn.closest(".dss-image-wrapper");Xt?Xt.remove():tn.remove()}}),Mn(),Z()})}),f.value.addEventListener("dragend",m=>{Ye.value=null});let d=null;const u=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 _=h.querySelectorAll&&h.querySelectorAll("img");_&&_.forEach($=>{$.removeAttribute("alt"),$.removeAttribute("data-alt"),$.setAttribute("alt",""),$.setAttribute("data-alt",""),$.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Mn(),Il(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Il()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),C.modelValue){const m=Pn(C.modelValue);f.value.innerHTML=m,he()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=C.title||"",h=C.description||"";X.value=m,Q.value=v,re.value=h,x.value=v,k.value=h,Sn(),Mn(),W(),En(),ml(),$l()}),wn(),Zn(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",On),window.removeEventListener("resize",Pt),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),st!==null&&(clearTimeout(st),st=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),Se.value&&clearTimeout(Se.value),$t.value&&clearTimeout($t.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),Ue.value&&Ue.value.disconnect(),Dt.value!==null&&(cancelAnimationFrame(Dt.value),Dt.value=null),$n.value!==null&&(clearTimeout($n.value),$n.value=null),an.value!==null&&(clearTimeout(an.value),an.value=null),Yn(!0),f.value&&f.value._scrollHandlers){const{wrapper:l,content:a,handler:r}=f.value._scrollHandlers;l&&l.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const Bl=o=>{const l=o.target,a=l.closest("a");if(a&&!C.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=l.closest(".dss-image-wrapper");r&&l.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),c.removeAllRanges(),c.addRange(v)}}Mn(),wn(),Zn(),qt(),En()}):e.nextTick(()=>{Mn(),wn(),Zn(),qt(),En()})},zl=()=>{Tt();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);Vt.value=!a.collapsed&&Wn(a),!a.collapsed&&Qe.value&&(Qe.value=null)}else Vt.value=!1;if(Mn(),wn(),Zn(),qt(),En(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),Vt.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(a==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}Re.value[a]=m}else{const d=document.queryCommandState(a);Re.value[a]=d}}}catch{}})},En=()=>{if(!C.richText||C.disabled||!f.value){qe.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){qe.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!f.value.contains(r)){qe.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){qe.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?qe.value=d:qe.value="p"}catch{qe.value="p"}},Zn=()=>{if(!f.value){pt.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");l=!!(c&&f.value.contains(c))}pt.value=l}catch{pt.value=!1}},Wn=o=>{if(!o||!f.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const a=l.nodeType===3?l.parentElement:l;return a?f.value.contains(a):!1},Ml=()=>{ge.value=!1},qt=()=>{if(!C.floatingToolbar||!C.richText||C.disabled){ge.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){ge.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!Wn(l)){ge.value=!1;return}const a=l.getBoundingClientRect();if(!a||a.width===0&&a.height===0){ge.value=!1;return}const r=f.value;if(!r){ge.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){ge.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let v=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let _=0;wt.value&&(_=wt.value.getBoundingClientRect().width);const $=(_||320)/2;let N=c.left+$,J=c.right-$;if(J<N){const K=c.left+c.width/2;N=K,J=K}if(h>0){const K=$+u,$e=h-$-u;if(N=Math.max(N,K),J=Math.min(J,$e),J<N){const me=h/2;N=me,J=me}}v<N?v=N:v>J&&(v=J),gt.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},ge.value=!0},fo=o=>{C.disabled||!C.richText||(tt.value=tt.value===o?null:o,o==="askAi"&&(ue.value=null))},cl=()=>{tt.value=null,dt.value=null},ul=o=>{bn(o),cl()};let gn=null,bl=null,gl=null,qn=null;const _o=o=>{if(C.disabled||!C.richText){_l(),wl();return}const l=o.target,a=l.closest("a"),r=l.closest("img");if(gn&&(clearTimeout(gn),gn=null),gl&&(clearTimeout(gl),gl=null),a&&a!==bl){wl(),bl=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),Ne.value=a,S.value=c,te.value=!0,Ze.value=!0,eo(a)}else!a&&bl?(bl=null,gn=setTimeout(()=>{Ze.value||_l()},150)):a&&a===bl&&eo(a);if(r&&r!==qn){_l(),qn=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),U.value=r,fe.value=c.trim()||R("textEditor.image.noAlt"),_e.value=!0,Et.value=!0,go(r)}else!r&&qn?(qn=null,gl=setTimeout(()=>{Et.value||wl()},150)):r&&r===qn&&go(r)},vo=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(bl=null,qn=null,gn&&(clearTimeout(gn),gn=null),gl&&(clearTimeout(gl),gl=null),_l(),wl())},_l=()=>{Ze.value=!1,setTimeout(()=>{Ze.value||(te.value=!1,S.value="",He.value||(Ne.value=null))},100)},eo=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;ae.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},wl=()=>{Et.value=!1,setTimeout(()=>{Et.value||(_e.value=!1,fe.value="",Mt.value||(U.value=null))},100)},go=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;ct.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},$o=()=>{if(!S.value||!Ne.value)return;let l=Ne.value.getAttribute("href")||S.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},nl=()=>{if(Ne.value){const o=Ne.value.textContent||"",l=Ne.value.getAttribute("href")||"",a=Ne.value;Ve.value=l,O.value=o,Bt.value=o,Ze.value=!1,te.value=!1,S.value="",Ne.value=a,He.value=!0}else if(ve.value){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";Ve.value=d,O.value=c,Bt.value=c,Ne.value=r,He.value=!0}}}else{Ht.value=Xe();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),Ve.value="",O.value=l,Bt.value="",Ne.value=null,He.value=!0}e.nextTick(()=>{lt.value&&(lt.value.focus(),lt.value.select())})},Un=()=>{He.value=!1,Ve.value="",O.value="",Bt.value="",Ne.value=null,Ht.value=null},Xn=()=>{if(!Ve.value.trim()){Un();return}if(ut.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),ze(),ut.value=!1):ze(),O.value.trim()||(O.value=Ve.value.trim()),Ne.value&&f.value&&f.value.contains(Ne.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=Ne.value;if(l.setAttribute("href",Ve.value.trim()),O.value.trim()!==Bt.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=O.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(l),a.collapse(!1),o.removeAllRanges(),o.addRange(a),Z()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),Ht.value&&jt(Ht.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const a=document.createElement("a");a.href=Ve.value.trim(),a.textContent=O.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",l.deleteContents(),l.insertNode(a);const r=document.createTextNode(" ");l.setStartAfter(a),l.insertNode(r),l.setStartAfter(r),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(f.value),l.collapse(!1));const a=l.startContainer,r=a.nodeType===3,c=r&&l.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=Ve.value.trim(),d.textContent=O.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const h=document.createRange();h.setStartAfter(d),h.collapse(!0),o.removeAllRanges(),o.addRange(h)}else{if(l.startOffset>0){const h=a.textContent.substring(0,l.startOffset),_=h[h.length-1];if(_&&_!==" "&&_!==" "&&_!==`
|
|
102
|
+
`){const $=document.createTextNode(" ");l.insertNode($),l.setStartAfter($)}}l.insertNode(d);const v=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(v),l.setStartAfter(v),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}}else{if(r&&l.startOffset>0){const m=a.textContent.substring(0,l.startOffset),v=m[m.length-1];if(v&&v!==" "&&v!==" "&&v!==`
|
|
103
|
+
`){const h=document.createTextNode(" ");l.insertNode(h),l.setStartAfter(h)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}Z()}e.nextTick(()=>{wn(),Un()})},Ot=()=>{if(!f.value||de.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=Xe());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(f.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}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],h=v.textContent;a.lastIndex=0;const _=[...h.matchAll(a)];if(_.length===0)continue;const $=_.filter(K=>{const $e=K[0],me=K.index;if(me>0&&h[me-1]==="@"||me+$e.length<h.length&&h[me+$e.length]==="@")return!1;const it=v.parentElement;return!(it&&it.closest("a"))});if($.length===0)continue;if($.length===1&&$[0][0]===h.trim()){const K=$[0][0],$e=K.startsWith("http://")||K.startsWith("https://")?K:`https://${K}`,me=document.createElement("a");me.href=$e,me.textContent=K,me.style.color="#60afdf",me.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(me,v),u=!0);continue}let N=0;const J=document.createDocumentFragment();if($.forEach(K=>{const $e=K.index,me=K[0];if($e>N){const Jt=h.substring(N,$e);Jt&&J.appendChild(document.createTextNode(Jt))}const it=me.startsWith("http://")||me.startsWith("https://")?me:`https://${me}`,ln=document.createElement("a");ln.href=it,ln.textContent=me,ln.style.color="#60afdf",ln.style.textDecoration="underline",J.appendChild(ln),N=$e+me.length}),N<h.length){const K=h.substring(N);K&&J.appendChild(document.createTextNode(K))}v.parentNode&&J.childNodes.length>0&&(v.parentNode.replaceChild(J,v),u=!0)}u&&l&&e.nextTick(()=>{jt(l),wn()})},To=()=>{if(!f.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=l.nextNode();)a.push(r);for(let c=a.length-1;c>=0;c--){const d=a[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const h=document.createDocumentFragment();m.forEach(_=>{const $=_.index,N=_[0].startsWith("<u>")?"u":"ins",J=_[1]||_[2]||"";$>v&&h.appendChild(document.createTextNode(u.substring(v,$)));const K=document.createElement(N);K.textContent=J,h.appendChild(K),v=$+_[0].length}),v<u.length&&h.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},Ut=o=>{if(!f.value||de.value)return;if(!o){To();return}if(!["*","_",">"].includes(o))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const c=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(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let Jt="",zt=0,en=!1;const tn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:jn=>jn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let Xt=0;for(;tn.nextNode();){const jn=tn.currentNode,hn=jn.textContent||"",Kn=Xt;if(Xt+=hn.length,jn===r.startContainer){Jt+=hn.substring(0,r.startOffset),zt=Kn+r.startOffset,en=!0;break}Jt+=hn}return en||(zt=Jt.length),{textBeforeCursor:Jt,cursorCharOffset:zt}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.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],_=m[1],$=u.length-h.length,J=(Jt=>{let zt=0;const en=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Xt=>Xt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let tn;for(;tn=en.nextNode();){const Xt=(tn.textContent||"").length;if(zt+Xt>=Jt)return{node:tn,offset:Jt-zt};zt+=Xt}return null})($);if(!J)return;const K=document.createRange();K.setStart(J.node,J.offset),K.setEnd(r.endContainer,r.endOffset);const $e=document.createElement(v);$e.textContent=_,K.deleteContents(),K.insertNode($e);const me=window.getSelection(),it=document.createRange();it.setStartAfter($e),it.collapse(!0),me.removeAllRanges(),me.addRange(it);const ln=Xe();e.nextTick(()=>{Z(),ln&&jt(ln)})},Qt=()=>{f.value&&(Ie.value=Xe(),Ft.value="",xt.value="",ft.value="",Ke.value="",Ge.value="",on.value=null,U.value=null,We.value="upload",Mt.value=!0,It(),e.nextTick(()=>{Zt.value&&Zt.value.focus(),At.value&&(At.value.value="")}))},ho=o=>{const l=o.target?.files?.[0];if(!l){on.value=null,xt.value="";return}on.value=l;const a=new FileReader;a.onload=r=>{xt.value=r.target?.result||""},a.readAsDataURL(l)},Lo=()=>{At.value&&At.value.click()},Pl=()=>{Ke.value&&(Ge.value="")},yo=()=>{Ge.value&&(Ke.value="")},Co=()=>{let o=U.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";U.value=o,Ft.value=l.trim()===""||l.trim()==="Image"?"":l;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(ft.value=a,xt.value="",We.value="url"):(xt.value=a,ft.value="",We.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";Ke.value=c.endsWith("px")?c.replace("px",""):c,Ge.value=d.endsWith("px")?d.replace("px",""):d,Ie.value=null}else{Qt();return}Mt.value=!0,Et.value=!1,_e.value=!1,e.nextTick(()=>{We.value==="url"&&_t.value?(_t.value.focus(),_t.value.select()):Zt.value&&(Zt.value.focus(),Zt.value.select()),At.value&&(At.value.value="")})},Lt=()=>{Mt.value=!1,Ft.value="",xt.value="",ft.value="",Ke.value="",Ge.value="",on.value=null,U.value=null,Ie.value=null,We.value="upload"},dl=()=>{const o=(Ft.value||"").trim(),l=f.value?._mutationObserver;l&&l.disconnect(),ut.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),ze(),ut.value=!1):ze();const a=We.value==="url"?ft.value.trim():xt.value;if(U.value&&f.value&&f.value.contains(U.value)){a&&(U.value.src=a),U.value.setAttribute("alt",o),U.value.setAttribute("data-alt",o),Ke.value?(U.value.style.width=`${Ke.value}px`,U.value.setAttribute("width",Ke.value)):(U.value.style.removeProperty("width"),U.value.removeAttribute("width")),Ge.value?(U.value.style.height=`${Ge.value}px`,U.value.setAttribute("height",Ge.value)):(U.value.style.removeProperty("height"),U.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(U.value),c.collapse(!0),r.addRange(c)}Z()}else{if(!a){l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),Lt();return}if(f.value){f.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Ie.value&&(jt(Ie.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&f.value){if(d=document.createRange(),f.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",f.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){Lt();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!f.value.contains(m)){if(d=document.createRange(),f.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",f.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=a,v.setAttribute("alt",o),v.setAttribute("data-alt",o),Ke.value&&(v.style.width=`${Ke.value}px`,v.setAttribute("width",Ke.value)),Ge.value&&(v.style.height=`${Ge.value}px`,v.setAttribute("height",Ge.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const $=document.createElement("p");f.value.appendChild($),$.appendChild(v)}else{const $=f.value.lastChild;if($&&$.nodeType===1)$.appendChild(v);else{const N=document.createElement("p");f.value.appendChild(N),N.appendChild(v)}}const _=document.createRange();_.setStartAfter(v),_.collapse(!0),c&&(c.removeAllRanges(),c.addRange(_))}}U.value=v,Z()}}e.nextTick(()=>{l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),wn(),qt(),Lt()})};e.watch(()=>C.modelValue,o=>{if(C.richText&&f.value&&!de.value){const l=Pn(o||""),r=f.value.innerHTML.replace(/ |\u00A0/g," "),c=l.replace(/ |\u00A0/g," ");if(r!==c){const d=Xe();f.value.innerHTML=l,e.nextTick(()=>{he();const u=f.value.innerHTML||"",m=C.title||"",v=C.description||"";X.value=u,Q.value=m,re.value=v,j.value=u,x.value=m,k.value=v,ot.value=[],bt.value=[],Se.value&&(clearTimeout(Se.value),Se.value=null),ut.value=!1,d&&jt(d),Sn(),Mn(),W(),wn(),qt(),En(),Rn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>C.richText,o=>{o?(qt(),e.nextTick(()=>{ml()})):(Ml(),vt.value=[],Ue.value&&(Ue.value.disconnect(),Ue.value=null)),En()}),e.watch(()=>C.floatingToolbar,o=>{o?qt():Ml()}),e.watch(()=>C.disabled,o=>{o&&Ml(),En()}),e.watch(()=>C.description,()=>{e.nextTick(()=>{le.value?fl():Ce()})}),e.watch(()=>C.title,()=>{e.nextTick(()=>{Le.value?kn():ol()})}),e.watch(()=>C.customToolbarSlots,()=>{e.nextTick(()=>{Il()})},{deep:!0}),e.watch(()=>C.comments,(o,l)=>{if(Gl.value){Gl.value=!1;return}Sl.value||C.richText&&f.value&&e.nextTick(()=>{$l()})},{deep:!0,immediate:!1});const $l=()=>{if(!Sl.value&&!(!C.comments||!Array.isArray(C.comments)||C.comments.length===0)&&!(!C.richText||!f.value)){Sl.value=!0;try{const o=new Set,l=C.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),a=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;l.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const v=String(m);if(d.has(v))return;const h=f.value.querySelector(`[data-comment="${v}"]`);if(h){Zl(h,u),d.add(v);return}try{const _=bo(u.selection_range,u.selection_text);if(_&&!_.collapsed){const $=_.commonAncestorContainer,N=$.nodeType===3?$.parentElement:$;if(N){const $e=N.closest("[data-comment], [data-fake-comment]");if($e){const me=$e.getAttribute("data-comment")||$e.getAttribute("data-fake-comment");if(String(me)===String(m)){$e.setAttribute("data-comment",v),$e.removeAttribute("data-fake-comment"),Zl($e,u),d.add(v);return}else return}}const J=f.value.querySelector(`[data-comment="${v}"]`);if(J){Zl(J,u),d.add(v);return}const K=document.createElement("span");K.setAttribute("data-comment",v),Zl(K,u);try{_.surroundContents(K),c++,d.add(v)}catch{try{const me=document.createRange();me.setStart(_.startContainer,_.startOffset),me.setEnd(_.endContainer,_.endOffset),Ol(me),me.surroundContents(K),c++,d.add(v)}catch{try{const it=_.extractContents();K.appendChild(it),_.insertNode(K),c++,d.add(v)}catch(it){console.warn("Failed to create comment marker:",it)}}}}}catch{}}),e.nextTick(()=>{Rn("restoreCommentsFromModel"),Z(),Sl.value=!1})}catch{Sl.value=!1}}},Ol=o=>{if(!o||!f.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=o.startContainer,r=o.startOffset;if(a.nodeType===3){const u=a.parentElement;u&&l.includes(u.tagName)&&(r===0&&!to(a)||o.setStartBefore(u))}else a.nodeType===1&&l.includes(a.tagName)&&r>0&&o.setStartBefore(a);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!ko(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},to=o=>{let l=o.previousSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.previousSibling}return!1},ko=o=>{let l=o.nextSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.nextSibling}return!1},bo=(o,l)=>{if(!o||!f.value)return null;try{const a=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?Ol(a):null}}catch{return null}return null},Zl=(o,l)=>{if(!o||!l)return;const a=l.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};a.length>0&&a.forEach(m=>{m.user&&d(m.user)}),c.length>0?o.setAttribute("data-comment-user",JSON.stringify(c[0])):o.removeAttribute("data-comment-user"),c.length>1?o.setAttribute("data-comment-user-2",JSON.stringify(c[1])):o.removeAttribute("data-comment-user-2");const u=a.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},Rn=(o="unknown")=>{if(!C.richText||!f.value){vt.value=[];return}Date.now()-cn.value<yn&&Dt.value!==null||Dt.value===null&&(Dt.value=requestAnimationFrame(()=>{if(Dt.value=null,cn.value=Date.now(),Tn.value)return;Tn.value=!0;const a={},r=f.value;if(!r){Tn.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Tn.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(N=>{const J=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");J&&N.tagName==="SPAN"&&(m.has(J)||(u.push(N),m.add(J)))}),d.forEach(N=>{const J=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");!J||m.has(J)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(N.tagName)?N.querySelector(`span[data-comment="${J}"], span[data-fake-comment="${J}"]`)||(u.push(N),m.add(J)):N.tagName!=="SPAN"&&(u.push(N),m.add(J)))});const v=c.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((N,J)=>{let K=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");if(!K)return;if(typeof K=="string"&&K.startsWith("comment-")){const Qn=N.textContent?.trim(),ll=C.comments?.find(In=>(typeof In.conversation_id=="string"&&In.conversation_id.startsWith("comment-")?null:In.conversation_id)&&In.selection_text?.trim()===Qn);ll?(K=String(ll.conversation_id),N.setAttribute("data-comment",K),N.removeAttribute("data-fake-comment")):(K=String(Date.now()),N.setAttribute("data-comment",K),N.removeAttribute("data-fake-comment"))}const $e=N.getBoundingClientRect(),me=window.getComputedStyle(N),it=parseFloat(me.lineHeight)||parseFloat(me.fontSize)*1.2,zt=$e.top-h.top+it/2-15,tn=h.top-v.top+zt;let Xt=null,jn=null,hn=0;const Kn=[],Ll=new Set;if(K&&C.comments){const Qn=C.comments.find(ll=>String(ll.conversation_id||ll.id)===String(K));if(Qn){const ll=Qn.conversation||[];ll.length>0?(ll.forEach(In=>{In.user&&In.user.id&&!Ll.has(In.user.id)&&(Ll.add(In.user.id),Kn.push(In.user))}),hn=ll.length):(hn=0,Xt=null,jn=null),Kn.length>0?Xt=Kn[0]:Xt=null,Kn.length>1?jn=Kn[1]:jn=null}}const Fn=$e.top+it/2-15,Hl=Fn+30,xl=5,yt=Hl>h.top+xl&&Fn<h.bottom-xl?1:0;vt.value.find(Qn=>Qn.id===K);let El=N;if(!El&&K&&f.value){const Qn=String(K);El=f.value.querySelector(`[data-comment="${Qn}"], [data-fake-comment="${Qn}"]`)}const Gn=Kn.length;a[K]?(a[K].top=tn,a[K].opacity=yt,a[K].element=El,a[K].firstUser=Xt,a[K].secondUser=jn,a[K].totalCount=hn,a[K].uniqueUserCount=Gn):a[K]={id:K,top:tn,opacity:yt,element:El,firstUser:Xt,secondUser:jn,totalCount:hn,uniqueUserCount:Gn}});const _=Object.values(a).map(N=>{const J=Math.max(0,(N.uniqueUserCount??0)-2);if(!N.element&&N.id&&f.value){const $e=String(N.id);N.element=f.value.querySelector(`[data-comment="${$e}"], [data-fake-comment="${$e}"]`)}return{...N,firstUser:N.firstUser||null,secondUser:N.secondUser||null,totalCount:N.totalCount,additionalCount:J}});(vt.value.length!==_.length||_.some((N,J)=>{const K=vt.value[J];if(!K)return!0;const $e=(K.firstUser?.id||null)!==(N.firstUser?.id||null),me=(K.secondUser?.id||null)!==(N.secondUser?.id||null);return K.id!==N.id||Math.abs(K.top-N.top)>1||K.opacity!==N.opacity||K.totalCount!==N.totalCount||K.additionalCount!==N.additionalCount||$e||me||K.element!==N.element}))&&(vt.value=_),Tn.value=!1}))},Ho=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&f.value){const a=String(o.id);l=f.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}l&&(Yn(),Jn.value=l,l.classList.add("editor-comment-highlighted"))},Yn=(o=!1)=>{!o&&Kt.value!==null&&Jn.value&&(Jn.value.getAttribute("data-comment")||Jn.value.getAttribute("data-fake-comment"))===Kt.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Jn.value&&(Jn.value.classList.remove("editor-comment-highlighted"),Jn.value=null))},Tl=o=>{if(!o||!o.element)return;Yn(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const a=`[data-comment="${l}"], [data-fake-comment="${l}"]`;Te("comment-marker-clicked",{commentId:l,selector:a,element:o.element})},wo=()=>{Yn()},ml=()=>{!C.richText||!f.value||(Ue.value&&Ue.value.disconnect(),an.value!==null&&(clearTimeout(an.value),an.value=null),Ue.value=new MutationObserver(()=>{an.value===null&&(an.value=setTimeout(()=>{an.value=null,e.nextTick(()=>{Rn("MutationObserver")})},200))}),Ue.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Rn("setupCommentMarkersObserver-initial"))},xo=(o,l)=>{if(!o||!l)return;const a=l.getBoundingClientRect();let r=a.top,c=a.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const v=a.left-d.width-4;o.style.left=`${v}px`}if(d.bottom>m){const v=Math.max(8,m-d.height-8);o.style.top=`${v}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>dt.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(a.parentNode!==document.body){const d=a.parentNode;a.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{xo(a,c),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(()=>[ue.value,tt.value],()=>{ue.value==="askAi"||tt.value==="askAi"?e.nextTick(()=>{Nt()}):(dt.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const a=l.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(l.dataset.originalParentRef==="inside")r.appendChild(l);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,r.nextSibling)}}}})}))}),e.watch(()=>C.locale,o=>{o&&o!==Me.value&&(Me.value=o)},{immediate:!0}),ke({openCommentOverlayForSelector:xn,updateCommentMarkers:Rn,restoreCommentsFromModel:$l}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",un.value]),style:e.normalizeStyle(zn.value)},[D.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Wc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:w,title:e.unref(R)("textEditor.toolbar.undo")},[...l[45]||(l[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,qc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!A.value}]),onClick:y,title:e.unref(R)("textEditor.toolbar.redo")},[...l[46]||(l[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Uc),l[73]||(l[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Xc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=a=>mn("paragraph")),title:e.unref(R)("textEditor.toolbar.paragraphFormat")},[qe.value==="h1"?(e.openBlock(),e.createElementBlock("svg",jc,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):qe.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Kc,[...l[48]||(l[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):qe.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Gc,[...l[49]||(l[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):qe.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Qc,[...l[50]||(l[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):qe.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Jc,[...l[51]||(l[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):qe.value==="h6"?(e.openBlock(),e.createElementBlock("svg",eu,[...l[52]||(l[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",tu,[...l[53]||(l[53]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[54]||(l[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Yc),ue.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[1]||(l[1]=a=>bn("<h1>"))},[l[55]||(l[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=a=>bn("<h2>"))},[l[56]||(l[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=a=>bn("<h3>"))},[l[57]||(l[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=a=>bn("<h4>"))},[l[58]||(l[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=a=>bn("<h5>"))},[l[59]||(l[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=a=>bn("<h6>"))},[l[60]||(l[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=a=>bn("<p>"))},[l[61]||(l[61]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("bold")}]),onClick:l[9]||(l[9]=a=>et("bold")),title:e.unref(R)("textEditor.toolbar.bold")},[...l[62]||(l[62]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,nu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("italic")}]),onClick:l[10]||(l[10]=a=>et("italic")),title:e.unref(R)("textEditor.toolbar.italic")},[...l[63]||(l[63]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,lu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("underline")}]),onClick:l[11]||(l[11]=a=>et("underline")),title:e.unref(R)("textEditor.toolbar.underline")},[...l[64]||(l[64]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,ou),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt.value}]),onClick:so,title:e.unref(R)("textEditor.toolbar.citation")},[...l[65]||(l[65]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,au),l[74]||(l[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:io,title:e.unref(R)("textEditor.toolbar.removeLink")},[...l[67]||(l[67]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,ru)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:jl,title:e.unref(R)("textEditor.toolbar.insertLink")},[...l[66]||(l[66]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,su)),l[75]||(l[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("insertUnorderedList")}]),onClick:al,title:e.unref(R)("textEditor.toolbar.bulletList")},[...l[68]||(l[68]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,iu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("insertOrderedList")}]),onClick:co,title:e.unref(R)("textEditor.toolbar.numberList")},[...l[69]||(l[69]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,cu),l[76]||(l[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Qt,title:e.unref(R)("textEditor.toolbar.image")},[...l[70]||(l[70]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,uu),Vt.value?(e.openBlock(),e.createElementBlock("div",du)):e.createCommentVNode("",!0),Vt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(R)("textEditor.toolbar.comment"),onClick:Rl},[...l[71]||(l[71]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,mu)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",pu)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",fu,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=a=>mn("askAi")),title:e.unref(R)("textEditor.toolbar.askAi")},[l[72]||(l[72]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",gu,e.toDisplayString(e.unref(R)("textEditor.toolbar.askAi")),1)],8,vu),ue.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[13]||(l[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",hu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[at(a)?(e.openBlock(),e.createElementBlock("div",yu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),at(a)&&r<D.customToolbarSlots.length-1&&sn(r)?(e.openBlock(),e.createElementBlock("div",Cu)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ue.value==="paragraph"||ue.value==="askAi")&&D.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:It})):e.createCommentVNode("",!0),e.createVNode(Ao,{showModal:He.value,width:"500px",height:"55vh",onCloseModal:Un},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(R)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ku,[e.createElementVNode("div",bu,[e.createElementVNode("label",wu,e.toDisplayString(e.unref(R)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:je,type:"text","onUpdate:modelValue":l[15]||(l[15]=a=>O.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Xn,["enter"])},null,40,xu),[[e.vModelText,O.value]])]),e.createElementVNode("div",Eu,[e.createElementVNode("label",Vu,e.toDisplayString(e.unref(R)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:lt,type:"text","onUpdate:modelValue":l[16]||(l[16]=a=>Ve.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Xn,["enter"])},null,40,Nu),[[e.vModelText,Ve.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Un},e.toDisplayString(e.unref(R)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Xn},e.toDisplayString(e.unref(R)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Ao,{showModal:Mt.value,width:"500px",height:"80vh",onCloseModal:Lt},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(U.value?e.unref(R)("textEditor.image.editImage"):e.unref(R)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Su,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":We.value==="upload"}]),onClick:l[17]||(l[17]=a=>We.value="upload")},e.toDisplayString(e.unref(R)("textEditor.image.upload")),3),l[77]||(l[77]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":We.value==="url"}]),onClick:l[18]||(l[18]=a=>We.value="url")},e.toDisplayString(e.unref(R)("textEditor.image.imageLink")),3)]),We.value==="upload"?(e.openBlock(),e.createElementBlock("div",Bu,[e.createElementVNode("div",Mu,[e.createElementVNode("div",_u,[Be.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",$u,e.toDisplayString(e.unref(R)("textEditor.image.uploadImage")),1)),Be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Lo},[e.createElementVNode("img",{src:xt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Tu),l[78]||(l[78]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:At,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:ho},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:At,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:ho},null,544))]),e.createElementVNode("div",Lu,[e.createElementVNode("label",Hu,e.toDisplayString(e.unref(R)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Zt,type:"text","onUpdate:modelValue":l[19]||(l[19]=a=>Ft.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterAltText"),onKeyup:e.withKeys(dl,["enter"])},null,40,Au),[[e.vModelText,Ft.value]])]),e.createElementVNode("div",Du,[e.createElementVNode("label",Ru,e.toDisplayString(e.unref(R)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=a=>Ke.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(dl,["enter"]),onInput:Pl},null,40,Fu),[[e.vModelText,Ke.value]])]),e.createElementVNode("div",Iu,[e.createElementVNode("label",zu,e.toDisplayString(e.unref(R)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=a=>Ge.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(dl,["enter"]),onInput:yo},null,40,Pu),[[e.vModelText,Ge.value]])])])])):e.createCommentVNode("",!0),We.value==="url"?(e.openBlock(),e.createElementBlock("div",Ou,[e.createElementVNode("div",Zu,[e.createElementVNode("div",Wu,[e.createElementVNode("label",qu,e.toDisplayString(e.unref(R)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:_t,type:"text","onUpdate:modelValue":l[22]||(l[22]=a=>ft.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(dl,["enter"])},null,40,Uu),[[e.vModelText,ft.value]])]),e.createElementVNode("div",Xu,[e.createElementVNode("label",Yu,e.toDisplayString(e.unref(R)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=a=>Ft.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterAltText"),onKeyup:e.withKeys(dl,["enter"])},null,40,ju),[[e.vModelText,Ft.value]])]),e.createElementVNode("div",Ku,[e.createElementVNode("label",Gu,e.toDisplayString(e.unref(R)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=a=>Ke.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(dl,["enter"]),onInput:Pl},null,40,Qu),[[e.vModelText,Ke.value]])]),e.createElementVNode("div",Ju,[e.createElementVNode("label",ed,e.toDisplayString(e.unref(R)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=a=>Ge.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(dl,["enter"]),onInput:yo},null,40,td),[[e.vModelText,Ge.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Lt},e.toDisplayString(e.unref(R)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:dl},e.toDisplayString(e.unref(R)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Cn.value&&Le.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.labels.title")),1),e.createElementVNode("div",nd,[Le.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ld,[D.title?(e.openBlock(),e.createElementBlock("span",od,e.toDisplayString(D.title),1)):(e.openBlock(),e.createElementBlock("span",ad,e.toDisplayString(Je.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:V,value:D.title,onInput:An,onFocus:vn,onBlur:Al,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Le.value}]),placeholder:Je.value,disabled:D.disabled,rows:"1"},null,42,sd)])],2),Cn.value&&Le.value?(e.openBlock(),e.createElementBlock("div",rd,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":dn.value&&le.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.labels.description")),1),e.createElementVNode("div",id,[le.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",cd,[D.description?(e.openBlock(),e.createElementBlock("span",ud,e.toDisplayString(D.description),1)):(e.openBlock(),e.createElementBlock("span",dd,e.toDisplayString(rt.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:P,value:D.description,onInput:Nl,onFocus:Vl,onBlur:Rt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!le.value}]),placeholder:rt.value,disabled:D.disabled,rows:"1"},null,42,md)])],2),dn.value&&le.value?(e.openBlock(),e.createElementBlock("div",pd,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Kt.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=>Ho(a),onMouseleave:wo},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>Tl(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,gd)):(e.openBlock(),e.createElementBlock("span",hd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,vd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>Tl(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Cd)):(e.openBlock(),e.createElementBlock("span",kd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,yd)):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=>Tl(a),["stop"])},[e.createElementVNode("span",wd,"+"+e.toDisplayString(a.additionalCount),1)],12,bd)):e.createCommentVNode("",!0)],46,fd))),128)),D.richText?(e.openBlock(),e.createElementBlock("div",Md,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":D.disabled,"dss-text-editor-fixed-height":D.fixedHeight}]),style:e.normalizeStyle(hl.value),onInput:Z,onBlur:Dl,onClick:Bl,onMouseup:zl,onKeyup:zl,onKeydown:Dn,onPaste:pn,onMousemove:_o,onMouseleave:vo},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Kt.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(_n.value)},[sl.value||Bn.value.length>0?(e.openBlock(),e.createElementBlock("div",_d,[e.createElementVNode("div",$d,[sl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:sl.value},null,8,Td)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bn.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",Hd,[e.createElementVNode("div",Ad,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Dd)):(e.openBlock(),e.createElementBlock("span",Rd,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Fd,[e.createElementVNode("div",Id,[e.createElementVNode("div",zd,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",Pd,e.toDisplayString(Xl(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Cl(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),C.commentUser&&a.user&&a.user.id===C.commentUser.id&&!Cl(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>So(a,r),["stop"]),title:e.unref(R)("textEditor.comment.delete")||"Delete comment"},[...l[80]||(l[80]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,Od)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Zd,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:tl,"onUpdate:modelValue":l[26]||(l[26]=a=>el.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(R)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Ql,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(tl.value){const a=tl.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,Wd),[[e.vModelText,el.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Ql,["stop"])},[...l[81]||(l[81]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",qd,[e.createElementVNode("div",Ud,[e.createElementVNode("span",Xd,e.toDisplayString(I.value)+" "+e.toDisplayString(I.value===1?e.unref(R)("textEditor.footer.word"):e.unref(R)("textEditor.footer.words")),1),l[82]||(l[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Yd,e.toDisplayString(ne.value)+" "+e.toDisplayString(ne.value===1?e.unref(R)("textEditor.footer.character"):e.unref(R)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",xd,[e.createElementVNode("textarea",{value:D.modelValue,onInput:kl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":D.fixedHeight}]),placeholder:Fe.value,rows:D.rows,disabled:D.disabled,style:e.normalizeStyle(Ln.value)},null,46,Ed),e.createElementVNode("div",Vd,[e.createElementVNode("div",Nd,[e.createElementVNode("span",Sd,e.toDisplayString(I.value)+" "+e.toDisplayString(I.value===1?e.unref(R)("textEditor.footer.word"):e.unref(R)("textEditor.footer.words")),1),l[79]||(l[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Bd,e.toDisplayString(ne.value)+" "+e.toDisplayString(ne.value===1?e.unref(R)("textEditor.footer.character"):e.unref(R)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[te.value&&S.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ae.value),onMouseenter:l[28]||(l[28]=a=>Ze.value=!0),onMouseleave:_l},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers($o,["stop"]),title:S.value},e.toDisplayString(S.value),9,jd),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(nl,["stop"]),title:e.unref(R)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Gd,[...l[83]||(l[83]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Kd)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_e.value&&fe.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ct.value),onMouseenter:l[29]||(l[29]=a=>Et.value=!0),onMouseleave:wl},[e.createElementVNode("div",Qd,[fe.value===e.unref(R)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Jd,[...l[84]||(l[84]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:fe.value},e.toDisplayString(fe.value),9,e1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Co,["stop"]),title:e.unref(R)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",n1,[...l[85]||(l[85]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,t1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[D.floatingToolbar&&D.richText&&ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:wt,class:"dss-floating-toolbar",style:e.normalizeStyle(gt.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",l1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(w,["stop"]),title:e.unref(R)("textEditor.toolbar.undo")},[...l[86]||(l[86]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,o1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!A.value}]),onClick:e.withModifiers(y,["stop"]),title:e.unref(R)("textEditor.toolbar.redo")},[...l[87]||(l[87]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,a1),l[107]||(l[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",s1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(a=>fo("paragraph"),["stop"])),title:e.unref(R)("textEditor.toolbar.paragraphFormat")},[qe.value==="h1"?(e.openBlock(),e.createElementBlock("svg",i1,[...l[88]||(l[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):qe.value==="h2"?(e.openBlock(),e.createElementBlock("svg",c1,[...l[89]||(l[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):qe.value==="h3"?(e.openBlock(),e.createElementBlock("svg",u1,[...l[90]||(l[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):qe.value==="h4"?(e.openBlock(),e.createElementBlock("svg",d1,[...l[91]||(l[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):qe.value==="h5"?(e.openBlock(),e.createElementBlock("svg",m1,[...l[92]||(l[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):qe.value==="h6"?(e.openBlock(),e.createElementBlock("svg",p1,[...l[93]||(l[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",f1,[...l[94]||(l[94]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[95]||(l[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,r1),tt.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[38]||(l[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[31]||(l[31]=a=>ul("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=a=>ul("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=a=>ul("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=a=>ul("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=a=>ul("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=a=>ul("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=a=>ul("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[108]||(l[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(a=>et("bold"),["stop"])),title:e.unref(R)("textEditor.toolbar.bold")},[...l[96]||(l[96]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,v1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(a=>et("italic"),["stop"])),title:e.unref(R)("textEditor.toolbar.italic")},[...l[97]||(l[97]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,g1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(a=>et("underline"),["stop"])),title:e.unref(R)("textEditor.toolbar.underline")},[...l[98]||(l[98]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,h1),l[109]||(l[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt.value}]),onClick:e.withModifiers(so,["stop"]),title:e.unref(R)("textEditor.toolbar.citation")},[...l[99]||(l[99]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,y1),l[110]||(l[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(io,["stop"]),title:e.unref(R)("textEditor.toolbar.removeLink")},[...l[101]||(l[101]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,k1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(jl,["stop"]),title:e.unref(R)("textEditor.toolbar.insertLink")},[...l[100]||(l[100]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,C1)),l[111]||(l[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("insertUnorderedList")}]),onClick:e.withModifiers(al,["stop"]),title:e.unref(R)("textEditor.toolbar.bulletList")},[...l[102]||(l[102]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,b1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("insertOrderedList")}]),onClick:e.withModifiers(co,["stop"]),title:e.unref(R)("textEditor.toolbar.numberList")},[...l[103]||(l[103]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,w1),l[112]||(l[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Qt,["stop"]),title:e.unref(R)("textEditor.toolbar.image")},[...l[104]||(l[104]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,x1),l[113]||(l[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(R)("textEditor.toolbar.comment"),onClick:e.withModifiers(Rl,["stop"])},[...l[105]||(l[105]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,E1),D.askAi?(e.openBlock(),e.createElementBlock("div",V1)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",N1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(a=>fo("askAi"),["stop"])),title:e.unref(R)("textEditor.toolbar.askAi")},[l[106]||(l[106]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",B1,e.toDisplayString(e.unref(R)("textEditor.toolbar.askAi")),1)],8,S1),tt.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[43]||(l[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Hn.value?(e.openBlock(),e.createElementBlock("div",M1,[D.askAi&&Hn.value?(e.openBlock(),e.createElementBlock("div",_1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[at(a)&&nn(a)?(e.openBlock(),e.createElementBlock("div",$1,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),at(a)&&nn(a)&&r<D.customToolbarSlots.length-1&&Nn(r)?(e.openBlock(),e.createElementBlock("div",T1)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),A1={class:"dss-color-picker__section-title"},D1={class:"dss-color-picker__presets-row"},R1=["title","onClick"],F1={key:1,class:"dss-color-picker__section"},I1={class:"dss-color-picker__presets-row"},z1=["title","onClick"],P1={class:"dss-color-picker__section"},O1={class:"dss-color-picker__section-header"},Z1={class:"dss-color-picker__presets-row"},W1=["title","onClick"],q1=["onClick"],U1={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},X1=["title","onClick"],Y1={class:"dss-color-picker__input-row"},j1=["value"],K1={__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(D,{emit:ke}){function z(X){const j=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(X);if(!j)return{h:0,s:0,l:50};const Q=parseInt(j[1],16)/255,re=parseInt(j[2],16)/255,x=parseInt(j[3],16)/255,k=Math.max(Q,re,x),V=Math.min(Q,re,x);let P=0,Y=0;const xe=(k+V)/2;if(k!==V){const Ye=k-V;switch(Y=xe>.5?Ye/(2-k-V):Ye/(k+V),k){case Q:P=((re-x)/Ye+(re<x?6:0))/6;break;case re:P=((x-Q)/Ye+2)/6;break;case x:P=((Q-re)/Ye+4)/6;break}}return{h:P*360,s:Y*100,l:xe*100}}function R(X,j,Q){j/=100,Q/=100;const re=j*Math.min(Q,1-Q),x=k=>{const V=(k+X/30)%12,P=Q-re*Math.max(Math.min(V-3,9-V,1),-1);return Math.round(255*P).toString(16).padStart(2,"0")};return`#${x(0)}${x(8)}${x(4)}`}function Me(X){const j=X.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!j)return null;let Q=j[1];return Q.length===3&&(Q=Q.split("").map(re=>re+re).join("")),"#"+Q}function C(X,j,Q){j/=100,Q/=100;const re=Q+j*Math.min(Q,1-Q),x=re===0?0:2-2*Q/re;return{h:X,s:x*100,v:re*100}}function Te(X,j,Q){j/=100,Q/=100;const re=Q*(1-j/2),x=re===0||re===1?0:(Q-re)/Math.min(re,1-re);return{h:X,s:x*100,l:re*100}}const ie=D,nt=ke,f=e.ref(!1),ue=e.ref(!1),ve=e.ref(!1),de=e.ref(-1),te=e.ref(-1),S=e.ref(null),ae=e.ref(null),Ze=e.ref(null),He=e.ref(null),Ve=e.ref({top:0,left:0}),O=e.ref(z(ie.modelValue||"#b8a5de")),lt=e.computed(()=>Array.isArray(ie.presetGroups)&&ie.presetGroups.length>0),je=e.computed(()=>lt.value?0:ie.initialPresetCount!=null?ie.initialPresetCount:te.value<0?null:te.value),Ne=e.computed(()=>{const X=je.value;return X==null?!0:Math.max(0,ie.presetColors.length-X)<ie.max}),Ht=e.computed(()=>!!(ue.value||de.value>=0||!Bt.value&&ie.presetColors.length===0));e.computed(()=>{const X=je.value;return X!=null&&ie.presetColors.length>X});const Bt=e.computed(()=>lt.value||je.value!=null),pt=e.computed(()=>{const X=je.value;return X==null?[]:ie.presetColors.slice(0,X)}),Re=e.computed(()=>{const X=je.value;return X==null?[]:ie.presetColors.slice(X)});function ge(X){const j=je.value;return j!=null?j+X:-1}function gt(X){const j=je.value;return j!=null&&X>=j}function wt(X){gt(X)&&(de.value=X,O.value=z(ie.presetColors[X]),ue.value=!0,e.nextTick(()=>He.value?.focus()))}function tt(X){if(!gt(X))return;const j=ie.presetColors.filter((x,k)=>k!==X);nt("update:presetColors",j);const Q=Me(ie.modelValue),re=Me(ie.presetColors[X]);if(Q&&re&&Q.toLowerCase()===re.toLowerCase()){const x=j[Math.max(0,X-1)]||j[0];x&&nt("update:modelValue",x)}}function Mt(){ve.value=!ve.value,ve.value||(de.value=-1,ue.value=!1)}function Ft(){if(de.value<0)return;const X=Ge.value,j=Me(X);if(j){const Q=[...ie.presetColors];Q[de.value]=j,nt("update:presetColors",Q),nt("update:modelValue",j),de.value=-1,ue.value=!1}}function on(){ie.disabled||(de.value=-1,ue.value=!ue.value,ue.value&&(fe(),e.nextTick(()=>He.value?.focus())))}function xt(X){const j=Me(X),Q=Me(ie.modelValue);return j&&Q&&j.toLowerCase()===Q.toLowerCase()}function Ke(){if(ie.disabled||!Ne.value)return;const X=Ge.value,j=Me(X);if(j){const Q=[...ie.presetColors,j];nt("update:presetColors",Q),nt("update:modelValue",j);const re=je.value??te.value;re>=0&&Q.length-re>=ie.max&&(ue.value=!1)}}const Ge=e.computed(()=>{const{h:X,s:j,l:Q}=O.value;return R(X,j,Q)}),Zt=e.computed(()=>Ge.value.toLowerCase()),At=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${O.value.h}, 100%, 50%))`})),_t=e.computed(()=>{const X=C(O.value.h,O.value.s,O.value.l);return{left:`${X.s}%`,bottom:`${X.v}%`,transform:"translate(-50%, 50%)"}}),U=e.computed(()=>({left:`${O.value.h/360*100}%`,transform:"translateX(-50%)"})),Ie=e.computed(()=>({position:"fixed",left:`${Ve.value.left}px`,top:`${Ve.value.top}px`,zIndex:1002}));function _e(){if(!S.value||!f.value)return;const X=S.value.getBoundingClientRect(),j=window.innerHeight||document.documentElement.clientHeight;let Q=X.bottom+4;const re=ae.value;re&&Q+re.offsetHeight>j-8&&(Q=X.top-4-re.offsetHeight),Ve.value={top:Q,left:X.left}}function fe(){const X=ie.modelValue||"#b8a5de";Me(X)&&(O.value=z(X))}function ct(){nt("update:modelValue",Ge.value)}function Et(){ie.disabled||(f.value=!f.value,f.value&&(fe(),e.nextTick(()=>{_e(),He.value?.focus()})))}function We(){const X=Ge.value,j=Me(X);if(j){if(de.value>=0){const Q=[...ie.presetColors];Q[de.value]=j,nt("update:presetColors",Q),nt("update:modelValue",j)}else if((ie.presetColors.length>0||lt.value)&&ue.value&&Ne.value&&!ie.presetColors.some(re=>Me(re)?.toLowerCase()===j.toLowerCase())){const re=[...ie.presetColors,j];nt("update:presetColors",re),nt("update:modelValue",j)}}f.value=!1,ue.value=!1,ve.value=!1,de.value=-1}function ft(X){if(!Ze.value)return;const j=Ze.value.getBoundingClientRect(),Q=re=>{const x=Math.max(0,Math.min(1,(re.clientX-j.left)/j.width)),k=Math.max(0,Math.min(1,1-(re.clientY-j.top)/j.height)),V={h:O.value.h,s:x*100,v:k*100};O.value=Te(V.h,V.s,V.v)};Q(X),document.addEventListener("mousemove",Q),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",Q),ct()},{once:!0})}function dt(X){if(!X.currentTarget)return;const Q=X.currentTarget.getBoundingClientRect(),re=x=>{const k=Math.max(0,Math.min(1,(x.clientX-Q.left)/Q.width));O.value={...O.value,h:k*360}};re(X),document.addEventListener("mousemove",re),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",re),ct()},{once:!0})}function $t(X){const j=X.target.value,Q=Me(j);Q&&(O.value=z(Q),nt("update:modelValue",Q))}function ot(X){if(ie.disabled)return;const j=Me(X);j&&(O.value=z(j),nt("update:modelValue",j))}let bt=null,Se=null;function ut(){bt&&(document.removeEventListener("keydown",bt),bt=null),Se&&(window.removeEventListener("resize",Se),Se=null)}return e.watch(f,X=>{if(ut(),X){if(!lt.value&&ie.initialPresetCount==null){const j=ie.presetColors.length;j>0&&(te.value<0||j<te.value)&&(te.value=j)}bt=j=>{j.key==="Escape"&&We()},Se=_e,document.addEventListener("keydown",bt),window.addEventListener("resize",Se)}}),e.watch(()=>ie.modelValue,()=>{f.value&&fe()},{immediate:!1}),e.watch(Re,X=>{X.length===0&&(ve.value=!1,de.value=-1,ue.value=!1)}),e.onBeforeUnmount(ut),(X,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":D.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:S,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":f.value}]),onClick:Et},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:Ge.value})},[...j[0]||(j[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"},[f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(We,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ae,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Ie.value)},[Bt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[lt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(D.presetGroups,(Q,re)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+re,class:"dss-color-picker__section"},[e.createElementVNode("span",A1,e.toDisplayString(Q.title),1),e.createElementVNode("div",D1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.colors,(x,k)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+re+"-"+k,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(x)}]),style:e.normalizeStyle({backgroundColor:x}),title:x,onClick:e.withModifiers(V=>ot(x),["stop"])},null,14,R1))),128))])]))),128)):pt.value.length?(e.openBlock(),e.createElementBlock("div",F1,[j[1]||(j[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",I1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,(Q,re)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+re,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(Q)}]),style:e.normalizeStyle({backgroundColor:Q}),title:Q,onClick:e.withModifiers(x=>ot(Q),["stop"])},null,14,z1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",P1,[e.createElementVNode("div",O1,[j[3]||(j[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Re.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":ve.value}]),title:"Manage custom colors",onClick:e.withModifiers(Mt,["stop"])},[...j[2]||(j[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",Z1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(Q,re)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+re,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":ve.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!ve.value&&xt(Q),"dss-color-picker__preset-bubble--editing":ve.value&&de.value===ge(re)}]),style:e.normalizeStyle({backgroundColor:de.value===ge(re)?Ge.value:Q}),title:de.value===ge(re)?Ge.value:Q,onClick:e.withModifiers(x=>ve.value?wt(ge(re)):ot(Q),["stop"])},null,14,W1),ve.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(x=>tt(ge(re)),["stop"])},[...j[4]||(j[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,q1)):e.createCommentVNode("",!0)],2))),128)),Ne.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ue.value}]),onClick:e.withModifiers(on,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):D.presetColors.length?(e.openBlock(),e.createElementBlock("div",U1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.presetColors,(Q,re)=>(e.openBlock(),e.createElementBlock("button",{key:re,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(Q)}]),style:e.normalizeStyle({backgroundColor:Q}),title:Q,onClick:e.withModifiers(x=>ot(Q),["stop"])},null,14,X1))),128)),Ne.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ue.value}]),onClick:e.withModifiers(on,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ht.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Ze,onMousedown:ft},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(At.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(_t.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:dt},[j[5]||(j[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(U.value)},null,4)],32),e.createElementVNode("div",Y1,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:He,type:"text",class:"dss-color-picker__hex-input",value:Zt.value,onInput:$t},null,40,j1)]),Bt.value&&(D.presetColors.length||lt.value)&&Ne.value&&de.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Ke}," Save color ")):e.createCommentVNode("",!0),Bt.value&&de.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Ft}," Save color ")):e.createCommentVNode("",!0),Bt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:We}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},G1={key:0,class:"dss-loader"},Q1={key:0,class:"dss-loader-label"},J1={key:1,class:"dss-loader"},em={key:0,class:"dss-loader-label"},tm={key:2,class:"dss-loader"},nm={key:0,class:"dss-loader-label"},lm={key:3,class:"dss-loader"},om={key:0,class:"dss-loader-label"},am={key:4,class:"dss-loader"},sm={key:0,class:"dss-loader-label"},rm={key:5,class:"dss-loader dss-loader--inline"},im={class:"dss-loader-inline-text"},cm={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"}},setup(D){const ke=D,z=e.computed(()=>ke.size==="small"?"dss-loaders--size-small":ke.size==="large"?"dss-loaders--size-large":ke.size==="medium"||ke.size==null?"dss-loaders--size-medium":null),R=e.computed(()=>ke.size==="small"||ke.size==="medium"||ke.size==="large"||ke.size==null?{}:{"--dss-loader-size":typeof ke.size=="number"?`${ke.size}px`:String(ke.size)});return(Me,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",z.value]),style:e.normalizeStyle(R.value)},[D.type==="spinner"?(e.openBlock(),e.createElementBlock("div",G1,[C[0]||(C[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),D.label?(e.openBlock(),e.createElementBlock("span",Q1,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="dots"?(e.openBlock(),e.createElementBlock("div",J1,[C[1]||(C[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)),D.label?(e.openBlock(),e.createElementBlock("span",em,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="battery"?(e.openBlock(),e.createElementBlock("div",tm,[C[2]||(C[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),D.label?(e.openBlock(),e.createElementBlock("span",nm,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",lm,[C[3]||(C[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)),D.label?(e.openBlock(),e.createElementBlock("span",om,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="bars"?(e.openBlock(),e.createElementBlock("div",am,[C[4]||(C[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)),D.label?(e.openBlock(),e.createElementBlock("span",sm,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="inline"?(e.openBlock(),e.createElementBlock("div",rm,[C[5]||(C[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",im,[e.renderSlot(Me.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(D.label),1)])])])):e.createCommentVNode("",!0)],6))}},Uo="dss-skeleton-item",um={__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:D=>["single","multiple"].includes(D)},targetClass:{type:String,default:Uo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(D){const ke=D,z=e.computed(()=>{const C={"dss-skeleton--loading":ke.loading,"dss-skeleton--static":!ke.shimmer,"dss-skeleton--multiple":ke.mode==="multiple","dss-skeleton--dark":ke.darkMode};return ke.mode==="multiple"&&ke.targetClass!==Uo&&(C[`dss-skeleton--target-${ke.targetClass}`]=!0),C}),R=e.computed(()=>{const C={};return ke.borderRadius&&(C.borderRadius=ke.borderRadius),C}),Me=e.computed(()=>{const C={};return ke.borderRadius&&(C["--dss-skeleton-border-radius"]=ke.borderRadius),ke.darkMode?(C["--dss-skeleton-bg"]=ke.bgDark||"#322c3f",C["--dss-skeleton-shimmer"]=ke.shimmerDark||"#3e3f41",C):(ke.bgColor&&(C["--dss-skeleton-bg"]=ke.bgColor),ke.shimmerColor&&(C["--dss-skeleton-shimmer"]=ke.shimmerColor),C)});return(C,Te)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",z.value]),style:e.normalizeStyle(Me.value)},[D.loading&&D.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(R.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":D.loading&&D.mode==="single"}])},[e.renderSlot(C.$slots,"default")],2)],6))}},dm={key:0,class:"dss-dnd-column-header"},mm={class:"dss-dnd-column-title"},pm={class:"dss-dnd-column-count"},fm=["data-column"],vm={key:0,class:"dss-dnd-indicator"},gm=["onPointerdown"],hm=["onPointerdown"],ym={class:"dss-dnd-item-content"},Cm={class:"dss-dnd-item-default"},km={key:0,class:"dss-dnd-empty"},bm={name:"DSSDnd"},wm=Object.assign(bm,{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(D,{emit:ke}){const z=D,R=ke,Me={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1},C=e.computed(()=>({...Me,...z.options})),Te=e.computed(()=>({"--dss-dnd-col-min-w":C.value.columnMinWidth,"--dss-dnd-col-max-w":C.value.columnMaxWidth,"--dss-dnd-col-gap":C.value.columnGap,"--dss-dnd-indicator-color":C.value.indicatorColor,"--dss-dnd-body-max-h":C.value.columnBodyMaxHeight})),ie=e.ref(null),nt=e.ref(null),f=e.ref(-1),ue=e.ref(null);let ve=null,de=null,te=null,S=null,ae=0,Ze=0,He="",Ve=null;const O=5,lt=e.computed(()=>{const U={};for(const Ie of z.columns)U[Ie.value]=z.items.filter(_e=>_e[z.columnKey]===Ie.value).sort((_e,fe)=>(_e[z.positionKey]??0)-(fe[z.positionKey]??0));return U}),je=e.computed(()=>{const U={},Ie=!!ie.value,_e=ie.value?.[z.itemKey],fe=nt.value,ct=f.value;for(const Et of z.columns){const We=lt.value[Et.value]||[],ft=[],dt=fe==Et.value;let $t=0;for(let ot=0;ot<We.length;ot++){const bt=We[ot],Se=Ie&&bt[z.itemKey]===_e;!Se&&dt&&ct===$t&&ft.push({type:"indicator",key:`ind-${$t}`}),Se||$t++,ft.push({type:"item",item:bt,isDragged:Se,key:`item-${bt[z.itemKey]}`})}dt&&ct>=$t&&ft.push({type:"indicator",key:"ind-end"}),U[Et.value]=ft}return U});function Ne(U,Ie){const fe=(lt.value[U]||[]).filter(We=>We[z.itemKey]!==ie.value?.[z.itemKey]);if(fe.length===0)return 1;if(Ie<=0){const We=fe[0][z.positionKey];return We!=null&&We>0?We/2:.5}if(Ie>=fe.length){const We=fe[fe.length-1][z.positionKey];return(We??0)+1}const ct=fe[Ie-1][z.positionKey]??0,Et=fe[Ie][z.positionKey]??0;return(ct+Et)/2}function Ht(U,Ie,_e){te&&te.remove();const fe=U.getBoundingClientRect(),ct=U.cloneNode(!0);ct.classList.add("dss-dnd-ghost"),ct.style.cssText=`
|
|
85
104
|
position: fixed;
|
|
86
|
-
left: ${
|
|
87
|
-
top: ${
|
|
88
|
-
width: ${
|
|
89
|
-
height: ${
|
|
105
|
+
left: ${Ie-ae}px;
|
|
106
|
+
top: ${_e-Ze}px;
|
|
107
|
+
width: ${fe.width}px;
|
|
108
|
+
height: ${fe.height}px;
|
|
90
109
|
z-index: 9999;
|
|
91
110
|
pointer-events: none;
|
|
92
|
-
opacity: ${
|
|
111
|
+
opacity: ${C.value.dragGhostOpacity};
|
|
93
112
|
box-sizing: border-box;
|
|
94
113
|
box-shadow: 0 8px 24px rgba(0,0,0,0.15);
|
|
95
|
-
background-color: ${
|
|
114
|
+
background-color: ${C.value.dragSourceBackground};
|
|
96
115
|
font-family: 'Work Sans', sans-serif;
|
|
97
|
-
`,document.body.appendChild(Xe),j=Xe}function ut(re,xe){j&&(j.style.left=`${re-_e}px`,j.style.top=`${xe-Pe}px`)}function he(re){re.classList.add("dss-dnd-item--dragging"),re.style.background=k.value.dragSourceBackground,re.style.borderColor=k.value.dragSourceBorder,re.style.transform="scale(0.97)"}function Dt(re){re.classList.remove("dss-dnd-item--dragging"),re.style.background="",re.style.borderColor="",re.style.transform=""}function xt(re,xe){return document.elementFromPoint(re,xe)?.closest(".dss-dnd-column-body")??null}function nt(re,xe){const ee=xt(re,xe),le=ee?.getAttribute("data-column")??null;if(!le){Fe.value=null,p.value=-1;return}Fe.value=le;const Xe=ee.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let ct=Xe.length;for(let Ze=0;Ze<Xe.length;Ze++){const Ve=Xe[Ze].getBoundingClientRect();if(xe<Ve.top+Ve.height/2){ct=Ze;break}}p.value=ct}function Be(re){re.preventDefault(),ut(re.clientX,re.clientY),!we&&(we=requestAnimationFrame(()=>{we=null,nt(re.clientX,re.clientY)}))}function ne(re){window.removeEventListener("pointermove",Be),window.removeEventListener("pointerup",ne),window.removeEventListener("pointercancel",ne),_?.releasePointerCapture?.(re.pointerId),Dt(_),_=null;const ee=xt(re.clientX,re.clientY)?.getAttribute("data-column")??null;if(oe.value&&ee){const le=oe.value[D.columnKey],Xe=ee,Ze=(Le.value[Xe]||[]).filter(ot=>ot[D.itemKey]!==oe.value[D.itemKey]),Ve=Math.max(0,Math.min(p.value,Ze.length)),Ot=F(Xe,Ve),_t=oe.value[D.itemKey];I("move",{item:oe.value,from:le,to:Xe,position:Ot,index:Ve}),ge&&clearTimeout(ge),ce.value={id:_t,from:le,to:Xe},ge=setTimeout(()=>{ce.value=null},3500)}j&&(j.remove(),j=null),Xt()}function vn(re,xe){re.preventDefault();const ee=re.target.closest(".dss-dnd-item");if(!ee)return;const le=ee.getBoundingClientRect();_e=re.clientX-le.left,Pe=re.clientY-le.top,oe.value=xe,_=ee,dt(ee,re.clientX,re.clientY),requestAnimationFrame(()=>he(ee)),ee.setPointerCapture?.(re.pointerId),window.addEventListener("pointermove",Be),window.addEventListener("pointerup",ne,{once:!0}),window.addEventListener("pointercancel",ne,{once:!0})}function rt(re,xe){k.value.useHandle||vn(re,xe)}function Ge(re,xe){vn(re,xe)}function sn(){we&&(cancelAnimationFrame(we),we=null)}function Xt(){sn(),oe.value=null,Fe.value=null,p.value=-1}return e.onBeforeUnmount(()=>{sn(),ge&&clearTimeout(ge),j&&(j.remove(),j=null)}),(re,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,ee=>(e.openBlock(),e.createElementBlock("div",{key:ee.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":Fe.value==ee.value},ee.class||""]])},[k.value.showHeader?(e.openBlock(),e.createElementBlock("div",hm,[e.renderSlot(re.$slots,"column-header",{column:ee,items:Le.value[ee.value]||[]},()=>[e.createElementVNode("span",ym,e.toDisplayString(ee.title||ee.value),1),e.createElementVNode("span",km,e.toDisplayString((Le.value[ee.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":ee.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value[ee.value],le=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:le.key},[le.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":le.isDragged,"dss-dnd-item--no-handle":!k.value.useHandle}]),onPointerdown:Xe=>rt(Xe,le.item)},[k.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Xe=>Ge(Xe,le.item),["stop"])},[e.renderSlot(re.$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(re.$slots,"item",{item:le.item,column:ee,justDropped:ce.value?.id===le.item[L.itemKey],droppedFrom:ce.value?.id===le.item[L.itemKey]?ce.value.from:null,droppedTo:ce.value?.id===le.item[L.itemKey]?ce.value.to:null},()=>[e.createElementVNode("div",Vm,e.toDisplayString(le.item[L.itemKey]),1)])])],42,wm))],64))),128)),(Le.value[ee.value]||[]).length===0&&Fe.value!=ee.value?(e.openBlock(),e.createElementBlock("div",Sm,[e.renderSlot(re.$slots,"empty",{column:ee},()=>[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),I=e.ref(!1);let be=[],k=null,Me=null;function oe(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 be)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 ce(j,_,_e){const Pe=.3+_e*.7;for(let Le=0;Le<be.length;Le++){const je=be[Le];je.tiltAngle+=je.tiltInc,je.y+=je.speed*Pe,je.x+=Math.sin(je.d)*.5*Pe,je.tilt=Math.sin(je.tiltAngle)*15,_e>=.99&&je.y>_+20&&(be[Le]=Fe(j))}}function we(){I.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,be=oe(j.width,j.height);const Le=Date.now(),je=Le+fe.duration,F=()=>{const dt=Date.now(),ut=dt-Le;if(dt<je){let he=1;ut>fe.fadeStart&&(he=1-(ut-fe.fadeStart)/(fe.duration-fe.fadeStart)),p(_,j.width,j.height,he),ce(j.width,j.height,he),k=requestAnimationFrame(F)}else ge()};F()})}function ge(){k&&(cancelAnimationFrame(k),k=null),be=[],I.value=!1}return e.watch(()=>fe.trigger,j=>{j&&(Me&&clearTimeout(Me),Me=setTimeout(we,fe.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ge(),Me&&clearTimeout(Me)}),(j,_)=>I.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:D,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),$m={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"}},Tm={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:$m,table:Tm,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;
|
|
116
|
+
cursor: grabbing;
|
|
117
|
+
`,document.body.appendChild(ct),te=ct}function Bt(U,Ie){te&&(te.style.left=`${U-ae}px`,te.style.top=`${Ie-Ze}px`)}function pt(U){U.classList.add("dss-dnd-item--dragging"),U.style.background=C.value.dragSourceBackground,U.style.borderColor=C.value.dragSourceBorder,U.style.transform="scale(0.97)"}function Re(U){U.classList.remove("dss-dnd-item--dragging"),U.style.background="",U.style.borderColor="",U.style.transform=""}function ge(U,Ie){return document.elementFromPoint(U,Ie)?.closest(".dss-dnd-column-body")??null}function gt(U,Ie){const _e=ge(U,Ie),fe=_e?.getAttribute("data-column")??null;if(!fe){nt.value=null,f.value=-1;return}nt.value=fe;const ct=_e.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Et=ct.length;for(let We=0;We<ct.length;We++){const ft=ct[We].getBoundingClientRect();if(Ie<ft.top+ft.height/2){Et=We;break}}f.value=Et}function wt(U){U.preventDefault(),Bt(U.clientX,U.clientY),!ve&&(ve=requestAnimationFrame(()=>{ve=null,gt(U.clientX,U.clientY)}))}function tt(U){window.removeEventListener("pointermove",wt),window.removeEventListener("pointerup",tt),window.removeEventListener("pointercancel",tt),S?.releasePointerCapture?.(U.pointerId),Re(S),S=null;const _e=ge(U.clientX,U.clientY)?.getAttribute("data-column")??null;if(ie.value&&_e){const fe=ie.value[z.columnKey],ct=_e,We=(lt.value[ct]||[]).filter(ot=>ot[z.itemKey]!==ie.value[z.itemKey]),ft=Math.max(0,Math.min(f.value,We.length)),dt=Ne(ct,ft),$t=ie.value[z.itemKey];R("move",{item:ie.value,from:fe,to:ct,position:dt,index:ft}),de&&clearTimeout(de),ue.value={id:$t,from:fe,to:ct},de=setTimeout(()=>{ue.value=null},3500)}te&&(te.remove(),te=null),He!==null&&(document.body.style.cursor=He,He=""),_t()}function Mt(U,Ie){U.preventDefault();const _e=U.target.closest(".dss-dnd-item");if(!_e)return;const fe=_e.getBoundingClientRect();ae=U.clientX-fe.left,Ze=U.clientY-fe.top,He=document.body.style.cursor,document.body.style.cursor="grabbing",ie.value=Ie,S=_e,Ht(_e,U.clientX,U.clientY),requestAnimationFrame(()=>pt(_e)),_e.setPointerCapture?.(U.pointerId),window.addEventListener("pointermove",wt),window.addEventListener("pointerup",tt,{once:!0}),window.addEventListener("pointercancel",tt,{once:!0})}function Ft(){Ve&&(window.removeEventListener("pointermove",on),window.removeEventListener("pointerup",xt),window.removeEventListener("pointercancel",xt),Ve=null)}function on(U){if(!Ve||U.pointerId!==Ve.pointerId)return;const Ie=U.clientX-Ve.startX,_e=U.clientY-Ve.startY;if(Math.abs(Ie)>=O||Math.abs(_e)>=O){const fe=Ve.item;Ft(),Mt(U,fe)}}function xt(U){!Ve||U.pointerId!==Ve.pointerId||Ft()}function Ke(U,Ie){Ft(),Ve={item:Ie,startX:U.clientX,startY:U.clientY,pointerId:U.pointerId},window.addEventListener("pointermove",on),window.addEventListener("pointerup",xt),window.addEventListener("pointercancel",xt)}function Ge(U,Ie){C.value.useHandle||Ke(U,Ie)}function Zt(U,Ie){Ke(U,Ie)}function At(){ve&&(cancelAnimationFrame(ve),ve=null)}function _t(){At(),ie.value=null,nt.value=null,f.value=-1}return e.onBeforeUnmount(()=>{At(),Ft(),de&&clearTimeout(de),te&&(te.remove(),te=null)}),(U,Ie)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":C.value.unstyled}]),style:e.normalizeStyle(Te.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.columns,_e=>(e.openBlock(),e.createElementBlock("div",{key:_e.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":nt.value==_e.value},_e.class||""]])},[C.value.showHeader?(e.openBlock(),e.createElementBlock("div",dm,[e.renderSlot(U.$slots,"column-header",{column:_e,items:lt.value[_e.value]||[]},()=>[e.createElementVNode("span",mm,e.toDisplayString(_e.title||_e.value),1),e.createElementVNode("span",pm,e.toDisplayString((lt.value[_e.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":_e.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value[_e.value],fe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:fe.key},[fe.type==="indicator"?(e.openBlock(),e.createElementBlock("div",vm)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":fe.isDragged,"dss-dnd-item--no-handle":!C.value.useHandle}]),onPointerdown:ct=>Ge(ct,fe.item)},[C.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(ct=>Zt(ct,fe.item),["stop"])},[e.renderSlot(U.$slots,"handle",{},()=>[Ie[0]||(Ie[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,hm)):e.createCommentVNode("",!0),e.createElementVNode("div",ym,[e.renderSlot(U.$slots,"item",{item:fe.item,column:_e,justDropped:ue.value?.id===fe.item[D.itemKey],droppedFrom:ue.value?.id===fe.item[D.itemKey]?ue.value.from:null,droppedTo:ue.value?.id===fe.item[D.itemKey]?ue.value.to:null},()=>[e.createElementVNode("div",Cm,e.toDisplayString(fe.item[D.itemKey]),1)])])],42,gm))],64))),128)),(lt.value[_e.value]||[]).length===0&&nt.value!=_e.value?(e.openBlock(),e.createElementBlock("div",km,[e.renderSlot(U.$slots,"empty",{column:_e},()=>[Ie[1]||(Ie[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,fm)],2))),128))],6))}}),xm={name:"DSSConfetti"},Em=Object.assign(xm,{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(D){const ke=D,z=e.ref(null),R=e.ref(!1);let Me=[],C=null,Te=null;function ie(te,S){const ae=[];for(let Ze=0;Ze<ke.count;Ze++)ae.push(nt(te));return ae}function nt(te,S){return{x:Math.random()*te,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:ke.colors[Math.floor(Math.random()*ke.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 f(te,S,ae,Ze){te.clearRect(0,0,S,ae);for(const He of Me)te.save(),te.globalAlpha=He.opacity*Ze,te.beginPath(),te.lineWidth=He.r,te.strokeStyle=He.color,te.moveTo(He.x+He.tilt+He.r/2,He.y),te.lineTo(He.x+He.tilt,He.y+He.tilt+He.r/2),te.stroke(),te.restore()}function ue(te,S,ae){const Ze=.3+ae*.7;for(let He=0;He<Me.length;He++){const Ve=Me[He];Ve.tiltAngle+=Ve.tiltInc,Ve.y+=Ve.speed*Ze,Ve.x+=Math.sin(Ve.d)*.5*Ze,Ve.tilt=Math.sin(Ve.tiltAngle)*15,ae>=.99&&Ve.y>S+20&&(Me[He]=nt(te))}}function ve(){R.value=!0,e.nextTick(()=>{const te=z.value;if(!te)return;const S=te.getContext("2d"),ae=te.parentElement;if(!ae)return;const Ze=ae.getBoundingClientRect();te.width=Ze.width,te.height=Ze.height,Me=ie(te.width,te.height);const He=Date.now(),Ve=He+ke.duration,O=()=>{const lt=Date.now(),je=lt-He;if(lt<Ve){let Ne=1;je>ke.fadeStart&&(Ne=1-(je-ke.fadeStart)/(ke.duration-ke.fadeStart)),f(S,te.width,te.height,Ne),ue(te.width,te.height,Ne),C=requestAnimationFrame(O)}else de()};O()})}function de(){C&&(cancelAnimationFrame(C),C=null),Me=[],R.value=!1}return e.watch(()=>ke.trigger,te=>{te&&(Te&&clearTimeout(Te),Te=setTimeout(ve,ke.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{de(),Te&&clearTimeout(Te)}),(te,S)=>R.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:z,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Vm={class:"dss-filter-global-inner"},Nm=["value"],Sm=["title"],Bm={key:0,class:"dss-filter-funnel-badge"},Mm={class:"dss-filter-panel"},_m={key:0,class:"dss-filter-empty"},$m={class:"dss-filter-row-prefix"},Tm={class:"dss-filter-cell"},Lm=["onClick"],Hm={class:"dss-filter-trigger-text"},Am={class:"dss-filter-popup-list"},Dm=["onClick"],Rm={key:0,class:"dss-filter-popup-empty"},Fm={key:0,class:"dss-filter-cell"},Im=["onClick"],zm={class:"dss-filter-trigger-text"},Pm={class:"dss-filter-popup-list"},Om=["onClick"],Zm={key:1,class:"dss-filter-cell dss-filter-cell--value"},Wm=["onUpdate:modelValue"],qm={key:1,class:"dss-filter-date-wrap"},Um=["onUpdate:modelValue"],Xm=["value","onInput","step"],Ym={key:4,class:"dss-filter-between"},jm=["value","onInput","step"],Km=["value","onInput","step"],Gm={key:5,class:"dss-filter-multiselect"},Qm=["onClick"],Jm={class:"dss-filter-trigger-text"},e2={class:"dss-filter-popup-list dss-filter-popup-list--check"},t2=["onClick"],n2=["checked"],l2={key:0,class:"dss-filter-popup-empty"},o2=["onClick"],a2={class:"dss-filter-foot"},s2={class:"dss-filter-cell"},r2={class:"dss-filter-popup-list"},i2=["onClick"],c2={key:0,class:"dss-filter-popup-divider"},u2=["onClick"],d2={class:"dss-filter-popup-list"},m2=["onClick"],p2={key:0,class:"dss-filter-popup-empty"},f2={class:"dss-filter-popup-list"},v2=["onClick"],g2={key:0,class:"dss-filter-popup-empty"},h2={name:"DSSFilter"},y2=Object.assign(h2,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(D,{expose:ke,emit:z}){const R=D,Me=z,C={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},Te=e.computed(()=>({...C,...R.options})),ie={text:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"equals",label:"equals"},{value:"not_equals",label:"does not equal"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],select:[{value:"is_any_of",label:"is any of"},{value:"is_none_of",label:"is none of"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],range:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],int:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arraySelect:[{value:"contains_any",label:"contains any of"},{value:"contains_all",label:"contains all of"},{value:"not_contains_any",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arrayText:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],date:[{value:"eq",label:"on"},{value:"before",label:"before"},{value:"after",label:"after"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],boolean:[{value:"is_true",label:"is true"},{value:"is_false",label:"is false"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}]},nt=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],ue=e.ref(""),ve=e.ref([]),de=e.ref(null),te=e.ref(!1),S=e.ref(null),ae=e.ref(""),Ze=e.ref(null);let He=1;function Ve(x){const k=x.find(V=>V&&typeof V=="object");if(!k)return null;for(const V of f)if(V in k&&typeof k[V]=="string")return V;return Object.keys(k).find(V=>typeof k[V]=="string")||null}function O(x,k){const V=k.filter(P=>P!=null&&P!=="NULL");if(V.length===0)return null;if(V.every(P=>Array.isArray(P))){const P=V.flatMap(xe=>xe).filter(xe=>xe!=null);return P.length===0?null:typeof P.find(xe=>xe!=null)=="object"?"arraySelect":"arrayText"}return V.every(P=>typeof P=="boolean")?"boolean":V.every(P=>typeof P=="number")?new Set(V).size<=Te.value.maxUniqueForEnum?"select":"range":V.every(P=>typeof P=="string")?new Set(V).size<=Te.value.maxUniqueForSelect?"select":"text":V.some(P=>typeof P=="object"&&!Array.isArray(P))?null:"text"}const lt=e.computed(()=>{if(!R.data?.length)return[];const x=new Set;for(const Y of R.data)if(Y&&typeof Y=="object")for(const xe of Object.keys(Y))x.add(xe);const k=new Set(R.exclude),V=[];for(const Y of x){if(k.has(Y))continue;const xe=R.config[Y]||{},Ye=R.data.map(Vt=>Vt?.[Y]),Le=xe.type||O(Y,Ye);if(!Le)continue;const le=xe.filterMode||"contain",Qe=le==="date"?"date":le==="string"?"text":Le,qe={key:Y,label:xe.label||Q(Y),type:Qe,filterMode:le};if(Le==="select"){const Vt=Ye.filter(vt=>vt!=null&&vt!=="NULL");qe.uniqueValues=[...new Set(Vt)].sort((vt,Ue)=>typeof vt=="number"&&typeof Ue=="number"?vt-Ue:String(vt).localeCompare(String(Ue)))}else if(Le==="range"||Le==="int"){const Vt=Ye.filter(vt=>typeof vt=="number");qe.min=Math.min(...Vt),qe.max=Math.max(...Vt)}else if(Le==="arraySelect"){const Vt=xe.displayKey||Ve(Ye.flatMap(Ue=>Array.isArray(Ue)?Ue:[]));qe.displayKey=Vt;const vt=Ye.flatMap(Ue=>Array.isArray(Ue)?Ue:[]).filter(Ue=>Ue!=null).map(Ue=>Vt&&typeof Ue=="object"?Ue[Vt]:String(Ue)).filter(Ue=>Ue!=null&&Ue!=="");qe.uniqueValues=[...new Set(vt)].sort((Ue,Dt)=>String(Ue).localeCompare(String(Dt)))}V.push(qe)}const P=R.config._order;return P&&V.sort((Y,xe)=>{const Ye=P.indexOf(Y.key),Le=P.indexOf(xe.key);return Ye===-1&&Le===-1?0:Ye===-1?1:Le===-1?-1:Ye-Le}),V}),je=e.computed(()=>{const x={};for(const k of lt.value)x[k.key]=k;return x}),Ne=e.computed(()=>Array.isArray(R.config.groups)&&R.config.groups.length>0),Ht=e.computed(()=>{if(!Ne.value)return[];const x=new Set(lt.value.map(k=>k.key));return R.config.groups.map(k=>({...k,keys:k.keys.filter(V=>x.has(V))})).filter(k=>k.keys.length>0)}),Bt=e.computed(()=>{if(!Ne.value)return[];const x=new Set(R.config.groups.flatMap(k=>k.keys));return lt.value.filter(k=>!x.has(k.key))}),pt=e.computed(()=>{if(!Ze.value)return[];const x=new Set(Ze.value.keys),k=lt.value.filter(P=>x.has(P.key));if(!ae.value)return k;const V=ae.value.toLowerCase();return k.filter(P=>P.label.toLowerCase().includes(V))}),Re=e.computed(()=>{if(!ae.value)return lt.value;const x=ae.value.toLowerCase();return lt.value.filter(k=>k.label.toLowerCase().includes(x))});function ge(x){de.value===x?gt():(de.value=x,ae.value="",Ze.value=null)}function gt(){de.value=null,ae.value="",Ze.value=null}function wt(x){const k=x.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");de.value&&!k&&!x.target.closest(".dss-filter-popup")&&!x.target.closest(".dss-filter-trigger")&&!x.target.closest(".dss-filter-add-btn")&>(),te.value&&S.value&&!S.value.contains(x.target)&&(k||(te.value=!1))}e.onMounted(()=>document.addEventListener("click",wt)),e.onBeforeUnmount(()=>document.removeEventListener("click",wt));function tt(x){return je.value[x]?.label||Q(x)}function Mt(x){return je.value[x.key]?.filterMode||"contain"}function Ft(x){for(const k of Object.values(ie)){const V=k.find(P=>P.value===x);if(V)return V.label}return x}function on(x){const k=je.value[x.key];return ie[k?.type]||ie.text}function xt(x){return nt.has(x)}function Ke(x){const k=je.value[x.key];return k?k.type==="date"?"date":k.type==="boolean"?"boolean":k.type==="text"||k.type==="arrayText"?"text":k.type==="select"||k.type==="arraySelect"?"multiselect":k.type==="range"||k.type==="int"?x.operator==="between"?"between":"number":"text":"text"}function Ge(x){return ie[x]?.[0]?.value||"contains"}function Zt(x,k){return nt.has(k)||x==="date"?null:x==="select"||x==="arraySelect"?[]:(x==="range"||x==="int")&&k==="between"?{min:null,max:null}:x==="range"||x==="int"?null:""}function At(x){return je.value[x.key]?.uniqueValues||[]}function _t(x){const k=At(x);if(!ae.value)return k;const V=ae.value.toLowerCase();return k.filter(P=>String(P).toLowerCase().includes(V))}function U(x){const k=x.value;return!k||k.length===0?"Select...":k.length<=2?k.join(", "):`${k.length} selected`}function Ie(x){const k=je.value[x],V=k?.filterMode||"contain",P=k?.type||"text",Y=V==="string"?"contains":Ge(P);ve.value.push(e.reactive({id:He++,key:x,operator:Y,value:Zt(P,Y)})),gt()}function _e(x){ve.value=ve.value.filter(k=>k.id!==x)}function fe(x,k){const P=je.value[k]?.type||"text";x.key=k,x.operator=Ge(P),x.value=Zt(P,x.operator),gt()}function ct(x,k){const V=Ke(x);x.operator=k;const P=Ke(x);if(V!==P||nt.has(k)){const Y=je.value[x.key];x.value=Zt(Y?.type||"text",k)}gt()}function Et(x,k){const V=k.target.value;x.value=V===""?null:Number(V)}function We(x,k,V){const P=V.target.value,Y=P===""?null:Number(P);(!x.value||typeof x.value!="object")&&(x.value={min:null,max:null}),x.value={...x.value,[k]:isNaN(Y)?null:Y}}function ft(x,k){const V=x.value||[],P=V.indexOf(k);x.value=P>=0?V.filter(Y=>Y!==k):[...V,k]}function dt(){ve.value=[],ue.value="",gt()}function $t(x){ue.value=x.target.value}const ot=e.computed(()=>{if(!R.data)return[];let x=R.data;if(ue.value){const k=ue.value.toLowerCase();x=x.filter(V=>{for(const P of Object.keys(V)){const Y=V[P];if(typeof Y=="string"&&Y.toLowerCase().includes(k)||typeof Y=="number"&&String(Y).includes(k)||Array.isArray(Y)&&Y.some(xe=>xe!=null&&(typeof xe=="string"?xe.toLowerCase().includes(k):typeof xe=="object"?Object.values(xe).some(Ye=>typeof Ye=="string"&&Ye.toLowerCase().includes(k)):!1)))return!0}return!1})}for(const k of ve.value){if(!bt(k))continue;const V=je.value[k.key];V&&(x=x.filter(P=>Se(P,k,V)))}return x});function bt(x){return nt.has(x.operator)?!0:x.value==null||typeof x.value=="string"&&x.value===""||Array.isArray(x.value)&&x.value.length===0?!1:x.value instanceof Date?!isNaN(x.value.getTime()):!(typeof x.value=="object"&&!Array.isArray(x.value)&&x.value.min==null&&x.value.max==null)}function Se(x,k,V){const P=x?.[k.key],Y=k.value,xe=k.operator;if(xe==="is_empty")return j(P);if(xe==="is_not_empty")return!j(P);const Ye=V.type;if(Ye==="text"||Ye==="arrayText"){const Le=Ye==="arrayText"&&Array.isArray(P)?P.filter(qe=>qe!=null).map(String).join(" "):P!=null?String(P):"",le=String(Y).toLowerCase(),Qe=Le.toLowerCase();switch(xe){case"contains":return Qe.includes(le);case"not_contains":return!Qe.includes(le);case"equals":return Qe===le;case"not_equals":return Qe!==le;case"starts_with":return Qe.startsWith(le);case"ends_with":return Qe.endsWith(le);default:return!0}}if(Ye==="select")switch(xe){case"is_any_of":return Y.includes(P);case"is_none_of":return!Y.includes(P);default:return!0}if(Ye==="range"||Ye==="int"){const Le=typeof P=="number"?P:Number(P);if(typeof Le!="number"||isNaN(Le))return!1;if(xe==="between"){const Qe=Y?.min!=null?Number(Y.min):null,qe=Y?.max!=null?Number(Y.max):null,Vt=Qe!=null&&!isNaN(Qe)?Qe:null,vt=qe!=null&&!isNaN(qe)?qe:null;return(Vt==null||Le>=Vt)&&(vt==null||Le<=vt)}const le=typeof Y=="number"&&!isNaN(Y)?Y:Number(Y);if(xe==="contains"||xe==="not_contains"){const Qe=String(Le),qe=String(Y??"").toLowerCase(),Vt=Qe.toLowerCase().includes(qe);return xe==="contains"?Vt:!Vt}if(typeof le!="number"||isNaN(le))return!1;switch(xe){case"eq":return Le===le;case"neq":return Le!==le;case"gt":return Le>le;case"gte":return Le>=le;case"lt":return Le<le;case"lte":return Le<=le;default:return!0}}if(Ye==="arraySelect"){if(!Array.isArray(P))return!1;const Le=P.filter(le=>le!=null).map(le=>V.displayKey&&typeof le=="object"?le[V.displayKey]:String(le));switch(xe){case"contains_any":return Le.some(le=>Y.includes(le));case"contains_all":return Y.every(le=>Le.includes(le));case"not_contains_any":return!Le.some(le=>Y.includes(le));default:return!0}}if(Ye==="date"){const Le=ut(Y);if(!Le||isNaN(Le.getTime()))return!1;const le=ut(P);if(!le||isNaN(le.getTime()))return!1;const Qe=X(le),qe=X(Le);switch(xe){case"eq":return Qe===qe;case"before":return Qe<qe;case"after":return Qe>qe;default:return!0}}if(Ye==="boolean"){const Le=P===!0||P==="true"||P===1,le=P===!1||P==="false"||P===0;switch(xe){case"is_true":return Le;case"is_false":return le;default:return!0}}return!0}function ut(x){if(x==null)return null;if(x instanceof Date)return isNaN(x.getTime())?null:x;if(typeof x=="number")return new Date(x>1e10?x:x*1e3);if(typeof x=="string"){const k=new Date(x);return isNaN(k.getTime())?null:k}return null}function X(x){const k=x.getFullYear(),V=String(x.getMonth()+1).padStart(2,"0"),P=String(x.getDate()).padStart(2,"0");return`${k}-${V}-${P}`}function j(x){return!!(x==null||x===""||x==="NULL"||Array.isArray(x)&&x.length===0||Array.isArray(x)&&x.every(k=>k==null))}e.watch(ot,x=>Me("update:modelValue",x),{immediate:!0}),e.watch(()=>R.data,()=>{ve.value=[],ue.value="",te.value=!1,gt()});function Q(x){return x.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,k=>k.toUpperCase())}function re(){const x=k=>{if(k==null)return k;if(k instanceof Date)return{_type:"Date",value:k.toISOString(),local:k.toLocaleDateString()};if(Array.isArray(k))return k.map(x);if(typeof k=="object"&&!Array.isArray(k)){const V={};for(const P of Object.keys(k))V[P]=x(k[P]);return V}return k};return{globalSearch:ue.value,rows:ve.value.map(k=>({key:k.key,operator:k.operator,value:x(k.value),defType:je.value[k.key]?.type,defFilterMode:je.value[k.key]?.filterMode})),filteredCount:ot.value?.length??0}}return ke({getDebugState:re}),(x,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":Te.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:S},[e.createElementVNode("div",Vm,[k[15]||(k[15]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:"Search across all fields...",value:ue.value,onInput:$t},null,40,Nm),ue.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:k[0]||(k[0]=V=>ue.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:te.value||ve.value.length>0}]),onClick:k[1]||(k[1]=V=>te.value=!te.value),type:"button",title:te.value?"Close advanced filter":"Open advanced filter"},[k[14]||(k[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),ve.value.length>0?(e.openBlock(),e.createElementBlock("span",Bm,e.toDisplayString(ve.value.length),1)):e.createCommentVNode("",!0)],10,Sm)]),te.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:k[13]||(k[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Mm,[ve.value.length===0?(e.openBlock(),e.createElementBlock("div",_m," No filter conditions are applied to this view ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(V,P)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",$m,e.toDisplayString(P===0?"Where":"And"),1),e.createElementVNode("div",Tm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Y=>ge(`${V.id}:field`),["stop"])},[e.createElementVNode("span",Hm,e.toDisplayString(tt(V.key)),1),k[16]||(k[16]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,Lm),de.value===`${V.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:k[3]||(k[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[2]||(k[2]=Y=>ae.value=Y),placeholder:"Search attributes..."},null,512),[[e.vModelText,ae.value]]),e.createElementVNode("ul",Am,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,Y=>(e.openBlock(),e.createElementBlock("li",{key:Y.key,class:"dss-filter-popup-item",onClick:xe=>fe(V,Y.key)},e.toDisplayString(Y.label),9,Dm))),128)),Re.value.length===0?(e.openBlock(),e.createElementBlock("li",Rm,"No match")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),Mt(V)==="contain"||Mt(V)==="date"?(e.openBlock(),e.createElementBlock("div",Fm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Y=>ge(`${V.id}:op`),["stop"])},[e.createElementVNode("span",zm,e.toDisplayString(Ft(V.operator)),1),k[17]||(k[17]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,Im),de.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:k[4]||(k[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",Pm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on(V),Y=>(e.openBlock(),e.createElementBlock("li",{key:Y.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===Y.value}]),onClick:xe=>ct(V,Y.value)},e.toDisplayString(Y.label),11,Om))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),xt(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Zm,[Mt(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":Y=>V.value=Y},null,8,Wm)),[[e.vModelText,V.value]]):Mt(V)==="date"?(e.openBlock(),e.createElementBlock("div",qm,[e.createVNode(zo,{mode:"single",modelValue:V.value,"onUpdate:modelValue":Y=>V.value=Y},null,8,["modelValue","onUpdate:modelValue"])])):Ke(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":Y=>V.value=Y},null,8,Um)),[[e.vModelText,V.value]]):Ke(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:"Enter value...",value:V.value,onInput:Y=>Et(V,Y),step:je.value[V.key]?.type==="int"?1:void 0},null,40,Xm)):Ke(V)==="between"?(e.openBlock(),e.createElementBlock("div",Ym,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Min",value:V.value?.min,onInput:Y=>We(V,"min",Y),step:je.value[V.key]?.type==="int"?1:void 0},null,40,jm),k[18]||(k[18]=e.createElementVNode("span",{class:"dss-filter-between-sep"},"and",-1)),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Max",value:V.value?.max,onInput:Y=>We(V,"max",Y),step:je.value[V.key]?.type==="int"?1:void 0},null,40,Km)])):Ke(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",Gm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Y=>ge(`${V.id}:val`),["stop"])},[e.createElementVNode("span",Jm,e.toDisplayString(U(V)),1),k[19]||(k[19]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,Qm),de.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:k[6]||(k[6]=e.withModifiers(()=>{},["stop"]))},[At(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[5]||(k[5]=Y=>ae.value=Y),placeholder:"Search..."},null,512)),[[e.vModelText,ae.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",e2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_t(V),Y=>(e.openBlock(),e.createElementBlock("li",{key:Y,class:"dss-filter-popup-item",onClick:xe=>ft(V,Y)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(Y),tabindex:"-1"},null,8,n2),e.createElementVNode("span",null,e.toDisplayString(Y),1)],8,t2))),128)),_t(V).length===0?(e.openBlock(),e.createElementBlock("li",l2," No match ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:Y=>_e(V.id)},[...k[20]||(k[20]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,o2)]))),128)),e.createElementVNode("div",a2,[e.createElementVNode("div",s2,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:k[7]||(k[7]=e.withModifiers(V=>ge("add"),["stop"]))}," Add filter "),de.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:k[12]||(k[12]=e.withModifiers(()=>{},["stop"]))},[Ne.value&&!Ze.value&&!ae.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[8]||(k[8]=V=>ae.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ae.value]]),e.createElementVNode("ul",r2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ht.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:P=>Ze.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),k[21]||(k[21]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,i2))),128)),Bt.value.length>0?(e.openBlock(),e.createElementBlock("li",c2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Ie(V.key)},e.toDisplayString(V.label),9,u2))),128))])],64)):Ze.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:k[9]||(k[9]=V=>Ze.value=null)},[k[22]||(k[22]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(Ze.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[10]||(k[10]=V=>ae.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ae.value]]),e.createElementVNode("ul",d2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Ie(V.key)},e.toDisplayString(V.label),9,m2))),128)),pt.value.length===0?(e.openBlock(),e.createElementBlock("li",p2,"No match")):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[11]||(k[11]=V=>ae.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ae.value]]),e.createElementVNode("ul",f2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Ie(V.key)},e.toDisplayString(V.label),9,v2))),128)),Re.value.length===0?(e.openBlock(),e.createElementBlock("li",g2,"No match ")):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ve.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:dt}," Clear all filters ")):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),C2={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 (required)"},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"}},k2={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"},b2={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"}},w2={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"}},lo={chart:C2,table:k2,datepicker:b2,textEditor:w2},x2={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 (requise)"},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"}},E2={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"},V2={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"}},N2={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"}},oo={chart:x2,table:E2,datepicker:V2,textEditor:N2},S2={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"}},B2={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"},M2={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"}},_2={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"}},ao={chart:S2,table:B2,datepicker:M2,textEditor:_2},Do={en:lo,fr:oo,nl:ao};function $2(D){if(!D||!D.global)return;const ke=D.global.availableLocales||[];Object.keys(Do).forEach(z=>{ke.includes(z)&&D.global.mergeLocaleMessage(z,Do[z])})}const Ro={en:{textEditor:lo.textEditor},fr:{textEditor:oo.textEditor},nl:{textEditor:ao.textEditor}};function T2(D){if(!D||!D.global)return;const ke=D.global.availableLocales||[];Object.keys(Ro).forEach(z=>{ke.includes(z)&&D.global.mergeLocaleMessage(z,Ro[z])})}const Fo={en:{table:lo.table},fr:{table:oo.table},nl:{table:ao.table}};function L2(D){if(!D||!D.global)return;const ke=D.global.availableLocales||[];Object.keys(Fo).forEach(z=>{ke.includes(z)&&D.global.mergeLocaleMessage(z,Fo[z])})}const Io={en:{datepicker:lo.datepicker},fr:{datepicker:oo.datepicker},nl:{datepicker:ao.datepicker}};function H2(D){if(!D||!D.global)return;const ke=D.global.availableLocales||[];Object.keys(Io).forEach(z=>{ke.includes(z)&&D.global.mergeLocaleMessage(z,Io[z])})}const A2={en:{...lo},fr:{...oo},nl:{...ao}};no.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:A2});exports.DSSChart=Ni;exports.DSSChartMessages=Do;exports.DSSColorPicker=K1;exports.DSSConfetti=Em;exports.DSSDatepicker=zo;exports.DSSDatepickerMessages=Io;exports.DSSDnd=wm;exports.DSSFilter=y2;exports.DSSLoader=cm;exports.DSSModal=Ao;exports.DSSSkeleton=um;exports.DSSTable=Zc;exports.DSSTableMessages=Fo;exports.DSSTextEditor=H1;exports.DSSTextEditorMessages=Ro;exports.addDSSChartTranslations=$2;exports.addDSSDatepickerTranslations=H2;exports.addDSSTableTranslations=L2;exports.addDSSTextEditorTranslations=T2;
|