95 lines
557 KiB
JavaScript
95 lines
557 KiB
JavaScript
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<r.defaultSize}]),style:Nl(s.cssVars)},[A(l,ht(e.$attrs,{"disable-menu":!0,"disable-tooltip":!0,"display-name":i.displayName||i.name,"is-no-user":i.isNoUser,size:i.avatarSize,class:"option__avatar"}),null,16,["display-name","is-no-user","size"]),I("div",X0,[A(c,{class:"option__lineone",text:i.name,search:s.searchParts[0]},null,8,["text","search"]),s.isValidSubname&&s.isSizeBigEnough?(p(),N(c,{key:0,class:"option__linetwo",text:i.subname,search:s.searchParts[1]},null,8,["text","search"])):e.hasStatus?(p(),w("span",W0,[I("span",null,O(e.userStatus.icon),1),I("span",null,O(e.userStatus.message),1)])):R("",!0)]),At(e.$slots,"default",{},()=>[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===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 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<o;++e){if(!(r=arguments[e]+"")||r in i||/[\s.]/.test(r))throw new Error("illegal type: "+r);i[r]=[]}return new xr(i)}function xr(e){this._=e}function cy(e,o){return e.trim().split(/^|\s+/).map(function(i){var r="",a=i.indexOf(".");if(a>=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(;++s<l;)if((a=(e=r[s]).type)&&(a=dy(i[a],e.name)))return a;return}if(o!=null&&typeof o!="function")throw new Error("invalid callback: "+o);for(;++s<l;)if(a=(e=r[s]).type)i[a]=Od(i[a],e.name,o);else if(o==null)for(a in i)i[a]=Od(i[a],e.name,null);return this},copy:function(){var e={},o=this._;for(var i in o)e[i]=o[i].slice();return new xr(e)},call:function(e,o){if((a=arguments.length-2)>0)for(var i=new Array(a),r=0,a,s;r<a;++r)i[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,a=s.length;r<a;++r)s[r].value.apply(o,i)},apply:function(e,o,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,s=r.length;a<s;++a)r[a].value.apply(o,i)}};function dy(e,o){for(var i=0,r=e.length,a;i<r;++i)if((a=e[i]).name===o)return a.value}function Od(e,o,i){for(var r=0,a=e.length;r<a;++r)if(e[r].name===o){e[r]=ly,e=e.slice(0,r).concat(e.slice(r+1));break}return i!=null&&e.push({name:o,value:i}),e}var Us="http://www.w3.org/1999/xhtml";const Ld={svg:"http://www.w3.org/2000/svg",xhtml:Us,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function wa(e){var o=e+="",i=o.indexOf(":");return i>=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<i;++a)for(var s=o[a],l=s.length,c=r[a]=new Array(l),d,u,h=0;h<l;++h)(d=s[h])&&(u=e.call(d,d.__data__,h,s))&&("__data__"in d&&(u.__data__=d.__data__),c[h]=u);return new De(r,this._parents)}function my(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function gy(){return[]}function Ih(e){return e==null?gy:function(){return this.querySelectorAll(e)}}function yy(e){return function(){return my(e.apply(this,arguments))}}function vy(e){typeof e=="function"?e=yy(e):e=Ih(e);for(var o=this._groups,i=o.length,r=[],a=[],s=0;s<i;++s)for(var l=o[s],c=l.length,d,u=0;u<c;++u)(d=l[u])&&(r.push(e.call(d,d.__data__,u,l)),a.push(d));return new De(r,a)}function Oh(e){return function(){return this.matches(e)}}function Lh(e){return function(o){return o.matches(e)}}var _y=Array.prototype.find;function by(e){return function(){return _y.call(this.children,e)}}function Cy(){return this.firstElementChild}function ky(e){return this.select(e==null?Cy:by(typeof e=="function"?e:Lh(e)))}var wy=Array.prototype.filter;function Sy(){return Array.from(this.children)}function xy(e){return function(){return wy.call(this.children,e)}}function Ey(e){return this.selectAll(e==null?Sy:xy(typeof e=="function"?e:Lh(e)))}function My(e){typeof e!="function"&&(e=Oh(e));for(var o=this._groups,i=o.length,r=new Array(i),a=0;a<i;++a)for(var s=o[a],l=s.length,c=r[a]=[],d,u=0;u<l;++u)(d=s[u])&&e.call(d,d.__data__,u,s)&&c.push(d);return new De(r,this._parents)}function Dh(e){return new Array(e.length)}function Ay(){return new De(this._enter||this._groups.map(Dh),this._parents)}function Yr(e,o){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=o}Yr.prototype={constructor:Yr,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,o){return this._parent.insertBefore(e,o)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Ny(e){return function(){return e}}function Ty(e,o,i,r,a,s){for(var l=0,c,d=o.length,u=s.length;l<u;++l)(c=o[l])?(c.__data__=s[l],r[l]=c):i[l]=new Yr(e,s[l]);for(;l<d;++l)(c=o[l])&&(a[l]=c)}function Iy(e,o,i,r,a,s,l){var c,d,u=new Map,h=o.length,f=s.length,v=new Array(h),_;for(c=0;c<h;++c)(d=o[c])&&(v[c]=_=l.call(d,d.__data__,c,o)+"",u.has(_)?a[c]=d:u.set(_,d));for(c=0;c<f;++c)_=l.call(e,s[c],c,s)+"",(d=u.get(_))?(r[c]=d,d.__data__=s[c],u.delete(_)):i[c]=new Yr(e,s[c]);for(c=0;c<h;++c)(d=o[c])&&u.get(v[c])===d&&(a[c]=d)}function Oy(e){return e.__data__}function Ly(e,o){if(!arguments.length)return Array.from(this,Oy);var i=o?Iy:Ty,r=this._parents,a=this._groups;typeof e!="function"&&(e=Ny(e));for(var s=a.length,l=new Array(s),c=new Array(s),d=new Array(s),u=0;u<s;++u){var h=r[u],f=a[u],v=f.length,_=Dy(e.call(h,h&&h.__data__,u,r)),b=_.length,C=c[u]=new Array(b),D=l[u]=new Array(b),L=d[u]=new Array(v);i(h,f,C,D,L,_,o);for(var B=0,X=0,nt,Z;B<b;++B)if(nt=C[B]){for(B>=X&&(X=B+1);!(Z=D[X])&&++X<b;);nt._next=Z||null}}return l=new De(l,r),l._enter=c,l._exit=d,l}function Dy(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Py(){return new De(this._exit||this._groups.map(Dh),this._parents)}function Ry(e,o,i){var r=this.enter(),a=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),o!=null&&(a=o(a),a&&(a=a.selection())),i==null?s.remove():i(s),r&&a?r.merge(a).order():a}function By(e){for(var o=e.selection?e.selection():e,i=this._groups,r=o._groups,a=i.length,s=r.length,l=Math.min(a,s),c=new Array(a),d=0;d<l;++d)for(var u=i[d],h=r[d],f=u.length,v=c[d]=new Array(f),_,b=0;b<f;++b)(_=u[b]||h[b])&&(v[b]=_);for(;d<a;++d)c[d]=i[d];return new De(c,this._parents)}function $y(){for(var e=this._groups,o=-1,i=e.length;++o<i;)for(var r=e[o],a=r.length-1,s=r[a],l;--a>=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;s<r;++s){for(var l=i[s],c=l.length,d=a[s]=new Array(c),u,h=0;h<c;++h)(u=l[h])&&(d[h]=u);d.sort(o)}return new De(a,this._parents).order()}function Uy(e,o){return e<o?-1:e>o?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;o<i;++o)for(var r=e[o],a=0,s=r.length;a<s;++a){var l=r[a];if(l)return l}return null}function Yy(){let e=0;for(const o of this)++e;return e}function Fy(){return!this.node()}function Xy(e){for(var o=this._groups,i=0,r=o.length;i<r;++i)for(var a=o[i],s=0,l=a.length,c;s<l;++s)(c=a[s])&&e.call(c,c.__data__,s,a);return this}function Wy(e){return function(){this.removeAttribute(e)}}function jy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function qy(e,o){return function(){this.setAttribute(e,o)}}function Zy(e,o){return function(){this.setAttributeNS(e.space,e.local,o)}}function Jy(e,o){return function(){var i=o.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function Ky(e,o){return function(){var i=o.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function Qy(e,o){var i=wa(e);if(arguments.length<2){var r=this.node();return i.local?r.getAttributeNS(i.space,i.local):r.getAttribute(i)}return this.each((o==null?i.local?jy:Wy:typeof o=="function"?i.local?Ky:Jy:i.local?Zy:qy)(i,o))}function Ph(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function t2(e){return function(){this.style.removeProperty(e)}}function e2(e,o,i){return function(){this.style.setProperty(e,o,i)}}function n2(e,o,i){return function(){var r=o.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,i)}}function o2(e,o,i){return arguments.length>1?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<a;)i.add(o[r])}function Vh(e,o){for(var i=Gl(e),r=-1,a=o.length;++r<a;)i.remove(o[r])}function l2(e){return function(){$h(this,e)}}function c2(e){return function(){Vh(this,e)}}function d2(e,o){return function(){(o.apply(this,arguments)?$h:Vh)(this,e)}}function u2(e,o){var i=Rh(e+"");if(arguments.length<2){for(var r=Gl(this.node()),a=-1,s=i.length;++a<s;)if(!r.contains(i[a]))return!1;return!0}return this.each((typeof o=="function"?d2:o?l2:c2)(i,o))}function h2(){this.textContent=""}function p2(e){return function(){this.textContent=e}}function f2(e){return function(){var o=e.apply(this,arguments);this.textContent=o??""}}function m2(e){return arguments.length?this.each(e==null?h2:(typeof e=="function"?f2:p2)(e)):this.node().textContent}function g2(){this.innerHTML=""}function y2(e){return function(){this.innerHTML=e}}function v2(e){return function(){var o=e.apply(this,arguments);this.innerHTML=o??""}}function _2(e){return arguments.length?this.each(e==null?g2:(typeof e=="function"?v2:y2)(e)):this.node().innerHTML}function b2(){this.nextSibling&&this.parentNode.appendChild(this)}function C2(){return this.each(b2)}function k2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function w2(){return this.each(k2)}function S2(e){var o=typeof e=="function"?e:Th(e);return this.select(function(){return this.appendChild(o.apply(this,arguments))})}function x2(){return null}function E2(e,o){var i=typeof e=="function"?e:Th(e),r=o==null?x2:typeof o=="function"?o:Hl(o);return this.select(function(){return this.insertBefore(i.apply(this,arguments),r.apply(this,arguments)||null)})}function M2(){var e=this.parentNode;e&&e.removeChild(this)}function A2(){return this.each(M2)}function N2(){var e=this.cloneNode(!1),o=this.parentNode;return o?o.insertBefore(e,this.nextSibling):e}function T2(){var e=this.cloneNode(!0),o=this.parentNode;return o?o.insertBefore(e,this.nextSibling):e}function I2(e){return this.select(e?T2:N2)}function O2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function L2(e){return function(o){e.call(this,o,this.__data__)}}function D2(e){return e.trim().split(/^|\s+/).map(function(o){var i="",r=o.indexOf(".");return 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<a;++i)s=o[i],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):o[++r]=s;++r?o.length=r:delete this.__on}}}function R2(e,o,i){return function(){var r=this.__on,a,s=L2(o);if(r){for(var l=0,c=r.length;l<c;++l)if((a=r[l]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=s,a.options=i),a.value=o;return}}this.addEventListener(e.type,s,i),a={type:e.type,name:e.name,value:o,listener:s,options:i},r?r.push(a):this.__on=[a]}}function B2(e,o,i){var r=D2(e+""),a,s=r.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var d=0,u=c.length,h;d<u;++d)for(a=0,h=c[d];a<s;++a)if((l=r[a]).type===h.type&&l.name===h.name)return h.value}return}for(c=o?R2:P2,a=0;a<s;++a)this.each(c(r[a],o,i));return this}function Uh(e,o,i){var r=Ph(e),a=r.CustomEvent;typeof a=="function"?a=new a(o,i):(a=r.document.createEvent("Event"),i?(a.initEvent(o,i.bubbles,i.cancelable),a.detail=i.detail):a.initEvent(o,!1,!1)),e.dispatchEvent(a)}function $2(e,o){return function(){return Uh(this,e,o)}}function V2(e,o){return function(){return Uh(this,e,o.apply(this,arguments))}}function U2(e,o){return this.each((typeof o=="function"?V2:$2)(e,o))}function*z2(){for(var e=this._groups,o=0,i=e.length;o<i;++o)for(var r=e[o],a=0,s=r.length,l;a<s;++a)(l=r[a])&&(yield l)}var zh=[null];function De(e,o){this._groups=e,this._parents=o}function Ko(){return new De([[document.documentElement]],zh)}function H2(){return this}De.prototype=Ko.prototype={constructor:De,select:fy,selectAll:vy,selectChild:ky,selectChildren:Ey,filter:My,data:Ly,enter:Ay,exit:Py,join:Ry,merge:By,selection:H2,order:$y,sort:Vy,call:zy,nodes:Hy,node:Gy,size:Yy,empty:Fy,each:Xy,attr:Qy,style:o2,property:s2,classed:u2,text:m2,html:_2,raise:C2,lower:w2,append:S2,insert:E2,remove:A2,clone:I2,datum:O2,on:B2,dispatch:U2,[Symbol.iterator]:z2};function Me(e){return typeof e=="string"?new De([[document.querySelector(e)]],[document.documentElement]):new De([[e]],zh)}function G2(e){let o;for(;o=e.sourceEvent;)e=o;return e}function uo(e,o){if(e=G2(e),o===void 0&&(o=e.currentTarget),o){var i=o.ownerSVGElement||o;if(i.createSVGPoint){var r=i.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(o.getScreenCTM().inverse()),[r.x,r.y]}if(o.getBoundingClientRect){var a=o.getBoundingClientRect();return[e.clientX-a.left-o.clientLeft,e.clientY-a.top-o.clientTop]}}return[e.pageX,e.pageY]}const zs={capture:!0,passive:!1};function Hs(e){e.preventDefault(),e.stopImmediatePropagation()}function Y2(e){var o=e.document.documentElement,i=Me(e).on("dragstart.drag",Hs,zs);"onselectstart"in o?i.on("selectstart.drag",Hs,zs):(o.__noselect=o.style.MozUserSelect,o.style.MozUserSelect="none")}function F2(e,o){var i=e.document.documentElement,r=Me(e).on("dragstart.drag",null);o&&(r.on("click.drag",Hs,zs),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in i?r.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}function Yl(e,o,i){e.prototype=o.prototype=i,i.constructor=e}function Hh(e,o){var i=Object.create(e.prototype);for(var r in o)i[r]=o[r];return i}function Zi(){}var Di=.7,Fr=1/Di,Ho="\\s*([+-]?\\d+)\\s*",Pi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ln="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",X2=/^#([0-9a-f]{3,8})$/,W2=new RegExp(`^rgb\\(${Ho},${Ho},${Ho}\\)$`),j2=new RegExp(`^rgb\\(${ln},${ln},${ln}\\)$`),q2=new RegExp(`^rgba\\(${Ho},${Ho},${Ho},${Pi}\\)$`),Z2=new RegExp(`^rgba\\(${ln},${ln},${ln},${Pi}\\)$`),J2=new RegExp(`^hsl\\(${Pi},${ln},${ln}\\)$`),K2=new RegExp(`^hsla\\(${Pi},${ln},${ln},${Pi}\\)$`),Dd={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Yl(Zi,Ri,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Pd,formatHex:Pd,formatHex8:Q2,formatHsl:tv,formatRgb:Rd,toString:Rd});function Pd(){return this.rgb().formatHex()}function Q2(){return this.rgb().formatHex8()}function tv(){return Gh(this).formatHsl()}function Rd(){return this.rgb().formatRgb()}function Ri(e){var o,i;return e=(e+"").trim().toLowerCase(),(o=X2.exec(e))?(i=o[1].length,o=parseInt(o[1],16),i===6?Bd(o):i===3?new Ae(o>>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+(i<r)*6:i===s?l=(r-o)/c+2:l=(o-i)/c+4,c/=d<.5?s+a:2-s-a,l*=60):c=d>0&&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 i<o.length&&(s=o.slice(i),c[l]?c[l]+=s:c[++l]=s),c.length<2?d[0]?lv(d[0].x):sv(o):(o=d.length,function(u){for(var h=0,f;h<o;++h)c[(f=d[h]).i]=f.x(u);return c.join("")})}var Gd=180/Math.PI,Xh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Wh(e,o,i,r,a,s){var l,c,d;return(l=Math.sqrt(e*e+o*o))&&(e/=l,o/=l),(d=e*i+o*r)&&(i-=e*d,r-=o*d),(c=Math.sqrt(i*i+r*r))&&(i/=c,r/=c,d/=c),e*r<o*i&&(e=-e,o=-o,d=-d,l=-l),{translateX:a,translateY:s,rotate:Math.atan2(o,e)*Gd,skewX:Math.atan(d)*Gd,scaleX:l,scaleY:c}}var dr;function dv(e){const o=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return o.isIdentity?Xh:Wh(o.a,o.b,o.c,o.d,o.e,o.f)}function uv(e){return e==null||(dr||(dr=document.createElementNS("http://www.w3.org/2000/svg","g")),dr.setAttribute("transform",e),!(e=dr.transform.baseVal.consolidate()))?Xh:(e=e.matrix,Wh(e.a,e.b,e.c,e.d,e.e,e.f))}function jh(e,o,i,r){function a(u){return u.length?u.pop()+" ":""}function s(u,h,f,v,_,b){if(u!==f||h!==v){var C=_.push("translate(",null,o,null,i);b.push({i:C-4,x:Gn(u,f)},{i:C-2,x:Gn(h,v)})}else(f||v)&&_.push("translate("+f+o+v+i)}function l(u,h,f,v){u!==h?(u-h>180?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<C;)f[(D=v[b]).i]=D.x(_);return f.join("")}}}var hv=jh(dv,"px, ","px)","deg)"),pv=jh(uv,", ",")",")"),fv=1e-12;function Yd(e){return((e=Math.exp(e))+1/e)/2}function mv(e){return((e=Math.exp(e))-1/e)/2}function gv(e){return((e=Math.exp(2*e))-1)/(e+1)}const yv=(function e(o,i,r){function a(s,l){var c=s[0],d=s[1],u=s[2],h=l[0],f=l[1],v=l[2],_=h-c,b=f-d,C=_*_+b*b,D,L;if(C<fv)L=Math.log(v/u)/o,D=function(st){return[c+st*_,d+st*b,u*Math.exp(o*st*L)]};else{var B=Math.sqrt(C),X=(v*v-u*u+r*C)/(2*u*i*B),nt=(v*v-u*u-r*C)/(2*v*i*B),Z=Math.log(Math.sqrt(X*X+1)-X),rt=Math.log(Math.sqrt(nt*nt+1)-nt);L=(rt-Z)/o,D=function(st){var J=st*L,ot=Yd(Z),lt=u/(i*B)*(ot*gv(o*J+Z)-mv(Z));return[c+lt*_,d+lt*b,u*ot/Yd(o*J+Z)]}}return D.duration=L*1e3*o/Math.SQRT2,D}return a.rho=function(s){var l=Math.max(.001,+s),c=l*l,d=c*c;return e(l,c,d)},a})(Math.SQRT2,2,4);var Qo=0,Si=0,yi=0,qh=1e3,Wr,xi,jr=0,So=0,Sa=0,Bi=typeof performance=="object"&&performance.now?performance:Date,Zh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Fl(){return So||(Zh(vv),So=Bi.now()+Sa)}function vv(){So=0}function qr(){this._call=this._time=this._next=null}qr.prototype=Jh.prototype={constructor:qr,restart:function(e,o,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Fl():+i)+(o==null?0:+o),!this._next&&xi!==this&&(xi?xi._next=this:Wr=this,xi=this),this._call=e,this._time=i,Fs()},stop:function(){this._call&&(this._call=null,this._time=1/0,Fs())}};function Jh(e,o,i){var r=new qr;return r.restart(e,o,i),r}function _v(){Fl(),++Qo;for(var e=Wr,o;e;)(o=So-e._time)>=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]):+h<o&&(_.state=Mr,_.timer.stop(),_.on.call("cancel",e,e.__data__,_.index,_.group),delete r[h])}if(Xd(function(){i.state===Er&&(i.state=jd,i.timer.restart(c,i.delay,i.time),c(u))}),i.state=Xs,i.on.call("start",e,e.__data__,i.index,i.group),i.state===Xs){for(i.state=Er,a=new Array(v=i.tween.length),h=0,f=-1;h<v;++h)(_=i.tween[h].value.call(e,e.__data__,i.index,i.group))&&(a[++f]=_);a.length=f+1}}function c(u){for(var h=u<i.duration?i.ease.call(null,u/i.duration):(i.timer.restart(d),i.state=Ws,1),f=-1,v=a.length;++f<v;)a[f].call(e,h);i.state===Ws&&(i.on.call("end",e,e.__data__,i.index,i.group),d())}function d(){i.state=Mr,i.timer.stop(),delete r[o];for(var u in r)return;delete e.__transition}}function Ar(e,o){var i=e.__transition,r,a,s=!0,l;if(i){o=o==null?null:o+"";for(l in i){if((r=i[l]).name!==o){s=!1;continue}a=r.state>Xs&&r.state<Ws,r.state=Mr,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete i[l]}s&&delete e.__transition}}function xv(e){return this.each(function(){Ar(this,e)})}function Ev(e,o){var i,r;return function(){var a=cn(this,e),s=a.tween;if(s!==i){r=i=s;for(var l=0,c=r.length;l<c;++l)if(r[l].name===o){r=r.slice(),r.splice(l,1);break}}a.tween=r}}function Mv(e,o,i){var r,a;if(typeof i!="function")throw new Error;return function(){var s=cn(this,e),l=s.tween;if(l!==r){a=(r=l).slice();for(var c={name:o,value:i},d=0,u=a.length;d<u;++d)if(a[d].name===o){a[d]=c;break}d===u&&a.push(c)}s.tween=a}}function Av(e,o){var i=this._id;if(e+="",arguments.length<2){for(var r=tn(this.node(),i).tween,a=0,s=r.length,l;a<s;++a)if((l=r[a]).name===e)return l.value;return null}return this.each((o==null?Ev:Mv)(i,e,o))}function Wl(e,o,i){var r=e._id;return e.each(function(){var a=cn(this,r);(a.value||(a.value={}))[o]=i.apply(this,arguments)}),function(a){return tn(a,r).value[o]}}function Qh(e,o){var i;return(typeof o=="number"?Gn:o instanceof Ri?Hd:(i=Ri(o))?(o=i,Hd):cv)(e,o)}function Nv(e){return function(){this.removeAttribute(e)}}function Tv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Iv(e,o,i){var r,a=i+"",s;return function(){var l=this.getAttribute(e);return l===a?null:l===r?s:s=o(r=l,i)}}function Ov(e,o,i){var r,a=i+"",s;return function(){var l=this.getAttributeNS(e.space,e.local);return l===a?null:l===r?s:s=o(r=l,i)}}function Lv(e,o,i){var r,a,s;return function(){var l,c=i(this),d;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),d=c+"",l===d?null:l===r&&d===a?s:(a=d,s=o(r=l,c)))}}function Dv(e,o,i){var r,a,s;return function(){var l,c=i(this),d;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),d=c+"",l===d?null:l===r&&d===a?s:(a=d,s=o(r=l,c)))}}function Pv(e,o){var i=wa(e),r=i==="transform"?pv:Qh;return this.attrTween(e,typeof o=="function"?(i.local?Dv:Lv)(i,r,Wl(this,"attr."+e,o)):o==null?(i.local?Tv:Nv)(i):(i.local?Ov:Iv)(i,r,o))}function Rv(e,o){return function(i){this.setAttribute(e,o.call(this,i))}}function Bv(e,o){return function(i){this.setAttributeNS(e.space,e.local,o.call(this,i))}}function $v(e,o){var i,r;function a(){var s=o.apply(this,arguments);return s!==r&&(i=(r=s)&&Bv(e,s)),i}return a._value=o,a}function Vv(e,o){var i,r;function a(){var s=o.apply(this,arguments);return s!==r&&(i=(r=s)&&Rv(e,s)),i}return a._value=o,a}function Uv(e,o){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(o==null)return this.tween(i,null);if(typeof o!="function")throw new Error;var r=wa(e);return this.tween(i,(r.local?$v:Vv)(r,o))}function zv(e,o){return function(){Xl(this,e).delay=+o.apply(this,arguments)}}function Hv(e,o){return o=+o,function(){Xl(this,e).delay=o}}function Gv(e){var o=this._id;return arguments.length?this.each((typeof e=="function"?zv:Hv)(o,e)):tn(this.node(),o).delay}function Yv(e,o){return function(){cn(this,e).duration=+o.apply(this,arguments)}}function Fv(e,o){return o=+o,function(){cn(this,e).duration=o}}function Xv(e){var o=this._id;return arguments.length?this.each((typeof e=="function"?Yv:Fv)(o,e)):tn(this.node(),o).duration}function Wv(e,o){if(typeof o!="function")throw new Error;return function(){cn(this,e).ease=o}}function jv(e){var o=this._id;return arguments.length?this.each(Wv(o,e)):tn(this.node(),o).ease}function qv(e,o){return function(){var i=o.apply(this,arguments);if(typeof i!="function")throw new Error;cn(this,e).ease=i}}function Zv(e){if(typeof e!="function")throw new Error;return this.each(qv(this._id,e))}function Jv(e){typeof e!="function"&&(e=Oh(e));for(var o=this._groups,i=o.length,r=new Array(i),a=0;a<i;++a)for(var s=o[a],l=s.length,c=r[a]=[],d,u=0;u<l;++u)(d=s[u])&&e.call(d,d.__data__,u,s)&&c.push(d);return new An(r,this._parents,this._name,this._id)}function Kv(e){if(e._id!==this._id)throw new Error;for(var o=this._groups,i=e._groups,r=o.length,a=i.length,s=Math.min(r,a),l=new Array(r),c=0;c<s;++c)for(var d=o[c],u=i[c],h=d.length,f=l[c]=new Array(h),v,_=0;_<h;++_)(v=d[_]||u[_])&&(f[_]=v);for(;c<r;++c)l[c]=o[c];return new An(l,this._parents,this._name,this._id)}function Qv(e){return(e+"").trim().split(/^|\s+/).every(function(o){var i=o.indexOf(".");return i>=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;l<a;++l)for(var c=r[l],d=c.length,u=s[l]=new Array(d),h,f,v=0;v<d;++v)(h=c[v])&&(f=e.call(h,h.__data__,v,c))&&("__data__"in h&&(f.__data__=h.__data__),u[v]=f,xa(u[v],o,i,v,u,tn(h,i)));return new An(s,this._parents,o,i)}function r_(e){var o=this._name,i=this._id;typeof e!="function"&&(e=Ih(e));for(var r=this._groups,a=r.length,s=[],l=[],c=0;c<a;++c)for(var d=r[c],u=d.length,h,f=0;f<u;++f)if(h=d[f]){for(var v=e.call(h,h.__data__,f,d),_,b=tn(h,i),C=0,D=v.length;C<D;++C)(_=v[C])&&xa(_,o,i,C,v,b);s.push(v),l.push(h)}return new An(s,l,o,i)}var a_=Ko.prototype.constructor;function s_(){return new a_(this._groups,this._parents)}function l_(e,o){var i,r,a;return function(){var s=Jo(this,e),l=(this.style.removeProperty(e),Jo(this,e));return s===l?null:s===i&&l===r?a:a=o(i=s,r=l)}}function tp(e){return function(){this.style.removeProperty(e)}}function c_(e,o,i){var r,a=i+"",s;return function(){var l=Jo(this,e);return l===a?null:l===r?s:s=o(r=l,i)}}function d_(e,o,i){var r,a,s;return function(){var l=Jo(this,e),c=i(this),d=c+"";return c==null&&(d=c=(this.style.removeProperty(e),Jo(this,e))),l===d?null:l===r&&d===a?s:(a=d,s=o(r=l,c))}}function u_(e,o){var i,r,a,s="style."+o,l="end."+s,c;return function(){var d=cn(this,e),u=d.on,h=d.value[s]==null?c||(c=tp(o)):void 0;(u!==i||a!==h)&&(r=(i=u).copy()).on(l,a=h),d.on=r}}function h_(e,o,i){var r=(e+="")=="transform"?hv:Qh;return o==null?this.styleTween(e,l_(e,r)).on("end.style."+e,tp(e)):typeof o=="function"?this.styleTween(e,d_(e,r,Wl(this,"style."+e,o))).each(u_(this._id,e)):this.styleTween(e,c_(e,r,o),i).on("end.style."+e,null)}function p_(e,o,i){return function(r){this.style.setProperty(e,o.call(this,r),i)}}function f_(e,o,i){var r,a;function s(){var l=o.apply(this,arguments);return l!==a&&(r=(a=l)&&p_(e,l,i)),r}return s._value=o,s}function m_(e,o,i){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(o==null)return this.tween(r,null);if(typeof o!="function")throw new Error;return this.tween(r,f_(e,o,i??""))}function g_(e){return function(){this.textContent=e}}function y_(e){return function(){var o=e(this);this.textContent=o??""}}function v_(e){return this.tween("text",typeof e=="function"?y_(Wl(this,"text",e)):g_(e==null?"":e+""))}function __(e){return function(o){this.textContent=e.call(this,o)}}function b_(e){var o,i;function r(){var a=e.apply(this,arguments);return a!==i&&(o=(i=a)&&__(a)),o}return r._value=e,r}function C_(e){var o="text";if(arguments.length<1)return(o=this.tween(o))&&o._value;if(e==null)return this.tween(o,null);if(typeof e!="function")throw new Error;return this.tween(o,b_(e))}function k_(){for(var e=this._name,o=this._id,i=ep(),r=this._groups,a=r.length,s=0;s<a;++s)for(var l=r[s],c=l.length,d,u=0;u<c;++u)if(d=l[u]){var h=tn(d,o);xa(d,e,i,u,l,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new An(r,this._parents,e,i)}function w_(){var e,o,i=this,r=i._id,a=i.size();return new Promise(function(s,l){var c={value:l},d={value:function(){--a===0&&s()}};i.each(function(){var u=cn(this,r),h=u.on;h!==e&&(o=(e=h).copy(),o._.cancel.push(c),o._.interrupt.push(c),o._.end.push(d)),u.on=o}),a===0&&s()})}var S_=0;function An(e,o,i,r){this._groups=e,this._parents=o,this._name=i,this._id=r}function ep(){return++S_}var pn=Ko.prototype;An.prototype={constructor:An,select:i_,selectAll:r_,selectChild:pn.selectChild,selectChildren:pn.selectChildren,filter:Jv,merge:Kv,selection:s_,transition:k_,call:pn.call,nodes:pn.nodes,node:pn.node,size:pn.size,empty:pn.empty,each:pn.each,on:e_,attr:Pv,attrTween:Uv,style:h_,styleTween:m_,text:v_,textTween:C_,remove:o_,tween:Av,delay:Gv,duration:Xv,ease:jv,easeVarying:Zv,end:w_,[Symbol.iterator]:pn[Symbol.iterator]};function x_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var E_={time:null,delay:0,duration:250,ease:x_};function M_(e,o){for(var i;!(i=e.__transition)||!(i=i[o]);)if(!(e=e.parentNode))throw new Error(`transition ${o} not found`);return i}function A_(e){var o,i;e instanceof An?(o=e._id,e=e._name):(o=ep(),(i=E_).time=Fl(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,s=0;s<a;++s)for(var l=r[s],c=l.length,d,u=0;u<c;++u)(d=l[u])&&xa(d,e,o,u,l,i||M_(d,o));return new An(r,this._parents,e,o)}Ko.prototype.interrupt=xv,Ko.prototype.transition=A_;const js=Math.PI,qs=2*js,fo=1e-6,N_=qs-fo;function Zs(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function np(){return new Zs}Zs.prototype=np.prototype={constructor:Zs,moveTo:function(e,o){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+o)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,o){this._+="L"+(this._x1=+e)+","+(this._y1=+o)},quadraticCurveTo:function(e,o,i,r){this._+="Q"+ +e+","+ +o+","+(this._x1=+i)+","+(this._y1=+r)},bezierCurveTo:function(e,o,i,r,a,s){this._+="C"+ +e+","+ +o+","+ +i+","+ +r+","+(this._x1=+a)+","+(this._y1=+s)},arcTo:function(e,o,i,r,a){e=+e,o=+o,i=+i,r=+r,a=+a;var s=this._x1,l=this._y1,c=i-e,d=r-o,u=s-e,h=l-o,f=u*u+h*h;if(a<0)throw new Error("negative radius: "+a);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=o);else if(f>fo)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<c;++l)r.push(s[l]);for(;i=a.pop();)e.call(o,i,++d,this);return this}function P_(e,o){let i=-1;for(const r of this)if(e.call(o,r,++i,this))return r}function R_(e){return this.eachAfter(function(o){for(var i=+e(o.data)||0,r=o.children,a=r&&r.length;--a>=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<s;++a)i.push(r[a]);while(i.length)}function op(e,o){e instanceof Map?(e=[void 0,e],o===void 0&&(o=W_)):o===void 0&&(o=X_);for(var i=new ti(e),r,a=[i],s,l,c,d;r=a.pop();)if((l=o(r.data))&&(d=(l=Array.from(l)).length))for(r.children=l,c=d-1;c>=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<d;++h)u=s[h],_=s[h]=new ti(u),(b=l(u,h,a))!=null&&(b+="")&&(C=_.id=b,D.set(C,D.has(C)?qd:_)),(b=c(u,h,a))!=null&&(b+="")&&(_.parent=b);for(h=0;h<d;++h)if(_=s[h],b=_.parent){if(v=D.get(b),!v)throw new Error("missing: "+b);if(v===qd)throw new Error("ambiguous: "+b);v.children?v.children.push(_):v.children=[_],_.parent=v}else{if(f)throw new Error("multiple roots");f=_}if(!f)throw new Error("no root");if(i!=null){for(;f.data===fs&&f.children.length===1;)f=f.children[0],--d;for(let L=s.length-1;L>=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.x<f.x&&(f=B),B.x>v.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<et;++F)ft=H[F],Mt=uo(ft,this),Mt=[Mt,this.__zoom.invert(Mt),ft.identifier],dt.touch0?!dt.touch1&&dt.touch0[2]!==Mt[2]&&(dt.touch1=Mt,dt.taps=0):(dt.touch0=Mt,ct=!0,dt.taps=1+!!h);h&&(h=clearTimeout(h)),ct&&(dt.taps<2&&(f=Mt[0],h=setTimeout(function(){h=null},_)),Ar(this),dt.start())}}function V(M,...z){if(this.__zooming){var H=rt(this,z).event(M),et=M.changedTouches,dt=et.length,ct,F,ft,Mt;for(vi(M),ct=0;ct<dt;++ct)F=et[ct],ft=uo(F,this),H.touch0&&H.touch0[2]===F.identifier?H.touch0[0]=ft:H.touch1&&H.touch1[2]===F.identifier&&(H.touch1[0]=ft);if(F=H.that.__zoom,H.touch1){var Ut=H.touch0[0],zt=H.touch0[1],Xt=H.touch1[0],he=H.touch1[1],le=(le=Xt[0]-Ut[0])*le+(le=Xt[1]-Ut[1])*le,ve=(ve=he[0]-zt[0])*ve+(ve=he[1]-zt[1])*ve;F=B(F,Math.sqrt(le/ve)),ft=[(Ut[0]+Xt[0])/2,(Ut[1]+Xt[1])/2],Mt=[(zt[0]+he[0])/2,(zt[1]+he[1])/2]}else if(H.touch0)ft=H.touch0[0],Mt=H.touch0[1];else return;H.zoom("touch",i(X(F,ft,Mt),H.extent,l))}}function U(M,...z){if(this.__zooming){var H=rt(this,z).event(M),et=M.changedTouches,dt=et.length,ct,F;for(ys(M),v&&clearTimeout(v),v=setTimeout(function(){v=null},_),ct=0;ct<dt;++ct)F=et[ct],H.touch0&&H.touch0[2]===F.identifier?delete H.touch0:H.touch1&&H.touch1[2]===F.identifier&&delete H.touch1;if(H.touch1&&!H.touch0&&(H.touch0=H.touch1,delete H.touch1),H.touch0)H.touch0[1]=this.__zoom.invert(H.touch0[0]);else if(H.end(),H.taps===2&&(F=uo(F,this),Math.hypot(f[0]-F[0],f[1]-F[1])<D)){var ft=Me(this).on("dblclick.zoom");ft&&ft.apply(this,arguments)}}}return L.wheelDelta=function(M){return arguments.length?(r=typeof M=="function"?M:ur(+M),L):r},L.filter=function(M){return arguments.length?(e=typeof M=="function"?M:ur(!!M),L):e},L.touchable=function(M){return arguments.length?(a=typeof M=="function"?M:ur(!!M),L):a},L.extent=function(M){return arguments.length?(o=typeof M=="function"?M:ur([[+M[0][0],+M[0][1]],[+M[1][0],+M[1][1]]]),L):o},L.scaleExtent=function(M){return arguments.length?(s[0]=+M[0],s[1]=+M[1],L):[s[0],s[1]]},L.translateExtent=function(M){return arguments.length?(l[0][0]=+M[0][0],l[1][0]=+M[1][0],l[0][1]=+M[0][1],l[1][1]=+M[1][1],L):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},L.constrain=function(M){return arguments.length?(i=M,L):i},L.duration=function(M){return arguments.length?(c=+M,L):c},L.interpolate=function(M){return arguments.length?(d=M,L):d},L.on=function(){var M=u.on.apply(u,arguments);return M===u?L:M},L.clickDistance=function(M){return arguments.length?(C=(M=+M)*M,L):Math.sqrt(C)},L.tapDistance=function(M){return arguments.length?(D=+M,L):D},L}function wb(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 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<l;++s)r.push(a[s]);while(r.length);return this}function Eb(e){for(var o=this,i=[o],r,a;o=i.pop();)if(e(o),r=o.children,r)for(a=r.length-1;a>=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<l;++s)i.push(a[s]);for(;o=r.pop();)e(o);return this}function Ab(e){return this.eachAfter(function(o){for(var i=+e(o.data)||0,r=o.children,a=r&&r.length;--a>=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=>`<div style="padding:5px;font-size:10px;">Sample Node(id=${o.id}), override using <br/>
|
||
<code>chart.nodeContent({data}=>{ <br/>
|
||
return '' // Custom HTML <br/>
|
||
})</code>
|
||
<br/>
|
||
Or check different <a href="https://github.com/bumbeishvili/org-chart#jump-to-examples" target="_blank">layout examples</a>
|
||
</div>`,buttonContent:({node:o,state:i})=>`<div style="border:1px solid #E4E2E9;border-radius:3px;padding:3px;font-size:9px;margin:auto auto;background-color:white"> ${{left:r=>r?`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M14.283 3.50094L6.51 11.4749C6.37348 11.615 6.29707 11.8029 6.29707 11.9984C6.29707 12.194 6.37348 12.3819 6.51 12.5219L14.283 20.4989C14.3466 20.5643 14.4226 20.6162 14.5066 20.6516C14.5906 20.6871 14.6808 20.7053 14.772 20.7053C14.8632 20.7053 14.9534 20.6871 15.0374 20.6516C15.1214 20.6162 15.1974 20.5643 15.261 20.4989C15.3918 20.365 15.4651 20.1852 15.4651 19.9979C15.4651 19.8107 15.3918 19.6309 15.261 19.4969L7.9515 11.9984L15.261 4.50144C15.3914 4.36756 15.4643 4.18807 15.4643 4.00119C15.4643 3.81431 15.3914 3.63482 15.261 3.50094C15.1974 3.43563 15.1214 3.38371 15.0374 3.34827C14.9534 3.31282 14.8632 3.29456 14.772 3.29456C14.6808 3.29456 14.5906 3.31282 14.5066 3.34827C14.4226 3.38371 14.3466 3.43563 14.283 3.50094V3.50094Z" fill="#716E7B" stroke="#716E7B"/>
|
||
</svg></span><span style="color:#716E7B">${o.data._directSubordinatesPaging} </span></div>`:`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M7.989 3.49944C7.85817 3.63339 7.78492 3.8132 7.78492 4.00044C7.78492 4.18768 7.85817 4.36749 7.989 4.50144L15.2985 11.9999L7.989 19.4969C7.85817 19.6309 7.78492 19.8107 7.78492 19.9979C7.78492 20.1852 7.85817 20.365 7.989 20.4989C8.05259 20.5643 8.12863 20.6162 8.21261 20.6516C8.2966 20.6871 8.38684 20.7053 8.478 20.7053C8.56916 20.7053 8.6594 20.6871 8.74338 20.6516C8.82737 20.6162 8.90341 20.5643 8.967 20.4989L16.74 12.5234C16.8765 12.3834 16.9529 12.1955 16.9529 11.9999C16.9529 11.8044 16.8765 11.6165 16.74 11.4764L8.967 3.50094C8.90341 3.43563 8.82737 3.38371 8.74338 3.34827C8.6594 3.31282 8.56916 3.29456 8.478 3.29456C8.38684 3.29456 8.2966 3.31282 8.21261 3.34827C8.12863 3.38371 8.05259 3.43563 7.989 3.50094V3.49944Z" fill="#716E7B" stroke="#716E7B"/>
|
||
</svg></span><span style="color:#716E7B">${o.data._directSubordinatesPaging} </span></div>`,bottom:r=>r?`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M19.497 7.98903L12 15.297L4.503 7.98903C4.36905 7.85819 4.18924 7.78495 4.002 7.78495C3.81476 7.78495 3.63495 7.85819 3.501 7.98903C3.43614 8.05257 3.38462 8.12842 3.34944 8.21213C3.31427 8.29584 3.29615 8.38573 3.29615 8.47653C3.29615 8.56733 3.31427 8.65721 3.34944 8.74092C3.38462 8.82463 3.43614 8.90048 3.501 8.96403L11.4765 16.74C11.6166 16.8765 11.8044 16.953 12 16.953C12.1956 16.953 12.3834 16.8765 12.5235 16.74L20.499 8.96553C20.5643 8.90193 20.6162 8.8259 20.6517 8.74191C20.6871 8.65792 20.7054 8.56769 20.7054 8.47653C20.7054 8.38537 20.6871 8.29513 20.6517 8.21114C20.6162 8.12715 20.5643 8.05112 20.499 7.98753C20.3651 7.85669 20.1852 7.78345 19.998 7.78345C19.8108 7.78345 19.6309 7.85669 19.497 7.98753V7.98903Z" fill="#716E7B" stroke="#716E7B"/>
|
||
</svg></span><span style="margin-left:1px;color:#716E7B" >${o.data._directSubordinatesPaging} </span></div>
|
||
`:`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M11.457 8.07005L3.49199 16.4296C3.35903 16.569 3.28485 16.7543 3.28485 16.9471C3.28485 17.1398 3.35903 17.3251 3.49199 17.4646L3.50099 17.4736C3.56545 17.5414 3.64304 17.5954 3.72904 17.6324C3.81504 17.6693 3.90765 17.6883 4.00124 17.6883C4.09483 17.6883 4.18745 17.6693 4.27344 17.6324C4.35944 17.5954 4.43703 17.5414 4.50149 17.4736L12.0015 9.60155L19.4985 17.4736C19.563 17.5414 19.6405 17.5954 19.7265 17.6324C19.8125 17.6693 19.9052 17.6883 19.9987 17.6883C20.0923 17.6883 20.1849 17.6693 20.2709 17.6324C20.3569 17.5954 20.4345 17.5414 20.499 17.4736L20.508 17.4646C20.641 17.3251 20.7151 17.1398 20.7151 16.9471C20.7151 16.7543 20.641 16.569 20.508 16.4296L12.543 8.07005C12.4729 7.99653 12.3887 7.93801 12.2954 7.89801C12.202 7.85802 12.1015 7.8374 12 7.8374C11.8984 7.8374 11.798 7.85802 11.7046 7.89801C11.6113 7.93801 11.527 7.99653 11.457 8.07005Z" fill="#716E7B" stroke="#716E7B"/>
|
||
</svg></span><span style="margin-left:1px;color:#716E7B" >${o.data._directSubordinatesPaging} </span></div>
|
||
`,right:r=>r?`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M7.989 3.49944C7.85817 3.63339 7.78492 3.8132 7.78492 4.00044C7.78492 4.18768 7.85817 4.36749 7.989 4.50144L15.2985 11.9999L7.989 19.4969C7.85817 19.6309 7.78492 19.8107 7.78492 19.9979C7.78492 20.1852 7.85817 20.365 7.989 20.4989C8.05259 20.5643 8.12863 20.6162 8.21261 20.6516C8.2966 20.6871 8.38684 20.7053 8.478 20.7053C8.56916 20.7053 8.6594 20.6871 8.74338 20.6516C8.82737 20.6162 8.90341 20.5643 8.967 20.4989L16.74 12.5234C16.8765 12.3834 16.9529 12.1955 16.9529 11.9999C16.9529 11.8044 16.8765 11.6165 16.74 11.4764L8.967 3.50094C8.90341 3.43563 8.82737 3.38371 8.74338 3.34827C8.6594 3.31282 8.56916 3.29456 8.478 3.29456C8.38684 3.29456 8.2966 3.31282 8.21261 3.34827C8.12863 3.38371 8.05259 3.43563 7.989 3.50094V3.49944Z" fill="#716E7B" stroke="#716E7B"/>
|
||
</svg></span><span style="color:#716E7B">${o.data._directSubordinatesPaging} </span></div>`:`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M14.283 3.50094L6.51 11.4749C6.37348 11.615 6.29707 11.8029 6.29707 11.9984C6.29707 12.194 6.37348 12.3819 6.51 12.5219L14.283 20.4989C14.3466 20.5643 14.4226 20.6162 14.5066 20.6516C14.5906 20.6871 14.6808 20.7053 14.772 20.7053C14.8632 20.7053 14.9534 20.6871 15.0374 20.6516C15.1214 20.6162 15.1974 20.5643 15.261 20.4989C15.3918 20.365 15.4651 20.1852 15.4651 19.9979C15.4651 19.8107 15.3918 19.6309 15.261 19.4969L7.9515 11.9984L15.261 4.50144C15.3914 4.36756 15.4643 4.18807 15.4643 4.00119C15.4643 3.81431 15.3914 3.63482 15.261 3.50094C15.1974 3.43563 15.1214 3.38371 15.0374 3.34827C14.9534 3.31282 14.8632 3.29456 14.772 3.29456C14.6808 3.29456 14.5906 3.31282 14.5066 3.34827C14.4226 3.38371 14.3466 3.43563 14.283 3.50094V3.50094Z" fill="#716E7B" stroke="#716E7B"/>
|
||
</svg></span><span style="color:#716E7B">${o.data._directSubordinatesPaging} </span></div>`,top:r=>r?`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M11.457 8.07005L3.49199 16.4296C3.35903 16.569 3.28485 16.7543 3.28485 16.9471C3.28485 17.1398 3.35903 17.3251 3.49199 17.4646L3.50099 17.4736C3.56545 17.5414 3.64304 17.5954 3.72904 17.6324C3.81504 17.6693 3.90765 17.6883 4.00124 17.6883C4.09483 17.6883 4.18745 17.6693 4.27344 17.6324C4.35944 17.5954 4.43703 17.5414 4.50149 17.4736L12.0015 9.60155L19.4985 17.4736C19.563 17.5414 19.6405 17.5954 19.7265 17.6324C19.8125 17.6693 19.9052 17.6883 19.9987 17.6883C20.0923 17.6883 20.1849 17.6693 20.2709 17.6324C20.3569 17.5954 20.4345 17.5414 20.499 17.4736L20.508 17.4646C20.641 17.3251 20.7151 17.1398 20.7151 16.9471C20.7151 16.7543 20.641 16.569 20.508 16.4296L12.543 8.07005C12.4729 7.99653 12.3887 7.93801 12.2954 7.89801C12.202 7.85802 12.1015 7.8374 12 7.8374C11.8984 7.8374 11.798 7.85802 11.7046 7.89801C11.6113 7.93801 11.527 7.99653 11.457 8.07005Z" fill="#716E7B" stroke="#716E7B"/>
|
||
</svg></span><span style="margin-left:1px;color:#716E7B">${o.data._directSubordinatesPaging} </span></div>
|
||
`:`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M19.497 7.98903L12 15.297L4.503 7.98903C4.36905 7.85819 4.18924 7.78495 4.002 7.78495C3.81476 7.78495 3.63495 7.85819 3.501 7.98903C3.43614 8.05257 3.38462 8.12842 3.34944 8.21213C3.31427 8.29584 3.29615 8.38573 3.29615 8.47653C3.29615 8.56733 3.31427 8.65721 3.34944 8.74092C3.38462 8.82463 3.43614 8.90048 3.501 8.96403L11.4765 16.74C11.6166 16.8765 11.8044 16.953 12 16.953C12.1956 16.953 12.3834 16.8765 12.5235 16.74L20.499 8.96553C20.5643 8.90193 20.6162 8.8259 20.6517 8.74191C20.6871 8.65792 20.7054 8.56769 20.7054 8.47653C20.7054 8.38537 20.6871 8.29513 20.6517 8.21114C20.6162 8.12715 20.5643 8.05112 20.499 7.98753C20.3651 7.85669 20.1852 7.78345 19.998 7.78345C19.8108 7.78345 19.6309 7.85669 19.497 7.98753V7.98903Z" fill="#716E7B" stroke="#716E7B"/>
|
||
</svg></span><span style="margin-left:1px;color:#716E7B">${o.data._directSubordinatesPaging} </span></div>
|
||
`}[i.layout](o.children)} </div>`,pagingButton:(o,i,r,a)=>{const s=a.pagingStep(o.parent),l=o.parent.data._pagingStep,c=o.parent.data._directSubordinatesPaging-l;return`
|
||
<div style="margin-top:90px;">
|
||
<div style="display:flex;width:170px;border-radius:20px;padding:5px 15px; padding-bottom:4px;;background-color:#E5E9F2">
|
||
<div><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M5.59 7.41L10.18 12L5.59 16.59L7 18L13 12L7 6L5.59 7.41ZM16 6H18V18H16V6Z" fill="#716E7B" stroke="#716E7B"/>
|
||
</svg>
|
||
</div><div style="line-height:2"> Show next ${Math.min(c,s)} nodes </div></div>
|
||
</div>
|
||
`},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<v?Math.abs(l-a)/2:v;_=Math.abs(c-s)/2<_?Math.abs(c-s)/2:_;let b=Math.abs(l-a)/2-_;return`
|
||
M ${d} ${u}
|
||
L ${d} ${s}
|
||
L ${a} ${s}
|
||
L ${a+b*h} ${s}
|
||
C ${a+b*h+_*h} ${s}
|
||
${a+b*h+_*h} ${s}
|
||
${a+b*h+_*h} ${s+_*f}
|
||
L ${a+b*h+_*h} ${c-_*f}
|
||
C ${a+b*h+_*h} ${c}
|
||
${a+b*h+_*h} ${c}
|
||
${l-b*h} ${c}
|
||
L ${l} ${c}
|
||
`},diagonal:function(o,i,r,a={sy:0}){const s=o.x;let l=o.y;const c=i.x,d=i.y;let u=r&&r.x!=null?r.x:s,h=r&&r.y!=null?r.y:l,f=c-s<0?-1:1,v=d-l<0?-1:1;l+=a.sy;let _=35,b=Math.abs(c-s)/2<_?Math.abs(c-s)/2:_;b=Math.abs(d-l)/2<b?Math.abs(d-l)/2:b;let C=Math.abs(d-l)/2-b,D=Math.abs(c-s)-b*2;return`
|
||
M ${u} ${h}
|
||
L ${s} ${h}
|
||
L ${s} ${l}
|
||
L ${s} ${l+C*v}
|
||
C ${s} ${l+C*v+b*v} ${s} ${l+C*v+b*v} ${s+b*f} ${l+C*v+b*v}
|
||
L ${s+D*f+b*f} ${l+C*v+b*v}
|
||
C ${c} ${l+C*v+b*v} ${c} ${l+C*v+b*v} ${c} ${d-C*v}
|
||
L ${c} ${d}
|
||
`},defs:function(o,i){return`<defs>
|
||
${i.map(r=>{const a=this.getTextWidth(r.label,{ctx:o.ctx,fontSize:2,defaultFont:o.defaultFont});return`
|
||
<marker id="${r.from+"_"+r.to}" refX="${r._source.x<r._target.x?-7:7}" refY="5" markerWidth="500" markerHeight="500" orient="${r._source.x<r._target.x?"auto":"auto-start-reverse"}" >
|
||
<rect rx=0.5 width=${r.label?a+3:0} height=3 y=1 fill="#E27396"></rect>
|
||
<text font-size="2px" x=1 fill="white" y=3>${r.label||""}</text>
|
||
</marker>
|
||
|
||
<marker id="arrow-${r.from+"_"+r.to}" markerWidth="500" markerHeight="500" refY="2" refX="1" orient="${r._source.x<r._target.x?"auto":"auto-start-reverse"}" >
|
||
<path transform="translate(0)" d='M0,0 V4 L2,2 Z' fill='#E27396' />
|
||
</marker>
|
||
`}).join("")}
|
||
</defs>
|
||
`},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<V.depth?T:V,{depth:1/0});J.attr("opacity",1).transition().duration(l.duration).attr("transform",T=>{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&&U<z+H-1:U>z-H&&U<z+H})),lt.data._centeredWithDescendants=null,lt.data._centered=null,this.fit({animate:!0,scale:!1,nodes:T})}}isEdge(){return window.navigator.userAgent.includes("Edge")}hdiagonal(e,o,i,r){return this.getChartState().hdiagonal(e,o,i,r)}diagonal(e,o,i,r){return this.getChartState().diagonal(e,o,i,r)}restyleForeignObjectElements(){const e=this.getChartState();e.svg.selectAll(".node-foreign-object").attr("width",({width:o})=>o).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?`<div class="paging-button-wrapper"><div style="pointer-events:none">${e.pagingButton(o,i,r,e)}</div></div>`: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=`<?xml version="1.0" standalone="no"?>\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<o;a++)e[r](-1);return e},fp=(e,o)=>{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<o;)r+=fp(e,i),e.u[++i]=r;return e.i=o,r},Do=(e,o,i=0,r=e.l-1)=>{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<Qd(dt)+1||b!==0||(_=ct<0?2:1),s&&(s=!1),u=M,et=4;const ft=Z();ft>=-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?F<C[0]:ot(F+(_===0&&b===0?1:0))<Z()))&&(ct+=ft-lt(F)),ct),0));for(const[ct,F]of dt){const ft=lt(ct),Mt=xw(X,ct,F);a&&(L+=Mt?F:F-ft)}a&&c&&L>c&&(V(((ct,F)=>{let ft=0;const Mt=[];ct.t.forEach((ve,Rn)=>{ve!==-1&&(Mt.push(ve),Rn<F&&ft++)}),ct.i=-1;const Ut=hp(Mt),zt=Ut.length,Xt=zt/2|0,he=zt%2==0?(Ut[Xt-1]+Ut[Xt])/2:Ut[Xt],le=ct.o;return((ct.o=he)-le)*Xe(F-ft,0)})(X,Do(X,rt()))),a=!1),et=3,H=!0;break}case 4:c!==M&&(c||(B=H=!0),c=M,et=3);break;case 5:M[1]?(V(tu(X,M[0],!0)),b=2,et=1):(tu(X,M[0]),et=1);break;case 6:d=M;break;case 7:b=1;break;case 8:C=st(M,M+c),et=1}et&&(l=1+(2147483647&l),z&&f&&(h+=f,f=0),nt.forEach(([dt,ct])=>{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<B&&(i?L.deltaX:L.deltaY)&&(d=!0)},C=()=>{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(V<U)ot="start";else{if(!(V+b.k(J)>U+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<e?t("contacts","Promote to {level}",{level:gi[e]}):t("contacts","Demote to {level}",{level:gi[e]})},async deleteMember(){if(!this.isCurrentUser){await this.doDeleteMember();return}try{await new Cm().setName(t("contacts","Leave team")).setText(t("contacts","Are you sure you want to leave this team? This action cannot be undone.")).setButtons([{label:t("contacts","Cancel"),type:"secondary",callback:()=>{}},{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<e.length){wm(Ai("contacts","Some members could not be added")),this.pickerSelection={};return}this.resetPicker()}catch(o){yt(Ai("contacts","There was an issue adding members to the team")),console.error("There was an issue adding members to the circle",this.pickerCircle,o)}finally{this.pickerLoading=!1}},resetPicker(){this.showPicker=!1,this.pickerCircle=null,this.pickerData=[],this.pickerSelection={}},async onGuestCreated(e){const o=await eu(e.username);this.$refs.entityPicker.onClick(o[0])}}}),FS={class:"member-list"},XS={key:3,class:"member-grid"};function WS(e,o,i,r,a,s){const l=k("IconLoading"),c=k("NcEmptyContent"),d=k("IconContact"),u=k("MemberGridItem"),h=k("EntityPicker");return p(),w("section",FS,[e.loading?(p(),N(c,{key:0,class:"empty-content",name:e.t("contacts","Loading members list …")},{icon:S(()=>[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;u<c+a;u+=1)for(let h=d;h<d+l;h+=1)e[u][h]=0;return e}const J5=new TextEncoder,K5=new TextDecoder;function tl(e,o){let i,r;if(typeof e=="string"||typeof e=="number")i=`${e}`,r=J5.encode(i);else if(Array.isArray(e))r=new Uint8Array(e),i=K5.decode(e);else throw new Error("Bad data: "+typeof e);if(/^[0-9]+$/.test(i)){if(r.byteLength>7089)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<<o-1;r;r>>>=1)e.push(r&i?1:0)}function Q5(e){const o=e.byteLength,i=[];for(let s=0;s<o;s++)qe(i,8,e[s]);const r={};let a=[0,1,0,0];if(qe(a,16,o),r.data10=r.data27=a.concat(i),o<256){let s=[0,1,0,0];qe(s,8,o),r.data1=s.concat(i)}return r}const nu=(function(e){const o={};for(let i=0;i<e.length;i++)o[e[i]]=i;return o})("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:");function t4(e){const o=e.length,i=[];for(let s=0;s<o;s+=2){let l=6,c=nu[e[s]];e[s+1]&&(l=11,c=c*45+nu[e[s+1]]),qe(i,l,c)}const r={};let a=[0,0,1,0];if(qe(a,13,o),r.data27=a.concat(i),o<2048){let s=[0,0,1,0];qe(s,11,o),r.data10=s.concat(i)}if(o<512){let s=[0,0,1,0];qe(s,9,o),r.data1=s.concat(i)}return r}function e4(e){const o=e.length,i=[];for(let s=0;s<o;s+=3){const l=e.substr(s,3),c=Math.ceil(l.length*10/3);qe(i,c,parseInt(l,10))}const r={};let a=[0,0,0,1];if(qe(a,14,o),r.data27=a.concat(i),o<4096){let s=[0,0,0,1];qe(s,12,o),r.data10=s.concat(i)}if(o<1024){let s=[0,0,0,1];qe(s,10,o),r.data1=s.concat(i)}return r}function n4(e){const o=e.indexOf("/",8)+1||e.length,i=tl(e.slice(0,o).toUpperCase(),!1);if(o>=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;r<o;r++)e.push(0);for(;e.length>o;){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<s.length;i++)for(let l=0;l<s.length;l++){const c=s[i],d=s[l];if(!e[c][d])for(let u=-2;u<=2;u++)for(let h=-2;h<=2;h++){const f=Math.max(u,h),v=Math.min(u,h),_=f==1&&v>=-1||v==-1&&f<=1?128:129;e[c+u][d+h]=_}}}for(var i=8;i<o-8;i++)e[6][i]=e[i][6]=i%2?128:129}function l4(e){const o=e.length;for(var i=0;i<8;i++)i!=6&&(e[8][i]=e[i][8]=128),e[8][o-1-i]=128,e[o-1-i][8]=128;if(e[8][8]=128,e[o-8][8]=129,!(o<45))for(var i=o-11;i<o-8;i++)for(let a=0;a<6;a++)e[i][a]=e[a][i]=128}const ou=(function(){const e=Array(32),o=Array(40),i=1335,r=7973,a=21522;for(let l=0;l<32;l++){let c=l<<10;for(let d=5;d>0;d--)c>>>9+d&&(c^=i<<d-1);e[l]=(c|l<<10)^a}for(let l=7;l<=40;l++){let c=l<<12;for(let d=6;d>0;d--)c>>>11+d&&(c^=r<<d-1);o[l]=c|l<<12}const s={L:1,M:0,Q:3,H:2};return function(l,c,d){const u=l.length,h=e[s[c]<<3|d];function f(C){return h>>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<u;h++)for(var f=0;f<i.blocks.length;f++)i.blocks[f].length<=h||v(i.blocks[f][h]);u=i.ec_len;for(var h=0;h<u;h++)for(var f=0;f<i.ec.length;f++)v(i.ec[f][h]);if(l>-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<o;r++){for(var a=e[r][0]&1,s=1,l=1;l<o;l++){var c=e[r][l]&1;if(c==a){s++;continue}s>=5&&(i+=s-2),a=c,s=1}s>=5&&(i+=s-2)}for(var l=0;l<o;l++){for(var a=e[0][l]&1,s=1,r=1;r<o;r++){var c=e[r][l]&1;if(c==a){s++;continue}s>=5&&(i+=s-2),a=c,s=1}s>=5&&(i+=s-2)}for(var r=0;r<o-1;r++)for(var l=0;l<o-1;l++){const _=e[r][l]+e[r][l+1]+e[r+1][l]+e[r+1][l+1]&7;(_==0||_==4)&&(i+=3)}function d(f){return e[r][l+f]&1}function u(f){return e[r+f][l]&1}for(var r=0;r<o;r++)for(var l=0;l<o;l++)l<o-6&&d(0)&&!d(1)&&d(2)&&d(3)&&d(4)&&!d(5)&&d(6)&&(l>=4&&!(d(-4)||d(-3)||d(-2)||d(-1))&&(i+=40),l<o-10&&!(d(7)||d(8)||d(9)||d(10))&&(i+=40)),r<o-6&&u(0)&&!u(1)&&u(2)&&u(3)&&u(4)&&!u(5)&&u(6)&&(r>=4&&!(u(-4)||u(-3)||u(-2)||u(-1))&&(i+=40),r<o-10&&!(u(7)||u(8)||u(9)||u(10))&&(i+=40));let h=0;for(var r=0;r<o;r++)for(var l=0;l<o;l++)e[r][l]&1&&h++;return i+=10*Math.floor(Math.abs(10-20*h/(o*o))),i}function d4(e){const o=r4(e.version);a4(o),s4(o),l4(o);let i=1/0,r=0;for(let a=0;a<8;a++){iu(o,e,a),ou(o,e.ec_level,a);const s=c4(o);s<i&&(i=s,r=a)}return iu(o,e,r),ou(o,e.ec_level,r),o.map(a=>a.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<a;c+=8){let d=0;for(let u=0;u<8;u++)d=d<<1|(r[c+u]?1:0);i[c/8]=d}let s=236;for(let c=Math.ceil((a+4)/8);c<i.length;c++)i[c]=s,s=s==236?17:236;let l=0;return o.blocks=o.blocks.map(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<c;l++){var d=a[l];e(d)?s=o.call(s,i.call(d)):s.push(d)}return s};return r.wrap=function(a){return function(){return a(r(arguments))}},ws.exports}var du;function v4(){if(du)return ks.exports;du=1;var e=m4(),o=y4(),i=Object.hasOwnProperty,r=Object.create(null);for(var a in e)i.call(e,a)&&(r[e[a]]=a);var s=ks.exports={to:{},get:{}};s.get=function(d){var u=d.substring(0,3).toLowerCase(),h,f;switch(u){case"hsl":h=s.get.hsl(d),f="hsl";break;case"hwb":h=s.get.hwb(d),f="hwb";break;default:h=s.get.rgb(d),f="rgb";break}return h?{model:f,value:h}:null},s.get.rgb=function(d){if(!d)return null;var u=/^#([a-f0-9]{3,4})$/i,h=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,f=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,v=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,_=/^(\w+)$/,b=[0,0,0,1],C,D,L;if(C=d.match(h)){for(L=C[2],C=C[1],D=0;D<3;D++){var B=D*2;b[D]=parseInt(C.slice(B,B+2),16)}L&&(b[3]=parseInt(L,16)/255)}else if(C=d.match(u)){for(C=C[1],L=C[3],D=0;D<3;D++)b[D]=parseInt(C[D]+C[D],16);L&&(b[3]=parseInt(L+L,16)/255)}else if(C=d.match(f)){for(D=0;D<3;D++)b[D]=parseInt(C[D+1],0);C[4]&&(C[5]?b[3]=parseFloat(C[4])*.01:b[3]=parseFloat(C[4]))}else if(C=d.match(v)){for(D=0;D<3;D++)b[D]=Math.round(parseFloat(C[D+1])*2.55);C[4]&&(C[5]?b[3]=parseFloat(C[4])*.01:b[3]=parseFloat(C[4]))}else return(C=d.match(_))?C[1]==="transparent"?[0,0,0,0]:i.call(e,C[1])?(b=e[C[1]],b[3]=1,b):null:null;for(D=0;D<3;D++)b[D]=l(b[D],0,255);return b[3]=l(b[3],0,1),b},s.get.hsl=function(d){if(!d)return null;var u=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,h=d.match(u);if(h){var f=parseFloat(h[4]),v=(parseFloat(h[1])%360+360)%360,_=l(parseFloat(h[2]),0,100),b=l(parseFloat(h[3]),0,100),C=l(isNaN(f)?1:f,0,1);return[v,_,b,C]}return null},s.get.hwb=function(d){if(!d)return null;var u=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,h=d.match(u);if(h){var f=parseFloat(h[4]),v=(parseFloat(h[1])%360+360)%360,_=l(parseFloat(h[2]),0,100),b=l(parseFloat(h[3]),0,100),C=l(isNaN(f)?1:f,0,1);return[v,_,b,C]}return null},s.to.hex=function(){var d=o(arguments);return"#"+c(d[0])+c(d[1])+c(d[2])+(d[3]<1?c(Math.round(d[3]*255)):"")},s.to.rgb=function(){var d=o(arguments);return d.length<4||d[3]===1?"rgb("+Math.round(d[0])+", "+Math.round(d[1])+", "+Math.round(d[2])+")":"rgba("+Math.round(d[0])+", "+Math.round(d[1])+", "+Math.round(d[2])+", "+d[3]+")"},s.to.rgb.percent=function(){var d=o(arguments),u=Math.round(d[0]/255*100),h=Math.round(d[1]/255*100),f=Math.round(d[2]/255*100);return d.length<4||d[3]===1?"rgb("+u+"%, "+h+"%, "+f+"%)":"rgba("+u+"%, "+h+"%, "+f+"%, "+d[3]+")"},s.to.hsl=function(){var d=o(arguments);return d.length<4||d[3]===1?"hsl("+d[0]+", "+d[1]+"%, "+d[2]+"%)":"hsla("+d[0]+", "+d[1]+"%, "+d[2]+"%, "+d[3]+")"},s.to.hwb=function(){var d=o(arguments),u="";return d.length>=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<e.length;s++){const l=e[s];for(let c=0;c<l.length;c++)if(l[c]){const d=s*o+i,u=c*o+i,h=o-2*r,f=[xp(d,u+r),Kr(h),Xn(r,r,r),Qr(h),Xn(r,r,-r),Kr(-h),Xn(r,-r,-r),Qr(-h),Xn(r,-r,r),Ep()];a.push(...f.flat())}}return a.join(" ")}const Mp={type:"png",parse_url:!1,ec_level:"M",logo:void 0,logoWidth:20,logoHeight:20,bgColor:4294967295,color:255},w4={...Mp,margin:1,size:5},S4={...Mp,margin:1,size:0},Ap="3.7.7",x4=Ap,di=typeof ze=="function",hu=typeof TextDecoder=="function"?new TextDecoder:void 0,pu=typeof TextEncoder=="function"?new TextEncoder:void 0,E4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ei=Array.prototype.slice.call(E4),pr=(e=>{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;c<e.length;){if((i=e.charCodeAt(c++))>255||(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;i<r;i+=4096)o.push(ue.apply(null,e.subarray(i,i+4096)));return oc(o.join(""))},Ir=(e,o=!1)=>o?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<e.length;)o=pr[e.charAt(s++)]<<18|pr[e.charAt(s++)]<<12|(r=pr[e.charAt(s++)])<<6|(a=pr[e.charAt(s++)]),i+=r===64?ue(o>>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='<?xml version="1.0" encoding="utf-8"?>',B=`<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"${C}${D} viewBox="0 0 ${b} ${b}">`,X=V4(e,{color:l,bgColor:c,size:b,margin:o,blockSize:f,borderRadius:h}),nt="</svg>",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=`<rect width="${o.size}" height="${o.size}" fill="${Ss(o.bgColor)}"></rect>`;return a+=`<path shape-rendering="geometricPrecision" d="${r}" fill-rule="evenodd" fill="${Ss(o.color)}"/>`,a+=`<path shape-rendering="geometricPrecision" d="${i}" fill="${Ss(o.color)}"/>`,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`<image width="${l}" height="${c}" xlink:href="${s}" x="${o+(i-l)/2}" y="${o+(i-c)/2}"></image>`}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;i<e.length;i++)o[i]=e.charCodeAt(i);return o}const fe={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class Z3{constructor(o,i){this.stack=o,this.cbs=i,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=_u,this.delimiterClose=bu,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return this.mode===2&&this.stack.length===0}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=_u,this.delimiterClose=bu}getPos(o){let i=1,r=o+1;const a=this.newlines.length;let s=-1;if(a>100){let l=-1,c=a;for(;l+1<c;){const d=l+c>>>1;this.newlines[d]<o?l=d:c=d}s=l}else for(let l=a-1;l>=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<i){const r=this.index;this.index=i,this.cbs.ontext(this.sectionStart,i),this.index=r}this.sectionStart=i+2,this.stateInClosingTagName(o),this.inRCDATA=!1;return}this.sequenceIndex=0}(o|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===fe.TitleEnd||this.currentSequence===fe.TextareaEnd&&!this.inSFCRoot?!this.inVPre&&o===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(o)):this.fastForwardTo(60)&&(this.sequenceIndex=1):this.sequenceIndex=+(o===60)}stateCDATASequence(o){o===fe.Cdata[this.sequenceIndex]?++this.sequenceIndex===fe.Cdata.length&&(this.state=28,this.currentSequence=fe.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=23,this.stateInDeclaration(o))}fastForwardTo(o){for(;++this.index<this.buffer.length;){const i=this.buffer.charCodeAt(this.index);if(i===10&&this.newlines.push(this.index),i===o)return!0}return this.index=this.buffer.length-1,!1}stateInCommentLike(o){o===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===fe.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index-2):this.cbs.oncomment(this.sectionStart,this.index-2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=1):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):o!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}startSpecial(o,i){this.enterRCDATA(o,i),this.state=31}enterRCDATA(o,i){this.inRCDATA=!0,this.currentSequence=o,this.sequenceIndex=i}stateBeforeTagName(o){o===33?(this.state=22,this.sectionStart=this.index+1):o===63?(this.state=24,this.sectionStart=this.index+1):Cu(o)?(this.sectionStart=this.index,this.mode===0?this.state=6:this.inSFCRoot?this.state=34:this.inXML?this.state=6:o===116?this.state=30:this.state=o===115?29:6):o===47?this.state=8:(this.state=1,this.stateText(o))}stateInTagName(o){Hn(o)&&this.handleTagName(o)}stateInSFCRootTagName(o){if(Hn(o)){const i=this.buffer.slice(this.sectionStart,this.index);i!=="template"&&this.enterRCDATA(oa("</"+i),0),this.handleTagName(o)}}handleTagName(o){this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(o)}stateBeforeClosingTagName(o){Ie(o)||(o===62?(this.state=1,this.sectionStart=this.index+1):(this.state=Cu(o)?9:27,this.sectionStart=this.index))}stateInClosingTagName(o){(o===62||Ie(o))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=10,this.stateAfterClosingTagName(o))}stateAfterClosingTagName(o){o===62&&(this.state=1,this.sectionStart=this.index+1)}stateBeforeAttrName(o){o===62?(this.cbs.onopentagend(this.index),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):o===47?this.state=7:o===60&&this.peek()===47?(this.cbs.onopentagend(this.index),this.state=5,this.sectionStart=this.index):Ie(o)||this.handleAttrStart(o)}handleAttrStart(o){o===118&&this.peek()===45?(this.state=13,this.sectionStart=this.index):o===46||o===58||o===64||o===35?(this.cbs.ondirname(this.index,this.index+1),this.state=14,this.sectionStart=this.index+1):(this.state=12,this.sectionStart=this.index)}stateInSelfClosingTag(o){o===62?(this.cbs.onselfclosingtag(this.index),this.state=1,this.sectionStart=this.index+1,this.inRCDATA=!1):Ie(o)||(this.state=11,this.stateBeforeAttrName(o))}stateInAttrName(o){(o===61||Hn(o))&&(this.cbs.onattribname(this.sectionStart,this.index),this.handleAttrNameEnd(o))}stateInDirName(o){o===61||Hn(o)?(this.cbs.ondirname(this.sectionStart,this.index),this.handleAttrNameEnd(o)):o===58?(this.cbs.ondirname(this.sectionStart,this.index),this.state=14,this.sectionStart=this.index+1):o===46&&(this.cbs.ondirname(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDirArg(o){o===61||Hn(o)?(this.cbs.ondirarg(this.sectionStart,this.index),this.handleAttrNameEnd(o)):o===91?this.state=15:o===46&&(this.cbs.ondirarg(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDynamicDirArg(o){o===93?this.state=14:(o===61||Hn(o))&&(this.cbs.ondirarg(this.sectionStart,this.index+1),this.handleAttrNameEnd(o))}stateInDirModifier(o){o===61||Hn(o)?(this.cbs.ondirmodifier(this.sectionStart,this.index),this.handleAttrNameEnd(o)):o===46&&(this.cbs.ondirmodifier(this.sectionStart,this.index),this.sectionStart=this.index+1)}handleAttrNameEnd(o){this.sectionStart=this.index,this.state=17,this.cbs.onattribnameend(this.index),this.stateAfterAttrName(o)}stateAfterAttrName(o){o===61?this.state=18:o===47||o===62?(this.cbs.onattribend(0,this.sectionStart),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(o)):Ie(o)||(this.cbs.onattribend(0,this.sectionStart),this.handleAttrStart(o))}stateBeforeAttrValue(o){o===34?(this.state=19,this.sectionStart=this.index+1):o===39?(this.state=20,this.sectionStart=this.index+1):Ie(o)||(this.sectionStart=this.index,this.state=21,this.stateInAttrValueNoQuotes(o))}handleInAttrValue(o,i){(o===i||this.fastForwardTo(i))&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(i===34?3:2,this.index+1),this.state=11)}stateInAttrValueDoubleQuotes(o){this.handleInAttrValue(o,34)}stateInAttrValueSingleQuotes(o){this.handleInAttrValue(o,39)}stateInAttrValueNoQuotes(o){Ie(o)||o===62?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(1,this.index),this.state=11,this.stateBeforeAttrName(o)):(o===39||o===60||o===61||o===96)&&this.cbs.onerr(18,this.index)}stateBeforeDeclaration(o){o===91?(this.state=26,this.sequenceIndex=0):this.state=o===45?25:23}stateInDeclaration(o){(o===62||this.fastForwardTo(62))&&(this.state=1,this.sectionStart=this.index+1)}stateInProcessingInstruction(o){(o===62||this.fastForwardTo(62))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeComment(o){o===45?(this.state=28,this.currentSequence=fe.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=23}stateInSpecialComment(o){(o===62||this.fastForwardTo(62))&&(this.cbs.oncomment(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeSpecialS(o){o===fe.ScriptEnd[3]?this.startSpecial(fe.ScriptEnd,4):o===fe.StyleEnd[3]?this.startSpecial(fe.StyleEnd,4):(this.state=6,this.stateInTagName(o))}stateBeforeSpecialT(o){o===fe.TitleEnd[3]?this.startSpecial(fe.TitleEnd,4):o===fe.TextareaEnd[3]?this.startSpecial(fe.TextareaEnd,4):(this.state=6,this.stateInTagName(o))}startEntity(){}stateInEntity(){}parse(o){for(this.buffer=o;this.index<this.buffer.length;){const i=this.buffer.charCodeAt(this.index);switch(i===10&&this.state!==33&&this.newlines.push(this.index),this.state){case 1:{this.stateText(i);break}case 2:{this.stateInterpolationOpen(i);break}case 3:{this.stateInterpolation(i);break}case 4:{this.stateInterpolationClose(i);break}case 31:{this.stateSpecialStartSequence(i);break}case 32:{this.stateInRCDATA(i);break}case 26:{this.stateCDATASequence(i);break}case 19:{this.stateInAttrValueDoubleQuotes(i);break}case 12:{this.stateInAttrName(i);break}case 13:{this.stateInDirName(i);break}case 14:{this.stateInDirArg(i);break}case 15:{this.stateInDynamicDirArg(i);break}case 16:{this.stateInDirModifier(i);break}case 28:{this.stateInCommentLike(i);break}case 27:{this.stateInSpecialComment(i);break}case 11:{this.stateBeforeAttrName(i);break}case 6:{this.stateInTagName(i);break}case 34:{this.stateInSFCRootTagName(i);break}case 9:{this.stateInClosingTagName(i);break}case 5:{this.stateBeforeTagName(i);break}case 17:{this.stateAfterAttrName(i);break}case 20:{this.stateInAttrValueSingleQuotes(i);break}case 18:{this.stateBeforeAttrValue(i);break}case 8:{this.stateBeforeClosingTagName(i);break}case 10:{this.stateAfterClosingTagName(i);break}case 29:{this.stateBeforeSpecialS(i);break}case 30:{this.stateBeforeSpecialT(i);break}case 21:{this.stateInAttrValueNoQuotes(i);break}case 7:{this.stateInSelfClosingTag(i);break}case 23:{this.stateInDeclaration(i);break}case 22:{this.stateBeforeDeclaration(i);break}case 25:{this.stateBeforeComment(i);break}case 24:{this.stateInProcessingInstruction(i);break}case 33:{this.stateInEntity();break}}this.index++}this.cleanup(),this.finish()}cleanup(){this.sectionStart!==this.index&&(this.state===1||this.state===32&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===19||this.state===20||this.state===21)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}finish(){this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const o=this.buffer.length;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 <template> tags or use a computed property that filters v-for data source.",link:"https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html"},COMPILER_NATIVE_TEMPLATE:{message:"<template> with no special directives will render as a native template element instead of its inner content in Vue 3."},COMPILER_INLINE_TEMPLATE:{message:'"inline-template" has been removed in Vue 3.',link:"https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html"},COMPILER_FILTERS:{message:'filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.',link:"https://v3-migration.vuejs.org/breaking-changes/filters.html"}};function il(e,{compatConfig:o}){const i=o&&o[e];return e==="MODE"?i||3:i}function Co(e,o){const i=il("MODE",o),r=il(e,o);return i===3?r===!0:r!==!1}function ii(e,o,i,...r){return Co(e,o)}function Q3(e,o,i,...r){if(il(e,o)==="suppress-warning")return;const{message:a,link:s}=K3[e],l=`(deprecation ${e}) ${typeof a=="function"?a(...r):a}${s?`
|
||
Details: ${s}`:""}`,c=new SyntaxError(l);c.code=e,i&&(c.loc=i),o.onWarn(c)}function hc(e){throw e}function Zp(e){}function Rt(e,o,i,r){const a=`https://vuejs.org/error-reference/#compiler-${e}`,s=new SyntaxError(String(a));return s.code=e,s.loc=o,s}const t6={ABRUPT_CLOSING_OF_EMPTY_COMMENT:0,0:"ABRUPT_CLOSING_OF_EMPTY_COMMENT",CDATA_IN_HTML_CONTENT:1,1:"CDATA_IN_HTML_CONTENT",DUPLICATE_ATTRIBUTE:2,2:"DUPLICATE_ATTRIBUTE",END_TAG_WITH_ATTRIBUTES:3,3:"END_TAG_WITH_ATTRIBUTES",END_TAG_WITH_TRAILING_SOLIDUS:4,4:"END_TAG_WITH_TRAILING_SOLIDUS",EOF_BEFORE_TAG_NAME:5,5:"EOF_BEFORE_TAG_NAME",EOF_IN_CDATA:6,6:"EOF_IN_CDATA",EOF_IN_COMMENT:7,7:"EOF_IN_COMMENT",EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT:8,8:"EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT",EOF_IN_TAG:9,9:"EOF_IN_TAG",INCORRECTLY_CLOSED_COMMENT:10,10:"INCORRECTLY_CLOSED_COMMENT",INCORRECTLY_OPENED_COMMENT:11,11:"INCORRECTLY_OPENED_COMMENT",INVALID_FIRST_CHARACTER_OF_TAG_NAME:12,12:"INVALID_FIRST_CHARACTER_OF_TAG_NAME",MISSING_ATTRIBUTE_VALUE:13,13:"MISSING_ATTRIBUTE_VALUE",MISSING_END_TAG_NAME:14,14:"MISSING_END_TAG_NAME",MISSING_WHITESPACE_BETWEEN_ATTRIBUTES:15,15:"MISSING_WHITESPACE_BETWEEN_ATTRIBUTES",NESTED_COMMENT:16,16:"NESTED_COMMENT",UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME:17,17:"UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME",UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE:18,18:"UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE",UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME:19,19:"UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME",UNEXPECTED_NULL_CHARACTER:20,20:"UNEXPECTED_NULL_CHARACTER",UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME:21,21:"UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME",UNEXPECTED_SOLIDUS_IN_TAG:22,22:"UNEXPECTED_SOLIDUS_IN_TAG",X_INVALID_END_TAG:23,23:"X_INVALID_END_TAG",X_MISSING_END_TAG:24,24:"X_MISSING_END_TAG",X_MISSING_INTERPOLATION_END:25,25:"X_MISSING_INTERPOLATION_END",X_MISSING_DIRECTIVE_NAME:26,26:"X_MISSING_DIRECTIVE_NAME",X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END:27,27:"X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END",X_V_IF_NO_EXPRESSION:28,28:"X_V_IF_NO_EXPRESSION",X_V_IF_SAME_KEY:29,29:"X_V_IF_SAME_KEY",X_V_ELSE_NO_ADJACENT_IF:30,30:"X_V_ELSE_NO_ADJACENT_IF",X_V_FOR_NO_EXPRESSION:31,31:"X_V_FOR_NO_EXPRESSION",X_V_FOR_MALFORMED_EXPRESSION:32,32:"X_V_FOR_MALFORMED_EXPRESSION",X_V_FOR_TEMPLATE_KEY_PLACEMENT:33,33:"X_V_FOR_TEMPLATE_KEY_PLACEMENT",X_V_BIND_NO_EXPRESSION:34,34:"X_V_BIND_NO_EXPRESSION",X_V_ON_NO_EXPRESSION:35,35:"X_V_ON_NO_EXPRESSION",X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET:36,36:"X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET",X_V_SLOT_MIXED_SLOT_USAGE:37,37:"X_V_SLOT_MIXED_SLOT_USAGE",X_V_SLOT_DUPLICATE_SLOT_NAMES:38,38:"X_V_SLOT_DUPLICATE_SLOT_NAMES",X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN:39,39:"X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN",X_V_SLOT_MISPLACED:40,40:"X_V_SLOT_MISPLACED",X_V_MODEL_NO_EXPRESSION:41,41:"X_V_MODEL_NO_EXPRESSION",X_V_MODEL_MALFORMED_EXPRESSION:42,42:"X_V_MODEL_MALFORMED_EXPRESSION",X_V_MODEL_ON_SCOPE_VARIABLE:43,43:"X_V_MODEL_ON_SCOPE_VARIABLE",X_V_MODEL_ON_PROPS:44,44:"X_V_MODEL_ON_PROPS",X_V_MODEL_ON_CONST:45,45:"X_V_MODEL_ON_CONST",X_INVALID_EXPRESSION:46,46:"X_INVALID_EXPRESSION",X_KEEP_ALIVE_INVALID_CHILDREN:47,47:"X_KEEP_ALIVE_INVALID_CHILDREN",X_PREFIX_ID_NOT_SUPPORTED:48,48:"X_PREFIX_ID_NOT_SUPPORTED",X_MODULE_MODE_NOT_SUPPORTED:49,49:"X_MODULE_MODE_NOT_SUPPORTED",X_CACHE_HANDLER_NOT_SUPPORTED:50,50:"X_CACHE_HANDLER_NOT_SUPPORTED",X_SCOPE_ID_NOT_SUPPORTED:51,51:"X_SCOPE_ID_NOT_SUPPORTED",X_VNODE_HOOKS:52,52:"X_VNODE_HOOKS",X_V_BIND_INVALID_SAME_NAME_ARGUMENT:53,53:"X_V_BIND_INVALID_SAME_NAME_ARGUMENT",__EXTEND_POINT__:54,54:"__EXTEND_POINT__"},e6={0:"Illegal comment.",1:"CDATA section is allowed only in XML context.",2:"Duplicate attribute.",3:"End tag cannot have attributes.",4:"Illegal '/' in tags.",5:"Unexpected EOF in tag.",6:"Unexpected EOF in CDATA section.",7:"Unexpected EOF in comment.",8:"Unexpected EOF in script.",9:"Unexpected EOF in tag.",10:"Incorrectly closed comment.",11:"Incorrectly opened comment.",12:"Illegal tag name. Use '<' to print '<'.",13:"Attribute value was expected.",14:"End tag name was expected.",15:"Whitespace was expected.",16:"Unexpected '<!--' in comment.",17:`Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,18:"Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",19:"Attribute name cannot start with '='.",21:"'<?' is allowed only in XML context.",20:"Unexpected null character.",22:"Illegal '/' in tags.",23:"Invalid end tag.",24:"Element is missing end tag.",25:"Interpolation end sign was not found.",27:"End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",26:"Legal directive name was expected.",28:"v-if/v-else-if is missing expression.",29:"v-if/else branches must use unique keys.",30:"v-else/v-else-if has no adjacent v-if or v-else-if.",31:"v-for is missing expression.",32:"v-for has invalid expression.",33:"<template v-for> key should be placed on the <template> tag.",34:"v-bind is missing expression.",53:"v-bind with same-name shorthand only allows static argument.",35:"v-on is missing expression.",36:"Unexpected custom directive on <slot> outlet.",37:"Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.",38:"Duplicate slot names found. ",39:"Extraneous children found when component already has explicitly named default slot. These children will be ignored.",40:"v-slot can only be used on components or <template> tags.",41:"v-model is missing expression.",42:"v-model value must be a valid JavaScript member expression.",43:"v-model cannot be used on v-for or v-slot scope variables because they are not writable.",44:`v-model cannot be used on a prop, because local prop bindings are not writable.
|
||
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,45:"v-model cannot be used on a const binding because it is not writable.",46:"Error parsing JavaScript expression: ",47:"<KeepAlive> expects exactly one child component.",52:"@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.",48:'"prefixIdentifiers" option is not supported in this build of compiler.',49:"ES module mode is not supported in this build of compiler.",50:'"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.',51:'"scopeId" option is only supported in module mode.',54:""};function n6(e,o,i=!1,r=[],a=Object.create(null)){}function o6(e,o,i){return!1}function i6(e,o){if(e&&(e.type==="ObjectProperty"||e.type==="ArrayPattern")){let i=o.length;for(;i--;){const r=o[i];if(r.type==="AssignmentExpression")return!0;if(r.type!=="ObjectProperty"&&!r.type.endsWith("Pattern"))break}}return!1}function r6(e){let o=e.length;for(;o--;){const i=e[o];if(i.type==="NewExpression")return!0;if(i.type!=="MemberExpression")break}return!1}function a6(e,o){for(const i of e.params)for(const r of rn(i))o(r)}function Jp(e,o){const i=e.type==="SwitchCase"?e.consequent:e.body;for(const r of i)if(r.type==="VariableDeclaration"){if(r.declare)continue;for(const a of r.declarations)for(const s of rn(a.id))o(s)}else if(r.type==="FunctionDeclaration"||r.type==="ClassDeclaration"){if(r.declare||!r.id)continue;o(r.id)}else s6(r)?l6(r,!0,o):r.type==="SwitchStatement"&&c6(r,!0,o)}function s6(e){return e.type==="ForOfStatement"||e.type==="ForInStatement"||e.type==="ForStatement"}function l6(e,o,i){const r=e.type==="ForStatement"?e.init:e.left;if(r&&r.type==="VariableDeclaration"&&(r.kind==="var"?o:!o))for(const a of r.declarations)for(const s of rn(a.id))i(s)}function c6(e,o,i){for(const r of e.cases){for(const a of r.consequent)if(a.type==="VariableDeclaration"&&(a.kind==="var"?o:!o))for(const s of a.declarations)for(const l of rn(s.id))i(l);Jp(r,i)}}function rn(e,o=[]){switch(e.type){case"Identifier":o.push(e);break;case"MemberExpression":let i=e;for(;i.type==="MemberExpression";)i=i.object;o.push(i);break;case"ObjectPattern":for(const r of e.properties)r.type==="RestElement"?rn(r.argument,o):rn(r.value,o);break;case"ArrayPattern":e.elements.forEach(r=>{r&&rn(r,o)});break;case"RestElement":rn(e.argument,o);break;case"AssignmentPattern":rn(e.left,o);break}return o}const d6=e=>/Function(?:Expression|Declaration)$|Method$/.test(e.type),Kp=e=>e&&(e.type==="ObjectProperty"||e.type==="ObjectMethod")&&!e.computed,u6=(e,o)=>Kp(o)&&o.key===e,Qp=["TSAsExpression","TSTypeAssertion","TSNonNullExpression","TSInstantiationExpression","TSSatisfiesExpression"];function t1(e){return Qp.includes(e.type)?t1(e.expression):e}const ke=e=>e.type===4&&e.isStatic;function pc(e){switch(e){case"Teleport":case"teleport":return Yo;case"Suspense":case"suspense":return Na;case"KeepAlive":case"keep-alive":return Vi;case"BaseTransition":case"base-transition":return rc}}const h6=/^$|^\d|[^\$\w\xA0-\uFFFF]/,Ki=e=>!h6.test(e),fc=/[A-Za-z_$\xA0-\uFFFF]/,p6=/[\.\?\w$\xA0-\uFFFF]/,f6=/\s+[.[]\s*|\s*[.[]\s+/g,e1=e=>e.type===4?e.content:e.loc.source,n1=e=>{const o=e1(e).trim().replace(f6,c=>c.trim());let i=0,r=[],a=0,s=0,l=null;for(let c=0;c<o.length;c++){const d=o.charAt(c);switch(i){case 0:if(d==="[")r.push(i),i=1,a++;else if(d==="(")r.push(i),i=2,s++;else if(!(c===0?fc:p6).test(d))return!1;break;case 1:d==="'"||d==='"'||d==="`"?(r.push(i),i=3,l=d):d==="["?a++:d==="]"&&(--a||(i=r.pop()));break;case 2:if(d==="'"||d==='"'||d==="`")r.push(i),i=3,l=d;else if(d==="(")s++;else if(d===")"){if(c===o.length-1)return!1;--s||(i=r.pop())}break;case 3:d===l&&(i=r.pop(),l=null);break}}return!a&&!s},m6=Ni,mc=n1,g6=/^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/,o1=e=>g6.test(e1(e)),y6=Ni,i1=o1;function v6(e,o,i=o.length){return r1({offset:e.offset,line:e.line,column:e.column},o,i)}function r1(e,o,i=o.length){let r=0,a=-1;for(let s=0;s<i;s++)o.charCodeAt(s)===10&&(r++,a=s);return e.offset+=i,e.line+=r,e.column=a===-1?e.column+i:i-a,e}function _6(e,o){if(!e)throw new Error(o||"unexpected compiler condition")}function Ce(e,o,i=!1){for(let r=0;r<e.props.length;r++){const a=e.props[r];if(a.type===7&&(i||a.exp)&&(re(o)?a.name===o:o.test(a.name)))return a}}function Qi(e,o,i=!1,r=!1){for(let a=0;a<e.props.length;a++){const s=e.props[a];if(s.type===6){if(i)continue;if(s.name===o&&(s.value||r))return s}else if(s.name==="bind"&&(s.exp||r)&&Wn(s.arg,o))return s}}function Wn(e,o){return!!(e&&ke(e)&&e.content===o)}function a1(e){return e.props.some(o=>o.type===7&&o.name==="bind"&&(!o.arg||o.arg.type!==4||!o.arg.isStatic))}function Or(e){return e.type===5||e.type===2}function rl(e){return e.type===7&&e.name==="pre"}function gc(e){return e.type===7&&e.name==="slot"}function ri(e){return e.type===1&&e.tagType===3}function Hi(e){return e.type===1&&e.tagType===2}const b6=new Set([ni,hi]);function s1(e,o=[]){if(e&&!re(e)&&e.type===14){const i=e.callee;if(!re(i)&&b6.has(i))return s1(e.arguments[0],o.concat(e))}return[e,o]}function Gi(e,o,i){let r,a=e.type===13?e.props:e.arguments[2],s=[],l;if(a&&!re(a)&&a.type===14){const c=s1(a);a=c[0],s=c[1],l=s[s.length-1]}if(a==null||re(a))r=Oe([o]);else if(a.type===14){const c=a.arguments[0];!re(c)&&c.type===15?ku(o,c)||c.properties.unshift(o):a.callee===za?r=ne(i.helper(Ui),[Oe([o]),a]):a.arguments.unshift(Oe([o])),!r&&(r=a)}else a.type===15?(ku(o,a)||a.properties.unshift(o),r=a):(r=ne(i.helper(Ui),[Oe([o]),a]),l&&l.callee===hi&&(l=s[s.length-2]));e.type===13?l?l.arguments[0]=r:e.props=r:l?l.arguments[0]=r:e.arguments[2]=r}function ku(e,o){let i=!1;if(e.key.type===4){const r=e.key.content;i=o.properties.some(a=>a.key.type===4&&a.key.content===r)}return i}function ai(e,o){return`_${o}_${e.replace(/[^\w]/g,(i,r)=>i==="-"?"_":e.charCodeAt(r).toString())}`}function Fe(e,o){if(!e||Object.keys(o).length===0)return!1;switch(e.type){case 1:for(let i=0;i<e.props.length;i++){const r=e.props[i];if(r.type===7&&(Fe(r.arg,o)||Fe(r.exp,o)))return!0}return e.children.some(i=>Fe(i,o));case 11:return Fe(e.source,o)?!0:e.children.some(i=>Fe(i,o));case 9:return e.branches.some(i=>Fe(i,o));case 10:return Fe(e.condition,o)?!0:e.children.some(i=>Fe(i,o));case 4:return!e.isStatic&&Ki(e.content)&&!!o[e.content];case 8:return e.children.some(i=>kh(i)&&Fe(i,o));case 5:case 12:return Fe(e.content,o);case 2:case 3:case 20:return!1;default:return!1}}function l1(e){return e.type===14&&e.callee===Ga?e.arguments[1].returns:e}const c1=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;function yc(e){for(let o=0;o<e.length;o++)if(!Ie(e.charCodeAt(o)))return!1;return!0}function Fa(e){return e.type===2&&yc(e.content)||e.type===12&&Fa(e.content)}function vc(e){return e.type===3||Fa(e)}const d1={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:sr,isPreTag:sr,isIgnoreNewlineTag:sr,isCustomElement:sr,onError:hc,onWarn:Zp,comments:!1,prefixIdentifiers:!1};let Nt=d1,Yi=null,Sn="",me=null,Ct=null,xe="",gn=-1,mo=-1,_c=0,Yn=!1,al=null;const Gt=[],Ft=new Z3(Gt,{onerr:fn,ontext(e,o){mr(de(e,o),e,o)},ontextentity(e,o,i){mr(e,o,i)},oninterpolation(e,o){if(Yn)return mr(de(e,o),e,o);let i=e+Ft.delimiterOpen.length,r=o-Ft.delimiterClose.length;for(;Ie(Sn.charCodeAt(i));)i++;for(;Ie(Sn.charCodeAt(r-1));)r--;let a=de(i,r);a.includes("&")&&(a=Nt.decodeEntities(a,!1)),sl({type:5,content:Dr(a,!1,jt(i,r)),loc:jt(e,o)})},onopentagname(e,o){const i=de(e,o);me={type:1,tag:i,ns:Nt.getNamespace(i,Gt[0],Nt.ns),tagType:0,props:[],children:[],loc:jt(e-1,o),codegenNode:void 0}},onopentagend(e){Su(e)},onclosetag(e,o){const i=de(e,o);if(!Nt.isVoidTag(i)){let r=!1;for(let a=0;a<Gt.length;a++)if(Gt[a].tag.toLowerCase()===i.toLowerCase()){r=!0,a>0&&fn(24,Gt[0].loc.start.offset);for(let s=0;s<=a;s++){const l=Gt.shift();Lr(l,o,s<a)}break}r||fn(23,u1(e,60))}},onselfclosingtag(e){const o=me.tag;me.isSelfClosing=!0,Su(e),Gt[0]&&Gt[0].tag===o&&Lr(Gt.shift(),e)},onattribname(e,o){Ct={type:6,name:de(e,o),nameLoc:jt(e,o),value:void 0,loc:jt(e)}},ondirname(e,o){const i=de(e,o),r=i==="."||i===":"?"bind":i==="@"?"on":i==="#"?"slot":i.slice(2);if(!Yn&&r===""&&fn(26,e),Yn||r==="")Ct={type:6,name:i,nameLoc:jt(e,o),value:void 0,loc:jt(e)};else if(Ct={type:7,name:r,rawName:i,exp:void 0,arg:void 0,modifiers:i==="."?[gt("prop")]:[],loc:jt(e)},r==="pre"){Yn=Ft.inVPre=!0,al=me;const a=me.props;for(let s=0;s<a.length;s++)a[s].type===7&&(a[s]=T6(a[s]))}},ondirarg(e,o){if(e===o)return;const i=de(e,o);if(Yn&&!rl(Ct))Ct.name+=i,vo(Ct.nameLoc,o);else{const r=i[0]!=="[";Ct.arg=Dr(r?i:i.slice(1,-1),r,jt(e,o),r?3:0)}},ondirmodifier(e,o){const i=de(e,o);if(Yn&&!rl(Ct))Ct.name+="."+i,vo(Ct.nameLoc,o);else if(Ct.name==="slot"){const r=Ct.arg;r&&(r.content+="."+i,vo(r.loc,o))}else{const r=gt(i,!0,jt(e,o));Ct.modifiers.push(r)}},onattribdata(e,o){xe+=de(e,o),gn<0&&(gn=e),mo=o},onattribentity(e,o,i){xe+=e,gn<0&&(gn=o),mo=i},onattribnameend(e){const o=Ct.loc.start.offset,i=de(o,e);Ct.type===7&&(Ct.rawName=i),me.props.some(r=>(r.type===7?r.rawName:r.name)===i)&&fn(2,o)},onattribend(e,o){if(me&&Ct){if(vo(Ct.loc,o),e!==0)if(xe.includes("&")&&(xe=Nt.decodeEntities(xe,!0)),Ct.type===6)Ct.name==="class"&&(xe=p1(xe).trim()),e===1&&!xe&&fn(13,o),Ct.value={type:2,content:xe,loc:e===1?jt(gn,mo):jt(gn-1,mo+1)},Ft.inSFCRoot&&me.tag==="template"&&Ct.name==="lang"&&xe&&xe!=="html"&&Ft.enterRCDATA(oa("</template"),0);else{let i=0;Ct.exp=Dr(xe,!1,jt(gn,mo),0,i),Ct.name==="for"&&(Ct.forParseResult=k6(Ct.exp));let r=-1;Ct.name==="bind"&&(r=Ct.modifiers.findIndex(a=>a.content==="sync"))>-1&&ii("COMPILER_V_BIND_SYNC",Nt,Ct.loc,Ct.arg.loc.source)&&(Ct.name="model",Ct.modifiers.splice(r,1))}(Ct.type!==7||Ct.name!=="pre")&&me.props.push(Ct)}xe="",gn=mo=-1},oncomment(e,o){Nt.comments&&sl({type:3,content:de(e,o),loc:jt(e-4,o+3)})},onend(){const e=Sn.length;for(let o=0;o<Gt.length;o++)Lr(Gt[o],e-1),fn(24,Gt[o].loc.start.offset)},oncdata(e,o){Gt[0].ns!==0?mr(de(e,o),e,o):fn(1,e-9)},onprocessinginstruction(e){(Gt[0]?Gt[0].ns:Nt.ns)===0&&fn(21,e-1)}}),wu=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,C6=/^\(|\)$/g;function k6(e){const o=e.loc,i=e.content,r=i.match(c1);if(!r)return;const[,a,s]=r,l=(f,v,_=!1)=>{const b=o.start.offset+v,C=b+f.length;return Dr(f,!1,jt(b,C),0,_?1:0)},c={source:l(s.trim(),i.indexOf(s,a.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let d=a.trim().replace(C6,"").trim();const u=a.indexOf(d),h=d.match(wu);if(h){d=d.replace(wu,"").trim();const f=h[1].trim();let v;if(f&&(v=i.indexOf(f,u+d.length),c.key=l(f,v,!0)),h[2]){const _=h[2].trim();_&&(c.index=l(_,i.indexOf(_,c.key?v+f.length:u+d.length),!0))}}return d&&(c.value=l(d,u,!0)),c}function de(e,o){return Sn.slice(e,o)}function Su(e){Ft.inSFCRoot&&(me.innerLoc=jt(e+1,e+1)),sl(me);const{tag:o,ns:i}=me;i===0&&Nt.isPreTag(o)&&_c++,Nt.isVoidTag(o)?Lr(me,e):(Gt.unshift(me),(i===1||i===2)&&(Ft.inXML=!0)),me=null}function mr(e,o,i){{const s=Gt[0]&&Gt[0].tag;s!=="script"&&s!=="style"&&e.includes("&")&&(e=Nt.decodeEntities(e,!1))}const r=Gt[0]||Yi,a=r.children[r.children.length-1];a&&a.type===2?(a.content+=e,vo(a.loc,i)):r.children.push({type:2,content:e,loc:jt(o,i)})}function Lr(e,o,i=!1){i?vo(e.loc,u1(o,60)):vo(e.loc,w6(o,62)+1),Ft.inSFCRoot&&(e.children.length?e.innerLoc.end=wn({},e.children[e.children.length-1].loc.end):e.innerLoc.end=wn({},e.innerLoc.start),e.innerLoc.source=de(e.innerLoc.start.offset,e.innerLoc.end.offset));const{tag:r,ns:a,children:s}=e;if(Yn||(r==="slot"?e.tagType=2:xu(e)?e.tagType=3:x6(e)&&(e.tagType=1)),Ft.inRCDATA||(e.children=h1(s)),a===0&&Nt.isIgnoreNewlineTag(r)){const l=s[0];l&&l.type===2&&(l.content=l.content.replace(/^\r?\n/,""))}a===0&&Nt.isPreTag(r)&&_c--,al===e&&(Yn=Ft.inVPre=!1,al=null),Ft.inXML&&(Gt[0]?Gt[0].ns:Nt.ns)===0&&(Ft.inXML=!1);{const l=e.props;if(!Ft.inSFCRoot&&Co("COMPILER_NATIVE_TEMPLATE",Nt)&&e.tag==="template"&&!xu(e)){const d=Gt[0]||Yi,u=d.children.indexOf(e);d.children.splice(u,1,...e.children)}const c=l.find(d=>d.type===6&&d.name==="inline-template");c&&ii("COMPILER_INLINE_TEMPLATE",Nt,c.loc)&&e.children.length&&(c.value={type:2,content:de(e.children[0].loc.start.offset,e.children[e.children.length-1].loc.end.offset),loc:c.loc})}}function w6(e,o){let i=e;for(;Sn.charCodeAt(i)!==o&&i<Sn.length-1;)i++;return i}function u1(e,o){let i=e;for(;Sn.charCodeAt(i)!==o&&i>=0;)i--;return i}const S6=new Set(["if","else","else-if","for","slot"]);function xu({tag:e,props:o}){if(e==="template"){for(let i=0;i<o.length;i++)if(o[i].type===7&&S6.has(o[i].name))return!0}return!1}function x6({tag:e,props:o}){if(Nt.isCustomElement(e))return!1;if(e==="component"||E6(e.charCodeAt(0))||pc(e)||Nt.isBuiltInComponent&&Nt.isBuiltInComponent(e)||Nt.isNativeTag&&!Nt.isNativeTag(e))return!0;for(let i=0;i<o.length;i++){const r=o[i];if(r.type===6){if(r.name==="is"&&r.value&&(r.value.content.startsWith("vue:")||ii("COMPILER_IS_ON_ELEMENT",Nt,r.loc)))return!0}else if(r.name==="bind"&&Wn(r.arg,"is")&&ii("COMPILER_IS_ON_ELEMENT",Nt,r.loc))return!0}return!1}function E6(e){return e>64&&e<91}const M6=/\r\n/g;function h1(e){const o=Nt.whitespace!=="preserve";let i=!1;for(let r=0;r<e.length;r++){const a=e[r];if(a.type===2)if(_c)a.content=a.content.replace(M6,`
|
||
`);else if(yc(a.content)){const s=e[r-1]&&e[r-1].type,l=e[r+1]&&e[r+1].type;!s||!l||o&&(s===3&&(l===3||l===1)||s===1&&(l===3||l===1&&A6(a.content)))?(i=!0,e[r]=null):a.content=" "}else o&&(a.content=p1(a.content))}return i?e.filter(Boolean):e}function A6(e){for(let o=0;o<e.length;o++){const i=e.charCodeAt(o);if(i===10||i===13)return!0}return!1}function p1(e){let o="",i=!1;for(let r=0;r<e.length;r++)Ie(e.charCodeAt(r))?i||(o+=" ",i=!0):(o+=e[r],i=!1);return o}function sl(e){(Gt[0]||Yi).children.push(e)}function jt(e,o){return{start:Ft.getPos(e),end:o==null?o:Ft.getPos(o),source:o==null?o:de(e,o)}}function N6(e){return jt(e.start.offset,e.end.offset)}function vo(e,o){e.end=Ft.getPos(o),e.source=de(e.start.offset,o)}function T6(e){const o={type:6,name:e.rawName,nameLoc:jt(e.loc.start.offset,e.loc.start.offset+e.rawName.length),value:void 0,loc:e.loc};if(e.exp){const i=e.exp.loc;i.end.offset<e.loc.end.offset&&(i.start.offset--,i.start.column--,i.end.offset++,i.end.column++),o.value={type:2,content:e.exp.content,loc:i}}return o}function Dr(e,o=!1,i,r=0,a=0){return gt(e,o,i,r)}function fn(e,o,i){Nt.onError(Rt(e,jt(o,o)))}function I6(){Ft.reset(),me=null,Ct=null,xe="",gn=-1,mo=-1,Gt.length=0}function bc(e,o){if(I6(),Sn=e,Nt=wn({},d1),o){let a;for(a in o)o[a]!=null&&(Nt[a]=o[a])}Ft.mode=Nt.parseMode==="html"?1:Nt.parseMode==="sfc"?2:0,Ft.inXML=Nt.ns===1||Nt.ns===2;const i=o&&o.delimiters;i&&(Ft.delimiterOpen=oa(i[0]),Ft.delimiterClose=oa(i[1]));const r=Yi=Wp([],e);return Ft.parse(Sn),r.loc=jt(0,e.length),r.children=h1(r.children),Yi=null,r}function O6(e,o){Pr(e,void 0,o,!!f1(e))}function f1(e){const o=e.children.filter(i=>i.type!==3);return o.length===1&&o[0].type===1&&!Hi(o[0])?o[0]:null}function Pr(e,o,i,r=!1,a=!1){const{children:s}=e,l=[];for(let h=0;h<s.length;h++){const f=s[h];if(f.type===1&&f.tagType===0){const v=r?0:Ne(f,i);if(v>0){if(v>=2){f.codegenNode.patchFlag=-1,l.push(f);continue}}else{const _=f.codegenNode;if(_.type===13){const b=_.patchFlag;if((b===void 0||b===512||b===1)&&g1(f,i)>=2){const C=y1(f);C&&(_.props=i.hoist(C))}_.dynamicProps&&(_.dynamicProps=i.hoist(_.dynamicProps))}}}else if(f.type===12&&(r?0:Ne(f,i))>=2){f.codegenNode.type===14&&f.codegenNode.arguments.length>0&&f.codegenNode.arguments.push("-1"),l.push(f);continue}if(f.type===1){const v=f.tagType===1;v&&i.scopes.vSlot++,Pr(f,e,i,!1,a),v&&i.scopes.vSlot--}else if(f.type===11)Pr(f,e,i,f.children.length===1,!0);else if(f.type===9)for(let v=0;v<f.branches.length;v++)Pr(f.branches[v],e,i,f.branches[v].children.length===1,a)}let c=!1;if(l.length===s.length&&e.type===1){if(e.tagType===0&&e.codegenNode&&e.codegenNode.type===13&&Fn(e.codegenNode.children))e.codegenNode.children=d(Jn(e.codegenNode.children)),c=!0;else if(e.tagType===1&&e.codegenNode&&e.codegenNode.type===13&&e.codegenNode.children&&!Fn(e.codegenNode.children)&&e.codegenNode.children.type===15){const h=u(e.codegenNode,"default");h&&(h.returns=d(Jn(h.returns)),c=!0)}else if(e.tagType===3&&o&&o.type===1&&o.tagType===1&&o.codegenNode&&o.codegenNode.type===13&&o.codegenNode.children&&!Fn(o.codegenNode.children)&&o.codegenNode.children.type===15){const h=Ce(e,"slot",!0),f=h&&h.arg&&u(o.codegenNode,h.arg);f&&(f.returns=d(Jn(f.returns)),c=!0)}}if(!c)for(const h of l)h.codegenNode=i.cache(h.codegenNode);function d(h){const f=i.cache(h);return f.needArraySpread=!0,f}function u(h,f){if(h.children&&!Fn(h.children)&&h.children.type===15){const v=h.children.properties.find(_=>_.key===f||_.key.content===f);return v&&v.value}}l.length&&i.transformHoist&&i.transformHoist(s,i,e)}function Ne(e,o){const{constantCache:i}=o;switch(e.type){case 1:if(e.tagType!==0)return 0;const r=i.get(e);if(r!==void 0)return r;const a=e.codegenNode;if(a.type!==13||a.isBlock&&e.tag!=="svg"&&e.tag!=="foreignObject"&&e.tag!=="math")return 0;if(a.patchFlag===void 0){let l=3;const c=g1(e,o);if(c===0)return i.set(e,0),0;c<l&&(l=c);for(let d=0;d<e.children.length;d++){const u=Ne(e.children[d],o);if(u===0)return i.set(e,0),0;u<l&&(l=u)}if(l>1)for(let d=0;d<e.props.length;d++){const u=e.props[d];if(u.type===7&&u.name==="bind"&&u.exp){const h=Ne(u.exp,o);if(h===0)return i.set(e,0),0;h<l&&(l=h)}}if(a.isBlock){for(let d=0;d<e.props.length;d++)if(e.props[d].type===7)return i.set(e,0),0;o.removeHelper(eo),o.removeHelper(Ao(o.inSSR,a.isComponent)),a.isBlock=!1,o.helper(Mo(o.inSSR,a.isComponent))}return i.set(e,l),l}else return i.set(e,0),0;case 2:case 3:return 3;case 9:case 11:case 10:return 0;case 5:case 12:return Ne(e.content,o);case 4:return e.constType;case 8:let s=3;for(let l=0;l<e.children.length;l++){const c=e.children[l];if(re(c)||Ol(c))continue;const d=Ne(c,o);if(d===0)return 0;d<s&&(s=d)}return s;case 20:return 2;default:return 0}}const L6=new Set([Va,Ua,ni,hi]);function m1(e,o){if(e.type===14&&!re(e.callee)&&L6.has(e.callee)){const i=e.arguments[0];if(i.type===4)return Ne(i,o);if(i.type===14)return m1(i,o)}return 0}function g1(e,o){let i=3;const r=y1(e);if(r&&r.type===15){const{properties:a}=r;for(let s=0;s<a.length;s++){const{key:l,value:c}=a[s],d=Ne(l,o);if(d===0)return d;d<i&&(i=d);let u;if(c.type===4?u=Ne(c,o):c.type===14?u=m1(c,o):u=0,u===0)return u;u<i&&(i=u)}}return i}function y1(e){const o=e.codegenNode;if(o.type===13)return o.props}function v1(e,{filename:o="",prefixIdentifiers:i=!1,hoistStatic:r=!1,hmr:a=!1,cacheHandlers:s=!1,nodeTransforms:l=[],directiveTransforms:c={},transformHoist:d=null,isBuiltInComponent:u=Ni,isCustomElement:h=Ni,expressionPlugins:f=[],scopeId:v=null,slotted:_=!0,ssr:b=!1,inSSR:C=!1,ssrCssVars:D="",bindingMetadata:L=ig,inline:B=!1,isTS:X=!1,onError:nt=hc,onWarn:Z=Zp,compatConfig:rt}){const st=o.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),J={filename:o,selfName:st&&Ch(Zn(st[1])),prefixIdentifiers:i,hoistStatic:r,hmr:a,cacheHandlers:s,nodeTransforms:l,directiveTransforms:c,transformHoist:d,isBuiltInComponent:u,isCustomElement:h,expressionPlugins:f,scopeId:v,slotted:_,ssr:b,inSSR:C,ssrCssVars:D,bindingMetadata:L,inline:B,isTS:X,onError:nt,onWarn:Z,compatConfig:rt,root:e,helpers:new Map,components:new Set,directives:new Set,hoists:[],imports:[],cached:[],constantCache:new WeakMap,temps:0,identifiers:Object.create(null),scopes:{vFor:0,vSlot:0,vPre:0,vOnce:0},parent:null,grandParent:null,currentNode:e,childIndex:0,inVOnce:!1,helper(ot){const lt=J.helpers.get(ot)||0;return J.helpers.set(ot,lt+1),ot},removeHelper(ot){const lt=J.helpers.get(ot);if(lt){const T=lt-1;T?J.helpers.set(ot,T):J.helpers.delete(ot)}},helperString(ot){return`_${xo[J.helper(ot)]}`},replaceNode(ot){J.parent.children[J.childIndex]=J.currentNode=ot},removeNode(ot){const lt=J.parent.children,T=ot?lt.indexOf(ot):J.currentNode?J.childIndex:-1;!ot||ot===J.currentNode?(J.currentNode=null,J.onNodeRemoved()):J.childIndex>T&&(J.childIndex--,J.onNodeRemoved()),J.parent.children.splice(T,1)},onNodeRemoved:Ni,addIdentifiers(ot){},removeIdentifiers(ot){},hoist(ot){re(ot)&&(ot=gt(ot)),J.hoists.push(ot);const lt=gt(`_hoisted_${J.hoists.length}`,!1,ot.loc,2);return lt.hoisted=ot,lt},cache(ot,lt=!1,T=!1){const V=jp(J.cached.length,ot,lt,T);return J.cached.push(V),V}};return J.filters=new Set,J}function _1(e,o){const i=v1(e,o);tr(e,i),o.hoistStatic&&O6(e,i),o.ssr||D6(e,i),e.helpers=new Set([...i.helpers.keys()]),e.components=[...i.components],e.directives=[...i.directives],e.imports=i.imports,e.hoists=i.hoists,e.temps=i.temps,e.cached=i.cached,e.transformed=!0,e.filters=[...i.filters]}function D6(e,o){const{helper:i}=o,{children:r}=e;if(r.length===1){const a=f1(e);if(a&&a.codegenNode){const s=a.codegenNode;s.type===13&&Ya(s,o),e.codegenNode=s}else e.codegenNode=r[0]}else if(r.length>1){let a=64;e.codegenNode=oi(o,i(ei),void 0,e.children,a,void 0,void 0,!0,void 0,!1)}}function P6(e,o){let i=0;const r=()=>{i--};for(;i<e.children.length;i++){const a=e.children[i];re(a)||(o.grandParent=o.parent,o.parent=e,o.childIndex=i,o.onNodeRemoved=r,tr(a,o))}}function tr(e,o){o.currentNode=e;const{nodeTransforms:i}=o,r=[];for(let s=0;s<i.length;s++){const l=i[s](e,o);if(l&&(Fn(l)?r.push(...l):r.push(l)),o.currentNode)e=o.currentNode;else return}switch(e.type){case 3:o.ssr||o.helper(ui);break;case 5:o.ssr||o.helper(Ji);break;case 9:for(let s=0;s<e.branches.length;s++)tr(e.branches[s],o);break;case 10:case 11:case 1:case 0:P6(e,o);break}o.currentNode=e;let a=r.length;for(;a--;)r[a]()}function Cc(e,o){const i=re(e)?r=>r===e:r=>e.test(r);return(r,a)=>{if(r.type===1){const{props:s}=r;if(r.tagType===3&&s.some(gc))return;const l=[];for(let c=0;c<s.length;c++){const d=s[c];if(d.type===7&&i(d.name)){s.splice(c,1),c--;const u=o(r,d,a);u&&l.push(u)}}return l}}}const Xa="/*@__PURE__*/",b1=e=>`${xo[e]}: _${xo[e]}`;function R6(e,{mode:o="function",prefixIdentifiers:i=o==="module",sourceMap:r=!1,filename:a="template.vue.html",scopeId:s=null,optimizeImports:l=!1,runtimeGlobalName:c="Vue",runtimeModuleName:d="vue",ssrRuntimeModuleName:u="vue/server-renderer",ssr:h=!1,isTS:f=!1,inSSR:v=!1}){const _={mode:o,prefixIdentifiers:i,sourceMap:r,filename:a,scopeId:s,optimizeImports:l,runtimeGlobalName:c,runtimeModuleName:d,ssrRuntimeModuleName:u,ssr:h,isTS:f,inSSR:v,source:e.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(C){return`_${xo[C]}`},push(C,D=-2,L){_.code+=C},indent(){b(++_.indentLevel)},deindent(C=!1){C?--_.indentLevel:b(--_.indentLevel)},newline(){b(_.indentLevel)}};function b(C){_.push(`
|
||
`+" ".repeat(C),0)}return _}function C1(e,o={}){const i=R6(e,o);o.onContextCreated&&o.onContextCreated(i);const{mode:r,push:a,prefixIdentifiers:s,indent:l,deindent:c,newline:d,scopeId:u,ssr:h}=i,f=Array.from(e.helpers),v=f.length>0,_=!s&&r!=="module";B6(e,i);const b=h?"ssrRender":"render",C=(h?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(a(`function ${b}(${C}) {`),l(),_&&(a("with (_ctx) {"),l(),v&&(a(`const { ${f.map(b1).join(", ")} } = _Vue
|
||
`,-1),d())),e.components.length&&(xs(e.components,"component",i),(e.directives.length||e.temps>0)&&d()),e.directives.length&&(xs(e.directives,"directive",i),e.temps>0&&d()),e.filters&&e.filters.length&&(d(),xs(e.filters,"filter",i),d()),e.temps>0){a("let ");for(let D=0;D<e.temps;D++)a(`${D>0?", ":""}_temp${D}`)}return(e.components.length||e.directives.length||e.temps)&&(a(`
|
||
`,0),d()),h||a("return "),e.codegenNode?ye(e.codegenNode,i):a("null"),_&&(c(),a("}")),c(),a("}"),{ast:e,code:i.code,preamble:"",map:i.map?i.map.toJSON():void 0}}function B6(e,o){const{ssr:i,prefixIdentifiers:r,push:a,newline:s,runtimeModuleName:l,runtimeGlobalName:c,ssrRuntimeModuleName:d}=o,u=c,h=Array.from(e.helpers);if(h.length>0&&(a(`const _Vue = ${u}
|
||
`,-1),e.hoists.length)){const f=[Ta,Ia,ui,Oa,lc].filter(v=>h.includes(v)).map(b1).join(", ");a(`const { ${f} } = _Vue
|
||
`,-1)}$6(e.hoists,o),s(),a("return ")}function xs(e,o,{helper:i,push:r,newline:a,isTS:s}){const l=i(o==="filter"?Ra:o==="component"?La:Pa);for(let c=0;c<e.length;c++){let d=e[c];const u=d.endsWith("__self");u&&(d=d.slice(0,-6)),r(`const ${ai(d,o)} = ${l}(${JSON.stringify(d)}${u?", true":""})${s?"!":""}`),c<e.length-1&&a()}}function $6(e,o){if(!e.length)return;o.pure=!0;const{push:i,newline:r}=o;r();for(let a=0;a<e.length;a++){const s=e[a];s&&(i(`const _hoisted_${a+1} = `),ye(s,o),r())}o.pure=!1}function kc(e,o){const i=e.length>3||!1;o.push("["),i&&o.indent(),er(e,o,i),i&&o.deindent(),o.push("]")}function er(e,o,i=!1,r=!0){const{push:a,newline:s}=o;for(let l=0;l<e.length;l++){const c=e[l];re(c)?a(c,-3):Fn(c)?kc(c,o):ye(c,o),l<e.length-1&&(i?(r&&a(","),s()):r&&a(", "))}}function ye(e,o){if(re(e)){o.push(e,-3);return}if(Ol(e)){o.push(o.helper(e));return}switch(e.type){case 1:case 9:case 11:ye(e.codegenNode,o);break;case 2:V6(e,o);break;case 4:k1(e,o);break;case 5:U6(e,o);break;case 12:ye(e.codegenNode,o);break;case 8:w1(e,o);break;case 3:H6(e,o);break;case 13:G6(e,o);break;case 14:F6(e,o);break;case 15:X6(e,o);break;case 17:W6(e,o);break;case 18:j6(e,o);break;case 19:q6(e,o);break;case 20:Z6(e,o);break;case 21:er(e.body,o,!0,!1);break}}function V6(e,o){o.push(JSON.stringify(e.content),-3,e)}function k1(e,o){const{content:i,isStatic:r}=e;o.push(r?JSON.stringify(i):i,-3,e)}function U6(e,o){const{push:i,helper:r,pure:a}=o;a&&i(Xa),i(`${r(Ji)}(`),ye(e.content,o),i(")")}function w1(e,o){for(let i=0;i<e.children.length;i++){const r=e.children[i];re(r)?o.push(r,-3):ye(r,o)}}function z6(e,o){const{push:i}=o;if(e.type===8)i("["),w1(e,o),i("]");else if(e.isStatic){const r=Ki(e.content)?e.content:JSON.stringify(e.content);i(r,-2,e)}else i(`[${e.content}]`,-3,e)}function H6(e,o){const{push:i,helper:r,pure:a}=o;a&&i(Xa),i(`${r(ui)}(${JSON.stringify(e.content)})`,-3,e)}function G6(e,o){const{push:i,helper:r,pure:a}=o,{tag:s,props:l,children:c,patchFlag:d,dynamicProps:u,directives:h,isBlock:f,disableTracking:v,isComponent:_}=e;let b;d&&(b=String(d)),h&&i(r(Ba)+"("),f&&i(`(${r(eo)}(${v?"true":""}), `),a&&i(Xa);const C=f?Ao(o.inSSR,_):Mo(o.inSSR,_);i(r(C)+"(",-2,e),er(Y6([s,l,c,b,u]),o),i(")"),f&&i(")"),h&&(i(", "),ye(h,o),i(")"))}function Y6(e){let o=e.length;for(;o--&&e[o]==null;);return e.slice(0,o+1).map(i=>i||"null")}function F6(e,o){const{push:i,helper:r,pure:a}=o,s=re(e.callee)?e.callee:r(e.callee);a&&i(Xa),i(s+"(",-2,e),er(e.arguments,o),i(")")}function X6(e,o){const{push:i,indent:r,deindent:a,newline:s}=o,{properties:l}=e;if(!l.length){i("{}",-2,e);return}const c=l.length>1||!1;i(c?"{":"{ "),c&&r();for(let d=0;d<l.length;d++){const{key:u,value:h}=l[d];z6(u,o),i(": "),ye(h,o),d<l.length-1&&(i(","),s())}c&&a(),i(c?"}":" }")}function W6(e,o){kc(e.elements,o)}function j6(e,o){const{push:i,indent:r,deindent:a}=o,{params:s,returns:l,body:c,newline:d,isSlot:u}=e;u&&i(`_${xo[Ha]}(`),i("(",-2,e),Fn(s)?er(s,o):s&&ye(s,o),i(") => "),(d||c)&&(i("{"),r()),l?(d&&i("return "),Fn(l)?kc(l,o):ye(l,o)):c&&ye(c,o),(d||c)&&(a(),i("}")),u&&(e.isNonScopedSlot&&i(", undefined, true"),i(")"))}function q6(e,o){const{test:i,consequent:r,alternate:a,newline:s}=e,{push:l,indent:c,deindent:d,newline:u}=o;if(i.type===4){const f=!Ki(i.content);f&&l("("),k1(i,o),f&&l(")")}else l("("),ye(i,o),l(")");s&&c(),o.indentLevel++,s||l(" "),l("? "),ye(r,o),o.indentLevel--,s&&u(),s||l(" "),l(": ");const h=a.type===19;h||o.indentLevel++,ye(a,o),h||o.indentLevel--,s&&d(!0)}function Z6(e,o){const{push:i,helper:r,indent:a,deindent:s,newline:l}=o,{needPauseTracking:c,needArraySpread:d}=e;d&&i("[...("),i(`_cache[${e.index}] || (`),c&&(a(),i(`${r(zi)}(-1`),e.inVOnce&&i(", true"),i("),"),l(),i("(")),i(`_cache[${e.index}] = `),ye(e.value,o),c&&(i(`).cacheIndex = ${e.index},`),l(),i(`${r(zi)}(1),`),l(),i(`_cache[${e.index}]`),s()),i(")"),d&&i(")]")}new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b");const J6=(e,o)=>{if(e.type===5)e.content=Rr(e.content,o);else if(e.type===1){const i=Ce(e,"memo");for(let r=0;r<e.props.length;r++){const a=e.props[r];if(a.type===7&&a.name!=="for"){const s=a.exp,l=a.arg;s&&s.type===4&&!(a.name==="on"&&l)&&!(i&&l&&l.type===4&&l.content==="key")&&(a.exp=Rr(s,o,a.name==="slot")),l&&l.type===4&&!l.isStatic&&(a.arg=Rr(l,o))}}}};function Rr(e,o,i=!1,r=!1,a=Object.create(o.identifiers)){return e}function S1(e){return re(e)?e:e.type===4?e.content:e.children.map(S1).join("")}const K6=Cc(/^(?:if|else|else-if)$/,(e,o,i)=>x1(e,o,i,(r,a,s)=>{const l=i.parent.children;let c=l.indexOf(r),d=0;for(;c-->=0;){const u=l[c];u&&u.type===9&&(d+=u.branches.length)}return()=>{if(s)r.codegenNode=Mu(a,d,i);else{const u=Q6(r.codegenNode);u.alternate=Mu(a,d+r.branches.length-1,i)}}}));function x1(e,o,i,r){if(o.name!=="else"&&(!o.exp||!o.exp.content.trim())){const a=o.exp?o.exp.loc:e.loc;i.onError(Rt(28,o.loc)),o.exp=gt("true",!1,a)}if(o.name==="if"){const a=Eu(e,o),s={type:9,loc:N6(e.loc),branches:[a]};if(i.replaceNode(s),r)return r(s,a,!0)}else{const a=i.parent.children;let s=a.indexOf(e);for(;s-->=-1;){const l=a[s];if(l&&vc(l)){i.removeNode(l);continue}if(l&&l.type===9){(o.name==="else-if"||o.name==="else")&&l.branches[l.branches.length-1].condition===void 0&&i.onError(Rt(30,e.loc)),i.removeNode();const c=Eu(e,o);l.branches.push(c);const d=r&&r(l,c,!1);tr(c,i),d&&d(),i.currentNode=null}else i.onError(Rt(30,e.loc));break}}}function Eu(e,o){const i=e.tagType===3;return{type:10,loc:e.loc,condition:o.name==="else"?void 0:o.exp,children:i&&!Ce(e,"for")?e.children:[e],userKey:Qi(e,"key"),isTemplateIf:i}}function Mu(e,o,i){return e.condition?na(e.condition,Au(e,o,i),ne(i.helper(ui),['""',"true"])):Au(e,o,i)}function Au(e,o,i){const{helper:r}=i,a=Jt("key",gt(`${o}`,!1,ae,2)),{children:s}=e,l=s[0];if(s.length!==1||l.type!==1)if(s.length===1&&l.type===11){const c=l.codegenNode;return Gi(c,a,i),c}else return oi(i,r(ei),Oe([a]),s,64,void 0,void 0,!0,!1,!1,e.loc);else{const c=l.codegenNode,d=l1(c);return d.type===13&&Ya(d,i),Gi(d,a,i),c}}function Q6(e){for(;;)if(e.type===19)if(e.alternate.type===19)e=e.alternate;else return e;else e.type===20&&(e=e.value)}const t8=Cc("for",(e,o,i)=>{const{helper:r,removeHelper:a}=i;return E1(e,o,i,s=>{const l=ne(r($a),[s.source]),c=ri(e),d=Ce(e,"memo"),u=Qi(e,"key",!1,!0);u&&u.type;let h=u&&(u.type===6?u.value?gt(u.value.content,!0):void 0:u.exp);const f=u&&h?Jt("key",h):null,v=s.source.type===4&&s.source.constType>0,_=v?64:u?128:256;return s.codegenNode=oi(i,r(ei),void 0,l,_,void 0,void 0,!0,!v,!1,e.loc),()=>{let b;const{children:C}=s,D=C.length!==1||C[0].type!==1,L=Hi(e)?e:c&&e.children.length===1&&Hi(e.children[0])?e.children[0]:null;if(L?(b=L.codegenNode,c&&f&&Gi(b,f,i)):D?b=oi(i,r(ei),f?Oe([f]):void 0,e.children,64,void 0,void 0,!0,void 0,!1):(b=C[0].codegenNode,c&&f&&Gi(b,f,i),b.isBlock!==!v&&(b.isBlock?(a(eo),a(Ao(i.inSSR,b.isComponent))):a(Mo(i.inSSR,b.isComponent))),b.isBlock=!v,b.isBlock?(r(eo),r(Ao(i.inSSR,b.isComponent))):r(Mo(i.inSSR,b.isComponent))),d){const B=Eo(ia(s.parseResult,[gt("_cached")]));B.body=qp([Ue(["const _memo = (",d.exp,")"]),Ue(["if (_cached",...h?[" && _cached.key === ",h]:[],` && ${i.helperString(uc)}(_cached, _memo)) return _cached`]),Ue(["const _item = ",b]),gt("_item.memo = _memo"),gt("return _item")]),l.arguments.push(B,gt("_cache"),gt(String(i.cached.length))),i.cached.push(null)}else l.arguments.push(Eo(ia(s.parseResult),b,!0))}})});function E1(e,o,i,r){if(!o.exp){i.onError(Rt(31,o.loc));return}const a=o.forParseResult;if(!a){i.onError(Rt(32,o.loc));return}wc(a);const{addIdentifiers:s,removeIdentifiers:l,scopes:c}=i,{source:d,value:u,key:h,index:f}=a,v={type:11,loc:o.loc,source:d,valueAlias:u,keyAlias:h,objectIndexAlias:f,parseResult:a,children:ri(e)?e.children:[e]};i.replaceNode(v),c.vFor++;const _=r&&r(v);return()=>{c.vFor--,_&&_()}}function wc(e,o){e.finalized||(e.finalized=!0)}function ia({value:e,key:o,index:i},r=[]){return e8([e,o,i,...r])}function e8(e){let o=e.length;for(;o--&&!e[o];);return e.slice(0,o+1).map((i,r)=>i||gt("_".repeat(r+1),!1))}const Nu=gt("undefined",!1),M1=(e,o)=>{if(e.type===1&&(e.tagType===1||e.tagType===3)){const i=Ce(e,"slot");if(i)return i.exp,o.scopes.vSlot++,()=>{o.scopes.vSlot--}}},n8=(e,o)=>{let i;if(ri(e)&&e.props.some(gc)&&(i=Ce(e,"for"))){const r=i.forParseResult;if(r){wc(r);const{value:a,key:s,index:l}=r,{addIdentifiers:c,removeIdentifiers:d}=o;return a&&c(a),s&&c(s),l&&c(l),()=>{a&&d(a),s&&d(s),l&&d(l)}}}},o8=(e,o,i,r)=>Eo(e,i,!1,!0,i.length?i[0].loc:r);function A1(e,o,i=o8){o.helper(Ha);const{children:r,loc:a}=e,s=[],l=[];let c=o.scopes.vSlot>0||o.scopes.vFor>0;const d=Ce(e,"slot",!0);if(d){const{arg:D,exp:L}=d;D&&!ke(D)&&(c=!0),s.push(Jt(D||gt("default",!0),i(L,void 0,r,a)))}let u=!1,h=!1;const f=[],v=new Set;let _=0;for(let D=0;D<r.length;D++){const L=r[D];let B;if(!ri(L)||!(B=Ce(L,"slot",!0))){L.type!==3&&f.push(L);continue}if(d){o.onError(Rt(37,B.loc));break}u=!0;const{children:X,loc:nt}=L,{arg:Z=gt("default",!0),exp:rt,loc:st}=B;let J;ke(Z)?J=Z?Z.content:"default":c=!0;const ot=Ce(L,"for"),lt=i(rt,ot,X,nt);let T,V;if(T=Ce(L,"if"))c=!0,l.push(na(T.exp,gr(Z,lt,_++),Nu));else if(V=Ce(L,/^else(?:-if)?$/,!0)){let U=D,M;for(;U--&&(M=r[U],!!vc(M)););if(M&&ri(M)&&Ce(M,/^(?:else-)?if$/)){let z=l[l.length-1];for(;z.alternate.type===19;)z=z.alternate;z.alternate=V.exp?na(V.exp,gr(Z,lt,_++),Nu):gr(Z,lt,_++)}else o.onError(Rt(30,V.loc))}else if(ot){c=!0;const U=ot.forParseResult;U?(wc(U),l.push(ne(o.helper($a),[U.source,Eo(ia(U),gr(Z,lt),!0)]))):o.onError(Rt(32,ot.loc))}else{if(J){if(v.has(J)){o.onError(Rt(38,st));continue}v.add(J),J==="default"&&(h=!0)}s.push(Jt(Z,lt))}}if(!d){const D=(L,B)=>{const X=i(L,void 0,B,a);return o.compatConfig&&(X.isNonScopedSlot=!0),Jt("default",X)};u?f.length&&!f.every(Fa)&&(h?o.onError(Rt(39,f[0].loc)):s.push(D(void 0,f))):s.push(D(void 0,r))}const b=c?2:Br(e.children)?3:1;let C=Oe(s.concat(Jt("_",gt(b+"",!1))),a);return l.length&&(C=ne(o.helper(dc),[C,Jn(l)])),{slots:C,hasDynamicSlots:c}}function gr(e,o,i){const r=[Jt("name",e),Jt("fn",o)];return i!=null&&r.push(Jt("key",gt(String(i),!0))),Oe(r)}function Br(e){for(let o=0;o<e.length;o++){const i=e[o];switch(i.type){case 1:if(i.tagType===2||Br(i.children))return!0;break;case 9:if(Br(i.branches))return!0;break;case 10:case 11:if(Br(i.children))return!0;break}}return!1}const N1=new WeakMap,T1=(e,o)=>function(){if(e=o.currentNode,!(e.type===1&&(e.tagType===0||e.tagType===1)))return;const{tag:i,props:r}=e,a=e.tagType===1;let s=a?I1(e,o):`"${i}"`;const l=kh(s)&&s.callee===Da;let c,d,u=0,h,f,v,_=l||s===Yo||s===Na||!a&&(i==="svg"||i==="foreignObject"||i==="math");if(r.length>0){const b=Sc(e,o,void 0,a,l);c=b.props,u=b.patchFlag,f=b.dynamicPropNames;const C=b.directives;v=C&&C.length?Jn(C.map(D=>O1(D,o))):void 0,b.shouldUseBlock&&(_=!0)}if(e.children.length>0)if(s===Vi&&(_=!0,u|=1024),a&&s!==Yo&&s!==Vi){const{slots:b,hasDynamicSlots:C}=A1(e,o);d=b,C&&(u|=1024)}else if(e.children.length===1&&s!==Yo){const b=e.children[0],C=b.type,D=C===5||C===8;D&&Ne(b,o)===0&&(u|=1),D||C===2?d=b:d=e.children}else d=e.children;f&&f.length&&(h=r8(f)),e.codegenNode=oi(o,s,c,d,u===0?void 0:u,h,v,!!_,!1,a,e.loc)};function I1(e,o,i=!1){let{tag:r}=e;const a=ll(r),s=Qi(e,"is",!1,!0);if(s)if(a||Co("COMPILER_IS_ON_ELEMENT",o)){let c;if(s.type===6?c=s.value&>(s.value.content,!0):(c=s.exp,c||(c=gt("is",!1,s.arg.loc))),c)return ne(o.helper(Da),[c])}else s.type===6&&s.value.content.startsWith("vue:")&&(r=s.value.content.slice(4));const l=pc(r)||o.isBuiltInComponent(r);return l?(i||o.helper(l),l):(o.helper(La),o.components.add(r),ai(r,"component"))}function Sc(e,o,i=e.props,r,a,s=!1){const{tag:l,loc:c,children:d}=e;let u=[];const h=[],f=[],v=d.length>0;let _=!1,b=0,C=!1,D=!1,L=!1,B=!1,X=!1,nt=!1;const Z=[],rt=lt=>{u.length&&(h.push(Oe(Tu(u),c)),u=[]),lt&&h.push(lt)},st=()=>{o.scopes.vFor>0&&u.push(Jt(gt("ref_for",!0),gt("true")))},J=({key:lt,value:T})=>{if(ke(lt)){const V=lt.content,U=wh(V);if(U&&(!r||a)&&V.toLowerCase()!=="onclick"&&V!=="onUpdate:modelValue"&&!Ad(V)&&(B=!0),U&&Ad(V)&&(nt=!0),U&&T.type===14&&(T=T.arguments[0]),T.type===20||(T.type===4||T.type===8)&&Ne(T,o)>0)return;V==="ref"?C=!0:V==="class"?D=!0:V==="style"?L=!0:V!=="key"&&!Z.includes(V)&&Z.push(V),r&&(V==="class"||V==="style")&&!Z.includes(V)&&Z.push(V)}else X=!0};for(let lt=0;lt<i.length;lt++){const T=i[lt];if(T.type===6){const{loc:V,name:U,nameLoc:M,value:z}=T;let H=!0;if(U==="ref"&&(C=!0,st()),U==="is"&&(ll(l)||z&&z.content.startsWith("vue:")||Co("COMPILER_IS_ON_ELEMENT",o)))continue;u.push(Jt(gt(U,!0,M),gt(z?z.content:"",H,z?z.loc:V)))}else{const{name:V,arg:U,exp:M,loc:z,modifiers:H}=T,et=V==="bind",dt=V==="on";if(V==="slot"){r||o.onError(Rt(40,z));continue}if(V==="once"||V==="memo"||V==="is"||et&&Wn(U,"is")&&(ll(l)||Co("COMPILER_IS_ON_ELEMENT",o))||dt&&s)continue;if((et&&Wn(U,"key")||dt&&v&&Wn(U,"vue:before-update"))&&(_=!0),et&&Wn(U,"ref")&&st(),!U&&(et||dt)){if(X=!0,M)if(et){if(rt(),Co("COMPILER_V_BIND_OBJECT_ORDER",o)){h.unshift(M);continue}st(),rt(),h.push(M)}else rt({type:14,loc:z,callee:o.helper(za),arguments:r?[M]:[M,"true"]});else o.onError(Rt(et?34:35,z));continue}et&&H.some(F=>F.content==="prop")&&(b|=32);const ct=o.directiveTransforms[V];if(ct){const{props:F,needRuntime:ft}=ct(T,e,o);!s&&F.forEach(J),dt&&U&&!ke(U)?rt(Oe(F,c)):u.push(...F),ft&&(f.push(T),Ol(ft)&&N1.set(T,ft))}else og(V)||(f.push(T),v&&(_=!0))}}let ot;if(h.length?(rt(),h.length>1?ot=ne(o.helper(Ui),h,c):ot=h[0]):u.length&&(ot=Oe(Tu(u),c)),X?b|=16:(D&&!r&&(b|=2),L&&!r&&(b|=4),Z.length&&(b|=8),B&&(b|=32)),!_&&(b===0||b===32)&&(C||nt||f.length>0)&&(b|=512),!o.inSSR&&ot)switch(ot.type){case 15:let lt=-1,T=-1,V=!1;for(let z=0;z<ot.properties.length;z++){const H=ot.properties[z].key;ke(H)?H.content==="class"?lt=z:H.content==="style"&&(T=z):H.isHandlerKey||(V=!0)}const U=ot.properties[lt],M=ot.properties[T];V?ot=ne(o.helper(ni),[ot]):(U&&!ke(U.value)&&(U.value=ne(o.helper(Va),[U.value])),M&&(L||M.value.type===4&&M.value.content.trim()[0]==="["||M.value.type===17)&&(M.value=ne(o.helper(Ua),[M.value])));break;case 14:break;default:ot=ne(o.helper(ni),[ne(o.helper(hi),[ot])]);break}return{props:ot,directives:f,patchFlag:b,dynamicPropNames:Z,shouldUseBlock:_}}function Tu(e){const o=new Map,i=[];for(let r=0;r<e.length;r++){const a=e[r];if(a.key.type===8||!a.key.isStatic){i.push(a);continue}const s=a.key.content,l=o.get(s);l?(s==="style"||s==="class"||wh(s))&&i8(l,a):(o.set(s,a),i.push(a))}return i}function i8(e,o){e.value.type===17?e.value.elements.push(o.value):e.value=Jn([e.value,o.value],e.loc)}function O1(e,o){const i=[],r=N1.get(e);r?i.push(o.helperString(r)):(o.helper(Pa),o.directives.add(e.name),i.push(ai(e.name,"directive")));const{loc:a}=e;if(e.exp&&i.push(e.exp),e.arg&&(e.exp||i.push("void 0"),i.push(e.arg)),Object.keys(e.modifiers).length){e.arg||(e.exp||i.push("void 0"),i.push("void 0"));const s=gt("true",!1,a);i.push(Oe(e.modifiers.map(l=>Jt(l,s)),a))}return Jn(i,e.loc)}function r8(e){let o="[";for(let i=0,r=e.length;i<r;i++)o+=JSON.stringify(e[i]),i<r-1&&(o+=", ");return o+"]"}function ll(e){return e==="component"||e==="Component"}const a8=(e,o)=>{if(Hi(e)){const{children:i,loc:r}=e,{slotName:a,slotProps:s}=L1(e,o),l=[o.prefixIdentifiers?"_ctx.$slots":"$slots",a,"{}","undefined","true"];let c=2;s&&(l[2]=s,c=3),i.length&&(l[3]=Eo([],i,!1,!1,r),c=4),o.scopeId&&!o.slotted&&(c=5),l.splice(c),e.codegenNode=ne(o.helper(cc),l,r)}};function L1(e,o){let i='"default"',r;const a=[];for(let s=0;s<e.props.length;s++){const l=e.props[s];if(l.type===6)l.value&&(l.name==="name"?i=JSON.stringify(l.value.content):(l.name=Zn(l.name),a.push(l)));else if(l.name==="bind"&&Wn(l.arg,"name")){if(l.exp)i=l.exp;else if(l.arg&&l.arg.type===4){const c=Zn(l.arg.content);i=l.exp=gt(c,!1,l.arg.loc)}}else l.name==="bind"&&l.arg&&ke(l.arg)&&(l.arg.content=Zn(l.arg.content)),a.push(l)}if(a.length>0){const{props:s,directives:l}=Sc(e,o,a,!1,!1);r=s,l.length&&o.onError(Rt(36,l[0].loc))}return{slotName:i,slotProps:r}}const xc=(e,o,i,r)=>{const{loc:a,modifiers:s,arg:l}=e;!e.exp&&!s.length&&i.onError(Rt(35,a));let c;if(l.type===4)if(l.isStatic){let f=l.content;f.startsWith("vue:")&&(f=`vnode-${f.slice(4)}`);const v=o.tagType!==0||f.startsWith("vnode")||!/[A-Z]/.test(f)?rg(Zn(f)):`on:${f}`;c=gt(v,!0,l.loc)}else c=Ue([`${i.helperString(ea)}(`,l,")"]);else c=l,c.children.unshift(`${i.helperString(ea)}(`),c.children.push(")");let d=e.exp;d&&!d.content.trim()&&(d=void 0);let u=i.cacheHandlers&&!d&&!i.inVOnce;if(d){const f=mc(d),v=!(f||i1(d)),_=d.content.includes(";");(v||u&&f)&&(d=Ue([`${v?"$event":"(...args)"} => ${_?"{":"("}`,d,_?"}":")"]))}let h={props:[Jt(c,d||gt("() => {}",!1,a))]};return r&&(h=r(h)),u&&(h.props[0].value=i.cache(h.props[0].value)),h.props.forEach(f=>f.key.isHandlerKey=!0),h},D1=(e,o,i)=>{const{modifiers:r,loc:a}=e,s=e.arg;let{exp:l}=e;return l&&l.type===4&&!l.content.trim()&&(l=void 0),s.type!==4?(s.children.unshift("("),s.children.push(') || ""')):s.isStatic||(s.content=s.content?`${s.content} || ""`:'""'),r.some(c=>c.content==="camel")&&(s.type===4?s.isStatic?s.content=Zn(s.content):s.content=`${i.helperString(ta)}(${s.content})`:(s.children.unshift(`${i.helperString(ta)}(`),s.children.push(")"))),i.inSSR||(r.some(c=>c.content==="prop")&&Iu(s,"."),r.some(c=>c.content==="attr")&&Iu(s,"^")),{props:[Jt(s,l)]}},Iu=(e,o)=>{e.type===4?e.isStatic?e.content=o+e.content:e.content=`\`${o}\${${e.content}}\``:(e.children.unshift(`'${o}' + (`),e.children.push(")"))},s8=(e,o)=>{if(e.type===0||e.type===1||e.type===11||e.type===10)return()=>{const i=e.children;let r,a=!1;for(let s=0;s<i.length;s++){const l=i[s];if(Or(l)){a=!0;for(let c=s+1;c<i.length;c++){const d=i[c];if(Or(d))r||(r=i[s]=Ue([l],l.loc)),r.children.push(" + ",d),i.splice(c,1),c--;else{r=void 0;break}}}}if(!(!a||i.length===1&&(e.type===0||e.type===1&&e.tagType===0&&!e.props.find(s=>s.type===7&&!o.directiveTransforms[s.name])&&e.tag!=="template")))for(let s=0;s<i.length;s++){const l=i[s];if(Or(l)||l.type===8){const c=[];(l.type!==2||l.content!==" ")&&c.push(l),!o.ssr&&Ne(l,o)===0&&c.push("1"),i[s]={type:12,content:l,loc:l.loc,codegenNode:ne(o.helper(Oa),c)}}}}},Ou=new WeakSet,l8=(e,o)=>{if(e.type===1&&Ce(e,"once",!0))return Ou.has(e)||o.inVOnce||o.inSSR?void 0:(Ou.add(e),o.inVOnce=!0,o.helper(zi),()=>{o.inVOnce=!1;const i=o.currentNode;i.codegenNode&&(i.codegenNode=o.cache(i.codegenNode,!0,!0))})},Ec=(e,o,i)=>{const{exp:r,arg:a}=e;if(!r)return i.onError(Rt(41,e.loc)),Ci();const s=r.loc.source.trim(),l=r.type===4?r.content:s,c=i.bindingMetadata[s];if(c==="props"||c==="props-aliased")return i.onError(Rt(44,r.loc)),Ci();if(c==="literal-const"||c==="setup-const")return i.onError(Rt(45,r.loc)),Ci();if(!l.trim()||!mc(r))return i.onError(Rt(42,r.loc)),Ci();const d=a||gt("modelValue",!0),u=a?ke(a)?`onUpdate:${Zn(a.content)}`:Ue(['"onUpdate:" + ',a]):"onUpdate:modelValue";let h;const f=i.isTS?"($event: any)":"$event";h=Ue([`${f} => ((`,r,") = $event)"]);const v=[Jt(d,e.exp),Jt(u,h)];if(e.modifiers.length&&o.tagType===1){const _=e.modifiers.map(C=>C.content).map(C=>(Ki(C)?C:JSON.stringify(C))+": true").join(", "),b=a?ke(a)?`${a.content}Modifiers`:Ue([a,' + "Modifiers"']):"modelModifiers";v.push(Jt(b,gt(`{ ${_} }`,!1,e.loc,2)))}return Ci(v)};function Ci(e=[]){return{props:e}}const c8=/[\w).+\-_$\]]/,d8=(e,o)=>{Co("COMPILER_FILTERS",o)&&(e.type===5?ra(e.content,o):e.type===1&&e.props.forEach(i=>{i.type===7&&i.name!=="for"&&i.exp&&ra(i.exp,o)}))};function ra(e,o){if(e.type===4)Lu(e,o);else for(let i=0;i<e.children.length;i++){const r=e.children[i];typeof r=="object"&&(r.type===4?Lu(r,o):r.type===8?ra(e,o):r.type===5&&ra(r.content,o))}}function Lu(e,o){const i=e.content;let r=!1,a=!1,s=!1,l=!1,c=0,d=0,u=0,h=0,f,v,_,b,C=[];for(_=0;_<i.length;_++)if(v=f,f=i.charCodeAt(_),r)f===39&&v!==92&&(r=!1);else if(a)f===34&&v!==92&&(a=!1);else if(s)f===96&&v!==92&&(s=!1);else if(l)f===47&&v!==92&&(l=!1);else if(f===124&&i.charCodeAt(_+1)!==124&&i.charCodeAt(_-1)!==124&&!c&&!d&&!u)b===void 0?(h=_+1,b=i.slice(0,_).trim()):D();else{switch(f){case 34:a=!0;break;case 39:r=!0;break;case 96:s=!0;break;case 40:u++;break;case 41:u--;break;case 91:d++;break;case 93:d--;break;case 123:c++;break;case 125:c--;break}if(f===47){let L=_-1,B;for(;L>=0&&(B=i.charAt(L),B===" ");L--);(!B||!c8.test(B))&&(l=!0)}}b===void 0?b=i.slice(0,_).trim():h!==0&&D();function D(){C.push(i.slice(h,_).trim()),h=_+1}if(C.length){for(_=0;_<C.length;_++)b=u8(b,C[_],o);e.content=b,e.ast=void 0}}function u8(e,o,i){i.helper(Ra);const r=o.indexOf("(");if(r<0)return i.filters.add(o),`${ai(o,"filter")}(${e})`;{const a=o.slice(0,r),s=o.slice(r+1);return i.filters.add(a),`${ai(a,"filter")}(${e}${s!==")"?","+s:s}`}}const Du=new WeakSet,h8=(e,o)=>{if(e.type===1){const i=Ce(e,"memo");return!i||Du.has(e)||o.inSSR?void 0:(Du.add(e),()=>{const r=e.codegenNode||o.currentNode.codegenNode;r&&r.type===13&&(e.tagType!==1&&Ya(r,o),e.codegenNode=ne(o.helper(Ga),[i.exp,Eo(void 0,r),"_cache",String(o.cached.length)]),o.cached.push(null))})}},P1=(e,o)=>{if(e.type===1){for(const i of e.props)if(i.type===7&&i.name==="bind"&&(!i.exp||i.exp.type===4&&!i.exp.content.trim())&&i.arg){const r=i.arg;if(r.type!==4||!r.isStatic)o.onError(Rt(53,r.loc)),i.exp=gt("",!0,r.loc);else{const a=Zn(r.content);(fc.test(a[0])||a[0]==="-")&&(i.exp=gt(a,!1,r.loc))}}}};function R1(e){return[[P1,l8,K6,h8,t8,d8,a8,T1,M1,s8],{on:xc,bind:D1,model:Ec}]}function B1(e,o={}){const i=o.onError||hc,r=o.mode==="module";o.prefixIdentifiers===!0?i(Rt(48)):r&&i(Rt(49));const a=!1;o.cacheHandlers&&i(Rt(50)),o.scopeId&&!r&&i(Rt(51));const s=wn({},o,{prefixIdentifiers:a}),l=re(e)?bc(e,s):e,[c,d]=R1();return _1(l,wn({},s,{nodeTransforms:[...c,...o.nodeTransforms||[]],directiveTransforms:wn({},d,o.directiveTransforms||{})})),C1(l,s)}const p8={DATA:"data",PROPS:"props",PROPS_ALIASED:"props-aliased",SETUP_LET:"setup-let",SETUP_CONST:"setup-const",SETUP_REACTIVE_CONST:"setup-reactive-const",SETUP_MAYBE_REF:"setup-maybe-ref",SETUP_REF:"setup-ref",OPTIONS:"options",LITERAL_CONST:"literal-const"},$1=()=>({props:[]}),Mc=Symbol(""),Ac=Symbol(""),Nc=Symbol(""),Tc=Symbol(""),aa=Symbol(""),Ic=Symbol(""),Oc=Symbol(""),Lc=Symbol(""),Dc=Symbol(""),Pc=Symbol("");Xp({[Mc]:"vModelRadio",[Ac]:"vModelCheckbox",[Nc]:"vModelText",[Tc]:"vModelSelect",[aa]:"vModelDynamic",[Ic]:"withModifiers",[Oc]:"withKeys",[Lc]:"vShow",[Dc]:"Transition",[Pc]:"TransitionGroup"});let Po;function f8(e,o=!1){return Po||(Po=document.createElement("div")),o?(Po.innerHTML=`<div foo="${e.replace(/"/g,""")}">`,Po.children[0].getAttribute("foo")):(Po.innerHTML=e,Po.textContent)}const Rc={parseMode:"html",isVoidTag:cg,isNativeTag:e=>ag(e)||sg(e)||lg(e),isPreTag:e=>e==="pre",isIgnoreNewlineTag:e=>e==="pre"||e==="textarea",decodeEntities:f8,isBuiltInComponent:e=>{if(e==="Transition"||e==="transition")return Dc;if(e==="TransitionGroup"||e==="transition-group")return Pc},getNamespace(e,o,i){let r=o?o.ns:i;if(o&&r===2)if(o.tag==="annotation-xml"){if(e==="svg")return 1;o.props.some(a=>a.type===6&&a.name==="encoding"&&a.value!=null&&(a.value.content==="text/html"||a.value.content==="application/xhtml+xml"))&&(r=0)}else/^m(?:[ions]|text)$/.test(o.tag)&&e!=="mglyph"&&e!=="malignmark"&&(r=0);else o&&r===1&&(o.tag==="foreignObject"||o.tag==="desc"||o.tag==="title")&&(r=0);if(r===0){if(e==="svg")return 1;if(e==="math")return 2}return r}},V1=e=>{e.type===1&&e.props.forEach((o,i)=>{o.type===6&&o.name==="style"&&o.value&&(e.props[i]={type:7,name:"bind",arg:gt("style",!0,o.loc),exp:m8(o.value.content,o.loc),modifiers:[],loc:o.loc})})},m8=(e,o)=>{const i=dg(e);return gt(JSON.stringify(i),!1,o,3)};function xn(e,o){return Rt(e,o)}const g8={X_V_HTML_NO_EXPRESSION:54,54:"X_V_HTML_NO_EXPRESSION",X_V_HTML_WITH_CHILDREN:55,55:"X_V_HTML_WITH_CHILDREN",X_V_TEXT_NO_EXPRESSION:56,56:"X_V_TEXT_NO_EXPRESSION",X_V_TEXT_WITH_CHILDREN:57,57:"X_V_TEXT_WITH_CHILDREN",X_V_MODEL_ON_INVALID_ELEMENT:58,58:"X_V_MODEL_ON_INVALID_ELEMENT",X_V_MODEL_ARG_ON_ELEMENT:59,59:"X_V_MODEL_ARG_ON_ELEMENT",X_V_MODEL_ON_FILE_INPUT_ELEMENT:60,60:"X_V_MODEL_ON_FILE_INPUT_ELEMENT",X_V_MODEL_UNNECESSARY_VALUE:61,61:"X_V_MODEL_UNNECESSARY_VALUE",X_V_SHOW_NO_EXPRESSION:62,62:"X_V_SHOW_NO_EXPRESSION",X_TRANSITION_INVALID_CHILDREN:63,63:"X_TRANSITION_INVALID_CHILDREN",X_IGNORED_SIDE_EFFECT_TAG:64,64:"X_IGNORED_SIDE_EFFECT_TAG",__EXTEND_POINT__:65,65:"__EXTEND_POINT__"},y8={54:"v-html is missing expression.",55:"v-html will override element children.",56:"v-text is missing expression.",57:"v-text will override element children.",58:"v-model can only be used on <input>, <textarea> and <select> elements.",59:"v-model argument is not supported on plain elements.",60:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",61:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",62:"v-show is missing expression.",63:"<Transition> expects exactly one child element or component.",64:"Tags with side effect (<script> and <style>) are ignored in client component templates."},v8=(e,o,i)=>{const{exp:r,loc:a}=e;return r||i.onError(xn(54,a)),o.children.length&&(i.onError(xn(55,a)),o.children.length=0),{props:[Jt(gt("innerHTML",!0,a),r||gt("",!0))]}},_8=(e,o,i)=>{const{exp:r,loc:a}=e;return r||i.onError(xn(56,a)),o.children.length&&(i.onError(xn(57,a)),o.children.length=0),{props:[Jt(gt("textContent",!0),r?Ne(r,i)>0?r:ne(i.helperString(Ji),[r],a):gt("",!0))]}},b8=(e,o,i)=>{const r=Ec(e,o,i);if(!r.props.length||o.tagType===1)return r;e.arg&&i.onError(xn(59,e.arg.loc));const{tag:a}=o,s=i.isCustomElement(a);if(a==="input"||a==="textarea"||a==="select"||s){let l=Nc,c=!1;if(a==="input"||s){const d=Qi(o,"type");if(d){if(d.type===7)l=aa;else if(d.value)switch(d.value.content){case"radio":l=Mc;break;case"checkbox":l=Ac;break;case"file":c=!0,i.onError(xn(60,e.loc));break}}else a1(o)&&(l=aa)}else a==="select"&&(l=Tc);c||(r.needRuntime=i.helper(l))}else i.onError(xn(58,e.loc));return r.props=r.props.filter(l=>!(l.key.type===4&&l.key.content==="modelValue")),r},C8=_a("passive,once,capture"),k8=_a("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),w8=_a("left,right"),U1=_a("onkeyup,onkeydown,onkeypress"),S8=(e,o,i,r)=>{const a=[],s=[],l=[];for(let c=0;c<o.length;c++){const d=o[c].content;d==="native"&&ii("COMPILER_V_ON_NATIVE",i)||C8(d)?l.push(d):w8(d)?ke(e)?U1(e.content.toLowerCase())?a.push(d):s.push(d):(a.push(d),s.push(d)):k8(d)?s.push(d):a.push(d)}return{keyModifiers:a,nonKeyModifiers:s,eventOptionModifiers:l}},Pu=(e,o)=>ke(e)&&e.content.toLowerCase()==="onclick"?gt(o,!0):e.type!==4?Ue(["(",e,`) === "onClick" ? "${o}" : (`,e,")"]):e,x8=(e,o,i)=>xc(e,o,i,r=>{const{modifiers:a}=e;if(!a.length)return r;let{key:s,value:l}=r.props[0];const{keyModifiers:c,nonKeyModifiers:d,eventOptionModifiers:u}=S8(s,a,i,e.loc);if(d.includes("right")&&(s=Pu(s,"onContextmenu")),d.includes("middle")&&(s=Pu(s,"onMouseup")),d.length&&(l=ne(i.helper(Ic),[l,JSON.stringify(d)])),c.length&&(!ke(s)||U1(s.content.toLowerCase()))&&(l=ne(i.helper(Oc),[l,JSON.stringify(c)])),u.length){const h=u.map(Ch).join("");s=ke(s)?gt(`${s.content}${h}`,!0):Ue(["(",s,`) + "${h}"`])}return{props:[Jt(s,l)]}}),E8=(e,o,i)=>{const{exp:r,loc:a}=e;return r||i.onError(xn(62,a)),{props:[],needRuntime:i.helper(Lc)}},M8=(e,o)=>{e.type===1&&e.tagType===0&&(e.tag==="script"||e.tag==="style")&&o.removeNode()},z1=[V1],H1={cloak:$1,html:v8,text:_8,model:b8,on:x8,show:E8};function A8(e,o={}){return B1(e,wn({},Rc,o,{nodeTransforms:[M8,...z1,...o.nodeTransforms||[]],directiveTransforms:wn({},H1,o.directiveTransforms||{}),transformHoist:null}))}function N8(e,o={}){return bc(e,wn({},Rc,o))}const T8=Object.freeze(Object.defineProperty({__proto__:null,BASE_TRANSITION:rc,BindingTypes:p8,CAMELIZE:ta,CAPITALIZE:zp,CREATE_BLOCK:ac,CREATE_COMMENT:ui,CREATE_ELEMENT_BLOCK:sc,CREATE_ELEMENT_VNODE:Ia,CREATE_SLOTS:dc,CREATE_STATIC:lc,CREATE_TEXT:Oa,CREATE_VNODE:Ta,CompilerDeprecationTypes:J3,ConstantTypes:G3,DOMDirectiveTransforms:H1,DOMErrorCodes:g8,DOMErrorMessages:y8,DOMNodeTransforms:z1,ElementTypes:H3,ErrorCodes:t6,FRAGMENT:ei,GUARD_REACTIVE_PROPS:hi,IS_MEMO_SAME:uc,IS_REF:Fp,KEEP_ALIVE:Vi,MERGE_PROPS:Ui,NORMALIZE_CLASS:Va,NORMALIZE_PROPS:ni,NORMALIZE_STYLE:Ua,Namespaces:U3,NodeTypes:z3,OPEN_BLOCK:eo,POP_SCOPE_ID:Gp,PUSH_SCOPE_ID:Hp,RENDER_LIST:$a,RENDER_SLOT:cc,RESOLVE_COMPONENT:La,RESOLVE_DIRECTIVE:Pa,RESOLVE_DYNAMIC_COMPONENT:Da,RESOLVE_FILTER:Ra,SET_BLOCK_TRACKING:zi,SUSPENSE:Na,TELEPORT:Yo,TO_DISPLAY_STRING:Ji,TO_HANDLERS:za,TO_HANDLER_KEY:ea,TRANSITION:Dc,TRANSITION_GROUP:Pc,TS_NODE_TYPES:Qp,UNREF:Yp,V_MODEL_CHECKBOX:Ac,V_MODEL_DYNAMIC:aa,V_MODEL_RADIO:Mc,V_MODEL_SELECT:Tc,V_MODEL_TEXT:Nc,V_ON_WITH_KEYS:Oc,V_ON_WITH_MODIFIERS:Ic,V_SHOW:Lc,WITH_CTX:Ha,WITH_DIRECTIVES:Ba,WITH_MEMO:Ga,advancePositionWithClone:v6,advancePositionWithMutation:r1,assert:_6,baseCompile:B1,baseParse:bc,buildDirectiveArgs:O1,buildProps:Sc,buildSlots:A1,checkCompatEnabled:ii,compile:A8,convertToBlock:Ya,createArrayExpression:Jn,createAssignmentExpression:W3,createBlockStatement:qp,createCacheExpression:jp,createCallExpression:ne,createCompilerError:Rt,createCompoundExpression:Ue,createConditionalExpression:na,createDOMCompilerError:xn,createForLoopParams:ia,createFunctionExpression:Eo,createIfStatement:X3,createInterpolation:Y3,createObjectExpression:Oe,createObjectProperty:Jt,createReturnStatement:q3,createRoot:Wp,createSequenceExpression:j3,createSimpleExpression:gt,createStructuralDirectiveTransform:Cc,createTemplateLiteral:F3,createTransformContext:v1,createVNodeCall:oi,errorMessages:e6,extractIdentifiers:rn,findDir:Ce,findProp:Qi,forAliasRE:c1,generate:C1,generateCodeFrame:ug,getBaseTransformPreset:R1,getConstantType:Ne,getMemoedVNodeCall:l1,getVNodeBlockHelper:Ao,getVNodeHelper:Mo,hasDynamicKeyVBind:a1,hasScopeRef:Fe,helperNameMap:xo,injectProp:Gi,isAllWhitespace:yc,isCommentOrWhitespace:vc,isCoreComponent:pc,isFnExpression:i1,isFnExpressionBrowser:o1,isFnExpressionNode:y6,isFunctionType:d6,isInDestructureAssignment:i6,isInNewExpression:r6,isMemberExpression:mc,isMemberExpressionBrowser:n1,isMemberExpressionNode:m6,isReferencedIdentifier:o6,isSimpleIdentifier:Ki,isSlotOutlet:Hi,isStaticArgOf:Wn,isStaticExp:ke,isStaticProperty:Kp,isStaticPropertyKey:u6,isTemplateNode:ri,isText:Or,isVPre:rl,isVSlot:gc,isWhitespaceText:Fa,locStub:ae,noopDirectiveTransform:$1,parse:N8,parserOptions:Rc,processExpression:Rr,processFor:E1,processIf:x1,processSlotOutlet:L1,registerRuntimeHelpers:Xp,resolveComponentType:I1,stringifyExpression:S1,toValidAssetId:ai,trackSlotScopes:M1,trackVForSlotScopes:n8,transform:_1,transformBind:D1,transformElement:T1,transformExpression:J6,transformModel:Ec,transformOn:xc,transformStyle:V1,transformVBindShorthand:P1,traverseNode:tr,unwrapTSNode:t1,validFirstIdentCharRE:fc,walkBlockDeclarations:Jp,walkFunctionParams:a6,walkIdentifiers:n6,warnDeprecation:Q3},Symbol.toStringTag,{value:"Module"})),I8=Ll(T8),O8=Ll(hg),L8=Ll(pg);var Ru;function D8(){return Ru||(Ru=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});var o=I8,i=O8,r=L8;function a(d){var u=Object.create(null);if(d)for(var h in d)u[h]=d[h];return u.default=d,Object.freeze(u)}var s=a(i);const l=Object.create(null);function c(d,u){if(!r.isString(d))if(d.nodeType)d=d.innerHTML;else return r.NOOP;const h=r.genCacheKey(d,u),f=l[h];if(f)return f;if(d[0]==="#"){const C=document.querySelector(d);d=C?C.innerHTML:""}const v=r.extend({hoistStatic:!0,onError:void 0,onWarn:r.NOOP},u);!v.isCustomElement&&typeof customElements<"u"&&(v.isCustomElement=C=>!!customElements.get(C));const{code:_}=o.compile(d,v),b=new Function("Vue",_)(s);return b._rc=!0,l[h]=b}i.registerRuntimeCompiler(c),e.compile=c,Object.keys(i).forEach(function(d){d!=="default"&&!Object.prototype.hasOwnProperty.call(e,d)&&(e[d]=i[d])})})(vu)),vu}var Bu;function P8(){return Bu||(Bu=1,yu.exports=D8()),yu.exports}var cl={exports:{}},R8=cl.exports,$u;function B8(){return $u||($u=1,(function(e,o){(function(i,r){e.exports=r()})(R8,function(){function i(m,g){var y=Object.keys(m);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(m);g&&(x=x.filter(function(E){return Object.getOwnPropertyDescriptor(m,E).enumerable})),y.push.apply(y,x)}return y}function r(m){for(var g=1;g<arguments.length;g++){var y=arguments[g]!=null?arguments[g]:{};g%2?i(Object(y),!0).forEach(function(x){h(m,x,y[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(y)):i(Object(y)).forEach(function(x){Object.defineProperty(m,x,Object.getOwnPropertyDescriptor(y,x))})}return m}function a(m,g){if(typeof m!="object"||!m)return m;var y=m[Symbol.toPrimitive];if(y!==void 0){var x=y.call(m,g);if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(m)}function s(m){var g=a(m,"string");return typeof g=="symbol"?g:g+""}function l(m){"@babel/helpers - typeof";return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},l(m)}function c(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function d(m,g){for(var y=0;y<g.length;y++){var x=g[y];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(m,s(x.key),x)}}function u(m,g,y){return g&&d(m.prototype,g),y&&d(m,y),Object.defineProperty(m,"prototype",{writable:!1}),m}function h(m,g,y){return g=s(g),g in m?Object.defineProperty(m,g,{value:y,enumerable:!0,configurable:!0,writable:!0}):m[g]=y,m}function f(m){return v(m)||_(m)||b(m)||D()}function v(m){if(Array.isArray(m))return C(m)}function _(m){if(typeof Symbol<"u"&&m[Symbol.iterator]!=null||m["@@iterator"]!=null)return Array.from(m)}function b(m,g){if(m){if(typeof m=="string")return C(m,g);var y=Object.prototype.toString.call(m).slice(8,-1);if(y==="Object"&&m.constructor&&(y=m.constructor.name),y==="Map"||y==="Set")return Array.from(m);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return C(m,g)}}function C(m,g){(g==null||g>m.length)&&(g=m.length);for(var y=0,x=new Array(g);y<g;y++)x[y]=m[y];return x}function D(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var L=typeof window<"u"&&typeof window.document<"u",B=L?window:{},X=L&&B.document.documentElement?"ontouchstart"in B.document.documentElement:!1,nt=L?"PointerEvent"in B:!1,Z="cropper",rt="all",st="crop",J="move",ot="zoom",lt="e",T="w",V="s",U="n",M="ne",z="nw",H="se",et="sw",dt="".concat(Z,"-crop"),ct="".concat(Z,"-disabled"),F="".concat(Z,"-hidden"),ft="".concat(Z,"-hide"),Mt="".concat(Z,"-invisible"),Ut="".concat(Z,"-modal"),zt="".concat(Z,"-move"),Xt="".concat(Z,"Action"),he="".concat(Z,"Preview"),le="crop",ve="move",Rn="none",Ja="crop",Ka="cropend",Qa="cropmove",ts="cropstart",ed="dblclick",Df=X?"touchstart":"mousedown",Pf=X?"touchmove":"mousemove",Rf=X?"touchend touchcancel":"mouseup",nd=nt?"pointerdown":Df,od=nt?"pointermove":Pf,id=nt?"pointerup pointercancel":Rf,rd="ready",ad="resize",sd="wheel",es="zoom",ld="image/jpeg",Bf=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,$f=/^data:/,Vf=/^data:image\/jpeg;base64,/,Uf=/^img|canvas$/i,cd=200,dd=100,ud={viewMode:0,dragMode:le,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:cd,minContainerHeight:dd,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},zf='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',Hf=Number.isNaN||B.isNaN;function bt(m){return typeof m=="number"&&!Hf(m)}var hd=function(m){return m>0&&m<1/0};function ns(m){return typeof m>"u"}function ao(m){return l(m)==="object"&&m!==null}var Gf=Object.prototype.hasOwnProperty;function To(m){if(!ao(m))return!1;try{var g=m.constructor,y=g.prototype;return g&&y&&Gf.call(y,"isPrototypeOf")}catch{return!1}}function we(m){return typeof m=="function"}var Yf=Array.prototype.slice;function pd(m){return Array.from?Array.from(m):Yf.call(m)}function Qt(m,g){return m&&we(g)&&(Array.isArray(m)||bt(m.length)?pd(m).forEach(function(y,x){g.call(m,y,x,m)}):ao(m)&&Object.keys(m).forEach(function(y){g.call(m,m[y],y,m)})),m}var Ht=Object.assign||function(m){for(var g=arguments.length,y=new Array(g>1?g-1:0),x=1;x<g;x++)y[x-1]=arguments[x];return ao(m)&&y.length>0&&y.forEach(function(E){ao(E)&&Object.keys(E).forEach(function(P){m[P]=E[P]})}),m},Ff=/\.\d*(?:0|9){12}\d*$/;function Io(m){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Ff.test(m)?Math.round(m*g)/g:m}var Xf=/^width|height|left|top|marginLeft|marginTop$/;function Bn(m,g){var y=m.style;Qt(g,function(x,E){Xf.test(E)&&bt(x)&&(x="".concat(x,"px")),y[E]=x})}function Wf(m,g){return m.classList?m.classList.contains(g):m.className.indexOf(g)>-1}function se(m,g){if(g){if(bt(m.length)){Qt(m,function(x){se(x,g)});return}if(m.classList){m.classList.add(g);return}var y=m.className.trim();y?y.indexOf(g)<0&&(m.className="".concat(y," ").concat(g)):m.className=g}}function en(m,g){if(g){if(bt(m.length)){Qt(m,function(y){en(y,g)});return}if(m.classList){m.classList.remove(g);return}m.className.indexOf(g)>=0&&(m.className=m.className.replace(g,""))}}function Oo(m,g,y){if(g){if(bt(m.length)){Qt(m,function(x){Oo(x,g,y)});return}y?se(m,g):en(m,g)}}var jf=/([a-z\d])([A-Z])/g;function os(m){return m.replace(jf,"$1-$2").toLowerCase()}function is(m,g){return ao(m[g])?m[g]:m.dataset?m.dataset[g]:m.getAttribute("data-".concat(os(g)))}function fi(m,g,y){ao(y)?m[g]=y:m.dataset?m.dataset[g]=y:m.setAttribute("data-".concat(os(g)),y)}function qf(m,g){if(ao(m[g]))try{delete m[g]}catch{m[g]=void 0}else if(m.dataset)try{delete m.dataset[g]}catch{m.dataset[g]=void 0}else m.removeAttribute("data-".concat(os(g)))}var fd=/\s\s*/,md=(function(){var m=!1;if(L){var g=!1,y=function(){},x=Object.defineProperty({},"once",{get:function(){return m=!0,g},set:function(E){g=E}});B.addEventListener("test",y,x),B.removeEventListener("test",y,x)}return m})();function Ye(m,g,y){var x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},E=y;g.trim().split(fd).forEach(function(P){if(!md){var $=m.listeners;$&&$[P]&&$[P][y]&&(E=$[P][y],delete $[P][y],Object.keys($[P]).length===0&&delete $[P],Object.keys($).length===0&&delete m.listeners)}m.removeEventListener(P,E,x)})}function Re(m,g,y){var x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},E=y;g.trim().split(fd).forEach(function(P){if(x.once&&!md){var $=m.listeners,W=$===void 0?{}:$;E=function(){delete W[P][y],m.removeEventListener(P,E,x);for(var j=arguments.length,G=new Array(j),Y=0;Y<j;Y++)G[Y]=arguments[Y];y.apply(m,G)},W[P]||(W[P]={}),W[P][y]&&m.removeEventListener(P,W[P][y],x),W[P][y]=E,m.listeners=W}m.addEventListener(P,E,x)})}function Lo(m,g,y){var x;return we(Event)&&we(CustomEvent)?x=new CustomEvent(g,{detail:y,bubbles:!0,cancelable:!0}):(x=document.createEvent("CustomEvent"),x.initCustomEvent(g,!0,!0,y)),m.dispatchEvent(x)}function gd(m){var g=m.getBoundingClientRect();return{left:g.left+(window.pageXOffset-document.documentElement.clientLeft),top:g.top+(window.pageYOffset-document.documentElement.clientTop)}}var rs=B.location,Zf=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function yd(m){var g=m.match(Zf);return g!==null&&(g[1]!==rs.protocol||g[2]!==rs.hostname||g[3]!==rs.port)}function vd(m){var g="timestamp=".concat(new Date().getTime());return m+(m.indexOf("?")===-1?"?":"&")+g}function mi(m){var g=m.rotate,y=m.scaleX,x=m.scaleY,E=m.translateX,P=m.translateY,$=[];bt(E)&&E!==0&&$.push("translateX(".concat(E,"px)")),bt(P)&&P!==0&&$.push("translateY(".concat(P,"px)")),bt(g)&&g!==0&&$.push("rotate(".concat(g,"deg)")),bt(y)&&y!==1&&$.push("scaleX(".concat(y,")")),bt(x)&&x!==1&&$.push("scaleY(".concat(x,")"));var W=$.length?$.join(" "):"none";return{WebkitTransform:W,msTransform:W,transform:W}}function Jf(m){var g=r({},m),y=0;return Qt(m,function(x,E){delete g[E],Qt(g,function(P){var $=Math.abs(x.startX-P.startX),W=Math.abs(x.startY-P.startY),j=Math.abs(x.endX-P.endX),G=Math.abs(x.endY-P.endY),Y=Math.sqrt($*$+W*W),K=Math.sqrt(j*j+G*G),St=(K-Y)/Y;Math.abs(St)>Math.abs(y)&&(y=St)})}),y}function rr(m,g){var y=m.pageX,x=m.pageY,E={endX:y,endY:x};return g?E:r({startX:y,startY:x},E)}function Kf(m){var g=0,y=0,x=0;return Qt(m,function(E){var P=E.startX,$=E.startY;g+=P,y+=$,x+=1}),g/=x,y/=x,{pageX:g,pageY:y}}function $n(m){var g=m.aspectRatio,y=m.height,x=m.width,E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",P=hd(x),$=hd(y);if(P&&$){var W=y*g;E==="contain"&&W>x||E==="cover"&&W<x?y=x/g:x=y*g}else P?y=x/g:$&&(x=y*g);return{width:x,height:y}}function Qf(m){var g=m.width,y=m.height,x=m.degree;if(x=Math.abs(x)%180,x===90)return{width:y,height:g};var E=x%90*Math.PI/180,P=Math.sin(E),$=Math.cos(E),W=g*$+y*P,j=g*P+y*$;return x>90?{width:j,height:W}:{width:W,height:j}}function tm(m,g,y,x){var E=g.aspectRatio,P=g.naturalWidth,$=g.naturalHeight,W=g.rotate,j=W===void 0?0:W,G=g.scaleX,Y=G===void 0?1:G,K=g.scaleY,St=K===void 0?1:K,_t=y.aspectRatio,Ot=y.naturalWidth,It=y.naturalHeight,te=x.fillColor,ce=te===void 0?"transparent":te,Wt=x.imageSmoothingEnabled,Vn=Wt===void 0?!0:Wt,Se=x.imageSmoothingQuality,it=Se===void 0?"low":Se,Tt=x.maxWidth,ee=Tt===void 0?1/0:Tt,nn=x.maxHeight,hn=nn===void 0?1/0:nn,so=x.minWidth,lo=so===void 0?0:so,Un=x.minHeight,zn=Un===void 0?0:Un,co=document.createElement("canvas"),pe=co.getContext("2d"),ar=$n({aspectRatio:_t,width:ee,height:hn}),Cd=$n({aspectRatio:_t,width:lo,height:zn},"cover"),as=Math.min(ar.width,Math.max(Cd.width,Ot)),ss=Math.min(ar.height,Math.max(Cd.height,It)),kd=$n({aspectRatio:E,width:ee,height:hn}),wd=$n({aspectRatio:E,width:lo,height:zn},"cover"),Sd=Math.min(kd.width,Math.max(wd.width,P)),xd=Math.min(kd.height,Math.max(wd.height,$)),fm=[-Sd/2,-xd/2,Sd,xd];return co.width=Io(as),co.height=Io(ss),pe.fillStyle=ce,pe.fillRect(0,0,as,ss),pe.save(),pe.translate(as/2,ss/2),pe.rotate(j*Math.PI/180),pe.scale(Y,St),pe.imageSmoothingEnabled=Vn,pe.imageSmoothingQuality=it,pe.drawImage.apply(pe,[m].concat(f(fm.map(function(mm){return Math.floor(Io(mm))})))),pe.restore(),co}var _d=String.fromCharCode;function em(m,g,y){var x="";y+=g;for(var E=g;E<y;E+=1)x+=_d(m.getUint8(E));return x}var nm=/^data:.*,/;function om(m){var g=m.replace(nm,""),y=atob(g),x=new ArrayBuffer(y.length),E=new Uint8Array(x);return Qt(E,function(P,$){E[$]=y.charCodeAt($)}),x}function im(m,g){for(var y=[],x=8192,E=new Uint8Array(m);E.length>0;)y.push(_d.apply(null,pd(E.subarray(0,x)))),E=E.subarray(x);return"data:".concat(g,";base64,").concat(btoa(y.join("")))}function rm(m){var g=new DataView(m),y;try{var x,E,P;if(g.getUint8(0)===255&&g.getUint8(1)===216)for(var $=g.byteLength,W=2;W+1<$;){if(g.getUint8(W)===255&&g.getUint8(W+1)===225){E=W;break}W+=1}if(E){var j=E+4,G=E+10;if(em(g,j,4)==="Exif"){var Y=g.getUint16(G);if(x=Y===18761,(x||Y===19789)&&g.getUint16(G+2,x)===42){var K=g.getUint32(G+4,x);K>=8&&(P=G+K)}}}if(P){var St=g.getUint16(P,x),_t,Ot;for(Ot=0;Ot<St;Ot+=1)if(_t=P+Ot*12+2,g.getUint16(_t,x)===274){_t+=8,y=g.getUint16(_t,x),g.setUint16(_t,1,x);break}}}catch{y=1}return y}function am(m){var g=0,y=1,x=1;switch(m){case 2:y=-1;break;case 3:g=-180;break;case 4:x=-1;break;case 5:g=90,x=-1;break;case 6:g=90;break;case 7:g=90,y=-1;break;case 8:g=-90;break}return{rotate:g,scaleX:y,scaleY:x}}var sm={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var m=this.element,g=this.options,y=this.container,x=this.cropper,E=Number(g.minContainerWidth),P=Number(g.minContainerHeight);se(x,F),en(m,F);var $={width:Math.max(y.offsetWidth,E>=0?E:cd),height:Math.max(y.offsetHeight,P>=0?P:dd)};this.containerData=$,Bn(x,{width:$.width,height:$.height}),se(m,F),en(x,F)},initCanvas:function(){var m=this.containerData,g=this.imageData,y=this.options.viewMode,x=Math.abs(g.rotate)%180===90,E=x?g.naturalHeight:g.naturalWidth,P=x?g.naturalWidth:g.naturalHeight,$=E/P,W=m.width,j=m.height;m.height*$>m.width?y===3?W=m.height*$:j=m.width/$:y===3?j=m.width/$:W=m.height*$;var G={aspectRatio:$,naturalWidth:E,naturalHeight:P,width:W,height:j};this.canvasData=G,this.limited=y===1||y===2,this.limitCanvas(!0,!0),G.width=Math.min(Math.max(G.width,G.minWidth),G.maxWidth),G.height=Math.min(Math.max(G.height,G.minHeight),G.maxHeight),G.left=(m.width-G.width)/2,G.top=(m.height-G.height)/2,G.oldLeft=G.left,G.oldTop=G.top,this.initialCanvasData=Ht({},G)},limitCanvas:function(m,g){var y=this.options,x=this.containerData,E=this.canvasData,P=this.cropBoxData,$=y.viewMode,W=E.aspectRatio,j=this.cropped&&P;if(m){var G=Number(y.minCanvasWidth)||0,Y=Number(y.minCanvasHeight)||0;$>1?(G=Math.max(G,x.width),Y=Math.max(Y,x.height),$===3&&(Y*W>G?G=Y*W:Y=G/W)):$>0&&(G?G=Math.max(G,j?P.width:0):Y?Y=Math.max(Y,j?P.height:0):j&&(G=P.width,Y=P.height,Y*W>G?G=Y*W:Y=G/W));var K=$n({aspectRatio:W,width:G,height:Y});G=K.width,Y=K.height,E.minWidth=G,E.minHeight=Y,E.maxWidth=1/0,E.maxHeight=1/0}if(g)if($>(j?0:1)){var St=x.width-E.width,_t=x.height-E.height;E.minLeft=Math.min(0,St),E.minTop=Math.min(0,_t),E.maxLeft=Math.max(0,St),E.maxTop=Math.max(0,_t),j&&this.limited&&(E.minLeft=Math.min(P.left,P.left+(P.width-E.width)),E.minTop=Math.min(P.top,P.top+(P.height-E.height)),E.maxLeft=P.left,E.maxTop=P.top,$===2&&(E.width>=x.width&&(E.minLeft=Math.min(0,St),E.maxLeft=Math.max(0,St)),E.height>=x.height&&(E.minTop=Math.min(0,_t),E.maxTop=Math.max(0,_t))))}else E.minLeft=-E.width,E.minTop=-E.height,E.maxLeft=x.width,E.maxTop=x.height},renderCanvas:function(m,g){var y=this.canvasData,x=this.imageData;if(g){var E=Qf({width:x.naturalWidth*Math.abs(x.scaleX||1),height:x.naturalHeight*Math.abs(x.scaleY||1),degree:x.rotate||0}),P=E.width,$=E.height,W=y.width*(P/y.naturalWidth),j=y.height*($/y.naturalHeight);y.left-=(W-y.width)/2,y.top-=(j-y.height)/2,y.width=W,y.height=j,y.aspectRatio=P/$,y.naturalWidth=P,y.naturalHeight=$,this.limitCanvas(!0,!1)}(y.width>y.maxWidth||y.width<y.minWidth)&&(y.left=y.oldLeft),(y.height>y.maxHeight||y.height<y.minHeight)&&(y.top=y.oldTop),y.width=Math.min(Math.max(y.width,y.minWidth),y.maxWidth),y.height=Math.min(Math.max(y.height,y.minHeight),y.maxHeight),this.limitCanvas(!1,!0),y.left=Math.min(Math.max(y.left,y.minLeft),y.maxLeft),y.top=Math.min(Math.max(y.top,y.minTop),y.maxTop),y.oldLeft=y.left,y.oldTop=y.top,Bn(this.canvas,Ht({width:y.width,height:y.height},mi({translateX:y.left,translateY:y.top}))),this.renderImage(m),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(m){var g=this.canvasData,y=this.imageData,x=y.naturalWidth*(g.width/g.naturalWidth),E=y.naturalHeight*(g.height/g.naturalHeight);Ht(y,{width:x,height:E,left:(g.width-x)/2,top:(g.height-E)/2}),Bn(this.image,Ht({width:y.width,height:y.height},mi(Ht({translateX:y.left,translateY:y.top},y)))),m&&this.output()},initCropBox:function(){var m=this.options,g=this.canvasData,y=m.aspectRatio||m.initialAspectRatio,x=Number(m.autoCropArea)||.8,E={width:g.width,height:g.height};y&&(g.height*y>g.width?E.height=E.width/y:E.width=E.height*y),this.cropBoxData=E,this.limitCropBox(!0,!0),E.width=Math.min(Math.max(E.width,E.minWidth),E.maxWidth),E.height=Math.min(Math.max(E.height,E.minHeight),E.maxHeight),E.width=Math.max(E.minWidth,E.width*x),E.height=Math.max(E.minHeight,E.height*x),E.left=g.left+(g.width-E.width)/2,E.top=g.top+(g.height-E.height)/2,E.oldLeft=E.left,E.oldTop=E.top,this.initialCropBoxData=Ht({},E)},limitCropBox:function(m,g){var y=this.options,x=this.containerData,E=this.canvasData,P=this.cropBoxData,$=this.limited,W=y.aspectRatio;if(m){var j=Number(y.minCropBoxWidth)||0,G=Number(y.minCropBoxHeight)||0,Y=$?Math.min(x.width,E.width,E.width+E.left,x.width-E.left):x.width,K=$?Math.min(x.height,E.height,E.height+E.top,x.height-E.top):x.height;j=Math.min(j,x.width),G=Math.min(G,x.height),W&&(j&&G?G*W>j?G=j/W:j=G*W:j?G=j/W:G&&(j=G*W),K*W>Y?K=Y/W:Y=K*W),P.minWidth=Math.min(j,Y),P.minHeight=Math.min(G,K),P.maxWidth=Y,P.maxHeight=K}g&&($?(P.minLeft=Math.max(0,E.left),P.minTop=Math.max(0,E.top),P.maxLeft=Math.min(x.width,E.left+E.width)-P.width,P.maxTop=Math.min(x.height,E.top+E.height)-P.height):(P.minLeft=0,P.minTop=0,P.maxLeft=x.width-P.width,P.maxTop=x.height-P.height))},renderCropBox:function(){var m=this.options,g=this.containerData,y=this.cropBoxData;(y.width>y.maxWidth||y.width<y.minWidth)&&(y.left=y.oldLeft),(y.height>y.maxHeight||y.height<y.minHeight)&&(y.top=y.oldTop),y.width=Math.min(Math.max(y.width,y.minWidth),y.maxWidth),y.height=Math.min(Math.max(y.height,y.minHeight),y.maxHeight),this.limitCropBox(!1,!0),y.left=Math.min(Math.max(y.left,y.minLeft),y.maxLeft),y.top=Math.min(Math.max(y.top,y.minTop),y.maxTop),y.oldLeft=y.left,y.oldTop=y.top,m.movable&&m.cropBoxMovable&&fi(this.face,Xt,y.width>=g.width&&y.height>=g.height?J:rt),Bn(this.cropBox,Ht({width:y.width,height:y.height},mi({translateX:y.left,translateY:y.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Lo(this.element,Ja,this.getData())}},lm={initPreview:function(){var m=this.element,g=this.crossOrigin,y=this.options.preview,x=g?this.crossOriginUrl:this.url,E=m.alt||"The image to preview",P=document.createElement("img");if(g&&(P.crossOrigin=g),P.src=x,P.alt=E,this.viewBox.appendChild(P),this.viewBoxImage=P,!!y){var $=y;typeof y=="string"?$=m.ownerDocument.querySelectorAll(y):y.querySelector&&($=[y]),this.previews=$,Qt($,function(W){var j=document.createElement("img");fi(W,he,{width:W.offsetWidth,height:W.offsetHeight,html:W.innerHTML}),g&&(j.crossOrigin=g),j.src=x,j.alt=E,j.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',W.innerHTML="",W.appendChild(j)})}},resetPreview:function(){Qt(this.previews,function(m){var g=is(m,he);Bn(m,{width:g.width,height:g.height}),m.innerHTML=g.html,qf(m,he)})},preview:function(){var m=this.imageData,g=this.canvasData,y=this.cropBoxData,x=y.width,E=y.height,P=m.width,$=m.height,W=y.left-g.left-m.left,j=y.top-g.top-m.top;!this.cropped||this.disabled||(Bn(this.viewBoxImage,Ht({width:P,height:$},mi(Ht({translateX:-W,translateY:-j},m)))),Qt(this.previews,function(G){var Y=is(G,he),K=Y.width,St=Y.height,_t=K,Ot=St,It=1;x&&(It=K/x,Ot=E*It),E&&Ot>St&&(It=St/E,_t=x*It,Ot=St),Bn(G,{width:_t,height:Ot}),Bn(G.getElementsByTagName("img")[0],Ht({width:P*It,height:$*It},mi(Ht({translateX:-W*It,translateY:-j*It},m))))}))}},cm={bind:function(){var m=this.element,g=this.options,y=this.cropper;we(g.cropstart)&&Re(m,ts,g.cropstart),we(g.cropmove)&&Re(m,Qa,g.cropmove),we(g.cropend)&&Re(m,Ka,g.cropend),we(g.crop)&&Re(m,Ja,g.crop),we(g.zoom)&&Re(m,es,g.zoom),Re(y,nd,this.onCropStart=this.cropStart.bind(this)),g.zoomable&&g.zoomOnWheel&&Re(y,sd,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&&Re(y,ed,this.onDblclick=this.dblclick.bind(this)),Re(m.ownerDocument,od,this.onCropMove=this.cropMove.bind(this)),Re(m.ownerDocument,id,this.onCropEnd=this.cropEnd.bind(this)),g.responsive&&Re(window,ad,this.onResize=this.resize.bind(this))},unbind:function(){var m=this.element,g=this.options,y=this.cropper;we(g.cropstart)&&Ye(m,ts,g.cropstart),we(g.cropmove)&&Ye(m,Qa,g.cropmove),we(g.cropend)&&Ye(m,Ka,g.cropend),we(g.crop)&&Ye(m,Ja,g.crop),we(g.zoom)&&Ye(m,es,g.zoom),Ye(y,nd,this.onCropStart),g.zoomable&&g.zoomOnWheel&&Ye(y,sd,this.onWheel,{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&&Ye(y,ed,this.onDblclick),Ye(m.ownerDocument,od,this.onCropMove),Ye(m.ownerDocument,id,this.onCropEnd),g.responsive&&Ye(window,ad,this.onResize)}},dm={resize:function(){if(!this.disabled){var m=this.options,g=this.container,y=this.containerData,x=g.offsetWidth/y.width,E=g.offsetHeight/y.height,P=Math.abs(x-1)>Math.abs(E-1)?x:E;if(P!==1){var $,W;m.restore&&($=this.getCanvasData(),W=this.getCropBoxData()),this.render(),m.restore&&(this.setCanvasData(Qt($,function(j,G){$[G]=j*P})),this.setCropBoxData(Qt(W,function(j,G){W[G]=j*P})))}}},dblclick:function(){this.disabled||this.options.dragMode===Rn||this.setDragMode(Wf(this.dragBox,dt)?ve:le)},wheel:function(m){var g=this,y=Number(this.options.wheelZoomRatio)||.1,x=1;this.disabled||(m.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){g.wheeling=!1},50),m.deltaY?x=m.deltaY>0?1:-1:m.wheelDelta?x=-m.wheelDelta/120:m.detail&&(x=m.detail>0?1:-1),this.zoom(-x*y,m)))},cropStart:function(m){var g=m.buttons,y=m.button;if(!(this.disabled||(m.type==="mousedown"||m.type==="pointerdown"&&m.pointerType==="mouse")&&(bt(g)&&g!==1||bt(y)&&y!==0||m.ctrlKey))){var x=this.options,E=this.pointers,P;m.changedTouches?Qt(m.changedTouches,function($){E[$.identifier]=rr($)}):E[m.pointerId||0]=rr(m),Object.keys(E).length>1&&x.zoomable&&x.zoomOnTouch?P=ot:P=is(m.target,Xt),Bf.test(P)&&Lo(this.element,ts,{originalEvent:m,action:P})!==!1&&(m.preventDefault(),this.action=P,this.cropping=!1,P===st&&(this.cropping=!0,se(this.dragBox,Ut)))}},cropMove:function(m){var g=this.action;if(!(this.disabled||!g)){var y=this.pointers;m.preventDefault(),Lo(this.element,Qa,{originalEvent:m,action:g})!==!1&&(m.changedTouches?Qt(m.changedTouches,function(x){Ht(y[x.identifier]||{},rr(x,!0))}):Ht(y[m.pointerId||0]||{},rr(m,!0)),this.change(m))}},cropEnd:function(m){if(!this.disabled){var g=this.action,y=this.pointers;m.changedTouches?Qt(m.changedTouches,function(x){delete y[x.identifier]}):delete y[m.pointerId||0],g&&(m.preventDefault(),Object.keys(y).length||(this.action=""),this.cropping&&(this.cropping=!1,Oo(this.dragBox,Ut,this.cropped&&this.options.modal)),Lo(this.element,Ka,{originalEvent:m,action:g}))}}},um={change:function(m){var g=this.options,y=this.canvasData,x=this.containerData,E=this.cropBoxData,P=this.pointers,$=this.action,W=g.aspectRatio,j=E.left,G=E.top,Y=E.width,K=E.height,St=j+Y,_t=G+K,Ot=0,It=0,te=x.width,ce=x.height,Wt=!0,Vn;!W&&m.shiftKey&&(W=Y&&K?Y/K:1),this.limited&&(Ot=E.minLeft,It=E.minTop,te=Ot+Math.min(x.width,y.width,y.left+y.width),ce=It+Math.min(x.height,y.height,y.top+y.height));var Se=P[Object.keys(P)[0]],it={x:Se.endX-Se.startX,y:Se.endY-Se.startY},Tt=function(ee){switch(ee){case lt:St+it.x>te&&(it.x=te-St);break;case T:j+it.x<Ot&&(it.x=Ot-j);break;case U:G+it.y<It&&(it.y=It-G);break;case V:_t+it.y>ce&&(it.y=ce-_t);break}};switch($){case rt:j+=it.x,G+=it.y;break;case lt:if(it.x>=0&&(St>=te||W&&(G<=It||_t>=ce))){Wt=!1;break}Tt(lt),Y+=it.x,Y<0&&($=T,Y=-Y,j-=Y),W&&(K=Y/W,G+=(E.height-K)/2);break;case U:if(it.y<=0&&(G<=It||W&&(j<=Ot||St>=te))){Wt=!1;break}Tt(U),K-=it.y,G+=it.y,K<0&&($=V,K=-K,G-=K),W&&(Y=K*W,j+=(E.width-Y)/2);break;case T:if(it.x<=0&&(j<=Ot||W&&(G<=It||_t>=ce))){Wt=!1;break}Tt(T),Y-=it.x,j+=it.x,Y<0&&($=lt,Y=-Y,j-=Y),W&&(K=Y/W,G+=(E.height-K)/2);break;case V:if(it.y>=0&&(_t>=ce||W&&(j<=Ot||St>=te))){Wt=!1;break}Tt(V),K+=it.y,K<0&&($=U,K=-K,G-=K),W&&(Y=K*W,j+=(E.width-Y)/2);break;case M:if(W){if(it.y<=0&&(G<=It||St>=te)){Wt=!1;break}Tt(U),K-=it.y,G+=it.y,Y=K*W}else Tt(U),Tt(lt),it.x>=0?St<te?Y+=it.x:it.y<=0&&G<=It&&(Wt=!1):Y+=it.x,it.y<=0?G>It&&(K-=it.y,G+=it.y):(K-=it.y,G+=it.y);Y<0&&K<0?($=et,K=-K,Y=-Y,G-=K,j-=Y):Y<0?($=z,Y=-Y,j-=Y):K<0&&($=H,K=-K,G-=K);break;case z:if(W){if(it.y<=0&&(G<=It||j<=Ot)){Wt=!1;break}Tt(U),K-=it.y,G+=it.y,Y=K*W,j+=E.width-Y}else Tt(U),Tt(T),it.x<=0?j>Ot?(Y-=it.x,j+=it.x):it.y<=0&&G<=It&&(Wt=!1):(Y-=it.x,j+=it.x),it.y<=0?G>It&&(K-=it.y,G+=it.y):(K-=it.y,G+=it.y);Y<0&&K<0?($=H,K=-K,Y=-Y,G-=K,j-=Y):Y<0?($=M,Y=-Y,j-=Y):K<0&&($=et,K=-K,G-=K);break;case et:if(W){if(it.x<=0&&(j<=Ot||_t>=ce)){Wt=!1;break}Tt(T),Y-=it.x,j+=it.x,K=Y/W}else Tt(V),Tt(T),it.x<=0?j>Ot?(Y-=it.x,j+=it.x):it.y>=0&&_t>=ce&&(Wt=!1):(Y-=it.x,j+=it.x),it.y>=0?_t<ce&&(K+=it.y):K+=it.y;Y<0&&K<0?($=M,K=-K,Y=-Y,G-=K,j-=Y):Y<0?($=H,Y=-Y,j-=Y):K<0&&($=z,K=-K,G-=K);break;case H:if(W){if(it.x>=0&&(St>=te||_t>=ce)){Wt=!1;break}Tt(lt),Y+=it.x,K=Y/W}else Tt(V),Tt(lt),it.x>=0?St<te?Y+=it.x:it.y>=0&&_t>=ce&&(Wt=!1):Y+=it.x,it.y>=0?_t<ce&&(K+=it.y):K+=it.y;Y<0&&K<0?($=z,K=-K,Y=-Y,G-=K,j-=Y):Y<0?($=et,Y=-Y,j-=Y):K<0&&($=M,K=-K,G-=K);break;case J:this.move(it.x,it.y),Wt=!1;break;case ot:this.zoom(Jf(P),m),Wt=!1;break;case st:if(!it.x||!it.y){Wt=!1;break}Vn=gd(this.cropper),j=Se.startX-Vn.left,G=Se.startY-Vn.top,Y=E.minWidth,K=E.minHeight,it.x>0?$=it.y>0?H:M:it.x<0&&(j-=Y,$=it.y>0?et:z),it.y<0&&(G-=K),this.cropped||(en(this.cropBox,F),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}Wt&&(E.width=Y,E.height=K,E.left=j,E.top=G,this.action=$,this.renderCropBox()),Qt(P,function(ee){ee.startX=ee.endX,ee.startY=ee.endY})}},hm={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&se(this.dragBox,Ut),en(this.cropBox,F),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Ht({},this.initialImageData),this.canvasData=Ht({},this.initialCanvasData),this.cropBoxData=Ht({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Ht(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),en(this.dragBox,Ut),se(this.cropBox,F)),this},replace:function(m){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&m&&(this.isImg&&(this.element.src=m),g?(this.url=m,this.image.src=m,this.ready&&(this.viewBoxImage.src=m,Qt(this.previews,function(y){y.getElementsByTagName("img")[0].src=m}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(m))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,en(this.cropper,ct)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,se(this.cropper,ct)),this},destroy:function(){var m=this.element;return m[Z]?(m[Z]=void 0,this.isImg&&this.replaced&&(m.src=this.originalUrl),this.uncreate(),this):this},move:function(m){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,y=this.canvasData,x=y.left,E=y.top;return this.moveTo(ns(m)?m:x+Number(m),ns(g)?g:E+Number(g))},moveTo:function(m){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,y=this.canvasData,x=!1;return m=Number(m),g=Number(g),this.ready&&!this.disabled&&this.options.movable&&(bt(m)&&(y.left=m,x=!0),bt(g)&&(y.top=g,x=!0),x&&this.renderCanvas(!0)),this},zoom:function(m,g){var y=this.canvasData;return m=Number(m),m<0?m=1/(1-m):m=1+m,this.zoomTo(y.width*m/y.naturalWidth,null,g)},zoomTo:function(m,g,y){var x=this.options,E=this.canvasData,P=E.width,$=E.height,W=E.naturalWidth,j=E.naturalHeight;if(m=Number(m),m>=0&&this.ready&&!this.disabled&&x.zoomable){var G=W*m,Y=j*m;if(Lo(this.element,es,{ratio:m,oldRatio:P/W,originalEvent:y})===!1)return this;if(y){var K=this.pointers,St=gd(this.cropper),_t=K&&Object.keys(K).length?Kf(K):{pageX:y.pageX,pageY:y.pageY};E.left-=(G-P)*((_t.pageX-St.left-E.left)/P),E.top-=(Y-$)*((_t.pageY-St.top-E.top)/$)}else To(g)&&bt(g.x)&&bt(g.y)?(E.left-=(G-P)*((g.x-E.left)/P),E.top-=(Y-$)*((g.y-E.top)/$)):(E.left-=(G-P)/2,E.top-=(Y-$)/2);E.width=G,E.height=Y,this.renderCanvas(!0)}return this},rotate:function(m){return this.rotateTo((this.imageData.rotate||0)+Number(m))},rotateTo:function(m){return m=Number(m),bt(m)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=m%360,this.renderCanvas(!0,!0)),this},scaleX:function(m){var g=this.imageData.scaleY;return this.scale(m,bt(g)?g:1)},scaleY:function(m){var g=this.imageData.scaleX;return this.scale(bt(g)?g:1,m)},scale:function(m){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,y=this.imageData,x=!1;return m=Number(m),g=Number(g),this.ready&&!this.disabled&&this.options.scalable&&(bt(m)&&(y.scaleX=m,x=!0),bt(g)&&(y.scaleY=g,x=!0),x&&this.renderCanvas(!0,!0)),this},getData:function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=this.options,y=this.imageData,x=this.canvasData,E=this.cropBoxData,P;if(this.ready&&this.cropped){P={x:E.left-x.left,y:E.top-x.top,width:E.width,height:E.height};var $=y.width/y.naturalWidth;if(Qt(P,function(G,Y){P[Y]=G/$}),m){var W=Math.round(P.y+P.height),j=Math.round(P.x+P.width);P.x=Math.round(P.x),P.y=Math.round(P.y),P.width=j-P.x,P.height=W-P.y}}else P={x:0,y:0,width:0,height:0};return g.rotatable&&(P.rotate=y.rotate||0),g.scalable&&(P.scaleX=y.scaleX||1,P.scaleY=y.scaleY||1),P},setData:function(m){var g=this.options,y=this.imageData,x=this.canvasData,E={};if(this.ready&&!this.disabled&&To(m)){var P=!1;g.rotatable&&bt(m.rotate)&&m.rotate!==y.rotate&&(y.rotate=m.rotate,P=!0),g.scalable&&(bt(m.scaleX)&&m.scaleX!==y.scaleX&&(y.scaleX=m.scaleX,P=!0),bt(m.scaleY)&&m.scaleY!==y.scaleY&&(y.scaleY=m.scaleY,P=!0)),P&&this.renderCanvas(!0,!0);var $=y.width/y.naturalWidth;bt(m.x)&&(E.left=m.x*$+x.left),bt(m.y)&&(E.top=m.y*$+x.top),bt(m.width)&&(E.width=m.width*$),bt(m.height)&&(E.height=m.height*$),this.setCropBoxData(E)}return this},getContainerData:function(){return this.ready?Ht({},this.containerData):{}},getImageData:function(){return this.sized?Ht({},this.imageData):{}},getCanvasData:function(){var m=this.canvasData,g={};return this.ready&&Qt(["left","top","width","height","naturalWidth","naturalHeight"],function(y){g[y]=m[y]}),g},setCanvasData:function(m){var g=this.canvasData,y=g.aspectRatio;return this.ready&&!this.disabled&&To(m)&&(bt(m.left)&&(g.left=m.left),bt(m.top)&&(g.top=m.top),bt(m.width)?(g.width=m.width,g.height=m.width/y):bt(m.height)&&(g.height=m.height,g.width=m.height*y),this.renderCanvas(!0)),this},getCropBoxData:function(){var m=this.cropBoxData,g;return this.ready&&this.cropped&&(g={left:m.left,top:m.top,width:m.width,height:m.height}),g||{}},setCropBoxData:function(m){var g=this.cropBoxData,y=this.options.aspectRatio,x,E;return this.ready&&this.cropped&&!this.disabled&&To(m)&&(bt(m.left)&&(g.left=m.left),bt(m.top)&&(g.top=m.top),bt(m.width)&&m.width!==g.width&&(x=!0,g.width=m.width),bt(m.height)&&m.height!==g.height&&(E=!0,g.height=m.height),y&&(x?g.height=g.width/y:E&&(g.width=g.height*y)),this.renderCropBox()),this},getCroppedCanvas:function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var g=this.canvasData,y=tm(this.image,this.imageData,g,m);if(!this.cropped)return y;var x=this.getData(m.rounded),E=x.x,P=x.y,$=x.width,W=x.height,j=y.width/Math.floor(g.naturalWidth);j!==1&&(E*=j,P*=j,$*=j,W*=j);var G=$/W,Y=$n({aspectRatio:G,width:m.maxWidth||1/0,height:m.maxHeight||1/0}),K=$n({aspectRatio:G,width:m.minWidth||0,height:m.minHeight||0},"cover"),St=$n({aspectRatio:G,width:m.width||(j!==1?y.width:$),height:m.height||(j!==1?y.height:W)}),_t=St.width,Ot=St.height;_t=Math.min(Y.width,Math.max(K.width,_t)),Ot=Math.min(Y.height,Math.max(K.height,Ot));var It=document.createElement("canvas"),te=It.getContext("2d");It.width=Io(_t),It.height=Io(Ot),te.fillStyle=m.fillColor||"transparent",te.fillRect(0,0,_t,Ot);var ce=m.imageSmoothingEnabled,Wt=ce===void 0?!0:ce,Vn=m.imageSmoothingQuality;te.imageSmoothingEnabled=Wt,Vn&&(te.imageSmoothingQuality=Vn);var Se=y.width,it=y.height,Tt=E,ee=P,nn,hn,so,lo,Un,zn;Tt<=-$||Tt>Se?(Tt=0,nn=0,so=0,Un=0):Tt<=0?(so=-Tt,Tt=0,nn=Math.min(Se,$+Tt),Un=nn):Tt<=Se&&(so=0,nn=Math.min($,Se-Tt),Un=nn),nn<=0||ee<=-W||ee>it?(ee=0,hn=0,lo=0,zn=0):ee<=0?(lo=-ee,ee=0,hn=Math.min(it,W+ee),zn=hn):ee<=it&&(lo=0,hn=Math.min(W,it-ee),zn=hn);var co=[Tt,ee,nn,hn];if(Un>0&&zn>0){var pe=_t/$;co.push(so*pe,lo*pe,Un*pe,zn*pe)}return te.drawImage.apply(te,[y].concat(f(co.map(function(ar){return Math.floor(Io(ar))})))),It},setAspectRatio:function(m){var g=this.options;return!this.disabled&&!ns(m)&&(g.aspectRatio=Math.max(0,m)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(m){var g=this.options,y=this.dragBox,x=this.face;if(this.ready&&!this.disabled){var E=m===le,P=g.movable&&m===ve;m=E||P?m:Rn,g.dragMode=m,fi(y,Xt,m),Oo(y,dt,E),Oo(y,zt,P),g.cropBoxMovable||(fi(x,Xt,m),Oo(x,dt,E),Oo(x,zt,P))}return this}},pm=B.Cropper,bd=(function(){function m(g){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(c(this,m),!g||!Uf.test(g.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=g,this.options=Ht({},ud,To(y)&&y),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return u(m,[{key:"init",value:function(){var g=this.element,y=g.tagName.toLowerCase(),x;if(!g[Z]){if(g[Z]=this,y==="img"){if(this.isImg=!0,x=g.getAttribute("src")||"",this.originalUrl=x,!x)return;x=g.src}else y==="canvas"&&window.HTMLCanvasElement&&(x=g.toDataURL());this.load(x)}}},{key:"load",value:function(g){var y=this;if(g){this.url=g,this.imageData={};var x=this.element,E=this.options;if(!E.rotatable&&!E.scalable&&(E.checkOrientation=!1),!E.checkOrientation||!window.ArrayBuffer){this.clone();return}if($f.test(g)){Vf.test(g)?this.read(om(g)):this.clone();return}var P=new XMLHttpRequest,$=this.clone.bind(this);this.reloading=!0,this.xhr=P,P.onabort=$,P.onerror=$,P.ontimeout=$,P.onprogress=function(){P.getResponseHeader("content-type")!==ld&&P.abort()},P.onload=function(){y.read(P.response)},P.onloadend=function(){y.reloading=!1,y.xhr=null},E.checkCrossOrigin&&yd(g)&&x.crossOrigin&&(g=vd(g)),P.open("GET",g,!0),P.responseType="arraybuffer",P.withCredentials=x.crossOrigin==="use-credentials",P.send()}}},{key:"read",value:function(g){var y=this.options,x=this.imageData,E=rm(g),P=0,$=1,W=1;if(E>1){this.url=im(g,ld);var j=am(E);P=j.rotate,$=j.scaleX,W=j.scaleY}y.rotatable&&(x.rotate=P),y.scalable&&(x.scaleX=$,x.scaleY=W),this.clone()}},{key:"clone",value:function(){var g=this.element,y=this.url,x=g.crossOrigin,E=y;this.options.checkCrossOrigin&&yd(y)&&(x||(x="anonymous"),E=vd(y)),this.crossOrigin=x,this.crossOriginUrl=E;var P=document.createElement("img");x&&(P.crossOrigin=x),P.src=E||y,P.alt=g.alt||"The image to crop",this.image=P,P.onload=this.start.bind(this),P.onerror=this.stop.bind(this),se(P,ft),g.parentNode.insertBefore(P,g.nextSibling)}},{key:"start",value:function(){var g=this,y=this.image;y.onload=null,y.onerror=null,this.sizing=!0;var x=B.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(B.navigator.userAgent),E=function(W,j){Ht(g.imageData,{naturalWidth:W,naturalHeight:j,aspectRatio:W/j}),g.initialImageData=Ht({},g.imageData),g.sizing=!1,g.sized=!0,g.build()};if(y.naturalWidth&&!x){E(y.naturalWidth,y.naturalHeight);return}var P=document.createElement("img"),$=document.body||document.documentElement;this.sizingImage=P,P.onload=function(){E(P.width,P.height),x||$.removeChild(P)},P.src=y.src,x||(P.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",$.appendChild(P))}},{key:"stop",value:function(){var g=this.image;g.onload=null,g.onerror=null,g.parentNode.removeChild(g),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var g=this.element,y=this.options,x=this.image,E=g.parentNode,P=document.createElement("div");P.innerHTML=zf;var $=P.querySelector(".".concat(Z,"-container")),W=$.querySelector(".".concat(Z,"-canvas")),j=$.querySelector(".".concat(Z,"-drag-box")),G=$.querySelector(".".concat(Z,"-crop-box")),Y=G.querySelector(".".concat(Z,"-face"));this.container=E,this.cropper=$,this.canvas=W,this.dragBox=j,this.cropBox=G,this.viewBox=$.querySelector(".".concat(Z,"-view-box")),this.face=Y,W.appendChild(x),se(g,F),E.insertBefore($,g.nextSibling),en(x,ft),this.initPreview(),this.bind(),y.initialAspectRatio=Math.max(0,y.initialAspectRatio)||NaN,y.aspectRatio=Math.max(0,y.aspectRatio)||NaN,y.viewMode=Math.max(0,Math.min(3,Math.round(y.viewMode)))||0,se(G,F),y.guides||se(G.getElementsByClassName("".concat(Z,"-dashed")),F),y.center||se(G.getElementsByClassName("".concat(Z,"-center")),F),y.background&&se($,"".concat(Z,"-bg")),y.highlight||se(Y,Mt),y.cropBoxMovable&&(se(Y,zt),fi(Y,Xt,rt)),y.cropBoxResizable||(se(G.getElementsByClassName("".concat(Z,"-line")),F),se(G.getElementsByClassName("".concat(Z,"-point")),F)),this.render(),this.ready=!0,this.setDragMode(y.dragMode),y.autoCrop&&this.crop(),this.setData(y.data),we(y.ready)&&Re(g,rd,y.ready,{once:!0}),Lo(g,rd)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var g=this.cropper.parentNode;g&&g.removeChild(this.cropper),en(this.element,F)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=pm,m}},{key:"setDefaults",value:function(g){Ht(ud,To(g)&&g)}}])})();return Ht(bd.prototype,sm,lm,cm,dm,um,hm),bd})})(cl)),cl.exports}var Vu;function $8(){if(Vu)return fr;Vu=1,Object.defineProperty(fr,"__esModule",{value:!0});var e=P8(),o=B8(),i=r(o);function r(l){return l&&l.__esModule?l:{default:l}}function a(l,c){var d={};for(var u in l)c.indexOf(u)>=0||Object.prototype.hasOwnProperty.call(l,u)&&(d[u]=l[u]);return d}var s=typeof window>"u"?[String,Array]:[String,Array,Element,NodeList];return fr.default={render:function(){var l=this.crossorigin||void 0;return(0,e.h)("div",{style:this.containerStyle},[(0,e.h)("img",{ref:"img",src:this.src,alt:this.alt||"image",style:[{"max-width":"100%"},this.imgStyle],crossorigin:l})])},props:{containerStyle:Object,src:{type:String,default:""},alt:String,imgStyle:Object,viewMode:Number,dragMode:String,initialAspectRatio:Number,aspectRatio:Number,data:Object,preview:s,responsive:{type:Boolean,default:!0},restore:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},crossorigin:{type:String},modal:{type:Boolean,default:!0},guides:{type:Boolean,default:!0},center:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0},background:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!0},autoCropArea:Number,movable:{type:Boolean,default:!0},rotatable:{type:Boolean,default:!0},scalable:{type:Boolean,default:!0},zoomable:{type:Boolean,default:!0},zoomOnTouch:{type:Boolean,default:!0},zoomOnWheel:{type:Boolean,default:!0},wheelZoomRatio:Number,cropBoxMovable:{type:Boolean,default:!0},cropBoxResizable:{type:Boolean,default:!0},toggleDragModeOnDblclick:{type:Boolean,default:!0},minCanvasWidth:Number,minCanvasHeight:Number,minCropBoxWidth:Number,minCropBoxHeight:Number,minContainerWidth:Number,minContainerHeight:Number,ready:Function,cropstart:Function,cropmove:Function,cropend:Function,crop:Function,zoom:Function},mounted:function(){var l=this.$options.props;l.containerStyle,l.src,l.alt,l.imgStyle;var c=a(l,["containerStyle","src","alt","imgStyle"]),d={};for(var u in c)this[u]!==void 0&&(d[u]=this[u]);this.cropper=new i.default(this.$refs.img,d)},methods:{reset:function(){return this.cropper.reset()},clear:function(){return this.cropper.clear()},initCrop:function(){return this.cropper.crop()},replace:function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.cropper.replace(l,c)},enable:function(){return this.cropper.enable()},disable:function(){return this.cropper.disable()},destroy:function(){return this.cropper.destroy()},move:function(l,c){return this.cropper.move(l,c)},moveTo:function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return this.cropper.moveTo(l,c)},relativeZoom:function(l,c){return this.cropper.zoom(l,c)},zoomTo:function(l,c){return this.cropper.zoomTo(l,c)},rotate:function(l){return this.cropper.rotate(l)},rotateTo:function(l){return this.cropper.rotateTo(l)},scaleX:function(l){return this.cropper.scaleX(l)},scaleY:function(l){return this.cropper.scaleY(l)},scale:function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return this.cropper.scale(l,c)},getData:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.cropper.getData(l)},setData:function(l){return this.cropper.setData(l)},getContainerData:function(){return this.cropper.getContainerData()},getImageData:function(){return this.cropper.getImageData()},getCanvasData:function(){return this.cropper.getCanvasData()},setCanvasData:function(l){return this.cropper.setCanvasData(l)},getCropBoxData:function(){return this.cropper.getCropBoxData()},setCropBoxData:function(l){return this.cropper.setCropBoxData(l)},getCroppedCanvas:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.cropper.getCroppedCanvas(l)},setAspectRatio:function(l){return this.cropper.setAspectRatio(l)},setDragMode:function(l){return this.cropper.setDragMode(l)}}},fr}var V8=$8();const U8=va(V8),z8={name:"CloudDownloadOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},H8=["aria-hidden","aria-label"],G8=["fill","width","height"],Y8={d:"M6.5 20Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.68 7.35 7.38 5.73 9.07 4.1 11 4.1 11.83 4.1 12.41 4.69 13 5.28 13 6.1V12.15L14.6 10.6L16 12L12 16L8 12L9.4 10.6L11 12.15V6.1Q9.1 6.45 8.05 7.94 7 9.43 7 11H6.5Q5.05 11 4.03 12.03 3 13.05 3 14.5 3 15.95 4.03 17 5.05 18 6.5 18H18.5Q19.55 18 20.27 17.27 21 16.55 21 15.5 21 14.45 20.27 13.73 19.55 13 18.5 13H17V11Q17 9.8 16.45 8.76 15.9 7.73 15 7V4.68Q16.85 5.55 17.93 7.26 19 9 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20M12 11.05Z"},F8={key:0};function X8(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 cloud-download-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",Y8,[i.title?(p(),w("title",F8,O(i.title),1)):R("",!0)])],8,G8))],16,H8)}const W8=tt(z8,[["render",X8]]),j8={name:"ImageOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},q8=["aria-hidden","aria-label"],Z8=["fill","width","height"],J8={d:"M19,19H5V5H19M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M13.96,12.29L11.21,15.83L9.25,13.47L6.5,17H17.5L13.96,12.29Z"},K8={key:0};function Q8(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 image-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",J8,[i.title?(p(),w("title",K8,O(i.title),1)):R("",!0)])],8,Z8))],16,q8)}const tx=tt(j8,[["render",Q8]]),ex={name:"UploadOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},nx=["aria-hidden","aria-label"],ox=["fill","width","height"],ix={d:"M9,10V16H15V10H19L12,3L5,10H9M12,5.8L14.2,8H13V14H11V8H9.8L12,5.8M19,18H5V20H19V18Z"},rx={key:0};function ax(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 upload-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",ix,[i.title?(p(),w("title",rx,O(i.title),1)):R("",!0)])],8,ox))],16,nx)}const G1=tt(ex,[["render",ax]]),sx=wo("contacts","supportedNetworks"),lx={name:"ContactDetailsAvatar",components:{ActionButton:Ln,ActionLink:Ca,Actions:oo,Avatar:In,IconCloudDownload:W8,IconDownload:Aa,IconDelete:Tn,IconUpload:G1,IconFolder:Kl,IconImage:tx,NcButton:Kt,VueCropper:U8,NcModal:On},props:{contact:{type:Object,required:!0},isReadOnly:{type:Boolean,required:!0},reloadBus:{type:Object,required:!0}},data(){return{opened:!1,loading:!1,photoUrl:void 0,root:Sh(`dav/files/${ya().uid}`),showCropper:!1,cropperOptions:{aspectRatio:1/1,viewMode:3,guides:!1,center:!1,highlight:!1,autoCropArea:1,dragMode:"move",minContainerWidth:100,minContainerHeight:100}}},computed:{supportedSocial(){const e=this.contact.vCard.getAllProperties("email"),o=this.contact.vCard.getAllProperties("x-socialprofile").map(s=>s.jCal[1].type.toString().toLowerCase()),i=this.contact.vCard.getAllProperties("impp").map(s=>s.jCal[1].type.toString().toLowerCase()),r=[].concat(o,i),a=sx.map(s=>s.toLowerCase());return e.length&&r.push("gravatar"),a.filter(s=>r.includes(s)).map(s=>this.capitalize(s))}},watch:{async contact(){await this.loadPhotoUrl()}},async mounted(){await this.loadPhotoUrl()},methods:{onLoad(...e){console.debug(...e)},async processPicture(e){const o=this.getMimetype(e);if(!o.startsWith("image/"))return yt(t("contacts","Please select a valid format")),!1;if(o==="image/svg"){const i=atob(e.toString("base64"));if(!await Om(i))throw new Error("Unsafe svg image",i)}return this.openCropper(e,o),!0},openCropper(e,o){const i=`data:${o};base64,${e.toString("base64")}`;this.$refs.cropper.replace(i),this.showCropper=!0},handleUploadedFile(e){if(e.target.files&&!this.loading){this.closeMenu();const o=e.target.files[0],i=new FileReader;i.onload=r=>{try{if(typeof r.target.result=="object"){const a=ze.from(r.target.result,"binary");if(this.processPicture(a))return;throw new Error("Wrong image mimetype")}}catch(a){console.error(a),yt(t("contacts","Invalid image"))}finally{this.resetPicker()}},i.readAsArrayBuffer(o)}},resetPicker(){this.$refs.uploadInput.value="",this.loading=!1},capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},getMimetype(e){const o=[];e.slice(0,12).forEach(a=>{o.push(a.toString(16).padStart(2,"0"))});const i=o.join("").toUpperCase(),r=parseInt(window.OC.config.version.split(".")[0]);if(r>=31&&i.slice(0,8)==="52494646"&&i.slice(16,24)==="57454250")return"image/webp";if(r>=32&&i.slice(8,24)==="6674797061766966")return"image/avif";switch(i.slice(0,8)){case"89504E47":return"image/png";case"47494638":return"image/gif";case"3C3F786D":case"3C737667":return"image/svg+xml";case"FFD8FFDB":case"FFD8FFE0":case"FFD8FFE1":return"image/jpeg";default:return"application/octet-stream"}},async setPhoto(e,o){if(this.contact.photo&&this.contact.vCard.addPropertyWithValue("photo",""),this.contact.version==="3.0"){this.contact.photo=e;const i=this.contact.vCard.getFirstProperty("photo");i.setParameter("encoding","b"),o&&i.setParameter("type",o.split("/").pop())}else this.contact.photo=`data:${o};base64,${e}`;await this.loadPhotoUrl(),await this.reloadBus.emit("reload-avatar",this.contact.key),this.loading=!1},async loadPhotoUrl(){if(this.photoUrl=void 0,this.contact.photo){const e=await this.contact.getPhotoUrl();if(!e){console.warn("contact has an invalid photo");return}this.photoUrl=e}else this.contact.url&&(this.photoUrl=`${this.contact.url}?photo`)},saveAvatar(){this.showCropper=!1,this.loading=!0,this.$refs.cropper.getCroppedCanvas({minWidth:16,minHeight:16,maxWidth:512,maxHeight:512}).toBlob(async e=>{if(e===null){yt(t("contacts","Error cropping picture")),this.cancel();return}const o=new FileReader;o.readAsDataURL(e),o.onloadend=()=>{const i=o.result;this.setPhoto(i.split(",").pop(),e.type)}})},removePhoto(){this.contact.vCard.removeAllProperties("photo"),this.photoUrl=void 0,this.reloadBus.emit("delete-avatar",this.contact.key)},cancel(){this.showCropper=!1,this.loading=!1},selectFileInput(){this.loading||this.$refs.uploadInput.click()},async selectFilePicker(){if(!this.loading){this.closeMenu();const e=await dh(t("contacts","Pick an avatar")).setMimeTypeFilter(["image/png","image/jpeg","image/gif","image/x-xbitmap","image/bmp","image/svg+xml"]).addButton({label:t("calendar","Pick"),type:"primary",callback:o=>Il.debug("Picked avatar",{nodes:o})}).build().pick();if(e){this.loading=!0;try{const o=await ie.get(`${this.root}${e}`,{responseType:"arraybuffer"}),i=ze.from(o.data,"binary");this.processPicture(i)}catch(o){yt(t("contacts","Error while processing the picture.")),console.error(o),this.loading=!1}finally{this.resetPicker()}}}},async getSocialAvatar(e){if(!this.loading){this.loading=!0;try{if((await ie.put(ci("/apps/contacts/api/v1/social/avatar/{network}/{id}/{uid}",{network:e.toLowerCase(),id:this.contact.addressbook.id,uid:this.contact.uid})))?.status!==200)throw new URIError("Download of social profile avatar failed");await this.$store.dispatch("fetchFullContact",{contact:this.contact,forceReFetch:!0});const o=this.$store.getters.getContact(this.contact.key);await this.$emit("update-local-contact",o),await this.loadPhotoUrl(),await this.reloadBus.emit("reload-avatar",this.contact.key),Oi(t("contacts","Avatar downloaded from social network"))}catch(o){o?.response?.status===304?Im(t("contacts","Avatar already up to date")):(yt(t("contacts","Avatar download failed")),console.debug(o))}}this.loading=!1},closeMenu(){this.opened=!1}}},cx={class:"contact-header-avatar__wrapper"},dx={class:"avatar__container"},ux={class:"avatar__cropper-buttons"};function hx(e,o,i,r,a,s){const l=k("Avatar"),c=k("VueCropper"),d=k("NcButton"),u=k("NcModal"),h=k("IconImage"),f=k("IconUpload"),v=k("ActionButton"),_=k("IconFolder"),b=k("IconCloudDownload"),C=k("IconDownload"),D=k("ActionLink"),L=k("IconDelete"),B=k("Actions");return p(),w("div",cx,[I("input",{id:"contact-avatar-upload",ref:"uploadInput",type:"file",class:"hidden",accept:"image/*",onChange:o[0]||(o[0]=(...X)=>s.handleUploadedFile&&s.handleUploadedFile(...X))},null,544),i.contact.addressbook.id==="z-server-generated--system"?(p(),N(l,{key:0,"disable-menu":"","show-user-status":!1,user:i.contact.uid,size:75,class:"contact-header-avatar__photo"},null,8,["user"])):(p(),N(l,{key:1,"disable-tooltip":!0,"display-name":i.contact.displayName,"is-no-user":!0,size:75,url:a.photoUrl,class:"contact-header-avatar__photo"},null,8,["display-name","url"])),A(u,{show:a.showCropper,"onUpdate:show":o[1]||(o[1]=X=>a.showCropper=X),size:"small",onClose:s.cancel},{default:S(()=>[I("div",dx,[I("h2",null,O(e.t("contacts","Crop contact photo")),1),A(c,ht({ref:"cropper",class:"avatar__cropper"},a.cropperOptions),null,16),I("div",ux,[A(d,{variant:"tertiary",onClick:s.cancel},{default:S(()=>[q(O(e.t("contacts","Cancel")),1)]),_:1},8,["onClick"]),A(d,{variant:"primary",onClick:s.saveAvatar},{default:S(()=>[q(O(e.t("contacts","Save")),1)]),_:1},8,["onClick"])])])]),_:1},8,["show","onClose"]),i.isReadOnly?R("",!0):(p(),N(B,{key:2,open:a.opened,"onUpdate:open":o[2]||(o[2]=X=>a.opened=X),"force-menu":!0,class:"contact-header-avatar__menu"},{icon:S(()=>[A(h,{size:20,"fill-color":"#fff"})]),default:S(()=>[A(v,{"close-after-click":!0,onClick:Zt(s.selectFileInput,["stop","prevent"])},{icon:S(()=>[A(f,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Upload a new picture")),1)]),_:1},8,["onClick"]),A(v,{"close-after-click":!0,onClick:s.selectFilePicker},{icon:S(()=>[A(_,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Choose from Files")),1)]),_:1},8,["onClick"]),(p(!0),w(mt,null,Dt(s.supportedSocial,X=>(p(),N(v,{key:X,"close-after-click":!0,onClick:nt=>s.getSocialAvatar(X)},{icon:S(()=>[A(b,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Get from "+X)),1)]),_:2},1032,["onClick"]))),128)),i.contact.photo?(p(),w(mt,{key:0},[A(D,{href:`${i.contact.url}?photo`,target:"_blank","close-after-click":!0},{icon:S(()=>[A(C,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Download picture")),1)]),_:1},8,["href"]),A(v,{"close-after-click":!0,onClick:s.removePhoto},{icon:S(()=>[A(L,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Delete picture")),1)]),_:1},8,["onClick"])],64)):R("",!0)]),_:1},8,["open"]))])}const px=tt(lx,[["render",hx],["__scopeId","data-v-5d080205"]]),fx={name:"DetailsHeader",components:{Actions:oo},data(){return{avatarSize:75}},computed:{cssStyle(){return{"--avatar-size":this.avatarSize+"px"}}}},mx={class:"contact-header__no-wrap"},gx={class:"contact-header__avatar"},yx={class:"contact-header__infos"},vx={class:"contact-header__infos-title"},_x={key:0,class:"contact-header__infos-subtitle"},bx={class:"contact-header__quick-actions"},Cx={class:"contact-header__actions"};function kx(e,o,i,r,a,s){const l=k("Actions");return p(),w("header",{class:"contact-header",style:Nl(s.cssStyle)},[I("div",mx,[I("div",gx,[At(e.$slots,"avatar",{avatarSize:a.avatarSize},void 0,!0)]),I("div",yx,[I("h2",vx,[At(e.$slots,"title",{},void 0,!0)]),e.$slots.subtitle?(p(),w("div",_x,[At(e.$slots,"subtitle",{},void 0,!0)])):R("",!0),I("div",bx,[At(e.$slots,"quick-actions",{},void 0,!0)])])]),I("div",Cx,[At(e.$slots,"actions",{},void 0,!0),A(l,ht({ref:"actions",class:"header-menu","menu-align":"right"},e.$attrs),{default:S(()=>[At(e.$slots,"actions-menu",{},void 0,!0)]),_:3},16)])],4)}const wx=tt(fx,[["render",kx],["__scopeId","data-v-b43ac596"]]);var Es,Uu;function Sx(){if(Uu)return Es;Uu=1;const e=[];function o(s){return s>=48&&s<=57}function i(s,l,c){if(typeof s!="string")throw new TypeError(`The first argument must be a string. Received type '${typeof s}'`);if(typeof l!="string")throw new TypeError(`The second argument must be a string. Received type '${typeof l}'`);const d=s.length,u=l.length;let h=0,f=0,v=e,_=0;for(c&&(c.caseInsensitive&&(s=s.toLowerCase(),l=l.toLowerCase()),c.alphabet&&(v=a(c.alphabet)));h<d&&f<u;){let b=s.charCodeAt(h),C=l.charCodeAt(f);if(o(b)){if(!o(C))return b-C;let D=h,L=f;for(;b===48&&++D<d;)b=s.charCodeAt(D);for(;C===48&&++L<u;)C=l.charCodeAt(L);D!==L&&_===0&&(_=D-L);let B=D,X=L;for(;B<d&&o(s.charCodeAt(B));)++B;for(;X<u&&o(l.charCodeAt(X));)++X;let nt=B-D-X+L;if(nt!==0)return nt;for(;D<B;)if(nt=s.charCodeAt(D++)-l.charCodeAt(L++),nt!==0)return nt;h=B,f=X;continue}if(b!==C)return b<v.length&&C<v.length&&v[b]!==-1&&v[C]!==-1?v[b]-v[C]:b-C;++h,++f}return h<d?1:f<u?-1:_}const r={};function a(s){const l=r[s];if(l!==void 0)return l;const c=[],d=s.split("").reduce((u,h)=>Math.max(u,h.charCodeAt(0)),0);for(let u=0;u<=d;u++)c.push(-1);for(let u=0;u<s.length;u++)c[s.charCodeAt(u)]=u;return r[s]=c,c}return Es=i,Es}var xx=Sx();const dl=va(xx),Ex={name:"PropertyGroups",components:{PropertyTitle:Lm,NcSelect:io},props:{propModel:{type:Object,required:!0},value:{type:Array,required:!0},contact:{type:Sl,required:!0},isReadOnly:{type:Boolean,required:!0}},data(){return{localValue:[...this.value].sort()}},computed:{showAsText(){return this.isReadOnly&&this.localValue.length<=1},showProperty(){return this.isReadOnly&&this.localValue.length>0||!this.isReadOnly},groups(){return this.$store.getters.getGroups.slice(0).map(e=>e.name).sort((e,o)=>dl(e,o,{caseInsensitive:!0}))},formatGroupsTitle(){return this.localValue.slice(3).join(", ")}},watch:{value(){this.localValue=this.value},selectType(){this.localType=this.selectType}},methods:{updateValue(){this.$emit("update:value",this.localValue)}}},Mx={key:0,class:"property"},Ax={class:"property__row"},Nx={class:"property__label"},Tx={class:"property__value"},Ix={class:"multiselect__limit"},Ox={key:1},Lx={key:0},Dx={key:1,class:"group__list"};function Px(e,o,i,r,a,s){const l=k("PropertyTitle"),c=k("NcSelect"),d=xh("tooltip");return i.propModel&&s.showProperty?(p(),w("div",Mx,[A(l,{icon:"icon-contacts-dark","readable-name":e.t("contacts","Contact groups"),"is-read-only":i.isReadOnly},null,8,["readable-name","is-read-only"]),I("div",Ax,[I("div",Nx,[I("span",null,O(i.propModel.readableName),1)]),I("div",Tx,[i.isReadOnly?(p(),w("div",Ox,[a.localValue.length===0?(p(),w("span",Lx,O(e.t("contacts","None")),1)):(p(),w("div",Dx,[(p(!0),w(mt,null,Dt(a.localValue,(u,h)=>(p(),w("span",{key:h},O(u)+O(h===a.localValue.length-1?"":", "),1))),128))]))])):(p(),N(c,{key:0,modelValue:a.localValue,"onUpdate:modelValue":o[0]||(o[0]=u=>a.localValue=u),options:s.groups,"no-wrap":!0,placeholder:e.t("contacts","Add contact in group"),multiple:!0,"keep-open":!0,clearable:!0,"deselect-from-dropdown":!0,taggable:!0,"tag-placeholder":"create","onOption:deselected":s.updateValue,onClose:s.updateValue},{limit:S(()=>[Ve((p(),w("span",Ix,[q(" +"+O(a.localValue.length-3),1)])),[[d,s.formatGroupsTitle,void 0,{auto:!0}]])]),"no-options":S(()=>[I("span",null,O(e.t("contacts","No results")),1)]),_:1},8,["modelValue","options","placeholder","onOption:deselected","onClose"]))]),o[1]||(o[1]=I("div",{class:"property__actions"},null,-1))])])):R("",!0)}const Rx=tt(Ex,[["render",Px],["__scopeId","data-v-043d1724"]]),Bx={name:"PropertyRev",props:{value:{type:Object,required:!0}},computed:{relativeDate(){return Dm.unix(Vs(this.value).toUnixTime()).fromNow()}}},$x={class:"property property--rev"},Vx={class:"property__row"},Ux={class:"property__value"};function zx(e,o,i,r,a,s){return p(),w("div",$x,[I("div",Vx,[o[0]||(o[0]=I("div",{class:"property__label"},null,-1)),I("div",Ux,O(e.t("contacts","Last modified"))+" "+O(s.relativeDate),1),o[1]||(o[1]=I("div",{class:"property__actions"},null,-1))])])}const Hx=tt(Bx,[["render",zx],["__scopeId","data-v-1f731c44"]]),Gx=wo("contacts","isTalkEnabled",!1),{profileEnabled:Yx}=wo("user_status","profileEnabled",!1),Ms=fg("contacts").persist().build(),Fx=Te({name:"ContactDetails",components:{Actions:oo,ActionButton:Ln,ActionLink:Ca,AddNewProp:V3,AppContentDetails:jg,ContactAvatar:px,ContactDetailsProperty:hh,DetailsHeader:wx,EmptyContent:Qn,IconContact:no,IconMail:uh,IconMessage:Bm,IconCall:Rm,IconAccount:Li,IconDownload:Aa,IconDelete:Tn,IconQr:f3,CakeIcon:W4,IconCopy:wl,IconLoading:Pe,PencilIcon:kl,CheckIcon:Ma,Modal:On,NcSelect:io,PropertyGroups:Rx,PropertyRev:Hx,PropertySelect:Pm,NcButton:Kt,NcRelatedResourcesPanel:Ng,NcEmptyContent:Qn,FolderMultipleImage:s3},mixins:[ga],provide(){return{sharedState:this.sharedState}},props:{contactKey:{type:String,default:void 0},contacts:{type:Array,default:()=>[]},reloadBus:{type:Object,required:!0},desc:{type:String,required:!1,default:""}},data(){return{fixed:!1,localContact:void 0,loadingData:!0,loadingUpdate:!1,qrcode:"",showPickAddressbookModal:!1,pickedAddressbook:null,editMode:!1,newGroupsValue:[],newAddressBook:null,contactDetailsSelector:".contact-details",excludeFromBirthdayKey:"x-nc-exclude-from-birthday-calendar",bus:El(),showMenuPopover:!1,profileEnabled:Yx,isTalkEnabled:Gx,hasFilesResources:!1,hasTalkResources:!1,hasCalendarResources:!1,hasDeckResources:!1,deckPanelHasError:!1,filesPanelHasError:!1,talkPanelHasError:!1,calendarPanelHasError:!1,sharedState:bh({validEmail:!0}),lastUsedAddressBook:void 0}},computed:{hasRelatedResources(){return this.hasFilesResources||this.hasTalkResources||this.hasCalendarResources||this.hasDeckResources},canModifyCard(){return this.contact.addressbook?.canModifyCard},canDeleteCard(){return this.contact.addressbook?.canDeleteCard},isReadOnly(){return!this.canModifyCard||!this.editMode},isDataValid(){return this.sharedState.validEmail},warning(){return this.canModifyCard===!1?{icon:t3,classes:[],msg:t("contacts","This contact is in read-only mode. You do not have permission to edit this contact.")}:!1},conflict(){return this.contact.conflict?t("contacts","The contact you were trying to edit has changed. Please manually refresh the contact. Any further edits will be discarded."):!1},sortedProperties(){return this.localContact.properties.slice(0).sort((e,o)=>{const i=e.name.split(".").pop(),r=o.name.split(".").pop();return sn.fieldOrder.indexOf(i)-sn.fieldOrder.indexOf(r)})},groupedProperties(){return this.sortedProperties.reduce((e,o)=>this.canDisplay(o)?o.name==="bday"||o.name==="deathdate"||o.name==="anniversary"?(e.lifeEvents||(e.lifeEvents=[]),e.lifeEvents.push(o),e):(e[o.name]||(e[o.name]=[]),e[o.name].push(o),e):e,{})},addressbookModel(){return{readableName:t("contacts","Address book"),icon:"icon-address-book",options:this.addressbooksOptions}},addressbook(){return this.contact?.addressbook?.id||this.lastUsedAddressBook?.id},groupsModel(){return{readableName:t("contacts","Contact groups"),icon:"icon-contacts-dark"}},addressbooksOptions(){return this.addressbooks.filter(e=>e.enabled).map(e=>({id:e.id,name:e.displayName,readOnly:e.readOnly}))},copyableAddressbooksOptions(){return this.addressbooksOptions.filter(e=>!e.readOnly).filter(e=>e.id!==this.contact.addressbook.id).map(e=>({id:e.id,name:e.name}))},addressbooks(){return this.$store.getters.getAddressbooks},contact(){return this.$store.getters.getContact(this.contactKey)},excludeFromBirthdayLabel(){return this.localContact.vCard.hasProperty(this.excludeFromBirthdayKey)?t("contacts","Add contact to Birthday Calendar"):t("contacts","Exclude contact from Birthday Calendar")},enableToggleBirthdayExclusion(){return!!this.localContact?.vCard&&!this.isInSystemAddressBook},formattedSubtitle(){const e=this.contact.title,o=this.contact.org;return e&&o?t("contacts","{title} at {organization}",{title:e,organization:o}):e?Ed(e):o?Ed(o):""},profilePageLink(){return this.contact.socialLink("NEXTCLOUD")},emailAddressProperties(){return this.localContact.properties.find(e=>e.name==="email")},emailAddress(){return this.emailAddressProperties?.getFirstValue()},phoneNumberProperties(){return this.localContact.properties.find(e=>e.name==="tel")},phoneNumberList(){return this.groupedProperties?.tel?.map(e=>e.getFirstValue()).filter(e=>!!e)},emailAddressList(){return this.groupedProperties?.email?.map(e=>e.getFirstValue()).filter(e=>!!e)},callUrl(){return ci("/apps/spreed/?callUser={uid}",{uid:this.contact.uid})},isInSystemAddressBook(){return this.contact.addressbook.id==="z-server-generated--system"},nextcloudVersionAtLeast28(){return parseInt(window.OC.config.version.split(".")[0])>=28}},watch:{contact(e,o){this.contactKey&&e!==o&&this.selectContact(this.contactKey)}},beforeMount(){this.contactKey&&this.selectContact(this.contactKey),document.addEventListener("keydown",this.onCtrlSave),this.lastUsedAddressBook=this.getLastUsedAddressBook()},beforeUnmount(){document.removeEventListener("keydown",this.onCtrlSave)},methods:{updateGroups(e){this.newGroupsValue=e},updateAddressbook(e){this.newAddressBook=e},async updateContact(){this.fixed=!1,this.loadingUpdate=!0;try{await this.$store.dispatch("updateContact",this.localContact)}finally{this.loadingUpdate=!1}if(!this.localContact.dav){this.logger.debug("New contact synced!",{localContact:this.localContact});const e=this.$store.getters.getContact(this.localContact.key);await this.updateLocalContact(e)}},async showQRcode(){const e=this.contact.jCal.slice(0);e[1]=e[1].filter(i=>i[0]!=="photo");const o=xl.stringify(e);if(o.length>0){const i=await R4(o),r=new TextDecoder().decode(i);this.qrcode=btoa(r)}},async toggleBirthdayExclusionForContact(){this.localContact.vCard.hasProperty(this.excludeFromBirthdayKey)?this.localContact.vCard.removeProperty(this.excludeFromBirthdayKey):this.localContact.vCard.addPropertyWithValue(this.excludeFromBirthdayKey,!0),await this.updateContact()},selectInput(){this.$refs.fullname&&this.$refs.fullname.value===t("contacts","Name")&&this.$refs.fullname.select()},async selectContact(e){this.loadingData=!0,this.editMode=!1;const o=this.$store.getters.getContact(e);if(o)if(o.dav)try{await this.$store.dispatch("fetchFullContact",{contact:o}),await this.updateLocalContact(o)}catch(i){i.name==="ParserError"?yt(t("contacts","Syntax error. Cannot open the contact.")):i?.status===404?yt(t("contacts","The contact does not exist on the server anymore.")):yt(t("contacts","Unable to retrieve the contact from the server, please check your network connection.")),console.error(i),this.$store.dispatch("deleteContact",{contact:this.contact,dav:!1})}else await this.updateLocalContact(o),this.editMode=!0;this.loadingData=!1},deleteContact(){this.$store.dispatch("deleteContact",{contact:this.contact})},async moveContactToAddressbook(e){const o=this.addressbooks.find(i=>i.id===e);if(this.loadingUpdate=!0,o)try{const i=await this.$store.dispatch("moveContactToAddressbook",{contact:this.contact,addressbook:o});this.$router.push({name:"contact",params:{selectedGroup:this.$route.params.selectedGroup,selectedContact:i.key}})}catch(i){console.error(i),yt(t("contacts","An error occurred while trying to move the contact"))}finally{this.loadingUpdate=!1}},async copyContactToAddressbook(e){const o=this.addressbooks.find(i=>i.id===e);if(this.loadingUpdate=!0,o)try{const i=await this.$store.dispatch("copyContactToAddressbook",{contact:this.contact,addressbook:o});this.$router.push({name:"contact",params:{selectedGroup:this.$route.params.selectedGroup,selectedContact:i.key}})}catch(i){console.error(i),yt(t("contacts","An error occurred while trying to copy the contact"))}finally{this.loadingUpdate=!1}},refreshContact(){this.$store.dispatch("fetchFullContact",{contact:this.contact,etag:this.conflict}).then(()=>{this.contact.conflict=!1})},closeQrModal(){this.qrcode=""},async updateLocalContact(e){const o=Object.assign(Object.create(Object.getPrototypeOf(e)),e);this.fixed=$m(o),this.localContact=o,this.newGroupsValue=[...this.localContact.groups]},onCtrlSave(e){this.editMode&&e.keyCode===83&&(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)&&(e.preventDefault(),this.onSave())},async cloneContact(){this.pickedAddressbook&&this.addressbooks.find(e=>e.id===this.pickedAddressbook.id)?(this.logger.debug("Cloning contact to",{name:this.pickedAddressbook.name}),await this.copyContactToAddressbook(this.pickedAddressbook.id),this.closePickAddressbookModal()):this.addressbooksOptions.length===1?(this.logger.debug("Cloning contact to",{name:this.addressbooksOptions[0].name}),await this.copyContactToAddressbook(this.addressbooksOptions[0].id)):this.showPickAddressbookModal=!0},closePickAddressbookModal(){this.showPickAddressbookModal=!1,this.pickedAddressbook=null},canDisplay(e){const o=sn.properties[e.name.split(".").pop()],i=o&&o.force?o.force:e.getDefaultType();return o&&i!=="unknown"},async onSave(){try{this.localContact.groups=[...this.newGroupsValue],await this.$store.dispatch("updateContactGroups",{groupNames:this.newGroupsValue,contact:this.contact}),await this.updateContact(),this.newAddressBook&&this.newAddressBook!==this.contact.addressbook.id&&(this.updateAddressBookAccesses(this.newAddressBook),this.moveContactToAddressbook(this.newAddressBook),this.newAddressBook=null),this.editMode=!1,await this.$store.commit("resortAddressbooks")}catch(e){this.logger.error("error while saving contact",{error:e}),yt(t("contacts","Unable to update contact")),this.logger.error(`Unable to update contact: ${e}`,{error:e,contact:Vs(this.contact),localContact:Vs(this.localContact)})}},getLastUsedAddressBook(){const e=JSON.parse(Ms.getItem("last-used-addressbook")||"{}");if(!(e?.id===null||e?.id===void 0))return this.addressbooksOptions?.find(o=>o.id===e.id)??void 0},updateAddressBookAccesses(e){let o=JSON.parse(Ms.getItem("last-used-addressbook")||"{}");(!o||typeof o!="object")&&(o={}),o.id=e,Ms.setItem("last-used-addressbook",JSON.stringify(o))}}}),Xx={key:0,class:"contact-title"},Wx=["placeholder"],jx=["innerHTML"],qx=["placeholder"],Zx=["placeholder"],Jx={key:0},Kx=["title"],Qx=["title"],tE=["src","alt"],eE={class:"contact-details"},nE={key:0,class:"life-events-group"},oE={key:4,class:"related-resources"};function iE(e,o,i,r,a,s){const l=k("IconContact"),c=k("EmptyContent"),d=k("ContactAvatar"),u=k("ActionButton"),h=k("IconAccount"),f=k("IconMail"),v=k("ActionLink"),_=k("IconCall"),b=k("Actions"),C=k("PencilIcon"),D=k("NcButton"),L=k("IconLoading"),B=k("CheckIcon"),X=k("IconDownload"),nt=k("IconCopy"),Z=k("IconQr"),rt=k("CakeIcon"),st=k("IconDelete"),J=k("DetailsHeader"),ot=k("Modal"),lt=k("NcSelect"),T=k("ContactDetailsProperty"),V=k("PropertySelect"),U=k("PropertyGroups"),M=k("NcRelatedResourcesPanel"),z=k("FolderMultipleImage"),H=k("NcEmptyContent"),et=k("AddNewProp"),dt=k("PropertyRev"),ct=k("AppContentDetails");return p(),N(ct,null,{default:S(()=>[e.contact?(p(),w(mt,{key:1},[A(J,null,{avatar:S(()=>[A(d,{contact:e.contact,"is-read-only":e.isReadOnly,"reload-bus":e.reloadBus,onUpdateLocalContact:e.updateLocalContact},null,8,["contact","is-read-only","reload-bus","onUpdateLocalContact"])]),title:S(()=>[e.isReadOnly?(p(),w("div",Xx,O(e.contact.fullName),1)):Ve((p(),w("input",{key:1,id:"contact-fullname",ref:"fullname","onUpdate:modelValue":o[0]||(o[0]=F=>e.contact.fullName=F),placeholder:e.t("contacts","Name"),type:"text",autocomplete:"off",autocorrect:"off",spellcheck:"false",name:"fullname",onClick:o[1]||(o[1]=(...F)=>e.selectInput&&e.selectInput(...F))},null,8,Wx)),[[zo,e.contact.fullName]])]),subtitle:S(()=>[e.isReadOnly?(p(),w("span",{key:0,innerHTML:e.formattedSubtitle},null,8,jx)):(p(),w(mt,{key:1},[Ve(I("input",{id:"contact-title","onUpdate:modelValue":o[2]||(o[2]=F=>e.contact.title=F),placeholder:e.t("contacts","Title"),type:"text",autocomplete:"off",autocorrect:"off",spellcheck:"false",name:"title"},null,8,qx),[[zo,e.contact.title]]),Ve(I("input",{id:"contact-org","onUpdate:modelValue":o[3]||(o[3]=F=>e.contact.org=F),placeholder:e.t("contacts","Company"),type:"text",autocomplete:"off",autocorrect:"off",spellcheck:"false",name:"org"},null,8,Zx),[[zo,e.contact.org]])],64))]),"quick-actions":S(()=>[!e.editMode&&!e.loadingData?(p(),w("div",Jx,[A(b,{inline:6,variant:"secondary"},{default:S(()=>[e.isTalkEnabled&&e.isInSystemAddressBook?(p(),N(u,{key:0,"aria-label":e.t("contacts","Go to talk conversation"),name:e.t("contacts","Go to talk conversation"),class:"icon-talk quick-action",href:e.callUrl},null,8,["aria-label","name","href"])):R("",!0),e.profilePageLink?(p(),N(u,{key:1,class:"quick-action","aria-label":e.t("contacts","View profile"),name:e.t("contacts","View profile"),href:e.profilePageLink},{icon:S(()=>[A(h,{size:20})]),_:1},8,["aria-label","name","href"])):R("",!0),(p(!0),w(mt,null,Dt(e.emailAddressList,F=>(p(),N(v,{key:F,class:"quick-action",href:"mailto:"+F},{icon:S(()=>[A(f,{size:20})]),default:S(()=>[q(" "+O(F),1)]),_:2},1032,["href"]))),128)),(p(!0),w(mt,null,Dt(e.phoneNumberList,F=>(p(),N(v,{key:F,class:"quick-action",href:"tel:"+F},{icon:S(()=>[A(_,{size:20})]),default:S(()=>[q(" "+O(F),1)]),_:2},1032,["href"]))),128))]),_:1})])):R("",!0)]),actions:S(()=>[e.warning?(p(),N(to(e.warning.icon),{key:0,title:e.warning?e.warning.msg:"",class:"header-icon",classes:e.warning.classes},null,8,["title","classes"])):R("",!0),e.conflict?(p(),w("div",{key:1,title:e.conflict,class:"header-icon header-icon--pulse icon-history",onClick:o[4]||(o[4]=(...F)=>e.refreshContact&&e.refreshContact(...F))},null,8,Kx)):R("",!0),e.fixed?(p(),w("div",{key:2,title:e.t("contacts","This contact was broken and received a fix. Please review the content and click here to save it."),class:"header-icon header-icon--pulse icon-up",onClick:o[5]||(o[5]=(...F)=>e.updateContact&&e.updateContact(...F))},null,8,Qx)):R("",!0),e.canModifyCard?(p(),w(mt,{key:3},[e.editMode?(p(),N(D,{key:1,variant:"secondary",disabled:e.loadingUpdate||!e.isDataValid,onClick:e.onSave},{icon:S(()=>[e.loadingUpdate?(p(),N(L,{key:0,size:20})):(p(),N(B,{key:1,size:20}))]),default:S(()=>[q(" "+O(e.t("contacts","Save")),1)]),_:1},8,["disabled","onClick"])):(p(),N(D,{key:0,variant:e.isMobile?"secondary":"tertiary",onClick:o[6]||(o[6]=F=>e.editMode=!0)},{icon:S(()=>[A(C,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Edit")),1)]),_:1},8,["variant"]))],64)):R("",!0)]),"actions-menu":S(()=>[A(v,{href:e.contact.url,download:`${e.contact.displayName}.vcf`},{icon:S(()=>[A(X,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Download")),1)]),_:1},8,["href","download"]),e.isReadOnly&&e.addressbooksOptions.length>0?(p(),N(u,{key:0,ref:"cloneAction","close-after-click":!0,onClick:e.cloneContact},{icon:S(()=>[A(nt,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Clone contact")),1)]),_:1},8,["onClick"])):R("",!0),A(u,{"close-after-click":!0,onClick:e.showQRcode},{icon:S(()=>[A(Z,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Generate QR Code")),1)]),_:1},8,["onClick"]),e.enableToggleBirthdayExclusion?(p(),N(u,{key:1,"close-after-click":!0,onClick:e.toggleBirthdayExclusionForContact},{icon:S(()=>[A(rt,{size:20})]),default:S(()=>[q(" "+O(e.excludeFromBirthdayLabel),1)]),_:1},8,["onClick"])):R("",!0),e.canDeleteCard?(p(),N(u,{key:2,onClick:e.deleteContact},{icon:S(()=>[A(st,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Delete")),1)]),_:1},8,["onClick"])):R("",!0)]),_:1}),e.qrcode?(p(),N(ot,{key:0,id:"qrcode-modal",size:"small","clear-view-delay":-1,name:e.contact.displayName,"close-button-contained":!1,onClose:e.closeQrModal},{default:S(()=>[I("img",{src:`data:image/svg+xml;base64,${e.qrcode}`,alt:e.t("contacts","Contact vCard as QR code"),class:"qrcode",width:"400"},null,8,tE)]),_:1},8,["name","onClose"])):R("",!0),e.showPickAddressbookModal?(p(),N(ot,{key:1,id:"pick-addressbook-modal","clear-view-delay":-1,name:e.t("contacts","Pick an address book"),onClose:e.closePickAddressbookModal},{default:S(()=>[A(lt,{ref:"pickAddressbook",modelValue:e.pickedAddressbook,"onUpdate:modelValue":o[7]||(o[7]=F=>e.pickedAddressbook=F),class:"address-book","allow-empty":!1,options:e.copyableAddressbooksOptions,placeholder:e.t("contacts","Select address book"),label:"name"},null,8,["modelValue","options","placeholder"]),I("button",{onClick:o[8]||(o[8]=(...F)=>e.closePickAddressbookModal&&e.closePickAddressbookModal(...F))},O(e.t("contacts","Cancel")),1),I("button",{class:"primary",onClick:o[9]||(o[9]=(...F)=>e.cloneContact&&e.cloneContact(...F))},O(e.t("contacts","Clone contact")),1)]),_:1},8,["name","onClose"])):R("",!0),e.loadingData?(p(),N(L,{key:2,size:20,class:"contact-details"})):e.loadingData?R("",!0):(p(),w("div",{key:3,class:$t(["contact-details-wrapper",[{"contact-details-wrapper-read-only":e.isReadOnly}]])},[I("section",eE,[e.name==="lifeEvents"?(p(),w("div",nE,[(p(!0),w(mt,null,Dt(e.properties,(F,ft)=>(p(),N(T,{key:`${ft}-${e.contact.key}-${F.name}`,"is-first-property":ft===0,"is-last-property":ft===e.properties.length-1,property:F,contact:e.contact,"local-contact":e.localContact,contacts:e.contacts,bus:e.bus,"is-read-only":e.isReadOnly},null,8,["is-first-property","is-last-property","property","contact","local-contact","contacts","bus","is-read-only"]))),128))])):R("",!0),(p(!0),w(mt,null,Dt(e.groupedProperties,(F,ft)=>(p(),w("div",{key:ft},[(p(!0),w(mt,null,Dt(F,(Mt,Ut)=>(p(),N(T,{key:`${Ut}-${e.contact.key}-${Mt.name}`,"is-first-property":Ut===0,"is-last-property":Ut===F.length-1,property:Mt,contact:e.contact,"local-contact":e.localContact,contacts:e.contacts,bus:e.bus,"is-read-only":e.isReadOnly},null,8,["is-first-property","is-last-property","property","contact","local-contact","contacts","bus","is-read-only"]))),128))]))),128))]),A(V,{"prop-model":e.addressbookModel,options:e.addressbooksOptions,value:e.addressbook,"is-first-property":!0,"is-last-property":!0,property:{},"hide-actions":!0,"is-read-only":e.isReadOnly,class:"property--addressbooks property--last","onUpdate:value":e.updateAddressbook},null,8,["prop-model","options","value","is-read-only","onUpdate:value"]),A(U,{value:e.localContact.groups,"prop-model":e.groupsModel,contact:e.contact,"is-read-only":e.isReadOnly,class:"property--groups property--last","onUpdate:value":e.updateGroups},null,8,["value","prop-model","contact","is-read-only","onUpdate:value"])],2)),e.nextcloudVersionAtLeast28&&!e.editMode?(p(),w("div",oE,[e.filesPanelHasError?R("",!0):(p(),N(M,{key:0,"provider-id":"account","resource-type":"files",description:e.desc,limit:5,header:e.t("contacts","Media shares with you"),"item-id":e.contact.uid,primary:!0,onHasResources:o[10]||(o[10]=F=>e.hasFilesResources=F),onHasError:o[11]||(o[11]=F=>e.filesPanelHasError=F)},null,8,["description","header","item-id"])),e.talkPanelHasError?R("",!0):(p(),N(M,{key:1,"provider-id":"account","resource-type":"talk",description:e.desc,limit:5,header:e.t("contacts","Talk conversations with you"),"item-id":e.contact.uid,primary:!0,onHasResources:o[12]||(o[12]=F=>e.hasTalkResources=F),onHasError:o[13]||(o[13]=F=>e.talkPanelHasError=F)},null,8,["description","header","item-id"])),e.calendarPanelHasError?R("",!0):(p(),N(M,{key:2,"provider-id":"account","resource-type":"calendar",description:e.desc,limit:5,header:e.t("contacts","Calendar events with you"),"item-id":e.contact.uid,primary:!0,onHasResources:o[14]||(o[14]=F=>e.hasCalendarResources=F),onHasError:o[15]||(o[15]=F=>e.calendarPanelHasError=F)},null,8,["description","header","item-id"])),e.deckPanelHasError?R("",!0):(p(),N(M,{key:3,"provider-id":"account","resource-type":"deck",description:e.desc,limit:5,header:e.t("contacts","Deck cards with you"),"item-id":e.contact.uid,primary:!0,onHasResources:o[16]||(o[16]=F=>e.hasDeckResources=F),onHasError:o[17]||(o[17]=F=>e.deckPanelHasError=F)},null,8,["description","header","item-id"])),!e.hasRelatedResources&&!e.loadingData?(p(),N(H,{key:4,name:e.t("contacts","No shared items with this contact")},{icon:S(()=>[A(z,{size:20})]),_:1},8,["name"])):R("",!0)])):R("",!0),e.isReadOnly?R("",!0):(p(),N(et,{key:5,class:"last-edit",bus:e.bus,contact:e.contact},null,8,["bus","contact"])),e.contact.rev?(p(),N(dt,{key:6,value:e.contact.rev,class:"last-edit"},null,8,["value"])):R("",!0)],64)):(p(),N(c,{key:0,class:"empty-content",name:e.t("contacts","No contact selected"),description:e.t("contacts","Select a contact on the list to begin")},{icon:S(()=>[A(l,{size:20})]),_:1},8,["name","description"]))]),_:1})}const rE=tt(Fx,[["render",iE],["__scopeId","data-v-d17f1c2c"]]),aE='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-cancel" viewBox="0 0 24 24"><path d="M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z" /></svg>',sE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='mdi-delete-outline'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M6,19A2,2%200%200,0%208,21H16A2,2%200%200,0%2018,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z'%20/%3e%3c/svg%3e",lE={name:"BookAccountOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},cE=["aria-hidden","aria-label"],dE=["fill","width","height"],uE={d:"M18 2A2 2 0 0 1 20 4V20A2 2 0 0 1 18 22H6A2 2 0 0 1 4 20V4A2 2 0 0 1 6 2H18M18 4H13V9L10.5 6.7L8 9V4H6V20H18M13 11A2 2 0 1 1 11 13A2 2 0 0 1 13 11M17 19H9V18C9 16.67 11.67 16 13 16S17 16.67 17 18V19"},hE={key:0};function pE(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-account-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",uE,[i.title?(p(),w("title",hE,O(i.title),1)):R("",!0)])],8,dE))],16,cE)}const fE=tt(lE,[["render",pE]]),mE={name:"CloseThickIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},gE=["aria-hidden","aria-label"],yE=["fill","width","height"],vE={d:"M20 6.91L17.09 4L12 9.09L6.91 4L4 6.91L9.09 12L4 17.09L6.91 20L12 14.91L17.09 20L20 17.09L14.91 12L20 6.91Z"},_E={key:0};function bE(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-thick-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",vE,[i.title?(p(),w("title",_E,O(i.title),1)):R("",!0)])],8,yE))],16,gE)}const CE=tt(mE,[["render",bE]]),kE={name:"SetMergeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},wE=["aria-hidden","aria-label"],SE=["fill","width","height"],xE={d:"M2 7V9H7V7H2M12 9V11H9V13H12V15L15 12L12 9M17 9V15H22V9H17M2 11V13H7V11H2M2 15V17H7V15H2Z"},EE={key:0};function ME(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 set-merge-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",xE,[i.title?(p(),w("title",EE,O(i.title),1)):R("",!0)])],8,SE))],16,wE)}const Y1=tt(kE,[["render",ME]]),AE={name:"AccountMultiplePlusOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},NE=["aria-hidden","aria-label"],TE=["fill","width","height"],IE={d:"M13 11A3 3 0 1 0 10 8A3 3 0 0 0 13 11M13 7A1 1 0 1 1 12 8A1 1 0 0 1 13 7M17.11 10.86A5 5 0 0 0 17.11 5.14A2.91 2.91 0 0 1 18 5A3 3 0 0 1 18 11A2.91 2.91 0 0 1 17.11 10.86M13 13C7 13 7 17 7 17V19H19V17S19 13 13 13M9 17C9 16.71 9.32 15 13 15C16.5 15 16.94 16.56 17 17M24 17V19H21V17A5.6 5.6 0 0 0 19.2 13.06C24 13.55 24 17 24 17M8 12H5V15H3V12H0V10H3V7H5V10H8Z"},OE={key:0};function LE(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-multiple-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",IE,[i.title?(p(),w("title",OE,O(i.title),1)):R("",!0)])],8,TE))],16,NE)}const F1=tt(AE,[["render",LE]]),DE={name:"BookArrowRightOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},PE=["aria-hidden","aria-label"],RE=["fill","width","height"],BE={d:"M13.09 20C13.21 20.72 13.46 21.39 13.81 22H6C4.89 22 4 21.11 4 20V4C4 2.9 4.89 2 6 2H18C19.11 2 20 2.9 20 4V13.09C19.67 13.04 19.34 13 19 13C18.66 13 18.33 13.04 18 13.09V4H13V12L10.5 9.75L8 12V4H6V20H13.09M23 19L20 16V18H16V20H20V22L23 19Z"},$E={key:0};function VE(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-arrow-right-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",BE,[i.title?(p(),w("title",$E,O(i.title),1)):R("",!0)])],8,RE))],16,PE)}const UE=tt(DE,[["render",VE]]),zE={name:"ContactsListItem",components:{ListItem:Nh,NcAvatar:In,CheckIcon:Ma},mixins:[ro],props:{index:{type:Number,required:!0},source:{type:Object,required:!0},reloadBus:{type:Object,required:!0},onSelectMultipleFromParent:{type:Function,default:()=>{}},isStatic:{type:Boolean,default:!1,required:!1},showAddressbook:{type:Boolean,default:!1,required:!1}},data(){return{avatarUrl:void 0,hoveringAvatar:!1}},computed:{isDraggable(){return!!this.source.dav&&this.source.addressbook.id!=="z-server-generated--system"&&!this.isStatic},id(){return this.source.key.slice(0,-2)},getTel(){return this.source.properties.find(e=>e.name==="tel")?.getFirstValue()}},created(){this.isStatic||(this.reloadBus.on("reload-avatar",this.reloadAvatarUrl),this.reloadBus.on("delete-avatar",this.deleteAvatar))},unmounted(){this.isStatic||(this.reloadBus.off("reload-avatar",this.reloadAvatarUrl),this.reloadBus.off("delete-avatar",this.deleteAvatar))},async mounted(){await this.loadAvatarUrl()},methods:{startDrag(e,o){e.dataTransfer.dropEffect="move",e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("item",JSON.stringify({addressbookId:o.addressbook.id,displayName:o.displayName,groups:o.groups,url:o.url,uid:o.uid}))},reloadAvatarUrl(e){e===this.source.key&&this.loadAvatarUrl()},deleteAvatar(e){e===this.source.key&&(this.avatarUrl=void 0)},async loadAvatarUrl(){if(this.avatarUrl=void 0,this.source.photo){const e=await this.source.getPhotoUrl();if(!e){console.warn("contact has an invalid photo");return}this.avatarUrl=e}else this.source.hasPhoto&&this.source.url&&(this.avatarUrl=`${this.source.url}?photo`)},selectContact(){this.isStatic||this.$router.push({name:"contact",params:{selectedGroup:this.selectedGroup,selectedContact:this.source.key}})},onSelectMultiple(){this.isStatic||this.onSelectMultipleFromParent(this.source,this.index)},onSelectMultipleRange(){this.isStatic||this.onSelectMultipleFromParent(this.source,this.index,!0)},hoverAvatar(e){this.isStatic||(this.hoveringAvatar=e)}}},HE=["draggable"],GE={class:"envelope__subtitle"},YE={class:"envelope__subtitle__subject"},FE={key:0,class:"envelope__subtitle"},XE={class:"envelope__subtitle__addressbook"};function WE(e,o,i,r,a,s){const l=k("NcAvatar"),c=k("CheckIcon"),d=k("ListItem");return p(),w("div",{class:"contacts-list__item-wrapper",draggable:s.isDraggable,onDragstart:o[3]||(o[3]=u=>s.startDrag(u,i.source)),onClick:o[4]||(o[4]=Zt((...u)=>s.onSelectMultipleRange&&s.onSelectMultipleRange(...u),["shift","exact","prevent"]))},[(p(),N(d,{id:s.id,key:i.source.key,class:"list-item-style envelope",name:i.source.displayName,to:i.isStatic?void 0:{name:"contact",params:{selectedGroup:e.selectedGroup,selectedContact:i.source.key}}},{icon:S(()=>[I("div",{class:"contacts-list__item-icon",onClick:o[0]||(o[0]=Zt((...u)=>s.onSelectMultiple&&s.onSelectMultiple(...u),["exact","prevent"])),onMouseenter:o[1]||(o[1]=u=>s.hoverAvatar(!0)),onMouseleave:o[2]||(o[2]=u=>s.hoverAvatar(!1))},[(!i.source.isMultiSelected&&!a.hoveringAvatar||i.isStatic)&&i.source.addressbook.id==="z-server-generated--system"?(p(),N(l,{key:0,user:i.source.uid,"hide-status":!0,size:40},null,8,["user"])):R("",!0),(!i.source.isMultiSelected&&!a.hoveringAvatar||i.isStatic)&&i.source.addressbook.id!=="z-server-generated--system"?(p(),N(l,{key:1,"display-name":i.source.displayName,url:a.avatarUrl,size:40},null,8,["display-name","url"])):R("",!0),(i.source.isMultiSelected||a.hoveringAvatar)&&!i.isStatic?(p(),N(c,{key:2,size:28,class:$t({"contacts-list__item-avatar-selected":i.source.isMultiSelected,"contacts-list__item-avatar-hovered":!i.source.isMultiSelected})},null,8,["class"])):R("",!0)],32)]),subname:S(()=>[I("div",GE,[I("span",YE,O(i.source.email?i.source.email:s.getTel),1)]),i.showAddressbook?(p(),w("div",FE,[I("span",XE,O(e.t("contacts","from {addressbook}",{addressbook:i.source.addressbook.displayName})),1)])):R("",!0)]),_:1},8,["id","name","to"]))],40,HE)}const X1=tt(zE,[["render",WE],["__scopeId","data-v-1d8a8cda"]]);async function W1(e,o){const i=e.groups;return i.push(o),ie.patch(e.url,{},{headers:{"X-PROPERTY":"CATEGORIES","X-PROPERTY-REPLACE":i.map(r=>encodeURIComponent(r)).join(",")}})}const jE={name:"Batch",components:{ContactsListItem:X1,NcButton:Kt,NcSelect:io,IconPlus:li,IconAccountPlus:F1,IconBookArrow:UE,NcNoteCard:ma},props:{contacts:{type:Array,required:!0},mode:{type:String,required:!1,default:"group"}},emits:["submit"],data(){return{reloadBus:null,showAllContacts:!1,selectedGroups:[],selectedAddressesBook:null}},computed:{contactsLimited(){return this.showAllContacts?this.contacts:this.contacts.slice(0,9)},groupOptions(){return this.$store.getters.getGroups.map(e=>({label:e.name,value:e.name}))},canModifyCount(){return this.contacts.filter(e=>e.addressbook.canModifyCard).length},canDeleteCount(){return this.contacts.filter(e=>e.addressbook.canDeleteCard).length},moveTargetOptions(){return this.$store.getters.getAddressbooks.filter(e=>e.canCreateCard&&e.enabled).map(e=>({label:e.displayName||e.label||e.addressbook,value:e.id||e.addressbook}))}},methods:{submit(){this.mode==="group"&&this.group(),this.mode==="move"&&this.moveToAddressbook()},listItemTitle(e){return this.mode==="move"?e.addressbook.canDeleteCard?"":this.$t("contacts","This contact cannot be moved"):this.mode==="group"?e.addressbook.canModifyCard?"":this.$t("contacts","This contact cannot be grouped"):""},async group(){const e=this.$store.getters.getGroups;this.selectedGroups.forEach(o=>{const i=e.find(r=>r.name===o.value);if(!i){console.error("Cannot add contact to an undefined group",o);return}this.contacts.forEach(r=>{r.addressbook.canModifyCard&&(r.groups&&r.groups.includes(i.name)||W1(r,i.name).then(()=>{this.$store.dispatch("addContactToGroup",{contact:r,groupName:i.name})}).catch(a=>{console.error(a)}))})}),this.$emit("submit")},async moveToAddressbook(){if(!this.selectedAddressesBook)return;const e=this.$store.getters.getAddressbooks.find(i=>i.id===this.selectedAddressesBook.value);if(!e){console.error("Selected addressbook not found",this.selectedAddressesBook);return}const o=this.contacts.map(async i=>{if(!i.addressbook.canDeleteCard||i.addressbook.id===e.id)return null;try{return await this.$store.dispatch("moveContactToAddressbook",{contact:i,addressbook:e}),i}catch(r){return console.error("Failed to move contact",i,r),null}});await Promise.all(o),this.$emit("submit")}}},qE={class:"batch"},ZE={class:"batch__title"},JE={key:0},KE={key:1},QE={class:"contacts-list"},tM={class:"batch__footer"};function eM(e,o,i,r,a,s){const l=k("NcSelect"),c=k("NcNoteCard"),d=k("ContactsListItem"),u=k("IconPlus"),h=k("NcButton"),f=k("IconAccountPlus"),v=k("IconBookArrow");return p(),w("div",qE,[I("div",ZE,[i.mode==="group"?(p(),w("h3",JE,O(e.t("contacts","Add contacts to groups")),1)):R("",!0),i.mode==="move"?(p(),w("h3",KE,O(e.t("contacts","Move contacts to addressbook")),1)):R("",!0)]),i.mode==="group"?(p(),N(l,{key:0,modelValue:a.selectedGroups,"onUpdate:modelValue":o[0]||(o[0]=_=>a.selectedGroups=_),"input-label":e.t("contacts","Select groups"),multiple:!0,options:s.groupOptions},null,8,["modelValue","input-label","options"])):R("",!0),i.mode==="move"?(p(),N(l,{key:1,modelValue:a.selectedAddressesBook,"onUpdate:modelValue":o[1]||(o[1]=_=>a.selectedAddressesBook=_),"input-label":e.t("contacts","Select addressbook"),options:s.moveTargetOptions},null,8,["modelValue","input-label","options"])):R("",!0),I("h6",null,O(e.t("contacts","Selected contacts")),1),i.mode==="group"&&s.canModifyCount!==i.contacts.length?(p(),N(c,{key:2,type:"info"},{default:S(()=>[q(O(e.t("contacts","Please note that only {count} of the {total} contacts can be added to a group",{count:s.canModifyCount,total:i.contacts.length})),1)]),_:1})):R("",!0),i.mode==="move"&&s.canDeleteCount!==i.contacts.length?(p(),N(c,{key:3,type:"info"},{default:S(()=>[q(O(e.t("contacts","Please note that only {count} of the {total} contacts can be moved",{count:s.canDeleteCount,total:i.contacts.length})),1)]),_:1})):R("",!0),I("ul",QE,[(p(!0),w(mt,null,Dt(s.contactsLimited,(_,b)=>(p(),N(d,{key:_.key,class:$t({disabled:!_.addressbook.canDeleteCard}),index:b,source:_,"reload-bus":a.reloadBus,title:s.listItemTitle(_),"is-static":!0,"show-addressbook":!0},null,8,["class","index","source","reload-bus","title"]))),128))]),i.contacts.length>9?(p(),N(h,{key:4,variant:"secondary",onClick:o[2]||(o[2]=_=>a.showAllContacts=!a.showAllContacts)},{icon:S(()=>[A(u,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts",a.showAllContacts?"Show less":"Show all")),1)]),_:1})):R("",!0),I("div",tM,[i.mode==="group"?(p(),N(h,{key:0,variant:"primary",disabled:a.selectedGroups.length===0,onClick:s.submit},{icon:S(()=>[A(f,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Add")),1)]),_:1},8,["disabled","onClick"])):R("",!0),i.mode==="move"?(p(),N(h,{key:1,variant:"primary",disabled:!a.selectedAddressesBook,onClick:s.submit},{icon:S(()=>[A(v,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Move")),1)]),_:1},8,["disabled","onClick"])):R("",!0)])])}const nM=tt(jE,[["render",eM],["__scopeId","data-v-399ff982"]]),oM={name:"BadgeAccountOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},iM=["aria-hidden","aria-label"],rM=["fill","width","height"],aM={d:"M17,3H14V5H17V21H7V5H10V3H7A2,2 0 0,0 5,5V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V5A2,2 0 0,0 17,3M12,7A2,2 0 0,1 14,9A2,2 0 0,1 12,11A2,2 0 0,1 10,9A2,2 0 0,1 12,7M16,15H8V14C8,12.67 10.67,12 12,12C13.33,12 16,12.67 16,14V15M16,18H8V17H16V18M12,20H8V19H12V20M13,5H11V1H13V5Z"},sM={key:0};function lM(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 badge-account-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",aM,[i.title?(p(),w("title",sM,O(i.title),1)):R("",!0)])],8,rM))],16,iM)}const zu=tt(oM,[["render",lM]]),cM={name:"CheckCircleOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},dM=["aria-hidden","aria-label"],uM=["fill","width","height"],hM={d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z"},pM={key:0};function fM(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-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",hM,[i.title?(p(),w("title",pM,O(i.title),1)):R("",!0)])],8,uM))],16,dM)}const mM=tt(cM,[["render",fM]]),gM={name:"CloseCircleOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},yM=["aria-hidden","aria-label"],vM=["fill","width","height"],_M={d:"M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2C6.47,2 2,6.47 2,12C2,17.53 6.47,22 12,22C17.53,22 22,17.53 22,12C22,6.47 17.53,2 12,2M14.59,8L12,10.59L9.41,8L8,9.41L10.59,12L8,14.59L9.41,16L12,13.41L14.59,16L16,14.59L13.41,12L16,9.41L14.59,8Z"},bM={key:0};function CM(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-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",_M,[i.title?(p(),w("title",bM,O(i.title),1)):R("",!0)])],8,vM))],16,yM)}const kM=tt(gM,[["render",CM]]),wM={name:"DomainIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},SM=["aria-hidden","aria-label"],xM=["fill","width","height"],EM={d:"M18,15H16V17H18M18,11H16V13H18M20,19H12V17H14V15H12V13H14V11H12V9H20M10,7H8V5H10M10,11H8V9H10M10,15H8V13H10M10,19H8V17H10M6,7H4V5H6M6,11H4V9H6M6,15H4V13H6M6,19H4V17H6M12,7V3H2V21H22V7H12Z"},MM={key:0};function AM(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 domain-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",EM,[i.title?(p(),w("title",MM,O(i.title),1)):R("",!0)])],8,xM))],16,SM)}const Hu=tt(wM,[["render",AM]]),NM={name:"Merging",components:{ContactDetailsProperty:hh,NcCheckboxRadioSwitch:ba,IconCheckCircleOutline:mM,IconCloseCircleOutline:kM,IconSetMerge:Y1,NcNoteCard:ma,NcButton:Kt,IconDomain:Hu,IconAccount:Li,IconBadgeAccount:zu,NcSelect:io,NcLoadingIcon:Pe},props:{contacts:{type:Map,required:!0}},data(){return{bus:El(),resolvedConflicts:new Map,conflictsToResolve:0,sortedProperties:[],simpleProperties:["fn","org","title"],simplePropertyDescriptions:{fn:{description:this.t("contacts","Name"),icon:Li},org:{description:this.t("contacts","Company"),icon:Hu},title:{description:this.t("contacts","Title"),icon:zu}},chosenAddressBook:null,selectedGroups:[],isLoading:!1}},computed:{contactsList(){return Array.from(this.contacts.values()).map(e=>e)},dividedProperties(){const[e,o]=this.contactsList;if(!e||!o)return{};const i=this.sortProperties(e),r=this.sortProperties(o),a=this.groupedProperties(i),s=this.groupedProperties(r);return[a,s]},usedProperties(){const e=this.dividedProperties.flatMap(o=>Object.keys(o));return[...new Set(e)].filter(o=>{const i=this.dividedProperties[0][o]?this.dividedProperties[0][o].map(a=>this.getPropertyValue(a)):[],r=this.dividedProperties[1][o]?this.dividedProperties[1][o].map(a=>this.getPropertyValue(a)):[];return!i.every(a=>a==null||a==="")||!r.every(a=>a==null||a==="")})},conflictInformation(){const e={};return this.usedProperties.forEach(o=>{if((this.dividedProperties[0][o]??[]).every(i=>this.checkIfPropertyEmpty(i))){e[o]={type:"onlyInSecond",value:this.dividedProperties[1][o].map(i=>this.getPropertyValue(i))};return}if((this.dividedProperties[1][o]??[]).every(i=>this.checkIfPropertyEmpty(i))){e[o]={type:"onlyInFirst",value:this.dividedProperties[0][o].map(i=>this.getPropertyValue(i))};return}if(((i,r)=>i.length===r.length&&i.every((a,s)=>a===r[s]))((this.dividedProperties[0][o]??[]).map(i=>this.getPropertyValue(i)),(this.dividedProperties[1][o]??[]).map(i=>this.getPropertyValue(i)))){e[o]={type:"equal",value:this.dividedProperties[0][o].map(i=>this.getPropertyValue(i))};return}if(sn.properties[o]?.multiple===!0){e[o]={type:"conflictWithMultipleValues",value:null};return}e[o]={type:"conflict",value:null}}),e},addressBookSelect(){return{placeholder:this.t("contacts","Select address book"),options:[{id:0,label:this.contactsList[0].addressbook.displayName},{id:1,label:this.contactsList[1].addressbook.displayName}]}}},mounted(){this.calculateConflictsToResolve(),this.sortedProperties=this.sortUsedProperties(),this.contactsList[0].addressbook.id===this.contactsList[1].addressbook.id&&(this.chosenAddressBook={id:0,label:this.contactsList[0].addressbook.displayName}),this.selectedGroups=this.selectedGroups.concat(this.contactsList[0].groups),this.selectedGroups=this.selectedGroups.concat(this.contactsList[1].groups)},methods:{resolveConflict(e,o){e===this.resolvedConflicts.get(o)?this.resolvedConflicts.set(o,void 0):this.resolvedConflicts.set(o,e),this.$forceUpdate(),this.calculateConflictsToResolve()},resolveMultiConflict(e,o){if(this.resolvedConflicts.has(o)){const i=this.resolvedConflicts.get(o);i.has(e)?i.delete(e):i.add(e),this.resolvedConflicts.set(o,i)}else{const i=new Set;i.add(e),this.resolvedConflicts.set(o,i)}this.$forceUpdate(),this.calculateConflictsToResolve()},canDisplay(e){const o=sn.properties[e.name.split(".").pop()],i=o&&o.force?o.force:e.getDefaultType();return o&&i!=="unknown"},sortProperties(e){return e.properties.slice(0).sort((o,i)=>{const r=o.name.split(".").pop(),a=i.name.split(".").pop();return sn.fieldOrder.indexOf(r)-sn.fieldOrder.indexOf(a)})},groupedProperties(e){return e.reduce((o,i)=>!this.canDisplay(i)&&i.name!=="title"&&i.name!=="org"&&i.name!=="fn"?o:i.name==="bday"||i.name==="deathdate"||i.name==="anniversary"?(o.lifeEvents||(o.lifeEvents=[]),o.lifeEvents.push(i),o):(o[i.name]||(o[i.name]=[]),o[i.name].push(i),o),{})},calculateConflictsToResolve(){let e=0;this.usedProperties.forEach(o=>{this.conflictInformation[o]?.type==="conflict"&&this.resolvedConflicts.get(o)===void 0&&e++,this.conflictInformation[o]?.type==="conflictWithMultipleValues"&&!this.resolvedConflicts.get(o)?.size&&e++}),this.chosenAddressBook===null&&e++,this.conflictsToResolve=e},getPropertyValue(e){return e.isMultiValue?e.isStructuredValue?e.getValues()[0]:e.getValues():e.getFirstValue()},checkIfPropertyEmpty(e){if(e===void 0)return!0;const o=this.getPropertyValue(e);return o===""||o===null||Array.isArray(o)&&o.length===0?!0:Array.isArray(o)?o.every(i=>i===""||i===void 0):!1},sortUsedProperties(){return this.usedProperties.sort((e,o)=>{const i=this.conflictInformation[e]?.type,r=this.conflictInformation[o]?.type;return i==="conflict"&&r!=="conflict"?-1:r==="conflict"&&i!=="conflict"?1:0})},async mergeContacts(){this.isLoading=!0;const e=this.contactsList[0],o={};this.usedProperties.forEach(i=>{if(this.conflictInformation[i]?.type==="conflict"){const r=this.resolvedConflicts.get(i);r!==void 0&&(o[i]=[this.dividedProperties[r][i]])}else if(this.conflictInformation[i]?.type==="conflictWithMultipleValues"){const r=this.resolvedConflicts.get(i);r?.size&&(o[i]=Array.from(r).map(a=>this.dividedProperties[a][i]))}else this.conflictInformation[i]?.type==="onlyInSecond"?o[i]=[this.dividedProperties[1][i]]:o[i]=[this.dividedProperties[0][i]]}),this.usedProperties.forEach(i=>{o[i]!==void 0&&o[i].length>0&&o[i].flat().forEach((r,a)=>{a===0?e.vCard.updatePropertyWithValue(i,this.getPropertyValue(r)):e.vCard.addProperty(r)})}),e.groups=this.selectedGroups,e.addressbook=this.contactsList[this.chosenAddressBook.id].addressbook,await this.$store.dispatch("updateContact",e),await this.$store.dispatch("deleteContact",{contact:this.contactsList[1]}),this.$emit("finished",e)}}},TM={class:"merging"},IM={class:"merging__title"},OM={class:"merging-title__addressbooks"},LM={class:"merging__conflicts"},DM={key:0},PM={key:1,class:"simple-property"},RM={class:"simple-property__title"},BM={key:6,class:"merging-conflicts__filler"},$M={key:0},VM={key:1,class:"simple-property"},UM={class:"simple-property__title"},zM={key:2,class:"merging__groups"},HM={class:"merging__groups__header"},GM={class:"merging__actions"};function YM(e,o,i,r,a,s){const l=k("IconCloseCircleOutline"),c=k("NcSelect"),d=k("NcNoteCard"),u=k("IconCheckCircleOutline"),h=k("NcCheckboxRadioSwitch"),f=k("ContactDetailsProperty"),v=k("IconSetMerge"),_=k("NcLoadingIcon"),b=k("NcButton");return p(),w("div",TM,[I("div",IM,[I("h3",null,O(e.t("contacts","Confirm merging contacts")),1),I("div",OM,[a.chosenAddressBook===null?(p(),N(l,{key:0,size:20,class:"needs-action"})):R("",!0),A(c,ht(s.addressBookSelect,{modelValue:a.chosenAddressBook,"onUpdate:modelValue":[o[0]||(o[0]=C=>a.chosenAddressBook=C),s.calculateConflictsToResolve],disabled:s.contactsList[0].addressbook.id===s.contactsList[1].addressbook.id,title:e.t("contacts","Select address book")}),null,16,["modelValue","disabled","title","onUpdate:modelValue"])])]),a.conflictsToResolve?(p(),N(d,{key:0,type:"warning",text:e.t("contacts","The selected contacts have conflicting information. Choose which information to keep")},null,8,["text"])):(p(),N(d,{key:1,type:"success",text:e.t("contacts","Contacts can be merged")},null,8,["text"])),I("div",LM,[(p(!0),w(mt,null,Dt(a.sortedProperties,(C,D)=>(p(),w("div",{key:C,class:$t(["merging__conflicts__row",[{conflict:s.conflictInformation[C]?.type==="conflict"||s.conflictInformation[C]?.type==="conflictWithMultipleValues",last:D===a.sortedProperties.length-1}]])},[(s.conflictInformation[C]?.type!=="conflict"||a.resolvedConflicts.get(C)!==void 0)&&(s.conflictInformation[C]?.type!=="conflictWithMultipleValues"||a.resolvedConflicts.get(C)?.size)?(p(),N(u,{key:0,size:20})):R("",!0),s.conflictInformation[C]?.type==="conflict"&&a.resolvedConflicts.get(C)===void 0?(p(),N(l,{key:1,size:20,class:"needs-action"})):R("",!0),s.conflictInformation[C]?.type==="conflictWithMultipleValues"&&!a.resolvedConflicts.get(C)?.size?(p(),N(l,{key:2,size:20,class:"needs-action"})):R("",!0),s.conflictInformation[C]?.type==="conflict"?(p(),N(h,{key:3,"model-value":a.resolvedConflicts.get(C)===0,type:"radio","onUpdate:modelValue":L=>s.resolveConflict(0,C)},null,8,["model-value","onUpdate:modelValue"])):R("",!0),s.conflictInformation[C]?.type==="conflictWithMultipleValues"?(p(),N(h,{key:4,"model-value":a.resolvedConflicts.get(C)?.has(0),"onUpdate:modelValue":L=>s.resolveMultiConflict(0,C)},null,8,["model-value","onUpdate:modelValue"])):R("",!0),s.conflictInformation[C]?.type!=="onlyInSecond"?(p(),w("div",{key:5,class:$t(["merging__conflicts__property",[{"no-conflict":s.conflictInformation[C]?.type!=="conflict"&&s.conflictInformation[C]?.type!=="conflictWithMultipleValues"}]])},[a.simpleProperties.includes(C)?(p(),w("div",PM,[I("div",RM,[(p(),N(to(a.simplePropertyDescriptions[C]?.icon||"span"),{size:20})),I("h3",null,O(a.simplePropertyDescriptions[C]?.description||C),1)]),(p(!0),w(mt,null,Dt(s.dividedProperties[0][C],L=>(p(),w("span",{key:L.jCal},O(L.getFirstValue()),1))),128))])):(p(),w("div",DM,[(p(!0),w(mt,null,Dt(s.dividedProperties[0][C],(L,B)=>(p(),N(f,{key:L.jCal,"is-first-property":B===0,"is-last-property":!1,property:L,contact:s.contactsList[0],"local-contact":s.contactsList[0],contacts:i.contacts,bus:a.bus,"is-read-only":!0},null,8,["is-first-property","property","contact","local-contact","contacts","bus"]))),128))]))],2)):R("",!0),s.conflictInformation[C]?.type==="onlyInSecond"?(p(),w("div",BM)):R("",!0),s.conflictInformation[C]?.type==="conflict"?(p(),N(h,{key:7,"model-value":a.resolvedConflicts.get(C)===1,type:"radio","onUpdate:modelValue":L=>s.resolveConflict(1,C)},null,8,["model-value","onUpdate:modelValue"])):R("",!0),s.conflictInformation[C]?.type==="conflictWithMultipleValues"?(p(),N(h,{key:8,"model-value":a.resolvedConflicts.get(C)?.has(1),"onUpdate:modelValue":L=>s.resolveMultiConflict(1,C)},null,8,["model-value","onUpdate:modelValue"])):R("",!0),s.conflictInformation[C]?.type!=="onlyInFirst"?(p(),w("div",{key:9,class:$t(["merging__conflicts__property",[{"no-conflict":s.conflictInformation[C]?.type!=="conflict"&&s.conflictInformation[C]?.type!=="conflictWithMultipleValues"}]])},[a.simpleProperties.includes(C)?(p(),w("div",VM,[I("div",UM,[(p(),N(to(a.simplePropertyDescriptions[C]?.icon||"span"),{size:20})),I("h3",null,O(a.simplePropertyDescriptions[C]?.description||C),1)]),(p(!0),w(mt,null,Dt(s.dividedProperties[1][C],L=>(p(),w("span",{key:L.jCal},O(L.getFirstValue()),1))),128))])):(p(),w("div",$M,[(p(!0),w(mt,null,Dt(s.dividedProperties[1][C],(L,B)=>(p(),N(f,{key:L.jCal,"is-first-property":B===0,"is-last-property":!1,property:L,contact:s.contactsList[1],"local-contact":s.contactsList[1],contacts:i.contacts,bus:a.bus,"is-read-only":!0},null,8,["is-first-property","property","contact","local-contact","contacts","bus"]))),128))]))],2)):R("",!0)],2))),128))]),s.contactsList[0].groups.length||s.contactsList[1].groups.length?(p(),w("div",zM,[I("h4",HM,O(e.t("contacts","Groups")),1),A(c,{modelValue:a.selectedGroups,"onUpdate:modelValue":[o[1]||(o[1]=C=>a.selectedGroups=C),s.calculateConflictsToResolve],options:s.contactsList[0].groups.concat(s.contactsList[1].groups),multiple:!0,placeholder:e.t("contacts","Select groups to add the merged contact to"),disabled:!s.contactsList[0].groups.length&&!s.contactsList[1].groups.length},null,8,["modelValue","options","placeholder","disabled","onUpdate:modelValue"])])):R("",!0),I("div",GM,[A(b,{disabled:a.conflictsToResolve!==0,variant:"secondary",onClick:s.mergeContacts},{icon:S(()=>[a.isLoading?(p(),N(_,{key:1,size:20})):(p(),N(v,{key:0,size:20}))]),default:S(()=>[q(O(e.t("contacts","Merge contacts"))+" ",1)]),_:1},8,["disabled","onClick"])])])}const FM=tt(NM,[["render",YM],["__scopeId","data-v-ce442f2b"]]),XM={name:"ContactsList",components:{AppContentList:Jg,NcNoteCard:ma,VList:gp,NcButton:Kt,IconSelect:CE,IconDelete:Tn,IconSetMerge:Y1,IconAccountMultiple:no,IconBookAccount:fE,NcDialog:Tg,NcModal:On,Merging:FM,NcLoadingIcon:Pe,ContactsListItem:X1,Batch:nM,NcTextField:Rl},mixins:[ro],props:{list:{type:Array,required:!0},contacts:{type:Object,required:!0},searchQuery:{type:String,default:""},reloadBus:{type:Object,required:!0}},data(){return{query:"",multiSelectedContacts:new Map,refreshKey:0,showDeleteConfirmationDialog:!1,buttons:[{label:t("contacts","Cancel"),icon:aE,callback:()=>{this.showDeleteConfirmationDialog=!1}},{label:t("contacts","Delete"),type:"primary",icon:sE,callback:()=>{this.deleteAllMultiSelected()}}],lastToggledIndex:void 0,isMerging:!1,isMergingLoading:!1,isGrouping:!1,isMovingAddressbook:!1}},computed:{filteredList(){let e=this.list.filter(o=>this.matchSearch(this.contacts[o.key])).map(o=>this.contacts[o.key]);return e=e.filter(o=>o!==void 0),e.forEach((o,i)=>{o!==void 0&&(o.isMultiSelected=this.multiSelectedContacts.has(i))}),e},isMultiSelecting(){return this.multiSelectedContacts.size>0},readOnlyMultiSelectedCount(){let e=0;return this.multiSelectedContacts.forEach(o=>{o.addressbook.readOnly&&e++}),e},selectedEditable(){let e=0;return this.multiSelectedContacts.forEach(o=>{o.addressbook.canModifyCard&&e++}),e},selectedDeletable(){let e=0;return this.multiSelectedContacts.forEach(o=>{o.addressbook.canDeleteCard&&e++}),e},canModifyAnySelected(){return this.selectedEditable>0},canDeleteAnySelected(){return this.selectedDeletable>0},canMergeSelected(){return this.multiSelectedContacts.size===2&&this.selectedEditable===this.multiSelectedContacts.size},deleteActionTitle(){return this.canDeleteAnySelected?n("contacts","Delete {number} contact","Delete {number} contacts",this.multiSelectedContacts.size,{number:this.multiSelectedContacts.size}):t("contacts","Please select at least one editable contact to delete")},mergeActionTitle(){return this.areTwoEditable?t("contacts","Merge contacts"):t("contacts","Please select two editable contacts to merge")},groupActionTitle(){return this.canModifyAnySelected?n("contacts","Add {number} contact to group","Add {number} contacts to group",this.multiSelectedContacts.size,{number:this.multiSelectedContacts.size}):t("contacts","Please select at least one editable contact to add to a group")},moveActionTitle(){return this.canDeleteAnySelected?n("contacts","Move {number} contact to addressbook","Move {number} contacts to addressbook",this.multiSelectedContacts.size,{number:this.multiSelectedContacts.size}):t("contacts","Please select at least one editable contact to move to an addressbook")}},watch:{async selectedContact(e){e&&(await this.$nextTick(),this.scrollToContact(e))},list(e,o){e.length!==0&&o.length===0&&this.selectedContact&&this.$nextTick(()=>{this.scrollToContact(this.selectedContact)})}},mounted(){this.query=this.searchQuery},methods:{selectContact(e){if(this.list.length>0&&e<this.list.length){const o=e===0?this.list[e+1]:this.list[e-1];o&&this.$router.push({name:"contact",params:{selectedGroup:this.selectedGroup,selectedContact:o.key}})}},scrollToContact(e){const o=this.list.findIndex(l=>l.key===e);if(o===-1)return;const i=this.$refs.scroller,r=i.$el.getBoundingClientRect(),a=this.$el.querySelector("#"+e.slice(0,-2)),s=a?.getBoundingClientRect();if(!a||s.y<r.y)i.scrollToIndex(o);else if(a){const l=i.getItemSize(o),c=s.y+l-(this.$el.offsetHeight+50);c>0&&i.scrollTo(i.scrollOffset+c)}},matchSearch(e){if(this.query.trim()!=="")try{return e.searchData.toString().toLowerCase().search(this.query.trim().toLowerCase())!==-1}catch(o){if(o instanceof SyntaxError)return e.searchData.toString().toLowerCase().includes(this.query.trim().toLowerCase())}return!0},onSelectMultiple(e,o,i=!1){i&&this.lastToggledIndex!==o&&this.onSelectRange(o)||(this.multiSelectedContacts.has(o)?this.multiSelectedContacts.delete(o):this.multiSelectedContacts.set(o,e),this.lastToggledIndex=o,this.multiSelectedContacts=new Map(this.multiSelectedContacts))},onSelectRange(e){const o=this.lastToggledIndex??void 0;if(o===void 0)return!1;const i=Math.min(o,e),r=Math.max(o,e),a=this.multiSelectedContacts.has(e),s=new Map(this.multiSelectedContacts);for(let l=i;l<=r;l++)a?s.delete(l):s.set(l,this.filteredList[l]);return this.lastToggledIndex=e,this.multiSelectedContacts=s,!0},unselectAllMultiSelected(){this.multiSelectedContacts=new Map,this.lastToggledIndex=void 0},attemptDeleteAllMultiSelected(){this.showDeleteConfirmationDialog=!0},deleteAllMultiSelected(){this.multiSelectedContacts.forEach(async e=>{e.addressbook.readOnly||(await new Promise(o=>setTimeout(o,500)),await this.$store.dispatch("deleteContact",{contact:e}))}),this.unselectAllMultiSelected(),this.showDeleteConfirmationDialog=!1},async initiateContactMerging(){this.isMergingLoading=!0;const e=Array.from(this.multiSelectedContacts.values());for(const o of e)await this.$store.dispatch("fetchFullContact",{contact:o});this.isMergingLoading=!1,this.isMerging=!0},async finishContactMerging(e){await this.$store.dispatch("fetchFullContact",{contact:e,forceReFetch:!0}),this.unselectAllMultiSelected(),this.isMerging=!1,await this.$router.push({name:"root"})},async finishBatch(){if(this.isGrouping)for(const e of this.multiSelectedContacts.values())await this.$store.dispatch("fetchFullContact",{contact:e,forceReFetch:!0});this.isGrouping=!1,this.isMovingAddressbook=!1,this.unselectAllMultiSelected()}}},WM={class:"contacts-list__header"},jM={class:"search-contacts-field"},qM={key:0,class:"contacts-list__multiselect-header"};function ZM(e,o,i,r,a,s){const l=k("NcNoteCard"),c=k("NcDialog"),d=k("Merging"),u=k("NcModal"),h=k("Batch"),f=k("NcTextField"),v=k("IconSelect"),_=k("NcButton"),b=k("IconDelete"),C=k("IconSetMerge"),D=k("NcLoadingIcon"),L=k("IconAccountMultiple"),B=k("IconBookAccount"),X=k("ContactsListItem"),nt=k("VList"),Z=k("AppContentList");return p(),N(Z,{class:"content-list"},{default:S(()=>[A(c,{open:a.showDeleteConfirmationDialog,name:e.n("contacts","Delete {number} contact","Delete {number} contacts",a.multiSelectedContacts.size,{number:a.multiSelectedContacts.size}),buttons:a.buttons,"no-close":""},{default:S(()=>[q(O(e.t("contacts","Are you sure you want to proceed?"))+" ",1),s.readOnlyMultiSelectedCount?(p(),N(l,{key:0,variant:"info",text:e.n("contacts","Please note that {number} contact is read only and will not be deleted","Please note that {number} contacts are read only and will not be deleted",s.readOnlyMultiSelectedCount,{number:s.readOnlyMultiSelectedCount})},null,8,["text"])):R("",!0)]),_:1},8,["open","name","buttons"]),a.isMerging?(p(),N(u,{key:0,name:e.t("contacts","Merge contacts"),size:"large",onClose:o[0]||(o[0]=rt=>a.isMerging=!1)},{default:S(()=>[A(d,{contacts:a.multiSelectedContacts,onFinished:s.finishContactMerging},null,8,["contacts","onFinished"])]),_:1},8,["name"])):R("",!0),a.isGrouping?(p(),N(u,{key:1,name:e.t("contacts","Add contacts to group"),size:"large",onClose:o[1]||(o[1]=rt=>a.isGrouping=!1)},{default:S(()=>[A(h,{contacts:Array.from(a.multiSelectedContacts.values()),mode:"group",onSubmit:s.finishBatch},null,8,["contacts","onSubmit"])]),_:1},8,["name"])):R("",!0),a.isMovingAddressbook?(p(),N(u,{key:2,name:e.t("contacts","Move contacts to addressbook"),size:"large",onClose:o[2]||(o[2]=rt=>a.isMovingAddressbook=!1)},{default:S(()=>[A(h,{contacts:Array.from(a.multiSelectedContacts.values()),mode:"move",onSubmit:s.finishBatch},null,8,["contacts","onSubmit"])]),_:1},8,["name"])):R("",!0),I("div",WM,[I("div",jM,[A(f,{modelValue:a.query,"onUpdate:modelValue":o[3]||(o[3]=rt=>a.query=rt),label:e.t("contacts","Search contacts …"),"trailing-button-icon":"close","show-trailing-button":a.query!=="",onTrailingButtonClick:o[4]||(o[4]=rt=>a.query="")},null,8,["modelValue","label","show-trailing-button"])])]),A(mg,{name:"contacts-list__multiselect-header"},{default:S(()=>[s.isMultiSelecting?(p(),w("div",qM,[A(_,{variant:"tertiary",title:e.t("contacts","Unselect {number}",{number:a.multiSelectedContacts.size}),"close-after-click":!0,onClick:Zt(s.unselectAllMultiSelected,["prevent"])},{default:S(()=>[A(v,{size:16})]),_:1},8,["title","onClick"]),A(_,{variant:"tertiary",disabled:!s.canDeleteAnySelected,title:s.deleteActionTitle,"close-after-click":!0,onClick:Zt(s.attemptDeleteAllMultiSelected,["prevent"])},{default:S(()=>[A(b,{size:16})]),_:1},8,["disabled","title","onClick"]),a.isMergingLoading?(p(),N(D,{key:1,size:20})):(p(),N(_,{key:0,variant:"tertiary",disabled:!s.canMergeSelected,title:s.mergeActionTitle,"close-after-click":!0,onClick:Zt(s.initiateContactMerging,["prevent"])},{default:S(()=>[A(C,{size:20})]),_:1},8,["disabled","title","onClick"])),A(_,{variant:"tertiary",title:s.groupActionTitle,disabled:!s.canModifyAnySelected,"close-after-click":!0,onClick:o[5]||(o[5]=Zt(rt=>a.isGrouping=!0,["prevent"]))},{default:S(()=>[A(L,{size:20})]),_:1},8,["title","disabled"]),A(_,{variant:"tertiary",title:s.moveActionTitle,disabled:!s.canDeleteAnySelected,"close-after-click":!0,onClick:o[6]||(o[6]=Zt(rt=>a.isMovingAddressbook=!0,["prevent"]))},{default:S(()=>[A(B,{size:20})]),_:1},8,["title","disabled"])])):R("",!0)]),_:1}),A(nt,{ref:"scroller",class:"contacts-list",data:s.filteredList},{default:S(({item:rt,index:st})=>[(p(),N(X,{key:rt.key,index:st,source:rt,"reload-bus":i.reloadBus,"on-select-multiple-from-parent":s.onSelectMultiple},null,8,["index","source","reload-bus","on-select-multiple-from-parent"]))]),_:1},8,["data"])]),_:1})}const JM=tt(XM,[["render",ZM],["__scopeId","data-v-aad1535b"]]),KM={name:"ContactsContent",components:{AppContent:Pl,NcButton:Kt,ContactDetails:rE,ContactsList:JM,EmptyContent:Qn,IconContact:no,IconLoading:Pe},mixins:[ro],props:{loading:{type:Boolean,default:!0},contactsList:{type:Array,required:!0}},data(){return{searchQuery:"",reloadBus:El()}},computed:{contacts(){return this.$store.getters.getContacts},groups(){return this.$store.getters.getGroups},sortedContacts(){return this.$store.getters.getSortedContacts},isRealGroup(){return this.groups.findIndex(e=>e.name===this.selectedGroup)>-1},isEmptyGroup(){return this.contactsList.length===0},showDetails(){return!!this.selectedContact}},methods:{addContactsToGroup(e){Zo("contacts:group:append",e)},newContact(){this.$emit("new-contact")},hideDetails(){this.$router.push({name:"group",params:{selectedGroup:this.selectedGroup}})}}};function QM(e,o,i,r,a,s){const l=k("IconLoading"),c=k("EmptyContent"),d=k("AppContent"),u=k("IconContact"),h=k("NcButton"),f=k("ContactsList"),v=k("ContactDetails");return i.loading?(p(),N(d,{key:0},{default:S(()=>[A(c,{class:"empty-content",name:e.t("contacts","Loading contacts …")},{icon:S(()=>[A(l,{size:20})]),_:1},8,["name"])]),_:1})):s.isEmptyGroup&&!s.isRealGroup?(p(),N(d,{key:1},{default:S(()=>[A(c,{class:"empty-content",name:e.t("contacts","There are no contacts yet")},{icon:S(()=>[A(u,{size:20})]),desc:S(()=>[A(h,{variant:"primary",onClick:s.newContact},{default:S(()=>[q(O(e.t("contacts","Create contact")),1)]),_:1},8,["onClick"])]),_:1},8,["name"])]),_:1})):s.isEmptyGroup&&s.isRealGroup?(p(),N(d,{key:2},{default:S(()=>[A(c,{class:"empty-content",name:e.t("contacts","There are no contacts in this group")},{icon:S(()=>[A(u,{size:20})]),desc:S(()=>[s.contacts.length===0?(p(),N(h,{key:0,variant:"primary",onClick:o[0]||(o[0]=_=>s.addContactsToGroup(e.selectedGroup))},{default:S(()=>[q(O(e.t("contacts","Create contacts")),1)]),_:1})):(p(),N(h,{key:1,variant:"primary",onClick:o[1]||(o[1]=_=>s.addContactsToGroup(e.selectedGroup))},{default:S(()=>[q(O(e.t("contacts","Add contacts")),1)]),_:1}))]),_:1},8,["name"])]),_:1})):(p(),N(d,{key:3,"show-details":s.showDetails,"onUpdate:showDetails":s.hideDetails},{list:S(()=>[A(f,{list:i.contactsList,contacts:s.contacts,"search-query":a.searchQuery,"reload-bus":a.reloadBus},null,8,["list","contacts","search-query","reload-bus"])]),default:S(()=>[A(v,{"contact-key":e.selectedContact,contacts:s.sortedContacts,"reload-bus":a.reloadBus},null,8,["contact-key","contacts","reload-bus"])]),_:1},8,["show-details","onUpdate:showDetails"]))}const tA=tt(KM,[["render",QM],["__scopeId","data-v-493f9834"]]),eA={name:"AccountIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},nA=["aria-hidden","aria-label"],oA=["fill","width","height"],iA={d:"M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"},rA={key:0};function aA(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-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",iA,[i.title?(p(),w("title",rA,O(i.title),1)):R("",!0)])],8,oA))],16,nA)}const sA=tt(eA,[["render",aA]]),lA={name:"AccountMultipleIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},cA=["aria-hidden","aria-label"],dA=["fill","width","height"],uA={d:"M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"},hA={key:0};function pA(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-multiple-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",uA,[i.title?(p(),w("title",hA,O(i.title),1)):R("",!0)])],8,dA))],16,cA)}const j1=tt(lA,[["render",pA]]),fA={name:"AlertCircleOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},mA=["aria-hidden","aria-label"],gA=["fill","width","height"],yA={d:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z"},vA={key:0};function _A(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 alert-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",yA,[i.title?(p(),w("title",vA,O(i.title),1)):R("",!0)])],8,gA))],16,mA)}const q1=tt(fA,[["render",_A]]),bA={name:"NewCircleIntro",components:{CheckboxRadioSwitch:ba,Modal:On},props:{loading:{type:Boolean,default:!1}},data(){return{circleName:"",isPersonal:!1,isLocal:!1,CIRCLE_DESC:ph}},computed:{isEmptyName(){return this.circleName.trim()===""},isGlobalScale(){return Ig().circles?.status?.globalScale!==!1}},mounted(){this.$nextTick(()=>{this.$refs.input.focus(),this.$refs.input.select()})},methods:{onCancel(){this.$emit("close")},onSubmit(){this.$emit("submit",this.circleName,this.isPersonal,this.isLocal)}}},CA={class:"entity-picker"},kA={class:"entity-picker__new"},wA=["placeholder"],SA={class:"entity-picker__content"},xA={class:"entity-picker__navigation"},EA=["disabled"],MA=["disabled"];function AA(e,o,i,r,a,s){const l=k("CheckboxRadioSwitch"),c=k("Modal");return p(),N(c,{size:"normal",onClose:s.onCancel},{default:S(()=>[I("div",CA,[I("div",kA,[Ve(I("input",{ref:"input","onUpdate:modelValue":o[0]||(o[0]=d=>a.circleName=d),placeholder:e.t("contacts","New team name"),class:"entity-picker__new-input",type:"text",onKeypress:o[1]||(o[1]=Al((...d)=>s.onSubmit&&s.onSubmit(...d),["enter"]))},null,40,wA),[[zo,a.circleName]])]),I("div",SA,[I("p",null,O(a.CIRCLE_DESC),1),o[6]||(o[6]=I("br",null,null,-1)),R("",!0),s.isGlobalScale?(p(),w(mt,{key:1},[A(l,{"model-value":a.isLocal,"onUpdate:modelValue":o[3]||(o[3]=d=>a.isLocal=d),disabled:i.loading!==!1},{default:S(()=>[q(O(e.t("contacts","Local team")),1)]),_:1},8,["model-value","disabled"]),I("p",null,O(e.t("contacts","This team will not be shared with the other instances of the global scale")),1)],64)):R("",!0)]),I("div",xA,[I("button",{disabled:i.loading,class:"navigation__button-left",onClick:o[4]||(o[4]=(...d)=>s.onCancel&&s.onCancel(...d))},O(e.t("contacts","Cancel")),9,EA),I("button",{disabled:s.isEmptyName||i.loading,class:"navigation__button-right primary",onClick:o[5]||(o[5]=(...d)=>s.onSubmit&&s.onSubmit(...d))},O(e.t("contacts","Create team")),9,MA)])])]),_:1},8,["onClose"])}const NA=tt(bA,[["render",AA],["__scopeId","data-v-877bbfbf"]]),TA={name:"IconRecentlyContacted",props:{title:{type:String,default:""},size:{type:Number,default:20},fillColor:{type:String,default:"currentColor"}}},IA=["aria-hidden","aria-label"],OA=["fill","width","height"];function LA(e,o,i,r,a,s){return p(),w("span",{"aria-hidden":!i.title,"aria-label":i.title,class:"material-design-icon icon-recently-contacted",role:"img"},[(p(),w("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 16 16"},[...o[0]||(o[0]=[I("path",{d:"M0 0h24v24H0V0z",fill:"none"},null,-1),I("path",{d:"M14 3v10h1V3zM12 13h1V3h-1zM1.7 3a.7.7 0 00-.7.7v8.6c0 .4.3.7.7.7h8.6c.4 0 .7-.3.7-.7V3.7a.7.7 0 00-.7-.7zM6 5a1.6 1.6 0 010 3.2A1.6 1.6 0 016 5zm0 4.4c1 0 3.2.6 3.2 1.6v.6H2.8V11c0-1 2.1-1.6 3.2-1.6z"},null,-1)])],8,OA))],8,IA)}const DA=tt(TA,[["render",LA]]),PA={name:"AccountStarOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},RA=["aria-hidden","aria-label"],BA=["fill","width","height"],$A={d:"M15,4A4,4 0 0,1 19,8A4,4 0 0,1 15,12A4,4 0 0,1 11,8A4,4 0 0,1 15,4M15,5.9A2.1,2.1 0 0,0 12.9,8A2.1,2.1 0 0,0 15,10.1C16.16,10.1 17.1,9.16 17.1,8C17.1,6.84 16.16,5.9 15,5.9M15,13C17.67,13 23,14.33 23,17V20H7V17C7,14.33 12.33,13 15,13M15,14.9C12,14.9 8.9,16.36 8.9,17V18.1H21.1V17C21.1,16.36 17.97,14.9 15,14.9M5,13.28L2.5,14.77L3.18,11.96L1,10.08L3.87,9.83L5,7.19L6.11,9.83L9,10.08L6.8,11.96L7.45,14.77L5,13.28Z"},VA={key:0};function UA(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-star-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",$A,[i.title?(p(),w("title",VA,O(i.title),1)):R("",!0)])],8,BA))],16,RA)}const zA=tt(PA,[["render",UA]]),HA={name:"LocationEnterIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},GA=["aria-hidden","aria-label"],YA=["fill","width","height"],FA={d:"M14 12L10 8V11H2V13H10V16M22 12A10 10 0 0 1 2.46 15H4.59A8 8 0 1 0 4.59 9H2.46A10 10 0 0 1 22 12Z"},XA={key:0};function WA(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 location-enter-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",FA,[i.title?(p(),w("title",XA,O(i.title),1)):R("",!0)])],8,YA))],16,GA)}const jA=tt(HA,[["render",WA]]),qA={name:"CircleNavigationItem",components:{ActionButton:Ln,ActionLink:Ca,ActionText:Bl,NcCounterBubble:ka,AppNavigationItem:$l,ExitToApp:vp,IconCog:Jl,IconDelete:Tn,LocationEnter:jA,AccountStar:zA,AccountGroupOutline:Ea,IconLoading:Pe},mixins:[bp],props:{circle:{type:[lh,ec],required:!0}},computed:{memberCount(){const e=Object.keys(this.circle?.members||[]).length;return e===0&&this.circle.population>0?this.circle.population:e}}};function ZA(e,o,i,r,a,s){const l=k("AccountStar"),c=k("AccountGroupOutline"),d=k("IconLoading"),u=k("ActionText"),h=k("IconCog"),f=k("ActionButton"),v=k("ActionLink"),_=k("ExitToApp"),b=k("LocationEnter"),C=k("IconDelete"),D=k("NcCounterBubble"),L=k("AppNavigationItem");return p(),N(L,{key:i.circle.key,name:i.circle.displayName,to:i.circle.router},{icon:S(()=>[i.circle.isOwner?(p(),N(l,{key:0,size:20})):(p(),N(c,{key:1,size:20}))]),actions:S(()=>[e.loadingAction?(p(),N(u,{key:0},{icon:S(()=>[A(d,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Loading …")),1)]),_:1})):(p(),w(mt,{key:1},[i.circle.canManageMembers?(p(),N(f,{key:0,"close-after-click":!0,onClick:e.addMemberToCircle},{icon:S(()=>[A(h,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Manage team")),1)]),_:1},8,["onClick"])):R("",!0),A(v,{href:e.circleUrl,icon:e.copyLinkIcon,onClick:o[0]||(o[0]=Zt(B=>e.copyToClipboard(e.circleUrl),["stop","prevent"]))},{default:S(()=>[q(O(e.copyButtonText),1)]),_:1},8,["href","icon"]),i.circle.canLeave?(p(),N(f,{key:1,onClick:e.confirmLeaveCircle},{icon:S(()=>[A(_,{size:16})]),default:S(()=>[q(O(e.t("contacts","Leave team"))+" ",1)]),_:1},8,["onClick"])):!i.circle.isMember&&i.circle.canJoin?(p(),N(f,{key:2,disabled:e.loadingJoin,onClick:e.joinCircle},{icon:S(()=>[A(b,{size:16})]),default:S(()=>[q(O(e.joinButtonTitle)+" ",1)]),_:1},8,["disabled","onClick"])):R("",!0),i.circle.canDelete?(p(),N(f,{key:3,onClick:e.confirmDeleteCircle},{icon:S(()=>[A(C,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Delete team")),1)]),_:1},8,["onClick"])):R("",!0)],64))]),counter:S(()=>[s.memberCount>0?(p(),N(D,{key:0,count:s.memberCount},null,8,["count"])):R("",!0)]),_:1},8,["name","to"])}const JA=tt(qA,[["render",ZA]]),KA={name:"ShareVariantOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},QA=["aria-hidden","aria-label"],tN=["fill","width","height"],eN={d:"M18 16.08C17.24 16.08 16.56 16.38 16.04 16.85L8.91 12.7C8.96 12.47 9 12.24 9 12S8.96 11.53 8.91 11.3L15.96 7.19C16.5 7.69 17.21 8 18 8C19.66 8 21 6.66 21 5S19.66 2 18 2 15 3.34 15 5C15 5.24 15.04 5.47 15.09 5.7L8.04 9.81C7.5 9.31 6.79 9 6 9C4.34 9 3 10.34 3 12S4.34 15 6 15C6.79 15 7.5 14.69 8.04 14.19L15.16 18.34C15.11 18.55 15.08 18.77 15.08 19C15.08 20.61 16.39 21.91 18 21.91S20.92 20.61 20.92 19C20.92 17.39 19.61 16.08 18 16.08M18 4C18.55 4 19 4.45 19 5S18.55 6 18 6 17 5.55 17 5 17.45 4 18 4M6 13C5.45 13 5 12.55 5 12S5.45 11 6 11 7 11.45 7 12 6.55 13 6 13M18 20C17.45 20 17 19.55 17 19S17.45 18 18 18 19 18.45 19 19 18.55 20 18 20Z"},nN={key:0};function oN(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 share-variant-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",eN,[i.title?(p(),w("title",nN,O(i.title),1)):R("",!0)])],8,tN))],16,QA)}const iN=tt(KA,[["render",oN]]),rN={name:"SettingsAddressbookSharee",components:{NcButton:Kt,IconDelete:Tn,IconGroup:no,IconLoading:Pe,IconUser:Li},props:{addressbook:{type:Object,required:!0},sharee:{type:Object,required:!0}},data(){return{loading:!1}},computed:{writeable(){return this.sharee.writeable},uid(){return this.sharee.id+this.addressbook.id+Math.floor(Math.random()*1e3)}},methods:{async deleteSharee(){if(this.loading)return!1;this.loading=!0;try{await this.$store.dispatch("removeSharee",{addressbook:this.addressbook,uri:this.sharee.uri})}catch(e){console.error(e),yt(t("contacts","Unable to delete the share"))}finally{this.loading=!1}},async editSharee(){if(this.loading)return!1;this.loading=!0;try{await this.$store.dispatch("toggleShareeWritable",{addressbook:this.addressbook,uri:this.sharee.uri,writeable:!this.sharee.writeable})}catch(e){console.error(e),yt(t("contacts","Unable to change permissions"))}finally{this.loading=!1}}}},aN={class:"addressbook-sharee"},sN=["title"],lN={class:"addressbook-sharee__utils"},cN=["id","checked","disabled"],dN=["for","title"];function uN(e,o,i,r,a,s){const l=k("IconLoading"),c=k("IconGroup"),d=k("IconUser"),u=k("IconDelete"),h=k("NcButton");return p(),w("li",aN,[a.loading?(p(),N(l,{key:0,size:20})):i.sharee.isGroup&&!a.loading?(p(),N(c,{key:1})):!i.sharee.isGroup&&!a.loading?(p(),N(d,{key:2})):R("",!0),I("span",{class:"addressbook-sharee__identifier",title:i.sharee.displayName},O(i.sharee.displayName),9,sN),I("span",lN,[I("input",{id:s.uid,checked:s.writeable,disabled:a.loading,class:"checkbox",name:"editable",type:"checkbox",onChange:o[0]||(o[0]=(...f)=>s.editSharee&&s.editSharee(...f))},null,40,cN),I("label",{for:s.uid,title:e.t("contacts","can edit")},O(e.t("contacts","can edit")),9,dN),A(h,{class:$t({"addressbook-sharee__utils--disabled":a.loading}),href:"#",title:"Delete",onClick:s.deleteSharee},{icon:S(()=>[A(u,{size:20})]),_:1},8,["class","onClick"])])])}const hN=tt(rN,[["render",uN],["__scopeId","data-v-b0bb8c65"]]),Gu=wo("contacts","isGroupSharingEnabled",!1);function Yu(e){return decodeURIComponent(e.replace(/\+/g," "))}const pN={name:"SettingsAddressbookShare",components:{NcSelectUsers:J0,AddressBookSharee:hN},props:{addressbook:{type:Object,default(){return{}}}},data(){return{isLoading:!1,inputGiven:!1,usersOrGroups:[]}},computed:{placeholder(){return Gu?t("contacts","Share with users or groups"):t("contacts","Share with users")},noResult(){return t("contacts","No users or groups")}},mounted(){document.getElementById("users-groups-search").focus()},methods:{shareAddressbook({user:e,displayName:o,uri:i,isGroup:r}){this.$store.dispatch("shareAddressbook",{addressbook:this.addressbook,user:e,displayName:o,uri:i,isGroup:r})},findSharee:Mh(async function(e){if(this.isLoading=!0,this.usersOrGroups=[],e.length>0){const o=await Cr.principalPropertySearchByDisplayname(e);this.usersOrGroups=o.filter(i=>{const r=["INDIVIDUAL"];return Gu&&r.push("GROUP"),r.includes(i.calendarUserType)&&!this.addressbook.shares.some(a=>a.uri===i.principalScheme)}).map(i=>{const r=i.calendarUserType==="GROUP";return{user:Yu(i[r?"groupId":"userId"]),displayName:i.displayname,icon:r?"icon-group":"icon-user",uri:Yu(i.principalScheme),isGroup:r}}),this.isLoading=!1,this.inputGiven=!0}else this.inputGiven=!1,this.isLoading=!1},500)}},fN={class:"addressbook-shares"},mN={key:0,class:"addressbook-shares__list"};function gN(e,o,i,r,a,s){const l=k("NcSelectUsers"),c=k("AddressBookSharee");return p(),w("div",fN,[A(l,{id:"users-groups-search",options:a.usersOrGroups,searchable:!0,"internal-search":!1,"max-height":600,"show-no-results":!0,placeholder:s.placeholder,class:$t({showContent:a.inputGiven,"icon-loading":a.isLoading}),"get-option-key":d=>d.user,"open-direction":"bottom",label:"displayName",onSearch:s.findSharee,"onUpdate:modelValue":s.shareAddressbook},null,8,["options","placeholder","class","get-option-key","onSearch","onUpdate:modelValue"]),i.addressbook.shares.length>0?(p(),w("ul",mN,[(p(!0),w(mt,null,Dt(i.addressbook.shares,d=>(p(),N(c,{key:d.uri,sharee:d,addressbook:i.addressbook},null,8,["sharee","addressbook"]))),128))])):R("",!0)])}const yN=tt(pN,[["render",gN],["__scopeId","data-v-e6862b5a"]]),vN={name:"SettingsAddressbook",components:{ActionButton:Ln,ActionCheckbox:Vm,ActionInput:Vl,ActionLink:Ca,Actions:oo,NcButton:Kt,IconDelete:Tn,IconDownload:Aa,IconRename:kl,IconContactPlus:F1,IconShare:iN,IconLoading:Pe,ShareAddressBook:yN},mixins:[tc],props:{addressbook:{type:Object,default(){return{}}}},data(){return{deleteAddressbookLoading:!1,editingName:!1,menuOpen:!1,renameLoading:!1,shareOpen:!1,toggleEnabledLoading:!1}},computed:{enabled(){return this.addressbook.enabled},hasShares(){return this.addressbook.shares.length>0},addressbooks(){return this.$store.getters.getAddressbooks},hasMultipleAddressbooks(){return this.addressbooks.length>1},sharedWithTooltip(){return this.hasShares?n("contacts","Shared with {num} entity","Shared with {num} entities",this.addressbook.shares.length,{num:this.addressbook.shares.length}):""},copyNcButtonText(){return this.copied?this.copySuccess?t("contacts","Copied"):t("contacts","Cannot copy"):t("contacts","Copy link")},addressbookUrl(){return window.location.origin+this.addressbook.url},contacts(){return Object.values(this.addressbook.contacts)},groups(){const e=this.contacts.flatMap(o=>o.vCard.getAllProperties("categories").map(i=>i.getFirstValue()));return[...new Set(e)]},contactsCount(){return this.contacts.length},groupsCount(){return this.groups.length},principalUrl(){return fh().currentUserPrincipal.principalUrl},isSharedWithMe(){return this.addressbook.owner!==this.principalUrl}},watch:{menuOpen(){this.menuOpen===!1&&(this.editingName=!1)}},mounted(){this.popupItem=this.$el},methods:{closeMenu(){this.menuOpen=!1},toggleMenu(){this.menuOpen=!this.menuOpen},toggleShare(){this.shareOpen=!this.shareOpen},async toggleAddressbookEnabled(){this.toggleEnabledLoading=!0;try{await this.$store.dispatch("toggleAddressbookEnabled",this.addressbook)}catch(e){console.error(e),yt(t("contacts","Toggling of address book was not successful"))}finally{this.toggleEnabledLoading=!1}},confirmDeletion(){window.OC.dialogs.confirm(t("contacts","This will delete the address book and every contacts within it"),t("contacts","Delete {addressbook}?",{addressbook:this.addressbook.displayName}),this.deleteAddressbook,!0)},confirmUnshare(){window.OC.dialogs.confirm(t("contacts","This will unshare the address book and every contacts within it"),t("contacts","Unshare {addressbook}?",{addressbook:this.addressbook.displayName}),this.deleteAddressbook,!0)},async deleteAddressbook(e){if(e){this.deleteAddressbookLoading=!0;try{await this.$store.dispatch("deleteAddressbook",this.addressbook)}catch(o){console.error(o),yt(t("contacts","Deletion of address book was not successful."))}finally{this.deleteAddressbookLoading=!1}}},renameAddressbook(){this.editingName=!0},async updateAddressbookName(){const e=this.addressbook,o=this.$refs.renameInput.$el.querySelector('input[type="text"]').value;this.renameLoading=!0;try{await this.$store.dispatch("renameAddressbook",{addressbook:e,newName:o})}catch(i){console.error(i),yt(t("contacts","Renaming of address book was not successful."))}finally{this.editingName=!1,this.renameLoading=!1,this.menuOpen=!1}}}},_N={class:"settings-addressbook-list"},bN={class:"addressbook__content"},CN=["title"],kN={key:0,class:"addressbook__description"},wN={key:1,class:"addressbook__count-wrapper"},SN={class:"addressbook__count"},xN={class:"addressbook__count"};function EN(e,o,i,r,a,s){const l=k("IconContactPlus"),c=k("IconShare"),d=k("NcButton"),u=k("ActionLink"),h=k("IconDownload"),f=k("ActionCheckbox"),v=k("IconLoading"),_=k("ActionButton"),b=k("IconRename"),C=k("ActionInput"),D=k("IconDelete"),L=k("Actions"),B=k("ShareAddressBook"),X=xh("tooltip");return p(),w("div",_N,[A(l,{class:"settings-line__icon"}),I("li",{class:$t([{"addressbook--disabled":!i.addressbook.enabled},"addressbook"])},[I("div",bN,[I("span",{class:"addressbook__name",title:i.addressbook.displayName},O(i.addressbook.enabled?i.addressbook.displayName:e.t("contacts","{addressbookname} (Hidden)",{addressbookname:i.addressbook.displayName})),9,CN),i.addressbook.dav.description?(p(),w("div",kN,O(i.addressbook.dav.description),1)):R("",!0),i.addressbook.enabled?(p(),w("div",wN,[I("span",SN,O(e.n("contacts","%n contact","%n contacts",s.contactsCount)),1),I("span",xN,"- "+O(e.n("contacts","%n group","%n groups",s.groupsCount)),1)])):R("",!0)]),!i.addressbook.readOnly&&!s.isSharedWithMe?Ve((p(),N(d,{key:0,class:$t([{"addressbook__share--shared":s.hasShares},"addressbook__share"]),name:s.sharedWithTooltip,href:"#",onClick:s.toggleShare},{icon:S(()=>[A(c,{size:20})]),_:1},8,["class","name","onClick"])),[[X,s.sharedWithTooltip,void 0,{top:!0}]]):R("",!0),A(L,{class:"addressbook__menu","menu-align":"right"},{default:S(()=>[A(u,{href:i.addressbook.url,icon:e.copyLinkIcon,onClick:o[0]||(o[0]=Zt(nt=>e.copyToClipboard(s.addressbookUrl),["stop","prevent"]))},{default:S(()=>[q(O(s.copyNcButtonText),1)]),_:1},8,["href","icon"]),A(u,{href:i.addressbook.url+"?export"},{icon:S(()=>[A(h,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Download")),1)]),_:1},8,["href"]),i.addressbook.writeProps?(p(),w(mt,{key:0},[a.toggleEnabledLoading?(p(),N(_,{key:1},{icon:S(()=>[A(v,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Show")),1)]),_:1})):(p(),N(f,{key:0,"model-value":s.enabled,"onUpdate:modelValue":s.toggleAddressbookEnabled},{default:S(()=>[q(O(e.t("contacts","Show")),1)]),_:1},8,["model-value","onUpdate:modelValue"]))],64)):R("",!0),i.addressbook.readOnly?R("",!0):(p(),w(mt,{key:1},[a.editingName?(p(),N(C,{key:1,ref:"renameInput",disabled:a.renameLoading,value:i.addressbook.displayName,onSubmit:s.updateAddressbookName},{icon:S(()=>[a.renameLoading?(p(),N(v,{key:0,size:20})):R("",!0),A(b,{size:20})]),_:1},8,["disabled","value","onSubmit"])):(p(),N(_,{key:0,onClick:Zt(s.renameAddressbook,["stop","prevent"])},{icon:S(()=>[A(b,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Rename")),1)]),_:1},8,["onClick"]))],64)),s.hasMultipleAddressbooks&&i.addressbook.owner!==s.principalUrl&&i.addressbook.owner!=="/remote.php/dav/principals/system/system/"?(p(),N(_,{key:2,onClick:s.confirmUnshare},{icon:S(()=>[a.deleteAddressbookLoading?(p(),N(v,{key:0,size:20})):R("",!0),A(D,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Unshare from me")),1)]),_:1},8,["onClick"])):s.hasMultipleAddressbooks&&i.addressbook.owner!=="/remote.php/dav/principals/system/system/"?(p(),N(_,{key:3,onClick:s.confirmDeletion},{icon:S(()=>[a.deleteAddressbookLoading?(p(),N(v,{key:0,size:20})):R("",!0),A(D,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Delete")),1)]),_:1},8,["onClick"])):R("",!0)]),_:1}),a.shareOpen&&!i.addressbook.readOnly?(p(),N(B,{key:1,addressbook:i.addressbook},null,8,["addressbook"])):R("",!0)],2)])}const MN=tt(vN,[["render",EN],["__scopeId","data-v-5f111cbd"]]),AN=ie.CancelToken,NN=dh(t("contacts","Choose a vCard file to import")).setMultiSelect(!1).setType(1).allowDirectories(!1).addMimeTypeFilter("text/vcard").build(),TN={name:"SettingsImportContacts",components:{NcButton:Kt,Modal:On,NcSelect:io,IconUpload:G1,IconError:q1,IconFolder:Kl,IconLoading:Pe},data(){return{cancelRequest:()=>{},importDestination:!1,isOpened:!1,loading:!1}},computed:{addressbooks(){return this.$store.getters.getAddressbooks},availableAddressbooks(){return this.addressbooks.filter(e=>!e.readOnly&&e.enabled)},options(){return this.availableAddressbooks.map(e=>({id:e.id,displayName:e.displayName}))},selectedAddressbook:{get(){return this.importDestination?this.availableAddressbooks.find(e=>e.id===this.importDestination.id):this.availableAddressbooks[0]},set(e){this.importDestination=e}},selectedAddressbookOption:{get(){return this.options.find(e=>e.id===this.selectedAddressbook.id)},set(e){this.selectedAddressbook=this.availableAddressbooks.find(o=>o.id===e.id)}},isSingleAddressbook(){return this.options.length===1},isNoAddressbookAvailable(){return this.options.length<1},importState(){return this.$store.getters.getImportState},isImporting(){return this.importState.stage!=="default"}},async mounted(){if(this.$route.name==="import"){const e=this.$route.query.file;await this.processLocalFile(e),this.$router.push({name:"group",params:{selectedGroup:t("contacts","All contacts")}})}},methods:{processFile(e){this.loading=!0,this.$store.dispatch("changeStage","parsing");const o=e.target.files[0],i=new FileReader,r=this.selectedAddressbook;this.$store.dispatch("setAddressbook",r.displayName),i.onload=()=>{this.isOpened=!1,this.$store.dispatch("importContactsIntoAddressbook",{vcf:i.result,addressbook:r}),e.target.value="",this.resetState()},i.readAsText(o)},async processLocalFile(e){console.debug("Importing",e);try{this.cancelRequest();const o=AN.source();this.cancelRequest=o.cancel;const i=await ie.get(Sh(`dav/files/${ya().uid}`)+Og(e),{cancelToken:o.token}),r=this.selectedAddressbook;this.$store.dispatch("changeStage","parsing"),this.$store.dispatch("setAddressbook",r.displayName),i.data&&await this.$store.dispatch("importContactsIntoAddressbook",{vcf:i.data,addressbook:r})}catch(o){console.error("Something wrong happened while processing local file",o)}},toggleModal(){this.isOpened=!this.isOpened,this.isOpened||this.cancelRequest()},clickImportInput(){this.$refs["contact-import-input"].click()},async openPicker(){try{this.cancelRequest();const e=await NN.pick();e&&(this.loading=!0,await this.processLocalFile(e)),this.resetState()}catch(e){this.loading=!1,console.error("Something wrong happened while picking a file",e)}},resetState(){this.cancelRequest=()=>{},this.importDestination=!1,this.isOpened=!1,this.loading=!1}}},IN={class:"import-contact"},ON={class:"import-contact__modal-addressbook"},LN={class:"import-contact__modal-pick"},DN=["disabled"];function PN(e,o,i,r,a,s){const l=k("IconUpload"),c=k("NcButton"),d=k("NcSelect"),u=k("IconLoading"),h=k("IconFolder"),f=k("Modal"),v=k("IconError");return p(),w("div",IN,[s.isNoAddressbookAvailable?(p(),N(c,{key:1,id:"upload",for:"contact-import",class:"button import-contact__button-disabled import-contact__multiselect-label import-contact__multiselect--no-select"},{icon:S(()=>[A(v,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Importing is disabled because there are no address books available")),1)]),_:1})):(p(),w(mt,{key:0},[A(c,{class:"import-contact__button-main",onClick:s.toggleModal},{icon:S(()=>[A(l,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Import contacts")),1)]),_:1},8,["onClick"]),a.isOpened?(p(),N(f,{key:0,ref:"modal",class:"import-contact__modal",name:e.t("contacts","Import contacts"),onClose:s.toggleModal},{default:S(()=>[I("section",ON,[I("h2",null,O(e.t("contacts","Import contacts")),1),s.isSingleAddressbook?R("",!0):(p(),N(d,{key:0,id:"select-addressbook",modelValue:s.selectedAddressbookOption,"onUpdate:modelValue":o[0]||(o[0]=_=>s.selectedAddressbookOption=_),"allow-empty":!1,clearable:!1,options:s.options,disabled:s.isSingleAddressbook||s.isImporting,placeholder:e.t("contacts","Contacts"),label:"displayName",class:"import-contact__modal-addressbook__select"},{"selected-option":S(({displayName:_})=>[I("span",null,O(e.t("contacts","Import into the {addressbookName} address book",{addressbookName:_})),1)]),_:1},8,["modelValue","options","disabled","placeholder"]))]),I("section",LN,[I("input",{id:"contact-import",ref:"contact-import-input",disabled:a.loading||s.isImporting,type:"file",class:"hidden-visually",onChange:o[1]||(o[1]=(..._)=>s.processFile&&s.processFile(..._))},null,40,DN),A(c,{disabled:a.loading,class:"import-contact__button import-contact__button--local",onClick:s.clickImportInput},{icon:S(()=>[A(l,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Select local file")),1)]),_:1},8,["disabled","onClick"]),A(c,{variant:"primary",disabled:a.loading,class:"import-contact__button import-contact__button--files",onClick:s.openPicker},{icon:S(()=>[a.loading?(p(),N(u,{key:0,size:20})):R("",!0),A(h,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Import from files")),1)]),_:1},8,["disabled","onClick"])])]),_:1},8,["name","onClose"])):R("",!0)],64))])}const Z1=tt(TN,[["render",PN],["__scopeId","data-v-cc79ea03"]]),RN={name:"LoadingIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},BN=["aria-hidden","aria-label"],$N=["fill","width","height"],VN={d:"M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z"},UN={key:0};function zN(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 loading-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",VN,[i.title?(p(),w("title",UN,O(i.title),1)):R("",!0)])],8,$N))],16,BN)}const HN=tt(RN,[["render",zN]]),GN={name:"SettingsNewAddressbook",components:{NcInputField:Lg,IconAdd:li,IconLoading:HN,NcButton:Kt,NcModal:On},data(){return{loading:!1,displayName:"",modalOpen:!1}},computed:{inputErrorState(){return this.displayName===""?!1:/[/\\]/.test(this.displayName)}},methods:{openModal(){this.modalOpen=!0},onModalCancel(){this.modalOpen=!1,this.displayName="",this.loading=!1},async onModalSubmit(){await this.addAddressbook(),this.modalOpen=!1},addAddressbook(){this.displayName!==""&&(this.loading=!0,this.$store.dispatch("appendAddressbook",{displayName:this.displayName}).then(()=>{this.displayName="",this.loading=!1}).catch(e=>{console.error(e),yt(t("contacts","An error occurred, unable to create the address book")),this.loading=!1}))}}},YN={class:"new-addressbook-entry"},FN={class:"new-addressbook-modal"},XN={class:"new-addressbook-modal__buttons"};function WN(e,o,i,r,a,s){const l=k("IconAdd"),c=k("NcButton"),d=k("IconLoading"),u=k("NcInputField"),h=k("NcModal");return p(),w("div",YN,[!a.modalOpen&&!a.loading?(p(),N(c,{key:0,onClick:s.openModal},{icon:S(()=>[A(l,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","New address book")),1)]),_:1},8,["onClick"])):R("",!0),a.loading?(p(),N(d,{key:1,size:20})):R("",!0),a.modalOpen?(p(),N(h,{key:2,size:"small",onClose:s.onModalCancel},{default:S(()=>[I("div",FN,[A(u,{"model-value":a.displayName,"onUpdate:modelValue":o[0]||(o[0]=f=>a.displayName=f),class:"new-addressbook",disabled:a.loading,label:e.t("contacts","Add new address book"),type:"text",autocomplete:"off",autocorrect:"off",spellcheck:"false"},null,8,["model-value","disabled","label"]),I("div",XN,[A(c,{variant:"tertiary",disabled:a.loading,onClick:s.onModalCancel},{default:S(()=>[q(O(e.t("contacts","Cancel")),1)]),_:1},8,["disabled","onClick"]),A(c,{variant:"primary",disabled:a.loading||s.inputErrorState,onClick:s.onModalSubmit},{default:S(()=>[q(O(e.t("contacts","Add")),1)]),_:1},8,["disabled","onClick"])])])]),_:1},8,["onClose"])):R("",!0)])}const jN=tt(GN,[["render",WN],["__scopeId","data-v-ebe06029"]]),qN={name:"SettingsSortContacts",components:{NcFormBox:Ah,NcSelect:io},data(){return{selected:null}},computed:{options(){return[{label:t("contacts","First name"),value:"firstName"},{label:t("contacts","Last name"),value:"lastName"},{label:t("contacts","Phonetic first name"),value:"phoneticFirstName"},{label:t("contacts","Phonetic last name"),value:"phoneticLastName"},{label:t("contacts","Display name"),value:"displayName"},{label:t("contacts","Last modified"),value:"rev"}]}},beforeMount(){this.selected=this.options.find(e=>e.value===this.$store.getters.getOrderKey)??null},methods:{sortContacts(e){const o=e&&e.value?e.value:"displayName";this.$store.commit("setOrder",o),this.$store.commit("sortContacts"),localStorage.setItem("orderKey",o)}}},ZN={class:"sort-contacts"},JN={for:"sort-by",class:"sort-contacts__label"};function KN(e,o,i,r,a,s){const l=k("NcSelect"),c=k("NcFormBox");return p(),N(c,null,{default:S(()=>[I("div",ZN,[I("label",JN,O(e.t("contacts","Sort contacts by")),1),A(l,{id:"sort-by",modelValue:a.selected,"onUpdate:modelValue":[o[0]||(o[0]=d=>a.selected=d),s.sortContacts],searchable:!1,"allow-empty":!1,options:s.options,label:"label"},null,8,["modelValue","options","onUpdate:modelValue"])])]),_:1})}const QN=tt(qN,[["render",KN],["__scopeId","data-v-71d3c71e"]]),tT={name:"ContactsSettings",components:{AppSettingsDialog:Dg,AppSettingsSection:o0,NcFormBox:Ah,NcFormBoxSwitch:T0,SettingsAddressbook:MN,SettingsNewAddressbook:jN,SettingsImportContacts:Z1,SettingsSortContacts:QN},props:{open:{required:!0,type:Boolean}},data(){return{allowSocialSync:wo("contacts","allowSocialSync")!=="no",enableSocialSync:wo("contacts","enableSocialSync")!=="no",enableSocialSyncLoading:!1,showSettings:!1}},computed:{addressbooks(){return this.$store.getters.getAddressbooks}},watch:{showSettings(e){e||this.$emit("update:open",e)},async open(e){e&&await this.onOpen()}},methods:{onClickImport(e){this.$emit("clicked",e)},async toggleSocialSync(e){this.enableSocialSyncLoading=!0;const o=e?"yes":"no";try{await ie.put(ci("apps/contacts/api/v1/social/config/user/enableSocialSync"),{allow:o}),Oi(t("contacts","Setting saved"))}catch{yt(t("contacts","Failed to save setting")),this.enableSocialSync=!e}finally{this.enableSocialSyncLoading=!1}},onLoad(){this.$emit("file-loaded",!1)},async onOpen(){this.showSettings=!0}}},eT={id:"addressbook-list",class:"addressbook-list"};function nT(e,o,i,r,a,s){const l=k("SettingsSortContacts"),c=k("NcFormBoxSwitch"),d=k("NcFormBox"),u=k("SettingsImportContacts"),h=k("AppSettingsSection"),f=k("SettingsAddressbook"),v=k("SettingsNewAddressbook"),_=k("AppSettingsDialog");return p(),N(_,{id:"app-settings-dialog",open:a.showSettings,"onUpdate:open":o[1]||(o[1]=b=>a.showSettings=b),name:e.t("contacts","Contacts settings"),"show-navigation":!0},{default:S(()=>[A(h,{id:"general",name:e.t("contacts","General")},{default:S(()=>[A(l),A(d,null,{default:S(()=>[A(c,{modelValue:a.enableSocialSync,"onUpdate:modelValue":[o[0]||(o[0]=b=>a.enableSocialSync=b),s.toggleSocialSync],label:e.t("contacts","Update avatars from social media"),description:e.t("contacts","Refreshed once per week"),loading:a.enableSocialSyncLoading,disabled:a.enableSocialSyncLoading},null,8,["modelValue","label","description","loading","disabled","onUpdate:modelValue"])]),_:1}),A(u,{addressbooks:s.addressbooks,onClicked:s.onClickImport,onFileLoaded:s.onLoad},null,8,["addressbooks","onClicked","onFileLoaded"])]),_:1},8,["name"]),A(h,{id:"address-books",name:e.t("contacts","Address books")},{default:S(()=>[I("ul",eT,[(p(!0),w(mt,null,Dt(s.addressbooks,b=>(p(),N(f,{key:b.id,addressbook:b},null,8,["addressbook"]))),128))]),A(v,{class:"settings-new-addressbook",addressbooks:s.addressbooks},null,8,["addressbooks"])]),_:1},8,["name"])]),_:1},8,["open","name"])}const oT=tt(tT,[["render",nT],["__scopeId","data-v-5e2430d6"]]);var ul={exports:{}},iT=ul.exports,Fu;function rT(){return Fu||(Fu=1,(function(e,o){(function(i,r){e.exports=r()})(iT,function(){return function i(r,a,s){var l=window,c="application/octet-stream",d=s||c,u=r,h=!a&&!s&&u,f=document.createElement("a"),v=function(st){return String(st)},_=l.Blob||l.MozBlob||l.WebKitBlob||v,b=a||"download",C,D;if(_=_.call?_.bind(l):Blob,String(this)==="true"&&(u=[u,d],d=u[0],u=u[1]),h&&h.length<2048&&(b=h.split("/").pop().split("?")[0],f.href=h,f.href.indexOf(h)!==-1)){var L=new XMLHttpRequest;return L.open("GET",h,!0),L.responseType="blob",L.onload=function(st){i(st.target.response,b,c)},setTimeout(function(){L.send()},0),L}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u))if(u.length>1024*1024*1.999&&_!==v)u=Z(u),d=u.type||c;else return navigator.msSaveBlob?navigator.msSaveBlob(Z(u),b):rt(u);else if(/([\x80-\xff])/.test(u)){var B=0,X=new Uint8Array(u.length),nt=X.length;for(B;B<nt;++B)X[B]=u.charCodeAt(B);u=new _([X],{type:d})}C=u instanceof _?u:new _([u],{type:d});function Z(st){var J=st.split(/[:;,]/),ot=J[1],lt=J[2]=="base64"?atob:decodeURIComponent,T=lt(J.pop()),V=T.length,U=0,M=new Uint8Array(V);for(U;U<V;++U)M[U]=T.charCodeAt(U);return new _([M],{type:ot})}function rt(st,J){if("download"in f)return f.href=st,f.setAttribute("download",b),f.className="download-js-link",f.innerHTML="downloading...",f.style.display="none",document.body.appendChild(f),setTimeout(function(){f.click(),document.body.removeChild(f),J===!0&&setTimeout(function(){l.URL.revokeObjectURL(f.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(st)&&(st="data:"+st.replace(/^data:([\w\/\-\+]+)/,c)),window.open(st)||confirm(`Displaying New Document
|
||
|
||
Use Save As... to download, then click back to return to this page.`)&&(location.href=st),!0;var ot=document.createElement("iframe");document.body.appendChild(ot),!J&&/^data:/.test(st)&&(st="data:"+st.replace(/^data:([\w\/\-\+]+)/,c)),ot.src=st,setTimeout(function(){document.body.removeChild(ot)},333)}if(navigator.msSaveBlob)return navigator.msSaveBlob(C,b);if(l.URL)rt(l.URL.createObjectURL(C),!0);else{if(typeof C=="string"||C.constructor===v)try{return rt("data:"+d+";base64,"+l.btoa(C))}catch{return rt("data:"+d+","+encodeURIComponent(C))}D=new FileReader,D.onload=function(st){rt(this.result)},D.readAsDataURL(C)}return!0}})})(ul)),ul.exports}var aT=rT();const sT=va(aT);var J1;function at(){return J1.apply(null,arguments)}function lT(e){J1=e}function Je(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function ko(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function Et(e,o){return Object.prototype.hasOwnProperty.call(e,o)}function Bc(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var o;for(o in e)if(Et(e,o))return!1;return!0}function Ee(e){return e===void 0}function Nn(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function nr(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function K1(e,o){var i=[],r,a=e.length;for(r=0;r<a;++r)i.push(o(e[r],r));return i}function jn(e,o){for(var i in o)Et(o,i)&&(e[i]=o[i]);return Et(o,"toString")&&(e.toString=o.toString),Et(o,"valueOf")&&(e.valueOf=o.valueOf),e}function dn(e,o,i,r){return gf(e,o,i,r,!0).utc()}function cT(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function vt(e){return e._pf==null&&(e._pf=cT()),e._pf}var hl;Array.prototype.some?hl=Array.prototype.some:hl=function(e){var o=Object(this),i=o.length>>>0,r;for(r=0;r<i;r++)if(r in o&&e.call(this,o[r],r,o))return!0;return!1};function $c(e){var o=null,i=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(o=vt(e),i=hl.call(o.parsedDateParts,function(a){return a!=null}),r=o.overflow<0&&!o.empty&&!o.invalidEra&&!o.invalidMonth&&!o.invalidWeekday&&!o.weekdayMismatch&&!o.nullInput&&!o.invalidFormat&&!o.userInvalidated&&(!o.meridiem||o.meridiem&&i),e._strict&&(r=r&&o.charsLeftOver===0&&o.unusedTokens.length===0&&o.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function Wa(e){var o=dn(NaN);return e!=null?jn(vt(o),e):vt(o).userInvalidated=!0,o}var Xu=at.momentProperties=[],As=!1;function Vc(e,o){var i,r,a,s=Xu.length;if(Ee(o._isAMomentObject)||(e._isAMomentObject=o._isAMomentObject),Ee(o._i)||(e._i=o._i),Ee(o._f)||(e._f=o._f),Ee(o._l)||(e._l=o._l),Ee(o._strict)||(e._strict=o._strict),Ee(o._tzm)||(e._tzm=o._tzm),Ee(o._isUTC)||(e._isUTC=o._isUTC),Ee(o._offset)||(e._offset=o._offset),Ee(o._pf)||(e._pf=vt(o)),Ee(o._locale)||(e._locale=o._locale),s>0)for(i=0;i<s;i++)r=Xu[i],a=o[r],Ee(a)||(e[r]=a);return e}function or(e){Vc(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),As===!1&&(As=!0,at.updateOffset(this),As=!1)}function Ke(e){return e instanceof or||e!=null&&e._isAMomentObject!=null}function Q1(e){at.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function $e(e,o){var i=!0;return jn(function(){if(at.deprecationHandler!=null&&at.deprecationHandler(null,e),i){var r=[],a,s,l,c=arguments.length;for(s=0;s<c;s++){if(a="",typeof arguments[s]=="object"){a+=`
|
||
[`+s+"] ";for(l in arguments[0])Et(arguments[0],l)&&(a+=l+": "+arguments[0][l]+", ");a=a.slice(0,-2)}else a=arguments[s];r.push(a)}Q1(e+`
|
||
Arguments: `+Array.prototype.slice.call(r).join("")+`
|
||
`+new Error().stack),i=!1}return o.apply(this,arguments)},o)}var Wu={};function tf(e,o){at.deprecationHandler!=null&&at.deprecationHandler(e,o),Wu[e]||(Q1(o),Wu[e]=!0)}at.suppressDeprecationWarnings=!1,at.deprecationHandler=null;function un(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function dT(e){var o,i;for(i in e)Et(e,i)&&(o=e[i],un(o)?this[i]=o:this["_"+i]=o);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function pl(e,o){var i=jn({},e),r;for(r in o)Et(o,r)&&(ko(e[r])&&ko(o[r])?(i[r]={},jn(i[r],e[r]),jn(i[r],o[r])):o[r]!=null?i[r]=o[r]:delete i[r]);for(r in e)Et(e,r)&&!Et(o,r)&&ko(e[r])&&(i[r]=jn({},i[r]));return i}function Uc(e){e!=null&&this.set(e)}var fl;Object.keys?fl=Object.keys:fl=function(e){var o,i=[];for(o in e)Et(e,o)&&i.push(o);return i};var uT={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function hT(e,o,i){var r=this._calendar[e]||this._calendar.sameElse;return un(r)?r.call(o,i):r}function on(e,o,i){var r=""+Math.abs(e),a=o-r.length,s=e>=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+r}var zc=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,yr=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ns={},Fo={};function pt(e,o,i,r){var a=r;typeof r=="string"&&(a=function(){return this[r]()}),e&&(Fo[e]=a),o&&(Fo[o[0]]=function(){return on(a.apply(this,arguments),o[1],o[2])}),i&&(Fo[i]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function pT(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function fT(e){var o=e.match(zc),i,r;for(i=0,r=o.length;i<r;i++)Fo[o[i]]?o[i]=Fo[o[i]]:o[i]=pT(o[i]);return function(a){var s="",l;for(l=0;l<r;l++)s+=un(o[l])?o[l].call(a,e):o[l];return s}}function $r(e,o){return e.isValid()?(o=ef(o,e.localeData()),Ns[o]=Ns[o]||fT(o),Ns[o](e)):e.localeData().invalidDate()}function ef(e,o){var i=5;function r(a){return o.longDateFormat(a)||a}for(yr.lastIndex=0;i>=0&&yr.test(e);)e=e.replace(yr,r),yr.lastIndex=0,i-=1;return e}var mT={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function gT(e){var o=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return o||!i?o:(this._longDateFormat[e]=i.match(zc).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var yT="Invalid date";function vT(){return this._invalidDate}var _T="%d",bT=/\d{1,2}/;function CT(e){return this._ordinal.replace("%d",e)}var kT={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function wT(e,o,i,r){var a=this._relativeTime[i];return un(a)?a(e,o,i,r):a.replace(/%d/i,e)}function ST(e,o){var i=this._relativeTime[e>0?"future":"past"];return un(i)?i(o):i.replace(/%s/i,o)}var ju={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Ge(e){return typeof e=="string"?ju[e]||ju[e.toLowerCase()]:void 0}function Hc(e){var o={},i,r;for(r in e)Et(e,r)&&(i=Ge(r),i&&(o[i]=e[r]));return o}var xT={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function ET(e){var o=[],i;for(i in e)Et(e,i)&&o.push({unit:i,priority:xT[i]});return o.sort(function(r,a){return r.priority-a.priority}),o}var nf=/\d/,Le=/\d\d/,of=/\d{3}/,ml=/\d{4}/,sa=/[+-]?\d{6}/,Bt=/\d\d?/,qu=/\d\d\d\d?/,Zu=/\d\d\d\d\d\d?/,Vr=/\d{1,3}/,gl=/\d{1,4}/,la=/[+-]?\d{1,6}/,Vo=/\d+/,ca=/[+-]?\d+/,MT=/Z|[+-]\d\d:?\d\d/gi,Ur=/Z|[+-]\d\d(?::?\d\d)?/gi,AT=/[+-]?\d+(\.\d{1,3})?/,ir=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,si=/^[1-9]\d?/,Gc=/^([1-9]\d|\d)/,da;da={};function ut(e,o,i){da[e]=un(o)?o:function(r,a){return r&&i?i:o}}function NT(e,o){return Et(da,e)?da[e](o._strict,o._locale):new RegExp(TT(e))}function TT(e){return En(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(o,i,r,a,s){return i||r||a||s}))}function En(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Be(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function kt(e){var o=+e,i=0;return o!==0&&isFinite(o)&&(i=Be(o)),i}var yl={};function Lt(e,o){var i,r=o,a;for(typeof e=="string"&&(e=[e]),Nn(o)&&(r=function(s,l){l[o]=kt(s)}),a=e.length,i=0;i<a;i++)yl[e[i]]=r}function Fi(e,o){Lt(e,function(i,r,a,s){a._w=a._w||{},o(i,a._w,a,s)})}function IT(e,o,i){o!=null&&Et(yl,e)&&yl[e](o,i._a,i,e)}function ja(e){return e%4===0&&e%100!==0||e%400===0}var ge=0,bn=1,an=2,oe=3,Ze=4,Cn=5,_o=6,OT=7,LT=8;pt("Y",0,0,function(){var e=this.year();return e<=9999?on(e,4):"+"+e}),pt(0,["YY",2],0,function(){return this.year()%100}),pt(0,["YYYY",4],0,"year"),pt(0,["YYYYY",5],0,"year"),pt(0,["YYYYYY",6,!0],0,"year"),ut("Y",ca),ut("YY",Bt,Le),ut("YYYY",gl,ml),ut("YYYYY",la,sa),ut("YYYYYY",la,sa),Lt(["YYYYY","YYYYYY"],ge),Lt("YYYY",function(e,o){o[ge]=e.length===2?at.parseTwoDigitYear(e):kt(e)}),Lt("YY",function(e,o){o[ge]=at.parseTwoDigitYear(e)}),Lt("Y",function(e,o){o[ge]=parseInt(e,10)});function Ii(e){return ja(e)?366:365}at.parseTwoDigitYear=function(e){return kt(e)+(kt(e)>68?1900:2e3)};var Ju=pi("FullYear",!0);function DT(){return ja(this.year())}function pi(e,o){return function(i){return i!=null?(rf(this,e,i),at.updateOffset(this,o),this):Xi(this,e)}}function Xi(e,o){if(!e.isValid())return NaN;var i=e._d,r=e._isUTC;switch(o){case"Milliseconds":return r?i.getUTCMilliseconds():i.getMilliseconds();case"Seconds":return r?i.getUTCSeconds():i.getSeconds();case"Minutes":return r?i.getUTCMinutes():i.getMinutes();case"Hours":return r?i.getUTCHours():i.getHours();case"Date":return r?i.getUTCDate():i.getDate();case"Day":return r?i.getUTCDay():i.getDay();case"Month":return r?i.getUTCMonth():i.getMonth();case"FullYear":return r?i.getUTCFullYear():i.getFullYear();default:return NaN}}function rf(e,o,i){var r,a,s,l,c;if(!(!e.isValid()||isNaN(i))){switch(r=e._d,a=e._isUTC,o){case"Milliseconds":return void(a?r.setUTCMilliseconds(i):r.setMilliseconds(i));case"Seconds":return void(a?r.setUTCSeconds(i):r.setSeconds(i));case"Minutes":return void(a?r.setUTCMinutes(i):r.setMinutes(i));case"Hours":return void(a?r.setUTCHours(i):r.setHours(i));case"Date":return void(a?r.setUTCDate(i):r.setDate(i));case"FullYear":break;default:return}s=i,l=e.month(),c=e.date(),c=c===29&&l===1&&!ja(s)?28:c,a?r.setUTCFullYear(s,l,c):r.setFullYear(s,l,c)}}function PT(e){return e=Ge(e),un(this[e])?this[e]():this}function RT(e,o){if(typeof e=="object"){e=Hc(e);var i=ET(e),r,a=i.length;for(r=0;r<a;r++)this[i[r].unit](e[i[r].unit])}else if(e=Ge(e),un(this[e]))return this[e](o);return this}function BT(e,o){return(e%o+o)%o}var qt;Array.prototype.indexOf?qt=Array.prototype.indexOf:qt=function(e){var o;for(o=0;o<this.length;++o)if(this[o]===e)return o;return-1};function Yc(e,o){if(isNaN(e)||isNaN(o))return NaN;var i=BT(o,12);return e+=(o-i)/12,i===1?ja(e)?29:28:31-i%7%2}pt("M",["MM",2],"Mo",function(){return this.month()+1}),pt("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),pt("MMMM",0,0,function(e){return this.localeData().months(this,e)}),ut("M",Bt,si),ut("MM",Bt,Le),ut("MMM",function(e,o){return o.monthsShortRegex(e)}),ut("MMMM",function(e,o){return o.monthsRegex(e)}),Lt(["M","MM"],function(e,o){o[bn]=kt(e)-1}),Lt(["MMM","MMMM"],function(e,o,i,r){var a=i._locale.monthsParse(e,r,i._strict);a!=null?o[bn]=a:vt(i).invalidMonth=e});var $T="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),af="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),sf=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,VT=ir,UT=ir;function zT(e,o){return e?Je(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||sf).test(o)?"format":"standalone"][e.month()]:Je(this._months)?this._months:this._months.standalone}function HT(e,o){return e?Je(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[sf.test(o)?"format":"standalone"][e.month()]:Je(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function GT(e,o,i){var r,a,s,l=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)s=dn([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(s,"").toLocaleLowerCase();return i?o==="MMM"?(a=qt.call(this._shortMonthsParse,l),a!==-1?a:null):(a=qt.call(this._longMonthsParse,l),a!==-1?a:null):o==="MMM"?(a=qt.call(this._shortMonthsParse,l),a!==-1?a:(a=qt.call(this._longMonthsParse,l),a!==-1?a:null)):(a=qt.call(this._longMonthsParse,l),a!==-1?a:(a=qt.call(this._shortMonthsParse,l),a!==-1?a:null))}function YT(e,o,i){var r,a,s;if(this._monthsParseExact)return GT.call(this,e,o,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++)if(a=dn([2e3,r]),i&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),!i&&!this._monthsParse[r]&&(s="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[r]=new RegExp(s.replace(".",""),"i")),i&&o==="MMMM"&&this._longMonthsParse[r].test(e)||i&&o==="MMM"&&this._shortMonthsParse[r].test(e)||!i&&this._monthsParse[r].test(e))return r}function lf(e,o){if(!e.isValid())return e;if(typeof o=="string"){if(/^\d+$/.test(o))o=kt(o);else if(o=e.localeData().monthsParse(o),!Nn(o))return e}var i=o,r=e.date();return r=r<29?r:Math.min(r,Yc(e.year(),i)),e._isUTC?e._d.setUTCMonth(i,r):e._d.setMonth(i,r),e}function Ku(e){return e!=null?(lf(this,e),at.updateOffset(this,!0),this):Xi(this,"Month")}function FT(){return Yc(this.year(),this.month())}function XT(e){return this._monthsParseExact?(Et(this,"_monthsRegex")||cf.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(Et(this,"_monthsShortRegex")||(this._monthsShortRegex=VT),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function WT(e){return this._monthsParseExact?(Et(this,"_monthsRegex")||cf.call(this),e?this._monthsStrictRegex:this._monthsRegex):(Et(this,"_monthsRegex")||(this._monthsRegex=UT),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function cf(){function e(d,u){return u.length-d.length}var o=[],i=[],r=[],a,s,l,c;for(a=0;a<12;a++)s=dn([2e3,a]),l=En(this.monthsShort(s,"")),c=En(this.months(s,"")),o.push(l),i.push(c),r.push(c),r.push(l);o.sort(e),i.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+o.join("|")+")","i")}function jT(e,o,i,r,a,s,l){var c;return e<100&&e>=0?(c=new Date(e+400,o,i,r,a,s,l),isFinite(c.getFullYear())&&c.setFullYear(e)):c=new Date(e,o,i,r,a,s,l),c}function Wi(e){var o,i;return e<100&&e>=0?(i=Array.prototype.slice.call(arguments),i[0]=e+400,o=new Date(Date.UTC.apply(null,i)),isFinite(o.getUTCFullYear())&&o.setUTCFullYear(e)):o=new Date(Date.UTC.apply(null,arguments)),o}function ua(e,o,i){var r=7+o-i,a=(7+Wi(e,0,r).getUTCDay()-o)%7;return-a+r-1}function df(e,o,i,r,a){var s=(7+i-r)%7,l=ua(e,r,a),c=1+7*(o-1)+s+l,d,u;return c<=0?(d=e-1,u=Ii(d)+c):c>Ii(e)?(d=e+1,u=c-Ii(e)):(d=e,u=c),{year:d,dayOfYear:u}}function ji(e,o,i){var r=ua(e.year(),o,i),a=Math.floor((e.dayOfYear()-r-1)/7)+1,s,l;return a<1?(l=e.year()-1,s=a+Mn(l,o,i)):a>Mn(e.year(),o,i)?(s=a-Mn(e.year(),o,i),l=e.year()+1):(l=e.year(),s=a),{week:s,year:l}}function Mn(e,o,i){var r=ua(e,o,i),a=ua(e+1,o,i);return(Ii(e)-r+a)/7}pt("w",["ww",2],"wo","week"),pt("W",["WW",2],"Wo","isoWeek"),ut("w",Bt,si),ut("ww",Bt,Le),ut("W",Bt,si),ut("WW",Bt,Le),Fi(["w","ww","W","WW"],function(e,o,i,r){o[r.substr(0,1)]=kt(e)});function qT(e){return ji(e,this._week.dow,this._week.doy).week}var ZT={dow:0,doy:6};function JT(){return this._week.dow}function KT(){return this._week.doy}function QT(e){var o=this.localeData().week(this);return e==null?o:this.add((e-o)*7,"d")}function tI(e){var o=ji(this,1,4).week;return e==null?o:this.add((e-o)*7,"d")}pt("d",0,"do","day"),pt("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),pt("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),pt("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),pt("e",0,0,"weekday"),pt("E",0,0,"isoWeekday"),ut("d",Bt),ut("e",Bt),ut("E",Bt),ut("dd",function(e,o){return o.weekdaysMinRegex(e)}),ut("ddd",function(e,o){return o.weekdaysShortRegex(e)}),ut("dddd",function(e,o){return o.weekdaysRegex(e)}),Fi(["dd","ddd","dddd"],function(e,o,i,r){var a=i._locale.weekdaysParse(e,r,i._strict);a!=null?o.d=a:vt(i).invalidWeekday=e}),Fi(["d","e","E"],function(e,o,i,r){o[r]=kt(e)});function eI(e,o){return typeof e!="string"?e:isNaN(e)?(e=o.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function nI(e,o){return typeof e=="string"?o.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Fc(e,o){return e.slice(o,7).concat(e.slice(0,o))}var oI="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),uf="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),iI="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),rI=ir,aI=ir,sI=ir;function lI(e,o){var i=Je(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(o)?"format":"standalone"];return e===!0?Fc(i,this._week.dow):e?i[e.day()]:i}function cI(e){return e===!0?Fc(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function dI(e){return e===!0?Fc(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function uI(e,o,i){var r,a,s,l=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)s=dn([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(s,"").toLocaleLowerCase();return i?o==="dddd"?(a=qt.call(this._weekdaysParse,l),a!==-1?a:null):o==="ddd"?(a=qt.call(this._shortWeekdaysParse,l),a!==-1?a:null):(a=qt.call(this._minWeekdaysParse,l),a!==-1?a:null):o==="dddd"?(a=qt.call(this._weekdaysParse,l),a!==-1||(a=qt.call(this._shortWeekdaysParse,l),a!==-1)?a:(a=qt.call(this._minWeekdaysParse,l),a!==-1?a:null)):o==="ddd"?(a=qt.call(this._shortWeekdaysParse,l),a!==-1||(a=qt.call(this._weekdaysParse,l),a!==-1)?a:(a=qt.call(this._minWeekdaysParse,l),a!==-1?a:null)):(a=qt.call(this._minWeekdaysParse,l),a!==-1||(a=qt.call(this._weekdaysParse,l),a!==-1)?a:(a=qt.call(this._shortWeekdaysParse,l),a!==-1?a:null))}function hI(e,o,i){var r,a,s;if(this._weekdaysParseExact)return uI.call(this,e,o,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++)if(a=dn([2e3,1]).day(r),i&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(s="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[r]=new RegExp(s.replace(".",""),"i")),i&&o==="dddd"&&this._fullWeekdaysParse[r].test(e)||i&&o==="ddd"&&this._shortWeekdaysParse[r].test(e)||i&&o==="dd"&&this._minWeekdaysParse[r].test(e)||!i&&this._weekdaysParse[r].test(e))return r}function pI(e){if(!this.isValid())return e!=null?this:NaN;var o=Xi(this,"Day");return e!=null?(e=eI(e,this.localeData()),this.add(e-o,"d")):o}function fI(e){if(!this.isValid())return e!=null?this:NaN;var o=(this.day()+7-this.localeData()._week.dow)%7;return e==null?o:this.add(e-o,"d")}function mI(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var o=nI(e,this.localeData());return this.day(this.day()%7?o:o-7)}else return this.day()||7}function gI(e){return this._weekdaysParseExact?(Et(this,"_weekdaysRegex")||Xc.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(Et(this,"_weekdaysRegex")||(this._weekdaysRegex=rI),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function yI(e){return this._weekdaysParseExact?(Et(this,"_weekdaysRegex")||Xc.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Et(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=aI),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function vI(e){return this._weekdaysParseExact?(Et(this,"_weekdaysRegex")||Xc.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Et(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=sI),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xc(){function e(h,f){return f.length-h.length}var o=[],i=[],r=[],a=[],s,l,c,d,u;for(s=0;s<7;s++)l=dn([2e3,1]).day(s),c=En(this.weekdaysMin(l,"")),d=En(this.weekdaysShort(l,"")),u=En(this.weekdays(l,"")),o.push(c),i.push(d),r.push(u),a.push(c),a.push(d),a.push(u);o.sort(e),i.sort(e),r.sort(e),a.sort(e),this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Ts(){return this.hours()%12||12}function _I(){return this.hours()||24}pt("H",["HH",2],0,"hour"),pt("h",["hh",2],0,Ts),pt("k",["kk",2],0,_I),pt("hmm",0,0,function(){return""+Ts.apply(this)+on(this.minutes(),2)}),pt("hmmss",0,0,function(){return""+Ts.apply(this)+on(this.minutes(),2)+on(this.seconds(),2)}),pt("Hmm",0,0,function(){return""+this.hours()+on(this.minutes(),2)}),pt("Hmmss",0,0,function(){return""+this.hours()+on(this.minutes(),2)+on(this.seconds(),2)});function Qu(e,o){pt(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),o)})}Qu("a",!0),Qu("A",!1);function th(e,o){return o._meridiemParse}ut("a",th),ut("A",th),ut("H",Bt,Gc),ut("h",Bt,si),ut("k",Bt,si),ut("HH",Bt,Le),ut("hh",Bt,Le),ut("kk",Bt,Le),ut("hmm",qu),ut("hmmss",Zu),ut("Hmm",qu),ut("Hmmss",Zu),Lt(["H","HH"],oe),Lt(["k","kk"],function(e,o,i){var r=kt(e);o[oe]=r===24?0:r}),Lt(["a","A"],function(e,o,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),Lt(["h","hh"],function(e,o,i){o[oe]=kt(e),vt(i).bigHour=!0}),Lt("hmm",function(e,o,i){var r=e.length-2;o[oe]=kt(e.substr(0,r)),o[Ze]=kt(e.substr(r)),vt(i).bigHour=!0}),Lt("hmmss",function(e,o,i){var r=e.length-4,a=e.length-2;o[oe]=kt(e.substr(0,r)),o[Ze]=kt(e.substr(r,2)),o[Cn]=kt(e.substr(a)),vt(i).bigHour=!0}),Lt("Hmm",function(e,o,i){var r=e.length-2;o[oe]=kt(e.substr(0,r)),o[Ze]=kt(e.substr(r))}),Lt("Hmmss",function(e,o,i){var r=e.length-4,a=e.length-2;o[oe]=kt(e.substr(0,r)),o[Ze]=kt(e.substr(r,2)),o[Cn]=kt(e.substr(a))});function bI(e){return(e+"").toLowerCase().charAt(0)==="p"}var CI=/[ap]\.?m?\.?/i,kI=pi("Hours",!0);function wI(e,o,i){return e>11?i?"pm":"PM":i?"am":"AM"}var hf={calendar:uT,longDateFormat:mT,invalidDate:yT,ordinal:_T,dayOfMonthOrdinalParse:bT,relativeTime:kT,months:$T,monthsShort:af,week:ZT,weekdays:oI,weekdaysMin:iI,weekdaysShort:uf,meridiemParse:CI},Yt={},ki={},qi;function SI(e,o){var i,r=Math.min(e.length,o.length);for(i=0;i<r;i+=1)if(e[i]!==o[i])return i;return r}function eh(e){return e&&e.toLowerCase().replace("_","-")}function xI(e){for(var o=0,i,r,a,s;o<e.length;){for(s=eh(e[o]).split("-"),i=s.length,r=eh(e[o+1]),r=r?r.split("-"):null;i>0;){if(a=qa(s.slice(0,i).join("-")),a)return a;if(r&&r.length>=i&&SI(s,r)>=i-1)break;i--}o++}return qi}function EI(e){return!!(e&&e.match("^[^/\\\\]*$"))}function qa(e){var o=null,i;if(Yt[e]===void 0&&typeof module<"u"&&module&&module.exports&&EI(e))try{o=qi._abbr,i=require,i("./locale/"+e),Kn(o)}catch{Yt[e]=null}return Yt[e]}function Kn(e,o){var i;return e&&(Ee(o)?i=Dn(e):i=Wc(e,o),i?qi=i:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),qi._abbr}function Wc(e,o){if(o!==null){var i,r=hf;if(o.abbr=e,Yt[e]!=null)tf("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=Yt[e]._config;else if(o.parentLocale!=null)if(Yt[o.parentLocale]!=null)r=Yt[o.parentLocale]._config;else if(i=qa(o.parentLocale),i!=null)r=i._config;else return ki[o.parentLocale]||(ki[o.parentLocale]=[]),ki[o.parentLocale].push({name:e,config:o}),null;return Yt[e]=new Uc(pl(r,o)),ki[e]&&ki[e].forEach(function(a){Wc(a.name,a.config)}),Kn(e),Yt[e]}else return delete Yt[e],null}function MI(e,o){if(o!=null){var i,r,a=hf;Yt[e]!=null&&Yt[e].parentLocale!=null?Yt[e].set(pl(Yt[e]._config,o)):(r=qa(e),r!=null&&(a=r._config),o=pl(a,o),r==null&&(o.abbr=e),i=new Uc(o),i.parentLocale=Yt[e],Yt[e]=i),Kn(e)}else Yt[e]!=null&&(Yt[e].parentLocale!=null?(Yt[e]=Yt[e].parentLocale,e===Kn()&&Kn(e)):Yt[e]!=null&&delete Yt[e]);return Yt[e]}function Dn(e){var o;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return qi;if(!Je(e)){if(o=qa(e),o)return o;e=[e]}return xI(e)}function AI(){return fl(Yt)}function jc(e){var o,i=e._a;return i&&vt(e).overflow===-2&&(o=i[bn]<0||i[bn]>11?bn:i[an]<1||i[an]>Yc(i[ge],i[bn])?an:i[oe]<0||i[oe]>24||i[oe]===24&&(i[Ze]!==0||i[Cn]!==0||i[_o]!==0)?oe:i[Ze]<0||i[Ze]>59?Ze:i[Cn]<0||i[Cn]>59?Cn:i[_o]<0||i[_o]>999?_o:-1,vt(e)._overflowDayOfYear&&(o<ge||o>an)&&(o=an),vt(e)._overflowWeeks&&o===-1&&(o=OT),vt(e)._overflowWeekday&&o===-1&&(o=LT),vt(e).overflow=o),e}var NI=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,TI=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,II=/Z|[+-]\d\d(?::?\d\d)?/,vr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Is=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],OI=/^\/?Date\((-?\d+)/i,LI=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,DI={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function pf(e){var o,i,r=e._i,a=NI.exec(r)||TI.exec(r),s,l,c,d,u=vr.length,h=Is.length;if(a){for(vt(e).iso=!0,o=0,i=u;o<i;o++)if(vr[o][1].exec(a[1])){l=vr[o][0],s=vr[o][2]!==!1;break}if(l==null){e._isValid=!1;return}if(a[3]){for(o=0,i=h;o<i;o++)if(Is[o][1].exec(a[3])){c=(a[2]||" ")+Is[o][0];break}if(c==null){e._isValid=!1;return}}if(!s&&c!=null){e._isValid=!1;return}if(a[4])if(II.exec(a[4]))d="Z";else{e._isValid=!1;return}e._f=l+(c||"")+(d||""),Zc(e)}else e._isValid=!1}function PI(e,o,i,r,a,s){var l=[RI(e),af.indexOf(o),parseInt(i,10),parseInt(r,10),parseInt(a,10)];return s&&l.push(parseInt(s,10)),l}function RI(e){var o=parseInt(e,10);return o<=49?2e3+o:o<=999?1900+o:o}function BI(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function $I(e,o,i){if(e){var r=uf.indexOf(e),a=new Date(o[0],o[1],o[2]).getDay();if(r!==a)return vt(i).weekdayMismatch=!0,i._isValid=!1,!1}return!0}function VI(e,o,i){if(e)return DI[e];if(o)return 0;var r=parseInt(i,10),a=r%100,s=(r-a)/100;return s*60+a}function ff(e){var o=LI.exec(BI(e._i)),i;if(o){if(i=PI(o[4],o[3],o[2],o[5],o[6],o[7]),!$I(o[1],i,e))return;e._a=i,e._tzm=VI(o[8],o[9],o[10]),e._d=Wi.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),vt(e).rfc2822=!0}else e._isValid=!1}function UI(e){var o=OI.exec(e._i);if(o!==null){e._d=new Date(+o[1]);return}if(pf(e),e._isValid===!1)delete e._isValid;else return;if(ff(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:at.createFromInputFallback(e)}at.createFromInputFallback=$e("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function Bo(e,o,i){return e??o??i}function zI(e){var o=new Date(at.now());return e._useUTC?[o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()]:[o.getFullYear(),o.getMonth(),o.getDate()]}function qc(e){var o,i,r=[],a,s,l;if(!e._d){for(a=zI(e),e._w&&e._a[an]==null&&e._a[bn]==null&&HI(e),e._dayOfYear!=null&&(l=Bo(e._a[ge],a[ge]),(e._dayOfYear>Ii(l)||e._dayOfYear===0)&&(vt(e)._overflowDayOfYear=!0),i=Wi(l,0,e._dayOfYear),e._a[bn]=i.getUTCMonth(),e._a[an]=i.getUTCDate()),o=0;o<3&&e._a[o]==null;++o)e._a[o]=r[o]=a[o];for(;o<7;o++)e._a[o]=r[o]=e._a[o]==null?o===2?1:0:e._a[o];e._a[oe]===24&&e._a[Ze]===0&&e._a[Cn]===0&&e._a[_o]===0&&(e._nextDay=!0,e._a[oe]=0),e._d=(e._useUTC?Wi:jT).apply(null,r),s=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[oe]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==s&&(vt(e).weekdayMismatch=!0)}}function HI(e){var o,i,r,a,s,l,c,d,u;o=e._w,o.GG!=null||o.W!=null||o.E!=null?(s=1,l=4,i=Bo(o.GG,e._a[ge],ji(Vt(),1,4).year),r=Bo(o.W,1),a=Bo(o.E,1),(a<1||a>7)&&(d=!0)):(s=e._locale._week.dow,l=e._locale._week.doy,u=ji(Vt(),s,l),i=Bo(o.gg,e._a[ge],u.year),r=Bo(o.w,u.week),o.d!=null?(a=o.d,(a<0||a>6)&&(d=!0)):o.e!=null?(a=o.e+s,(o.e<0||o.e>6)&&(d=!0)):a=s),r<1||r>Mn(i,s,l)?vt(e)._overflowWeeks=!0:d!=null?vt(e)._overflowWeekday=!0:(c=df(i,r,a,s,l),e._a[ge]=c.year,e._dayOfYear=c.dayOfYear)}at.ISO_8601=function(){},at.RFC_2822=function(){};function Zc(e){if(e._f===at.ISO_8601){pf(e);return}if(e._f===at.RFC_2822){ff(e);return}e._a=[],vt(e).empty=!0;var o=""+e._i,i,r,a,s,l,c=o.length,d=0,u,h;for(a=ef(e._f,e._locale).match(zc)||[],h=a.length,i=0;i<h;i++)s=a[i],r=(o.match(NT(s,e))||[])[0],r&&(l=o.substr(0,o.indexOf(r)),l.length>0&&vt(e).unusedInput.push(l),o=o.slice(o.indexOf(r)+r.length),d+=r.length),Fo[s]?(r?vt(e).empty=!1:vt(e).unusedTokens.push(s),IT(s,r,e)):e._strict&&!r&&vt(e).unusedTokens.push(s);vt(e).charsLeftOver=c-d,o.length>0&&vt(e).unusedInput.push(o),e._a[oe]<=12&&vt(e).bigHour===!0&&e._a[oe]>0&&(vt(e).bigHour=void 0),vt(e).parsedDateParts=e._a.slice(0),vt(e).meridiem=e._meridiem,e._a[oe]=GI(e._locale,e._a[oe],e._meridiem),u=vt(e).era,u!==null&&(e._a[ge]=e._locale.erasConvertYear(u,e._a[ge])),qc(e),jc(e)}function GI(e,o,i){var r;return i==null?o:e.meridiemHour!=null?e.meridiemHour(o,i):(e.isPM!=null&&(r=e.isPM(i),r&&o<12&&(o+=12),!r&&o===12&&(o=0)),o)}function YI(e){var o,i,r,a,s,l,c=!1,d=e._f.length;if(d===0){vt(e).invalidFormat=!0,e._d=new Date(NaN);return}for(a=0;a<d;a++)s=0,l=!1,o=Vc({},e),e._useUTC!=null&&(o._useUTC=e._useUTC),o._f=e._f[a],Zc(o),$c(o)&&(l=!0),s+=vt(o).charsLeftOver,s+=vt(o).unusedTokens.length*10,vt(o).score=s,c?s<r&&(r=s,i=o):(r==null||s<r||l)&&(r=s,i=o,l&&(c=!0));jn(e,i||o)}function FI(e){if(!e._d){var o=Hc(e._i),i=o.day===void 0?o.date:o.day;e._a=K1([o.year,o.month,i,o.hour,o.minute,o.second,o.millisecond],function(r){return r&&parseInt(r,10)}),qc(e)}}function XI(e){var o=new or(jc(mf(e)));return o._nextDay&&(o.add(1,"d"),o._nextDay=void 0),o}function mf(e){var o=e._i,i=e._f;return e._locale=e._locale||Dn(e._l),o===null||i===void 0&&o===""?Wa({nullInput:!0}):(typeof o=="string"&&(e._i=o=e._locale.preparse(o)),Ke(o)?new or(jc(o)):(nr(o)?e._d=o:Je(i)?YI(e):i?Zc(e):WI(e),$c(e)||(e._d=null),e))}function WI(e){var o=e._i;Ee(o)?e._d=new Date(at.now()):nr(o)?e._d=new Date(o.valueOf()):typeof o=="string"?UI(e):Je(o)?(e._a=K1(o.slice(0),function(i){return parseInt(i,10)}),qc(e)):ko(o)?FI(e):Nn(o)?e._d=new Date(o):at.createFromInputFallback(e)}function gf(e,o,i,r,a){var s={};return(o===!0||o===!1)&&(r=o,o=void 0),(i===!0||i===!1)&&(r=i,i=void 0),(ko(e)&&Bc(e)||Je(e)&&e.length===0)&&(e=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=a,s._l=i,s._i=e,s._f=o,s._strict=r,XI(s)}function Vt(e,o,i,r){return gf(e,o,i,r,!1)}var jI=$e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Vt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:Wa()}),qI=$e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Vt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:Wa()});function yf(e,o){var i,r;if(o.length===1&&Je(o[0])&&(o=o[0]),!o.length)return Vt();for(i=o[0],r=1;r<o.length;++r)(!o[r].isValid()||o[r][e](i))&&(i=o[r]);return i}function ZI(){var e=[].slice.call(arguments,0);return yf("isBefore",e)}function JI(){var e=[].slice.call(arguments,0);return yf("isAfter",e)}var KI=function(){return Date.now?Date.now():+new Date},wi=["year","quarter","month","week","day","hour","minute","second","millisecond"];function QI(e){var o,i=!1,r,a=wi.length;for(o in e)if(Et(e,o)&&!(qt.call(wi,o)!==-1&&(e[o]==null||!isNaN(e[o]))))return!1;for(r=0;r<a;++r)if(e[wi[r]]){if(i)return!1;parseFloat(e[wi[r]])!==kt(e[wi[r]])&&(i=!0)}return!0}function t9(){return this._isValid}function e9(){return Qe(NaN)}function Za(e){var o=Hc(e),i=o.year||0,r=o.quarter||0,a=o.month||0,s=o.week||o.isoWeek||0,l=o.day||0,c=o.hour||0,d=o.minute||0,u=o.second||0,h=o.millisecond||0;this._isValid=QI(o),this._milliseconds=+h+u*1e3+d*6e4+c*1e3*60*60,this._days=+l+s*7,this._months=+a+r*3+i*12,this._data={},this._locale=Dn(),this._bubble()}function zr(e){return e instanceof Za}function vl(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function n9(e,o,i){var r=Math.min(e.length,o.length),a=Math.abs(e.length-o.length),s=0,l;for(l=0;l<r;l++)kt(e[l])!==kt(o[l])&&s++;return s+a}function nh(e,o){pt(e,0,0,function(){var i=this.utcOffset(),r="+";return i<0&&(i=-i,r="-"),r+on(~~(i/60),2)+o+on(~~i%60,2)})}nh("Z",":"),nh("ZZ",""),ut("Z",Ur),ut("ZZ",Ur),Lt(["Z","ZZ"],function(e,o,i){i._useUTC=!0,i._tzm=Jc(Ur,e)});var o9=/([\+\-]|\d\d)/gi;function Jc(e,o){var i=(o||"").match(e),r,a,s;return i===null?null:(r=i[i.length-1]||[],a=(r+"").match(o9)||["-",0,0],s=+(a[1]*60)+kt(a[2]),s===0?0:a[0]==="+"?s:-s)}function Kc(e,o){var i,r;return o._isUTC?(i=o.clone(),r=(Ke(e)||nr(e)?e.valueOf():Vt(e).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+r),at.updateOffset(i,!1),i):Vt(e).local()}function _l(e){return-Math.round(e._d.getTimezoneOffset())}at.updateOffset=function(){};function i9(e,o,i){var r=this._offset||0,a;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Jc(Ur,e),e===null)return this}else Math.abs(e)<16&&!i&&(e=e*60);return!this._isUTC&&o&&(a=_l(this)),this._offset=e,this._isUTC=!0,a!=null&&this.add(a,"m"),r!==e&&(!o||this._changeInProgress?_f(this,Qe(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,at.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:_l(this)}function r9(e,o){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,o),this):-this.utcOffset()}function a9(e){return this.utcOffset(0,e)}function s9(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(_l(this),"m")),this}function l9(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Jc(MT,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function c9(e){return this.isValid()?(e=e?Vt(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function d9(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function u9(){if(!Ee(this._isDSTShifted))return this._isDSTShifted;var e={},o;return Vc(e,this),e=mf(e),e._a?(o=e._isUTC?dn(e._a):Vt(e._a),this._isDSTShifted=this.isValid()&&n9(e._a,o.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function h9(){return this.isValid()?!this._isUTC:!1}function p9(){return this.isValid()?this._isUTC:!1}function oh(){return this.isValid()?this._isUTC&&this._offset===0:!1}var f9=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,m9=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Qe(e,o){var i=e,r=null,a,s,l;return zr(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:Nn(e)||!isNaN(+e)?(i={},o?i[o]=+e:i.milliseconds=+e):(r=f9.exec(e))?(a=r[1]==="-"?-1:1,i={y:0,d:kt(r[an])*a,h:kt(r[oe])*a,m:kt(r[Ze])*a,s:kt(r[Cn])*a,ms:kt(vl(r[_o]*1e3))*a}):(r=m9.exec(e))?(a=r[1]==="-"?-1:1,i={y:ho(r[2],a),M:ho(r[3],a),w:ho(r[4],a),d:ho(r[5],a),h:ho(r[6],a),m:ho(r[7],a),s:ho(r[8],a)}):i==null?i={}:typeof i=="object"&&("from"in i||"to"in i)&&(l=g9(Vt(i.from),Vt(i.to)),i={},i.ms=l.milliseconds,i.M=l.months),s=new Za(i),zr(e)&&Et(e,"_locale")&&(s._locale=e._locale),zr(e)&&Et(e,"_isValid")&&(s._isValid=e._isValid),s}Qe.fn=Za.prototype,Qe.invalid=e9;function ho(e,o){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*o}function ih(e,o){var i={};return i.months=o.month()-e.month()+(o.year()-e.year())*12,e.clone().add(i.months,"M").isAfter(o)&&--i.months,i.milliseconds=+o-+e.clone().add(i.months,"M"),i}function g9(e,o){var i;return e.isValid()&&o.isValid()?(o=Kc(o,e),e.isBefore(o)?i=ih(e,o):(i=ih(o,e),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function vf(e,o){return function(i,r){var a,s;return r!==null&&!isNaN(+r)&&(tf(o,"moment()."+o+"(period, number) is deprecated. Please use moment()."+o+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=i,i=r,r=s),a=Qe(i,r),_f(this,a,e),this}}function _f(e,o,i,r){var a=o._milliseconds,s=vl(o._days),l=vl(o._months);e.isValid()&&(r=r??!0,l&&lf(e,Xi(e,"Month")+l*i),s&&rf(e,"Date",Xi(e,"Date")+s*i),a&&e._d.setTime(e._d.valueOf()+a*i),r&&at.updateOffset(e,s||l))}var y9=vf(1,"add"),v9=vf(-1,"subtract");function bf(e){return typeof e=="string"||e instanceof String}function _9(e){return Ke(e)||nr(e)||bf(e)||Nn(e)||C9(e)||b9(e)||e===null||e===void 0}function b9(e){var o=ko(e)&&!Bc(e),i=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a,s,l=r.length;for(a=0;a<l;a+=1)s=r[a],i=i||Et(e,s);return o&&i}function C9(e){var o=Je(e),i=!1;return o&&(i=e.filter(function(r){return!Nn(r)&&bf(e)}).length===0),o&&i}function k9(e){var o=ko(e)&&!Bc(e),i=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],a,s;for(a=0;a<r.length;a+=1)s=r[a],i=i||Et(e,s);return o&&i}function w9(e,o){var i=e.diff(o,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function S9(e,o){arguments.length===1&&(arguments[0]?_9(arguments[0])?(e=arguments[0],o=void 0):k9(arguments[0])&&(o=arguments[0],e=void 0):(e=void 0,o=void 0));var i=e||Vt(),r=Kc(i,this).startOf("day"),a=at.calendarFormat(this,r)||"sameElse",s=o&&(un(o[a])?o[a].call(this,i):o[a]);return this.format(s||this.localeData().calendar(a,this,Vt(i)))}function x9(){return new or(this)}function E9(e,o){var i=Ke(e)?e:Vt(e);return this.isValid()&&i.isValid()?(o=Ge(o)||"millisecond",o==="millisecond"?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(o).valueOf()):!1}function M9(e,o){var i=Ke(e)?e:Vt(e);return this.isValid()&&i.isValid()?(o=Ge(o)||"millisecond",o==="millisecond"?this.valueOf()<i.valueOf():this.clone().endOf(o).valueOf()<i.valueOf()):!1}function A9(e,o,i,r){var a=Ke(e)?e:Vt(e),s=Ke(o)?o:Vt(o);return this.isValid()&&a.isValid()&&s.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(a,i):!this.isBefore(a,i))&&(r[1]===")"?this.isBefore(s,i):!this.isAfter(s,i))):!1}function N9(e,o){var i=Ke(e)?e:Vt(e),r;return this.isValid()&&i.isValid()?(o=Ge(o)||"millisecond",o==="millisecond"?this.valueOf()===i.valueOf():(r=i.valueOf(),this.clone().startOf(o).valueOf()<=r&&r<=this.clone().endOf(o).valueOf())):!1}function T9(e,o){return this.isSame(e,o)||this.isAfter(e,o)}function I9(e,o){return this.isSame(e,o)||this.isBefore(e,o)}function O9(e,o,i){var r,a,s;if(!this.isValid())return NaN;if(r=Kc(e,this),!r.isValid())return NaN;switch(a=(r.utcOffset()-this.utcOffset())*6e4,o=Ge(o),o){case"year":s=Hr(this,r)/12;break;case"month":s=Hr(this,r);break;case"quarter":s=Hr(this,r)/3;break;case"second":s=(this-r)/1e3;break;case"minute":s=(this-r)/6e4;break;case"hour":s=(this-r)/36e5;break;case"day":s=(this-r-a)/864e5;break;case"week":s=(this-r-a)/6048e5;break;default:s=this-r}return i?s:Be(s)}function Hr(e,o){if(e.date()<o.date())return-Hr(o,e);var i=(o.year()-e.year())*12+(o.month()-e.month()),r=e.clone().add(i,"months"),a,s;return o-r<0?(a=e.clone().add(i-1,"months"),s=(o-r)/(r-a)):(a=e.clone().add(i+1,"months"),s=(o-r)/(a-r)),-(i+s)||0}at.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",at.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function L9(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function D9(e){if(!this.isValid())return null;var o=e!==!0,i=o?this.clone().utc():this;return i.year()<0||i.year()>9999?$r(i,o?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):un(Date.prototype.toISOString)?o?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",$r(i,"Z")):$r(i,o?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function P9(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",o="",i,r,a,s;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",o="Z"),i="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",s=o+'[")]',this.format(i+r+a+s)}function R9(e){e||(e=this.isUtc()?at.defaultFormatUtc:at.defaultFormat);var o=$r(this,e);return this.localeData().postformat(o)}function B9(e,o){return this.isValid()&&(Ke(e)&&e.isValid()||Vt(e).isValid())?Qe({to:this,from:e}).locale(this.locale()).humanize(!o):this.localeData().invalidDate()}function $9(e){return this.from(Vt(),e)}function V9(e,o){return this.isValid()&&(Ke(e)&&e.isValid()||Vt(e).isValid())?Qe({from:this,to:e}).locale(this.locale()).humanize(!o):this.localeData().invalidDate()}function U9(e){return this.to(Vt(),e)}function Cf(e){var o;return e===void 0?this._locale._abbr:(o=Dn(e),o!=null&&(this._locale=o),this)}var kf=$e("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function wf(){return this._locale}var ha=1e3,Xo=60*ha,pa=60*Xo,Sf=(365*400+97)*24*pa;function Wo(e,o){return(e%o+o)%o}function xf(e,o,i){return e<100&&e>=0?new Date(e+400,o,i)-Sf:new Date(e,o,i).valueOf()}function Ef(e,o,i){return e<100&&e>=0?Date.UTC(e+400,o,i)-Sf:Date.UTC(e,o,i)}function z9(e){var o,i;if(e=Ge(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(i=this._isUTC?Ef:xf,e){case"year":o=i(this.year(),0,1);break;case"quarter":o=i(this.year(),this.month()-this.month()%3,1);break;case"month":o=i(this.year(),this.month(),1);break;case"week":o=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":o=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":o=i(this.year(),this.month(),this.date());break;case"hour":o=this._d.valueOf(),o-=Wo(o+(this._isUTC?0:this.utcOffset()*Xo),pa);break;case"minute":o=this._d.valueOf(),o-=Wo(o,Xo);break;case"second":o=this._d.valueOf(),o-=Wo(o,ha);break}return this._d.setTime(o),at.updateOffset(this,!0),this}function H9(e){var o,i;if(e=Ge(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(i=this._isUTC?Ef:xf,e){case"year":o=i(this.year()+1,0,1)-1;break;case"quarter":o=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":o=i(this.year(),this.month()+1,1)-1;break;case"week":o=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":o=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":o=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":o=this._d.valueOf(),o+=pa-Wo(o+(this._isUTC?0:this.utcOffset()*Xo),pa)-1;break;case"minute":o=this._d.valueOf(),o+=Xo-Wo(o,Xo)-1;break;case"second":o=this._d.valueOf(),o+=ha-Wo(o,ha)-1;break}return this._d.setTime(o),at.updateOffset(this,!0),this}function G9(){return this._d.valueOf()-(this._offset||0)*6e4}function Y9(){return Math.floor(this.valueOf()/1e3)}function F9(){return new Date(this.valueOf())}function X9(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function W9(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function j9(){return this.isValid()?this.toISOString():null}function q9(){return $c(this)}function Z9(){return jn({},vt(this))}function J9(){return vt(this).overflow}function K9(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}pt("N",0,0,"eraAbbr"),pt("NN",0,0,"eraAbbr"),pt("NNN",0,0,"eraAbbr"),pt("NNNN",0,0,"eraName"),pt("NNNNN",0,0,"eraNarrow"),pt("y",["y",1],"yo","eraYear"),pt("y",["yy",2],0,"eraYear"),pt("y",["yyy",3],0,"eraYear"),pt("y",["yyyy",4],0,"eraYear"),ut("N",Os),ut("NN",Os),ut("NNN",Os),ut("NNNN",c7),ut("NNNNN",d7),Lt(["N","NN","NNN","NNNN","NNNNN"],function(e,o,i,r){var a=i._locale.erasParse(e,r,i._strict);a?vt(i).era=a:vt(i).invalidEra=e}),ut("y",Vo),ut("yy",Vo),ut("yyy",Vo),ut("yyyy",Vo),ut("yo",u7),Lt(["y","yy","yyy","yyyy"],ge),Lt(["yo"],function(e,o,i,r){var a;i._locale._eraYearOrdinalRegex&&(a=e.match(i._locale._eraYearOrdinalRegex)),i._locale.eraYearOrdinalParse?o[ge]=i._locale.eraYearOrdinalParse(e,a):o[ge]=parseInt(e,10)});function Q9(e,o){var i,r,a,s=this._eras||Dn("en")._eras;for(i=0,r=s.length;i<r;++i)switch(typeof s[i].since==="string"&&(a=at(s[i].since).startOf("day"),s[i].since=a.valueOf()),typeof s[i].until){case"undefined":s[i].until=1/0;break;case"string":a=at(s[i].until).startOf("day").valueOf(),s[i].until=a.valueOf();break}return s}function t7(e,o,i){var r,a,s=this.eras(),l,c,d;for(e=e.toUpperCase(),r=0,a=s.length;r<a;++r)if(l=s[r].name.toUpperCase(),c=s[r].abbr.toUpperCase(),d=s[r].narrow.toUpperCase(),i)switch(o){case"N":case"NN":case"NNN":if(c===e)return s[r];break;case"NNNN":if(l===e)return s[r];break;case"NNNNN":if(d===e)return s[r];break}else if([l,c,d].indexOf(e)>=0)return s[r]}function e7(e,o){var i=e.since<=e.until?1:-1;return o===void 0?at(e.since).year():at(e.since).year()+(o-e.offset)*i}function n7(){var e,o,i,r=this.localeData().eras();for(e=0,o=r.length;e<o;++e)if(i=this.clone().startOf("day").valueOf(),r[e].since<=i&&i<=r[e].until||r[e].until<=i&&i<=r[e].since)return r[e].name;return""}function o7(){var e,o,i,r=this.localeData().eras();for(e=0,o=r.length;e<o;++e)if(i=this.clone().startOf("day").valueOf(),r[e].since<=i&&i<=r[e].until||r[e].until<=i&&i<=r[e].since)return r[e].narrow;return""}function i7(){var e,o,i,r=this.localeData().eras();for(e=0,o=r.length;e<o;++e)if(i=this.clone().startOf("day").valueOf(),r[e].since<=i&&i<=r[e].until||r[e].until<=i&&i<=r[e].since)return r[e].abbr;return""}function r7(){var e,o,i,r,a=this.localeData().eras();for(e=0,o=a.length;e<o;++e)if(i=a[e].since<=a[e].until?1:-1,r=this.clone().startOf("day").valueOf(),a[e].since<=r&&r<=a[e].until||a[e].until<=r&&r<=a[e].since)return(this.year()-at(a[e].since).year())*i+a[e].offset;return this.year()}function a7(e){return Et(this,"_erasNameRegex")||Qc.call(this),e?this._erasNameRegex:this._erasRegex}function s7(e){return Et(this,"_erasAbbrRegex")||Qc.call(this),e?this._erasAbbrRegex:this._erasRegex}function l7(e){return Et(this,"_erasNarrowRegex")||Qc.call(this),e?this._erasNarrowRegex:this._erasRegex}function Os(e,o){return o.erasAbbrRegex(e)}function c7(e,o){return o.erasNameRegex(e)}function d7(e,o){return o.erasNarrowRegex(e)}function u7(e,o){return o._eraYearOrdinalRegex||Vo}function Qc(){var e=[],o=[],i=[],r=[],a,s,l,c,d,u=this.eras();for(a=0,s=u.length;a<s;++a)l=En(u[a].name),c=En(u[a].abbr),d=En(u[a].narrow),o.push(l),e.push(c),i.push(d),r.push(l),r.push(c),r.push(d);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+o.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+i.join("|")+")","i")}pt(0,["gg",2],0,function(){return this.weekYear()%100}),pt(0,["GG",2],0,function(){return this.isoWeekYear()%100});function _r(e,o){pt(0,[e,e.length],0,o)}_r("gggg","weekYear"),_r("ggggg","weekYear"),_r("GGGG","isoWeekYear"),_r("GGGGG","isoWeekYear"),ut("G",ca),ut("g",ca),ut("GG",Bt,Le),ut("gg",Bt,Le),ut("GGGG",gl,ml),ut("gggg",gl,ml),ut("GGGGG",la,sa),ut("ggggg",la,sa),Fi(["gggg","ggggg","GGGG","GGGGG"],function(e,o,i,r){o[r.substr(0,2)]=kt(e)}),Fi(["gg","GG"],function(e,o,i,r){o[r]=at.parseTwoDigitYear(e)});function h7(e){return Mf.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function p7(e){return Mf.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function f7(){return Mn(this.year(),1,4)}function m7(){return Mn(this.isoWeekYear(),1,4)}function g7(){var e=this.localeData()._week;return Mn(this.year(),e.dow,e.doy)}function y7(){var e=this.localeData()._week;return Mn(this.weekYear(),e.dow,e.doy)}function Mf(e,o,i,r,a){var s;return e==null?ji(this,r,a).year:(s=Mn(e,r,a),o>s&&(o=s),v7.call(this,e,o,i,r,a))}function v7(e,o,i,r,a){var s=df(e,o,i,r,a),l=Wi(s.year,0,s.dayOfYear);return this.year(l.getUTCFullYear()),this.month(l.getUTCMonth()),this.date(l.getUTCDate()),this}pt("Q",0,"Qo","quarter"),ut("Q",nf),Lt("Q",function(e,o){o[bn]=(kt(e)-1)*3});function _7(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}pt("D",["DD",2],"Do","date"),ut("D",Bt,si),ut("DD",Bt,Le),ut("Do",function(e,o){return e?o._dayOfMonthOrdinalParse||o._ordinalParse:o._dayOfMonthOrdinalParseLenient}),Lt(["D","DD"],an),Lt("Do",function(e,o){o[an]=kt(e.match(Bt)[0])});var rh=pi("Date",!0);pt("DDD",["DDDD",3],"DDDo","dayOfYear"),ut("DDD",Vr),ut("DDDD",of),Lt(["DDD","DDDD"],function(e,o,i){i._dayOfYear=kt(e)});function b7(e){var o=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?o:this.add(e-o,"d")}pt("m",["mm",2],0,"minute"),ut("m",Bt,Gc),ut("mm",Bt,Le),Lt(["m","mm"],Ze);var C7=pi("Minutes",!1);pt("s",["ss",2],0,"second"),ut("s",Bt,Gc),ut("ss",Bt,Le),Lt(["s","ss"],Cn);var k7=pi("Seconds",!1);pt("S",0,0,function(){return~~(this.millisecond()/100)}),pt(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),pt(0,["SSS",3],0,"millisecond"),pt(0,["SSSS",4],0,function(){return this.millisecond()*10}),pt(0,["SSSSS",5],0,function(){return this.millisecond()*100}),pt(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),pt(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),pt(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),pt(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ut("S",Vr,nf),ut("SS",Vr,Le),ut("SSS",Vr,of);var qn,Af;for(qn="SSSS";qn.length<=9;qn+="S")ut(qn,Vo);function w7(e,o){o[_o]=kt(("0."+e)*1e3)}for(qn="S";qn.length<=9;qn+="S")Lt(qn,w7);Af=pi("Milliseconds",!1),pt("z",0,0,"zoneAbbr"),pt("zz",0,0,"zoneName");function S7(){return this._isUTC?"UTC":""}function x7(){return this._isUTC?"Coordinated Universal Time":""}var Q=or.prototype;Q.add=y9,Q.calendar=S9,Q.clone=x9,Q.diff=O9,Q.endOf=H9,Q.format=R9,Q.from=B9,Q.fromNow=$9,Q.to=V9,Q.toNow=U9,Q.get=PT,Q.invalidAt=J9,Q.isAfter=E9,Q.isBefore=M9,Q.isBetween=A9,Q.isSame=N9,Q.isSameOrAfter=T9,Q.isSameOrBefore=I9,Q.isValid=q9,Q.lang=kf,Q.locale=Cf,Q.localeData=wf,Q.max=qI,Q.min=jI,Q.parsingFlags=Z9,Q.set=RT,Q.startOf=z9,Q.subtract=v9,Q.toArray=X9,Q.toObject=W9,Q.toDate=F9,Q.toISOString=D9,Q.inspect=P9,typeof Symbol<"u"&&Symbol.for!=null&&(Q[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Q.toJSON=j9,Q.toString=L9,Q.unix=Y9,Q.valueOf=G9,Q.creationData=K9,Q.eraName=n7,Q.eraNarrow=o7,Q.eraAbbr=i7,Q.eraYear=r7,Q.year=Ju,Q.isLeapYear=DT,Q.weekYear=h7,Q.isoWeekYear=p7,Q.quarter=Q.quarters=_7,Q.month=Ku,Q.daysInMonth=FT,Q.week=Q.weeks=QT,Q.isoWeek=Q.isoWeeks=tI,Q.weeksInYear=g7,Q.weeksInWeekYear=y7,Q.isoWeeksInYear=f7,Q.isoWeeksInISOWeekYear=m7,Q.date=rh,Q.day=Q.days=pI,Q.weekday=fI,Q.isoWeekday=mI,Q.dayOfYear=b7,Q.hour=Q.hours=kI,Q.minute=Q.minutes=C7,Q.second=Q.seconds=k7,Q.millisecond=Q.milliseconds=Af,Q.utcOffset=i9,Q.utc=a9,Q.local=s9,Q.parseZone=l9,Q.hasAlignedHourOffset=c9,Q.isDST=d9,Q.isLocal=h9,Q.isUtcOffset=p9,Q.isUtc=oh,Q.isUTC=oh,Q.zoneAbbr=S7,Q.zoneName=x7,Q.dates=$e("dates accessor is deprecated. Use date instead.",rh),Q.months=$e("months accessor is deprecated. Use month instead",Ku),Q.years=$e("years accessor is deprecated. Use year instead",Ju),Q.zone=$e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",r9),Q.isDSTShifted=$e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",u9);function E7(e){return Vt(e*1e3)}function M7(){return Vt.apply(null,arguments).parseZone()}function ah(e){return e}var xt=Uc.prototype;xt.calendar=hT,xt.longDateFormat=gT,xt.invalidDate=vT,xt.ordinal=CT,xt.preparse=ah,xt.postformat=ah,xt.relativeTime=wT,xt.pastFuture=ST,xt.set=dT,xt.eras=Q9,xt.erasParse=t7,xt.erasConvertYear=e7,xt.erasAbbrRegex=s7,xt.erasNameRegex=a7,xt.erasNarrowRegex=l7,xt.months=zT,xt.monthsShort=HT,xt.monthsParse=YT,xt.monthsRegex=WT,xt.monthsShortRegex=XT,xt.week=qT,xt.firstDayOfYear=KT,xt.firstDayOfWeek=JT,xt.weekdays=lI,xt.weekdaysMin=dI,xt.weekdaysShort=cI,xt.weekdaysParse=hI,xt.weekdaysRegex=gI,xt.weekdaysShortRegex=yI,xt.weekdaysMinRegex=vI,xt.isPM=bI,xt.meridiem=wI;function fa(e,o,i,r){var a=Dn(),s=dn().set(r,o);return a[i](s,e)}function Nf(e,o,i){if(Nn(e)&&(o=e,e=void 0),e=e||"",o!=null)return fa(e,o,i,"month");var r,a=[];for(r=0;r<12;r++)a[r]=fa(e,r,i,"month");return a}function td(e,o,i,r){typeof e=="boolean"?(Nn(o)&&(i=o,o=void 0),o=o||""):(o=e,i=o,e=!1,Nn(o)&&(i=o,o=void 0),o=o||"");var a=Dn(),s=e?a._week.dow:0,l,c=[];if(i!=null)return fa(o,(i+s)%7,r,"day");for(l=0;l<7;l++)c[l]=fa(o,(l+s)%7,r,"day");return c}function A7(e,o){return Nf(e,o,"months")}function N7(e,o){return Nf(e,o,"monthsShort")}function T7(e,o,i){return td(e,o,i,"weekdays")}function I7(e,o,i){return td(e,o,i,"weekdaysShort")}function O7(e,o,i){return td(e,o,i,"weekdaysMin")}Kn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var o=e%10,i=kt(e%100/10)===1?"th":o===1?"st":o===2?"nd":o===3?"rd":"th";return e+i}}),at.lang=$e("moment.lang is deprecated. Use moment.locale instead.",Kn),at.langData=$e("moment.langData is deprecated. Use moment.localeData instead.",Dn);var mn=Math.abs;function L7(){var e=this._data;return this._milliseconds=mn(this._milliseconds),this._days=mn(this._days),this._months=mn(this._months),e.milliseconds=mn(e.milliseconds),e.seconds=mn(e.seconds),e.minutes=mn(e.minutes),e.hours=mn(e.hours),e.months=mn(e.months),e.years=mn(e.years),this}function Tf(e,o,i,r){var a=Qe(o,i);return e._milliseconds+=r*a._milliseconds,e._days+=r*a._days,e._months+=r*a._months,e._bubble()}function D7(e,o){return Tf(this,e,o,1)}function P7(e,o){return Tf(this,e,o,-1)}function sh(e){return e<0?Math.floor(e):Math.ceil(e)}function R7(){var e=this._milliseconds,o=this._days,i=this._months,r=this._data,a,s,l,c,d;return e>=0&&o>=0&&i>=0||e<=0&&o<=0&&i<=0||(e+=sh(bl(i)+o)*864e5,o=0,i=0),r.milliseconds=e%1e3,a=Be(e/1e3),r.seconds=a%60,s=Be(a/60),r.minutes=s%60,l=Be(s/60),r.hours=l%24,o+=Be(l/24),d=Be(If(o)),i+=d,o-=sh(bl(d)),c=Be(i/12),i%=12,r.days=o,r.months=i,r.years=c,this}function If(e){return e*4800/146097}function bl(e){return e*146097/4800}function B7(e){if(!this.isValid())return NaN;var o,i,r=this._milliseconds;if(e=Ge(e),e==="month"||e==="quarter"||e==="year")switch(o=this._days+r/864e5,i=this._months+If(o),e){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(o=this._days+Math.round(bl(this._months)),e){case"week":return o/7+r/6048e5;case"day":return o+r/864e5;case"hour":return o*24+r/36e5;case"minute":return o*1440+r/6e4;case"second":return o*86400+r/1e3;case"millisecond":return Math.floor(o*864e5)+r;default:throw new Error("Unknown unit "+e)}}function Pn(e){return function(){return this.as(e)}}var Of=Pn("ms"),$7=Pn("s"),V7=Pn("m"),U7=Pn("h"),z7=Pn("d"),H7=Pn("w"),G7=Pn("M"),Y7=Pn("Q"),F7=Pn("y"),X7=Of;function W7(){return Qe(this)}function j7(e){return e=Ge(e),this.isValid()?this[e+"s"]():NaN}function No(e){return function(){return this.isValid()?this._data[e]:NaN}}var q7=No("milliseconds"),Z7=No("seconds"),J7=No("minutes"),K7=No("hours"),Q7=No("days"),tO=No("months"),eO=No("years");function nO(){return Be(this.days()/7)}var yn=Math.round,Uo={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function oO(e,o,i,r,a){return a.relativeTime(o||1,!!i,e,r)}function iO(e,o,i,r){var a=Qe(e).abs(),s=yn(a.as("s")),l=yn(a.as("m")),c=yn(a.as("h")),d=yn(a.as("d")),u=yn(a.as("M")),h=yn(a.as("w")),f=yn(a.as("y")),v=s<=i.ss&&["s",s]||s<i.s&&["ss",s]||l<=1&&["m"]||l<i.m&&["mm",l]||c<=1&&["h"]||c<i.h&&["hh",c]||d<=1&&["d"]||d<i.d&&["dd",d];return i.w!=null&&(v=v||h<=1&&["w"]||h<i.w&&["ww",h]),v=v||u<=1&&["M"]||u<i.M&&["MM",u]||f<=1&&["y"]||["yy",f],v[2]=o,v[3]=+e>0,v[4]=r,oO.apply(null,v)}function rO(e){return e===void 0?yn:typeof e=="function"?(yn=e,!0):!1}function aO(e,o){return Uo[e]===void 0?!1:o===void 0?Uo[e]:(Uo[e]=o,e==="s"&&(Uo.ss=o-1),!0)}function sO(e,o){if(!this.isValid())return this.localeData().invalidDate();var i=!1,r=Uo,a,s;return typeof e=="object"&&(o=e,e=!1),typeof e=="boolean"&&(i=e),typeof o=="object"&&(r=Object.assign({},Uo,o),o.s!=null&&o.ss==null&&(r.ss=o.s-1)),a=this.localeData(),s=iO(this,!i,r,a),i&&(s=a.pastFuture(+this,s)),a.postformat(s)}var Ls=Math.abs;function Ro(e){return(e>0)-(e<0)||+e}function br(){if(!this.isValid())return this.localeData().invalidDate();var e=Ls(this._milliseconds)/1e3,o=Ls(this._days),i=Ls(this._months),r,a,s,l,c=this.asSeconds(),d,u,h,f;return c?(r=Be(e/60),a=Be(r/60),e%=60,r%=60,s=Be(i/12),i%=12,l=e?e.toFixed(3).replace(/\.?0+$/,""):"",d=c<0?"-":"",u=Ro(this._months)!==Ro(c)?"-":"",h=Ro(this._days)!==Ro(c)?"-":"",f=Ro(this._milliseconds)!==Ro(c)?"-":"",d+"P"+(s?u+s+"Y":"")+(i?u+i+"M":"")+(o?h+o+"D":"")+(a||r||e?"T":"")+(a?f+a+"H":"")+(r?f+r+"M":"")+(e?f+l+"S":"")):"P0D"}var wt=Za.prototype;wt.isValid=t9,wt.abs=L7,wt.add=D7,wt.subtract=P7,wt.as=B7,wt.asMilliseconds=Of,wt.asSeconds=$7,wt.asMinutes=V7,wt.asHours=U7,wt.asDays=z7,wt.asWeeks=H7,wt.asMonths=G7,wt.asQuarters=Y7,wt.asYears=F7,wt.valueOf=X7,wt._bubble=R7,wt.clone=W7,wt.get=j7,wt.milliseconds=q7,wt.seconds=Z7,wt.minutes=J7,wt.hours=K7,wt.days=Q7,wt.weeks=nO,wt.months=tO,wt.years=eO,wt.humanize=sO,wt.toISOString=br,wt.toString=br,wt.toJSON=br,wt.locale=Cf,wt.localeData=wf,wt.toIsoString=$e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",br),wt.lang=kf,pt("X",0,0,"unix"),pt("x",0,0,"valueOf"),ut("x",ca),ut("X",AT),Lt("X",function(e,o,i){i._d=new Date(parseFloat(e)*1e3)}),Lt("x",function(e,o,i){i._d=new Date(kt(e))});at.version="2.30.1",lT(Vt),at.fn=Q,at.min=ZI,at.max=JI,at.now=KI,at.utc=dn,at.unix=E7,at.months=A7,at.isDate=nr,at.locale=Kn,at.invalid=Wa,at.duration=Qe,at.isMoment=Ke,at.weekdays=T7,at.parseZone=M7,at.localeData=Dn,at.isDuration=zr,at.monthsShort=N7,at.weekdaysMin=O7,at.defineLocale=Wc,at.updateLocale=MI,at.locales=AI,at.weekdaysShort=I7,at.normalizeUnits=Ge,at.relativeTimeRounding=rO,at.relativeTimeThreshold=aO,at.calendarFormat=w9,at.prototype=Q,at.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const lO={name:"FolderEditOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},cO=["aria-hidden","aria-label"],dO=["fill","width","height"],uO={d:"M4 18H12.13L11 19.13V20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.89 4 4 4H10L12 6H20C21.1 6 22 6.89 22 8V10.15C21.74 10.06 21.46 10 21.17 10C20.75 10 20.36 10.11 20 10.3V8H4V18M22.85 13.47L21.53 12.15C21.33 11.95 21 11.95 20.81 12.15L19.83 13.13L21.87 15.17L22.85 14.19C23.05 14 23.05 13.67 22.85 13.47M13 19.96V22H15.04L21.17 15.88L19.13 13.83L13 19.96Z"},hO={key:0};function pO(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-edit-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",uO,[i.title?(p(),w("title",hO,O(i.title),1)):R("",!0)])],8,dO))],16,cO)}const fO=tt(lO,[["render",pO]]);async function mO(e,o){let i=e.groups.map(r=>encodeURIComponent(r));return i=i.filter(r=>r!==encodeURIComponent(o)),ie.patch(e.url,{},{headers:{"X-PROPERTY":"CATEGORIES","X-PROPERTY-REPLACE":i.join(",")}})}async function gO(e,o,i){const r=e.groups;r.push(i);let a=r.map(s=>encodeURIComponent(s));return a=a.filter(s=>s!==encodeURIComponent(o)),ie.patch(e.url,{},{headers:{"X-PROPERTY":"CATEGORIES","X-PROPERTY-REPLACE":a.join(",")}})}const yO={name:"GroupNavigationItem",components:{ActionButton:Ln,NcCounterBubble:ka,AppNavigationItem:$l,ActionInput:Vl,IconContact:no,IconAdd:li,IconDownload:Aa,IconEmail:uh,IconRename:fO,IconDelete:Tn,IconLoading:Pe,IconContactFilled:j1},props:{group:{type:Object,required:!0},routeState:{type:String,required:!0}},data(){return{newGroupName:"",renaming:!1,deleting:!1}},computed:{contacts(){return this.$store.getters.getContacts},isEmpty(){return this.group.contacts.length===0}},methods:{isInGroup(e,o){return e.includes(o)},async onDrop(e,o){try{const i=JSON.parse(e.dataTransfer.getData("item")),r=this.$store.getters.getContact(ze.from(`${i.uid}~${i.addressbookId}`,"utf-8").toString("base64"));if(r&&!this.isInGroup(r.groups,o.id)){const a=this.$store.getters.getContact(ze.from(`${i.uid}~${i.addressbookId}`,"utf-8").toString("base64"));await this.$store.dispatch("updateContactGroups",{groupNames:[...r.groups,o.id],contact:a});const s=Object.assign(Object.create(Object.getPrototypeOf(a)),a);s.groups=[...r.groups,o.id],await this.$store.dispatch("updateContact",s)}}catch(i){console.error(i),yt("Tried to drop an invalid contact!")}finally{e.target.closest(".group-drop-area").removeAttribute("drop-active")}},onDragOver(e){e.preventDefault(),e.target.closest(".group-drop-area").setAttribute("drop-active",!0)},onDragLeave(e){e.target.closest(".group-drop-area").removeAttribute("drop-active")},addContactsToGroup(){Zo("contacts:group:append",this.group.name)},downloadGroup(e){let o={};e.contacts.forEach(r=>{const a=this.contacts[r].addressbook.id;o={[a]:{addressbook:this.contacts[r].addressbook,contacts:[]},...o},o[a].contacts.push(this.contacts[r].url)});const i=Promise.all(Object.keys(o).map(r=>o[r].addressbook.dav.addressbookMultigetExport(o[r].contacts))).then(r=>({groupName:e.name,data:r.map(a=>a.body).join("")}));this.downloadVcardPromise(i)},async downloadVcardPromise(e){e.then(o=>{const i=at().format("YYYY-MM-DD_HH-mm")+"_"+o.groupName+".vcf",r="data:text/plain;charset=utf-8,"+window.encodeURIComponent(o.data);sT(r,i,"text/vcard")})},emailGroup(e,o="to"){const i=[];e.contacts.filter(r=>this.contacts[r].email!==null).forEach(r=>{const a=this.contacts[r].email.replace(/(.*<)([^>]*)(>)/g,"$2").trim(),s=this.contacts[r].fullName.replace(/[,<>]/g,"").trim();if(a!==""){if(s===null||s===""){i.push(a);return}i.push(`${s} <${a}>`)}}),window.location.href=`mailto:?${o}=${i.map(encodeURIComponent).join(",")}`},async renameGroup(){if(this.newGroupName!==""){this.renaming=!0;for(const e of this.group.contacts){const o=this.$store.getters.getContact(e);if(o===void 0)return;try{await gO(o,this.group.name,this.newGroupName)}catch(i){console.error("Error renaming group",i)}}this.$store.commit("renameGroup",{oldGroupName:this.group.name,newGroupName:this.newGroupName}),this.renaming=!1}},async deleteGroup(){this.deleting=!0;for(const e of this.group.contacts){const o=this.$store.getters.getContact(e);if(o===void 0)return;try{await mO(o,this.group.name)}catch(i){console.error("Error deleting group",i)}}this.$store.commit("removeGroup",this.group.name),this.deleting=!1}}};function vO(e,o,i,r,a,s){const l=k("IconContactFilled"),c=k("IconContact"),d=k("IconAdd"),u=k("ActionButton"),h=k("IconLoading"),f=k("IconRename"),v=k("ActionInput"),_=k("IconDownload"),b=k("IconEmail"),C=k("IconDelete"),D=k("NcCounterBubble"),L=k("AppNavigationItem");return s.isEmpty?R("",!0):(p(),w("div",{key:0,class:"group-drop-area","data-testid":"group-drop-area",onDrop:o[6]||(o[6]=B=>s.onDrop(B,i.group)),onDragenter:o[7]||(o[7]=Zt(()=>{},["prevent"])),onDragover:o[8]||(o[8]=B=>s.onDragOver(B)),onDragleave:o[9]||(o[9]=B=>s.onDragLeave(B))},[(p(),N(L,{key:i.group.key,to:i.group.router,name:i.group.name,active:i.routeState===`group:${i.group.id}`,onClick:o[5]||(o[5]=B=>e.$emit("updateRouteState",`group:${i.group.id}`))},{icon:S(()=>[i.routeState===`group:${i.group.id}`?(p(),N(l,{key:0,size:20})):(p(),N(c,{key:1,size:20}))]),actions:S(()=>[A(u,{"close-after-click":!0,onClick:o[0]||(o[0]=B=>s.addContactsToGroup(i.group))},{icon:S(()=>[A(d,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Add contacts")),1)]),_:1}),A(v,{"model-value":a.newGroupName,"onUpdate:modelValue":o[1]||(o[1]=B=>a.newGroupName=B),disabled:a.renaming,onSubmit:s.renameGroup},{icon:S(()=>[a.renaming?(p(),N(h,{key:0,size:20})):(p(),N(f,{key:1,size:20}))]),default:S(()=>[q(" "+O(e.t("contacts","Rename")),1)]),_:1},8,["model-value","disabled","onSubmit"]),A(u,{"close-after-click":!0,onClick:o[2]||(o[2]=B=>s.downloadGroup(i.group))},{icon:S(()=>[A(_,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Export")),1)]),_:1}),A(u,{onClick:o[3]||(o[3]=B=>s.emailGroup(i.group))},{icon:S(()=>[A(b,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Send email")),1)]),_:1}),A(u,{onClick:o[4]||(o[4]=B=>s.emailGroup(i.group,"bcc"))},{icon:S(()=>[A(b,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Send email as BCC")),1)]),_:1}),A(u,{disabled:a.deleting,onClick:s.deleteGroup},{icon:S(()=>[a.deleting?(p(),N(h,{key:0,size:20})):(p(),N(C,{key:1,size:20}))]),default:S(()=>[q(" "+O(e.t("contacts","Delete")),1)]),_:1},8,["disabled","onClick"])]),counter:S(()=>[i.group.contacts.length>0?(p(),N(D,{key:0,count:i.group.contacts.length},null,8,["count"])):R("",!0)]),_:1},8,["to","name","active"]))],32))}const _O=tt(yO,[["render",vO],["__scopeId","data-v-c565d334"]]),bO=wo("contacts","isContactsInteractionEnabled",!1),CO={name:"RootNavigation",components:{ActionInput:Vl,ActionText:Bl,NcActionButton:Ln,AppNavigation:Rg,NcCounterBubble:ka,AppNavigationItem:$l,AppNavigationCaption:Pg,CircleNavigationItem:JA,Cog:Jl,ContactsSettings:oT,GroupNavigationItem:_O,IconContact:no,IconContactFilled:j1,IconUser:Li,IconUserFilled:sA,IconAdd:li,IconError:q1,IconLoading:Pe,IconRecentlyContacted:DA,NewCircleIntro:NA,NcButton:Kt},mixins:[ro],props:{loading:{type:Boolean,default:!1}},data(){return{CIRCLE_DESC:ph,CONTACTS_SETTINGS:zm,ELLIPSIS_COUNT:ds,GROUP_ALL_CONTACTS:wr,CHART_ALL_CONTACTS:Um,GROUP_NO_GROUP_CONTACTS:kr,GROUP_RECENTLY_CONTACTED:cs,isNewGroupMenuOpen:!1,createGroupError:null,isNewCircleModalOpen:!1,createCircleLoading:!1,createCircleError:null,isCirclesEnabled:Bs,isContactsInteractionEnabled:bO,collapsedGroups:!0,collapsedCircles:!0,showSettings:!1,routeState:"all"}},computed:{circles(){return this.$store.getters.getCircles},contacts(){const e=this.$store.getters.getContacts;return e.undefined&&(e[this.selectedContact]=e.undefined,delete e.undefined),this.$store.getters.getContacts},groups(){return this.$store.getters.getGroups},sortedContacts(){return this.$store.getters.getSortedContacts},userGroups(){return this.userGroupStore.userGroupList},ungroupedContacts(){return this.sortedContacts.filter(e=>this.contacts[e.key]?.groups&&this.contacts[e.key]?.groups?.length===0)},existChart(){return!!Object.keys(this.contacts).filter(e=>this.contacts[e].managersName).length},groupsMenu(){const e=this.groups.map(i=>({...i,id:i.name.replace(" ","_"),key:i.name.replace(" ","_"),router:{name:"group",params:{selectedGroup:i.name}},toString:()=>i.name}));e.sort((i,r)=>dl(i.toString(),r.toString(),{caseInsensitive:!0}));const o=e.findIndex(i=>i.name===cs);return o>=0&&e.splice(o,1),e},ellipsisGroupsMenu(){return this.isCirclesEnabled&&this.collapsedGroups?this.groupsMenu.slice(0,ds):this.groupsMenu},circlesMenu(){const e=[...this.circles||[],...this.userGroups||[]];return e.sort((o,i)=>o?.initiator?.level!==i?.initiator?.level&&o?.initiator?.level&&i?.initiator?.level?i.initiator.level-o.initiator.level:o.initiator&&!i.initiator?-1:!o.initiator&&i.initiator?1:dl(o.toString(),i.toString(),{caseInsensitive:!0})),e},ellipsisCirclesMenu(){return this.collapsedCircles?this.circlesMenu.slice(0,ds):this.circlesMenu},recentlyContactedContacts(){return this.groups.find(e=>e.name===cs)},collapseGroupsTitle(){return this.collapsedGroups?t("contacts","Show all groups"):t("contacts","Collapse groups")},collapseCirclesTitle(){return this.collapsedCircles?t("contacts","Show all teams"):t("contacts","Collapse teams")},...ch(nc)},methods:{toggleNewGroupMenu(){this.isNewGroupMenuOpen=!this.isNewGroupMenuOpen},createNewGroup(e){const o=e.target.querySelector("input[type=text]").value.trim();if(o.length===0){yt(t("contacts","Group name cannot be empty"));return}if(this.logger.debug("Creating new group",{groupName:o}),this.groups.find(i=>i.name===o)){this.createGroupError=t("contacts","This group already exists"),Zo("contacts:group:append",this.groups.find(i=>i.name===o).name);return}this.createGroupError=null,this.logger.debug("Created new local group",{groupName:o});try{this.$store.dispatch("addGroup",o),this.isNewGroupMenuOpen=!1,Zo("contacts:group:append",o)}catch{yt(t("contacts","An error occurred while creating the group"))}},onToggleGroups(){this.collapsedGroups=!this.collapsedGroups},onToggleCircles(){this.collapsedCircles=!this.collapsedCircles},toggleNewCircleModal(){this.isNewCircleModalOpen=!0},async createNewCircle(e,o,i){if(this.logger.debug("Creating new team",{circleName:e}),this.createCircleLoading=!0,this.circles.find(r=>r.name===e)){this.createCircleError=t("contacts","This team already exists");return}this.createCircleError=null;try{const r=await this.$store.dispatch("createCircle",{circleName:e,isPersonal:o,isLocal:i});this.closeNewCircleIntro(),this.$router.push({name:"circle",params:{selectedCircle:r.id}})}catch{yt(t("contacts","An error happened during the creation of the team"))}finally{this.createCircleLoading=!1}},closeNewCircleIntro(){this.isNewCircleModalOpen=!1},showContactsSettings(){this.showSettings=!0},updateRouteState(e){this.routeState=e}}},kO={class:"header"},wO={class:"app-navigation__circle-desc"},SO={class:"contacts-settings"};function xO(e,o,i,r,a,s){const l=k("IconLoading"),c=k("IconContactFilled"),d=k("IconContact"),u=k("NcCounterBubble"),h=k("AppNavigationItem"),f=k("IconUserFilled"),v=k("IconUser"),_=k("IconRecentlyContacted"),b=k("IconAdd"),C=k("IconError"),D=k("ActionText"),L=k("ActionInput"),B=k("AppNavigationCaption"),X=k("GroupNavigationItem"),nt=k("NcActionButton"),Z=k("NewCircleIntro"),rt=k("CircleNavigationItem"),st=k("Cog"),J=k("NcButton"),ot=k("ContactsSettings"),lt=k("AppNavigation");return p(),N(lt,null,{icon:S(()=>[i.loading?(p(),N(l,{key:0,size:20})):R("",!0)]),search:S(()=>[I("header",kO,[At(e.$slots,"default",{},void 0,!0)])]),list:S(()=>[A(h,{id:"everyone",name:a.GROUP_ALL_CONTACTS,to:{name:"group",params:{selectedGroup:a.GROUP_ALL_CONTACTS}},active:a.routeState==="all",onClick:o[0]||(o[0]=T=>s.updateRouteState("all"))},{icon:S(()=>[a.routeState==="all"?(p(),N(c,{key:0,size:20})):(p(),N(d,{key:1,size:20}))]),counter:S(()=>[s.sortedContacts.length?(p(),N(u,{key:0,count:s.sortedContacts.length},null,8,["count"])):R("",!0)]),_:1},8,["name","to","active"]),s.existChart?(p(),N(h,{key:0,id:"chart",name:a.CHART_ALL_CONTACTS,to:{name:"chart",params:{selectedChart:a.GROUP_ALL_CONTACTS}},active:a.routeState==="orgchart",icon:"icon-category-monitoring",onClick:o[1]||(o[1]=T=>s.updateRouteState("orgchart"))},null,8,["name","to","active"])):R("",!0),s.ungroupedContacts.length>0?(p(),N(h,{key:1,id:"notgrouped",name:a.GROUP_NO_GROUP_CONTACTS,to:{name:"group",params:{selectedGroup:a.GROUP_NO_GROUP_CONTACTS}},active:a.routeState==="notgrouped",onClick:o[2]||(o[2]=T=>s.updateRouteState("notgrouped"))},{icon:S(()=>[a.routeState==="notgrouped"?(p(),N(f,{key:0,size:20})):(p(),N(v,{key:1,size:20}))]),counter:S(()=>[s.ungroupedContacts.length?(p(),N(u,{key:0,count:s.ungroupedContacts.length},null,8,["count"])):R("",!0)]),_:1},8,["name","to","active"])):R("",!0),a.isContactsInteractionEnabled&&s.recentlyContactedContacts&&s.recentlyContactedContacts.contacts.length>0?(p(),N(h,{key:2,id:"recentlycontacted",name:e.t("contacts","Recently contacted"),to:{name:"group",params:{selectedGroup:a.GROUP_RECENTLY_CONTACTED}},active:a.routeState==="recentlycontacted",onClick:o[3]||(o[3]=T=>s.updateRouteState("recentlycontacted"))},{icon:S(()=>[A(_,{size:20})]),counter:S(()=>[s.recentlyContactedContacts.contacts.length?(p(),N(u,{key:0,count:s.recentlyContactedContacts.contacts.length},null,8,["count"])):R("",!0)]),_:1},8,["name","to","active"])):R("",!0),A(B,{id:"newgroup","menu-open":a.isNewGroupMenuOpen,"onUpdate:menuOpen":o[4]||(o[4]=T=>a.isNewGroupMenuOpen=T),"force-menu":!0,name:e.t("contacts","Contact groups"),onClick:Zt(s.toggleNewGroupMenu,["prevent","stop"])},{actionsTriggerIcon:S(()=>[A(b,{size:20})]),actions:S(()=>[Ve(A(D,null,{icon:S(()=>[a.createGroupError?(p(),N(C,{key:0,size:20})):a.createGroupError?R("",!0):(p(),N(d,{key:1,size:20}))]),default:S(()=>[q(" "+O(a.createGroupError?a.createGroupError:e.t("contacts","Create a new contact group")),1)]),_:1},512),[[$s,a.isNewGroupMenuOpen]]),Ve(A(L,{icon:"",placeholder:e.t("contacts","Contact group name"),onSubmit:Zt(s.createNewGroup,["prevent","stop"])},null,8,["placeholder","onSubmit"]),[[$s,a.isNewGroupMenuOpen]])]),_:1},8,["menu-open","name","onClick"]),(p(!0),w(mt,null,Dt(s.ellipsisGroupsMenu,T=>(p(),N(X,{key:T.key,"route-state":a.routeState,group:T,onUpdateRouteState:s.updateRouteState},null,8,["route-state","group","onUpdateRouteState"]))),128)),a.isCirclesEnabled?(p(),w(mt,{key:3},[s.groupsMenu.length>a.ELLIPSIS_COUNT?(p(),N(h,{key:0,name:s.collapseGroupsTitle,class:"app-navigation__collapse",icon:"",onClick:s.onToggleGroups},null,8,["name","onClick"])):R("",!0),A(B,{id:"newcircle",name:e.t("contacts","Teams")},{actions:S(()=>[A(nt,{onClick:s.toggleNewCircleModal},{icon:S(()=>[A(b,{size:20})]),default:S(()=>[q(" "+O(e.t("contacts","Create a new team")),1)]),_:1},8,["onClick"])]),_:1},8,["name"]),a.isNewCircleModalOpen?(p(),N(Z,{key:1,loading:a.createCircleLoading,onClose:s.closeNewCircleIntro,onSubmit:s.createNewCircle},null,8,["loading","onClose","onSubmit"])):R("",!0),s.circlesMenu.length>0?(p(),w(mt,{key:2},[(p(!0),w(mt,null,Dt(s.ellipsisCirclesMenu,T=>(p(),N(rt,{key:T.key,circle:T,onClick:V=>s.updateRouteState(`circle:${T.id}`)},null,8,["circle","onClick"]))),128)),s.circlesMenu.length>a.ELLIPSIS_COUNT?(p(),N(h,{key:0,name:s.collapseCirclesTitle,class:"app-navigation__collapse",icon:"",onClick:s.onToggleCircles},null,8,["name","onClick"])):R("",!0)],64)):R("",!0),I("li",wO,O(a.CIRCLE_DESC),1)],64)):R("",!0)]),footer:S(()=>[I("div",SO,[A(J,{"aria-label":e.t("contacts","Open the contacts app settings"),variant:"tertiary",wide:!0,onClick:s.showContactsSettings},{icon:S(()=>[A(st,{size:20})]),default:S(()=>[q(" "+O(a.CONTACTS_SETTINGS),1)]),_:1},8,["aria-label","onClick"])])]),default:S(()=>[A(ot,{open:a.showSettings,"onUpdate:open":o[5]||(o[5]=T=>a.showSettings=T)},null,8,["open"])]),_:3})}const EO=tt(CO,[["render",xO],["__scopeId","data-v-3cd11221"]]),MO={name:"ProcessingScreen",components:{EmptyContent:Qn,IconContact:no},props:{total:{type:Number,required:!0},progress:{type:Number,required:!0},desc:{type:String,required:!0},title:{type:String,required:!0}}},AO={class:"processing-screen__progress"},NO=["max","value"];function TO(e,o,i,r,a,s){const l=k("IconContact"),c=k("EmptyContent");return p(),w("div",null,[A(c,{description:i.desc,name:i.title,class:"processing-screen__wrapper"},{icon:S(()=>[A(l,{size:20})]),_:1},8,["description","name"]),I("div",AO,[I("progress",{max:i.total,value:i.progress},null,8,NO)])])}const Lf=tt(MO,[["render",TO],["__scopeId","data-v-5b1ffeb8"]]),IO={name:"AddToGroupView",components:{ProcessingScreen:Lf,NcButton:Kt},props:{failed:{type:Number,default:0},progress:{type:Number,default:0},success:{type:Number,default:0},total:{type:Number,default:0},name:{type:String,default:""}},computed:{progressHeader(){return n("contacts","{success} contact added to {name}","{success} contacts added to {name}",this.success,{success:this.success,name:this.name})},finishedHeader(){return n("contacts","Adding {success} contact to {name}","Adding {success} contacts to {name}",this.success,{success:this.success,name:this.name})},messageFailed(){return n("contacts","{count} error","{count} errors",this.failed,{count:this.failed})}},methods:{onClose(){this.$emit("close")}}},OO={class:"close__button"};function LO(e,o,i,r,a,s){const l=k("ProcessingScreen"),c=k("NcButton");return p(),w("div",null,[A(l,{progress:i.progress,total:i.total,desc:i.failed>0?s.messageFailed:"",title:i.total===i.progress?s.finishedHeader:s.progressHeader},null,8,["progress","total","desc","title"]),I("div",OO,[i.total===i.progress?(p(),N(c,{key:0,class:"primary",onClick:s.onClose},{default:S(()=>[q(O(e.t("contacts","Close")),1)]),_:1},8,["onClick"])):R("",!0)])])}const DO=tt(IO,[["render",LO],["__scopeId","data-v-1e72e682"]]),PO={name:"ContactsPicker",components:{AddToGroupView:DO,EntityPicker:yp,Modal:On},data(){return{showPicker:!1,pickerforGroup:null,pickerData:[],pickerTypes:[{id:"contact",label:t("contacts","Contacts")}],isProcessing:!1,isProcessDone:!1,processStatus:{failed:0,progress:0,success:0,total:0,name:""},passedGroupName:""}},computed:{contacts(){return this.$store.getters.getContacts},groups(){return this.$store.getters.getGroups},sortedContacts(){return this.$store.getters.getSortedContacts}},mounted(){Gr("contacts:group:append",this.addContactsToGroup)},methods:{addContactsToGroup(e){if(console.debug("Contacts picker opened for group",e),this.passedGroupName=e.name?e.name:e,typeof e=="string"&&(e=this.groups.find(o=>o.name===e),!e)){console.error("Cannot add contact to an undefined group",e);return}this.pickerData=this.sortedContacts.map(({key:o})=>{const i=this.contacts[o];return{id:i.key,label:i.displayName,type:"contact",readOnly:i.addressbook.readOnly,groups:i.groups}}).filter(o=>!o.readOnly).filter(o=>o.groups.indexOf(e.name)===-1),this.showPicker=!0,this.pickerforGroup=e},onContactPickerClose(){this.pickerData=[],this.showPicker=!1},onContactPickerPick(e){console.debug("Adding",e,"to group",this.pickerforGroup);const o=this.pickerforGroup.name;this.isProcessing=!0,this.showPicker=!1,this.processStatus.total=e.length,this.processStatus.name=this.pickerforGroup.name,this.processStatus.progress=0,this.processStatus.failed=0;const i=Hm(3),r=[];e.map(async a=>{try{const s=this.contacts[a.id];r.push(i(()=>W1(s,o).then(()=>{this.$store.dispatch("addContactToGroup",{contact:s,groupName:o}),this.processStatus.progress++,this.processStatus.success++}).catch(l=>{this.processStatus.progress++,this.processStatus.error++,console.error(l)})))}catch(s){console.error(s)}}),Promise.all(r).then(()=>{this.isProcessDone=!0,this.showPicker=!1,this.$router.push({name:"group",params:{selectedGroup:typeof this.passedGroupName=="string"?this.passedGroupName:this.passedGroupName.name}}),this.processStatus.failed===0&&setTimeout(this.closeProcess,3e3)})},closeProcess(){this.pickerforGroup=null,this.isProcessing=!1,this.isProcessDone=!1,this.processStatus.failed=0,this.processStatus.progress=0,this.processStatus.success=0,this.processStatus.total=0,!(this.passedGroupName===""||this.passedGroupName===void 0)&&this.$router.push({name:"group",params:{selectedGroup:typeof this.passedGroupName=="string"?this.passedGroupName:this.passedGroupName.name}})}}};function RO(e,o,i,r,a,s){const l=k("AddToGroupView"),c=k("Modal"),d=k("EntityPicker");return a.isProcessing||a.isProcessDone?(p(),N(c,{key:0,"clear-view-delay":-1,"can-close":a.isProcessDone,onClose:s.closeProcess},{default:S(()=>[A(l,ht(a.processStatus,{onClose:s.closeProcess}),null,16,["onClose"])]),_:1},8,["can-close","onClose"])):a.showPicker?(p(),N(d,{key:1,"confirm-label":e.t("contacts","Add to {group}",{group:a.pickerforGroup.name}),"title-label":e.t("contacts","Add members to {group}",{group:a.pickerforGroup.name}),"data-types":a.pickerTypes,"data-set":a.pickerData,"empty-data-set-description":e.t("contacts","Please note that you can only add contacts from writable address books to contact groups. Contacts from read-only address books, such as the system address book, cannot be added."),onClose:s.onContactPickerClose,onSubmit:s.onContactPickerPick},null,8,["confirm-label","title-label","data-types","data-set","empty-data-set-description","onClose","onSubmit"])):R("",!0)}const BO=tt(PO,[["render",RO]]),$O={name:"ImportView",components:{ProcessingScreen:Lf,NcButton:Kt},computed:{importState(){return this.$store.getters.getImportState},addressbook(){return this.importState.addressbook},total(){return this.importState.total},accepted(){return this.importState.accepted},failed(){return this.importState.denied},progress(){return this.accepted+this.failed},importingHeader(){return n("contacts","Importing %n contact into {addressbook}","Importing %n contacts into {addressbook}",this.total,{addressbook:this.addressbook})},importedHeader(){return n("contacts","Done importing %n contact into {addressbook}","Done importing %n contacts into {addressbook}",this.total,{addressbook:this.addressbook})},importFailed(){return n("contacts","{count} error","{count} errors",this.failed,{count:this.failed})}},methods:{onClose(){this.$emit("close")}}},VO={class:"close__button"};function UO(e,o,i,r,a,s){const l=k("ProcessingScreen"),c=k("NcButton");return p(),w("div",null,[A(l,{progress:s.progress,total:s.total,desc:s.failed>0?s.importFailed:"",title:s.total===s.progress?s.importedHeader:s.importingHeader},null,8,["progress","total","desc","title"]),I("div",VO,[s.total===s.progress?(p(),N(c,{key:0,class:"primary",onClick:s.onClose},{default:S(()=>[q(O(e.t("contacts","Close")),1)]),_:1},8,["onClick"])):R("",!0)])])}const zO=tt($O,[["render",UO],["__scopeId","data-v-50dd203a"]]),HO={name:"Contacts",components:{NcButton:Kt,CircleContent:j5,ChartContent:bC,ContactsContent:tA,ContactsPicker:BO,Content:Bg,ImportView:zO,IconAdd:li,Modal:On,RootNavigation:EO,SettingsImportContacts:Z1},mixins:[ga,ro],data(){return{appName:gm,loadingCircles:Bs,loadingContacts:!0}},computed:{addressbooks(){return this.$store.getters.getAddressbooks},contacts(){return this.$store.getters.getContacts},sortedContacts(){return this.$store.getters.getSortedContacts},groups(){return this.$store.getters.getGroups},circles(){return this.$store.getters.getCircles},orderKey(){return this.$store.getters.getOrderKey},importState(){return this.$store.getters.getImportState},isEmptyGroup(){return this.contactsList.length===0},isChartView(){return!!this.selectedChart},isImporting(){return this.importState.stage!=="default"},isImportDone(){return this.importState.stage==="done"},defaultAddressbook(){return this.addressbooks.find(e=>!e.readOnly&&e.enabled)},contactsList(){if(this.selectedGroup===wr)return this.sortedContacts;if(this.selectedGroup===kr)return this.ungroupedContacts.map(o=>this.sortedContacts.find(i=>i.key===o.key));if(this.selectedGroup===Sr||this.selectedGroup===Mi)return[];const e=this.groups.filter(o=>o.name===this.selectedGroup)[0];return e?this.sortedContacts.filter(o=>e.contacts.indexOf(o.key)>=0):[]},isCirclesView(){return this.selectedGroup===Sr||this.selectedGroup===Mi},ungroupedContacts(){return this.sortedContacts.filter(e=>this.contacts[e.key].groups&&this.contacts[e.key].groups.length===0)}},watch:{selectedGroup(){!this.isMobile&&!this.selectedChart&&this.selectFirstContactIfNone()},selectedContact(){!this.isMobile&&!this.selectedChart&&this.selectFirstContactIfNone()}},mounted(){this.isCirclesEnabled?this.logger.info("Circles frontend enabled"):this.logger.info("No compatible version of circles found")},async beforeMount(){if(Cr.connect({enableCardDAV:!0}).then(()=>{this.logger.debug("Connected to dav!",{client:Cr}),fh().setCurrentUserPrincipal(Cr),this.$store.dispatch("getAddressbooks").then(e=>{e.filter(o=>!o.readOnly).length===0?this.$store.dispatch("appendAddressbook",{displayName:t("contacts","Contacts")}).then(()=>{this.fetchContacts()}):this.fetchContacts()}),localStorage.getItem("orderKey")&&this.$store.commit("setOrder",localStorage.getItem("orderKey"))}),Bs){const e=nc();this.$store.dispatch("getCircles").then(e.getUserGroups(ya().uid)).then(()=>{this.loadingCircles=!1})}},methods:{async newContact(){if(this.isCirclesView){Zo("contacts:circles:append",this.selectedCircle.id);return}const e=new Sl(`
|
||
BEGIN:VCARD
|
||
VERSION:4.0
|
||
PRODID:-//Nextcloud Contacts v${ym}
|
||
END:VCARD
|
||
`.trim().replace(/\t/gm,""),this.defaultAddressbook);e.fullName=t("contacts","Name"),e.rev=xl.Time.fromJSDate(new Date,!0);const o=sn.properties;for(const i in o)if(o[i].default){const r=o[i].defaultValue;let a=r.value;Array.isArray(a)&&(a=[...a]);const s=e.vCard.addPropertyWithValue(i,a);r.type&&s.setParameter("type",r.type)}[wr,kr].indexOf(this.selectedGroup)===-1&&(e.groups=[this.selectedGroup]);try{await this.$store.dispatch("addContact",e),await this.$router.push({name:"contact",params:{selectedGroup:this.selectedGroup,selectedContact:e.key}})}catch(i){yt(t("contacts","Unable to create the contact.")),console.error(i)}},updateSorting(e="displayName"){this.$store.commit("setOrder",e),this.$store.commit("sortContacts")},fetchContacts(){Promise.all(this.addressbooks.map(e=>e.enabled?this.$store.dispatch("getContactsFromAddressBook",{addressbook:e}):Promise.resolve())).then(()=>{this.loadingContacts=!1,!this.isMobile&&!this.selectedChart&&this.selectFirstContactIfNone()})},selectFirstContactIfNone(){if(this.$route.name==="import")return;const e=this.contactsList.findIndex(o=>o.key===this.selectedContact)>-1;if(!this.selectedContact||!e){if(this.selectedContact&&!e&&(yt(t("contacts","Contact not found")),this.$router.push({name:"group",params:{selectedGroup:this.selectedGroup}})),!this.selectedCircle&&!this.selectedUserGroup&&!this.groups.find(o=>o.name===this.selectedGroup)&&wr!==this.selectedGroup&&kr!==this.selectedGroup&&Sr!==this.selectedGroup&&Mi!==this.selectedGroup){yt(t("contacts","Group {group} not found",{group:this.selectedGroup})),console.error("Group not found",this.selectedGroup),this.$router.push({name:"root"});return}Object.keys(this.contactsList).length&&this.$router.push({name:"contact",params:{selectedGroup:this.selectedGroup,selectedContact:Object.values(this.contactsList)[0].key}})}},closeImport(){this.$store.dispatch("changeStage","default")}}},GO={class:"import-and-new-contact-buttons"};function YO(e,o,i,r,a,s){const l=k("SettingsImportContacts"),c=k("IconAdd"),d=k("NcButton"),u=k("RootNavigation"),h=k("UserGroupContent"),f=k("CircleContent"),v=k("ChartContent"),_=k("ContactsContent"),b=k("ImportView"),C=k("Modal"),D=k("ContactsPicker"),L=k("Content");return p(),N(L,{"app-name":a.appName},{default:S(()=>[A(u,{"contacts-list":s.contactsList,loading:a.loadingContacts||a.loadingCircles,"selected-group":e.selectedGroup,"selected-contact":e.selectedContact},{default:S(()=>[I("div",GO,[!a.loadingContacts&&s.isEmptyGroup&&!s.isChartView&&!s.isCirclesView?(p(),N(l,{key:0})):R("",!0),a.loadingContacts?R("",!0):(p(),N(d,{key:1,disabled:!s.defaultAddressbook,variant:"secondary",wide:"",onClick:s.newContact},{icon:S(()=>[A(c,{size:20})]),default:S(()=>[q(" "+O(s.isCirclesView?e.t("contacts","Add member"):e.t("contacts","New contact")),1)]),_:1},8,["disabled","onClick"]))])]),_:1},8,["contacts-list","loading","selected-group","selected-contact"]),e.selectedUserGroup?(p(),N(h,{key:0,loding:a.loadingCircles},null,8,["loding"])):R("",!0),e.selectedCircle||e.selectedUserGroup?(p(),N(f,{key:1,loading:a.loadingCircles},null,8,["loading"])):e.selectedChart?(p(),N(v,{key:2,"contacts-list":s.contacts},null,8,["contacts-list"])):(p(),N(_,{key:3,"contacts-list":s.contactsList,loading:a.loadingContacts,onNewContact:s.newContact},null,8,["contacts-list","loading","onNewContact"])),s.isImporting?(p(),N(C,{key:4,"clear-view-delay":-1,"can-close":s.isImportDone,onClose:s.closeImport},{default:S(()=>[A(b,{onClose:s.closeImport},null,8,["onClose"])]),_:1},8,["can-close","onClose"])):R("",!0),A(D)]),_:1},8,["app-name"])}const po=tt(HO,[["render",YO],["__scopeId","data-v-647041df"]]),FO=$g(ci("/apps/contacts","")),Cl=Vg({history:FO,linkActiveClass:"active",routes:[{path:"/",component:po,props:!0,name:"root",redirect:{name:"group",params:{selectedGroup:t("contacts","All contacts")}},children:[{path:`/${Gm}/:selectedChart`,name:"chart",component:po},{path:"import",name:"import",component:po},{path:`${Sr}/:selectedCircle`,name:"circle",component:po},{path:":selectedGroup",name:"group",component:po},{path:":selectedGroup/:selectedContact",name:"contact",component:po},{path:`${Mi}/:selectedUserGroup`,name:"user_group",component:po}]}]}),$o=vh(Hg);$o.config.errorHandler=async function(e,o,i){Il.error(`[Vue error]: Error in ${i}: ${e}`,{error:e,vm:o,info:i}),window.onerror?.(e)};const XO=Ym();$o.use(XO),$o.use(Fm),$o.use(Cl),$o.mixin(_h),window.location.pathname.split("/")[1]==="index.php"&&window.OC.config.modRewriteWorking&&Cl.push({name:"group",params:{selectedGroup:t("contacts","All contacts")}}),$o.mount("#content");
|
||
//# sourceMappingURL=contacts-main.mjs.map
|