const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('contacts', '', 'js/style-QJh_LeZW.chunk.mjs'),window.OC.filePath('contacts', '', 'js/index-CGOHHiYr.chunk.mjs'),window.OC.filePath('contacts', '', 'js/modulepreload-polyfill-DzIIs1ni.chunk.mjs'),window.OC.filePath('contacts', '', 'css/index-BjHjsnSj.chunk.css'),window.OC.filePath('contacts', '', 'css/style-BskYOXwk.chunk.css')])))=>i.map(i=>d[i]); import{g as ls,h as vm,i as Tn,j as Ds,k as Ps,f as yt,P as _m,o as ma,N as Qn,p as bm,M as _e,q as gi,D as Cm,w as km,x as Rs,I as ga,a as no,y as wm,z as Sm,A as Oi,B as lh,E as xm,F as Em,G as Mm,H as kl,J as wl,R as Mi,K as Am,L as ch,b as Sl,O as Nm,Q as Tm,T as li,U as xl,r as sn,V as Im,W as dh,X as Om,Y as Lm,Z as Dm,_ as Pm,$ as Li,a0 as Rm,a1 as Bm,a2 as uh,C as hh,v as $m,e as Ed,m as El,a3 as ph,c as Cr,a4 as Vm,u as fh,a5 as cs,a6 as ds,a7 as Bs,a8 as kr,a9 as Um,aa as wr,ab as zm,ac as Hm,ad as Sr,ae as Gm,d as Ym,s as Fm}from"./style-QJh_LeZW.chunk.mjs";import{_ as tt,r as k,e as N,o as p,c as w,B as Te,k as At,q as $t,a5 as mh,a6 as Xm,C as be,K as kn,M as gh,a7 as Wm,a as I,t as O,E as We,a4 as jm,a8 as qm,a9 as Zm,m as R,h as S,n as q,s as ht,aa as to,P as jo,Q as Ml,p as yh,w as Ve,f as A,v as Jm,ab as Al,ac as $s,ad as Km,ae as Qm,V as Nl,G as qo,af as tg,d as vh,L as _h,ag as eg,a2 as ze,F as mt,ah as zo,j as Ai,i as Dt,u as Zt,ai as Tl,S as Md,A as Gr,aj as ng,b as ie,ak as vn,N as Zo,g as ci,T as ya,al as bh,am as Il,a1 as va,an as Ni,ao as wn,ap as re,aq as sr,ar as Ol,as as og,at as Ch,au as Zn,av as ig,aw as kh,ax as rg,ay as Fn,az as wh,aA as Ad,aB as ag,aC as sg,aD as lg,aE as cg,aF as dg,aG as _a,aH as ug,aI as Ll,aJ as hg,aK as pg,l as wo,Z as Sh,aL as xh,aM as Vs,aN as fg,aO as mg}from"./modulepreload-polyfill-DzIIs1ni.chunk.mjs";import{_ as He,x as gg,A as yg,y as vg,z as _g,B as bg,d as Eh,C as Cg,D as kg,E as wg,c as oo,F as Sg,p as xg,G as Eg,H as In,q as io,R as Mg,I as Dl,J as Pl,b as Kt,n as ba,o as Rl,h as Mh,a as On,N as Pe,K as Bl,g as Ln,L as Nd,M as Ag,e as Ca,O as Ng,k as Tg,w as Ig,Q as $l,m as Vl,s as Og,S as Lg,T as Dg,U as Pg,V as Rg,W as Bg,X as $g,Y as Vg}from"./index-CGOHHiYr.chunk.mjs";const gm="contacts",ym="8.3.1",Ug={name:"ContactsRoot"};function zg(e,o,i,r,a,s){const l=k("RouterView");return p(),N(l)}const Hg=tt(Ug,[["render",zg]]),Gg={name:"NcActionSeparator"},Yg={class:"action action-separator action--disabled",role:"separator"};function Fg(e,o,i,r,a,s){return p(),w("li",Yg)}const Xg=He(Gg,[["render",Fg],["__scopeId","data-v-3e2324b7"]]),Wg={class:"app-content-details"},jg=Te({__name:"NcAppContentDetails",setup(e){return(o,i)=>(p(),w("div",Wg,[At(o.$slots,"default")]))}}),qg={name:"NcAppContentList",props:{selection:{type:Boolean,default:!1},showDetails:{type:Boolean,default:!1}}};function Zg(e,o,i,r,a,s){return p(),w("div",{class:$t(["app-content-list",{selection:i.selection,showdetails:i.showDetails}])},[At(e.$slots,"default")],2)}const Jg=He(qg,[["render",Zg]]),Kg=["id","aria-labelledby"],Qg=["id"],t0={class:"app-settings-section__description"},e0={class:"app-settings-section__content"},n0=Te({__name:"NcAppSettingsSection",props:{name:{},description:{},id:{},order:{}},setup(e){const o=e,i=mh(),{registerSection:r,unregisterSection:a}=gg(),s=Xm(yg),l=be(()=>"settings-section_"+o.id);return kn(()=>o.id,()=>{/^[a-z0-9\-_]+$/.test(o.id)||vg.warn(`Invalid id prop: ${o.id}. Only alphanumeric, dash and underscore are allowed.`)},{immediate:!0}),kn([()=>o.id,()=>o.name,()=>o.order],([c,d,u],[h,,])=>{a(h),r(c,d,u,i?.icon?.())}),gh(()=>{r(o.id,o.name,o.order,i?.icon?.())}),Wm(()=>{a(o.id)}),(c,d)=>(p(),w("section",{id:l.value,"aria-labelledby":`${l.value}--label`,class:$t(["app-settings-section",{"app-settings-section__legacy":We(s)}])},[I("h3",{id:`${l.value}--label`,class:"app-settings-section__name"},O(c.name),9,Qg),I("div",t0,O(c.description),1),I("div",e0,[At(c.$slots,"default",{},void 0,!0)])],10,Kg))}}),o0=He(n0,[["__scopeId","data-v-4095bb7f"]]),i0=["title"],r0=Te({__name:"NcCounterBubble",props:{count:{},active:{type:Boolean},type:{default:""},raw:{type:Boolean}},setup(e){const o=e,i=be(()=>o.raw?o.count.toString():new Intl.NumberFormat(jm(),{notation:"compact",compactDisplay:"short"}).format(o.count)),r=be(()=>{if(o.raw)return;const a=o.count.toString();if(a!==i.value)return a});return(a,s)=>(p(),w("div",{class:$t(["counter-bubble__counter",{active:a.active,"counter-bubble__counter--highlighted":a.type==="highlighted","counter-bubble__counter--outlined":a.type==="outlined"}]),title:r.value},O(i.value),11,i0))}}),ka=He(r0,[["__scopeId","data-v-36ffc13f"]]),a0=Te({__name:"NcFormBox",props:{row:{type:Boolean}},setup(e){const o=qm();return Zm(_g,{isInFormBox:!0,formBoxItemClass:o.ncFormBox__item}),(i,r)=>(p(),w("div",{class:$t([i.$style.ncFormBox,i.row?i.$style.ncFormBox_row:i.$style.ncFormBox_col])},[At(i.$slots,"default",{itemClass:i.$style.ncFormBox__item})],2))}}),s0="_ncFormBox_1u9di_20",l0="_ncFormBox_row_1u9di_25",c0="_ncFormBox__item_1u9di_29",d0="_ncFormBox_col_1u9di_33",u0={"material-design-icon":"_material-design-icon_1u9di_12",ncFormBox:s0,ncFormBox_row:l0,ncFormBox__item:c0,ncFormBox_col:d0},h0={$style:u0},Ah=He(a0,[["__cssModules",h0]]),p0=["id"],f0=Te({inheritAttrs:!1,__name:"NcFormBoxItem",props:{tag:{},label:{default:()=>{}},description:{default:()=>{}},invertedAccent:{type:Boolean,default:!1},class:{default:()=>{}},itemClasses:{default:()=>{}}},emits:["click"],setup(e){const o=mh(),{formBoxItemClass:i}=bg(),r=Eh(),a=()=>!!e.description||!!o.description;return(s,l)=>(p(),w("div",{class:$t([e.class,s.$style.formBoxItem,We(i),{[s.$style.formBoxItem_inverted]:s.invertedAccent&&a(),[s.$style.formBoxItem_legacy]:We(Cg)}])},[I("span",{class:$t(s.$style.formBoxItem__content)},[(p(),N(to(s.tag),ht({class:[s.$style.formBoxItem__element,s.itemClasses]},s.$attrs,{onClick:l[0]||(l[0]=c=>s.$emit("click",c))}),{default:S(()=>[At(s.$slots,"default",{descriptionId:We(r)},()=>[q(O(s.label||"⚠️ Label is missing"),1)])]),_:3},16,["class"])),a()?(p(),w("span",{key:0,id:We(r),class:$t(s.$style.formBoxItem__description)},[At(s.$slots,"description",{},()=>[q(O(s.description),1)])],10,p0)):R("",!0)],2),I("span",{class:$t(s.$style.formBoxItem__icon)},[At(s.$slots,"icon",{descriptionId:We(r)},()=>[l[1]||(l[1]=q(" ⚠️ Icon is missing ",-1))])],2)],2))}}),m0="_formBoxItem_v5un7_20",g0="_formBoxItem_legacy_v5un7_60",y0="_formBoxItem_inverted_v5un7_64",v0="_formBoxItem__element_v5un7_64",_0="_formBoxItem__description_v5un7_67",b0="_formBoxItem__content_v5un7_71",C0="_formBoxItem__icon_v5un7_89",k0={"material-design-icon":"_material-design-icon_v5un7_12",formBoxItem:m0,formBoxItem_legacy:g0,formBoxItem_inverted:y0,formBoxItem__element:v0,formBoxItem__description:_0,formBoxItem__content:b0,formBoxItem__icon:C0},w0={$style:k0},S0=He(f0,[["__cssModules",w0]]),x0=["id","aria-describedby","disabled"],E0=Te({__name:"NcFormBoxSwitch",props:jo({label:{default:()=>{}},description:{default:()=>{}},disabled:{type:Boolean,default:!1}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:jo(["enable","disable"],["update:modelValue"]),setup(e,{emit:o}){const i=Ml(e,"modelValue"),r=o,a=Eh();return kn(i,()=>{i.value?r("enable"):r("disable")},{flush:"sync"}),(s,l)=>(p(),N(S0,{tag:"label",for:We(a)},yh({icon:S(({descriptionId:c})=>[Ve(I("input",{id:We(a),"onUpdate:modelValue":l[0]||(l[0]=d=>i.value=d),class:$t(s.$style.formBoxSwitch__input),type:"checkbox",role:"switch","aria-describedby":c,disabled:s.disabled},null,10,x0),[[Jm,i.value]]),A(kg,{checked:i.value,inline:""},null,8,["checked"])]),_:2},[s.$slots.default||s.label?{name:"default",fn:S(()=>[At(s.$slots,"default",{},()=>[q(O(s.label),1)])]),key:"0"}:void 0,s.$slots.description||s.description?{name:"description",fn:S(()=>[At(s.$slots,"description",{},()=>[q(O(s.description),1)])]),key:"1"}:void 0]),1032,["for"]))}}),M0="_formBoxSwitch__input_njiy8_20",A0={"material-design-icon":"_material-design-icon_njiy8_12",formBoxSwitch__input:M0},N0={$style:A0},T0=He(E0,[["__cssModules",N0]]),I0={name:"NcListItem",components:{NcActions:oo,NcCounterBubble:ka,NcVNodes:wg},inheritAttrs:!1,props:{details:{type:String,default:""},name:{type:String,default:void 0},to:{type:[String,Object],default:null},href:{type:String,default:"#"},target:{type:String,default:""},anchorId:{type:String,default:""},bold:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},active:{type:Boolean,default:void 0},linkAriaLabel:{type:String,default:""},actionsAriaLabel:{type:String,default:void 0},counterNumber:{type:[Number,String],default:0},counterType:{type:String,default:"",validator(e){return["highlighted","outlined",""].indexOf(e)!==-1}},forceDisplayActions:{type:Boolean,default:!1},forceMenu:{type:Boolean,default:!1},oneLine:{type:Boolean,default:!1}},emits:["click","update:menuOpen"],data(){return{hovered:!1,hasActions:!1,hasSubname:!1,displayActionsOnHoverFocus:!1,menuOpen:!1,hasIndicator:!1,hasDetails:!1}},computed:{showAdditionalElements(){return!this.displayActionsOnHoverFocus||this.forceDisplayActions},showDetails(){return(this.details!==""||this.hasDetails)&&(!this.displayActionsOnHoverFocus||this.forceDisplayActions)}},watch:{menuOpen(e){!e&&!this.hovered&&(this.displayActionsOnHoverFocus=!1)}},mounted(){this.checkSlots()},updated(){this.checkSlots()},methods:{onClick(e,o,i){this.$emit("click",e),!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&i&&(o?.(e),e.preventDefault())},showActions(){this.hasActions&&(this.displayActionsOnHoverFocus=!0),this.hovered=!1},hideActions(){this.displayActionsOnHoverFocus=!1},handleBlur(e){this.menuOpen||this.$refs["list-item"]?.contains(e.relatedTarget)||this.hideActions()},handleMouseleave(){this.menuOpen||(this.displayActionsOnHoverFocus=!1),this.hovered=!1},handleMouseover(){this.showActions(),this.hovered=!0},handleActionsUpdateOpen(e){this.menuOpen=e,this.$emit("update:menuOpen",e)},checkSlots(){this.hasActions!==!!this.$slots.actions&&(this.hasActions=!!this.$slots.actions),this.hasSubname!==!!this.$slots.subname&&(this.hasSubname=!!this.$slots.subname),this.hasIndicator!==!!this.$slots.indicator&&(this.hasIndicator=!!this.$slots.indicator),this.hasDetails!==!!this.$slots.details&&(this.hasDetails=!!this.$slots.details)}}},O0=["id","aria-label","href","target","rel","onClick"],L0={class:"list-item-content"},D0={class:"list-item-content__main"},P0={class:"list-item-content__name"},R0={class:"list-item-content__details"},B0={key:0,class:"list-item-details__details"},$0={key:1,class:"list-item-details__extra"},V0={key:1,class:"list-item-details__indicator"},U0={key:0,class:"list-item-content__extra-actions"},z0={key:2,class:"list-item__extra"};function H0(e,o,i,r,a,s){const l=k("NcCounterBubble"),c=k("NcActions");return p(),N(to(i.to?"router-link":"NcVNodes"),Km(Qm({...i.to&&{custom:!0,to:i.to}})),{default:S(({href:d,navigate:u,isActive:h})=>[I("li",ht({class:["list-item__wrapper",{"list-item__wrapper--active":i.active??h}]},e.$attrs),[I("div",{ref:"list-item",class:$t(["list-item",{"list-item--compact":i.compact,"list-item--one-line":i.oneLine}]),onMouseover:o[4]||(o[4]=(...f)=>s.handleMouseover&&s.handleMouseover(...f)),onMouseleave:o[5]||(o[5]=(...f)=>s.handleMouseleave&&s.handleMouseleave(...f))},[I("a",{id:i.anchorId||void 0,"aria-label":i.linkAriaLabel,class:"list-item__anchor",href:d||i.href,target:i.target||(i.href==="#"?void 0:"_blank"),rel:i.href==="#"?void 0:"noopener noreferrer",onFocus:o[0]||(o[0]=(...f)=>s.showActions&&s.showActions(...f)),onFocusout:o[1]||(o[1]=(...f)=>s.handleBlur&&s.handleBlur(...f)),onClick:f=>s.onClick(f,u,d),onKeydown:o[2]||(o[2]=Al((...f)=>s.hideActions&&s.hideActions(...f),["esc"]))},[At(e.$slots,"icon",{},void 0,!0),I("div",L0,[I("div",D0,[I("div",P0,[At(e.$slots,"name",{},()=>[q(O(i.name),1)],!0)]),a.hasSubname?(p(),w("div",{key:0,class:$t(["list-item-content__subname",{"list-item-content__subname--bold":i.bold}])},[At(e.$slots,"subname",{},void 0,!0)],2)):R("",!0)]),I("div",R0,[s.showDetails?(p(),w("div",B0,[At(e.$slots,"details",{},()=>[q(O(i.details),1)],!0)])):R("",!0),i.counterNumber!==0||a.hasIndicator?Ve((p(),w("div",$0,[i.counterNumber!==0?(p(),N(l,{key:0,count:i.counterNumber,active:i.active??h,class:"list-item-details__counter",type:i.counterType},null,8,["count","active","type"])):R("",!0),a.hasIndicator?(p(),w("span",V0,[At(e.$slots,"indicator",{},void 0,!0)])):R("",!0)],512)),[[$s,s.showAdditionalElements]]):R("",!0)])])],40,O0),e.$slots["extra-actions"]?(p(),w("div",U0,[At(e.$slots,"extra-actions",{},void 0,!0)])):R("",!0),i.forceDisplayActions||a.displayActionsOnHoverFocus?(p(),w("div",{key:1,class:"list-item-content__actions",onFocusout:o[3]||(o[3]=(...f)=>s.handleBlur&&s.handleBlur(...f))},[A(c,{ref:"actions",primary:i.active??h,"force-menu":i.forceMenu,"aria-label":i.actionsAriaLabel,"onUpdate:open":s.handleActionsUpdateOpen},yh({default:S(()=>[At(e.$slots,"actions",{},void 0,!0)]),_:2},[e.$slots["actions-icon"]?{name:"icon",fn:S(()=>[At(e.$slots,"actions-icon",{},void 0,!0)]),key:"0"}:void 0]),1032,["primary","force-menu","aria-label","onUpdate:open"])],32)):R("",!0),e.$slots.extra?(p(),w("div",z0,[At(e.$slots,"extra",{},void 0,!0)])):R("",!0)],34)],16)]),_:3},16)}const Nh=He(I0,[["render",H0],["__scopeId","data-v-532f3807"]]),G0=8,Td=32,Y0={name:"NcListItemIcon",components:{NcAvatar:In,NcHighlight:Eg,NcIconSvgWrapper:xg},mixins:[Sg],props:{name:{type:String,required:!0},subname:{type:String,default:""},icon:{type:String,default:""},iconSvg:{type:String,default:""},iconName:{type:String,default:""},search:{type:String,default:""},avatarSize:{type:Number,default:Td},noMargin:{type:Boolean,default:!1},displayName:{type:String,default:null},isNoUser:{type:Boolean,default:!1},id:{type:String,default:null}},setup(){return{margin:G0,defaultSize:Td}},computed:{hasIcon(){return this.icon!==""},hasIconSvg(){return this.iconSvg!==""},isValidSubname(){return this.subname?.trim?.()!==""},isSizeBigEnough(){return this.avatarSize>=26},cssVars(){const e=this.noMargin?0:this.margin;return{"--height":this.avatarSize+2*e+"px","--margin":this.margin+"px"}},searchParts(){const e=/^([^<]*)<([^>]+)>?$/,o=this.search.match(e);return this.isNoUser||!o?[this.search,this.search]:[o[1].trim(),o[2]]}},beforeMount(){!this.isNoUser&&!this.subname&&this.fetchUserStatus(this.user)}},F0=["id"],X0={class:"option__details"},W0={key:1},j0=["aria-label"];function q0(e,o,i,r,a,s){const l=k("NcAvatar"),c=k("NcHighlight"),d=k("NcIconSvgWrapper");return p(),w("span",{id:i.id,class:$t(["option",{"option--compact":i.avatarSize[s.hasIconSvg?(p(),N(d,{key:0,class:"option__icon",svg:i.iconSvg,name:i.iconName},null,8,["svg","name"])):s.hasIcon?(p(),w("span",{key:1,class:$t(["icon option__icon",i.icon]),"aria-label":i.iconName},null,10,j0)):R("",!0)],!0)],14,F0)}const Id=He(Y0,[["render",q0],["__scopeId","data-v-60a83836"]]),Z0=Te({__name:"NcSelectUsers",props:jo({ariaLabelClearSelected:{},ariaLabelListbox:{},ariaLabelDeselectOption:{type:Function},disabled:{type:Boolean},inputId:{},inputLabel:{},labelOutside:{type:Boolean},keepOpen:{type:Boolean},loading:{type:Boolean},multiple:{type:Boolean},noWrap:{type:Boolean},options:{},placeholder:{},required:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:jo(["search"],["update:modelValue"]),setup(e,{emit:o}){const i=Ml(e,"modelValue"),r=o,a=qo("");kn(a,()=>r("search",a.value));const s=Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--default-clickable-area")),l=Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--default-grid-baseline")),c=s-2*l;function d(u,h,f){const v=/[^<]*<([^>]+)/,_=f.match(v),b=u.subname?.toLocaleLowerCase()??"";return _&&b.indexOf(_[1].toLocaleLowerCase())>-1||`${h} ${u.subname}`.toLocaleLowerCase().indexOf(f.toLocaleLowerCase())>-1}return(u,h)=>(p(),N(We(io),ht({modelValue:i.value,"onUpdate:modelValue":h[0]||(h[0]=f=>i.value=f),class:"nc-select-users"},u.$props,{"filter-by":d,label:"displayName",onSearch:h[1]||(h[1]=f=>a.value=f)}),{option:S(f=>[A(We(Id),ht(f,{"avatar-size":32,name:f.displayName,search:a.value}),null,16,["name","search"])]),"selected-option":S(f=>[A(We(Id),ht(f,{"avatar-size":c,name:f.displayName,"no-margin":"",search:a.value}),null,16,["name","search"])]),_:1},16,["modelValue"]))}}),J0=He(Z0,[["__scopeId","data-v-4fbb6472"]]),K0={};function Q0(e,o){return p(),w("div",null,[At(e.$slots,"trigger")])}const ty=He(K0,[["render",Q0]]),ey={class:"user-bubble__name"},ny={key:0,class:"user-bubble__secondary"},oy=Te({__name:"NcUserBubble",props:jo({avatarImage:{default:void 0},user:{default:void 0},displayName:{default:void 0},showUserStatus:{type:Boolean},url:{default:void 0},to:{default:void 0},primary:{type:Boolean},size:{default:20},margin:{default:2}},{open:{type:Boolean},openModifiers:{}}),emits:jo(["click"],["update:open"]),setup(e,{emit:o}){const i=Ml(e,"open"),r=e,a=o,s=be(()=>{if(!r.avatarImage)return!1;try{return!!new URL(r.avatarImage)}catch{return!1}}),l=be(()=>!!r.avatarImage),c=be(()=>({marginInlineStart:`${r.margin}px`})),d=be(()=>{if(!r.url||r.url.trim()==="")return!1;try{return!!new URL(r.url,r.url?.startsWith?.("/")?window.location.href:void 0)}catch{return tg("[NcUserBubble] Invalid URL passed",{url:r.url}),!1}}),u=be(()=>d.value?r.url:void 0),h=be(()=>d.value?"a":r.to?Mg:"div"),f=be(()=>({height:`${r.size}px`,lineHeight:`${r.size}px`,borderRadius:`${r.size/2}px`}));return kn([()=>r.displayName,()=>r.user],()=>{!r.displayName&&r.user}),(v,_)=>(p(),N(to(v.$slots.default?Dl:ty),{shown:i.value,"onUpdate:shown":_[1]||(_[1]=b=>i.value=b),class:"user-bubble__wrapper",trigger:"hover focus"},{trigger:S(({attrs:b})=>[(p(),N(to(h.value),ht({class:["user-bubble__content",{"user-bubble__content--primary":v.primary}],style:f.value,to:v.to,href:u.value},b,{onClick:_[0]||(_[0]=C=>a("click",C))}),{default:S(()=>[A(In,{url:l.value&&s.value?v.avatarImage:void 0,"icon-class":l.value&&!s.value?v.avatarImage:void 0,user:v.user,"display-name":v.displayName,size:v.size-v.margin*2,style:Nl(c.value),"disable-tooltip":!0,"disable-menu":!0,"hide-status":!v.showUserStatus,class:"user-bubble__avatar"},null,8,["url","icon-class","user","display-name","size","style","hide-status"]),I("span",ey,O(v.displayName||v.user),1),v.$slots.name?(p(),w("span",ny,[At(v.$slots,"name",{},void 0,!0)])):R("",!0)]),_:2},1040,["class","style","to","href"]))]),default:S(()=>[At(v.$slots,"default",{},void 0,!0)]),_:3},40,["shown"]))}}),Ul=He(oy,[["__scopeId","data-v-ad356e41"]]);function iy(e,o){var i=0,r=0;return Float64Array.from(e,o===void 0?a=>i+=+a||0:a=>i+=+o(a,r++,e)||0)}function ry(e,o){let i;if(o===void 0)for(const r of e)r!=null&&(i=r)&&(i=r);else{let r=-1;for(let a of e)(a=o(a,++r,e))!=null&&(i=a)&&(i=a)}return i}function ay(e,o){let i;if(o===void 0)for(const r of e)r!=null&&(i>r||i===void 0&&r>=r)&&(i=r);else{let r=-1;for(let a of e)(a=o(a,++r,e))!=null&&(i>a||i===void 0&&a>=a)&&(i=a)}return i}function sy(e,o){let i=0;if(o===void 0)for(let r of e)(r=+r)&&(i+=r);else{let r=-1;for(let a of e)(a=+o(a,++r,e))&&(i+=a)}return i}var ly={value:()=>{}};function zl(){for(var e=0,o=arguments.length,i={},r;e=0&&(r=i.slice(a+1),i=i.slice(0,a)),i&&!o.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:r}})}xr.prototype=zl.prototype={constructor:xr,on:function(e,o){var i=this._,r=cy(e+"",i),a,s=-1,l=r.length;if(arguments.length<2){for(;++s0)for(var i=new Array(a),r=0,a,s;r=0&&(o=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),Ld.hasOwnProperty(o)?{space:Ld[o],local:e}:e}function uy(e){return function(){var o=this.ownerDocument,i=this.namespaceURI;return i===Us&&o.documentElement.namespaceURI===Us?o.createElement(e):o.createElementNS(i,e)}}function hy(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Th(e){var o=wa(e);return(o.local?hy:uy)(o)}function py(){}function Hl(e){return e==null?py:function(){return this.querySelector(e)}}function fy(e){typeof e!="function"&&(e=Hl(e));for(var o=this._groups,i=o.length,r=new Array(i),a=0;a=X&&(X=B+1);!(Z=D[X])&&++X=0;)(l=r[a])&&(s&&l.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(l,s),s=l);return this}function Vy(e){e||(e=Uy);function o(f,v){return f&&v?e(f.__data__,v.__data__):!f-!v}for(var i=this._groups,r=i.length,a=new Array(r),s=0;so?1:e>=o?0:NaN}function zy(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Hy(){return Array.from(this)}function Gy(){for(var e=this._groups,o=0,i=e.length;o1?this.each((o==null?t2:typeof o=="function"?n2:e2)(e,o,i??"")):Jo(this.node(),e)}function Jo(e,o){return e.style.getPropertyValue(o)||Ph(e).getComputedStyle(e,null).getPropertyValue(o)}function i2(e){return function(){delete this[e]}}function r2(e,o){return function(){this[e]=o}}function a2(e,o){return function(){var i=o.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function s2(e,o){return arguments.length>1?this.each((o==null?i2:typeof o=="function"?a2:r2)(e,o)):this.node()[e]}function Rh(e){return e.trim().split(/^|\s+/)}function Gl(e){return e.classList||new Bh(e)}function Bh(e){this._node=e,this._names=Rh(e.getAttribute("class")||"")}Bh.prototype={add:function(e){var o=this._names.indexOf(e);o<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var o=this._names.indexOf(e);o>=0&&(this._names.splice(o,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function $h(e,o){for(var i=Gl(e),r=-1,a=o.length;++r=0&&(i=o.slice(r+1),o=o.slice(0,r)),{type:o,name:i}})}function P2(e){return function(){var o=this.__on;if(o){for(var i=0,r=-1,a=o.length,s;i>8&15|o>>4&240,o>>4&15|o&240,(o&15)<<4|o&15,1):i===8?lr(o>>24&255,o>>16&255,o>>8&255,(o&255)/255):i===4?lr(o>>12&15|o>>8&240,o>>8&15|o>>4&240,o>>4&15|o&240,((o&15)<<4|o&15)/255):null):(o=W2.exec(e))?new Ae(o[1],o[2],o[3],1):(o=j2.exec(e))?new Ae(o[1]*255/100,o[2]*255/100,o[3]*255/100,1):(o=q2.exec(e))?lr(o[1],o[2],o[3],o[4]):(o=Z2.exec(e))?lr(o[1]*255/100,o[2]*255/100,o[3]*255/100,o[4]):(o=J2.exec(e))?Ud(o[1],o[2]/100,o[3]/100,1):(o=K2.exec(e))?Ud(o[1],o[2]/100,o[3]/100,o[4]):Dd.hasOwnProperty(e)?Bd(Dd[e]):e==="transparent"?new Ae(NaN,NaN,NaN,0):null}function Bd(e){return new Ae(e>>16&255,e>>8&255,e&255,1)}function lr(e,o,i,r){return r<=0&&(e=o=i=NaN),new Ae(e,o,i,r)}function ev(e){return e instanceof Zi||(e=Ri(e)),e?(e=e.rgb(),new Ae(e.r,e.g,e.b,e.opacity)):new Ae}function Gs(e,o,i,r){return arguments.length===1?ev(e):new Ae(e,o,i,r??1)}function Ae(e,o,i,r){this.r=+e,this.g=+o,this.b=+i,this.opacity=+r}Yl(Ae,Gs,Hh(Zi,{brighter(e){return e=e==null?Fr:Math.pow(Fr,e),new Ae(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Di:Math.pow(Di,e),new Ae(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ae(bo(this.r),bo(this.g),bo(this.b),Xr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$d,formatHex:$d,formatHex8:nv,formatRgb:Vd,toString:Vd}));function $d(){return`#${go(this.r)}${go(this.g)}${go(this.b)}`}function nv(){return`#${go(this.r)}${go(this.g)}${go(this.b)}${go((isNaN(this.opacity)?1:this.opacity)*255)}`}function Vd(){const e=Xr(this.opacity);return`${e===1?"rgb(":"rgba("}${bo(this.r)}, ${bo(this.g)}, ${bo(this.b)}${e===1?")":`, ${e})`}`}function Xr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function bo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function go(e){return e=bo(e),(e<16?"0":"")+e.toString(16)}function Ud(e,o,i,r){return r<=0?e=o=i=NaN:i<=0||i>=1?e=o=NaN:o<=0&&(e=NaN),new je(e,o,i,r)}function Gh(e){if(e instanceof je)return new je(e.h,e.s,e.l,e.opacity);if(e instanceof Zi||(e=Ri(e)),!e)return new je;if(e instanceof je)return e;e=e.rgb();var o=e.r/255,i=e.g/255,r=e.b/255,a=Math.min(o,i,r),s=Math.max(o,i,r),l=NaN,c=s-a,d=(s+a)/2;return c?(o===s?l=(i-r)/c+(i0&&d<1?0:l,new je(l,c,d,e.opacity)}function ov(e,o,i,r){return arguments.length===1?Gh(e):new je(e,o,i,r??1)}function je(e,o,i,r){this.h=+e,this.s=+o,this.l=+i,this.opacity=+r}Yl(je,ov,Hh(Zi,{brighter(e){return e=e==null?Fr:Math.pow(Fr,e),new je(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Di:Math.pow(Di,e),new je(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,o=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,r=i+(i<.5?i:1-i)*o,a=2*i-r;return new Ae(us(e>=240?e-240:e+120,a,r),us(e,a,r),us(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new je(zd(this.h),cr(this.s),cr(this.l),Xr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Xr(this.opacity);return`${e===1?"hsl(":"hsla("}${zd(this.h)}, ${cr(this.s)*100}%, ${cr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function zd(e){return e=(e||0)%360,e<0?e+360:e}function cr(e){return Math.max(0,Math.min(1,e||0))}function us(e,o,i){return(e<60?o+(i-o)*e/60:e<180?i:e<240?o+(i-o)*(240-e)/60:o)*255}const Yh=e=>()=>e;function iv(e,o){return function(i){return e+i*o}}function rv(e,o,i){return e=Math.pow(e,i),o=Math.pow(o,i)-e,i=1/i,function(r){return Math.pow(e+r*o,i)}}function av(e){return(e=+e)==1?Fh:function(o,i){return i-o?rv(o,i,e):Yh(isNaN(o)?i:o)}}function Fh(e,o){var i=o-e;return i?iv(e,i):Yh(isNaN(e)?o:e)}const Hd=(function e(o){var i=av(o);function r(a,s){var l=i((a=Gs(a)).r,(s=Gs(s)).r),c=i(a.g,s.g),d=i(a.b,s.b),u=Fh(a.opacity,s.opacity);return function(h){return a.r=l(h),a.g=c(h),a.b=d(h),a.opacity=u(h),a+""}}return r.gamma=e,r})(1);function Gn(e,o){return e=+e,o=+o,function(i){return e*(1-i)+o*i}}var Ys=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hs=new RegExp(Ys.source,"g");function sv(e){return function(){return e}}function lv(e){return function(o){return e(o)+""}}function cv(e,o){var i=Ys.lastIndex=hs.lastIndex=0,r,a,s,l=-1,c=[],d=[];for(e=e+"",o=o+"";(r=Ys.exec(e))&&(a=hs.exec(o));)(s=a.index)>i&&(s=o.slice(i,s),c[l]?c[l]+=s:c[++l]=s),(r=r[0])===(a=a[0])?c[l]?c[l]+=a:c[++l]=a:(c[++l]=null,d.push({i:l,x:Gn(r,a)})),i=hs.lastIndex;return i180?h+=360:h-u>180&&(u+=360),v.push({i:f.push(a(f)+"rotate(",null,r)-2,x:Gn(u,h)})):h&&f.push(a(f)+"rotate("+h+r)}function c(u,h,f,v){u!==h?v.push({i:f.push(a(f)+"skewX(",null,r)-2,x:Gn(u,h)}):h&&f.push(a(f)+"skewX("+h+r)}function d(u,h,f,v,_,b){if(u!==f||h!==v){var C=_.push(a(_)+"scale(",null,",",null,")");b.push({i:C-4,x:Gn(u,f)},{i:C-2,x:Gn(h,v)})}else(f!==1||v!==1)&&_.push(a(_)+"scale("+f+","+v+")")}return function(u,h){var f=[],v=[];return u=e(u),h=e(h),s(u.translateX,u.translateY,h.translateX,h.translateY,f,v),l(u.rotate,h.rotate,f,v),c(u.skewX,h.skewX,f,v),d(u.scaleX,u.scaleY,h.scaleX,h.scaleY,f,v),u=h=null,function(_){for(var b=-1,C=v.length,D;++b=0&&e._call.call(void 0,o),e=e._next;--Qo}function Fd(){So=(jr=Bi.now())+Sa,Qo=Si=0;try{_v()}finally{Qo=0,Cv(),So=0}}function bv(){var e=Bi.now(),o=e-jr;o>qh&&(Sa-=o,jr=e)}function Cv(){for(var e,o=Wr,i,r=1/0;o;)o._call?(r>o._time&&(r=o._time),e=o,o=o._next):(i=o._next,o._next=null,o=e?e._next=i:Wr=i);xi=e,Fs(r)}function Fs(e){if(!Qo){Si&&(Si=clearTimeout(Si));var o=e-So;o>24?(e<1/0&&(Si=setTimeout(Fd,e-Bi.now()-Sa)),yi&&(yi=clearInterval(yi))):(yi||(jr=Bi.now(),yi=setInterval(bv,qh)),Qo=1,Zh(Fd))}}function Xd(e,o,i){var r=new qr;return o=o==null?0:+o,r.restart(a=>{r.stop(),e(a+o)},o,i),r}var kv=zl("start","end","cancel","interrupt"),wv=[],Kh=0,Wd=1,Xs=2,Er=3,jd=4,Ws=5,Mr=6;function xa(e,o,i,r,a,s){var l=e.__transition;if(!l)e.__transition={};else if(i in l)return;Sv(e,i,{name:o,index:r,group:a,on:kv,tween:wv,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Kh})}function Xl(e,o){var i=tn(e,o);if(i.state>Kh)throw new Error("too late; already scheduled");return i}function cn(e,o){var i=tn(e,o);if(i.state>Er)throw new Error("too late; already running");return i}function tn(e,o){var i=e.__transition;if(!i||!(i=i[o]))throw new Error("transition not found");return i}function Sv(e,o,i){var r=e.__transition,a;r[o]=i,i.timer=Jh(s,0,i.time);function s(u){i.state=Wd,i.timer.restart(l,i.delay,i.time),i.delay<=u&&l(u-i.delay)}function l(u){var h,f,v,_;if(i.state!==Wd)return d();for(h in r)if(_=r[h],_.name===i.name){if(_.state===Er)return Xd(l);_.state===jd?(_.state=Mr,_.timer.stop(),_.on.call("interrupt",e,e.__data__,_.index,_.group),delete r[h]):+hXs&&r.state=0&&(o=o.slice(0,i)),!o||o==="start"})}function t_(e,o,i){var r,a,s=Qv(o)?Xl:cn;return function(){var l=s(this,e),c=l.on;c!==r&&(a=(r=c).copy()).on(o,i),l.on=a}}function e_(e,o){var i=this._id;return arguments.length<2?tn(this.node(),i).on.on(e):this.each(t_(i,e,o))}function n_(e){return function(){var o=this.parentNode;for(var i in this.__transition)if(+i!==e)return;o&&o.removeChild(this)}}function o_(){return this.on("end.remove",n_(this._id))}function i_(e){var o=this._name,i=this._id;typeof e!="function"&&(e=Hl(e));for(var r=this._groups,a=r.length,s=new Array(a),l=0;lfo)if(!(Math.abs(h*c-d*u)>fo)||!a)this._+="L"+(this._x1=e)+","+(this._y1=o);else{var v=i-s,_=r-l,b=c*c+d*d,C=v*v+_*_,D=Math.sqrt(b),L=Math.sqrt(f),B=a*Math.tan((js-Math.acos((b+f-C)/(2*D*L)))/2),X=B/L,nt=B/D;Math.abs(X-1)>fo&&(this._+="L"+(e+X*u)+","+(o+X*h)),this._+="A"+a+","+a+",0,0,"+ +(h*v>u*_)+","+(this._x1=e+nt*c)+","+(this._y1=o+nt*d)}},arc:function(e,o,i,r,a,s){e=+e,o=+o,i=+i,s=!!s;var l=i*Math.cos(r),c=i*Math.sin(r),d=e+l,u=o+c,h=1^s,f=s?r-a:a-r;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+d+","+u:(Math.abs(this._x1-d)>fo||Math.abs(this._y1-u)>fo)&&(this._+="L"+d+","+u),i&&(f<0&&(f=f%qs+qs),f>N_?this._+="A"+i+","+i+",0,1,"+h+","+(e-l)+","+(o-c)+"A"+i+","+i+",0,1,"+h+","+(this._x1=d)+","+(this._y1=u):f>fo&&(this._+="A"+i+","+i+",0,"+ +(f>=js)+","+h+","+(this._x1=e+i*Math.cos(a))+","+(this._y1=o+i*Math.sin(a))))},rect:function(e,o,i,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+o)+"h"+ +i+"v"+ +r+"h"+-i+"Z"},toString:function(){return this._}};function T_(e){var o=0,i=e.children,r=i&&i.length;if(!r)o=1;else for(;--r>=0;)o+=i[r].value;e.value=o}function I_(){return this.eachAfter(T_)}function O_(e,o){let i=-1;for(const r of this)e.call(o,r,++i,this);return this}function L_(e,o){for(var i=this,r=[i],a,s,l=-1;i=r.pop();)if(e.call(o,i,++l,this),a=i.children)for(s=a.length-1;s>=0;--s)r.push(a[s]);return this}function D_(e,o){for(var i=this,r=[i],a=[],s,l,c,d=-1;i=r.pop();)if(a.push(i),s=i.children)for(l=0,c=s.length;l=0;)i+=r[a].value;o.value=i})}function B_(e){return this.eachBefore(function(o){o.children&&o.children.sort(e)})}function $_(e){for(var o=this,i=V_(o,e),r=[o];o!==i;)o=o.parent,r.push(o);for(var a=r.length;e!==i;)r.splice(a,0,e),e=e.parent;return r}function V_(e,o){if(e===o)return e;var i=e.ancestors(),r=o.ancestors(),a=null;for(e=i.pop(),o=r.pop();e===o;)a=e,e=i.pop(),o=r.pop();return a}function U_(){for(var e=this,o=[e];e=e.parent;)o.push(e);return o}function z_(){return Array.from(this)}function H_(){var e=[];return this.eachBefore(function(o){o.children||e.push(o)}),e}function G_(){var e=this,o=[];return e.each(function(i){i!==e&&o.push({source:i.parent,target:i})}),o}function*Y_(){var e=this,o,i=[e],r,a,s;do for(o=i.reverse(),i=[];e=o.pop();)if(yield e,r=e.children)for(a=0,s=r.length;a=0;--c)a.push(s=l[c]=new ti(l[c])),s.parent=r,s.depth=r.depth+1;return i.eachBefore(ip)}function F_(){return op(this).eachBefore(j_)}function X_(e){return e.children}function W_(e){return Array.isArray(e)?e[1]:null}function j_(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function ip(e){var o=0;do e.height=o;while((e=e.parent)&&e.height<++o)}function ti(e){this.data=e,this.depth=this.height=0,this.parent=null}ti.prototype=op.prototype={constructor:ti,count:I_,each:O_,eachAfter:D_,eachBefore:L_,find:P_,sum:R_,sort:B_,path:$_,ancestors:U_,descendants:z_,leaves:H_,links:G_,copy:F_,[Symbol.iterator]:Y_};function ps(e){return e==null?null:q_(e)}function q_(e){if(typeof e!="function")throw new Error;return e}var Z_={depth:-1},qd={},fs={};function J_(e){return e.id}function K_(e){return e.parentId}function Q_(){var e=J_,o=K_,i;function r(a){var s=Array.from(a),l=e,c=o,d,u,h,f,v,_,b,C,D=new Map;if(i!=null){const L=s.map((nt,Z)=>tb(i(nt,Z,a))),B=L.map(Zd),X=new Set(L).add("");for(const nt of B)X.has(nt)||(X.add(nt),L.push(nt),B.push(Zd(nt)),s.push(fs));l=(nt,Z)=>L[Z],c=(nt,Z)=>B[Z]}for(h=0,d=s.length;h=0&&(_=s[L],_.data===fs);--L)_.data=null}if(f.parent=Z_,f.eachBefore(function(L){L.depth=L.parent.depth+1,--d}).eachBefore(ip),f.parent=null,d>0)throw new Error("cycle");return f}return r.id=function(a){return arguments.length?(e=ps(a),r):e},r.parentId=function(a){return arguments.length?(o=ps(a),r):o},r.path=function(a){return arguments.length?(i=ps(a),r):i},r}function tb(e){e=`${e}`;let o=e.length;return Js(e,o-1)&&!Js(e,o-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function Zd(e){let o=e.length;if(o<2)return"";for(;--o>1&&!Js(e,o););return e.slice(0,o)}function Js(e,o){if(e[o]==="/"){let i=0;for(;o>0&&e[--o]==="\\";)++i;if((i&1)===0)return!0}return!1}function eb(e,o){return e.parent===o.parent?1:2}function ms(e){var o=e.children;return o?o[0]:e.t}function gs(e){var o=e.children;return o?o[o.length-1]:e.t}function nb(e,o,i){var r=i/(o.i-e.i);o.c-=r,o.s+=i,e.c+=r,o.z+=i,o.m+=i}function ob(e){for(var o=0,i=0,r=e.children,a=r.length,s;--a>=0;)s=r[a],s.z+=o,s.m+=o,o+=s.s+(i+=s.c)}function ib(e,o,i){return e.a.parent===o.parent?e.a:i}function Nr(e,o){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=o}Nr.prototype=Object.create(ti.prototype);function rb(e){for(var o=new Nr(e,0),i,r=[o],a,s,l,c;i=r.pop();)if(s=i._.children)for(i.children=new Array(c=s.length),l=c-1;l>=0;--l)r.push(a=i.children[l]=new Nr(s[l],l)),a.parent=i;return(o.parent=new Nr(null,0)).children=[o],o}function ab(){var e=eb,o=1,i=1,r=null;function a(u){var h=rb(u);if(h.eachAfter(s),h.parent.m=-h.z,h.eachBefore(l),r)u.eachBefore(d);else{var f=u,v=u,_=u;u.eachBefore(function(B){B.xv.x&&(v=B),B.depth>_.depth&&(_=B)});var b=f===v?1:e(f,v)/2,C=b-f.x,D=o/(v.x+b+C),L=i/(_.depth||1);u.eachBefore(function(B){B.x=(B.x+C)*D,B.y=B.depth*L})}return u}function s(u){var h=u.children,f=u.parent.children,v=u.i?f[u.i-1]:null;if(h){ob(u);var _=(h[0].z+h[h.length-1].z)/2;v?(u.z=v.z+e(u._,v._),u.m=u.z-_):u.z=_}else v&&(u.z=v.z+e(u._,v._));u.parent.A=c(u,v,u.parent.A||f[0])}function l(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function c(u,h,f){if(h){for(var v=u,_=u,b=h,C=v.parent.children[0],D=v.m,L=_.m,B=b.m,X=C.m,nt;b=gs(b),v=ms(v),b&&v;)C=ms(C),_=gs(_),_.a=u,nt=b.z+B-v.z-D+e(b._,v._),nt>0&&(nb(ib(b,u,f),u,nt),D+=nt,L+=nt),B+=b.m,D+=v.m,X+=C.m,L+=_.m;b&&!gs(_)&&(_.t=b,_.m+=B-L),v&&!ms(C)&&(C.t=v,C.m+=D-X,f=u)}return f}function d(u){u.x*=o,u.y=u.depth*i}return a.separation=function(u){return arguments.length?(e=u,a):e},a.size=function(u){return arguments.length?(r=!1,o=+u[0],i=+u[1],a):r?null:[o,i]},a.nodeSize=function(u){return arguments.length?(r=!0,o=+u[0],i=+u[1],a):r?[o,i]:null},a}function Jd(e){return function(){return e}}var sb=Array.prototype.slice;function lb(e){return e[0]}function cb(e){return e[1]}class db{constructor(o,i){this._context=o,this._x=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(o,i){switch(o=+o,i=+i,this._point){case 0:{this._point=1,this._line?this._context.lineTo(o,i):this._context.moveTo(o,i);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+o)/2,this._y0,this._x0,i,o,i):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+i)/2,o,this._y0,o,i);break}}this._x0=o,this._y0=i}}function ub(e){return new db(e,!0)}function hb(e){return e.source}function pb(e){return e.target}function fb(e){let o=hb,i=pb,r=lb,a=cb,s=null,l=null;function c(){let d;const u=sb.call(arguments),h=o.apply(this,u),f=i.apply(this,u);if(s==null&&(l=e(d=np())),l.lineStart(),u[0]=h,l.point(+r.apply(this,u),+a.apply(this,u)),u[0]=f,l.point(+r.apply(this,u),+a.apply(this,u)),l.lineEnd(),d)return l=null,d+""||null}return c.source=function(d){return arguments.length?(o=d,c):o},c.target=function(d){return arguments.length?(i=d,c):i},c.x=function(d){return arguments.length?(r=typeof d=="function"?d:Jd(+d),c):r},c.y=function(d){return arguments.length?(a=typeof d=="function"?d:Jd(+d),c):a},c.context=function(d){return arguments.length?(d==null?s=l=null:l=e(s=d),c):s},c}function mb(){return fb(ub)}const ur=e=>()=>e;function gb(e,{sourceEvent:o,target:i,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:o,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function _n(e,o,i){this.k=e,this.x=o,this.y=i}_n.prototype={constructor:_n,scale:function(e){return e===1?this:new _n(this.k*e,this.x,this.y)},translate:function(e,o){return e===0&o===0?this:new _n(this.k,this.x+this.k*e,this.y+this.k*o)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var jl=new _n(1,0,0);_n.prototype;function ys(e){e.stopImmediatePropagation()}function vi(e){e.preventDefault(),e.stopImmediatePropagation()}function yb(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function vb(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Kd(){return this.__zoom||jl}function _b(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function bb(){return navigator.maxTouchPoints||"ontouchstart"in this}function Cb(e,o,i){var r=e.invertX(o[0][0])-i[0][0],a=e.invertX(o[1][0])-i[1][0],s=e.invertY(o[0][1])-i[0][1],l=e.invertY(o[1][1])-i[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),l>s?(s+l)/2:Math.min(0,s)||Math.max(0,l))}function kb(){var e=yb,o=vb,i=Cb,r=_b,a=bb,s=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,d=yv,u=zl("start","zoom","end"),h,f,v,_=500,b=150,C=0,D=10;function L(M){M.property("__zoom",Kd).on("wheel.zoom",J,{passive:!1}).on("mousedown.zoom",ot).on("dblclick.zoom",lt).filter(a).on("touchstart.zoom",T).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}L.transform=function(M,z,H,et){var dt=M.selection?M.selection():M;dt.property("__zoom",Kd),M!==dt?Z(M,z,H,et):dt.interrupt().each(function(){rt(this,arguments).event(et).start().zoom(null,typeof z=="function"?z.apply(this,arguments):z).end()})},L.scaleBy=function(M,z,H,et){L.scaleTo(M,function(){var dt=this.__zoom.k,ct=typeof z=="function"?z.apply(this,arguments):z;return dt*ct},H,et)},L.scaleTo=function(M,z,H,et){L.transform(M,function(){var dt=o.apply(this,arguments),ct=this.__zoom,F=H==null?nt(dt):typeof H=="function"?H.apply(this,arguments):H,ft=ct.invert(F),Mt=typeof z=="function"?z.apply(this,arguments):z;return i(X(B(ct,Mt),F,ft),dt,l)},H,et)},L.translateBy=function(M,z,H,et){L.transform(M,function(){return i(this.__zoom.translate(typeof z=="function"?z.apply(this,arguments):z,typeof H=="function"?H.apply(this,arguments):H),o.apply(this,arguments),l)},null,et)},L.translateTo=function(M,z,H,et,dt){L.transform(M,function(){var ct=o.apply(this,arguments),F=this.__zoom,ft=et==null?nt(ct):typeof et=="function"?et.apply(this,arguments):et;return i(jl.translate(ft[0],ft[1]).scale(F.k).translate(typeof z=="function"?-z.apply(this,arguments):-z,typeof H=="function"?-H.apply(this,arguments):-H),ct,l)},et,dt)};function B(M,z){return z=Math.max(s[0],Math.min(s[1],z)),z===M.k?M:new _n(z,M.x,M.y)}function X(M,z,H){var et=z[0]-H[0]*M.k,dt=z[1]-H[1]*M.k;return et===M.x&&dt===M.y?M:new _n(M.k,et,dt)}function nt(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function Z(M,z,H,et){M.on("start.zoom",function(){rt(this,arguments).event(et).start()}).on("interrupt.zoom end.zoom",function(){rt(this,arguments).event(et).end()}).tween("zoom",function(){var dt=this,ct=arguments,F=rt(dt,ct).event(et),ft=o.apply(dt,ct),Mt=H==null?nt(ft):typeof H=="function"?H.apply(dt,ct):H,Ut=Math.max(ft[1][0]-ft[0][0],ft[1][1]-ft[0][1]),zt=dt.__zoom,Xt=typeof z=="function"?z.apply(dt,ct):z,he=d(zt.invert(Mt).concat(Ut/zt.k),Xt.invert(Mt).concat(Ut/Xt.k));return function(le){if(le===1)le=Xt;else{var ve=he(le),Rn=Ut/ve[2];le=new _n(Rn,Mt[0]-ve[0]*Rn,Mt[1]-ve[1]*Rn)}F.zoom(null,le)}})}function rt(M,z,H){return!H&&M.__zooming||new st(M,z)}function st(M,z){this.that=M,this.args=z,this.active=0,this.sourceEvent=null,this.extent=o.apply(M,z),this.taps=0}st.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,z){return this.mouse&&M!=="mouse"&&(this.mouse[1]=z.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=z.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=z.invert(this.touch1[0])),this.that.__zoom=z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var z=Me(this.that).datum();u.call(M,this.that,new gb(M,{sourceEvent:this.sourceEvent,target:L,transform:this.that.__zoom,dispatch:u}),z)}};function J(M,...z){if(!e.apply(this,arguments))return;var H=rt(this,z).event(M),et=this.__zoom,dt=Math.max(s[0],Math.min(s[1],et.k*Math.pow(2,r.apply(this,arguments)))),ct=uo(M);if(H.wheel)(H.mouse[0][0]!==ct[0]||H.mouse[0][1]!==ct[1])&&(H.mouse[1]=et.invert(H.mouse[0]=ct)),clearTimeout(H.wheel);else{if(et.k===dt)return;H.mouse=[ct,et.invert(ct)],Ar(this),H.start()}vi(M),H.wheel=setTimeout(F,b),H.zoom("mouse",i(X(B(et,dt),H.mouse[0],H.mouse[1]),H.extent,l));function F(){H.wheel=null,H.end()}}function ot(M,...z){if(v||!e.apply(this,arguments))return;var H=M.currentTarget,et=rt(this,z,!0).event(M),dt=Me(M.view).on("mousemove.zoom",Mt,!0).on("mouseup.zoom",Ut,!0),ct=uo(M,H),F=M.clientX,ft=M.clientY;Y2(M.view),ys(M),et.mouse=[ct,this.__zoom.invert(ct)],Ar(this),et.start();function Mt(zt){if(vi(zt),!et.moved){var Xt=zt.clientX-F,he=zt.clientY-ft;et.moved=Xt*Xt+he*he>C}et.event(zt).zoom("mouse",i(X(et.that.__zoom,et.mouse[0]=uo(zt,H),et.mouse[1]),et.extent,l))}function Ut(zt){dt.on("mousemove.zoom mouseup.zoom",null),F2(zt.view,et.moved),vi(zt),et.event(zt).end()}}function lt(M,...z){if(e.apply(this,arguments)){var H=this.__zoom,et=uo(M.changedTouches?M.changedTouches[0]:M,this),dt=H.invert(et),ct=H.k*(M.shiftKey?.5:2),F=i(X(B(H,ct),et,dt),o.apply(this,z),l);vi(M),c>0?Me(this).transition().duration(c).call(Z,F,et,M):Me(this).call(L.transform,F,et,M)}}function T(M,...z){if(e.apply(this,arguments)){var H=M.touches,et=H.length,dt=rt(this,z,M.changedTouches.length===et).event(M),ct,F,ft,Mt;for(ys(M),F=0;F=0;)o+=i[r].value;e.value=o}function Sb(){return this.eachAfter(wb)}function xb(e){var o=this,i,r=[o],a,s,l;do for(i=r.reverse(),r=[];o=i.pop();)if(e(o),a=o.children,a)for(s=0,l=a.length;s=0;--a)i.push(r[a]);return this}function Mb(e){for(var o=this,i=[o],r=[],a,s,l;o=i.pop();)if(r.push(o),a=o.children,a)for(s=0,l=a.length;s=0;)i+=r[a].value;o.value=i})}function Nb(e){return this.eachBefore(function(o){o.children&&o.children.sort(e)})}function Tb(e){for(var o=this,i=Ib(o,e),r=[o];o!==i;)o=o.parent,r.push(o);for(var a=r.length;e!==i;)r.splice(a,0,e),e=e.parent;return r}function Ib(e,o){if(e===o)return e;var i=e.ancestors(),r=o.ancestors(),a=null;for(e=i.pop(),o=r.pop();e===o;)a=e,e=i.pop(),o=r.pop();return a}function Ob(){for(var e=this,o=[e];e=e.parent;)o.push(e);return o}function Lb(){var e=[];return this.each(function(o){e.push(o)}),e}function Db(){var e=[];return this.eachBefore(function(o){o.children||e.push(o)}),e}function Pb(){var e=this,o=[];return e.each(function(i){i!==e&&o.push({source:i.parent,target:i})}),o}function ql(e,o){var i=new Zr(e),r=+e.value&&(i.value=e.value),a,s=[i],l,c,d,u;for(o==null&&(o=Bb);a=s.pop();)if(r&&(a.value=+a.data.value),(c=o(a.data))&&(u=c.length))for(a.children=new Array(u),d=u-1;d>=0;--d)s.push(l=a.children[d]=new Zr(c[d])),l.parent=a,l.depth=a.depth+1;return i.eachBefore(Vb)}function Rb(){return ql(this).eachBefore($b)}function Bb(e){return e.children}function $b(e){e.data=e.data.data}function Vb(e){var o=0;do e.height=o;while((e=e.parent)&&e.height<++o)}function Zr(e){this.data=e,this.depth=this.height=0,this.parent=null}Zr.prototype=ql.prototype={constructor:Zr,count:Sb,each:xb,eachAfter:Mb,eachBefore:Eb,sum:Ab,sort:Nb,path:Tb,ancestors:Ob,descendants:Lb,leaves:Db,links:Pb,copy:Rb};const Ub="2.1.2",zb={version:Ub},{version:Hb}=zb,Gb=Object.freeze({children:e=>e.children,nodeSize:e=>e.data.size,spacing:0});function Zl(e){const o=Object.assign({},Gb,e);function i(c){const d=o[c];return typeof d=="function"?d:()=>d}function r(c){const d=l(s(),c,u=>u.children);return d.update(),d.data}function a(){const c=i("nodeSize"),d=i("spacing");return class rp extends ql.prototype.constructor{constructor(h){super(h)}copy(){const h=l(this.constructor,this,f=>f.children);return h.each(f=>f.data=f.data.data),h}get size(){return c(this)}spacing(h){return d(this,h)}get nodes(){return this.descendants()}get xSize(){return this.size[0]}get ySize(){return this.size[1]}get top(){return this.y}get bottom(){return this.y+this.ySize}get left(){return this.x-this.xSize/2}get right(){return this.x+this.xSize/2}get root(){const h=this.ancestors();return h[h.length-1]}get numChildren(){return this.hasChildren?this.children.length:0}get hasChildren(){return!this.noChildren}get noChildren(){return this.children===null}get firstChild(){return this.hasChildren?this.children[0]:null}get lastChild(){return this.hasChildren?this.children[this.numChildren-1]:null}get extents(){return(this.children||[]).reduce((h,f)=>rp.maxExtents(h,f.extents),this.nodeExtents)}get nodeExtents(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}static maxExtents(h,f){return{top:Math.min(h.top,f.top),bottom:Math.max(h.bottom,f.bottom),left:Math.min(h.left,f.left),right:Math.max(h.right,f.right)}}}}function s(){const c=a(),d=i("nodeSize"),u=i("spacing");return class extends c{constructor(h){super(h),Object.assign(this,{x:0,y:0,relX:0,prelim:0,shift:0,change:0,lExt:this,lExtRelX:0,lThr:null,rExt:this,rExtRelX:0,rThr:null})}get size(){return d(this.data)}spacing(h){return u(this.data,h.data)}get x(){return this.data.x}set x(h){this.data.x=h}get y(){return this.data.y}set y(h){this.data.y=h}update(){return ap(this),sp(this),this}}}function l(c,d,u){const h=(f,v)=>{const _=new c(f);Object.assign(_,{parent:v,depth:v===null?0:v.depth+1,height:0,length:1});const b=u(f)||[];return _.children=b.length===0?null:b.map(C=>h(C,_)),_.children&&Object.assign(_,_.children.reduce((C,D)=>({height:Math.max(C.height,D.height+1),length:C.length+D.length}),_)),_};return h(d,null)}return Object.assign(r,{nodeSize(c){return arguments.length?(o.nodeSize=c,r):o.nodeSize},spacing(c){return arguments.length?(o.spacing=c,r):o.spacing},children(c){return arguments.length?(o.children=c,r):o.children},hierarchy(c,d){const u=typeof d>"u"?o.children:d;return l(a(),c,u)},dump(c){const d=i("nodeSize"),u=h=>f=>{const v=h+" ",_=h+" ",{x:b,y:C}=f,D=d(f),L=f.children||[],B=L.length===0?" ":`,${v}children: [${_}${L.map(u(_)).join(_)}${v}],${h}`;return`{ size: [${D.join(", ")}],${v}x: ${b}, y: ${C}${B}},`};return u(` `)(c)}}),r}Zl.version=Hb;const ap=(e,o=0)=>(e.y=o,(e.children||[]).reduce((i,r)=>{const[a,s]=i;ap(r,e.y+e.ySize);const l=(a===0?r.lExt:r.rExt).bottom;a!==0&&Fb(e,a,s);const c=Qb(l,a,s);return[a+1,c]},[0,null]),Yb(e),Kb(e),e),sp=(e,o,i)=>{typeof o>"u"&&(o=-e.relX-e.prelim,i=0);const r=o+e.relX;return e.relX=r+e.prelim-i,e.prelim=0,e.x=i+e.relX,(e.children||[]).forEach(a=>sp(a,r,e.x)),e},Yb=e=>{(e.children||[]).reduce((o,i)=>{const[r,a]=o,s=r+i.shift,l=a+s+i.change;return i.relX+=l,[s,l]},[0,0])},Fb=(e,o,i)=>{const r=e.children[o-1],a=e.children[o];let s=r,l=r.relX,c=a,d=a.relX,u=!0;for(;s&&c;){s.bottom>i.lowY&&(i=i.next);const h=l+s.prelim-(d+c.prelim)+s.xSize/2+c.xSize/2+s.spacing(c);(h>0||h<0&&u)&&(d+=h,Xb(a,h),Wb(e,o,i.index,h)),u=!1;const f=s.bottom,v=c.bottom;f<=v&&(s=qb(s),s&&(l+=s.relX)),f>=v&&(c=jb(c),c&&(d+=c.relX))}!s&&c?Zb(e,o,c,d):s&&!c&&Jb(e,o,s,l)},Xb=(e,o)=>{e.relX+=o,e.lExtRelX+=o,e.rExtRelX+=o},Wb=(e,o,i,r)=>{const a=e.children[o],s=o-i;if(s>1){const l=r/s;e.children[i+1].shift+=l,a.shift-=l,a.change-=r-l}},jb=e=>e.hasChildren?e.firstChild:e.lThr,qb=e=>e.hasChildren?e.lastChild:e.rThr,Zb=(e,o,i,r)=>{const a=e.firstChild,s=a.lExt,l=e.children[o];s.lThr=i;const c=r-i.relX-a.lExtRelX;s.relX+=c,s.prelim-=c,a.lExt=l.lExt,a.lExtRelX=l.lExtRelX},Jb=(e,o,i,r)=>{const a=e.children[o],s=a.rExt,l=e.children[o-1];s.rThr=i;const c=r-i.relX-a.rExtRelX;s.relX+=c,s.prelim-=c,a.rExt=l.rExt,a.rExtRelX=l.rExtRelX},Kb=e=>{if(e.hasChildren){const o=e.firstChild,i=e.lastChild,r=(o.prelim+o.relX-o.xSize/2+i.relX+i.prelim+i.xSize/2)/2;Object.assign(e,{prelim:r,lExt:o.lExt,lExtRelX:o.lExtRelX,rExt:i.rExt,rExtRelX:i.rExtRelX})}},Qb=(e,o,i)=>{for(;i!==null&&e>=i.lowY;)i=i.next;return{lowY:e,index:o,next:i}},Pt={selection:Ko,select:Me,max:ry,min:ay,sum:sy,cumsum:iy,tree:ab,stratify:Q_,zoom:kb,zoomIdentity:jl,linkHorizontal:mb,flextree:Zl};let tC=class{constructor(){const e={id:`ID${Math.floor(Math.random()*1e6)}`,firstDraw:!0,ctx:document.createElement("canvas").getContext("2d"),initialExpandLevel:1,nodeDefaultBackground:"none",lastTransform:{x:0,y:0,k:1},allowedNodesCount:{},zoomBehavior:null,generateRoot:null,svgWidth:800,svgHeight:window.innerHeight-100,container:"body",data:null,connections:[],defaultFont:"Helvetica",nodeId:o=>o.nodeId||o.id,parentNodeId:o=>o.parentNodeId||o.parentId,rootMargin:40,nodeWidth:o=>250,nodeHeight:o=>150,neighbourMargin:(o,i)=>80,siblingsMargin:o=>20,childrenMargin:o=>60,compactMarginPair:o=>100,compactMarginBetween:o=>20,nodeButtonWidth:o=>40,nodeButtonHeight:o=>40,nodeButtonX:o=>-20,nodeButtonY:o=>-20,linkYOffset:30,pagingStep:o=>5,minPagingVisibleNodes:o=>2e3,scaleExtent:[.001,20],duration:400,imageName:"Chart",setActiveNodeCentered:!0,layout:"top",compact:!0,createZoom:o=>Pt.zoom(),onZoomStart:o=>{},onZoom:o=>{},onZoomEnd:o=>{},onNodeClick:o=>o,onExpandOrCollapse:o=>o,nodeContent:o=>`
Sample Node(id=${o.id}), override using
chart.nodeContent({data}=>{
    return '' // Custom HTML
})

Or check different layout examples
`,buttonContent:({node:o,state:i})=>`
${{left:r=>r?`
${o.data._directSubordinatesPaging}
`:`
${o.data._directSubordinatesPaging}
`,bottom:r=>r?`
${o.data._directSubordinatesPaging}
`:`
${o.data._directSubordinatesPaging}
`,right:r=>r?`
${o.data._directSubordinatesPaging}
`:`
${o.data._directSubordinatesPaging}
`,top:r=>r?`
${o.data._directSubordinatesPaging}
`:`
${o.data._directSubordinatesPaging}
`}[i.layout](o.children)}
`,pagingButton:(o,i,r,a)=>{const s=a.pagingStep(o.parent),l=o.parent.data._pagingStep,c=o.parent.data._directSubordinatesPaging-l;return`
Show next ${Math.min(c,s)} nodes
`},nodeUpdate:function(o,i,r){Pt.select(this).select(".node-rect").attr("stroke",a=>a.data._highlighted||a.data._upToTheRootHighlighted?"#E27396":"none").attr("stroke-width",o.data._highlighted||o.data._upToTheRootHighlighted?10:1)},nodeEnter:o=>o,nodeExit:o=>o,linkUpdate:function(o,i,r){Pt.select(this).attr("stroke",a=>a.data._upToTheRootHighlighted?"#E27396":"#E4E2E9").attr("stroke-width",a=>a.data._upToTheRootHighlighted?5:1),o.data._upToTheRootHighlighted&&Pt.select(this).raise()},hdiagonal:function(o,i,r){const a=o.x,s=o.y,l=i.x,c=i.y;let d=r&&r.x!=null?r.x:a,u=r&&r.y!=null?r.y:s,h=l-a<0?-1:1,f=c-s<0?-1:1,v=35,_=Math.abs(l-a)/2 ${i.map(r=>{const a=this.getTextWidth(r.label,{ctx:o.ctx,fontSize:2,defaultFont:o.defaultFont});return` ${r.label||""} `}).join("")} `},connectionsUpdate:function(o,i,r){Pt.select(this).attr("stroke",a=>"#E27396").attr("stroke-linecap","round").attr("stroke-width",a=>"5").attr("pointer-events","none").attr("marker-start",a=>`url(#${a.from+"_"+a.to})`).attr("marker-end",a=>`url(#arrow-${a.from+"_"+a.to})`)},linkGroupArc:Pt.linkHorizontal().x(o=>o.x).y(o=>o.y),layoutBindings:{left:{nodeLeftX:o=>0,nodeRightX:o=>o.width,nodeTopY:o=>-o.height/2,nodeBottomY:o=>o.height/2,nodeJoinX:o=>o.x+o.width,nodeJoinY:o=>o.y-o.height/2,linkJoinX:o=>o.x+o.width,linkJoinY:o=>o.y,linkX:o=>o.x,linkY:o=>o.y,linkCompactXStart:o=>o.x+o.width/2,linkCompactYStart:o=>o.y+(o.compactEven?o.height/2:-o.height/2),compactLinkMidX:(o,i)=>o.firstCompactNode.x,compactLinkMidY:(o,i)=>o.firstCompactNode.y+o.firstCompactNode.flexCompactDim[0]/4+i.compactMarginPair(o)/4,linkParentX:o=>o.parent.x+o.parent.width,linkParentY:o=>o.parent.y,buttonX:o=>o.width,buttonY:o=>o.height/2,centerTransform:({root:o,rootMargin:i,centerY:r,scale:a,centerX:s})=>`translate(${i},${r}) scale(${a})`,compactDimension:{sizeColumn:o=>o.height,sizeRow:o=>o.width,reverse:o=>o.slice().reverse()},nodeFlexSize:({height:o,width:i,siblingsMargin:r,childrenMargin:a,state:s,node:l})=>s.compact&&l.flexCompactDim?[l.flexCompactDim[0],l.flexCompactDim[1]]:[o+r,i+a],zoomTransform:({centerY:o,scale:i})=>`translate(0,${o}) scale(${i})`,diagonal:this.hdiagonal.bind(this),swap:o=>{const i=o.x;o.x=o.y,o.y=i},nodeUpdateTransform:({x:o,y:i,width:r,height:a})=>`translate(${o},${i-a/2})`},top:{nodeLeftX:o=>-o.width/2,nodeRightX:o=>o.width/2,nodeTopY:o=>0,nodeBottomY:o=>o.height,nodeJoinX:o=>o.x-o.width/2,nodeJoinY:o=>o.y+o.height,linkJoinX:o=>o.x,linkJoinY:o=>o.y+o.height,linkCompactXStart:o=>o.x+(o.compactEven?o.width/2:-o.width/2),linkCompactYStart:o=>o.y+o.height/2,compactLinkMidX:(o,i)=>o.firstCompactNode.x+o.firstCompactNode.flexCompactDim[0]/4+i.compactMarginPair(o)/4,compactLinkMidY:o=>o.firstCompactNode.y,compactDimension:{sizeColumn:o=>o.width,sizeRow:o=>o.height,reverse:o=>o},linkX:o=>o.x,linkY:o=>o.y,linkParentX:o=>o.parent.x,linkParentY:o=>o.parent.y+o.parent.height,buttonX:o=>o.width/2,buttonY:o=>o.height,centerTransform:({root:o,rootMargin:i,centerY:r,scale:a,centerX:s})=>`translate(${s},${i}) scale(${a})`,nodeFlexSize:({height:o,width:i,siblingsMargin:r,childrenMargin:a,state:s,node:l,compactViewIndex:c})=>s.compact&&l.flexCompactDim?[l.flexCompactDim[0],l.flexCompactDim[1]]:[i+r,o+a],zoomTransform:({centerX:o,scale:i})=>`translate(${o},0}) scale(${i})`,diagonal:this.diagonal.bind(this),swap:o=>{},nodeUpdateTransform:({x:o,y:i,width:r,height:a})=>`translate(${o-r/2},${i})`},bottom:{nodeLeftX:o=>-o.width/2,nodeRightX:o=>o.width/2,nodeTopY:o=>-o.height,nodeBottomY:o=>0,nodeJoinX:o=>o.x-o.width/2,nodeJoinY:o=>o.y-o.height-o.height,linkJoinX:o=>o.x,linkJoinY:o=>o.y-o.height,linkCompactXStart:o=>o.x+(o.compactEven?o.width/2:-o.width/2),linkCompactYStart:o=>o.y-o.height/2,compactLinkMidX:(o,i)=>o.firstCompactNode.x+o.firstCompactNode.flexCompactDim[0]/4+i.compactMarginPair(o)/4,compactLinkMidY:o=>o.firstCompactNode.y,linkX:o=>o.x,linkY:o=>o.y,compactDimension:{sizeColumn:o=>o.width,sizeRow:o=>o.height,reverse:o=>o},linkParentX:o=>o.parent.x,linkParentY:o=>o.parent.y-o.parent.height,buttonX:o=>o.width/2,buttonY:o=>0,centerTransform:({root:o,rootMargin:i,centerY:r,scale:a,centerX:s,chartHeight:l})=>`translate(${s},${l-i}) scale(${a})`,nodeFlexSize:({height:o,width:i,siblingsMargin:r,childrenMargin:a,state:s,node:l})=>s.compact&&l.flexCompactDim?[l.flexCompactDim[0],l.flexCompactDim[1]]:[i+r,o+a],zoomTransform:({centerX:o,scale:i})=>`translate(${o},0}) scale(${i})`,diagonal:this.diagonal.bind(this),swap:o=>{o.y=-o.y},nodeUpdateTransform:({x:o,y:i,width:r,height:a})=>`translate(${o-r/2},${i-a})`},right:{nodeLeftX:o=>-o.width,nodeRightX:o=>0,nodeTopY:o=>-o.height/2,nodeBottomY:o=>o.height/2,nodeJoinX:o=>o.x-o.width-o.width,nodeJoinY:o=>o.y-o.height/2,linkJoinX:o=>o.x-o.width,linkJoinY:o=>o.y,linkX:o=>o.x,linkY:o=>o.y,linkParentX:o=>o.parent.x-o.parent.width,linkParentY:o=>o.parent.y,buttonX:o=>0,buttonY:o=>o.height/2,linkCompactXStart:o=>o.x-o.width/2,linkCompactYStart:o=>o.y+(o.compactEven?o.height/2:-o.height/2),compactLinkMidX:(o,i)=>o.firstCompactNode.x,compactLinkMidY:(o,i)=>o.firstCompactNode.y+o.firstCompactNode.flexCompactDim[0]/4+i.compactMarginPair(o)/4,centerTransform:({root:o,rootMargin:i,centerY:r,scale:a,centerX:s,chartWidth:l})=>`translate(${l-i},${r}) scale(${a})`,nodeFlexSize:({height:o,width:i,siblingsMargin:r,childrenMargin:a,state:s,node:l})=>s.compact&&l.flexCompactDim?[l.flexCompactDim[0],l.flexCompactDim[1]]:[o+r,i+a],compactDimension:{sizeColumn:o=>o.height,sizeRow:o=>o.width,reverse:o=>o.slice().reverse()},zoomTransform:({centerY:o,scale:i})=>`translate(0,${o}) scale(${i})`,diagonal:this.hdiagonal.bind(this),swap:o=>{const i=o.x;o.x=-o.y,o.y=i},nodeUpdateTransform:({x:o,y:i,width:r,height:a})=>`translate(${o-r},${i-a/2})`}}};this.getChartState=()=>e,Object.keys(e).forEach(o=>{this[o]=function(i){if(arguments.length)e[o]=i;else return e[o];return this}}),this.initializeEnterExitUpdatePattern()}initializeEnterExitUpdatePattern(){Pt.selection.prototype.patternify=function(e){var o=this,i=e.selector,r=e.tag,a=e.data||[i],s=o.selectAll("."+i).data(a,(l,c)=>typeof l=="object"&&l.id?l.id:c);return s.exit().remove(),s=s.enter().append(r).merge(s),s.attr("class",i),s}}getNodeChildren({data:e,children:o,_children:i},r){return r.push(e),o&&o.forEach(a=>{this.getNodeChildren(a,r)}),i&&i.forEach(a=>{this.getNodeChildren(a,r)}),r}initialZoom(e){const o=this.getChartState();return o.lastTransform.k=e,this}render(){const e=this.getChartState();if(!e.data||e.data.length==0)return console.log("ORG CHART - Data is empty"),e.container&&(Me(e.container).select(".nodes-wrapper").remove(),Me(e.container).select(".links-wrapper").remove(),Me(e.container).select(".connections-wrapper").remove()),this;const o=Pt.select(e.container),i=o.node().getBoundingClientRect();i.width>0&&(e.svgWidth=i.width);const r={id:`ID${Math.floor(Math.random()*1e6)}`,chartWidth:e.svgWidth,chartHeight:e.svgHeight};if(e.calc=r,r.centerX=r.chartWidth/2,r.centerY=r.chartHeight/2,e.firstDraw){const l={zoom:null};l.zoom=e.createZoom().clickDistance(10).on("start",(c,d)=>e.onZoomStart(c)).on("end",(c,d)=>e.onZoomEnd(c)).on("zoom",(c,d)=>{e.onZoom(c),this.zoomed(c,d)}).scaleExtent(e.scaleExtent),e.zoomBehavior=l.zoom}e.flexTreeLayout=Zl({nodeSize:l=>{const c=e.nodeWidth(l),d=e.nodeHeight(l),u=e.siblingsMargin(l),h=e.childrenMargin(l);return e.layoutBindings[e.layout].nodeFlexSize({state:e,node:l,width:c,height:d,siblingsMargin:u,childrenMargin:h})}}).spacing((l,c)=>l.parent==c.parent?0:e.neighbourMargin(l,c)),this.setLayouts({expandNodesFirst:!1});const a=o.patternify({tag:"svg",selector:"svg-chart-container"}).attr("width",e.svgWidth).attr("height",e.svgHeight).attr("font-family",e.defaultFont);e.firstDraw&&a.call(e.zoomBehavior).on("dblclick.zoom",null).attr("cursor","move"),e.svg=a;const s=a.patternify({tag:"g",selector:"chart"});return e.centerG=s.patternify({tag:"g",selector:"center-group"}),e.linksWrapper=e.centerG.patternify({tag:"g",selector:"links-wrapper"}),e.nodesWrapper=e.centerG.patternify({tag:"g",selector:"nodes-wrapper"}),e.connectionsWrapper=e.centerG.patternify({tag:"g",selector:"connections-wrapper"}),e.defsWrapper=a.patternify({tag:"g",selector:"defs-wrapper"}),e.firstDraw&&e.centerG.attr("transform",()=>e.layoutBindings[e.layout].centerTransform({centerX:r.centerX,centerY:r.centerY,scale:e.lastTransform.k,rootMargin:e.rootMargin,root:e.root,chartHeight:r.chartHeight,chartWidth:r.chartWidth})),e.chart=s,this.update(e.root),Pt.select(window).on(`resize.${e.id}`,()=>{const l=Pt.select(e.container).node().getBoundingClientRect();e.svg.attr("width",l.width)}),e.firstDraw&&(e.firstDraw=!1),this}addNode(e){const o=this.getChartState();if(e&&(o.parentNodeId(e)==null||o.parentNodeId(e)==o.nodeId(e))&&o.data.length==0)return o.data.push(e),this.render(),this;const i=o.generateRoot(o.data).descendants(),r=i.filter(({data:a})=>o.nodeId(a).toString()===o.nodeId(e).toString())[0];return i.filter(({data:a})=>o.nodeId(a).toString()===o.parentNodeId(e).toString())[0],r?(console.log(`ORG CHART - ADD - Node with id "${o.nodeId(e)}" already exists in tree`),this):(e._centered&&!e._expanded&&(e._expanded=!0),o.data.push(e),this.updateNodesState(),this)}removeNode(e){const o=this.getChartState(),i=o.generateRoot(o.data).descendants().filter(({data:r})=>o.nodeId(r)==e)[0];return i?(i.descendants().forEach(r=>r.data._filteredOut=!0),o.data=o.data.filter(r=>!r._filteredOut),o.data.length==0?this.render():this.updateNodesState.bind(this)(),this):(console.log(`ORG CHART - REMOVE - Node with id "${e}" not found in the tree`),this)}groupBy(e,o,i){const r={};return e.forEach(a=>{const s=o(a);r[s]||(r[s]=[]),r[s].push(a)}),Object.keys(r).forEach(a=>{r[a]=i(r[a])}),Object.entries(r)}calculateCompactFlexDimensions(e){const o=this.getChartState();e.eachBefore(i=>{i.firstCompact=null,i.compactEven=null,i.flexCompactDim=null,i.firstCompactNode=null}),e.eachBefore(i=>{if(i.children&&i.children.length>1){const r=i.children.filter(u=>!u.children);if(r.length<2)return;r.forEach((u,h)=>{h||(u.firstCompact=!0),h%2?u.compactEven=!1:u.compactEven=!0,u.row=Math.floor(h/2)});const a=Pt.max(r.filter(u=>u.compactEven),o.layoutBindings[o.layout].compactDimension.sizeColumn),s=Pt.max(r.filter(u=>!u.compactEven),o.layoutBindings[o.layout].compactDimension.sizeColumn),l=Math.max(a,s)*2,c=this.groupBy(r,u=>u.row,u=>Pt.max(u,h=>o.layoutBindings[o.layout].compactDimension.sizeRow(h)+o.compactMarginBetween(h))),d=Pt.sum(c.map(u=>u[1]));r.forEach(u=>{u.firstCompactNode=r[0],u.firstCompact?u.flexCompactDim=[l+o.compactMarginPair(u),d-o.compactMarginBetween(u)]:u.flexCompactDim=[0,0]}),i.flexCompactDim=null}})}calculateCompactFlexPositions(e){const o=this.getChartState();e.eachBefore(i=>{if(i.children){const r=i.children.filter(u=>u.flexCompactDim),a=r[0];if(!a)return;r.forEach((u,h,f)=>{h==0&&(a.x-=a.flexCompactDim[0]/2),h&h%2-1?u.x=a.x+a.flexCompactDim[0]*.25-o.compactMarginPair(u)/4:h&&(u.x=a.x+a.flexCompactDim[0]*.75+o.compactMarginPair(u)/4)});const s=a.x+a.flexCompactDim[0]*.5;a.x=a.x+a.flexCompactDim[0]*.25-o.compactMarginPair(a)/4;const l=i.x-s;Math.abs(l)<10&&r.forEach(u=>u.x+=l);const c=this.groupBy(r,u=>u.row,u=>Pt.max(u,h=>o.layoutBindings[o.layout].compactDimension.sizeRow(h))),d=Pt.cumsum(c.map(u=>u[1]+o.compactMarginBetween(u)));r.forEach((u,h)=>{u.row?u.y=a.y+d[u.row-1]:u.y=a.y})}})}update({x0:e,y0:o,x:i=0,y:r=0,width:a,height:s}){const l=this.getChartState();l.calc,l.compact&&this.calculateCompactFlexDimensions(l.root);const c=l.flexTreeLayout(l.root);l.compact&&this.calculateCompactFlexPositions(l.root);const d=c.descendants(),u=c.descendants().slice(1);d.forEach(l.layoutBindings[l.layout].swap);const h=l.connections,f={};l.allNodes.forEach(T=>f[l.nodeId(T.data)]=T);const v={};d.forEach(T=>v[l.nodeId(T.data)]=T),h.forEach(T=>{const V=f[T.from],U=f[T.to];T._source=V,T._target=U});const _=h.filter(T=>v[T.from]&&v[T.to]),b=l.defs.bind(this)(l,_),C=l.defsWrapper.html();b!==C&&l.defsWrapper.html(b);const D=l.linksWrapper.selectAll("path.link").data(u,T=>l.nodeId(T.data)),L=D.enter().insert("path","g").attr("class","link").attr("d",T=>{const V=l.layoutBindings[l.layout].linkJoinX({x:e,y:o,width:a,height:s}),U=l.layoutBindings[l.layout].linkJoinY({x:e,y:o,width:a,height:s}),M={x:V,y:U};return l.layoutBindings[l.layout].diagonal(M,M,M)}).merge(D);L.attr("fill","none"),this.isEdge()?L.style("display",T=>T.data._pagingButton?"none":"auto"):L.attr("display",T=>T.data._pagingButton?"none":"auto"),L.each(l.linkUpdate),L.transition().duration(l.duration).attr("d",T=>{const V=l.compact&&T.flexCompactDim?{x:l.layoutBindings[l.layout].compactLinkMidX(T,l),y:l.layoutBindings[l.layout].compactLinkMidY(T,l)}:{x:l.layoutBindings[l.layout].linkX(T),y:l.layoutBindings[l.layout].linkY(T)},U={x:l.layoutBindings[l.layout].linkParentX(T),y:l.layoutBindings[l.layout].linkParentY(T)},M=l.compact&&T.flexCompactDim?{x:l.layoutBindings[l.layout].linkCompactXStart(T),y:l.layoutBindings[l.layout].linkCompactYStart(T)}:V;return l.layoutBindings[l.layout].diagonal(V,U,M,{sy:l.linkYOffset})}),D.exit().transition().duration(l.duration).attr("d",T=>{const V=l.layoutBindings[l.layout].linkJoinX({x:i,y:r,width:a,height:s}),U=l.layoutBindings[l.layout].linkJoinY({x:i,y:r,width:a,height:s}),M={x:V,y:U};return l.layoutBindings[l.layout].diagonal(M,M,null,{sy:l.linkYOffset})}).remove();const B=l.connectionsWrapper.selectAll("path.connection").data(_),X=B.enter().insert("path","g").attr("class","connection").attr("d",T=>{const V=l.layoutBindings[l.layout].linkJoinX({x:e,y:o,width:a,height:s}),U=l.layoutBindings[l.layout].linkJoinY({x:e,y:o,width:a,height:s}),M={x:V,y:U};return l.layoutBindings[l.layout].diagonal(M,M,null,{sy:l.linkYOffset})}).merge(B);X.attr("fill","none"),X.transition().duration(l.duration).attr("d",T=>{const V=l.layoutBindings[l.layout].linkX({x:T._source.x,y:T._source.y,width:T._source.width,height:T._source.height}),U=l.layoutBindings[l.layout].linkY({x:T._source.x,y:T._source.y,width:T._source.width,height:T._source.height}),M=l.layoutBindings[l.layout].linkJoinX({x:T._target.x,y:T._target.y,width:T._target.width,height:T._target.height}),z=l.layoutBindings[l.layout].linkJoinY({x:T._target.x,y:T._target.y,width:T._target.width,height:T._target.height});return l.linkGroupArc({source:{x:V,y:U},target:{x:M,y:z}})}),X.each(l.connectionsUpdate),B.exit().transition().duration(l.duration).attr("opacity",0).remove();const nt=l.nodesWrapper.selectAll("g.node").data(d,({data:T})=>l.nodeId(T)),Z=nt.enter().append("g").attr("class","node").attr("transform",T=>{if(T==l.root)return`translate(${e},${o})`;const V=l.layoutBindings[l.layout].nodeJoinX({x:e,y:o,width:a,height:s}),U=l.layoutBindings[l.layout].nodeJoinY({x:e,y:o,width:a,height:s});return`translate(${V},${U})`}).attr("cursor","pointer").on("click.node",(T,V)=>{const{data:U}=V;if(![...T.srcElement.classList].includes("node-button-foreign-object")){if([...T.srcElement.classList].includes("paging-button-wrapper")){this.loadPagingNodes(V);return}if(!U._pagingButton){l.onNodeClick(V);return}console.log("event fired, no handlers")}}).on("keydown.node",(T,V)=>{const{data:U}=V;if(T.key==="Enter"||T.key===" "||T.key==="Spacebar"){if([...T.srcElement.classList].includes("node-button-foreign-object"))return;if([...T.srcElement.classList].includes("paging-button-wrapper")){this.loadPagingNodes(V);return}(T.key==="Enter"||T.key===" "||T.key==="Spacebar")&&this.onButtonClick(T,V)}});Z.each(l.nodeEnter),Z.patternify({tag:"rect",selector:"node-rect",data:T=>[T]});const rt=Z.merge(nt).style("font","12px sans-serif");rt.patternify({tag:"foreignObject",selector:"node-foreign-object",data:T=>[T]}).style("overflow","visible").patternify({tag:"xhtml:div",selector:"node-foreign-object-div",data:T=>[T]}),this.restyleForeignObjectElements();const st=Z.patternify({tag:"g",selector:"node-button-g",data:T=>[T]}).on("click",(T,V)=>this.onButtonClick(T,V)).on("keydown",(T,V)=>{(T.key==="Enter"||T.key===" "||T.key==="Spacebar")&&this.onButtonClick(T,V)});st.patternify({tag:"rect",selector:"node-button-rect",data:T=>[T]}).attr("opacity",0).attr("pointer-events","all").attr("width",T=>l.nodeButtonWidth(T)).attr("height",T=>l.nodeButtonHeight(T)).attr("x",T=>l.nodeButtonX(T)).attr("y",T=>l.nodeButtonY(T)),st.patternify({tag:"foreignObject",selector:"node-button-foreign-object",data:T=>[T]}).attr("width",T=>l.nodeButtonWidth(T)).attr("height",T=>l.nodeButtonHeight(T)).attr("x",T=>l.nodeButtonX(T)).attr("y",T=>l.nodeButtonY(T)).style("overflow","visible").patternify({tag:"xhtml:div",selector:"node-button-div",data:T=>[T]}).style("pointer-events","none").style("display","flex").style("width","100%").style("height","100%"),rt.transition().attr("opacity",0).duration(l.duration).attr("transform",({x:T,y:V,width:U,height:M})=>l.layoutBindings[l.layout].nodeUpdateTransform({x:T,y:V,width:U,height:M})).attr("opacity",1),rt.select(".node-rect").attr("width",({width:T})=>T).attr("height",({height:T})=>T).attr("x",({width:T})=>0).attr("y",({height:T})=>0).attr("cursor","pointer").attr("rx",3).attr("fill",l.nodeDefaultBackground),rt.select(".node-button-g").attr("transform",({data:T,width:V,height:U})=>{const M=l.layoutBindings[l.layout].buttonX({width:V,height:U}),z=l.layoutBindings[l.layout].buttonY({width:V,height:U});return`translate(${M},${z})`}).attr("display",({data:T})=>T._directSubordinates>0?null:"none").attr("opacity",({data:T,children:V,_children:U})=>T._pagingButton?0:V||U?1:0),rt.select(".node-button-foreign-object .node-button-div").html(T=>l.buttonContent({node:T,state:l})),rt.select(".node-button-text").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("font-size",({children:T})=>T?40:26).text(({children:T})=>T?"-":"+").attr("y",this.isEdge()?10:0),rt.each(l.nodeUpdate);const J=nt.exit();J.each(l.nodeExit);const ot=J.data().reduce((T,V)=>T.depth{let{x:V,y:U,width:M,height:z}=ot.parent||{};const H=l.layoutBindings[l.layout].nodeJoinX({x:V,y:U,width:M,height:z}),et=l.layoutBindings[l.layout].nodeJoinY({x:V,y:U,width:M,height:z});return`translate(${H},${et})`}).on("end",function(){Pt.select(this).remove()}).attr("opacity",0),d.forEach(T=>{T.x0=T.x,T.y0=T.y});const lt=l.allNodes.filter(T=>T.data._centered)[0];if(lt){let T=[lt];lt.data._centeredWithDescendants&&(l.compact?T=lt.descendants().filter((V,U)=>U<7):T=lt.descendants().filter((V,U,M)=>{const z=Math.round(M.length/2),H=2;return M.length%2?U>z-H&&Uz-H&&Uo).attr("height",({height:o})=>o).attr("x",({width:o})=>0).attr("y",({height:o})=>0),e.svg.selectAll(".node-foreign-object-div").style("width",({width:o})=>`${o}px`).style("height",({height:o})=>`${o}px`).html(function(o,i,r){return o.data._pagingButton?`
${e.pagingButton(o,i,r,e)}
`:e.nodeContent.bind(this)(o,i,r,e)})}onButtonClick(e,o){const i=this.getChartState();o.data._pagingButton||(i.setActiveNodeCentered&&(o.data._centered=!0,o.data._centeredWithDescendants=!0),o.children?(o._children=o.children,o.children=null,this.setExpansionFlagToChildren(o,!1)):(o.children=o._children,o._children=null,o.children&&o.children.forEach(({data:r})=>r._expanded=!0)),this.update(o),e.stopPropagation(),i.onExpandOrCollapse(o))}setExpansionFlagToChildren({data:e,children:o,_children:i},r){e._expanded=r,o&&o.forEach(a=>{this.setExpansionFlagToChildren(a,r)}),i&&i.forEach(a=>{this.setExpansionFlagToChildren(a,r)})}expandSomeNodes(e){if(e.data._expanded){let o=e.parent;for(;o&&o._children;)o.children=o._children,o._children=null,o=o.parent}e._children&&e._children.forEach(o=>this.expandSomeNodes(o)),e.children&&e.children.forEach(o=>this.expandSomeNodes(o))}updateNodesState(){const e=this.getChartState();this.setLayouts({expandNodesFirst:!0}),this.update(e.root)}setLayouts({expandNodesFirst:e=!0}){const o=this.getChartState();o.generateRoot=Pt.stratify().id(a=>o.nodeId(a)).parentId(a=>o.parentNodeId(a)),o.root=o.generateRoot(o.data);const i=o.root.descendants();o.initialExpandLevel>1&&i.length>0&&(i.forEach(a=>{a.depth<=o.initialExpandLevel&&(a.data._expanded=!0)}),o.initialExpandLevel=1);const r={};o.root.descendants().filter(a=>a.children).filter(a=>!a.data._pagingStep).forEach(a=>{a.data._pagingStep=o.minPagingVisibleNodes(a)}),o.root.eachBefore((a,s)=>{a.data._directSubordinatesPaging=a.children?a.children.length:0,a.children&&a.children.forEach((l,c)=>{if(l.data._pagingButton=!1,c>a.data._pagingStep&&(r[l.id]=!0),c===a.data._pagingStep&&a.children.length-1>a.data._pagingStep&&(l.data._pagingButton=!0),r[l.parent.id]&&(r[l.id]=!0),l.data._expanded||l.data._centered||l.data._highlighted||l.data._upToTheRootHighlighted){let d=l;for(;d&&(r[d.id]||d.data._pagingButton);)r[d.id]=!1,d.data._pagingButton&&(d.data._pagingButton=!1,d.parent.children.forEach(u=>{u.data._expanded=!0,r[u.id]=!1})),d=d.parent}})}),o.root=Pt.stratify().id(a=>o.nodeId(a)).parentId(a=>o.parentNodeId(a))(o.data.filter(a=>r[a.id]!==!0)),o.root.each((a,s,l)=>{let c=a._hierarchyHeight||a.height,d=o.nodeWidth(a),u=o.nodeHeight(a);Object.assign(a,{width:d,height:u,_hierarchyHeight:c})}),o.root.x0=0,o.root.y0=0,o.allNodes=o.root.descendants(),o.allNodes.forEach(a=>{Object.assign(a.data,{_directSubordinates:a.children?a.children.length:0,_totalSubordinates:a.descendants().length-1})}),o.root.children&&(e&&o.root.children.forEach(this.expand),o.root.children.forEach(a=>this.collapse(a)),o.initialExpandLevel==0&&(o.root._children=o.root.children,o.root.children=null),[o.root].forEach(a=>this.expandSomeNodes(a)))}collapse(e){e.children&&(e._children=e.children,e._children.forEach(o=>this.collapse(o)),e.children=null)}expand(e){e._children&&(e.children=e._children,e.children.forEach(o=>this.expand(o)),e._children=null)}zoomed(e,o){const i=this.getChartState(),r=i.chart,a=e.transform;i.lastTransform=a,r.attr("transform",a),this.isEdge()&&this.restyleForeignObjectElements()}zoomTreeBounds({x0:e,x1:o,y0:i,y1:r,params:a={animate:!0,scale:!0,onCompleted:()=>{}}}){const{centerG:s,svgWidth:l,svgHeight:c,svg:d,zoomBehavior:u,duration:h,lastTransform:f}=this.getChartState();let v=Math.min(8,.9/Math.max((o-e)/l,(r-i)/c)),_=Pt.zoomIdentity.translate(l/2,c/2);_=_.scale(a.scale?v:f.k),_=_.translate(-(e+o)/2,-(i+r)/2),d.transition().duration(a.animate?h:0).call(u.transform,_),s.transition().duration(a.animate?h:0).attr("transform","translate(0,0)").on("end",function(){a.onCompleted&&a.onCompleted()})}fit({animate:e=!0,nodes:o,scale:i=!0,onCompleted:r=()=>{}}={}){const a=this.getChartState(),{root:s}=a;let l=o||s.descendants();const c=Pt.min(l,f=>f.x+a.layoutBindings[a.layout].nodeLeftX(f)),d=Pt.max(l,f=>f.x+a.layoutBindings[a.layout].nodeRightX(f)),u=Pt.min(l,f=>f.y+a.layoutBindings[a.layout].nodeTopY(f)),h=Pt.max(l,f=>f.y+a.layoutBindings[a.layout].nodeBottomY(f));return this.zoomTreeBounds({params:{animate:e,scale:i,onCompleted:r},x0:c-50,x1:d+50,y0:u-50,y1:h+50}),this}loadPagingNodes(e){const o=this.getChartState();e.data._pagingButton=!1;const i=e.parent.data._pagingStep,r=o.pagingStep(e.parent),a=i+r;e.parent.data._pagingStep=a,this.updateNodesState()}setExpanded(e,o=!0){const i=this.getChartState(),r=i.allNodes.filter(({data:a})=>i.nodeId(a)==e)[0];if(!r)return console.log(`ORG CHART - ${o?"EXPAND":"COLLAPSE"} - Node with id (${e}) not found in the tree`),this;if(r.data._expanded=o,o==!1){const a=r.parent||{descendants:()=>[]};a.descendants().filter(s=>s!=a).forEach(s=>s.data._expanded=!1)}return this}setCentered(e){const o=this.getChartState(),i=o.generateRoot(o.data).descendants().filter(({data:r})=>o.nodeId(r).toString()==e.toString())[0];return i?(i.ancestors().forEach(r=>r.data._expanded=!0),i.data._centered=!0,i.data._expanded=!0,this):(console.log(`ORG CHART - CENTER - Node with id (${e}) not found in the tree`),this)}setHighlighted(e){const o=this.getChartState(),i=o.generateRoot(o.data).descendants().filter(r=>o.nodeId(r.data).toString()===e.toString())[0];return i?(i.ancestors().forEach(r=>r.data._expanded=!0),i.data._highlighted=!0,i.data._expanded=!0,i.data._centered=!0,this):(console.log(`ORG CHART - HIGHLIGHT - Node with id (${e}) not found in the tree`),this)}setUpToTheRootHighlighted(e){const o=this.getChartState(),i=o.generateRoot(o.data).descendants().filter(r=>o.nodeId(r.data).toString()===e.toString())[0];return i?(i.ancestors().forEach(r=>r.data._expanded=!0),i.data._upToTheRootHighlighted=!0,i.data._expanded=!0,i.ancestors().forEach(r=>r.data._upToTheRootHighlighted=!0),this):(console.log(`ORG CHART - HIGHLIGHTROOT - Node with id (${e}) not found in the tree`),this)}clearHighlighting(){const e=this.getChartState();return e.allNodes.forEach(o=>{o.data._highlighted=!1,o.data._upToTheRootHighlighted=!1}),this.update(e.root),this}fullscreen(e){const o=this.getChartState(),i=Pt.select(e||o.container).node();Pt.select(document).on("fullscreenchange."+o.id,function(r){(document.fullscreenElement||document.mozFullscreenElement||document.webkitFullscreenElement)==i?setTimeout(a=>{o.svg.attr("height",window.innerHeight-40)},500):o.svg.attr("height",o.svgHeight)}),i.requestFullscreen?i.requestFullscreen():i.mozRequestFullScreen?i.mozRequestFullScreen():i.webkitRequestFullscreen?i.webkitRequestFullscreen():i.msRequestFullscreen&&i.msRequestFullscreen()}zoomIn(){const{svg:e,zoomBehavior:o}=this.getChartState();e.transition().call(o.scaleBy,1.3)}zoomOut(){const{svg:e,zoomBehavior:o}=this.getChartState();e.transition().call(o.scaleBy,.78)}toDataURL(e,o){var i=new XMLHttpRequest;i.onload=function(){var r=new FileReader;r.onloadend=function(){o(r.result)},r.readAsDataURL(i.response)},i.open("GET",e),i.responseType="blob",i.send()}exportImg({full:e=!1,scale:o=3,onLoad:i=s=>s,save:r=!0,backgroundColor:a="#FAFAFA"}={}){const s=this,l=this.getChartState(),{svg:c,root:d}=l;let u=0;const h=c.selectAll("img");let f=h.size();const v=()=>{JSON.parse(JSON.stringify(s.lastTransform()));const _=s.duration();e&&s.fit();const{svg:b}=s.getChartState();setTimeout(C=>{s.downloadImage({node:b.node(),scale:o,isSvg:!1,backgroundColor:a,onAlreadySerialized:D=>{s.update(d)},imageName:l.imageName,onLoad:i,save:r})},e?_+10:0)};f>0?h.each(function(){s.toDataURL(this.src,_=>{this.src=_,++u==f&&v()})}):v()}exportSvg(){const{svg:e,imageName:o}=this.getChartState();return this.downloadImage({imageName:o,node:e.node(),scale:3,isSvg:!0}),this}expandAll(){const{allNodes:e,root:o,data:i}=this.getChartState();return i.forEach(r=>r._expanded=!0),this.render(),this}collapseAll(){const{allNodes:e,root:o}=this.getChartState();return e.forEach(i=>i.data._expanded=!1),this.initialExpandLevel(0),this.render(),this}downloadImage({node:e,scale:o=2,imageName:i="graph",isSvg:r=!1,save:a=!0,backgroundColor:s="#FAFAFA",onAlreadySerialized:l=d=>{},onLoad:c=d=>{}}){const d=e;function u(b,C){var D=document.createElement("a");typeof D.download=="string"?(document.body.appendChild(D),D.download=C,D.href=b,D.click(),document.body.removeChild(D)):location.replace(b)}function h(b){const C="http://www.w3.org/2000/xmlns/",D="http://www.w3.org/1999/xlink",L="http://www.w3.org/2000/svg";b=b.cloneNode(!0);const B=window.location.href+"#",X=document.createTreeWalker(b,NodeFilter.SHOW_ELEMENT,null,!1);for(;X.nextNode();)for(const nt of X.currentNode.attributes)nt.value.includes(B)&&(nt.value=nt.value.replace(B,"#"));return b.setAttributeNS(C,"xmlns",L),b.setAttributeNS(C,"xmlns:xlink",D),new XMLSerializer().serializeToString(b)}if(r){let b=h(d);b=`\r `+b;var _="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(b);u(_,i+".svg"),l();return}const f=o,v=document.createElement("img");v.onload=function(){const b=document.createElement("canvas"),C=d.getBoundingClientRect();b.width=C.width*f,b.height=C.height*f;const D=b.getContext("2d");D.fillStyle=s,D.fillRect(0,0,C.width*f,C.height*f),D.drawImage(v,0,0,C.width*f,C.height*f);let L=b.toDataURL("image/png");c&&c(L),a&&u(L,i+".png")};var _="data:image/svg+xml; charset=utf8, "+encodeURIComponent(h(d));l(),v.src=_}getTextWidth(e,{fontSize:o=14,fontWeight:i=400,defaultFont:r="Helvetice",ctx:a}={}){return a.font=`${i||""} ${o}px ${r} `,a.measureText(e).width}clear(){const e=this.getChartState();Pt.select(window).on(`resize.${e.id}`,null),e.svg&&e.svg.selectAll("*").remove()}};const eC={name:"ChartTemplate",components:{Avatar:In},props:{chartData:{type:Object,default:()=>{}},onAvatarClick:{type:Function,default:()=>{}}},computed:{selectedChart(){return this.$route.params.selectedChart}}},nC={class:"org-chart-node"},oC={class:"inner-box"},iC={class:"main-container"},rC={class:"fullName"},aC={class:"title"},sC={class:"description"},lC={key:0},cC={key:1};function dC(e,o,i,r,a,s){const l=k("Avatar"),c=k("router-link");return p(),w("div",nC,[I("div",oC,[A(c,{to:{name:"contact",params:{selectedGroup:s.selectedChart,selectedContact:i.chartData.key}}},{default:S(()=>[A(l,{"disable-tooltip":!0,"display-name":i.chartData.fullName,"is-no-user":!0,size:60,url:i.chartData.photoUrl,class:"org-chart-node__avatar"},null,8,["display-name","url"])]),_:1},8,["to"]),o[0]||(o[0]=I("div",{class:"panel"},null,-1)),I("div",iC,[I("h3",rC,O(i.chartData.fullName),1),I("h4",aC,O(i.chartData.title),1)]),I("div",sC,[i.chartData._directSubordinates?(p(),w("p",lC,O(e.t("contacts","Manages"))+": "+O(i.chartData._directSubordinates),1)):R("",!0),i.chartData._totalSubordinates?(p(),w("p",cC,O(e.t("contacts","Oversees"))+": "+O(i.chartData._totalSubordinates),1)):R("",!0)])])])}const uC=tt(eC,[["render",dC],["__scopeId","data-v-c955ad94"]]),hC={name:"OrgChart",components:{NcSelect:io},props:{data:{type:Array,default:()=>[]}},data(){return{chartReference:null,chart:0}},computed:{charts(){return this.data.map((e,o)=>{const i=e.find(r=>r.parentNodeId===null);return{id:o,label:i.org?`${i.org} (${i.fullName})`:i.fullName}}).sort((e,o)=>e.label.localeCompare(o.label,eg().replace("_","-"),{sensitivity:"base"}))},placeholder(){return t("contacts","Select chart …")}},watch:{data(){this.data[this.chart]?.length&&this.renderChart(this.data[this.chart])}},mounted(){this.data[this.chart]?.length&&this.renderChart(this.data[this.chart])},methods:{chartChanged(e){this.renderChart(this.data[e.id])},goToContact(e){this.$router.push({name:"contact",params:{selectedGroup:this.$route.params.selectedChart,selectedContact:e}})},renderChart(e){const o=this;this.chartReference||(this.chartReference=new tC),this.chartReference.container(this.$refs.svgElementContainer).data(e).nodeWidth(()=>250).initialZoom(1).nodeHeight(()=>200).childrenMargin(()=>70).compactMarginBetween(()=>15).compactMarginPair(()=>80).nodeContent(()=>"").nodeUpdate(function(i){const r=this.querySelector(".node-foreign-object-div");if(r)if(i.data.rendered)r.appendChild(i.data.rendered);else{const a=vh(uC,{chartData:i.data,onAvatarClick:l=>o.goToContact(l)});a.use(Cl),a.mixin(_h);const s=document.createElement("div");a.mount(s),i.data.rendered=s,r.appendChild(s)}Me(this).select(".inner-box").attr("class",a=>a.data._highlighted||a.data._upToTheRootHighlighted?"inner-box inner-box-highlight":"inner-box")}).linkUpdate(function(i){Me(this).attr("stroke",()=>"var(--color-primary-element)").attr("stroke-width",r=>r.data._upToTheRootHighlighted?2:1),i.data._upToTheRootHighlighted&&Me(this).raise()}).onNodeClick(i=>{this.chartReference.data().filter(r=>r.nodeId===i.id)[0]?._upToTheRootHighlighted?this.chartReference.clearHighlighting():(this.chartReference.clearHighlighting(),this.chartReference.setUpToTheRootHighlighted(i.id).render())}).render()}}},pC={class:"org-chart"},fC={key:0,class:"org-chart__menu"},mC={ref:"svgElementContainer",class:"org-chart__container"};function gC(e,o,i,r,a,s){const l=k("NcSelect");return p(),w("div",pC,[i.data.length>1?(p(),w("div",fC,[I("h3",null,O(e.t("contacts","Chart"))+": ",1),A(l,{modelValue:a.chart,"onUpdate:modelValue":[o[0]||(o[0]=c=>a.chart=c),s.chartChanged],class:"chart-selection",disabled:i.data.length===1,options:s.charts,"allow-empty":!1,searchable:!1,placeholder:s.placeholder,"input-id":"select-chart-input",label:"label"},null,8,["modelValue","disabled","options","placeholder","onUpdate:modelValue"])])):R("",!0),I("div",mC,null,512)])}const yC=tt(hC,[["render",gC]]),vC={name:"ChartContent",components:{AppContent:Pl,OrgChart:yC},props:{contactsList:{type:Object,required:!0}},data(){return{data:[],searchQuery:""}},computed:{transformData(){const e={},o=Object.keys(this.contactsList).map(s=>{const[l,c]=ze.from(s,"base64").toString("utf-8").split("~");return e[c]||(e[c]={}),e[c][l]=this.contactsList[s]}),i=[],r=o.filter(s=>s.managersName).reduce((s,l)=>{s.push(ls(l));const c=e[l.addressbook.id][l.managersName];return c&&!c.managersName&&!i.some(d=>d.nodeId===c.uid)&&(s.push(ls(c)),i.push(ls(c))),s},[]),a=i.map(s=>vm(r,s));return console.debug("Org charts",a.map((s,l)=>s.map(c=>`list ${l} ${c.nodeId} (${c.fullName}) -> ${c.parentNodeId}`))),a}}};function _C(e,o,i,r,a,s){const l=k("OrgChart"),c=k("AppContent");return p(),N(c,null,{default:S(()=>[A(l,{data:s.transformData},null,8,["data"])]),_:1})}const bC=tt(vC,[["render",_C]]),CC={name:"AccountGroupOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},kC=["aria-hidden","aria-label"],wC=["fill","width","height"],SC={d:"M12,5A3.5,3.5 0 0,0 8.5,8.5A3.5,3.5 0 0,0 12,12A3.5,3.5 0 0,0 15.5,8.5A3.5,3.5 0 0,0 12,5M12,7A1.5,1.5 0 0,1 13.5,8.5A1.5,1.5 0 0,1 12,10A1.5,1.5 0 0,1 10.5,8.5A1.5,1.5 0 0,1 12,7M5.5,8A2.5,2.5 0 0,0 3,10.5C3,11.44 3.53,12.25 4.29,12.68C4.65,12.88 5.06,13 5.5,13C5.94,13 6.35,12.88 6.71,12.68C7.08,12.47 7.39,12.17 7.62,11.81C6.89,10.86 6.5,9.7 6.5,8.5C6.5,8.41 6.5,8.31 6.5,8.22C6.2,8.08 5.86,8 5.5,8M18.5,8C18.14,8 17.8,8.08 17.5,8.22C17.5,8.31 17.5,8.41 17.5,8.5C17.5,9.7 17.11,10.86 16.38,11.81C16.5,12 16.63,12.15 16.78,12.3C16.94,12.45 17.1,12.58 17.29,12.68C17.65,12.88 18.06,13 18.5,13C18.94,13 19.35,12.88 19.71,12.68C20.47,12.25 21,11.44 21,10.5A2.5,2.5 0 0,0 18.5,8M12,14C9.66,14 5,15.17 5,17.5V19H19V17.5C19,15.17 14.34,14 12,14M4.71,14.55C2.78,14.78 0,15.76 0,17.5V19H3V17.07C3,16.06 3.69,15.22 4.71,14.55M19.29,14.55C20.31,15.22 21,16.06 21,17.07V19H24V17.5C24,15.76 21.22,14.78 19.29,14.55M12,16C13.53,16 15.24,16.5 16.23,17H7.77C8.76,16.5 10.47,16 12,16Z"},xC={key:0};function EC(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon account-group-outline-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",SC,[i.title?(p(),w("title",xC,O(i.title),1)):R("",!0)])],8,wC))],16,kC)}const Ea=tt(CC,[["render",EC]]),MC={name:"AccountPlusOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},AC=["aria-hidden","aria-label"],NC=["fill","width","height"],TC={d:"M15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4M15,5.9C16.16,5.9 17.1,6.84 17.1,8C17.1,9.16 16.16,10.1 15,10.1A2.1,2.1 0 0,1 12.9,8A2.1,2.1 0 0,1 15,5.9M4,7V10H1V12H4V15H6V12H9V10H6V7H4M15,13C12.33,13 7,14.33 7,17V20H23V17C23,14.33 17.67,13 15,13M15,14.9C17.97,14.9 21.1,16.36 21.1,17V18.1H8.9V17C8.9,16.36 12,14.9 15,14.9Z"},IC={key:0};function LC(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon account-plus-outline-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",TC,[i.title?(p(),w("title",IC,O(i.title),1)):R("",!0)])],8,NC))],16,AC)}const lp=tt(MC,[["render",LC]]),DC={name:"BookOpenPageVariantIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},PC=["aria-hidden","aria-label"],RC=["fill","width","height"],BC={d:"M19 2L14 6.5V17.5L19 13V2M6.5 5C4.55 5 2.45 5.4 1 6.5V21.16C1 21.41 1.25 21.66 1.5 21.66C1.6 21.66 1.65 21.59 1.75 21.59C3.1 20.94 5.05 20.5 6.5 20.5C8.45 20.5 10.55 20.9 12 22C13.35 21.15 15.8 20.5 17.5 20.5C19.15 20.5 20.85 20.81 22.25 21.56C22.35 21.61 22.4 21.59 22.5 21.59C22.75 21.59 23 21.34 23 21.09V6.5C22.4 6.05 21.75 5.75 21 5.5V19C19.9 18.65 18.7 18.5 17.5 18.5C15.8 18.5 13.35 19.15 12 20V6.5C10.55 5.4 8.45 5 6.5 5Z"},$C={key:0};function VC(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon book-open-page-variant-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",BC,[i.title?(p(),w("title",$C,O(i.title),1)):R("",!0)])],8,RC))],16,PC)}const UC=tt(DC,[["render",VC]]),zC={name:"CalendarOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},HC=["aria-hidden","aria-label"],GC=["fill","width","height"],YC={d:"M12 12H17V17H12V12M19 3H18V1H16V3H8V1H6V3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3M19 5V7H5V5H19M5 19V9H19V19H5Z"},FC={key:0};function XC(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon calendar-outline-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",YC,[i.title?(p(),w("title",FC,O(i.title),1)):R("",!0)])],8,GC))],16,HC)}const WC=tt(zC,[["render",XC]]),jC={name:"CheckIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},qC=["aria-hidden","aria-label"],ZC=["fill","width","height"],JC={d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},KC={key:0};function QC(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon check-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",JC,[i.title?(p(),w("title",KC,O(i.title),1)):R("",!0)])],8,ZC))],16,qC)}const Ma=tt(jC,[["render",QC]]),tk={name:"CogOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ek=["aria-hidden","aria-label"],nk=["fill","width","height"],ok={d:"M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M10,22C9.75,22 9.54,21.82 9.5,21.58L9.13,18.93C8.5,18.68 7.96,18.34 7.44,17.94L4.95,18.95C4.73,19.03 4.46,18.95 4.34,18.73L2.34,15.27C2.21,15.05 2.27,14.78 2.46,14.63L4.57,12.97L4.5,12L4.57,11L2.46,9.37C2.27,9.22 2.21,8.95 2.34,8.73L4.34,5.27C4.46,5.05 4.73,4.96 4.95,5.05L7.44,6.05C7.96,5.66 8.5,5.32 9.13,5.07L9.5,2.42C9.54,2.18 9.75,2 10,2H14C14.25,2 14.46,2.18 14.5,2.42L14.87,5.07C15.5,5.32 16.04,5.66 16.56,6.05L19.05,5.05C19.27,4.96 19.54,5.05 19.66,5.27L21.66,8.73C21.79,8.95 21.73,9.22 21.54,9.37L19.43,11L19.5,12L19.43,13L21.54,14.63C21.73,14.78 21.79,15.05 21.66,15.27L19.66,18.73C19.54,18.95 19.27,19.04 19.05,18.95L16.56,17.95C16.04,18.34 15.5,18.68 14.87,18.93L14.5,21.58C14.46,21.82 14.25,22 14,22H10M11.25,4L10.88,6.61C9.68,6.86 8.62,7.5 7.85,8.39L5.44,7.35L4.69,8.65L6.8,10.2C6.4,11.37 6.4,12.64 6.8,13.8L4.68,15.36L5.43,16.66L7.86,15.62C8.63,16.5 9.68,17.14 10.87,17.38L11.24,20H12.76L13.13,17.39C14.32,17.14 15.37,16.5 16.14,15.62L18.57,16.66L19.32,15.36L17.2,13.81C17.6,12.64 17.6,11.37 17.2,10.2L19.31,8.65L18.56,7.35L16.15,8.39C15.38,7.5 14.32,6.86 13.12,6.62L12.75,4H11.25Z"},ik={key:0};function rk(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon cog-outline-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",ok,[i.title?(p(),w("title",ik,O(i.title),1)):R("",!0)])],8,nk))],16,ek)}const Jl=tt(tk,[["render",rk]]),ak={name:"FileDocumentOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},sk=["aria-hidden","aria-label"],lk=["fill","width","height"],ck={d:"M6,2A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6M6,4H13V9H18V20H6V4M8,12V14H16V12H8M8,16V18H13V16H8Z"},dk={key:0};function uk(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon file-document-outline-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",ck,[i.title?(p(),w("title",dk,O(i.title),1)):R("",!0)])],8,lk))],16,sk)}const hk=tt(ak,[["render",uk]]),pk={name:"FolderOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},fk=["aria-hidden","aria-label"],mk=["fill","width","height"],gk={d:"M20,18H4V8H20M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z"},yk={key:0};function vk(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon folder-outline-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",gk,[i.title?(p(),w("title",yk,O(i.title),1)):R("",!0)])],8,mk))],16,fk)}const Kl=tt(pk,[["render",vk]]),_k={name:"LoginIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},bk=["aria-hidden","aria-label"],Ck=["fill","width","height"],kk={d:"M11 7L9.6 8.4L12.2 11H2V13H12.2L9.6 15.6L11 17L16 12L11 7M20 19H12V21H20C21.1 21 22 20.1 22 19V5C22 3.9 21.1 3 20 3H12V5H20V19Z"},wk={key:0};function Sk(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon login-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",kk,[i.title?(p(),w("title",wk,O(i.title),1)):R("",!0)])],8,Ck))],16,bk)}const xk=tt(_k,[["render",Sk]]),Ek={name:"LogoutIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Mk=["aria-hidden","aria-label"],Ak=["fill","width","height"],Nk={d:"M17 7L15.59 8.41L18.17 11H8V13H18.17L15.59 15.58L17 17L22 12M4 5H12V3H4C2.9 3 2 3.9 2 5V19C2 20.1 2.9 21 4 21H12V19H4V5Z"},Tk={key:0};function Ik(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon logout-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",Nk,[i.title?(p(),w("title",Tk,O(i.title),1)):R("",!0)])],8,Ak))],16,Mk)}const cp=tt(Ek,[["render",Ik]]),Ok={name:"MessageOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Lk=["aria-hidden","aria-label"],Dk=["fill","width","height"],Pk={d:"M20 2H4C2.9 2 2 2.9 2 4V22L6 18H20C21.1 18 22 17.1 22 16V4C22 2.9 21.1 2 20 2M20 16H5.2L4 17.2V4H20V16Z"},Rk={key:0};function Bk(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon message-outline-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",Pk,[i.title?(p(),w("title",Rk,O(i.title),1)):R("",!0)])],8,Dk))],16,Lk)}const $k=tt(Ok,[["render",Bk]]),Vk={name:"ViewDashboardIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Uk=["aria-hidden","aria-label"],zk=["fill","width","height"],Hk={d:"M13,3V9H21V3M13,21H21V11H13M3,21H11V15H3M3,13H11V3H3V13Z"},Gk={key:0};function Yk(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon view-dashboard-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",Hk,[i.title?(p(),w("title",Gk,O(i.title),1)):R("",!0)])],8,zk))],16,Uk)}const Fk=tt(Vk,[["render",Yk]]),_i="enforce_password",bi="password_single_enabled",hr="password_single",Xk={name:"CirclePasswordSettings",components:{CheckboxRadioSwitch:ba,NcButton:Kt},props:{circle:{type:Object,required:!0}},data(){return{ENFORCE_PASSWORD_PROTECTION:_i,USE_UNIQUE_PASSWORD:bi,UNIQUE_PASSWORD:hr,loading:[],uniquePassword:"",uniquePasswordError:!1,showUniquePasswordInput:!1}},computed:{circleId(){return this.circle._data.id},enforcePasswordProtection(){const e=this.circle._data.settings[_i];return e==="1"||e==="true"},useUniquePassword(){const e=this.circle._data.settings[bi];return e==="1"||e==="true"}},methods:{async changePasswordProtection(){this.loading.push(_i);try{const e=!this.enforcePasswordProtection;!e&&this.useUniquePassword&&await this.saveUseUniquePassword(!1),!e&&this.showUniquePasswordInput&&(this.showUniquePasswordInput=!1),await this.$store.dispatch("editCircleSetting",{circleId:this.circleId,setting:{setting:_i,value:e.toString()}})}finally{this.loading=this.loading.filter(e=>e!==_i)}},async changeUseUniquePassword(){if(!this.useUniquePassword){this.showUniquePasswordInput=!this.showUniquePasswordInput;return}await this.saveUseUniquePassword(!this.useUniquePassword)},async saveUseUniquePassword(e){this.loading.push(bi);try{await this.$store.dispatch("editCircleSetting",{circleId:this.circleId,setting:{setting:bi,value:e.toString()}}),e||(this.uniquePassword="",this.showUniquePasswordInput=!1)}finally{this.loading=this.loading.filter(o=>o!==bi)}},async saveUniquePassword(){if(this.uniquePassword.length!==0){this.loading.push(hr),this.uniquePasswordError=!1;try{this.useUniquePassword||await this.saveUseUniquePassword(!0),await this.$store.dispatch("editCircleSetting",{circleId:this.circleId,setting:{setting:hr,value:this.uniquePassword}}),this.showUniquePasswordInput=!1,this.uniquePassword=""}catch{this.uniquePasswordError=!0}finally{this.loading=this.loading.filter(e=>e!==hr)}}},onClickChangePassword(){this.showUniquePasswordInput=!0}}},Wk={class:"circle-config"},jk={class:"circle-config__list"},qk={class:"unique-password"},Zk=["disabled","placeholder"],Jk={key:2,class:"unique-password-error"};function Kk(e,o,i,r,a,s){const l=k("CheckboxRadioSwitch"),c=k("NcButton");return p(),w("ul",null,[I("li",Wk,[I("ul",jk,[A(l,{"model-value":s.enforcePasswordProtection,loading:a.loading.includes(a.ENFORCE_PASSWORD_PROTECTION),disabled:a.loading.length>0,"wrapper-element":"li","onUpdate:modelValue":s.changePasswordProtection},{default:S(()=>[q(O(e.t("contacts","Enforce password protection on files shared to this team")),1)]),_:1},8,["model-value","loading","disabled","onUpdate:modelValue"]),s.enforcePasswordProtection?(p(),N(l,{key:0,"model-value":s.useUniquePassword||a.showUniquePasswordInput,loading:a.loading.includes(a.USE_UNIQUE_PASSWORD),disabled:a.loading.length>0,"wrapper-element":"li","onUpdate:modelValue":s.changeUseUniquePassword},{default:S(()=>[q(O(e.t("contacts","Use a unique password for all shares to this team")),1)]),_:1},8,["model-value","loading","disabled","onUpdate:modelValue"])):R("",!0),I("li",qk,[a.showUniquePasswordInput?(p(),w(mt,{key:0},[Ve(I("input",{"onUpdate:modelValue":o[0]||(o[0]=d=>a.uniquePassword=d),disabled:a.loading.length>0,placeholder:e.t("contacts","Unique password …"),type:"text",onKeyup:o[1]||(o[1]=Al((...d)=>s.saveUniquePassword&&s.saveUniquePassword(...d),["enter"]))},null,40,Zk),[[zo,a.uniquePassword]]),A(c,{variant:"tertiary-no-background",disabled:a.loading.length>0||a.uniquePassword.length===0,onClick:s.saveUniquePassword},{default:S(()=>[q(O(e.t("contacts","Save")),1)]),_:1},8,["disabled","onClick"])],64)):s.useUniquePassword?(p(),N(c,{key:1,class:"change-unique-password",onClick:s.onClickChangePassword},{default:S(()=>[q(O(e.t("contacts","Change unique password")),1)]),_:1},8,["onClick"])):R("",!0),a.uniquePasswordError?(p(),w("div",Jk,O(e.t("contacts","Failed to save password. Please try again later.")),1)):R("",!0)])])])])}const Qk=tt(Xk,[["render",Kk],["__scopeId","data-v-93191071"]]),tw={name:"ContentHeading",props:{loading:{type:Boolean,default:!1}}},ew={class:"app-content-heading"},nw={key:0,class:"app-content-heading__loader icon-loading-small"};function ow(e,o,i,r,a,s){return p(),w("h3",ew,[At(e.$slots,"default",{},void 0,!0),i.loading?(p(),w("div",nw)):R("",!0)])}const dp=tt(tw,[["render",ow],["__scopeId","data-v-614dccab"]]),iw=Te({name:"CircleSettings",components:{ContentHeading:dp,CirclePasswordSettings:Qk,IconDelete:Tn,IconLogout:cp,NcButton:Kt,NcCheckboxRadioSwitch:ba},props:{circle:{type:Object,required:!0}},emits:["leave","delete"],setup(){return{t:Ai}},data(){return{PUBLIC_CIRCLE_CONFIG:_m,loading:!1}},methods:{isChecked(e){return(this.circle.config&e)!==0},async onChange(e,o){this.logger.debug(`Circle config ${e} is set to ${o}`),this.loading=e;const i=this.circle.config;o?e=i|e:e=i&~e;try{const r=await Ds(this.circle.id,Ps.Config,e);this.circle.config=r.config}catch(r){this.logger.error("Unable to edit circle config",{prevConfig:i,config:e,error:r}),yt(Ai("contacts","An error happened during the config change"))}finally{this.loading=!1}}}}),rw={class:"circle-settings"},aw={class:"circle-config__list"};function sw(e,o,i,r,a,s){const l=k("ContentHeading"),c=k("NcCheckboxRadioSwitch"),d=k("CirclePasswordSettings"),u=k("IconLogout"),h=k("NcButton"),f=k("IconDelete");return p(),w("div",rw,[I("ul",null,[(p(!0),w(mt,null,Dt(e.PUBLIC_CIRCLE_CONFIG,(v,_)=>(p(),w("li",{key:_,class:"circle-config"},[A(l,{class:"circle-config__title"},{default:S(()=>[q(O(_),1)]),_:2},1024),I("ul",aw,[(p(!0),w(mt,null,Dt(v,(b,C)=>(p(),N(c,{key:"circle-config"+C,"model-value":e.isChecked(C),loading:e.loading===C,disabled:e.loading!==!1,"wrapper-element":"li","onUpdate:modelValue":D=>e.onChange(C,D)},{default:S(()=>[q(O(b),1)]),_:2},1032,["model-value","loading","disabled","onUpdate:modelValue"]))),128))])]))),128))]),A(d,{circle:e.circle},null,8,["circle"]),e.circle.canLeave?(p(),N(h,{key:0,variant:"warning",onClick:o[0]||(o[0]=v=>e.$emit("leave"))},{icon:S(()=>[A(u,{size:16})]),default:S(()=>[q(" "+O(e.t("contacts","Leave team")),1)]),_:1})):R("",!0),e.circle.canDelete?(p(),N(h,{key:1,variant:"error",href:"#",onClick:o[1]||(o[1]=Zt(v=>e.$emit("delete"),["prevent","stop"]))},{icon:S(()=>[A(f,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Delete team")),1)]),_:1})):R("",!0)])}const lw=tt(iw,[["render",sw],["__scopeId","data-v-4ec5ee61"]]),cw={name:"CloseIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},dw=["aria-hidden","aria-label"],uw=["fill","width","height"],hw={d:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"},pw={key:0};function fw(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon close-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",hw,[i.title?(p(),w("title",pw,O(i.title),1)):R("",!0)])],8,uw))],16,dw)}const mw=tt(cw,[["render",fw]]),gw={name:"TeamResourceButton",components:{NcButton:Kt,NcNoteCard:ma,NcPopover:Dl,NcTextField:Rl,CloseOutlineIcon:mw,CheckOutlineIcon:Ma},props:{resourceType:{type:Object,required:!0},value:{type:String,default:""},isOpen:{type:Boolean,default:!1}},emits:["update:value","update:isOpen","create"],computed:{inputValue(){return this.value},isPopoverOpen:{get(){return this.isOpen},set(e){this.$emit("update:isOpen",e)}},canCreate(){if(this.resourceType.noInput)return this.resourceType.enabled!==!1;const e=this.inputValue;return typeof e=="string"&&e.trim().length>0&&this.resourceType.enabled!==!1}},methods:{openPopover(){this.resourceType.noInput?this.createResource():this.isPopoverOpen=!0},closePopover(){this.isPopoverOpen=!1},handlePopoverToggle(e){this.isPopoverOpen=e},updateInput(e){const o=typeof e=="string"?e:e?.target?.value||e?.value||"";this.$emit("update:value",o)},createResource(){if(this.canCreate)if(this.resourceType.noInput)this.$emit("create",{resourceType:this.resourceType,name:""});else{const e=this.inputValue,o=typeof e=="string"?e.trim():"";o&&this.$emit("create",{resourceType:this.resourceType,name:o})}}}},yw={key:0,class:"resource-creation-popover"},vw={class:"popover-content"},_w={class:"popover-actions"},bw={key:0,class:"popover-helper-text"};function Cw(e,o,i,r,a,s){const l=k("NcButton"),c=k("NcTextField"),d=k("CloseOutlineIcon"),u=k("CheckOutlineIcon"),h=k("NcNoteCard"),f=k("NcPopover");return p(),N(f,{shown:s.isPopoverOpen,"popup-role":"dialog","onUpdate:shown":s.handlePopoverToggle},{trigger:S(()=>[A(l,{variant:"secondary","aria-describedby":`tooltip-${i.resourceType.id}`,onClick:s.openPopover},{icon:S(()=>[At(e.$slots,"icon",{},void 0,!0)]),default:S(()=>[q(" "+O(i.resourceType.label),1)]),_:3},8,["aria-describedby","onClick"])]),default:S(()=>[i.resourceType.noInput?R("",!0):(p(),w("div",yw,[I("div",vw,[A(c,{"model-value":s.inputValue,placeholder:i.resourceType.placeholder,label:i.resourceType.inputLabel,"onUpdate:value":s.updateInput,onInput:s.updateInput},null,8,["model-value","placeholder","label","onUpdate:value","onInput"]),I("div",_w,[A(l,{variant:"secondary","aria-label":e.t("contacts","Close"),onClick:s.closePopover},{icon:S(()=>[A(d,{size:20})]),_:1},8,["aria-label","onClick"]),A(l,{variant:"primary","aria-label":e.t("contacts","Save"),disabled:!s.canCreate,onClick:s.createResource},{icon:S(()=>[A(u,{size:20})]),_:1},8,["aria-label","disabled","onClick"])])]),i.resourceType.helperText?(p(),w("div",bw,[A(h,{type:"info"},{default:S(()=>[q(O(i.resourceType.helperText),1)]),_:1})])):R("",!0)]))]),_:3},8,["shown","onUpdate:shown"])}const kw=tt(gw,[["render",Cw],["__scopeId","data-v-d459b596"]]),$i=null,{min:yo,max:Xe,abs:Qd,floor:ww}=Math,up=(e,o,i)=>yo(i,Xe(o,e)),hp=e=>[...e].sort((o,i)=>o-i),Sw=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)},Ks=()=>{let e;return[new Promise(o=>{e=o}),e]},pp=e=>{let o;return()=>(e&&(o=e(),e=void 0),o)},Ti=(e,o,i)=>{const r=i?"unshift":"push";for(let a=0;a{const i=e.t[o];return i===-1?e.o:i},xw=(e,o,i)=>{const r=e.t[o]===-1;return e.t[o]=i,e.i=yo(o,e.i),r},Tr=(e,o)=>{if(!e.l)return 0;if(e.i>=o)return e.u[o];e.i<0&&(e.u[0]=0,e.i=0);let i=e.i,r=e.u[i];for(;i{let a=i;for(;i<=r;){const s=ww((i+r)/2);Tr(e,s)<=o?(a=s,i=s+1):r=s-1}return up(a,0,e.l-1)},tu=(e,o,i)=>{const r=o-e.l;return e.i=i?-1:yo(o-1,e.i),e.l=o,r>0?(Ti(e.u,r),Ti(e.t,r,i),e.o*r):(e.u.splice(r),(i?e.t.splice(0,-r):e.t.splice(r)).reduce((a,s)=>a-(s===-1?e.o:s),0))},Ew=e=>e.documentElement,Mw=e=>e.ownerDocument,Aw=e=>e.defaultView,mp=pp(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>0),Nw=pp(()=>"scrollBehavior"in Ew(document).style),Tw=(e,o=40,i=0,r,a=!1)=>{let s=!!i,l=1,c=0,d=0,u=0,h=0,f=0,v=0,_=0,b=0,C=$i,D=[0,s?Xe(i-1,0):-1],L=0,B=!1;const X=((U,M,z)=>({o:M,t:z?Ti(z.slice(0,yo(U,z.length)),Xe(0,U-z.length)):Ti([],U),l:U,i:-1,u:Ti([],U+1)}))(e,r?r[1]:o,r&&r[0]),nt=new Set,Z=()=>u-d,rt=()=>Z()+f+h,st=(U,M)=>((z,H,et,dt)=>{if(dt=yo(dt,z.l-1),Tr(z,dt)<=H){const ct=Do(z,et,dt);return[Do(z,H,dt,ct),ct]}{const ct=Do(z,H,void 0,dt);return[ct,Do(z,et,ct)]}})(X,U,M,D[0]),J=()=>Tr(X,X.l),ot=(U,M)=>{const z=Tr(X,U)-f;return M?J()-z-lt(U):z},lt=U=>fp(X,U),T=(U,M=-1)=>X.t[U]===M,V=U=>{U&&(mp()&&_!==0||C&&b===1?f+=U:h+=U)};return{p:()=>{nt.clear()},h:()=>l,m:()=>(U=>[U.t.slice(),U.o])(X),v:(U=200)=>{if(!B||s)return D;let M,z;if(v)[M,z]=D;else{let H=Xe(0,rt()),et=H+c;a||(U=Xe(0,U),_!==1&&(H-=U),_!==2&&(et+=U)),[M,z]=D=st(Xe(0,H),Xe(0,et)),C&&(M=yo(M,C[0]),z=Xe(z,C[1]))}return[Xe(M,0),yo(z,X.l-1)]},S:U=>Do(X,U-d),I:T,O:ot,k:lt,j:()=>X.l,N:()=>u,B:()=>_!==0,T:()=>c,q:()=>d,M:J,P:()=>(v=h,h=0,[v,b===2]),R:(U,M)=>{const z=[U,M];return nt.add(z),()=>{nt.delete(z)}},A:(U,M)=>{let z,H,et=0;switch(U){case 1:{if(M===u&&b===0)break;const dt=v;v=0;const ct=M-u,F=Qd(ct);dt&&F=-c&&ft<=J()&&(et+=1,H=F>c);break}case 2:et=8,_!==0&&(z=!0,et+=1),_=0,b=0,C=$i;break;case 3:{const dt=M.filter(([ct,F])=>!T(ct,F));if(!dt.length)break;V(dt.reduce((ct,[F,ft])=>((b===2||(C&&b===1?Fc&&(V(((ct,F)=>{let ft=0;const Mt=[];ct.t.forEach((ve,Rn)=>{ve!==-1&&(Mt.push(ve),Rn{et&dt&&ct(H)}))}}},Ql=setTimeout,vs=(e,o)=>o?-e:e,Iw=(e,o,i,r,a,s)=>{const l=Date.now;let c=0,d=!1,u=!1,h=!1,f=!1;const v=(()=>{let L;const B=()=>{L!=$i&&clearTimeout(L)},X=()=>{B(),L=Ql(()=>{L=$i,(()=>{if(d||u)return d=!1,void v();h=!1,e.A(2)})()},150)};return X.C=B,X})(),_=()=>{c=l(),h&&(f=!0),e.A(1,r()),v()},b=L=>{if(d||!e.B()||L.ctrlKey)return;const B=l()-c;150>B&&50{u=!0,h=f=!1},D=()=>{u=!1,mp()&&(h=!0)};return o.addEventListener("scroll",_),o.addEventListener("wheel",b,{passive:!0}),o.addEventListener("touchstart",C,{passive:!0}),o.addEventListener("touchend",D,{passive:!0}),{H:()=>{o.removeEventListener("scroll",_),o.removeEventListener("wheel",b),o.removeEventListener("touchstart",C),o.removeEventListener("touchend",D),v.C()},V:()=>{const[L,B]=e.P();L&&(a(L,B,f),f=!1,B&&e.T()>e.M()&&e.A(1,r()))}}},Ow=(e,o,i)=>{let r;return[async(a,s)=>{if(!await o())return;r&&r();const l=()=>{const[c,d]=Ks();return r=()=>{d(!1)},e.T()&&Ql(r,150),[c,e.R(2,()=>{d(!0)})]};if(s&&Nw())e.A(8,a()),Sw(async()=>{for(;;){let c=!0;for(let[h,f]=e.v();h<=f;h++)if(e.I(h)){c=!1;break}if(c)break;const[d,u]=l();try{if(!await d)return}finally{u()}}e.A(7),i(a(),s)});else for(;;){const[c,d]=l();try{if(e.A(7),i(a()),!await c)return}finally{d()}}},()=>{r&&r()}]},Lw=e=>{let o;return{F(i){(o||(o=new(Aw(Mw(i))).ResizeObserver(e))).observe(i)},J(i){o.unobserve(i)},H(){o&&o.disconnect()}}},Dw=Te({props:{L:{type:Object,required:!0},W:{type:Object,required:!0},X:{type:Object,required:!0},Y:{type:Function,required:!0},D:{type:Number,required:!0},U:{type:Boolean},G:{type:Boolean},K:{type:Boolean},Z:{type:String,required:!0},ee:Object},setup(e){const o=qo(),i=be(()=>e.L.value&&e.W.O(e.D,e.K)),r=be(()=>e.L.value&&e.W.I(e.D));return kn(()=>o.value&&e.D,(a,s,l)=>{l(e.Y(o.value,e.D))},{flush:"post"}),()=>{var a;const{X:s,U:l,G:c,Z:d}=e,u=r.value,{style:h,...f}=(a=e.ee)!==null&&a!==void 0?a:{},v={contain:"layout style",position:u&&c?void 0:"absolute",[l?"height":"width"]:"100%",[l?"top":"left"]:"0px",[l?"left":"top"]:i.value+"px",visibility:!u||c?void 0:"hidden",...h};return l&&(v.display="inline-flex"),A(d,ht({ref:o,style:v},f),typeof(_=s)=="function"||Object.prototype.toString.call(_)==="[object Object]"&&!Tl(_)?s:{default:()=>[s],_:2},16,["style"]);var _}}}),Pw=(e,o)=>e.key??"_"+o,Rw=(e,o)=>e[0]===o[0]&&e[1]===o[1],Bw=Te({props:{data:{type:Array,required:!0},bufferSize:Number,itemSize:Number,shift:Boolean,horizontal:Boolean,startMargin:{type:Number,default:0},ssrCount:Number,scrollRef:Object,as:{type:String,default:"div"},item:{type:String,default:"div"},itemProps:Function,keepMounted:Array,cache:Object},emits:["scroll","scrollEnd"],setup(e,{emit:o,expose:i,slots:r}){let a=!!e.ssrCount;const s=e.horizontal,l=qo(),c=Tw(e.data.length,e.itemSize,e.ssrCount,e.cache,!e.itemSize),d=((b,C)=>{let D;const L=C?"width":"height",B=new WeakMap,X=Lw(nt=>{const Z=[];for(const{target:rt,contentRect:st}of nt)if(rt.offsetParent)if(rt===D)b.A(4,st[L]);else{const J=B.get(rt);J!=$i&&Z.push([J,st[L]])}Z.length&&b.A(3,Z)});return{te(nt){X.F(D=nt)},re:(nt,Z)=>(B.set(nt,Z),X.F(nt),()=>{B.delete(nt),X.J(nt)}),p:X.H}})(c,s),u=((b,C)=>{let D,L,B=Ks(),X=!1;const nt=C?"scrollLeft":"scrollTop",Z=C?"overflowX":"overflowY",[rt,st]=Ow(b,()=>B[0],(J,ot)=>{J=vs(J,X),ot?D.scrollTo({[C?"left":"top"]:J,behavior:"smooth"}):D[nt]=J});return{oe(J){D=J,C&&(X=getComputedStyle(J).direction==="rtl"),L=Iw(b,J,C,()=>vs(J[nt],X),(ot,lt,T)=>{if(T){const V=J.style,U=V[Z];V[Z]="hidden",Ql(()=>{V[Z]=U})}J[nt]=vs(b.N()+ot,X),lt&&st()}),B[1](!0)},p(){L&&L.H(),B[1](!1),B=Ks()},ne:()=>X,se(J){rt(()=>J)},ie(J){J+=b.N(),rt(()=>J)},le(J,{align:ot,smooth:lt,offset:T=0}={}){if(J=up(J,0,b.j()-1),ot==="nearest"){const V=b.O(J),U=b.N();if(VU+b.T()))return;ot="end"}}rt(()=>T+b.q()+b.O(J)+(ot==="end"?b.k(J)-b.T():ot==="center"?(b.k(J)-b.T())/2:0),lt)},ce:()=>{L&&L.V()}}})(c,s),h=qo(c.h());c.R(1,()=>{h.value=c.h()}),c.R(4,()=>{o("scroll",c.N())}),c.R(8,()=>{o("scrollEnd")});const f=be(b=>{h.value;const C=c.v(e.bufferSize);return b&&Rw(b,C)?b:C}),v=be(()=>h.value&&c.B()),_=be(()=>h.value&&c.M());return gh(()=>{a=!1;const b=requestAnimationFrame(()=>{const C=D=>{d.te(D),u.oe(D)};e.scrollRef?C(e.scrollRef):C(l.value.parentElement)});Md(()=>{cancelAnimationFrame(b)})}),Md(()=>{c.p(),d.p(),u.p()}),kn(()=>e.data.length,b=>{c.A(5,[b,e.shift])}),kn(()=>e.startMargin,b=>{c.A(6,b)},{immediate:!0}),kn([h],()=>{u.ce()},{flush:"post"}),i({get cache(){return c.m()},get scrollOffset(){return c.N()},get scrollSize(){return(b=>Xe(b.M(),b.T()))(c)},get viewportSize(){return c.T()},findItemIndex:c.S,getItemOffset:c.O,getItemSize:c.k,scrollToIndex:u.le,scrollTo:u.se,scrollBy:u.ie}),()=>{const b=e.as,C=e.item,D=_.value,L=u.ne(),B=!s&&L?"unshift":"push",X=[],nt=rt=>{var st;const J=r.default({item:e.data[rt],index:rt})[0];return A(Dw,{key:Pw(J,rt),L:h,W:c,Y:d.re,D:rt,X:J,U:s,K:L,G:a,Z:C,ee:(st=e.itemProps)===null||st===void 0?void 0:st.call(e,{item:e.data[rt],index:rt})},null,8,["L","W","Y","D","X","U","K","G","Z","ee"])};if(e.keepMounted){const rt=new Set(e.keepMounted);for(let[st,J]=f.value;st<=J;st++)rt.add(st);hp([...rt]).forEach(st=>{X[B](nt(st))})}else for(let[rt,st]=f.value;rt<=st;rt++)X[B](nt(rt));return A(b,{ref:l,style:{contain:"size style",overflowAnchor:"none",flex:"none",position:"relative",width:s?D+"px":"100%",height:s?"100%":D+"px",pointerEvents:v.value?"none":void 0}},typeof(Z=X)=="function"||Object.prototype.toString.call(Z)==="[object Object]"&&!Tl(Z)?X:{default:()=>[X],_:2},8,["style"]);var Z}}}),gp=Te({props:{data:{type:Array,required:!0},bufferSize:Number,itemSize:Number,shift:Boolean,horizontal:Boolean,ssrCount:Number,itemProps:Function,keepMounted:Array,cache:Object},emits:["scroll","scrollEnd"],setup(e,{emit:o,expose:i,slots:r}){const a=e.horizontal,s=d=>{o("scroll",d)},l=()=>{o("scrollEnd")},c=qo();return i({get cache(){return c.value.cache},get scrollOffset(){return c.value.scrollOffset},get scrollSize(){return c.value.scrollSize},get viewportSize(){return c.value.viewportSize},findItemIndex:(...d)=>c.value.findItemIndex(...d),getItemOffset:(...d)=>c.value.getItemOffset(...d),getItemSize:(...d)=>c.value.getItemSize(...d),scrollToIndex:(...d)=>c.value.scrollToIndex(...d),scrollTo:(...d)=>c.value.scrollTo(...d),scrollBy:(...d)=>c.value.scrollBy(...d)}),()=>{return A("div",{style:{display:a?"inline-block":"block",[a?"overflowX":"overflowY"]:"auto",contain:"strict",width:"100%",height:"100%"}},[A(Bw,{ref:c,data:e.data,bufferSize:e.bufferSize,itemSize:e.itemSize,itemProps:e.itemProps,shift:e.shift,ssrCount:e.ssrCount,horizontal:a,keepMounted:e.keepMounted,cache:e.cache,onScroll:s,onScrollEnd:l},(d=r,typeof d=="function"||Object.prototype.toString.call(d)==="[object Object]"&&!Tl(d)?r:{default:()=>[r],_:2}),8,["data","bufferSize","itemSize","itemProps","shift","ssrCount","horizontal","keepMounted","cache","onScroll","onScrollEnd"])],4);var d}}}),$w={name:"MagnifyIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Vw=["aria-hidden","aria-label"],Uw=["fill","width","height"],zw={d:"M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"},Hw={key:0};function Gw(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon magnify-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",zw,[i.title?(p(),w("title",Hw,O(i.title),1)):R("",!0)])],8,Uw))],16,Vw)}const Yw=tt($w,[["render",Gw]]),Fw={name:"EntityBubble",components:{UserBubble:Ul},props:{id:{type:String,required:!0},label:{type:String,required:!0},type:{type:String,required:!0}},methods:{onDelete(){this.$emit("delete",{id:this.id,type:this.type})}}},Xw=["title"];function Ww(e,o,i,r,a,s){const l=k("UserBubble");return p(),N(l,{class:"entity-picker__bubble",margin:0,size:22,"display-name":i.label},{name:S(()=>[I("a",{href:"#",title:e.t("contacts","Remove {type}",{type:i.type}),class:"entity-picker__bubble-delete icon-close",onClick:o[0]||(o[0]=(...c)=>s.onDelete&&s.onDelete(...c))},null,8,Xw)]),_:1},8,["display-name"])}const jw=tt(Fw,[["render",Ww],["__scopeId","data-v-d311b888"]]),qw={name:"EntitySearchResult",components:{UserBubble:Ul},props:{source:{type:Object,default(){return{}}},onClick:{type:Function,default(){}},selection:{type:Object,default:()=>({})}},computed:{isSelected(){return this.source.id in this.selection}}};function Zw(e,o,i,r,a,s){const l=k("UserBubble");return i.source.heading?(p(),w("h4",{key:i.source.id,class:"entity-picker__option-caption"},O(e.t("contacts","Add {type}",{type:i.source.label.toLowerCase()})),1)):(p(),N(l,{key:1,class:$t(["entity-picker__bubble",{"entity-picker__bubble--selected":s.isSelected}]),"display-name":i.source.label,user:i.source.user,margin:6,size:44,url:"#",onClick:o[0]||(o[0]=Zt(c=>i.onClick(i.source),["stop","prevent"]))},{title:S(()=>[...o[1]||(o[1]=[I("span",{class:"entity-picker__bubble-checkmark icon-checkmark"},null,-1)])]),_:1},8,["class","display-name","user"]))}const Jw=tt(qw,[["render",Zw],["__scopeId","data-v-506d3d91"]]),Kw={name:"EntityPicker",components:{NcButton:Kt,EmptyContent:Qn,EntityBubble:jw,IconAccountPlusOutline:lp,IconSearch:Yw,IconLoading:Pe,Modal:On,VList:gp,EntitySearchResult:Jw},props:{loading:{type:Boolean,default:!1},dataTypes:{type:Array,required:!0,validator:e=>{const o=e.filter(i=>!i.id&&!i.label);return o.length>0?(console.error("The following types MUST have a proper id and label key",o),!1):!0}},dataSet:{type:Array,required:!0,validator:e=>(e.forEach(o=>{(!o.id||!o.label)&&console.error("The following source MUST have a proper id and label key",o)}),!0)},sort:{type:String,default:"label"},confirmLabel:{type:String,default:t("contacts","Add to group")},titleLabel:{type:String,default:t("contacts","Add members to group")},internalSearch:{type:Boolean,default:!0},selection:{type:Object,default:null},emptyDataSetDescription:{type:String,default:""}},data(){return{canInviteGuests:!!window?.OCA?.Guests?.openGuestDialog,searchQuery:"",localSelection:{}}},computed:{selectionSet:{get(){return this.selection!==null?this.selection:this.localSelection},set(e){this.selection!==null&&this.$emit("update:selection",e),this.localSelection=e}},isSingleType(){return!(this.dataTypes.length>1)},isEmptySelection(){return Object.keys(this.selectionSet).length===0},searchPlaceholderTypes(){return`${this.dataTypes.map(e=>e.label).join(", ")}…`},searchSet(){return this.internalSearch&&this.searchQuery&&this.searchQuery.trim!==""?this.dataSet.filter(e=>e.label.toLowerCase().indexOf(this.searchQuery.toLowerCase())>-1):this.dataSet},availableEntities(){return this.isSingleType?this.searchSet:this.dataTypes.map(e=>{const o=this.searchSet.filter(r=>r.type===e.id),i=[{id:e.id,label:e.label,heading:!0},...o];return o.length===0?[]:i}).flat()}},mounted(){this.$nextTick(()=>{this.$refs.input.focus(),this.$refs.input.select()}),this.canInviteGuests&&Gr("guests:user:created",this.addGuest)},methods:{onCancel(){this.$emit("close")},onSubmit(){this.$emit("submit",Object.values(this.selectionSet))},onSearch:Mh(function(){this.$emit("search",this.searchQuery)},200),onDelete(e){delete this.selectionSet[e.id],console.debug("Removing entity from selection",e)},onClick(e){if(e.id in this.selectionSet){delete this.selectionSet[e.id],console.debug("Removed entity to selection",e);return}this.selectionSet[e.id]=e,console.debug("Added entity to selection",e)},onToggle(e){e.id in this.selectionSet?this.onDelete(e):this.onPick(e)},onGuestButtonClick(){this.canInviteGuests&&window?.OCA?.Guests?.openGuestDialog("contacts")}}},Qw={class:"entity-picker"},tS={class:"entity-picker__heading"},eS={class:"entity-picker__title"},nS={class:"entity-picker__search-container"},oS={class:"entity-picker__search"},iS=["placeholder"],rS={class:"entity-picker__navigation"};function aS(e,o,i,r,a,s){const l=k("IconAccountPlusOutline"),c=k("NcButton"),d=k("IconLoading"),u=k("EmptyContent"),h=k("EntityBubble"),f=k("IconSearch"),v=k("EntitySearchResult"),_=k("VList"),b=k("Modal");return p(),N(b,{size:"normal",onClose:s.onCancel},{default:S(()=>[I("div",Qw,[I("div",tS,[I("h3",eS,O(i.titleLabel),1)]),I("div",nS,[I("div",oS,[o[2]||(o[2]=I("div",{class:"entity-picker__search-icon icon-search"},null,-1)),Ve(I("input",{ref:"input","onUpdate:modelValue":o[0]||(o[0]=C=>a.searchQuery=C),placeholder:e.t("contacts","Search {types}",{types:s.searchPlaceholderTypes}),class:"entity-picker__search-input",type:"search",onInput:o[1]||(o[1]=(...C)=>s.onSearch&&s.onSearch(...C))},null,40,iS),[[zo,a.searchQuery]])]),a.canInviteGuests?(p(),N(c,{key:0,type:"button",variant:"tertiary-no-background",title:e.t("contacts","Add guest"),"aria-label":e.t("contacts","Add guest"),onClick:s.onGuestButtonClick},{default:S(()=>[A(l,{size:20})]),_:1},8,["title","aria-label","onClick"])):R("",!0)]),i.loading?(p(),N(u,{key:0,name:e.t("contacts","Loading …")},{icon:S(()=>[A(d,{size:20})]),_:1},8,["name"])):(p(),w(mt,{key:1},[Object.keys(s.selectionSet).length>0?(p(),N(ng,{key:0,name:"zoom",tag:"ul",class:"entity-picker__selection"},{default:S(()=>[(p(!0),w(mt,null,Dt(s.selectionSet,C=>(p(),N(h,ht({key:C.key||`entity-${C.type}-${C.id}`},{ref_for:!0},C,{onDelete:D=>s.onDelete(C)}),null,16,["onDelete"]))),128))]),_:1})):R("",!0),i.dataSet.length===0?(p(),N(u,{key:1,name:e.t("contacts","Search for people to add"),description:i.emptyDataSetDescription},{icon:S(()=>[A(f,{size:20})]),_:1},8,["name","description"])):s.searchSet.length>0&&s.availableEntities.length>0?(p(),N(_,{key:2,class:"entity-picker__options",data:s.availableEntities},{default:S(({item:C})=>[(p(),N(v,{key:C.id,source:C,selection:s.selectionSet,"on-click":s.onClick},null,8,["source","selection","on-click"]))]),_:1},8,["data"])):a.searchQuery?(p(),N(u,{key:3,name:e.t("contacts","No results")},{icon:S(()=>[A(f,{size:20})]),_:1},8,["name"])):R("",!0),I("div",rS,[A(c,{disabled:i.loading,class:"navigation__button-left",onClick:s.onCancel},{default:S(()=>[q(O(e.t("contacts","Cancel")),1)]),_:1},8,["disabled","onClick"]),A(c,{disabled:s.isEmptySelection||i.loading,class:"navigation__button-right primary",onClick:s.onSubmit},{default:S(()=>[q(O(i.confirmLabel),1)]),_:1},8,["disabled","onClick"])])],64))])]),_:1},8,["onClose"])}const yp=tt(Kw,[["render",aS],["__scopeId","data-v-76578209"]]),sS={name:"CheckOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},lS=["aria-hidden","aria-label"],cS=["fill","width","height"],dS={d:"M19.78,2.2L24,6.42L8.44,22L0,13.55L4.22,9.33L8.44,13.55L19.78,2.2M19.78,5L8.44,16.36L4.22,12.19L2.81,13.55L8.44,19.17L21.19,6.42L19.78,5Z"},uS={key:0};function hS(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon check-outline-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",dS,[i.title?(p(),w("title",uS,O(i.title),1)):R("",!0)])],8,cS))],16,lS)}const pS=tt(sS,[["render",hS]]),fS={name:"CloseOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},mS=["aria-hidden","aria-label"],gS=["fill","width","height"],yS={d:"M3,16.74L7.76,12L3,7.26L7.26,3L12,7.76L16.74,3L21,7.26L16.24,12L21,16.74L16.74,21L12,16.24L7.26,21L3,16.74M12,13.41L16.74,18.16L18.16,16.74L13.41,12L18.16,7.26L16.74,5.84L12,10.59L7.26,5.84L5.84,7.26L10.59,12L5.84,16.74L7.26,18.16L12,13.41Z"},vS={key:0};function _S(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon close-outline-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",yS,[i.title?(p(),w("title",vS,O(i.title),1)):R("",!0)])],8,gS))],16,mS)}const bS=tt(fS,[["render",_S]]),CS={name:"ExitToAppIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},kS=["aria-hidden","aria-label"],wS=["fill","width","height"],SS={d:"M19,3H5C3.89,3 3,3.89 3,5V9H5V5H19V19H5V15H3V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M10.08,15.58L11.5,17L16.5,12L11.5,7L10.08,8.41L12.67,11H3V13H12.67L10.08,15.58Z"},xS={key:0};function ES(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon exit-to-app-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",SS,[i.title?(p(),w("title",xS,O(i.title),1)):R("",!0)])],8,wS))],16,kS)}const vp=tt(CS,[["render",ES]]),MS={name:"ShieldCheckOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},AS=["aria-hidden","aria-label"],NS=["fill","width","height"],TS={d:"M21,11C21,16.55 17.16,21.74 12,23C6.84,21.74 3,16.55 3,11V5L12,1L21,5V11M12,21C15.75,20 19,15.54 19,11.22V6.3L12,3.18L5,6.3V11.22C5,15.54 8.25,20 12,21M10,17L6,13L7.41,11.59L10,14.17L16.59,7.58L18,9"},IS={key:0};function OS(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon shield-check-outline-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",TS,[i.title?(p(),w("title",IS,O(i.title),1)):R("",!0)])],8,NS))],16,AS)}const LS=tt(MS,[["render",OS]]),ro={computed:{selectedContact(){return this.$route.params.selectedContact},selectedGroup(){return this.$route.params.selectedGroup},selectedCircle(){return this.$route.params.selectedCircle},selectedUserGroup(){return this.$route.params.selectedUserGroup},selectedChart(){return this.$route.params.selectedChart}}},DS={name:"MemberGridItem",components:{NcAvatar:In,IconAccountGroupOutline:Ea,NcActions:oo,NcActionButton:Ln,NcActionSeparator:Xg,NcActionText:Bl,IconDeleteOutline:Tn,IconExitToApp:vp,IconShieldCheckOutline:LS,IconCheckOutline:pS,IconCloseOutline:bS,NcButton:Kt},mixins:[ro],props:{member:{type:Object,required:!0},isTeam:{type:Boolean,default:!1}},data(){return{loading:!1}},computed:{circle(){return this.$store.getters.getCircle(this.selectedCircle)},currentUserLevel(){return this.circle?.initiator?.level||_e.MEMBER},currentUserId(){return this.circle?.initiator?.singleId},availableLevelsChange(){const e=[];return this.member.level===_e.OWNER||this.isCurrentUser||(this.currentUserLevel>=_e.MODERATOR&&this.member.level!==_e.ADMIN&&e.push(_e.ADMIN),this.currentUserLevel>=_e.ADMIN&&(this.member.level!==_e.MODERATOR&&e.push(_e.MODERATOR),this.member.level!==_e.MEMBER&&e.push(_e.MEMBER)),this.circle.isOwner&&e.push(_e.OWNER)),e},isCurrentUser(){return this.member.id===this.currentUserId},isPendingApproval(){return this.member.level===_e.NONE&&this.member.status===km.PENDING},canChangeLevel(){return this.circle.canManageMembers&&this.availableLevelsChange.length>0&&!this.isCurrentUser},canDelete(){return this.circle.canManageMembers&&this.member.level<=this.currentUserLevel&&!this.isCurrentUser},memberRole(){return!this.member.level||this.member.level===_e.NONE?null:gi[this.member.level]||null}},methods:{levelChangeLabel(e){return e===_e.OWNER?t("contacts","Promote as sole owner"):this.member.level{}},{label:t("contacts","Leave team"),type:"error",callback:async()=>{try{await this.doDeleteMember()}catch(e){this.logger.error("Error in delete member callback",{e}),yt(t("contacts","Leave team failed."))}}}]).build().show()}catch{}},async doDeleteMember(){this.loading=!0;try{await this.$store.dispatch("deleteMemberFromCircle",{member:this.member,leave:this.isCurrentUser})}catch(e){if(e?.response?.status===404){this.logger.debug("Member is not in circle");return}this.logger.error("Could not delete the member",{member:this.member,error:e}),yt(t("contacts","Could not delete the member {displayName}",this.member))}finally{this.loading=!1}},async changeLevel(e){this.loading=!0;try{if(await bm(this.circle.id,this.member.id,e),this.showLevelMenu=!1,e===_e.OWNER){await this.$store.dispatch("getCircle",this.circle.id),await this.$store.dispatch("getCircleMembers",this.circle.id);return}this.member.level=e}catch(o){this.logger.error("Could not change the member level",{level:gi[e],error:o}),yt(t("contacts","Could not change the member level to {level}",{level:gi[e]}))}finally{this.loading=!1}},async acceptMember(){this.loading=!0;try{await await this.$store.dispatch("acceptCircleMember",{circleId:this.circle.id,memberId:this.member.id})}catch(e){this.logger.error("Could not accept membership request",{member:this.member,error:e}),yt(t("contacts","Could not accept membership request"))}finally{this.loading=!1}}}},PS={class:"member-grid-item"},RS={class:"member-info"},BS={class:"member-name"},$S={key:0,class:"member-role"},VS={key:2,class:"member-grid-item__actions"};function US(e,o,i,r,a,s){const l=k("IconAccountGroupOutline"),c=k("NcAvatar"),d=k("IconCheckOutline"),u=k("NcButton"),h=k("IconCloseOutline"),f=k("NcActionText"),v=k("IconShieldCheckOutline"),_=k("NcActionButton"),b=k("NcActionSeparator"),C=k("IconExitToApp"),D=k("IconDeleteOutline"),L=k("NcActions");return p(),w("div",PS,[i.isTeam?(p(),N(c,{key:0,"display-name":i.member.displayName,"is-no-user":!0,size:32},{icon:S(()=>[A(l,{size:20})]),_:1},8,["display-name"])):(p(),N(c,{key:1,user:i.member.userId,"display-name":i.member.displayName,size:32},null,8,["user","display-name"])),I("div",RS,[I("span",BS,O(i.member.displayName),1),s.memberRole?(p(),w("span",$S,O(s.memberRole),1)):R("",!0)]),!a.loading&&s.isPendingApproval&&s.circle.canManageMembers?(p(),w("div",VS,[A(u,{"aria-label":e.t("contacts","Accept membership request"),onClick:s.acceptMember},{icon:S(()=>[A(d,{size:20})]),_:1},8,["aria-label","onClick"]),A(u,{"aria-label":e.t("contacts","Reject membership request"),onClick:s.deleteMember},{icon:S(()=>[A(h,{size:20})]),_:1},8,["aria-label","onClick"])])):(p(),N(L,{key:3},{default:S(()=>[a.loading?(p(),N(f,{key:0,icon:"icon-loading-small"},{default:S(()=>[q(O(e.t("contacts","Loading …")),1)]),_:1})):(p(),w(mt,{key:1},[s.canChangeLevel?(p(),w(mt,{key:0},[A(f,null,{icon:S(()=>[A(v,{size:16})]),default:S(()=>[q(O(e.t("contacts","Manage level"))+" ",1)]),_:1}),(p(!0),w(mt,null,Dt(s.availableLevelsChange,B=>(p(),N(_,{key:B,icon:"",onClick:X=>s.changeLevel(B)},{default:S(()=>[q(O(s.levelChangeLabel(B)),1)]),_:2},1032,["onClick"]))),128)),A(b)],64)):R("",!0),s.isCurrentUser&&!s.circle.isOwner?(p(),N(_,{key:1,onClick:s.deleteMember},{icon:S(()=>[A(C,{size:16})]),default:S(()=>[q(O(e.t("contacts","Leave team"))+" ",1)]),_:1},8,["onClick"])):s.canDelete?(p(),N(_,{key:2,onClick:s.deleteMember},{icon:S(()=>[A(D,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Remove member")),1)]),_:1},8,["onClick"])):R("",!0)],64))]),_:1}))])}const zS=tt(DS,[["render",US],["__scopeId","data-v-2a4da73d"]]),_p=Object.keys(Rs),HS=parseInt(window.OC.config["sharing.maxAutocompleteResults"],10)||25;async function eu(e){const o=await ie.get(vn("apps/files_sharing/api/v1/sharees"),{params:{format:"json",itemType:"contacts",search:e,perPage:HS,shareType:_p,lookup:!1}}),i=o.data.ocs.data,r=o.data.ocs.data.exact;i.exact=[];const a=Object.values(r).reduce((f,v)=>f.concat(v),[]),s=Object.values(i).reduce((f,v)=>f.concat(v),[]),l=a.filter(f=>typeof f=="object").map(f=>Qs(f)).sort((f,v)=>f.shareType-v.shareType),c=s.filter(f=>typeof f=="object").map(f=>Qs(f)).sort((f,v)=>f.shareType-v.shareType),d=l.concat(c),u=d.reduce((f,v)=>(v.displayName&&(f[v.displayName]||(f[v.displayName]=0),f[v.displayName]++),f),{}),h=d.map(f=>u[f.displayName]>1&&!f.desc?{...f,desc:f.shareWithDisplayNameUnique}:f);return console.info("suggestions",h),h}async function GS(){const e=(await ie.get(vn("apps/files_sharing/api/v1/sharees_recommended"),{params:{format:"json",itemType:"contacts",shareType:_p}})).data.ocs.data.exact,o=Object.values(e).reduce((i,r)=>i.concat(r),[]).map(i=>Qs(i));return console.info("recommendations",o),o}function Qs(e){const o=`picker-${e.value.shareType}`;return{label:e.label,id:`${o}-${e.value.shareWith}`,user:[window.OC.Share.SHARE_TYPE_USER,window.OC.Share.SHARE_TYPE_REMOTE].indexOf(e.value.shareType)>-1?e.value.shareWith:null,type:o,...e.value}}const YS=Te({name:"MemberList",components:{EntityPicker:yp,IconContact:no,MemberGridItem:zS,NcEmptyContent:Qn},mixins:[ga,ro],props:{list:{type:Array,required:!0},loading:{type:Boolean,default:!1}},data(){return{pickerLoading:!1,showPicker:!1,showPickerIntro:!0,recommendations:[],pickerCircle:null,pickerData:[],pickerSelection:{},pickerTypes:Sm}},computed:{circle(){return this.$store.getters.getCircle(this.selectedCircle)},filteredPickerData(){return this.pickerData.filter(e=>{const o=Rs[e.shareType],i=this.list.filter(({userType:r})=>r===o);return i?i.find(r=>r.userId===e.shareWith)===void 0:!0})},flatList(){const e=this.list.filter(i=>!i.isUser),o=this.list.filter(i=>i.isUser);return[...e,...o]},hasMembers(){return this.flatList.length>0}},mounted(){Gr("contacts:circles:append",this.onShowPicker),Gr("guests:user:created",this.onGuestCreated)},methods:{async onShowPicker(e){this.showPicker=!0,this.pickerLoading=!0,this.pickerCircle=e;try{const o=await GS();this.recommendations=o,this.pickerData=o}catch(o){console.error("Unable to get the recommendations list",o)}finally{this.pickerLoading=!1}},async onSearch(e){if(e.trim()===""){this.pickerData=this.recommendations;return}this.pickerLoading=!0;try{const o=await eu(e);this.pickerData=o}catch(o){console.error("Unable to get the results",o),yt(Ai("contacts","Unable to get the results"))}finally{this.pickerLoading=!1}},async onPickerPick(e){this.logger.info("Adding selection to circle",{selection:e,pickerCircle:this.pickerCircle}),this.pickerLoading=!0,e=e.map(o=>({id:o.shareWith,type:Rs[o.shareType]}));try{if((await this.$store.dispatch("addMembersToCircle",{circleId:this.pickerCircle,selection:e})).length[A(l,{size:20})]),_:1},8,["name"])):e.circle.isMember?e.hasMembers?(p(),w("div",XS,[(p(!0),w(mt,null,Dt(e.flatList,f=>(p(),N(u,{key:`member-grid-item-${f.id}`,member:f,"is-team":!f.isUser},null,8,["member","is-team"]))),128))])):(p(),N(c,{key:2,class:"empty-content",name:e.t("contacts","You currently have no access to the member list")},{icon:S(()=>[A(d,{size:20})]),_:1},8,["name"])):(p(),N(c,{key:1,class:"empty-content",name:e.t("contacts","The list of members is only visible to members of this team")},{icon:S(()=>[A(d,{size:20})]),_:1},8,["name"])),e.showPicker?(p(),N(h,{key:4,ref:"entityPicker",selection:e.pickerSelection,"onUpdate:selection":o[0]||(o[0]=f=>e.pickerSelection=f),"confirm-label":e.t("contacts","Add to {team}",{team:e.circle.displayName}),"title-label":e.t("contacts","Invite members to {team}",{team:e.circle.displayName}),"data-types":e.pickerTypes,"data-set":e.filteredPickerData,"internal-search":!1,loading:e.pickerLoading,onClose:e.resetPicker,onSearch:e.onSearch,onSubmit:e.onPickerPick},null,8,["selection","confirm-label","title-label","data-types","data-set","loading","onClose","onSearch","onSubmit"])):R("",!0)])}const jS=tt(YS,[["render",WS],["__scopeId","data-v-6d4c97c1"]]),tc={data(){return{copied:!1,copyLoading:!1,copySuccess:!1}},computed:{copyLinkIcon(){return this.copySuccess?"icon-checkmark":this.copyLoading?"icon-loading-small":"icon-public"}},methods:{async copyToClipboard(e){this.copyLoading=!0;try{await navigator.clipboard.writeText(e),this.copySuccess=!0,this.copied=!0,Oi(t("contacts","Link copied to the clipboard"))}catch{this.copySuccess=!1,this.copied=!0,yt(t("contacts","Could not copy link to the clipboard."))}finally{this.copyLoading=!1,setTimeout(()=>{this.copied=!1,this.copySuccess=!1},2e3)}}}},bp={props:{circle:{type:lh,required:!0}},mixins:[tc],data(){return{loadingAction:!1,loadingJoin:!1}},computed:{copyButtonText(){return this.copied?this.copySuccess?t("contacts","Copied"):t("contacts","Could not copy"):t("contacts","Copy link")},circleUrl(){const e=this.$router.resolve(this.circle.router);return window.location.origin+e.href},joinButtonTitle(){return this.circle.requireJoinAccept?t("contacts","Request to join"):t("contacts","Join team")}},methods:{confirmLeaveCircle(){window.OC.dialogs.confirmDestructive(t("contacts",`You are about to leave {circle}. Are you sure?`,{circle:this.circle.displayName}),t("contacts","Please confirm team leave"),window.OC.dialogs.YES_NO_BUTTONS,this.leaveCircle,!0)},async leaveCircle(e){if(!e){this.logger.debug("Circle leave cancelled");return}this.loadingAction=!0;const o=this.circle.initiator;try{await this.$store.dispatch("deleteMemberFromCircle",{member:o,leave:!0}),this.circle.initiator=null}catch(i){console.error("Could not leave the circle",o,i),yt(t("contacts","Could not leave the team {displayName}",this.circle))}finally{this.loadingAction=!1}},async joinCircle(){this.loadingJoin=!0;try{const e=await xm(this.circle.id),o=new Em(e,this.circle);this.circle.initiator=o,o.circle.addMember(o)}catch(e){yt(t("contacts","Unable to join the team")),console.error("Unable to join the circle",e)}finally{this.loadingJoin=!1}},confirmDeleteCircle(){window.OC.dialogs.confirmDestructive(t("contacts",`You are about to delete {circle}. Are you sure?`,{circle:this.circle.displayName}),t("contacts","Please confirm team deletion"),window.OC.dialogs.YES_NO_BUTTONS,this.deleteCircle,!0)},async deleteCircle(e){if(!e){this.logger.debug("Circle deletion cancelled");return}this.loadingAction=!0;try{this.$store.dispatch("deleteCircle",this.circle.id)}catch{yt(t("contacts","Unable to delete the team"))}finally{this.loadingAction=!1}},async addMemberToCircle(){try{await this.$router.push(this.circle.router)}catch(e){console.error("Could not open circle member picker",e)}Zo("contacts:circles:append",this.circle.id)}}},qS={name:"CircleDetails",components:{AccountPlusIcon:lp,Avatar:In,NcButton:Kt,ContentHeading:dp,ListItem:Nh,CogIcon:Jl,CopyIcon:wl,IconAccountGroup:Ea,FileDocumentOutline:hk,LoginIcon:xk,LogoutIcon:cp,MemberList:jS,CircleSettings:lw,TeamResourceButton:kw,NcEmptyContent:Qn,NcLoadingIcon:Pe,NcPopover:Dl,PencilIcon:kl,UserBubble:Ul,NcTextField:Rl,NcTextArea:Mm,NcActions:oo,NcActionButton:Ln,FolderIcon:Kl,MessageIcon:$k,CalendarIcon:WC,ViewDashboardIcon:Fk,BookOpenPageVariantIcon:UC,CheckIcon:Ma},mixins:[bp],setup(){const e=qo(),{width:o}=Ag(e);return{avatarList:e,width:o}},data(){return{active:!1,isEditing:!1,showMembersModal:!1,loading:!1,loadingJoin:!1,loadingLeave:!1,loadingName:!1,loadingDescription:!1,isSettingsPopoverShown:!1,resources:[],originalDisplayName:"",originalDescription:"",activePopover:null,resourceInputs:bh({}),popoverBoundary:null,createdCalendar:null,showCalendarSuccessNotification:!1,createdCalendarName:""}},computed:{descriptionPlaceholder(){return this.circle.description.trim()===""?t("contacts","There is no description for this team"):t("contacts","Enter a description for the team")},isEmptyDescription(){return this.circle.description.trim()===""},showDescription(){return this.circle.isOwner?!0:!this.isEmptyDescription},members(){return Object.values(this.$store.getters.getCircle(this.circle.id)?.members||[])},circleUrl(){return window.location.href},canManageTeam(){return(this.circle.isOwner||this.circle.isAdmin)&&!this.circle.isPersonal},teamHasCollective(){return this.resourcesForProvider("collectives").length>0},maxMembers(){const e=parseInt(window.getComputedStyle(document.body).getPropertyValue("--default-clickable-area"))+12,o=Math.floor(this.width/e);return this.members.length>o?o-1:o},memberLimit(){return Math.min(this.members.length,this.maxMembers)},membersLimited(){return this.members.slice(0,this.memberLimit)},hasExtraMembers(){return this.members.length>this.maxMembers},groupedResources(){return this.resources.reduce((e,o)=>{const i=o.provider.id;return e[i]||(e[i]={name:o.provider.name,resources:[]}),e[i].resources.push(o),e},{})},resourcesForProvider(){return e=>this.resources?.filter(o=>o.provider.id===e)??[]},resourceTypes(){const e=window.OC?.appswebroots||{};return[{id:"folder",label:t("contacts","Folder"),inputLabel:t("contacts","New folder"),placeholder:t("contacts","Folder name"),helperText:t("contacts","This will create a regular folder shared with the team. To create a Team Folder, please contact your {productName} administrator",{productName:OC.theme.name}),icon:"FolderIcon",apiPath:"files",enabled:e.files!==void 0},{id:"talk",label:t("contacts","Talk conversation"),inputLabel:t("contacts","New Talk conversation"),placeholder:t("contacts","Conversation name"),icon:"MessageIcon",apiPath:"spreed",enabled:e.spreed!==void 0},{id:"collective",label:t("contacts","Collective"),inputLabel:null,placeholder:null,icon:"BookOpenPageVariantIcon",apiPath:"collectives",enabled:e.collectives!==void 0&&!this.teamHasCollective,noInput:!0},{id:"calendar",label:t("contacts","Calendar"),inputLabel:t("contacts","New calendar"),placeholder:t("contacts","Calendar name"),icon:"CalendarIcon",apiPath:"calendar",enabled:e.calendar!==void 0},{id:"deck",label:t("contacts","Deck board"),inputLabel:t("contacts","New Deck board"),placeholder:t("contacts","Board name"),icon:"ViewDashboardIcon",apiPath:"deck",enabled:e.deck!==void 0}].filter(o=>o.enabled)}},watch:{"circle.id":{handler(){this.fetchTeamResources()},immediate:!0}},methods:{addMembers(){this.$refs.memberList.onShowPicker(this.circle.id)},setActivePopover(e,o){this.activePopover=o?e:null},updateResourceInput(e,o){this.resourceInputs[e]=o},async handleResourceCreation({resourceType:e,name:o}){try{let i;switch(e.id){case"folder":{const r=`/remote.php/dav/files/${ya().uid}/${o}`;await ie.request({method:"MKCOL",url:r,headers:{"Content-Type":"application/xml"}}),i=o;break}case"talk":{const r=vn("/apps/spreed/api/v4/room");i=(await ie.post(r,{roomName:o,roomType:2})).data.ocs.data.token;break}case"collective":{const r=this.circle.sanitizedName||this.circle.name||this.circle.displayName;if(!r)throw new Error("Cannot create collective: team has no valid name");const a=vn("/apps/collectives/api/v1.0/collectives");if(i=(await ie.post(a,{name:r})).data.ocs.data.collective.id,!i)throw new Error("Failed to get collective ID from creation response");break}case"calendar":{const r=(await Nd(async()=>{const{default:c}=await import("./style-QJh_LeZW.chunk.mjs").then(d=>d.af);return{default:c}},__vite__mapDeps([0,1,2,3,4]),import.meta.url)).default,{generateRemoteUrl:a}=await Nd(async()=>{const{generateRemoteUrl:c}=await import("./modulepreload-polyfill-DzIIs1ni.chunk.mjs").then(d=>d.bl);return{generateRemoteUrl:c}},[],import.meta.url),s=new r({rootUrl:a("dav"),defaultHeaders:{"X-NC-CalDAV-Webcal-Caching":"On"}});await s.connect({enableCalDAV:!0});const l=s.calendarHomes[0];try{const c=await l.createCalendarCollection(o,"#0082c9",["VEVENT","VTODO"],0);this.createdCalendar=c,i=c.url}catch{throw console.error("Calendar creation failed for name:",o),new Error(`CALENDAR_EXISTS:${o}`)}break}case"deck":{yt(t("contacts","Deck app is not installed. Please install it to create team boards."));return}default:{yt(t("contacts","Unknown resource type"));return}}await this.shareResourceWithTeam(e,i),this.resourceInputs[e.id]="",this.activePopover=null,e.id==="calendar"?(this.createdCalendar=null,Oi(t("contacts",'Team calendar "{resourceName}" created and shared with team',{resourceName:o})),this.createdCalendarName=o,this.showCalendarSuccessNotification=!0,setTimeout(()=>{this.showCalendarSuccessNotification=!1},1e4)):(Oi(t("contacts",'{resourceType} "{resourceName}" created and shared with team',{resourceType:e.label,resourceName:o})),this.fetchTeamResources())}catch(i){if(console.error("Failed to create resource:",i),i.message&&i.message.startsWith("CALENDAR_EXISTS:")){const r=i.message.replace("CALENDAR_EXISTS:","");yt(t("contacts",'A calendar named "{name}" already exists. Please choose a different name.',{name:r}))}else yt(t("contacts","Failed to create {resourceType}: {error}",{resourceType:e.label.toLowerCase(),error:i.response?.data?.ocs?.data?.message||i.response?.data?.message||i.message}))}},async shareResourceWithTeam(e,o){switch(e.id){case"folder":{const i=vn("/apps/files_sharing/api/v1/shares");await ie.post(i,{path:`/${o}`,shareType:7,shareWith:this.circle.id,permissions:31});break}case"talk":{const i=vn(`/apps/spreed/api/v4/room/${o}/participants`);await ie.post(i,{source:"circles",newParticipant:this.circle.id});break}case"collective":break;case"calendar":{if(!this.createdCalendar||!this.createdCalendar.share)throw new Error("No calendar object available for sharing");const i=`principal:principals/circles/${this.circle.id}`;await this.createdCalendar.share(i);break}}},onLeave(){this.isSettingsPopoverShown=!1,this.confirmLeaveCircle()},onDelete(){this.isSettingsPopoverShown=!1,this.confirmDeleteCircle()},startEditing(){this.originalDisplayName=this.circle.displayName,this.originalDescription=this.circle.description,this.isEditing=!0},cancelEditing(){this.circle.displayName=this.originalDisplayName,this.circle.description=this.originalDescription,this.isEditing=!1},async fetchTeamResources(){const e=await ie.get(vn(`/teams/${this.circle.id}/resources`));this.resources=e.data.ocs.data.resources,console.debug("Team resources",this.resources)},onAutocomplete(e,o){o([])},async saveChanges(){const e=[];if(this.circle.displayName!==this.originalDisplayName){this.loadingName=!0;try{await Ds(this.circle.id,Ps.Name,this.circle.displayName),this.originalDisplayName=this.circle.displayName}catch(o){console.error("Unable to edit name",this.circle.displayName,o),e.push("name"),this.circle.displayName=this.originalDisplayName}finally{this.loadingName=!1}}if(this.circle.description!==this.originalDescription){this.loadingDescription=!0;try{await Ds(this.circle.id,Ps.Description,this.circle.description),this.originalDescription=this.circle.description}catch(o){console.error("Unable to edit team description",this.circle.description,o),e.push("description"),this.circle.description=this.originalDescription}finally{this.loadingDescription=!1}}if(e.length>0){const o=e.join(" and ");yt(t("contacts","An error happened while saving {fields}",{fields:o}));return}this.isEditing=!1},openCalendarApp(){window.open(ci("/apps/calendar/"),"_blank"),this.showCalendarSuccessNotification=!1}}},ZS={class:"circle-details-container"},JS={class:"circle-details__header-wrapper"},KS={class:"circle-details-grid__avatar"},QS={class:"circle-details__header"},t5={class:"circle-name-wrapper"},e5={key:0,class:"circle-name"},n5=["title"],o5={key:0,class:"subtitle"},i5={key:1,class:"circle-description-wrapper"},r5={key:0,class:"circle-description"},a5={class:"actions"},s5={key:2,class:"resource-shortcuts"},l5={class:"resource-shortcuts__title"},c5={class:"resource-shortcuts__buttons"},d5={class:"circle-details__main-content"},u5={key:1},h5={class:"section-header"},p5={class:"item-list"},f5=["innerHTML"],m5=["src"],g5={class:"circle-details-section"},y5={class:"member-section-layout"},v5={class:"section-header"};function _5(e,o,i,r,a,s){const l=k("Avatar"),c=k("NcLoadingIcon"),d=k("NcTextField"),u=k("UserBubble"),h=k("NcTextArea"),f=k("PencilIcon"),v=k("NcButton"),_=k("CopyIcon"),b=k("CogIcon"),C=k("CircleSettings"),D=k("NcPopover"),L=k("LoginIcon"),B=k("LogoutIcon"),X=k("CheckIcon"),nt=k("TeamResourceButton"),Z=k("NcEmptyContent"),rt=k("IconAccountGroup"),st=k("ContentHeading"),J=k("FileDocumentOutline"),ot=k("ListItem"),lt=k("AccountPlusIcon"),T=k("MemberList");return p(),w("div",ZS,[I("div",{class:$t(["circle-details-grid",{"is-editing":a.isEditing}])},[I("div",JS,[I("div",KS,[A(l,{"disable-tooltip":!0,"display-name":e.circle.displayName,"is-no-user":!0,size:75},null,8,["display-name"])]),I("div",QS,[I("div",t5,[a.isEditing?(p(),N(d,{key:1,modelValue:e.circle.displayName,"onUpdate:modelValue":o[0]||(o[0]=V=>e.circle.displayName=V),placeholder:e.t("contacts","Team name"),label:"Team name"},null,8,["modelValue","placeholder"])):(p(),w("h2",e5,[I("span",{title:e.circle.displayName},O(e.circle.displayName),9,n5),a.loadingName?(p(),N(c,{key:0,size:24})):R("",!0)]))]),a.isEditing?R("",!0):(p(),w("div",o5,[I("span",null,O(e.t("files","Team owner")),1),o[5]||(o[5]=q()),A(u,{user:e.circle.owner.userId,"display-name":e.circle.isOwner?"you":e.circle.owner.displayName},null,8,["user","display-name"])])),s.showDescription?(p(),w("div",i5,[a.isEditing?(p(),N(h,{key:1,modelValue:e.circle.description,"onUpdate:modelValue":o[1]||(o[1]=V=>e.circle.description=V),placeholder:s.descriptionPlaceholder,label:"Description",maxlength:1024},null,8,["modelValue","placeholder"])):(p(),w("div",r5,O(e.circle.description),1))])):R("",!0),I("div",a5,[a.isEditing?(p(),w(mt,{key:1},[A(v,{variant:"secondary",onClick:s.cancelEditing},{default:S(()=>[q(O(e.t("contacts","Cancel")),1)]),_:1},8,["onClick"]),A(v,{variant:"primary",onClick:s.saveChanges},{default:S(()=>[q(O(e.t("contacts","Save")),1)]),_:1},8,["onClick"])],64)):(p(),w(mt,{key:0},[s.canManageTeam?(p(),N(v,{key:0,variant:"primary",onClick:s.startEditing},{icon:S(()=>[A(f,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Edit")),1)]),_:1},8,["onClick"])):R("",!0),A(v,{variant:"secondary",href:s.circleUrl,onClick:o[2]||(o[2]=Zt(V=>e.copyToClipboard(s.circleUrl),["stop","prevent"]))},{icon:S(()=>[A(_,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Copy link")),1)]),_:1},8,["href"]),s.canManageTeam?(p(),N(D,{key:1,shown:a.isSettingsPopoverShown,"popup-role":"dialog","onUpdate:shown":o[4]||(o[4]=V=>a.isSettingsPopoverShown=V)},{trigger:S(()=>[A(v,{onClick:o[3]||(o[3]=V=>a.isSettingsPopoverShown=!0)},{icon:S(()=>[A(b,{size:20})]),_:1})]),default:S(()=>[A(C,{circle:e.circle,onLeave:s.onLeave,onDelete:s.onDelete},null,8,["circle","onLeave","onDelete"])]),_:1},8,["shown"])):R("",!0)],64)),!e.circle.isPendingMember&&!e.circle.isMember&&e.circle.canJoin?(p(),N(v,{key:2,disabled:a.loadingJoin,class:"primary",onClick:e.joinCircle},{icon:S(()=>[A(L,{size:16})]),default:S(()=>[q(" "+O(e.t("contacts","Request to join")),1)]),_:1},8,["disabled","onClick"])):R("",!0),e.circle.isMember&&e.circle.canLeave?(p(),N(v,{key:3,disabled:a.loadingLeave,variant:"warning",onClick:e.confirmLeaveCircle},{icon:S(()=>[A(B,{size:16})]),default:S(()=>[q(" "+O(e.t("contacts","Leave team")),1)]),_:1},8,["disabled","onClick"])):R("",!0)]),e.circle.isMember?(p(),w("div",s5,[I("h3",l5,O(e.t("contacts","Create")),1),I("div",c5,[(p(!0),w(mt,null,Dt(s.resourceTypes,V=>(p(),w(mt,{key:V.id},[V.id==="calendar"&&a.showCalendarSuccessNotification?(p(),N(v,{key:0,variant:"success",onClick:s.openCalendarApp},{icon:S(()=>[A(X,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Show in Calendar")),1)]),_:1},8,["onClick"])):(p(),N(nt,{key:1,"resource-type":V,value:a.resourceInputs[V.id]||"","is-open":a.activePopover===V.id,"helper-text":V.helperText,"onUpdate:value":U=>s.updateResourceInput(V.id,U),"onUpdate:isOpen":U=>s.setActivePopover(V.id,U),onCreate:s.handleResourceCreation},{icon:S(()=>[(p(),N(to(V.icon),{size:20}))]),_:2},1032,["resource-type","value","is-open","helper-text","onUpdate:value","onUpdate:isOpen","onCreate"]))],64))),128))])])):R("",!0)])]),I("div",d5,[e.circle.isMember?(p(),w("section",u5,[(p(!0),w(mt,null,Dt(s.groupedResources,(V,U)=>(p(),w("div",{key:U,class:"circle-details-section"},[I("div",h5,[A(st,null,{default:S(()=>[q(O(V.name),1)]),_:2},1024)]),I("ul",p5,[(p(!0),w(mt,null,Dt(V.resources,M=>(p(),N(ot,{key:M.id,href:M.url,name:M.label},{icon:S(()=>[M.iconSvg?(p(),w("div",{key:0,class:"resource__icon",innerHTML:M.iconSvg},null,8,f5)):M.iconURL?(p(),w("img",{key:1,src:M.iconURL,class:"resource__icon"},null,8,m5)):(p(),N(J,{key:2,size:20}))]),_:2},1032,["href","name"]))),128))])]))),128)),I("div",g5,[I("div",y5,[I("div",v5,[A(st,null,{default:S(()=>[q(O(e.t("contacts","Members")),1)]),_:1}),e.circle.canManageMembers?(p(),N(v,{key:0,variant:"tertiary",onClick:s.addMembers},{icon:S(()=>[A(lt,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Add")),1)]),_:1},8,["onClick"])):R("",!0)]),A(T,{ref:"memberList",list:s.members},null,8,["list"])])])])):(p(),w(mt,{key:0},[e.circle.isPendingMember?(p(),N(Z,{key:0,name:e.t("contacts","Your request to join this team is pending approval")},{icon:S(()=>[A(c,{size:20})]),_:1},8,["name"])):(p(),N(Z,{key:1,name:e.t("contacts","You are not a member of {circle}",{circle:e.circle.displayName})},{icon:S(()=>[A(rt,{size:20})]),_:1},8,["name"]))],64))])],2)])}const b5=tt(qS,[["render",_5],["__scopeId","data-v-1421d4d8"]]),C5={name:"UserGroupMember",components:{NcAvatar:In},props:{member:{type:String,required:!0}},data(){return{loading:!0,displayName:""}},mounted(){this.fetchMemberInfo()},methods:{async fetchMemberInfo(){const e=encodeURIComponent(this.member),{data:o}=await ie.post(ci("contactsmenu/findOne"),`shareType=0&shareWith=${e}`);this.displayName=o.fullName,this.loading=!1}}},k5={class:"usergroup-member__container"},w5={class:"usergroup-member__info"},S5={key:0,class:"usergroup-member__name"},x5={class:"usergroup-member__role"};function E5(e,o,i,r,a,s){const l=k("NcAvatar");return p(),w("div",k5,[A(l,{user:i.member,size:32},null,8,["user"]),I("div",w5,[a.loading?R("",!0):(p(),w("div",S5,O(a.displayName),1)),I("div",x5,O(e.t("contacts","Member")),1)])])}const M5=tt(C5,[["render",E5],["__scopeId","data-v-7b48e627"]]);class ec{_data;_members;constructor(o){this._data=o,this._members=[]}addMember(o){this._members.includes(o)||this._members.push(o)}get id(){return this._data.id}get displayName(){return this._data.displayname}get population(){return this._data.usercount}get canLeave(){return!1}get isOwner(){return!1}get isMember(){return!0}get canManageMembers(){return!1}get canJoin(){return!1}get members(){return this._members}get router(){return{name:"user_group",params:{selectedUserGroup:this.id,selectedGroup:Mi}}}toString(){return this.displayName}}const A5={name:"UserGroupDetails",components:{CopyIcon:wl,NcAvatar:In,NcButton:Kt,UserGroupMember:M5},mixins:[tc],props:{userGroup:{type:ec,required:!0}},computed:{userGroupUrl(){return window.location.href}}},N5={class:"usergroup-details-container"},T5={class:"usergroup-details-grid"},I5={class:"usergroup-details__header-wrapper"},O5={class:"usergroup-details-grid__avatar"},L5={class:"usergroup-details__header"},D5={class:"usergroup-name-wrapper"},P5={class:"usergroup-name"},R5=["title"],B5={class:"usergroup-details__subtitle"},$5={class:"actions"},V5={class:"usergroup-details__main-content"},U5={class:"usergroup-details__content-heading"},z5={class:"usergroup-details__member-grid"};function H5(e,o,i,r,a,s){const l=k("NcAvatar"),c=k("CopyIcon"),d=k("NcButton"),u=k("UserGroupMember");return p(),w("div",N5,[I("div",T5,[I("div",I5,[I("div",O5,[A(l,{"disable-tooltip":!0,"display-name":i.userGroup.displayName,"is-no-user":!0,size:75},null,8,["display-name"])]),I("div",L5,[I("div",D5,[I("h2",P5,[I("span",{title:i.userGroup.displayName},O(i.userGroup.displayName),9,R5)]),I("div",B5,O(e.t("contacts","This is a read-only group managed by administrators. Group members can only view this group.")),1)]),I("div",$5,[A(d,{variant:"secondary",onClick:o[0]||(o[0]=Zt(h=>e.copyToClipboard(s.userGroupUrl),["stop","prevent"]))},{icon:S(()=>[A(c,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Copy link")),1)]),_:1})])])]),I("div",V5,[I("h3",U5,O(e.t("contacts","Members")),1),I("div",z5,[(p(!0),w(mt,null,Dt(i.userGroup.members,h=>(p(),N(u,{key:`user-group-member-${h}`,member:h},null,8,["member"]))),128))])])])])}const G5=tt(A5,[["render",H5],["__scopeId","data-v-c6692938"]]);async function Y5(e){return(await ie.get(vn("/cloud/users/{userId}/groups/details",{userId:e}))).data.ocs.data.groups}async function F5(e){return(await ie.get(vn("/cloud/groups/{groupId}/users",{groupId:e}))).data.ocs.data.users}const nc=Am("userGroup",{state:()=>({userGroups:{}}),getters:{userGroupList:e=>Object.values(e.userGroups),getUserGroup:e=>o=>e.userGroups[o]},actions:{async getUserGroups(e){const o=await Y5(e);return o.forEach(i=>{try{const r=new ec(i);this.userGroups[r.id]=r}catch(r){Il.error("Failed to add group",{group:i,error:r})}}),o},async getUserGroupMembers(e){const o=await F5(e);return o.forEach(i=>{this.getUserGroup(e).addMember(i)}),o}}}),X5={name:"CircleContent",components:{AppContent:Pl,CircleDetails:b5,EmptyContent:Qn,AccountGroup:Ea,IconLoading:Pe,UserGroupDetails:G5},mixins:[ga,ro],props:{loading:{type:Boolean,default:!0}},data(){return{loadingList:!1}},computed:{circles(){return this.$store.getters.getCircles},circle(){return this.$store.getters.getCircle(this.selectedCircle)},userGroup(){return this.userGroupStore.getUserGroup(this.selectedUserGroup)},members(){return Object.values(this.circle?.members||[])},isEmptyCircle(){return this.members.length===0},...ch(nc)},watch:{circle(e){e?.id&&this.fetchCircleMembers(e.id)},userGroup(e){e?.id&&this.fetchUserGroupMembers(e.id)}},beforeMount(){this.circle?.id&&this.fetchCircleMembers(this.circle.id),this.userGroup?.id&&this.fetchUserGroupMembers(this.userGroup.id)},methods:{async fetchCircleMembers(e){this.loadingList=!0,this.logger.debug("Fetching members for",{circleId:e});try{await this.$store.dispatch("getCircleMembers",e)}catch(o){console.error(o),yt(t("contacts","There was an error fetching the member list"))}finally{this.loadingList=!1}},async fetchUserGroupMembers(e){this.loadingList=!0;try{await this.userGroupStore.getUserGroupMembers(e)}catch(o){console.error(o),yt(t("contacts","There was an error fetching the member list"))}finally{this.loadingList=!1}}}};function W5(e,o,i,r,a,s){const l=k("AccountGroup"),c=k("EmptyContent"),d=k("IconLoading"),u=k("UserGroupDetails"),h=k("CircleDetails"),f=k("AppContent");return p(),N(f,null,{default:S(()=>[!s.circle&&!s.userGroup?(p(),N(c,{key:0,name:e.t("contacts","Please select a team")},{icon:S(()=>[A(l,{size:20})]),_:1},8,["name"])):i.loading?(p(),N(c,{key:1,class:"empty-content",name:e.t("contacts","Loading team…")},{icon:S(()=>[A(d,{size:20})]),_:1},8,["name"])):s.userGroup?(p(),N(u,{key:2,"user-group":s.userGroup},null,8,["user-group"])):(p(),N(h,{key:3,circle:s.circle},null,8,["circle"]))]),_:1})}const j5=tt(X5,[["render",W5],["__scopeId","data-v-62e499e6"]]);function q5(e){e=structuredClone(e);const o=e.length,i=0;for(let r=-3;r<=3;r++)for(let a=-3;a<=3;a++)e[3+r][3+a]=i,e[3+r][o-4+a]=i,e[o-4+r][3+a]=i;for(let r=0;r<8;r++)e[7][r]=e[r][7]=e[7][o-r-1]=e[r][o-8]=e[o-8][r]=e[o-1-r][7]=i;return e}function Z5(e,o,i){e=structuredClone(e);const r=e.length,a=Math.ceil((r*o/100+r%2)/2)*2-r%2,s=e[0]?.length??0,l=Math.ceil((s*i/100+s%2)/2)*2-s%2,c=Math.round((r-a)/2),d=Math.round((s-l)/2);for(let u=c;u7089)throw new Error("Too much data");return e4(i)}if(/^[0-9A-Z \$%\*\+\.\/\:\-]+$/.test(i)){if(r.byteLength>4296)throw new Error("Too much data");return t4(i)}if(o&&/^https?:/i.test(i))return n4(i);if(r.byteLength>2953)throw new Error("Too much data");return Q5(new Uint8Array(r))}function qe(e,o,i){for(let r=1<>>=1)e.push(r&i?1:0)}function Q5(e){const o=e.byteLength,i=[];for(let s=0;s=e.length)return i;const r=tl(e.slice(o),!1);return i.data27=i.data27.concat(r.data27),i.data10&&r.data10&&(i.data10=i.data10.concat(r.data10)),i.data1&&r.data1&&(i.data1=i.data1.concat(r.data1)),i}function o4(e,o){e=[].slice.call(e);const i=wp(o);for(let r=0;ro;){if(!e[0]){e.shift();continue}const r=kp(e[0]);for(let a=0;a<=o;a++)e[a]=e[a]^el(i[a]+r);e.shift()}return new Uint8Array(e)}const i4=285,Jr=[1],Cp=[];for(let e=1;e<256;e++){let o=Jr[e-1]<<1;o>255&&(o^=i4),Jr[e]=o}for(let e=0;e<255;e++)Cp[Jr[e]]=e;function el(e){for(;e<0;)e+=255;for(;e>255;)e-=255;return Jr[e]}function kp(e){if(e<1||e>255)throw Error(`Bad log(${e})`);return Cp[e]}const _s=[[0],[0,0],[0,25,1]];function wp(e){if(_s[e])return _s[e];const o=wp(e-1),i=[];i[0]=o[0];for(let r=1;r<=e;r++)i[r]=kp(el(o[r])^el(o[r-1]+e-1));return _s[e]=i,i}function r4(e){const o=(e<<2)+17;return Array(o).fill(null).map(()=>Array(o).fill(0))}function a4(e){const o=e.length;for(let i=-3;i<=3;i++)for(let r=-3;r<=3;r++){const a=Math.max(i,r),s=Math.min(i,r),l=a==2&&s>=-2||s==-2&&a<=2?128:129;e[3+i][3+r]=l,e[3+i][o-4+r]=l,e[o-4+i][3+r]=l}for(let i=0;i<8;i++)e[7][i]=e[i][7]=e[7][o-i-1]=e[i][o-8]=e[o-8][i]=e[o-1-i][7]=128}function s4(e){const o=e.length;if(o>21){const r=o-13;let a=Math.round(r/Math.ceil(r/28));a%2&&a++;const s=[];for(let l=r+6;l>10;l-=a)s.unshift(l);s.unshift(6);for(var i=0;i=-1||v==-1&&f<=1?128:129;e[c+u][d+h]=_}}}for(var i=8;i0;d--)c>>>9+d&&(c^=i<0;d--)c>>>11+d&&(c^=r<>C&1?129:128}for(var v=0;v<8;v++)l[8][u-1-v]=f(v),v<6&&(l[v][8]=f(v));for(var v=8;v<15;v++)l[u-15+v][8]=f(v),v>8&&(l[8][14-v]=f(v));l[7][8]=f(6),l[8][8]=f(7),l[8][7]=f(8);const _=o[(u-17)/4];if(!_)return;function b(C){return _>>C&1?129:128}for(var v=0;v<6;v++)for(let D=0;D<3;D++)l[u-11+D][v]=l[v][u-11+D]=b(v*3+D)}})(),iu=(function(){const e=[(o,i)=>(o+i)%2==0,(o,i)=>o%2==0,(o,i)=>i%3==0,(o,i)=>(o+i)%3==0,(o,i)=>(Math.floor(o/2)+Math.floor(i/3))%2==0,(o,i)=>o*i%2+o*i%3==0,(o,i)=>(o*i%2+o*i%3)%2==0,(o,i)=>(o*i%3+(o+i)%2)%2==0];return function(o,i,r){const a=o.length;let s,l,c=-1;s=l=a-1;const d=e[r];let u=i.blocks[i.blocks.length-1].length;for(var h=0;h-1)do o[s][l]=d(s,l)?1:0;while(_());function v(b){for(let C=128;C;C>>=1){let D=!!(C&b);d(s,l)&&(D=!D),o[s][l]=D?1:0,_()}}function _(){do if(l%2^+(l<6)?c<0&&s==0||c>0&&s==a-1?(l--,c=-c):(l++,s+=c):l--,l==6&&l--,l<0)return!1;while(o[s][l]&240);return!0}}})();function c4(e){const o=e.length;let i=0;for(var r=0;r=5&&(i+=s-2),a=c,s=1}s>=5&&(i+=s-2)}for(var l=0;l=5&&(i+=s-2),a=c,s=1}s>=5&&(i+=s-2)}for(var r=0;r=4&&!(d(-4)||d(-3)||d(-2)||d(-1))&&(i+=40),l=4&&!(u(-4)||u(-3)||u(-2)||u(-1))&&(i+=40),ra.map(s=>s&1))}const Sp=["L","M","Q","H"];function u4(e,o){let i=1,r;for(e.data1?r=Math.ceil(e.data1.length/8):i=10;i<10;i++){let a=Cs[i][o];if(a.data_len>=r)return bs(a)}for(e.data10?r=Math.ceil(e.data10.length/8):i=27;i<27;i++){let a=Cs[i][o];if(a.data_len>=r)return bs(a)}for(r=Math.ceil(e.data27.length/8);i<41;i++){let a=Cs[i][o];if(a.data_len>=r)return bs(a)}throw new Error("Too much data")}function h4(e,o){const i=new Uint8ClampedArray(o.data_len);let r;o.version<10?r=e.data1:o.version<27?r=e.data10:r=e.data27;const a=r.length;for(let c=0;c{const d=i.slice(l,l+c);return l+=c,o.ec.push(o4(d,o.ec_len)),d}),o}function p4(e,o,i){o=Sp.includes(o)?o:"M";const r=tl(e,i),a=h4(r,u4(r,o));return d4(a)}const bs=typeof structuredClone<"u"?structuredClone:e=>JSON.parse(JSON.stringify(e)),f4=[[],[26,7,1,10,1,13,1,17,1],[44,10,1,16,1,22,1,28,1],[70,15,1,26,1,36,2,44,2],[100,20,1,36,2,52,2,64,4],[134,26,1,48,2,72,4,88,4],[172,36,2,64,4,96,4,112,4],[196,40,2,72,4,108,6,130,5],[242,48,2,88,4,132,6,156,6],[292,60,2,110,5,160,8,192,8],[346,72,4,130,5,192,8,224,8],[404,80,4,150,5,224,8,264,11],[466,96,4,176,8,260,10,308,11],[532,104,4,198,9,288,12,352,16],[581,120,4,216,9,320,16,384,16],[655,132,6,240,10,360,12,432,18],[733,144,6,280,10,408,17,480,16],[815,168,6,308,11,448,16,532,19],[901,180,6,338,13,504,18,588,21],[991,196,7,364,14,546,21,650,25],[1085,224,8,416,16,600,20,700,25],[1156,224,8,442,17,644,23,750,25],[1258,252,9,476,17,690,23,816,34],[1364,270,9,504,18,750,25,900,30],[1474,300,10,560,20,810,27,960,32],[1588,312,12,588,21,870,29,1050,35],[1706,336,12,644,23,952,34,1110,37],[1828,360,12,700,25,1020,34,1200,40],[1921,390,13,728,26,1050,35,1260,42],[2051,420,14,784,28,1140,38,1350,45],[2185,450,15,812,29,1200,40,1440,48],[2323,480,16,868,31,1290,43,1530,51],[2465,510,17,924,33,1350,45,1620,54],[2611,540,18,980,35,1440,48,1710,57],[2761,570,19,1036,37,1530,51,1800,60],[2876,570,19,1064,38,1590,53,1890,63],[3034,600,20,1120,40,1680,56,1980,66],[3196,630,21,1204,43,1770,59,2100,70],[3362,660,22,1260,45,1860,62,2220,74],[3532,720,24,1316,47,1950,65,2310,77],[3706,750,25,1372,49,2040,68,2430,81]],Cs=f4.map((e,o)=>{if(!o)return Object.create(null);const i=Object.create(null);for(let r=1;r<8;r+=2){const a=e[0]-e[r],s=e[r+1],l=Sp[r/2|0],c={version:o,ec_level:l,data_len:a,ec_len:e[r]/s,blocks:[],ec:[]};for(let d=s,u=a;d>0;d--){const h=u/d|0;c.blocks.push(h),u-=h}i[l]=c}return i});var ks={exports:{}},ru,au;function m4(){return au||(au=1,ru={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),ru}var ws={exports:{}},su,lu;function g4(){return lu||(lu=1,su=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")}),su}var cu;function y4(){if(cu)return ws.exports;cu=1;var e=g4(),o=Array.prototype.concat,i=Array.prototype.slice,r=ws.exports=function(a){for(var s=[],l=0,c=a.length;l=4&&d[3]!==1&&(u=", "+d[3]),"hwb("+d[0]+", "+d[1]+"%, "+d[2]+"%"+u+")"},s.to.keyword=function(d){return r[d.slice(0,3)]};function l(d,u,h){return Math.min(Math.max(u,d),h)}function c(d){var u=Math.round(d).toString(16).toUpperCase();return u.length<2?"0"+u:u}return ks.exports}var _4=v4();const uu=va(_4);function b4(e){return{...(e?.type??"png")==="png"?w4:S4,...e}}function Ss(e){return typeof e=="string"?uu.to.hex(uu.get.rgb(e)):`#${(e>>>8).toString(16).padStart(6,"0")}`}const xp=(e,o)=>["M",e,o],Ep=()=>["z"],Xn=(e,o,i,r=0)=>e>0?["a",e,e,0,0,r,o,i]:[],Kr=e=>["v",e],Qr=e=>["h",e];function C4(e,o=0,i=0,r=0){const a=e.length*o+i*2;let s=7;const l=[[0,0],[1,0],[0,1]],c=[];for(const d of l){const[u,h]=d.map(f=>f==0?1:-1);for(const f of[0,1,2]){let v=a*d[0]+u*(i+o*f),_=a*d[1]+h*(i+o*f);const b=u*(o*(s-2*f)-2*r),C=h*(o*(s-2*f)-2*r);let D=[xp(v,_+r*h),Kr(C),Xn(r,r*u,r*h,d[1]|d[0]),Qr(b),Xn(r,r*u,-r*h,d[1]|d[0]),Kr(-C),Xn(r,-r*u,-r*h,d[1]|d[0]),Qr(-b),Xn(r,-r*u,r*h,d[1]|d[0]),Ep()];c.push(...D.flat())}}return c.join(" ")}function k4(e,o,i=0,r=0){let a=[];for(let s=0;s{let o={};return e.forEach((i,r)=>o[i]=r),o})(Ei),M4=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ue=String.fromCharCode.bind(String),fu=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Np=e=>e.replace(/=/g,"").replace(/[+\/]/g,o=>o=="+"?"-":"_"),Tp=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Ip=e=>{let o,i,r,a,s="";const l=e.length%3;for(let c=0;c255||(r=e.charCodeAt(c++))>255||(a=e.charCodeAt(c++))>255)throw new TypeError("invalid character found");o=i<<16|r<<8|a,s+=Ei[o>>18&63]+Ei[o>>12&63]+Ei[o>>6&63]+Ei[o&63]}return l?s.slice(0,l-3)+"===".substring(l):s},oc=typeof btoa=="function"?e=>btoa(e):di?e=>ze.from(e,"binary").toString("base64"):Ip,nl=di?e=>ze.from(e).toString("base64"):e=>{let o=[];for(let i=0,r=e.length;io?Np(nl(e)):nl(e),A4=e=>{if(e.length<2){var o=e.charCodeAt(0);return o<128?e:o<2048?ue(192|o>>>6)+ue(128|o&63):ue(224|o>>>12&15)+ue(128|o>>>6&63)+ue(128|o&63)}else{var o=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return ue(240|o>>>18&7)+ue(128|o>>>12&63)+ue(128|o>>>6&63)+ue(128|o&63)}},N4=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Op=e=>e.replace(N4,A4),mu=di?e=>ze.from(e,"utf8").toString("base64"):pu?e=>nl(pu.encode(e)):e=>oc(Op(e)),Go=(e,o=!1)=>o?Np(mu(e)):mu(e),gu=e=>Go(e,!0),T4=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,I4=e=>{switch(e.length){case 4:var o=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),i=o-65536;return ue((i>>>10)+55296)+ue((i&1023)+56320);case 3:return ue((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return ue((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Lp=e=>e.replace(T4,I4),Dp=e=>{if(e=e.replace(/\s+/g,""),!M4.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let o,i="",r,a;for(let s=0;s>16&255):a===64?ue(o>>16&255,o>>8&255):ue(o>>16&255,o>>8&255,o&255);return i},ic=typeof atob=="function"?e=>atob(Tp(e)):di?e=>ze.from(e,"base64").toString("binary"):Dp,Pp=di?e=>fu(ze.from(e,"base64")):e=>fu(ic(e).split("").map(o=>o.charCodeAt(0))),Rp=e=>Pp(Bp(e)),O4=di?e=>ze.from(e,"base64").toString("utf8"):hu?e=>hu.decode(Pp(e)):e=>Lp(ic(e)),Bp=e=>Tp(e.replace(/[-_]/g,o=>o=="-"?"+":"/")),ol=e=>O4(Bp(e)),L4=e=>{if(typeof e!="string")return!1;const o=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(o)||!/[^\s0-9a-zA-Z\-_]/.test(o)},$p=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),Vp=function(){const e=(o,i)=>Object.defineProperty(String.prototype,o,$p(i));e("fromBase64",function(){return ol(this)}),e("toBase64",function(o){return Go(this,o)}),e("toBase64URI",function(){return Go(this,!0)}),e("toBase64URL",function(){return Go(this,!0)}),e("toUint8Array",function(){return Rp(this)})},Up=function(){const e=(o,i)=>Object.defineProperty(Uint8Array.prototype,o,$p(i));e("toBase64",function(o){return Ir(this,o)}),e("toBase64URI",function(){return Ir(this,!0)}),e("toBase64URL",function(){return Ir(this,!0)})},D4=()=>{Vp(),Up()},P4={version:Ap,VERSION:x4,atob:ic,atobPolyfill:Dp,btoa:oc,btoaPolyfill:Ip,fromBase64:ol,toBase64:Go,encode:Go,encodeURI:gu,encodeURL:gu,utob:Op,btou:Lp,decode:ol,isValid:L4,fromUint8Array:Ir,toUint8Array:Rp,extendString:Vp,extendUint8Array:Up,extendBuiltins:D4};function R4(e,o={}){const i=b4({...o,type:"svg"});let r=p4(e,i.ec_level,i.parse_url);return r=q5(r),i.logo&&i.logoWidth&&i.logoHeight&&!i.noExcavate&&(r=Z5(r,i.logoWidth,i.logoHeight)),$4({matrix:r,...i})}const B4=new TextEncoder;function $4({matrix:e,margin:o,size:i,logo:r,logoWidth:a,logoHeight:s,color:l,bgColor:c,imageWidth:d,imageHeight:u,borderRadius:h}){const f=i||9,v=e.length*f,_=o*f,b=v+2*_,C=d?` width="${d}"`:"",D=u?` height="${d}"`:"",L='',B=``,X=V4(e,{color:l,bgColor:c,size:b,margin:o,blockSize:f,borderRadius:h}),nt="",Z=r?U4(r,_,v,a,s):"";return B4.encode(L+B+X+Z+nt)}function V4(e,o){const i=k4(e,o.blockSize,o.margin*o.blockSize,o.borderRadius),r=C4(e,o.blockSize,o.margin*o.blockSize,o.borderRadius);let a=``;return a+=``,a+=``,a}function U4(e,o,i,r,a){const s=`data:image/png;base64,${P4.fromUint8Array(new Uint8Array(e))}`,l=r/100*i,c=a/100*i;return``}const z4={name:"CakeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},H4=["aria-hidden","aria-label"],G4=["fill","width","height"],Y4={d:"M11.5,0.5C12,0.75 13,2.4 13,3.5C13,4.6 12.33,5 11.5,5C10.67,5 10,4.85 10,3.75C10,2.65 11,2 11.5,0.5M18.5,9C21,9 23,11 23,13.5C23,15.06 22.21,16.43 21,17.24V23H12L3,23V17.24C1.79,16.43 1,15.06 1,13.5C1,11 3,9 5.5,9H10V6H13V9H18.5M12,16A2.5,2.5 0 0,0 14.5,13.5H16A2.5,2.5 0 0,0 18.5,16A2.5,2.5 0 0,0 21,13.5A2.5,2.5 0 0,0 18.5,11H5.5A2.5,2.5 0 0,0 3,13.5A2.5,2.5 0 0,0 5.5,16A2.5,2.5 0 0,0 8,13.5H9.5A2.5,2.5 0 0,0 12,16Z"},F4={key:0};function X4(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon cake-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",Y4,[i.title?(p(),w("title",F4,O(i.title),1)):R("",!0)])],8,G4))],16,H4)}const W4=tt(z4,[["render",X4]]),j4={name:"EyeCircleOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},q4=["aria-hidden","aria-label"],Z4=["fill","width","height"],J4={d:"M12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,11A1,1 0 0,1 13,12A1,1 0 0,1 12,13A1,1 0 0,1 11,12A1,1 0 0,1 12,11M12,8C14.63,8 17,9.57 18,12C16.62,15.31 12.81,16.88 9.5,15.5C7.92,14.84 6.66,13.58 6,12C7,9.57 9.37,8 12,8M12,9.5A2.5,2.5 0 0,0 9.5,12A2.5,2.5 0 0,0 12,14.5A2.5,2.5 0 0,0 14.5,12A2.5,2.5 0 0,0 12,9.5"},K4={key:0};function Q4(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon eye-circle-outline-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",J4,[i.title?(p(),w("title",K4,O(i.title),1)):R("",!0)])],8,Z4))],16,q4)}const t3=tt(j4,[["render",Q4]]),e3={name:"FolderMultipleImageIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},n3=["aria-hidden","aria-label"],o3=["fill","width","height"],i3={d:"M7,15L11.5,9L15,13.5L17.5,10.5L21,15M22,4H14L12,2H6A2,2 0 0,0 4,4V16A2,2 0 0,0 6,18H22A2,2 0 0,0 24,16V6A2,2 0 0,0 22,4M2,6H0V11H0V20A2,2 0 0,0 2,22H20V20H2V6Z"},r3={key:0};function a3(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon folder-multiple-image-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",i3,[i.title?(p(),w("title",r3,O(i.title),1)):R("",!0)])],8,o3))],16,n3)}const s3=tt(e3,[["render",a3]]),l3={name:"QrcodeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},c3=["aria-hidden","aria-label"],d3=["fill","width","height"],u3={d:"M3,11H5V13H3V11M11,5H13V9H11V5M9,11H13V15H11V13H9V11M15,11H17V13H19V11H21V13H19V15H21V19H19V21H17V19H13V21H11V17H15V15H17V13H15V11M19,19V15H17V19H19M15,3H21V9H15V3M17,5V7H19V5H17M3,3H9V9H3V3M5,5V7H7V5H5M3,15H9V21H3V15M5,17V19H7V17H5Z"},h3={key:0};function p3(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon qrcode-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",u3,[i.title?(p(),w("title",h3,O(i.title),1)):R("",!0)])],8,d3))],16,c3)}const f3=tt(l3,[["render",p3]]),m3={name:"TrayArrowDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},g3=["aria-hidden","aria-label"],y3=["fill","width","height"],v3={d:"M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z"},_3={key:0};function b3(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon tray-arrow-down-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",v3,[i.title?(p(),w("title",_3,O(i.title),1)):R("",!0)])],8,y3))],16,g3)}const Aa=tt(m3,[["render",b3]]),C3={name:"ChevronLeftIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},k3=["aria-hidden","aria-label"],w3=["fill","width","height"],S3={d:"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z"},x3={key:0};function E3(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon chevron-left-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",S3,[i.title?(p(),w("title",x3,O(i.title),1)):R("",!0)])],8,w3))],16,k3)}const M3=tt(C3,[["render",E3]]),A3={name:"DotsHorizontalIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},N3=["aria-hidden","aria-label"],T3=["fill","width","height"],I3={d:"M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"},O3={key:0};function L3(e,o,i,r,a,s){return p(),w("span",ht(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon dots-horizontal-icon",role:"img",onClick:o[0]||(o[0]=l=>e.$emit("click",l))}),[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[I("path",I3,[i.title?(p(),w("title",O3,O(i.title),1)):R("",!0)])],8,T3))],16,N3)}const D3=tt(A3,[["render",L3]]),P3={name:"ContactDetailsAddNewProp",components:{IconAdd:li,PropertyTitleIcon:Tm,Actions:oo,ActionButton:Ln,ChevronLeft:M3,DotsHorizontalIcon:D3},mixins:[Nm],props:{contact:{type:Sl,default:null},bus:{type:Object,required:!0}},data(){return{moreActionsOpen:!1}},computed:{properties(){return sn.properties},propertiesOrder(){return sn.fieldOrder},usedProperties(){return this.contact.jCal[1].map(e=>e[0])},availablePrimaryProperties(){return Object.keys(this.properties).filter(e=>this.properties[e].primary).map(e=>({id:e,name:this.properties[e].readableName,icon:this.properties[e].icon})).sort((e,o)=>this.propertiesOrder.indexOf(e.id)-this.propertiesOrder.indexOf(o.id))},availableSecondaryProperties(){return Object.keys(this.properties).filter(e=>!this.properties[e].primary).map(e=>({id:e,name:this.properties[e].readableName,icon:this.properties[e].icon})).sort((e,o)=>e.name.localeCompare(o.name))}},created(){this.bus.on("add-prop",this.addProp)},unmounted(){this.bus.off("add-prop",this.addProp)},methods:{async addProp(e){if(this.usedProperties.includes(e)&&!this.properties[e].multiple){this.bus.emit("focus-prop",e);return}if(e==="x-managersname"){const o=this.otherContacts(this.contact);o.length===1?(await this.contact.vCard.addPropertyWithValue(e,o[0].key),await this.$store.dispatch("updateContact",this.contact)):await this.contact.vCard.addPropertyWithValue(e,"")}else if(this.properties[e]&&this.properties[e].defaultjCal&&this.properties[e].defaultjCal[this.contact.version]){const o=this.properties[e].defaultjCal[this.contact.version],i=new xl.Property([e,...o]);await this.contact.vCard.addProperty(i)}else{const o=this.properties[e].defaultValue;let i=o?o.value:"";Array.isArray(i)&&(i=[...i]);const r=await this.contact.vCard.addPropertyWithValue(e,i);o&&o.type&&r.setParameter("type",o.type)}this.moreActionsOpen=!1,this.bus.emit("focus-prop",e)}}},R3={class:"property__row"},B3={class:"property__value"};function $3(e,o,i,r,a,s){const l=k("IconAdd"),c=k("PropertyTitleIcon"),d=k("ActionButton"),u=k("DotsHorizontalIcon"),h=k("ChevronLeft"),f=k("Actions");return p(),w("div",R3,[o[3]||(o[3]=I("div",{class:"property__label"},null,-1)),I("div",B3,[A(f,{"menu-align":"right",event:"",variant:"secondary","menu-name":e.t("contacts","Add more info"),onClick:o[2]||(o[2]=Zt(()=>{},["prevent"]))},{icon:S(()=>[A(l,{size:20})]),default:S(()=>[a.moreActionsOpen?R("",!0):(p(),w(mt,{key:0},[(p(!0),w(mt,null,Dt(s.availablePrimaryProperties,v=>(p(),N(d,{key:v.id,class:"action--primary","close-after-click":!0,onClick:Zt(_=>s.addProp(v.id),["prevent"])},{icon:S(()=>[A(c,{icon:v.icon},null,8,["icon"])]),default:S(()=>[q(" "+O(v.name),1)]),_:2},1032,["onClick"]))),128)),A(d,{"close-after-click":!1,onClick:o[0]||(o[0]=v=>a.moreActionsOpen=!0)},{icon:S(()=>[A(u,{title:e.t("contacts","More fields"),size:20},null,8,["title"])]),default:S(()=>[q(" "+O(e.t("contacts","More fields")),1)]),_:1})],64)),a.moreActionsOpen?(p(),w(mt,{key:1},[A(d,{"close-after-click":!1,onClick:o[1]||(o[1]=v=>a.moreActionsOpen=!1)},{icon:S(()=>[A(h,{title:e.t("contacts","More fields"),size:20},null,8,["title"]),q(" "+O(e.t("contacts","More fields")),1)]),_:1}),(p(!0),w(mt,null,Dt(s.availableSecondaryProperties,v=>(p(),N(d,{key:v.id,class:"action--primary","close-after-click":!0,onClick:Zt(_=>s.addProp(v.id),["prevent"])},{icon:S(()=>[A(c,{icon:v.icon},null,8,["icon"])]),default:S(()=>[q(" "+O(v.name),1)]),_:2},1032,["onClick"]))),128))],64)):R("",!0)]),_:1},8,["menu-name"])]),o[4]||(o[4]=I("div",{class:"property__actions"},null,-1))])}const V3=tt(P3,[["render",$3]]);var fr={},yu={exports:{}},vu={};const ei=Symbol(""),Yo=Symbol(""),Na=Symbol(""),Vi=Symbol(""),rc=Symbol(""),eo=Symbol(""),ac=Symbol(""),sc=Symbol(""),Ta=Symbol(""),Ia=Symbol(""),ui=Symbol(""),Oa=Symbol(""),lc=Symbol(""),La=Symbol(""),Da=Symbol(""),Pa=Symbol(""),Ra=Symbol(""),Ba=Symbol(""),$a=Symbol(""),cc=Symbol(""),dc=Symbol(""),Ji=Symbol(""),Ui=Symbol(""),Va=Symbol(""),Ua=Symbol(""),ni=Symbol(""),hi=Symbol(""),za=Symbol(""),ta=Symbol(""),zp=Symbol(""),ea=Symbol(""),zi=Symbol(""),Hp=Symbol(""),Gp=Symbol(""),Ha=Symbol(""),Yp=Symbol(""),Fp=Symbol(""),Ga=Symbol(""),uc=Symbol(""),xo={[ei]:"Fragment",[Yo]:"Teleport",[Na]:"Suspense",[Vi]:"KeepAlive",[rc]:"BaseTransition",[eo]:"openBlock",[ac]:"createBlock",[sc]:"createElementBlock",[Ta]:"createVNode",[Ia]:"createElementVNode",[ui]:"createCommentVNode",[Oa]:"createTextVNode",[lc]:"createStaticVNode",[La]:"resolveComponent",[Da]:"resolveDynamicComponent",[Pa]:"resolveDirective",[Ra]:"resolveFilter",[Ba]:"withDirectives",[$a]:"renderList",[cc]:"renderSlot",[dc]:"createSlots",[Ji]:"toDisplayString",[Ui]:"mergeProps",[Va]:"normalizeClass",[Ua]:"normalizeStyle",[ni]:"normalizeProps",[hi]:"guardReactiveProps",[za]:"toHandlers",[ta]:"camelize",[zp]:"capitalize",[ea]:"toHandlerKey",[zi]:"setBlockTracking",[Hp]:"pushScopeId",[Gp]:"popScopeId",[Ha]:"withCtx",[Yp]:"unref",[Fp]:"isRef",[Ga]:"withMemo",[uc]:"isMemoSame"};function Xp(e){Object.getOwnPropertySymbols(e).forEach(o=>{xo[o]=e[o]})}const U3={HTML:0,0:"HTML",SVG:1,1:"SVG",MATH_ML:2,2:"MATH_ML"},z3={ROOT:0,0:"ROOT",ELEMENT:1,1:"ELEMENT",TEXT:2,2:"TEXT",COMMENT:3,3:"COMMENT",SIMPLE_EXPRESSION:4,4:"SIMPLE_EXPRESSION",INTERPOLATION:5,5:"INTERPOLATION",ATTRIBUTE:6,6:"ATTRIBUTE",DIRECTIVE:7,7:"DIRECTIVE",COMPOUND_EXPRESSION:8,8:"COMPOUND_EXPRESSION",IF:9,9:"IF",IF_BRANCH:10,10:"IF_BRANCH",FOR:11,11:"FOR",TEXT_CALL:12,12:"TEXT_CALL",VNODE_CALL:13,13:"VNODE_CALL",JS_CALL_EXPRESSION:14,14:"JS_CALL_EXPRESSION",JS_OBJECT_EXPRESSION:15,15:"JS_OBJECT_EXPRESSION",JS_PROPERTY:16,16:"JS_PROPERTY",JS_ARRAY_EXPRESSION:17,17:"JS_ARRAY_EXPRESSION",JS_FUNCTION_EXPRESSION:18,18:"JS_FUNCTION_EXPRESSION",JS_CONDITIONAL_EXPRESSION:19,19:"JS_CONDITIONAL_EXPRESSION",JS_CACHE_EXPRESSION:20,20:"JS_CACHE_EXPRESSION",JS_BLOCK_STATEMENT:21,21:"JS_BLOCK_STATEMENT",JS_TEMPLATE_LITERAL:22,22:"JS_TEMPLATE_LITERAL",JS_IF_STATEMENT:23,23:"JS_IF_STATEMENT",JS_ASSIGNMENT_EXPRESSION:24,24:"JS_ASSIGNMENT_EXPRESSION",JS_SEQUENCE_EXPRESSION:25,25:"JS_SEQUENCE_EXPRESSION",JS_RETURN_STATEMENT:26,26:"JS_RETURN_STATEMENT"},H3={ELEMENT:0,0:"ELEMENT",COMPONENT:1,1:"COMPONENT",SLOT:2,2:"SLOT",TEMPLATE:3,3:"TEMPLATE"},G3={NOT_CONSTANT:0,0:"NOT_CONSTANT",CAN_SKIP_PATCH:1,1:"CAN_SKIP_PATCH",CAN_CACHE:2,2:"CAN_CACHE",CAN_STRINGIFY:3,3:"CAN_STRINGIFY"},ae={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function Wp(e,o=""){return{type:0,source:o,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:ae}}function oi(e,o,i,r,a,s,l,c=!1,d=!1,u=!1,h=ae){return e&&(c?(e.helper(eo),e.helper(Ao(e.inSSR,u))):e.helper(Mo(e.inSSR,u)),l&&e.helper(Ba)),{type:13,tag:o,props:i,children:r,patchFlag:a,dynamicProps:s,directives:l,isBlock:c,disableTracking:d,isComponent:u,loc:h}}function Jn(e,o=ae){return{type:17,loc:o,elements:e}}function Oe(e,o=ae){return{type:15,loc:o,properties:e}}function Jt(e,o){return{type:16,loc:ae,key:re(e)?gt(e,!0):e,value:o}}function gt(e,o=!1,i=ae,r=0){return{type:4,loc:i,content:e,isStatic:o,constType:o?3:r}}function Y3(e,o){return{type:5,loc:o,content:re(e)?gt(e,!1,o):e}}function Ue(e,o=ae){return{type:8,loc:o,children:e}}function ne(e,o=[],i=ae){return{type:14,loc:i,callee:e,arguments:o}}function Eo(e,o=void 0,i=!1,r=!1,a=ae){return{type:18,params:e,returns:o,newline:i,isSlot:r,loc:a}}function na(e,o,i,r=!0){return{type:19,test:e,consequent:o,alternate:i,newline:r,loc:ae}}function jp(e,o,i=!1,r=!1){return{type:20,index:e,value:o,needPauseTracking:i,inVOnce:r,needArraySpread:!1,loc:ae}}function qp(e){return{type:21,body:e,loc:ae}}function F3(e){return{type:22,elements:e,loc:ae}}function X3(e,o,i){return{type:23,test:e,consequent:o,alternate:i,loc:ae}}function W3(e,o){return{type:24,left:e,right:o,loc:ae}}function j3(e){return{type:25,expressions:e,loc:ae}}function q3(e){return{type:26,returns:e,loc:ae}}function Mo(e,o){return e||o?Ta:Ia}function Ao(e,o){return e||o?ac:sc}function Ya(e,{helper:o,removeHelper:i,inSSR:r}){e.isBlock||(e.isBlock=!0,i(Mo(r,e.isComponent)),o(eo),o(Ao(r,e.isComponent)))}const _u=new Uint8Array([123,123]),bu=new Uint8Array([125,125]);function Cu(e){return e>=97&&e<=122||e>=65&&e<=90}function Ie(e){return e===32||e===10||e===9||e===12||e===13}function Hn(e){return e===47||e===62||Ie(e)}function oa(e){const o=new Uint8Array(e.length);for(let i=0;i100){let l=-1,c=a;for(;l+1>>1;this.newlines[d]=0;l--)if(o>this.newlines[l]){s=l;break}return s>=0&&(i=s+2,r=o-this.newlines[s]),{column:r,line:i,offset:o}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(o){o===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&o===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(o))}stateInterpolationOpen(o){if(o===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const i=this.index+1-this.delimiterOpen.length;i>this.sectionStart&&this.cbs.ontext(this.sectionStart,i),this.state=3,this.sectionStart=i}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(o)):(this.state=1,this.stateText(o))}stateInterpolation(o){o===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(o))}stateInterpolationClose(o){o===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(o))}stateSpecialStartSequence(o){const i=this.sequenceIndex===this.currentSequence.length;if(!(i?Hn(o):(o|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!i){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(o)}stateInRCDATA(o){if(this.sequenceIndex===this.currentSequence.length){if(o===62||Ie(o)){const i=this.index-this.currentSequence.length;if(this.sectionStart=o||(this.state===28?this.currentSequence===fe.CdataEnd?this.cbs.oncdata(this.sectionStart,o):this.cbs.oncomment(this.sectionStart,o):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,o))}emitCodePoint(o,i){}}const J3={COMPILER_IS_ON_ELEMENT:"COMPILER_IS_ON_ELEMENT",COMPILER_V_BIND_SYNC:"COMPILER_V_BIND_SYNC",COMPILER_V_BIND_OBJECT_ORDER:"COMPILER_V_BIND_OBJECT_ORDER",COMPILER_V_ON_NATIVE:"COMPILER_V_ON_NATIVE",COMPILER_V_IF_V_FOR_PRECEDENCE:"COMPILER_V_IF_V_FOR_PRECEDENCE",COMPILER_NATIVE_TEMPLATE:"COMPILER_NATIVE_TEMPLATE",COMPILER_INLINE_TEMPLATE:"COMPILER_INLINE_TEMPLATE",COMPILER_FILTERS:"COMPILER_FILTERS"},K3={COMPILER_IS_ON_ELEMENT:{message:'Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".',link:"https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html"},COMPILER_V_BIND_SYNC:{message:e=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${e}.sync\` should be changed to \`v-model:${e}\`.`,link:"https://v3-migration.vuejs.org/breaking-changes/v-model.html"},COMPILER_V_BIND_OBJECT_ORDER:{message:'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',link:"https://v3-migration.vuejs.org/breaking-changes/v-bind.html"},COMPILER_V_ON_NATIVE:{message:".native modifier for v-on has been removed as is no longer necessary.",link:"https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"},COMPILER_V_IF_V_FOR_PRECEDENCE:{message:"v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with