diff --git a/js/vendor.LICENSE.txt b/js/vendor.LICENSE.txt new file mode 100644 index 000000000..04af9eb12 --- /dev/null +++ b/js/vendor.LICENSE.txt @@ -0,0 +1,349 @@ +Included dependencies: + +@babel/runtime +version: 7.25.6 +license: MIT + +@emotion/is-prop-valid +version: 1.3.0 +license: MIT + +@emotion/memoize +version: 0.9.0 +license: MIT + +@emotion/stylis +version: 0.8.5 +license: MIT + +@emotion/unitless +version: 0.7.5 +license: MIT + +@floating-ui/core +version: 1.6.7 +license: MIT + +@floating-ui/dom +version: 1.6.10 +license: MIT + +@floating-ui/utils +version: 0.2.7 +license: MIT + +@linusborg/vue-simple-portal +version: 0.1.5 +license: Apache-2.0 + +@mdi/svg +version: 7.4.47 +license: Apache-2.0 + +@nextcloud/auth +version: 2.4.0 +license: GPL-3.0-or-later + +@nextcloud/axios +version: 2.5.0 +license: GPL-3.0 + +@nextcloud/browser-storage +version: 0.4.0 +license: GPL-3.0-or-later + +@nextcloud/capabilities +version: 1.2.0 +license: GPL-3.0-or-later + +@nextcloud/dialogs +version: 5.3.7 +license: AGPL-3.0-or-later + +@nextcloud/event-bus +version: 3.3.1 +license: GPL-3.0-or-later + +@nextcloud/files +version: 3.9.0 +license: AGPL-3.0-or-later + +@nextcloud/initial-state +version: 2.2.0 +license: GPL-3.0-or-later + +@nextcloud/l10n +version: 3.1.0 +license: GPL-3.0-or-later + +@nextcloud/logger +version: 3.0.2 +license: GPL-3.0-or-later + +@nextcloud/paths +version: 2.2.1 +license: GPL-3.0-or-later + +@nextcloud/router +version: 3.0.1 +license: GPL-3.0-or-later + +@nextcloud/sharing +version: 0.2.3 +license: GPL-3.0-or-later + +@nextcloud/timezones +version: 0.1.1 +license: AGPL-3.0-or-later + +@nextcloud/vue +version: 8.17.1 +license: AGPL-3.0-or-later + +@nextcloud/vue-select +version: 3.25.1 +license: MIT + +@popperjs/core +version: 2.11.8 +license: MIT + +@scaleflex/icons +version: 2.6.3 +license: MIT + +@scaleflex/ui +version: 2.7.0 +license: MIT + +@skjnldsv/vue-plyr +version: 7.5.0 +license: MIT + +@vueuse/components +version: 11.0.3 +license: MIT + +@vueuse/core +version: 11.0.3 +license: MIT + +@vueuse/shared +version: 11.0.3 +license: MIT + +ansi-regex +version: 6.0.1 +license: MIT + +axios +version: 1.7.7 +license: MIT + +camelcase +version: 8.0.0 +license: MIT + +cancelable-promise +version: 4.3.1 +license: MIT + +char-regex +version: 2.0.1 +license: MIT + +charenc +version: 0.0.2 +license: BSD-3-Clause + +crypt +version: 0.0.2 +license: BSD-3-Clause + +date-format-parse +version: 0.2.7 +license: MIT + +debounce +version: 2.1.1 +license: MIT + +dompurify +version: 3.1.6 +license: (MPL-2.0 OR Apache-2.0) + +emoji-mart-vue-fast +version: 15.0.2 +license: BSD-3-Clause + +escape-html +version: 1.0.3 +license: MIT + +filerobot-image-editor +version: 4.8.1 +license: MIT + +floating-vue +version: 1.0.0-beta.19 +license: MIT + +focus-trap +version: 7.5.4 +license: MIT + +hoist-non-react-statics +version: 3.3.2 +license: BSD-3-Clause + +ical.js +version: 2.0.1 +license: MPL-2.0 + +is-buffer +version: 1.1.6 +license: MIT + +its-fine +version: 1.2.5 +license: MIT + +konva +version: 9.3.14 +license: MIT + +linkify-string +version: 4.1.3 +license: MIT + +linkifyjs +version: 4.1.3 +license: MIT + +lodash.get +version: 4.4.2 +license: MIT + +lodash.merge +version: 4.6.2 +license: MIT + +md5 +version: 2.3.0 +license: BSD-3-Clause + +nanoid +version: 3.3.7 +license: MIT + +node-gettext +version: 3.0.0 +license: (MIT) + +path-browserify +version: 1.0.1 +license: MIT + +path-parse +version: 1.0.7 +license: MIT + +prop-types +version: 15.7.2 +license: MIT + +react +version: 18.3.1 +license: MIT + +react-dom +version: 18.3.1 +license: MIT + +react-filerobot-image-editor +version: 4.8.1 +license: MIT + +react-is +version: 18.3.1 +license: MIT + +react-konva +version: 18.2.10 +license: MIT + +react-reconciler +version: 0.29.2 +license: MIT + +scheduler +version: 0.23.2 +license: MIT + +semver +version: 7.6.3 +license: ISC + +string-length +version: 5.0.1 +license: MIT + +strip-ansi +version: 7.1.0 +license: MIT + +striptags +version: 3.2.0 +license: MIT + +styled-components +version: 5.3.11 +license: MIT + +tabbable +version: 6.2.0 +license: MIT + +toastify-js +version: 1.12.0 +license: MIT + +tributejs +version: 5.1.3 +license: MIT + +vite-plugin-node-polyfills +version: 0.22.0 +license: MIT + +vue +version: 2.7.16 +license: MIT + +vue-async-computed +version: 3.9.0 +license: MIT + +vue-color +version: 2.8.1 +license: MIT + +vue-demi +version: 0.14.10 +license: MIT + +vue-material-design-icons +version: 5.3.0 +license: MIT + +vue-router +version: 3.6.5 +license: MIT + +vue2-datepicker +version: 3.11.1 +license: MIT + +webdav +version: 5.7.1 +license: MIT \ No newline at end of file diff --git a/js/viewer-init.mjs b/js/viewer-init.mjs new file mode 100644 index 000000000..8a4130016 --- /dev/null +++ b/js/viewer-init.mjs @@ -0,0 +1,4790 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('viewer', '', 'js/index-9CY9Vnrl.chunk.mjs'),window.OC.filePath('viewer', '', 'js/logger-wTanTwQL.chunk.mjs'),window.OC.filePath('viewer', '', 'css/logger-B0wUvUiR.chunk.css')])))=>i.map(i=>d[i]); +/*! third party licenses: js/vendor.LICENSE.txt */ +import{A as te,B as Ol,V as ka,C as Zs,N as wa,D as Is,E as at,F as Hs,G as Ca,H as st,o as Wt,I as Nl,J as xl,z as M,K as Ml,P as jl,n as ii,L as oe,M as Na,O as Yl,Q as ql,R as x,c as ma,S as Pa,T as Ll,j as Rn,_ as Ps,U as mo,W as Zl,X as po,Y as Ti,Z as nn,$ as Cn,a0 as Il,a1 as Yt,a2 as Hl,a3 as Pl,a4 as Gs,a5 as Bn,a6 as Gl,a7 as On,a8 as Us,a9 as on,s as j0,u as Y0,aa as Nn,ab as Ul,ac as zl,ad as Wl,ae as zs,af as Vl,ag as xn,ah as $l,ai as Ql,aj as Kl,ak as Jl,al as Xl,am as e1,an as a1,ao as t1,ap as Ws,aq as i1,ar as Vs,as as n1,at as o1,au as s1,av as r1,aw as l1,az as _1,aA as $s,aB as d1,aC as f1,aE as g1,aF as h1,aG as F1,aH as u1,aI as c1,aJ as m1,aK as p1,aL as b1,aM as Qs,aN as Ks,aO as T1,aP as D1,aQ as y1,aR as E1,aS as k1,aT as A1,aU as Z2,aV as Js,aW as w1,aX as v1,aY as S1,aZ as Xs,a_ as R1,a$ as C1,b0 as B1,b1 as O1,x as Di,b2 as N1,b3 as x1,b4 as M1,b5 as I2,b6 as j1,b7 as Y1,b8 as q1,b9 as Ot,r as Mn,q as qa,ba as L1,bb as Z1,bc as I1,v as H1,g as P1,bd as G1,k as U1}from"./logger-wTanTwQL.chunk.mjs";import{C as jn,N as z1}from"./NcActionButton-nkutStw-.chunk.mjs";import W1 from"./NcActionLink-DgFezF1w.chunk.mjs";import{A as er,a as V1}from"./actionText-fFcUPi2g-1UIVDoW6.chunk.mjs";const Cl="viewer",Bl="4.0.0",$1={name:"NcIconSvgWrapper",props:{inline:{type:Boolean,default:!1},svg:{type:String,default:""},name:{type:String,default:""},path:{type:String,default:""},size:{type:[Number,String],default:20,validator:e=>typeof e=="number"||e==="auto"}},computed:{iconSize(){return typeof this.size=="number"?"".concat(this.size,"px"):this.size},cleanSvg(){if(!this.svg||this.path)return;const e=Ol.sanitize(this.svg),a=new DOMParser().parseFromString(e,"image/svg+xml");return a.querySelector("parsererror")?(ka.util.warn("SVG is not valid"),""):(a.documentElement.id&&a.documentElement.removeAttribute("id"),a.documentElement.outerHTML)},attributes(){return{class:["icon-vue",{"icon-vue--inline":this.inline}],style:{"--icon-size":this.iconSize},role:"img","aria-hidden":this.name?void 0:!0,"aria-label":this.name||void 0}}}};var Q1=function(){var e=this,a=e._self._c;return e.cleanSvg?a("span",e._b({domProps:{innerHTML:e._s(e.cleanSvg)}},"span",e.attributes,!1)):a("span",e._b({},"span",e.attributes,!1),[a("svg",{attrs:{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"}},[a("path",{attrs:{d:e.path}})])])},K1=[],J1=te($1,Q1,K1,!1,null,"2d0a4d76");const y0=J1.exports,X1=Zs({name:"NcDialogButton",components:{NcButton:wa,NcIconSvgWrapper:y0},props:{callback:{type:Function,required:!1,default:()=>{}},label:{type:String,required:!0},icon:{type:String,required:!1,default:void 0},type:{type:String,required:!1,default:"secondary",validator:e=>typeof e=="string"&&["primary","secondary","tertiary","error","warning","success"].includes(e)},nativeType:{type:String,required:!1,default:"button",validator(e){return["submit","reset","button"].includes(e)}},disabled:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:a}){return{handleClick:i=>{var n;(n=e.callback)==null||n.call(e),a("click",i)}}}});var e_=function(){var e=this,a=e._self._c;return e._self._setupProxy,a("NcButton",{attrs:{"aria-label":e.label,disabled:e.disabled,"native-type":e.nativeType,type:e.type},on:{click:e.handleClick},scopedSlots:e._u([{key:"icon",fn:function(){return[e._t("icon",function(){return[e.icon!==void 0?a("NcIconSvgWrapper",{attrs:{svg:e.icon}}):e._e()]})]},proxy:!0}],null,!0)},[e._v(" "+e._s(e.label)+" ")])},a_=[],t_=te(X1,e_,a_,!1,null,null);const i_=t_.exports,n_=Zs({name:"NcDialog",components:{NcDialogButton:i_,NcModal:Is},props:{name:{type:String,required:!0},message:{type:String,default:""},additionalTrapElements:{type:Array,validator:e=>Array.isArray(e)&&e.every(a=>typeof a=="string"||a instanceof HTMLElement),default:()=>[]},container:{type:String,required:!1,default:"body"},open:{type:Boolean,default:!0},size:{type:String,required:!1,default:"small",validator:e=>typeof e=="string"&&["small","normal","large","full"].includes(e)},buttons:{type:Array,required:!1,default:()=>[],validator:e=>Array.isArray(e)&&e.every(a=>typeof a=="object")},canClose:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!1},isForm:{type:Boolean,default:!1},outTransition:{type:Boolean,default:!1},navigationClasses:{type:[String,Array,Object],required:!1,default:""},navigationAriaLabel:{type:String,required:!1,default:""},navigationAriaLabelledby:{type:String,required:!1,default:""},contentClasses:{type:[String,Array,Object],required:!1,default:""},dialogClasses:{type:[String,Array,Object],required:!1,default:""}},emits:["closing","update:open","submit"],setup(e,{emit:a,slots:i}){const n=at(),{width:o}=Hs(n,{width:900}),s=Ca(()=>o.value<876),r=Ca(()=>i?.navigation!==void 0),_=st(),l=Ca(()=>e.navigationAriaLabel||void 0),g=Ca(()=>{if(!e.navigationAriaLabel)return e.navigationAriaLabelledby||_}),d=at(),f=Ca(()=>e.isForm&&!r.value?"form":"div"),h=Ca(()=>f.value==="form"?{submit(w){w.preventDefault(),a("submit",w)}}:{}),u=at(!0),m=()=>{f.value==="form"&&!d.value.reportValidity()||(b(),window.setTimeout(()=>y(),300))},b=()=>{u.value=!1,a("closing")},y=()=>{u.value=!0,a("update:open",!1)},k=Ca(()=>({canClose:e.canClose,container:e.container===void 0?"body":e.container,labelId:_,size:e.size,show:e.open&&u.value,outTransition:e.outTransition,closeOnClickOutside:e.closeOnClickOutside,additionalTrapElements:e.additionalTrapElements}));return{dialogElement:d,dialogListeners:h,dialogTagName:f,handleButtonClose:m,handleClosing:b,handleClosed:y,hasNavigation:r,navigationId:_,navigationAriaLabelAttr:l,navigationAriaLabelledbyAttr:g,isNavigationCollapsed:s,modalProps:k,wrapper:n}}});var o_=function(){var e=this,a=e._self._c;return e._self._setupProxy,e.open?a("NcModal",e._b({staticClass:"dialog__modal",attrs:{"enable-slideshow":!1,"enable-swipe":!1},on:{close:e.handleClosed,"update:show":e.handleClosing}},"NcModal",e.modalProps,!1),[a("h2",{staticClass:"dialog__name",attrs:{id:e.navigationId},domProps:{textContent:e._s(e.name)}}),a(e.dialogTagName,e._g({ref:"dialogElement",tag:"component",staticClass:"dialog",class:e.dialogClasses},e.dialogListeners),[a("div",{ref:"wrapper",class:["dialog__wrapper",{"dialog__wrapper--collapsed":e.isNavigationCollapsed}]},[e.hasNavigation?a("nav",{staticClass:"dialog__navigation",class:e.navigationClasses,attrs:{"aria-label":e.navigationAriaLabelAttr,"aria-labelledby":e.navigationAriaLabelledbyAttr}},[e._t("navigation",null,{isCollapsed:e.isNavigationCollapsed})],2):e._e(),a("div",{staticClass:"dialog__content",class:e.contentClasses},[e._t("default",function(){return[a("p",{staticClass:"dialog__text"},[e._v(" "+e._s(e.message)+" ")])]})],2)]),a("div",{staticClass:"dialog__actions"},[e._t("actions",function(){return e._l(e.buttons,function(i,n){return a("NcDialogButton",e._b({key:n,on:{click:e.handleButtonClose}},"NcDialogButton",i,!1))})})],2)])],1):e._e()},s_=[],r_=te(n_,o_,s_,!1,null,"de9f48dc");const U2=r_.exports;function ar(){try{return Wt("core","capabilities")}catch{return console.debug("Could not find capabilities initial state fall back to _oc_capabilities"),"_oc_capabilities"in window?window._oc_capabilities:{}}}const l_='';function q0(e,a,i){window.OCP.Files.Router.goToRoute(null,{view:a.id,fileid:String(e.fileid)},{dir:i,openfile:"true"},!0)}async function __(e,a,i){const n=()=>{const o={...window.OCP.Files.Router.query};delete o.openfile,window.OCP.Files.Router.goToRoute(null,window.OCP.Files.Router.params,o)};return q0(e,a,i),window.OCA.Viewer.open({path:e.path,onPrev:q0,onNext:q0,onClose:n}),null}function d_(){Nl(new xl({id:"view",displayName:()=>M("viewer","View"),iconSvgInline:()=>l_,default:Ml.DEFAULT,enabled:e=>e.some(a=>!(a.isDavRessource&&a.root?.startsWith("/files")))?!1:e.every(a=>!!(a.permissions&jl.READ)&&window.OCA.Viewer.mimetypes.includes(a.mime)),exec:__}))}function si(e,a,i){e.$set(e.$data._asyncComputed[a],"state",i),e.$set(e.$data._asyncComputed[a],"updating",i==="updating"),e.$set(e.$data._asyncComputed[a],"error",i==="error"),e.$set(e.$data._asyncComputed[a],"success",i==="success")}function f_(e){return typeof e=="function"?e:e.get}function sn(e,a){return Object.prototype.hasOwnProperty.call(e,a)}function Yn(e){return sn(e,"lazy")&&e.lazy}function g_(e,a){return e[qn+a]}var qn="async_computed$lazy_active$",Vt="async_computed$lazy_data$";function h_(e,a,i){e[qn+a]=!1,e[Vt+a]=i}function F_(e){return{get:function(){return this[qn+e]=!0,this[Vt+e]},set:function(a){this[Vt+e]=a}}}function u_(e,a,i){e[Vt+a]=i}function c_(e,a){return e[Vt+a]}var m_=function(e){return function(){var a=this;return e.watch.forEach(function(i){var n=i.split(".");if(n.length===1)a[i];else try{var o=a;n.forEach(function(s){o=o[s]})}catch(s){throw console.error("AsyncComputed: bad path: ",i),s}}),e.get.call(this)}},p_=function(e){return function(){return e.watch.call(this),e.get.call(this)}};function b_(e){if(typeof e.watch=="function")return p_(e);if(Array.isArray(e.watch))return e.watch.forEach(function(a){if(typeof a!="string")throw new Error("AsyncComputed: watch elemnts must be strings")}),m_(e);throw Error("AsyncComputed: watch should be function or an array")}var tr=typeof Symbol=="function"?Symbol("did-not-update"):{},T_=function(e,a){return function(){return e.shouldUpdate.call(this)?a.call(this):tr}},D_=function(e){return tr===e},ir="_async_computed$",nr={install:function(e,a){a=a||{},e.config.optionMergeStrategies.asyncComputed=e.config.optionMergeStrategies.computed,e.mixin({data:function(){return{_asyncComputed:{}}},computed:{$asyncComputed:function(){return this.$data._asyncComputed}},beforeCreate:function(){var i=this.$options.asyncComputed||{};if(Object.keys(i).length){for(var n in i){var o=k_(n,i[n]);this.$options.computed[ir+n]=o}this.$options.data=E_(this.$options,a)}},created:function(){for(var i in this.$options.asyncComputed||{}){var n=this.$options.asyncComputed[i],o=or.call(this,n,a);Yn(n)?u_(this,i,o):this[i]=o}for(var s in this.$options.asyncComputed||{})y_(this,s,a,e)}})}};function y_(e,a,i,n){var o=0,s=function(r){var _=++o;D_(r)||((!r||!r.then)&&(r=Promise.resolve(r)),si(e,a,"updating"),r.then(function(l){_===o&&(si(e,a,"success"),e[a]=l)}).catch(function(l){if(_===o&&(si(e,a,"error"),n.set(e.$data._asyncComputed[a],"exception",l),i.errorHandler!==!1)){var g=i.errorHandler===void 0?console.error.bind(console,"Error evaluating async computed property:"):i.errorHandler;i.useRawError?g(l,e,l.stack):g(l.stack)}}))};n.set(e.$data._asyncComputed,a,{exception:null,update:function(){e._isDestroyed||s(f_(e.$options.asyncComputed[a]).apply(e))}}),si(e,a,"updating"),e.$watch(ir+a,s,{immediate:!0})}function E_(e,a){var i=e.data,n=e.asyncComputed||{};return function(o){var s=(typeof i=="function"?i.call(this,o):i)||{};for(var r in n){var _=this.$options.asyncComputed[r],l=or.call(this,_,a);Yn(_)?(h_(s,r,l),this.$options.computed[r]=F_(r)):s[r]=l}return s}}function k_(e,a){if(typeof a=="function")return a;var i=a.get;if(sn(a,"watch")&&(i=b_(a)),sn(a,"shouldUpdate")&&(i=T_(a,i)),Yn(a)){var n=i;i=function(){return g_(this,e)?n.call(this):c_(this,e)}}return i}function or(e,a){var i=null;return"default"in e?i=e.default:"default"in a&&(i=a.default),typeof i=="function"?i.call(this):i}typeof window<"u"&&window.Vue&&window.Vue.use(nr);const A_={name:"PlayCircleOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var w_=function(){var e=this,a=e._self._c;return a("span",e._b({staticClass:"material-design-icon play-circle-outline-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(i){return e.$emit("click",i)}}},"span",e.$attrs,!1),[a("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[a("path",{attrs:{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,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M10,16.5L16,12L10,7.5V16.5Z"}},[e.title?a("title",[e._v(e._s(e.title))]):e._e()])])])},v_=[],S_=ii(A_,w_,v_,!1,null,null);const R_=S_.exports;oe();let sr=class rr{static fromString(a){return new rr(a)}constructor(a){this.value=a}icaltype="binary";decodeValue(){return this._b64_decode(this.value)}setEncodedValue(a){this.value=this._b64_encode(a)}_b64_encode(a){let i,n,o,s,r,_,l,g,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f=0,h=0,u="",m=[];if(!a)return a;do i=a.charCodeAt(f++),n=a.charCodeAt(f++),o=a.charCodeAt(f++),g=i<<16|n<<8|o,s=g>>18&63,r=g>>12&63,_=g>>6&63,l=63&g,m[h++]=d.charAt(s)+d.charAt(r)+d.charAt(_)+d.charAt(l);while(f>16&255,n=g>>8&255,o=255&g,m[h++]=_==64?String.fromCharCode(i):l==64?String.fromCharCode(i,n):String.fromCharCode(i,n,o);while(fn)-(i12||(n=[0,31,28,31,30,31,30,31,31,30,31,30,31][a],a==2&&(n+=N.isLeapYear(i))),n}static isLeapYear(a){return a<=1752?a%4==0:a%4==0&&a%100!=0||a%400==0}static fromDayOfYear(a,i){let n=i,o=a,s=new N;s.auto_normalize=!1;let r=N.isLeapYear(n)?1:0;if(o<1)return n--,r=N.isLeapYear(n)?1:0,o+=N.daysInYearPassedMonth[r][12],N.fromDayOfYear(o,n);if(o>N.daysInYearPassedMonth[r][12])return r=N.isLeapYear(n)?1:0,o-=N.daysInYearPassedMonth[r][12],n++,N.fromDayOfYear(o,n);s.year=n,s.isDate=!0;for(let _=11;_>=0;_--)if(o>N.daysInYearPassedMonth[r][_]){s.month=_+1,s.day=o-N.daysInYearPassedMonth[r][_];break}return s.auto_normalize=!0,s}static fromStringv2(a){return new N({year:parseInt(a.slice(0,4),10),month:parseInt(a.slice(5,7),10),day:parseInt(a.slice(8,10),10),isDate:!0})}static fromDateString(a){return new N({year:Le(a.slice(0,4)),month:Le(a.slice(5,7)),day:Le(a.slice(8,10)),isDate:!0})}static fromDateTimeString(a,i){if(a.length<19)throw new Error('invalid date-time value: "'+a+'"');let n,o;a[19]&&a[19]==="Z"?n=X.utcTimezone:i&&(o=i.getParameter("tzid"),i.parent&&(i.parent.name==="standard"||i.parent.name==="daylight"?n=X.localTimezone:o&&(n=i.parent.getTimeZoneByID(o))));const s={year:Le(a.slice(0,4)),month:Le(a.slice(5,7)),day:Le(a.slice(8,10)),hour:Le(a.slice(11,13)),minute:Le(a.slice(14,16)),second:Le(a.slice(17,19))};return o&&!n&&(s.timezone=o),new N(s,n)}static fromString(a,i){return a.length>10?N.fromDateTimeString(a,i):N.fromDateString(a)}static fromJSDate(a,i){return new N().fromJSDate(a,i)}static fromData=function(a,i){return new N().fromData(a,i)};static now(){return N.fromJSDate(new Date,!1)}static weekOneStarts(a,i){let n=N.fromData({year:a,month:1,day:1,isDate:!0}),o=n.dayOfWeek(),s=i||N.DEFAULT_WEEK_START;return o>N.THURSDAY&&(n.day+=7),s>N.THURSDAY&&(n.day-=7),n.day-=o-s,n}static getDominicalLetter(a){let i="GFEDCBA",n=(a+(a/4|0)+(a/400|0)-(a/100|0)-1)%7;return N.isLeapYear(a)?i[(n+6)%7]+i[n]:i[n]}static#e=null;static get epochTime(){return this.#e||(this.#e=N.fromData({year:1970,month:1,day:1,hour:0,minute:0,second:0,isDate:!1,timezone:"Z"})),this.#e}static _cmp_attr(a,i,n){return a[n]>i[n]?1:a[n]=0){_.day=1,s!=0&&s--,r=_.day;let l=a-_.dayOfWeek();l<0&&(l+=7),r+=l,r-=a,n=a}else _.day=o,s++,n=_.dayOfWeek()-a,n<0&&(n+=7),n=o-n;return n+=7*s,r+n}isNthWeekDay(a,i){let n=this.dayOfWeek();return i===0&&n===a||this.nthWeekDay(a,i)===this.day}weekNumber(a){let i,n=(this.year<<12)+(this.month<<8)+(this.day<<3)+a;if(n in N._wnCache)return N._wnCache[n];let o=this.clone();o.isDate=!0;let s=this.year;o.month==12&&o.day>25?(i=N.weekOneStarts(s+1,a),o.compare(i)<0?i=N.weekOneStarts(s,a):s++):(i=N.weekOneStarts(s,a),o.compare(i)<0&&(i=N.weekOneStarts(--s,a)));let r=Oe(o.subtractDate(i).toSeconds()/86400/7)+1;return N._wnCache[n]=r,r}addDuration(a){let i=a.isNegative?-1:1,n=this.second,o=this.minute,s=this.hour,r=this.day;n+=i*a.seconds,o+=i*a.minutes,s+=i*a.hours,r+=i*a.days,r+=7*i*a.weeks,this.second=n,this.minute=o,this.hour=s,this.day=r,this._cachedUnixTime=null}subtractDate(a){let i=this.toUnixTime()+this.utcOffset(),n=a.toUnixTime()+a.utcOffset();return Ie.fromSeconds(i-n)}subtractDateTz(a){let i=this.toUnixTime(),n=a.toUnixTime();return Ie.fromSeconds(i-n)}compare(a){let i=this.toUnixTime(),n=a.toUnixTime();return i>n?1:n>i?-1:0}compareDateOnlyTz(a,i){let n=this.convertToZone(i),o=a.convertToZone(i),s=0;return(s=N._cmp_attr(n,o,"year"))!=0||(s=N._cmp_attr(n,o,"month"))!=0||(s=N._cmp_attr(n,o,"day")),s}convertToZone(a){let i=this.clone(),n=this.zone.tzid==a.tzid;return this.isDate||n||X.convert_time(i,this.zone,a),i.zone=a,i}utcOffset(){return this.zone==X.localTimezone||this.zone==X.utcTimezone?0:this.zone.utcOffset(this)}toICALString(){let a=this.toString();return a.length>10?xe.icalendar.value["date-time"].toICAL(a):xe.icalendar.value.date.toICAL(a)}toString(){let a=this.year+"-"+Ve(this.month)+"-"+Ve(this.day);return this.isDate||(a+="T"+Ve(this.hour)+":"+Ve(this.minute)+":"+Ve(this.second),this.zone===X.utcTimezone&&(a+="Z")),a}toJSDate(){return this.zone==X.localTimezone?this.isDate?new Date(this.year,this.month-1,this.day):new Date(this.year,this.month-1,this.day,this.hour,this.minute,this.second,0):new Date(1e3*this.toUnixTime())}_normalize(){return this._time.isDate&&(this._time.hour=0,this._time.minute=0,this._time.second=0),this.adjust(0,0,0,0),this}adjust(a,i,n,o,s){let r,_,l,g,d,f,h,u=0,m=0,b=s||this._time;if(b.isDate||(l=b.second+o,b.second=l%60,r=Oe(l/60),b.second<0&&(b.second+=60,r--),g=b.minute+n+r,b.minute=g%60,_=Oe(g/60),b.minute<0&&(b.minute+=60,_--),d=b.hour+i+_,b.hour=d%24,u=Oe(d/24),b.hour<0&&(b.hour+=24,u--)),b.month>12?m=Oe((b.month-1)/12):b.month<1&&(m=Oe(b.month/12)-1),b.year+=m,b.month-=12*m,f=b.day+a+u,f>0)for(;h=N.daysInMonth(b.month,b.year),!(f<=h);)b.month++,b.month>12&&(b.year++,b.month=1),f-=h;else for(;f<=0;)b.month==1?(b.year--,b.month=12):b.month--,f+=N.daysInMonth(b.month,b.year);return b.day=f,this._cachedUnixTime=null,this}fromUnixTime(a){this.zone=X.utcTimezone;let i=new Date(1e3*a);this.year=i.getUTCFullYear(),this.month=i.getUTCMonth()+1,this.day=i.getUTCDate(),this._time.isDate?(this.hour=0,this.minute=0,this.second=0):(this.hour=i.getUTCHours(),this.minute=i.getUTCMinutes(),this.second=i.getUTCSeconds()),this._cachedUnixTime=null}toUnixTime(){if(this._cachedUnixTime!==null)return this._cachedUnixTime;let a=this.utcOffset(),i=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second-a);return this._cachedUnixTime=i/1e3,this._cachedUnixTime}toJSON(){let a,i=["year","month","day","hour","minute","second","isDate"],n=Object.create(null),o=0,s=i.length;for(;o1)throw new Ka("invalid ical body. component began but did not end");return a=null,i.length==1?i[0]:i}he.property=function(e,a){let i={component:[[],[]],designSet:a||xe.defaultSet};return he._handleContentLine(e,i),i.component[1][0]},he.component=function(e){return he(e)};class Ka extends Error{constructor(a){super(a),this.name=this.constructor.name;try{throw new Error}catch(i){if(i.stack){let n=i.stack.split(` +`);n.shift(),this.stack=n.join(` +`)}}}}he.ParserError=Ka,he._handleContentLine=function(e,a){let i,n,o,s,r,_,l=e.indexOf(":"),g=e.indexOf(";"),d={};if(g!==-1&&l!==-1&&g>l&&(g=-1),g!==-1){if(o=e.slice(0,Math.max(0,g)).toLowerCase(),r=he._parseParameters(e.slice(Math.max(0,g)),0,a.designSet),r[2]==-1)throw new Ka("Invalid parameters in '"+e+"'");if(d=r[0],i=r[1].length+r[2]+g,(n=e.slice(Math.max(0,i)).indexOf(":"))===-1)throw new Ka("Missing parameter value in '"+e+"'");s=e.slice(Math.max(0,i+n+1))}else{if(l===-1)throw new Ka('invalid line (no token ";" or ":") "'+e+'"');if(o=e.slice(0,Math.max(0,l)).toLowerCase(),s=e.slice(Math.max(0,l+1)),o==="begin"){let k=[s.toLowerCase(),[],[]];return a.stack.length===1?a.component.push(k):a.component[2].push(k),a.stack.push(a.component),a.component=k,void(a.designSet||(a.designSet=xe.getDesignSet(a.component[0])))}if(o==="end")return void(a.component=a.stack.pop())}let f,h,u,m,b=!1,y=!1;a.designSet.propertyGroups&&o.indexOf(".")!==-1?(h=o.split("."),d.group=h[0],u=h[1]):u=o,u in a.designSet.property&&(f=a.designSet.property[u],"multiValue"in f&&(b=f.multiValue),"structuredValue"in f&&(y=f.structuredValue),s&&"detectType"in f&&(_=f.detectType(s))),_||(_="value"in d?d.value.toLowerCase():f?f.defaultType:"unknown"),delete d.value,b&&y?(s=he._parseMultiValue(s,y,_,[],b,a.designSet,y),m=[u,d,_,s]):b?(m=[u,d,_],he._parseMultiValue(s,b,_,m,null,a.designSet,!1)):y?(s=he._parseMultiValue(s,y,_,[],null,a.designSet,y),m=[u,d,_,s]):(s=he._parseValue(s,_,a.designSet,!1),m=[u,d,_,s]),a.component[0]!=="vcard"||a.component[1].length!==0||o==="version"&&s==="4.0"||(a.designSet=xe.getDesignSet("vcard3")),a.component[1].push(m)},he._parseValue=function(e,a,i,n){return a in i.value&&"fromICAL"in i.value[a]?i.value[a].fromICAL(e,n):e},he._parseParameters=function(e,a,i){let n,o,s,r,_,l,g=a,d=0,f={},h=-1;for(;d!==!1&&(d=oa(e,"=",d+1))!==-1;){if(n=e.slice(g+1,d),n.length==0)throw new Ka("Empty parameter name in '"+e+"'");if(o=n.toLowerCase(),l=!1,_=!1,r=o in i.param&&i.param[o].valueType?i.param[o].valueType:"text",o in i.param&&(_=i.param[o].multiValue,i.param[o].multiValueSeparateDQuote&&(l=he._rfc6868Escape('"'+_+'"'))),e[d+1]==='"'){if(h=d+2,d=oa(e,'"',h),_&&d!=-1){let u=!0;for(;u;)e[d+1]==_&&e[d+2]=='"'?d=oa(e,'"',d+3):u=!1}if(d===-1)throw new Ka('invalid line (no matching double quote) "'+e+'"');s=e.slice(h,d),g=oa(e,";",d),g===-1&&(d=!1)}else{h=d+1;let u=oa(e,";",h),m=oa(e,":",h);m!==-1&&u>m?(u=m,d=!1):u===-1?(u=m===-1?e.length:m,d=!1):(g=u,d=u),s=e.slice(h,u)}if(s=he._rfc6868Escape(s),_){let u=l||_;s=he._parseMultiValue(s,u,r,[],null,i)}else s=he._parseValue(s,r,i);_&&o in f?Array.isArray(f[o])?f[o].push(s):f[o]=[f[o],s]:f[o]=s}return[f,s,h]},he._rfc6868Escape=function(e){return e.replace(/\^['n^]/g,function(a){return x_[a]})},he._parseMultiValue=function(e,a,i,n,o,s,r){let _,l=0,g=0;if(a.length===0)return e;for(;(l=oa(e,a,g))!==-1;)_=e.slice(g,l),_=o?he._parseMultiValue(_,o,i,[],null,s,r):he._parseValue(_,i,s,r),n.push(_),g=l+a.length;return _=e.slice(g),_=o?he._parseMultiValue(_,o,i,[],null,s,r):he._parseValue(_,i,s,r),n.push(_),n.length==1?n[0]:n},he._eachLine=function(e,a){let i,n,o,s=e.length,r=e.search(N_),_=r;do _=e.indexOf(` +`,r)+1,o=_>1&&e[_-2]==="\r"?2:1,_===0&&(_=s,o=0),n=e[r],n===" "||n===" "?i+=e.slice(r+1,_-o):(i&&a(null,i),i=e.slice(r,_-o)),r=_;while(_!==s);i=i.trim(),i.length&&a(null,i)};const M_=["tzid","location","tznames","latitude","longitude"];class X{static _compare_change_fn(a,i){return a.yeari.year?1:a.monthi.month?1:a.dayi.day?1:a.houri.hour?1:a.minutei.minute?1:a.secondi.second?1:0}static convert_time(a,i,n){if(a.isDate||i.tzid==n.tzid||i==X.localTimezone||n==X.localTimezone)return a.zone=n,a;let o=i.utcOffset(a);return a.adjust(0,0,0,-o),o=n.utcOffset(a),a.adjust(0,0,0,o),null}static fromData(a){return new X().fromData(a)}static#e=null;static get utcTimezone(){return this.#e||(this.#e=X.fromData({tzid:"UTC"})),this.#e}static#a=null;static get localTimezone(){return this.#a||(this.#a=X.fromData({tzid:"floating"})),this.#a}static adjust_change(a,i,n,o,s){return N.prototype.adjust.call(a,i,n,o,s,a)}static _minimumExpansionYear=-1;static EXTRA_COVERAGE=5;constructor(a){this.wrappedJSObject=this,this.fromData(a)}tzid="";location="";tznames="";latitude=0;longitude=0;component=null;expandedUntilYear=0;icalclass="icaltimezone";fromData(a){if(this.expandedUntilYear=0,this.changes=[],a instanceof $e)this.component=a;else{if(a&&"component"in a)if(typeof a.component=="string"){let i=he(a.component);this.component=new $e(i)}else a.component instanceof $e?this.component=a.component:this.component=null;for(let i of M_)a&&i in a&&(this[i]=a[i])}return this.component instanceof $e&&!this.tzid&&(this.tzid=this.component.getFirstPropertyValue("tzid")),this}utcOffset(a){if(this==X.utcTimezone||this==X.localTimezone||(this._ensureCoverage(a.year),!this.changes.length))return 0;let i={year:a.year,month:a.month,day:a.day,hour:a.hour,minute:a.minute,second:a.second},n=this._findNearbyChange(i),o=-1,s=1;for(;;){let _=rt(this.changes[n],!0);if(_.utcOffset<_.prevUtcOffset?X.adjust_change(_,0,0,0,_.utcOffset):X.adjust_change(_,0,0,0,_.prevUtcOffset),X._compare_change_fn(i,_)>=0?o=n:s=-1,s==-1&&o!=-1)break;if(n+=s,n<0)return 0;if(n>=this.changes.length)break}let r=this.changes[o];if(r.utcOffset-r.prevUtcOffset<0&&o>0){let _=rt(r,!0);if(X.adjust_change(_,0,0,0,_.prevUtcOffset),X._compare_change_fn(i,_)<0){let l=this.changes[o-1],g=!1;r.is_daylight!=g&&l.is_daylight==g&&(r=l)}}return r.utcOffset}_findNearbyChange(a){let i=tt(this.changes,a,X._compare_change_fn);return i>=this.changes.length?this.changes.length-1:i}_ensureCoverage(a){if(X._minimumExpansionYear==-1){let n=N.now();X._minimumExpansionYear=n.year}let i=a;if(ii)&&d);)o.year=d.year,o.month=d.month,o.day=d.day,o.hour=d.hour,o.minute=d.minute,o.second=d.second,o.isDate=d.isDate,X.adjust_change(o,0,0,0,-o.prevUtcOffset),n.push(o)}}else o=_(),o.year=s.year,o.month=s.month,o.day=s.day,o.hour=s.hour,o.minute=s.minute,o.second=s.second,X.adjust_change(o,0,0,0,-o.prevUtcOffset),n.push(o);return n}toString(){return this.tznames?this.tznames:this.tzid}}let ze=null;const Ni={get count(){return ze===null?0:Object.keys(ze).length},reset:function(){ze=Object.create(null);let e=X.utcTimezone;ze.Z=e,ze.UTC=e,ze.GMT=e},has:function(e){return ze!==null&&!!ze[e]},get:function(e){return ze===null&&this.reset(),ze[e]},register:function(e,a){if(ze===null&&this.reset(),e instanceof $e&&e.name==="vtimezone"&&(e=(a=new X(e)).tzid),!(a instanceof X))throw new TypeError("timezone must be ICAL.Timezone or ICAL.Component");ze[e]=a},remove:function(e){return ze===null?null:delete ze[e]}};function $t(e){return typeof e=="number"&&isNaN(e)}function Le(e){let a=parseInt(e,10);if($t(a))throw new Error('Could not extract integer from "'+e+'"');return a}function Ta(e,a){if(e!==void 0)return e instanceof a?e:new a(e)}function oa(e,a,i){for(;(i=e.indexOf(a,i))!==-1;){if(!(i>0&&e[i-1]==="\\"))return i;i+=1}return-1}function tt(e,a,i){if(!e.length)return 0;let n,o,s=0,r=e.length-1;for(;s<=r;)if(n=s+Math.floor((r-s)/2),o=i(a,e[n]),o<0)r=n-1;else{if(!(o>0))break;s=n+1}return o<0?n:o>0?n+1:n}function rt(e,a){if(e&&typeof e=="object"){if(e instanceof Date)return new Date(e.getTime());if("clone"in e)return e.clone();if(Array.isArray(e)){let i=[];for(let n=0;n65535?2:1:(a+=Re.newLineChar+" "+i.slice(0,Math.max(0,n)),i=i.slice(Math.max(0,n)),n=o=0)}return a.slice(Re.newLineChar.length+1)}function Ve(e){switch(typeof e!="string"&&(typeof e=="number"&&(e=parseInt(e)),e=String(e)),e.length){case 0:return"00";case 1:return"0"+e;default:return e}}function Oe(e){return e<0?Math.ceil(e):Math.floor(e)}function dt(e,a){for(let i in e){let n=Object.getOwnPropertyDescriptor(e,i);n&&!Object.getOwnPropertyDescriptor(a,i)&&Object.defineProperty(a,i,n)}return a}var j_=Object.freeze({__proto__:null,updateTimezones:function(e){let a,i,n,o,s;if(!e||e.name!=="vcalendar")return e;for(a=e.getAllSubcomponents(),i=[],n={},s=0;sn)-(n>i)}_normalize(){let a=this.toSeconds(),i=this.factor;for(;a<-43200;)a+=97200;for(;a>50400;)a-=97200;this.fromSeconds(a),a==0&&(this.factor=i)}toICALString(){return xe.icalendar.value["utc-offset"].toICAL(this.toString())}toString(){return(this.factor==1?"+":"-")+Ve(this.hours)+":"+Ve(this.minutes)}}class Ya extends N{static fromDateAndOrTimeString(a,i){function n(b,y,k){return b?Le(b.slice(y,y+k)):null}let o=a.split("T"),s=o[0],r=o[1],_=r?xe.vcard.value.time._splitZone(r):[],l=_[0],g=_[1],d=s?s.length:0,f=g?g.length:0,h=s&&s[0]=="-"&&s[1]=="-",u=g&&g[0]=="-",m={year:h?null:n(s,0,4),month:!h||d!=4&&d!=7?d==7||d==10?n(s,5,2):null:n(s,2,2),day:d==5?n(s,3,2):d==7&&h?n(s,5,2):d==10?n(s,8,2):null,hour:u?null:n(g,0,2),minute:u&&f==3?n(g,1,2):f>4?n(g,u?1:3,2):null,second:f==4?n(g,2,2):f==6?n(g,4,2):f==8?n(g,6,2):null};return l=l=="Z"?X.utcTimezone:l&&l[3]==":"?ra.fromString(l):null,new Ya(m,l,i)}constructor(a,i,n){super(a,i),this.icaltype=n||"date-and-or-time"}icalclass="vcardtime";icaltype="date-and-or-time";clone(){return new Ya(this._time,this.zone,this.icaltype)}_normalize(){return this}utcOffset(){return this.zone instanceof ra?this.zone.toSeconds():N.prototype.utcOffset.apply(this,arguments)}toICALString(){return xe.vcard.value[this.icaltype].toICAL(this.toString())}toString(){let a,i=this.year,n=this.month,o=this.day,s=this.hour,r=this.minute,_=this.second,l=n!==null,g=o!==null,d=s!==null,f=r!==null,h=_!==null,u=(i!==null?Ve(i)+(l||g?"-":""):l||g?"--":"")+(l?Ve(n):"")+(g?"-"+Ve(o):""),m=(d?Ve(s):"-")+(d&&f?":":"")+(f?Ve(r):"")+(d||f?"":"-")+(f&&h?":":"")+(h?Ve(_):"");switch(this.zone===X.utcTimezone?a="Z":this.zone instanceof ra?a=this.zone.toString():this.zone===X.localTimezone?a="":this.zone instanceof X?a=ra.fromSeconds(this.zone.utcOffset(this)).toString():a="",this.icaltype){case"time":return m+a;case"date-and-or-time":case"date-time":return u+(m=="--"?"":"T"+m+a);case"date":return u}return null}}class Fa{static _indexMap={BYSECOND:0,BYMINUTE:1,BYHOUR:2,BYDAY:3,BYMONTHDAY:4,BYYEARDAY:5,BYWEEKNO:6,BYMONTH:7,BYSETPOS:8};static _expandMap={SECONDLY:[1,1,1,1,1,1,1,1],MINUTELY:[2,1,1,1,1,1,1,1],HOURLY:[2,2,1,1,1,1,1,1],DAILY:[2,2,2,1,1,1,1,1],WEEKLY:[2,2,2,2,3,3,1,1],MONTHLY:[2,2,2,2,2,3,3,1],YEARLY:[2,2,2,2,2,2,2,2]};static UNKNOWN=0;static CONTRACT=1;static EXPAND=2;static ILLEGAL=3;constructor(a){this.fromData(a)}completed=!1;rule=null;dtstart=null;last=null;occurrence_number=0;by_indices=null;initialized=!1;by_data=null;days=null;days_index=0;fromData(a){if(this.rule=Ta(a.rule,Ze),!this.rule)throw new Error("iterator requires a (ICAL.Recur) rule");if(this.dtstart=Ta(a.dtstart,N),!this.dtstart)throw new Error("iterator requires a (ICAL.Time) dtstart");a.by_data?this.by_data=a.by_data:this.by_data=rt(this.rule.parts,!0),a.occurrence_number&&(this.occurrence_number=a.occurrence_number),this.days=a.days||[],a.last&&(this.last=Ta(a.last,N)),this.by_indices=a.by_indices,this.by_indices||(this.by_indices={BYSECOND:0,BYMINUTE:0,BYHOUR:0,BYDAY:0,BYMONTH:0,BYWEEKNO:0,BYMONTHDAY:0}),this.initialized=a.initialized||!1,this.initialized||this.init()}init(){this.initialized=!0,this.last=this.dtstart.clone();let a=this.by_data;if("BYDAY"in a&&this.sort_byday_rules(a.BYDAY),"BYYEARDAY"in a&&("BYMONTH"in a||"BYWEEKNO"in a||"BYMONTHDAY"in a||"BYDAY"in a))throw new Error("Invalid BYYEARDAY rule");if("BYWEEKNO"in a&&"BYMONTHDAY"in a)throw new Error("BYWEEKNO does not fit to BYMONTHDAY");if(this.rule.freq=="MONTHLY"&&("BYYEARDAY"in a||"BYWEEKNO"in a))throw new Error("For MONTHLY recurrences neither BYYEARDAY nor BYWEEKNO may appear");if(this.rule.freq=="WEEKLY"&&("BYYEARDAY"in a||"BYMONTHDAY"in a))throw new Error("For WEEKLY recurrences neither BYMONTHDAY nor BYYEARDAY may appear");if(this.rule.freq!="YEARLY"&&"BYYEARDAY"in a)throw new Error("BYYEARDAY may only appear in YEARLY rules");this.last.second=this.setup_defaults("BYSECOND","SECONDLY",this.dtstart.second),this.last.minute=this.setup_defaults("BYMINUTE","MINUTELY",this.dtstart.minute),this.last.hour=this.setup_defaults("BYHOUR","HOURLY",this.dtstart.hour);let i=this.last.day=this.setup_defaults("BYMONTHDAY","DAILY",this.dtstart.day);if(this.last.month=this.setup_defaults("BYMONTH","MONTHLY",this.dtstart.month),this.rule.freq=="WEEKLY")if("BYDAY"in a){let[,n]=this.ruleDayOfWeek(a.BYDAY[0],this.rule.wkst),o=n-this.last.dayOfWeek(this.rule.wkst);(this.last.dayOfWeek(this.rule.wkst)=0||o<0)&&(this.last.day+=o)}else{let n=Ze.numericDayToIcalDay(this.dtstart.dayOfWeek());a.BYDAY=[n]}if(this.rule.freq=="YEARLY"){for(;this.expand_year_days(this.last.year),!(this.days.length>0);)this.increment_year(this.rule.interval);this._nextByYearDay()}if(this.rule.freq=="MONTHLY"&&this.has_by_data("BYDAY")){let n=null,o=this.last.clone(),s=N.daysInMonth(this.last.month,this.last.year);for(let r of this.by_data.BYDAY){this.last=o.clone();let[_,l]=this.ruleDayOfWeek(r),g=this.last.nthWeekDay(l,_);if(_>=6||_<=-6)throw new Error("Malformed values in BYDAY part");if(g>s||g<=0){if(n&&n.month==o.month)continue;for(;g>s||g<=0;)this.increment_month(),s=N.daysInMonth(this.last.month,this.last.year),g=this.last.nthWeekDay(l,_)}this.last.day=g,(!n||this.last.compare(n)<0)&&(n=this.last.clone())}if(this.last=n.clone(),this.has_by_data("BYMONTHDAY")&&this._byDayAndMonthDay(!0),this.last.day>s||this.last.day==0)throw new Error("Malformed values in BYDAY part")}else if(this.has_by_data("BYMONTHDAY")){this.last.day=1;let n=N.daysInMonth(this.last.month,this.last.year);if(i<0)this.last.day=n+i+1;else if(this.by_data.BYMONTHDAY[0]>n){if(!this.next_month()&&!this.next_month()&&!this.next_month())throw new Error("No possible occurrences")}else this.last.day=i}}next(){let a,i=this.last?this.last.clone():null;if(this.rule.count&&this.occurrence_number>=this.rule.count||this.rule.until&&this.last.compare(this.rule.until)>0)return this.completed=!0,null;if(this.occurrence_number==0&&this.last.compare(this.dtstart)>=0)return this.occurrence_number++,this.last;do switch(a=1,this.rule.freq){case"SECONDLY":this.next_second();break;case"MINUTELY":this.next_minute();break;case"HOURLY":this.next_hour();break;case"DAILY":this.next_day();break;case"WEEKLY":this.next_week();break;case"MONTHLY":a=this.next_month();break;case"YEARLY":this.next_year();break;default:return null}while(!this.check_contracting_rules()||this.last.compare(this.dtstart)<0||!a);if(this.last.compare(i)==0)throw new Error("Same occurrence found twice, protecting you from death by recursion");return this.rule.until&&this.last.compare(this.rule.until)>0?(this.completed=!0,null):(this.occurrence_number++,this.last)}next_second(){return this.next_generic("BYSECOND","SECONDLY","second","minute")}increment_second(a){return this.increment_generic(a,"second",60,"minute")}next_minute(){return this.next_generic("BYMINUTE","MINUTELY","minute","hour","next_second")}increment_minute(a){return this.increment_generic(a,"minute",60,"hour")}next_hour(){return this.next_generic("BYHOUR","HOURLY","hour","monthday","next_minute")}increment_hour(a){this.increment_generic(a,"hour",24,"monthday")}next_day(){let a=this.rule.freq=="DAILY";return this.next_hour()==0||(a?this.increment_monthday(this.rule.interval):this.increment_monthday(1)),0}next_week(){let a=0;if(this.next_weekday_by_week()==0)return a;if(this.has_by_data("BYWEEKNO")){this.by_indices.BYWEEKNO++,this.by_indices.BYWEEKNO==this.by_data.BYWEEKNO.length&&(this.by_indices.BYWEEKNO=0,a=1),this.last.month=1,this.last.day=1;let i=this.by_data.BYWEEKNO[this.by_indices.BYWEEKNO];this.last.day+=7*i,a&&this.increment_year(1)}else this.increment_monthday(7*this.rule.interval);return a}normalizeByMonthDayRules(a,i,n){let o,s=N.daysInMonth(i,a),r=[],_=0,l=n.length;for(;_s)){if(o<0)o=s+(o+1);else if(o===0)continue;r.indexOf(o)===-1&&r.push(o)}return r.sort(function(g,d){return g-d})}_byDayAndMonthDay(a){let i,n,o,s,r=this.by_data.BYDAY,_=0,l=r.length,g=0,d=this,f=this.last.day;function h(){for(s=N.daysInMonth(d.last.month,d.last.year),i=d.normalizeByMonthDayRules(d.last.year,d.last.month,d.by_data.BYMONTHDAY),o=i.length;i[_]<=f&&(!a||i[_]!=f)&&_s){u();continue}let b=i[_++];if(b>=n){f=b;for(let y=0;yn&&(this.last.day=1,this.increment_month(),this.is_day_in_byday(this.last)?this.has_by_data("BYSETPOS")&&!this.check_set_position(1)||(a=1):a=0)}else if(this.has_by_data("BYMONTHDAY")){this.by_indices.BYMONTHDAY++,this.by_indices.BYMONTHDAY>=this.by_data.BYMONTHDAY.length&&(this.by_indices.BYMONTHDAY=0,this.increment_month());let i=N.daysInMonth(this.last.month,this.last.year),n=this.by_data.BYMONTHDAY[this.by_indices.BYMONTHDAY];n<0&&(n=i+n+1),n>i?(this.last.day=1,a=this.is_day_in_byday(this.last)):this.last.day=n}else{this.increment_month();let i=N.daysInMonth(this.last.month,this.last.year);this.by_data.BYMONTHDAY[0]>i?a=0:this.last.day=this.by_data.BYMONTHDAY[0]}return a}next_weekday_by_week(){let a=0;if(this.next_hour()==0)return a;if(!this.has_by_data("BYDAY"))return 1;for(;;){let i=new N;this.by_indices.BYDAY++,this.by_indices.BYDAY==Object.keys(this.by_data.BYDAY).length&&(this.by_indices.BYDAY=0,a=1);let n=this.by_data.BYDAY[this.by_indices.BYDAY],o=this.ruleDayOfWeek(n)[1];o-=this.rule.wkst,o<0&&(o+=7),i.year=this.last.year,i.month=this.last.month,i.day=this.last.day;let s=i.startDoyWeek(this.rule.wkst);if(o+s<1&&!a)continue;let r=N.fromDayOfYear(s+o,this.last.year);return this.last.year=r.year,this.last.month=r.month,this.last.day=r.day,a}}next_year(){if(this.next_hour()==0)return 0;if(++this.days_index==this.days.length){this.days_index=0;do this.increment_year(this.rule.interval),this.expand_year_days(this.last.year);while(this.days.length==0)}return this._nextByYearDay(),1}_nextByYearDay(){let a=this.days[this.days_index],i=this.last.year;a<1&&(a+=1,i+=1);let n=N.fromDayOfYear(a,i);this.last.day=n.day,this.last.month=n.month}ruleDayOfWeek(a,i){let n=a.match(/([+-]?[0-9])?(MO|TU|WE|TH|FR|SA|SU)/);return n?[parseInt(n[1]||0,10),a=Ze.icalDayToNumericDay(n[2],i)]:[0,0]}next_generic(a,i,n,o,s){let r=a in this.by_data,_=this.rule.freq==i,l=0;if(s&&this[s]()==0)return l;if(r){this.by_indices[a]++;let g=this.by_data[a];this.by_indices[a]==g.length&&(this.by_indices[a]=0,l=1),this.last[n]=g[this.by_indices[a]]}else _&&this["increment_"+n](this.rule.interval);return r&&l&&_&&this["increment_"+o](1),l}increment_monthday(a){for(let i=0;in&&(this.last.day-=n,this.increment_month())}}increment_month(){if(this.last.day=1,this.has_by_data("BYMONTH"))this.by_indices.BYMONTH++,this.by_indices.BYMONTH==this.by_data.BYMONTH.length&&(this.by_indices.BYMONTH=0,this.increment_year(1)),this.last.month=this.by_data.BYMONTH[this.by_indices.BYMONTH];else{this.rule.freq=="MONTHLY"?this.last.month+=this.rule.interval:this.last.month++,this.last.month--;let a=Oe(this.last.month/12);this.last.month%=12,this.last.month++,a!=0&&this.increment_year(a)}}increment_year(a){this.last.year+=a}increment_generic(a,i,n,o){this.last[i]+=a;let s=Oe(this.last[i]/n);this.last[i]%=n,s!=0&&this["increment_"+o](s)}has_by_data(a){return a in this.rule.parts}expand_year_days(a){let i=new N;this.days=[];let n={},o=["BYDAY","BYWEEKNO","BYMONTHDAY","BYMONTH","BYYEARDAY"];for(let r of o)r in this.rule.parts&&(n[r]=this.rule.parts[r]);if("BYMONTH"in n&&"BYWEEKNO"in n){let r=1,_={};i.year=a,i.isDate=!0;for(let l=0;l0?(h=y+7*(m-1),h<=_&&this.days.push(g+h)):(h=k+7*(m+1),h>0&&this.days.push(g+h))}}this.days.sort(function(r,_){return r-_})}else if(s==2&&"BYDAY"in n&&"BYMONTHDAY"in n){let r=this.expand_by_day(a);for(let _ of r){let l=N.fromDayOfYear(_,a);this.by_data.BYMONTHDAY.indexOf(l.day)>=0&&this.days.push(_)}}else if(s==3&&"BYDAY"in n&&"BYMONTHDAY"in n&&"BYMONTH"in n){let r=this.expand_by_day(a);for(let _ of r){let l=N.fromDayOfYear(_,a);this.by_data.BYMONTH.indexOf(l.month)>=0&&this.by_data.BYMONTHDAY.indexOf(l.day)>=0&&this.days.push(_)}}else if(s==2&&"BYDAY"in n&&"BYWEEKNO"in n){let r=this.expand_by_day(a);for(let _ of r){let l=N.fromDayOfYear(_,a).weekNumber(this.rule.wkst);this.by_data.BYWEEKNO.indexOf(l)&&this.days.push(_)}}else s==3&&"BYDAY"in n&&"BYWEEKNO"in n&&"BYMONTHDAY"in n||(this.days=s==1&&"BYYEARDAY"in n?this.days.concat(this.by_data.BYYEARDAY):[]);return 0}expand_by_day(a){let i=[],n=this.last.clone();n.year=a,n.month=1,n.day=1,n.isDate=!0;let o=n.dayOfWeek();n.month=12,n.day=31,n.isDate=!0;let s=n.dayOfWeek(),r=n.dayOfYear();for(let _ of this.by_data.BYDAY){let l=this.ruleDayOfWeek(_),g=l[0],d=l[1];if(g==0)for(let f=(d+7-o)%7+1;f<=r;f+=7)i.push(f);else if(g>0){let f;f=d>=o?d-o+1:d-o+8,i.push(f+7*(g-1))}else{let f;g=-g,f=d<=s?r-s+d:r-s+d-7,i.push(f-7*(g-1))}}return i}is_day_in_byday(a){if(this.by_data.BYDAY)for(let i of this.by_data.BYDAY){let n=this.ruleDayOfWeek(i),o=n[0],s=n[1],r=a.dayOfWeek();if(o==0&&s==r||a.nthWeekDay(s,o)==a.day)return 1}return 0}check_set_position(a){return this.has_by_data("BYSETPOS")?this.by_data.BYSETPOS.indexOf(a)!==-1:!1}sort_byday_rules(a){for(let i=0;ithis.ruleDayOfWeek(a[i],this.rule.wkst)[1]){let o=a[i];a[i]=a[n],a[n]=o}}check_contract_restriction(a,i){let n=Fa._indexMap[a],o=Fa._expandMap[this.rule.freq][n],s=!1;if(a in this.by_data&&o==Fa.CONTRACT){let r=this.by_data[a];for(let _ of r)if(_==i){s=!0;break}}else s=!0;return s}check_contracting_rules(){let a=this.last.dayOfWeek(),i=this.last.weekNumber(this.rule.wkst),n=this.last.dayOfYear();return this.check_contract_restriction("BYSECOND",this.last.second)&&this.check_contract_restriction("BYMINUTE",this.last.minute)&&this.check_contract_restriction("BYHOUR",this.last.hour)&&this.check_contract_restriction("BYDAY",Ze.numericDayToIcalDay(a))&&this.check_contract_restriction("BYWEEKNO",i)&&this.check_contract_restriction("BYMONTHDAY",this.last.day)&&this.check_contract_restriction("BYMONTH",this.last.month)&&this.check_contract_restriction("BYYEARDAY",n)}setup_defaults(a,i,n){let o=Fa._indexMap[a];return Fa._expandMap[this.rule.freq][o]!=Fa.CONTRACT&&(a in this.by_data||(this.by_data[a]=[n]),this.rule.freq!=i)?this.by_data[a][0]:n}toJSON(){let a=Object.create(null);return a.initialized=this.initialized,a.rule=this.rule.toJSON(),a.dtstart=this.dtstart.toJSON(),a.by_data=this.by_data,a.days=this.days,a.last=this.last.toJSON(),a.by_indices=this.by_indices,a.occurrence_number=this.occurrence_number,a}}const Y_=/^(SU|MO|TU|WE|TH|FR|SA)$/,q_=/^([+-])?(5[0-3]|[1-4][0-9]|[1-9])?(SU|MO|TU|WE|TH|FR|SA)$/,_r={SU:N.SUNDAY,MO:N.MONDAY,TU:N.TUESDAY,WE:N.WEDNESDAY,TH:N.THURSDAY,FR:N.FRIDAY,SA:N.SATURDAY},L_=Object.fromEntries(Object.entries(_r).map(e=>e.reverse())),bo=["SECONDLY","MINUTELY","HOURLY","DAILY","WEEKLY","MONTHLY","YEARLY"];class Ze{static fromString(a){let i=this._stringToData(a,!1);return new Ze(i)}static fromData(a){return new Ze(a)}static _stringToData(a,i){let n=Object.create(null),o=a.split(";"),s=o.length;for(let r=0;r7&&(n-=7),L_[n]}constructor(a){this.wrappedJSObject=this,this.parts={},a&&typeof a=="object"&&this.fromData(a)}parts=null;interval=1;wkst=N.MONDAY;until=null;count=null;freq=null;icalclass="icalrecur";icaltype="recur";iterator(a){return new Fa({rule:this,dtstart:a})}clone(){return new Ze(this.toJSON())}isFinite(){return!(!this.count&&!this.until)}isByCount(){return!(!this.count||this.until)}addComponent(a,i){let n=a.toUpperCase();n in this.parts?this.parts[n].push(i):this.parts[n]=[i]}setComponent(a,i){this.parts[a.toUpperCase()]=i.slice()}getComponent(a){let i=a.toUpperCase();return i in this.parts?this.parts[i].slice():[]}getNextOccurrence(a,i){let n,o=this.iterator(a);do n=o.next();while(n&&n.compare(i)<=0);return n&&i.zone&&(n.zone=i.zone),n}fromData(a){for(let i in a){let n=i.toUpperCase();n in Z0?Array.isArray(a[i])?this.parts[n]=a[i]:this.parts[n]=[a[i]]:this[i]=a[i]}this.interval&&typeof this.interval!="number"&&L0.INTERVAL(this.interval,this),this.wkst&&typeof this.wkst!="number"&&(this.wkst=Ze.icalDayToNumericDay(this.wkst)),!this.until||this.until instanceof N||(this.until=N.fromString(this.until))}toJSON(){let a=Object.create(null);a.freq=this.freq,this.count&&(a.count=this.count),this.interval>1&&(a.interval=this.interval);for(let[i,n]of Object.entries(this.parts))Array.isArray(n)&&n.length==1?a[i.toLowerCase()]=n[0]:a[i.toLowerCase()]=rt(n);return this.until&&(a.until=this.until.toString()),"wkst"in this&&this.wkst!==N.DEFAULT_WEEK_START&&(a.wkst=Ze.numericDayToIcalDay(this.wkst)),a}toString(){let a="FREQ="+this.freq;this.count&&(a+=";COUNT="+this.count),this.interval>1&&(a+=";INTERVAL="+this.interval);for(let[i,n]of Object.entries(this.parts))a+=";"+i+"="+n;return this.until&&(a+=";UNTIL="+this.until.toICALString()),"wkst"in this&&this.wkst!==N.DEFAULT_WEEK_START&&(a+=";WKST="+Ze.numericDayToIcalDay(this.wkst)),a}}function Sa(e,a,i,n){let o=n;if(n[0]==="+"&&(o=n.slice(1)),o=Le(o),a!==void 0&&n '+a);if(i!==void 0&&n>i)throw new Error(e+': invalid value "'+n+'" must be < '+a);return o}const L0={FREQ:function(e,a,i){if(bo.indexOf(e)===-1)throw new Error('invalid frequency "'+e+'" expected: "'+bo.join(", ")+'"');a.freq=e},COUNT:function(e,a,i){a.count=Le(e)},INTERVAL:function(e,a,i){a.interval=Le(e),a.interval<1&&(a.interval=1)},UNTIL:function(e,a,i){e.length>10?a.until=xe.icalendar.value["date-time"].fromICAL(e):a.until=xe.icalendar.value.date.fromICAL(e),i||(a.until=N.fromString(a.until))},WKST:function(e,a,i){if(!Y_.test(e))throw new Error('invalid WKST value "'+e+'"');a.wkst=Ze.icalDayToNumericDay(e)}},Z0={BYSECOND:Sa.bind(void 0,"BYSECOND",0,60),BYMINUTE:Sa.bind(void 0,"BYMINUTE",0,59),BYHOUR:Sa.bind(void 0,"BYHOUR",0,23),BYDAY:function(e){if(q_.test(e))return e;throw new Error('invalid BYDAY value "'+e+'"')},BYMONTHDAY:Sa.bind(void 0,"BYMONTHDAY",-31,31),BYYEARDAY:Sa.bind(void 0,"BYYEARDAY",-366,366),BYWEEKNO:Sa.bind(void 0,"BYWEEKNO",-53,53),BYMONTH:Sa.bind(void 0,"BYMONTH",1,12),BYSETPOS:Sa.bind(void 0,"BYSETPOS",-366,366)};class xa{static fromString(a,i){let n=a.split("/");if(n.length!==2)throw new Error('Invalid string value: "'+a+'" must contain a "/" char.');let o={start:N.fromDateTimeString(n[0],i)},s=n[1];return Ie.isValueString(s)?o.duration=Ie.fromString(s):o.end=N.fromDateTimeString(s,i),new xa(o)}static fromData(a){return new xa(a)}static fromJSON(a,i,n){function o(s,r){return n?N.fromString(s,r):N.fromDateTimeString(s,r)}return Ie.isValueString(a[1])?xa.fromData({start:o(a[0],i),duration:Ie.fromString(a[1])}):xa.fromData({start:o(a[0],i),end:o(a[1],i)})}constructor(a){if(this.wrappedJSObject=this,a&&"start"in a){if(a.start&&!(a.start instanceof N))throw new TypeError(".start must be an instance of ICAL.Time");this.start=a.start}if(a&&a.end&&a.duration)throw new Error("cannot accept both end and duration");if(a&&"end"in a){if(a.end&&!(a.end instanceof N))throw new TypeError(".end must be an instance of ICAL.Time");this.end=a.end}if(a&&"duration"in a){if(a.duration&&!(a.duration instanceof Ie))throw new TypeError(".duration must be an instance of ICAL.Duration");this.duration=a.duration}}start=null;end=null;duration=null;icalclass="icalperiod";icaltype="period";clone(){return xa.fromData({start:this.start?this.start.clone():null,end:this.end?this.end.clone():null,duration:this.duration?this.duration.clone():null})}getDuration(){return this.duration?this.duration:this.end.subtractDate(this.start)}getEnd(){if(this.end)return this.end;{let a=this.start.clone();return a.addDuration(this.duration),a}}toString(){return this.start+"/"+(this.end||this.duration)}toJSON(){return[this.start.toString(),(this.end||this.duration).toString()]}toICALString(){return this.start.toICALString()+"/"+(this.end||this.duration).toICALString()}}const To=/\\\\|\\,|\\[Nn]/g,Do=/\\|,|\n/g;function rn(e,a){return{matches:/.*/,fromICAL:function(i,n){return function(o,s,r){return o.indexOf("\\")===-1?o:(r&&(s=new RegExp(s.source+"|\\\\"+r,s.flags)),o.replace(s,Z_))}(i,e,n)},toICAL:function(i,n){let o=a;return n&&(o=new RegExp(o.source+"|"+n,o.flags)),i.replace(o,function(s){switch(s){case"\\":return"\\\\";case";":return"\\;";case",":return"\\,";case` +`:return"\\n";default:return s}})}}}const de={defaultType:"text"},Qt={defaultType:"text",multiValue:","},xi={defaultType:"text",structuredValue:";"},ri={defaultType:"integer"},li={defaultType:"date-time",allowedTypes:["date-time","date"]},_i={defaultType:"date-time"},We={defaultType:"uri"},yo={defaultType:"utc-offset"},Eo={defaultType:"recur"},ko={defaultType:"date-and-or-time",allowedTypes:["date-time","date","text"]};function Z_(e){switch(e){case"\\\\":return"\\";case"\\;":return";";case"\\,":return",";case"\\n":case"\\N":return` +`;default:return e}}let Ln={categories:Qt,url:We,version:de,uid:de},Zn={boolean:{values:["TRUE","FALSE"],fromICAL:function(e){return e==="TRUE"},toICAL:function(e){return e?"TRUE":"FALSE"}},float:{matches:/^[+-]?\d+\.\d+$/,fromICAL:function(e){let a=parseFloat(e);return $t(a)?0:a},toICAL:function(e){return String(e)}},integer:{fromICAL:function(e){let a=parseInt(e);return $t(a)?0:a},toICAL:function(e){return String(e)}},"utc-offset":{toICAL:function(e){return e.length<7?e.slice(0,3)+e.slice(4,6):e.slice(0,3)+e.slice(4,6)+e.slice(7,9)},fromICAL:function(e){return e.length<6?e.slice(0,3)+":"+e.slice(3,5):e.slice(0,3)+":"+e.slice(3,5)+":"+e.slice(5,7)},decorate:function(e){return ra.fromString(e)},undecorate:function(e){return e.toString()}}};const Ne=dt(Zn,{text:rn(/\\\\|\\;|\\,|\\[Nn]/g,/\\|;|,|\n/g),uri:{},binary:{decorate:function(e){return sr.fromString(e)},undecorate:function(e){return e.toString()}},"cal-address":{},date:{decorate:function(e,a){return Da.strict?N.fromDateString(e,a):N.fromString(e,a)},undecorate:function(e){return e.toString()},fromICAL:function(e){return!Da.strict&&e.length>=15?Ne["date-time"].fromICAL(e):e.slice(0,4)+"-"+e.slice(4,6)+"-"+e.slice(6,8)},toICAL:function(e){let a=e.length;return a==10?e.slice(0,4)+e.slice(5,7)+e.slice(8,10):a>=19?Ne["date-time"].toICAL(e):e}},"date-time":{fromICAL:function(e){{let a=e.slice(0,4)+"-"+e.slice(4,6)+"-"+e.slice(6,8)+"T"+e.slice(9,11)+":"+e.slice(11,13)+":"+e.slice(13,15);return e[15]&&e[15]==="Z"&&(a+="Z"),a}},toICAL:function(e){let a=e.length;if(a!=10||Da.strict){if(a>=19){let i=e.slice(0,4)+e.slice(5,7)+e.slice(8,13)+e.slice(14,16)+e.slice(17,19);return e[19]&&e[19]==="Z"&&(i+="Z"),i}return e}return Ne.date.toICAL(e)},decorate:function(e,a){return Da.strict?N.fromDateTimeString(e,a):N.fromString(e,a)},undecorate:function(e){return e.toString()}},duration:{decorate:function(e){return Ie.fromString(e)},undecorate:function(e){return e.toString()}},period:{fromICAL:function(e){let a=e.split("/");return a[0]=Ne["date-time"].fromICAL(a[0]),Ie.isValueString(a[1])||(a[1]=Ne["date-time"].fromICAL(a[1])),a},toICAL:function(e){return e=e.slice(),e[0]=Ne["date-time"].toICAL(e[0]),Ie.isValueString(e[1])||(e[1]=Ne["date-time"].toICAL(e[1])),e.join("/")},decorate:function(e,a){return xa.fromJSON(e,a,!Da.strict)},undecorate:function(e){return e.toJSON()}},recur:{fromICAL:function(e){return Ze._stringToData(e,!0)},toICAL:function(e){let a="";for(let[i,n]of Object.entries(e))i=="until"?n=n.length>10?Ne["date-time"].toICAL(n):Ne.date.toICAL(n):i=="wkst"?typeof n=="number"&&(n=Ze.numericDayToIcalDay(n)):Array.isArray(n)&&(n=n.join(",")),a+=i.toUpperCase()+"="+n+";";return a.slice(0,Math.max(0,a.length-1))},decorate:function(e){return Ze.fromData(e)},undecorate:function(e){return e.toJSON()}},time:{fromICAL:function(e){if(e.length<6)return e;let a=e.slice(0,2)+":"+e.slice(2,4)+":"+e.slice(4,6);return e[6]==="Z"&&(a+="Z"),a},toICAL:function(e){if(e.length<8)return e;let a=e.slice(0,2)+e.slice(3,5)+e.slice(6,8);return e[8]==="Z"&&(a+="Z"),a}}});let I_=dt(Ln,{action:de,attach:{defaultType:"uri"},attendee:{defaultType:"cal-address"},calscale:de,class:de,comment:de,completed:_i,contact:de,created:_i,description:de,dtend:li,dtstamp:_i,dtstart:li,due:li,duration:{defaultType:"duration"},exdate:{defaultType:"date-time",allowedTypes:["date-time","date"],multiValue:","},exrule:Eo,freebusy:{defaultType:"period",multiValue:","},geo:{defaultType:"float",structuredValue:";"},"last-modified":_i,location:de,method:de,organizer:{defaultType:"cal-address"},"percent-complete":ri,priority:ri,prodid:de,"related-to":de,repeat:ri,rdate:{defaultType:"date-time",allowedTypes:["date-time","date","period"],multiValue:",",detectType:function(e){return e.indexOf("/")!==-1?"period":e.indexOf("T")===-1?"date":"date-time"}},"recurrence-id":li,resources:Qt,"request-status":xi,rrule:Eo,sequence:ri,status:de,summary:de,transp:de,trigger:{defaultType:"duration",allowedTypes:["duration","date-time"]},tzoffsetfrom:yo,tzoffsetto:yo,tzurl:We,tzid:de,tzname:de});const ta=dt(Zn,{text:rn(To,Do),uri:rn(To,Do),date:{decorate:function(e){return Ya.fromDateAndOrTimeString(e,"date")},undecorate:function(e){return e.toString()},fromICAL:function(e){return e.length==8?Ne.date.fromICAL(e):e[0]=="-"&&e.length==6?e.slice(0,4)+"-"+e.slice(4):e},toICAL:function(e){return e.length==10?Ne.date.toICAL(e):e[0]=="-"&&e.length==7?e.slice(0,4)+e.slice(5):e}},time:{decorate:function(e){return Ya.fromDateAndOrTimeString("T"+e,"time")},undecorate:function(e){return e.toString()},fromICAL:function(e){let a=ta.time._splitZone(e,!0),i=a[0],n=a[1];return n.length==6?n=n.slice(0,2)+":"+n.slice(2,4)+":"+n.slice(4,6):n.length==4&&n[0]!="-"?n=n.slice(0,2)+":"+n.slice(2,4):n.length==5&&(n=n.slice(0,3)+":"+n.slice(3,5)),i.length!=5||i[0]!="-"&&i[0]!="+"||(i=i.slice(0,3)+":"+i.slice(3)),n+i},toICAL:function(e){let a=ta.time._splitZone(e),i=a[0],n=a[1];return n.length==8?n=n.slice(0,2)+n.slice(3,5)+n.slice(6,8):n.length==5&&n[0]!="-"?n=n.slice(0,2)+n.slice(3,5):n.length==6&&(n=n.slice(0,3)+n.slice(4,6)),i.length!=6||i[0]!="-"&&i[0]!="+"||(i=i.slice(0,3)+i.slice(4)),n+i},_splitZone:function(e,a){let i,n,o=e.length-1,s=e.length-(a?5:6),r=e[s];return e[o]=="Z"?(i=e[o],n=e.slice(0,Math.max(0,o))):e.length>6&&(r=="-"||r=="+")?(i=e.slice(s),n=e.slice(0,Math.max(0,s))):(i="",n=e),[i,n]}},"date-time":{decorate:function(e){return Ya.fromDateAndOrTimeString(e,"date-time")},undecorate:function(e){return e.toString()},fromICAL:function(e){return ta["date-and-or-time"].fromICAL(e)},toICAL:function(e){return ta["date-and-or-time"].toICAL(e)}},"date-and-or-time":{decorate:function(e){return Ya.fromDateAndOrTimeString(e,"date-and-or-time")},undecorate:function(e){return e.toString()},fromICAL:function(e){let a=e.split("T");return(a[0]?ta.date.fromICAL(a[0]):"")+(a[1]?"T"+ta.time.fromICAL(a[1]):"")},toICAL:function(e){let a=e.split("T");return ta.date.toICAL(a[0])+(a[1]?"T"+ta.time.toICAL(a[1]):"")}},timestamp:Ne["date-time"],"language-tag":{matches:/^[a-zA-Z0-9-]+$/},"phone-number":{fromICAL:function(e){return Array.from(e).filter(function(a){return a==="\\"?void 0:a}).join("")},toICAL:function(e){return Array.from(e).map(function(a){return a===","||a===";"?"\\"+a:a}).join("")}}});let H_=dt(Ln,{adr:{defaultType:"text",structuredValue:";",multiValue:","},anniversary:ko,bday:ko,caladruri:We,caluri:We,clientpidmap:xi,email:de,fburl:We,fn:de,gender:xi,geo:We,impp:We,key:We,kind:de,lang:{defaultType:"language-tag"},logo:We,member:We,n:{defaultType:"text",structuredValue:";",multiValue:","},nickname:Qt,note:de,org:{defaultType:"text",structuredValue:";"},photo:We,related:We,rev:{defaultType:"timestamp"},role:de,sound:We,source:We,tel:{defaultType:"uri",allowedTypes:["uri","text"]},title:de,tz:{defaultType:"text",allowedTypes:["text","utc-offset","uri"]},xml:de}),P_=dt(Zn,{binary:Ne.binary,date:ta.date,"date-time":ta["date-time"],"phone-number":ta["phone-number"],uri:Ne.uri,text:Ne.text,time:Ne.time,vcard:Ne.text,"utc-offset":{toICAL:function(e){return e.slice(0,7)},fromICAL:function(e){return e.slice(0,7)},decorate:function(e){return ra.fromString(e)},undecorate:function(e){return e.toString()}}}),G_=dt(Ln,{fn:de,n:{defaultType:"text",structuredValue:";",multiValue:","},nickname:Qt,photo:{defaultType:"binary",allowedTypes:["binary","uri"]},bday:{defaultType:"date-time",allowedTypes:["date-time","date"],detectType:function(e){return e.indexOf("T")===-1?"date":"date-time"}},adr:{defaultType:"text",structuredValue:";",multiValue:","},label:de,tel:{defaultType:"phone-number"},email:de,mailer:de,tz:{defaultType:"utc-offset",allowedTypes:["utc-offset","text"]},geo:{defaultType:"float",structuredValue:";"},title:de,role:de,logo:{defaultType:"binary",allowedTypes:["binary","uri"]},agent:{defaultType:"vcard",allowedTypes:["vcard","text","uri"]},org:xi,note:Qt,prodid:de,rev:{defaultType:"date-time",allowedTypes:["date-time","date"],detectType:function(e){return e.indexOf("T")===-1?"date":"date-time"}},"sort-string":de,sound:{defaultType:"binary",allowedTypes:["binary","uri"]},class:de,key:{defaultType:"binary",allowedTypes:["binary","text"]}}),pa={value:Ne,param:{cutype:{values:["INDIVIDUAL","GROUP","RESOURCE","ROOM","UNKNOWN"],allowXName:!0,allowIanaToken:!0},"delegated-from":{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},"delegated-to":{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},encoding:{values:["8BIT","BASE64"]},fbtype:{values:["FREE","BUSY","BUSY-UNAVAILABLE","BUSY-TENTATIVE"],allowXName:!0,allowIanaToken:!0},member:{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},partstat:{values:["NEEDS-ACTION","ACCEPTED","DECLINED","TENTATIVE","DELEGATED","COMPLETED","IN-PROCESS"],allowXName:!0,allowIanaToken:!0},range:{values:["THISANDFUTURE"]},related:{values:["START","END"]},reltype:{values:["PARENT","CHILD","SIBLING"],allowXName:!0,allowIanaToken:!0},role:{values:["REQ-PARTICIPANT","CHAIR","OPT-PARTICIPANT","NON-PARTICIPANT"],allowXName:!0,allowIanaToken:!0},rsvp:{values:["TRUE","FALSE"]},"sent-by":{valueType:"cal-address"},tzid:{matches:/^\//},value:{values:["binary","boolean","cal-address","date","date-time","duration","float","integer","period","recur","text","time","uri","utc-offset"],allowXName:!0,allowIanaToken:!0}},property:I_,propertyGroups:!1},Ao={value:ta,param:{type:{valueType:"text",multiValue:","},value:{values:["text","uri","date","time","date-time","date-and-or-time","timestamp","boolean","integer","float","utc-offset","language-tag"],allowXName:!0,allowIanaToken:!0}},property:H_,propertyGroups:!0},wo={value:P_,param:{type:{valueType:"text",multiValue:","},value:{values:["text","uri","date","date-time","phone-number","time","boolean","integer","float","utc-offset","vcard","binary"],allowXName:!0,allowIanaToken:!0}},property:G_,propertyGroups:!0};const Da={strict:!0,defaultSet:pa,defaultType:"unknown",components:{vcard:Ao,vcard3:wo,vevent:pa,vtodo:pa,vjournal:pa,valarm:pa,vtimezone:pa,daylight:pa,standard:pa},icalendar:pa,vcard:Ao,vcard3:wo,getDesignSet:function(e){return e&&e in Da.components?Da.components[e]:Da.defaultSet}};var xe=Da;const yi=`\r +`,vo="unknown",U_={'"':"^'","\n":"^n","^":"^^"};function Ee(e){typeof e[0]=="string"&&(e=[e]);let a=0,i=e.length,n="";for(;a0&&(e[1][0][0]!=="version"||e[1][0][3]!=="4.0")&&(_="vcard3"),a=a||xe.getDesignSet(_);s0&&typeof a[0]=="object"&&"icaltype"in a[0]&&this.resetType(a[0].icaltype),this.isDecorated)for(;n=0;r--)n&&s[r][0]!==n||this._removeObjectByIndex(a,o,r)}addSubcomponent(a){this._components||(this._components=[],this._hydratedComponentCount=0),a.parent&&a.parent.removeSubcomponent(a);let i=this.jCal[2].push(a.jCal);return this._components[i-1]=a,this._hydratedComponentCount++,a.parent=this,a}removeSubcomponent(a){let i=this._removeObject(2,"_components",a);return i&&this._hydratedComponentCount--,i}removeAllSubcomponents(a){let i=this._removeAllObjects(2,"_components",a);return this._hydratedComponentCount=0,i}addProperty(a){if(!(a instanceof it))throw new TypeError("must be instance of ICAL.Property");this._properties||(this._properties=[],this._hydratedPropertyCount=0),a.parent&&a.parent.removeProperty(a);let i=this.jCal[1].push(a.jCal);return this._properties[i-1]=a,this._hydratedPropertyCount++,a.parent=this,a}addPropertyWithValue(a,i){let n=new it(a);return n.setValue(i),this.addProperty(n),n}updatePropertyWithValue(a,i){let n=this.getFirstProperty(a);return n?n.setValue(i):n=this.addPropertyWithValue(a,i),n}removeProperty(a){let i=this._removeObject(1,"_properties",a);return i&&this._hydratedPropertyCount--,i}removeAllProperties(a){let i=this._removeAllObjects(1,"_properties",a);return this._hydratedPropertyCount=0,i}toJSON(){return this.jCal}toString(){return Ee.component(this.jCal,this._designSet)}getTimeZoneByID(a){if(this.parent)return this.parent.getTimeZoneByID(a);if(!this._timezoneCache)return null;if(this._timezoneCache.has(a))return this._timezoneCache.get(a);const i=this.getAllSubcomponents("vtimezone");for(const n of i)if(n.getFirstProperty("tzid").getFirstValue()===a){const o=new X({component:n,tzid:a});return this._timezoneCache.set(a,o),o}return null}}class dr{constructor(a){this.ruleDates=[],this.exDates=[],this.fromData(a)}complete=!1;ruleIterators=null;ruleDates=null;exDates=null;ruleDateInc=0;exDateInc=0;exDate=null;ruleDate=null;dtstart=null;last=null;fromData(a){let i=Ta(a.dtstart,N);if(!i)throw new Error(".dtstart (ICAL.Time) must be given");if(this.dtstart=i,a.component)this._init(a.component);else{if(this.last=Ta(a.last,N)||i.clone(),!a.ruleIterators)throw new Error(".ruleIterators or .component must be given");this.ruleIterators=a.ruleIterators.map(function(n){return Ta(n,Fa)}),this.ruleDateInc=a.ruleDateInc,this.exDateInc=a.exDateInc,a.ruleDates&&(this.ruleDates=a.ruleDates.map(n=>Ta(n,N)),this.ruleDate=this.ruleDates[this.ruleDateInc]),a.exDates&&(this.exDates=a.exDates.map(n=>Ta(n,N)),this.exDate=this.exDates[this.exDateInc]),a.complete!==void 0&&(this.complete=a.complete)}}next(){let a,i,n,o=0;for(;;){if(o++>500)throw new Error("max tries have occurred, rule may be impossible to fulfill.");if(i=this.ruleDate,a=this._nextRecurrenceIter(this.last),!i&&!a){this.complete=!0;break}if((!i||a&&i.compare(a.last)>0)&&(i=a.last.clone(),a.next()),this.ruleDate===i&&this._nextRuleDay(),this.last=i,!this.exDate||(n=this.exDate.compare(this.last),n<0&&this._nextExDay(),n!==0))return this.last;this._nextExDay()}}toJSON(){function a(n){return n.toJSON()}let i=Object.create(null);return i.ruleIterators=this.ruleIterators.map(a),this.ruleDates&&(i.ruleDates=this.ruleDates.map(a)),this.exDates&&(i.exDates=this.exDates.map(a)),i.ruleDateInc=this.ruleDateInc,i.exDateInc=this.exDateInc,i.last=this.last.toJSON(),i.dtstart=this.dtstart.toJSON(),i.complete=this.complete,i}_extractDates(a,i){let n=[],o=a.getAllProperties(i);for(let s=0,r=o.length;sg.compare(d));n.splice(l,0,_)}return n}_init(a){if(this.ruleIterators=[],this.last=this.dtstart.clone(),!a.hasProperty("rdate")&&!a.hasProperty("rrule")&&!a.hasProperty("recurrence-id"))return this.ruleDate=this.last.clone(),void(this.complete=!0);if(a.hasProperty("rdate")&&(this.ruleDates=this._extractDates(a,"rdate"),this.ruleDates[0]&&this.ruleDates[0].compare(this.dtstart)<0?(this.ruleDateInc=0,this.last=this.ruleDates[0].clone()):this.ruleDateInc=tt(this.ruleDates,this.last,(i,n)=>i.compare(n)),this.ruleDate=this.ruleDates[this.ruleDateInc]),a.hasProperty("rrule")){let i,n,o=a.getAllProperties("rrule"),s=0,r=o.length;for(;si.compare(n)),this.exDate=this.exDates[this.exDateInc])}_nextExDay(){this.exDate=this.exDates[++this.exDateInc]}_nextRuleDay(){this.ruleDate=this.ruleDates[++this.ruleDateInc]}_nextRecurrenceIter(){let a=this.ruleIterators;if(a.length===0)return null;let i,n,o,s=a.length,r=0;for(;r0)&&(o=i);return o}}class Kt{constructor(a,i){a instanceof $e||(i=a,a=null),this.component=a||new $e("vevent"),this._rangeExceptionCache=Object.create(null),this.exceptions=Object.create(null),this.rangeExceptions=[],i&&i.strictExceptions&&(this.strictExceptions=i.strictExceptions),i&&i.exceptions?i.exceptions.forEach(this.relateException,this):this.component.parent&&!this.isRecurrenceException()&&this.component.parent.getAllSubcomponents("vevent").forEach(function(n){n.hasProperty("recurrence-id")&&this.relateException(n)},this)}static THISANDFUTURE="THISANDFUTURE";exceptions=null;strictExceptions=!1;relateException(a){if(this.isRecurrenceException())throw new Error("cannot relate exception to exceptions");if(a instanceof $e&&(a=new Kt(a)),this.strictExceptions&&a.uid!==this.uid)throw new Error("attempted to relate unrelated exception");let i=a.recurrenceId.toString();if(this.exceptions[i]=a,a.modifiesFuture()){let n=[a.recurrenceId.toUnixTime(),i],o=tt(this.rangeExceptions,n,So);this.rangeExceptions.splice(o,0,n)}}modifiesFuture(){return this.component.hasProperty("recurrence-id")?this.component.getFirstProperty("recurrence-id").getParameter("range")===Kt.THISANDFUTURE:!1}findRangeException(a){if(!this.rangeExceptions.length)return null;let i=a.toUnixTime(),n=tt(this.rangeExceptions,[i],So);if(n-=1,n<0)return null;let o=this.rangeExceptions[n];return ia[0]?1:a[0]>e[0]?-1:0}var Re={foldLength:75,debug:!1,newLineChar:`\r +`,Binary:sr,Component:$e,ComponentParser:class{constructor(e){e===void 0&&(e={});for(let[a,i]of Object.entries(e))this[a]=i}parseEvent=!0;parseTimezone=!0;oncomplete=function(){};onerror=function(e){};ontimezone=function(e){};onevent=function(e){};process(e){typeof e=="string"&&(e=he(e)),e instanceof $e||(e=new $e(e));let a,i=e.getAllSubcomponents(),n=0,o=i.length;for(;n=20)return console.error("TimezoneManager.getTimezoneForIdRec() exceeds recursion limits"),null;if(this._aliases.has(a)){const n=this._aliases.get(a);return this._getTimezoneForIdRec(n,i+1)}return null}hasTimezoneForId(a){return this._timezones.has(a)||this._aliases.has(a)}isAlias(a){return!this._timezones.has(a)&&this._aliases.has(a)}listAllTimezones(a=!1){const i=Array.from(this._timezones.keys());return a?i.concat(Array.from(this._aliases.keys())):i}registerTimezone(a){this._timezones.set(a.timezoneId,a),Re.TimezoneService.register(a.timezoneId,a.toICALTimezone()),this._pendingAliases=this._pendingAliases.filter(([i,n])=>n!==a.timezoneId?!0:(Re.TimezoneService.register(i,a.toICALTimezone()),!1))}registerDefaultTimezones(){console.debug(`@nextcloud/calendar-js app is using version ${$a.version} of the timezone database`);for(const a in $a.zones)if(Object.prototype.hasOwnProperty.call($a.zones,[a])){const i=["BEGIN:VTIMEZONE","TZID:"+a,...$a.zones[a].ics,"END:VTIMEZONE"].join(`\r +`);this.registerTimezoneFromICS(a,i)}for(const a in $a.aliases)Object.prototype.hasOwnProperty.call($a.aliases,[a])&&this.registerAlias(a,$a.aliases[a].aliasTo)}registerTimezoneFromICS(a,i){const n=new ya(a,i);this.registerTimezone(n)}registerAlias(a,i){this._aliases.set(a,i);const n=this.getTimezoneForId(i);if(!n){this._pendingAliases.push([a,i]);return}Re.TimezoneService.register(a,n.toICALTimezone())}unregisterTimezones(a){this._timezones.delete(a),Re.TimezoneService.remove(a)}unregisterAlias(a){this._aliases.delete(a),this._pendingAliases=this._pendingAliases.filter(([i])=>i!==a),Re.TimezoneService.remove(a)}clearAllTimezones(){this._aliases=new Map,this._pendingAliases=[],this._timezones=new Map,Re.TimezoneService.reset(),bt.registerTimezone(ya.utc),bt.registerTimezone(ya.floating),bt.registerAlias("GMT",ya.utc.timezoneId),bt.registerAlias("Z",ya.utc.timezoneId)}}const bt=new $_;bt.clearAllTimezones();function Q_(){return bt}var fr={exports:{}};(function(e,a){(function(i,n){e.exports=n()})(typeof self<"u"?self:Na,function(){return(()=>{var i={646:r=>{r.exports=function(_){if(Array.isArray(_)){for(var l=0,g=new Array(_.length);l<_.length;l++)g[l]=_[l];return g}}},713:r=>{r.exports=function(_,l,g){return l in _?Object.defineProperty(_,l,{value:g,enumerable:!0,configurable:!0,writable:!0}):_[l]=g,_}},860:r=>{r.exports=function(_){if(Symbol.iterator in Object(_)||Object.prototype.toString.call(_)==="[object Arguments]")return Array.from(_)}},206:r=>{r.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},319:(r,_,l)=>{var g=l(646),d=l(860),f=l(206);r.exports=function(h){return g(h)||d(h)||f()}},8:r=>{function _(l){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?r.exports=_=function(g){return typeof g}:r.exports=_=function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},_(l)}r.exports=_}},n={};function o(r){var _=n[r];if(_!==void 0)return _.exports;var l=n[r]={exports:{}};return i[r](l,l.exports,o),l.exports}o.n=r=>{var _=r&&r.__esModule?()=>r.default:()=>r;return o.d(_,{a:_}),_},o.d=(r,_)=>{for(var l in _)o.o(_,l)&&!o.o(r,l)&&Object.defineProperty(r,l,{enumerable:!0,get:_[l]})},o.o=(r,_)=>Object.prototype.hasOwnProperty.call(r,_),o.r=r=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var s={};return(()=>{o.r(s),o.d(s,{VueSelect:()=>G,default:()=>I,mixins:()=>W});var r=o(319),_=o.n(r),l=o(8),g=o.n(l),d=o(713),f=o.n(d);const h={props:{autoscroll:{type:Boolean,default:!0}},watch:{typeAheadPointer:function(){this.autoscroll&&this.maybeAdjustScroll()},open:function(c){var v=this;this.autoscroll&&c&&this.$nextTick(function(){return v.maybeAdjustScroll()})}},methods:{maybeAdjustScroll:function(){var c,v=((c=this.$refs.dropdownMenu)===null||c===void 0?void 0:c.children[this.typeAheadPointer])||!1;if(v){var R=this.getDropdownViewport(),O=v.getBoundingClientRect(),z=O.top,q=O.bottom,ie=O.height;if(zR.bottom)return this.$refs.dropdownMenu.scrollTop=v.offsetTop-(R.height-ie)}},getDropdownViewport:function(){return this.$refs.dropdownMenu?this.$refs.dropdownMenu.getBoundingClientRect():{height:0,top:0,bottom:0}}}},u={data:function(){return{typeAheadPointer:-1}},watch:{filteredOptions:function(){if(this.resetFocusOnOptionsChange){for(var c=0;c=0;c--)if(this.selectable(this.filteredOptions[c])){this.typeAheadPointer=c;break}},typeAheadDown:function(){for(var c=this.typeAheadPointer+1;c0&&arguments[0]!==void 0?arguments[0]:null;return this.mutableLoading=c??!this.mutableLoading}}};function b(c,v,R,O,z,q,ie,ee){var fe,ne=typeof c=="function"?c.options:c;return v&&(ne.render=v,ne.staticRenderFns=R,ne._compiled=!0),{exports:c,options:ne}}const y={Deselect:b({},function(){var c=this.$createElement,v=this._self._c||c;return v("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"}},[v("path",{attrs:{d:"M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z"}})])},[]).exports,OpenIndicator:b({},function(){var c=this.$createElement,v=this._self._c||c;return v("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"}},[v("path",{attrs:{d:"M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z"}})])},[]).exports},k={inserted:function(c,v,R){var O=R.context;if(O.appendToBody){document.body.appendChild(c);var z=O.$refs.toggle.getBoundingClientRect(),q=z.height,ie=z.top,ee=z.left,fe=z.width,ne=window.scrollX||window.pageXOffset,ce=window.scrollY||window.pageYOffset;c.unbindPosition=O.calculatePosition(c,O,{width:fe+"px",left:ne+ee+"px",top:ce+ie+q+"px"})}},unbind:function(c,v,R){R.context.appendToBody&&(c.unbindPosition&&typeof c.unbindPosition=="function"&&c.unbindPosition(),c.parentNode&&c.parentNode.removeChild(c))}},w=function(c){var v={};return Object.keys(c).sort().forEach(function(R){v[R]=c[R]}),JSON.stringify(v)};var S=0;const j=function(){return++S};function Z(c,v){var R=Object.keys(c);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(c);v&&(O=O.filter(function(z){return Object.getOwnPropertyDescriptor(c,z).enumerable})),R.push.apply(R,O)}return R}function B(c){for(var v=1;v-1}},filter:{type:Function,default:function(c,v){var R=this;return c.filter(function(O){var z=R.getOptionLabel(O);return typeof z=="number"&&(z=z.toString()),R.filterBy(O,z,v)})}},createOption:{type:Function,default:function(c){return g()(this.optionList[0])==="object"?f()({},this.label,c):c}},resetFocusOnOptionsChange:{type:Boolean,default:!0},resetOnOptionsChange:{default:!1,validator:function(c){return["function","boolean"].includes(g()(c))}},clearSearchOnBlur:{type:Function,default:function(c){var v=c.clearSearchOnSelect,R=c.multiple;return v&&!R}},noDrop:{type:Boolean,default:!1},inputId:{type:String},dir:{type:String,default:"auto"},selectOnTab:{type:Boolean,default:!1},selectOnKeyCodes:{type:Array,default:function(){return[13]}},searchInputQuerySelector:{type:String,default:"[type=search]"},mapKeydown:{type:Function,default:function(c,v){return c}},appendToBody:{type:Boolean,default:!1},calculatePosition:{type:Function,default:function(c,v,R){var O=R.width,z=R.top,q=R.left;c.style.top=z,c.style.left=q,c.style.width=O}},dropdownShouldOpen:{type:Function,default:function(c){var v=c.noDrop,R=c.open,O=c.mutableLoading;return!v&&R&&!O}},keyboardFocusBorder:{type:Boolean,default:!1},uid:{type:[String,Number],default:function(){return j()}}},data:function(){return{search:"",open:!1,isComposing:!1,isKeyboardNavigation:!1,pushedTags:[],_value:[]}},computed:{isTrackingValues:function(){return this.value===void 0||this.$options.propsData.hasOwnProperty("reduce")},selectedValue:function(){var c=this.value;return this.isTrackingValues&&(c=this.$data._value),c!=null&&c!==""?[].concat(c):[]},optionList:function(){return this.options.concat(this.pushTags?this.pushedTags:[])},searchEl:function(){return this.$scopedSlots.search?this.$refs.selectedOptions.querySelector(this.searchInputQuerySelector):this.$refs.search},scope:function(){var c=this,v={search:this.search,loading:this.loading,searching:this.searching,filteredOptions:this.filteredOptions};return{search:{attributes:B({id:this.inputId,disabled:this.disabled,placeholder:this.searchPlaceholder,tabindex:this.tabindex,readonly:!this.searchable,role:"combobox","aria-autocomplete":"list","aria-label":this.ariaLabelCombobox,"aria-controls":"vs-".concat(this.uid,"__listbox"),"aria-owns":"vs-".concat(this.uid,"__listbox"),"aria-expanded":this.dropdownOpen.toString(),ref:"search",type:"search",autocomplete:this.autocomplete,value:this.search},this.dropdownOpen&&this.filteredOptions[this.typeAheadPointer]?{"aria-activedescendant":"vs-".concat(this.uid,"__option-").concat(this.typeAheadPointer)}:{}),events:{compositionstart:function(){return c.isComposing=!0},compositionend:function(){return c.isComposing=!1},keydown:this.onSearchKeyDown,keypress:this.onSearchKeyPress,blur:this.onSearchBlur,focus:this.onSearchFocus,input:function(R){return c.search=R.target.value}}},spinner:{loading:this.mutableLoading},noOptions:{search:this.search,loading:this.mutableLoading,searching:this.searching},openIndicator:{attributes:{ref:"openIndicator",role:"presentation",class:"vs__open-indicator"}},listHeader:v,listFooter:v,header:B({},v,{deselect:this.deselect}),footer:B({},v,{deselect:this.deselect})}},childComponents:function(){return B({},y,{},this.components)},stateClasses:function(){return{"vs--open":this.dropdownOpen,"vs--single":!this.multiple,"vs--multiple":this.multiple,"vs--searching":this.searching&&!this.noDrop,"vs--searchable":this.searchable&&!this.noDrop,"vs--unsearchable":!this.searchable,"vs--loading":this.mutableLoading,"vs--disabled":this.disabled}},searching:function(){return!!this.search},dropdownOpen:function(){return this.dropdownShouldOpen(this)},searchPlaceholder:function(){return this.isValueEmpty&&this.placeholder?this.placeholder:void 0},filteredOptions:function(){var c=this,v=function(q){return c.limit!==null?q.slice(0,c.limit):q},R=[].concat(this.optionList);if(!this.filterable&&!this.taggable)return v(R);var O=this.search.length?this.filter(R,this.search,this):R;if(this.taggable&&this.search.length){var z=this.createOption(this.search);this.optionExists(z)||O.unshift(z)}return v(O)},isValueEmpty:function(){return this.selectedValue.length===0},showClearButton:function(){return!this.multiple&&this.clearable&&!this.open&&!this.isValueEmpty}},watch:{options:function(c,v){var R=this;!this.taggable&&(typeof R.resetOnOptionsChange=="function"?R.resetOnOptionsChange(c,v,R.selectedValue):R.resetOnOptionsChange)&&this.clearSelection(),this.value&&this.isTrackingValues&&this.setInternalValueFromOptions(this.value)},value:{immediate:!0,handler:function(c){this.isTrackingValues&&this.setInternalValueFromOptions(c)}},multiple:function(){this.clearSelection()},open:function(c){this.$emit(c?"open":"close")},search:function(c){c.length&&(this.open=!0)}},created:function(){this.mutableLoading=this.loading,this.$on("option:created",this.pushTag)},methods:{setInternalValueFromOptions:function(c){var v=this;Array.isArray(c)?this.$data._value=c.map(function(R){return v.findOptionFromReducedValue(R)}):this.$data._value=this.findOptionFromReducedValue(c)},select:function(c){this.$emit("option:selecting",c),this.isOptionSelected(c)?this.deselectFromDropdown&&(this.clearable||this.multiple&&this.selectedValue.length>1)&&this.deselect(c):(this.taggable&&!this.optionExists(c)&&this.$emit("option:created",c),this.multiple&&(c=this.selectedValue.concat(c)),this.updateValue(c),this.$emit("option:selected",c)),this.onAfterSelect(c)},deselect:function(c){var v=this;this.$emit("option:deselecting",c),this.updateValue(this.selectedValue.filter(function(R){return!v.optionComparator(R,c)})),this.$emit("option:deselected",c)},keyboardDeselect:function(c,v){var R,O;this.deselect(c);var z=(R=this.$refs.deselectButtons)===null||R===void 0?void 0:R[v+1],q=(O=this.$refs.deselectButtons)===null||O===void 0?void 0:O[v-1],ie=z??q;ie?ie.focus():this.searchEl.focus()},clearSelection:function(){this.updateValue(this.multiple?[]:null),this.searchEl.focus()},onAfterSelect:function(c){var v=this;this.closeOnSelect&&(this.open=!this.open),this.clearSearchOnSelect&&(this.search=""),this.noDrop&&this.multiple&&this.$nextTick(function(){return v.$refs.search.focus()})},updateValue:function(c){var v=this;this.value===void 0&&(this.$data._value=c),c!==null&&(c=Array.isArray(c)?c.map(function(R){return v.reduce(R)}):this.reduce(c)),this.$emit("input",c)},toggleDropdown:function(c){var v=c.target!==this.searchEl;v&&c.preventDefault();var R=[].concat(_()(this.$refs.deselectButtons||[]),_()([this.$refs.clearButton]));this.searchEl===void 0||R.filter(Boolean).some(function(O){return O.contains(c.target)||O===c.target})?c.preventDefault():this.open&&v?this.searchEl.blur():this.disabled||(this.open=!0,this.searchEl.focus())},isOptionSelected:function(c){var v=this;return this.selectedValue.some(function(R){return v.optionComparator(R,c)})},isOptionDeselectable:function(c){return this.isOptionSelected(c)&&this.deselectFromDropdown},hasKeyboardFocusBorder:function(c){return!(!this.keyboardFocusBorder||!this.isKeyboardNavigation)&&c===this.typeAheadPointer},optionComparator:function(c,v){return this.getOptionKey(c)===this.getOptionKey(v)},findOptionFromReducedValue:function(c){var v=this,R=[].concat(_()(this.options),_()(this.pushedTags)).filter(function(O){return JSON.stringify(v.reduce(O))===JSON.stringify(c)});return R.length===1?R[0]:R.find(function(O){return v.optionComparator(O,v.$data._value)})||c},closeSearchOptions:function(){this.open=!1,this.$emit("search:blur")},maybeDeleteValue:function(){if(!this.searchEl.value.length&&this.selectedValue&&this.selectedValue.length&&this.clearable){var c=null;this.multiple&&(c=_()(this.selectedValue.slice(0,this.selectedValue.length-1))),this.updateValue(c)}},optionExists:function(c){var v=this;return this.optionList.some(function(R){return v.optionComparator(R,c)})},optionAriaSelected:function(c){return this.selectable(c)?String(this.isOptionSelected(c)):null},normalizeOptionForSlot:function(c){return g()(c)==="object"?c:f()({},this.label,c)},pushTag:function(c){this.pushedTags.push(c)},onEscape:function(){this.search.length?this.search="":this.open=!1},onSearchBlur:function(){if(!this.mousedown||this.searching){var c=this.clearSearchOnSelect,v=this.multiple;return this.clearSearchOnBlur({clearSearchOnSelect:c,multiple:v})&&(this.search=""),void this.closeSearchOptions()}this.mousedown=!1,this.search.length!==0||this.options.length!==0||this.closeSearchOptions()},onSearchFocus:function(){this.open=!0,this.$emit("search:focus")},onMousedown:function(){this.mousedown=!0},onMouseUp:function(){this.mousedown=!1},onMouseMove:function(c,v){this.isKeyboardNavigation=!1,this.selectable(c)&&(this.typeAheadPointer=v)},onSearchKeyDown:function(c){var v=this,R=function(q){if(q.preventDefault(),v.open)return!v.isComposing&&v.typeAheadSelect();v.open=!0},O={8:function(q){return v.maybeDeleteValue()},9:function(q){return v.onTab()},27:function(q){return v.onEscape()},38:function(q){if(q.preventDefault(),v.isKeyboardNavigation=!0,v.open)return v.typeAheadUp();v.open=!0},40:function(q){if(q.preventDefault(),v.isKeyboardNavigation=!0,v.open)return v.typeAheadDown();v.open=!0}};this.selectOnKeyCodes.forEach(function(q){return O[q]=R});var z=this.mapKeydown(O,this);if(typeof z[c.keyCode]=="function")return z[c.keyCode](c)},onSearchKeyPress:function(c){this.open||c.keyCode!==32||(c.preventDefault(),this.open=!0)}}},function(){var c=this,v=c.$createElement,R=c._self._c||v;return R("div",{staticClass:"v-select",class:c.stateClasses,attrs:{id:"v-select-"+c.uid,dir:c.dir}},[c._t("header",null,null,c.scope.header),c._v(" "),R("div",{ref:"toggle",staticClass:"vs__dropdown-toggle"},[R("div",{ref:"selectedOptions",staticClass:"vs__selected-options",on:{mousedown:c.toggleDropdown}},[c._l(c.selectedValue,function(O,z){return c._t("selected-option-container",[R("span",{key:c.getOptionKey(O),staticClass:"vs__selected"},[c._t("selected-option",[c._v(` + `+c._s(c.getOptionLabel(O))+` + `)],null,c.normalizeOptionForSlot(O)),c._v(" "),c.multiple?R("button",{ref:"deselectButtons",refInFor:!0,staticClass:"vs__deselect",attrs:{disabled:c.disabled,type:"button",title:c.ariaLabelDeselectOption(c.getOptionLabel(O)),"aria-label":c.ariaLabelDeselectOption(c.getOptionLabel(O))},on:{mousedown:function(q){return q.stopPropagation(),c.deselect(O)},keydown:function(q){return!q.type.indexOf("key")&&c._k(q.keyCode,"enter",13,q.key,"Enter")?null:c.keyboardDeselect(O,z)}}},[R(c.childComponents.Deselect,{tag:"component"})],1):c._e()],2)],{option:c.normalizeOptionForSlot(O),deselect:c.deselect,multiple:c.multiple,disabled:c.disabled})}),c._v(" "),c._t("search",[R("input",c._g(c._b({staticClass:"vs__search"},"input",c.scope.search.attributes,!1),c.scope.search.events))],null,c.scope.search)],2),c._v(" "),R("div",{ref:"actions",staticClass:"vs__actions"},[R("button",{directives:[{name:"show",rawName:"v-show",value:c.showClearButton,expression:"showClearButton"}],ref:"clearButton",staticClass:"vs__clear",attrs:{disabled:c.disabled,type:"button",title:c.ariaLabelClearSelected,"aria-label":c.ariaLabelClearSelected},on:{click:c.clearSelection}},[R(c.childComponents.Deselect,{tag:"component"})],1),c._v(" "),c.noDrop?c._e():R("button",{ref:"openIndicatorButton",staticClass:"vs__open-indicator-button",attrs:{type:"button",tabindex:"-1","aria-labelledby":"vs-"+c.uid+"__listbox","aria-controls":"vs-"+c.uid+"__listbox","aria-expanded":c.dropdownOpen.toString()},on:{mousedown:c.toggleDropdown}},[c._t("open-indicator",[R(c.childComponents.OpenIndicator,c._b({tag:"component"},"component",c.scope.openIndicator.attributes,!1))],null,c.scope.openIndicator)],2),c._v(" "),c._t("spinner",[R("div",{directives:[{name:"show",rawName:"v-show",value:c.mutableLoading,expression:"mutableLoading"}],staticClass:"vs__spinner"},[c._v("Loading...")])],null,c.scope.spinner)],2)]),c._v(" "),R("transition",{attrs:{name:c.transition}},[c.dropdownOpen?R("ul",{directives:[{name:"append-to-body",rawName:"v-append-to-body"}],key:"vs-"+c.uid+"__listbox",ref:"dropdownMenu",staticClass:"vs__dropdown-menu",attrs:{id:"vs-"+c.uid+"__listbox",role:"listbox","aria-label":c.ariaLabelListbox,"aria-multiselectable":c.multiple,tabindex:"-1"},on:{mousedown:function(O){return O.preventDefault(),c.onMousedown(O)},mouseup:c.onMouseUp}},[c._t("list-header",null,null,c.scope.listHeader),c._v(" "),c._l(c.filteredOptions,function(O,z){return R("li",{key:c.getOptionKey(O),staticClass:"vs__dropdown-option",class:{"vs__dropdown-option--deselect":c.isOptionDeselectable(O)&&z===c.typeAheadPointer,"vs__dropdown-option--selected":c.isOptionSelected(O),"vs__dropdown-option--highlight":z===c.typeAheadPointer,"vs__dropdown-option--kb-focus":c.hasKeyboardFocusBorder(z),"vs__dropdown-option--disabled":!c.selectable(O)},attrs:{id:"vs-"+c.uid+"__option-"+z,role:"option","aria-selected":c.optionAriaSelected(O)},on:{mousemove:function(q){return c.onMouseMove(O,z)},click:function(q){q.preventDefault(),q.stopPropagation(),c.selectable(O)&&c.select(O)}}},[c._t("option",[c._v(` + `+c._s(c.getOptionLabel(O))+` + `)],null,c.normalizeOptionForSlot(O))],2)}),c._v(" "),c.filteredOptions.length===0?R("li",{staticClass:"vs__no-options"},[c._t("no-options",[c._v(` + Sorry, no matching options. + `)],null,c.scope.noOptions)],2):c._e(),c._v(" "),c._t("list-footer",null,null,c.scope.listFooter)],2):R("ul",{staticStyle:{display:"none",visibility:"hidden"},attrs:{id:"vs-"+c.uid+"__listbox",role:"listbox","aria-label":c.ariaLabelListbox}})]),c._v(" "),c._t("footer",null,null,c.scope.footer)],2)},[]).exports,W={ajax:m,pointer:u,pointerScroll:h},I=G})(),s})()})})(fr);var Qa=fr.exports;const Mi=Math.min,nt=Math.max,ji=Math.round,di=Math.floor,Ga=e=>({x:e,y:e}),K_={left:"right",right:"left",bottom:"top",top:"bottom"},J_={start:"end",end:"start"};function Ro(e,a,i){return nt(e,Mi(a,i))}function yt(e,a){return typeof e=="function"?e(a):e}function Ua(e){return e.split("-")[0]}function E0(e){return e.split("-")[1]}function In(e){return e==="x"?"y":"x"}function gr(e){return e==="y"?"height":"width"}function lt(e){return["top","bottom"].includes(Ua(e))?"y":"x"}function hr(e){return In(lt(e))}function X_(e,a,i){i===void 0&&(i=!1);const n=E0(e),o=hr(e),s=gr(o);let r=o==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return a.reference[s]>a.floating[s]&&(r=Yi(r)),[r,Yi(r)]}function ed(e){const a=Yi(e);return[ln(e),a,ln(a)]}function ln(e){return e.replace(/start|end/g,a=>J_[a])}function ad(e,a,i){const n=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?a?o:n:a?n:o;case"left":case"right":return a?s:r;default:return[]}}function td(e,a,i,n){const o=E0(e);let s=ad(Ua(e),i==="start",n);return o&&(s=s.map(r=>r+"-"+o),a&&(s=s.concat(s.map(ln)))),s}function Yi(e){return e.replace(/left|right|bottom|top/g,a=>K_[a])}function id(e){return{top:0,right:0,bottom:0,left:0,...e}}function nd(e){return typeof e!="number"?id(e):{top:e,right:e,bottom:e,left:e}}function qi(e){const{x:a,y:i,width:n,height:o}=e;return{width:n,height:o,top:i,left:a,right:a+n,bottom:i+o,x:a,y:i}}function Co(e,a,i){let{reference:n,floating:o}=e;const s=lt(a),r=hr(a),_=gr(r),l=Ua(a),g=s==="y",d=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,h=n[_]/2-o[_]/2;let u;switch(l){case"top":u={x:d,y:n.y-o.height};break;case"bottom":u={x:d,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:f};break;case"left":u={x:n.x-o.width,y:f};break;default:u={x:n.x,y:n.y}}switch(E0(a)){case"start":u[r]-=h*(i&&g?-1:1);break;case"end":u[r]+=h*(i&&g?-1:1);break}return u}const od=async(e,a,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,_=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(a));let g=await r.getElementRects({reference:e,floating:a,strategy:o}),{x:d,y:f}=Co(g,n,l),h=n,u={},m=0;for(let b=0;b<_.length;b++){const{name:y,fn:k}=_[b],{x:w,y:S,data:j,reset:Z}=await k({x:d,y:f,initialPlacement:n,placement:h,strategy:o,middlewareData:u,rects:g,platform:r,elements:{reference:e,floating:a}});d=w??d,f=S??f,u={...u,[y]:{...u[y],...j}},Z&&m<=50&&(m++,typeof Z=="object"&&(Z.placement&&(h=Z.placement),Z.rects&&(g=Z.rects===!0?await r.getElementRects({reference:e,floating:a,strategy:o}):Z.rects),{x:d,y:f}=Co(g,h,l)),b=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:u}};async function Fr(e,a){var i;a===void 0&&(a={});const{x:n,y:o,platform:s,rects:r,elements:_,strategy:l}=e,{boundary:g="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:u=0}=yt(a,e),m=nd(u),b=_[h?f==="floating"?"reference":"floating":f],y=qi(await s.getClippingRect({element:(i=await(s.isElement==null?void 0:s.isElement(b)))==null||i?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(_.floating)),boundary:g,rootBoundary:d,strategy:l})),k=f==="floating"?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(_.floating)),S=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},j=qi(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:_,rect:k,offsetParent:w,strategy:l}):k);return{top:(y.top-j.top+m.top)/S.y,bottom:(j.bottom-y.bottom+m.bottom)/S.y,left:(y.left-j.left+m.left)/S.x,right:(j.right-y.right+m.right)/S.x}}const sd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(a){var i,n;const{placement:o,middlewareData:s,rects:r,initialPlacement:_,platform:l,elements:g}=a,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:b=!0,...y}=yt(e,a);if((i=s.arrow)!=null&&i.alignmentOffset)return{};const k=Ua(o),w=lt(_),S=Ua(_)===_,j=await(l.isRTL==null?void 0:l.isRTL(g.floating)),Z=h||(S||!b?[Yi(_)]:ed(_)),B=m!=="none";!h&&B&&Z.push(...td(_,b,m,j));const G=[_,...Z],W=await Fr(a,y),I=[];let c=((n=s.flip)==null?void 0:n.overflows)||[];if(d&&I.push(W[k]),f){const z=X_(o,r,j);I.push(W[z[0]],W[z[1]])}if(c=[...c,{placement:o,overflows:I}],!I.every(z=>z<=0)){var v,R;const z=(((v=s.flip)==null?void 0:v.index)||0)+1,q=G[z];if(q)return{data:{index:z,overflows:c},reset:{placement:q}};let ie=(R=c.filter(ee=>ee.overflows[0]<=0).sort((ee,fe)=>ee.overflows[1]-fe.overflows[1])[0])==null?void 0:R.placement;if(!ie)switch(u){case"bestFit":{var O;const ee=(O=c.filter(fe=>{if(B){const ne=lt(fe.placement);return ne===w||ne==="y"}return!0}).map(fe=>[fe.placement,fe.overflows.filter(ne=>ne>0).reduce((ne,ce)=>ne+ce,0)]).sort((fe,ne)=>fe[1]-ne[1])[0])==null?void 0:O[0];ee&&(ie=ee);break}case"initialPlacement":ie=_;break}if(o!==ie)return{reset:{placement:ie}}}return{}}}};async function rd(e,a){const{placement:i,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),r=Ua(i),_=E0(i),l=lt(i)==="y",g=["left","top"].includes(r)?-1:1,d=s&&l?-1:1,f=yt(a,e);let{mainAxis:h,crossAxis:u,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return _&&typeof m=="number"&&(u=_==="end"?m*-1:m),l?{x:u*d,y:h*g}:{x:h*g,y:u*d}}const ld=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(a){var i,n;const{x:o,y:s,placement:r,middlewareData:_}=a,l=await rd(a,e);return r===((i=_.offset)==null?void 0:i.placement)&&(n=_.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:r}}}}},_d=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(a){const{x:i,y:n,placement:o}=a,{mainAxis:s=!0,crossAxis:r=!1,limiter:_={fn:y=>{let{x:k,y:w}=y;return{x:k,y:w}}},...l}=yt(e,a),g={x:i,y:n},d=await Fr(a,l),f=lt(Ua(o)),h=In(f);let u=g[h],m=g[f];if(s){const y=h==="y"?"top":"left",k=h==="y"?"bottom":"right",w=u+d[y],S=u-d[k];u=Ro(w,u,S)}if(r){const y=f==="y"?"top":"left",k=f==="y"?"bottom":"right",w=m+d[y],S=m-d[k];m=Ro(w,m,S)}const b=_.fn({...a,[h]:u,[f]:m});return{...b,data:{x:b.x-i,y:b.y-n}}}}},dd=function(e){return e===void 0&&(e={}),{options:e,fn(a){const{x:i,y:n,placement:o,rects:s,middlewareData:r}=a,{offset:_=0,mainAxis:l=!0,crossAxis:g=!0}=yt(e,a),d={x:i,y:n},f=lt(o),h=In(f);let u=d[h],m=d[f];const b=yt(_,a),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const S=h==="y"?"height":"width",j=s.reference[h]-s.floating[S]+y.mainAxis,Z=s.reference[h]+s.reference[S]-y.mainAxis;uZ&&(u=Z)}if(g){var k,w;const S=h==="y"?"width":"height",j=["top","left"].includes(Ua(o)),Z=s.reference[f]-s.floating[S]+(j&&((k=r.offset)==null?void 0:k[f])||0)+(j?0:y.crossAxis),B=s.reference[f]+s.reference[S]+(j?0:((w=r.offset)==null?void 0:w[f])||0)-(j?y.crossAxis:0);mB&&(m=B)}return{[h]:u,[f]:m}}}};function Bt(e){return ur(e)?(e.nodeName||"").toLowerCase():"#document"}function Xe(e){var a;return(e==null||(a=e.ownerDocument)==null?void 0:a.defaultView)||window}function va(e){var a;return(a=(ur(e)?e.ownerDocument:e.document)||window.document)==null?void 0:a.documentElement}function ur(e){return e instanceof Node||e instanceof Xe(e).Node}function la(e){return e instanceof Element||e instanceof Xe(e).Element}function ca(e){return e instanceof HTMLElement||e instanceof Xe(e).HTMLElement}function Bo(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xe(e).ShadowRoot}function ni(e){const{overflow:a,overflowX:i,overflowY:n,display:o}=_a(e);return/auto|scroll|overlay|hidden|clip/.test(a+n+i)&&!["inline","contents"].includes(o)}function fd(e){return["table","td","th"].includes(Bt(e))}function k0(e){return[":popover-open",":modal"].some(a=>{try{return e.matches(a)}catch{return!1}})}function Hn(e){const a=Pn(),i=la(e)?_a(e):e;return i.transform!=="none"||i.perspective!=="none"||(i.containerType?i.containerType!=="normal":!1)||!a&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!a&&(i.filter?i.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(i.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(i.contain||"").includes(n))}function gd(e){let a=za(e);for(;ca(a)&&!Et(a);){if(Hn(a))return a;if(k0(a))return null;a=za(a)}return null}function Pn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Et(e){return["html","body","#document"].includes(Bt(e))}function _a(e){return Xe(e).getComputedStyle(e)}function A0(e){return la(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function za(e){if(Bt(e)==="html")return e;const a=e.assignedSlot||e.parentNode||Bo(e)&&e.host||va(e);return Bo(a)?a.host:a}function cr(e){const a=za(e);return Et(a)?e.ownerDocument?e.ownerDocument.body:e.body:ca(a)&&ni(a)?a:cr(a)}function Jt(e,a,i){var n;a===void 0&&(a=[]),i===void 0&&(i=!0);const o=cr(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),r=Xe(o);if(s){const _=_n(r);return a.concat(r,r.visualViewport||[],ni(o)?o:[],_&&i?Jt(_):[])}return a.concat(o,Jt(o,[],i))}function _n(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function mr(e){const a=_a(e);let i=parseFloat(a.width)||0,n=parseFloat(a.height)||0;const o=ca(e),s=o?e.offsetWidth:i,r=o?e.offsetHeight:n,_=ji(i)!==s||ji(n)!==r;return _&&(i=s,n=r),{width:i,height:n,$:_}}function Gn(e){return la(e)?e:e.contextElement}function Dt(e){const a=Gn(e);if(!ca(a))return Ga(1);const i=a.getBoundingClientRect(),{width:n,height:o,$:s}=mr(a);let r=(s?ji(i.width):i.width)/n,_=(s?ji(i.height):i.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!_||!Number.isFinite(_))&&(_=1),{x:r,y:_}}const hd=Ga(0);function pr(e){const a=Xe(e);return!Pn()||!a.visualViewport?hd:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function Fd(e,a,i){return a===void 0&&(a=!1),!i||a&&i!==Xe(e)?!1:a}function _t(e,a,i,n){a===void 0&&(a=!1),i===void 0&&(i=!1);const o=e.getBoundingClientRect(),s=Gn(e);let r=Ga(1);a&&(n?la(n)&&(r=Dt(n)):r=Dt(e));const _=Fd(s,i,n)?pr(s):Ga(0);let l=(o.left+_.x)/r.x,g=(o.top+_.y)/r.y,d=o.width/r.x,f=o.height/r.y;if(s){const h=Xe(s),u=n&&la(n)?Xe(n):n;let m=h,b=_n(m);for(;b&&n&&u!==m;){const y=Dt(b),k=b.getBoundingClientRect(),w=_a(b),S=k.left+(b.clientLeft+parseFloat(w.paddingLeft))*y.x,j=k.top+(b.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,g*=y.y,d*=y.x,f*=y.y,l+=S,g+=j,m=Xe(b),b=_n(m)}}return qi({width:d,height:f,x:l,y:g})}function ud(e){let{elements:a,rect:i,offsetParent:n,strategy:o}=e;const s=o==="fixed",r=va(n),_=a?k0(a.floating):!1;if(n===r||_&&s)return i;let l={scrollLeft:0,scrollTop:0},g=Ga(1);const d=Ga(0),f=ca(n);if((f||!f&&!s)&&((Bt(n)!=="body"||ni(r))&&(l=A0(n)),ca(n))){const h=_t(n);g=Dt(n),d.x=h.x+n.clientLeft,d.y=h.y+n.clientTop}return{width:i.width*g.x,height:i.height*g.y,x:i.x*g.x-l.scrollLeft*g.x+d.x,y:i.y*g.y-l.scrollTop*g.y+d.y}}function cd(e){return Array.from(e.getClientRects())}function br(e){return _t(va(e)).left+A0(e).scrollLeft}function md(e){const a=va(e),i=A0(e),n=e.ownerDocument.body,o=nt(a.scrollWidth,a.clientWidth,n.scrollWidth,n.clientWidth),s=nt(a.scrollHeight,a.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+br(e);const _=-i.scrollTop;return _a(n).direction==="rtl"&&(r+=nt(a.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:_}}function pd(e,a){const i=Xe(e),n=va(e),o=i.visualViewport;let s=n.clientWidth,r=n.clientHeight,_=0,l=0;if(o){s=o.width,r=o.height;const g=Pn();(!g||g&&a==="fixed")&&(_=o.offsetLeft,l=o.offsetTop)}return{width:s,height:r,x:_,y:l}}function bd(e,a){const i=_t(e,!0,a==="fixed"),n=i.top+e.clientTop,o=i.left+e.clientLeft,s=ca(e)?Dt(e):Ga(1),r=e.clientWidth*s.x,_=e.clientHeight*s.y,l=o*s.x,g=n*s.y;return{width:r,height:_,x:l,y:g}}function Oo(e,a,i){let n;if(a==="viewport")n=pd(e,i);else if(a==="document")n=md(va(e));else if(la(a))n=bd(a,i);else{const o=pr(e);n={...a,x:a.x-o.x,y:a.y-o.y}}return qi(n)}function Tr(e,a){const i=za(e);return i===a||!la(i)||Et(i)?!1:_a(i).position==="fixed"||Tr(i,a)}function Td(e,a){const i=a.get(e);if(i)return i;let n=Jt(e,[],!1).filter(_=>la(_)&&Bt(_)!=="body"),o=null;const s=_a(e).position==="fixed";let r=s?za(e):e;for(;la(r)&&!Et(r);){const _=_a(r),l=Hn(r);!l&&_.position==="fixed"&&(o=null),(s?!l&&!o:!l&&_.position==="static"&&o&&["absolute","fixed"].includes(o.position)||ni(r)&&!l&&Tr(e,r))?n=n.filter(g=>g!==r):o=_,r=za(r)}return a.set(e,n),n}function Dd(e){let{element:a,boundary:i,rootBoundary:n,strategy:o}=e;const s=[...i==="clippingAncestors"?k0(a)?[]:Td(a,this._c):[].concat(i),n],r=s[0],_=s.reduce((l,g)=>{const d=Oo(a,g,o);return l.top=nt(d.top,l.top),l.right=Mi(d.right,l.right),l.bottom=Mi(d.bottom,l.bottom),l.left=nt(d.left,l.left),l},Oo(a,r,o));return{width:_.right-_.left,height:_.bottom-_.top,x:_.left,y:_.top}}function yd(e){const{width:a,height:i}=mr(e);return{width:a,height:i}}function Ed(e,a,i){const n=ca(a),o=va(a),s=i==="fixed",r=_t(e,!0,s,a);let _={scrollLeft:0,scrollTop:0};const l=Ga(0);if(n||!n&&!s)if((Bt(a)!=="body"||ni(o))&&(_=A0(a)),n){const f=_t(a,!0,s,a);l.x=f.x+a.clientLeft,l.y=f.y+a.clientTop}else o&&(l.x=br(o));const g=r.left+_.scrollLeft-l.x,d=r.top+_.scrollTop-l.y;return{x:g,y:d,width:r.width,height:r.height}}function I0(e){return _a(e).position==="static"}function No(e,a){return!ca(e)||_a(e).position==="fixed"?null:a?a(e):e.offsetParent}function Dr(e,a){const i=Xe(e);if(k0(e))return i;if(!ca(e)){let o=za(e);for(;o&&!Et(o);){if(la(o)&&!I0(o))return o;o=za(o)}return i}let n=No(e,a);for(;n&&fd(n)&&I0(n);)n=No(n,a);return n&&Et(n)&&I0(n)&&!Hn(n)?i:n||gd(e)||i}const kd=async function(e){const a=this.getOffsetParent||Dr,i=this.getDimensions,n=await i(e.floating);return{reference:Ed(e.reference,await a(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Ad(e){return _a(e).direction==="rtl"}const wd={convertOffsetParentRelativeRectToViewportRelativeRect:ud,getDocumentElement:va,getClippingRect:Dd,getOffsetParent:Dr,getElementRects:kd,getClientRects:cd,getDimensions:yd,getScale:Dt,isElement:la,isRTL:Ad};function vd(e,a){let i=null,n;const o=va(e);function s(){var _;clearTimeout(n),(_=i)==null||_.disconnect(),i=null}function r(_,l){_===void 0&&(_=!1),l===void 0&&(l=1),s();const{left:g,top:d,width:f,height:h}=e.getBoundingClientRect();if(_||a(),!f||!h)return;const u=di(d),m=di(o.clientWidth-(g+f)),b=di(o.clientHeight-(d+h)),y=di(g),k={rootMargin:-u+"px "+-m+"px "+-b+"px "+-y+"px",threshold:nt(0,Mi(1,l))||1};let w=!0;function S(j){const Z=j[0].intersectionRatio;if(Z!==l){if(!w)return r();Z?r(!1,Z):n=setTimeout(()=>{r(!1,1e-7)},1e3)}w=!1}try{i=new IntersectionObserver(S,{...k,root:o.ownerDocument})}catch{i=new IntersectionObserver(S,k)}i.observe(e)}return r(!0),s}function Sd(e,a,i,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:_=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,g=Gn(e),d=o||s?[...g?Jt(g):[],...Jt(a)]:[];d.forEach(k=>{o&&k.addEventListener("scroll",i,{passive:!0}),s&&k.addEventListener("resize",i)});const f=g&&_?vd(g,i):null;let h=-1,u=null;r&&(u=new ResizeObserver(k=>{let[w]=k;w&&w.target===g&&u&&(u.unobserve(a),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=u)==null||S.observe(a)})),i()}),g&&!l&&u.observe(g),u.observe(a));let m,b=l?_t(e):null;l&&y();function y(){const k=_t(e);b&&(k.x!==b.x||k.y!==b.y||k.width!==b.width||k.height!==b.height)&&i(),b=k,m=requestAnimationFrame(y)}return i(),()=>{var k;d.forEach(w=>{o&&w.removeEventListener("scroll",i),s&&w.removeEventListener("resize",i)}),f?.(),(k=u)==null||k.disconnect(),u=null,l&&cancelAnimationFrame(m)}}const Rd=ld,Cd=_d,Bd=sd,Od=dd,Nd=(e,a,i)=>{const n=new Map,o={platform:wd,...i},s={...o.platform,_c:n};return od(e,a,{...o,platform:s})},xd={name:"ChevronDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Md=function(){var e=this,a=e._self._c;return a("span",e._b({staticClass:"material-design-icon chevron-down-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(i){return e.$emit("click",i)}}},"span",e.$attrs,!1),[a("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"}},[e.title?a("title",[e._v(e._s(e.title))]):e._e()])])])},jd=[],Yd=te(xd,Md,jd,!1,null,null);const yr=Yd.exports,Er=(e,a)=>{const i=[];let n=0,o=e.toLowerCase().indexOf(a.toLowerCase(),n),s=0;for(;o>-1&&s[]}},computed:{ranges(){let e=[];return!this.search&&this.highlight.length===0||(this.highlight.length>0?e=this.highlight:e=Er(this.text,this.search),e.forEach((a,i)=>{a.end(i.start0&&a.push({start:i.start<0?0:i.start,end:i.end>this.text.length?this.text.length:i.end}),a),[]),e.sort((a,i)=>a.start-i.start),e=e.reduce((a,i)=>{if(!a.length)a.push(i);else{const n=a.length-1;a[n].end>=i.start?a[n]={start:a[n].start,end:Math.max(a[n].end,i.end)}:a.push(i)}return a},[])),e},chunks(){if(this.ranges.length===0)return[{start:0,end:this.text.length,highlight:!1,text:this.text}];const e=[];let a=0,i=0;for(;a=this.ranges.length&&aa.highlight?e("strong",{},a.text):a.text)):e("span",{},this.text)}},Ld=null,Zd=null;var Id=te(qd,Ld,Zd,!1,null,null);const w0=Id.exports,Hd={name:"NcEllipsisedOption",components:{NcHighlight:w0},props:{name:{type:String,default:""},search:{type:String,default:""}},computed:{needsTruncate(){return this.name&&this.name.length>=10},split(){return this.name.length-Math.min(Math.floor(this.name.length/2),10)},part1(){return this.needsTruncate?this.name.slice(0,this.split):this.name},part2(){return this.needsTruncate?this.name.slice(this.split):""},highlight1(){return this.search?Er(this.name,this.search):[]},highlight2(){return this.highlight1.map(e=>({start:e.start-this.split,end:e.end-this.split}))}}};var Pd=function(){var e=this,a=e._self._c;return a("span",{staticClass:"name-parts",attrs:{title:e.name}},[a("NcHighlight",{staticClass:"name-parts__first",attrs:{text:e.part1,search:e.search,highlight:e.highlight1}}),e.part2?a("NcHighlight",{staticClass:"name-parts__last",attrs:{text:e.part2,search:e.search,highlight:e.highlight2}}):e._e()],1)},Gd=[],Ud=te(Hd,Pd,Gd,!1,null,"0c4478a6");const zd=Ud.exports,Wd={name:"NcActionRouter",mixins:[er],inject:{isInSemanticMenu:{from:"NcActions:isSemanticMenu",default:!1}},props:{to:{type:[String,Object],default:"",required:!0},exact:{type:Boolean,default:!1}}};var Vd=function(){var e=this,a=e._self._c;return a("li",{staticClass:"action",attrs:{role:e.isInSemanticMenu&&"presentation"}},[a("RouterLink",{staticClass:"action-router focusable",attrs:{to:e.to,"aria-label":e.ariaLabel,exact:e.exact,title:e.title,rel:"nofollow noreferrer noopener",role:e.isInSemanticMenu&&"menuitem"},nativeOn:{click:function(i){return e.onClick.apply(null,arguments)}}},[e._t("icon",function(){return[a("span",{staticClass:"action-router__icon",class:[e.isIconUrl?"action-router__icon--url":e.icon],style:{backgroundImage:e.isIconUrl?"url(".concat(e.icon,")"):null},attrs:{"aria-hidden":"true"}})]}),e.name?a("span",{staticClass:"action-router__longtext-wrapper"},[a("strong",{staticClass:"action-router__name"},[e._v(" "+e._s(e.name)+" ")]),a("br"),a("span",{staticClass:"action-router__longtext",domProps:{textContent:e._s(e.text)}})]):e.isLongText?a("span",{staticClass:"action-router__longtext",domProps:{textContent:e._s(e.text)}}):a("span",{staticClass:"action-router__text"},[e._v(e._s(e.text))]),e._e()],2)],1)},$d=[],Qd=te(Wd,Vd,$d,!1,null,"579c6b4d");const Kd=Qd.exports,Jd={name:"NcActionText",mixins:[er],inject:{isInSemanticMenu:{from:"NcActions:isSemanticMenu",default:!1}}};var Xd=function(){var e=this,a=e._self._c;return a("li",{staticClass:"action",attrs:{role:e.isInSemanticMenu&&"presentation"}},[a("span",{staticClass:"action-text",on:{click:e.onClick}},[e._t("icon",function(){return[e.icon!==""?a("span",{staticClass:"action-text__icon",class:[e.isIconUrl?"action-text__icon--url":e.icon],style:{backgroundImage:e.isIconUrl?"url(".concat(e.icon,")"):null},attrs:{"aria-hidden":"true"}}):e._e()]}),e.name?a("span",{staticClass:"action-text__longtext-wrapper"},[a("strong",{staticClass:"action-text__name"},[e._v(" "+e._s(e.name)+" ")]),a("br"),a("span",{staticClass:"action-text__longtext",domProps:{textContent:e._s(e.text)}})]):e.isLongText?a("span",{staticClass:"action-text__longtext",domProps:{textContent:e._s(e.text)}}):a("span",{staticClass:"action-text__text"},[e._v(e._s(e.text))]),e._e()],2)])},ef=[],af=te(Jd,Xd,ef,!1,null,"824615f4");const tf=af.exports,nf={name:"NcLoadingIcon",props:{size:{type:Number,default:20},appearance:{type:String,validator(e){return["auto","light","dark"].includes(e)},default:"auto"},name:{type:String,default:""}},computed:{colors(){const e=["#777","#CCC"];return this.appearance==="light"?e:this.appearance==="dark"?e.reverse():["var(--color-loading-light)","var(--color-loading-dark)"]}}};var of=function(){var e=this,a=e._self._c;return a("span",{staticClass:"material-design-icon loading-icon",attrs:{"aria-label":e.name,role:"img"}},[a("svg",{attrs:{width:e.size,height:e.size,viewBox:"0 0 24 24"}},[a("path",{attrs:{fill:e.colors[0],d:"M12,4V2A10,10 0 1,0 22,12H20A8,8 0 1,1 12,4Z"}}),a("path",{attrs:{fill:e.colors[1],d:"M12,4V2A10,10 0 0,1 22,12H20A8,8 0 0,0 12,4Z"}},[e.name?a("title",[e._v(e._s(e.name))]):e._e()])])])},sf=[],rf=te(nf,of,sf,!1,null,"551209a3");const v0=rf.exports,lf=` + + + +`,xo=` + + + + +`,_f=` + + + + + +`,Mo=` + + + + +`;oe(Yl);const kr=e=>{switch(e){case"away":return x("away");case"busy":return x("busy");case"dnd":return x("do not disturb");case"online":return x("online");case"invisible":return x("invisible");case"offline":return x("offline");default:return e}};oe(ql);const df={name:"NcUserStatusIcon",props:{user:{type:String,default:null},status:{type:String,default:null,validator:e=>["online","away","busy","dnd","invisible","offline"].includes(e)},ariaHidden:{type:String,default:null,validator:e=>["true","false"].includes(e)}},data(){return{fetchedUserStatus:null}},computed:{activeStatus(){var e;return(e=this.status)!=null?e:this.fetchedUserStatus},activeSvg(){var e;return(e={online:lf,away:xo,busy:xo,dnd:_f,invisible:Mo,offline:Mo}[this.activeStatus])!=null?e:null},ariaLabel(){return this.ariaHidden==="true"?null:x("User status: {status}",{status:kr(this.activeStatus)})}},watch:{user:{immediate:!0,async handler(e,a){var i,n,o,s;if(!e||!((n=(i=ar())==null?void 0:i.user_status)!=null&&n.enabled)){this.fetchedUserStatus=null;return}try{const{data:r}=await ma.get(Pa("/apps/user_status/api/v1/statuses/{user}",{user:e}));this.fetchedUserStatus=(s=(o=r.ocs)==null?void 0:o.data)==null?void 0:s.status}catch{this.fetchedUserStatus=null}}}}};var ff=function(){var e=this,a=e._self._c;return e.activeStatus?a("span",{staticClass:"user-status-icon",class:{"user-status-icon--invisible":["invisible","offline"].includes(e.status)},attrs:{role:"img","aria-hidden":e.ariaHidden,"aria-label":e.ariaLabel},domProps:{innerHTML:e._s(e.activeSvg)}}):e._e()},gf=[],hf=te(df,ff,gf,!1,null,"0555d8d0");const Ar=hf.exports;oe(Ll);class Ae{constructor(a,i,n,o){this.r=a,this.g=i,this.b=n,o&&(this.name=o)}get color(){const a=i=>"00".concat(i.toString(16)).slice(-2);return"#".concat(a(this.r)).concat(a(this.g)).concat(a(this.b))}}function Ff(e,a){const i=new Array(3);return i[0]=(a[1].r-a[0].r)/e,i[1]=(a[1].g-a[0].g)/e,i[2]=(a[1].b-a[0].b)/e,i}function H0(e,a,i){const n=[];n.push(a);const o=Ff(e,[a,i]);for(let s=1;s>>32-n},rotr:function(i,n){return i<<32-n|i>>>n},endian:function(i){if(i.constructor==Number)return a.rotl(i,8)&16711935|a.rotl(i,24)&4278255360;for(var n=0;n0;i--)n.push(Math.floor(Math.random()*256));return n},bytesToWords:function(i){for(var n=[],o=0,s=0;o>>5]|=i[o]<<24-s%32;return n},wordsToBytes:function(i){for(var n=[],o=0;o>>5]>>>24-o%32&255);return n},bytesToHex:function(i){for(var n=[],o=0;o>>4).toString(16)),n.push((i[o]&15).toString(16));return n.join("")},hexToBytes:function(i){for(var n=[],o=0;o>>6*(3-r)&63)):n.push("=");return n.join("")},base64ToBytes:function(i){i=i.replace(/[^A-Z0-9+\/]/ig,"");for(var n=[],o=0,s=0;o>>6-s*2);return n}};vr.exports=a})();var mf=vr.exports,dn={utf8:{stringToBytes:function(e){return dn.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(dn.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var a=[],i=0;i>>24)&16711935|(_[u]<<24|_[u]>>>8)&4278255360;_[l>>>5]|=128<>>9<<4)+14]=l;for(var m=o._ff,b=o._gg,y=o._hh,k=o._ii,u=0;u<_.length;u+=16){var w=g,S=d,j=f,Z=h;g=m(g,d,f,h,_[u+0],7,-680876936),h=m(h,g,d,f,_[u+1],12,-389564586),f=m(f,h,g,d,_[u+2],17,606105819),d=m(d,f,h,g,_[u+3],22,-1044525330),g=m(g,d,f,h,_[u+4],7,-176418897),h=m(h,g,d,f,_[u+5],12,1200080426),f=m(f,h,g,d,_[u+6],17,-1473231341),d=m(d,f,h,g,_[u+7],22,-45705983),g=m(g,d,f,h,_[u+8],7,1770035416),h=m(h,g,d,f,_[u+9],12,-1958414417),f=m(f,h,g,d,_[u+10],17,-42063),d=m(d,f,h,g,_[u+11],22,-1990404162),g=m(g,d,f,h,_[u+12],7,1804603682),h=m(h,g,d,f,_[u+13],12,-40341101),f=m(f,h,g,d,_[u+14],17,-1502002290),d=m(d,f,h,g,_[u+15],22,1236535329),g=b(g,d,f,h,_[u+1],5,-165796510),h=b(h,g,d,f,_[u+6],9,-1069501632),f=b(f,h,g,d,_[u+11],14,643717713),d=b(d,f,h,g,_[u+0],20,-373897302),g=b(g,d,f,h,_[u+5],5,-701558691),h=b(h,g,d,f,_[u+10],9,38016083),f=b(f,h,g,d,_[u+15],14,-660478335),d=b(d,f,h,g,_[u+4],20,-405537848),g=b(g,d,f,h,_[u+9],5,568446438),h=b(h,g,d,f,_[u+14],9,-1019803690),f=b(f,h,g,d,_[u+3],14,-187363961),d=b(d,f,h,g,_[u+8],20,1163531501),g=b(g,d,f,h,_[u+13],5,-1444681467),h=b(h,g,d,f,_[u+2],9,-51403784),f=b(f,h,g,d,_[u+7],14,1735328473),d=b(d,f,h,g,_[u+12],20,-1926607734),g=y(g,d,f,h,_[u+5],4,-378558),h=y(h,g,d,f,_[u+8],11,-2022574463),f=y(f,h,g,d,_[u+11],16,1839030562),d=y(d,f,h,g,_[u+14],23,-35309556),g=y(g,d,f,h,_[u+1],4,-1530992060),h=y(h,g,d,f,_[u+4],11,1272893353),f=y(f,h,g,d,_[u+7],16,-155497632),d=y(d,f,h,g,_[u+10],23,-1094730640),g=y(g,d,f,h,_[u+13],4,681279174),h=y(h,g,d,f,_[u+0],11,-358537222),f=y(f,h,g,d,_[u+3],16,-722521979),d=y(d,f,h,g,_[u+6],23,76029189),g=y(g,d,f,h,_[u+9],4,-640364487),h=y(h,g,d,f,_[u+12],11,-421815835),f=y(f,h,g,d,_[u+15],16,530742520),d=y(d,f,h,g,_[u+2],23,-995338651),g=k(g,d,f,h,_[u+0],6,-198630844),h=k(h,g,d,f,_[u+7],10,1126891415),f=k(f,h,g,d,_[u+14],15,-1416354905),d=k(d,f,h,g,_[u+5],21,-57434055),g=k(g,d,f,h,_[u+12],6,1700485571),h=k(h,g,d,f,_[u+3],10,-1894986606),f=k(f,h,g,d,_[u+10],15,-1051523),d=k(d,f,h,g,_[u+1],21,-2054922799),g=k(g,d,f,h,_[u+8],6,1873313359),h=k(h,g,d,f,_[u+15],10,-30611744),f=k(f,h,g,d,_[u+6],15,-1560198380),d=k(d,f,h,g,_[u+13],21,1309151649),g=k(g,d,f,h,_[u+4],6,-145523070),h=k(h,g,d,f,_[u+11],10,-1120210379),f=k(f,h,g,d,_[u+2],15,718787259),d=k(d,f,h,g,_[u+9],21,-343485551),g=g+w>>>0,d=d+S>>>0,f=f+j>>>0,h=h+Z>>>0}return e.endian([g,d,f,h])};o._ff=function(s,r,_,l,g,d,f){var h=s+(r&_|~r&l)+(g>>>0)+f;return(h<>>32-d)+r},o._gg=function(s,r,_,l,g,d,f){var h=s+(r&l|_&~l)+(g>>>0)+f;return(h<>>32-d)+r},o._hh=function(s,r,_,l,g,d,f){var h=s+(r^_^l)+(g>>>0)+f;return(h<>>32-d)+r},o._ii=function(s,r,_,l,g,d,f){var h=s+(_^(r|~l))+(g>>>0)+f;return(h<>>32-d)+r},o._blocksize=16,o._digestsize=16,wr.exports=function(s,r){if(s==null)throw new Error("Illegal argument "+s);var _=e.wordsToBytes(o(s,r));return r&&r.asBytes?_:r&&r.asString?n.bytesToString(_):e.bytesToHex(_)}})();var Tf=wr.exports;const Df=Rn(Tf),Yo=function(e){let a=e.toLowerCase();a.match(/^([0-9a-f]{4}-?){8}$/)===null&&(a=Df(a)),a=a.replace(/[^0-9a-f]/g,"");const i=6,n=cf(i);function o(s,r){let _=0;const l=[];for(let g=0;g{const n=window.getComputedStyle(document.body).getPropertyValue("--background-invert-if-dark")==="invert(100%)";return Ps("/avatar"+(i?"/guest":"")+"/{user}/{size}"+(n?"/dark":""),{user:e,size:a})},yf="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Ef="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",kt=(e,a)=>{for(const i in a)e[i]=a[i];return e},fn="numeric",gn="ascii",hn="alpha",Ei="asciinumeric",fi="alphanumeric",Fn="domain",Rr="emoji",kf="scheme",Af="slashscheme",qo="whitespace";function wf(e,a){return e in a||(a[e]=[]),a[e]}function Xa(e,a,i){a[fn]&&(a[Ei]=!0,a[fi]=!0),a[gn]&&(a[Ei]=!0,a[hn]=!0),a[Ei]&&(a[fi]=!0),a[hn]&&(a[fi]=!0),a[fi]&&(a[Fn]=!0),a[Rr]&&(a[Fn]=!0);for(const n in a){const o=wf(n,i);o.indexOf(e)<0&&o.push(e)}}function vf(e,a){const i={};for(const n in a)a[n].indexOf(e)>=0&&(i[n]=!0);return i}function Je(e){e===void 0&&(e=null),this.j={},this.jr=[],this.jd=null,this.t=e}Je.groups={},Je.prototype={accepts(){return!!this.t},go(e){const a=this,i=a.j[e];if(i)return i;for(let n=0;ne.ta(a,i,n,o),ea=(e,a,i,n,o)=>e.tr(a,i,n,o),Lo=(e,a,i,n,o)=>e.ts(a,i,n,o),H=(e,a,i,n,o)=>e.tt(a,i,n,o),ba="WORD",un="UWORD",Xt="LOCALHOST",cn="TLD",mn="UTLD",ki="SCHEME",ct="SLASH_SCHEME",zn="NUM",Cr="WS",Wn="NL",qt="OPENBRACE",Lt="CLOSEBRACE",Li="OPENBRACKET",Zi="CLOSEBRACKET",Ii="OPENPAREN",Hi="CLOSEPAREN",Pi="OPENANGLEBRACKET",Gi="CLOSEANGLEBRACKET",Ui="FULLWIDTHLEFTPAREN",zi="FULLWIDTHRIGHTPAREN",Wi="LEFTCORNERBRACKET",Vi="RIGHTCORNERBRACKET",$i="LEFTWHITECORNERBRACKET",Qi="RIGHTWHITECORNERBRACKET",Ki="FULLWIDTHLESSTHAN",Ji="FULLWIDTHGREATERTHAN",Xi="AMPERSAND",e0="APOSTROPHE",a0="ASTERISK",Oa="AT",t0="BACKSLASH",i0="BACKTICK",n0="CARET",Ma="COLON",Vn="COMMA",o0="DOLLAR",fa="DOT",s0="EQUALS",$n="EXCLAMATION",ga="HYPHEN",r0="PERCENT",l0="PIPE",_0="PLUS",d0="POUND",f0="QUERY",Qn="QUOTE",Kn="SEMI",ha="SLASH",Zt="TILDE",g0="UNDERSCORE",Br="EMOJI",h0="SYM";var Or=Object.freeze({__proto__:null,WORD:ba,UWORD:un,LOCALHOST:Xt,TLD:cn,UTLD:mn,SCHEME:ki,SLASH_SCHEME:ct,NUM:zn,WS:Cr,NL:Wn,OPENBRACE:qt,CLOSEBRACE:Lt,OPENBRACKET:Li,CLOSEBRACKET:Zi,OPENPAREN:Ii,CLOSEPAREN:Hi,OPENANGLEBRACKET:Pi,CLOSEANGLEBRACKET:Gi,FULLWIDTHLEFTPAREN:Ui,FULLWIDTHRIGHTPAREN:zi,LEFTCORNERBRACKET:Wi,RIGHTCORNERBRACKET:Vi,LEFTWHITECORNERBRACKET:$i,RIGHTWHITECORNERBRACKET:Qi,FULLWIDTHLESSTHAN:Ki,FULLWIDTHGREATERTHAN:Ji,AMPERSAND:Xi,APOSTROPHE:e0,ASTERISK:a0,AT:Oa,BACKSLASH:t0,BACKTICK:i0,CARET:n0,COLON:Ma,COMMA:Vn,DOLLAR:o0,DOT:fa,EQUALS:s0,EXCLAMATION:$n,HYPHEN:ga,PERCENT:r0,PIPE:l0,PLUS:_0,POUND:d0,QUERY:f0,QUOTE:Qn,SEMI:Kn,SLASH:ha,TILDE:Zt,UNDERSCORE:g0,EMOJI:Br,SYM:h0});const Ft=/[a-z]/,P0=new RegExp("\\p{L}","u"),G0=new RegExp("\\p{Emoji}","u"),U0=/\d/,Zo=/\s/,Io=` +`,Sf="️",Rf="";let gi=null,hi=null;function Cf(e){e===void 0&&(e=[]);const a={};Je.groups=a;const i=new Je;gi==null&&(gi=Ho(yf)),hi==null&&(hi=Ho(Ef)),H(i,"'",e0),H(i,"{",qt),H(i,"}",Lt),H(i,"[",Li),H(i,"]",Zi),H(i,"(",Ii),H(i,")",Hi),H(i,"<",Pi),H(i,">",Gi),H(i,"(",Ui),H(i,")",zi),H(i,"「",Wi),H(i,"」",Vi),H(i,"『",$i),H(i,"』",Qi),H(i,"<",Ki),H(i,">",Ji),H(i,"&",Xi),H(i,"*",a0),H(i,"@",Oa),H(i,"`",i0),H(i,"^",n0),H(i,":",Ma),H(i,",",Vn),H(i,"$",o0),H(i,".",fa),H(i,"=",s0),H(i,"!",$n),H(i,"-",ga),H(i,"%",r0),H(i,"|",l0),H(i,"+",_0),H(i,"#",d0),H(i,"?",f0),H(i,'"',Qn),H(i,"/",ha),H(i,";",Kn),H(i,"~",Zt),H(i,"_",g0),H(i,"\\",t0);const n=ea(i,U0,zn,{[fn]:!0});ea(n,U0,n);const o=ea(i,Ft,ba,{[gn]:!0});ea(o,Ft,o);const s=ea(i,P0,un,{[hn]:!0});ea(s,Ft),ea(s,P0,s);const r=ea(i,Zo,Cr,{[qo]:!0});H(i,Io,Wn,{[qo]:!0}),H(r,Io),ea(r,Zo,r);const _=ea(i,G0,Br,{[Rr]:!0});ea(_,G0,_),H(_,Sf,_);const l=H(_,Rf);ea(l,G0,_);const g=[[Ft,o]],d=[[Ft,null],[P0,s]];for(let f=0;ff[0]>h[0]?1:-1);for(let f=0;f=0?u[Fn]=!0:Ft.test(h)?U0.test(h)?u[Ei]=!0:u[gn]=!0:u[fn]=!0,Lo(i,h,h,u)}return Lo(i,"localhost",Xt,{ascii:!0}),i.jd=new Je(h0),{start:i,tokens:kt({groups:a},Or)}}function Bf(e,a){const i=Of(a.replace(/[A-Z]/g,_=>_.toLowerCase())),n=i.length,o=[];let s=0,r=0;for(;r=0&&(f+=i[r].length,h++),g+=i[r].length,s+=i[r].length,r++;s-=f,r-=h,g-=f,o.push({t:d.t,v:a.slice(s-g,s),s:s-g,e:s})}return o}function Of(e){const a=[],i=e.length;let n=0;for(;n56319||n+1===i||(s=e.charCodeAt(n+1))<56320||s>57343?e[n]:e.slice(n,n+2);a.push(r),n+=r.length}return a}function Ra(e,a,i,n,o){let s;const r=a.length;for(let _=0;_=0;)s++;if(s>0){a.push(i.join(""));for(let r=parseInt(e.substring(n,n+s),10);r>0;r--)i.pop();n+=s}else i.push(e[n]),n++}return a}const ei={defaultProtocol:"http",events:null,format:Po,formatHref:Po,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Jn(e,a){a===void 0&&(a=null);let i=kt({},ei);e&&(i=kt(i,e instanceof Jn?e.o:e));const n=i.ignoreTags,o=[];for(let s=0;si?n.substring(0,i)+"…":n},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e){return e===void 0&&(e=ei.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const a=this,i=this.toHref(e.get("defaultProtocol")),n=e.get("formatHref",i,this),o=e.get("tagName",i,a),s=this.toFormattedString(e),r={},_=e.get("className",i,a),l=e.get("target",i,a),g=e.get("rel",i,a),d=e.getObj("attributes",i,a),f=e.getObj("events",i,a);return r.href=n,_&&(r.class=_),l&&(r.target=l),g&&(r.rel=g),d&&kt(r,d),{tagName:o,attributes:r,content:s,eventListeners:f}}};function S0(e,a){class i extends Nr{constructor(o,s){super(o,s),this.t=e}}for(const n in a)i.prototype[n]=a[n];return i.t=e,i}const Go=S0("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Uo=S0("text"),Nf=S0("nl"),Fi=S0("url",{isLink:!0,toHref(e){return e===void 0&&(e=ei.defaultProtocol),this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Xt&&e[1].t===Ma}}),aa=e=>new Je(e);function xf(e){let{groups:a}=e;const i=a.domain.concat([Xi,a0,Oa,t0,i0,n0,o0,s0,ga,zn,r0,l0,_0,d0,ha,h0,Zt,g0]),n=[e0,Ma,Vn,fa,$n,f0,Qn,Kn,Pi,Gi,qt,Lt,Zi,Li,Ii,Hi,Ui,zi,Wi,Vi,$i,Qi,Ki,Ji],o=[Xi,e0,a0,t0,i0,n0,o0,s0,ga,qt,Lt,r0,l0,_0,d0,f0,ha,h0,Zt,g0],s=aa(),r=H(s,Zt);re(r,o,r),re(r,a.domain,r);const _=aa(),l=aa(),g=aa();re(s,a.domain,_),re(s,a.scheme,l),re(s,a.slashscheme,g),re(_,o,r),re(_,a.domain,_);const d=H(_,Oa);H(r,Oa,d),H(l,Oa,d),H(g,Oa,d);const f=H(r,fa);re(f,o,r),re(f,a.domain,r);const h=aa();re(d,a.domain,h),re(h,a.domain,h);const u=H(h,fa);re(u,a.domain,h);const m=aa(Go);re(u,a.tld,m),re(u,a.utld,m),H(d,Xt,m);const b=H(h,ga);re(b,a.domain,h),re(m,a.domain,h),H(m,fa,u),H(m,ga,b);const y=H(m,Ma);re(y,a.numeric,Go);const k=H(_,ga),w=H(_,fa);re(k,a.domain,_),re(w,o,r),re(w,a.domain,_);const S=aa(Fi);re(w,a.tld,S),re(w,a.utld,S),re(S,a.domain,_),re(S,o,r),H(S,fa,w),H(S,ga,k),H(S,Oa,d);const j=H(S,Ma),Z=aa(Fi);re(j,a.numeric,Z);const B=aa(Fi),G=aa();re(B,i,B),re(B,n,G),re(G,i,B),re(G,n,G),H(S,ha,B),H(Z,ha,B);const W=H(l,Ma),I=H(g,Ma),c=H(I,ha),v=H(c,ha);re(l,a.domain,_),H(l,fa,w),H(l,ga,k),re(g,a.domain,_),H(g,fa,w),H(g,ga,k),re(W,a.domain,B),H(W,ha,B),re(v,a.domain,B),re(v,i,B),H(v,ha,B);const R=[[qt,Lt],[Li,Zi],[Ii,Hi],[Pi,Gi],[Ui,zi],[Wi,Vi],[$i,Qi],[Ki,Ji]];for(let O=0;O=0&&h++,o++,d++;if(h<0)o-=d,o0&&(s.push(z0(Uo,a,r)),r=[]),o-=h,d-=h;const u=f.t,m=i.slice(o-d,o);s.push(z0(u,a,m))}}return r.length>0&&s.push(z0(Uo,a,r)),s}function z0(e,a,i){const n=i[0].s,o=i[i.length-1].e,s=a.slice(n,o);return new e(s,i)}const He={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function jf(){He.scanner=Cf(He.customSchemes);for(let e=0;e/g,">")}function qf(e){return e.replace(/"/g,""")}function Lf(e){const a=[];for(const i in e){let n=e[i]+"";a.push(`${i}="${qf(n)}"`)}return a.join(" ")}function Zf(e){let{tagName:a,attributes:i,content:n}=e;return`<${a} ${Lf(i)}>${xr(n)}${a}>`}function If(e,a){a===void 0&&(a={}),a=new Jn(a,Zf);const i=Yf(e),n=[];for(let o=0;o +`):!s.isLink||!a.check(s)?n.push(xr(s.toString())):n.push(a.render(s))}return n.join("")}String.prototype.linkify||Object.defineProperty(String.prototype,"linkify",{writable:!1,value:function(e){return If(this,e)}});var Mr={exports:{}};(function(e){(function(a){if(typeof i!="function"){var i=function(m){return m};i.nonNative=!0}const n=i("plaintext"),o=i("html"),s=i("comment"),r=/<(\w*)>/g,_=/<\/?([^\s\/>]+)/;function l(m,b,y){m=m||"",b=b||[],y=y||"";let k=d(b,y);return f(m,k)}function g(m,b){m=m||[],b=b||"";let y=d(m,b);return function(k){return f(k||"",y)}}l.init_streaming_mode=g;function d(m,b){return m=h(m),{allowable_tags:m,tag_replacement:b,state:n,tag_buffer:"",depth:0,in_quote_char:""}}function f(m,b){if(typeof m!="string")throw new TypeError("'html' parameter must be a string");let y=b.allowable_tags,k=b.tag_replacement,w=b.state,S=b.tag_buffer,j=b.depth,Z=b.in_quote_char,B="";for(let G=0,W=m.length;G":if(Z)break;if(j){j--;break}Z="",w=n,S+=">",y.has(u(S))?B+=S:B+=k,S="";break;case'"':case"'":I===Z?Z="":Z=Z||I,S+=I;break;case"-":S==="":S.slice(-2)=="--"&&(w=n),S="";break;default:S+=I;break}}return b.state=w,b.tag_buffer=S,b.depth=j,b.in_quote_char=Z,B}function h(m){let b=new Set;if(typeof m=="string"){let y;for(;y=r.exec(m);)b.add(y[1])}else!i.nonNative&&typeof m[i.iterator]=="function"?b=new Set(m):typeof m.forEach=="function"&&m.forEach(b.add,b);return b}function u(m){let b=_.exec(m);return b?b[1].toLowerCase():null}e.exports?e.exports=l:a.striptags=l})(Na)})(Mr);var Hf=Mr.exports;const z2=Rn(Hf),Xn=(e,a)=>{const i=(d,f)=>d.startsWith(f)?d.slice(f.length):d,n=(d,...f)=>f.reduce((h,u)=>i(h,u),d);if(!e)return null;const o=/^https?:\/\//.test(a),s=/^[a-z][a-z0-9+.-]*:.+/.test(a);if(!o&&s||o&&!a.startsWith(mo())||!o&&!a.startsWith("/"))return null;const r=o?n(a,mo(),"/index.php"):a,_=n(e.history.base,Zl(),"/index.php"),l=n(r,_)||"/",g=e.resolve(l).route;return g.matched.length?g.fullPath:null};ka.util.warn;function xt(e){var a;const i=Yt(e);return(a=i?.$el)!=null?a:i}const jr=Pl?window:void 0;function Ai(...e){let a,i,n,o;if(typeof e[0]=="string"||Array.isArray(e[0])?([i,n,o]=e,a=jr):[a,i,n,o]=e,!a)return Ti;Array.isArray(i)||(i=[i]),Array.isArray(n)||(n=[n]);const s=[],r=()=>{s.forEach(d=>d()),s.length=0},_=(d,f,h,u)=>(d.addEventListener(f,h,u),()=>d.removeEventListener(f,h,u)),l=Cn(()=>[xt(a),Yt(o)],([d,f])=>{if(r(),!d)return;const h=Il(f)?{...f}:f;s.push(...i.flatMap(u=>n.map(m=>_(d,u,m,h))))},{immediate:!0,flush:"post"}),g=()=>{l(),r()};return Gs(g),g}let zo=!1;function Wo(e,a,i={}){const{window:n=jr,ignore:o=[],capture:s=!0,detectIframe:r=!1}=i;if(!n)return Ti;nn&&!zo&&(zo=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",Ti)),n.document.documentElement.addEventListener("click",Ti));let _=!0;const l=d=>o.some(f=>{if(typeof f=="string")return Array.from(n.document.querySelectorAll(f)).some(h=>h===d.target||d.composedPath().includes(h));{const h=xt(f);return h&&(d.target===h||d.composedPath().includes(h))}}),g=[Ai(n,"click",d=>{const f=xt(e);if(!(!f||f===d.target||d.composedPath().includes(f))){if(d.detail===0&&(_=!l(d)),!_){_=!0;return}a(d)}},{passive:!0,capture:s}),Ai(n,"pointerdown",d=>{const f=xt(e);_=!l(d)&&!!(f&&!d.composedPath().includes(f))},{passive:!0}),r&&Ai(n,"blur",d=>{setTimeout(()=>{var f;const h=xt(e);((f=n.document.activeElement)==null?void 0:f.tagName)==="IFRAME"&&!h?.contains(n.document.activeElement)&&a(d)},0)})].filter(Boolean);return()=>g.forEach(d=>d())}const Pf={[po.mounted](e,a){const i=!a.modifiers.bubble;if(typeof a.value=="function")e.__onClickOutside_stop=Wo(e,a.value,{capture:i});else{const[n,o]=a.value;e.__onClickOutside_stop=Wo(e,n,Object.assign({capture:i},o))}},[po.unmounted](e){e.__onClickOutside_stop()}};function W0(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function Yr(e){const a=window.getComputedStyle(e);if(a.overflowX==="scroll"||a.overflowY==="scroll"||a.overflowX==="auto"&&e.clientWidth1?!0:(a.preventDefault&&a.preventDefault(),!1)}const V0=new WeakMap;function Uf(e,a=!1){const i=at(a);let n=null,o="";Cn(Hl(e),_=>{const l=W0(Yt(_));if(l){const g=l;if(V0.get(g)||V0.set(g,g.style.overflow),g.style.overflow!=="hidden"&&(o=g.style.overflow),g.style.overflow==="hidden")return i.value=!0;if(i.value)return g.style.overflow="hidden"}},{immediate:!0});const s=()=>{const _=W0(Yt(e));!_||i.value||(nn&&(n=Ai(_,"touchmove",l=>{Gf(l)},{passive:!1})),_.style.overflow="hidden",i.value=!0)},r=()=>{const _=W0(Yt(e));!_||!i.value||(nn&&n?.(),_.style.overflow=o,V0.delete(_),i.value=!1)};return Gs(r),Ca({get(){return i.value},set(_){_?s():r()}})}function zf(){let e=!1;const a=at(!1);return(i,n)=>{if(a.value=n.value,e)return;e=!0;const o=Uf(i,n.value);Cn(a,s=>o.value=s)}}zf();const qr={data(){return{hasStatus:!1,userStatus:{status:null,message:null,icon:null}}},methods:{async fetchUserStatus(e){var a,i;if(!e)return;const n=ar();if(!(!Object.prototype.hasOwnProperty.call(n,"user_status")||!n.user_status.enabled)&&on())try{const{data:o}=await ma.get(Pa("apps/user_status/api/v1/statuses/{userId}",{userId:e})),{status:s,message:r,icon:_}=o.ocs.data;this.userStatus.status=s,this.userStatus.message=r||"",this.userStatus.icon=_||"",this.hasStatus=!0}catch(o){if(o.response.status===404&&((i=(a=o.response.data.ocs)==null?void 0:a.data)==null?void 0:i.length)===0)return;console.error(o)}}}};oe(Gl);const Lr=Bn("nextcloud").persist().build();function Wf(e){const a=Lr.getItem("user-has-avatar."+e);return typeof a=="string"?!!a:null}function Vo(e,a){e&&Lr.setItem("user-has-avatar."+e,a)}const Vf={name:"NcAvatar",directives:{ClickOutside:Pf},components:{DotsHorizontal:On,NcActions:Us,NcButton:wa,NcIconSvgWrapper:y0,NcLoadingIcon:v0,NcUserStatusIcon:Ar},mixins:[qr],props:{url:{type:String,default:void 0},iconClass:{type:String,default:void 0},user:{type:String,default:void 0},showUserStatus:{type:Boolean,default:!0},showUserStatusCompact:{type:Boolean,default:!0},preloadedUserStatus:{type:Object,default:void 0},isGuest:{type:Boolean,default:!1},displayName:{type:String,default:void 0},size:{type:Number,default:32},allowPlaceholder:{type:Boolean,default:!0},disableTooltip:{type:Boolean,default:!1},disableMenu:{type:Boolean,default:!1},tooltipMessage:{type:String,default:null},isNoUser:{type:Boolean,default:!1},menuContainer:{type:[String,Object,Element,Boolean],default:"body"}},data(){return{avatarUrlLoaded:null,avatarSrcSetLoaded:null,userDoesNotExist:!1,isAvatarLoaded:!1,isMenuLoaded:!1,contactsMenuLoading:!1,contactsMenuActions:[],contactsMenuOpenState:!1}},computed:{avatarAriaLabel(){var e,a;if(this.hasMenu)return this.canDisplayUserStatus||this.showUserStatusIconOnAvatar?x("Avatar of {displayName}, {status}",{displayName:(e=this.displayName)!=null?e:this.user,status:kr(this.userStatus.status)}):x("Avatar of {displayName}",{displayName:(a=this.displayName)!=null?a:this.user})},canDisplayUserStatus(){return this.showUserStatus&&this.hasStatus&&["online","away","busy","dnd"].includes(this.userStatus.status)},showUserStatusIconOnAvatar(){return this.showUserStatus&&this.showUserStatusCompact&&this.hasStatus&&this.userStatus.status!=="dnd"&&this.userStatus.icon},userIdentifier(){return this.isDisplayNameDefined?this.displayName:this.isUserDefined?this.user:""},isUserDefined(){return typeof this.user<"u"},isDisplayNameDefined(){return typeof this.displayName<"u"},isUrlDefined(){return typeof this.url<"u"},hasMenu(){var e;return this.disableMenu?!1:this.isMenuLoaded?this.menu.length>0:!(this.user===((e=on())==null?void 0:e.uid)||this.userDoesNotExist||this.url)},showInitials(){return this.allowPlaceholder&&this.userDoesNotExist&&!(this.iconClass||this.$slots.icon)},avatarStyle(){return{"--size":this.size+"px",lineHeight:this.size+"px",fontSize:Math.round(this.size*.45)+"px"}},initialsWrapperStyle(){const{r:e,g:a,b:i}=Yo(this.userIdentifier);return{backgroundColor:"rgba(".concat(e,", ").concat(a,", ").concat(i,", 0.1)")}},initialsStyle(){const{r:e,g:a,b:i}=Yo(this.userIdentifier);return{color:"rgb(".concat(e,", ").concat(a,", ").concat(i,")")}},tooltip(){return this.disableTooltip?!1:this.tooltipMessage?this.tooltipMessage:this.displayName},initials(){let e="?";if(this.showInitials){const a=this.userIdentifier.trim();if(a==="")return e;const i=a.match(/[\p{L}\p{N}\s]/gu);if(i==null)return e;const n=i.join(""),o=n.lastIndexOf(" ");e=String.fromCodePoint(n.codePointAt(0)),o!==-1&&(e=e.concat(String.fromCodePoint(n.codePointAt(o+1))))}return e.toLocaleUpperCase()},menu(){const e=this.contactsMenuActions.map(i=>{const n=Xn(this.$router,i.hyperlink);return{ncActionComponent:n?Kd:W1,ncActionComponentProps:n?{to:n,icon:i.icon}:{href:i.hyperlink,icon:i.icon},text:i.title}});function a(i){const n=document.createTextNode(i),o=document.createElement("p");return o.appendChild(n),o.innerHTML}if(this.showUserStatus&&(this.userStatus.icon||this.userStatus.message)){const i=` + `.concat(a(this.userStatus.icon),` + `);return[{ncActionComponent:tf,ncActionComponentProps:{},iconSvg:this.userStatus.icon?i:void 0,text:"".concat(this.userStatus.message)}].concat(e)}return e}},watch:{url(){this.userDoesNotExist=!1,this.loadAvatarUrl()},user(){this.userDoesNotExist=!1,this.isMenuLoaded=!1,this.loadAvatarUrl()}},mounted(){this.loadAvatarUrl(),j0("settings:avatar:updated",this.loadAvatarUrl),j0("settings:display-name:updated",this.loadAvatarUrl),this.showUserStatus&&this.user&&!this.isNoUser&&(this.preloadedUserStatus?(this.userStatus.status=this.preloadedUserStatus.status||"",this.userStatus.message=this.preloadedUserStatus.message||"",this.userStatus.icon=this.preloadedUserStatus.icon||"",this.hasStatus=this.preloadedUserStatus.status!==null):this.fetchUserStatus(this.user),j0("user_status:status.updated",this.handleUserStatusUpdated))},beforeDestroy(){Y0("settings:avatar:updated",this.loadAvatarUrl),Y0("settings:display-name:updated",this.loadAvatarUrl),this.showUserStatus&&this.user&&!this.isNoUser&&Y0("user_status:status.updated",this.handleUserStatusUpdated)},methods:{t:x,handleUserStatusUpdated(e){this.user===e.userId&&(this.userStatus={status:e.status,icon:e.icon,message:e.message})},async toggleMenu(e){e.type==="keydown"&&e.key!=="Enter"||(this.contactsMenuOpenState||await this.fetchContactsMenu(),this.contactsMenuOpenState=!this.contactsMenuOpenState)},closeMenu(){this.contactsMenuOpenState=!1},async fetchContactsMenu(){this.contactsMenuLoading=!0;try{const e=encodeURIComponent(this.user),{data:a}=await ma.post(Ps("contactsmenu/findOne"),"shareType=0&shareWith=".concat(e));this.contactsMenuActions=a.topAction?[a.topAction].concat(a.actions):a.actions}catch{this.contactsMenuOpenState=!1}this.contactsMenuLoading=!1,this.isMenuLoaded=!0},loadAvatarUrl(){if(this.isAvatarLoaded=!1,!this.isUrlDefined&&(!this.isUserDefined||this.isNoUser)){this.isAvatarLoaded=!0,this.userDoesNotExist=!0;return}if(this.isUrlDefined){this.updateImageIfValid(this.url);return}if(this.size<=64){const e=this.avatarUrlGenerator(this.user,64),a=[e+" 1x",this.avatarUrlGenerator(this.user,512)+" 8x"].join(", ");this.updateImageIfValid(e,a)}else{const e=this.avatarUrlGenerator(this.user,512);this.updateImageIfValid(e)}},avatarUrlGenerator(e,a){var i;let n=Un(e,a,this.isGuest);return e===((i=on())==null?void 0:i.uid)&&typeof oc_userconfig<"u"&&(n+="?v="+oc_userconfig.avatar.version),n},updateImageIfValid(e,a=null){const i=Wf(this.user);if(this.isUserDefined&&typeof i=="boolean"){this.isAvatarLoaded=!0,this.avatarUrlLoaded=e,a&&(this.avatarSrcSetLoaded=a),i===!1&&(this.userDoesNotExist=!0);return}const n=new Image;n.onload=()=>{this.avatarUrlLoaded=e,a&&(this.avatarSrcSetLoaded=a),this.isAvatarLoaded=!0,Vo(this.user,!0)},n.onerror=()=>{console.debug("Invalid avatar url",e),this.avatarUrlLoaded=null,this.avatarSrcSetLoaded=null,this.userDoesNotExist=!0,this.isAvatarLoaded=!1,Vo(this.user,!1)},a&&(n.srcset=a),n.src=e}}};var $f=function(){var e=this,a=e._self._c;return a("span",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeMenu,expression:"closeMenu"}],ref:"main",staticClass:"avatardiv popovermenu-wrapper",class:{"avatardiv--unknown":e.userDoesNotExist,"avatardiv--with-menu":e.hasMenu,"avatardiv--with-menu-loading":e.contactsMenuLoading},style:e.avatarStyle},[e._t("icon",function(){return[e.iconClass?a("span",{staticClass:"avatar-class-icon",class:e.iconClass}):e.isAvatarLoaded&&!e.userDoesNotExist?a("img",{attrs:{src:e.avatarUrlLoaded,srcset:e.avatarSrcSetLoaded,alt:""}}):e._e()]}),e.hasMenu&&e.menu.length===0?a("NcButton",{staticClass:"action-item action-item__menutoggle",attrs:{type:"tertiary-no-background","aria-label":e.avatarAriaLabel,title:e.tooltip},on:{click:e.toggleMenu},scopedSlots:e._u([{key:"icon",fn:function(){return[e.contactsMenuLoading?a("NcLoadingIcon"):a("DotsHorizontal",{attrs:{size:20}})]},proxy:!0}],null,!1,2617833509)}):e.hasMenu?a("NcActions",{attrs:{"force-menu":"","manual-open":"",type:"tertiary-no-background",container:e.menuContainer,open:e.contactsMenuOpenState,"aria-label":e.avatarAriaLabel,title:e.tooltip},on:{"update:open":function(i){e.contactsMenuOpenState=i},click:e.toggleMenu},scopedSlots:e._u([e.contactsMenuLoading?{key:"icon",fn:function(){return[a("NcLoadingIcon")]},proxy:!0}:null],null,!0)},e._l(e.menu,function(i,n){return a(i.ncActionComponent,e._b({key:n,tag:"component",scopedSlots:e._u([i.iconSvg?{key:"icon",fn:function(){return[a("NcIconSvgWrapper",{attrs:{svg:i.iconSvg}})]},proxy:!0}:null],null,!0)},"component",i.ncActionComponentProps,!1),[e._v(" "+e._s(i.text)+" ")])}),1):e._e(),e.showUserStatusIconOnAvatar?a("span",{staticClass:"avatardiv__user-status avatardiv__user-status--icon"},[e._v(" "+e._s(e.userStatus.icon)+" ")]):e.canDisplayUserStatus?a("NcUserStatusIcon",{staticClass:"avatardiv__user-status",attrs:{status:e.userStatus.status,"aria-hidden":String(e.hasMenu)}}):e._e(),e.showInitials?a("span",{staticClass:"avatardiv__initials-wrapper",style:e.initialsWrapperStyle},[a("span",{staticClass:"avatardiv__initials",style:e.initialsStyle},[e._v(" "+e._s(e.initials)+" ")])]):e._e()],2)},Qf=[],Kf=te(Vf,$f,Qf,!1,null,"9ce7ef1d");const Zr=Kf.exports,Jf=8,$o=32,Xf={name:"NcListItemIcon",components:{NcAvatar:Zr,NcHighlight:w0,NcIconSvgWrapper:y0},mixins:[qr],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:$o},noMargin:{type:Boolean,default:!1},displayName:{type:String,default:null},isNoUser:{type:Boolean,default:!1},id:{type:String,default:null}},setup(){return{margin:Jf,defaultSize:$o}},computed:{hasIcon(){return this.icon!==""},hasIconSvg(){return this.iconSvg!==""},isValidSubname(){var e,a;return((a=(e=this.subname)==null?void 0:e.trim)==null?void 0:a.call(e))!==""},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=/^([^<]*)<([^>]+)>?$/,a=this.search.match(e);return this.isNoUser||!a?[this.search,this.search]:[a[1].trim(),a[2]]}},beforeMount(){!this.isNoUser&&!this.subname&&this.fetchUserStatus(this.user)}};var eg=function(){var e=this,a=e._self._c;return a("span",e._g({staticClass:"option",class:{"option--compact":e.avatarSize({...e,...a.props}),{}),ariaLabelClearSelected:{type:String,default:x("Clear selected")},ariaLabelCombobox:{type:String,default:null},ariaLabelListbox:{type:String,default:x("Options")},ariaLabelDeselectOption:{type:Function,default:e=>x("Deselect {option}",{option:e})},appendToBody:{type:Boolean,default:!0},calculatePosition:{type:Function,default:null},closeOnSelect:{type:Boolean,default:!0},components:{type:Object,default:()=>({Deselect:{render:e=>e(Nn,{props:{size:20,fillColor:"var(--vs-controls-color)"},style:{cursor:"pointer"}})}})},limit:{type:Number,default:null},disabled:{type:Boolean,default:!1},dropdownShouldOpen:{type:Function,default:({noDrop:e,open:a})=>e?!1:a},filterBy:{type:Function,default:null},inputClass:{type:[String,Object],default:null},inputId:{type:String,default:()=>"select-input-".concat(st())},inputLabel:{type:String,default:null},labelOutside:{type:Boolean,default:!1},keyboardFocusBorder:{type:Boolean,default:!0},label:{type:String,default:null},loading:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},noWrap:{type:Boolean,default:!1},options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},mapKeydown:{type:Function,default(e,a){return{...e,27:i=>{a.open&&i.stopPropagation(),e[27](i)}}}},uid:{type:String,default:()=>st()},placement:{type:String,default:"bottom"},resetFocusOnOptionsChange:{type:Boolean,default:!0},userSelect:{type:Boolean,default:!1},value:{type:[String,Number,Object,Array],default:null},required:{type:Boolean,default:!1}," ":{}},emits:[" "],setup(){const e=Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--default-clickable-area")),a=Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--default-grid-baseline"));return{avatarSize:e-2*a}},data(){return{search:""}},computed:{inputRequired(){return this.required?this.value===null||Array.isArray(this.value)&&this.value.length===0:null},localCalculatePosition(){return this.calculatePosition!==null?this.calculatePosition:(e,a,{width:i})=>{e.style.width=i;const n={name:"addClass",fn(r){return e.classList.add("vs__dropdown-menu--floating"),{}}},o={name:"togglePlacementClass",fn({placement:r}){return a.$el.classList.toggle("select--drop-up",r==="top"),e.classList.toggle("vs__dropdown-menu--floating-placement-top",r==="top"),{}}},s=()=>{Nd(a.$refs.toggle,e,{placement:this.placement,middleware:[Rd(-1),n,o,Bd(),Cd({limiter:Od()})]}).then(({x:r,y:_})=>{Object.assign(e.style,{left:"".concat(r,"px"),top:"".concat(_,"px"),width:"".concat(a.$refs.toggle.getBoundingClientRect().width,"px")})})};return Sd(a.$refs.toggle,e,s)}},localFilterBy(){const e=/[^<]*<([^>]+)/;return this.filterBy!==null?this.filterBy:this.userSelect?(a,i,n)=>{var o,s,r;const _=n.match(e);return _&&((r=(s=(o=a.subname)==null?void 0:o.toLocaleLowerCase)==null?void 0:s.call(o))==null?void 0:r.indexOf(_[1].toLocaleLowerCase()))>-1||"".concat(i," ").concat(a.subname).toLocaleLowerCase().indexOf(n.toLocaleLowerCase())>-1}:Qa.VueSelect.props.filterBy.default},localLabel(){return this.label!==null?this.label:this.userSelect?"displayName":Qa.VueSelect.props.label.default},propsToForward(){const e=[...Object.keys(Qa.VueSelect.props),...Qa.VueSelect.mixins.flatMap(a=>{var i;return Object.keys((i=a.props)!=null?i:{})})];return{...Object.fromEntries(Object.entries(this.$props).filter(([a,i])=>e.includes(a))),calculatePosition:this.localCalculatePosition,filterBy:this.localFilterBy,label:this.localLabel}}},mounted(){!this.labelOutside&&!this.inputLabel&&!this.ariaLabelCombobox&&ka.util.warn("[NcSelect] An `inputLabel` or `ariaLabelCombobox` should be set. If an external label is used, `labelOutside` should be set to `true`."),this.inputLabel&&this.ariaLabelCombobox&&ka.util.warn("[NcSelect] Only one of `inputLabel` or `ariaLabelCombobox` should to be set.")},methods:{t:x}};var og=function(){var e=this,a=e._self._c;return a("VueSelect",e._g(e._b({staticClass:"select",class:{"select--no-wrap":e.noWrap,"user-select":e.userSelect},on:{search:i=>e.search=i},scopedSlots:e._u([!e.labelOutside&&e.inputLabel?{key:"header",fn:function(){return[a("label",{staticClass:"select__label",attrs:{for:e.inputId}},[e._v(" "+e._s(e.inputLabel)+" ")])]},proxy:!0}:null,{key:"search",fn:function({attributes:i,events:n}){return[a("input",e._g(e._b({class:["vs__search",e.inputClass],attrs:{required:e.inputRequired}},"input",i,!1),n))]}},{key:"open-indicator",fn:function({attributes:i}){return[a("ChevronDown",e._b({style:{cursor:e.disabled?null:"pointer"},attrs:{"fill-color":"var(--vs-controls-color)",size:26}},"ChevronDown",i,!1))]}},{key:"option",fn:function(i){return[e.userSelect?a("NcListItemIcon",e._b({attrs:{"avatar-size":32,name:i[e.localLabel],search:e.search}},"NcListItemIcon",i,!1)):a("NcEllipsisedOption",{attrs:{name:String(i[e.localLabel]),search:e.search}})]}},{key:"selected-option",fn:function(i){return[e.userSelect?a("NcListItemIcon",e._b({attrs:{"avatar-size":e.avatarSize,name:i[e.localLabel],"no-margin":"",search:e.search}},"NcListItemIcon",i,!1)):a("NcEllipsisedOption",{attrs:{name:String(i[e.localLabel]),search:e.search}})]}},{key:"spinner",fn:function(i){return[i.loading?a("NcLoadingIcon"):e._e()]}},{key:"no-options",fn:function(){return[e._v(" "+e._s(e.t("No results"))+" ")]},proxy:!0},e._l(e.$scopedSlots,function(i,n){return{key:n,fn:function(o){return[e._t(n,null,null,o)]}}})],null,!0)},"VueSelect",e.propsToForward,!1),e.$listeners))},sg=[],rg=te(ng,og,sg,!1,null,null);const R0=rg.exports;oe(zl);function lg(e=[],a=[]){const i={},n=[];for(const o of e){const s=o.split("/");let[r,_]=[s.shift(),s.join("/")];_||(_=r,r=x("Global")),i[r]=i[r]||{continent:r,regions:[]},i[r].regions.push({label:Ir(_),cities:[],timezoneId:o})}for(const o of a){const{continent:s,label:r,timezoneId:_}=o;i[s]=i[s]||{continent:s,regions:[]},i[s].regions.push({label:r,cities:[],timezoneId:_})}for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&(i[o].regions.sort((s,r)=>s.labelo.continent[]},value:{type:String,default:"floating"},uid:{type:[String,Number],default:()=>"tz-".concat(st(5))}},emits:["input"],computed:{placeholder(){return x("Type to search time zone")},selectedTimezone(){for(const e of this.additionalTimezones)if(e.timezoneId===this.value)return e;return{label:Ir(this.value),timezoneId:this.value}},options(){const e=_g(),a=lg(e.listAllTimezones(),this.additionalTimezones);let i=[];return Object.values(a).forEach(n=>{i=i.concat(n.regions)}),i}},methods:{t:x,change(e){e&&this.$emit("input",e.timezoneId)},isSelectable(e){return!e.timezoneId.startsWith("tz-group__")},filterBy(e,a,i){const n=i.trim().split(" ");return e.timezoneId.startsWith("tz-group__")?e.regions.some(o=>this.matchTimezoneId(o.timezoneId,n)):this.matchTimezoneId(e.timezoneId,n)},matchTimezoneId(e,a){return a.every(i=>e.toLowerCase().includes(i.toLowerCase()))}}};var fg=function(){var e=this,a=e._self._c;return a("NcSelect",{attrs:{"aria-label-combobox":e.t("Search for time zone"),clearable:!1,"filter-by":e.filterBy,multiple:!1,options:e.options,placeholder:e.placeholder,selectable:e.isSelectable,uid:e.uid,value:e.selectedTimezone,label:"label"},on:{"option:selected":e.change}})},gg=[],hg=te(dg,fg,gg,!1,null,null);const Fg=hg.exports;function Hr(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function C0(e){return Hr(e)?new Date(e.getTime()):e==null?new Date(NaN):new Date(e)}function ug(e){return Hr(e)&&!isNaN(e.getTime())}function Pr(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var i=C0(e),n=i.getDay(),o=(n+7-a)%7;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Gr(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=a.firstDayOfWeek,n=i===void 0?0:i,o=a.firstWeekContainsDate,s=o===void 0?1:o;if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7");for(var r=C0(e),_=r.getFullYear(),l=new Date(0),g=_+1;g>=_-1&&(l.setFullYear(g,0,s),l.setHours(0,0,0,0),l=Pr(l,n),!(r.getTime()>=l.getTime()));g--);return l}function eo(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=a.firstDayOfWeek,n=i===void 0?0:i,o=a.firstWeekContainsDate,s=o===void 0?1:o,r=C0(e),_=Pr(r,n),l=Gr(r,{firstDayOfWeek:n,firstWeekContainsDate:s}),g=_.getTime()-l.getTime();return Math.round(g/(7*24*3600*1e3))+1}var Ur={months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],firstDayOfWeek:0,firstWeekContainsDate:1},cg=/\[([^\]]+)]|YYYY|YY?|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|Z{1,2}|S{1,3}|w{1,2}|x|X|a|A/g;function Ke(e){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,i="".concat(Math.abs(e)),n=e<0?"-":"";i.length1&&arguments[1]!==void 0?arguments[1]:"",i=e>0?"-":"+",n=Math.abs(e),o=Math.floor(n/60),s=n%60;return i+Ke(o,2)+a+Ke(s,2)}var es=function(e,a,i){var n=e<12?"AM":"PM";return i?n.toLocaleLowerCase():n},It={Y:function(e){var a=e.getFullYear();return a<=9999?"".concat(a):"+".concat(a)},YY:function(e){return Ke(e.getFullYear(),4).substr(2)},YYYY:function(e){return Ke(e.getFullYear(),4)},M:function(e){return e.getMonth()+1},MM:function(e){return Ke(e.getMonth()+1,2)},MMM:function(e,a){return a.monthsShort[e.getMonth()]},MMMM:function(e,a){return a.months[e.getMonth()]},D:function(e){return e.getDate()},DD:function(e){return Ke(e.getDate(),2)},H:function(e){return e.getHours()},HH:function(e){return Ke(e.getHours(),2)},h:function(e){var a=e.getHours();return a===0?12:a>12?a%12:a},hh:function(){var e=It.h.apply(It,arguments);return Ke(e,2)},m:function(e){return e.getMinutes()},mm:function(e){return Ke(e.getMinutes(),2)},s:function(e){return e.getSeconds()},ss:function(e){return Ke(e.getSeconds(),2)},S:function(e){return Math.floor(e.getMilliseconds()/100)},SS:function(e){return Ke(Math.floor(e.getMilliseconds()/10),2)},SSS:function(e){return Ke(e.getMilliseconds(),3)},d:function(e){return e.getDay()},dd:function(e,a){return a.weekdaysMin[e.getDay()]},ddd:function(e,a){return a.weekdaysShort[e.getDay()]},dddd:function(e,a){return a.weekdays[e.getDay()]},A:function(e,a){var i=a.meridiem||es;return i(e.getHours(),e.getMinutes(),!1)},a:function(e,a){var i=a.meridiem||es;return i(e.getHours(),e.getMinutes(),!0)},Z:function(e){return Xo(Jo(e),":")},ZZ:function(e){return Xo(Jo(e))},X:function(e){return Math.floor(e.getTime()/1e3)},x:function(e){return e.getTime()},w:function(e,a){return eo(e,{firstDayOfWeek:a.firstDayOfWeek,firstWeekContainsDate:a.firstWeekContainsDate})},ww:function(e,a){return Ke(It.w(e,a),2)}};function B0(e,a){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=a?String(a):"YYYY-MM-DDTHH:mm:ss.SSSZ",o=C0(e);if(!ug(o))return"Invalid Date";var s=i.locale||Ur;return n.replace(cg,function(r,_){return _||(typeof It[r]=="function"?"".concat(It[r](o,s)):r)})}function as(e){return bg(e)||pg(e)||mg()}function mg(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function pg(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function bg(e){if(Array.isArray(e)){for(var a=0,i=new Array(e.length);a68?i-1:i)*100+n,ja({},$0,n)}),Fe("YYYY",vg,$0),Fe("M",mt,function(e){return ja({},ui,parseInt(e,10)-1)}),Fe("MM",Ba,function(e){return ja({},ui,parseInt(e,10)-1)}),Fe("MMM",Ht("monthsShort"),Pt("monthsShort",ui)),Fe("MMMM",Ht("months"),Pt("months",ui)),Fe("D",mt,is),Fe("DD",Ba,is),Fe(["H","h"],mt,ns),Fe(["HH","hh"],Ba,ns),Fe("m",mt,os),Fe("mm",Ba,os),Fe("s",mt,ss),Fe("ss",Ba,ss),Fe("S",zr,function(e){return ja({},Q0,parseInt(e,10)*100)}),Fe("SS",Ba,function(e){return ja({},Q0,parseInt(e,10)*10)}),Fe("SSS",wg,Q0);function Bg(e){return e.meridiemParse||/[ap]\.?m?\.?/i}function Og(e){return"".concat(e).toLowerCase().charAt(0)==="p"}Fe(["A","a"],Bg,function(e,a){var i=typeof a.isPM=="function"?a.isPM(e):Og(e);return{isPM:i}});function Ng(e){var a=e.match(/([+-]|\d\d)/g)||["-","0","0"],i=Dg(a,3),n=i[0],o=i[1],s=i[2],r=parseInt(o,10)*60+parseInt(s,10);return r===0?0:n==="+"?-r:+r}Fe(["Z","ZZ"],Sg,function(e){return{offset:Ng(e)}}),Fe("x",Wr,function(e){return{date:new Date(parseInt(e,10))}}),Fe("X",Rg,function(e){return{date:new Date(parseFloat(e)*1e3)}}),Fe("d",zr,"weekday"),Fe("dd",Ht("weekdaysMin"),Pt("weekdaysMin","weekday")),Fe("ddd",Ht("weekdaysShort"),Pt("weekdaysShort","weekday")),Fe("dddd",Ht("weekdays"),Pt("weekdays","weekday")),Fe("w",mt,"week"),Fe("ww",Ba,"week");function xg(e,a){if(e!==void 0&&a!==void 0){if(a){if(e<12)return e+12}else if(e===12)return 0}return e}function Mg(e){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Date,i=[0,0,1,0,0,0,0],n=[a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()],o=!0,s=0;s<7;s++)e[s]===void 0?i[s]=o?n[s]:i[s]:(i[s]=e[s],o=!1);return i}function jg(e,a,i,n,o,s,r){var _;return e<100&&e>=0?(_=new Date(e+400,a,i,n,o,s,r),isFinite(_.getFullYear())&&_.setFullYear(e)):_=new Date(e,a,i,n,o,s,r),_}function Yg(){for(var e,a=arguments.length,i=new Array(a),n=0;n=0?(i[0]+=400,e=new Date(Date.UTC.apply(Date,i)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(o)):e=new Date(Date.UTC.apply(Date,i)),e}function qg(e,a,i){var n=a.match(Ag);if(!n)throw new Error;for(var o=n.length,s={},r=0;r2&&arguments[2]!==void 0?arguments[2]:{};try{var n=i.locale,o=n===void 0?Ur:n,s=i.backupDate,r=s===void 0?new Date:s,_=qg(e,a,o),l=_.year,g=_.month,d=_.day,f=_.hour,h=_.minute,u=_.second,m=_.millisecond,b=_.isPM,y=_.date,k=_.offset,w=_.weekday,S=_.week;if(y)return y;var j=[l,g,d,f,h,u,m];if(j[3]=xg(j[3],b),S!==void 0&&g===void 0&&d===void 0){var Z=Gr(l===void 0?r:new Date(l,3),{firstDayOfWeek:o.firstDayOfWeek,firstWeekContainsDate:o.firstWeekContainsDate});return new Date(Z.getTime()+(S-1)*7*24*3600*1e3)}var B,G=Mg(j,r);return k!==void 0?(G[6]+=k*60*1e3,B=Yg.apply(void 0,as(G))):B=jg.apply(void 0,as(G)),w!==void 0&&B.getDay()!==w?new Date(NaN):B}catch{return new Date(NaN)}}function wi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?wi=function(a){return typeof a}:wi=function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},wi(e)}function et(e,a,i){return a in e?Object.defineProperty(e,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[a]=i,e}function pn(){return pn=Object.assign||function(e){for(var a=1;a=0)&&(i[o]=e[o]);return i}function Ig(e,a){if(e==null)return{};var i=Zg(e,a),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Gt(e,a){return Hg(e)||Pg(e,a)||Gg(e,a)||Ug()}function Hg(e){if(Array.isArray(e))return e}function Pg(e,a){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var i=[],n=!0,o=!1,s=void 0;try{for(var r=e[Symbol.iterator](),_;!(n=(_=r.next()).done)&&(i.push(_.value),!(a&&i.length===a));n=!0);}catch(l){o=!0,s=l}finally{try{!n&&r.return!=null&&r.return()}finally{if(o)throw s}}return i}}function Gg(e,a){if(e){if(typeof e=="string")return ls(e,a);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ls(e,a)}}function ls(e,a){(a==null||a>e.length)&&(a=e.length);for(var i=0,n=new Array(a);i1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,r=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0,_=new Date(e,a,i,n,o,s,r);return e<100&&e>=0&&_.setFullYear(e),_}function Aa(e){return e instanceof Date&&!isNaN(e)}function O0(e){return Array.isArray(e)&&e.length===2&&e.every(Aa)&&e[0]<=e[1]}function Kg(e){return Array.isArray(e)&&e.every(Aa)}function At(e){var a=new Date(e);if(Aa(a))return a;for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o1&&arguments[1]!==void 0?arguments[1]:document.body;if(!e||e===a)return null;var i=function(s,r){return getComputedStyle(s,null).getPropertyValue(r)},n=/(auto|scroll)/,o=n.test(i(e,"overflow")+i(e,"overflow-y")+i(e,"overflow-x"));return o?e:N0(e.parentNode,a)}var _h={name:"Popup",inject:{prefixClass:{default:"mx"}},props:{visible:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!0}},data:function(){return{top:"",left:""}},watch:{visible:{immediate:!0,handler:function(e){var a=this;this.$nextTick(function(){e&&a.displayPopup()})}}},mounted:function(){var e=this;this.appendToBody&&document.body.appendChild(this.$el),this._clickoutEvent="ontouchend"in document?"touchstart":"mousedown",document.addEventListener(this._clickoutEvent,this.handleClickOutside);var a=this.$parent.$el;this._displayPopup=sh(function(){return e.displayPopup()}),this._scrollParent=N0(a)||window,this._scrollParent.addEventListener("scroll",this._displayPopup),window.addEventListener("resize",this._displayPopup)},beforeDestroy:function(){this.appendToBody&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el),document.removeEventListener(this._clickoutEvent,this.handleClickOutside),this._scrollParent.removeEventListener("scroll",this._displayPopup),window.removeEventListener("resize",this._displayPopup)},methods:{handleClickOutside:function(e){if(this.visible){var a=e.target,i=this.$el;i&&!i.contains(a)&&this.$emit("clickoutside",e)}},displayPopup:function(){if(this.visible){var e=this.$el,a=this.$parent.$el,i=this.appendToBody;this._popupRect||(this._popupRect=rh(e));var n=this._popupRect,o=n.width,s=n.height,r=lh(a,o,s,i),_=r.left,l=r.top;this.left=_,this.top=l}}}};function ia(e,a,i,n,o,s,r,_,l,g){var d=typeof i=="function"?i.options:i;return e&&e.render&&(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0),i}var dh=_h,fh=function(){var e=this,a=e.$createElement,i=e._self._c||a;return i("transition",{attrs:{name:e.prefixClass+"-zoom-in-down"}},[e.visible?i("div",{class:e.prefixClass+"-datepicker-main "+e.prefixClass+"-datepicker-popup",style:{top:e.top,left:e.left,position:"absolute"}},[e._t("default")],2):e._e()])},gh=[],hh=void 0,Fh=ia({render:fh,staticRenderFns:gh},hh,dh),uh=function(){var e=this,a=e.$createElement,i=e._self._c||a;return i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",width:"1em",height:"1em"}},[i("path",{attrs:{d:"M940.218182 107.054545h-209.454546V46.545455h-65.163636v60.50909H363.054545V46.545455H297.890909v60.50909H83.781818c-18.618182 0-32.581818 13.963636-32.581818 32.581819v805.236363c0 18.618182 13.963636 32.581818 32.581818 32.581818h861.090909c18.618182 0 32.581818-13.963636 32.581818-32.581818V139.636364c-4.654545-18.618182-18.618182-32.581818-37.236363-32.581819zM297.890909 172.218182V232.727273h65.163636V172.218182h307.2V232.727273h65.163637V172.218182h176.872727v204.8H116.363636V172.218182h181.527273zM116.363636 912.290909V442.181818h795.927273v470.109091H116.363636z"}})])},ch=[],mh=void 0,ph=ia({render:uh,staticRenderFns:ch},mh,{}),bh=function(){var e=this,a=e.$createElement,i=e._self._c||a;return i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em"}},[i("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),e._v(" "),i("path",{attrs:{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}}),e._v(" "),i("path",{attrs:{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"}})])},Th=[],Dh=void 0,yh=ia({render:bh,staticRenderFns:Th},Dh,{}),Eh=function(){var e=this,a=e.$createElement,i=e._self._c||a;return i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",width:"1em",height:"1em"}},[i("path",{attrs:{d:"M810.005333 274.005333l-237.994667 237.994667 237.994667 237.994667-60.010667 60.010667-237.994667-237.994667-237.994667 237.994667-60.010667-60.010667 237.994667-237.994667-237.994667-237.994667 60.010667-60.010667 237.994667 237.994667 237.994667-237.994667z"}})])},kh=[],Ah=void 0,wh=ia({render:Eh,staticRenderFns:kh},Ah,{}),vh={props:{type:String,disabled:Boolean},inject:{prefixClass:{default:"mx"}}},Sh=vh,Rh=function(){var e=this,a=e.$createElement,i=e._self._c||a;return i("button",e._g({class:[e.prefixClass+"-btn "+e.prefixClass+"-btn-text "+e.prefixClass+"-btn-icon-"+e.type,{disabled:e.disabled}],attrs:{type:"button",disabled:e.disabled}},e.$listeners),[i("i",{class:e.prefixClass+"-icon-"+e.type})])},Ch=[],Bh=void 0,to=ia({render:Rh,staticRenderFns:Ch},Bh,Sh),Oh={name:"TableDate",components:{IconButton:to},inject:{getLocale:{default:function(){return St}},getWeek:{default:function(){return eo}},prefixClass:{default:"mx"},onDateMouseEnter:{default:void 0},onDateMouseLeave:{default:void 0}},props:{disabledCalendarChanger:{type:Function,default:function(){return!1}},calendar:{type:Date,default:function(){return new Date}},showWeekNumber:{type:Boolean,default:!1},titleFormat:{type:String,default:"YYYY-MM-DD"},getRowClasses:{type:Function,default:function(){return[]}},getCellClasses:{type:Function,default:function(){return[]}}},computed:{firstDayOfWeek:function(){return this.getLocale().formatLocale.firstDayOfWeek||0},yearMonth:function(){var e=this.getLocale(),a=e.yearFormat,i=e.monthBeforeYear,n=e.monthFormat,o=n===void 0?"MMM":n,s={panel:"year",label:this.formatDate(this.calendar,a)},r={panel:"month",label:this.formatDate(this.calendar,o)};return i?[r,s]:[s,r]},days:function(){var e=this.getLocale(),a=e.days||e.formatLocale.weekdaysMin;return a.concat(a).slice(this.firstDayOfWeek,this.firstDayOfWeek+7)},dates:function(){var e=this.calendar.getFullYear(),a=this.calendar.getMonth(),i=eh({firstDayOfWeek:this.firstDayOfWeek,year:e,month:a});return ao(i,7)}},methods:{isDisabledArrows:function(e){var a=new Date(this.calendar);switch(e){case"last-year":a.setFullYear(a.getFullYear()-1,a.getMonth()+1,0),a.setHours(23,59,59,999);break;case"next-year":a.setFullYear(a.getFullYear()+1);break;case"last-month":a.setMonth(a.getMonth(),0),a.setHours(23,59,59,999);break;case"next-month":a.setMonth(a.getMonth()+1);break}return this.disabledCalendarChanger(a,e)},handleIconLeftClick:function(){this.$emit("changecalendar",Dn(this.calendar,function(e){return e-1}),"last-month")},handleIconRightClick:function(){this.$emit("changecalendar",Dn(this.calendar,function(e){return e+1}),"next-month")},handleIconDoubleLeftClick:function(){this.$emit("changecalendar",wt(this.calendar,function(e){return e-1}),"last-year")},handleIconDoubleRightClick:function(){this.$emit("changecalendar",wt(this.calendar,function(e){return e+1}),"next-year")},handlePanelChange:function(e){this.$emit("changepanel",e)},handleMouseEnter:function(e){typeof this.onDateMouseEnter=="function"&&this.onDateMouseEnter(e)},handleMouseLeave:function(e){typeof this.onDateMouseLeave=="function"&&this.onDateMouseLeave(e)},handleCellClick:function(e){var a=e.target;a.tagName.toUpperCase()==="DIV"&&(a=a.parentNode);var i=a.getAttribute("data-row-col");if(i){var n=i.split(",").map(function(l){return parseInt(l,10)}),o=Gt(n,2),s=o[0],r=o[1],_=this.dates[s][r];this.$emit("select",new Date(_))}},formatDate:function(e,a){return B0(e,a,{locale:this.getLocale().formatLocale})},getCellTitle:function(e){var a=this.titleFormat;return this.formatDate(e,a)},getWeekNumber:function(e){return this.getWeek(e,this.getLocale().formatLocale)}}},Nh=Oh,xh=function(){var e=this,a=e.$createElement,i=e._self._c||a;return i("div",{class:e.prefixClass+"-calendar "+e.prefixClass+"-calendar-panel-date"},[i("div",{class:e.prefixClass+"-calendar-header"},[i("icon-button",{attrs:{type:"double-left",disabled:e.isDisabledArrows("last-year")},on:{click:e.handleIconDoubleLeftClick}}),e._v(" "),i("icon-button",{attrs:{type:"left",disabled:e.isDisabledArrows("last-month")},on:{click:e.handleIconLeftClick}}),e._v(" "),i("icon-button",{attrs:{type:"double-right",disabled:e.isDisabledArrows("next-year")},on:{click:e.handleIconDoubleRightClick}}),e._v(" "),i("icon-button",{attrs:{type:"right",disabled:e.isDisabledArrows("next-month")},on:{click:e.handleIconRightClick}}),e._v(" "),i("span",{class:e.prefixClass+"-calendar-header-label"},e._l(e.yearMonth,function(n){return i("button",{key:n.panel,class:e.prefixClass+"-btn "+e.prefixClass+"-btn-text "+e.prefixClass+"-btn-current-"+n.panel,attrs:{type:"button"},on:{click:function(o){return e.handlePanelChange(n.panel)}}},[e._v(` + `+e._s(n.label)+` + `)])}),0)],1),e._v(" "),i("div",{class:e.prefixClass+"-calendar-content"},[i("table",{class:e.prefixClass+"-table "+e.prefixClass+"-table-date"},[i("thead",[i("tr",[e.showWeekNumber?i("th",{class:e.prefixClass+"-week-number-header"}):e._e(),e._v(" "),e._l(e.days,function(n){return i("th",{key:n},[e._v(e._s(n))])})],2)]),e._v(" "),i("tbody",{on:{click:e.handleCellClick}},e._l(e.dates,function(n,o){return i("tr",{key:o,class:[e.prefixClass+"-date-row",e.getRowClasses(n)]},[e.showWeekNumber?i("td",{class:e.prefixClass+"-week-number",attrs:{"data-row-col":o+",0"}},[e._v(` + `+e._s(e.getWeekNumber(n[0]))+` + `)]):e._e(),e._v(" "),e._l(n,function(s,r){return i("td",{key:r,staticClass:"cell",class:e.getCellClasses(s),attrs:{"data-row-col":o+","+r,title:e.getCellTitle(s)},on:{mouseenter:function(_){return e.handleMouseEnter(s)},mouseleave:function(_){return e.handleMouseLeave(s)}}},[i("div",[e._v(e._s(s.getDate()))])])})],2)}),0)])])])},Mh=[],jh=void 0,Yh=ia({render:xh,staticRenderFns:Mh},jh,Nh),qh={name:"TableMonth",components:{IconButton:to},inject:{getLocale:{default:function(){return St}},prefixClass:{default:"mx"}},props:{disabledCalendarChanger:{type:Function,default:function(){return!1}},calendar:{type:Date,default:function(){return new Date}},getCellClasses:{type:Function,default:function(){return[]}}},computed:{calendarYear:function(){return this.calendar.getFullYear()},months:function(){var e=this.getLocale(),a=e.months||e.formatLocale.monthsShort,i=a.map(function(n,o){return{text:n,month:o}});return ao(i,3)}},methods:{isDisabledArrows:function(e){var a=new Date(this.calendar);switch(e){case"last-year":a.setFullYear(a.getFullYear()-1,11,31),a.setHours(23,59,59,999);break;case"next-year":a.setFullYear(a.getFullYear()+1,0,1);break}return this.disabledCalendarChanger(a,e)},handleIconDoubleLeftClick:function(){this.$emit("changecalendar",wt(this.calendar,function(e){return e-1}),"last-year")},handleIconDoubleRightClick:function(){this.$emit("changecalendar",wt(this.calendar,function(e){return e+1}),"next-year")},handlePanelChange:function(){this.$emit("changepanel","year")},handleClick:function(e){var a=e.target;a.tagName.toUpperCase()==="DIV"&&(a=a.parentNode);var i=a.getAttribute("data-month");i&&!a.classList.contains("disabled")&&this.$emit("select",parseInt(i,10))}}},Lh=qh,Zh=function(){var e=this,a=e.$createElement,i=e._self._c||a;return i("div",{class:e.prefixClass+"-calendar "+e.prefixClass+"-calendar-panel-month"},[i("div",{class:e.prefixClass+"-calendar-header"},[i("icon-button",{attrs:{type:"double-left",disabled:e.isDisabledArrows("last-year")},on:{click:e.handleIconDoubleLeftClick}}),e._v(" "),i("icon-button",{attrs:{type:"double-right",disabled:e.isDisabledArrows("next-year")},on:{click:e.handleIconDoubleRightClick}}),e._v(" "),i("span",{class:e.prefixClass+"-calendar-header-label"},[i("button",{class:e.prefixClass+"-btn "+e.prefixClass+"-btn-text",attrs:{type:"button"},on:{click:e.handlePanelChange}},[e._v(` + `+e._s(e.calendarYear)+` + `)])])],1),e._v(" "),i("div",{class:e.prefixClass+"-calendar-content"},[i("table",{class:e.prefixClass+"-table "+e.prefixClass+"-table-month",on:{click:e.handleClick}},e._l(e.months,function(n,o){return i("tr",{key:o},e._l(n,function(s,r){return i("td",{key:r,staticClass:"cell",class:e.getCellClasses(s.month),attrs:{"data-month":s.month}},[i("div",[e._v(e._s(s.text))])])}),0)}),0)])])},Ih=[],Hh=void 0,Ph=ia({render:Zh,staticRenderFns:Ih},Hh,Lh),Gh={name:"TableYear",components:{IconButton:to},inject:{prefixClass:{default:"mx"}},props:{disabledCalendarChanger:{type:Function,default:function(){return!1}},calendar:{type:Date,default:function(){return new Date}},getCellClasses:{type:Function,default:function(){return[]}},getYearPanel:{type:Function}},computed:{years:function(){var e=new Date(this.calendar);return typeof this.getYearPanel=="function"?this.getYearPanel(e):this.getYears(e)},firstYear:function(){return this.years[0][0]},lastYear:function(){var e=function(a){return a[a.length-1]};return e(e(this.years))}},methods:{isDisabledArrows:function(e){var a=new Date(this.calendar);switch(e){case"last-decade":a.setFullYear(this.firstYear-1,11,31),a.setHours(23,59,59,999);break;case"next-decade":a.setFullYear(this.lastYear+1,0,1);break}return this.disabledCalendarChanger(a,e)},getYears:function(e){for(var a=Math.floor(e.getFullYear()/10)*10,i=[],n=0;n<10;n++)i.push(a+n);return ao(i,2)},handleIconDoubleLeftClick:function(){this.$emit("changecalendar",wt(this.calendar,function(e){return e-10}),"last-decade")},handleIconDoubleRightClick:function(){this.$emit("changecalendar",wt(this.calendar,function(e){return e+10}),"next-decade")},handleClick:function(e){var a=e.target;a.tagName.toUpperCase()==="DIV"&&(a=a.parentNode);var i=a.getAttribute("data-year");i&&!a.classList.contains("disabled")&&this.$emit("select",parseInt(i,10))}}},Uh=Gh,zh=function(){var e=this,a=e.$createElement,i=e._self._c||a;return i("div",{class:e.prefixClass+"-calendar "+e.prefixClass+"-calendar-panel-year"},[i("div",{class:e.prefixClass+"-calendar-header"},[i("icon-button",{attrs:{type:"double-left",disabled:e.isDisabledArrows("last-decade")},on:{click:e.handleIconDoubleLeftClick}}),e._v(" "),i("icon-button",{attrs:{type:"double-right",disabled:e.isDisabledArrows("next-decade")},on:{click:e.handleIconDoubleRightClick}}),e._v(" "),i("span",{class:e.prefixClass+"-calendar-header-label"},[i("span",[e._v(e._s(e.firstYear))]),e._v(" "),i("span",{class:e.prefixClass+"-calendar-decade-separator"}),e._v(" "),i("span",[e._v(e._s(e.lastYear))])])],1),e._v(" "),i("div",{class:e.prefixClass+"-calendar-content"},[i("table",{class:e.prefixClass+"-table "+e.prefixClass+"-table-year",on:{click:e.handleClick}},e._l(e.years,function(n,o){return i("tr",{key:o},e._l(n,function(s,r){return i("td",{key:r,staticClass:"cell",class:e.getCellClasses(s),attrs:{"data-year":s}},[i("div",[e._v(e._s(s))])])}),0)}),0)])])},Wh=[],Vh=void 0,$h=ia({render:zh,staticRenderFns:Wh},Vh,Uh),ot={name:"CalendarPanel",inject:{prefixClass:{default:"mx"},dispatchDatePicker:{default:function(){return function(){}}}},props:{value:{},defaultValue:{default:function(){var e=new Date;return e.setHours(0,0,0,0),e}},defaultPanel:{type:String},disabledCalendarChanger:{type:Function,default:function(){return!1}},disabledDate:{type:Function,default:function(){return!1}},type:{type:String,default:"date"},getClasses:{type:Function,default:function(){return[]}},showWeekNumber:{type:Boolean,default:void 0},getYearPanel:{type:Function},titleFormat:{type:String,default:"YYYY-MM-DD"},calendar:Date,partialUpdate:{type:Boolean,default:!1}},data:function(){var e=["date","month","year"],a=Math.max(e.indexOf(this.type),e.indexOf(this.defaultPanel)),i=a!==-1?e[a]:"date";return{panel:i,innerCalendar:new Date}},computed:{innerValue:function(){var e=Array.isArray(this.value)?this.value:[this.value],a={year:Jg,month:Tn,date:Xg},i=a[this.type]||a.date;return e.filter(Aa).map(function(n){return i(n)})},calendarYear:function(){return this.innerCalendar.getFullYear()},calendarMonth:function(){return this.innerCalendar.getMonth()}},watch:{value:{immediate:!0,handler:"initCalendar"},calendar:{handler:"initCalendar"},defaultValue:{handler:"initCalendar"}},methods:{initCalendar:function(){var e=this.calendar;if(!Aa(e)){var a=this.innerValue.length;e=At(a>0?this.innerValue[a-1]:this.defaultValue)}this.innerCalendar=Tn(e)},isDisabled:function(e){return this.disabledDate(new Date(e),this.innerValue)},emitDate:function(e,a){this.isDisabled(e)||(this.$emit("select",e,a,this.innerValue),this.dispatchDatePicker("pick",e,a))},handleCalendarChange:function(e,a){var i=new Date(this.innerCalendar);this.innerCalendar=e,this.$emit("update:calendar",e),this.dispatchDatePicker("calendar-change",e,i,a)},handelPanelChange:function(e){var a=this.panel;this.panel=e,this.dispatchDatePicker("panel-change",e,a)},handleSelectYear:function(e){if(this.type==="year"){var a=this.getYearCellDate(e);this.emitDate(a,"year")}else if(this.handleCalendarChange(Ea(e,this.calendarMonth),"year"),this.handelPanelChange("month"),this.partialUpdate&&this.innerValue.length===1){var i=new Date(this.innerValue[0]);i.setFullYear(e),this.emitDate(i,"year")}},handleSelectMonth:function(e){if(this.type==="month"){var a=this.getMonthCellDate(e);this.emitDate(a,"month")}else if(this.handleCalendarChange(Ea(this.calendarYear,e),"month"),this.handelPanelChange("date"),this.partialUpdate&&this.innerValue.length===1){var i=new Date(this.innerValue[0]);i.setFullYear(this.calendarYear),this.emitDate(Dn(i,e),"month")}},handleSelectDate:function(e){this.emitDate(e,this.type==="week"?"week":"date")},getMonthCellDate:function(e){return Ea(this.calendarYear,e)},getYearCellDate:function(e){return Ea(e,0)},getDateClasses:function(e){var a=e.getMonth()!==this.calendarMonth,i=[];e.getTime()===new Date().setHours(0,0,0,0)&&i.push("today"),a&&i.push("not-current-month");var n=this.getStateClass(e);return n==="active"&&a||i.push(n),i.concat(this.getClasses(e,this.innerValue,i.join(" ")))},getMonthClasses:function(e){var a=[];if(this.type!=="month"){this.calendarMonth===e&&a.push("active");var i=this.getMonthCellDate(e);return this.disabledCalendarChanger(i,"month")&&a.push("disabled"),a}var n=this.getMonthCellDate(e);return a.push(this.getStateClass(n)),a.concat(this.getClasses(n,this.innerValue,a.join(" ")))},getYearClasses:function(e){var a=[];if(this.type!=="year"){this.calendarYear===e&&a.push("active");var i=this.getYearCellDate(e);return this.disabledCalendarChanger(i,"year")&&a.push("disabled"),a}var n=this.getYearCellDate(e);return a.push(this.getStateClass(n)),a.concat(this.getClasses(n,this.innerValue,a.join(" ")))},getStateClass:function(e){return this.isDisabled(e)?"disabled":this.innerValue.some(function(a){return a.getTime()===e.getTime()})?"active":""},getWeekState:function(e){if(this.type!=="week")return"";var a=e[0].getTime(),i=e[6].getTime(),n=this.innerValue.some(function(o){var s=o.getTime();return s>=a&&s<=i});return n?"".concat(this.prefixClass,"-active-week"):""}},render:function(){var e=arguments[0],a=this.panel,i=this.innerCalendar;return a==="year"?e($h,{attrs:{disabledCalendarChanger:this.disabledCalendarChanger,calendar:i,getCellClasses:this.getYearClasses,getYearPanel:this.getYearPanel},on:{select:this.handleSelectYear,changecalendar:this.handleCalendarChange}}):a==="month"?e(Ph,{attrs:{disabledCalendarChanger:this.disabledCalendarChanger,calendar:i,getCellClasses:this.getMonthClasses},on:{select:this.handleSelectMonth,changepanel:this.handelPanelChange,changecalendar:this.handleCalendarChange}}):e(Yh,{attrs:{disabledCalendarChanger:this.disabledCalendarChanger,calendar:i,getCellClasses:this.getDateClasses,getRowClasses:this.getWeekState,titleFormat:this.titleFormat,showWeekNumber:typeof this.showWeekNumber=="boolean"?this.showWeekNumber:this.type==="week"},class:et({},"".concat(this.prefixClass,"-calendar-week-mode"),this.type==="week"),on:{select:this.handleSelectDate,changepanel:this.handelPanelChange,changecalendar:this.handleCalendarChange}})}},Ut={name:"CalendarRange",components:{CalendarPanel:ot},provide:function(){return{onDateMouseEnter:this.onDateMouseEnter,onDateMouseLeave:this.onDateMouseLeave}},inject:{prefixClass:{default:"mx"}},props:pe({},ot.props),data:function(){return{innerValue:[],calendars:[],hoveredValue:null}},computed:{calendarMinDiff:function(){var e={date:1,month:12,year:120};return e[this.type]||e.date},calendarMaxDiff:function(){return 1/0},defaultValues:function(){return Array.isArray(this.defaultValue)?this.defaultValue:[this.defaultValue,this.defaultValue]}},watch:{value:{immediate:!0,handler:function(){var e=this;this.innerValue=O0(this.value)?this.value:[new Date(NaN),new Date(NaN)];var a=this.innerValue.map(function(i,n){return Tn(At(i,e.defaultValues[n]))});this.updateCalendars(a)}}},methods:{handleSelect:function(e,a){var i=Gt(this.innerValue,2),n=i[0],o=i[1];Aa(n)&&!Aa(o)?(n.getTime()>e.getTime()?this.innerValue=[e,n]:this.innerValue=[n,e],this.emitDate(this.innerValue,a)):this.innerValue=[e,new Date(NaN)]},onDateMouseEnter:function(e){this.hoveredValue=e},onDateMouseLeave:function(){this.hoveredValue=null},emitDate:function(e,a){this.$emit("select",e,a)},updateStartCalendar:function(e){this.updateCalendars([e,this.calendars[1]],1)},updateEndCalendar:function(e){this.updateCalendars([this.calendars[0],e],0)},updateCalendars:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,i=this.getCalendarGap(e);if(i){var n=new Date(e[a]);n.setMonth(n.getMonth()+(a===0?-i:i)),e[a]=n}this.calendars=e},getCalendarGap:function(e){var a=Gt(e,2),i=a[0],n=a[1],o=n.getFullYear()-i.getFullYear(),s=n.getMonth()-i.getMonth(),r=o*12+s,_=this.calendarMinDiff,l=this.calendarMaxDiff;return r<_?_-r:r>l?l-r:0},getRangeClasses:function(e,a,i){var n=[].concat(this.getClasses(e,a,i));if(/disabled|active/.test(i))return n;var o=function(s,r){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(m){return m.getTime()},l=_(s),g=r.map(_),d=Gt(g,2),f=d[0],h=d[1];if(f>h){var u=[h,f];f=u[0],h=u[1]}return l>f&&l"u")return 0;if(ci!==void 0)return ci;var e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var a=document.createElement("div");return a.style.width="100%",e.appendChild(a),ci=e.offsetWidth-a.offsetWidth,e.parentNode.removeChild(e),ci}var Kh={inject:{prefixClass:{default:"mx"}},data:function(){return{scrollbarWidth:0,thumbTop:"",thumbHeight:""}},created:function(){this.scrollbarWidth=Qh(),document.addEventListener("mouseup",this.handleDragend)},beforeDestroy:function(){document.addEventListener("mouseup",this.handleDragend)},mounted:function(){this.$nextTick(this.getThumbSize)},methods:{getThumbSize:function(){var e=this.$refs.wrap;if(e){var a=e.clientHeight*100/e.scrollHeight;this.thumbHeight=a<100?"".concat(a,"%"):""}},handleScroll:function(e){var a=e.currentTarget,i=a.scrollHeight,n=a.scrollTop;this.thumbTop="".concat(n*100/i,"%")},handleDragstart:function(e){e.stopImmediatePropagation(),this._draggable=!0;var a=this.$refs.thumb.offsetTop;this._prevY=e.clientY-a,document.addEventListener("mousemove",this.handleDraging)},handleDraging:function(e){if(this._draggable){var a=e.clientY,i=this.$refs.wrap,n=i.scrollHeight,o=i.clientHeight,s=a-this._prevY,r=s*n/o;i.scrollTop=r}},handleDragend:function(){this._draggable&&(this._draggable=!1,document.removeEventListener("mousemove",this.handleDraging))}}},Jh=Kh,Xh=function(){var e=this,a=e.$createElement,i=e._self._c||a;return i("div",{class:e.prefixClass+"-scrollbar",style:{position:"relative",overflow:"hidden"}},[i("div",{ref:"wrap",class:e.prefixClass+"-scrollbar-wrap",style:{marginRight:"-"+e.scrollbarWidth+"px"},on:{scroll:e.handleScroll}},[e._t("default")],2),e._v(" "),i("div",{class:e.prefixClass+"-scrollbar-track"},[i("div",{ref:"thumb",class:e.prefixClass+"-scrollbar-thumb",style:{height:e.thumbHeight,top:e.thumbTop},on:{mousedown:e.handleDragstart}})])])},eF=[],aF=void 0,Kr=ia({render:Xh,staticRenderFns:eF},aF,Jh),K0=function(e){return e=parseInt(e,10),e<10?"0".concat(e):"".concat(e)},J0=function(e,a,i){if(Array.isArray(i))return i.filter(function(s){return s>=0&&s2&&arguments[2]!==void 0?arguments[2]:0;if(n<=0){requestAnimationFrame(function(){a.scrollTop=i});return}var o=i-a.scrollTop,s=o/n*10;requestAnimationFrame(function(){var r=a.scrollTop+s;if(r>=i){a.scrollTop=i;return}a.scrollTop=r,e(a,i,n-10)})},iF={name:"ListColumns",components:{ScrollbarVertical:Kr},inject:{prefixClass:{default:"mx"}},props:{date:Date,scrollDuration:{type:Number,default:100},getClasses:{type:Function,default:function(){return[]}},hourOptions:Array,minuteOptions:Array,secondOptions:Array,showHour:{type:Boolean,default:!0},showMinute:{type:Boolean,default:!0},showSecond:{type:Boolean,default:!0},hourStep:{type:Number,default:1},minuteStep:{type:Number,default:1},secondStep:{type:Number,default:1},use12h:{type:Boolean,default:!1}},computed:{columns:function(){var e=[];return this.showHour&&e.push({type:"hour",list:this.getHoursList()}),this.showMinute&&e.push({type:"minute",list:this.getMinutesList()}),this.showSecond&&e.push({type:"second",list:this.getSecondsList()}),this.use12h&&e.push({type:"ampm",list:this.getAMPMList()}),e.filter(function(a){return a.list.length>0})}},watch:{date:{handler:function(){var e=this;this.$nextTick(function(){e.scrollToSelected(e.scrollDuration)})}}},mounted:function(){this.scrollToSelected(0)},methods:{getHoursList:function(){var e=this;return J0(this.use12h?12:24,this.hourStep,this.hourOptions).map(function(a){var i=new Date(e.date),n=K0(a);e.use12h&&(a===0&&(n="12"),i.getHours()>=12&&(a+=12));var o=i.setHours(a);return{value:o,text:n}})},getMinutesList:function(){var e=this;return J0(60,this.minuteStep,this.minuteOptions).map(function(a){var i=new Date(e.date).setMinutes(a);return{value:i,text:K0(a)}})},getSecondsList:function(){var e=this;return J0(60,this.secondStep,this.secondOptions).map(function(a){var i=new Date(e.date).setSeconds(a);return{value:i,text:K0(a)}})},getAMPMList:function(){var e=this;return["AM","PM"].map(function(a,i){var n=new Date(e.date),o=n.setHours(n.getHours()%12+i*12);return{text:a,value:o}})},scrollToSelected:function(e){for(var a=this.$el.querySelectorAll(".active"),i=0;i0&&arguments[0]!==void 0?arguments[0]:"",a=e.split(":");if(a.length>=2){var i=parseInt(a[0],10),n=parseInt(a[1],10);return{hours:i,minutes:n}}return null}var _F=function(e,a){e&&(e.scrollTop=a)},dF={name:"ListOptions",components:{ScrollbarVertical:Kr},inject:{getLocale:{default:function(){return St}},prefixClass:{default:"mx"}},props:{date:Date,options:{type:[Object,Function],default:function(){return[]}},format:{type:String,default:"HH:mm:ss"},getClasses:{type:Function,default:function(){return[]}}},computed:{list:function(){var e=[],a=this.options;if(typeof a=="function")return a()||[];var i=X0(a.start),n=X0(a.end),o=X0(a.step),s=a.format||this.format;if(i&&n&&o)for(var r=i.minutes+i.hours*60,_=n.minutes+n.hours*60,l=o.minutes+o.hours*60,g=Math.floor((_-r)/l),d=0;d<=g;d++){var f=r+d*l,h=Math.floor(f/60),u=f%60,m=new Date(this.date).setHours(h,u,0);e.push({value:m,text:this.formatDate(m,s)})}return e}},mounted:function(){this.scrollToSelected()},methods:{formatDate:function(e,a){return B0(e,a,{locale:this.getLocale().formatLocale})},scrollToSelected:function(){var e=this.$el.querySelector(".active");if(e){var a=N0(e,this.$el);if(a){var i=e.offsetTop;_F(a,i)}}},handleSelect:function(e){this.$emit("select",e,"time")}}},fF=dF,gF=function(){var e=this,a=e.$createElement,i=e._self._c||a;return i("scrollbar-vertical",e._l(e.list,function(n){return i("div",{key:n.value,class:[e.prefixClass+"-time-option",e.getClasses(n.value)],on:{click:function(o){return e.handleSelect(n.value)}}},[e._v(` + `+e._s(n.text)+` + `)])}),0)},hF=[],FF=void 0,uF=ia({render:gF,staticRenderFns:hF},FF,fF),cF={name:"TimePanel",components:{ListColumns:lF,ListOptions:uF},inject:{getLocale:{default:function(){return St}},prefixClass:{default:"mx"}},props:{value:{},defaultValue:{default:function(){var e=new Date;return e.setHours(0,0,0,0),e}},format:{default:"HH:mm:ss"},timeTitleFormat:{type:String,default:"YYYY-MM-DD"},showTimeHeader:{type:Boolean,default:!1},disabledTime:{type:Function,default:function(){return!1}},timePickerOptions:{type:[Object,Function],default:function(){return null}},hourOptions:Array,minuteOptions:Array,secondOptions:Array,hourStep:{type:Number,default:1},minuteStep:{type:Number,default:1},secondStep:{type:Number,default:1},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12h:{type:Boolean,default:void 0},scrollDuration:{type:Number,default:100}},data:function(){return{innerValue:At(this.value,this.defaultValue)}},computed:{title:function(){var e=this.timeTitleFormat,a=new Date(this.innerValue);return this.formatDate(a,e)},innerForamt:function(){return typeof this.format=="string"?this.format:"HH:mm:ss"},ShowHourMinuteSecondAMPM:function(){var e=this,a=this.innerForamt,i={showHour:/[HhKk]/.test(a),showMinute:/m/.test(a),showSecond:/s/.test(a),use12h:/a/i.test(a)},n={};return Object.keys(i).forEach(function(o){n[o]=typeof e[o]=="boolean"?e[o]:i[o]}),n}},watch:{value:{immediate:!0,handler:function(){this.innerValue=At(this.value,this.defaultValue)}}},methods:{formatDate:function(e,a){return B0(e,a,{locale:this.getLocale().formatLocale})},isDisabledTime:function(e){return this.disabledTime(new Date(e))},isDisabledHour:function(e){var a=new Date(e);return this.isDisabledTime(a)&&this.isDisabledTime(a.setMinutes(0,0,0))&&this.isDisabledTime(a.setMinutes(59,59,999))},isDisabledMinute:function(e){var a=new Date(e);return this.isDisabledTime(a)&&this.isDisabledTime(a.setSeconds(0,0))&&this.isDisabledTime(a.setSeconds(59,999))},isDisabledAMPM:function(e){var a=new Date(e),i=a.getHours()<12?0:12,n=i+11;return this.isDisabledTime(a)&&this.isDisabledTime(a.setHours(i,0,0,0))&&this.isDisabledTime(a.setHours(n,59,59,999))},isDisabled:function(e,a){return a==="hour"?this.isDisabledHour(e):a==="minute"?this.isDisabledMinute(e):a==="ampm"?this.isDisabledAMPM(e):this.isDisabledTime(e)},handleSelect:function(e,a){var i=new Date(e);this.isDisabled(e,a)||(this.innerValue=i,this.isDisabledTime(i)||this.$emit("select",i,a))},handleClickTitle:function(){this.$emit("clicktitle")},getClasses:function(e,a){var i=new Date(e);return this.isDisabled(e,a)?"disabled":i.getTime()===this.innerValue.getTime()?"active":""}}},mF=cF,pF=function(){var e=this,a=e.$createElement,i=e._self._c||a;return i("div",{class:e.prefixClass+"-time"},[e.showTimeHeader?i("div",{class:e.prefixClass+"-time-header"},[i("button",{class:e.prefixClass+"-btn "+e.prefixClass+"-btn-text "+e.prefixClass+"-time-header-title",attrs:{type:"button"},on:{click:e.handleClickTitle}},[e._v(` + `+e._s(e.title)+` + `)])]):e._e(),e._v(" "),i("div",{class:e.prefixClass+"-time-content"},[e.timePickerOptions?i("list-options",{attrs:{date:e.innerValue,"get-classes":e.getClasses,options:e.timePickerOptions,format:e.innerForamt},on:{select:e.handleSelect}}):i("list-columns",e._b({attrs:{date:e.innerValue,"get-classes":e.getClasses,"hour-options":e.hourOptions,"minute-options":e.minuteOptions,"second-options":e.secondOptions,"hour-step":e.hourStep,"minute-step":e.minuteStep,"second-step":e.secondStep,"scroll-duration":e.scrollDuration},on:{select:e.handleSelect}},"list-columns",e.ShowHourMinuteSecondAMPM,!1))],1)])},bF=[],TF=void 0,La=ia({render:pF,staticRenderFns:bF},TF,mF),zt={name:"TimeRange",inject:{prefixClass:{default:"mx"}},props:pe({},La.props),data:function(){return{startValue:new Date(NaN),endValue:new Date(NaN)}},watch:{value:{immediate:!0,handler:function(){if(O0(this.value)){var e=Gt(this.value,2),a=e[0],i=e[1];this.startValue=a,this.endValue=i}else this.startValue=new Date(NaN),this.endValue=new Date(NaN)}}},methods:{emitChange:function(e,a){var i=[this.startValue,this.endValue];this.$emit("select",i,e==="time"?"time-range":e,a)},handleSelectStart:function(e,a){this.startValue=e,this.endValue.getTime()>=e.getTime()||(this.endValue=e),this.emitChange(a,0)},handleSelectEnd:function(e,a){this.endValue=e,this.startValue.getTime()<=e.getTime()||(this.startValue=e),this.emitChange(a,1)},disabledStartTime:function(e){return this.disabledTime(e,0)},disabledEndTime:function(e){return e.getTime()2&&arguments[2]!==void 0?arguments[2]:!0;this.userInput=null;var n=Array.isArray(e)?e.map(this.date2value):this.date2value(e);return this.$emit("input",n),this.$emit("change",n,a),i&&this.closePopup(),n},isValidValue:function(e){return this.validMultipleType?Kg(e):this.range?O0(e):Aa(e)},isValidValueAndNotDisabled:function(e){if(!this.isValidValue(e))return!1;var a=typeof this.disabledDate=="function"?this.disabledDate:function(){return!1},i=typeof this.disabledTime=="function"?this.disabledTime:function(){return!1};return Array.isArray(e)||(e=[e]),e.every(function(n){return!a(n)&&!i(n)})},handleMultipleDates:function(e,a){if(this.validMultipleType&&a){var i=a.filter(function(n){return n.getTime()!==e.getTime()});return i.length===a.length&&i.push(e),i}return e},handleSelectDate:function(e,a,i){e=this.handleMultipleDates(e,i),this.confirm?this.currentValue=e:this.emitValue(e,a,!this.validMultipleType&&(a===this.type||a==="time"))},clear:function(){this.emitValue(this.range?[null,null]:null),this.$emit("clear")},handleClear:function(e){e.stopPropagation(),this.clear()},handleConfirmDate:function(){var e=this.emitValue(this.currentValue);this.$emit("confirm",e)},handleSelectShortcut:function(e){var a=e.currentTarget.getAttribute("data-index"),i=this.shortcuts[parseInt(a,10)];if(ua(i)&&typeof i.onClick=="function"){var n=i.onClick(this);n&&this.emitValue(n)}},openPopup:function(e){this.popupVisible||this.disabled||(this.defaultOpen=!0,this.$emit("open",e),this.$emit("update:open",!0))},closePopup:function(){this.popupVisible&&(this.defaultOpen=!1,this.$emit("close"),this.$emit("update:open",!1))},blur:function(){this.$refs.input&&this.$refs.input.blur()},focus:function(){this.$refs.input&&this.$refs.input.focus()},handleInputChange:function(){var e=this;if(!(!this.editable||this.userInput===null)){var a=this.userInput.trim();if(this.userInput=null,a===""){this.clear();return}var i;if(this.validMultipleType)i=a.split(this.innerRangeSeparator).map(function(o){return e.parseDate(o.trim())});else if(this.range){var n=a.split(this.innerRangeSeparator);n.length!==2&&(n=a.split(this.innerRangeSeparator.trim())),i=n.map(function(o){return e.parseDate(o.trim())})}else i=this.parseDate(a);this.isValidValueAndNotDisabled(i)?(this.emitValue(i),this.blur()):this.$emit("input-error",a)}},handleInputInput:function(e){this.userInput=typeof e=="string"?e:e.target.value},handleInputKeydown:function(e){var a=e.keyCode;a===9?this.closePopup():a===13&&this.handleInputChange()},handleInputBlur:function(e){this.$emit("blur",e)},handleInputFocus:function(e){this.openPopup(e),this.$emit("focus",e)},hasSlot:function(e){return!!(this.$slots[e]||this.$scopedSlots[e])},renderSlot:function(e,a,i){var n=this.$scopedSlots[e];return n?n(i)||a:this.$slots[e]||a},renderInput:function(){var e=this.$createElement,a=this.prefixClass,i=pe({name:"date",type:"text",autocomplete:"off",value:this.text,class:this.inputClass||"".concat(this.prefixClass,"-input"),readonly:!this.editable,disabled:this.disabled,placeholder:this.placeholder},this.inputAttr),n=i.value,o=i.class,s=Ig(i,["value","class"]),r={keydown:this.handleInputKeydown,focus:this.handleInputFocus,blur:this.handleInputBlur,input:this.handleInputInput,change:this.handleInputChange},_=this.renderSlot("input",e("input",{domProps:{value:n},class:o,attrs:pe({},s),on:pe({},r),ref:"input"}),{props:i,events:r}),l=this.type==="time"?e(yh):e(ph);return e("div",{class:"".concat(a,"-input-wrapper"),on:{mouseenter:this.handleMouseEnter,mouseleave:this.handleMouseLeave,click:this.openPopup},ref:"inputWrapper"},[_,this.showClearIcon?e("i",{class:"".concat(a,"-icon-clear"),on:{click:this.handleClear}},[this.renderSlot("icon-clear",e(wh))]):e("i",{class:"".concat(a,"-icon-calendar")},[this.renderSlot("icon-calendar",l)])])},renderContent:function(){var e=this.$createElement,a=this.range?yF:DF,i=a[this.type]||a.default,n=pe({},vt(this.$props,Object.keys(i.props)),{value:this.currentValue}),o=pe({},vt(this.$listeners,i.emits||[]),{select:this.handleSelectDate}),s=e(i,ai([{},{props:n,on:o,ref:"picker"}]));return e("div",{class:"".concat(this.prefixClass,"-datepicker-body")},[this.renderSlot("content",s,{value:this.currentValue,emit:this.handleSelectDate})])},renderSidebar:function(){var e=this,a=this.$createElement,i=this.prefixClass;return a("div",{class:"".concat(i,"-datepicker-sidebar")},[this.renderSlot("sidebar",null,{value:this.currentValue,emit:this.handleSelectDate}),this.shortcuts.map(function(n,o){return a("button",{key:o,attrs:{"data-index":o,type:"button"},class:"".concat(i,"-btn ").concat(i,"-btn-text ").concat(i,"-btn-shortcut"),on:{click:e.handleSelectShortcut}},[n.text])})])},renderHeader:function(){var e=this.$createElement;return e("div",{class:"".concat(this.prefixClass,"-datepicker-header")},[this.renderSlot("header",null,{value:this.currentValue,emit:this.handleSelectDate})])},renderFooter:function(){var e=this.$createElement,a=this.prefixClass;return e("div",{class:"".concat(a,"-datepicker-footer")},[this.renderSlot("footer",null,{value:this.currentValue,emit:this.handleSelectDate}),this.confirm?e("button",{attrs:{type:"button"},class:"".concat(a,"-btn ").concat(a,"-datepicker-btn-confirm"),on:{click:this.handleConfirmDate}},[this.confirmText]):null])}},render:function(){var e,a=arguments[0],i=this.prefixClass,n=this.inline,o=this.disabled,s=this.hasSlot("sidebar")||this.shortcuts.length?this.renderSidebar():null,r=a("div",{class:"".concat(i,"-datepicker-content")},[this.hasSlot("header")?this.renderHeader():null,this.renderContent(),this.hasSlot("footer")||this.confirm?this.renderFooter():null]);return a("div",{class:(e={},et(e,"".concat(i,"-datepicker"),!0),et(e,"".concat(i,"-datepicker-range"),this.range),et(e,"".concat(i,"-datepicker-inline"),n),et(e,"disabled",o),e)},[n?null:this.renderInput(),n?a("div",{class:"".concat(i,"-datepicker-main")},[s,r]):a(Fh,{ref:"popup",class:this.popupClass,style:this.popupStyle,attrs:{visible:this.popupVisible,appendToBody:this.appendToBody},on:{clickoutside:this.handleClickOutSide}},[s,r])])}};Ja.locale=Qr,Ja.install=function(e){e.component(Ja.name,Ja)},typeof window<"u"&&window.Vue&&Ja.install(window.Vue),pn(Ja,{CalendarPanel:ot,CalendarRange:Ut,TimePanel:La,TimeRange:zt,DatetimePanel:io,DatetimeRange:Jr}),oe(Vl);const EF={name:"CalendarBlankIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var kF=function(){var e=this,a=e._self._c;return a("span",e._b({staticClass:"material-design-icon calendar-blank-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(i){return e.$emit("click",i)}}},"span",e.$attrs,!1),[a("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1"}},[e.title?a("title",[e._v(e._s(e.title))]):e._e()])])])},AF=[],wF=te(EF,kF,AF,!1,null,null);const vF=wF.exports,SF={name:"WebIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var RF=function(){var e=this,a=e._self._c;return a("span",e._b({staticClass:"material-design-icon web-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(i){return e.$emit("click",i)}}},"span",e.$attrs,!1),[a("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,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,2Z"}},[e.title?a("title",[e._v(e._s(e.title))]):e._e()])])])},CF=[],BF=te(SF,RF,CF,!1,null,null);const OF=BF.exports,_s={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD H:mm:ss",year:"YYYY",month:"YYYY-MM",time:"H:mm:ss",week:"w"},NF={name:"NcDateTimePicker",components:{CalendarBlank:vF,DatePicker:Ja,NcPopover:xn,NcTimezonePicker:Fg,Web:OF},inheritAttrs:!1,props:{clearable:{type:Boolean,default:!1},minuteStep:{type:Number,default:10},type:{type:String,default:"date"},format:{type:String,default:null},formatter:{type:Object,default:null},lang:{type:Object,default:null},value:{default:()=>new Date},timezoneId:{type:String,default:"UTC"},showTimezoneSelect:{type:Boolean,default:!1},highlightTimezone:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!1},showWeekNumber:{type:Boolean,default:!1},placeholder:{type:String,default:null}},emits:["update:value","update:timezone-id"],setup(){return{timezoneDialogHeaderId:"timezone-dialog-header-".concat(st())}},data(){return{showTimezonePopover:!1,tzVal:this.timezoneId}},computed:{defaultLang(){return{formatLocale:{months:$l(),monthsShort:Ql(),weekdays:Kl(),weekdaysShort:Jl(),weekdaysMin:Xl(),firstDayOfWeek:e1()},monthFormat:"MMM"}},defaultPlaceholder(){return this.type==="time"?x("Pick a time"):this.type==="month"?x("Pick a month"):this.type==="year"?x("Pick a year"):this.type==="week"?x("Pick a week"):this.type==="date"?x("Pick a date"):x("Pick a date and a time")},formatTypeMap(){var e;return(e=_s[this.type])!=null?e:_s.date},internalFormatter(){var e;return{getWeek:a=>{const i=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate()));i.setUTCDate(i.getUTCDate()+4-(i.getUTCDay()||7));const n=new Date(Date.UTC(i.getUTCFullYear(),0,1));return Math.ceil(((i-n)/864e5+1)/7)},...(e=this.formatter)!=null?e:{}}}},methods:{t:x,handleSelectYear(e){const a=this.$refs.datepicker.currentValue;if(a)try{const i=new Date(new Date(a).setFullYear(e));this.$refs.datepicker.selectDate(i)}catch{console.error("Invalid value",a,e)}},handleSelectMonth(e){const a=this.$refs.datepicker.currentValue;if(a)try{const i=new Date(new Date(a).setMonth(e));this.$refs.datepicker.selectDate(i)}catch{console.error("Invalid value",a,e)}},toggleTimezonePopover(){this.showTimezoneSelect&&(this.showTimezonePopover=!this.showTimezonePopover)}}};var xF=function(){var e=this,a=e._self._c;return a("DatePicker",e._g(e._b({ref:"datepicker",attrs:{"append-to-body":e.appendToBody,clearable:e.clearable,format:e.format?e.format:e.formatTypeMap,formatter:e.internalFormatter,lang:e.lang?e.lang:e.defaultLang,"minute-step":e.minuteStep,placeholder:e.placeholder?e.placeholder:e.defaultPlaceholder,"popup-class":{"show-week-number":e.showWeekNumber},"show-week-number":e.showWeekNumber,type:e.type,value:e.value},on:{"select-year":e.handleSelectYear,"select-month":e.handleSelectMonth,"update:value":function(i){return e.$emit("update:value",e.value)}},scopedSlots:e._u([{key:"icon-calendar",fn:function(){return[e.showTimezoneSelect?a("NcPopover",{attrs:{"popup-role":"dialog",shown:e.showTimezonePopover,"popover-base-class":"timezone-select__popper"},on:{"update:shown":function(i){e.showTimezonePopover=i}},scopedSlots:e._u([{key:"trigger",fn:function({attrs:i}){return[a("button",e._b({staticClass:"datetime-picker-inline-icon",class:{"datetime-picker-inline-icon--highlighted":e.highlightTimezone},on:{mousedown:function(n){return n.stopPropagation(),n.preventDefault(),(()=>{}).apply(null,arguments)}}},"button",i,!1),[a("Web",{attrs:{size:20}})],1)]}}],null,!1,270852355)},[a("div",{attrs:{role:"dialog","aria-labelledby":e.timezoneDialogHeaderId}},[a("div",{staticClass:"timezone-popover-wrapper__label"},[a("strong",{attrs:{id:e.timezoneDialogHeaderId}},[e._v(" "+e._s(e.t("Please select a time zone:"))+" ")])]),a("NcTimezonePicker",{staticClass:"timezone-popover-wrapper__timezone-select",on:{input:function(i){return e.$emit("update:timezone-id",arguments[0])}},model:{value:e.tzVal,callback:function(i){e.tzVal=i},expression:"tzVal"}})],1)]):a("CalendarBlank",{attrs:{size:20}})]},proxy:!0},e._l(e.$scopedSlots,function(i,n){return{key:n,fn:function(o){return[e._t(n,null,null,o)]}}})],null,!0)},"DatePicker",e.$attrs,!1),e.$listeners))},MF=[],jF=te(NF,xF,MF,!1,null,"4727c294");const YF=jF.exports;zs(YF);const qF=["date","datetime-local","month","time","week"],LF={name:"NcDateTimePickerNative",inheritAttrs:!1,props:{value:{type:Date,default:null},id:{type:String,required:!0},type:{type:String,default:"date",validate:e=>qF.includes(e)},label:{type:String,default:"Please choose a date"},min:{type:[Date,Boolean],default:null},max:{type:[Date,Boolean],default:null},hideLabel:{type:Boolean,default:!1},inputClass:{type:[Object,String],default:""}},emits:["input"],computed:{formattedValue(){return this.formatValue(this.value)},formattedMin(){return this.min?this.formatValue(this.min):!1},formattedMax(){return this.max?this.formatValue(this.max):!1},listeners(){return{...this.$listeners,input:e=>{if(isNaN(e.target.valueAsNumber))return this.$emit("input",null);if(this.type==="time"){const n=e.target.value;if(this.value===""){const{yyyy:_,MM:l,dd:g}=this.getReadableDate(new Date);return this.$emit("input",new Date("".concat(_,"-").concat(l,"-").concat(g,"T").concat(n)))}const{yyyy:o,MM:s,dd:r}=this.getReadableDate(this.value);return this.$emit("input",new Date("".concat(o,"-").concat(s,"-").concat(r,"T").concat(n)))}else if(this.type==="month"){const n=(new Date(e.target.value).getMonth()+1).toString().padStart(2,"0");if(this.value===""){const{yyyy:l,dd:g,hh:d,mm:f}=this.getReadableDate(new Date);return this.$emit("input",new Date("".concat(l,"-").concat(n,"-").concat(g,"T").concat(d,":").concat(f)))}const{yyyy:o,dd:s,hh:r,mm:_}=this.getReadableDate(this.value);return this.$emit("input",new Date("".concat(o,"-").concat(n,"-").concat(s,"T").concat(r,":").concat(_)))}const a=new Date(e.target.valueAsNumber).getTimezoneOffset()*1e3*60,i=e.target.valueAsNumber+a;return this.$emit("input",new Date(i))}}}},methods:{getReadableDate(e){if(e instanceof Date){const a=e.getFullYear().toString().padStart(4,"0"),i=(e.getMonth()+1).toString().padStart(2,"0"),n=e.getDate().toString().padStart(2,"0"),o=e.getHours().toString().padStart(2,"0"),s=e.getMinutes().toString().padStart(2,"0");return{yyyy:a,MM:i,dd:n,hh:o,mm:s}}},formatValue(e){if(e instanceof Date){const{yyyy:a,MM:i,dd:n,hh:o,mm:s}=this.getReadableDate(e);if(this.type==="datetime-local")return"".concat(a,"-").concat(i,"-").concat(n,"T").concat(o,":").concat(s);if(this.type==="date")return"".concat(a,"-").concat(i,"-").concat(n);if(this.type==="month")return"".concat(a,"-").concat(i);if(this.type==="time")return"".concat(o,":").concat(s);if(this.type==="week"){const r=new Date(a,0,1),_=Math.floor((e-r)/(24*60*60*1e3)),l=Math.ceil(_/7);return"".concat(a,"-W").concat(l)}}else return""}}};var ZF=function(){var e=this,a=e._self._c;return a("div",{staticClass:"native-datetime-picker"},[a("label",{class:{"hidden-visually":e.hideLabel},attrs:{for:e.id}},[e._v(e._s(e.label))]),a("input",e._g(e._b({staticClass:"native-datetime-picker--input",class:e.inputClass,attrs:{id:e.id,type:e.type,min:e.formattedMin,max:e.formattedMax},domProps:{value:e.formattedValue}},"input",e.$attrs,!1),e.listeners))])},IF=[],HF=te(LF,ZF,IF,!1,null,"fbe2ff4a");const PF=HF.exports;zs(PF);const GF={name:"AlertCircleOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var UF=function(){var e=this,a=e._self._c;return a("span",e._b({staticClass:"material-design-icon alert-circle-outline-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(i){return e.$emit("click",i)}}},"span",e.$attrs,!1),[a("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[a("path",{attrs:{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"}},[e.title?a("title",[e._v(e._s(e.title))]):e._e()])])])},zF=[],WF=te(GF,UF,zF,!1,null,null);const VF=WF.exports,$F={name:"NcInputField",components:{NcButton:wa,AlertCircle:VF,Check:jn},inheritAttrs:!1,props:{value:{type:[String,Number],required:!0},type:{type:String,default:"text",validator:e=>["text","password","email","tel","url","search","number"].includes(e)},label:{type:String,default:void 0},labelOutside:{type:Boolean,default:!1},placeholder:{type:String,default:void 0},showTrailingButton:{type:Boolean,default:!1},trailingButtonLabel:{type:String,default:""},success:{type:Boolean,default:!1},error:{type:Boolean,default:!1},helperText:{type:String,default:""},disabled:{type:Boolean,default:!1},pill:{type:Boolean,default:!1},inputClass:{type:[Object,String],default:""}},emits:["update:value","trailing-button-click"],computed:{computedId(){return this.$attrs.id&&this.$attrs.id!==""?this.$attrs.id:this.inputName},inputName(){return"input"+st()},hasLeadingIcon(){return this.$slots.default},hasTrailingIcon(){return this.success},hasPlaceholder(){return this.placeholder!==""&&this.placeholder!==void 0},computedPlaceholder(){return this.hasPlaceholder?this.placeholder:this.label},isValidLabel(){const e=this.label||this.labelOutside;return e||console.warn("You need to add a label to the NcInputField component. Either use the prop label or use an external one, as per the example in the documentation."),e},ariaDescribedby(){const e=[];return this.helperText.length>0&&e.push("".concat(this.inputName,"-helper-text")),this.$attrs["aria-describedby"]&&e.push(this.$attrs["aria-describedby"]),e.join(" ")||null}},methods:{focus(){this.$refs.input.focus()},select(){this.$refs.input.select()},handleInput(e){this.$emit("update:value",this.type==="number"&&typeof this.value=="number"?parseFloat(e.target.value,10):e.target.value)},handleTrailingButtonClick(e){this.$emit("trailing-button-click",e)}}};var QF=function(){var e=this,a=e._self._c;return a("div",{staticClass:"input-field",class:{"input-field--disabled":e.disabled,"input-field--label-outside":e.labelOutside||!e.isValidLabel,"input-field--leading-icon":e.hasLeadingIcon,"input-field--trailing-icon":e.showTrailingButton||e.hasTrailingIcon,"input-field--pill":e.pill}},[a("div",{staticClass:"input-field__main-wrapper"},[a("input",e._g(e._b({ref:"input",staticClass:"input-field__input",class:[e.inputClass,{"input-field__input--success":e.success,"input-field__input--error":e.error}],attrs:{id:e.computedId,type:e.type,disabled:e.disabled,placeholder:e.computedPlaceholder,"aria-describedby":e.ariaDescribedby,"aria-live":"polite"},domProps:{value:e.value.toString()},on:{input:e.handleInput}},"input",e.$attrs,!1),e.$listeners)),!e.labelOutside&&e.isValidLabel?a("label",{staticClass:"input-field__label",attrs:{for:e.computedId}},[e._v(" "+e._s(e.label)+" ")]):e._e(),a("div",{directives:[{name:"show",rawName:"v-show",value:e.hasLeadingIcon,expression:"hasLeadingIcon"}],staticClass:"input-field__icon input-field__icon--leading"},[e._t("default")],2),e.showTrailingButton?a("NcButton",{staticClass:"input-field__trailing-button",attrs:{type:"tertiary-no-background","aria-label":e.trailingButtonLabel,disabled:e.disabled},on:{click:e.handleTrailingButtonClick},scopedSlots:e._u([{key:"icon",fn:function(){return[e._t("trailing-button-icon")]},proxy:!0}],null,!0)}):e.success||e.error?a("div",{staticClass:"input-field__icon input-field__icon--trailing"},[e.success?a("Check",{staticStyle:{color:"var(--color-success-text)"},attrs:{size:20}}):e.error?a("AlertCircle",{staticStyle:{color:"var(--color-error-text)"},attrs:{size:20}}):e._e()],1):e._e()],1),e.helperText.length>0?a("p",{staticClass:"input-field__helper-text-message",class:{"input-field__helper-text-message--error":e.error,"input-field__helper-text-message--success":e.success},attrs:{id:"".concat(e.inputName,"-helper-text")}},[e.success?a("Check",{staticClass:"input-field__helper-text-message__icon",attrs:{size:18}}):e.error?a("AlertCircle",{staticClass:"input-field__helper-text-message__icon",attrs:{size:18}}):e._e(),e._v(" "+e._s(e.helperText)+" ")],1):e._e()])},KF=[],JF=te($F,QF,KF,!1,null,"374fffac");const Rt=JF.exports;var yn={exports:{}};function ds(e,a=100,i={}){if(typeof e!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof e}\`.`);if(a<0)throw new RangeError("`wait` must not be negative.");const{immediate:n}=typeof i=="boolean"?{immediate:i}:i;let o,s,r,_,l;function g(){const h=o,u=s;return o=void 0,s=void 0,l=e.apply(h,u),l}function d(){const h=Date.now()-_;h=0?r=setTimeout(d,a-h):(r=void 0,n||(l=g()))}const f=function(...h){if(o&&this!==o)throw new Error("Debounced method called with different contexts.");o=this,s=h,_=Date.now();const u=n&&!r;return r||(r=setTimeout(d,a)),u&&(l=g()),l};return f.clear=()=>{r&&(clearTimeout(r),r=void 0)},f.flush=()=>{r&&f.trigger()},f.trigger=()=>{l=g(),f.clear()},f}yn.exports.debounce=ds,yn.exports=ds;var XF=yn.exports;const no=Rn(XF),eu={name:"EyeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var au=function(){var e=this,a=e._self._c;return a("span",e._b({staticClass:"material-design-icon eye-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(i){return e.$emit("click",i)}}},"span",e.$attrs,!1),[a("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z"}},[e.title?a("title",[e._v(e._s(e.title))]):e._e()])])])},tu=[],iu=te(eu,au,tu,!1,null,null);const nu=iu.exports,ou={name:"EyeOffIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var su=function(){var e=this,a=e._self._c;return a("span",e._b({staticClass:"material-design-icon eye-off-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(i){return e.$emit("click",i)}}},"span",e.$attrs,!1),[a("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z"}},[e.title?a("title",[e._v(e._s(e.title))]):e._e()])])])},ru=[],lu=te(ou,su,ru,!1,null,null);const _u=lu.exports;oe(t1);const du=a1().detectUser().setApp("@nextcloud/vue").build(),fs=Wt("core","capabilities",{}).password_policy||null,fu=new Set(Object.keys(Rt.props)),gu={name:"NcPasswordField",components:{NcInputField:Rt,Eye:nu,EyeOff:_u},inheritAttrs:!1,props:{" ":{},...Rt.props,showTrailingButton:{type:Boolean,default:!0},trailingButtonLabel:void 0,checkPasswordStrength:{type:Boolean,default:!1},minlength:{type:Number,default:0},maxlength:{type:Number,default:null},asText:{type:Boolean,default:!1}},emits:["valid","invalid","update:value"],data(){return{isPasswordHidden:!0,internalHelpMessage:"",isValid:null}},computed:{computedError(){return this.error||this.isValid===!1},computedSuccess(){return this.success||this.isValid===!0},computedHelperText(){return this.helperText.length>0?this.helperText:this.internalHelpMessage},rules(){const{minlength:e}=this;return{minlength:e??fs?.minLength}},trailingButtonLabelPassword(){return this.isPasswordHidden?x("Show password"):x("Hide password")},propsAndAttrsToForward(){return{...this.$attrs,...Object.fromEntries(Object.entries(this.$props).filter(([e])=>fu.has(e)))}}},watch:{value(e){if(this.checkPasswordStrength){if(fs===null)return;this.checkPassword(e)}}},methods:{focus(){this.$refs.inputField.focus()},select(){this.$refs.inputField.select()},handleInput(e){this.$emit("update:value",e.target.value)},togglePasswordVisibility(){this.isPasswordHidden=!this.isPasswordHidden},checkPassword:no(async function(e){try{const{data:a}=await ma.post(Pa("apps/password_policy/api/v1/validate"),{password:e});if(this.isValid=a.ocs.data.passed,a.ocs.data.passed){this.internalHelpMessage=x("Password is secure"),this.$emit("valid");return}this.internalHelpMessage=a.ocs.data.reason,this.$emit("invalid")}catch(a){du.error("Password policy returned an error",a)}},500)}};var hu=function(){var e=this,a=e._self._c;return a("NcInputField",e._g(e._b({ref:"inputField",attrs:{type:e.isPasswordHidden&&!e.asText?"password":"text","trailing-button-label":e.trailingButtonLabelPassword,"helper-text":e.computedHelperText,error:e.computedError,success:e.computedSuccess,minlength:e.rules.minlength,"input-class":{"password-field__input--secure-text":e.isPasswordHidden&&e.asText}},on:{"trailing-button-click":e.togglePasswordVisibility,input:e.handleInput},scopedSlots:e._u([{key:"trailing-button-icon",fn:function(){return[e.isPasswordHidden?a("Eye",{attrs:{size:18}}):a("EyeOff",{attrs:{size:18}})]},proxy:!0}])},"NcInputField",e.propsAndAttrsToForward,!1),e.$listeners),[e._t("default")],2)},Fu=[],uu=te(gu,hu,Fu,!1,null,"d984b8e5");const W2=uu.exports,cu={name:"ArrowRightIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var mu=function(){var e=this,a=e._self._c;return a("span",e._b({staticClass:"material-design-icon arrow-right-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(i){return e.$emit("click",i)}}},"span",e.$attrs,!1),[a("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z"}},[e.title?a("title",[e._v(e._s(e.title))]):e._e()])])])},pu=[],bu=te(cu,mu,pu,!1,null,null);const Tu=bu.exports,Du={name:"UndoVariantIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var yu=function(){var e=this,a=e._self._c;return a("span",e._b({staticClass:"material-design-icon undo-variant-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(i){return e.$emit("click",i)}}},"span",e.$attrs,!1),[a("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M13.5,7A6.5,6.5 0 0,1 20,13.5A6.5,6.5 0 0,1 13.5,20H10V18H13.5C16,18 18,16 18,13.5C18,11 16,9 13.5,9H7.83L10.91,12.09L9.5,13.5L4,8L9.5,2.5L10.92,3.91L7.83,7H13.5M6,18H8V20H6V18Z"}},[e.title?a("title",[e._v(e._s(e.title))]):e._e()])])])},Eu=[],ku=te(Du,yu,Eu,!1,null,null);const Au=ku.exports;oe(i1,Ws);const wu=new Set(Object.keys(Rt.props)),vu={name:"NcTextField",components:{NcInputField:Rt,Close:Nn,ArrowRight:Tu,Undo:Au},inheritAttrs:!1,props:{" ":{},...Rt.props,trailingButtonLabel:{type:String,default:""},trailingButtonIcon:{type:String,default:"close",validator:e=>["close","arrowRight","undo"].includes(e)}},emits:["update:value"],computed:{propsAndAttrsToForward(){const e={undo:x("Undo changes"),close:x("Clear text"),arrowRight:x("Save changes")};return{...this.$attrs,...Object.fromEntries(Object.entries(this.$props).filter(([a])=>wu.has(a))),trailingButtonLabel:this.trailingButtonLabel||e[this.trailingButtonIcon]}}},methods:{focus(){this.$refs.inputField.focus()},select(){this.$refs.inputField.select()},handleInput(e){this.$emit("update:value",e.target.value)}}};var Su=function(){var e=this,a=e._self._c;return a("NcInputField",e._g(e._b({ref:"inputField",on:{input:e.handleInput},scopedSlots:e._u([e.type!=="search"?{key:"trailing-button-icon",fn:function(){return[e.trailingButtonIcon==="close"?a("Close",{attrs:{size:20}}):e.trailingButtonIcon==="arrowRight"?a("ArrowRight",{attrs:{size:20}}):e.trailingButtonIcon==="undo"?a("Undo",{attrs:{size:20}}):e._e()]},proxy:!0}:null],null,!0)},"NcInputField",e.propsAndAttrsToForward,!1),e.$listeners),[e._t("default")],2)},Ru=[],Cu=te(vu,Su,Ru,!1,null,null);const Bu=Cu.exports;oe(Vs),V1,x("Submit"),oe(n1),Bn("nextcloud").persist().build(),oe(o1);const Ou={name:"NcVNodes",props:{vnodes:{type:[Array,Object],default:null}},render(e){var a,i,n;return this.vnodes||((a=this.$slots)==null?void 0:a.default)||((n=(i=this.$scopedSlots)==null?void 0:i.default)==null?void 0:n.call(i))}},Nu=null,xu=null;var Mu=te(Ou,Nu,xu,!1,null,null);const V2=Mu.exports,ju={name:"ChevronUpIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Yu=function(){var e=this,a=e._self._c;return a("span",e._b({staticClass:"material-design-icon chevron-up-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(i){return e.$emit("click",i)}}},"span",e.$attrs,!1),[a("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z"}},[e.title?a("title",[e._v(e._s(e.title))]):e._e()])])])},qu=[],Lu=te(ju,Yu,qu,!1,null,null);const Zu=Lu.exports;oe(s1),oe(r1),oe(l1,Ws),oe($s,_1);x("Search…");oe(f1);const Iu={name:"CogIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Hu=function(){var e=this,a=e._self._c;return a("span",e._b({staticClass:"material-design-icon cog-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(i){return e.$emit("click",i)}}},"span",e.$attrs,!1),[a("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z"}},[e.title?a("title",[e._v(e._s(e.title))]):e._e()])])])},Pu=[],Gu=te(Iu,Hu,Pu,!1,null,null);const $2=Gu.exports;x("Settings"),oe(g1),no(function(){this.selectedSection="",document.activeElement.className.includes("navigation-list__link")&&document.activeElement.blur()},300);let Uu="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",zu=(e=21)=>{let a="",i=e;for(;i--;)a+=Uu[Math.random()*64|0];return a};function vi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?vi=function(a){return typeof a}:vi=function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},vi(e)}var Xr={selector:"vue-portal-target-".concat(zu())},Wu=function(e){return Xr.selector=e},en=typeof window<"u"&&(typeof document>"u"?"undefined":vi(document))!==void 0,Vu=ka.extend({abstract:!0,name:"PortalOutlet",props:["nodes","tag"],data:function(e){return{updatedNodes:e.nodes}},render:function(e){var a=this.updatedNodes&&this.updatedNodes();return a?a.length===1&&!a[0].text?a:e(this.tag||"DIV",a):e()},destroyed:function(){var e=this.$el;e&&e.parentNode.removeChild(e)}}),$u=ka.extend({name:"VueSimplePortal",props:{disabled:{type:Boolean},prepend:{type:Boolean},selector:{type:String,default:function(){return"#".concat(Xr.selector)}},tag:{type:String,default:"DIV"}},render:function(e){if(this.disabled){var a=this.$scopedSlots&&this.$scopedSlots.default();return a?a.length<2&&!a[0].text?a:e(this.tag,a):e()}return e()},created:function(){this.getTargetEl()||this.insertTargetEl()},updated:function(){var e=this;this.$nextTick(function(){!e.disabled&&e.slotFn!==e.$scopedSlots.default&&(e.container.updatedNodes=e.$scopedSlots.default),e.slotFn=e.$scopedSlots.default})},beforeDestroy:function(){this.unmount()},watch:{disabled:{immediate:!0,handler:function(e){e?this.unmount():this.$nextTick(this.mount)}}},methods:{getTargetEl:function(){if(en)return document.querySelector(this.selector)},insertTargetEl:function(){if(en){var e=document.querySelector("body"),a=document.createElement(this.tag);a.id=this.selector.substring(1),e.appendChild(a)}},mount:function(){if(en){var e=this.getTargetEl(),a=document.createElement("DIV");this.prepend&&e.firstChild?e.insertBefore(a,e.firstChild):e.appendChild(a),this.container=new Vu({el:a,parent:this,propsData:{tag:this.tag,nodes:this.$scopedSlots.default}})}},unmount:function(){this.container&&(this.container.$destroy(),delete this.container)}}});function Qu(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};e.component(a.name||"portal",$u),a.defaultSelector&&Wu(a.defaultSelector)}typeof window<"u"&&window.Vue&&window.Vue===ka&&ka.use(Qu),oe();const Ku={name:"NcEmptyContent",props:{name:{type:String,default:""},description:{type:String,default:""}},computed:{hasName(){return this.name!==""},hasDescription(){var e;return this.description!==""||((e=this.$slots.description)==null?void 0:e[0])}}};var Ju=function(){var e=this,a=e._self._c;return a("div",{staticClass:"empty-content",attrs:{role:"note"}},[e.$slots.icon?a("div",{staticClass:"empty-content__icon",attrs:{"aria-hidden":"true"}},[e._t("icon")],2):e._e(),e._t("name",function(){return[e.hasName?a("span",{staticClass:"empty-content__name"},[e._v(" "+e._s(e.name)+" ")]):e._e()]}),e.hasDescription?a("p",{staticClass:"empty-content__description"},[e._t("description",function(){return[e._v(" "+e._s(e.description)+" ")]})],2):e._e(),e.$slots.action?a("div",{staticClass:"empty-content__action"},[e._t("action")],2):e._e()],2)},Xu=[],ec=te(Ku,Ju,Xu,!1,null,"fede0c71");const oo=ec.exports;oe(h1),oe(F1),oe(u1);const ac={name:"ArrowLeftIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var tc=function(){var e=this,a=e._self._c;return a("span",e._b({staticClass:"material-design-icon arrow-left-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(i){return e.$emit("click",i)}}},"span",e.$attrs,!1),[a("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"}},[e.title?a("title",[e._v(e._s(e.title))]):e._e()])])])},ic=[],nc=te(ac,tc,ic,!1,null,null);const el=nc.exports;var al={exports:{}};(function(e,a){(function(i,n){e.exports=n()})(typeof self<"u"?self:Na,function(){return function(i){function n(s){if(o[s])return o[s].exports;var r=o[s]={i:s,l:!1,exports:{}};return i[s].call(r.exports,r,r.exports,n),r.l=!0,r.exports}var o={};return n.m=i,n.c=o,n.d=function(s,r,_){n.o(s,r)||Object.defineProperty(s,r,{configurable:!1,enumerable:!0,get:_})},n.n=function(s){var r=s&&s.__esModule?function(){return s.default}:function(){return s};return n.d(r,"a",r),r},n.o=function(s,r){return Object.prototype.hasOwnProperty.call(s,r)},n.p="",n(n.s=60)}([function(i,n){function o(r,_){var l=r[1]||"",g=r[3];if(!g)return l;if(_&&typeof btoa=="function"){var d=s(g);return[l].concat(g.sources.map(function(f){return"/*# sourceURL="+g.sourceRoot+f+" */"})).concat([d]).join(` +`)}return[l].join(` +`)}function s(r){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"}i.exports=function(r){var _=[];return _.toString=function(){return this.map(function(l){var g=o(l,r);return l[2]?"@media "+l[2]+"{"+g+"}":g}).join("")},_.i=function(l,g){typeof l=="string"&&(l=[[null,l,""]]);for(var d={},f=0;fW.parts.length&&(I.parts.length=W.parts.length)}else{for(var v=[],c=0;c"u"||(k=__VUE_SSR_CONTEXT__),_&&_.call(this,k),k&&k._registeredComponents&&k._registeredComponents.add(g)},u._ssrRegister=m):_&&(m=_),m){var b=u.functional,y=b?u.render:u.beforeCreate;b?(u._injectStyles=m,u.render=function(k,w){return m.call(w),y(k,w)}):u.beforeCreate=y?[].concat(y,m):[m]}return{esModule:d,exports:f,options:u}}},function(i,n,o){function s(l,g){var d,f=l&&l.a;!(d=l&&l.hsl?(0,_.default)(l.hsl):l&&l.hex&&l.hex.length>0?(0,_.default)(l.hex):l&&l.hsv?(0,_.default)(l.hsv):l&&l.rgba?(0,_.default)(l.rgba):l&&l.rgb?(0,_.default)(l.rgb):(0,_.default)(l))||d._a!==void 0&&d._a!==null||d.setAlpha(f||1);var h=d.toHsl(),u=d.toHsv();return h.s===0&&(u.h=h.h=l.h||l.hsl&&l.hsl.h||g||0),{hsl:h,hex:d.toHexString().toUpperCase(),hex8:d.toHex8String().toUpperCase(),rgba:d.toRgb(),hsv:u,oldHue:l.h||g||h.h,source:l.source,a:l.a||d.getAlpha()}}Object.defineProperty(n,"__esModule",{value:!0});var r=o(65),_=function(l){return l&&l.__esModule?l:{default:l}}(r);n.default={props:["value"],data:function(){return{val:s(this.value)}},computed:{colors:{get:function(){return this.val},set:function(l){this.val=l,this.$emit("input",l)}}},watch:{value:function(l){this.val=s(l)}},methods:{colorChange:function(l,g){this.oldHue=this.colors.hsl.h,this.colors=s(l,g||this.oldHue)},isValidHex:function(l){return(0,_.default)(l).isValid()},simpleCheckForValidColor:function(l){for(var g=["r","g","b","a","h","s","l","v"],d=0,f=0,h=0;h0?s:o)(r)}},function(i,n){i.exports=function(o){if(o==null)throw TypeError("Can't call method on "+o);return o}},function(i,n,o){var s=o(12);i.exports=function(r,_){if(!s(r))return r;var l,g;if(_&&typeof(l=r.toString)=="function"&&!s(g=l.call(r))||typeof(l=r.valueOf)=="function"&&!s(g=l.call(r))||!_&&typeof(l=r.toString)=="function"&&!s(g=l.call(r)))return g;throw TypeError("Can't convert object to primitive value")}},function(i,n){i.exports={}},function(i,n,o){var s=o(46),r=o(30);i.exports=Object.keys||function(_){return s(_,r)}},function(i,n,o){var s=o(29)("keys"),r=o(19);i.exports=function(_){return s[_]||(s[_]=r(_))}},function(i,n,o){var s=o(15),r=o(4),_=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(i.exports=function(l,g){return _[l]||(_[l]=g!==void 0?g:{})})("versions",[]).push({version:s.version,mode:o(14)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(i,n){i.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(i,n,o){var s=o(8).f,r=o(6),_=o(11)("toStringTag");i.exports=function(l,g,d){l&&!r(l=d?l:l.prototype,_)&&s(l,_,{configurable:!0,value:g})}},function(i,n,o){n.f=o(11)},function(i,n,o){var s=o(4),r=o(15),_=o(14),l=o(32),g=o(8).f;i.exports=function(d){var f=r.Symbol||(r.Symbol=_?{}:s.Symbol||{});d.charAt(0)=="_"||d in f||g(f,d,{value:l.f(d)})}},function(i,n){n.f={}.propertyIsEnumerable},function(i,n,o){function s(f){return f&&f.__esModule?f:{default:f}}Object.defineProperty(n,"__esModule",{value:!0});var r=o(3),_=s(r),l=o(5),g=s(l),d=["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#CCCCCC","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"];n.default={name:"Compact",mixins:[_.default],props:{palette:{type:Array,default:function(){return d}}},components:{"ed-in":g.default},computed:{pick:function(){return this.colors.hex.toUpperCase()}},methods:{handlerClick:function(f){this.colorChange({hex:f,source:"hex"})}}}},function(i,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default={name:"editableInput",props:{label:String,labelText:String,desc:String,value:[String,Number],max:Number,min:Number,arrowOffset:{type:Number,default:1}},computed:{val:{get:function(){return this.value},set:function(s){if(!(this.max!==void 0&&+s>this.max))return s;this.$refs.input.value=this.max}},labelId:function(){return"input__label__"+this.label+"__"+Math.random().toString().slice(2,5)},labelSpanText:function(){return this.labelText||this.label}},methods:{update:function(s){this.handleChange(s.target.value)},handleChange:function(s){var r={};r[this.label]=s,r.hex===void 0&&r["#"]===void 0?this.$emit("change",r):s.length>5&&this.$emit("change",r)},handleKeyDown:function(s){var r=this.val,_=Number(r);if(_){var l=this.arrowOffset||1;s.keyCode===38&&(r=_+l,this.handleChange(r),s.preventDefault()),s.keyCode===40&&(r=_-l,this.handleChange(r),s.preventDefault())}}}}},function(i,n,o){Object.defineProperty(n,"__esModule",{value:!0});var s=o(3),r=function(l){return l&&l.__esModule?l:{default:l}}(s),_=["#FFFFFF","#F2F2F2","#E6E6E6","#D9D9D9","#CCCCCC","#BFBFBF","#B3B3B3","#A6A6A6","#999999","#8C8C8C","#808080","#737373","#666666","#595959","#4D4D4D","#404040","#333333","#262626","#0D0D0D","#000000"];n.default={name:"Grayscale",mixins:[r.default],props:{palette:{type:Array,default:function(){return _}}},components:{},computed:{pick:function(){return this.colors.hex.toUpperCase()}},methods:{handlerClick:function(l){this.colorChange({hex:l,source:"hex"})}}}},function(i,n,o){function s(d){return d&&d.__esModule?d:{default:d}}Object.defineProperty(n,"__esModule",{value:!0});var r=o(5),_=s(r),l=o(3),g=s(l);n.default={name:"Material",mixins:[g.default],components:{"ed-in":_.default},methods:{onChange:function(d){d&&(d.hex?this.isValidHex(d.hex)&&this.colorChange({hex:d.hex,source:"hex"}):(d.r||d.g||d.b)&&this.colorChange({r:d.r||this.colors.rgba.r,g:d.g||this.colors.rgba.g,b:d.b||this.colors.rgba.b,a:d.a||this.colors.rgba.a,source:"rgba"}))}}}},function(i,n,o){function s(h){return h&&h.__esModule?h:{default:h}}Object.defineProperty(n,"__esModule",{value:!0});var r=o(81),_=s(r),l=o(3),g=s(l),d=o(13),f=s(d);n.default={name:"Slider",mixins:[g.default],props:{swatches:{type:Array,default:function(){return[{s:.5,l:.8},{s:.5,l:.65},{s:.5,l:.5},{s:.5,l:.35},{s:.5,l:.2}]}}},components:{hue:f.default},computed:{normalizedSwatches:function(){return this.swatches.map(function(h){return(h===void 0?"undefined":(0,_.default)(h))!=="object"?{s:.5,l:h}:h})}},methods:{isActive:function(h,u){var m=this.colors.hsl;return m.l===1&&h.l===1||m.l===0&&h.l===0||Math.abs(m.l-h.l)<.01&&Math.abs(m.s-h.s)<.01},hueChange:function(h){this.colorChange(h)},handleSwClick:function(h,u){this.colorChange({h:this.colors.hsl.h,s:u.s,l:u.l,source:"hsl"})}}}},function(i,n,o){var s=o(14),r=o(41),_=o(44),l=o(7),g=o(26),d=o(88),f=o(31),h=o(95),u=o(11)("iterator"),m=!([].keys&&"next"in[].keys()),b=function(){return this};i.exports=function(y,k,w,S,j,Z,B){d(w,k,S);var G,W,I,c=function(ne){if(!m&&ne in z)return z[ne];switch(ne){case"keys":case"values":return function(){return new w(this,ne)}}return function(){return new w(this,ne)}},v=k+" Iterator",R=j=="values",O=!1,z=y.prototype,q=z[u]||z["@@iterator"]||j&&z[j],ie=q||c(j),ee=j?R?c("entries"):ie:void 0,fe=k=="Array"&&z.entries||q;if(fe&&(I=h(fe.call(new y)))!==Object.prototype&&I.next&&(f(I,v,!0),s||typeof I[u]=="function"||l(I,u,b)),R&&q&&q.name!=="values"&&(O=!0,ie=function(){return q.call(this)}),s&&!B||!m&&!O&&z[u]||l(z,u,ie),g[k]=ie,g[v]=b,j)if(G={values:R?ie:c("values"),keys:Z?ie:c("keys"),entries:ee},B)for(W in G)W in z||_(z,W,G[W]);else r(r.P+r.F*(m||O),k,G);return G}},function(i,n,o){var s=o(4),r=o(15),_=o(86),l=o(7),g=o(6),d=function(f,h,u){var m,b,y,k=f&d.F,w=f&d.G,S=f&d.S,j=f&d.P,Z=f&d.B,B=f&d.W,G=w?r:r[h]||(r[h]={}),W=G.prototype,I=w?s:S?s[h]:(s[h]||{}).prototype;w&&(u=h);for(m in u)(b=!k&&I&&I[m]!==void 0)&&g(G,m)||(y=b?I[m]:u[m],G[m]=w&&typeof I[m]!="function"?u[m]:Z&&b?_(y,s):B&&I[m]==y?function(c){var v=function(R,O,z){if(this instanceof c){switch(arguments.length){case 0:return new c;case 1:return new c(R);case 2:return new c(R,O)}return new c(R,O,z)}return c.apply(this,arguments)};return v.prototype=c.prototype,v}(y):j&&typeof y=="function"?_(Function.call,y):y,j&&((G.virtual||(G.virtual={}))[m]=y,f&d.R&&W&&!W[m]&&l(W,m,y)))};d.F=1,d.G=2,d.S=4,d.P=8,d.B=16,d.W=32,d.U=64,d.R=128,i.exports=d},function(i,n,o){i.exports=!o(9)&&!o(17)(function(){return Object.defineProperty(o(43)("div"),"a",{get:function(){return 7}}).a!=7})},function(i,n,o){var s=o(12),r=o(4).document,_=s(r)&&s(r.createElement);i.exports=function(l){return _?r.createElement(l):{}}},function(i,n,o){i.exports=o(7)},function(i,n,o){var s=o(16),r=o(89),_=o(30),l=o(28)("IE_PROTO"),g=function(){},d=function(){var f,h=o(43)("iframe"),u=_.length;for(h.style.display="none",o(94).appendChild(h),h.src="javascript:",f=h.contentWindow.document,f.open(),f.write("","import '../assets/NcActionButtonGroup-CQxLn2fv.css';\nimport { defineComponent } from \"vue\";\nimport { G as GenRandomId } from \"./GenRandomId-CMooMQt0.mjs\";\nimport { r as register, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nregister();\nconst _sfc_main = defineComponent({\n name: \"NcActionButtonGroup\",\n inject: {\n isInSemanticMenu: {\n from: \"NcActions:isSemanticMenu\",\n default: false\n }\n },\n props: {\n /**\n * Optional text shown below the button group\n */\n name: {\n required: false,\n default: void 0,\n type: String\n }\n },\n setup() {\n return {\n labelId: \"nc-action-button-group-\".concat(GenRandomId())\n };\n },\n methods: {\n t\n }\n});\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n _vm._self._setupProxy;\n return _c(\"li\", { staticClass: \"nc-button-group-base\", attrs: { \"role\": _vm.isInSemanticMenu && \"presentation\" } }, [_vm.name ? _c(\"div\", { attrs: { \"id\": _vm.labelId } }, [_vm._v(\" \" + _vm._s(_vm.name) + \" \")]) : _vm._e(), _c(\"ul\", { staticClass: \"nc-button-group-content\", attrs: { \"role\": \"group\", \"aria-labelledby\": _vm.name ? _vm.labelId : void 0 } }, [_vm._t(\"default\")], 2)]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n null\n);\nconst NcActionButtonGroup = __component__.exports;\nexport {\n NcActionButtonGroup as N\n};\n","/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n * Portions Copyright (C) Philipp Kewisch */\nclass t{static fromString(e){return new t(e)}constructor(t){this.value=t}icaltype=\"binary\";decodeValue(){return this._b64_decode(this.value)}setEncodedValue(t){this.value=this._b64_encode(t)}_b64_encode(t){let e,i,r,n,s,a,o,l,h=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",u=0,c=0,d=\"\",m=[];if(!t)return t;do{e=t.charCodeAt(u++),i=t.charCodeAt(u++),r=t.charCodeAt(u++),l=e<<16|i<<8|r,n=l>>18&63,s=l>>12&63,a=l>>6&63,o=63&l,m[c++]=h.charAt(n)+h.charAt(s)+h.charAt(a)+h.charAt(o)}while(u>16&255,i=l>>8&255,r=255&l,m[c++]=64==a?String.fromCharCode(e):64==o?String.fromCharCode(e,i):String.fromCharCode(e,i,r)}while(ui)-(e12||(i=[0,31,28,31,30,31,30,31,31,30,31,30,31][t],2==t&&(i+=s.isLeapYear(e))),i}static isLeapYear(t){return t<=1752?t%4==0:t%4==0&&t%100!=0||t%400==0}static fromDayOfYear(t,e){let i=e,r=t,n=new s;n.auto_normalize=!1;let a=s.isLeapYear(i)?1:0;if(r<1)return i--,a=s.isLeapYear(i)?1:0,r+=s.daysInYearPassedMonth[a][12],s.fromDayOfYear(r,i);if(r>s.daysInYearPassedMonth[a][12])return a=s.isLeapYear(i)?1:0,r-=s.daysInYearPassedMonth[a][12],i++,s.fromDayOfYear(r,i);n.year=i,n.isDate=!0;for(let t=11;t>=0;t--)if(r>s.daysInYearPassedMonth[a][t]){n.month=t+1,n.day=r-s.daysInYearPassedMonth[a][t];break}return n.auto_normalize=!0,n}static fromStringv2(t){return new s({year:parseInt(t.slice(0,4),10),month:parseInt(t.slice(5,7),10),day:parseInt(t.slice(8,10),10),isDate:!0})}static fromDateString(t){return new s({year:p(t.slice(0,4)),month:p(t.slice(5,7)),day:p(t.slice(8,10)),isDate:!0})}static fromDateTimeString(t,e){if(t.length<19)throw new Error('invalid date-time value: \"'+t+'\"');let i,r;t[19]&&\"Z\"===t[19]?i=c.utcTimezone:e&&(r=e.getParameter(\"tzid\"),e.parent&&(\"standard\"===e.parent.name||\"daylight\"===e.parent.name?i=c.localTimezone:r&&(i=e.parent.getTimeZoneByID(r))));const n={year:p(t.slice(0,4)),month:p(t.slice(5,7)),day:p(t.slice(8,10)),hour:p(t.slice(11,13)),minute:p(t.slice(14,16)),second:p(t.slice(17,19))};return r&&!i&&(n.timezone=r),new s(n,i)}static fromString(t,e){return t.length>10?s.fromDateTimeString(t,e):s.fromDateString(t)}static fromJSDate(t,e){return(new s).fromJSDate(t,e)}static fromData=function(t,e){return(new s).fromData(t,e)};static now(){return s.fromJSDate(new Date,!1)}static weekOneStarts(t,e){let i=s.fromData({year:t,month:1,day:1,isDate:!0}),r=i.dayOfWeek(),n=e||s.DEFAULT_WEEK_START;return r>s.THURSDAY&&(i.day+=7),n>s.THURSDAY&&(i.day-=7),i.day-=r-n,i}static getDominicalLetter(t){let e=\"GFEDCBA\",i=(t+(t/4|0)+(t/400|0)-(t/100|0)-1)%7;return s.isLeapYear(t)?e[(i+6)%7]+e[i]:e[i]}static#t=null;static get epochTime(){return this.#t||(this.#t=s.fromData({year:1970,month:1,day:1,hour:0,minute:0,second:0,isDate:!1,timezone:\"Z\"})),this.#t}static _cmp_attr(t,e,i){return t[i]>e[i]?1:t[i]=0){o.day=1,0!=n&&n--,a=o.day;let e=t-o.dayOfWeek();e<0&&(e+=7),a+=e,a-=t,i=t}else{o.day=r,n++,i=o.dayOfWeek()-t,i<0&&(i+=7),i=r-i}return i+=7*n,a+i}isNthWeekDay(t,e){let i=this.dayOfWeek();return 0===e&&i===t||this.nthWeekDay(t,e)===this.day}weekNumber(t){let e,i=(this.year<<12)+(this.month<<8)+(this.day<<3)+t;if(i in s._wnCache)return s._wnCache[i];let r=this.clone();r.isDate=!0;let n=this.year;12==r.month&&r.day>25?(e=s.weekOneStarts(n+1,t),r.compare(e)<0?e=s.weekOneStarts(n,t):n++):(e=s.weekOneStarts(n,t),r.compare(e)<0&&(e=s.weekOneStarts(--n,t)));let a=A(r.subtractDate(e).toSeconds()/86400/7)+1;return s._wnCache[i]=a,a}addDuration(t){let e=t.isNegative?-1:1,i=this.second,r=this.minute,n=this.hour,s=this.day;i+=e*t.seconds,r+=e*t.minutes,n+=e*t.hours,s+=e*t.days,s+=7*e*t.weeks,this.second=i,this.minute=r,this.hour=n,this.day=s,this._cachedUnixTime=null}subtractDate(t){let e=this.toUnixTime()+this.utcOffset(),i=t.toUnixTime()+t.utcOffset();return r.fromSeconds(e-i)}subtractDateTz(t){let e=this.toUnixTime(),i=t.toUnixTime();return r.fromSeconds(e-i)}compare(t){let e=this.toUnixTime(),i=t.toUnixTime();return e>i?1:i>e?-1:0}compareDateOnlyTz(t,e){let i=this.convertToZone(e),r=t.convertToZone(e),n=0;return 0!=(n=s._cmp_attr(i,r,\"year\"))||0!=(n=s._cmp_attr(i,r,\"month\"))||(n=s._cmp_attr(i,r,\"day\")),n}convertToZone(t){let e=this.clone(),i=this.zone.tzid==t.tzid;return this.isDate||i||c.convert_time(e,this.zone,t),e.zone=t,e}utcOffset(){return this.zone==c.localTimezone||this.zone==c.utcTimezone?0:this.zone.utcOffset(this)}toICALString(){let t=this.toString();return t.length>10?ut.icalendar.value[\"date-time\"].toICAL(t):ut.icalendar.value.date.toICAL(t)}toString(){let t=this.year+\"-\"+Y(this.month)+\"-\"+Y(this.day);return this.isDate||(t+=\"T\"+Y(this.hour)+\":\"+Y(this.minute)+\":\"+Y(this.second),this.zone===c.utcTimezone&&(t+=\"Z\")),t}toJSDate(){return this.zone==c.localTimezone?this.isDate?new Date(this.year,this.month-1,this.day):new Date(this.year,this.month-1,this.day,this.hour,this.minute,this.second,0):new Date(1e3*this.toUnixTime())}_normalize(){return this._time.isDate&&(this._time.hour=0,this._time.minute=0,this._time.second=0),this.adjust(0,0,0,0),this}adjust(t,e,i,r,n){let a,o,l,h,u,c,d,m=0,f=0,p=n||this._time;if(p.isDate||(l=p.second+r,p.second=l%60,a=A(l/60),p.second<0&&(p.second+=60,a--),h=p.minute+i+a,p.minute=h%60,o=A(h/60),p.minute<0&&(p.minute+=60,o--),u=p.hour+e+o,p.hour=u%24,m=A(u/24),p.hour<0&&(p.hour+=24,m--)),p.month>12?f=A((p.month-1)/12):p.month<1&&(f=A(p.month/12)-1),p.year+=f,p.month-=12*f,c=p.day+t+m,c>0)for(;d=s.daysInMonth(p.month,p.year),!(c<=d);)p.month++,p.month>12&&(p.year++,p.month=1),c-=d;else for(;c<=0;)1==p.month?(p.year--,p.month=12):p.month--,c+=s.daysInMonth(p.month,p.year);return p.day=c,this._cachedUnixTime=null,this}fromUnixTime(t){this.zone=c.utcTimezone;let e=new Date(1e3*t);this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this._time.isDate?(this.hour=0,this.minute=0,this.second=0):(this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()),this._cachedUnixTime=null}toUnixTime(){if(null!==this._cachedUnixTime)return this._cachedUnixTime;let t=this.utcOffset(),e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second-t);return this._cachedUnixTime=e/1e3,this._cachedUnixTime}toJSON(){let t,e=[\"year\",\"month\",\"day\",\"hour\",\"minute\",\"second\",\"isDate\"],i=Object.create(null),r=0,n=e.length;for(;r1)throw new h(\"invalid ical body. component began but did not end\");return e=null,1==i.length?i[0]:i}l.property=function(t,e){let i={component:[[],[]],designSet:e||ut.defaultSet};return l._handleContentLine(t,i),i.component[1][0]},l.component=function(t){return l(t)};class h extends Error{constructor(t){super(t),this.name=this.constructor.name;try{throw new Error}catch(t){if(t.stack){let e=t.stack.split(\"\\n\");e.shift(),this.stack=e.join(\"\\n\")}}}}l.ParserError=h,l._handleContentLine=function(t,e){let i,r,n,s,a,o,u=t.indexOf(\":\"),c=t.indexOf(\";\"),d={};if(-1!==c&&-1!==u&&c>u&&(c=-1),-1!==c){if(n=t.slice(0,Math.max(0,c)).toLowerCase(),a=l._parseParameters(t.slice(Math.max(0,c)),0,e.designSet),-1==a[2])throw new h(\"Invalid parameters in '\"+t+\"'\");if(d=a[0],i=a[1].length+a[2]+c,-1===(r=t.slice(Math.max(0,i)).indexOf(\":\")))throw new h(\"Missing parameter value in '\"+t+\"'\");s=t.slice(Math.max(0,i+r+1))}else{if(-1===u)throw new h('invalid line (no token \";\" or \":\") \"'+t+'\"');if(n=t.slice(0,Math.max(0,u)).toLowerCase(),s=t.slice(Math.max(0,u+1)),\"begin\"===n){let t=[s.toLowerCase(),[],[]];return 1===e.stack.length?e.component.push(t):e.component[2].push(t),e.stack.push(e.component),e.component=t,void(e.designSet||(e.designSet=ut.getDesignSet(e.component[0])))}if(\"end\"===n)return void(e.component=e.stack.pop())}let m,f,p,y,_=!1,g=!1;e.designSet.propertyGroups&&-1!==n.indexOf(\".\")?(f=n.split(\".\"),d.group=f[0],p=f[1]):p=n,p in e.designSet.property&&(m=e.designSet.property[p],\"multiValue\"in m&&(_=m.multiValue),\"structuredValue\"in m&&(g=m.structuredValue),s&&\"detectType\"in m&&(o=m.detectType(s))),o||(o=\"value\"in d?d.value.toLowerCase():m?m.defaultType:\"unknown\"),delete d.value,_&&g?(s=l._parseMultiValue(s,g,o,[],_,e.designSet,g),y=[p,d,o,s]):_?(y=[p,d,o],l._parseMultiValue(s,_,o,y,null,e.designSet,!1)):g?(s=l._parseMultiValue(s,g,o,[],null,e.designSet,g),y=[p,d,o,s]):(s=l._parseValue(s,o,e.designSet,!1),y=[p,d,o,s]),\"vcard\"!==e.component[0]||0!==e.component[1].length||\"version\"===n&&\"4.0\"===s||(e.designSet=ut.getDesignSet(\"vcard3\")),e.component[1].push(y)},l._parseValue=function(t,e,i,r){return e in i.value&&\"fromICAL\"in i.value[e]?i.value[e].fromICAL(t,r):t},l._parseParameters=function(t,e,i){let r,n,s,a,o,u,c=e,d=0,m={},f=-1;for(;!1!==d&&-1!==(d=_(t,\"=\",d+1));){if(r=t.slice(c+1,d),0==r.length)throw new h(\"Empty parameter name in '\"+t+\"'\");if(n=r.toLowerCase(),u=!1,o=!1,a=n in i.param&&i.param[n].valueType?i.param[n].valueType:\"text\",n in i.param&&(o=i.param[n].multiValue,i.param[n].multiValueSeparateDQuote&&(u=l._rfc6868Escape('\"'+o+'\"'))),'\"'===t[d+1]){if(f=d+2,d=_(t,'\"',f),o&&-1!=d){let e=!0;for(;e;)t[d+1]==o&&'\"'==t[d+2]?d=_(t,'\"',d+3):e=!1}if(-1===d)throw new h('invalid line (no matching double quote) \"'+t+'\"');s=t.slice(f,d),c=_(t,\";\",d),-1===c&&(d=!1)}else{f=d+1;let e=_(t,\";\",f),i=_(t,\":\",f);-1!==i&&e>i?(e=i,d=!1):-1===e?(e=-1===i?t.length:i,d=!1):(c=e,d=e),s=t.slice(f,e)}if(s=l._rfc6868Escape(s),o){let t=u||o;s=l._parseMultiValue(s,t,a,[],null,i)}else s=l._parseValue(s,a,i);o&&n in m?Array.isArray(m[n])?m[n].push(s):m[n]=[m[n],s]:m[n]=s}return[m,s,f]},l._rfc6868Escape=function(t){return t.replace(/\\^['n^]/g,(function(t){return o[t]}))},l._parseMultiValue=function(t,e,i,r,n,s,a){let o,h=0,u=0;if(0===e.length)return t;for(;-1!==(h=_(t,e,u));)o=t.slice(u,h),o=n?l._parseMultiValue(o,n,i,[],null,s,a):l._parseValue(o,i,s,a),r.push(o),u=h+e.length;return o=t.slice(u),o=n?l._parseMultiValue(o,n,i,[],null,s,a):l._parseValue(o,i,s,a),r.push(o),1==r.length?r[0]:r},l._eachLine=function(t,e){let i,r,n,s=t.length,o=t.search(a),l=o;do{l=t.indexOf(\"\\n\",o)+1,n=l>1&&\"\\r\"===t[l-2]?2:1,0===l&&(l=s,n=0),r=t[o],\" \"===r||\"\\t\"===r?i+=t.slice(o+1,l-n):(i&&e(null,i),i=t.slice(o,l-n)),o=l}while(l!==s);i=i.trim(),i.length&&e(null,i)};const u=[\"tzid\",\"location\",\"tznames\",\"latitude\",\"longitude\"];class c{static _compare_change_fn(t,e){return t.yeare.year?1:t.monthe.month?1:t.daye.day?1:t.houre.hour?1:t.minutee.minute?1:t.seconde.second?1:0}static convert_time(t,e,i){if(t.isDate||e.tzid==i.tzid||e==c.localTimezone||i==c.localTimezone)return t.zone=i,t;let r=e.utcOffset(t);return t.adjust(0,0,0,-r),r=i.utcOffset(t),t.adjust(0,0,0,r),null}static fromData(t){return(new c).fromData(t)}static#e=null;static get utcTimezone(){return this.#e||(this.#e=c.fromData({tzid:\"UTC\"})),this.#e}static#i=null;static get localTimezone(){return this.#i||(this.#i=c.fromData({tzid:\"floating\"})),this.#i}static adjust_change(t,e,i,r,n){return s.prototype.adjust.call(t,e,i,r,n,t)}static _minimumExpansionYear=-1;static EXTRA_COVERAGE=5;constructor(t){this.wrappedJSObject=this,this.fromData(t)}tzid=\"\";location=\"\";tznames=\"\";latitude=0;longitude=0;component=null;expandedUntilYear=0;icalclass=\"icaltimezone\";fromData(t){if(this.expandedUntilYear=0,this.changes=[],t instanceof yt)this.component=t;else{if(t&&\"component\"in t)if(\"string\"==typeof t.component){let e=l(t.component);this.component=new yt(e)}else t.component instanceof yt?this.component=t.component:this.component=null;for(let e of u)t&&e in t&&(this[e]=t[e])}return this.component instanceof yt&&!this.tzid&&(this.tzid=this.component.getFirstPropertyValue(\"tzid\")),this}utcOffset(t){if(this==c.utcTimezone||this==c.localTimezone)return 0;if(this._ensureCoverage(t.year),!this.changes.length)return 0;let e={year:t.year,month:t.month,day:t.day,hour:t.hour,minute:t.minute,second:t.second},i=this._findNearbyChange(e),r=-1,n=1;for(;;){let t=D(this.changes[i],!0);if(t.utcOffset=0?r=i:n=-1,-1==n&&-1!=r)break;if(i+=n,i<0)return 0;if(i>=this.changes.length)break}let s=this.changes[r];if(s.utcOffset-s.prevUtcOffset<0&&r>0){let t=D(s,!0);if(c.adjust_change(t,0,0,0,t.prevUtcOffset),c._compare_change_fn(e,t)<0){let t=this.changes[r-1],e=!1;s.is_daylight!=e&&t.is_daylight==e&&(s=t)}}return s.utcOffset}_findNearbyChange(t){let e=g(this.changes,t,c._compare_change_fn);return e>=this.changes.length?this.changes.length-1:e}_ensureCoverage(t){if(-1==c._minimumExpansionYear){let t=s.now();c._minimumExpansionYear=t.year}let e=t;if(ee)&&t);)r.year=t.year,r.month=t.month,r.day=t.day,r.hour=t.hour,r.minute=t.minute,r.second=t.second,r.isDate=t.isDate,c.adjust_change(r,0,0,0,-r.prevUtcOffset),i.push(r)}}else r=a(),r.year=n.year,r.month=n.month,r.day=n.day,r.hour=n.hour,r.minute=n.minute,r.second=n.second,c.adjust_change(r,0,0,0,-r.prevUtcOffset),i.push(r);return i}toString(){return this.tznames?this.tznames:this.tzid}}let d=null;const m={get count(){return null===d?0:Object.keys(d).length},reset:function(){d=Object.create(null);let t=c.utcTimezone;d.Z=t,d.UTC=t,d.GMT=t},has:function(t){return null!==d&&!!d[t]},get:function(t){return null===d&&this.reset(),d[t]},register:function(t,e){if(null===d&&this.reset(),t instanceof yt&&\"vtimezone\"===t.name&&(t=(e=new c(t)).tzid),!(e instanceof c))throw new TypeError(\"timezone must be ICAL.Timezone or ICAL.Component\");d[t]=e},remove:function(t){return null===d?null:delete d[t]}};function f(t){return\"number\"==typeof t&&isNaN(t)}function p(t){let e=parseInt(t,10);if(f(e))throw new Error('Could not extract integer from \"'+t+'\"');return e}function y(t,e){if(void 0!==t)return t instanceof e?t:new e(t)}function _(t,e,i){for(;-1!==(i=t.indexOf(e,i));){if(!(i>0&&\"\\\\\"===t[i-1]))return i;i+=1}return-1}function g(t,e,i){if(!t.length)return 0;let r,n,s=0,a=t.length-1;for(;s<=a;)if(r=s+Math.floor((a-s)/2),n=i(e,t[r]),n<0)a=r-1;else{if(!(n>0))break;s=r+1}return n<0?r:n>0?r+1:r}function D(t,e){if(t&&\"object\"==typeof t){if(t instanceof Date)return new Date(t.getTime());if(\"clone\"in t)return t.clone();if(Array.isArray(t)){let i=[];for(let r=0;r65535?2:1:(e+=Tt.newLineChar+\" \"+i.slice(0,Math.max(0,r)),i=i.slice(Math.max(0,r)),r=n=0)}return e.slice(Tt.newLineChar.length+1)}function Y(t){switch(\"string\"!=typeof t&&(\"number\"==typeof t&&(t=parseInt(t)),t=String(t)),t.length){case 0:return\"00\";case 1:return\"0\"+t;default:return t}}function A(t){return t<0?Math.ceil(t):Math.floor(t)}function O(t,e){for(let i in t){let r=Object.getOwnPropertyDescriptor(t,i);r&&!Object.getOwnPropertyDescriptor(e,i)&&Object.defineProperty(e,i,r)}return e}var b=Object.freeze({__proto__:null,updateTimezones:function(t){let e,i,r,n,s;if(!t||\"vcalendar\"!==t.name)return t;for(e=t.getAllSubcomponents(),i=[],r={},s=0;si)-(i>e)}_normalize(){let t=this.toSeconds(),e=this.factor;for(;t<-43200;)t+=97200;for(;t>50400;)t-=97200;this.fromSeconds(t),0==t&&(this.factor=e)}toICALString(){return ut.icalendar.value[\"utc-offset\"].toICAL(this.toString())}toString(){return(1==this.factor?\"+\":\"-\")+Y(this.hours)+\":\"+Y(this.minutes)}}class E extends s{static fromDateAndOrTimeString(t,e){function i(t,e,i){return t?p(t.slice(e,e+i)):null}let r=t.split(\"T\"),n=r[0],s=r[1],a=s?ut.vcard.value.time._splitZone(s):[],o=a[0],l=a[1],h=n?n.length:0,u=l?l.length:0,d=n&&\"-\"==n[0]&&\"-\"==n[1],m=l&&\"-\"==l[0],f={year:d?null:i(n,0,4),month:!d||4!=h&&7!=h?7==h||10==h?i(n,5,2):null:i(n,2,2),day:5==h?i(n,3,2):7==h&&d?i(n,5,2):10==h?i(n,8,2):null,hour:m?null:i(l,0,2),minute:m&&3==u?i(l,1,2):u>4?i(l,m?1:3,2):null,second:4==u?i(l,2,2):6==u?i(l,4,2):8==u?i(l,6,2):null};return o=\"Z\"==o?c.utcTimezone:o&&\":\"==o[3]?S.fromString(o):null,new E(f,o,e)}constructor(t,e,i){super(t,e),this.icaltype=i||\"date-and-or-time\"}icalclass=\"vcardtime\";icaltype=\"date-and-or-time\";clone(){return new E(this._time,this.zone,this.icaltype)}_normalize(){return this}utcOffset(){return this.zone instanceof S?this.zone.toSeconds():s.prototype.utcOffset.apply(this,arguments)}toICALString(){return ut.vcard.value[this.icaltype].toICAL(this.toString())}toString(){let t,e=this.year,i=this.month,r=this.day,n=this.hour,s=this.minute,a=this.second,o=null!==i,l=null!==r,h=null!==n,u=null!==s,d=null!==a,m=(null!==e?Y(e)+(o||l?\"-\":\"\"):o||l?\"--\":\"\")+(o?Y(i):\"\")+(l?\"-\"+Y(r):\"\"),f=(h?Y(n):\"-\")+(h&&u?\":\":\"\")+(u?Y(s):\"\")+(h||u?\"\":\"-\")+(u&&d?\":\":\"\")+(d?Y(a):\"\");if(this.zone===c.utcTimezone)t=\"Z\";else if(this.zone instanceof S)t=this.zone.toString();else if(this.zone===c.localTimezone)t=\"\";else if(this.zone instanceof c){t=S.fromSeconds(this.zone.utcOffset(this)).toString()}else t=\"\";switch(this.icaltype){case\"time\":return f+t;case\"date-and-or-time\":case\"date-time\":return m+(\"--\"==f?\"\":\"T\"+f+t);case\"date\":return m}return null}}class C{static _indexMap={BYSECOND:0,BYMINUTE:1,BYHOUR:2,BYDAY:3,BYMONTHDAY:4,BYYEARDAY:5,BYWEEKNO:6,BYMONTH:7,BYSETPOS:8};static _expandMap={SECONDLY:[1,1,1,1,1,1,1,1],MINUTELY:[2,1,1,1,1,1,1,1],HOURLY:[2,2,1,1,1,1,1,1],DAILY:[2,2,2,1,1,1,1,1],WEEKLY:[2,2,2,2,3,3,1,1],MONTHLY:[2,2,2,2,2,3,3,1],YEARLY:[2,2,2,2,2,2,2,2]};static UNKNOWN=0;static CONTRACT=1;static EXPAND=2;static ILLEGAL=3;constructor(t){this.fromData(t)}completed=!1;rule=null;dtstart=null;last=null;occurrence_number=0;by_indices=null;initialized=!1;by_data=null;days=null;days_index=0;fromData(t){if(this.rule=y(t.rule,B),!this.rule)throw new Error(\"iterator requires a (ICAL.Recur) rule\");if(this.dtstart=y(t.dtstart,s),!this.dtstart)throw new Error(\"iterator requires a (ICAL.Time) dtstart\");t.by_data?this.by_data=t.by_data:this.by_data=D(this.rule.parts,!0),t.occurrence_number&&(this.occurrence_number=t.occurrence_number),this.days=t.days||[],t.last&&(this.last=y(t.last,s)),this.by_indices=t.by_indices,this.by_indices||(this.by_indices={BYSECOND:0,BYMINUTE:0,BYHOUR:0,BYDAY:0,BYMONTH:0,BYWEEKNO:0,BYMONTHDAY:0}),this.initialized=t.initialized||!1,this.initialized||this.init()}init(){this.initialized=!0,this.last=this.dtstart.clone();let t=this.by_data;if(\"BYDAY\"in t&&this.sort_byday_rules(t.BYDAY),\"BYYEARDAY\"in t&&(\"BYMONTH\"in t||\"BYWEEKNO\"in t||\"BYMONTHDAY\"in t||\"BYDAY\"in t))throw new Error(\"Invalid BYYEARDAY rule\");if(\"BYWEEKNO\"in t&&\"BYMONTHDAY\"in t)throw new Error(\"BYWEEKNO does not fit to BYMONTHDAY\");if(\"MONTHLY\"==this.rule.freq&&(\"BYYEARDAY\"in t||\"BYWEEKNO\"in t))throw new Error(\"For MONTHLY recurrences neither BYYEARDAY nor BYWEEKNO may appear\");if(\"WEEKLY\"==this.rule.freq&&(\"BYYEARDAY\"in t||\"BYMONTHDAY\"in t))throw new Error(\"For WEEKLY recurrences neither BYMONTHDAY nor BYYEARDAY may appear\");if(\"YEARLY\"!=this.rule.freq&&\"BYYEARDAY\"in t)throw new Error(\"BYYEARDAY may only appear in YEARLY rules\");this.last.second=this.setup_defaults(\"BYSECOND\",\"SECONDLY\",this.dtstart.second),this.last.minute=this.setup_defaults(\"BYMINUTE\",\"MINUTELY\",this.dtstart.minute),this.last.hour=this.setup_defaults(\"BYHOUR\",\"HOURLY\",this.dtstart.hour);let e=this.last.day=this.setup_defaults(\"BYMONTHDAY\",\"DAILY\",this.dtstart.day);if(this.last.month=this.setup_defaults(\"BYMONTH\",\"MONTHLY\",this.dtstart.month),\"WEEKLY\"==this.rule.freq)if(\"BYDAY\"in t){let[,e]=this.ruleDayOfWeek(t.BYDAY[0],this.rule.wkst),i=e-this.last.dayOfWeek(this.rule.wkst);(this.last.dayOfWeek(this.rule.wkst)=0||i<0)&&(this.last.day+=i)}else{let e=B.numericDayToIcalDay(this.dtstart.dayOfWeek());t.BYDAY=[e]}if(\"YEARLY\"==this.rule.freq){for(;this.expand_year_days(this.last.year),!(this.days.length>0);)this.increment_year(this.rule.interval);this._nextByYearDay()}if(\"MONTHLY\"==this.rule.freq&&this.has_by_data(\"BYDAY\")){let t=null,e=this.last.clone(),i=s.daysInMonth(this.last.month,this.last.year);for(let r of this.by_data.BYDAY){this.last=e.clone();let[n,a]=this.ruleDayOfWeek(r),o=this.last.nthWeekDay(a,n);if(n>=6||n<=-6)throw new Error(\"Malformed values in BYDAY part\");if(o>i||o<=0){if(t&&t.month==e.month)continue;for(;o>i||o<=0;)this.increment_month(),i=s.daysInMonth(this.last.month,this.last.year),o=this.last.nthWeekDay(a,n)}this.last.day=o,(!t||this.last.compare(t)<0)&&(t=this.last.clone())}if(this.last=t.clone(),this.has_by_data(\"BYMONTHDAY\")&&this._byDayAndMonthDay(!0),this.last.day>i||0==this.last.day)throw new Error(\"Malformed values in BYDAY part\")}else if(this.has_by_data(\"BYMONTHDAY\")){this.last.day=1;let t=s.daysInMonth(this.last.month,this.last.year);if(e<0)this.last.day=t+e+1;else if(this.by_data.BYMONTHDAY[0]>t){if(!this.next_month()&&!this.next_month()&&!this.next_month())throw new Error(\"No possible occurrences\")}else this.last.day=e}}next(){let t,e=this.last?this.last.clone():null;if(this.rule.count&&this.occurrence_number>=this.rule.count||this.rule.until&&this.last.compare(this.rule.until)>0)return this.completed=!0,null;if(0==this.occurrence_number&&this.last.compare(this.dtstart)>=0)return this.occurrence_number++,this.last;do{switch(t=1,this.rule.freq){case\"SECONDLY\":this.next_second();break;case\"MINUTELY\":this.next_minute();break;case\"HOURLY\":this.next_hour();break;case\"DAILY\":this.next_day();break;case\"WEEKLY\":this.next_week();break;case\"MONTHLY\":t=this.next_month();break;case\"YEARLY\":this.next_year();break;default:return null}}while(!this.check_contracting_rules()||this.last.compare(this.dtstart)<0||!t);if(0==this.last.compare(e))throw new Error(\"Same occurrence found twice, protecting you from death by recursion\");return this.rule.until&&this.last.compare(this.rule.until)>0?(this.completed=!0,null):(this.occurrence_number++,this.last)}next_second(){return this.next_generic(\"BYSECOND\",\"SECONDLY\",\"second\",\"minute\")}increment_second(t){return this.increment_generic(t,\"second\",60,\"minute\")}next_minute(){return this.next_generic(\"BYMINUTE\",\"MINUTELY\",\"minute\",\"hour\",\"next_second\")}increment_minute(t){return this.increment_generic(t,\"minute\",60,\"hour\")}next_hour(){return this.next_generic(\"BYHOUR\",\"HOURLY\",\"hour\",\"monthday\",\"next_minute\")}increment_hour(t){this.increment_generic(t,\"hour\",24,\"monthday\")}next_day(){let t=\"DAILY\"==this.rule.freq;return 0==this.next_hour()||(t?this.increment_monthday(this.rule.interval):this.increment_monthday(1)),0}next_week(){let t=0;if(0==this.next_weekday_by_week())return t;if(this.has_by_data(\"BYWEEKNO\")){this.by_indices.BYWEEKNO++,this.by_indices.BYWEEKNO==this.by_data.BYWEEKNO.length&&(this.by_indices.BYWEEKNO=0,t=1),this.last.month=1,this.last.day=1;let e=this.by_data.BYWEEKNO[this.by_indices.BYWEEKNO];this.last.day+=7*e,t&&this.increment_year(1)}else this.increment_monthday(7*this.rule.interval);return t}normalizeByMonthDayRules(t,e,i){let r,n=s.daysInMonth(e,t),a=[],o=0,l=i.length;for(;on)){if(r<0)r=n+(r+1);else if(0===r)continue;-1===a.indexOf(r)&&a.push(r)}return a.sort((function(t,e){return t-e}))}_byDayAndMonthDay(t){let e,i,r,n,a=this.by_data.BYDAY,o=0,l=a.length,h=0,u=this,c=this.last.day;function d(){for(n=s.daysInMonth(u.last.month,u.last.year),e=u.normalizeByMonthDayRules(u.last.year,u.last.month,u.by_data.BYMONTHDAY),r=e.length;e[o]<=c&&(!t||e[o]!=c)&&on){m();continue}let t=e[o++];if(t>=i){c=t;for(let t=0;ti&&(this.last.day=1,this.increment_month(),this.is_day_in_byday(this.last)?this.has_by_data(\"BYSETPOS\")&&!this.check_set_position(1)||(t=1):t=0)}else if(this.has_by_data(\"BYMONTHDAY\")){this.by_indices.BYMONTHDAY++,this.by_indices.BYMONTHDAY>=this.by_data.BYMONTHDAY.length&&(this.by_indices.BYMONTHDAY=0,this.increment_month());let e=s.daysInMonth(this.last.month,this.last.year),i=this.by_data.BYMONTHDAY[this.by_indices.BYMONTHDAY];i<0&&(i=e+i+1),i>e?(this.last.day=1,t=this.is_day_in_byday(this.last)):this.last.day=i}else{this.increment_month();let e=s.daysInMonth(this.last.month,this.last.year);this.by_data.BYMONTHDAY[0]>e?t=0:this.last.day=this.by_data.BYMONTHDAY[0]}return t}next_weekday_by_week(){let t=0;if(0==this.next_hour())return t;if(!this.has_by_data(\"BYDAY\"))return 1;for(;;){let e=new s;this.by_indices.BYDAY++,this.by_indices.BYDAY==Object.keys(this.by_data.BYDAY).length&&(this.by_indices.BYDAY=0,t=1);let i=this.by_data.BYDAY[this.by_indices.BYDAY],r=this.ruleDayOfWeek(i)[1];r-=this.rule.wkst,r<0&&(r+=7),e.year=this.last.year,e.month=this.last.month,e.day=this.last.day;let n=e.startDoyWeek(this.rule.wkst);if(r+n<1&&!t)continue;let a=s.fromDayOfYear(n+r,this.last.year);return this.last.year=a.year,this.last.month=a.month,this.last.day=a.day,t}}next_year(){if(0==this.next_hour())return 0;if(++this.days_index==this.days.length){this.days_index=0;do{this.increment_year(this.rule.interval),this.expand_year_days(this.last.year)}while(0==this.days.length)}return this._nextByYearDay(),1}_nextByYearDay(){let t=this.days[this.days_index],e=this.last.year;t<1&&(t+=1,e+=1);let i=s.fromDayOfYear(t,e);this.last.day=i.day,this.last.month=i.month}ruleDayOfWeek(t,e){let i=t.match(/([+-]?[0-9])?(MO|TU|WE|TH|FR|SA|SU)/);if(i){return[parseInt(i[1]||0,10),t=B.icalDayToNumericDay(i[2],e)]}return[0,0]}next_generic(t,e,i,r,n){let s=t in this.by_data,a=this.rule.freq==e,o=0;if(n&&0==this[n]())return o;if(s){this.by_indices[t]++;let e=this.by_data[t];this.by_indices[t]==e.length&&(this.by_indices[t]=0,o=1),this.last[i]=e[this.by_indices[t]]}else a&&this[\"increment_\"+i](this.rule.interval);return s&&o&&a&&this[\"increment_\"+r](1),o}increment_monthday(t){for(let e=0;et&&(this.last.day-=t,this.increment_month())}}increment_month(){if(this.last.day=1,this.has_by_data(\"BYMONTH\"))this.by_indices.BYMONTH++,this.by_indices.BYMONTH==this.by_data.BYMONTH.length&&(this.by_indices.BYMONTH=0,this.increment_year(1)),this.last.month=this.by_data.BYMONTH[this.by_indices.BYMONTH];else{\"MONTHLY\"==this.rule.freq?this.last.month+=this.rule.interval:this.last.month++,this.last.month--;let t=A(this.last.month/12);this.last.month%=12,this.last.month++,0!=t&&this.increment_year(t)}}increment_year(t){this.last.year+=t}increment_generic(t,e,i,r){this.last[e]+=t;let n=A(this.last[e]/i);this.last[e]%=i,0!=n&&this[\"increment_\"+r](n)}has_by_data(t){return t in this.rule.parts}expand_year_days(t){let e=new s;this.days=[];let i={},r=[\"BYDAY\",\"BYWEEKNO\",\"BYMONTHDAY\",\"BYMONTH\",\"BYYEARDAY\"];for(let t of r)t in this.rule.parts&&(i[t]=this.rule.parts[t]);if(\"BYMONTH\"in i&&\"BYWEEKNO\"in i){let r=1,n={};e.year=t,e.isDate=!0;for(let i=0;i0?(e=h+7*(s-1),e<=r&&this.days.push(a+e)):(e=u+7*(s+1),e>0&&this.days.push(a+e))}}this.days.sort((function(t,e){return t-e}))}else if(2==n&&\"BYDAY\"in i&&\"BYMONTHDAY\"in i){let e=this.expand_by_day(t);for(let i of e){let e=s.fromDayOfYear(i,t);this.by_data.BYMONTHDAY.indexOf(e.day)>=0&&this.days.push(i)}}else if(3==n&&\"BYDAY\"in i&&\"BYMONTHDAY\"in i&&\"BYMONTH\"in i){let e=this.expand_by_day(t);for(let i of e){let e=s.fromDayOfYear(i,t);this.by_data.BYMONTH.indexOf(e.month)>=0&&this.by_data.BYMONTHDAY.indexOf(e.day)>=0&&this.days.push(i)}}else if(2==n&&\"BYDAY\"in i&&\"BYWEEKNO\"in i){let e=this.expand_by_day(t);for(let i of e){let e=s.fromDayOfYear(i,t).weekNumber(this.rule.wkst);this.by_data.BYWEEKNO.indexOf(e)&&this.days.push(i)}}else 3==n&&\"BYDAY\"in i&&\"BYWEEKNO\"in i&&\"BYMONTHDAY\"in i||(this.days=1==n&&\"BYYEARDAY\"in i?this.days.concat(this.by_data.BYYEARDAY):[]);return 0}expand_by_day(t){let e=[],i=this.last.clone();i.year=t,i.month=1,i.day=1,i.isDate=!0;let r=i.dayOfWeek();i.month=12,i.day=31,i.isDate=!0;let n=i.dayOfWeek(),s=i.dayOfYear();for(let t of this.by_data.BYDAY){let i=this.ruleDayOfWeek(t),a=i[0],o=i[1];if(0==a){for(let t=(o+7-r)%7+1;t<=s;t+=7)e.push(t)}else if(a>0){let t;t=o>=r?o-r+1:o-r+8,e.push(t+7*(a-1))}else{let t;a=-a,t=o<=n?s-n+o:s-n+o-7,e.push(t-7*(a-1))}}return e}is_day_in_byday(t){if(this.by_data.BYDAY)for(let e of this.by_data.BYDAY){let i=this.ruleDayOfWeek(e),r=i[0],n=i[1],s=t.dayOfWeek();if(0==r&&n==s||t.nthWeekDay(n,r)==t.day)return 1}return 0}check_set_position(t){if(this.has_by_data(\"BYSETPOS\")){return-1!==this.by_data.BYSETPOS.indexOf(t)}return!1}sort_byday_rules(t){for(let e=0;ethis.ruleDayOfWeek(t[e],this.rule.wkst)[1]){let r=t[e];t[e]=t[i],t[i]=r}}}check_contract_restriction(t,e){let i=C._indexMap[t],r=C._expandMap[this.rule.freq][i],n=!1;if(t in this.by_data&&r==C.CONTRACT){let i=this.by_data[t];for(let t of i)if(t==e){n=!0;break}}else n=!0;return n}check_contracting_rules(){let t=this.last.dayOfWeek(),e=this.last.weekNumber(this.rule.wkst),i=this.last.dayOfYear();return this.check_contract_restriction(\"BYSECOND\",this.last.second)&&this.check_contract_restriction(\"BYMINUTE\",this.last.minute)&&this.check_contract_restriction(\"BYHOUR\",this.last.hour)&&this.check_contract_restriction(\"BYDAY\",B.numericDayToIcalDay(t))&&this.check_contract_restriction(\"BYWEEKNO\",e)&&this.check_contract_restriction(\"BYMONTHDAY\",this.last.day)&&this.check_contract_restriction(\"BYMONTH\",this.last.month)&&this.check_contract_restriction(\"BYYEARDAY\",i)}setup_defaults(t,e,i){let r=C._indexMap[t];return C._expandMap[this.rule.freq][r]!=C.CONTRACT&&(t in this.by_data||(this.by_data[t]=[i]),this.rule.freq!=e)?this.by_data[t][0]:i}toJSON(){let t=Object.create(null);return t.initialized=this.initialized,t.rule=this.rule.toJSON(),t.dtstart=this.dtstart.toJSON(),t.by_data=this.by_data,t.days=this.days,t.last=this.last.toJSON(),t.by_indices=this.by_indices,t.occurrence_number=this.occurrence_number,t}}const w=/^(SU|MO|TU|WE|TH|FR|SA)$/,x=/^([+-])?(5[0-3]|[1-4][0-9]|[1-9])?(SU|MO|TU|WE|TH|FR|SA)$/,v={SU:s.SUNDAY,MO:s.MONDAY,TU:s.TUESDAY,WE:s.WEDNESDAY,TH:s.THURSDAY,FR:s.FRIDAY,SA:s.SATURDAY},N=Object.fromEntries(Object.entries(v).map((t=>t.reverse()))),I=[\"SECONDLY\",\"MINUTELY\",\"HOURLY\",\"DAILY\",\"WEEKLY\",\"MONTHLY\",\"YEARLY\"];class B{static fromString(t){let e=this._stringToData(t,!1);return new B(e)}static fromData(t){return new B(t)}static _stringToData(t,e){let i=Object.create(null),r=t.split(\";\"),n=r.length;for(let t=0;t7&&(i-=7),N[i]}constructor(t){this.wrappedJSObject=this,this.parts={},t&&\"object\"==typeof t&&this.fromData(t)}parts=null;interval=1;wkst=s.MONDAY;until=null;count=null;freq=null;icalclass=\"icalrecur\";icaltype=\"recur\";iterator(t){return new C({rule:this,dtstart:t})}clone(){return new B(this.toJSON())}isFinite(){return!(!this.count&&!this.until)}isByCount(){return!(!this.count||this.until)}addComponent(t,e){let i=t.toUpperCase();i in this.parts?this.parts[i].push(e):this.parts[i]=[e]}setComponent(t,e){this.parts[t.toUpperCase()]=e.slice()}getComponent(t){let e=t.toUpperCase();return e in this.parts?this.parts[e].slice():[]}getNextOccurrence(t,e){let i,r=this.iterator(t);do{i=r.next()}while(i&&i.compare(e)<=0);return i&&e.zone&&(i.zone=e.zone),i}fromData(t){for(let e in t){let i=e.toUpperCase();i in L?Array.isArray(t[e])?this.parts[i]=t[e]:this.parts[i]=[t[e]]:this[e]=t[e]}this.interval&&\"number\"!=typeof this.interval&&M.INTERVAL(this.interval,this),this.wkst&&\"number\"!=typeof this.wkst&&(this.wkst=B.icalDayToNumericDay(this.wkst)),!this.until||this.until instanceof s||(this.until=s.fromString(this.until))}toJSON(){let t=Object.create(null);t.freq=this.freq,this.count&&(t.count=this.count),this.interval>1&&(t.interval=this.interval);for(let[e,i]of Object.entries(this.parts))Array.isArray(i)&&1==i.length?t[e.toLowerCase()]=i[0]:t[e.toLowerCase()]=D(i);return this.until&&(t.until=this.until.toString()),\"wkst\"in this&&this.wkst!==s.DEFAULT_WEEK_START&&(t.wkst=B.numericDayToIcalDay(this.wkst)),t}toString(){let t=\"FREQ=\"+this.freq;this.count&&(t+=\";COUNT=\"+this.count),this.interval>1&&(t+=\";INTERVAL=\"+this.interval);for(let[e,i]of Object.entries(this.parts))t+=\";\"+e+\"=\"+i;return this.until&&(t+=\";UNTIL=\"+this.until.toICALString()),\"wkst\"in this&&this.wkst!==s.DEFAULT_WEEK_START&&(t+=\";WKST=\"+B.numericDayToIcalDay(this.wkst)),t}}function z(t,e,i,r){let n=r;if(\"+\"===r[0]&&(n=r.slice(1)),n=p(n),void 0!==e&&r '+e);if(void 0!==i&&r>i)throw new Error(t+': invalid value \"'+r+'\" must be < '+e);return n}const M={FREQ:function(t,e,i){if(-1===I.indexOf(t))throw new Error('invalid frequency \"'+t+'\" expected: \"'+I.join(\", \")+'\"');e.freq=t},COUNT:function(t,e,i){e.count=p(t)},INTERVAL:function(t,e,i){e.interval=p(t),e.interval<1&&(e.interval=1)},UNTIL:function(t,e,i){t.length>10?e.until=ut.icalendar.value[\"date-time\"].fromICAL(t):e.until=ut.icalendar.value.date.fromICAL(t),i||(e.until=s.fromString(e.until))},WKST:function(t,e,i){if(!w.test(t))throw new Error('invalid WKST value \"'+t+'\"');e.wkst=B.icalDayToNumericDay(t)}},L={BYSECOND:z.bind(void 0,\"BYSECOND\",0,60),BYMINUTE:z.bind(void 0,\"BYMINUTE\",0,59),BYHOUR:z.bind(void 0,\"BYHOUR\",0,23),BYDAY:function(t){if(x.test(t))return t;throw new Error('invalid BYDAY value \"'+t+'\"')},BYMONTHDAY:z.bind(void 0,\"BYMONTHDAY\",-31,31),BYYEARDAY:z.bind(void 0,\"BYYEARDAY\",-366,366),BYWEEKNO:z.bind(void 0,\"BYWEEKNO\",-53,53),BYMONTH:z.bind(void 0,\"BYMONTH\",1,12),BYSETPOS:z.bind(void 0,\"BYSETPOS\",-366,366)};class k{static fromString(t,e){let i=t.split(\"/\");if(2!==i.length)throw new Error('Invalid string value: \"'+t+'\" must contain a \"/\" char.');let n={start:s.fromDateTimeString(i[0],e)},a=i[1];return r.isValueString(a)?n.duration=r.fromString(a):n.end=s.fromDateTimeString(a,e),new k(n)}static fromData(t){return new k(t)}static fromJSON(t,e,i){function n(t,e){return i?s.fromString(t,e):s.fromDateTimeString(t,e)}return r.isValueString(t[1])?k.fromData({start:n(t[0],e),duration:r.fromString(t[1])}):k.fromData({start:n(t[0],e),end:n(t[1],e)})}constructor(t){if(this.wrappedJSObject=this,t&&\"start\"in t){if(t.start&&!(t.start instanceof s))throw new TypeError(\".start must be an instance of ICAL.Time\");this.start=t.start}if(t&&t.end&&t.duration)throw new Error(\"cannot accept both end and duration\");if(t&&\"end\"in t){if(t.end&&!(t.end instanceof s))throw new TypeError(\".end must be an instance of ICAL.Time\");this.end=t.end}if(t&&\"duration\"in t){if(t.duration&&!(t.duration instanceof r))throw new TypeError(\".duration must be an instance of ICAL.Duration\");this.duration=t.duration}}start=null;end=null;duration=null;icalclass=\"icalperiod\";icaltype=\"period\";clone(){return k.fromData({start:this.start?this.start.clone():null,end:this.end?this.end.clone():null,duration:this.duration?this.duration.clone():null})}getDuration(){return this.duration?this.duration:this.end.subtractDate(this.start)}getEnd(){if(this.end)return this.end;{let t=this.start.clone();return t.addDuration(this.duration),t}}toString(){return this.start+\"/\"+(this.end||this.duration)}toJSON(){return[this.start.toString(),(this.end||this.duration).toString()]}toICALString(){return this.start.toICALString()+\"/\"+(this.end||this.duration).toICALString()}}const P=/\\\\\\\\|\\\\,|\\\\[Nn]/g,U=/\\\\|,|\\n/g;function j(t,e){return{matches:/.*/,fromICAL:function(e,i){return function(t,e,i){if(-1===t.indexOf(\"\\\\\"))return t;i&&(e=new RegExp(e.source+\"|\\\\\\\\\"+i,e.flags));return t.replace(e,X)}(e,t,i)},toICAL:function(t,i){let r=e;return i&&(r=new RegExp(r.source+\"|\"+i,r.flags)),t.replace(r,(function(t){switch(t){case\"\\\\\":return\"\\\\\\\\\";case\";\":return\"\\\\;\";case\",\":return\"\\\\,\";case\"\\n\":return\"\\\\n\";default:return t}}))}}}const V={defaultType:\"text\"},H={defaultType:\"text\",multiValue:\",\"},R={defaultType:\"text\",structuredValue:\";\"},W={defaultType:\"integer\"},F={defaultType:\"date-time\",allowedTypes:[\"date-time\",\"date\"]},K={defaultType:\"date-time\"},q={defaultType:\"uri\"},J={defaultType:\"utc-offset\"},Z={defaultType:\"recur\"},G={defaultType:\"date-and-or-time\",allowedTypes:[\"date-time\",\"date\",\"text\"]};function X(t){switch(t){case\"\\\\\\\\\":return\"\\\\\";case\"\\\\;\":return\";\";case\"\\\\,\":return\",\";case\"\\\\n\":case\"\\\\N\":return\"\\n\";default:return t}}let Q={categories:H,url:q,version:V,uid:V},$={boolean:{values:[\"TRUE\",\"FALSE\"],fromICAL:function(t){return\"TRUE\"===t},toICAL:function(t){return t?\"TRUE\":\"FALSE\"}},float:{matches:/^[+-]?\\d+\\.\\d+$/,fromICAL:function(t){let e=parseFloat(t);return f(e)?0:e},toICAL:function(t){return String(t)}},integer:{fromICAL:function(t){let e=parseInt(t);return f(e)?0:e},toICAL:function(t){return String(t)}},\"utc-offset\":{toICAL:function(t){return t.length<7?t.slice(0,3)+t.slice(4,6):t.slice(0,3)+t.slice(4,6)+t.slice(7,9)},fromICAL:function(t){return t.length<6?t.slice(0,3)+\":\"+t.slice(3,5):t.slice(0,3)+\":\"+t.slice(3,5)+\":\"+t.slice(5,7)},decorate:function(t){return S.fromString(t)},undecorate:function(t){return t.toString()}}};const tt=O($,{text:j(/\\\\\\\\|\\\\;|\\\\,|\\\\[Nn]/g,/\\\\|;|,|\\n/g),uri:{},binary:{decorate:function(e){return t.fromString(e)},undecorate:function(t){return t.toString()}},\"cal-address\":{},date:{decorate:function(t,e){return ht.strict?s.fromDateString(t,e):s.fromString(t,e)},undecorate:function(t){return t.toString()},fromICAL:function(t){return!ht.strict&&t.length>=15?tt[\"date-time\"].fromICAL(t):t.slice(0,4)+\"-\"+t.slice(4,6)+\"-\"+t.slice(6,8)},toICAL:function(t){let e=t.length;return 10==e?t.slice(0,4)+t.slice(5,7)+t.slice(8,10):e>=19?tt[\"date-time\"].toICAL(t):t}},\"date-time\":{fromICAL:function(t){if(ht.strict||8!=t.length){let e=t.slice(0,4)+\"-\"+t.slice(4,6)+\"-\"+t.slice(6,8)+\"T\"+t.slice(9,11)+\":\"+t.slice(11,13)+\":\"+t.slice(13,15);return t[15]&&\"Z\"===t[15]&&(e+=\"Z\"),e}return tt.date.fromICAL(t)},toICAL:function(t){let e=t.length;if(10!=e||ht.strict){if(e>=19){let e=t.slice(0,4)+t.slice(5,7)+t.slice(8,13)+t.slice(14,16)+t.slice(17,19);return t[19]&&\"Z\"===t[19]&&(e+=\"Z\"),e}return t}return tt.date.toICAL(t)},decorate:function(t,e){return ht.strict?s.fromDateTimeString(t,e):s.fromString(t,e)},undecorate:function(t){return t.toString()}},duration:{decorate:function(t){return r.fromString(t)},undecorate:function(t){return t.toString()}},period:{fromICAL:function(t){let e=t.split(\"/\");return e[0]=tt[\"date-time\"].fromICAL(e[0]),r.isValueString(e[1])||(e[1]=tt[\"date-time\"].fromICAL(e[1])),e},toICAL:function(t){return t=t.slice(),ht.strict||10!=t[0].length?t[0]=tt[\"date-time\"].toICAL(t[0]):t[0]=tt.date.toICAL(t[0]),r.isValueString(t[1])||(ht.strict||10!=t[1].length?t[1]=tt[\"date-time\"].toICAL(t[1]):t[1]=tt.date.toICAL(t[1])),t.join(\"/\")},decorate:function(t,e){return k.fromJSON(t,e,!ht.strict)},undecorate:function(t){return t.toJSON()}},recur:{fromICAL:function(t){return B._stringToData(t,!0)},toICAL:function(t){let e=\"\";for(let[i,r]of Object.entries(t))\"until\"==i?r=r.length>10?tt[\"date-time\"].toICAL(r):tt.date.toICAL(r):\"wkst\"==i?\"number\"==typeof r&&(r=B.numericDayToIcalDay(r)):Array.isArray(r)&&(r=r.join(\",\")),e+=i.toUpperCase()+\"=\"+r+\";\";return e.slice(0,Math.max(0,e.length-1))},decorate:function(t){return B.fromData(t)},undecorate:function(t){return t.toJSON()}},time:{fromICAL:function(t){if(t.length<6)return t;let e=t.slice(0,2)+\":\"+t.slice(2,4)+\":\"+t.slice(4,6);return\"Z\"===t[6]&&(e+=\"Z\"),e},toICAL:function(t){if(t.length<8)return t;let e=t.slice(0,2)+t.slice(3,5)+t.slice(6,8);return\"Z\"===t[8]&&(e+=\"Z\"),e}}});let et=O(Q,{action:V,attach:{defaultType:\"uri\"},attendee:{defaultType:\"cal-address\"},calscale:V,class:V,comment:V,completed:K,contact:V,created:K,description:V,dtend:F,dtstamp:K,dtstart:F,due:F,duration:{defaultType:\"duration\"},exdate:{defaultType:\"date-time\",allowedTypes:[\"date-time\",\"date\"],multiValue:\",\"},exrule:Z,freebusy:{defaultType:\"period\",multiValue:\",\"},geo:{defaultType:\"float\",structuredValue:\";\"},\"last-modified\":K,location:V,method:V,organizer:{defaultType:\"cal-address\"},\"percent-complete\":W,priority:W,prodid:V,\"related-to\":V,repeat:W,rdate:{defaultType:\"date-time\",allowedTypes:[\"date-time\",\"date\",\"period\"],multiValue:\",\",detectType:function(t){return-1!==t.indexOf(\"/\")?\"period\":-1===t.indexOf(\"T\")?\"date\":\"date-time\"}},\"recurrence-id\":F,resources:H,\"request-status\":R,rrule:Z,sequence:W,status:V,summary:V,transp:V,trigger:{defaultType:\"duration\",allowedTypes:[\"duration\",\"date-time\"]},tzoffsetfrom:J,tzoffsetto:J,tzurl:q,tzid:V,tzname:V});const it=O($,{text:j(P,U),uri:j(P,U),date:{decorate:function(t){return E.fromDateAndOrTimeString(t,\"date\")},undecorate:function(t){return t.toString()},fromICAL:function(t){return 8==t.length?tt.date.fromICAL(t):\"-\"==t[0]&&6==t.length?t.slice(0,4)+\"-\"+t.slice(4):t},toICAL:function(t){return 10==t.length?tt.date.toICAL(t):\"-\"==t[0]&&7==t.length?t.slice(0,4)+t.slice(5):t}},time:{decorate:function(t){return E.fromDateAndOrTimeString(\"T\"+t,\"time\")},undecorate:function(t){return t.toString()},fromICAL:function(t){let e=it.time._splitZone(t,!0),i=e[0],r=e[1];return 6==r.length?r=r.slice(0,2)+\":\"+r.slice(2,4)+\":\"+r.slice(4,6):4==r.length&&\"-\"!=r[0]?r=r.slice(0,2)+\":\"+r.slice(2,4):5==r.length&&(r=r.slice(0,3)+\":\"+r.slice(3,5)),5!=i.length||\"-\"!=i[0]&&\"+\"!=i[0]||(i=i.slice(0,3)+\":\"+i.slice(3)),r+i},toICAL:function(t){let e=it.time._splitZone(t),i=e[0],r=e[1];return 8==r.length?r=r.slice(0,2)+r.slice(3,5)+r.slice(6,8):5==r.length&&\"-\"!=r[0]?r=r.slice(0,2)+r.slice(3,5):6==r.length&&(r=r.slice(0,3)+r.slice(4,6)),6!=i.length||\"-\"!=i[0]&&\"+\"!=i[0]||(i=i.slice(0,3)+i.slice(4)),r+i},_splitZone:function(t,e){let i,r,n=t.length-1,s=t.length-(e?5:6),a=t[s];return\"Z\"==t[n]?(i=t[n],r=t.slice(0,Math.max(0,n))):t.length>6&&(\"-\"==a||\"+\"==a)?(i=t.slice(s),r=t.slice(0,Math.max(0,s))):(i=\"\",r=t),[i,r]}},\"date-time\":{decorate:function(t){return E.fromDateAndOrTimeString(t,\"date-time\")},undecorate:function(t){return t.toString()},fromICAL:function(t){return it[\"date-and-or-time\"].fromICAL(t)},toICAL:function(t){return it[\"date-and-or-time\"].toICAL(t)}},\"date-and-or-time\":{decorate:function(t){return E.fromDateAndOrTimeString(t,\"date-and-or-time\")},undecorate:function(t){return t.toString()},fromICAL:function(t){let e=t.split(\"T\");return(e[0]?it.date.fromICAL(e[0]):\"\")+(e[1]?\"T\"+it.time.fromICAL(e[1]):\"\")},toICAL:function(t){let e=t.split(\"T\");return it.date.toICAL(e[0])+(e[1]?\"T\"+it.time.toICAL(e[1]):\"\")}},timestamp:tt[\"date-time\"],\"language-tag\":{matches:/^[a-zA-Z0-9-]+$/},\"phone-number\":{fromICAL:function(t){return Array.from(t).filter((function(t){return\"\\\\\"===t?void 0:t})).join(\"\")},toICAL:function(t){return Array.from(t).map((function(t){return\",\"===t||\";\"===t?\"\\\\\"+t:t})).join(\"\")}}});let rt=O(Q,{adr:{defaultType:\"text\",structuredValue:\";\",multiValue:\",\"},anniversary:G,bday:G,caladruri:q,caluri:q,clientpidmap:R,email:V,fburl:q,fn:V,gender:R,geo:q,impp:q,key:q,kind:V,lang:{defaultType:\"language-tag\"},logo:q,member:q,n:{defaultType:\"text\",structuredValue:\";\",multiValue:\",\"},nickname:H,note:V,org:{defaultType:\"text\",structuredValue:\";\"},photo:q,related:q,rev:{defaultType:\"timestamp\"},role:V,sound:q,source:q,tel:{defaultType:\"uri\",allowedTypes:[\"uri\",\"text\"]},title:V,tz:{defaultType:\"text\",allowedTypes:[\"text\",\"utc-offset\",\"uri\"]},xml:V}),nt=O($,{binary:tt.binary,date:it.date,\"date-time\":it[\"date-time\"],\"phone-number\":it[\"phone-number\"],uri:tt.uri,text:tt.text,time:tt.time,vcard:tt.text,\"utc-offset\":{toICAL:function(t){return t.slice(0,7)},fromICAL:function(t){return t.slice(0,7)},decorate:function(t){return S.fromString(t)},undecorate:function(t){return t.toString()}}}),st=O(Q,{fn:V,n:{defaultType:\"text\",structuredValue:\";\",multiValue:\",\"},nickname:H,photo:{defaultType:\"binary\",allowedTypes:[\"binary\",\"uri\"]},bday:{defaultType:\"date-time\",allowedTypes:[\"date-time\",\"date\"],detectType:function(t){return-1===t.indexOf(\"T\")?\"date\":\"date-time\"}},adr:{defaultType:\"text\",structuredValue:\";\",multiValue:\",\"},label:V,tel:{defaultType:\"phone-number\"},email:V,mailer:V,tz:{defaultType:\"utc-offset\",allowedTypes:[\"utc-offset\",\"text\"]},geo:{defaultType:\"float\",structuredValue:\";\"},title:V,role:V,logo:{defaultType:\"binary\",allowedTypes:[\"binary\",\"uri\"]},agent:{defaultType:\"vcard\",allowedTypes:[\"vcard\",\"text\",\"uri\"]},org:R,note:H,prodid:V,rev:{defaultType:\"date-time\",allowedTypes:[\"date-time\",\"date\"],detectType:function(t){return-1===t.indexOf(\"T\")?\"date\":\"date-time\"}},\"sort-string\":V,sound:{defaultType:\"binary\",allowedTypes:[\"binary\",\"uri\"]},class:V,key:{defaultType:\"binary\",allowedTypes:[\"binary\",\"text\"]}}),at={value:tt,param:{cutype:{values:[\"INDIVIDUAL\",\"GROUP\",\"RESOURCE\",\"ROOM\",\"UNKNOWN\"],allowXName:!0,allowIanaToken:!0},\"delegated-from\":{valueType:\"cal-address\",multiValue:\",\",multiValueSeparateDQuote:!0},\"delegated-to\":{valueType:\"cal-address\",multiValue:\",\",multiValueSeparateDQuote:!0},encoding:{values:[\"8BIT\",\"BASE64\"]},fbtype:{values:[\"FREE\",\"BUSY\",\"BUSY-UNAVAILABLE\",\"BUSY-TENTATIVE\"],allowXName:!0,allowIanaToken:!0},member:{valueType:\"cal-address\",multiValue:\",\",multiValueSeparateDQuote:!0},partstat:{values:[\"NEEDS-ACTION\",\"ACCEPTED\",\"DECLINED\",\"TENTATIVE\",\"DELEGATED\",\"COMPLETED\",\"IN-PROCESS\"],allowXName:!0,allowIanaToken:!0},range:{values:[\"THISANDFUTURE\"]},related:{values:[\"START\",\"END\"]},reltype:{values:[\"PARENT\",\"CHILD\",\"SIBLING\"],allowXName:!0,allowIanaToken:!0},role:{values:[\"REQ-PARTICIPANT\",\"CHAIR\",\"OPT-PARTICIPANT\",\"NON-PARTICIPANT\"],allowXName:!0,allowIanaToken:!0},rsvp:{values:[\"TRUE\",\"FALSE\"]},\"sent-by\":{valueType:\"cal-address\"},tzid:{matches:/^\\//},value:{values:[\"binary\",\"boolean\",\"cal-address\",\"date\",\"date-time\",\"duration\",\"float\",\"integer\",\"period\",\"recur\",\"text\",\"time\",\"uri\",\"utc-offset\"],allowXName:!0,allowIanaToken:!0}},property:et,propertyGroups:!1},ot={value:it,param:{type:{valueType:\"text\",multiValue:\",\"},value:{values:[\"text\",\"uri\",\"date\",\"time\",\"date-time\",\"date-and-or-time\",\"timestamp\",\"boolean\",\"integer\",\"float\",\"utc-offset\",\"language-tag\"],allowXName:!0,allowIanaToken:!0}},property:rt,propertyGroups:!0},lt={value:nt,param:{type:{valueType:\"text\",multiValue:\",\"},value:{values:[\"text\",\"uri\",\"date\",\"date-time\",\"phone-number\",\"time\",\"boolean\",\"integer\",\"float\",\"utc-offset\",\"vcard\",\"binary\"],allowXName:!0,allowIanaToken:!0}},property:st,propertyGroups:!0};const ht={strict:!0,defaultSet:at,defaultType:\"unknown\",components:{vcard:ot,vcard3:lt,vevent:at,vtodo:at,vjournal:at,valarm:at,vtimezone:at,daylight:at,standard:at},icalendar:at,vcard:ot,vcard3:lt,getDesignSet:function(t){return t&&t in ht.components?ht.components[t]:ht.defaultSet}};var ut=ht;const ct=\"\\r\\n\",dt=\"unknown\",mt={'\"':\"^'\",\"\\n\":\"^n\",\"^\":\"^^\"};function ft(t){\"string\"==typeof t[0]&&(t=[t]);let e=0,i=t.length,r=\"\";for(;e0&&(\"version\"!==t[1][0][0]||\"4.0\"!==t[1][0][3])&&(o=\"vcard3\"),e=e||ut.getDesignSet(o);s0&&\"object\"==typeof t[0]&&\"icaltype\"in t[0]&&this.resetType(t[0].icaltype),this.isDecorated)for(;i=0;s--)i&&n[s][0]!==i||this._removeObjectByIndex(t,r,s)}addSubcomponent(t){this._components||(this._components=[],this._hydratedComponentCount=0),t.parent&&t.parent.removeSubcomponent(t);let e=this.jCal[2].push(t.jCal);return this._components[e-1]=t,this._hydratedComponentCount++,t.parent=this,t}removeSubcomponent(t){let e=this._removeObject(2,\"_components\",t);return e&&this._hydratedComponentCount--,e}removeAllSubcomponents(t){let e=this._removeAllObjects(2,\"_components\",t);return this._hydratedComponentCount=0,e}addProperty(t){if(!(t instanceof pt))throw new TypeError(\"must be instance of ICAL.Property\");this._properties||(this._properties=[],this._hydratedPropertyCount=0),t.parent&&t.parent.removeProperty(t);let e=this.jCal[1].push(t.jCal);return this._properties[e-1]=t,this._hydratedPropertyCount++,t.parent=this,t}addPropertyWithValue(t,e){let i=new pt(t);return i.setValue(e),this.addProperty(i),i}updatePropertyWithValue(t,e){let i=this.getFirstProperty(t);return i?i.setValue(e):i=this.addPropertyWithValue(t,e),i}removeProperty(t){let e=this._removeObject(1,\"_properties\",t);return e&&this._hydratedPropertyCount--,e}removeAllProperties(t){let e=this._removeAllObjects(1,\"_properties\",t);return this._hydratedPropertyCount=0,e}toJSON(){return this.jCal}toString(){return ft.component(this.jCal,this._designSet)}getTimeZoneByID(t){if(this.parent)return this.parent.getTimeZoneByID(t);if(!this._timezoneCache)return null;if(this._timezoneCache.has(t))return this._timezoneCache.get(t);const e=this.getAllSubcomponents(\"vtimezone\");for(const i of e)if(i.getFirstProperty(\"tzid\").getFirstValue()===t){const e=new c({component:i,tzid:t});return this._timezoneCache.set(t,e),e}return null}}class _t{constructor(t){this.ruleDates=[],this.exDates=[],this.fromData(t)}complete=!1;ruleIterators=null;ruleDates=null;exDates=null;ruleDateInc=0;exDateInc=0;exDate=null;ruleDate=null;dtstart=null;last=null;fromData(t){let e=y(t.dtstart,s);if(!e)throw new Error(\".dtstart (ICAL.Time) must be given\");if(this.dtstart=e,t.component)this._init(t.component);else{if(this.last=y(t.last,s)||e.clone(),!t.ruleIterators)throw new Error(\".ruleIterators or .component must be given\");this.ruleIterators=t.ruleIterators.map((function(t){return y(t,C)})),this.ruleDateInc=t.ruleDateInc,this.exDateInc=t.exDateInc,t.ruleDates&&(this.ruleDates=t.ruleDates.map((t=>y(t,s))),this.ruleDate=this.ruleDates[this.ruleDateInc]),t.exDates&&(this.exDates=t.exDates.map((t=>y(t,s))),this.exDate=this.exDates[this.exDateInc]),void 0!==t.complete&&(this.complete=t.complete)}}next(){let t,e,i,r=0;for(;;){if(r++>500)throw new Error(\"max tries have occurred, rule may be impossible to fulfill.\");if(e=this.ruleDate,t=this._nextRecurrenceIter(this.last),!e&&!t){this.complete=!0;break}if((!e||t&&e.compare(t.last)>0)&&(e=t.last.clone(),t.next()),this.ruleDate===e&&this._nextRuleDay(),this.last=e,!this.exDate||(i=this.exDate.compare(this.last),i<0&&this._nextExDay(),0!==i))return this.last;this._nextExDay()}}toJSON(){function t(t){return t.toJSON()}let e=Object.create(null);return e.ruleIterators=this.ruleIterators.map(t),this.ruleDates&&(e.ruleDates=this.ruleDates.map(t)),this.exDates&&(e.exDates=this.exDates.map(t)),e.ruleDateInc=this.ruleDateInc,e.exDateInc=this.exDateInc,e.last=this.last.toJSON(),e.dtstart=this.dtstart.toJSON(),e.complete=this.complete,e}_extractDates(t,e){let i=[],r=t.getAllProperties(e);for(let t=0,e=r.length;tt.compare(e)));i.splice(t,0,e)}return i}_init(t){if(this.ruleIterators=[],this.last=this.dtstart.clone(),!t.hasProperty(\"rdate\")&&!t.hasProperty(\"rrule\")&&!t.hasProperty(\"recurrence-id\"))return this.ruleDate=this.last.clone(),void(this.complete=!0);if(t.hasProperty(\"rdate\")&&(this.ruleDates=this._extractDates(t,\"rdate\"),this.ruleDates[0]&&this.ruleDates[0].compare(this.dtstart)<0?(this.ruleDateInc=0,this.last=this.ruleDates[0].clone()):this.ruleDateInc=g(this.ruleDates,this.last,((t,e)=>t.compare(e))),this.ruleDate=this.ruleDates[this.ruleDateInc]),t.hasProperty(\"rrule\")){let e,i,r=t.getAllProperties(\"rrule\"),n=0,s=r.length;for(;nt.compare(e))),this.exDate=this.exDates[this.exDateInc])}_nextExDay(){this.exDate=this.exDates[++this.exDateInc]}_nextRuleDay(){this.ruleDate=this.ruleDates[++this.ruleDateInc]}_nextRecurrenceIter(){let t=this.ruleIterators;if(0===t.length)return null;let e,i,r,n=t.length,s=0;for(;s0)&&(r=e);return r}}class gt{constructor(t,e){t instanceof yt||(e=t,t=null),this.component=t||new yt(\"vevent\"),this._rangeExceptionCache=Object.create(null),this.exceptions=Object.create(null),this.rangeExceptions=[],e&&e.strictExceptions&&(this.strictExceptions=e.strictExceptions),e&&e.exceptions?e.exceptions.forEach(this.relateException,this):this.component.parent&&!this.isRecurrenceException()&&this.component.parent.getAllSubcomponents(\"vevent\").forEach((function(t){t.hasProperty(\"recurrence-id\")&&this.relateException(t)}),this)}static THISANDFUTURE=\"THISANDFUTURE\";exceptions=null;strictExceptions=!1;relateException(t){if(this.isRecurrenceException())throw new Error(\"cannot relate exception to exceptions\");if(t instanceof yt&&(t=new gt(t)),this.strictExceptions&&t.uid!==this.uid)throw new Error(\"attempted to relate unrelated exception\");let e=t.recurrenceId.toString();if(this.exceptions[e]=t,t.modifiesFuture()){let i=[t.recurrenceId.toUnixTime(),e],r=g(this.rangeExceptions,i,Dt);this.rangeExceptions.splice(r,0,i)}}modifiesFuture(){if(!this.component.hasProperty(\"recurrence-id\"))return!1;return this.component.getFirstProperty(\"recurrence-id\").getParameter(\"range\")===gt.THISANDFUTURE}findRangeException(t){if(!this.rangeExceptions.length)return null;let e=t.toUnixTime(),i=g(this.rangeExceptions,[e],Dt);if(i-=1,i<0)return null;let r=this.rangeExceptions[i];return ee[0]?1:e[0]>t[0]?-1:0}var Tt={foldLength:75,debug:!1,newLineChar:\"\\r\\n\",Binary:t,Component:yt,ComponentParser:class{constructor(t){void 0===t&&(t={});for(let[e,i]of Object.entries(t))this[e]=i}parseEvent=!0;parseTimezone=!0;oncomplete=function(){};onerror=function(t){};ontimezone=function(t){};onevent=function(t){};process(t){\"string\"==typeof t&&(t=l(t)),t instanceof yt||(t=new yt(t));let e,i=t.getAllSubcomponents(),r=0,n=i.length;for(;r= 20) {\n console.error(\"TimezoneManager.getTimezoneForIdRec() exceeds recursion limits\");\n return null;\n }\n if (this._aliases.has(timezoneId)) {\n const resolvedTimezoneId = this._aliases.get(timezoneId);\n return this._getTimezoneForIdRec(resolvedTimezoneId, level + 1);\n }\n return null;\n }\n /**\n * Checks if there is a timezone for the given id stored in this manager\n *\n * @param {string} timezoneId The id of the timezone\n * @return {boolean}\n */\n hasTimezoneForId(timezoneId) {\n return this._timezones.has(timezoneId) || this._aliases.has(timezoneId);\n }\n /**\n * Checks if the given timezone id is an alias\n *\n * @param {string} timezoneId The id of the timezone\n * @return {boolean}\n */\n isAlias(timezoneId) {\n return !this._timezones.has(timezoneId) && this._aliases.has(timezoneId);\n }\n /**\n * Lists all timezones\n *\n * @param {boolean=} includeAliases Whether or not to include aliases\n * @return {string[]}\n */\n listAllTimezones(includeAliases = false) {\n const timezones = Array.from(this._timezones.keys());\n if (includeAliases) {\n return timezones.concat(Array.from(this._aliases.keys()));\n }\n return timezones;\n }\n /**\n * Registers a timezone\n *\n * @param {Timezone} timezone The timezone-object to register\n */\n registerTimezone(timezone) {\n this._timezones.set(timezone.timezoneId, timezone);\n ICAL.TimezoneService.register(timezone.timezoneId, timezone.toICALTimezone());\n this._pendingAliases = this._pendingAliases.filter(([aliasName, timezoneId]) => {\n if (timezoneId !== timezone.timezoneId) {\n return true;\n }\n ICAL.TimezoneService.register(aliasName, timezone.toICALTimezone());\n return false;\n });\n }\n registerDefaultTimezones() {\n console.debug(`@nextcloud/calendar-js app is using version ${tzData.version} of the timezone database`);\n for (const tzid in tzData.zones) {\n if (Object.prototype.hasOwnProperty.call(tzData.zones, [tzid])) {\n const ics = [\n \"BEGIN:VTIMEZONE\",\n \"TZID:\" + tzid,\n ...tzData.zones[tzid].ics,\n \"END:VTIMEZONE\"\n ].join(\"\\r\\n\");\n this.registerTimezoneFromICS(tzid, ics);\n }\n }\n for (const tzid in tzData.aliases) {\n if (Object.prototype.hasOwnProperty.call(tzData.aliases, [tzid])) {\n this.registerAlias(tzid, tzData.aliases[tzid].aliasTo);\n }\n }\n }\n /**\n * Registers a timezone based on ics data\n *\n * @param {string} timezoneId The id of the timezone\n * @param {string} ics The iCalendar timezone definition\n */\n registerTimezoneFromICS(timezoneId, ics) {\n const timezone = new Timezone(timezoneId, ics);\n this.registerTimezone(timezone);\n }\n /**\n * Registers a new timezone-alias\n *\n * @param {string} aliasName The timezone-id of the alias\n * @param {string} timezoneId The timezone-id to resolve the alias to\n */\n registerAlias(aliasName, timezoneId) {\n this._aliases.set(aliasName, timezoneId);\n const resolvedTimezone = this.getTimezoneForId(timezoneId);\n if (!resolvedTimezone) {\n this._pendingAliases.push([aliasName, timezoneId]);\n return;\n }\n ICAL.TimezoneService.register(aliasName, resolvedTimezone.toICALTimezone());\n }\n /**\n * Unregisters a timezone\n *\n * @param {string} timezoneId Unregisters a timezone by Id\n */\n unregisterTimezones(timezoneId) {\n this._timezones.delete(timezoneId);\n ICAL.TimezoneService.remove(timezoneId);\n }\n /**\n * Unregisters a timezone-alias\n *\n * @param {string} aliasName The alias to unregister\n */\n unregisterAlias(aliasName) {\n this._aliases.delete(aliasName);\n this._pendingAliases = this._pendingAliases.filter(([pendingAliasName]) => pendingAliasName !== aliasName);\n ICAL.TimezoneService.remove(aliasName);\n }\n /**\n * Clear all timezones\n */\n clearAllTimezones() {\n this._aliases = /* @__PURE__ */ new Map();\n this._pendingAliases = [];\n this._timezones = /* @__PURE__ */ new Map();\n ICAL.TimezoneService.reset();\n timezoneManager.registerTimezone(Timezone.utc);\n timezoneManager.registerTimezone(Timezone.floating);\n timezoneManager.registerAlias(\"GMT\", Timezone.utc.timezoneId);\n timezoneManager.registerAlias(\"Z\", Timezone.utc.timezoneId);\n }\n}\nconst timezoneManager = new TimezoneManager();\ntimezoneManager.clearAllTimezones();\nfunction getTimezoneManager() {\n return timezoneManager;\n}\nfunction isOlsonTimezone(tzName) {\n const hasSlash = tzName.indexOf(\"/\") !== -1;\n const hasSpace = tzName.indexOf(\" \") !== -1;\n const startsWithETC = tzName.startsWith(\"Etc\");\n const startsWithUS = tzName.startsWith(\"US/\");\n return hasSlash && !hasSpace && !startsWithETC && !startsWithUS;\n}\nfunction getSortedTimezoneList(timezoneList = [], additionalTimezones = [], globalTimezoneName = \"Global\") {\n const sortedByContinent = {};\n const sortedList = [];\n for (const timezoneId of timezoneList) {\n const components = timezoneId.split(\"/\");\n let [continent, name] = [components.shift(), components.join(\"/\")];\n if (!name) {\n name = continent;\n continent = globalTimezoneName;\n }\n sortedByContinent[continent] = sortedByContinent[continent] || {\n continent,\n regions: []\n };\n sortedByContinent[continent].regions.push({\n label: getReadableTimezoneName(name),\n cities: [],\n timezoneId\n });\n }\n for (const additionalTimezone of additionalTimezones) {\n const { continent, label, timezoneId } = additionalTimezone;\n sortedByContinent[continent] = sortedByContinent[continent] || {\n continent,\n regions: []\n };\n sortedByContinent[continent].regions.push({\n label,\n cities: [],\n timezoneId\n });\n }\n for (const continent in sortedByContinent) {\n if (!Object.prototype.hasOwnProperty.call(sortedByContinent, continent)) {\n continue;\n }\n sortedByContinent[continent].regions.sort((a, b) => {\n if (a.label < b.label) {\n return -1;\n }\n return 1;\n });\n sortedList.push(sortedByContinent[continent]);\n }\n sortedList.sort((a, b) => {\n if (a.continent < b.continent) {\n return -1;\n }\n return 1;\n });\n return sortedList;\n}\nfunction getReadableTimezoneName(timezoneId) {\n return timezoneId.split(\"_\").join(\" \").replace(\"St \", \"St. \").split(\"/\").join(\" - \");\n}\nexport {\n Timezone,\n getReadableTimezoneName,\n getSortedTimezoneList,\n getTimezoneManager,\n isOlsonTimezone\n};\n","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.VueSelect=t():e.VueSelect=t()}(\"undefined\"!=typeof self?self:this,(function(){return(()=>{var e={646:e=>{e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t{e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},860:e=>{e.exports=function(e){if(Symbol.iterator in Object(e)||\"[object Arguments]\"===Object.prototype.toString.call(e))return Array.from(e)}},206:e=>{e.exports=function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance\")}},319:(e,t,n)=>{var o=n(646),i=n(860),s=n(206);e.exports=function(e){return o(e)||i(e)||s()}},8:e=>{function t(n){return\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},t(n)}e.exports=t}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})};var o={};return(()=>{\"use strict\";n.r(o),n.d(o,{VueSelect:()=>m,default:()=>_,mixins:()=>O});var e=n(319),t=n.n(e),i=n(8),s=n.n(i),r=n(713),a=n.n(r);const l={props:{autoscroll:{type:Boolean,default:!0}},watch:{typeAheadPointer:function(){this.autoscroll&&this.maybeAdjustScroll()},open:function(e){var t=this;this.autoscroll&&e&&this.$nextTick((function(){return t.maybeAdjustScroll()}))}},methods:{maybeAdjustScroll:function(){var e,t=(null===(e=this.$refs.dropdownMenu)||void 0===e?void 0:e.children[this.typeAheadPointer])||!1;if(t){var n=this.getDropdownViewport(),o=t.getBoundingClientRect(),i=o.top,s=o.bottom,r=o.height;if(in.bottom)return this.$refs.dropdownMenu.scrollTop=t.offsetTop-(n.height-r)}},getDropdownViewport:function(){return this.$refs.dropdownMenu?this.$refs.dropdownMenu.getBoundingClientRect():{height:0,top:0,bottom:0}}}},c={data:function(){return{typeAheadPointer:-1}},watch:{filteredOptions:function(){if(this.resetFocusOnOptionsChange)for(var e=0;e=0;e--)if(this.selectable(this.filteredOptions[e])){this.typeAheadPointer=e;break}},typeAheadDown:function(){for(var e=this.typeAheadPointer+1;e0&&void 0!==arguments[0]?arguments[0]:null;return this.mutableLoading=null==e?!this.mutableLoading:e}}};function p(e,t,n,o,i,s,r,a){var l,c=\"function\"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),o&&(c.functional=!0),s&&(c._scopeId=\"data-v-\"+s),r?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||\"undefined\"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=l):i&&(l=a?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:e,options:c}}const d={Deselect:p({},(function(){var e=this.$createElement,t=this._self._c||e;return t(\"svg\",{attrs:{xmlns:\"http://www.w3.org/2000/svg\",width:\"10\",height:\"10\"}},[t(\"path\",{attrs:{d:\"M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z\"}})])}),[],!1,null,null,null).exports,OpenIndicator:p({},(function(){var e=this.$createElement,t=this._self._c||e;return t(\"svg\",{attrs:{xmlns:\"http://www.w3.org/2000/svg\",width:\"14\",height:\"10\"}},[t(\"path\",{attrs:{d:\"M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z\"}})])}),[],!1,null,null,null).exports},h={inserted:function(e,t,n){var o=n.context;if(o.appendToBody){document.body.appendChild(e);var i=o.$refs.toggle.getBoundingClientRect(),s=i.height,r=i.top,a=i.left,l=i.width,c=window.scrollX||window.pageXOffset,u=window.scrollY||window.pageYOffset;e.unbindPosition=o.calculatePosition(e,o,{width:l+\"px\",left:c+a+\"px\",top:u+r+s+\"px\"})}},unbind:function(e,t,n){n.context.appendToBody&&(e.unbindPosition&&\"function\"==typeof e.unbindPosition&&e.unbindPosition(),e.parentNode&&e.parentNode.removeChild(e))}};const f=function(e){var t={};return Object.keys(e).sort().forEach((function(n){t[n]=e[n]})),JSON.stringify(t)};var y=0;const b=function(){return++y};function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function v(e){for(var t=1;t-1}},filter:{type:Function,default:function(e,t){var n=this;return e.filter((function(e){var o=n.getOptionLabel(e);return\"number\"==typeof o&&(o=o.toString()),n.filterBy(e,o,t)}))}},createOption:{type:Function,default:function(e){return\"object\"===s()(this.optionList[0])?a()({},this.label,e):e}},resetFocusOnOptionsChange:{type:Boolean,default:!0},resetOnOptionsChange:{default:!1,validator:function(e){return[\"function\",\"boolean\"].includes(s()(e))}},clearSearchOnBlur:{type:Function,default:function(e){var t=e.clearSearchOnSelect,n=e.multiple;return t&&!n}},noDrop:{type:Boolean,default:!1},inputId:{type:String},dir:{type:String,default:\"auto\"},selectOnTab:{type:Boolean,default:!1},selectOnKeyCodes:{type:Array,default:function(){return[13]}},searchInputQuerySelector:{type:String,default:\"[type=search]\"},mapKeydown:{type:Function,default:function(e,t){return e}},appendToBody:{type:Boolean,default:!1},calculatePosition:{type:Function,default:function(e,t,n){var o=n.width,i=n.top,s=n.left;e.style.top=i,e.style.left=s,e.style.width=o}},dropdownShouldOpen:{type:Function,default:function(e){var t=e.noDrop,n=e.open,o=e.mutableLoading;return!t&&(n&&!o)}},keyboardFocusBorder:{type:Boolean,default:!1},uid:{type:[String,Number],default:function(){return b()}}},data:function(){return{search:\"\",open:!1,isComposing:!1,isKeyboardNavigation:!1,pushedTags:[],_value:[]}},computed:{isTrackingValues:function(){return void 0===this.value||this.$options.propsData.hasOwnProperty(\"reduce\")},selectedValue:function(){var e=this.value;return this.isTrackingValues&&(e=this.$data._value),null!=e&&\"\"!==e?[].concat(e):[]},optionList:function(){return this.options.concat(this.pushTags?this.pushedTags:[])},searchEl:function(){return this.$scopedSlots.search?this.$refs.selectedOptions.querySelector(this.searchInputQuerySelector):this.$refs.search},scope:function(){var e=this,t={search:this.search,loading:this.loading,searching:this.searching,filteredOptions:this.filteredOptions};return{search:{attributes:v({id:this.inputId,disabled:this.disabled,placeholder:this.searchPlaceholder,tabindex:this.tabindex,readonly:!this.searchable,role:\"combobox\",\"aria-autocomplete\":\"list\",\"aria-label\":this.ariaLabelCombobox,\"aria-controls\":\"vs-\".concat(this.uid,\"__listbox\"),\"aria-owns\":\"vs-\".concat(this.uid,\"__listbox\"),\"aria-expanded\":this.dropdownOpen.toString(),ref:\"search\",type:\"search\",autocomplete:this.autocomplete,value:this.search},this.dropdownOpen&&this.filteredOptions[this.typeAheadPointer]?{\"aria-activedescendant\":\"vs-\".concat(this.uid,\"__option-\").concat(this.typeAheadPointer)}:{}),events:{compositionstart:function(){return e.isComposing=!0},compositionend:function(){return e.isComposing=!1},keydown:this.onSearchKeyDown,keypress:this.onSearchKeyPress,blur:this.onSearchBlur,focus:this.onSearchFocus,input:function(t){return e.search=t.target.value}}},spinner:{loading:this.mutableLoading},noOptions:{search:this.search,loading:this.mutableLoading,searching:this.searching},openIndicator:{attributes:{ref:\"openIndicator\",role:\"presentation\",class:\"vs__open-indicator\"}},listHeader:t,listFooter:t,header:v({},t,{deselect:this.deselect}),footer:v({},t,{deselect:this.deselect})}},childComponents:function(){return v({},d,{},this.components)},stateClasses:function(){return{\"vs--open\":this.dropdownOpen,\"vs--single\":!this.multiple,\"vs--multiple\":this.multiple,\"vs--searching\":this.searching&&!this.noDrop,\"vs--searchable\":this.searchable&&!this.noDrop,\"vs--unsearchable\":!this.searchable,\"vs--loading\":this.mutableLoading,\"vs--disabled\":this.disabled}},searching:function(){return!!this.search},dropdownOpen:function(){return this.dropdownShouldOpen(this)},searchPlaceholder:function(){return this.isValueEmpty&&this.placeholder?this.placeholder:void 0},filteredOptions:function(){var e=this,t=function(t){return null!==e.limit?t.slice(0,e.limit):t},n=[].concat(this.optionList);if(!this.filterable&&!this.taggable)return t(n);var o=this.search.length?this.filter(n,this.search,this):n;if(this.taggable&&this.search.length){var i=this.createOption(this.search);this.optionExists(i)||o.unshift(i)}return t(o)},isValueEmpty:function(){return 0===this.selectedValue.length},showClearButton:function(){return!this.multiple&&this.clearable&&!this.open&&!this.isValueEmpty}},watch:{options:function(e,t){var n=this;!this.taggable&&(\"function\"==typeof n.resetOnOptionsChange?n.resetOnOptionsChange(e,t,n.selectedValue):n.resetOnOptionsChange)&&this.clearSelection(),this.value&&this.isTrackingValues&&this.setInternalValueFromOptions(this.value)},value:{immediate:!0,handler:function(e){this.isTrackingValues&&this.setInternalValueFromOptions(e)}},multiple:function(){this.clearSelection()},open:function(e){this.$emit(e?\"open\":\"close\")},search:function(e){e.length&&(this.open=!0)}},created:function(){this.mutableLoading=this.loading,this.$on(\"option:created\",this.pushTag)},methods:{setInternalValueFromOptions:function(e){var t=this;Array.isArray(e)?this.$data._value=e.map((function(e){return t.findOptionFromReducedValue(e)})):this.$data._value=this.findOptionFromReducedValue(e)},select:function(e){this.$emit(\"option:selecting\",e),this.isOptionSelected(e)?this.deselectFromDropdown&&(this.clearable||this.multiple&&this.selectedValue.length>1)&&this.deselect(e):(this.taggable&&!this.optionExists(e)&&this.$emit(\"option:created\",e),this.multiple&&(e=this.selectedValue.concat(e)),this.updateValue(e),this.$emit(\"option:selected\",e)),this.onAfterSelect(e)},deselect:function(e){var t=this;this.$emit(\"option:deselecting\",e),this.updateValue(this.selectedValue.filter((function(n){return!t.optionComparator(n,e)}))),this.$emit(\"option:deselected\",e)},keyboardDeselect:function(e,t){var n,o;this.deselect(e);var i=null===(n=this.$refs.deselectButtons)||void 0===n?void 0:n[t+1],s=null===(o=this.$refs.deselectButtons)||void 0===o?void 0:o[t-1],r=null!=i?i:s;r?r.focus():this.searchEl.focus()},clearSelection:function(){this.updateValue(this.multiple?[]:null),this.searchEl.focus()},onAfterSelect:function(e){var t=this;this.closeOnSelect&&(this.open=!this.open),this.clearSearchOnSelect&&(this.search=\"\"),this.noDrop&&this.multiple&&this.$nextTick((function(){return t.$refs.search.focus()}))},updateValue:function(e){var t=this;void 0===this.value&&(this.$data._value=e),null!==e&&(e=Array.isArray(e)?e.map((function(e){return t.reduce(e)})):this.reduce(e)),this.$emit(\"input\",e)},toggleDropdown:function(e){var n=e.target!==this.searchEl;n&&e.preventDefault();var o=[].concat(t()(this.$refs.deselectButtons||[]),t()([this.$refs.clearButton]||0));void 0===this.searchEl||o.filter(Boolean).some((function(t){return t.contains(e.target)||t===e.target}))?e.preventDefault():this.open&&n?this.searchEl.blur():this.disabled||(this.open=!0,this.searchEl.focus())},isOptionSelected:function(e){var t=this;return this.selectedValue.some((function(n){return t.optionComparator(n,e)}))},isOptionDeselectable:function(e){return this.isOptionSelected(e)&&this.deselectFromDropdown},hasKeyboardFocusBorder:function(e){return!(!this.keyboardFocusBorder||!this.isKeyboardNavigation)&&e===this.typeAheadPointer},optionComparator:function(e,t){return this.getOptionKey(e)===this.getOptionKey(t)},findOptionFromReducedValue:function(e){var n=this,o=[].concat(t()(this.options),t()(this.pushedTags)).filter((function(t){return JSON.stringify(n.reduce(t))===JSON.stringify(e)}));return 1===o.length?o[0]:o.find((function(e){return n.optionComparator(e,n.$data._value)}))||e},closeSearchOptions:function(){this.open=!1,this.$emit(\"search:blur\")},maybeDeleteValue:function(){if(!this.searchEl.value.length&&this.selectedValue&&this.selectedValue.length&&this.clearable){var e=null;this.multiple&&(e=t()(this.selectedValue.slice(0,this.selectedValue.length-1))),this.updateValue(e)}},optionExists:function(e){var t=this;return this.optionList.some((function(n){return t.optionComparator(n,e)}))},optionAriaSelected:function(e){return this.selectable(e)?String(this.isOptionSelected(e)):null},normalizeOptionForSlot:function(e){return\"object\"===s()(e)?e:a()({},this.label,e)},pushTag:function(e){this.pushedTags.push(e)},onEscape:function(){this.search.length?this.search=\"\":this.open=!1},onSearchBlur:function(){if(!this.mousedown||this.searching){var e=this.clearSearchOnSelect,t=this.multiple;return this.clearSearchOnBlur({clearSearchOnSelect:e,multiple:t})&&(this.search=\"\"),void this.closeSearchOptions()}this.mousedown=!1,0!==this.search.length||0!==this.options.length||this.closeSearchOptions()},onSearchFocus:function(){this.open=!0,this.$emit(\"search:focus\")},onMousedown:function(){this.mousedown=!0},onMouseUp:function(){this.mousedown=!1},onMouseMove:function(e,t){this.isKeyboardNavigation=!1,this.selectable(e)&&(this.typeAheadPointer=t)},onSearchKeyDown:function(e){var t=this,n=function(e){if(e.preventDefault(),t.open)return!t.isComposing&&t.typeAheadSelect();t.open=!0},o={8:function(e){return t.maybeDeleteValue()},9:function(e){return t.onTab()},27:function(e){return t.onEscape()},38:function(e){if(e.preventDefault(),t.isKeyboardNavigation=!0,t.open)return t.typeAheadUp();t.open=!0},40:function(e){if(e.preventDefault(),t.isKeyboardNavigation=!0,t.open)return t.typeAheadDown();t.open=!0}};this.selectOnKeyCodes.forEach((function(e){return o[e]=n}));var i=this.mapKeydown(o,this);if(\"function\"==typeof i[e.keyCode])return i[e.keyCode](e)},onSearchKeyPress:function(e){this.open||32!==e.keyCode||(e.preventDefault(),this.open=!0)}}},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"div\",{staticClass:\"v-select\",class:e.stateClasses,attrs:{id:\"v-select-\"+e.uid,dir:e.dir}},[e._t(\"header\",null,null,e.scope.header),e._v(\" \"),n(\"div\",{ref:\"toggle\",staticClass:\"vs__dropdown-toggle\"},[n(\"div\",{ref:\"selectedOptions\",staticClass:\"vs__selected-options\",on:{mousedown:e.toggleDropdown}},[e._l(e.selectedValue,(function(t,o){return e._t(\"selected-option-container\",[n(\"span\",{key:e.getOptionKey(t),staticClass:\"vs__selected\"},[e._t(\"selected-option\",[e._v(\"\\n \"+e._s(e.getOptionLabel(t))+\"\\n \")],null,e.normalizeOptionForSlot(t)),e._v(\" \"),e.multiple?n(\"button\",{ref:\"deselectButtons\",refInFor:!0,staticClass:\"vs__deselect\",attrs:{disabled:e.disabled,type:\"button\",title:e.ariaLabelDeselectOption(e.getOptionLabel(t)),\"aria-label\":e.ariaLabelDeselectOption(e.getOptionLabel(t))},on:{mousedown:function(n){return n.stopPropagation(),e.deselect(t)},keydown:function(n){return!n.type.indexOf(\"key\")&&e._k(n.keyCode,\"enter\",13,n.key,\"Enter\")?null:e.keyboardDeselect(t,o)}}},[n(e.childComponents.Deselect,{tag:\"component\"})],1):e._e()],2)],{option:e.normalizeOptionForSlot(t),deselect:e.deselect,multiple:e.multiple,disabled:e.disabled})})),e._v(\" \"),e._t(\"search\",[n(\"input\",e._g(e._b({staticClass:\"vs__search\"},\"input\",e.scope.search.attributes,!1),e.scope.search.events))],null,e.scope.search)],2),e._v(\" \"),n(\"div\",{ref:\"actions\",staticClass:\"vs__actions\"},[n(\"button\",{directives:[{name:\"show\",rawName:\"v-show\",value:e.showClearButton,expression:\"showClearButton\"}],ref:\"clearButton\",staticClass:\"vs__clear\",attrs:{disabled:e.disabled,type:\"button\",title:e.ariaLabelClearSelected,\"aria-label\":e.ariaLabelClearSelected},on:{click:e.clearSelection}},[n(e.childComponents.Deselect,{tag:\"component\"})],1),e._v(\" \"),e.noDrop?e._e():n(\"button\",{ref:\"openIndicatorButton\",staticClass:\"vs__open-indicator-button\",attrs:{type:\"button\",tabindex:\"-1\",\"aria-labelledby\":\"vs-\"+e.uid+\"__listbox\",\"aria-controls\":\"vs-\"+e.uid+\"__listbox\",\"aria-expanded\":e.dropdownOpen.toString()},on:{mousedown:e.toggleDropdown}},[e._t(\"open-indicator\",[n(e.childComponents.OpenIndicator,e._b({tag:\"component\"},\"component\",e.scope.openIndicator.attributes,!1))],null,e.scope.openIndicator)],2),e._v(\" \"),e._t(\"spinner\",[n(\"div\",{directives:[{name:\"show\",rawName:\"v-show\",value:e.mutableLoading,expression:\"mutableLoading\"}],staticClass:\"vs__spinner\"},[e._v(\"Loading...\")])],null,e.scope.spinner)],2)]),e._v(\" \"),n(\"transition\",{attrs:{name:e.transition}},[e.dropdownOpen?n(\"ul\",{directives:[{name:\"append-to-body\",rawName:\"v-append-to-body\"}],key:\"vs-\"+e.uid+\"__listbox\",ref:\"dropdownMenu\",staticClass:\"vs__dropdown-menu\",attrs:{id:\"vs-\"+e.uid+\"__listbox\",role:\"listbox\",\"aria-label\":e.ariaLabelListbox,\"aria-multiselectable\":e.multiple,tabindex:\"-1\"},on:{mousedown:function(t){return t.preventDefault(),e.onMousedown(t)},mouseup:e.onMouseUp}},[e._t(\"list-header\",null,null,e.scope.listHeader),e._v(\" \"),e._l(e.filteredOptions,(function(t,o){return n(\"li\",{key:e.getOptionKey(t),staticClass:\"vs__dropdown-option\",class:{\"vs__dropdown-option--deselect\":e.isOptionDeselectable(t)&&o===e.typeAheadPointer,\"vs__dropdown-option--selected\":e.isOptionSelected(t),\"vs__dropdown-option--highlight\":o===e.typeAheadPointer,\"vs__dropdown-option--kb-focus\":e.hasKeyboardFocusBorder(o),\"vs__dropdown-option--disabled\":!e.selectable(t)},attrs:{id:\"vs-\"+e.uid+\"__option-\"+o,role:\"option\",\"aria-selected\":e.optionAriaSelected(t)},on:{mousemove:function(n){return e.onMouseMove(t,o)},click:function(n){n.preventDefault(),n.stopPropagation(),e.selectable(t)&&e.select(t)}}},[e._t(\"option\",[e._v(\"\\n \"+e._s(e.getOptionLabel(t))+\"\\n \")],null,e.normalizeOptionForSlot(t))],2)})),e._v(\" \"),0===e.filteredOptions.length?n(\"li\",{staticClass:\"vs__no-options\"},[e._t(\"no-options\",[e._v(\"\\n Sorry, no matching options.\\n \")],null,e.scope.noOptions)],2):e._e(),e._v(\" \"),e._t(\"list-footer\",null,null,e.scope.listFooter)],2):n(\"ul\",{staticStyle:{display:\"none\",visibility:\"hidden\"},attrs:{id:\"vs-\"+e.uid+\"__listbox\",role:\"listbox\",\"aria-label\":e.ariaLabelListbox}})]),e._v(\" \"),e._t(\"footer\",null,null,e.scope.footer)],2)}),[],!1,null,null,null).exports,O={ajax:u,pointer:c,pointerScroll:l},_=m})(),o})()}));\n//# sourceMappingURL=vue-select.js.map","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n const lr = ['left', 'right'];\n const rl = ['right', 'left'];\n const tb = ['top', 'bottom'];\n const bt = ['bottom', 'top'];\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rl : lr;\n return isStart ? lr : rl;\n case 'left':\n case 'right':\n return isStart ? tb : bt;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: 0,\n crossAxis: 0,\n alignmentAxis: null,\n ...rawValue\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = ['top', 'left'].includes(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if (isYAxis) {\n availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;\n } else {\n availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n // Browsers without `ShadowRoot` support.\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isTopLayer(element) {\n return [':popover-open', ':modal'].some(selector => {\n try {\n return element.matches(selector);\n } catch (e) {\n return false;\n }\n });\n}\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nfunction isLastTraversableNode(node) {\n return ['html', 'body', '#document'].includes(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, detectOverflow as detectOverflow$1, offset as offset$1, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getNodeScroll, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\nfunction getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n ...clippingAncestor,\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n const x = rect.left + scroll.scrollLeft - offsets.x;\n const y = rect.top + scroll.scrollTop - offsets.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n return element.offsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const {\n left,\n top,\n width,\n height\n } = element.getBoundingClientRect();\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle s\n root: root.ownerDocument\n });\n } catch (e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n resizeObserver.observe(floating);\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n name: \"ChevronDownIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon chevron-down-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n null\n);\nconst ChevronDown = __component__.exports;\nexport {\n ChevronDown as C\n};\n","import { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst FindRanges = (text, search) => {\n const ranges = [];\n let currentIndex = 0;\n let index = text.toLowerCase().indexOf(search.toLowerCase(), currentIndex);\n let i = 0;\n while (index > -1 && i < text.length) {\n currentIndex = index + search.length;\n ranges.push({ start: index, end: currentIndex });\n index = text.toLowerCase().indexOf(search.toLowerCase(), currentIndex);\n i++;\n }\n return ranges;\n};\nconst _sfc_main = {\n name: \"NcHighlight\",\n props: {\n /**\n * The string to display\n */\n text: {\n type: String,\n default: \"\"\n },\n /**\n * The string to match and highlight\n */\n search: {\n type: String,\n default: \"\"\n },\n /**\n * The ranges to highlight, takes precedence over the search prop.\n */\n highlight: {\n type: Array,\n default: () => []\n }\n },\n computed: {\n /**\n * The indice ranges which should be highlighted.\n * If an array with ranges is provided, we use it. Otherwise\n * we calculate it based on the provided substring to highlight.\n *\n * @return {Array} The array of ranges to highlight\n */\n ranges() {\n let ranges = [];\n if (!this.search && this.highlight.length === 0) {\n return ranges;\n }\n if (this.highlight.length > 0) {\n ranges = this.highlight;\n } else {\n ranges = FindRanges(this.text, this.search);\n }\n ranges.forEach((range, i) => {\n if (range.end < range.start) {\n ranges[i] = {\n start: range.end,\n end: range.start\n };\n }\n });\n ranges = ranges.reduce((validRanges, range) => {\n if (range.start < this.text.length && range.end > 0) {\n validRanges.push({\n start: range.start < 0 ? 0 : range.start,\n end: range.end > this.text.length ? this.text.length : range.end\n });\n }\n return validRanges;\n }, []);\n ranges.sort((a, b) => {\n return a.start - b.start;\n });\n ranges = ranges.reduce((mergedRanges, range) => {\n if (!mergedRanges.length) {\n mergedRanges.push(range);\n } else {\n const idx = mergedRanges.length - 1;\n if (mergedRanges[idx].end >= range.start) {\n mergedRanges[idx] = {\n start: mergedRanges[idx].start,\n end: Math.max(mergedRanges[idx].end, range.end)\n };\n } else {\n mergedRanges.push(range);\n }\n }\n return mergedRanges;\n }, []);\n return ranges;\n },\n /**\n * Calculate the different chunks to show based on the ranges to highlight.\n *\n * @return {Array} The chunks\n */\n chunks() {\n if (this.ranges.length === 0) {\n return [{\n start: 0,\n end: this.text.length,\n highlight: false,\n text: this.text\n }];\n }\n const chunks = [];\n let currentIndex = 0;\n let currentRange = 0;\n while (currentIndex < this.text.length) {\n const range = this.ranges[currentRange];\n if (range.start === currentIndex) {\n chunks.push({\n ...range,\n highlight: true,\n text: this.text.slice(range.start, range.end)\n });\n currentRange++;\n currentIndex = range.end;\n if (currentRange >= this.ranges.length && currentIndex < this.text.length) {\n chunks.push({\n start: currentIndex,\n end: this.text.length,\n highlight: false,\n text: this.text.slice(currentIndex)\n });\n currentIndex = this.text.length;\n }\n continue;\n }\n chunks.push({\n start: currentIndex,\n end: range.start,\n highlight: false,\n text: this.text.slice(currentIndex, range.start)\n });\n currentIndex = range.start;\n }\n return chunks;\n }\n },\n /**\n * The render function to display the component\n *\n * @param {Function} h The function to create VNodes\n * @return {object} The created VNode\n */\n render(h) {\n if (!this.ranges.length) {\n return h(\"span\", {}, this.text);\n }\n return h(\"span\", {}, this.chunks.map((chunk) => {\n return chunk.highlight ? h(\"strong\", {}, chunk.text) : chunk.text;\n }));\n }\n};\nconst _sfc_render = null;\nconst _sfc_staticRenderFns = null;\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n null\n);\nconst NcHighlight = __component__.exports;\nexport {\n FindRanges as F,\n NcHighlight as N\n};\n","import '../assets/NcEllipsisedOption-DZK2vWD1.css';\nimport { N as NcHighlight, F as FindRanges } from \"../chunks/index-Bz6q9mZw.mjs\";\nimport { n as normalizeComponent } from \"../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n name: \"NcEllipsisedOption\",\n components: {\n NcHighlight\n },\n props: {\n /**\n * The text to be display in one line. If it is longer than 10 characters, it is be truncated with ellipsis in the end but keeping up to 10 last characters to fit the parent container.\n */\n name: {\n type: String,\n default: \"\"\n },\n /**\n * The search value to highlight in the text\n */\n search: {\n type: String,\n default: \"\"\n }\n },\n computed: {\n needsTruncate() {\n return this.name && this.name.length >= 10;\n },\n /**\n * Index at which to split the name if it is longer than 10 characters.\n *\n * @return {number} The position at which to split\n */\n split() {\n return this.name.length - Math.min(Math.floor(this.name.length / 2), 10);\n },\n part1() {\n if (this.needsTruncate) {\n return this.name.slice(0, this.split);\n }\n return this.name;\n },\n part2() {\n if (this.needsTruncate) {\n return this.name.slice(this.split);\n }\n return \"\";\n },\n /**\n * The ranges to highlight. Since we split the string for ellipsising,\n * the Highlight component cannot figure this out itself and needs the ranges provided.\n *\n * @return {Array} The array with the ranges to highlight\n */\n highlight1() {\n if (!this.search) {\n return [];\n }\n return FindRanges(this.name, this.search);\n },\n /**\n * We shift the ranges for the second part by the position of the split.\n * Ranges out of the string length are discarded by the Highlight component,\n * so we don't need to take care of this here.\n *\n * @return {Array} The array with the ranges to highlight\n */\n highlight2() {\n return this.highlight1.map((range) => {\n return {\n start: range.start - this.split,\n end: range.end - this.split\n };\n });\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", { staticClass: \"name-parts\", attrs: { \"title\": _vm.name } }, [_c(\"NcHighlight\", { staticClass: \"name-parts__first\", attrs: { \"text\": _vm.part1, \"search\": _vm.search, \"highlight\": _vm.highlight1 } }), _vm.part2 ? _c(\"NcHighlight\", { staticClass: \"name-parts__last\", attrs: { \"text\": _vm.part2, \"search\": _vm.search, \"highlight\": _vm.highlight2 } }) : _vm._e()], 1);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"0c4478a6\"\n);\nconst NcEllipsisedOption = __component__.exports;\nexport {\n NcEllipsisedOption as default\n};\n","import '../assets/NcActionRouter-DidTlbov.css';\nimport { A as ActionTextMixin } from \"../chunks/actionText-fFcUPi2g.mjs\";\nimport { n as normalizeComponent } from \"../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n name: \"NcActionRouter\",\n mixins: [ActionTextMixin],\n inject: {\n isInSemanticMenu: {\n from: \"NcActions:isSemanticMenu\",\n default: false\n }\n },\n props: {\n /**\n * router-link to prop [https://router.vuejs.org/api/#to](https://router.vuejs.org/api/#to)\n */\n to: {\n type: [String, Object],\n default: \"\",\n required: true\n },\n /**\n * router-link exact prop [https://router.vuejs.org/api/#exact](https://router.vuejs.org/api/#exact)\n */\n exact: {\n type: Boolean,\n default: false\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"li\", { staticClass: \"action\", attrs: { \"role\": _vm.isInSemanticMenu && \"presentation\" } }, [_c(\"RouterLink\", { staticClass: \"action-router focusable\", attrs: { \"to\": _vm.to, \"aria-label\": _vm.ariaLabel, \"exact\": _vm.exact, \"title\": _vm.title, \"rel\": \"nofollow noreferrer noopener\", \"role\": _vm.isInSemanticMenu && \"menuitem\" }, nativeOn: { \"click\": function($event) {\n return _vm.onClick.apply(null, arguments);\n } } }, [_vm._t(\"icon\", function() {\n return [_c(\"span\", { staticClass: \"action-router__icon\", class: [_vm.isIconUrl ? \"action-router__icon--url\" : _vm.icon], style: { backgroundImage: _vm.isIconUrl ? \"url(\".concat(_vm.icon, \")\") : null }, attrs: { \"aria-hidden\": \"true\" } })];\n }), _vm.name ? _c(\"span\", { staticClass: \"action-router__longtext-wrapper\" }, [_c(\"strong\", { staticClass: \"action-router__name\" }, [_vm._v(\" \" + _vm._s(_vm.name) + \" \")]), _c(\"br\"), _c(\"span\", { staticClass: \"action-router__longtext\", domProps: { \"textContent\": _vm._s(_vm.text) } })]) : _vm.isLongText ? _c(\"span\", { staticClass: \"action-router__longtext\", domProps: { \"textContent\": _vm._s(_vm.text) } }) : _c(\"span\", { staticClass: \"action-router__text\" }, [_vm._v(_vm._s(_vm.text))]), _vm._e()], 2)], 1);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"579c6b4d\"\n);\nconst NcActionRouter = __component__.exports;\nexport {\n NcActionRouter as default\n};\n","import '../assets/NcActionText-DCx1DWXe.css';\nimport { A as ActionTextMixin } from \"../chunks/actionText-fFcUPi2g.mjs\";\nimport { n as normalizeComponent } from \"../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n name: \"NcActionText\",\n mixins: [ActionTextMixin],\n inject: {\n isInSemanticMenu: {\n from: \"NcActions:isSemanticMenu\",\n default: false\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"li\", { staticClass: \"action\", attrs: { \"role\": _vm.isInSemanticMenu && \"presentation\" } }, [_c(\"span\", { staticClass: \"action-text\", on: { \"click\": _vm.onClick } }, [_vm._t(\"icon\", function() {\n return [_vm.icon !== \"\" ? _c(\"span\", { staticClass: \"action-text__icon\", class: [_vm.isIconUrl ? \"action-text__icon--url\" : _vm.icon], style: { backgroundImage: _vm.isIconUrl ? \"url(\".concat(_vm.icon, \")\") : null }, attrs: { \"aria-hidden\": \"true\" } }) : _vm._e()];\n }), _vm.name ? _c(\"span\", { staticClass: \"action-text__longtext-wrapper\" }, [_c(\"strong\", { staticClass: \"action-text__name\" }, [_vm._v(\" \" + _vm._s(_vm.name) + \" \")]), _c(\"br\"), _c(\"span\", { staticClass: \"action-text__longtext\", domProps: { \"textContent\": _vm._s(_vm.text) } })]) : _vm.isLongText ? _c(\"span\", { staticClass: \"action-text__longtext\", domProps: { \"textContent\": _vm._s(_vm.text) } }) : _c(\"span\", { staticClass: \"action-text__text\" }, [_vm._v(_vm._s(_vm.text))]), _vm._e()], 2)]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"824615f4\"\n);\nconst NcActionText = __component__.exports;\nexport {\n NcActionText as default\n};\n","import '../assets/NcLoadingIcon-BSONDy7x.css';\nimport { n as normalizeComponent } from \"../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n name: \"NcLoadingIcon\",\n props: {\n /**\n * Specify the size of the loading icon.\n */\n size: {\n type: Number,\n default: 20\n },\n /**\n * The appearance of the loading icon.\n * 'auto' adjusts to the Nextcloud color scheme,\n * 'light' and 'dark' are static.\n */\n appearance: {\n type: String,\n validator(value) {\n return [\"auto\", \"light\", \"dark\"].includes(value);\n },\n default: \"auto\"\n },\n /**\n * Specify what is loading.\n */\n name: {\n type: String,\n default: \"\"\n }\n },\n computed: {\n colors() {\n const colors = [\"#777\", \"#CCC\"];\n if (this.appearance === \"light\") {\n return colors;\n } else if (this.appearance === \"dark\") {\n return colors.reverse();\n }\n return [\"var(--color-loading-light)\", \"var(--color-loading-dark)\"];\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", { staticClass: \"material-design-icon loading-icon\", attrs: { \"aria-label\": _vm.name, \"role\": \"img\" } }, [_c(\"svg\", { attrs: { \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"fill\": _vm.colors[0], \"d\": \"M12,4V2A10,10 0 1,0 22,12H20A8,8 0 1,1 12,4Z\" } }), _c(\"path\", { attrs: { \"fill\": _vm.colors[1], \"d\": \"M12,4V2A10,10 0 0,1 22,12H20A8,8 0 0,0 12,4Z\" } }, [_vm.name ? _c(\"title\", [_vm._v(_vm._s(_vm.name))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"551209a3\"\n);\nconst NcLoadingIcon = __component__.exports;\nexport {\n NcLoadingIcon as default\n};\n","import '../assets/NcUserStatusIcon-DMxcdM51.css';\nimport axios from \"@nextcloud/axios\";\nimport { generateOcsUrl } from \"@nextcloud/router\";\nimport { getCapabilities } from \"@nextcloud/capabilities\";\nimport { r as register, M as t11, a as t, N as t48 } from \"./_l10n-B4dEPXsr.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst onlineSvg = '\\n\\n\t\\n\\n';\nconst awaySvg = '\\n\\n\t\\n\t\\n\\n';\nconst dndSvg = '\\n\\n\t\\n\t\\n\t\\n\\n';\nconst invisibleSvg = '\\n\\n\t\\n\t\\n\\n';\nregister(t11);\nconst getUserStatusText = (status) => {\n switch (status) {\n case \"away\":\n return t(\"away\");\n case \"busy\":\n return t(\"busy\");\n case \"dnd\":\n return t(\"do not disturb\");\n case \"online\":\n return t(\"online\");\n case \"invisible\":\n return t(\"invisible\");\n case \"offline\":\n return t(\"offline\");\n default:\n return status;\n }\n};\nregister(t48);\nconst _sfc_main = {\n name: \"NcUserStatusIcon\",\n props: {\n /**\n * Set the user id to fetch the status\n */\n user: {\n type: String,\n default: null\n },\n /**\n * Set the status\n *\n * @type {'online' | 'away' | 'busy' | 'dnd' | 'invisible' | 'offline'}\n */\n status: {\n type: String,\n default: null,\n validator: (value) => [\n \"online\",\n \"away\",\n \"busy\",\n \"dnd\",\n \"invisible\",\n \"offline\"\n ].includes(value)\n },\n /**\n * Set the `aria-hidden` attribute\n *\n * @type {'true' | 'false'}\n */\n ariaHidden: {\n type: String,\n default: null,\n validator: (value) => [\n \"true\",\n \"false\"\n ].includes(value)\n }\n },\n data() {\n return {\n fetchedUserStatus: null\n };\n },\n computed: {\n activeStatus() {\n var _a;\n return (_a = this.status) != null ? _a : this.fetchedUserStatus;\n },\n activeSvg() {\n var _a;\n const matchSvg = {\n online: onlineSvg,\n away: awaySvg,\n busy: awaySvg,\n dnd: dndSvg,\n invisible: invisibleSvg,\n offline: invisibleSvg\n };\n return (_a = matchSvg[this.activeStatus]) != null ? _a : null;\n },\n ariaLabel() {\n if (this.ariaHidden === \"true\") {\n return null;\n }\n return t(\"User status: {status}\", { status: getUserStatusText(this.activeStatus) });\n }\n },\n watch: {\n user: {\n immediate: true,\n async handler(user, _oldUser) {\n var _a, _b, _c, _d;\n if (!user || !((_b = (_a = getCapabilities()) == null ? void 0 : _a.user_status) == null ? void 0 : _b.enabled)) {\n this.fetchedUserStatus = null;\n return;\n }\n try {\n const { data } = await axios.get(generateOcsUrl(\"/apps/user_status/api/v1/statuses/{user}\", { user }));\n this.fetchedUserStatus = (_d = (_c = data.ocs) == null ? void 0 : _c.data) == null ? void 0 : _d.status;\n } catch (error) {\n this.fetchedUserStatus = null;\n }\n }\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _vm.activeStatus ? _c(\"span\", { staticClass: \"user-status-icon\", class: {\n \"user-status-icon--invisible\": [\"invisible\", \"offline\"].includes(_vm.status)\n }, attrs: { \"role\": \"img\", \"aria-hidden\": _vm.ariaHidden, \"aria-label\": _vm.ariaLabel }, domProps: { \"innerHTML\": _vm._s(_vm.activeSvg) } }) : _vm._e();\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"0555d8d0\"\n);\nconst NcUserStatusIcon = __component__.exports;\nexport {\n NcUserStatusIcon as N,\n getUserStatusText as g\n};\n","import { r as register, t as t3, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nregister(t3);\nclass Color {\n /**\n * @param {number} r The red value\n * @param {number} g The green value\n * @param {number} b The blue value\n * @param {string} [name] The name of the color\n */\n constructor(r, g, b, name) {\n this.r = r;\n this.g = g;\n this.b = b;\n if (name) {\n this.name = name;\n }\n }\n get color() {\n const toHex = (num) => \"00\".concat(num.toString(16)).slice(-2);\n return \"#\".concat(toHex(this.r)).concat(toHex(this.g)).concat(toHex(this.b));\n }\n}\nfunction stepCalc(steps, ends) {\n const step = new Array(3);\n step[0] = (ends[1].r - ends[0].r) / steps;\n step[1] = (ends[1].g - ends[0].g) / steps;\n step[2] = (ends[1].b - ends[0].b) / steps;\n return step;\n}\nfunction mixPalette(steps, color1, color2) {\n const palette = [];\n palette.push(color1);\n const step = stepCalc(steps, [color1, color2]);\n for (let i = 1; i < steps; i++) {\n const r = Math.floor(color1.r + step[0] * i);\n const g = Math.floor(color1.g + step[1] * i);\n const b = Math.floor(color1.b + step[2] * i);\n palette.push(new Color(r, g, b));\n }\n return palette;\n}\nconst defaultPalette = [\n new Color(182, 70, 157, t(\"Purple\")),\n new Color(\n 191,\n 103,\n 139,\n t(\"Rosy brown\")\n // TRANSLATORS: A color name for RGB(191, 103, 139)\n ),\n new Color(\n 201,\n 136,\n 121,\n t(\"Feldspar\")\n // TRANSLATORS: A color name for RGB(201, 136, 121)\n ),\n new Color(\n 211,\n 169,\n 103,\n t(\"Whiskey\")\n // TRANSLATORS: A color name for RGB(211, 169, 103)\n ),\n new Color(\n 221,\n 203,\n 85,\n t(\"Gold\")\n ),\n new Color(\n 165,\n 184,\n 114,\n t(\"Olivine\")\n // TRANSLATORS: A color name for RGB(165, 184, 114)\n ),\n new Color(\n 110,\n 166,\n 143,\n t(\"Acapulco\")\n // TRANSLATORS: A color name for RGB(110, 166, 143)\n ),\n new Color(\n 55,\n 148,\n 172,\n t(\"Boston Blue\")\n // TRANSLATORS: A color name for RGB(55, 148, 172)\n ),\n new Color(\n 0,\n 130,\n 201,\n t(\"Nextcloud blue\")\n ),\n new Color(\n 45,\n 115,\n 190,\n t(\"Mariner\")\n // TRANSLATORS: A color name for RGB(45, 115, 190)\n ),\n new Color(\n 91,\n 100,\n 179,\n t(\"Blue Violet\")\n // TRANSLATORS: A color name for RGB(91, 100, 179)\n ),\n new Color(\n 136,\n 85,\n 168,\n t(\"Deluge\")\n // TRANSLATORS: A color name for RGB(136, 85, 168)\n )\n];\nfunction GenColors(steps) {\n const red = new Color(182, 70, 157, t(\"Purple\"));\n const yellow = new Color(221, 203, 85, t(\"Gold\"));\n const blue = new Color(0, 130, 201, t(\"Nextcloud blue\"));\n const palette1 = mixPalette(steps, red, yellow);\n const palette2 = mixPalette(steps, yellow, blue);\n const palette3 = mixPalette(steps, blue, red);\n return palette1.concat(palette2).concat(palette3);\n}\nexport {\n Color as C,\n GenColors as G,\n defaultPalette as d\n};\n","(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\n crypt = {\n // Bit-wise rotation left\n rotl: function(n, b) {\n return (n << b) | (n >>> (32 - b));\n },\n\n // Bit-wise rotation right\n rotr: function(n, b) {\n return (n << (32 - b)) | (n >>> b);\n },\n\n // Swap big-endian to little-endian and vice versa\n endian: function(n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++)\n n[i] = crypt.endian(n[i]);\n return n;\n },\n\n // Generate an array of any length of random bytes\n randomBytes: function(n) {\n for (var bytes = []; n > 0; n--)\n bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function(bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n return words;\n },\n\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function(words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8)\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a hex string\n bytesToHex: function(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n\n // Convert a hex string to a byte array\n hexToBytes: function(hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2)\n bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n\n // Convert a byte array to a base-64 string\n bytesToBase64: function(bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n for (var j = 0; j < 4; j++)\n if (i * 8 + j * 6 <= bytes.length * 8)\n base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\n else\n base64.push('=');\n }\n return base64.join('');\n },\n\n // Convert a base-64 string to a byte array\n base64ToBytes: function(base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length;\n imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push(((base64map.indexOf(base64.charAt(i - 1))\n & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))\n | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\n }\n return bytes;\n }\n };\n\n module.exports = crypt;\n})();\n","var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n for (var bytes = [], i = 0; i < str.length; i++)\n bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++)\n str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\n\nmodule.exports = charenc;\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","(function(){\r\n var crypt = require('crypt'),\r\n utf8 = require('charenc').utf8,\r\n isBuffer = require('is-buffer'),\r\n bin = require('charenc').bin,\r\n\r\n // The core\r\n md5 = function (message, options) {\r\n // Convert to byte array\r\n if (message.constructor == String)\r\n if (options && options.encoding === 'binary')\r\n message = bin.stringToBytes(message);\r\n else\r\n message = utf8.stringToBytes(message);\r\n else if (isBuffer(message))\r\n message = Array.prototype.slice.call(message, 0);\r\n else if (!Array.isArray(message) && message.constructor !== Uint8Array)\r\n message = message.toString();\r\n // else, assume byte array already\r\n\r\n var m = crypt.bytesToWords(message),\r\n l = message.length * 8,\r\n a = 1732584193,\r\n b = -271733879,\r\n c = -1732584194,\r\n d = 271733878;\r\n\r\n // Swap endian\r\n for (var i = 0; i < m.length; i++) {\r\n m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |\r\n ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;\r\n }\r\n\r\n // Padding\r\n m[l >>> 5] |= 0x80 << (l % 32);\r\n m[(((l + 64) >>> 9) << 4) + 14] = l;\r\n\r\n // Method shortcuts\r\n var FF = md5._ff,\r\n GG = md5._gg,\r\n HH = md5._hh,\r\n II = md5._ii;\r\n\r\n for (var i = 0; i < m.length; i += 16) {\r\n\r\n var aa = a,\r\n bb = b,\r\n cc = c,\r\n dd = d;\r\n\r\n a = FF(a, b, c, d, m[i+ 0], 7, -680876936);\r\n d = FF(d, a, b, c, m[i+ 1], 12, -389564586);\r\n c = FF(c, d, a, b, m[i+ 2], 17, 606105819);\r\n b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);\r\n a = FF(a, b, c, d, m[i+ 4], 7, -176418897);\r\n d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);\r\n c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);\r\n b = FF(b, c, d, a, m[i+ 7], 22, -45705983);\r\n a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);\r\n d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);\r\n c = FF(c, d, a, b, m[i+10], 17, -42063);\r\n b = FF(b, c, d, a, m[i+11], 22, -1990404162);\r\n a = FF(a, b, c, d, m[i+12], 7, 1804603682);\r\n d = FF(d, a, b, c, m[i+13], 12, -40341101);\r\n c = FF(c, d, a, b, m[i+14], 17, -1502002290);\r\n b = FF(b, c, d, a, m[i+15], 22, 1236535329);\r\n\r\n a = GG(a, b, c, d, m[i+ 1], 5, -165796510);\r\n d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);\r\n c = GG(c, d, a, b, m[i+11], 14, 643717713);\r\n b = GG(b, c, d, a, m[i+ 0], 20, -373897302);\r\n a = GG(a, b, c, d, m[i+ 5], 5, -701558691);\r\n d = GG(d, a, b, c, m[i+10], 9, 38016083);\r\n c = GG(c, d, a, b, m[i+15], 14, -660478335);\r\n b = GG(b, c, d, a, m[i+ 4], 20, -405537848);\r\n a = GG(a, b, c, d, m[i+ 9], 5, 568446438);\r\n d = GG(d, a, b, c, m[i+14], 9, -1019803690);\r\n c = GG(c, d, a, b, m[i+ 3], 14, -187363961);\r\n b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);\r\n a = GG(a, b, c, d, m[i+13], 5, -1444681467);\r\n d = GG(d, a, b, c, m[i+ 2], 9, -51403784);\r\n c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);\r\n b = GG(b, c, d, a, m[i+12], 20, -1926607734);\r\n\r\n a = HH(a, b, c, d, m[i+ 5], 4, -378558);\r\n d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);\r\n c = HH(c, d, a, b, m[i+11], 16, 1839030562);\r\n b = HH(b, c, d, a, m[i+14], 23, -35309556);\r\n a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);\r\n d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);\r\n c = HH(c, d, a, b, m[i+ 7], 16, -155497632);\r\n b = HH(b, c, d, a, m[i+10], 23, -1094730640);\r\n a = HH(a, b, c, d, m[i+13], 4, 681279174);\r\n d = HH(d, a, b, c, m[i+ 0], 11, -358537222);\r\n c = HH(c, d, a, b, m[i+ 3], 16, -722521979);\r\n b = HH(b, c, d, a, m[i+ 6], 23, 76029189);\r\n a = HH(a, b, c, d, m[i+ 9], 4, -640364487);\r\n d = HH(d, a, b, c, m[i+12], 11, -421815835);\r\n c = HH(c, d, a, b, m[i+15], 16, 530742520);\r\n b = HH(b, c, d, a, m[i+ 2], 23, -995338651);\r\n\r\n a = II(a, b, c, d, m[i+ 0], 6, -198630844);\r\n d = II(d, a, b, c, m[i+ 7], 10, 1126891415);\r\n c = II(c, d, a, b, m[i+14], 15, -1416354905);\r\n b = II(b, c, d, a, m[i+ 5], 21, -57434055);\r\n a = II(a, b, c, d, m[i+12], 6, 1700485571);\r\n d = II(d, a, b, c, m[i+ 3], 10, -1894986606);\r\n c = II(c, d, a, b, m[i+10], 15, -1051523);\r\n b = II(b, c, d, a, m[i+ 1], 21, -2054922799);\r\n a = II(a, b, c, d, m[i+ 8], 6, 1873313359);\r\n d = II(d, a, b, c, m[i+15], 10, -30611744);\r\n c = II(c, d, a, b, m[i+ 6], 15, -1560198380);\r\n b = II(b, c, d, a, m[i+13], 21, 1309151649);\r\n a = II(a, b, c, d, m[i+ 4], 6, -145523070);\r\n d = II(d, a, b, c, m[i+11], 10, -1120210379);\r\n c = II(c, d, a, b, m[i+ 2], 15, 718787259);\r\n b = II(b, c, d, a, m[i+ 9], 21, -343485551);\r\n\r\n a = (a + aa) >>> 0;\r\n b = (b + bb) >>> 0;\r\n c = (c + cc) >>> 0;\r\n d = (d + dd) >>> 0;\r\n }\r\n\r\n return crypt.endian([a, b, c, d]);\r\n };\r\n\r\n // Auxiliary functions\r\n md5._ff = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & c | ~b & d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._gg = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & d | c & ~d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._hh = function (a, b, c, d, x, s, t) {\r\n var n = a + (b ^ c ^ d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._ii = function (a, b, c, d, x, s, t) {\r\n var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n\r\n // Package private blocksize\r\n md5._blocksize = 16;\r\n md5._digestsize = 16;\r\n\r\n module.exports = function (message, options) {\r\n if (message === undefined || message === null)\r\n throw new Error('Illegal argument ' + message);\r\n\r\n var digestbytes = crypt.wordsToBytes(md5(message, options));\r\n return options && options.asBytes ? digestbytes :\r\n options && options.asString ? bin.bytesToString(digestbytes) :\r\n crypt.bytesToHex(digestbytes);\r\n };\r\n\r\n})();\r\n","import { G as GenColors } from \"./GenColors-u1W5WMXj.mjs\";\nimport md5 from \"md5\";\nconst usernameToColor = function(username) {\n let hash = username.toLowerCase();\n if (hash.match(/^([0-9a-f]{4}-?){8}$/) === null) {\n hash = md5(hash);\n }\n hash = hash.replace(/[^0-9a-f]/g, \"\");\n const steps = 6;\n const finalPalette = GenColors(steps);\n function hashToInt(hash2, maximum) {\n let finalInt = 0;\n const result = [];\n for (let i = 0; i < hash2.length; i++) {\n result.push(parseInt(hash2.charAt(i), 16) % 16);\n }\n for (const j in result) {\n finalInt += result[j];\n }\n return parseInt(parseInt(finalInt, 10) % maximum, 10);\n }\n return finalPalette[hashToInt(hash, steps * 3)];\n};\nexport {\n usernameToColor as u\n};\n","import { generateUrl } from \"@nextcloud/router\";\nconst getAvatarUrl = (user, size, isGuest) => {\n const darkTheme = window.getComputedStyle(document.body).getPropertyValue(\"--background-invert-if-dark\") === \"invert(100%)\";\n return generateUrl(\"/avatar\" + (isGuest ? \"/guest\" : \"\") + \"/{user}/{size}\" + (darkTheme ? \"/dark\" : \"\"), {\n user,\n size\n });\n};\nexport {\n getAvatarUrl as g\n};\n","// THIS FILE IS AUTOMATICALLY GENERATED DO NOT EDIT DIRECTLY\n// See update-tlds.js for encoding/decoding format\n// https://data.iana.org/TLD/tlds-alpha-by-domain.txt\nconst encodedTlds = 'aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2';\n// Internationalized domain names containing non-ASCII\nconst encodedUtlds = 'ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2';\n\n/**\n * @template A\n * @template B\n * @param {A} target\n * @param {B} properties\n * @return {A & B}\n */\nconst assign = (target, properties) => {\n for (const key in properties) {\n target[key] = properties[key];\n }\n return target;\n};\n\n/**\n * Finite State Machine generation utilities\n */\n\n/**\n * @template T\n * @typedef {{ [group: string]: T[] }} Collections\n */\n\n/**\n * @typedef {{ [group: string]: true }} Flags\n */\n\n// Keys in scanner Collections instances\nconst numeric = 'numeric';\nconst ascii = 'ascii';\nconst alpha = 'alpha';\nconst asciinumeric = 'asciinumeric';\nconst alphanumeric = 'alphanumeric';\nconst domain = 'domain';\nconst emoji = 'emoji';\nconst scheme = 'scheme';\nconst slashscheme = 'slashscheme';\nconst whitespace = 'whitespace';\n\n/**\n * @template T\n * @param {string} name\n * @param {Collections} groups to register in\n * @returns {T[]} Current list of tokens in the given collection\n */\nfunction registerGroup(name, groups) {\n if (!(name in groups)) {\n groups[name] = [];\n }\n return groups[name];\n}\n\n/**\n * @template T\n * @param {T} t token to add\n * @param {Collections} groups\n * @param {Flags} flags\n */\nfunction addToGroups(t, flags, groups) {\n if (flags[numeric]) {\n flags[asciinumeric] = true;\n flags[alphanumeric] = true;\n }\n if (flags[ascii]) {\n flags[asciinumeric] = true;\n flags[alpha] = true;\n }\n if (flags[asciinumeric]) {\n flags[alphanumeric] = true;\n }\n if (flags[alpha]) {\n flags[alphanumeric] = true;\n }\n if (flags[alphanumeric]) {\n flags[domain] = true;\n }\n if (flags[emoji]) {\n flags[domain] = true;\n }\n for (const k in flags) {\n const group = registerGroup(k, groups);\n if (group.indexOf(t) < 0) {\n group.push(t);\n }\n }\n}\n\n/**\n * @template T\n * @param {T} t token to check\n * @param {Collections} groups\n * @returns {Flags} group flags that contain this token\n */\nfunction flagsForToken(t, groups) {\n const result = {};\n for (const c in groups) {\n if (groups[c].indexOf(t) >= 0) {\n result[c] = true;\n }\n }\n return result;\n}\n\n/**\n * @template T\n * @typedef {null | T } Transition\n */\n\n/**\n * Define a basic state machine state. j is the list of character transitions,\n * jr is the list of regex-match transitions, jd is the default state to\n * transition to t is the accepting token type, if any. If this is the terminal\n * state, then it does not emit a token.\n *\n * The template type T represents the type of the token this state accepts. This\n * should be a string (such as of the token exports in `text.js`) or a\n * MultiToken subclass (from `multi.js`)\n *\n * @template T\n * @param {T} [token] Token that this state emits\n */\nfunction State(token) {\n if (token === void 0) {\n token = null;\n }\n // this.n = null; // DEBUG: State name\n /** @type {{ [input: string]: State }} j */\n this.j = {}; // IMPLEMENTATION 1\n // this.j = []; // IMPLEMENTATION 2\n /** @type {[RegExp, State][]} jr */\n this.jr = [];\n /** @type {?State} jd */\n this.jd = null;\n /** @type {?T} t */\n this.t = token;\n}\n\n/**\n * Scanner token groups\n * @type Collections\n */\nState.groups = {};\nState.prototype = {\n accepts() {\n return !!this.t;\n },\n /**\n * Follow an existing transition from the given input to the next state.\n * Does not mutate.\n * @param {string} input character or token type to transition on\n * @returns {?State} the next state, if any\n */\n go(input) {\n const state = this;\n const nextState = state.j[input];\n if (nextState) {\n return nextState;\n }\n for (let i = 0; i < state.jr.length; i++) {\n const regex = state.jr[i][0];\n const nextState = state.jr[i][1]; // note: might be empty to prevent default jump\n if (nextState && regex.test(input)) {\n return nextState;\n }\n }\n // Nowhere left to jump! Return default, if any\n return state.jd;\n },\n /**\n * Whether the state has a transition for the given input. Set the second\n * argument to true to only look for an exact match (and not a default or\n * regular-expression-based transition)\n * @param {string} input\n * @param {boolean} exactOnly\n */\n has(input, exactOnly) {\n if (exactOnly === void 0) {\n exactOnly = false;\n }\n return exactOnly ? input in this.j : !!this.go(input);\n },\n /**\n * Short for \"transition all\"; create a transition from the array of items\n * in the given list to the same final resulting state.\n * @param {string | string[]} inputs Group of inputs to transition on\n * @param {Transition | State} [next] Transition options\n * @param {Flags} [flags] Collections flags to add token to\n * @param {Collections} [groups] Master list of token groups\n */\n ta(inputs, next, flags, groups) {\n for (let i = 0; i < inputs.length; i++) {\n this.tt(inputs[i], next, flags, groups);\n }\n },\n /**\n * Short for \"take regexp transition\"; defines a transition for this state\n * when it encounters a token which matches the given regular expression\n * @param {RegExp} regexp Regular expression transition (populate first)\n * @param {T | State} [next] Transition options\n * @param {Flags} [flags] Collections flags to add token to\n * @param {Collections} [groups] Master list of token groups\n * @returns {State} taken after the given input\n */\n tr(regexp, next, flags, groups) {\n groups = groups || State.groups;\n let nextState;\n if (next && next.j) {\n nextState = next;\n } else {\n // Token with maybe token groups\n nextState = new State(next);\n if (flags && groups) {\n addToGroups(next, flags, groups);\n }\n }\n this.jr.push([regexp, nextState]);\n return nextState;\n },\n /**\n * Short for \"take transitions\", will take as many sequential transitions as\n * the length of the given input and returns the\n * resulting final state.\n * @param {string | string[]} input\n * @param {T | State} [next] Transition options\n * @param {Flags} [flags] Collections flags to add token to\n * @param {Collections} [groups] Master list of token groups\n * @returns {State} taken after the given input\n */\n ts(input, next, flags, groups) {\n let state = this;\n const len = input.length;\n if (!len) {\n return state;\n }\n for (let i = 0; i < len - 1; i++) {\n state = state.tt(input[i]);\n }\n return state.tt(input[len - 1], next, flags, groups);\n },\n /**\n * Short for \"take transition\", this is a method for building/working with\n * state machines.\n *\n * If a state already exists for the given input, returns it.\n *\n * If a token is specified, that state will emit that token when reached by\n * the linkify engine.\n *\n * If no state exists, it will be initialized with some default transitions\n * that resemble existing default transitions.\n *\n * If a state is given for the second argument, that state will be\n * transitioned to on the given input regardless of what that input\n * previously did.\n *\n * Specify a token group flags to define groups that this token belongs to.\n * The token will be added to corresponding entires in the given groups\n * object.\n *\n * @param {string} input character, token type to transition on\n * @param {T | State} [next] Transition options\n * @param {Flags} [flags] Collections flags to add token to\n * @param {Collections} [groups] Master list of groups\n * @returns {State} taken after the given input\n */\n tt(input, next, flags, groups) {\n groups = groups || State.groups;\n const state = this;\n\n // Check if existing state given, just a basic transition\n if (next && next.j) {\n state.j[input] = next;\n return next;\n }\n const t = next;\n\n // Take the transition with the usual default mechanisms and use that as\n // a template for creating the next state\n let nextState,\n templateState = state.go(input);\n if (templateState) {\n nextState = new State();\n assign(nextState.j, templateState.j);\n nextState.jr.push.apply(nextState.jr, templateState.jr);\n nextState.jd = templateState.jd;\n nextState.t = templateState.t;\n } else {\n nextState = new State();\n }\n if (t) {\n // Ensure newly token is in the same groups as the old token\n if (groups) {\n if (nextState.t && typeof nextState.t === 'string') {\n const allFlags = assign(flagsForToken(nextState.t, groups), flags);\n addToGroups(t, allFlags, groups);\n } else if (flags) {\n addToGroups(t, flags, groups);\n }\n }\n nextState.t = t; // overwrite anything that was previously there\n }\n\n state.j[input] = nextState;\n return nextState;\n }\n};\n\n// Helper functions to improve minification (not exported outside linkifyjs module)\n\n/**\n * @template T\n * @param {State} state\n * @param {string | string[]} input\n * @param {Flags} [flags]\n * @param {Collections} [groups]\n */\nconst ta = (state, input, next, flags, groups) => state.ta(input, next, flags, groups);\n\n/**\n * @template T\n * @param {State} state\n * @param {RegExp} regexp\n * @param {T | State} [next]\n * @param {Flags} [flags]\n * @param {Collections} [groups]\n */\nconst tr = (state, regexp, next, flags, groups) => state.tr(regexp, next, flags, groups);\n\n/**\n * @template T\n * @param {State} state\n * @param {string | string[]} input\n * @param {T | State} [next]\n * @param {Flags} [flags]\n * @param {Collections} [groups]\n */\nconst ts = (state, input, next, flags, groups) => state.ts(input, next, flags, groups);\n\n/**\n * @template T\n * @param {State} state\n * @param {string} input\n * @param {T | State} [next]\n * @param {Collections} [groups]\n * @param {Flags} [flags]\n */\nconst tt = (state, input, next, flags, groups) => state.tt(input, next, flags, groups);\n\n/******************************************************************************\nText Tokens\nIdentifiers for token outputs from the regexp scanner\n******************************************************************************/\n\n// A valid web domain token\nconst WORD = 'WORD'; // only contains a-z\nconst UWORD = 'UWORD'; // contains letters other than a-z, used for IDN\n\n// Special case of word\nconst LOCALHOST = 'LOCALHOST';\n\n// Valid top-level domain, special case of WORD (see tlds.js)\nconst TLD = 'TLD';\n\n// Valid IDN TLD, special case of UWORD (see tlds.js)\nconst UTLD = 'UTLD';\n\n// The scheme portion of a web URI protocol. Supported types include: `mailto`,\n// `file`, and user-defined custom protocols. Limited to schemes that contain\n// only letters\nconst SCHEME = 'SCHEME';\n\n// Similar to SCHEME, except makes distinction for schemes that must always be\n// followed by `://`, not just `:`. Supported types include `http`, `https`,\n// `ftp`, `ftps`\nconst SLASH_SCHEME = 'SLASH_SCHEME';\n\n// Any sequence of digits 0-9\nconst NUM = 'NUM';\n\n// Any number of consecutive whitespace characters that are not newline\nconst WS = 'WS';\n\n// New line (unix style)\nconst NL$1 = 'NL'; // \\n\n\n// Opening/closing bracket classes\n// TODO: Rename OPEN -> LEFT and CLOSE -> RIGHT in v5 to fit with Unicode names\n// Also rename angle brackes to LESSTHAN and GREATER THAN\nconst OPENBRACE = 'OPENBRACE'; // {\nconst CLOSEBRACE = 'CLOSEBRACE'; // }\nconst OPENBRACKET = 'OPENBRACKET'; // [\nconst CLOSEBRACKET = 'CLOSEBRACKET'; // ]\nconst OPENPAREN = 'OPENPAREN'; // (\nconst CLOSEPAREN = 'CLOSEPAREN'; // )\nconst OPENANGLEBRACKET = 'OPENANGLEBRACKET'; // <\nconst CLOSEANGLEBRACKET = 'CLOSEANGLEBRACKET'; // >\nconst FULLWIDTHLEFTPAREN = 'FULLWIDTHLEFTPAREN'; // (\nconst FULLWIDTHRIGHTPAREN = 'FULLWIDTHRIGHTPAREN'; // )\nconst LEFTCORNERBRACKET = 'LEFTCORNERBRACKET'; // 「\nconst RIGHTCORNERBRACKET = 'RIGHTCORNERBRACKET'; // 」\nconst LEFTWHITECORNERBRACKET = 'LEFTWHITECORNERBRACKET'; // 『\nconst RIGHTWHITECORNERBRACKET = 'RIGHTWHITECORNERBRACKET'; // 』\nconst FULLWIDTHLESSTHAN = 'FULLWIDTHLESSTHAN'; // <\nconst FULLWIDTHGREATERTHAN = 'FULLWIDTHGREATERTHAN'; // >\n\n// Various symbols\nconst AMPERSAND = 'AMPERSAND'; // &\nconst APOSTROPHE = 'APOSTROPHE'; // '\nconst ASTERISK = 'ASTERISK'; // *\nconst AT = 'AT'; // @\nconst BACKSLASH = 'BACKSLASH'; // \\\nconst BACKTICK = 'BACKTICK'; // `\nconst CARET = 'CARET'; // ^\nconst COLON = 'COLON'; // :\nconst COMMA = 'COMMA'; // ,\nconst DOLLAR = 'DOLLAR'; // $\nconst DOT = 'DOT'; // .\nconst EQUALS = 'EQUALS'; // =\nconst EXCLAMATION = 'EXCLAMATION'; // !\nconst HYPHEN = 'HYPHEN'; // -\nconst PERCENT = 'PERCENT'; // %\nconst PIPE = 'PIPE'; // |\nconst PLUS = 'PLUS'; // +\nconst POUND = 'POUND'; // #\nconst QUERY = 'QUERY'; // ?\nconst QUOTE = 'QUOTE'; // \"\n\nconst SEMI = 'SEMI'; // ;\nconst SLASH = 'SLASH'; // /\nconst TILDE = 'TILDE'; // ~\nconst UNDERSCORE = 'UNDERSCORE'; // _\n\n// Emoji symbol\nconst EMOJI$1 = 'EMOJI';\n\n// Default token - anything that is not one of the above\nconst SYM = 'SYM';\n\nvar tk = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tWORD: WORD,\n\tUWORD: UWORD,\n\tLOCALHOST: LOCALHOST,\n\tTLD: TLD,\n\tUTLD: UTLD,\n\tSCHEME: SCHEME,\n\tSLASH_SCHEME: SLASH_SCHEME,\n\tNUM: NUM,\n\tWS: WS,\n\tNL: NL$1,\n\tOPENBRACE: OPENBRACE,\n\tCLOSEBRACE: CLOSEBRACE,\n\tOPENBRACKET: OPENBRACKET,\n\tCLOSEBRACKET: CLOSEBRACKET,\n\tOPENPAREN: OPENPAREN,\n\tCLOSEPAREN: CLOSEPAREN,\n\tOPENANGLEBRACKET: OPENANGLEBRACKET,\n\tCLOSEANGLEBRACKET: CLOSEANGLEBRACKET,\n\tFULLWIDTHLEFTPAREN: FULLWIDTHLEFTPAREN,\n\tFULLWIDTHRIGHTPAREN: FULLWIDTHRIGHTPAREN,\n\tLEFTCORNERBRACKET: LEFTCORNERBRACKET,\n\tRIGHTCORNERBRACKET: RIGHTCORNERBRACKET,\n\tLEFTWHITECORNERBRACKET: LEFTWHITECORNERBRACKET,\n\tRIGHTWHITECORNERBRACKET: RIGHTWHITECORNERBRACKET,\n\tFULLWIDTHLESSTHAN: FULLWIDTHLESSTHAN,\n\tFULLWIDTHGREATERTHAN: FULLWIDTHGREATERTHAN,\n\tAMPERSAND: AMPERSAND,\n\tAPOSTROPHE: APOSTROPHE,\n\tASTERISK: ASTERISK,\n\tAT: AT,\n\tBACKSLASH: BACKSLASH,\n\tBACKTICK: BACKTICK,\n\tCARET: CARET,\n\tCOLON: COLON,\n\tCOMMA: COMMA,\n\tDOLLAR: DOLLAR,\n\tDOT: DOT,\n\tEQUALS: EQUALS,\n\tEXCLAMATION: EXCLAMATION,\n\tHYPHEN: HYPHEN,\n\tPERCENT: PERCENT,\n\tPIPE: PIPE,\n\tPLUS: PLUS,\n\tPOUND: POUND,\n\tQUERY: QUERY,\n\tQUOTE: QUOTE,\n\tSEMI: SEMI,\n\tSLASH: SLASH,\n\tTILDE: TILDE,\n\tUNDERSCORE: UNDERSCORE,\n\tEMOJI: EMOJI$1,\n\tSYM: SYM\n});\n\n// Note that these two Unicode ones expand into a really big one with Babel\nconst ASCII_LETTER = /[a-z]/;\nconst LETTER = /\\p{L}/u; // Any Unicode character with letter data type\nconst EMOJI = /\\p{Emoji}/u; // Any Unicode emoji character\nconst EMOJI_VARIATION$1 = /\\ufe0f/;\nconst DIGIT = /\\d/;\nconst SPACE = /\\s/;\n\nvar regexp = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tASCII_LETTER: ASCII_LETTER,\n\tLETTER: LETTER,\n\tEMOJI: EMOJI,\n\tEMOJI_VARIATION: EMOJI_VARIATION$1,\n\tDIGIT: DIGIT,\n\tSPACE: SPACE\n});\n\n/**\n\tThe scanner provides an interface that takes a string of text as input, and\n\toutputs an array of tokens instances that can be used for easy URL parsing.\n*/\nconst NL = '\\n'; // New line character\nconst EMOJI_VARIATION = '\\ufe0f'; // Variation selector, follows heart and others\nconst EMOJI_JOINER = '\\u200d'; // zero-width joiner\n\nlet tlds = null,\n utlds = null; // don't change so only have to be computed once\n\n/**\n * Scanner output token:\n * - `t` is the token name (e.g., 'NUM', 'EMOJI', 'TLD')\n * - `v` is the value of the token (e.g., '123', '❤️', 'com')\n * - `s` is the start index of the token in the original string\n * - `e` is the end index of the token in the original string\n * @typedef {{t: string, v: string, s: number, e: number}} Token\n */\n\n/**\n * @template T\n * @typedef {{ [collection: string]: T[] }} Collections\n */\n\n/**\n * Initialize the scanner character-based state machine for the given start\n * state\n * @param {[string, boolean][]} customSchemes List of custom schemes, where each\n * item is a length-2 tuple with the first element set to the string scheme, and\n * the second element set to `true` if the `://` after the scheme is optional\n */\nfunction init$2(customSchemes) {\n if (customSchemes === void 0) {\n customSchemes = [];\n }\n // Frequently used states (name argument removed during minification)\n /** @type Collections */\n const groups = {}; // of tokens\n State.groups = groups;\n /** @type State */\n const Start = new State();\n if (tlds == null) {\n tlds = decodeTlds(encodedTlds);\n }\n if (utlds == null) {\n utlds = decodeTlds(encodedUtlds);\n }\n\n // States for special URL symbols that accept immediately after start\n tt(Start, \"'\", APOSTROPHE);\n tt(Start, '{', OPENBRACE);\n tt(Start, '}', CLOSEBRACE);\n tt(Start, '[', OPENBRACKET);\n tt(Start, ']', CLOSEBRACKET);\n tt(Start, '(', OPENPAREN);\n tt(Start, ')', CLOSEPAREN);\n tt(Start, '<', OPENANGLEBRACKET);\n tt(Start, '>', CLOSEANGLEBRACKET);\n tt(Start, '(', FULLWIDTHLEFTPAREN);\n tt(Start, ')', FULLWIDTHRIGHTPAREN);\n tt(Start, '「', LEFTCORNERBRACKET);\n tt(Start, '」', RIGHTCORNERBRACKET);\n tt(Start, '『', LEFTWHITECORNERBRACKET);\n tt(Start, '』', RIGHTWHITECORNERBRACKET);\n tt(Start, '<', FULLWIDTHLESSTHAN);\n tt(Start, '>', FULLWIDTHGREATERTHAN);\n tt(Start, '&', AMPERSAND);\n tt(Start, '*', ASTERISK);\n tt(Start, '@', AT);\n tt(Start, '`', BACKTICK);\n tt(Start, '^', CARET);\n tt(Start, ':', COLON);\n tt(Start, ',', COMMA);\n tt(Start, '$', DOLLAR);\n tt(Start, '.', DOT);\n tt(Start, '=', EQUALS);\n tt(Start, '!', EXCLAMATION);\n tt(Start, '-', HYPHEN);\n tt(Start, '%', PERCENT);\n tt(Start, '|', PIPE);\n tt(Start, '+', PLUS);\n tt(Start, '#', POUND);\n tt(Start, '?', QUERY);\n tt(Start, '\"', QUOTE);\n tt(Start, '/', SLASH);\n tt(Start, ';', SEMI);\n tt(Start, '~', TILDE);\n tt(Start, '_', UNDERSCORE);\n tt(Start, '\\\\', BACKSLASH);\n const Num = tr(Start, DIGIT, NUM, {\n [numeric]: true\n });\n tr(Num, DIGIT, Num);\n\n // State which emits a word token\n const Word = tr(Start, ASCII_LETTER, WORD, {\n [ascii]: true\n });\n tr(Word, ASCII_LETTER, Word);\n\n // Same as previous, but specific to non-fsm.ascii alphabet words\n const UWord = tr(Start, LETTER, UWORD, {\n [alpha]: true\n });\n tr(UWord, ASCII_LETTER); // Non-accepting\n tr(UWord, LETTER, UWord);\n\n // Whitespace jumps\n // Tokens of only non-newline whitespace are arbitrarily long\n // If any whitespace except newline, more whitespace!\n const Ws = tr(Start, SPACE, WS, {\n [whitespace]: true\n });\n tt(Start, NL, NL$1, {\n [whitespace]: true\n });\n tt(Ws, NL); // non-accepting state to avoid mixing whitespaces\n tr(Ws, SPACE, Ws);\n\n // Emoji tokens. They are not grouped by the scanner except in cases where a\n // zero-width joiner is present\n const Emoji = tr(Start, EMOJI, EMOJI$1, {\n [emoji]: true\n });\n tr(Emoji, EMOJI, Emoji);\n tt(Emoji, EMOJI_VARIATION, Emoji);\n // tt(Start, EMOJI_VARIATION, Emoji); // This one is sketchy\n\n const EmojiJoiner = tt(Emoji, EMOJI_JOINER);\n tr(EmojiJoiner, EMOJI, Emoji);\n // tt(EmojiJoiner, EMOJI_VARIATION, Emoji); // also sketchy\n\n // Generates states for top-level domains\n // Note that this is most accurate when tlds are in alphabetical order\n const wordjr = [[ASCII_LETTER, Word]];\n const uwordjr = [[ASCII_LETTER, null], [LETTER, UWord]];\n for (let i = 0; i < tlds.length; i++) {\n fastts(Start, tlds[i], TLD, WORD, wordjr);\n }\n for (let i = 0; i < utlds.length; i++) {\n fastts(Start, utlds[i], UTLD, UWORD, uwordjr);\n }\n addToGroups(TLD, {\n tld: true,\n ascii: true\n }, groups);\n addToGroups(UTLD, {\n utld: true,\n alpha: true\n }, groups);\n\n // Collect the states generated by different protocols. NOTE: If any new TLDs\n // get added that are also protocols, set the token to be the same as the\n // protocol to ensure parsing works as expected.\n fastts(Start, 'file', SCHEME, WORD, wordjr);\n fastts(Start, 'mailto', SCHEME, WORD, wordjr);\n fastts(Start, 'http', SLASH_SCHEME, WORD, wordjr);\n fastts(Start, 'https', SLASH_SCHEME, WORD, wordjr);\n fastts(Start, 'ftp', SLASH_SCHEME, WORD, wordjr);\n fastts(Start, 'ftps', SLASH_SCHEME, WORD, wordjr);\n addToGroups(SCHEME, {\n scheme: true,\n ascii: true\n }, groups);\n addToGroups(SLASH_SCHEME, {\n slashscheme: true,\n ascii: true\n }, groups);\n\n // Register custom schemes. Assumes each scheme is asciinumeric with hyphens\n customSchemes = customSchemes.sort((a, b) => a[0] > b[0] ? 1 : -1);\n for (let i = 0; i < customSchemes.length; i++) {\n const sch = customSchemes[i][0];\n const optionalSlashSlash = customSchemes[i][1];\n const flags = optionalSlashSlash ? {\n [scheme]: true\n } : {\n [slashscheme]: true\n };\n if (sch.indexOf('-') >= 0) {\n flags[domain] = true;\n } else if (!ASCII_LETTER.test(sch)) {\n flags[numeric] = true; // numbers only\n } else if (DIGIT.test(sch)) {\n flags[asciinumeric] = true;\n } else {\n flags[ascii] = true;\n }\n ts(Start, sch, sch, flags);\n }\n\n // Localhost token\n ts(Start, 'localhost', LOCALHOST, {\n ascii: true\n });\n\n // Set default transition for start state (some symbol)\n Start.jd = new State(SYM);\n return {\n start: Start,\n tokens: assign({\n groups\n }, tk)\n };\n}\n\n/**\n\tGiven a string, returns an array of TOKEN instances representing the\n\tcomposition of that string.\n\n\t@method run\n\t@param {State} start scanner starting state\n\t@param {string} str input string to scan\n\t@return {Token[]} list of tokens, each with a type and value\n*/\nfunction run$1(start, str) {\n // State machine is not case sensitive, so input is tokenized in lowercased\n // form (still returns regular case). Uses selective `toLowerCase` because\n // lowercasing the entire string causes the length and character position to\n // vary in some non-English strings with V8-based runtimes.\n const iterable = stringToArray(str.replace(/[A-Z]/g, c => c.toLowerCase()));\n const charCount = iterable.length; // <= len if there are emojis, etc\n const tokens = []; // return value\n\n // cursor through the string itself, accounting for characters that have\n // width with length 2 such as emojis\n let cursor = 0;\n\n // Cursor through the array-representation of the string\n let charCursor = 0;\n\n // Tokenize the string\n while (charCursor < charCount) {\n let state = start;\n let nextState = null;\n let tokenLength = 0;\n let latestAccepting = null;\n let sinceAccepts = -1;\n let charsSinceAccepts = -1;\n while (charCursor < charCount && (nextState = state.go(iterable[charCursor]))) {\n state = nextState;\n\n // Keep track of the latest accepting state\n if (state.accepts()) {\n sinceAccepts = 0;\n charsSinceAccepts = 0;\n latestAccepting = state;\n } else if (sinceAccepts >= 0) {\n sinceAccepts += iterable[charCursor].length;\n charsSinceAccepts++;\n }\n tokenLength += iterable[charCursor].length;\n cursor += iterable[charCursor].length;\n charCursor++;\n }\n\n // Roll back to the latest accepting state\n cursor -= sinceAccepts;\n charCursor -= charsSinceAccepts;\n tokenLength -= sinceAccepts;\n\n // No more jumps, just make a new token from the last accepting one\n tokens.push({\n t: latestAccepting.t,\n // token type/name\n v: str.slice(cursor - tokenLength, cursor),\n // string value\n s: cursor - tokenLength,\n // start index\n e: cursor // end index (excluding)\n });\n }\n\n return tokens;\n}\n\n/**\n * Convert a String to an Array of characters, taking into account that some\n * characters like emojis take up two string indexes.\n *\n * Adapted from core-js (MIT license)\n * https://github.com/zloirock/core-js/blob/2d69cf5f99ab3ea3463c395df81e5a15b68f49d9/packages/core-js/internals/string-multibyte.js\n *\n * @function stringToArray\n * @param {string} str\n * @returns {string[]}\n */\nfunction stringToArray(str) {\n const result = [];\n const len = str.length;\n let index = 0;\n while (index < len) {\n let first = str.charCodeAt(index);\n let second;\n let char = first < 0xd800 || first > 0xdbff || index + 1 === len || (second = str.charCodeAt(index + 1)) < 0xdc00 || second > 0xdfff ? str[index] // single character\n : str.slice(index, index + 2); // two-index characters\n result.push(char);\n index += char.length;\n }\n return result;\n}\n\n/**\n * Fast version of ts function for when transition defaults are well known\n * @param {State} state\n * @param {string} input\n * @param {string} t\n * @param {string} defaultt\n * @param {[RegExp, State][]} jr\n * @returns {State}\n */\nfunction fastts(state, input, t, defaultt, jr) {\n let next;\n const len = input.length;\n for (let i = 0; i < len - 1; i++) {\n const char = input[i];\n if (state.j[char]) {\n next = state.j[char];\n } else {\n next = new State(defaultt);\n next.jr = jr.slice();\n state.j[char] = next;\n }\n state = next;\n }\n next = new State(t);\n next.jr = jr.slice();\n state.j[input[len - 1]] = next;\n return next;\n}\n\n/**\n * Converts a string of Top-Level Domain names encoded in update-tlds.js back\n * into a list of strings.\n * @param {str} encoded encoded TLDs string\n * @returns {str[]} original TLDs list\n */\nfunction decodeTlds(encoded) {\n const words = [];\n const stack = [];\n let i = 0;\n let digits = '0123456789';\n while (i < encoded.length) {\n let popDigitCount = 0;\n while (digits.indexOf(encoded[i + popDigitCount]) >= 0) {\n popDigitCount++; // encountered some digits, have to pop to go one level up trie\n }\n\n if (popDigitCount > 0) {\n words.push(stack.join('')); // whatever preceded the pop digits must be a word\n for (let popCount = parseInt(encoded.substring(i, i + popDigitCount), 10); popCount > 0; popCount--) {\n stack.pop();\n }\n i += popDigitCount;\n } else {\n stack.push(encoded[i]); // drop down a level into the trie\n i++;\n }\n }\n return words;\n}\n\n/**\n * An object where each key is a valid DOM Event Name such as `click` or `focus`\n * and each value is an event handler function.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/Element#events\n * @typedef {?{ [event: string]: Function }} EventListeners\n */\n\n/**\n * All formatted properties required to render a link, including `tagName`,\n * `attributes`, `content` and `eventListeners`.\n * @typedef {{ tagName: any, attributes: {[attr: string]: any}, content: string,\n * eventListeners: EventListeners }} IntermediateRepresentation\n */\n\n/**\n * Specify either an object described by the template type `O` or a function.\n *\n * The function takes a string value (usually the link's href attribute), the\n * link type (`'url'`, `'hashtag`', etc.) and an internal token representation\n * of the link. It should return an object of the template type `O`\n * @template O\n * @typedef {O | ((value: string, type: string, token: MultiToken) => O)} OptObj\n */\n\n/**\n * Specify either a function described by template type `F` or an object.\n *\n * Each key in the object should be a link type (`'url'`, `'hashtag`', etc.). Each\n * value should be a function with template type `F` that is called when the\n * corresponding link type is encountered.\n * @template F\n * @typedef {F | { [type: string]: F}} OptFn\n */\n\n/**\n * Specify either a value with template type `V`, a function that returns `V` or\n * an object where each value resolves to `V`.\n *\n * The function takes a string value (usually the link's href attribute), the\n * link type (`'url'`, `'hashtag`', etc.) and an internal token representation\n * of the link. It should return an object of the template type `V`\n *\n * For the object, each key should be a link type (`'url'`, `'hashtag`', etc.).\n * Each value should either have type `V` or a function that returns V. This\n * function similarly takes a string value and a token.\n *\n * Example valid types for `Opt`:\n *\n * ```js\n * 'hello'\n * (value, type, token) => 'world'\n * { url: 'hello', email: (value, token) => 'world'}\n * ```\n * @template V\n * @typedef {V | ((value: string, type: string, token: MultiToken) => V) | { [type: string]: V | ((value: string, token: MultiToken) => V) }} Opt\n */\n\n/**\n * See available options: https://linkify.js.org/docs/options.html\n * @typedef {{\n * \tdefaultProtocol?: string,\n * events?: OptObj,\n * \tformat?: Opt,\n * \tformatHref?: Opt,\n * \tnl2br?: boolean,\n * \ttagName?: Opt,\n * \ttarget?: Opt,\n * \trel?: Opt,\n * \tvalidate?: Opt,\n * \ttruncate?: Opt,\n * \tclassName?: Opt,\n * \tattributes?: OptObj<({ [attr: string]: any })>,\n * ignoreTags?: string[],\n * \trender?: OptFn<((ir: IntermediateRepresentation) => any)>\n * }} Opts\n */\n\n/**\n * @type Required\n */\nconst defaults = {\n defaultProtocol: 'http',\n events: null,\n format: noop,\n formatHref: noop,\n nl2br: false,\n tagName: 'a',\n target: null,\n rel: null,\n validate: true,\n truncate: Infinity,\n className: null,\n attributes: null,\n ignoreTags: [],\n render: null\n};\n\n/**\n * Utility class for linkify interfaces to apply specified\n * {@link Opts formatting and rendering options}.\n *\n * @param {Opts | Options} [opts] Option value overrides.\n * @param {(ir: IntermediateRepresentation) => any} [defaultRender] (For\n * internal use) default render function that determines how to generate an\n * HTML element based on a link token's derived tagName, attributes and HTML.\n * Similar to render option\n */\nfunction Options(opts, defaultRender) {\n if (defaultRender === void 0) {\n defaultRender = null;\n }\n let o = assign({}, defaults);\n if (opts) {\n o = assign(o, opts instanceof Options ? opts.o : opts);\n }\n\n // Ensure all ignored tags are uppercase\n const ignoredTags = o.ignoreTags;\n const uppercaseIgnoredTags = [];\n for (let i = 0; i < ignoredTags.length; i++) {\n uppercaseIgnoredTags.push(ignoredTags[i].toUpperCase());\n }\n /** @protected */\n this.o = o;\n if (defaultRender) {\n this.defaultRender = defaultRender;\n }\n this.ignoreTags = uppercaseIgnoredTags;\n}\nOptions.prototype = {\n o: defaults,\n /**\n * @type string[]\n */\n ignoreTags: [],\n /**\n * @param {IntermediateRepresentation} ir\n * @returns {any}\n */\n defaultRender(ir) {\n return ir;\n },\n /**\n * Returns true or false based on whether a token should be displayed as a\n * link based on the user options.\n * @param {MultiToken} token\n * @returns {boolean}\n */\n check(token) {\n return this.get('validate', token.toString(), token);\n },\n // Private methods\n\n /**\n * Resolve an option's value based on the value of the option and the given\n * params. If operator and token are specified and the target option is\n * callable, automatically calls the function with the given argument.\n * @template {keyof Opts} K\n * @param {K} key Name of option to use\n * @param {string} [operator] will be passed to the target option if it's a\n * function. If not specified, RAW function value gets returned\n * @param {MultiToken} [token] The token from linkify.tokenize\n * @returns {Opts[K] | any}\n */\n get(key, operator, token) {\n const isCallable = operator != null;\n let option = this.o[key];\n if (!option) {\n return option;\n }\n if (typeof option === 'object') {\n option = token.t in option ? option[token.t] : defaults[key];\n if (typeof option === 'function' && isCallable) {\n option = option(operator, token);\n }\n } else if (typeof option === 'function' && isCallable) {\n option = option(operator, token.t, token);\n }\n return option;\n },\n /**\n * @template {keyof Opts} L\n * @param {L} key Name of options object to use\n * @param {string} [operator]\n * @param {MultiToken} [token]\n * @returns {Opts[L] | any}\n */\n getObj(key, operator, token) {\n let obj = this.o[key];\n if (typeof obj === 'function' && operator != null) {\n obj = obj(operator, token.t, token);\n }\n return obj;\n },\n /**\n * Convert the given token to a rendered element that may be added to the\n * calling-interface's DOM\n * @param {MultiToken} token Token to render to an HTML element\n * @returns {any} Render result; e.g., HTML string, DOM element, React\n * Component, etc.\n */\n render(token) {\n const ir = token.render(this); // intermediate representation\n const renderFn = this.get('render', null, token) || this.defaultRender;\n return renderFn(ir, token.t, token);\n }\n};\nfunction noop(val) {\n return val;\n}\n\nvar options = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tdefaults: defaults,\n\tOptions: Options,\n\tassign: assign\n});\n\n/******************************************************************************\n\tMulti-Tokens\n\tTokens composed of arrays of TextTokens\n******************************************************************************/\n\n/**\n * @param {string} value\n * @param {Token[]} tokens\n */\nfunction MultiToken(value, tokens) {\n this.t = 'token';\n this.v = value;\n this.tk = tokens;\n}\n\n/**\n * Abstract class used for manufacturing tokens of text tokens. That is rather\n * than the value for a token being a small string of text, it's value an array\n * of text tokens.\n *\n * Used for grouping together URLs, emails, hashtags, and other potential\n * creations.\n * @class MultiToken\n * @property {string} t\n * @property {string} v\n * @property {Token[]} tk\n * @abstract\n */\nMultiToken.prototype = {\n isLink: false,\n /**\n * Return the string this token represents.\n * @return {string}\n */\n toString() {\n return this.v;\n },\n /**\n * What should the value for this token be in the `href` HTML attribute?\n * Returns the `.toString` value by default.\n * @param {string} [scheme]\n * @return {string}\n */\n toHref(scheme) {\n return this.toString();\n },\n /**\n * @param {Options} options Formatting options\n * @returns {string}\n */\n toFormattedString(options) {\n const val = this.toString();\n const truncate = options.get('truncate', val, this);\n const formatted = options.get('format', val, this);\n return truncate && formatted.length > truncate ? formatted.substring(0, truncate) + '…' : formatted;\n },\n /**\n *\n * @param {Options} options\n * @returns {string}\n */\n toFormattedHref(options) {\n return options.get('formatHref', this.toHref(options.get('defaultProtocol')), this);\n },\n /**\n * The start index of this token in the original input string\n * @returns {number}\n */\n startIndex() {\n return this.tk[0].s;\n },\n /**\n * The end index of this token in the original input string (up to this\n * index but not including it)\n * @returns {number}\n */\n endIndex() {\n return this.tk[this.tk.length - 1].e;\n },\n /**\n \tReturns an object of relevant values for this token, which includes keys\n \t* type - Kind of token ('url', 'email', etc.)\n \t* value - Original text\n \t* href - The value that should be added to the anchor tag's href\n \t\tattribute\n \t\t@method toObject\n \t@param {string} [protocol] `'http'` by default\n */\n toObject(protocol) {\n if (protocol === void 0) {\n protocol = defaults.defaultProtocol;\n }\n return {\n type: this.t,\n value: this.toString(),\n isLink: this.isLink,\n href: this.toHref(protocol),\n start: this.startIndex(),\n end: this.endIndex()\n };\n },\n /**\n *\n * @param {Options} options Formatting option\n */\n toFormattedObject(options) {\n return {\n type: this.t,\n value: this.toFormattedString(options),\n isLink: this.isLink,\n href: this.toFormattedHref(options),\n start: this.startIndex(),\n end: this.endIndex()\n };\n },\n /**\n * Whether this token should be rendered as a link according to the given options\n * @param {Options} options\n * @returns {boolean}\n */\n validate(options) {\n return options.get('validate', this.toString(), this);\n },\n /**\n * Return an object that represents how this link should be rendered.\n * @param {Options} options Formattinng options\n */\n render(options) {\n const token = this;\n const href = this.toHref(options.get('defaultProtocol'));\n const formattedHref = options.get('formatHref', href, this);\n const tagName = options.get('tagName', href, token);\n const content = this.toFormattedString(options);\n const attributes = {};\n const className = options.get('className', href, token);\n const target = options.get('target', href, token);\n const rel = options.get('rel', href, token);\n const attrs = options.getObj('attributes', href, token);\n const eventListeners = options.getObj('events', href, token);\n attributes.href = formattedHref;\n if (className) {\n attributes.class = className;\n }\n if (target) {\n attributes.target = target;\n }\n if (rel) {\n attributes.rel = rel;\n }\n if (attrs) {\n assign(attributes, attrs);\n }\n return {\n tagName,\n attributes,\n content,\n eventListeners\n };\n }\n};\n\n/**\n * Create a new token that can be emitted by the parser state machine\n * @param {string} type readable type of the token\n * @param {object} props properties to assign or override, including isLink = true or false\n * @returns {new (value: string, tokens: Token[]) => MultiToken} new token class\n */\nfunction createTokenClass(type, props) {\n class Token extends MultiToken {\n constructor(value, tokens) {\n super(value, tokens);\n this.t = type;\n }\n }\n for (const p in props) {\n Token.prototype[p] = props[p];\n }\n Token.t = type;\n return Token;\n}\n\n/**\n\tRepresents a list of tokens making up a valid email address\n*/\nconst Email = createTokenClass('email', {\n isLink: true,\n toHref() {\n return 'mailto:' + this.toString();\n }\n});\n\n/**\n\tRepresents some plain text\n*/\nconst Text = createTokenClass('text');\n\n/**\n\tMulti-linebreak token - represents a line break\n\t@class Nl\n*/\nconst Nl = createTokenClass('nl');\n\n/**\n\tRepresents a list of text tokens making up a valid URL\n\t@class Url\n*/\nconst Url = createTokenClass('url', {\n isLink: true,\n /**\n \tLowercases relevant parts of the domain and adds the protocol if\n \trequired. Note that this will not escape unsafe HTML characters in the\n \tURL.\n \t\t@param {string} [scheme] default scheme (e.g., 'https')\n \t@return {string} the full href\n */\n toHref(scheme) {\n if (scheme === void 0) {\n scheme = defaults.defaultProtocol;\n }\n // Check if already has a prefix scheme\n return this.hasProtocol() ? this.v : `${scheme}://${this.v}`;\n },\n /**\n * Check whether this URL token has a protocol\n * @return {boolean}\n */\n hasProtocol() {\n const tokens = this.tk;\n return tokens.length >= 2 && tokens[0].t !== LOCALHOST && tokens[1].t === COLON;\n }\n});\n\nvar multi = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tMultiToken: MultiToken,\n\tBase: MultiToken,\n\tcreateTokenClass: createTokenClass,\n\tEmail: Email,\n\tText: Text,\n\tNl: Nl,\n\tUrl: Url\n});\n\n/**\n\tNot exactly parser, more like the second-stage scanner (although we can\n\ttheoretically hotswap the code here with a real parser in the future... but\n\tfor a little URL-finding utility abstract syntax trees may be a little\n\toverkill).\n\n\tURL format: http://en.wikipedia.org/wiki/URI_scheme\n\tEmail format: http://en.wikipedia.org/wiki/EmailAddress (links to RFC in\n\treference)\n\n\t@module linkify\n\t@submodule parser\n\t@main run\n*/\nconst makeState = arg => new State(arg);\n\n/**\n * Generate the parser multi token-based state machine\n * @param {{ groups: Collections }} tokens\n */\nfunction init$1(_ref) {\n let {\n groups\n } = _ref;\n // Types of characters the URL can definitely end in\n const qsAccepting = groups.domain.concat([AMPERSAND, ASTERISK, AT, BACKSLASH, BACKTICK, CARET, DOLLAR, EQUALS, HYPHEN, NUM, PERCENT, PIPE, PLUS, POUND, SLASH, SYM, TILDE, UNDERSCORE]);\n\n // Types of tokens that can follow a URL and be part of the query string\n // but cannot be the very last characters\n // Characters that cannot appear in the URL at all should be excluded\n const qsNonAccepting = [APOSTROPHE, COLON, COMMA, DOT, EXCLAMATION, QUERY, QUOTE, SEMI, OPENANGLEBRACKET, CLOSEANGLEBRACKET, OPENBRACE, CLOSEBRACE, CLOSEBRACKET, OPENBRACKET, OPENPAREN, CLOSEPAREN, FULLWIDTHLEFTPAREN, FULLWIDTHRIGHTPAREN, LEFTCORNERBRACKET, RIGHTCORNERBRACKET, LEFTWHITECORNERBRACKET, RIGHTWHITECORNERBRACKET, FULLWIDTHLESSTHAN, FULLWIDTHGREATERTHAN];\n\n // For addresses without the mailto prefix\n // Tokens allowed in the localpart of the email\n const localpartAccepting = [AMPERSAND, APOSTROPHE, ASTERISK, BACKSLASH, BACKTICK, CARET, DOLLAR, EQUALS, HYPHEN, OPENBRACE, CLOSEBRACE, PERCENT, PIPE, PLUS, POUND, QUERY, SLASH, SYM, TILDE, UNDERSCORE];\n\n // The universal starting state.\n /**\n * @type State\n */\n const Start = makeState();\n const Localpart = tt(Start, TILDE); // Local part of the email address\n ta(Localpart, localpartAccepting, Localpart);\n ta(Localpart, groups.domain, Localpart);\n const Domain = makeState(),\n Scheme = makeState(),\n SlashScheme = makeState();\n ta(Start, groups.domain, Domain); // parsed string ends with a potential domain name (A)\n ta(Start, groups.scheme, Scheme); // e.g., 'mailto'\n ta(Start, groups.slashscheme, SlashScheme); // e.g., 'http'\n\n ta(Domain, localpartAccepting, Localpart);\n ta(Domain, groups.domain, Domain);\n const LocalpartAt = tt(Domain, AT); // Local part of the email address plus @\n\n tt(Localpart, AT, LocalpartAt); // close to an email address now\n\n // Local part of an email address can be e.g. 'http' or 'mailto'\n tt(Scheme, AT, LocalpartAt);\n tt(SlashScheme, AT, LocalpartAt);\n const LocalpartDot = tt(Localpart, DOT); // Local part of the email address plus '.' (localpart cannot end in .)\n ta(LocalpartDot, localpartAccepting, Localpart);\n ta(LocalpartDot, groups.domain, Localpart);\n const EmailDomain = makeState();\n ta(LocalpartAt, groups.domain, EmailDomain); // parsed string starts with local email info + @ with a potential domain name\n ta(EmailDomain, groups.domain, EmailDomain);\n const EmailDomainDot = tt(EmailDomain, DOT); // domain followed by DOT\n ta(EmailDomainDot, groups.domain, EmailDomain);\n const Email$1 = makeState(Email); // Possible email address (could have more tlds)\n ta(EmailDomainDot, groups.tld, Email$1);\n ta(EmailDomainDot, groups.utld, Email$1);\n tt(LocalpartAt, LOCALHOST, Email$1);\n\n // Hyphen can jump back to a domain name\n const EmailDomainHyphen = tt(EmailDomain, HYPHEN); // parsed string starts with local email info + @ with a potential domain name\n ta(EmailDomainHyphen, groups.domain, EmailDomain);\n ta(Email$1, groups.domain, EmailDomain);\n tt(Email$1, DOT, EmailDomainDot);\n tt(Email$1, HYPHEN, EmailDomainHyphen);\n\n // Final possible email states\n const EmailColon = tt(Email$1, COLON); // URL followed by colon (potential port number here)\n /*const EmailColonPort = */\n ta(EmailColon, groups.numeric, Email); // URL followed by colon and port number\n\n // Account for dots and hyphens. Hyphens are usually parts of domain names\n // (but not TLDs)\n const DomainHyphen = tt(Domain, HYPHEN); // domain followed by hyphen\n const DomainDot = tt(Domain, DOT); // domain followed by DOT\n ta(DomainHyphen, groups.domain, Domain);\n ta(DomainDot, localpartAccepting, Localpart);\n ta(DomainDot, groups.domain, Domain);\n const DomainDotTld = makeState(Url); // Simplest possible URL with no query string\n ta(DomainDot, groups.tld, DomainDotTld);\n ta(DomainDot, groups.utld, DomainDotTld);\n ta(DomainDotTld, groups.domain, Domain);\n ta(DomainDotTld, localpartAccepting, Localpart);\n tt(DomainDotTld, DOT, DomainDot);\n tt(DomainDotTld, HYPHEN, DomainHyphen);\n tt(DomainDotTld, AT, LocalpartAt);\n const DomainDotTldColon = tt(DomainDotTld, COLON); // URL followed by colon (potential port number here)\n const DomainDotTldColonPort = makeState(Url); // TLD followed by a port number\n ta(DomainDotTldColon, groups.numeric, DomainDotTldColonPort);\n\n // Long URL with optional port and maybe query string\n const Url$1 = makeState(Url);\n\n // URL with extra symbols at the end, followed by an opening bracket\n const UrlNonaccept = makeState(); // URL followed by some symbols (will not be part of the final URL)\n\n // Query strings\n ta(Url$1, qsAccepting, Url$1);\n ta(Url$1, qsNonAccepting, UrlNonaccept);\n ta(UrlNonaccept, qsAccepting, Url$1);\n ta(UrlNonaccept, qsNonAccepting, UrlNonaccept);\n\n // Become real URLs after `SLASH` or `COLON NUM SLASH`\n // Here works with or without scheme:// prefix\n tt(DomainDotTld, SLASH, Url$1);\n tt(DomainDotTldColonPort, SLASH, Url$1);\n\n // Note that domains that begin with schemes are treated slighly differently\n const SchemeColon = tt(Scheme, COLON); // e.g., 'mailto:'\n const SlashSchemeColon = tt(SlashScheme, COLON); // e.g., 'http:'\n const SlashSchemeColonSlash = tt(SlashSchemeColon, SLASH); // e.g., 'http:/'\n\n const UriPrefix = tt(SlashSchemeColonSlash, SLASH); // e.g., 'http://'\n\n // Scheme states can transition to domain states\n ta(Scheme, groups.domain, Domain);\n tt(Scheme, DOT, DomainDot);\n tt(Scheme, HYPHEN, DomainHyphen);\n ta(SlashScheme, groups.domain, Domain);\n tt(SlashScheme, DOT, DomainDot);\n tt(SlashScheme, HYPHEN, DomainHyphen);\n\n // Force URL with scheme prefix followed by anything sane\n ta(SchemeColon, groups.domain, Url$1);\n tt(SchemeColon, SLASH, Url$1);\n ta(UriPrefix, groups.domain, Url$1);\n ta(UriPrefix, qsAccepting, Url$1);\n tt(UriPrefix, SLASH, Url$1);\n const bracketPairs = [[OPENBRACE, CLOSEBRACE],\n // {}\n [OPENBRACKET, CLOSEBRACKET],\n // []\n [OPENPAREN, CLOSEPAREN],\n // ()\n [OPENANGLEBRACKET, CLOSEANGLEBRACKET],\n // <>\n [FULLWIDTHLEFTPAREN, FULLWIDTHRIGHTPAREN],\n // ()\n [LEFTCORNERBRACKET, RIGHTCORNERBRACKET],\n // 「」\n [LEFTWHITECORNERBRACKET, RIGHTWHITECORNERBRACKET],\n // 『』\n [FULLWIDTHLESSTHAN, FULLWIDTHGREATERTHAN] // <>\n ];\n\n for (let i = 0; i < bracketPairs.length; i++) {\n const [OPEN, CLOSE] = bracketPairs[i];\n const UrlOpen = tt(Url$1, OPEN); // URL followed by open bracket\n\n // Continue not accepting for open brackets\n tt(UrlNonaccept, OPEN, UrlOpen);\n\n // Closing bracket component. This character WILL be included in the URL\n tt(UrlOpen, CLOSE, Url$1);\n\n // URL that beings with an opening bracket, followed by a symbols.\n // Note that the final state can still be `UrlOpen` (if the URL has a\n // single opening bracket for some reason).\n const UrlOpenQ = makeState(Url);\n ta(UrlOpen, qsAccepting, UrlOpenQ);\n const UrlOpenSyms = makeState(); // UrlOpen followed by some symbols it cannot end it\n ta(UrlOpen, qsNonAccepting);\n\n // URL that begins with an opening bracket, followed by some symbols\n ta(UrlOpenQ, qsAccepting, UrlOpenQ);\n ta(UrlOpenQ, qsNonAccepting, UrlOpenSyms);\n ta(UrlOpenSyms, qsAccepting, UrlOpenQ);\n ta(UrlOpenSyms, qsNonAccepting, UrlOpenSyms);\n\n // Close brace/bracket to become regular URL\n tt(UrlOpenQ, CLOSE, Url$1);\n tt(UrlOpenSyms, CLOSE, Url$1);\n }\n tt(Start, LOCALHOST, DomainDotTld); // localhost is a valid URL state\n tt(Start, NL$1, Nl); // single new line\n\n return {\n start: Start,\n tokens: tk\n };\n}\n\n/**\n * Run the parser state machine on a list of scanned string-based tokens to\n * create a list of multi tokens, each of which represents a URL, email address,\n * plain text, etc.\n *\n * @param {State} start parser start state\n * @param {string} input the original input used to generate the given tokens\n * @param {Token[]} tokens list of scanned tokens\n * @returns {MultiToken[]}\n */\nfunction run(start, input, tokens) {\n let len = tokens.length;\n let cursor = 0;\n let multis = [];\n let textTokens = [];\n while (cursor < len) {\n let state = start;\n let secondState = null;\n let nextState = null;\n let multiLength = 0;\n let latestAccepting = null;\n let sinceAccepts = -1;\n while (cursor < len && !(secondState = state.go(tokens[cursor].t))) {\n // Starting tokens with nowhere to jump to.\n // Consider these to be just plain text\n textTokens.push(tokens[cursor++]);\n }\n while (cursor < len && (nextState = secondState || state.go(tokens[cursor].t))) {\n // Get the next state\n secondState = null;\n state = nextState;\n\n // Keep track of the latest accepting state\n if (state.accepts()) {\n sinceAccepts = 0;\n latestAccepting = state;\n } else if (sinceAccepts >= 0) {\n sinceAccepts++;\n }\n cursor++;\n multiLength++;\n }\n if (sinceAccepts < 0) {\n // No accepting state was found, part of a regular text token add\n // the first text token to the text tokens array and try again from\n // the next\n cursor -= multiLength;\n if (cursor < len) {\n textTokens.push(tokens[cursor]);\n cursor++;\n }\n } else {\n // Accepting state!\n // First close off the textTokens (if available)\n if (textTokens.length > 0) {\n multis.push(initMultiToken(Text, input, textTokens));\n textTokens = [];\n }\n\n // Roll back to the latest accepting state\n cursor -= sinceAccepts;\n multiLength -= sinceAccepts;\n\n // Create a new multitoken\n const Multi = latestAccepting.t;\n const subtokens = tokens.slice(cursor - multiLength, cursor);\n multis.push(initMultiToken(Multi, input, subtokens));\n }\n }\n\n // Finally close off the textTokens (if available)\n if (textTokens.length > 0) {\n multis.push(initMultiToken(Text, input, textTokens));\n }\n return multis;\n}\n\n/**\n * Utility function for instantiating a new multitoken with all the relevant\n * fields during parsing.\n * @param {new (value: string, tokens: Token[]) => MultiToken} Multi class to instantiate\n * @param {string} input original input string\n * @param {Token[]} tokens consecutive tokens scanned from input string\n * @returns {MultiToken}\n */\nfunction initMultiToken(Multi, input, tokens) {\n const startIdx = tokens[0].s;\n const endIdx = tokens[tokens.length - 1].e;\n const value = input.slice(startIdx, endIdx);\n return new Multi(value, tokens);\n}\n\nconst warn = typeof console !== 'undefined' && console && console.warn || (() => {});\nconst warnAdvice = 'until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.';\n\n// Side-effect initialization state\nconst INIT = {\n scanner: null,\n parser: null,\n tokenQueue: [],\n pluginQueue: [],\n customSchemes: [],\n initialized: false\n};\n\n/**\n * @typedef {{\n * \tstart: State,\n * \ttokens: { groups: Collections } & typeof tk\n * }} ScannerInit\n */\n\n/**\n * @typedef {{\n * \tstart: State,\n * \ttokens: typeof multi\n * }} ParserInit\n */\n\n/**\n * @typedef {(arg: { scanner: ScannerInit }) => void} TokenPlugin\n */\n\n/**\n * @typedef {(arg: { scanner: ScannerInit, parser: ParserInit }) => void} Plugin\n */\n\n/**\n * De-register all plugins and reset the internal state-machine. Used for\n * testing; not required in practice.\n * @private\n */\nfunction reset() {\n State.groups = {};\n INIT.scanner = null;\n INIT.parser = null;\n INIT.tokenQueue = [];\n INIT.pluginQueue = [];\n INIT.customSchemes = [];\n INIT.initialized = false;\n}\n\n/**\n * Register a token plugin to allow the scanner to recognize additional token\n * types before the parser state machine is constructed from the results.\n * @param {string} name of plugin to register\n * @param {TokenPlugin} plugin function that accepts the scanner state machine\n * and available scanner tokens and collections and extends the state machine to\n * recognize additional tokens or groups.\n */\nfunction registerTokenPlugin(name, plugin) {\n if (typeof plugin !== 'function') {\n throw new Error(`linkifyjs: Invalid token plugin ${plugin} (expects function)`);\n }\n for (let i = 0; i < INIT.tokenQueue.length; i++) {\n if (name === INIT.tokenQueue[i][0]) {\n warn(`linkifyjs: token plugin \"${name}\" already registered - will be overwritten`);\n INIT.tokenQueue[i] = [name, plugin];\n return;\n }\n }\n INIT.tokenQueue.push([name, plugin]);\n if (INIT.initialized) {\n warn(`linkifyjs: already initialized - will not register token plugin \"${name}\" ${warnAdvice}`);\n }\n}\n\n/**\n * Register a linkify plugin\n * @param {string} name of plugin to register\n * @param {Plugin} plugin function that accepts the parser state machine and\n * extends the parser to recognize additional link types\n */\nfunction registerPlugin(name, plugin) {\n if (typeof plugin !== 'function') {\n throw new Error(`linkifyjs: Invalid plugin ${plugin} (expects function)`);\n }\n for (let i = 0; i < INIT.pluginQueue.length; i++) {\n if (name === INIT.pluginQueue[i][0]) {\n warn(`linkifyjs: plugin \"${name}\" already registered - will be overwritten`);\n INIT.pluginQueue[i] = [name, plugin];\n return;\n }\n }\n INIT.pluginQueue.push([name, plugin]);\n if (INIT.initialized) {\n warn(`linkifyjs: already initialized - will not register plugin \"${name}\" ${warnAdvice}`);\n }\n}\n\n/**\n * Detect URLs with the following additional protocol. Anything with format\n * \"protocol://...\" will be considered a link. If `optionalSlashSlash` is set to\n * `true`, anything with format \"protocol:...\" will be considered a link.\n * @param {string} protocol\n * @param {boolean} [optionalSlashSlash]\n */\nfunction registerCustomProtocol(scheme, optionalSlashSlash) {\n if (optionalSlashSlash === void 0) {\n optionalSlashSlash = false;\n }\n if (INIT.initialized) {\n warn(`linkifyjs: already initialized - will not register custom scheme \"${scheme}\" ${warnAdvice}`);\n }\n if (!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(scheme)) {\n throw new Error(`linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or \"-\"\n2. Cannot start or end with \"-\"\n3. \"-\" cannot repeat`);\n }\n INIT.customSchemes.push([scheme, optionalSlashSlash]);\n}\n\n/**\n * Initialize the linkify state machine. Called automatically the first time\n * linkify is called on a string, but may be called manually as well.\n */\nfunction init() {\n // Initialize scanner state machine and plugins\n INIT.scanner = init$2(INIT.customSchemes);\n for (let i = 0; i < INIT.tokenQueue.length; i++) {\n INIT.tokenQueue[i][1]({\n scanner: INIT.scanner\n });\n }\n\n // Initialize parser state machine and plugins\n INIT.parser = init$1(INIT.scanner.tokens);\n for (let i = 0; i < INIT.pluginQueue.length; i++) {\n INIT.pluginQueue[i][1]({\n scanner: INIT.scanner,\n parser: INIT.parser\n });\n }\n INIT.initialized = true;\n}\n\n/**\n * Parse a string into tokens that represent linkable and non-linkable sub-components\n * @param {string} str\n * @return {MultiToken[]} tokens\n */\nfunction tokenize(str) {\n if (!INIT.initialized) {\n init();\n }\n return run(INIT.parser.start, str, run$1(INIT.scanner.start, str));\n}\n\n/**\n * Find a list of linkable items in the given string.\n * @param {string} str string to find links in\n * @param {string | Opts} [type] either formatting options or specific type of\n * links to find, e.g., 'url' or 'email'\n * @param {Opts} [opts] formatting options for final output. Cannot be specified\n * if opts already provided in `type` argument\n */\nfunction find(str, type, opts) {\n if (type === void 0) {\n type = null;\n }\n if (opts === void 0) {\n opts = null;\n }\n if (type && typeof type === 'object') {\n if (opts) {\n throw Error(`linkifyjs: Invalid link type ${type}; must be a string`);\n }\n opts = type;\n type = null;\n }\n const options = new Options(opts);\n const tokens = tokenize(str);\n const filtered = [];\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n if (token.isLink && (!type || token.t === type) && options.check(token)) {\n filtered.push(token.toFormattedObject(options));\n }\n }\n return filtered;\n}\n\n/**\n * Is the given string valid linkable text of some sort. Note that this does not\n * trim the text for you.\n *\n * Optionally pass in a second `type` param, which is the type of link to test\n * for.\n *\n * For example,\n *\n * linkify.test(str, 'email');\n *\n * Returns `true` if str is a valid email.\n * @param {string} str string to test for links\n * @param {string} [type] optional specific link type to look for\n * @returns boolean true/false\n */\nfunction test(str, type) {\n if (type === void 0) {\n type = null;\n }\n const tokens = tokenize(str);\n return tokens.length === 1 && tokens[0].isLink && (!type || tokens[0].t === type);\n}\n\nexport { MultiToken, Options, State, createTokenClass, find, init, multi, options, regexp, registerCustomProtocol, registerPlugin, registerTokenPlugin, reset, stringToArray, test, tokenize };\n","import { Options, tokenize } from 'linkifyjs';\n\n/**\n\tConvert strings of text into linkable HTML text\n*/\nfunction escapeText(text) {\n return text.replace(/&/g, '&').replace(//g, '>');\n}\nfunction escapeAttr(href) {\n return href.replace(/\"/g, '"');\n}\nfunction attributesToString(attributes) {\n const result = [];\n for (const attr in attributes) {\n let val = attributes[attr] + '';\n result.push(`${attr}=\"${escapeAttr(val)}\"`);\n }\n return result.join(' ');\n}\nfunction defaultRender(_ref) {\n let {\n tagName,\n attributes,\n content\n } = _ref;\n return `<${tagName} ${attributesToString(attributes)}>${escapeText(content)}${tagName}>`;\n}\n\n/**\n * Convert a plan text string to an HTML string with links. Expects that the\n * given strings does not contain any HTML entities. Use the linkify-html\n * interface if you need to parse HTML entities.\n *\n * @param {string} str string to linkify\n * @param {import('linkifyjs').Opts} [opts] overridable options\n * @returns {string}\n */\nfunction linkifyStr(str, opts) {\n if (opts === void 0) {\n opts = {};\n }\n opts = new Options(opts, defaultRender);\n const tokens = tokenize(str);\n const result = [];\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n if (token.t === 'nl' && opts.get('nl2br')) {\n result.push('\\n');\n } else if (!token.isLink || !opts.check(token)) {\n result.push(escapeText(token.toString()));\n } else {\n result.push(opts.render(token));\n }\n }\n return result.join('');\n}\nif (!String.prototype.linkify) {\n Object.defineProperty(String.prototype, 'linkify', {\n writable: false,\n value: function linkify(options) {\n return linkifyStr(this, options);\n }\n });\n}\n\nexport { linkifyStr as default };\n","'use strict';\n\n(function (global) {\n\n // minimal symbol polyfill for IE11 and others\n if (typeof Symbol !== 'function') {\n var Symbol = function(name) {\n return name;\n }\n\n Symbol.nonNative = true;\n }\n\n const STATE_PLAINTEXT = Symbol('plaintext');\n const STATE_HTML = Symbol('html');\n const STATE_COMMENT = Symbol('comment');\n\n const ALLOWED_TAGS_REGEX = /<(\\w*)>/g;\n const NORMALIZE_TAG_REGEX = /<\\/?([^\\s\\/>]+)/;\n\n function striptags(html, allowable_tags, tag_replacement) {\n html = html || '';\n allowable_tags = allowable_tags || [];\n tag_replacement = tag_replacement || '';\n\n let context = init_context(allowable_tags, tag_replacement);\n\n return striptags_internal(html, context);\n }\n\n function init_striptags_stream(allowable_tags, tag_replacement) {\n allowable_tags = allowable_tags || [];\n tag_replacement = tag_replacement || '';\n\n let context = init_context(allowable_tags, tag_replacement);\n\n return function striptags_stream(html) {\n return striptags_internal(html || '', context);\n };\n }\n\n striptags.init_streaming_mode = init_striptags_stream;\n\n function init_context(allowable_tags, tag_replacement) {\n allowable_tags = parse_allowable_tags(allowable_tags);\n\n return {\n allowable_tags : allowable_tags,\n tag_replacement: tag_replacement,\n\n state : STATE_PLAINTEXT,\n tag_buffer : '',\n depth : 0,\n in_quote_char : ''\n };\n }\n\n function striptags_internal(html, context) {\n if (typeof html != \"string\") {\n throw new TypeError(\"'html' parameter must be a string\");\n }\n\n let allowable_tags = context.allowable_tags;\n let tag_replacement = context.tag_replacement;\n\n let state = context.state;\n let tag_buffer = context.tag_buffer;\n let depth = context.depth;\n let in_quote_char = context.in_quote_char;\n let output = '';\n\n for (let idx = 0, length = html.length; idx < length; idx++) {\n let char = html[idx];\n\n if (state === STATE_PLAINTEXT) {\n switch (char) {\n case '<':\n state = STATE_HTML;\n tag_buffer += char;\n break;\n\n default:\n output += char;\n break;\n }\n }\n\n else if (state === STATE_HTML) {\n switch (char) {\n case '<':\n // ignore '<' if inside a quote\n if (in_quote_char) {\n break;\n }\n\n // we're seeing a nested '<'\n depth++;\n break;\n\n case '>':\n // ignore '>' if inside a quote\n if (in_quote_char) {\n break;\n }\n\n // something like this is happening: '<<>>'\n if (depth) {\n depth--;\n\n break;\n }\n\n // this is closing the tag in tag_buffer\n in_quote_char = '';\n state = STATE_PLAINTEXT;\n tag_buffer += '>';\n\n if (allowable_tags.has(normalize_tag(tag_buffer))) {\n output += tag_buffer;\n } else {\n output += tag_replacement;\n }\n\n tag_buffer = '';\n break;\n\n case '\"':\n case '\\'':\n // catch both single and double quotes\n\n if (char === in_quote_char) {\n in_quote_char = '';\n } else {\n in_quote_char = in_quote_char || char;\n }\n\n tag_buffer += char;\n break;\n\n case '-':\n if (tag_buffer === '':\n if (tag_buffer.slice(-2) == '--') {\n // close the comment\n state = STATE_PLAINTEXT;\n }\n\n tag_buffer = '';\n break;\n\n default:\n tag_buffer += char;\n break;\n }\n }\n }\n\n // save the context for future iterations\n context.state = state;\n context.tag_buffer = tag_buffer;\n context.depth = depth;\n context.in_quote_char = in_quote_char;\n\n return output;\n }\n\n function parse_allowable_tags(allowable_tags) {\n let tag_set = new Set();\n\n if (typeof allowable_tags === 'string') {\n let match;\n\n while ((match = ALLOWED_TAGS_REGEX.exec(allowable_tags))) {\n tag_set.add(match[1]);\n }\n }\n\n else if (!Symbol.nonNative &&\n typeof allowable_tags[Symbol.iterator] === 'function') {\n\n tag_set = new Set(allowable_tags);\n }\n\n else if (typeof allowable_tags.forEach === 'function') {\n // IE11 compatible\n allowable_tags.forEach(tag_set.add, tag_set);\n }\n\n return tag_set;\n }\n\n function normalize_tag(tag_buffer) {\n let match = NORMALIZE_TAG_REGEX.exec(tag_buffer);\n\n return match ? match[1].toLowerCase() : null;\n }\n\n if (typeof define === 'function' && define.amd) {\n // AMD\n define(function module_factory() { return striptags; });\n }\n\n else if (typeof module === 'object' && module.exports) {\n // Node\n module.exports = striptags;\n }\n\n else {\n // Browser\n global.striptags = striptags;\n }\n}(this));\n","import { visit, SKIP } from \"unist-util-visit\";\nimport { u } from \"unist-builder\";\nimport { getBaseUrl, getRootUrl } from \"@nextcloud/router\";\nconst URL_PATTERN = /(\\s|^)(https?:\\/\\/)([-A-Z0-9+_.]+(?::[0-9]+)?(?:\\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\\s|$)/ig;\nconst URL_PATTERN_AUTOLINK = /(\\s|\\(|^)((https?:\\/\\/)([-A-Z0-9+_.]+[-A-Z0-9]+(?::[0-9]+)?(?:\\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*))(?=\\s|\\)|$)/ig;\nconst NcLink = {\n name: \"NcLink\",\n props: {\n href: {\n type: String,\n required: true\n }\n },\n render(h) {\n return h(\"a\", {\n attrs: {\n href: this.href,\n rel: \"noopener noreferrer\",\n target: \"_blank\",\n class: \"rich-text--external-link\"\n }\n }, [this.href.trim()]);\n }\n};\nconst remarkAutolink = function({ autolink, useMarkdown, useExtendedMarkdown }) {\n return function(tree) {\n if (useExtendedMarkdown || !useMarkdown || !autolink) {\n return;\n }\n visit(tree, (node) => node.type === \"text\", (node, index, parent) => {\n let parsed = parseUrl(node.value);\n parsed = parsed.map((n) => {\n if (typeof n === \"string\") {\n return u(\"text\", n);\n }\n return u(\"link\", {\n url: n.props.href\n }, [u(\"text\", n.props.href)]);\n }).filter((x) => x);\n parent.children.splice(index, 1, ...parsed.flat());\n return [SKIP, index + parsed.flat().length];\n });\n };\n};\nconst parseUrl = (text) => {\n let match = URL_PATTERN_AUTOLINK.exec(text);\n const list = [];\n let start = 0;\n while (match !== null) {\n let href = match[2];\n let textAfter;\n let textBefore = text.substring(start, match.index + match[1].length);\n if (href[0] === \" \") {\n textBefore += href[0];\n href = href.substring(1).trim();\n }\n const lastChar = href[href.length - 1];\n if (lastChar === \".\" || lastChar === \",\" || lastChar === \";\" || match[0][0] === \"(\" && lastChar === \")\") {\n href = href.substring(0, href.length - 1);\n textAfter = lastChar;\n }\n list.push(textBefore);\n list.push({ component: NcLink, props: { href } });\n if (textAfter) {\n list.push(textAfter);\n }\n start = match.index + match[0].length;\n match = URL_PATTERN_AUTOLINK.exec(text);\n }\n list.push(text.substring(start));\n const joinedText = list.map((item) => typeof item === \"string\" ? item : item.props.href).join(\"\");\n if (text === joinedText) {\n return list;\n }\n console.error(\"Failed to reassemble the chunked text: \" + text);\n return text;\n};\nconst getRoute = (router, url) => {\n const removePrefix = (str, prefix) => str.startsWith(prefix) ? str.slice(prefix.length) : str;\n const removePrefixes = (str, ...prefixes) => prefixes.reduce((acc, prefix) => removePrefix(acc, prefix), str);\n if (!router) {\n return null;\n }\n const isAbsoluteURL = /^https?:\\/\\//.test(url);\n const isNonHttpLink = /^[a-z][a-z0-9+.-]*:.+/.test(url);\n if (!isAbsoluteURL && isNonHttpLink) {\n return null;\n }\n if (isAbsoluteURL && !url.startsWith(getBaseUrl())) {\n return null;\n }\n if (!isAbsoluteURL && !url.startsWith(\"/\")) {\n return null;\n }\n const relativeUrl = isAbsoluteURL ? removePrefixes(url, getBaseUrl(), \"/index.php\") : url;\n const relativeRouterBase = removePrefixes(router.history.base, getRootUrl(), \"/index.php\");\n const potentialRouterPath = removePrefixes(relativeUrl, relativeRouterBase) || \"/\";\n const route = router.resolve(potentialRouterPath).route;\n if (!route.matched.length) {\n return null;\n }\n return route.fullPath;\n};\nexport {\n URL_PATTERN as U,\n getRoute as g,\n parseUrl as p,\n remarkAutolink as r\n};\n","import Vue from 'vue'\nimport { getCurrentInstance } from 'vue'\n\nvar isVue2 = true\nvar isVue3 = false\nvar Vue2 = Vue\nvar warn = Vue.util.warn\n\nfunction install() {}\n\n// createApp polyfill\nexport function createApp(rootComponent, rootProps) {\n var vm\n var provide = {}\n var app = {\n config: Vue.config,\n use: Vue.use.bind(Vue),\n mixin: Vue.mixin.bind(Vue),\n component: Vue.component.bind(Vue),\n provide: function (key, value) {\n provide[key] = value\n return this\n },\n directive: function (name, dir) {\n if (dir) {\n Vue.directive(name, dir)\n return app\n } else {\n return Vue.directive(name)\n }\n },\n mount: function (el, hydrating) {\n if (!vm) {\n vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) }))\n vm.$mount(el, hydrating)\n return vm\n } else {\n return vm\n }\n },\n unmount: function () {\n if (vm) {\n vm.$destroy()\n vm = undefined\n }\n },\n }\n return app\n}\n\nexport {\n Vue,\n Vue2,\n isVue2,\n isVue3,\n install,\n warn\n}\n\n// Vue 3 components mock\nfunction createMockComponent(name) {\n return {\n setup() {\n throw new Error('[vue-demi] ' + name + ' is not supported in Vue 2. It\\'s provided to avoid compiler errors.')\n }\n }\n}\nexport var Fragment = /*#__PURE__*/ createMockComponent('Fragment')\nexport var Transition = /*#__PURE__*/ createMockComponent('Transition')\nexport var TransitionGroup = /*#__PURE__*/ createMockComponent('TransitionGroup')\nexport var Teleport = /*#__PURE__*/ createMockComponent('Teleport')\nexport var Suspense = /*#__PURE__*/ createMockComponent('Suspense')\nexport var KeepAlive = /*#__PURE__*/ createMockComponent('KeepAlive')\n\nexport * from 'vue'\n\n// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance()\nexport function hasInjectionContext() {\n return !!getCurrentInstance()\n}\n","import { defineComponent, ref, h, watch, computed, reactive, shallowRef, nextTick, getCurrentInstance, onMounted, isVue2, watchEffect, toRefs } from 'vue-demi';\nimport { onClickOutside as onClickOutside$1, useActiveElement, useBattery, useBrowserLocation, useClipboard, useDark, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDocumentVisibility, useStorage as useStorage$1, isClient as isClient$1, useDraggable, useElementBounding, useElementSize as useElementSize$1, useElementVisibility as useElementVisibility$1, useEyeDropper, useFullscreen, useGeolocation, useIdle, useMouse, useMouseInElement, useMousePressed, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, usePointer, usePointerLock, usePreferredColorScheme, usePreferredContrast, usePreferredDark as usePreferredDark$1, usePreferredLanguages, usePreferredReducedMotion, useTimeAgo, useTimestamp, useVirtualList, useWindowFocus, useWindowSize } from '@vueuse/core';\nimport { toValue, isClient, noop, isObject, tryOnScopeDispose, isIOS, directiveHooks, pausableWatch, tryOnMounted, toRef, useToggle, notNullish, promiseTimeout, until, useDebounceFn, useThrottleFn } from '@vueuse/shared';\n\nconst OnClickOutside = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"OnClickOutside\",\n props: [\"as\", \"options\"],\n emits: [\"trigger\"],\n setup(props, { slots, emit }) {\n const target = ref();\n onClickOutside$1(target, (e) => {\n emit(\"trigger\", e);\n }, props.options);\n return () => {\n if (slots.default)\n return h(props.as || \"div\", { ref: target }, slots.default());\n };\n }\n});\n\nfunction unrefElement(elRef) {\n var _a;\n const plain = toValue(elRef);\n return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;\n}\n\nconst defaultWindow = isClient ? window : void 0;\n\nfunction useEventListener(...args) {\n let target;\n let events;\n let listeners;\n let options;\n if (typeof args[0] === \"string\" || Array.isArray(args[0])) {\n [events, listeners, options] = args;\n target = defaultWindow;\n } else {\n [target, events, listeners, options] = args;\n }\n if (!target)\n return noop;\n if (!Array.isArray(events))\n events = [events];\n if (!Array.isArray(listeners))\n listeners = [listeners];\n const cleanups = [];\n const cleanup = () => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n };\n const register = (el, event, listener, options2) => {\n el.addEventListener(event, listener, options2);\n return () => el.removeEventListener(event, listener, options2);\n };\n const stopWatch = watch(\n () => [unrefElement(target), toValue(options)],\n ([el, options2]) => {\n cleanup();\n if (!el)\n return;\n const optionsClone = isObject(options2) ? { ...options2 } : options2;\n cleanups.push(\n ...events.flatMap((event) => {\n return listeners.map((listener) => register(el, event, listener, optionsClone));\n })\n );\n },\n { immediate: true, flush: \"post\" }\n );\n const stop = () => {\n stopWatch();\n cleanup();\n };\n tryOnScopeDispose(stop);\n return stop;\n}\n\nlet _iOSWorkaround = false;\nfunction onClickOutside(target, handler, options = {}) {\n const { window = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;\n if (!window)\n return noop;\n if (isIOS && !_iOSWorkaround) {\n _iOSWorkaround = true;\n Array.from(window.document.body.children).forEach((el) => el.addEventListener(\"click\", noop));\n window.document.documentElement.addEventListener(\"click\", noop);\n }\n let shouldListen = true;\n const shouldIgnore = (event) => {\n return ignore.some((target2) => {\n if (typeof target2 === \"string\") {\n return Array.from(window.document.querySelectorAll(target2)).some((el) => el === event.target || event.composedPath().includes(el));\n } else {\n const el = unrefElement(target2);\n return el && (event.target === el || event.composedPath().includes(el));\n }\n });\n };\n const listener = (event) => {\n const el = unrefElement(target);\n if (!el || el === event.target || event.composedPath().includes(el))\n return;\n if (event.detail === 0)\n shouldListen = !shouldIgnore(event);\n if (!shouldListen) {\n shouldListen = true;\n return;\n }\n handler(event);\n };\n const cleanup = [\n useEventListener(window, \"click\", listener, { passive: true, capture }),\n useEventListener(window, \"pointerdown\", (e) => {\n const el = unrefElement(target);\n shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));\n }, { passive: true }),\n detectIframe && useEventListener(window, \"blur\", (event) => {\n setTimeout(() => {\n var _a;\n const el = unrefElement(target);\n if (((_a = window.document.activeElement) == null ? void 0 : _a.tagName) === \"IFRAME\" && !(el == null ? void 0 : el.contains(window.document.activeElement))) {\n handler(event);\n }\n }, 0);\n })\n ].filter(Boolean);\n const stop = () => cleanup.forEach((fn) => fn());\n return stop;\n}\n\nconst vOnClickOutside = {\n [directiveHooks.mounted](el, binding) {\n const capture = !binding.modifiers.bubble;\n if (typeof binding.value === \"function\") {\n el.__onClickOutside_stop = onClickOutside(el, binding.value, { capture });\n } else {\n const [handler, options] = binding.value;\n el.__onClickOutside_stop = onClickOutside(el, handler, Object.assign({ capture }, options));\n }\n },\n [directiveHooks.unmounted](el) {\n el.__onClickOutside_stop();\n }\n};\n\nfunction createKeyPredicate(keyFilter) {\n if (typeof keyFilter === \"function\")\n return keyFilter;\n else if (typeof keyFilter === \"string\")\n return (event) => event.key === keyFilter;\n else if (Array.isArray(keyFilter))\n return (event) => keyFilter.includes(event.key);\n return () => true;\n}\nfunction onKeyStroke(...args) {\n let key;\n let handler;\n let options = {};\n if (args.length === 3) {\n key = args[0];\n handler = args[1];\n options = args[2];\n } else if (args.length === 2) {\n if (typeof args[1] === \"object\") {\n key = true;\n handler = args[0];\n options = args[1];\n } else {\n key = args[0];\n handler = args[1];\n }\n } else {\n key = true;\n handler = args[0];\n }\n const {\n target = defaultWindow,\n eventName = \"keydown\",\n passive = false,\n dedupe = false\n } = options;\n const predicate = createKeyPredicate(key);\n const listener = (e) => {\n if (e.repeat && toValue(dedupe))\n return;\n if (predicate(e))\n handler(e);\n };\n return useEventListener(target, eventName, listener, passive);\n}\n\nconst vOnKeyStroke = {\n [directiveHooks.mounted](el, binding) {\n var _a, _b;\n const keys = (_b = (_a = binding.arg) == null ? void 0 : _a.split(\",\")) != null ? _b : true;\n if (typeof binding.value === \"function\") {\n onKeyStroke(keys, binding.value, {\n target: el\n });\n } else {\n const [handler, options] = binding.value;\n onKeyStroke(keys, handler, {\n target: el,\n ...options\n });\n }\n }\n};\n\nconst DEFAULT_DELAY = 500;\nconst DEFAULT_THRESHOLD = 10;\nfunction onLongPress(target, handler, options) {\n var _a, _b;\n const elementRef = computed(() => unrefElement(target));\n let timeout;\n let posStart;\n let startTimestamp;\n let hasLongPressed = false;\n function clear() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = void 0;\n }\n posStart = void 0;\n startTimestamp = void 0;\n hasLongPressed = false;\n }\n function onRelease(ev) {\n var _a2, _b2, _c;\n const [_startTimestamp, _posStart, _hasLongPressed] = [startTimestamp, posStart, hasLongPressed];\n clear();\n if (!(options == null ? void 0 : options.onMouseUp) || !_posStart || !_startTimestamp)\n return;\n if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)\n return;\n if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)\n ev.preventDefault();\n if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)\n ev.stopPropagation();\n const dx = ev.x - _posStart.x;\n const dy = ev.y - _posStart.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n options.onMouseUp(ev.timeStamp - _startTimestamp, distance, _hasLongPressed);\n }\n function onDown(ev) {\n var _a2, _b2, _c, _d;\n if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)\n return;\n clear();\n if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)\n ev.preventDefault();\n if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)\n ev.stopPropagation();\n posStart = {\n x: ev.x,\n y: ev.y\n };\n startTimestamp = ev.timeStamp;\n timeout = setTimeout(\n () => {\n hasLongPressed = true;\n handler(ev);\n },\n (_d = options == null ? void 0 : options.delay) != null ? _d : DEFAULT_DELAY\n );\n }\n function onMove(ev) {\n var _a2, _b2, _c, _d;\n if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)\n return;\n if (!posStart || (options == null ? void 0 : options.distanceThreshold) === false)\n return;\n if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)\n ev.preventDefault();\n if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)\n ev.stopPropagation();\n const dx = ev.x - posStart.x;\n const dy = ev.y - posStart.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n if (distance >= ((_d = options == null ? void 0 : options.distanceThreshold) != null ? _d : DEFAULT_THRESHOLD))\n clear();\n }\n const listenerOptions = {\n capture: (_a = options == null ? void 0 : options.modifiers) == null ? void 0 : _a.capture,\n once: (_b = options == null ? void 0 : options.modifiers) == null ? void 0 : _b.once\n };\n const cleanup = [\n useEventListener(elementRef, \"pointerdown\", onDown, listenerOptions),\n useEventListener(elementRef, \"pointermove\", onMove, listenerOptions),\n useEventListener(elementRef, [\"pointerup\", \"pointerleave\"], onRelease, listenerOptions)\n ];\n const stop = () => cleanup.forEach((fn) => fn());\n return stop;\n}\n\nconst OnLongPress = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"OnLongPress\",\n props: [\"as\", \"options\"],\n emits: [\"trigger\"],\n setup(props, { slots, emit }) {\n const target = ref();\n onLongPress(\n target,\n (e) => {\n emit(\"trigger\", e);\n },\n props.options\n );\n return () => {\n if (slots.default)\n return h(props.as || \"div\", { ref: target }, slots.default());\n };\n }\n});\n\nconst vOnLongPress = {\n [directiveHooks.mounted](el, binding) {\n if (typeof binding.value === \"function\")\n onLongPress(el, binding.value, { modifiers: binding.modifiers });\n else\n onLongPress(el, ...binding.value);\n }\n};\n\nconst UseActiveElement = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseActiveElement\",\n setup(props, { slots }) {\n const data = reactive({\n element: useActiveElement()\n });\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseBattery = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseBattery\",\n setup(props, { slots }) {\n const data = reactive(useBattery(props));\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseBrowserLocation = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseBrowserLocation\",\n setup(props, { slots }) {\n const data = reactive(useBrowserLocation());\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseClipboard = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseClipboard\",\n props: [\n \"source\",\n \"read\",\n \"navigator\",\n \"copiedDuring\",\n \"legacy\"\n ],\n setup(props, { slots }) {\n const data = reactive(useClipboard(props));\n return () => {\n var _a;\n return (_a = slots.default) == null ? void 0 : _a.call(slots, data);\n };\n }\n});\n\nconst _global = typeof globalThis !== \"undefined\" ? globalThis : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : {};\nconst globalKey = \"__vueuse_ssr_handlers__\";\nconst handlers = /* @__PURE__ */ getHandlers();\nfunction getHandlers() {\n if (!(globalKey in _global))\n _global[globalKey] = _global[globalKey] || {};\n return _global[globalKey];\n}\nfunction getSSRHandler(key, fallback) {\n return handlers[key] || fallback;\n}\n\nfunction guessSerializerType(rawInit) {\n return rawInit == null ? \"any\" : rawInit instanceof Set ? \"set\" : rawInit instanceof Map ? \"map\" : rawInit instanceof Date ? \"date\" : typeof rawInit === \"boolean\" ? \"boolean\" : typeof rawInit === \"string\" ? \"string\" : typeof rawInit === \"object\" ? \"object\" : !Number.isNaN(rawInit) ? \"number\" : \"any\";\n}\n\nconst StorageSerializers = {\n boolean: {\n read: (v) => v === \"true\",\n write: (v) => String(v)\n },\n object: {\n read: (v) => JSON.parse(v),\n write: (v) => JSON.stringify(v)\n },\n number: {\n read: (v) => Number.parseFloat(v),\n write: (v) => String(v)\n },\n any: {\n read: (v) => v,\n write: (v) => String(v)\n },\n string: {\n read: (v) => v,\n write: (v) => String(v)\n },\n map: {\n read: (v) => new Map(JSON.parse(v)),\n write: (v) => JSON.stringify(Array.from(v.entries()))\n },\n set: {\n read: (v) => new Set(JSON.parse(v)),\n write: (v) => JSON.stringify(Array.from(v))\n },\n date: {\n read: (v) => new Date(v),\n write: (v) => v.toISOString()\n }\n};\nconst customStorageEventName = \"vueuse-storage\";\nfunction useStorage(key, defaults, storage, options = {}) {\n var _a;\n const {\n flush = \"pre\",\n deep = true,\n listenToStorageChanges = true,\n writeDefaults = true,\n mergeDefaults = false,\n shallow,\n window = defaultWindow,\n eventFilter,\n onError = (e) => {\n console.error(e);\n },\n initOnMounted\n } = options;\n const data = (shallow ? shallowRef : ref)(typeof defaults === \"function\" ? defaults() : defaults);\n if (!storage) {\n try {\n storage = getSSRHandler(\"getDefaultStorage\", () => {\n var _a2;\n return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;\n })();\n } catch (e) {\n onError(e);\n }\n }\n if (!storage)\n return data;\n const rawInit = toValue(defaults);\n const type = guessSerializerType(rawInit);\n const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];\n const { pause: pauseWatch, resume: resumeWatch } = pausableWatch(\n data,\n () => write(data.value),\n { flush, deep, eventFilter }\n );\n if (window && listenToStorageChanges) {\n tryOnMounted(() => {\n if (storage instanceof Storage)\n useEventListener(window, \"storage\", update);\n else\n useEventListener(window, customStorageEventName, updateFromCustomEvent);\n if (initOnMounted)\n update();\n });\n }\n if (!initOnMounted)\n update();\n function dispatchWriteEvent(oldValue, newValue) {\n if (window) {\n const payload = {\n key,\n oldValue,\n newValue,\n storageArea: storage\n };\n window.dispatchEvent(storage instanceof Storage ? new StorageEvent(\"storage\", payload) : new CustomEvent(customStorageEventName, {\n detail: payload\n }));\n }\n }\n function write(v) {\n try {\n const oldValue = storage.getItem(key);\n if (v == null) {\n dispatchWriteEvent(oldValue, null);\n storage.removeItem(key);\n } else {\n const serialized = serializer.write(v);\n if (oldValue !== serialized) {\n storage.setItem(key, serialized);\n dispatchWriteEvent(oldValue, serialized);\n }\n }\n } catch (e) {\n onError(e);\n }\n }\n function read(event) {\n const rawValue = event ? event.newValue : storage.getItem(key);\n if (rawValue == null) {\n if (writeDefaults && rawInit != null)\n storage.setItem(key, serializer.write(rawInit));\n return rawInit;\n } else if (!event && mergeDefaults) {\n const value = serializer.read(rawValue);\n if (typeof mergeDefaults === \"function\")\n return mergeDefaults(value, rawInit);\n else if (type === \"object\" && !Array.isArray(value))\n return { ...rawInit, ...value };\n return value;\n } else if (typeof rawValue !== \"string\") {\n return rawValue;\n } else {\n return serializer.read(rawValue);\n }\n }\n function update(event) {\n if (event && event.storageArea !== storage)\n return;\n if (event && event.key == null) {\n data.value = rawInit;\n return;\n }\n if (event && event.key !== key)\n return;\n pauseWatch();\n try {\n if ((event == null ? void 0 : event.newValue) !== serializer.write(data.value))\n data.value = read(event);\n } catch (e) {\n onError(e);\n } finally {\n if (event)\n nextTick(resumeWatch);\n else\n resumeWatch();\n }\n }\n function updateFromCustomEvent(event) {\n update(event.detail);\n }\n return data;\n}\n\nfunction useMounted() {\n const isMounted = ref(false);\n const instance = getCurrentInstance();\n if (instance) {\n onMounted(() => {\n isMounted.value = true;\n }, isVue2 ? void 0 : instance);\n }\n return isMounted;\n}\n\nfunction useSupported(callback) {\n const isMounted = useMounted();\n return computed(() => {\n isMounted.value;\n return Boolean(callback());\n });\n}\n\nfunction useMediaQuery(query, options = {}) {\n const { window = defaultWindow } = options;\n const isSupported = useSupported(() => window && \"matchMedia\" in window && typeof window.matchMedia === \"function\");\n let mediaQuery;\n const matches = ref(false);\n const handler = (event) => {\n matches.value = event.matches;\n };\n const cleanup = () => {\n if (!mediaQuery)\n return;\n if (\"removeEventListener\" in mediaQuery)\n mediaQuery.removeEventListener(\"change\", handler);\n else\n mediaQuery.removeListener(handler);\n };\n const stopWatch = watchEffect(() => {\n if (!isSupported.value)\n return;\n cleanup();\n mediaQuery = window.matchMedia(toValue(query));\n if (\"addEventListener\" in mediaQuery)\n mediaQuery.addEventListener(\"change\", handler);\n else\n mediaQuery.addListener(handler);\n matches.value = mediaQuery.matches;\n });\n tryOnScopeDispose(() => {\n stopWatch();\n cleanup();\n mediaQuery = void 0;\n });\n return matches;\n}\n\nfunction usePreferredDark(options) {\n return useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n}\n\nconst CSS_DISABLE_TRANS = \"*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\";\nfunction useColorMode(options = {}) {\n const {\n selector = \"html\",\n attribute = \"class\",\n initialValue = \"auto\",\n window = defaultWindow,\n storage,\n storageKey = \"vueuse-color-scheme\",\n listenToStorageChanges = true,\n storageRef,\n emitAuto,\n disableTransition = true\n } = options;\n const modes = {\n auto: \"\",\n light: \"light\",\n dark: \"dark\",\n ...options.modes || {}\n };\n const preferredDark = usePreferredDark({ window });\n const system = computed(() => preferredDark.value ? \"dark\" : \"light\");\n const store = storageRef || (storageKey == null ? toRef(initialValue) : useStorage(storageKey, initialValue, storage, { window, listenToStorageChanges }));\n const state = computed(() => store.value === \"auto\" ? system.value : store.value);\n const updateHTMLAttrs = getSSRHandler(\n \"updateHTMLAttrs\",\n (selector2, attribute2, value) => {\n const el = typeof selector2 === \"string\" ? window == null ? void 0 : window.document.querySelector(selector2) : unrefElement(selector2);\n if (!el)\n return;\n const classesToAdd = /* @__PURE__ */ new Set();\n const classesToRemove = /* @__PURE__ */ new Set();\n let attributeToChange = null;\n if (attribute2 === \"class\") {\n const current = value.split(/\\s/g);\n Object.values(modes).flatMap((i) => (i || \"\").split(/\\s/g)).filter(Boolean).forEach((v) => {\n if (current.includes(v))\n classesToAdd.add(v);\n else\n classesToRemove.add(v);\n });\n } else {\n attributeToChange = { key: attribute2, value };\n }\n if (classesToAdd.size === 0 && classesToRemove.size === 0 && attributeToChange === null)\n return;\n let style;\n if (disableTransition) {\n style = window.document.createElement(\"style\");\n style.appendChild(document.createTextNode(CSS_DISABLE_TRANS));\n window.document.head.appendChild(style);\n }\n for (const c of classesToAdd) {\n el.classList.add(c);\n }\n for (const c of classesToRemove) {\n el.classList.remove(c);\n }\n if (attributeToChange) {\n el.setAttribute(attributeToChange.key, attributeToChange.value);\n }\n if (disableTransition) {\n window.getComputedStyle(style).opacity;\n document.head.removeChild(style);\n }\n }\n );\n function defaultOnChanged(mode) {\n var _a;\n updateHTMLAttrs(selector, attribute, (_a = modes[mode]) != null ? _a : mode);\n }\n function onChanged(mode) {\n if (options.onChanged)\n options.onChanged(mode, defaultOnChanged);\n else\n defaultOnChanged(mode);\n }\n watch(state, onChanged, { flush: \"post\", immediate: true });\n tryOnMounted(() => onChanged(state.value));\n const auto = computed({\n get() {\n return emitAuto ? store.value : state.value;\n },\n set(v) {\n store.value = v;\n }\n });\n try {\n return Object.assign(auto, { store, system, state });\n } catch (e) {\n return auto;\n }\n}\n\nconst UseColorMode = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseColorMode\",\n props: [\"selector\", \"attribute\", \"modes\", \"onChanged\", \"storageKey\", \"storage\", \"emitAuto\"],\n setup(props, { slots }) {\n const mode = useColorMode(props);\n const data = reactive({\n mode,\n system: mode.system,\n store: mode.store\n });\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseDark = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseDark\",\n props: [\"selector\", \"attribute\", \"valueDark\", \"valueLight\", \"onChanged\", \"storageKey\", \"storage\"],\n setup(props, { slots }) {\n const isDark = useDark(props);\n const data = reactive({\n isDark,\n toggleDark: useToggle(isDark)\n });\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseDeviceMotion = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseDeviceMotion\",\n setup(props, { slots }) {\n const data = reactive(useDeviceMotion());\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseDeviceOrientation = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseDeviceOrientation\",\n setup(props, { slots }) {\n const data = reactive(useDeviceOrientation());\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseDevicePixelRatio = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseDevicePixelRatio\",\n setup(props, { slots }) {\n const data = reactive({\n pixelRatio: useDevicePixelRatio()\n });\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseDevicesList = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseDevicesList\",\n props: [\"onUpdated\", \"requestPermissions\", \"constraints\"],\n setup(props, { slots }) {\n const data = reactive(useDevicesList(props));\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseDocumentVisibility = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseDocumentVisibility\",\n setup(props, { slots }) {\n const data = reactive({\n visibility: useDocumentVisibility()\n });\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseDraggable = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseDraggable\",\n props: [\n \"storageKey\",\n \"storageType\",\n \"initialValue\",\n \"exact\",\n \"preventDefault\",\n \"stopPropagation\",\n \"pointerTypes\",\n \"as\",\n \"handle\",\n \"axis\",\n \"onStart\",\n \"onMove\",\n \"onEnd\",\n \"disabled\",\n \"buttons\"\n ],\n setup(props, { slots }) {\n const target = ref();\n const handle = computed(() => {\n var _a;\n return (_a = props.handle) != null ? _a : target.value;\n });\n const disabled = computed(() => !!props.disabled);\n const storageValue = props.storageKey && useStorage$1(\n props.storageKey,\n toValue(props.initialValue) || { x: 0, y: 0 },\n isClient$1 ? props.storageType === \"session\" ? sessionStorage : localStorage : void 0\n );\n const initialValue = storageValue || props.initialValue || { x: 0, y: 0 };\n const onEnd = (position, event) => {\n var _a;\n (_a = props.onEnd) == null ? void 0 : _a.call(props, position, event);\n if (!storageValue)\n return;\n storageValue.value.x = position.x;\n storageValue.value.y = position.y;\n };\n const data = reactive(useDraggable(target, {\n ...props,\n handle,\n initialValue,\n onEnd,\n disabled\n }));\n return () => {\n if (slots.default)\n return h(props.as || \"div\", { ref: target, style: `touch-action:none;${data.style}` }, slots.default(data));\n };\n }\n});\n\nconst UseElementBounding = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseElementBounding\",\n props: [\"box\", \"as\"],\n setup(props, { slots }) {\n const target = ref();\n const data = reactive(useElementBounding(target));\n return () => {\n if (slots.default)\n return h(props.as || \"div\", { ref: target }, slots.default(data));\n };\n }\n});\n\nfunction useElementHover(el, options = {}) {\n const {\n delayEnter = 0,\n delayLeave = 0,\n window = defaultWindow\n } = options;\n const isHovered = ref(false);\n let timer;\n const toggle = (entering) => {\n const delay = entering ? delayEnter : delayLeave;\n if (timer) {\n clearTimeout(timer);\n timer = void 0;\n }\n if (delay)\n timer = setTimeout(() => isHovered.value = entering, delay);\n else\n isHovered.value = entering;\n };\n if (!window)\n return isHovered;\n useEventListener(el, \"mouseenter\", () => toggle(true), { passive: true });\n useEventListener(el, \"mouseleave\", () => toggle(false), { passive: true });\n return isHovered;\n}\n\nconst vElementHover = {\n [directiveHooks.mounted](el, binding) {\n const value = binding.value;\n if (typeof value === \"function\") {\n const isHovered = useElementHover(el);\n watch(isHovered, (v) => value(v));\n } else {\n const [handler, options] = value;\n const isHovered = useElementHover(el, options);\n watch(isHovered, (v) => handler(v));\n }\n }\n};\n\nconst UseElementSize = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseElementSize\",\n props: [\"width\", \"height\", \"box\", \"as\"],\n setup(props, { slots }) {\n const target = ref();\n const data = reactive(useElementSize$1(target, { width: props.width, height: props.height }, { box: props.box }));\n return () => {\n if (slots.default)\n return h(props.as || \"div\", { ref: target }, slots.default(data));\n };\n }\n});\n\nfunction useResizeObserver(target, callback, options = {}) {\n const { window = defaultWindow, ...observerOptions } = options;\n let observer;\n const isSupported = useSupported(() => window && \"ResizeObserver\" in window);\n const cleanup = () => {\n if (observer) {\n observer.disconnect();\n observer = void 0;\n }\n };\n const targets = computed(() => {\n const _targets = toValue(target);\n return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];\n });\n const stopWatch = watch(\n targets,\n (els) => {\n cleanup();\n if (isSupported.value && window) {\n observer = new ResizeObserver(callback);\n for (const _el of els) {\n if (_el)\n observer.observe(_el, observerOptions);\n }\n }\n },\n { immediate: true, flush: \"post\" }\n );\n const stop = () => {\n cleanup();\n stopWatch();\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n stop\n };\n}\n\nfunction useElementSize(target, initialSize = { width: 0, height: 0 }, options = {}) {\n const { window = defaultWindow, box = \"content-box\" } = options;\n const isSVG = computed(() => {\n var _a, _b;\n return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes(\"svg\");\n });\n const width = ref(initialSize.width);\n const height = ref(initialSize.height);\n const { stop: stop1 } = useResizeObserver(\n target,\n ([entry]) => {\n const boxSize = box === \"border-box\" ? entry.borderBoxSize : box === \"content-box\" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;\n if (window && isSVG.value) {\n const $elem = unrefElement(target);\n if ($elem) {\n const rect = $elem.getBoundingClientRect();\n width.value = rect.width;\n height.value = rect.height;\n }\n } else {\n if (boxSize) {\n const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];\n width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);\n height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);\n } else {\n width.value = entry.contentRect.width;\n height.value = entry.contentRect.height;\n }\n }\n },\n options\n );\n tryOnMounted(() => {\n const ele = unrefElement(target);\n if (ele) {\n width.value = \"offsetWidth\" in ele ? ele.offsetWidth : initialSize.width;\n height.value = \"offsetHeight\" in ele ? ele.offsetHeight : initialSize.height;\n }\n });\n const stop2 = watch(\n () => unrefElement(target),\n (ele) => {\n width.value = ele ? initialSize.width : 0;\n height.value = ele ? initialSize.height : 0;\n }\n );\n function stop() {\n stop1();\n stop2();\n }\n return {\n width,\n height,\n stop\n };\n}\n\nconst vElementSize = {\n [directiveHooks.mounted](el, binding) {\n var _a;\n const handler = typeof binding.value === \"function\" ? binding.value : (_a = binding.value) == null ? void 0 : _a[0];\n const options = typeof binding.value === \"function\" ? [] : binding.value.slice(1);\n const { width, height } = useElementSize(el, ...options);\n watch([width, height], ([width2, height2]) => handler({ width: width2, height: height2 }));\n }\n};\n\nconst UseElementVisibility = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseElementVisibility\",\n props: [\"as\"],\n setup(props, { slots }) {\n const target = ref();\n const data = reactive({\n isVisible: useElementVisibility$1(target)\n });\n return () => {\n if (slots.default)\n return h(props.as || \"div\", { ref: target }, slots.default(data));\n };\n }\n});\n\nfunction useIntersectionObserver(target, callback, options = {}) {\n const {\n root,\n rootMargin = \"0px\",\n threshold = 0,\n window = defaultWindow,\n immediate = true\n } = options;\n const isSupported = useSupported(() => window && \"IntersectionObserver\" in window);\n const targets = computed(() => {\n const _target = toValue(target);\n return (Array.isArray(_target) ? _target : [_target]).map(unrefElement).filter(notNullish);\n });\n let cleanup = noop;\n const isActive = ref(immediate);\n const stopWatch = isSupported.value ? watch(\n () => [targets.value, unrefElement(root), isActive.value],\n ([targets2, root2]) => {\n cleanup();\n if (!isActive.value)\n return;\n if (!targets2.length)\n return;\n const observer = new IntersectionObserver(\n callback,\n {\n root: unrefElement(root2),\n rootMargin,\n threshold\n }\n );\n targets2.forEach((el) => el && observer.observe(el));\n cleanup = () => {\n observer.disconnect();\n cleanup = noop;\n };\n },\n { immediate, flush: \"post\" }\n ) : noop;\n const stop = () => {\n cleanup();\n stopWatch();\n isActive.value = false;\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n isActive,\n pause() {\n cleanup();\n isActive.value = false;\n },\n resume() {\n isActive.value = true;\n },\n stop\n };\n}\n\nfunction useElementVisibility(element, options = {}) {\n const { window = defaultWindow, scrollTarget, threshold = 0 } = options;\n const elementIsVisible = ref(false);\n useIntersectionObserver(\n element,\n (intersectionObserverEntries) => {\n let isIntersecting = elementIsVisible.value;\n let latestTime = 0;\n for (const entry of intersectionObserverEntries) {\n if (entry.time >= latestTime) {\n latestTime = entry.time;\n isIntersecting = entry.isIntersecting;\n }\n }\n elementIsVisible.value = isIntersecting;\n },\n {\n root: scrollTarget,\n window,\n threshold\n }\n );\n return elementIsVisible;\n}\n\nconst vElementVisibility = {\n [directiveHooks.mounted](el, binding) {\n if (typeof binding.value === \"function\") {\n const handler = binding.value;\n const isVisible = useElementVisibility(el);\n watch(isVisible, (v) => handler(v), { immediate: true });\n } else {\n const [handler, options] = binding.value;\n const isVisible = useElementVisibility(el, options);\n watch(isVisible, (v) => handler(v), { immediate: true });\n }\n }\n};\n\nconst UseEyeDropper = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseEyeDropper\",\n props: {\n sRGBHex: String\n },\n setup(props, { slots }) {\n const data = reactive(useEyeDropper());\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseFullscreen = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseFullscreen\",\n props: [\"as\"],\n setup(props, { slots }) {\n const target = ref();\n const data = reactive(useFullscreen(target));\n return () => {\n if (slots.default)\n return h(props.as || \"div\", { ref: target }, slots.default(data));\n };\n }\n});\n\nconst UseGeolocation = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseGeolocation\",\n props: [\"enableHighAccuracy\", \"maximumAge\", \"timeout\", \"navigator\"],\n setup(props, { slots }) {\n const data = reactive(useGeolocation(props));\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseIdle = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseIdle\",\n props: [\"timeout\", \"events\", \"listenForVisibilityChange\", \"initialState\"],\n setup(props, { slots }) {\n const data = reactive(useIdle(props.timeout, props));\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nfunction useAsyncState(promise, initialState, options) {\n const {\n immediate = true,\n delay = 0,\n onError = noop,\n onSuccess = noop,\n resetOnExecute = true,\n shallow = true,\n throwError\n } = options != null ? options : {};\n const state = shallow ? shallowRef(initialState) : ref(initialState);\n const isReady = ref(false);\n const isLoading = ref(false);\n const error = shallowRef(void 0);\n async function execute(delay2 = 0, ...args) {\n if (resetOnExecute)\n state.value = initialState;\n error.value = void 0;\n isReady.value = false;\n isLoading.value = true;\n if (delay2 > 0)\n await promiseTimeout(delay2);\n const _promise = typeof promise === \"function\" ? promise(...args) : promise;\n try {\n const data = await _promise;\n state.value = data;\n isReady.value = true;\n onSuccess(data);\n } catch (e) {\n error.value = e;\n onError(e);\n if (throwError)\n throw e;\n } finally {\n isLoading.value = false;\n }\n return state.value;\n }\n if (immediate)\n execute(delay);\n const shell = {\n state,\n isReady,\n isLoading,\n error,\n execute\n };\n function waitUntilIsLoaded() {\n return new Promise((resolve, reject) => {\n until(isLoading).toBe(false).then(() => resolve(shell)).catch(reject);\n });\n }\n return {\n ...shell,\n then(onFulfilled, onRejected) {\n return waitUntilIsLoaded().then(onFulfilled, onRejected);\n }\n };\n}\n\nasync function loadImage(options) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n const { src, srcset, sizes, class: clazz, loading, crossorigin, referrerPolicy } = options;\n img.src = src;\n if (srcset)\n img.srcset = srcset;\n if (sizes)\n img.sizes = sizes;\n if (clazz)\n img.className = clazz;\n if (loading)\n img.loading = loading;\n if (crossorigin)\n img.crossOrigin = crossorigin;\n if (referrerPolicy)\n img.referrerPolicy = referrerPolicy;\n img.onload = () => resolve(img);\n img.onerror = reject;\n });\n}\nfunction useImage(options, asyncStateOptions = {}) {\n const state = useAsyncState(\n () => loadImage(toValue(options)),\n void 0,\n {\n resetOnExecute: true,\n ...asyncStateOptions\n }\n );\n watch(\n () => toValue(options),\n () => state.execute(asyncStateOptions.delay),\n { deep: true }\n );\n return state;\n}\n\nconst UseImage = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseImage\",\n props: [\n \"src\",\n \"srcset\",\n \"sizes\",\n \"as\",\n \"alt\",\n \"class\",\n \"loading\",\n \"crossorigin\",\n \"referrerPolicy\"\n ],\n setup(props, { slots }) {\n const data = reactive(useImage(props));\n return () => {\n if (data.isLoading && slots.loading)\n return slots.loading(data);\n else if (data.error && slots.error)\n return slots.error(data.error);\n if (slots.default)\n return slots.default(data);\n return h(props.as || \"img\", props);\n };\n }\n});\n\nconst ARRIVED_STATE_THRESHOLD_PIXELS = 1;\nfunction useScroll(element, options = {}) {\n const {\n throttle = 0,\n idle = 200,\n onStop = noop,\n onScroll = noop,\n offset = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n },\n eventListenerOptions = {\n capture: false,\n passive: true\n },\n behavior = \"auto\",\n window = defaultWindow,\n onError = (e) => {\n console.error(e);\n }\n } = options;\n const internalX = ref(0);\n const internalY = ref(0);\n const x = computed({\n get() {\n return internalX.value;\n },\n set(x2) {\n scrollTo(x2, void 0);\n }\n });\n const y = computed({\n get() {\n return internalY.value;\n },\n set(y2) {\n scrollTo(void 0, y2);\n }\n });\n function scrollTo(_x, _y) {\n var _a, _b, _c, _d;\n if (!window)\n return;\n const _element = toValue(element);\n if (!_element)\n return;\n (_c = _element instanceof Document ? window.document.body : _element) == null ? void 0 : _c.scrollTo({\n top: (_a = toValue(_y)) != null ? _a : y.value,\n left: (_b = toValue(_x)) != null ? _b : x.value,\n behavior: toValue(behavior)\n });\n const scrollContainer = ((_d = _element == null ? void 0 : _element.document) == null ? void 0 : _d.documentElement) || (_element == null ? void 0 : _element.documentElement) || _element;\n if (x != null)\n internalX.value = scrollContainer.scrollLeft;\n if (y != null)\n internalY.value = scrollContainer.scrollTop;\n }\n const isScrolling = ref(false);\n const arrivedState = reactive({\n left: true,\n right: false,\n top: true,\n bottom: false\n });\n const directions = reactive({\n left: false,\n right: false,\n top: false,\n bottom: false\n });\n const onScrollEnd = (e) => {\n if (!isScrolling.value)\n return;\n isScrolling.value = false;\n directions.left = false;\n directions.right = false;\n directions.top = false;\n directions.bottom = false;\n onStop(e);\n };\n const onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle + idle);\n const setArrivedState = (target) => {\n var _a;\n if (!window)\n return;\n const el = ((_a = target == null ? void 0 : target.document) == null ? void 0 : _a.documentElement) || (target == null ? void 0 : target.documentElement) || unrefElement(target);\n const { display, flexDirection } = getComputedStyle(el);\n const scrollLeft = el.scrollLeft;\n directions.left = scrollLeft < internalX.value;\n directions.right = scrollLeft > internalX.value;\n const left = Math.abs(scrollLeft) <= (offset.left || 0);\n const right = Math.abs(scrollLeft) + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n if (display === \"flex\" && flexDirection === \"row-reverse\") {\n arrivedState.left = right;\n arrivedState.right = left;\n } else {\n arrivedState.left = left;\n arrivedState.right = right;\n }\n internalX.value = scrollLeft;\n let scrollTop = el.scrollTop;\n if (target === window.document && !scrollTop)\n scrollTop = window.document.body.scrollTop;\n directions.top = scrollTop < internalY.value;\n directions.bottom = scrollTop > internalY.value;\n const top = Math.abs(scrollTop) <= (offset.top || 0);\n const bottom = Math.abs(scrollTop) + el.clientHeight >= el.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n if (display === \"flex\" && flexDirection === \"column-reverse\") {\n arrivedState.top = bottom;\n arrivedState.bottom = top;\n } else {\n arrivedState.top = top;\n arrivedState.bottom = bottom;\n }\n internalY.value = scrollTop;\n };\n const onScrollHandler = (e) => {\n var _a;\n if (!window)\n return;\n const eventTarget = (_a = e.target.documentElement) != null ? _a : e.target;\n setArrivedState(eventTarget);\n isScrolling.value = true;\n onScrollEndDebounced(e);\n onScroll(e);\n };\n useEventListener(\n element,\n \"scroll\",\n throttle ? useThrottleFn(onScrollHandler, throttle, true, false) : onScrollHandler,\n eventListenerOptions\n );\n tryOnMounted(() => {\n try {\n const _element = toValue(element);\n if (!_element)\n return;\n setArrivedState(_element);\n } catch (e) {\n onError(e);\n }\n });\n useEventListener(\n element,\n \"scrollend\",\n onScrollEnd,\n eventListenerOptions\n );\n return {\n x,\n y,\n isScrolling,\n arrivedState,\n directions,\n measure() {\n const _element = toValue(element);\n if (window && _element)\n setArrivedState(_element);\n }\n };\n}\n\nfunction resolveElement(el) {\n if (typeof Window !== \"undefined\" && el instanceof Window)\n return el.document.documentElement;\n if (typeof Document !== \"undefined\" && el instanceof Document)\n return el.documentElement;\n return el;\n}\n\nfunction useInfiniteScroll(element, onLoadMore, options = {}) {\n var _a;\n const {\n direction = \"bottom\",\n interval = 100,\n canLoadMore = () => true\n } = options;\n const state = reactive(useScroll(\n element,\n {\n ...options,\n offset: {\n [direction]: (_a = options.distance) != null ? _a : 0,\n ...options.offset\n }\n }\n ));\n const promise = ref();\n const isLoading = computed(() => !!promise.value);\n const observedElement = computed(() => {\n return resolveElement(toValue(element));\n });\n const isElementVisible = useElementVisibility(observedElement);\n function checkAndLoad() {\n state.measure();\n if (!observedElement.value || !isElementVisible.value || !canLoadMore(observedElement.value))\n return;\n const { scrollHeight, clientHeight, scrollWidth, clientWidth } = observedElement.value;\n const isNarrower = direction === \"bottom\" || direction === \"top\" ? scrollHeight <= clientHeight : scrollWidth <= clientWidth;\n if (state.arrivedState[direction] || isNarrower) {\n if (!promise.value) {\n promise.value = Promise.all([\n onLoadMore(state),\n new Promise((resolve) => setTimeout(resolve, interval))\n ]).finally(() => {\n promise.value = null;\n nextTick(() => checkAndLoad());\n });\n }\n }\n }\n watch(\n () => [state.arrivedState[direction], isElementVisible.value],\n checkAndLoad,\n { immediate: true }\n );\n return {\n isLoading,\n reset() {\n nextTick(() => checkAndLoad());\n }\n };\n}\n\nconst vInfiniteScroll = {\n [directiveHooks.mounted](el, binding) {\n if (typeof binding.value === \"function\")\n useInfiniteScroll(el, binding.value);\n else\n useInfiniteScroll(el, ...binding.value);\n }\n};\n\nconst vIntersectionObserver = {\n [directiveHooks.mounted](el, binding) {\n if (typeof binding.value === \"function\")\n useIntersectionObserver(el, binding.value);\n else\n useIntersectionObserver(el, ...binding.value);\n }\n};\n\nconst UseMouse = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseMouse\",\n props: [\"touch\", \"resetOnTouchEnds\", \"initialValue\"],\n setup(props, { slots }) {\n const data = reactive(useMouse(props));\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseMouseInElement = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseMouseElement\",\n props: [\"handleOutside\", \"as\"],\n setup(props, { slots }) {\n const target = ref();\n const data = reactive(useMouseInElement(target, props));\n return () => {\n if (slots.default)\n return h(props.as || \"div\", { ref: target }, slots.default(data));\n };\n }\n});\n\nconst UseMousePressed = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseMousePressed\",\n props: [\"touch\", \"initialValue\", \"as\"],\n setup(props, { slots }) {\n const target = ref();\n const data = reactive(useMousePressed({ ...props, target }));\n return () => {\n if (slots.default)\n return h(props.as || \"div\", { ref: target }, slots.default(data));\n };\n }\n});\n\nconst UseNetwork = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseNetwork\",\n setup(props, { slots }) {\n const data = reactive(useNetwork());\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseNow = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseNow\",\n props: [\"interval\"],\n setup(props, { slots }) {\n const data = reactive(useNow({ ...props, controls: true }));\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseObjectUrl = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseObjectUrl\",\n props: [\n \"object\"\n ],\n setup(props, { slots }) {\n const object = toRef(props, \"object\");\n const url = useObjectUrl(object);\n return () => {\n if (slots.default && url.value)\n return slots.default(url);\n };\n }\n});\n\nconst UseOffsetPagination = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseOffsetPagination\",\n props: [\n \"total\",\n \"page\",\n \"pageSize\",\n \"onPageChange\",\n \"onPageSizeChange\",\n \"onPageCountChange\"\n ],\n emits: [\n \"page-change\",\n \"page-size-change\",\n \"page-count-change\"\n ],\n setup(props, { slots, emit }) {\n const data = reactive(useOffsetPagination({\n ...props,\n onPageChange(...args) {\n var _a;\n (_a = props.onPageChange) == null ? void 0 : _a.call(props, ...args);\n emit(\"page-change\", ...args);\n },\n onPageSizeChange(...args) {\n var _a;\n (_a = props.onPageSizeChange) == null ? void 0 : _a.call(props, ...args);\n emit(\"page-size-change\", ...args);\n },\n onPageCountChange(...args) {\n var _a;\n (_a = props.onPageCountChange) == null ? void 0 : _a.call(props, ...args);\n emit(\"page-count-change\", ...args);\n }\n }));\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseOnline = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseOnline\",\n setup(props, { slots }) {\n const data = reactive({\n isOnline: useOnline()\n });\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UsePageLeave = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UsePageLeave\",\n setup(props, { slots }) {\n const data = reactive({\n isLeft: usePageLeave()\n });\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UsePointer = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UsePointer\",\n props: [\n \"pointerTypes\",\n \"initialValue\",\n \"target\"\n ],\n setup(props, { slots }) {\n const el = ref(null);\n const data = reactive(usePointer({\n ...props,\n target: props.target === \"self\" ? el : defaultWindow\n }));\n return () => {\n if (slots.default)\n return slots.default(data, { ref: el });\n };\n }\n});\n\nconst UsePointerLock = /* #__PURE__ */ defineComponent({\n name: \"UsePointerLock\",\n props: [\"as\"],\n setup(props, { slots }) {\n const target = ref();\n const data = reactive(usePointerLock(target));\n return () => {\n if (slots.default)\n return h(props.as || \"div\", { ref: target }, slots.default(data));\n };\n }\n});\n\nconst UsePreferredColorScheme = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UsePreferredColorScheme\",\n setup(props, { slots }) {\n const data = reactive({\n colorScheme: usePreferredColorScheme()\n });\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UsePreferredContrast = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UsePreferredContrast\",\n setup(props, { slots }) {\n const data = reactive({\n contrast: usePreferredContrast()\n });\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UsePreferredDark = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UsePreferredDark\",\n setup(props, { slots }) {\n const data = reactive({\n prefersDark: usePreferredDark$1()\n });\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UsePreferredLanguages = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UsePreferredLanguages\",\n setup(props, { slots }) {\n const data = reactive({\n languages: usePreferredLanguages()\n });\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UsePreferredReducedMotion = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UsePreferredReducedMotion\",\n setup(props, { slots }) {\n const data = reactive({\n motion: usePreferredReducedMotion()\n });\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst vResizeObserver = {\n [directiveHooks.mounted](el, binding) {\n if (typeof binding.value === \"function\")\n useResizeObserver(el, binding.value);\n else\n useResizeObserver(el, ...binding.value);\n }\n};\n\nfunction useMutationObserver(target, callback, options = {}) {\n const { window = defaultWindow, ...mutationOptions } = options;\n let observer;\n const isSupported = useSupported(() => window && \"MutationObserver\" in window);\n const cleanup = () => {\n if (observer) {\n observer.disconnect();\n observer = void 0;\n }\n };\n const targets = computed(() => {\n const value = toValue(target);\n const items = (Array.isArray(value) ? value : [value]).map(unrefElement).filter(notNullish);\n return new Set(items);\n });\n const stopWatch = watch(\n () => targets.value,\n (targets2) => {\n cleanup();\n if (isSupported.value && targets2.size) {\n observer = new MutationObserver(callback);\n targets2.forEach((el) => observer.observe(el, mutationOptions));\n }\n },\n { immediate: true, flush: \"post\" }\n );\n const takeRecords = () => {\n return observer == null ? void 0 : observer.takeRecords();\n };\n const stop = () => {\n stopWatch();\n cleanup();\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n stop,\n takeRecords\n };\n}\n\nfunction useCssVar(prop, target, options = {}) {\n const { window = defaultWindow, initialValue, observe = false } = options;\n const variable = ref(initialValue);\n const elRef = computed(() => {\n var _a;\n return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement);\n });\n function updateCssVar() {\n var _a;\n const key = toValue(prop);\n const el = toValue(elRef);\n if (el && window && key) {\n const value = (_a = window.getComputedStyle(el).getPropertyValue(key)) == null ? void 0 : _a.trim();\n variable.value = value || initialValue;\n }\n }\n if (observe) {\n useMutationObserver(elRef, updateCssVar, {\n attributeFilter: [\"style\", \"class\"],\n window\n });\n }\n watch(\n [elRef, () => toValue(prop)],\n (_, old) => {\n if (old[0] && old[1])\n old[0].style.removeProperty(old[1]);\n updateCssVar();\n },\n { immediate: true }\n );\n watch(\n variable,\n (val) => {\n var _a;\n const raw_prop = toValue(prop);\n if (((_a = elRef.value) == null ? void 0 : _a.style) && raw_prop) {\n if (val == null)\n elRef.value.style.removeProperty(raw_prop);\n else\n elRef.value.style.setProperty(raw_prop, val);\n }\n }\n );\n return variable;\n}\n\nconst topVarName = \"--vueuse-safe-area-top\";\nconst rightVarName = \"--vueuse-safe-area-right\";\nconst bottomVarName = \"--vueuse-safe-area-bottom\";\nconst leftVarName = \"--vueuse-safe-area-left\";\nfunction useScreenSafeArea() {\n const top = ref(\"\");\n const right = ref(\"\");\n const bottom = ref(\"\");\n const left = ref(\"\");\n if (isClient) {\n const topCssVar = useCssVar(topVarName);\n const rightCssVar = useCssVar(rightVarName);\n const bottomCssVar = useCssVar(bottomVarName);\n const leftCssVar = useCssVar(leftVarName);\n topCssVar.value = \"env(safe-area-inset-top, 0px)\";\n rightCssVar.value = \"env(safe-area-inset-right, 0px)\";\n bottomCssVar.value = \"env(safe-area-inset-bottom, 0px)\";\n leftCssVar.value = \"env(safe-area-inset-left, 0px)\";\n update();\n useEventListener(\"resize\", useDebounceFn(update));\n }\n function update() {\n top.value = getValue(topVarName);\n right.value = getValue(rightVarName);\n bottom.value = getValue(bottomVarName);\n left.value = getValue(leftVarName);\n }\n return {\n top,\n right,\n bottom,\n left,\n update\n };\n}\nfunction getValue(position) {\n return getComputedStyle(document.documentElement).getPropertyValue(position);\n}\n\nconst UseScreenSafeArea = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseScreenSafeArea\",\n props: {\n top: Boolean,\n right: Boolean,\n bottom: Boolean,\n left: Boolean\n },\n setup(props, { slots }) {\n const {\n top,\n right,\n bottom,\n left\n } = useScreenSafeArea();\n return () => {\n if (slots.default) {\n return h(\"div\", {\n style: {\n paddingTop: props.top ? top.value : \"\",\n paddingRight: props.right ? right.value : \"\",\n paddingBottom: props.bottom ? bottom.value : \"\",\n paddingLeft: props.left ? left.value : \"\",\n boxSizing: \"border-box\",\n maxHeight: \"100vh\",\n maxWidth: \"100vw\",\n overflow: \"auto\"\n }\n }, slots.default());\n }\n };\n }\n});\n\nconst vScroll = {\n [directiveHooks.mounted](el, binding) {\n if (typeof binding.value === \"function\") {\n const handler = binding.value;\n const state = useScroll(el, {\n onScroll() {\n handler(state);\n },\n onStop() {\n handler(state);\n }\n });\n } else {\n const [handler, options] = binding.value;\n const state = useScroll(el, {\n ...options,\n onScroll(e) {\n var _a;\n (_a = options.onScroll) == null ? void 0 : _a.call(options, e);\n handler(state);\n },\n onStop(e) {\n var _a;\n (_a = options.onStop) == null ? void 0 : _a.call(options, e);\n handler(state);\n }\n });\n }\n }\n};\n\nfunction checkOverflowScroll(ele) {\n const style = window.getComputedStyle(ele);\n if (style.overflowX === \"scroll\" || style.overflowY === \"scroll\" || style.overflowX === \"auto\" && ele.clientWidth < ele.scrollWidth || style.overflowY === \"auto\" && ele.clientHeight < ele.scrollHeight) {\n return true;\n } else {\n const parent = ele.parentNode;\n if (!parent || parent.tagName === \"BODY\")\n return false;\n return checkOverflowScroll(parent);\n }\n}\nfunction preventDefault(rawEvent) {\n const e = rawEvent || window.event;\n const _target = e.target;\n if (checkOverflowScroll(_target))\n return false;\n if (e.touches.length > 1)\n return true;\n if (e.preventDefault)\n e.preventDefault();\n return false;\n}\nconst elInitialOverflow = /* @__PURE__ */ new WeakMap();\nfunction useScrollLock(element, initialState = false) {\n const isLocked = ref(initialState);\n let stopTouchMoveListener = null;\n let initialOverflow = \"\";\n watch(toRef(element), (el) => {\n const target = resolveElement(toValue(el));\n if (target) {\n const ele = target;\n if (!elInitialOverflow.get(ele))\n elInitialOverflow.set(ele, ele.style.overflow);\n if (ele.style.overflow !== \"hidden\")\n initialOverflow = ele.style.overflow;\n if (ele.style.overflow === \"hidden\")\n return isLocked.value = true;\n if (isLocked.value)\n return ele.style.overflow = \"hidden\";\n }\n }, {\n immediate: true\n });\n const lock = () => {\n const el = resolveElement(toValue(element));\n if (!el || isLocked.value)\n return;\n if (isIOS) {\n stopTouchMoveListener = useEventListener(\n el,\n \"touchmove\",\n (e) => {\n preventDefault(e);\n },\n { passive: false }\n );\n }\n el.style.overflow = \"hidden\";\n isLocked.value = true;\n };\n const unlock = () => {\n const el = resolveElement(toValue(element));\n if (!el || !isLocked.value)\n return;\n if (isIOS)\n stopTouchMoveListener == null ? void 0 : stopTouchMoveListener();\n el.style.overflow = initialOverflow;\n elInitialOverflow.delete(el);\n isLocked.value = false;\n };\n tryOnScopeDispose(unlock);\n return computed({\n get() {\n return isLocked.value;\n },\n set(v) {\n if (v)\n lock();\n else unlock();\n }\n });\n}\n\nfunction onScrollLock() {\n let isMounted = false;\n const state = ref(false);\n return (el, binding) => {\n state.value = binding.value;\n if (isMounted)\n return;\n isMounted = true;\n const isLocked = useScrollLock(el, binding.value);\n watch(state, (v) => isLocked.value = v);\n };\n}\nconst vScrollLock = onScrollLock();\n\nconst UseTimeAgo = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseTimeAgo\",\n props: [\"time\", \"updateInterval\", \"max\", \"fullDateFormatter\", \"messages\", \"showSecond\"],\n setup(props, { slots }) {\n const data = reactive(useTimeAgo(() => props.time, { ...props, controls: true }));\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseTimestamp = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseTimestamp\",\n props: [\"immediate\", \"interval\", \"offset\"],\n setup(props, { slots }) {\n const data = reactive(useTimestamp({ ...props, controls: true }));\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseVirtualList = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseVirtualList\",\n props: [\n \"list\",\n \"options\",\n \"height\"\n ],\n setup(props, { slots, expose }) {\n const { list: listRef } = toRefs(props);\n const { list, containerProps, wrapperProps, scrollTo } = useVirtualList(listRef, props.options);\n expose({ scrollTo });\n if (containerProps.style && typeof containerProps.style === \"object\" && !Array.isArray(containerProps.style))\n containerProps.style.height = props.height || \"300px\";\n return () => h(\"div\", { ...containerProps }, [\n h(\"div\", { ...wrapperProps.value }, list.value.map((item) => h(\"div\", { style: { overflow: \"hidden\", height: item.height } }, slots.default ? slots.default(item) : \"Please set content!\")))\n ]);\n }\n});\n\nconst UseWindowFocus = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseWindowFocus\",\n setup(props, { slots }) {\n const data = reactive({\n focused: useWindowFocus()\n });\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nconst UseWindowSize = /* @__PURE__ */ /* #__PURE__ */ defineComponent({\n name: \"UseWindowSize\",\n props: [\"initialWidth\", \"initialHeight\"],\n setup(props, { slots }) {\n const data = reactive(useWindowSize(props));\n return () => {\n if (slots.default)\n return slots.default(data);\n };\n }\n});\n\nexport { OnClickOutside, OnLongPress, UseActiveElement, UseBattery, UseBrowserLocation, UseClipboard, UseColorMode, UseDark, UseDeviceMotion, UseDeviceOrientation, UseDevicePixelRatio, UseDevicesList, UseDocumentVisibility, UseDraggable, UseElementBounding, UseElementSize, UseElementVisibility, UseEyeDropper, UseFullscreen, UseGeolocation, UseIdle, UseImage, UseMouse, UseMouseInElement, UseMousePressed, UseNetwork, UseNow, UseObjectUrl, UseOffsetPagination, UseOnline, UsePageLeave, UsePointer, UsePointerLock, UsePreferredColorScheme, UsePreferredContrast, UsePreferredDark, UsePreferredLanguages, UsePreferredReducedMotion, UseScreenSafeArea, UseTimeAgo, UseTimestamp, UseVirtualList, UseWindowFocus, UseWindowSize, vOnClickOutside as VOnClickOutside, vOnLongPress as VOnLongPress, vElementHover, vElementSize, vElementVisibility, vInfiniteScroll, vIntersectionObserver, vOnClickOutside, vOnKeyStroke, vOnLongPress, vResizeObserver, vScroll, vScrollLock };\n","import '../assets/NcMentionBubble-C6t8od-_.css';\nimport '../assets/NcAvatar-CfUWTmJW.css';\nimport { N as NcActions } from \"./NcActions-D77YAhAy.mjs\";\nimport NcActionLink from \"../Components/NcActionLink.mjs\";\nimport NcActionRouter from \"../Components/NcActionRouter.mjs\";\nimport NcActionText from \"../Components/NcActionText.mjs\";\nimport NcButton from \"../Components/NcButton.mjs\";\nimport { N as NcIconSvgWrapper } from \"./NcIconSvgWrapper-DjrkBUkC.mjs\";\nimport NcLoadingIcon from \"../Components/NcLoadingIcon.mjs\";\nimport { N as NcUserStatusIcon, g as getUserStatusText } from \"./NcUserStatusIcon-CCCrTIIn.mjs\";\nimport { u as usernameToColor } from \"./usernameToColor-DivFGAn4.mjs\";\nimport { g as getAvatarUrl } from \"./getAvatarUrl-DxvUjKMi.mjs\";\nimport \"../Composables/useIsFullscreen.mjs\";\nimport \"../Composables/useIsMobile.mjs\";\n/* empty css */\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nimport \"linkify-string\";\nimport \"escape-html\";\nimport \"striptags\";\nimport \"vue\";\nimport { getCurrentUser } from \"@nextcloud/auth\";\nimport axios from \"@nextcloud/axios\";\nimport { getCapabilities } from \"@nextcloud/capabilities\";\nimport { generateOcsUrl, generateUrl } from \"@nextcloud/router\";\nimport { r as register, p as t10, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nimport { g as getRoute } from \"./autolink-cbuFALXr.mjs\";\nimport { D as DotsHorizontal } from \"./DotsHorizontal-Cd2x8oz2.mjs\";\nimport { subscribe, unsubscribe } from \"@nextcloud/event-bus\";\nimport { getBuilder } from \"@nextcloud/browser-storage\";\nimport { vOnClickOutside } from \"@vueuse/components\";\nconst userStatus = {\n data() {\n return {\n hasStatus: false,\n userStatus: {\n status: null,\n message: null,\n icon: null\n }\n };\n },\n methods: {\n /**\n * Fetches the user-status from the server\n *\n * @param {string} userId UserId of the user to fetch the status for\n *\n * @return {Promise}\n */\n async fetchUserStatus(userId) {\n var _a, _b;\n if (!userId) {\n return;\n }\n const capabilities = getCapabilities();\n if (!Object.prototype.hasOwnProperty.call(capabilities, \"user_status\") || !capabilities.user_status.enabled) {\n return;\n }\n if (!getCurrentUser()) {\n return;\n }\n try {\n const { data } = await axios.get(generateOcsUrl(\"apps/user_status/api/v1/statuses/{userId}\", { userId }));\n const {\n status,\n message,\n icon\n } = data.ocs.data;\n this.userStatus.status = status;\n this.userStatus.message = message || \"\";\n this.userStatus.icon = icon || \"\";\n this.hasStatus = true;\n } catch (e) {\n if (e.response.status === 404 && ((_b = (_a = e.response.data.ocs) == null ? void 0 : _a.data) == null ? void 0 : _b.length) === 0) {\n return;\n }\n console.error(e);\n }\n }\n }\n};\nregister(t10);\nconst browserStorage = getBuilder(\"nextcloud\").persist().build();\nfunction getUserHasAvatar(userId) {\n const flag = browserStorage.getItem(\"user-has-avatar.\" + userId);\n if (typeof flag === \"string\") {\n return Boolean(flag);\n }\n return null;\n}\nfunction setUserHasAvatar(userId, flag) {\n if (userId) {\n browserStorage.setItem(\"user-has-avatar.\" + userId, flag);\n }\n}\nconst _sfc_main = {\n name: \"NcAvatar\",\n directives: {\n ClickOutside: vOnClickOutside\n },\n components: {\n DotsHorizontal,\n NcActions,\n NcButton,\n NcIconSvgWrapper,\n NcLoadingIcon,\n NcUserStatusIcon\n },\n mixins: [userStatus],\n props: {\n /**\n * Set a custom url to the avatar image\n * either the url, user or displayName property must be defined\n */\n url: {\n type: String,\n default: void 0\n },\n /**\n * Set a css icon-class for an icon to be used instead of the avatar.\n */\n iconClass: {\n type: String,\n default: void 0\n },\n /**\n * Set the user id to fetch the avatar\n * either the url, user or displayName property must be defined\n */\n user: {\n type: String,\n default: void 0\n },\n /**\n * Whether or not to display the user-status\n */\n showUserStatus: {\n type: Boolean,\n default: true\n },\n /**\n * Whether or not to the status-icon should be used instead of online/away\n */\n showUserStatusCompact: {\n type: Boolean,\n default: true\n },\n /**\n * When the user status was preloaded via another source it can be handed in with this property to save the request.\n * If this property is not set the status will be fetched automatically.\n * If a preloaded no-status is available provide this object with properties \"status\", \"icon\" and \"message\" set to null.\n */\n preloadedUserStatus: {\n type: Object,\n default: void 0\n },\n /**\n * Is the user a guest user (then we have to user a different endpoint)\n */\n isGuest: {\n type: Boolean,\n default: false\n },\n /**\n * Set a display name that will be rendered as a tooltip\n * either the url, user or displayName property must be defined\n * specify just the displayname to generate a placeholder avatar without\n * trying to fetch the avatar based on the user id\n */\n displayName: {\n type: String,\n default: void 0\n },\n /**\n * Set a size in px for the rendered avatar\n */\n size: {\n type: Number,\n default: 32\n },\n /**\n * Placeholder avatars will be automatically generated when this is set to true\n */\n allowPlaceholder: {\n type: Boolean,\n default: true\n },\n /**\n * Disable the tooltip\n */\n disableTooltip: {\n type: Boolean,\n default: false\n },\n /**\n * Disable the menu\n */\n disableMenu: {\n type: Boolean,\n default: false\n },\n /**\n * Declares a custom tooltip when not null\n * Fallback will be the displayName\n *\n * requires disableTooltip not to be set to true\n */\n tooltipMessage: {\n type: String,\n default: null\n },\n /**\n * Declares username is not a user's name, when true.\n * Prevents loading user's avatar from server and forces generating colored initials,\n * i.e. if the user is a group\n */\n isNoUser: {\n type: Boolean,\n default: false\n },\n /**\n * Selector for the popover menu container\n */\n menuContainer: {\n type: [String, Object, Element, Boolean],\n default: \"body\"\n }\n },\n data() {\n return {\n avatarUrlLoaded: null,\n avatarSrcSetLoaded: null,\n userDoesNotExist: false,\n isAvatarLoaded: false,\n isMenuLoaded: false,\n contactsMenuLoading: false,\n contactsMenuActions: [],\n contactsMenuOpenState: false\n };\n },\n computed: {\n avatarAriaLabel() {\n var _a, _b;\n if (!this.hasMenu) {\n return;\n }\n if (this.canDisplayUserStatus || this.showUserStatusIconOnAvatar) {\n return t(\"Avatar of {displayName}, {status}\", { displayName: (_a = this.displayName) != null ? _a : this.user, status: getUserStatusText(this.userStatus.status) });\n }\n return t(\"Avatar of {displayName}\", { displayName: (_b = this.displayName) != null ? _b : this.user });\n },\n canDisplayUserStatus() {\n return this.showUserStatus && this.hasStatus && [\"online\", \"away\", \"busy\", \"dnd\"].includes(this.userStatus.status);\n },\n showUserStatusIconOnAvatar() {\n return this.showUserStatus && this.showUserStatusCompact && this.hasStatus && this.userStatus.status !== \"dnd\" && this.userStatus.icon;\n },\n /**\n * The user identifier, either the display name if set or the user property\n * If both properties are not set an empty string is returned\n */\n userIdentifier() {\n if (this.isDisplayNameDefined) {\n return this.displayName;\n }\n if (this.isUserDefined) {\n return this.user;\n }\n return \"\";\n },\n isUserDefined() {\n return typeof this.user !== \"undefined\";\n },\n isDisplayNameDefined() {\n return typeof this.displayName !== \"undefined\";\n },\n isUrlDefined() {\n return typeof this.url !== \"undefined\";\n },\n hasMenu() {\n var _a;\n if (this.disableMenu) {\n return false;\n }\n if (this.isMenuLoaded) {\n return this.menu.length > 0;\n }\n return !(this.user === ((_a = getCurrentUser()) == null ? void 0 : _a.uid) || this.userDoesNotExist || this.url);\n },\n /**\n * True if initials should be shown as the user icon fallback\n */\n showInitials() {\n return this.allowPlaceholder && this.userDoesNotExist && !(this.iconClass || this.$slots.icon);\n },\n avatarStyle() {\n const style = {\n \"--size\": this.size + \"px\",\n lineHeight: this.size + \"px\",\n fontSize: Math.round(this.size * 0.45) + \"px\"\n };\n return style;\n },\n initialsWrapperStyle() {\n const { r, g, b } = usernameToColor(this.userIdentifier);\n return {\n backgroundColor: \"rgba(\".concat(r, \", \").concat(g, \", \").concat(b, \", 0.1)\")\n };\n },\n initialsStyle() {\n const { r, g, b } = usernameToColor(this.userIdentifier);\n return {\n color: \"rgb(\".concat(r, \", \").concat(g, \", \").concat(b, \")\")\n };\n },\n tooltip() {\n if (this.disableTooltip) {\n return false;\n }\n if (this.tooltipMessage) {\n return this.tooltipMessage;\n }\n return this.displayName;\n },\n /**\n * Get the (max. two) initials of the user as uppcase string\n */\n initials() {\n let initials = \"?\";\n if (this.showInitials) {\n const user = this.userIdentifier.trim();\n if (user === \"\") {\n return initials;\n }\n const filteredChars = user.match(/[\\p{L}\\p{N}\\s]/gu);\n if (filteredChars == null) {\n return initials;\n }\n const filtered = filteredChars.join(\"\");\n const idx = filtered.lastIndexOf(\" \");\n initials = String.fromCodePoint(filtered.codePointAt(0));\n if (idx !== -1) {\n initials = initials.concat(String.fromCodePoint(filtered.codePointAt(idx + 1)));\n }\n }\n return initials.toLocaleUpperCase();\n },\n menu() {\n const actions = this.contactsMenuActions.map((item) => {\n const route = getRoute(this.$router, item.hyperlink);\n return {\n ncActionComponent: route ? NcActionRouter : NcActionLink,\n ncActionComponentProps: route ? {\n to: route,\n icon: item.icon\n } : {\n href: item.hyperlink,\n icon: item.icon\n },\n text: item.title\n };\n });\n function escape(html) {\n const text = document.createTextNode(html);\n const p = document.createElement(\"p\");\n p.appendChild(text);\n return p.innerHTML;\n }\n if (this.showUserStatus && (this.userStatus.icon || this.userStatus.message)) {\n const emojiIcon = '\\n\t\t\t\t\t'.concat(escape(this.userStatus.icon), \"\\n\t\t\t\t\");\n return [{\n ncActionComponent: NcActionText,\n ncActionComponentProps: {},\n iconSvg: this.userStatus.icon ? emojiIcon : void 0,\n text: \"\".concat(this.userStatus.message)\n }].concat(actions);\n }\n return actions;\n }\n },\n watch: {\n url() {\n this.userDoesNotExist = false;\n this.loadAvatarUrl();\n },\n user() {\n this.userDoesNotExist = false;\n this.isMenuLoaded = false;\n this.loadAvatarUrl();\n }\n },\n mounted() {\n this.loadAvatarUrl();\n subscribe(\"settings:avatar:updated\", this.loadAvatarUrl);\n subscribe(\"settings:display-name:updated\", this.loadAvatarUrl);\n if (this.showUserStatus && this.user && !this.isNoUser) {\n if (!this.preloadedUserStatus) {\n this.fetchUserStatus(this.user);\n } else {\n this.userStatus.status = this.preloadedUserStatus.status || \"\";\n this.userStatus.message = this.preloadedUserStatus.message || \"\";\n this.userStatus.icon = this.preloadedUserStatus.icon || \"\";\n this.hasStatus = this.preloadedUserStatus.status !== null;\n }\n subscribe(\"user_status:status.updated\", this.handleUserStatusUpdated);\n }\n },\n beforeDestroy() {\n unsubscribe(\"settings:avatar:updated\", this.loadAvatarUrl);\n unsubscribe(\"settings:display-name:updated\", this.loadAvatarUrl);\n if (this.showUserStatus && this.user && !this.isNoUser) {\n unsubscribe(\"user_status:status.updated\", this.handleUserStatusUpdated);\n }\n },\n methods: {\n t,\n handleUserStatusUpdated(state) {\n if (this.user === state.userId) {\n this.userStatus = {\n status: state.status,\n icon: state.icon,\n message: state.message\n };\n }\n },\n /**\n * Toggle the popover menu on click or enter\n * @param {KeyboardEvent|MouseEvent} event the UI event\n */\n async toggleMenu(event) {\n if (event.type === \"keydown\" && event.key !== \"Enter\") {\n return;\n }\n if (!this.contactsMenuOpenState) {\n await this.fetchContactsMenu();\n }\n this.contactsMenuOpenState = !this.contactsMenuOpenState;\n },\n closeMenu() {\n this.contactsMenuOpenState = false;\n },\n async fetchContactsMenu() {\n this.contactsMenuLoading = true;\n try {\n const user = encodeURIComponent(this.user);\n const { data } = await axios.post(generateUrl(\"contactsmenu/findOne\"), \"shareType=0&shareWith=\".concat(user));\n this.contactsMenuActions = data.topAction ? [data.topAction].concat(data.actions) : data.actions;\n } catch (e) {\n this.contactsMenuOpenState = false;\n }\n this.contactsMenuLoading = false;\n this.isMenuLoaded = true;\n },\n /**\n * Handle avatar loading if user or url defined\n */\n loadAvatarUrl() {\n this.isAvatarLoaded = false;\n if (!this.isUrlDefined && (!this.isUserDefined || this.isNoUser)) {\n this.isAvatarLoaded = true;\n this.userDoesNotExist = true;\n return;\n }\n if (this.isUrlDefined) {\n this.updateImageIfValid(this.url);\n return;\n }\n if (this.size <= 64) {\n const avatarUrl = this.avatarUrlGenerator(this.user, 64);\n const srcset = [\n avatarUrl + \" 1x\",\n this.avatarUrlGenerator(this.user, 512) + \" 8x\"\n ].join(\", \");\n this.updateImageIfValid(avatarUrl, srcset);\n } else {\n const avatarUrl = this.avatarUrlGenerator(this.user, 512);\n this.updateImageIfValid(avatarUrl);\n }\n },\n /**\n * Generate an avatar url from the server's avatar endpoint\n *\n * @param {string} user the user id\n * @param {number} size the desired size\n * @return {string}\n */\n avatarUrlGenerator(user, size) {\n var _a;\n let avatarUrl = getAvatarUrl(user, size, this.isGuest);\n if (user === ((_a = getCurrentUser()) == null ? void 0 : _a.uid) && typeof oc_userconfig !== \"undefined\") {\n avatarUrl += \"?v=\" + oc_userconfig.avatar.version;\n }\n return avatarUrl;\n },\n /**\n * Check if the provided url is valid and update Avatar if so\n *\n * @param {string} url the avatar url\n * @param {Array} srcset the avatar srcset\n */\n updateImageIfValid(url, srcset = null) {\n const userHasAvatar = getUserHasAvatar(this.user);\n if (this.isUserDefined && typeof userHasAvatar === \"boolean\") {\n this.isAvatarLoaded = true;\n this.avatarUrlLoaded = url;\n if (srcset) {\n this.avatarSrcSetLoaded = srcset;\n }\n if (userHasAvatar === false) {\n this.userDoesNotExist = true;\n }\n return;\n }\n const img = new Image();\n img.onload = () => {\n this.avatarUrlLoaded = url;\n if (srcset) {\n this.avatarSrcSetLoaded = srcset;\n }\n this.isAvatarLoaded = true;\n setUserHasAvatar(this.user, true);\n };\n img.onerror = () => {\n console.debug(\"Invalid avatar url\", url);\n this.avatarUrlLoaded = null;\n this.avatarSrcSetLoaded = null;\n this.userDoesNotExist = true;\n this.isAvatarLoaded = false;\n setUserHasAvatar(this.user, false);\n };\n if (srcset) {\n img.srcset = srcset;\n }\n img.src = url;\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", { directives: [{ name: \"click-outside\", rawName: \"v-click-outside\", value: _vm.closeMenu, expression: \"closeMenu\" }], ref: \"main\", staticClass: \"avatardiv popovermenu-wrapper\", class: {\n \"avatardiv--unknown\": _vm.userDoesNotExist,\n \"avatardiv--with-menu\": _vm.hasMenu,\n \"avatardiv--with-menu-loading\": _vm.contactsMenuLoading\n }, style: _vm.avatarStyle }, [_vm._t(\"icon\", function() {\n return [_vm.iconClass ? _c(\"span\", { staticClass: \"avatar-class-icon\", class: _vm.iconClass }) : _vm.isAvatarLoaded && !_vm.userDoesNotExist ? _c(\"img\", { attrs: { \"src\": _vm.avatarUrlLoaded, \"srcset\": _vm.avatarSrcSetLoaded, \"alt\": \"\" } }) : _vm._e()];\n }), _vm.hasMenu && _vm.menu.length === 0 ? _c(\"NcButton\", { staticClass: \"action-item action-item__menutoggle\", attrs: { \"type\": \"tertiary-no-background\", \"aria-label\": _vm.avatarAriaLabel, \"title\": _vm.tooltip }, on: { \"click\": _vm.toggleMenu }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_vm.contactsMenuLoading ? _c(\"NcLoadingIcon\") : _c(\"DotsHorizontal\", { attrs: { \"size\": 20 } })];\n }, proxy: true }], null, false, 2617833509) }) : _vm.hasMenu ? _c(\"NcActions\", { attrs: { \"force-menu\": \"\", \"manual-open\": \"\", \"type\": \"tertiary-no-background\", \"container\": _vm.menuContainer, \"open\": _vm.contactsMenuOpenState, \"aria-label\": _vm.avatarAriaLabel, \"title\": _vm.tooltip }, on: { \"update:open\": function($event) {\n _vm.contactsMenuOpenState = $event;\n }, \"click\": _vm.toggleMenu }, scopedSlots: _vm._u([_vm.contactsMenuLoading ? { key: \"icon\", fn: function() {\n return [_c(\"NcLoadingIcon\")];\n }, proxy: true } : null], null, true) }, _vm._l(_vm.menu, function(item, key) {\n return _c(item.ncActionComponent, _vm._b({ key, tag: \"component\", scopedSlots: _vm._u([item.iconSvg ? { key: \"icon\", fn: function() {\n return [_c(\"NcIconSvgWrapper\", { attrs: { \"svg\": item.iconSvg } })];\n }, proxy: true } : null], null, true) }, \"component\", item.ncActionComponentProps, false), [_vm._v(\" \" + _vm._s(item.text) + \" \")]);\n }), 1) : _vm._e(), _vm.showUserStatusIconOnAvatar ? _c(\"span\", { staticClass: \"avatardiv__user-status avatardiv__user-status--icon\" }, [_vm._v(\" \" + _vm._s(_vm.userStatus.icon) + \" \")]) : _vm.canDisplayUserStatus ? _c(\"NcUserStatusIcon\", { staticClass: \"avatardiv__user-status\", attrs: { \"status\": _vm.userStatus.status, \"aria-hidden\": String(_vm.hasMenu) } }) : _vm._e(), _vm.showInitials ? _c(\"span\", { staticClass: \"avatardiv__initials-wrapper\", style: _vm.initialsWrapperStyle }, [_c(\"span\", { staticClass: \"avatardiv__initials\", style: _vm.initialsStyle }, [_vm._v(\" \" + _vm._s(_vm.initials) + \" \")])]) : _vm._e()], 2);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"9ce7ef1d\"\n);\nconst NcAvatar = __component__.exports;\nexport {\n NcAvatar as N,\n userStatus as u\n};\n","import '../assets/NcMentionBubble-C6t8od-_.css';\nimport '../assets/NcListItemIcon--7OhLYWA.css';\nimport { N as NcAvatar, u as userStatus } from \"./NcAvatar-BFV6oZYX.mjs\";\nimport { N as NcHighlight } from \"./index-Bz6q9mZw.mjs\";\nimport { N as NcIconSvgWrapper } from \"./NcIconSvgWrapper-DjrkBUkC.mjs\";\nimport \"../Composables/useIsFullscreen.mjs\";\nimport \"../Composables/useIsMobile.mjs\";\nimport \"@nextcloud/router\";\n/* empty css */\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nimport \"linkify-string\";\nimport \"escape-html\";\nimport \"striptags\";\nimport \"vue\";\nconst margin = 8;\nconst defaultSize = 32;\nconst _sfc_main = {\n name: \"NcListItemIcon\",\n components: {\n NcAvatar,\n NcHighlight,\n NcIconSvgWrapper\n },\n mixins: [\n userStatus\n ],\n props: {\n /**\n * Default first line text\n */\n name: {\n type: String,\n required: true\n },\n /**\n * Secondary optional line\n * Only visible on size of 32 and above\n */\n subname: {\n type: String,\n default: \"\"\n },\n /**\n * Icon class to be displayed at the end of the component\n */\n icon: {\n type: String,\n default: \"\"\n },\n /**\n * SVG icon to be displayed at the end of the component\n */\n iconSvg: {\n type: String,\n default: \"\"\n },\n /**\n * Descriptive name for the icon\n */\n iconName: {\n type: String,\n default: \"\"\n },\n /**\n * Search within the highlight of name/subname\n */\n search: {\n type: String,\n default: \"\"\n },\n /**\n * Set a size in px that will define the avatar height/width\n * and therefore, the height of the component\n */\n avatarSize: {\n type: Number,\n default: defaultSize\n },\n /**\n * Disable the margins of this component.\n * Useful for integration in `NcSelect` for example\n */\n noMargin: {\n type: Boolean,\n default: false\n },\n /**\n * See the [Avatar](#Avatar) displayName prop\n * Fallback to name\n */\n displayName: {\n type: String,\n default: null\n },\n /**\n * See the [Avatar](#Avatar) isNoUser prop\n * Enable/disable the UserStatus fetching\n */\n isNoUser: {\n type: Boolean,\n default: false\n },\n /**\n * Unique list item ID\n */\n id: {\n type: String,\n default: null\n }\n },\n setup() {\n return {\n margin,\n defaultSize\n };\n },\n computed: {\n hasIcon() {\n return this.icon !== \"\";\n },\n hasIconSvg() {\n return this.iconSvg !== \"\";\n },\n isValidSubname() {\n var _a, _b;\n return ((_b = (_a = this.subname) == null ? void 0 : _a.trim) == null ? void 0 : _b.call(_a)) !== \"\";\n },\n isSizeBigEnough() {\n return this.avatarSize >= 26;\n },\n cssVars() {\n const margin2 = this.noMargin ? 0 : this.margin;\n return {\n \"--height\": this.avatarSize + 2 * margin2 + \"px\",\n \"--margin\": this.margin + \"px\"\n };\n },\n /**\n * Seperates the search property into two parts, the first one is the search part on the name, the second on the subname.\n * @return {[string, string]}\n */\n searchParts() {\n const EMAIL_NOTATION = /^([^<]*)<([^>]+)>?$/;\n const match = this.search.match(EMAIL_NOTATION);\n if (this.isNoUser || !match) {\n return [this.search, this.search];\n }\n return [match[1].trim(), match[2]];\n }\n },\n beforeMount() {\n if (!this.isNoUser && !this.subname) {\n this.fetchUserStatus(this.user);\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._g({ staticClass: \"option\", class: { \"option--compact\": _vm.avatarSize < _vm.defaultSize }, style: _vm.cssVars, attrs: { \"id\": _vm.id } }, _vm.$listeners), [_c(\"NcAvatar\", _vm._b({ staticClass: \"option__avatar\", attrs: { \"disable-menu\": true, \"disable-tooltip\": true, \"display-name\": _vm.displayName || _vm.name, \"is-no-user\": _vm.isNoUser, \"size\": _vm.avatarSize } }, \"NcAvatar\", _vm.$attrs, false)), _c(\"div\", { staticClass: \"option__details\" }, [_c(\"NcHighlight\", { staticClass: \"option__lineone\", attrs: { \"text\": _vm.name, \"search\": _vm.searchParts[0] } }), _vm.isValidSubname && _vm.isSizeBigEnough ? _c(\"NcHighlight\", { staticClass: \"option__linetwo\", attrs: { \"text\": _vm.subname, \"search\": _vm.searchParts[1] } }) : _vm.hasStatus ? _c(\"span\", [_c(\"span\", [_vm._v(_vm._s(_vm.userStatus.icon))]), _c(\"span\", [_vm._v(_vm._s(_vm.userStatus.message))])]) : _vm._e()], 1), _vm._t(\"default\", function() {\n return [_vm.hasIconSvg ? _c(\"NcIconSvgWrapper\", { staticClass: \"option__icon\", attrs: { \"svg\": _vm.iconSvg, \"name\": _vm.iconName } }) : _vm.hasIcon ? _c(\"span\", { staticClass: \"icon option__icon\", class: _vm.icon, attrs: { \"aria-label\": _vm.iconName } }) : _vm._e()];\n })], 2);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"a0f4d73a\"\n);\nconst NcListItemIcon = __component__.exports;\nexport {\n NcListItemIcon as N\n};\n","import '../assets/NcSelect-EIXtZSVn.css';\nimport { VueSelect } from \"@nextcloud/vue-select\";\nimport { autoUpdate, computePosition, offset, flip, shift, limitShift } from \"@floating-ui/dom\";\nimport Vue from \"vue\";\nimport { r as register, b as t16, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nimport { C as ChevronDown } from \"./ChevronDown-D3Tfshug.mjs\";\nimport { C as Close } from \"./Close-B6ccm1RP.mjs\";\nimport NcEllipsisedOption from \"../Components/NcEllipsisedOption.mjs\";\nimport { N as NcListItemIcon } from \"./NcListItemIcon-Bo4o5oVB.mjs\";\nimport NcLoadingIcon from \"../Components/NcLoadingIcon.mjs\";\nimport { G as GenRandomId } from \"./GenRandomId-CMooMQt0.mjs\";\nimport \"@nextcloud/vue-select/dist/vue-select.css\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nregister(t16);\nconst _sfc_main = {\n name: \"NcSelect\",\n components: {\n ChevronDown,\n NcEllipsisedOption,\n NcListItemIcon,\n NcLoadingIcon,\n VueSelect\n },\n props: {\n // Add VueSelect props to $props\n ...VueSelect.props,\n ...VueSelect.mixins.reduce((allProps, mixin) => ({ ...allProps, ...mixin.props }), {}),\n /**\n * `aria-label` for the clear input button\n */\n ariaLabelClearSelected: {\n type: String,\n default: t(\"Clear selected\")\n },\n /**\n * `aria-label` for the search input\n *\n * A descriptive `inputLabel` is preferred as this is not visible.\n */\n ariaLabelCombobox: {\n type: String,\n default: null\n },\n /**\n * `aria-label` for the listbox element\n */\n ariaLabelListbox: {\n type: String,\n default: t(\"Options\")\n },\n /**\n * Allows to customize the `aria-label` for the deselect-option button\n * The default is \"Deselect \" + optionLabel\n * @type {(optionLabel: string) => string}\n */\n ariaLabelDeselectOption: {\n type: Function,\n default: (optionLabel) => t(\"Deselect {option}\", { option: optionLabel })\n },\n /**\n * Append the dropdown element to the end of the body\n * and size/position it dynamically.\n *\n * @see https://vue-select.org/api/props.html#appendtobody\n */\n appendToBody: {\n type: Boolean,\n default: true\n },\n /**\n * When `appendToBody` is true, this function is responsible for\n * positioning the drop down list.\n *\n * If a function is returned from `calculatePosition`, it will\n * be called when the drop down list is removed from the DOM.\n * This allows for any garbage collection you may need to do.\n *\n * @see https://vue-select.org/api/props.html#calculateposition\n */\n calculatePosition: {\n type: Function,\n default: null\n },\n /**\n * Close the dropdown when selecting an option\n *\n * @see https://vue-select.org/api/props.html#closeonselect\n */\n closeOnSelect: {\n type: Boolean,\n default: true\n },\n /**\n * Replace default vue-select components\n *\n * @see https://vue-select.org/api/props.html#components\n */\n components: {\n type: Object,\n default: () => ({\n Deselect: {\n render: (createElement) => createElement(Close, {\n props: {\n size: 20,\n fillColor: \"var(--vs-controls-color)\"\n },\n style: {\n cursor: \"pointer\"\n }\n })\n }\n })\n },\n /**\n * Sets the maximum number of options to display in the dropdown list\n */\n limit: {\n type: Number,\n default: null\n },\n /**\n * Disable the component\n *\n * @see https://vue-select.org/api/props.html#disabled\n */\n disabled: {\n type: Boolean,\n default: false\n },\n /**\n * Determines whether the dropdown should be open.\n * Receives the component instance as the only argument.\n *\n * @see https://vue-select.org/api/props.html#dropdownshouldopen\n */\n dropdownShouldOpen: {\n type: Function,\n default: ({ noDrop, open }) => {\n return noDrop ? false : open;\n }\n },\n /**\n * Callback to determine if the provided option should\n * match the current search text. Used to determine\n * if the option should be displayed.\n *\n * Defaults to the internal vue-select function documented at the link\n * below\n *\n * Enabling `userSelect` will automatically set this to filter by the\n * `displayName` and `subname` properties of the user option object\n * unless this prop is set explicitly\n *\n * @see https://vue-select.org/api/props.html#filterby\n */\n filterBy: {\n type: Function,\n default: null\n },\n /**\n * Class for the `input`\n *\n * Necessary for use in NcActionInput\n */\n inputClass: {\n type: [String, Object],\n default: null\n },\n /**\n * Input element id\n */\n inputId: {\n type: String,\n default: () => \"select-input-\".concat(GenRandomId())\n },\n /**\n * Visible label for the input element\n *\n * @todo Set default for @nextcloud/vue 9\n */\n inputLabel: {\n type: String,\n default: null\n },\n /**\n * Pass true if you are using an external label\n */\n labelOutside: {\n type: Boolean,\n default: false\n },\n /**\n * Display a visible border around dropdown options\n * which have keyboard focus\n */\n keyboardFocusBorder: {\n type: Boolean,\n default: true\n },\n /**\n * Key of the displayed label for object options\n *\n * Defaults to the internal vue-select string documented at the link\n * below\n *\n * Enabling `userSelect` will automatically set this to `'displayName'`\n * unless this prop is set explicitly\n *\n * @see https://vue-select.org/api/props.html#label\n */\n label: {\n type: String,\n default: null\n },\n /**\n * Show the loading icon\n *\n * @see https://vue-select.org/api/props.html#loading\n */\n loading: {\n type: Boolean,\n default: false\n },\n /**\n * Allow selection of multiple options\n *\n * @see https://vue-select.org/api/props.html#multiple\n */\n multiple: {\n type: Boolean,\n default: false\n },\n /**\n * Disable automatic wrapping when selected options overflow the width\n */\n noWrap: {\n type: Boolean,\n default: false\n },\n /**\n * Array of options\n *\n * @type {Array>}\n *\n * @see https://vue-select.org/api/props.html#options\n */\n options: {\n type: Array,\n default: () => []\n },\n /**\n * Placeholder text\n *\n * @see https://vue-select.org/api/props.html#placeholder\n */\n placeholder: {\n type: String,\n default: \"\"\n },\n /**\n * Customized component's response to keydown events while the search input has focus\n *\n * @see https://vue-select.org/guide/keydown.html#mapkeydown\n */\n mapKeydown: {\n type: Function,\n /**\n * Patched Vue-Select keydown events handlers map to stop Escape propagation in open select\n *\n * @param {Record} map - Mapped keyCode to handlers { : }\n * @param {import('@nextcloud/vue-select').VueSelect} vm - VueSelect instance\n * @return {Record} patched keydown event handlers\n */\n default(map, vm) {\n return {\n ...map,\n /**\n * Patched Escape handler to stop propagation from open select\n *\n * @param {KeyboardEvent} event - default keydown event handler\n */\n 27: (event) => {\n if (vm.open) {\n event.stopPropagation();\n }\n map[27](event);\n }\n };\n }\n },\n /**\n * A unique identifier used to generate IDs and DOM attributes. Must be unique for every instance of the component.\n *\n * @see https://vue-select.org/api/props.html#uid\n */\n uid: {\n type: String,\n default: () => GenRandomId()\n },\n /**\n * When `appendToBody` is true, this sets the placement of the dropdown\n *\n * @type {'bottom' | 'top'}\n */\n placement: {\n type: String,\n default: \"bottom\"\n },\n /**\n * If false, the focused dropdown option will not be reset when filtered\n * options change\n */\n resetFocusOnOptionsChange: {\n type: Boolean,\n default: true\n },\n /**\n * Enable the user selector with avatars\n *\n * Objects must contain the data expected by the\n * [NcListItemIcon](#/Components/NcListItemIcon) and\n * [NcAvatar](#/Components/NcAvatar) components\n */\n userSelect: {\n type: Boolean,\n default: false\n },\n /**\n * Currently selected value\n *\n * The `v-model` directive may be used for two-way data binding\n *\n * @type {string | number | Record | Array}\n *\n * @see https://vue-select.org/api/props.html#value\n */\n value: {\n type: [String, Number, Object, Array],\n default: null\n },\n /**\n * Enable if a value is required for native form validation\n */\n required: {\n type: Boolean,\n default: false\n },\n /**\n * Any available prop\n *\n * @see https://vue-select.org/api/props.html\n */\n // Not an actual prop but needed to show in vue-styleguidist docs\n // eslint-disable-next-line\n \" \": {}\n },\n emits: [\n /**\n * All events from https://vue-select.org/api/events.html\n */\n // Not an actual event but needed to show in vue-styleguidist docs\n \" \"\n ],\n setup() {\n const clickableArea = Number.parseInt(window.getComputedStyle(document.body).getPropertyValue(\"--default-clickable-area\"));\n const gridBaseLine = Number.parseInt(window.getComputedStyle(document.body).getPropertyValue(\"--default-grid-baseline\"));\n const avatarSize = clickableArea - 2 * gridBaseLine;\n return {\n avatarSize\n };\n },\n data() {\n return {\n search: \"\"\n };\n },\n computed: {\n inputRequired() {\n if (!this.required) {\n return null;\n }\n return this.value === null || Array.isArray(this.value) && this.value.length === 0;\n },\n localCalculatePosition() {\n if (this.calculatePosition !== null) {\n return this.calculatePosition;\n }\n return (dropdownMenu, component, { width }) => {\n dropdownMenu.style.width = width;\n const addClass = {\n name: \"addClass\",\n fn(_middlewareArgs) {\n dropdownMenu.classList.add(\"vs__dropdown-menu--floating\");\n return {};\n }\n };\n const togglePlacementClass = {\n name: \"togglePlacementClass\",\n fn({ placement }) {\n component.$el.classList.toggle(\n \"select--drop-up\",\n placement === \"top\"\n );\n dropdownMenu.classList.toggle(\n \"vs__dropdown-menu--floating-placement-top\",\n placement === \"top\"\n );\n return {};\n }\n };\n const updatePosition = () => {\n computePosition(component.$refs.toggle, dropdownMenu, {\n placement: this.placement,\n middleware: [\n offset(-1),\n addClass,\n togglePlacementClass,\n // Match popperjs default collision prevention behavior by appending the following middleware in order\n flip(),\n shift({ limiter: limitShift() })\n ]\n }).then(({ x, y }) => {\n Object.assign(dropdownMenu.style, {\n left: \"\".concat(x, \"px\"),\n top: \"\".concat(y, \"px\"),\n width: \"\".concat(component.$refs.toggle.getBoundingClientRect().width, \"px\")\n });\n });\n };\n const cleanup = autoUpdate(\n component.$refs.toggle,\n dropdownMenu,\n updatePosition\n );\n return cleanup;\n };\n },\n localFilterBy() {\n const EMAIL_NOTATION = /[^<]*<([^>]+)/;\n if (this.filterBy !== null) {\n return this.filterBy;\n }\n if (this.userSelect) {\n return (option, label, search) => {\n var _a, _b, _c;\n const match = search.match(EMAIL_NOTATION);\n return match && ((_c = (_b = (_a = option.subname) == null ? void 0 : _a.toLocaleLowerCase) == null ? void 0 : _b.call(_a)) == null ? void 0 : _c.indexOf(match[1].toLocaleLowerCase())) > -1 || \"\".concat(label, \" \").concat(option.subname).toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) > -1;\n };\n }\n return VueSelect.props.filterBy.default;\n },\n localLabel() {\n if (this.label !== null) {\n return this.label;\n }\n if (this.userSelect) {\n return \"displayName\";\n }\n return VueSelect.props.label.default;\n },\n propsToForward() {\n const vueSelectKeys = [\n ...Object.keys(VueSelect.props),\n ...VueSelect.mixins.flatMap((mixin) => {\n var _a;\n return Object.keys((_a = mixin.props) != null ? _a : {});\n })\n ];\n const initialPropsToForward = Object.fromEntries(\n Object.entries(this.$props).filter(([key, _value]) => vueSelectKeys.includes(key))\n );\n const propsToForward = {\n ...initialPropsToForward,\n // Custom overrides of vue-select props\n calculatePosition: this.localCalculatePosition,\n filterBy: this.localFilterBy,\n label: this.localLabel\n };\n return propsToForward;\n }\n },\n mounted() {\n if (!this.labelOutside && !this.inputLabel && !this.ariaLabelCombobox) {\n Vue.util.warn(\"[NcSelect] An `inputLabel` or `ariaLabelCombobox` should be set. If an external label is used, `labelOutside` should be set to `true`.\");\n }\n if (this.inputLabel && this.ariaLabelCombobox) {\n Vue.util.warn(\"[NcSelect] Only one of `inputLabel` or `ariaLabelCombobox` should to be set.\");\n }\n },\n methods: {\n t\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"VueSelect\", _vm._g(_vm._b({ staticClass: \"select\", class: {\n \"select--no-wrap\": _vm.noWrap,\n \"user-select\": _vm.userSelect\n }, on: { \"search\": (searchString) => _vm.search = searchString }, scopedSlots: _vm._u([!_vm.labelOutside && _vm.inputLabel ? { key: \"header\", fn: function() {\n return [_c(\"label\", { staticClass: \"select__label\", attrs: { \"for\": _vm.inputId } }, [_vm._v(\" \" + _vm._s(_vm.inputLabel) + \" \")])];\n }, proxy: true } : null, { key: \"search\", fn: function({ attributes, events }) {\n return [_c(\"input\", _vm._g(_vm._b({ class: [\"vs__search\", _vm.inputClass], attrs: { \"required\": _vm.inputRequired } }, \"input\", attributes, false), events))];\n } }, { key: \"open-indicator\", fn: function({ attributes }) {\n return [_c(\"ChevronDown\", _vm._b({ style: {\n cursor: !_vm.disabled ? \"pointer\" : null\n }, attrs: { \"fill-color\": \"var(--vs-controls-color)\", \"size\": 26 } }, \"ChevronDown\", attributes, false))];\n } }, { key: \"option\", fn: function(option) {\n return [_vm.userSelect ? _c(\"NcListItemIcon\", _vm._b({ attrs: { \"avatar-size\": 32, \"name\": option[_vm.localLabel], \"search\": _vm.search } }, \"NcListItemIcon\", option, false)) : _c(\"NcEllipsisedOption\", { attrs: { \"name\": String(option[_vm.localLabel]), \"search\": _vm.search } })];\n } }, { key: \"selected-option\", fn: function(selectedOption) {\n return [_vm.userSelect ? _c(\"NcListItemIcon\", _vm._b({ attrs: { \"avatar-size\": _vm.avatarSize, \"name\": selectedOption[_vm.localLabel], \"no-margin\": \"\", \"search\": _vm.search } }, \"NcListItemIcon\", selectedOption, false)) : _c(\"NcEllipsisedOption\", { attrs: { \"name\": String(selectedOption[_vm.localLabel]), \"search\": _vm.search } })];\n } }, { key: \"spinner\", fn: function(spinner) {\n return [spinner.loading ? _c(\"NcLoadingIcon\") : _vm._e()];\n } }, { key: \"no-options\", fn: function() {\n return [_vm._v(\" \" + _vm._s(_vm.t(\"No results\")) + \" \")];\n }, proxy: true }, _vm._l(_vm.$scopedSlots, function(_, name) {\n return { key: name, fn: function(data) {\n return [_vm._t(name, null, null, data)];\n } };\n })], null, true) }, \"VueSelect\", _vm.propsToForward, false), _vm.$listeners));\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n null\n);\nconst NcSelect = __component__.exports;\nexport {\n NcSelect as N\n};\n","import { r as register, w as t25, a as t, x as t40 } from \"./_l10n-B4dEPXsr.mjs\";\nimport { getTimezoneManager as getTimezoneManager$1 } from \"@nextcloud/timezones\";\nimport { G as GenRandomId } from \"./GenRandomId-CMooMQt0.mjs\";\nimport { N as NcSelect } from \"./NcSelect-kmuffooC.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nregister(t25);\nfunction getSortedTimezoneList(timezoneList = [], additionalTimezones = []) {\n const sortedByContinent = {};\n const sortedList = [];\n for (const timezoneId of timezoneList) {\n const components = timezoneId.split(\"/\");\n let [continent, name] = [components.shift(), components.join(\"/\")];\n if (!name) {\n name = continent;\n continent = t(\"Global\");\n }\n sortedByContinent[continent] = sortedByContinent[continent] || {\n continent,\n regions: []\n };\n sortedByContinent[continent].regions.push({\n label: getReadableTimezoneName(name),\n cities: [],\n timezoneId\n });\n }\n for (const additionalTimezone of additionalTimezones) {\n const { continent, label, timezoneId } = additionalTimezone;\n sortedByContinent[continent] = sortedByContinent[continent] || {\n continent,\n regions: []\n };\n sortedByContinent[continent].regions.push({\n label,\n cities: [],\n timezoneId\n });\n }\n for (const continent in sortedByContinent) {\n if (!Object.prototype.hasOwnProperty.call(sortedByContinent, continent)) {\n continue;\n }\n sortedByContinent[continent].regions.sort((a, b) => {\n if (a.label < b.label) {\n return -1;\n }\n return 1;\n });\n sortedList.push(sortedByContinent[continent]);\n }\n sortedList.sort((a, b) => {\n if (a.continent < b.continent) {\n return -1;\n }\n return 1;\n });\n return sortedList;\n}\nfunction getReadableTimezoneName(timezoneId) {\n return timezoneId.split(\"_\").join(\" \").replace(\"St \", \"St. \").split(\"/\").join(\" - \");\n}\nconst timezoneManager = getTimezoneManager$1();\nlet initialized = false;\nfunction getTimezoneManager() {\n if (!initialized) {\n timezoneManager.registerDefaultTimezones();\n initialized = true;\n }\n return timezoneManager;\n}\nregister(t40);\nconst _sfc_main = {\n name: \"NcTimezonePicker\",\n components: {\n NcSelect\n },\n props: {\n /**\n * An array of additional timezones to include with the standard database. Useful if there is a custom timezone, e.g. read from user data\n */\n additionalTimezones: {\n type: Array,\n default: () => []\n },\n /**\n * The selected timezone. Use v-model for two-way binding. The default timezone is floating, which means a time independent of timezone. See https://icalendar.org/CalDAV-Access-RFC-4791/7-3-date-and-floating-time.html for details.\n */\n value: {\n type: String,\n default: \"floating\"\n },\n /**\n * ID of the inner vue-select element, can be used for labels like: `vs-${uid}__combobox`\n */\n uid: {\n type: [String, Number],\n default: () => \"tz-\".concat(GenRandomId(5))\n }\n },\n emits: [\"input\"],\n computed: {\n placeholder() {\n return t(\"Type to search time zone\");\n },\n selectedTimezone() {\n for (const additionalTimezone of this.additionalTimezones) {\n if (additionalTimezone.timezoneId === this.value) {\n return additionalTimezone;\n }\n }\n return {\n label: getReadableTimezoneName(this.value),\n timezoneId: this.value\n };\n },\n options() {\n const timezoneManager2 = getTimezoneManager();\n const timezoneList = getSortedTimezoneList(timezoneManager2.listAllTimezones(), this.additionalTimezones);\n let timezonesGrouped = [];\n Object.values(timezoneList).forEach((group) => {\n timezonesGrouped = timezonesGrouped.concat(group.regions);\n });\n return timezonesGrouped;\n }\n },\n methods: {\n t,\n change(newValue) {\n if (!newValue) {\n return;\n }\n this.$emit(\"input\", newValue.timezoneId);\n },\n /**\n * Returns whether this is a continent label,\n * or an actual timezone. Continent labels are not selectable.\n *\n * @param {string} option The option\n * @return {boolean}\n */\n isSelectable(option) {\n return !option.timezoneId.startsWith(\"tz-group__\");\n },\n /**\n * Function to filter the timezone list.\n * We search in the timezoneId, so both continent and region names can be matched.\n *\n * @param {object} option The timezone option\n * @param {string} label The label of the timezone\n * @param {string} search The search string\n * @return {boolean}\n */\n filterBy(option, label, search) {\n const terms = search.trim().split(\" \");\n if (option.timezoneId.startsWith(\"tz-group__\")) {\n return option.regions.some((region) => {\n return this.matchTimezoneId(region.timezoneId, terms);\n });\n }\n return this.matchTimezoneId(option.timezoneId, terms);\n },\n matchTimezoneId(timezoneId, terms) {\n return terms.every((term) => timezoneId.toLowerCase().includes(term.toLowerCase()));\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"NcSelect\", { attrs: { \"aria-label-combobox\": _vm.t(\"Search for time zone\"), \"clearable\": false, \"filter-by\": _vm.filterBy, \"multiple\": false, \"options\": _vm.options, \"placeholder\": _vm.placeholder, \"selectable\": _vm.isSelectable, \"uid\": _vm.uid, \"value\": _vm.selectedTimezone, \"label\": \"label\" }, on: { \"option:selected\": _vm.change } });\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n null\n);\nconst NcTimezonePicker = __component__.exports;\nexport {\n NcTimezonePicker as N\n};\n","export function isDate(value) {\n return value instanceof Date || Object.prototype.toString.call(value) === '[object Date]';\n}\nexport function toDate(value) {\n if (isDate(value)) {\n return new Date(value.getTime());\n }\n\n if (value == null) {\n return new Date(NaN);\n }\n\n return new Date(value);\n}\nexport function isValidDate(value) {\n return isDate(value) && !isNaN(value.getTime());\n}\nexport function startOfWeek(value) {\n var firstDayOfWeek = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (!(firstDayOfWeek >= 0 && firstDayOfWeek <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6');\n }\n\n var date = toDate(value);\n var day = date.getDay();\n var diff = (day + 7 - firstDayOfWeek) % 7;\n date.setDate(date.getDate() - diff);\n date.setHours(0, 0, 0, 0);\n return date;\n}\nexport function startOfWeekYear(value) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$firstDayOfWeek = _ref.firstDayOfWeek,\n firstDayOfWeek = _ref$firstDayOfWeek === void 0 ? 0 : _ref$firstDayOfWeek,\n _ref$firstWeekContain = _ref.firstWeekContainsDate,\n firstWeekContainsDate = _ref$firstWeekContain === void 0 ? 1 : _ref$firstWeekContain;\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7');\n }\n\n var date = toDate(value);\n var year = date.getFullYear();\n var firstDateOfFirstWeek = new Date(0);\n\n for (var i = year + 1; i >= year - 1; i--) {\n firstDateOfFirstWeek.setFullYear(i, 0, firstWeekContainsDate);\n firstDateOfFirstWeek.setHours(0, 0, 0, 0);\n firstDateOfFirstWeek = startOfWeek(firstDateOfFirstWeek, firstDayOfWeek);\n\n if (date.getTime() >= firstDateOfFirstWeek.getTime()) {\n break;\n }\n }\n\n return firstDateOfFirstWeek;\n}\nexport function getWeek(value) {\n var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref2$firstDayOfWeek = _ref2.firstDayOfWeek,\n firstDayOfWeek = _ref2$firstDayOfWeek === void 0 ? 0 : _ref2$firstDayOfWeek,\n _ref2$firstWeekContai = _ref2.firstWeekContainsDate,\n firstWeekContainsDate = _ref2$firstWeekContai === void 0 ? 1 : _ref2$firstWeekContai;\n\n var date = toDate(value);\n var firstDateOfThisWeek = startOfWeek(date, firstDayOfWeek);\n var firstDateOfFirstWeek = startOfWeekYear(date, {\n firstDayOfWeek: firstDayOfWeek,\n firstWeekContainsDate: firstWeekContainsDate\n });\n var diff = firstDateOfThisWeek.getTime() - firstDateOfFirstWeek.getTime();\n return Math.round(diff / (7 * 24 * 3600 * 1000)) + 1;\n}","var locale = {\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n weekdaysMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n firstDayOfWeek: 0,\n firstWeekContainsDate: 1\n};\nexport default locale;","import { toDate, isValidDate, getWeek } from './util';\nimport defaultLocale from './locale/en';\nvar REGEX_FORMAT = /\\[([^\\]]+)]|YYYY|YY?|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|Z{1,2}|S{1,3}|w{1,2}|x|X|a|A/g;\n\nfunction pad(val) {\n var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n var output = \"\".concat(Math.abs(val));\n var sign = val < 0 ? '-' : '';\n\n while (output.length < len) {\n output = \"0\".concat(output);\n }\n\n return sign + output;\n}\n\nfunction getOffset(date) {\n return Math.round(date.getTimezoneOffset() / 15) * 15;\n}\n\nfunction formatTimezone(offset) {\n var delimeter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = Math.floor(absOffset / 60);\n var minutes = absOffset % 60;\n return sign + pad(hours, 2) + delimeter + pad(minutes, 2);\n}\n\nvar meridiem = function meridiem(h, _, isLowercase) {\n var word = h < 12 ? 'AM' : 'PM';\n return isLowercase ? word.toLocaleLowerCase() : word;\n};\n\nvar formatFlags = {\n Y: function Y(date) {\n var y = date.getFullYear();\n return y <= 9999 ? \"\".concat(y) : \"+\".concat(y);\n },\n // Year: 00, 01, ..., 99\n YY: function YY(date) {\n return pad(date.getFullYear(), 4).substr(2);\n },\n // Year: 1900, 1901, ..., 2099\n YYYY: function YYYY(date) {\n return pad(date.getFullYear(), 4);\n },\n // Month: 1, 2, ..., 12\n M: function M(date) {\n return date.getMonth() + 1;\n },\n // Month: 01, 02, ..., 12\n MM: function MM(date) {\n return pad(date.getMonth() + 1, 2);\n },\n MMM: function MMM(date, locale) {\n return locale.monthsShort[date.getMonth()];\n },\n MMMM: function MMMM(date, locale) {\n return locale.months[date.getMonth()];\n },\n // Day of month: 1, 2, ..., 31\n D: function D(date) {\n return date.getDate();\n },\n // Day of month: 01, 02, ..., 31\n DD: function DD(date) {\n return pad(date.getDate(), 2);\n },\n // Hour: 0, 1, ... 23\n H: function H(date) {\n return date.getHours();\n },\n // Hour: 00, 01, ..., 23\n HH: function HH(date) {\n return pad(date.getHours(), 2);\n },\n // Hour: 1, 2, ..., 12\n h: function h(date) {\n var hours = date.getHours();\n\n if (hours === 0) {\n return 12;\n }\n\n if (hours > 12) {\n return hours % 12;\n }\n\n return hours;\n },\n // Hour: 01, 02, ..., 12\n hh: function hh() {\n var hours = formatFlags.h.apply(formatFlags, arguments);\n return pad(hours, 2);\n },\n // Minute: 0, 1, ..., 59\n m: function m(date) {\n return date.getMinutes();\n },\n // Minute: 00, 01, ..., 59\n mm: function mm(date) {\n return pad(date.getMinutes(), 2);\n },\n // Second: 0, 1, ..., 59\n s: function s(date) {\n return date.getSeconds();\n },\n // Second: 00, 01, ..., 59\n ss: function ss(date) {\n return pad(date.getSeconds(), 2);\n },\n // 1/10 of second: 0, 1, ..., 9\n S: function S(date) {\n return Math.floor(date.getMilliseconds() / 100);\n },\n // 1/100 of second: 00, 01, ..., 99\n SS: function SS(date) {\n return pad(Math.floor(date.getMilliseconds() / 10), 2);\n },\n // Millisecond: 000, 001, ..., 999\n SSS: function SSS(date) {\n return pad(date.getMilliseconds(), 3);\n },\n // Day of week: 0, 1, ..., 6\n d: function d(date) {\n return date.getDay();\n },\n // Day of week: 'Su', 'Mo', ..., 'Sa'\n dd: function dd(date, locale) {\n return locale.weekdaysMin[date.getDay()];\n },\n // Day of week: 'Sun', 'Mon',..., 'Sat'\n ddd: function ddd(date, locale) {\n return locale.weekdaysShort[date.getDay()];\n },\n // Day of week: 'Sunday', 'Monday', ...,'Saturday'\n dddd: function dddd(date, locale) {\n return locale.weekdays[date.getDay()];\n },\n // AM, PM\n A: function A(date, locale) {\n var meridiemFunc = locale.meridiem || meridiem;\n return meridiemFunc(date.getHours(), date.getMinutes(), false);\n },\n // am, pm\n a: function a(date, locale) {\n var meridiemFunc = locale.meridiem || meridiem;\n return meridiemFunc(date.getHours(), date.getMinutes(), true);\n },\n // Timezone: -01:00, +00:00, ... +12:00\n Z: function Z(date) {\n return formatTimezone(getOffset(date), ':');\n },\n // Timezone: -0100, +0000, ... +1200\n ZZ: function ZZ(date) {\n return formatTimezone(getOffset(date));\n },\n // Seconds timestamp: 512969520\n X: function X(date) {\n return Math.floor(date.getTime() / 1000);\n },\n // Milliseconds timestamp: 512969520900\n x: function x(date) {\n return date.getTime();\n },\n w: function w(date, locale) {\n return getWeek(date, {\n firstDayOfWeek: locale.firstDayOfWeek,\n firstWeekContainsDate: locale.firstWeekContainsDate\n });\n },\n ww: function ww(date, locale) {\n return pad(formatFlags.w(date, locale), 2);\n }\n};\nexport function format(val, str) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var formatStr = str ? String(str) : 'YYYY-MM-DDTHH:mm:ss.SSSZ';\n var date = toDate(val);\n\n if (!isValidDate(date)) {\n return 'Invalid Date';\n }\n\n var locale = options.locale || defaultLocale;\n return formatStr.replace(REGEX_FORMAT, function (match, p1) {\n if (p1) {\n return p1;\n }\n\n if (typeof formatFlags[match] === 'function') {\n return \"\".concat(formatFlags[match](date, locale));\n }\n\n return match;\n });\n}","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport defaultLocale from './locale/en';\nimport { startOfWeekYear } from './util';\nvar formattingTokens = /(\\[[^\\[]*\\])|(MM?M?M?|Do|DD?|ddd?d?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|S{1,3}|x|X|ZZ?|.)/g;\nvar match1 = /\\d/; // 0 - 9\n\nvar match2 = /\\d\\d/; // 00 - 99\n\nvar match3 = /\\d{3}/; // 000 - 999\n\nvar match4 = /\\d{4}/; // 0000 - 9999\n\nvar match1to2 = /\\d\\d?/; // 0 - 99\n\nvar matchShortOffset = /[+-]\\d\\d:?\\d\\d/; // +00:00 -00:00 +0000 or -0000\n\nvar matchSigned = /[+-]?\\d+/; // -inf - inf\n\nvar matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/; // 123456789 123456789.123\n// const matchWord = /[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; // Word\n\nvar YEAR = 'year';\nvar MONTH = 'month';\nvar DAY = 'day';\nvar HOUR = 'hour';\nvar MINUTE = 'minute';\nvar SECOND = 'second';\nvar MILLISECOND = 'millisecond';\nvar parseFlags = {};\n\nvar addParseFlag = function addParseFlag(token, regex, callback) {\n var tokens = Array.isArray(token) ? token : [token];\n var func;\n\n if (typeof callback === 'string') {\n func = function func(input) {\n var value = parseInt(input, 10);\n return _defineProperty({}, callback, value);\n };\n } else {\n func = callback;\n }\n\n tokens.forEach(function (key) {\n parseFlags[key] = [regex, func];\n });\n};\n\nvar escapeStringRegExp = function escapeStringRegExp(str) {\n return str.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n};\n\nvar matchWordRegExp = function matchWordRegExp(localeKey) {\n return function (locale) {\n var array = locale[localeKey];\n\n if (!Array.isArray(array)) {\n throw new Error(\"Locale[\".concat(localeKey, \"] need an array\"));\n }\n\n return new RegExp(array.map(escapeStringRegExp).join('|'));\n };\n};\n\nvar matchWordCallback = function matchWordCallback(localeKey, key) {\n return function (input, locale) {\n var array = locale[localeKey];\n\n if (!Array.isArray(array)) {\n throw new Error(\"Locale[\".concat(localeKey, \"] need an array\"));\n }\n\n var index = array.indexOf(input);\n\n if (index < 0) {\n throw new Error('Invalid Word');\n }\n\n return _defineProperty({}, key, index);\n };\n};\n\naddParseFlag('Y', matchSigned, YEAR);\naddParseFlag('YY', match2, function (input) {\n var year = new Date().getFullYear();\n var cent = Math.floor(year / 100);\n var value = parseInt(input, 10);\n value = (value > 68 ? cent - 1 : cent) * 100 + value;\n return _defineProperty({}, YEAR, value);\n});\naddParseFlag('YYYY', match4, YEAR);\naddParseFlag('M', match1to2, function (input) {\n return _defineProperty({}, MONTH, parseInt(input, 10) - 1);\n});\naddParseFlag('MM', match2, function (input) {\n return _defineProperty({}, MONTH, parseInt(input, 10) - 1);\n});\naddParseFlag('MMM', matchWordRegExp('monthsShort'), matchWordCallback('monthsShort', MONTH));\naddParseFlag('MMMM', matchWordRegExp('months'), matchWordCallback('months', MONTH));\naddParseFlag('D', match1to2, DAY);\naddParseFlag('DD', match2, DAY);\naddParseFlag(['H', 'h'], match1to2, HOUR);\naddParseFlag(['HH', 'hh'], match2, HOUR);\naddParseFlag('m', match1to2, MINUTE);\naddParseFlag('mm', match2, MINUTE);\naddParseFlag('s', match1to2, SECOND);\naddParseFlag('ss', match2, SECOND);\naddParseFlag('S', match1, function (input) {\n return _defineProperty({}, MILLISECOND, parseInt(input, 10) * 100);\n});\naddParseFlag('SS', match2, function (input) {\n return _defineProperty({}, MILLISECOND, parseInt(input, 10) * 10);\n});\naddParseFlag('SSS', match3, MILLISECOND);\n\nfunction matchMeridiem(locale) {\n return locale.meridiemParse || /[ap]\\.?m?\\.?/i;\n}\n\nfunction defaultIsPM(input) {\n return \"\".concat(input).toLowerCase().charAt(0) === 'p';\n}\n\naddParseFlag(['A', 'a'], matchMeridiem, function (input, locale) {\n var isPM = typeof locale.isPM === 'function' ? locale.isPM(input) : defaultIsPM(input);\n return {\n isPM: isPM\n };\n});\n\nfunction offsetFromString(str) {\n var _ref8 = str.match(/([+-]|\\d\\d)/g) || ['-', '0', '0'],\n _ref9 = _slicedToArray(_ref8, 3),\n symbol = _ref9[0],\n hour = _ref9[1],\n minute = _ref9[2];\n\n var minutes = parseInt(hour, 10) * 60 + parseInt(minute, 10);\n\n if (minutes === 0) {\n return 0;\n }\n\n return symbol === '+' ? -minutes : +minutes;\n}\n\naddParseFlag(['Z', 'ZZ'], matchShortOffset, function (input) {\n return {\n offset: offsetFromString(input)\n };\n});\naddParseFlag('x', matchSigned, function (input) {\n return {\n date: new Date(parseInt(input, 10))\n };\n});\naddParseFlag('X', matchTimestamp, function (input) {\n return {\n date: new Date(parseFloat(input) * 1000)\n };\n});\naddParseFlag('d', match1, 'weekday');\naddParseFlag('dd', matchWordRegExp('weekdaysMin'), matchWordCallback('weekdaysMin', 'weekday'));\naddParseFlag('ddd', matchWordRegExp('weekdaysShort'), matchWordCallback('weekdaysShort', 'weekday'));\naddParseFlag('dddd', matchWordRegExp('weekdays'), matchWordCallback('weekdays', 'weekday'));\naddParseFlag('w', match1to2, 'week');\naddParseFlag('ww', match2, 'week');\n\nfunction to24hour(hour, isPM) {\n if (hour !== undefined && isPM !== undefined) {\n if (isPM) {\n if (hour < 12) {\n return hour + 12;\n }\n } else if (hour === 12) {\n return 0;\n }\n }\n\n return hour;\n}\n\nfunction getFullInputArray(input) {\n var backupDate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Date();\n var result = [0, 0, 1, 0, 0, 0, 0];\n var backupArr = [backupDate.getFullYear(), backupDate.getMonth(), backupDate.getDate(), backupDate.getHours(), backupDate.getMinutes(), backupDate.getSeconds(), backupDate.getMilliseconds()];\n var useBackup = true;\n\n for (var i = 0; i < 7; i++) {\n if (input[i] === undefined) {\n result[i] = useBackup ? backupArr[i] : result[i];\n } else {\n result[i] = input[i];\n useBackup = false;\n }\n }\n\n return result;\n}\n\nfunction createDate(y, m, d, h, M, s, ms) {\n var date;\n\n if (y < 100 && y >= 0) {\n date = new Date(y + 400, m, d, h, M, s, ms);\n\n if (isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n } else {\n date = new Date(y, m, d, h, M, s, ms);\n }\n\n return date;\n}\n\nfunction createUTCDate() {\n var date;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var y = args[0];\n\n if (y < 100 && y >= 0) {\n args[0] += 400;\n date = new Date(Date.UTC.apply(Date, args)); // eslint-disable-next-line no-restricted-globals\n\n if (isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n } else {\n date = new Date(Date.UTC.apply(Date, args));\n }\n\n return date;\n}\n\nfunction makeParser(dateString, format, locale) {\n var tokens = format.match(formattingTokens);\n\n if (!tokens) {\n throw new Error();\n }\n\n var length = tokens.length;\n var mark = {};\n\n for (var i = 0; i < length; i += 1) {\n var token = tokens[i];\n var parseTo = parseFlags[token];\n\n if (!parseTo) {\n var word = token.replace(/^\\[|\\]$/g, '');\n\n if (dateString.indexOf(word) === 0) {\n dateString = dateString.substr(word.length);\n } else {\n throw new Error('not match');\n }\n } else {\n var regex = typeof parseTo[0] === 'function' ? parseTo[0](locale) : parseTo[0];\n var parser = parseTo[1];\n var value = (regex.exec(dateString) || [])[0];\n var obj = parser(value, locale);\n mark = _objectSpread({}, mark, {}, obj);\n dateString = dateString.replace(value, '');\n }\n }\n\n return mark;\n}\n\nexport function parse(str, format) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n try {\n var _options$locale = options.locale,\n _locale = _options$locale === void 0 ? defaultLocale : _options$locale,\n _options$backupDate = options.backupDate,\n backupDate = _options$backupDate === void 0 ? new Date() : _options$backupDate;\n\n var parseResult = makeParser(str, format, _locale);\n var year = parseResult.year,\n month = parseResult.month,\n day = parseResult.day,\n hour = parseResult.hour,\n minute = parseResult.minute,\n second = parseResult.second,\n millisecond = parseResult.millisecond,\n isPM = parseResult.isPM,\n date = parseResult.date,\n offset = parseResult.offset,\n weekday = parseResult.weekday,\n week = parseResult.week;\n\n if (date) {\n return date;\n }\n\n var inputArray = [year, month, day, hour, minute, second, millisecond];\n inputArray[3] = to24hour(inputArray[3], isPM); // check week\n\n if (week !== undefined && month === undefined && day === undefined) {\n // new Date(year, 3) make sure in current year\n var firstDate = startOfWeekYear(year === undefined ? backupDate : new Date(year, 3), {\n firstDayOfWeek: _locale.firstDayOfWeek,\n firstWeekContainsDate: _locale.firstWeekContainsDate\n });\n return new Date(firstDate.getTime() + (week - 1) * 7 * 24 * 3600 * 1000);\n }\n\n var parsedDate;\n var result = getFullInputArray(inputArray, backupDate);\n\n if (offset !== undefined) {\n result[6] += offset * 60 * 1000;\n parsedDate = createUTCDate.apply(void 0, _toConsumableArray(result));\n } else {\n parsedDate = createDate.apply(void 0, _toConsumableArray(result));\n } // check weekday\n\n\n if (weekday !== undefined && parsedDate.getDay() !== weekday) {\n return new Date(NaN);\n }\n\n return parsedDate;\n } catch (e) {\n return new Date(NaN);\n }\n}","import { getWeek, format, parse } from 'date-format-parse';\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _extends$1() {\n return _extends$1 = Object.assign || function (a) {\n for (var b, c = 1; c < arguments.length; c++) {\n for (var d in b = arguments[c], b) {\n Object.prototype.hasOwnProperty.call(b, d) && (a[d] = b[d]);\n }\n }\n\n return a;\n }, _extends$1.apply(this, arguments);\n}\n\nvar normalMerge = [\"attrs\", \"props\", \"domProps\"],\n toArrayMerge = [\"class\", \"style\", \"directives\"],\n functionalMerge = [\"on\", \"nativeOn\"],\n mergeJsxProps = function mergeJsxProps(a) {\n return a.reduce(function (c, a) {\n for (var b in a) {\n if (!c[b]) c[b] = a[b];else if (-1 !== normalMerge.indexOf(b)) c[b] = _extends$1({}, c[b], a[b]);else if (-1 !== toArrayMerge.indexOf(b)) {\n var d = c[b] instanceof Array ? c[b] : [c[b]],\n e = a[b] instanceof Array ? a[b] : [a[b]];\n c[b] = d.concat(e);\n } else if (-1 !== functionalMerge.indexOf(b)) {\n for (var f in a[b]) {\n if (c[b][f]) {\n var g = c[b][f] instanceof Array ? c[b][f] : [c[b][f]],\n h = a[b][f] instanceof Array ? a[b][f] : [a[b][f]];\n c[b][f] = g.concat(h);\n } else c[b][f] = a[b][f];\n }\n } else if (\"hook\" == b) for (var i in a[b]) {\n c[b][i] = c[b][i] ? mergeFn(c[b][i], a[b][i]) : a[b][i];\n } else c[b] = a[b];\n }\n\n return c;\n }, {});\n},\n mergeFn = function mergeFn(a, b) {\n return function () {\n a && a.apply(this, arguments), b && b.apply(this, arguments);\n };\n};\n\nvar helper = mergeJsxProps;\n\n// new Date(10, 0, 1) The year from 0 to 99 will be incremented by 1900 automatically.\nfunction createDate(y) {\n var M = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var d = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var h = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n var m = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;\n var s = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n var ms = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;\n var date = new Date(y, M, d, h, m, s, ms);\n\n if (y < 100 && y >= 0) {\n date.setFullYear(y);\n }\n\n return date;\n}\nfunction isValidDate(date) {\n return date instanceof Date && !isNaN(date);\n}\nfunction isValidRangeDate(date) {\n return Array.isArray(date) && date.length === 2 && date.every(isValidDate) && date[0] <= date[1];\n}\nfunction isValidDates(dates) {\n return Array.isArray(dates) && dates.every(isValidDate);\n}\nfunction getValidDate(value) {\n var date = new Date(value);\n\n if (isValidDate(date)) {\n return date;\n }\n\n for (var _len = arguments.length, backup = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n backup[_key - 1] = arguments[_key];\n }\n\n if (backup.length) {\n return getValidDate.apply(void 0, backup);\n }\n\n return new Date();\n}\nfunction startOfYear(value) {\n var date = new Date(value);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}\nfunction startOfMonth(value) {\n var date = new Date(value);\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n return date;\n}\nfunction startOfDay(value) {\n var date = new Date(value);\n date.setHours(0, 0, 0, 0);\n return date;\n}\nfunction getCalendar(_ref) {\n var firstDayOfWeek = _ref.firstDayOfWeek,\n year = _ref.year,\n month = _ref.month;\n var arr = []; // change to the last day of the last month\n\n var calendar = createDate(year, month, 0);\n var lastDayInLastMonth = calendar.getDate(); // getDay() 0 is Sunday, 1 is Monday\n\n var firstDayInLastMonth = lastDayInLastMonth - (calendar.getDay() + 7 - firstDayOfWeek) % 7;\n\n for (var i = firstDayInLastMonth; i <= lastDayInLastMonth; i++) {\n arr.push(createDate(year, month, i - lastDayInLastMonth));\n } // change to the last day of the current month\n\n\n calendar.setMonth(month + 1, 0);\n var lastDayInCurrentMonth = calendar.getDate();\n\n for (var _i = 1; _i <= lastDayInCurrentMonth; _i++) {\n arr.push(createDate(year, month, _i));\n }\n\n var lastMonthLength = lastDayInLastMonth - firstDayInLastMonth + 1;\n var nextMonthLength = 6 * 7 - lastMonthLength - lastDayInCurrentMonth;\n\n for (var _i2 = 1; _i2 <= nextMonthLength; _i2++) {\n arr.push(createDate(year, month, lastDayInCurrentMonth + _i2));\n }\n\n return arr;\n}\nfunction setMonth(dirtyDate, dirtyMonth) {\n var date = new Date(dirtyDate);\n var month = typeof dirtyMonth === 'function' ? dirtyMonth(date.getMonth()) : Number(dirtyMonth);\n var year = date.getFullYear();\n var daysInMonth = createDate(year, month + 1, 0).getDate();\n var day = date.getDate();\n date.setMonth(month, Math.min(day, daysInMonth));\n return date;\n}\nfunction setYear(dirtyDate, dirtyYear) {\n var date = new Date(dirtyDate);\n var year = typeof dirtyYear === 'function' ? dirtyYear(date.getFullYear()) : dirtyYear;\n date.setFullYear(year);\n return date;\n}\nfunction assignTime(target, source) {\n var date = new Date(target);\n var time = new Date(source);\n date.setHours(time.getHours(), time.getMinutes(), time.getSeconds());\n return date;\n}\n\n/**\n * chunk the array\n * @param {Array} arr\n * @param {Number} size\n */\nfunction chunk(arr, size) {\n if (!Array.isArray(arr)) {\n return [];\n }\n\n var result = [];\n var len = arr.length;\n var i = 0;\n size = size || len;\n\n while (i < len) {\n result.push(arr.slice(i, i += size));\n }\n\n return result;\n}\n/**\n * isObject\n * @param {*} obj\n * @returns {Boolean}\n */\n\nfunction isObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n/**\n * pick object\n * @param {Object} obj\n * @param {Array|String} props\n */\n\nfunction pick(obj, props) {\n if (!isObject(obj)) return {};\n\n if (!Array.isArray(props)) {\n props = [props];\n }\n\n var res = {};\n props.forEach(function (prop) {\n if (prop in obj) {\n res[prop] = obj[prop];\n }\n });\n return res;\n}\n/**\n * deep merge two object without merging array\n * @param {object} target\n * @param {object} source\n */\n\nfunction mergeDeep(target, source) {\n if (!isObject(target)) {\n return {};\n }\n\n var result = target;\n\n if (isObject(source)) {\n Object.keys(source).forEach(function (key) {\n var value = source[key];\n\n if (isObject(value) && isObject(target[key])) {\n value = mergeDeep(target[key], value);\n }\n\n result = _objectSpread2({}, result, _defineProperty({}, key, value));\n });\n }\n\n return result;\n}\n\nfunction unwrapExports (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar en = createCommonjsModule(function (module, exports) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar locale = {\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n weekdaysMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n firstDayOfWeek: 0,\n firstWeekContainsDate: 1\n};\nvar _default = locale;\nexports[\"default\"] = _default;\nmodule.exports = exports.default;\n});\n\nvar en$1 = unwrapExports(en);\n\nvar lang = {\n formatLocale: en$1,\n yearFormat: 'YYYY',\n monthFormat: 'MMM',\n monthBeforeYear: true\n};\n\nvar defaultLocale = 'en';\nvar locales = {};\nlocales[defaultLocale] = lang;\nfunction locale(name, object, isLocal) {\n if (typeof name !== 'string') return locales[defaultLocale];\n var l = defaultLocale;\n\n if (locales[name]) {\n l = name;\n }\n\n if (object) {\n locales[name] = object;\n l = name;\n }\n\n if (!isLocal) {\n defaultLocale = l;\n }\n\n return locales[name] || locales[defaultLocale];\n}\n/**\n * get locale object\n * @param {string} name lang\n */\n\nfunction getLocale(name) {\n return locale(name, null, true);\n}\n\n/* istanbul ignore file */\nfunction rafThrottle(fn) {\n var isRunning = false;\n return function fnBinfRaf() {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (isRunning) return;\n isRunning = true;\n requestAnimationFrame(function () {\n isRunning = false;\n fn.apply(_this, args);\n });\n };\n}\n\n/**\n * get the hidden element width, height\n * @param {HTMLElement} element dom\n */\nfunction getPopupElementSize(element) {\n var originalDisplay = element.style.display;\n var originalVisibility = element.style.visibility;\n element.style.display = 'block';\n element.style.visibility = 'hidden';\n var styles = window.getComputedStyle(element);\n var width = element.offsetWidth + parseInt(styles.marginLeft, 10) + parseInt(styles.marginRight, 10);\n var height = element.offsetHeight + parseInt(styles.marginTop, 10) + parseInt(styles.marginBottom, 10);\n element.style.display = originalDisplay;\n element.style.visibility = originalVisibility;\n return {\n width: width,\n height: height\n };\n}\n/**\n * get the popup position\n * @param {HTMLElement} el relative element\n * @param {Number} targetWidth target element's width\n * @param {Number} targetHeight target element's height\n * @param {Boolean} fixed\n */\n\nfunction getRelativePosition(el, targetWidth, targetHeight, fixed) {\n var left = 0;\n var top = 0;\n var offsetX = 0;\n var offsetY = 0;\n var relativeRect = el.getBoundingClientRect();\n var dw = document.documentElement.clientWidth;\n var dh = document.documentElement.clientHeight;\n\n if (fixed) {\n offsetX = window.pageXOffset + relativeRect.left;\n offsetY = window.pageYOffset + relativeRect.top;\n }\n\n if (dw - relativeRect.left < targetWidth && relativeRect.right < targetWidth) {\n left = offsetX - relativeRect.left + 1;\n } else if (relativeRect.left + relativeRect.width / 2 <= dw / 2) {\n left = offsetX;\n } else {\n left = offsetX + relativeRect.width - targetWidth;\n }\n\n if (relativeRect.top <= targetHeight && dh - relativeRect.bottom <= targetHeight) {\n top = offsetY + dh - relativeRect.top - targetHeight;\n } else if (relativeRect.top + relativeRect.height / 2 <= dh / 2) {\n top = offsetY + relativeRect.height;\n } else {\n top = offsetY - targetHeight;\n }\n\n return {\n left: \"\".concat(left, \"px\"),\n top: \"\".concat(top, \"px\")\n };\n}\nfunction getScrollParent(node) {\n var until = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.body;\n\n if (!node || node === until) {\n return null;\n }\n\n var style = function style(value, prop) {\n return getComputedStyle(value, null).getPropertyValue(prop);\n };\n\n var regex = /(auto|scroll)/;\n var scroll = regex.test(style(node, 'overflow') + style(node, 'overflow-y') + style(node, 'overflow-x'));\n return scroll ? node : getScrollParent(node.parentNode, until);\n}\n\n//\nvar script = {\n name: 'Popup',\n inject: {\n prefixClass: {\n default: 'mx'\n }\n },\n props: {\n visible: {\n type: Boolean,\n default: false\n },\n appendToBody: {\n type: Boolean,\n default: true\n }\n },\n data: function data() {\n return {\n top: '',\n left: ''\n };\n },\n watch: {\n visible: {\n immediate: true,\n handler: function handler(val) {\n var _this = this;\n\n this.$nextTick(function () {\n if (val) {\n _this.displayPopup();\n }\n });\n }\n }\n },\n mounted: function mounted() {\n var _this2 = this;\n\n if (this.appendToBody) {\n document.body.appendChild(this.$el);\n }\n\n this._clickoutEvent = 'ontouchend' in document ? 'touchstart' : 'mousedown';\n document.addEventListener(this._clickoutEvent, this.handleClickOutside); // change the popup position when resize or scroll\n\n var relativeElement = this.$parent.$el;\n this._displayPopup = rafThrottle(function () {\n return _this2.displayPopup();\n });\n this._scrollParent = getScrollParent(relativeElement) || window;\n\n this._scrollParent.addEventListener('scroll', this._displayPopup);\n\n window.addEventListener('resize', this._displayPopup);\n },\n beforeDestroy: function beforeDestroy() {\n if (this.appendToBody && this.$el.parentNode) {\n this.$el.parentNode.removeChild(this.$el);\n }\n\n document.removeEventListener(this._clickoutEvent, this.handleClickOutside);\n\n this._scrollParent.removeEventListener('scroll', this._displayPopup);\n\n window.removeEventListener('resize', this._displayPopup);\n },\n methods: {\n handleClickOutside: function handleClickOutside(evt) {\n if (!this.visible) return;\n var target = evt.target;\n var el = this.$el;\n\n if (el && !el.contains(target)) {\n this.$emit('clickoutside', evt);\n }\n },\n displayPopup: function displayPopup() {\n if (!this.visible) return;\n var popup = this.$el;\n var relativeElement = this.$parent.$el;\n var appendToBody = this.appendToBody;\n\n if (!this._popupRect) {\n this._popupRect = getPopupElementSize(popup);\n }\n\n var _this$_popupRect = this._popupRect,\n width = _this$_popupRect.width,\n height = _this$_popupRect.height;\n\n var _getRelativePosition = getRelativePosition(relativeElement, width, height, appendToBody),\n left = _getRelativePosition.left,\n top = _getRelativePosition.top;\n\n this.left = left;\n this.top = top;\n }\n }\n};\n\nfunction normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier\n/* server only */\n, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {\n if (typeof shadowMode !== 'boolean') {\n createInjectorSSR = createInjector;\n createInjector = shadowMode;\n shadowMode = false;\n } // Vue.extend constructor export interop.\n\n\n var options = typeof script === 'function' ? script.options : script; // render functions\n\n if (template && template.render) {\n options.render = template.render;\n options.staticRenderFns = template.staticRenderFns;\n options._compiled = true; // functional template\n\n if (isFunctionalTemplate) {\n options.functional = true;\n }\n } // scopedId\n\n\n if (scopeId) {\n options._scopeId = scopeId;\n }\n\n var hook;\n\n if (moduleIdentifier) {\n // server build\n hook = function hook(context) {\n // 2.3 injection\n context = context || // cached call\n this.$vnode && this.$vnode.ssrContext || // stateful\n this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional\n // 2.2 with runInNewContext: true\n\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__;\n } // inject component styles\n\n\n if (style) {\n style.call(this, createInjectorSSR(context));\n } // register component module identifier for async chunk inference\n\n\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier);\n }\n }; // used by ssr in case component is cached and beforeCreate\n // never gets called\n\n\n options._ssrRegister = hook;\n } else if (style) {\n hook = shadowMode ? function (context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));\n } : function (context) {\n style.call(this, createInjector(context));\n };\n }\n\n if (hook) {\n if (options.functional) {\n // register for functional component in vue file\n var originalRender = options.render;\n\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context);\n return originalRender(h, context);\n };\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate;\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook];\n }\n }\n\n return script;\n}\n\n/* script */\nvar __vue_script__ = script;\n/* template */\n\nvar __vue_render__ = function __vue_render__() {\n var _vm = this;\n\n var _h = _vm.$createElement;\n\n var _c = _vm._self._c || _h;\n\n return _c('transition', {\n attrs: {\n \"name\": _vm.prefixClass + \"-zoom-in-down\"\n }\n }, [_vm.visible ? _c('div', {\n class: _vm.prefixClass + \"-datepicker-main \" + _vm.prefixClass + \"-datepicker-popup\",\n style: {\n top: _vm.top,\n left: _vm.left,\n position: 'absolute'\n }\n }, [_vm._t(\"default\")], 2) : _vm._e()]);\n};\n\nvar __vue_staticRenderFns__ = [];\n/* style */\n\nvar __vue_inject_styles__ = undefined;\n/* scoped */\n\nvar __vue_scope_id__ = undefined;\n/* module identifier */\n\nvar __vue_module_identifier__ = undefined;\n/* functional template */\n\nvar __vue_is_functional_template__ = false;\n/* style inject */\n\n/* style inject SSR */\n\n/* style inject shadow dom */\n\nvar __vue_component__ = normalizeComponent({\n render: __vue_render__,\n staticRenderFns: __vue_staticRenderFns__\n}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);\n\n/* script */\n\n/* template */\nvar __vue_render__$1 = function __vue_render__() {\n var _vm = this;\n\n var _h = _vm.$createElement;\n\n var _c = _vm._self._c || _h;\n\n return _c('svg', {\n attrs: {\n \"xmlns\": \"http://www.w3.org/2000/svg\",\n \"viewBox\": \"0 0 1024 1024\",\n \"width\": \"1em\",\n \"height\": \"1em\"\n }\n }, [_c('path', {\n attrs: {\n \"d\": \"M940.218182 107.054545h-209.454546V46.545455h-65.163636v60.50909H363.054545V46.545455H297.890909v60.50909H83.781818c-18.618182 0-32.581818 13.963636-32.581818 32.581819v805.236363c0 18.618182 13.963636 32.581818 32.581818 32.581818h861.090909c18.618182 0 32.581818-13.963636 32.581818-32.581818V139.636364c-4.654545-18.618182-18.618182-32.581818-37.236363-32.581819zM297.890909 172.218182V232.727273h65.163636V172.218182h307.2V232.727273h65.163637V172.218182h176.872727v204.8H116.363636V172.218182h181.527273zM116.363636 912.290909V442.181818h795.927273v470.109091H116.363636z\"\n }\n })]);\n};\n\nvar __vue_staticRenderFns__$1 = [];\n/* style */\n\nvar __vue_inject_styles__$1 = undefined;\n/* scoped */\n\nvar __vue_scope_id__$1 = undefined;\n/* module identifier */\n\nvar __vue_module_identifier__$1 = undefined;\n/* functional template */\n\nvar __vue_is_functional_template__$1 = false;\n/* style inject */\n\n/* style inject SSR */\n\n/* style inject shadow dom */\n\nvar __vue_component__$1 = normalizeComponent({\n render: __vue_render__$1,\n staticRenderFns: __vue_staticRenderFns__$1\n}, __vue_inject_styles__$1, {}, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, false, undefined, undefined, undefined);\n\n/* script */\n\n/* template */\nvar __vue_render__$2 = function __vue_render__() {\n var _vm = this;\n\n var _h = _vm.$createElement;\n\n var _c = _vm._self._c || _h;\n\n return _c('svg', {\n attrs: {\n \"xmlns\": \"http://www.w3.org/2000/svg\",\n \"viewBox\": \"0 0 24 24\",\n \"width\": \"1em\",\n \"height\": \"1em\"\n }\n }, [_c('path', {\n attrs: {\n \"d\": \"M0 0h24v24H0z\",\n \"fill\": \"none\"\n }\n }), _vm._v(\" \"), _c('path', {\n attrs: {\n \"d\": \"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z\"\n }\n }), _vm._v(\" \"), _c('path', {\n attrs: {\n \"d\": \"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z\"\n }\n })]);\n};\n\nvar __vue_staticRenderFns__$2 = [];\n/* style */\n\nvar __vue_inject_styles__$2 = undefined;\n/* scoped */\n\nvar __vue_scope_id__$2 = undefined;\n/* module identifier */\n\nvar __vue_module_identifier__$2 = undefined;\n/* functional template */\n\nvar __vue_is_functional_template__$2 = false;\n/* style inject */\n\n/* style inject SSR */\n\n/* style inject shadow dom */\n\nvar __vue_component__$2 = normalizeComponent({\n render: __vue_render__$2,\n staticRenderFns: __vue_staticRenderFns__$2\n}, __vue_inject_styles__$2, {}, __vue_scope_id__$2, __vue_is_functional_template__$2, __vue_module_identifier__$2, false, undefined, undefined, undefined);\n\n/* script */\n\n/* template */\nvar __vue_render__$3 = function __vue_render__() {\n var _vm = this;\n\n var _h = _vm.$createElement;\n\n var _c = _vm._self._c || _h;\n\n return _c('svg', {\n attrs: {\n \"xmlns\": \"http://www.w3.org/2000/svg\",\n \"viewBox\": \"0 0 1024 1024\",\n \"width\": \"1em\",\n \"height\": \"1em\"\n }\n }, [_c('path', {\n attrs: {\n \"d\": \"M810.005333 274.005333l-237.994667 237.994667 237.994667 237.994667-60.010667 60.010667-237.994667-237.994667-237.994667 237.994667-60.010667-60.010667 237.994667-237.994667-237.994667-237.994667 60.010667-60.010667 237.994667 237.994667 237.994667-237.994667z\"\n }\n })]);\n};\n\nvar __vue_staticRenderFns__$3 = [];\n/* style */\n\nvar __vue_inject_styles__$3 = undefined;\n/* scoped */\n\nvar __vue_scope_id__$3 = undefined;\n/* module identifier */\n\nvar __vue_module_identifier__$3 = undefined;\n/* functional template */\n\nvar __vue_is_functional_template__$3 = false;\n/* style inject */\n\n/* style inject SSR */\n\n/* style inject shadow dom */\n\nvar __vue_component__$3 = normalizeComponent({\n render: __vue_render__$3,\n staticRenderFns: __vue_staticRenderFns__$3\n}, __vue_inject_styles__$3, {}, __vue_scope_id__$3, __vue_is_functional_template__$3, __vue_module_identifier__$3, false, undefined, undefined, undefined);\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nvar script$1 = {\n props: {\n type: String,\n disabled: Boolean\n },\n inject: {\n prefixClass: {\n default: 'mx'\n }\n }\n};\n\n/* script */\nvar __vue_script__$1 = script$1;\n/* template */\n\nvar __vue_render__$4 = function __vue_render__() {\n var _vm = this;\n\n var _h = _vm.$createElement;\n\n var _c = _vm._self._c || _h;\n\n return _c('button', _vm._g({\n class: [_vm.prefixClass + \"-btn \" + _vm.prefixClass + \"-btn-text \" + _vm.prefixClass + \"-btn-icon-\" + _vm.type, {\n disabled: _vm.disabled\n }],\n attrs: {\n \"type\": \"button\",\n \"disabled\": _vm.disabled\n }\n }, _vm.$listeners), [_c('i', {\n class: _vm.prefixClass + \"-icon-\" + _vm.type\n })]);\n};\n\nvar __vue_staticRenderFns__$4 = [];\n/* style */\n\nvar __vue_inject_styles__$4 = undefined;\n/* scoped */\n\nvar __vue_scope_id__$4 = undefined;\n/* module identifier */\n\nvar __vue_module_identifier__$4 = undefined;\n/* functional template */\n\nvar __vue_is_functional_template__$4 = false;\n/* style inject */\n\n/* style inject SSR */\n\n/* style inject shadow dom */\n\nvar __vue_component__$4 = normalizeComponent({\n render: __vue_render__$4,\n staticRenderFns: __vue_staticRenderFns__$4\n}, __vue_inject_styles__$4, __vue_script__$1, __vue_scope_id__$4, __vue_is_functional_template__$4, __vue_module_identifier__$4, false, undefined, undefined, undefined);\n\nvar script$2 = {\n name: 'TableDate',\n components: {\n IconButton: __vue_component__$4\n },\n inject: {\n getLocale: {\n default: function _default() {\n return getLocale;\n }\n },\n getWeek: {\n default: function _default() {\n return getWeek;\n }\n },\n prefixClass: {\n default: 'mx'\n },\n onDateMouseEnter: {\n default: undefined\n },\n onDateMouseLeave: {\n default: undefined\n }\n },\n props: {\n disabledCalendarChanger: {\n type: Function,\n default: function _default() {\n return false;\n }\n },\n calendar: {\n type: Date,\n default: function _default() {\n return new Date();\n }\n },\n showWeekNumber: {\n type: Boolean,\n default: false\n },\n titleFormat: {\n type: String,\n default: 'YYYY-MM-DD'\n },\n getRowClasses: {\n type: Function,\n default: function _default() {\n return [];\n }\n },\n getCellClasses: {\n type: Function,\n default: function _default() {\n return [];\n }\n }\n },\n computed: {\n firstDayOfWeek: function firstDayOfWeek() {\n return this.getLocale().formatLocale.firstDayOfWeek || 0;\n },\n yearMonth: function yearMonth() {\n var _this$getLocale = this.getLocale(),\n yearFormat = _this$getLocale.yearFormat,\n monthBeforeYear = _this$getLocale.monthBeforeYear,\n _this$getLocale$month = _this$getLocale.monthFormat,\n monthFormat = _this$getLocale$month === void 0 ? 'MMM' : _this$getLocale$month;\n\n var yearLabel = {\n panel: 'year',\n label: this.formatDate(this.calendar, yearFormat)\n };\n var monthLabel = {\n panel: 'month',\n label: this.formatDate(this.calendar, monthFormat)\n };\n return monthBeforeYear ? [monthLabel, yearLabel] : [yearLabel, monthLabel];\n },\n days: function days() {\n var locale = this.getLocale();\n var days = locale.days || locale.formatLocale.weekdaysMin;\n return days.concat(days).slice(this.firstDayOfWeek, this.firstDayOfWeek + 7);\n },\n dates: function dates() {\n var year = this.calendar.getFullYear();\n var month = this.calendar.getMonth();\n var arr = getCalendar({\n firstDayOfWeek: this.firstDayOfWeek,\n year: year,\n month: month\n });\n return chunk(arr, 7);\n }\n },\n methods: {\n isDisabledArrows: function isDisabledArrows(type) {\n var date = new Date(this.calendar);\n\n switch (type) {\n case 'last-year':\n date.setFullYear(date.getFullYear() - 1, date.getMonth() + 1, 0);\n date.setHours(23, 59, 59, 999);\n break;\n\n case 'next-year':\n date.setFullYear(date.getFullYear() + 1);\n break;\n\n case 'last-month':\n date.setMonth(date.getMonth(), 0);\n date.setHours(23, 59, 59, 999);\n break;\n\n case 'next-month':\n date.setMonth(date.getMonth() + 1);\n break;\n }\n\n return this.disabledCalendarChanger(date, type);\n },\n handleIconLeftClick: function handleIconLeftClick() {\n this.$emit('changecalendar', setMonth(this.calendar, function (v) {\n return v - 1;\n }), 'last-month');\n },\n handleIconRightClick: function handleIconRightClick() {\n this.$emit('changecalendar', setMonth(this.calendar, function (v) {\n return v + 1;\n }), 'next-month');\n },\n handleIconDoubleLeftClick: function handleIconDoubleLeftClick() {\n this.$emit('changecalendar', setYear(this.calendar, function (v) {\n return v - 1;\n }), 'last-year');\n },\n handleIconDoubleRightClick: function handleIconDoubleRightClick() {\n this.$emit('changecalendar', setYear(this.calendar, function (v) {\n return v + 1;\n }), 'next-year');\n },\n handlePanelChange: function handlePanelChange(panel) {\n this.$emit('changepanel', panel);\n },\n handleMouseEnter: function handleMouseEnter(cell) {\n if (typeof this.onDateMouseEnter === 'function') {\n this.onDateMouseEnter(cell);\n }\n },\n handleMouseLeave: function handleMouseLeave(cell) {\n if (typeof this.onDateMouseLeave === 'function') {\n this.onDateMouseLeave(cell);\n }\n },\n handleCellClick: function handleCellClick(evt) {\n var target = evt.target;\n\n if (target.tagName.toUpperCase() === 'DIV') {\n target = target.parentNode;\n }\n\n var index = target.getAttribute('data-row-col');\n\n if (index) {\n var _index$split$map = index.split(',').map(function (v) {\n return parseInt(v, 10);\n }),\n _index$split$map2 = _slicedToArray(_index$split$map, 2),\n row = _index$split$map2[0],\n col = _index$split$map2[1];\n\n var date = this.dates[row][col];\n this.$emit('select', new Date(date));\n }\n },\n formatDate: function formatDate(date, fmt) {\n return format(date, fmt, {\n locale: this.getLocale().formatLocale\n });\n },\n getCellTitle: function getCellTitle(date) {\n var fmt = this.titleFormat;\n return this.formatDate(date, fmt);\n },\n getWeekNumber: function getWeekNumber(date) {\n return this.getWeek(date, this.getLocale().formatLocale);\n }\n }\n};\n\n/* script */\nvar __vue_script__$2 = script$2;\n/* template */\n\nvar __vue_render__$5 = function __vue_render__() {\n var _vm = this;\n\n var _h = _vm.$createElement;\n\n var _c = _vm._self._c || _h;\n\n return _c('div', {\n class: _vm.prefixClass + \"-calendar \" + _vm.prefixClass + \"-calendar-panel-date\"\n }, [_c('div', {\n class: _vm.prefixClass + \"-calendar-header\"\n }, [_c('icon-button', {\n attrs: {\n \"type\": \"double-left\",\n \"disabled\": _vm.isDisabledArrows('last-year')\n },\n on: {\n \"click\": _vm.handleIconDoubleLeftClick\n }\n }), _vm._v(\" \"), _c('icon-button', {\n attrs: {\n \"type\": \"left\",\n \"disabled\": _vm.isDisabledArrows('last-month')\n },\n on: {\n \"click\": _vm.handleIconLeftClick\n }\n }), _vm._v(\" \"), _c('icon-button', {\n attrs: {\n \"type\": \"double-right\",\n \"disabled\": _vm.isDisabledArrows('next-year')\n },\n on: {\n \"click\": _vm.handleIconDoubleRightClick\n }\n }), _vm._v(\" \"), _c('icon-button', {\n attrs: {\n \"type\": \"right\",\n \"disabled\": _vm.isDisabledArrows('next-month')\n },\n on: {\n \"click\": _vm.handleIconRightClick\n }\n }), _vm._v(\" \"), _c('span', {\n class: _vm.prefixClass + \"-calendar-header-label\"\n }, _vm._l(_vm.yearMonth, function (item) {\n return _c('button', {\n key: item.panel,\n class: _vm.prefixClass + \"-btn \" + _vm.prefixClass + \"-btn-text \" + _vm.prefixClass + \"-btn-current-\" + item.panel,\n attrs: {\n \"type\": \"button\"\n },\n on: {\n \"click\": function click($event) {\n return _vm.handlePanelChange(item.panel);\n }\n }\n }, [_vm._v(\"\\n \" + _vm._s(item.label) + \"\\n \")]);\n }), 0)], 1), _vm._v(\" \"), _c('div', {\n class: _vm.prefixClass + \"-calendar-content\"\n }, [_c('table', {\n class: _vm.prefixClass + \"-table \" + _vm.prefixClass + \"-table-date\"\n }, [_c('thead', [_c('tr', [_vm.showWeekNumber ? _c('th', {\n class: _vm.prefixClass + \"-week-number-header\"\n }) : _vm._e(), _vm._v(\" \"), _vm._l(_vm.days, function (day) {\n return _c('th', {\n key: day\n }, [_vm._v(_vm._s(day))]);\n })], 2)]), _vm._v(\" \"), _c('tbody', {\n on: {\n \"click\": _vm.handleCellClick\n }\n }, _vm._l(_vm.dates, function (row, i) {\n return _c('tr', {\n key: i,\n class: [_vm.prefixClass + \"-date-row\", _vm.getRowClasses(row)]\n }, [_vm.showWeekNumber ? _c('td', {\n class: _vm.prefixClass + \"-week-number\",\n attrs: {\n \"data-row-col\": i + \",0\"\n }\n }, [_vm._v(\"\\n \" + _vm._s(_vm.getWeekNumber(row[0])) + \"\\n \")]) : _vm._e(), _vm._v(\" \"), _vm._l(row, function (cell, j) {\n return _c('td', {\n key: j,\n staticClass: \"cell\",\n class: _vm.getCellClasses(cell),\n attrs: {\n \"data-row-col\": i + \",\" + j,\n \"title\": _vm.getCellTitle(cell)\n },\n on: {\n \"mouseenter\": function mouseenter($event) {\n return _vm.handleMouseEnter(cell);\n },\n \"mouseleave\": function mouseleave($event) {\n return _vm.handleMouseLeave(cell);\n }\n }\n }, [_c('div', [_vm._v(_vm._s(cell.getDate()))])]);\n })], 2);\n }), 0)])])]);\n};\n\nvar __vue_staticRenderFns__$5 = [];\n/* style */\n\nvar __vue_inject_styles__$5 = undefined;\n/* scoped */\n\nvar __vue_scope_id__$5 = undefined;\n/* module identifier */\n\nvar __vue_module_identifier__$5 = undefined;\n/* functional template */\n\nvar __vue_is_functional_template__$5 = false;\n/* style inject */\n\n/* style inject SSR */\n\n/* style inject shadow dom */\n\nvar __vue_component__$5 = normalizeComponent({\n render: __vue_render__$5,\n staticRenderFns: __vue_staticRenderFns__$5\n}, __vue_inject_styles__$5, __vue_script__$2, __vue_scope_id__$5, __vue_is_functional_template__$5, __vue_module_identifier__$5, false, undefined, undefined, undefined);\n\n//\nvar script$3 = {\n name: 'TableMonth',\n components: {\n IconButton: __vue_component__$4\n },\n inject: {\n getLocale: {\n default: function _default() {\n return getLocale;\n }\n },\n prefixClass: {\n default: 'mx'\n }\n },\n props: {\n disabledCalendarChanger: {\n type: Function,\n default: function _default() {\n return false;\n }\n },\n calendar: {\n type: Date,\n default: function _default() {\n return new Date();\n }\n },\n getCellClasses: {\n type: Function,\n default: function _default() {\n return [];\n }\n }\n },\n computed: {\n calendarYear: function calendarYear() {\n return this.calendar.getFullYear();\n },\n months: function months() {\n var locale = this.getLocale();\n var monthsLocale = locale.months || locale.formatLocale.monthsShort;\n var months = monthsLocale.map(function (text, month) {\n return {\n text: text,\n month: month\n };\n });\n return chunk(months, 3);\n }\n },\n methods: {\n isDisabledArrows: function isDisabledArrows(type) {\n var date = new Date(this.calendar);\n\n switch (type) {\n case 'last-year':\n date.setFullYear(date.getFullYear() - 1, 11, 31);\n date.setHours(23, 59, 59, 999);\n break;\n\n case 'next-year':\n date.setFullYear(date.getFullYear() + 1, 0, 1);\n break;\n }\n\n return this.disabledCalendarChanger(date, type);\n },\n handleIconDoubleLeftClick: function handleIconDoubleLeftClick() {\n this.$emit('changecalendar', setYear(this.calendar, function (v) {\n return v - 1;\n }), 'last-year');\n },\n handleIconDoubleRightClick: function handleIconDoubleRightClick() {\n this.$emit('changecalendar', setYear(this.calendar, function (v) {\n return v + 1;\n }), 'next-year');\n },\n handlePanelChange: function handlePanelChange() {\n this.$emit('changepanel', 'year');\n },\n handleClick: function handleClick(evt) {\n var target = evt.target;\n\n if (target.tagName.toUpperCase() === 'DIV') {\n target = target.parentNode;\n }\n\n var month = target.getAttribute('data-month');\n\n if (month && !target.classList.contains('disabled')) {\n this.$emit('select', parseInt(month, 10));\n }\n }\n }\n};\n\n/* script */\nvar __vue_script__$3 = script$3;\n/* template */\n\nvar __vue_render__$6 = function __vue_render__() {\n var _vm = this;\n\n var _h = _vm.$createElement;\n\n var _c = _vm._self._c || _h;\n\n return _c('div', {\n class: _vm.prefixClass + \"-calendar \" + _vm.prefixClass + \"-calendar-panel-month\"\n }, [_c('div', {\n class: _vm.prefixClass + \"-calendar-header\"\n }, [_c('icon-button', {\n attrs: {\n \"type\": \"double-left\",\n \"disabled\": _vm.isDisabledArrows('last-year')\n },\n on: {\n \"click\": _vm.handleIconDoubleLeftClick\n }\n }), _vm._v(\" \"), _c('icon-button', {\n attrs: {\n \"type\": \"double-right\",\n \"disabled\": _vm.isDisabledArrows('next-year')\n },\n on: {\n \"click\": _vm.handleIconDoubleRightClick\n }\n }), _vm._v(\" \"), _c('span', {\n class: _vm.prefixClass + \"-calendar-header-label\"\n }, [_c('button', {\n class: _vm.prefixClass + \"-btn \" + _vm.prefixClass + \"-btn-text\",\n attrs: {\n \"type\": \"button\"\n },\n on: {\n \"click\": _vm.handlePanelChange\n }\n }, [_vm._v(\"\\n \" + _vm._s(_vm.calendarYear) + \"\\n \")])])], 1), _vm._v(\" \"), _c('div', {\n class: _vm.prefixClass + \"-calendar-content\"\n }, [_c('table', {\n class: _vm.prefixClass + \"-table \" + _vm.prefixClass + \"-table-month\",\n on: {\n \"click\": _vm.handleClick\n }\n }, _vm._l(_vm.months, function (row, i) {\n return _c('tr', {\n key: i\n }, _vm._l(row, function (cell, j) {\n return _c('td', {\n key: j,\n staticClass: \"cell\",\n class: _vm.getCellClasses(cell.month),\n attrs: {\n \"data-month\": cell.month\n }\n }, [_c('div', [_vm._v(_vm._s(cell.text))])]);\n }), 0);\n }), 0)])]);\n};\n\nvar __vue_staticRenderFns__$6 = [];\n/* style */\n\nvar __vue_inject_styles__$6 = undefined;\n/* scoped */\n\nvar __vue_scope_id__$6 = undefined;\n/* module identifier */\n\nvar __vue_module_identifier__$6 = undefined;\n/* functional template */\n\nvar __vue_is_functional_template__$6 = false;\n/* style inject */\n\n/* style inject SSR */\n\n/* style inject shadow dom */\n\nvar __vue_component__$6 = normalizeComponent({\n render: __vue_render__$6,\n staticRenderFns: __vue_staticRenderFns__$6\n}, __vue_inject_styles__$6, __vue_script__$3, __vue_scope_id__$6, __vue_is_functional_template__$6, __vue_module_identifier__$6, false, undefined, undefined, undefined);\n\n//\nvar script$4 = {\n name: 'TableYear',\n components: {\n IconButton: __vue_component__$4\n },\n inject: {\n prefixClass: {\n default: 'mx'\n }\n },\n props: {\n disabledCalendarChanger: {\n type: Function,\n default: function _default() {\n return false;\n }\n },\n calendar: {\n type: Date,\n default: function _default() {\n return new Date();\n }\n },\n getCellClasses: {\n type: Function,\n default: function _default() {\n return [];\n }\n },\n getYearPanel: {\n type: Function\n }\n },\n computed: {\n years: function years() {\n var calendar = new Date(this.calendar);\n\n if (typeof this.getYearPanel === 'function') {\n return this.getYearPanel(calendar);\n }\n\n return this.getYears(calendar);\n },\n firstYear: function firstYear() {\n return this.years[0][0];\n },\n lastYear: function lastYear() {\n var last = function last(arr) {\n return arr[arr.length - 1];\n };\n\n return last(last(this.years));\n }\n },\n methods: {\n isDisabledArrows: function isDisabledArrows(type) {\n var date = new Date(this.calendar);\n\n switch (type) {\n case 'last-decade':\n date.setFullYear(this.firstYear - 1, 11, 31);\n date.setHours(23, 59, 59, 999);\n break;\n\n case 'next-decade':\n date.setFullYear(this.lastYear + 1, 0, 1);\n break;\n }\n\n return this.disabledCalendarChanger(date, type);\n },\n getYears: function getYears(calendar) {\n var firstYear = Math.floor(calendar.getFullYear() / 10) * 10;\n var years = [];\n\n for (var i = 0; i < 10; i++) {\n years.push(firstYear + i);\n }\n\n return chunk(years, 2);\n },\n handleIconDoubleLeftClick: function handleIconDoubleLeftClick() {\n this.$emit('changecalendar', setYear(this.calendar, function (v) {\n return v - 10;\n }), 'last-decade');\n },\n handleIconDoubleRightClick: function handleIconDoubleRightClick() {\n this.$emit('changecalendar', setYear(this.calendar, function (v) {\n return v + 10;\n }), 'next-decade');\n },\n handleClick: function handleClick(evt) {\n var target = evt.target;\n\n if (target.tagName.toUpperCase() === 'DIV') {\n target = target.parentNode;\n }\n\n var year = target.getAttribute('data-year');\n\n if (year && !target.classList.contains('disabled')) {\n this.$emit('select', parseInt(year, 10));\n }\n }\n }\n};\n\n/* script */\nvar __vue_script__$4 = script$4;\n/* template */\n\nvar __vue_render__$7 = function __vue_render__() {\n var _vm = this;\n\n var _h = _vm.$createElement;\n\n var _c = _vm._self._c || _h;\n\n return _c('div', {\n class: _vm.prefixClass + \"-calendar \" + _vm.prefixClass + \"-calendar-panel-year\"\n }, [_c('div', {\n class: _vm.prefixClass + \"-calendar-header\"\n }, [_c('icon-button', {\n attrs: {\n \"type\": \"double-left\",\n \"disabled\": _vm.isDisabledArrows('last-decade')\n },\n on: {\n \"click\": _vm.handleIconDoubleLeftClick\n }\n }), _vm._v(\" \"), _c('icon-button', {\n attrs: {\n \"type\": \"double-right\",\n \"disabled\": _vm.isDisabledArrows('next-decade')\n },\n on: {\n \"click\": _vm.handleIconDoubleRightClick\n }\n }), _vm._v(\" \"), _c('span', {\n class: _vm.prefixClass + \"-calendar-header-label\"\n }, [_c('span', [_vm._v(_vm._s(_vm.firstYear))]), _vm._v(\" \"), _c('span', {\n class: _vm.prefixClass + \"-calendar-decade-separator\"\n }), _vm._v(\" \"), _c('span', [_vm._v(_vm._s(_vm.lastYear))])])], 1), _vm._v(\" \"), _c('div', {\n class: _vm.prefixClass + \"-calendar-content\"\n }, [_c('table', {\n class: _vm.prefixClass + \"-table \" + _vm.prefixClass + \"-table-year\",\n on: {\n \"click\": _vm.handleClick\n }\n }, _vm._l(_vm.years, function (row, i) {\n return _c('tr', {\n key: i\n }, _vm._l(row, function (cell, j) {\n return _c('td', {\n key: j,\n staticClass: \"cell\",\n class: _vm.getCellClasses(cell),\n attrs: {\n \"data-year\": cell\n }\n }, [_c('div', [_vm._v(_vm._s(cell))])]);\n }), 0);\n }), 0)])]);\n};\n\nvar __vue_staticRenderFns__$7 = [];\n/* style */\n\nvar __vue_inject_styles__$7 = undefined;\n/* scoped */\n\nvar __vue_scope_id__$7 = undefined;\n/* module identifier */\n\nvar __vue_module_identifier__$7 = undefined;\n/* functional template */\n\nvar __vue_is_functional_template__$7 = false;\n/* style inject */\n\n/* style inject SSR */\n\n/* style inject shadow dom */\n\nvar __vue_component__$7 = normalizeComponent({\n render: __vue_render__$7,\n staticRenderFns: __vue_staticRenderFns__$7\n}, __vue_inject_styles__$7, __vue_script__$4, __vue_scope_id__$7, __vue_is_functional_template__$7, __vue_module_identifier__$7, false, undefined, undefined, undefined);\n\nvar CalendarPanel = {\n name: 'CalendarPanel',\n inject: {\n prefixClass: {\n default: 'mx'\n },\n dispatchDatePicker: {\n default: function _default() {\n return function () {};\n }\n }\n },\n props: {\n value: {},\n defaultValue: {\n default: function _default() {\n var date = new Date();\n date.setHours(0, 0, 0, 0);\n return date;\n }\n },\n defaultPanel: {\n type: String\n },\n disabledCalendarChanger: {\n type: Function,\n default: function _default() {\n return false;\n }\n },\n disabledDate: {\n type: Function,\n default: function _default() {\n return false;\n }\n },\n type: {\n type: String,\n default: 'date'\n },\n getClasses: {\n type: Function,\n default: function _default() {\n return [];\n }\n },\n showWeekNumber: {\n type: Boolean,\n default: undefined\n },\n getYearPanel: {\n type: Function\n },\n titleFormat: {\n type: String,\n default: 'YYYY-MM-DD'\n },\n calendar: Date,\n // update date when select year or month\n partialUpdate: {\n type: Boolean,\n default: false\n }\n },\n data: function data() {\n var panels = ['date', 'month', 'year'];\n var index = Math.max(panels.indexOf(this.type), panels.indexOf(this.defaultPanel));\n var panel = index !== -1 ? panels[index] : 'date';\n return {\n panel: panel,\n innerCalendar: new Date()\n };\n },\n computed: {\n innerValue: function innerValue() {\n var value = Array.isArray(this.value) ? this.value : [this.value];\n var map = {\n year: startOfYear,\n month: startOfMonth,\n date: startOfDay\n };\n var start = map[this.type] || map.date;\n return value.filter(isValidDate).map(function (v) {\n return start(v);\n });\n },\n calendarYear: function calendarYear() {\n return this.innerCalendar.getFullYear();\n },\n calendarMonth: function calendarMonth() {\n return this.innerCalendar.getMonth();\n }\n },\n watch: {\n value: {\n immediate: true,\n handler: 'initCalendar'\n },\n calendar: {\n handler: 'initCalendar'\n },\n defaultValue: {\n handler: 'initCalendar'\n }\n },\n methods: {\n initCalendar: function initCalendar() {\n var calendarDate = this.calendar;\n\n if (!isValidDate(calendarDate)) {\n var length = this.innerValue.length;\n calendarDate = getValidDate(length > 0 ? this.innerValue[length - 1] : this.defaultValue);\n }\n\n this.innerCalendar = startOfMonth(calendarDate);\n },\n isDisabled: function isDisabled(date) {\n return this.disabledDate(new Date(date), this.innerValue);\n },\n emitDate: function emitDate(date, type) {\n if (!this.isDisabled(date)) {\n this.$emit('select', date, type, this.innerValue); // someone need get the first selected date to set range value. (#429)\n\n this.dispatchDatePicker('pick', date, type);\n }\n },\n handleCalendarChange: function handleCalendarChange(calendar, type) {\n var oldCalendar = new Date(this.innerCalendar);\n this.innerCalendar = calendar;\n this.$emit('update:calendar', calendar);\n this.dispatchDatePicker('calendar-change', calendar, oldCalendar, type);\n },\n handelPanelChange: function handelPanelChange(panel) {\n var oldPanel = this.panel;\n this.panel = panel;\n this.dispatchDatePicker('panel-change', panel, oldPanel);\n },\n handleSelectYear: function handleSelectYear(year) {\n if (this.type === 'year') {\n var date = this.getYearCellDate(year);\n this.emitDate(date, 'year');\n } else {\n this.handleCalendarChange(createDate(year, this.calendarMonth), 'year');\n this.handelPanelChange('month');\n\n if (this.partialUpdate && this.innerValue.length === 1) {\n var _date = new Date(this.innerValue[0]);\n\n _date.setFullYear(year);\n\n this.emitDate(_date, 'year');\n }\n }\n },\n handleSelectMonth: function handleSelectMonth(month) {\n if (this.type === 'month') {\n var date = this.getMonthCellDate(month);\n this.emitDate(date, 'month');\n } else {\n this.handleCalendarChange(createDate(this.calendarYear, month), 'month');\n this.handelPanelChange('date');\n\n if (this.partialUpdate && this.innerValue.length === 1) {\n var _date2 = new Date(this.innerValue[0]);\n\n _date2.setFullYear(this.calendarYear);\n\n this.emitDate(setMonth(_date2, month), 'month');\n }\n }\n },\n handleSelectDate: function handleSelectDate(date) {\n this.emitDate(date, this.type === 'week' ? 'week' : 'date');\n },\n getMonthCellDate: function getMonthCellDate(month) {\n return createDate(this.calendarYear, month);\n },\n getYearCellDate: function getYearCellDate(year) {\n return createDate(year, 0);\n },\n getDateClasses: function getDateClasses(cellDate) {\n var notCurrentMonth = cellDate.getMonth() !== this.calendarMonth;\n var classes = [];\n\n if (cellDate.getTime() === new Date().setHours(0, 0, 0, 0)) {\n classes.push('today');\n }\n\n if (notCurrentMonth) {\n classes.push('not-current-month');\n }\n\n var state = this.getStateClass(cellDate);\n\n if (!(state === 'active' && notCurrentMonth)) {\n classes.push(state);\n }\n\n return classes.concat(this.getClasses(cellDate, this.innerValue, classes.join(' ')));\n },\n getMonthClasses: function getMonthClasses(month) {\n var classes = [];\n\n if (this.type !== 'month') {\n if (this.calendarMonth === month) {\n classes.push('active');\n }\n\n var _cellDate = this.getMonthCellDate(month);\n\n if (this.disabledCalendarChanger(_cellDate, 'month')) {\n classes.push('disabled');\n }\n\n return classes;\n }\n\n var cellDate = this.getMonthCellDate(month);\n classes.push(this.getStateClass(cellDate));\n return classes.concat(this.getClasses(cellDate, this.innerValue, classes.join(' ')));\n },\n getYearClasses: function getYearClasses(year) {\n var classes = [];\n\n if (this.type !== 'year') {\n if (this.calendarYear === year) {\n classes.push('active');\n }\n\n var _cellDate2 = this.getYearCellDate(year);\n\n if (this.disabledCalendarChanger(_cellDate2, 'year')) {\n classes.push('disabled');\n }\n\n return classes;\n }\n\n var cellDate = this.getYearCellDate(year);\n classes.push(this.getStateClass(cellDate));\n return classes.concat(this.getClasses(cellDate, this.innerValue, classes.join(' ')));\n },\n getStateClass: function getStateClass(cellDate) {\n if (this.isDisabled(cellDate)) {\n return 'disabled';\n }\n\n if (this.innerValue.some(function (v) {\n return v.getTime() === cellDate.getTime();\n })) {\n return 'active';\n }\n\n return '';\n },\n getWeekState: function getWeekState(row) {\n if (this.type !== 'week') return '';\n var start = row[0].getTime();\n var end = row[6].getTime();\n var active = this.innerValue.some(function (v) {\n var time = v.getTime();\n return time >= start && time <= end;\n });\n return active ? \"\".concat(this.prefixClass, \"-active-week\") : '';\n }\n },\n render: function render() {\n var h = arguments[0];\n var panel = this.panel,\n innerCalendar = this.innerCalendar;\n\n if (panel === 'year') {\n return h(__vue_component__$7, {\n \"attrs\": {\n \"disabledCalendarChanger\": this.disabledCalendarChanger,\n \"calendar\": innerCalendar,\n \"getCellClasses\": this.getYearClasses,\n \"getYearPanel\": this.getYearPanel\n },\n \"on\": {\n \"select\": this.handleSelectYear,\n \"changecalendar\": this.handleCalendarChange\n }\n });\n }\n\n if (panel === 'month') {\n return h(__vue_component__$6, {\n \"attrs\": {\n \"disabledCalendarChanger\": this.disabledCalendarChanger,\n \"calendar\": innerCalendar,\n \"getCellClasses\": this.getMonthClasses\n },\n \"on\": {\n \"select\": this.handleSelectMonth,\n \"changepanel\": this.handelPanelChange,\n \"changecalendar\": this.handleCalendarChange\n }\n });\n }\n\n return h(__vue_component__$5, {\n \"attrs\": {\n \"disabledCalendarChanger\": this.disabledCalendarChanger,\n \"calendar\": innerCalendar,\n \"getCellClasses\": this.getDateClasses,\n \"getRowClasses\": this.getWeekState,\n \"titleFormat\": this.titleFormat,\n \"showWeekNumber\": typeof this.showWeekNumber === 'boolean' ? this.showWeekNumber : this.type === 'week'\n },\n \"class\": _defineProperty({}, \"\".concat(this.prefixClass, \"-calendar-week-mode\"), this.type === 'week'),\n \"on\": {\n \"select\": this.handleSelectDate,\n \"changepanel\": this.handelPanelChange,\n \"changecalendar\": this.handleCalendarChange\n }\n });\n }\n};\n\nvar CalendarRange = {\n name: 'CalendarRange',\n components: {\n CalendarPanel: CalendarPanel\n },\n provide: function provide() {\n return {\n onDateMouseEnter: this.onDateMouseEnter,\n onDateMouseLeave: this.onDateMouseLeave\n };\n },\n inject: {\n prefixClass: {\n default: 'mx'\n }\n },\n props: _objectSpread2({}, CalendarPanel.props),\n data: function data() {\n return {\n innerValue: [],\n calendars: [],\n hoveredValue: null\n };\n },\n computed: {\n // Minimum difference between start and end calendars\n calendarMinDiff: function calendarMinDiff() {\n var map = {\n date: 1,\n // type:date min 1 month\n month: 1 * 12,\n // type:month min 1 year\n year: 10 * 12 // type:year min 10 year\n\n };\n return map[this.type] || map.date;\n },\n calendarMaxDiff: function calendarMaxDiff() {\n return Infinity;\n },\n defaultValues: function defaultValues() {\n return Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue, this.defaultValue];\n }\n },\n watch: {\n value: {\n immediate: true,\n handler: function handler() {\n var _this = this;\n\n this.innerValue = isValidRangeDate(this.value) ? this.value : [new Date(NaN), new Date(NaN)];\n var calendars = this.innerValue.map(function (v, i) {\n return startOfMonth(getValidDate(v, _this.defaultValues[i]));\n });\n this.updateCalendars(calendars);\n }\n }\n },\n methods: {\n handleSelect: function handleSelect(date, type) {\n var _this$innerValue = _slicedToArray(this.innerValue, 2),\n startValue = _this$innerValue[0],\n endValue = _this$innerValue[1];\n\n if (isValidDate(startValue) && !isValidDate(endValue)) {\n if (startValue.getTime() > date.getTime()) {\n this.innerValue = [date, startValue];\n } else {\n this.innerValue = [startValue, date];\n }\n\n this.emitDate(this.innerValue, type);\n } else {\n this.innerValue = [date, new Date(NaN)];\n }\n },\n onDateMouseEnter: function onDateMouseEnter(cell) {\n this.hoveredValue = cell;\n },\n onDateMouseLeave: function onDateMouseLeave() {\n this.hoveredValue = null;\n },\n emitDate: function emitDate(dates, type) {\n this.$emit('select', dates, type);\n },\n updateStartCalendar: function updateStartCalendar(value) {\n this.updateCalendars([value, this.calendars[1]], 1);\n },\n updateEndCalendar: function updateEndCalendar(value) {\n this.updateCalendars([this.calendars[0], value], 0);\n },\n updateCalendars: function updateCalendars(calendars) {\n var adjustIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var gap = this.getCalendarGap(calendars);\n\n if (gap) {\n var calendar = new Date(calendars[adjustIndex]);\n calendar.setMonth(calendar.getMonth() + (adjustIndex === 0 ? -gap : gap));\n calendars[adjustIndex] = calendar;\n }\n\n this.calendars = calendars;\n },\n getCalendarGap: function getCalendarGap(calendars) {\n var _calendars = _slicedToArray(calendars, 2),\n calendarLeft = _calendars[0],\n calendarRight = _calendars[1];\n\n var yearDiff = calendarRight.getFullYear() - calendarLeft.getFullYear();\n var monthDiff = calendarRight.getMonth() - calendarLeft.getMonth();\n var diff = yearDiff * 12 + monthDiff;\n var min = this.calendarMinDiff;\n var max = this.calendarMaxDiff;\n\n if (diff < min) {\n return min - diff;\n }\n\n if (diff > max) {\n return max - diff;\n }\n\n return 0;\n },\n getRangeClasses: function getRangeClasses(cellDate, currentDates, classnames) {\n var classes = [].concat(this.getClasses(cellDate, currentDates, classnames));\n if (/disabled|active/.test(classnames)) return classes;\n\n var inRange = function inRange(data, range) {\n var fn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (v) {\n return v.getTime();\n };\n var value = fn(data);\n\n var _range$map = range.map(fn),\n _range$map2 = _slicedToArray(_range$map, 2),\n min = _range$map2[0],\n max = _range$map2[1];\n\n if (min > max) {\n var _ref = [max, min];\n min = _ref[0];\n max = _ref[1];\n }\n\n return value > min && value < max;\n };\n\n if (currentDates.length === 2 && inRange(cellDate, currentDates)) {\n return classes.concat('in-range');\n }\n\n if (currentDates.length === 1 && this.hoveredValue && inRange(cellDate, [currentDates[0], this.hoveredValue])) {\n return classes.concat('hover-in-range');\n }\n\n return classes;\n }\n },\n render: function render() {\n var _this2 = this;\n\n var h = arguments[0];\n var calendarRange = this.calendars.map(function (calendar, index) {\n var props = _objectSpread2({}, _this2.$props, {\n calendar: calendar,\n value: _this2.innerValue,\n defaultValue: _this2.defaultValues[index],\n getClasses: _this2.getRangeClasses,\n // don't update when range is true\n partialUpdate: false\n });\n\n var on = {\n select: _this2.handleSelect,\n 'update:calendar': index === 0 ? _this2.updateStartCalendar : _this2.updateEndCalendar\n };\n return h(\"calendar-panel\", {\n \"props\": _objectSpread2({}, props),\n \"on\": _objectSpread2({}, on)\n });\n });\n var prefixClass = this.prefixClass;\n return h(\"div\", {\n \"class\": \"\".concat(prefixClass, \"-range-wrapper\")\n }, [calendarRange]);\n }\n};\n\nvar scrollBarWidth;\nfunction getScrollbarWidth () {\n if (typeof window === 'undefined') return 0;\n if (scrollBarWidth !== undefined) return scrollBarWidth;\n var outer = document.createElement('div');\n outer.style.visibility = 'hidden';\n outer.style.overflow = 'scroll';\n outer.style.width = '100px';\n outer.style.position = 'absolute';\n outer.style.top = '-9999px';\n document.body.appendChild(outer);\n var inner = document.createElement('div');\n inner.style.width = '100%';\n outer.appendChild(inner);\n scrollBarWidth = outer.offsetWidth - inner.offsetWidth;\n outer.parentNode.removeChild(outer);\n return scrollBarWidth;\n}\n\n//\nvar script$5 = {\n inject: {\n prefixClass: {\n default: 'mx'\n }\n },\n data: function data() {\n return {\n scrollbarWidth: 0,\n thumbTop: '',\n thumbHeight: ''\n };\n },\n created: function created() {\n this.scrollbarWidth = getScrollbarWidth();\n document.addEventListener('mouseup', this.handleDragend);\n },\n beforeDestroy: function beforeDestroy() {\n document.addEventListener('mouseup', this.handleDragend);\n },\n mounted: function mounted() {\n this.$nextTick(this.getThumbSize);\n },\n methods: {\n getThumbSize: function getThumbSize() {\n var wrap = this.$refs.wrap;\n if (!wrap) return;\n var heightPercentage = wrap.clientHeight * 100 / wrap.scrollHeight;\n this.thumbHeight = heightPercentage < 100 ? \"\".concat(heightPercentage, \"%\") : '';\n },\n handleScroll: function handleScroll(evt) {\n var el = evt.currentTarget;\n var scrollHeight = el.scrollHeight,\n scrollTop = el.scrollTop;\n this.thumbTop = \"\".concat(scrollTop * 100 / scrollHeight, \"%\");\n },\n handleDragstart: function handleDragstart(evt) {\n evt.stopImmediatePropagation();\n this._draggable = true;\n var offsetTop = this.$refs.thumb.offsetTop;\n this._prevY = evt.clientY - offsetTop;\n document.addEventListener('mousemove', this.handleDraging);\n },\n handleDraging: function handleDraging(evt) {\n if (!this._draggable) return;\n var clientY = evt.clientY;\n var wrap = this.$refs.wrap;\n var scrollHeight = wrap.scrollHeight,\n clientHeight = wrap.clientHeight;\n var offsetY = clientY - this._prevY;\n var top = offsetY * scrollHeight / clientHeight;\n wrap.scrollTop = top;\n },\n handleDragend: function handleDragend() {\n if (this._draggable) {\n this._draggable = false;\n document.removeEventListener('mousemove', this.handleDraging);\n }\n }\n }\n};\n\n/* script */\nvar __vue_script__$5 = script$5;\n/* template */\n\nvar __vue_render__$8 = function __vue_render__() {\n var _vm = this;\n\n var _h = _vm.$createElement;\n\n var _c = _vm._self._c || _h;\n\n return _c('div', {\n class: _vm.prefixClass + \"-scrollbar\",\n style: {\n position: 'relative',\n overflow: 'hidden'\n }\n }, [_c('div', {\n ref: \"wrap\",\n class: _vm.prefixClass + \"-scrollbar-wrap\",\n style: {\n marginRight: \"-\" + _vm.scrollbarWidth + \"px\"\n },\n on: {\n \"scroll\": _vm.handleScroll\n }\n }, [_vm._t(\"default\")], 2), _vm._v(\" \"), _c('div', {\n class: _vm.prefixClass + \"-scrollbar-track\"\n }, [_c('div', {\n ref: \"thumb\",\n class: _vm.prefixClass + \"-scrollbar-thumb\",\n style: {\n height: _vm.thumbHeight,\n top: _vm.thumbTop\n },\n on: {\n \"mousedown\": _vm.handleDragstart\n }\n })])]);\n};\n\nvar __vue_staticRenderFns__$8 = [];\n/* style */\n\nvar __vue_inject_styles__$8 = undefined;\n/* scoped */\n\nvar __vue_scope_id__$8 = undefined;\n/* module identifier */\n\nvar __vue_module_identifier__$8 = undefined;\n/* functional template */\n\nvar __vue_is_functional_template__$8 = false;\n/* style inject */\n\n/* style inject SSR */\n\n/* style inject shadow dom */\n\nvar __vue_component__$8 = normalizeComponent({\n render: __vue_render__$8,\n staticRenderFns: __vue_staticRenderFns__$8\n}, __vue_inject_styles__$8, __vue_script__$5, __vue_scope_id__$8, __vue_is_functional_template__$8, __vue_module_identifier__$8, false, undefined, undefined, undefined);\n\n//\n\nvar padNumber = function padNumber(value) {\n value = parseInt(value, 10);\n return value < 10 ? \"0\".concat(value) : \"\".concat(value);\n};\n\nvar generateOptions = function generateOptions(length, step, options) {\n if (Array.isArray(options)) {\n return options.filter(function (v) {\n return v >= 0 && v < length;\n });\n }\n\n if (step <= 0) {\n step = 1;\n }\n\n var arr = [];\n\n for (var i = 0; i < length; i += step) {\n arr.push(i);\n }\n\n return arr;\n};\n\nvar scrollTo = function scrollTo(element, to) {\n var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n // jump to target if duration zero\n if (duration <= 0) {\n requestAnimationFrame(function () {\n element.scrollTop = to;\n });\n return;\n }\n\n var difference = to - element.scrollTop;\n var tick = difference / duration * 10;\n requestAnimationFrame(function () {\n var scrollTop = element.scrollTop + tick;\n\n if (scrollTop >= to) {\n element.scrollTop = to;\n return;\n }\n\n element.scrollTop = scrollTop;\n scrollTo(element, to, duration - 10);\n });\n};\n\nvar script$6 = {\n name: 'ListColumns',\n components: {\n ScrollbarVertical: __vue_component__$8\n },\n inject: {\n prefixClass: {\n default: 'mx'\n }\n },\n props: {\n date: Date,\n scrollDuration: {\n type: Number,\n default: 100\n },\n getClasses: {\n type: Function,\n default: function _default() {\n return [];\n }\n },\n hourOptions: Array,\n minuteOptions: Array,\n secondOptions: Array,\n showHour: {\n type: Boolean,\n default: true\n },\n showMinute: {\n type: Boolean,\n default: true\n },\n showSecond: {\n type: Boolean,\n default: true\n },\n hourStep: {\n type: Number,\n default: 1\n },\n minuteStep: {\n type: Number,\n default: 1\n },\n secondStep: {\n type: Number,\n default: 1\n },\n use12h: {\n type: Boolean,\n default: false\n }\n },\n computed: {\n columns: function columns() {\n var cols = [];\n if (this.showHour) cols.push({\n type: 'hour',\n list: this.getHoursList()\n });\n if (this.showMinute) cols.push({\n type: 'minute',\n list: this.getMinutesList()\n });\n if (this.showSecond) cols.push({\n type: 'second',\n list: this.getSecondsList()\n });\n if (this.use12h) cols.push({\n type: 'ampm',\n list: this.getAMPMList()\n });\n return cols.filter(function (v) {\n return v.list.length > 0;\n });\n }\n },\n watch: {\n date: {\n handler: function handler() {\n var _this = this;\n\n this.$nextTick(function () {\n _this.scrollToSelected(_this.scrollDuration);\n });\n }\n }\n },\n mounted: function mounted() {\n this.scrollToSelected(0);\n },\n methods: {\n getHoursList: function getHoursList() {\n var _this2 = this;\n\n return generateOptions(this.use12h ? 12 : 24, this.hourStep, this.hourOptions).map(function (num) {\n var date = new Date(_this2.date);\n var text = padNumber(num);\n\n if (_this2.use12h) {\n if (num === 0) {\n text = '12';\n }\n\n if (date.getHours() >= 12) {\n num += 12;\n }\n }\n\n var value = date.setHours(num);\n return {\n value: value,\n text: text\n };\n });\n },\n getMinutesList: function getMinutesList() {\n var _this3 = this;\n\n return generateOptions(60, this.minuteStep, this.minuteOptions).map(function (num) {\n var value = new Date(_this3.date).setMinutes(num);\n return {\n value: value,\n text: padNumber(num)\n };\n });\n },\n getSecondsList: function getSecondsList() {\n var _this4 = this;\n\n return generateOptions(60, this.secondStep, this.secondOptions).map(function (num) {\n var value = new Date(_this4.date).setSeconds(num);\n return {\n value: value,\n text: padNumber(num)\n };\n });\n },\n getAMPMList: function getAMPMList() {\n var _this5 = this;\n\n return ['AM', 'PM'].map(function (text, i) {\n var date = new Date(_this5.date);\n var value = date.setHours(date.getHours() % 12 + i * 12);\n return {\n text: text,\n value: value\n };\n });\n },\n scrollToSelected: function scrollToSelected(duration) {\n var elements = this.$el.querySelectorAll('.active');\n\n for (var i = 0; i < elements.length; i++) {\n var element = elements[i];\n var scrollElement = getScrollParent(element, this.$el);\n\n if (scrollElement) {\n var to = element.offsetTop;\n scrollTo(scrollElement, to, duration);\n }\n }\n },\n handleSelect: function handleSelect(evt) {\n var target = evt.target,\n currentTarget = evt.currentTarget;\n if (target.tagName.toUpperCase() !== 'LI') return;\n var type = currentTarget.getAttribute('data-type');\n var colIndex = parseInt(currentTarget.getAttribute('data-index'), 10);\n var cellIndex = parseInt(target.getAttribute('data-index'), 10);\n var value = this.columns[colIndex].list[cellIndex].value;\n this.$emit('select', value, type);\n }\n }\n};\n\n/* script */\nvar __vue_script__$6 = script$6;\n/* template */\n\nvar __vue_render__$9 = function __vue_render__() {\n var _vm = this;\n\n var _h = _vm.$createElement;\n\n var _c = _vm._self._c || _h;\n\n return _c('div', {\n class: _vm.prefixClass + \"-time-columns\"\n }, _vm._l(_vm.columns, function (col, i) {\n return _c('scrollbar-vertical', {\n key: i,\n class: _vm.prefixClass + \"-time-column\"\n }, [_c('ul', {\n class: _vm.prefixClass + \"-time-list\",\n attrs: {\n \"data-type\": col.type,\n \"data-index\": i\n },\n on: {\n \"click\": _vm.handleSelect\n }\n }, _vm._l(col.list, function (item, j) {\n return _c('li', {\n key: item.value,\n class: [_vm.prefixClass + \"-time-item\", _vm.getClasses(item.value, col.type)],\n attrs: {\n \"data-index\": j\n }\n }, [_vm._v(\"\\n \" + _vm._s(item.text) + \"\\n \")]);\n }), 0)]);\n }), 1);\n};\n\nvar __vue_staticRenderFns__$9 = [];\n/* style */\n\nvar __vue_inject_styles__$9 = undefined;\n/* scoped */\n\nvar __vue_scope_id__$9 = undefined;\n/* module identifier */\n\nvar __vue_module_identifier__$9 = undefined;\n/* functional template */\n\nvar __vue_is_functional_template__$9 = false;\n/* style inject */\n\n/* style inject SSR */\n\n/* style inject shadow dom */\n\nvar __vue_component__$9 = normalizeComponent({\n render: __vue_render__$9,\n staticRenderFns: __vue_staticRenderFns__$9\n}, __vue_inject_styles__$9, __vue_script__$6, __vue_scope_id__$9, __vue_is_functional_template__$9, __vue_module_identifier__$9, false, undefined, undefined, undefined);\n\n//\n\nfunction parseOption() {\n var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var values = time.split(':');\n\n if (values.length >= 2) {\n var hours = parseInt(values[0], 10);\n var minutes = parseInt(values[1], 10);\n return {\n hours: hours,\n minutes: minutes\n };\n }\n\n return null;\n}\n\nvar scrollTo$1 = function scrollTo(element, to) {\n if (element) {\n element.scrollTop = to;\n }\n};\n\nvar script$7 = {\n name: 'ListOptions',\n components: {\n ScrollbarVertical: __vue_component__$8\n },\n inject: {\n getLocale: {\n default: function _default() {\n return getLocale;\n }\n },\n prefixClass: {\n default: 'mx'\n }\n },\n props: {\n date: Date,\n options: {\n type: [Object, Function],\n default: function _default() {\n return [];\n }\n },\n format: {\n type: String,\n default: 'HH:mm:ss'\n },\n getClasses: {\n type: Function,\n default: function _default() {\n return [];\n }\n }\n },\n computed: {\n list: function list() {\n var result = [];\n var options = this.options;\n\n if (typeof options === 'function') {\n return options() || [];\n }\n\n var start = parseOption(options.start);\n var end = parseOption(options.end);\n var step = parseOption(options.step);\n var fmt = options.format || this.format;\n\n if (start && end && step) {\n var startMinutes = start.minutes + start.hours * 60;\n var endMinutes = end.minutes + end.hours * 60;\n var stepMinutes = step.minutes + step.hours * 60;\n var len = Math.floor((endMinutes - startMinutes) / stepMinutes);\n\n for (var i = 0; i <= len; i++) {\n var timeMinutes = startMinutes + i * stepMinutes;\n var hours = Math.floor(timeMinutes / 60);\n var minutes = timeMinutes % 60;\n var value = new Date(this.date).setHours(hours, minutes, 0);\n result.push({\n value: value,\n text: this.formatDate(value, fmt)\n });\n }\n }\n\n return result;\n }\n },\n mounted: function mounted() {\n this.scrollToSelected();\n },\n methods: {\n formatDate: function formatDate(date, fmt) {\n return format(date, fmt, {\n locale: this.getLocale().formatLocale\n });\n },\n scrollToSelected: function scrollToSelected() {\n var element = this.$el.querySelector('.active');\n if (!element) return;\n var scrollElement = getScrollParent(element, this.$el);\n if (!scrollElement) return;\n var to = element.offsetTop;\n scrollTo$1(scrollElement, to);\n },\n handleSelect: function handleSelect(value) {\n this.$emit('select', value, 'time');\n }\n }\n};\n\n/* script */\nvar __vue_script__$7 = script$7;\n/* template */\n\nvar __vue_render__$a = function __vue_render__() {\n var _vm = this;\n\n var _h = _vm.$createElement;\n\n var _c = _vm._self._c || _h;\n\n return _c('scrollbar-vertical', _vm._l(_vm.list, function (item) {\n return _c('div', {\n key: item.value,\n class: [_vm.prefixClass + \"-time-option\", _vm.getClasses(item.value)],\n on: {\n \"click\": function click($event) {\n return _vm.handleSelect(item.value);\n }\n }\n }, [_vm._v(\"\\n \" + _vm._s(item.text) + \"\\n \")]);\n }), 0);\n};\n\nvar __vue_staticRenderFns__$a = [];\n/* style */\n\nvar __vue_inject_styles__$a = undefined;\n/* scoped */\n\nvar __vue_scope_id__$a = undefined;\n/* module identifier */\n\nvar __vue_module_identifier__$a = undefined;\n/* functional template */\n\nvar __vue_is_functional_template__$a = false;\n/* style inject */\n\n/* style inject SSR */\n\n/* style inject shadow dom */\n\nvar __vue_component__$a = normalizeComponent({\n render: __vue_render__$a,\n staticRenderFns: __vue_staticRenderFns__$a\n}, __vue_inject_styles__$a, __vue_script__$7, __vue_scope_id__$a, __vue_is_functional_template__$a, __vue_module_identifier__$a, false, undefined, undefined, undefined);\n\n//\nvar script$8 = {\n name: 'TimePanel',\n components: {\n ListColumns: __vue_component__$9,\n ListOptions: __vue_component__$a\n },\n inject: {\n getLocale: {\n default: function _default() {\n return getLocale;\n }\n },\n prefixClass: {\n default: 'mx'\n }\n },\n props: {\n value: {},\n defaultValue: {\n default: function _default() {\n var date = new Date();\n date.setHours(0, 0, 0, 0);\n return date;\n }\n },\n format: {\n default: 'HH:mm:ss'\n },\n timeTitleFormat: {\n type: String,\n default: 'YYYY-MM-DD'\n },\n showTimeHeader: {\n type: Boolean,\n default: false\n },\n disabledTime: {\n type: Function,\n default: function _default() {\n return false;\n }\n },\n timePickerOptions: {\n type: [Object, Function],\n default: function _default() {\n return null;\n }\n },\n hourOptions: Array,\n minuteOptions: Array,\n secondOptions: Array,\n hourStep: {\n type: Number,\n default: 1\n },\n minuteStep: {\n type: Number,\n default: 1\n },\n secondStep: {\n type: Number,\n default: 1\n },\n showHour: {\n type: Boolean,\n default: undefined\n },\n showMinute: {\n type: Boolean,\n default: undefined\n },\n showSecond: {\n type: Boolean,\n default: undefined\n },\n use12h: {\n type: Boolean,\n default: undefined\n },\n scrollDuration: {\n type: Number,\n default: 100\n }\n },\n data: function data() {\n return {\n innerValue: getValidDate(this.value, this.defaultValue)\n };\n },\n computed: {\n title: function title() {\n var titleFormat = this.timeTitleFormat;\n var date = new Date(this.innerValue);\n return this.formatDate(date, titleFormat);\n },\n innerForamt: function innerForamt() {\n return typeof this.format === 'string' ? this.format : 'HH:mm:ss';\n },\n ShowHourMinuteSecondAMPM: function ShowHourMinuteSecondAMPM() {\n var _this = this;\n\n var fmt = this.innerForamt;\n var defaultProps = {\n showHour: /[HhKk]/.test(fmt),\n showMinute: /m/.test(fmt),\n showSecond: /s/.test(fmt),\n use12h: /a/i.test(fmt)\n };\n var obj = {};\n Object.keys(defaultProps).forEach(function (key) {\n obj[key] = typeof _this[key] === 'boolean' ? _this[key] : defaultProps[key];\n });\n return obj;\n }\n },\n watch: {\n value: {\n immediate: true,\n handler: function handler() {\n this.innerValue = getValidDate(this.value, this.defaultValue);\n }\n }\n },\n methods: {\n formatDate: function formatDate(date, fmt) {\n return format(date, fmt, {\n locale: this.getLocale().formatLocale\n });\n },\n isDisabledTime: function isDisabledTime(value) {\n return this.disabledTime(new Date(value));\n },\n isDisabledHour: function isDisabledHour(date) {\n var value = new Date(date);\n return this.isDisabledTime(value) && this.isDisabledTime(value.setMinutes(0, 0, 0)) && this.isDisabledTime(value.setMinutes(59, 59, 999));\n },\n isDisabledMinute: function isDisabledMinute(date) {\n var value = new Date(date);\n return this.isDisabledTime(value) && this.isDisabledTime(value.setSeconds(0, 0)) && this.isDisabledTime(value.setSeconds(59, 999));\n },\n isDisabledAMPM: function isDisabledAMPM(date) {\n var value = new Date(date);\n var minHour = value.getHours() < 12 ? 0 : 12;\n var maxHour = minHour + 11;\n return this.isDisabledTime(value) && this.isDisabledTime(value.setHours(minHour, 0, 0, 0)) && this.isDisabledTime(value.setHours(maxHour, 59, 59, 999));\n },\n isDisabled: function isDisabled(date, type) {\n if (type === 'hour') {\n return this.isDisabledHour(date);\n }\n\n if (type === 'minute') {\n return this.isDisabledMinute(date);\n }\n\n if (type === 'ampm') {\n return this.isDisabledAMPM(date);\n }\n\n return this.isDisabledTime(date);\n },\n handleSelect: function handleSelect(value, type) {\n var date = new Date(value);\n\n if (!this.isDisabled(value, type)) {\n this.innerValue = date;\n\n if (!this.isDisabledTime(date)) {\n this.$emit('select', date, type);\n }\n }\n },\n handleClickTitle: function handleClickTitle() {\n this.$emit('clicktitle');\n },\n getClasses: function getClasses(value, type) {\n var cellDate = new Date(value);\n\n if (this.isDisabled(value, type)) {\n return 'disabled';\n }\n\n if (cellDate.getTime() === this.innerValue.getTime()) {\n return 'active';\n }\n\n return '';\n }\n }\n};\n\n/* script */\nvar __vue_script__$8 = script$8;\n/* template */\n\nvar __vue_render__$b = function __vue_render__() {\n var _vm = this;\n\n var _h = _vm.$createElement;\n\n var _c = _vm._self._c || _h;\n\n return _c('div', {\n class: _vm.prefixClass + \"-time\"\n }, [_vm.showTimeHeader ? _c('div', {\n class: _vm.prefixClass + \"-time-header\"\n }, [_c('button', {\n class: _vm.prefixClass + \"-btn \" + _vm.prefixClass + \"-btn-text \" + _vm.prefixClass + \"-time-header-title\",\n attrs: {\n \"type\": \"button\"\n },\n on: {\n \"click\": _vm.handleClickTitle\n }\n }, [_vm._v(\"\\n \" + _vm._s(_vm.title) + \"\\n \")])]) : _vm._e(), _vm._v(\" \"), _c('div', {\n class: _vm.prefixClass + \"-time-content\"\n }, [_vm.timePickerOptions ? _c('list-options', {\n attrs: {\n \"date\": _vm.innerValue,\n \"get-classes\": _vm.getClasses,\n \"options\": _vm.timePickerOptions,\n \"format\": _vm.innerForamt\n },\n on: {\n \"select\": _vm.handleSelect\n }\n }) : _c('list-columns', _vm._b({\n attrs: {\n \"date\": _vm.innerValue,\n \"get-classes\": _vm.getClasses,\n \"hour-options\": _vm.hourOptions,\n \"minute-options\": _vm.minuteOptions,\n \"second-options\": _vm.secondOptions,\n \"hour-step\": _vm.hourStep,\n \"minute-step\": _vm.minuteStep,\n \"second-step\": _vm.secondStep,\n \"scroll-duration\": _vm.scrollDuration\n },\n on: {\n \"select\": _vm.handleSelect\n }\n }, 'list-columns', _vm.ShowHourMinuteSecondAMPM, false))], 1)]);\n};\n\nvar __vue_staticRenderFns__$b = [];\n/* style */\n\nvar __vue_inject_styles__$b = undefined;\n/* scoped */\n\nvar __vue_scope_id__$b = undefined;\n/* module identifier */\n\nvar __vue_module_identifier__$b = undefined;\n/* functional template */\n\nvar __vue_is_functional_template__$b = false;\n/* style inject */\n\n/* style inject SSR */\n\n/* style inject shadow dom */\n\nvar __vue_component__$b = normalizeComponent({\n render: __vue_render__$b,\n staticRenderFns: __vue_staticRenderFns__$b\n}, __vue_inject_styles__$b, __vue_script__$8, __vue_scope_id__$b, __vue_is_functional_template__$b, __vue_module_identifier__$b, false, undefined, undefined, undefined);\n\nvar TimeRange = {\n name: 'TimeRange',\n inject: {\n prefixClass: {\n default: 'mx'\n }\n },\n props: _objectSpread2({}, __vue_component__$b.props),\n data: function data() {\n return {\n startValue: new Date(NaN),\n endValue: new Date(NaN)\n };\n },\n watch: {\n value: {\n immediate: true,\n handler: function handler() {\n if (isValidRangeDate(this.value)) {\n var _this$value = _slicedToArray(this.value, 2),\n startValue = _this$value[0],\n endValue = _this$value[1];\n\n this.startValue = startValue;\n this.endValue = endValue;\n } else {\n this.startValue = new Date(NaN);\n this.endValue = new Date(NaN);\n }\n }\n }\n },\n methods: {\n emitChange: function emitChange(type, index) {\n var date = [this.startValue, this.endValue];\n this.$emit('select', date, type === 'time' ? 'time-range' : type, index);\n },\n handleSelectStart: function handleSelectStart(date, type) {\n this.startValue = date; // check the NaN\n\n if (!(this.endValue.getTime() >= date.getTime())) {\n this.endValue = date;\n }\n\n this.emitChange(type, 0);\n },\n handleSelectEnd: function handleSelectEnd(date, type) {\n // check the NaN\n this.endValue = date;\n\n if (!(this.startValue.getTime() <= date.getTime())) {\n this.startValue = date;\n }\n\n this.emitChange(type, 1);\n },\n disabledStartTime: function disabledStartTime(date) {\n return this.disabledTime(date, 0);\n },\n disabledEndTime: function disabledEndTime(date) {\n return date.getTime() < this.startValue.getTime() || this.disabledTime(date, 1);\n }\n },\n render: function render() {\n var h = arguments[0];\n var defaultValues = Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue, this.defaultValue];\n var prefixClass = this.prefixClass;\n return h(\"div\", {\n \"class\": \"\".concat(prefixClass, \"-range-wrapper\")\n }, [h(__vue_component__$b, {\n \"props\": _objectSpread2({}, _objectSpread2({}, this.$props, {\n value: this.startValue,\n defaultValue: defaultValues[0],\n disabledTime: this.disabledStartTime\n })),\n \"on\": _objectSpread2({}, _objectSpread2({}, this.$listeners, {\n select: this.handleSelectStart\n }))\n }), h(__vue_component__$b, {\n \"props\": _objectSpread2({}, _objectSpread2({}, this.$props, {\n value: this.endValue,\n defaultValue: defaultValues[1],\n disabledTime: this.disabledEndTime\n })),\n \"on\": _objectSpread2({}, _objectSpread2({}, this.$listeners, {\n select: this.handleSelectEnd\n }))\n })]);\n }\n};\n\nvar DatetimePanel = {\n name: 'DatetimePanel',\n inject: {\n prefixClass: {\n default: 'mx'\n }\n },\n emits: ['select', 'update:show-time-panel'],\n props: _objectSpread2({}, CalendarPanel.props, {}, __vue_component__$b.props, {\n showTimePanel: {\n type: Boolean,\n default: undefined\n }\n }),\n data: function data() {\n return {\n defaultTimeVisible: false,\n currentValue: this.value\n };\n },\n computed: {\n timeVisible: function timeVisible() {\n return typeof this.showTimePanel === 'boolean' ? this.showTimePanel : this.defaultTimeVisible;\n }\n },\n watch: {\n value: function value(val) {\n this.currentValue = val;\n }\n },\n methods: {\n closeTimePanel: function closeTimePanel() {\n this.defaultTimeVisible = false;\n this.$emit('update:show-time-panel', false);\n },\n openTimePanel: function openTimePanel() {\n this.defaultTimeVisible = true;\n this.$emit('update:show-time-panel', true);\n },\n emitDate: function emitDate(date, type) {\n this.$emit('select', date, type);\n },\n handleSelect: function handleSelect(date, type) {\n if (type === 'date') {\n this.openTimePanel();\n }\n\n var datetime = assignTime(date, getValidDate(this.value, this.defaultValue));\n\n if (this.disabledTime(new Date(datetime))) {\n // set the time of defalutValue;\n datetime = assignTime(date, this.defaultValue);\n\n if (this.disabledTime(new Date(datetime))) {\n // if disabled don't emit date\n this.currentValue = datetime;\n return;\n }\n }\n\n this.emitDate(datetime, type);\n }\n },\n render: function render() {\n var h = arguments[0];\n var calendarProps = {\n props: _objectSpread2({}, pick(this.$props, Object.keys(CalendarPanel.props)), {\n type: 'date',\n value: this.currentValue\n }),\n on: {\n select: this.handleSelect\n }\n };\n var timeProps = {\n props: _objectSpread2({}, pick(this.$props, Object.keys(__vue_component__$b.props)), {\n showTimeHeader: true,\n value: this.currentValue\n }),\n on: {\n select: this.emitDate,\n clicktitle: this.closeTimePanel\n }\n };\n var prefixClass = this.prefixClass;\n return h(\"div\", [h(CalendarPanel, helper([{}, calendarProps])), this.timeVisible && h(__vue_component__$b, helper([{\n \"class\": \"\".concat(prefixClass, \"-calendar-time\")\n }, timeProps]))]);\n }\n};\n\nvar DatetimeRange = {\n name: 'DatetimeRange',\n inject: {\n prefixClass: {\n default: 'mx'\n }\n },\n emits: ['select', 'update:show-time-panel'],\n props: _objectSpread2({}, CalendarRange.props, {}, TimeRange.props, {\n showTimePanel: {\n type: Boolean,\n default: undefined\n }\n }),\n data: function data() {\n return {\n defaultTimeVisible: false,\n currentValue: this.value\n };\n },\n computed: {\n timeVisible: function timeVisible() {\n return typeof this.showTimePanel === 'boolean' ? this.showTimePanel : this.defaultTimeVisible;\n }\n },\n watch: {\n value: function value(val) {\n this.currentValue = val;\n }\n },\n methods: {\n closeTimePanel: function closeTimePanel() {\n this.defaultTimeVisible = false;\n this.$emit('update:show-time-panel', false);\n },\n openTimePanel: function openTimePanel() {\n this.defaultTimeVisible = true;\n this.$emit('update:show-time-panel', true);\n },\n emitDate: function emitDate(dates, type) {\n this.$emit('select', dates, type);\n },\n handleSelect: function handleSelect(dates, type) {\n var _this = this;\n\n if (type === 'date') {\n this.openTimePanel();\n }\n\n var defaultValues = Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue, this.defaultValue];\n var datetimes = dates.map(function (date, i) {\n var time = isValidRangeDate(_this.value) ? _this.value[i] : defaultValues[i];\n return assignTime(date, time);\n });\n\n if (datetimes[1].getTime() < datetimes[0].getTime()) {\n datetimes = [datetimes[0], datetimes[0]];\n }\n\n if (datetimes.some(this.disabledTime)) {\n datetimes = dates.map(function (date, i) {\n return assignTime(date, defaultValues[i]);\n });\n\n if (datetimes.some(this.disabledTime)) {\n this.currentValue = datetimes;\n return;\n }\n }\n\n this.emitDate(datetimes, type);\n }\n },\n render: function render() {\n var h = arguments[0];\n var calendarProps = {\n props: _objectSpread2({}, pick(this.$props, Object.keys(CalendarRange.props)), {\n type: 'date',\n value: this.currentValue\n }),\n on: {\n select: this.handleSelect\n }\n };\n var timeProps = {\n props: _objectSpread2({}, pick(this.$props, Object.keys(TimeRange.props)), {\n value: this.currentValue,\n showTimeHeader: true\n }),\n on: {\n select: this.emitDate,\n clicktitle: this.closeTimePanel\n }\n };\n var prefixClass = this.prefixClass;\n return h(\"div\", [h(CalendarRange, helper([{}, calendarProps])), this.timeVisible && h(TimeRange, helper([{\n \"class\": \"\".concat(prefixClass, \"-calendar-time\")\n }, timeProps]))]);\n }\n};\n\nvar componentMap = {\n default: CalendarPanel,\n time: __vue_component__$b,\n datetime: DatetimePanel\n};\nvar componentRangeMap = {\n default: CalendarRange,\n time: TimeRange,\n datetime: DatetimeRange\n};\nvar DatePicker = {\n name: 'DatePicker',\n provide: function provide() {\n var _this = this;\n\n return {\n // make locale reactive\n getLocale: function getLocale() {\n return _this.locale;\n },\n getWeek: this.getWeek,\n prefixClass: this.prefixClass,\n dispatchDatePicker: this.$emit.bind(this)\n };\n },\n props: _objectSpread2({}, DatetimePanel.props, {\n value: {},\n valueType: {\n type: String,\n default: 'date' // date, format, timestamp, or token like 'YYYY-MM-DD'\n\n },\n type: {\n type: String,\n // ['date', 'datetime', 'time', 'year', 'month', 'week']\n default: 'date'\n },\n format: {\n type: String\n },\n formatter: {\n type: Object\n },\n range: {\n type: Boolean,\n default: false\n },\n multiple: {\n type: Boolean,\n default: false\n },\n rangeSeparator: {\n type: String\n },\n lang: {\n type: [String, Object]\n },\n placeholder: {\n type: String,\n default: ''\n },\n editable: {\n type: Boolean,\n default: true\n },\n disabled: {\n type: Boolean,\n default: false\n },\n clearable: {\n type: Boolean,\n default: true\n },\n prefixClass: {\n type: String,\n default: 'mx'\n },\n inputClass: {},\n inputAttr: {\n type: Object,\n default: function _default() {\n return {};\n }\n },\n appendToBody: {\n type: Boolean,\n default: true\n },\n open: {\n type: Boolean,\n default: undefined\n },\n popupClass: {},\n popupStyle: {\n type: Object,\n default: function _default() {\n return {};\n }\n },\n inline: {\n type: Boolean,\n default: false\n },\n confirm: {\n type: Boolean,\n default: false\n },\n confirmText: {\n type: String,\n default: 'OK'\n },\n renderInputText: {\n type: Function\n },\n shortcuts: {\n type: Array,\n validator: function validator(value) {\n return Array.isArray(value) && value.every(function (v) {\n return isObject(v) && typeof v.text === 'string' && typeof v.onClick === 'function';\n });\n },\n default: function _default() {\n return [];\n }\n }\n }),\n data: function data() {\n return {\n // cache the innervalue, wait to confirm\n currentValue: null,\n userInput: null,\n defaultOpen: false,\n mouseInInput: false\n };\n },\n computed: {\n popupVisible: function popupVisible() {\n return !this.disabled && (typeof this.open === 'boolean' ? this.open : this.defaultOpen);\n },\n innerRangeSeparator: function innerRangeSeparator() {\n return this.rangeSeparator || (this.multiple ? ',' : ' ~ ');\n },\n innerFormat: function innerFormat() {\n var map = {\n date: 'YYYY-MM-DD',\n datetime: 'YYYY-MM-DD HH:mm:ss',\n year: 'YYYY',\n month: 'YYYY-MM',\n time: 'HH:mm:ss',\n week: 'w'\n };\n return this.format || map[this.type] || map.date;\n },\n innerValue: function innerValue() {\n var value = this.value;\n\n if (this.validMultipleType) {\n value = Array.isArray(value) ? value : [];\n return value.map(this.value2date);\n }\n\n if (this.range) {\n value = Array.isArray(value) ? value.slice(0, 2) : [null, null];\n return value.map(this.value2date);\n }\n\n return this.value2date(value);\n },\n text: function text() {\n var _this2 = this;\n\n if (this.userInput !== null) {\n return this.userInput;\n }\n\n if (typeof this.renderInputText === 'function') {\n return this.renderInputText(this.innerValue);\n }\n\n if (!this.isValidValue(this.innerValue)) {\n return '';\n }\n\n if (Array.isArray(this.innerValue)) {\n return this.innerValue.map(function (v) {\n return _this2.formatDate(v);\n }).join(this.innerRangeSeparator);\n }\n\n return this.formatDate(this.innerValue);\n },\n showClearIcon: function showClearIcon() {\n return !this.disabled && this.clearable && this.text && this.mouseInInput;\n },\n locale: function locale() {\n if (isObject(this.lang)) {\n return mergeDeep(getLocale(), this.lang);\n }\n\n return getLocale(this.lang);\n },\n validMultipleType: function validMultipleType() {\n var types = ['date', 'month', 'year'];\n return this.multiple && !this.range && types.indexOf(this.type) !== -1;\n }\n },\n watch: {\n innerValue: {\n immediate: true,\n handler: function handler(val) {\n this.currentValue = val;\n }\n },\n popupVisible: {\n handler: function handler(val) {\n if (val) {\n this.currentValue = this.innerValue;\n }\n }\n }\n },\n created: function created() {\n if (_typeof(this.format) === 'object') {\n console.warn(\"[vue2-datepicker]: The prop `format` don't support Object any more. You can use the new prop `formatter` to replace it\");\n }\n },\n methods: {\n handleMouseEnter: function handleMouseEnter() {\n this.mouseInInput = true;\n },\n handleMouseLeave: function handleMouseLeave() {\n this.mouseInInput = false;\n },\n handleClickOutSide: function handleClickOutSide(evt) {\n var target = evt.target;\n\n if (!this.$el.contains(target)) {\n this.closePopup();\n }\n },\n getFormatter: function getFormatter(key) {\n return isObject(this.formatter) && this.formatter[key] || isObject(this.format) && this.format[key];\n },\n getWeek: function getWeek$1(date, options) {\n if (typeof this.getFormatter('getWeek') === 'function') {\n return this.getFormatter('getWeek')(date, options);\n }\n\n return getWeek(date, options);\n },\n parseDate: function parseDate(value, fmt) {\n fmt = fmt || this.innerFormat;\n\n if (typeof this.getFormatter('parse') === 'function') {\n return this.getFormatter('parse')(value, fmt);\n }\n\n var backupDate = new Date();\n return parse(value, fmt, {\n locale: this.locale.formatLocale,\n backupDate: backupDate\n });\n },\n formatDate: function formatDate(date, fmt) {\n fmt = fmt || this.innerFormat;\n\n if (typeof this.getFormatter('stringify') === 'function') {\n return this.getFormatter('stringify')(date, fmt);\n }\n\n return format(date, fmt, {\n locale: this.locale.formatLocale\n });\n },\n // transform the outer value to inner date\n value2date: function value2date(value) {\n switch (this.valueType) {\n case 'date':\n return value instanceof Date ? new Date(value.getTime()) : new Date(NaN);\n\n case 'timestamp':\n return typeof value === 'number' ? new Date(value) : new Date(NaN);\n\n case 'format':\n return typeof value === 'string' ? this.parseDate(value) : new Date(NaN);\n\n default:\n return typeof value === 'string' ? this.parseDate(value, this.valueType) : new Date(NaN);\n }\n },\n // transform the inner date to outer value\n date2value: function date2value(date) {\n if (!isValidDate(date)) return null;\n\n switch (this.valueType) {\n case 'date':\n return date;\n\n case 'timestamp':\n return date.getTime();\n\n case 'format':\n return this.formatDate(date);\n\n default:\n return this.formatDate(date, this.valueType);\n }\n },\n emitValue: function emitValue(date, type) {\n var close = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n // fix IE11/10 trigger input event when input is focused. (placeholder !== '')\n this.userInput = null;\n var value = Array.isArray(date) ? date.map(this.date2value) : this.date2value(date);\n this.$emit('input', value);\n this.$emit('change', value, type);\n\n if (close) {\n this.closePopup();\n }\n\n return value;\n },\n isValidValue: function isValidValue(value) {\n if (this.validMultipleType) {\n return isValidDates(value);\n }\n\n if (this.range) {\n return isValidRangeDate(value);\n }\n\n return isValidDate(value);\n },\n isValidValueAndNotDisabled: function isValidValueAndNotDisabled(value) {\n if (!this.isValidValue(value)) {\n return false;\n }\n\n var disabledDate = typeof this.disabledDate === 'function' ? this.disabledDate : function () {\n return false;\n };\n var disabledTime = typeof this.disabledTime === 'function' ? this.disabledTime : function () {\n return false;\n };\n\n if (!Array.isArray(value)) {\n value = [value];\n }\n\n return value.every(function (v) {\n return !disabledDate(v) && !disabledTime(v);\n });\n },\n handleMultipleDates: function handleMultipleDates(date, dates) {\n if (this.validMultipleType && dates) {\n var nextDates = dates.filter(function (v) {\n return v.getTime() !== date.getTime();\n });\n\n if (nextDates.length === dates.length) {\n nextDates.push(date);\n }\n\n return nextDates;\n }\n\n return date;\n },\n handleSelectDate: function handleSelectDate(val, type, dates) {\n val = this.handleMultipleDates(val, dates);\n\n if (this.confirm) {\n this.currentValue = val;\n } else {\n this.emitValue(val, type, // this.type === 'datetime', click the time should close popup\n !this.validMultipleType && (type === this.type || type === 'time'));\n }\n },\n clear: function clear() {\n this.emitValue(this.range ? [null, null] : null);\n this.$emit('clear');\n },\n handleClear: function handleClear(evt) {\n evt.stopPropagation();\n this.clear();\n },\n handleConfirmDate: function handleConfirmDate() {\n var value = this.emitValue(this.currentValue);\n this.$emit('confirm', value);\n },\n handleSelectShortcut: function handleSelectShortcut(evt) {\n var index = evt.currentTarget.getAttribute('data-index');\n var item = this.shortcuts[parseInt(index, 10)];\n\n if (isObject(item) && typeof item.onClick === 'function') {\n var date = item.onClick(this);\n\n if (date) {\n this.emitValue(date);\n }\n }\n },\n openPopup: function openPopup(evt) {\n if (this.popupVisible || this.disabled) return;\n this.defaultOpen = true;\n this.$emit('open', evt);\n this.$emit('update:open', true);\n },\n closePopup: function closePopup() {\n if (!this.popupVisible) return;\n this.defaultOpen = false;\n this.$emit('close');\n this.$emit('update:open', false);\n },\n blur: function blur() {\n // when use slot input\n if (this.$refs.input) {\n this.$refs.input.blur();\n }\n },\n focus: function focus() {\n if (this.$refs.input) {\n this.$refs.input.focus();\n }\n },\n handleInputChange: function handleInputChange() {\n var _this3 = this;\n\n if (!this.editable || this.userInput === null) return;\n var text = this.userInput.trim();\n this.userInput = null;\n\n if (text === '') {\n this.clear();\n return;\n }\n\n var date;\n\n if (this.validMultipleType) {\n date = text.split(this.innerRangeSeparator).map(function (v) {\n return _this3.parseDate(v.trim());\n });\n } else if (this.range) {\n var arr = text.split(this.innerRangeSeparator);\n\n if (arr.length !== 2) {\n // Maybe the separator during the day is the same as the separator for the date\n // eg: 2019-10-09-2020-01-02\n arr = text.split(this.innerRangeSeparator.trim());\n }\n\n date = arr.map(function (v) {\n return _this3.parseDate(v.trim());\n });\n } else {\n date = this.parseDate(text);\n }\n\n if (this.isValidValueAndNotDisabled(date)) {\n this.emitValue(date);\n this.blur();\n } else {\n this.$emit('input-error', text);\n }\n },\n handleInputInput: function handleInputInput(evt) {\n // slot input v-model\n this.userInput = typeof evt === 'string' ? evt : evt.target.value;\n },\n handleInputKeydown: function handleInputKeydown(evt) {\n var keyCode = evt.keyCode; // Tab 9 or Enter 13\n\n if (keyCode === 9) {\n this.closePopup();\n } else if (keyCode === 13) {\n this.handleInputChange();\n }\n },\n handleInputBlur: function handleInputBlur(evt) {\n // tab close\n this.$emit('blur', evt);\n },\n handleInputFocus: function handleInputFocus(evt) {\n this.openPopup(evt);\n this.$emit('focus', evt);\n },\n hasSlot: function hasSlot(name) {\n return !!(this.$slots[name] || this.$scopedSlots[name]);\n },\n renderSlot: function renderSlot(name, fallback, props) {\n var slotFn = this.$scopedSlots[name];\n\n if (slotFn) {\n return slotFn(props) || fallback;\n }\n\n return this.$slots[name] || fallback;\n },\n renderInput: function renderInput() {\n var h = this.$createElement;\n var prefixClass = this.prefixClass;\n\n var props = _objectSpread2({\n name: 'date',\n type: 'text',\n autocomplete: 'off',\n value: this.text,\n class: this.inputClass || \"\".concat(this.prefixClass, \"-input\"),\n readonly: !this.editable,\n disabled: this.disabled,\n placeholder: this.placeholder\n }, this.inputAttr);\n\n var value = props.value,\n className = props.class,\n attrs = _objectWithoutProperties(props, [\"value\", \"class\"]);\n\n var events = {\n keydown: this.handleInputKeydown,\n focus: this.handleInputFocus,\n blur: this.handleInputBlur,\n input: this.handleInputInput,\n change: this.handleInputChange\n };\n var input = this.renderSlot('input', h(\"input\", {\n \"domProps\": {\n \"value\": value\n },\n \"class\": className,\n \"attrs\": _objectSpread2({}, attrs),\n \"on\": _objectSpread2({}, events),\n \"ref\": \"input\"\n }), {\n props: props,\n events: events\n });\n var calendarIcon = this.type === 'time' ? h(__vue_component__$2) : h(__vue_component__$1); // remove touchstart event to avoid opens the popup while scrolling in mobile #469\n\n return h(\"div\", {\n \"class\": \"\".concat(prefixClass, \"-input-wrapper\"),\n \"on\": {\n \"mouseenter\": this.handleMouseEnter,\n \"mouseleave\": this.handleMouseLeave,\n \"click\": this.openPopup\n },\n \"ref\": \"inputWrapper\"\n }, [input, this.showClearIcon ? h(\"i\", {\n \"class\": \"\".concat(prefixClass, \"-icon-clear\"),\n \"on\": {\n \"click\": this.handleClear\n }\n }, [this.renderSlot('icon-clear', h(__vue_component__$3))]) : h(\"i\", {\n \"class\": \"\".concat(prefixClass, \"-icon-calendar\")\n }, [this.renderSlot('icon-calendar', calendarIcon)])]);\n },\n renderContent: function renderContent() {\n var h = this.$createElement;\n var map = this.range ? componentRangeMap : componentMap;\n var Component = map[this.type] || map.default;\n\n var props = _objectSpread2({}, pick(this.$props, Object.keys(Component.props)), {\n value: this.currentValue\n });\n\n var on = _objectSpread2({}, pick(this.$listeners, Component.emits || []), {\n select: this.handleSelectDate\n });\n\n var content = h(Component, helper([{}, {\n props: props,\n on: on,\n ref: 'picker'\n }]));\n return h(\"div\", {\n \"class\": \"\".concat(this.prefixClass, \"-datepicker-body\")\n }, [this.renderSlot('content', content, {\n value: this.currentValue,\n emit: this.handleSelectDate\n })]);\n },\n renderSidebar: function renderSidebar() {\n var _this4 = this;\n\n var h = this.$createElement;\n var prefixClass = this.prefixClass;\n return h(\"div\", {\n \"class\": \"\".concat(prefixClass, \"-datepicker-sidebar\")\n }, [this.renderSlot('sidebar', null, {\n value: this.currentValue,\n emit: this.handleSelectDate\n }), this.shortcuts.map(function (v, i) {\n return h(\"button\", {\n \"key\": i,\n \"attrs\": {\n \"data-index\": i,\n \"type\": \"button\"\n },\n \"class\": \"\".concat(prefixClass, \"-btn \").concat(prefixClass, \"-btn-text \").concat(prefixClass, \"-btn-shortcut\"),\n \"on\": {\n \"click\": _this4.handleSelectShortcut\n }\n }, [v.text]);\n })]);\n },\n renderHeader: function renderHeader() {\n var h = this.$createElement;\n return h(\"div\", {\n \"class\": \"\".concat(this.prefixClass, \"-datepicker-header\")\n }, [this.renderSlot('header', null, {\n value: this.currentValue,\n emit: this.handleSelectDate\n })]);\n },\n renderFooter: function renderFooter() {\n var h = this.$createElement;\n var prefixClass = this.prefixClass;\n return h(\"div\", {\n \"class\": \"\".concat(prefixClass, \"-datepicker-footer\")\n }, [this.renderSlot('footer', null, {\n value: this.currentValue,\n emit: this.handleSelectDate\n }), this.confirm ? h(\"button\", {\n \"attrs\": {\n \"type\": \"button\"\n },\n \"class\": \"\".concat(prefixClass, \"-btn \").concat(prefixClass, \"-datepicker-btn-confirm\"),\n \"on\": {\n \"click\": this.handleConfirmDate\n }\n }, [this.confirmText]) : null]);\n }\n },\n render: function render() {\n var _class;\n\n var h = arguments[0];\n var prefixClass = this.prefixClass,\n inline = this.inline,\n disabled = this.disabled;\n var sidedar = this.hasSlot('sidebar') || this.shortcuts.length ? this.renderSidebar() : null;\n var content = h(\"div\", {\n \"class\": \"\".concat(prefixClass, \"-datepicker-content\")\n }, [this.hasSlot('header') ? this.renderHeader() : null, this.renderContent(), this.hasSlot('footer') || this.confirm ? this.renderFooter() : null]);\n return h(\"div\", {\n \"class\": (_class = {}, _defineProperty(_class, \"\".concat(prefixClass, \"-datepicker\"), true), _defineProperty(_class, \"\".concat(prefixClass, \"-datepicker-range\"), this.range), _defineProperty(_class, \"\".concat(prefixClass, \"-datepicker-inline\"), inline), _defineProperty(_class, \"disabled\", disabled), _class)\n }, [!inline ? this.renderInput() : null, !inline ? h(__vue_component__, {\n \"ref\": \"popup\",\n \"class\": this.popupClass,\n \"style\": this.popupStyle,\n \"attrs\": {\n \"visible\": this.popupVisible,\n \"appendToBody\": this.appendToBody\n },\n \"on\": {\n \"clickoutside\": this.handleClickOutSide\n }\n }, [sidedar, content]) : h(\"div\", {\n \"class\": \"\".concat(prefixClass, \"-datepicker-main\")\n }, [sidedar, content])]);\n }\n};\n\nDatePicker.locale = locale;\n\nDatePicker.install = function install(Vue) {\n Vue.component(DatePicker.name, DatePicker);\n};\n\nif (typeof window !== 'undefined' && window.Vue) {\n DatePicker.install(window.Vue);\n}\n\n_extends(DatePicker, {\n CalendarPanel: CalendarPanel,\n CalendarRange: CalendarRange,\n TimePanel: __vue_component__$b,\n TimeRange: TimeRange,\n DatetimePanel: DatetimePanel,\n DatetimeRange: DatetimeRange\n});\n\nexport default DatePicker;\n","import '../assets/NcDateTimePicker-BshzbbKT.css';\nimport { r as register, H as t36, a as t } from \"../chunks/_l10n-B4dEPXsr.mjs\";\nimport { G as GenRandomId } from \"../chunks/GenRandomId-CMooMQt0.mjs\";\nimport { N as NcTimezonePicker } from \"../chunks/NcTimezonePicker-DdVLB1Bv.mjs\";\nimport { N as NcPopover } from \"../chunks/NcPopover-DbeCmze0.mjs\";\nimport { n as normalizeComponent } from \"../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nimport { getMonthNames, getMonthNamesShort, getDayNames, getDayNamesShort, getDayNamesMin, getFirstDay } from \"@nextcloud/l10n\";\nimport DatePicker from \"vue2-datepicker\";\nimport { S as ScopeComponent } from \"../chunks/ScopeComponent-_wrdOOmW.mjs\";\nregister(t36);\nconst _sfc_main$2 = {\n name: \"CalendarBlankIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$2 = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon calendar-blank-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$2 = [];\nvar __component__$2 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$2,\n _sfc_render$2,\n _sfc_staticRenderFns$2,\n false,\n null,\n null\n);\nconst CalendarBlank = __component__$2.exports;\nconst _sfc_main$1 = {\n name: \"WebIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$1 = function render2() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon web-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,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,2Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$1 = [];\nvar __component__$1 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$1,\n _sfc_render$1,\n _sfc_staticRenderFns$1,\n false,\n null,\n null\n);\nconst Web = __component__$1.exports;\nconst formatMap = {\n date: \"YYYY-MM-DD\",\n datetime: \"YYYY-MM-DD H:mm:ss\",\n year: \"YYYY\",\n month: \"YYYY-MM\",\n time: \"H:mm:ss\",\n week: \"w\"\n};\nconst _sfc_main = {\n name: \"NcDateTimePicker\",\n components: {\n CalendarBlank,\n DatePicker,\n NcPopover,\n NcTimezonePicker,\n Web\n },\n inheritAttrs: false,\n props: {\n clearable: {\n type: Boolean,\n default: false\n },\n minuteStep: {\n type: Number,\n default: 10\n },\n type: {\n type: String,\n default: \"date\"\n },\n format: {\n type: String,\n default: null\n },\n formatter: {\n type: Object,\n default: null\n },\n lang: {\n type: Object,\n default: null\n },\n /**\n * The value to initialize, but also two-way bind the selected date. The date is – like the `Date` object in\n * JavaScript – tied to UTC. The selected time zone does not have an influence of the selected time and date\n * value. You have to translate the time yourself when you want to factor in time zones.\n */\n // eslint-disable-next-line\n value: {\n default: () => /* @__PURE__ */ new Date()\n },\n /**\n * The preselected IANA time zone ID for the time zone picker, only relevant in combination with `:show-timezone-select=\"true\"`. Example: `Europe/Berlin`. The prop supports two-way binding through the .sync modifier.\n */\n timezoneId: {\n type: String,\n default: \"UTC\"\n },\n showTimezoneSelect: {\n type: Boolean,\n default: false\n },\n highlightTimezone: {\n type: Boolean,\n default: false\n },\n appendToBody: {\n type: Boolean,\n default: false\n },\n showWeekNumber: {\n type: Boolean,\n default: false\n },\n placeholder: {\n type: String,\n default: null\n }\n },\n emits: [\n \"update:value\",\n \"update:timezone-id\"\n ],\n setup() {\n return {\n timezoneDialogHeaderId: \"timezone-dialog-header-\".concat(GenRandomId())\n };\n },\n data() {\n return {\n showTimezonePopover: false,\n tzVal: this.timezoneId\n };\n },\n computed: {\n /**\n * Datepicker language\n * https://github.com/mengxiong10/vue2-datepicker/blob/master/locale.md\n *\n * @return {object}\n */\n defaultLang() {\n return {\n formatLocale: {\n months: getMonthNames(),\n monthsShort: getMonthNamesShort(),\n weekdays: getDayNames(),\n weekdaysShort: getDayNamesShort(),\n weekdaysMin: getDayNamesMin(),\n // 0 = sunday, 1 = monday\n firstDayOfWeek: getFirstDay()\n },\n monthFormat: \"MMM\"\n };\n },\n /**\n * Translated placeholder\n *\n * @return {string}\n */\n defaultPlaceholder() {\n if (this.type === \"time\") {\n return t(\"Pick a time\");\n }\n if (this.type === \"month\") {\n return t(\"Pick a month\");\n }\n if (this.type === \"year\") {\n return t(\"Pick a year\");\n }\n if (this.type === \"week\") {\n return t(\"Pick a week\");\n }\n if (this.type === \"date\") {\n return t(\"Pick a date\");\n }\n return t(\"Pick a date and a time\");\n },\n /**\n * If format is not provided, try to match the type\n * or fallback to 'date'\n *\n * @return {string}\n */\n formatTypeMap() {\n var _a;\n return (_a = formatMap[this.type]) != null ? _a : formatMap.date;\n },\n /**\n * The formatter used for the vue-datepicker to fix nextcloud-libraries/nextcloud-vue#5044\n */\n internalFormatter() {\n var _a;\n const getWeek = (date) => {\n const firstThursday = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));\n firstThursday.setUTCDate(firstThursday.getUTCDate() + 4 - (firstThursday.getUTCDay() || 7));\n const yearStart = new Date(Date.UTC(firstThursday.getUTCFullYear(), 0, 1));\n return Math.ceil(((firstThursday - yearStart) / 864e5 + 1) / 7);\n };\n return {\n getWeek,\n // allow to override it by users using the `formatter` prop\n ...(_a = this.formatter) != null ? _a : {}\n };\n }\n },\n methods: {\n t,\n handleSelectYear(year) {\n const value = this.$refs.datepicker.currentValue;\n if (value) {\n try {\n const date = new Date(new Date(value).setFullYear(year));\n this.$refs.datepicker.selectDate(date);\n } catch (error) {\n console.error(\"Invalid value\", value, year);\n }\n }\n },\n handleSelectMonth(month) {\n const value = this.$refs.datepicker.currentValue;\n if (value) {\n try {\n const date = new Date(new Date(value).setMonth(month));\n this.$refs.datepicker.selectDate(date);\n } catch (error) {\n console.error(\"Invalid value\", value, month);\n }\n }\n },\n /**\n * Toggles the visibility of the time zone popover\n */\n toggleTimezonePopover() {\n if (!this.showTimezoneSelect) {\n return;\n }\n this.showTimezonePopover = !this.showTimezonePopover;\n }\n }\n};\nvar _sfc_render = function render3() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"DatePicker\", _vm._g(_vm._b({ ref: \"datepicker\", attrs: { \"append-to-body\": _vm.appendToBody, \"clearable\": _vm.clearable, \"format\": _vm.format ? _vm.format : _vm.formatTypeMap, \"formatter\": _vm.internalFormatter, \"lang\": _vm.lang ? _vm.lang : _vm.defaultLang, \"minute-step\": _vm.minuteStep, \"placeholder\": _vm.placeholder ? _vm.placeholder : _vm.defaultPlaceholder, \"popup-class\": { \"show-week-number\": _vm.showWeekNumber }, \"show-week-number\": _vm.showWeekNumber, \"type\": _vm.type, \"value\": _vm.value }, on: { \"select-year\": _vm.handleSelectYear, \"select-month\": _vm.handleSelectMonth, \"update:value\": function($event) {\n return _vm.$emit(\"update:value\", _vm.value);\n } }, scopedSlots: _vm._u([{ key: \"icon-calendar\", fn: function() {\n return [_vm.showTimezoneSelect ? _c(\"NcPopover\", { attrs: { \"popup-role\": \"dialog\", \"shown\": _vm.showTimezonePopover, \"popover-base-class\": \"timezone-select__popper\" }, on: { \"update:shown\": function($event) {\n _vm.showTimezonePopover = $event;\n } }, scopedSlots: _vm._u([{ key: \"trigger\", fn: function({ attrs }) {\n return [_c(\"button\", _vm._b({ staticClass: \"datetime-picker-inline-icon\", class: { \"datetime-picker-inline-icon--highlighted\": _vm.highlightTimezone }, on: { \"mousedown\": function($event) {\n $event.stopPropagation();\n $event.preventDefault();\n return (() => {\n }).apply(null, arguments);\n } } }, \"button\", attrs, false), [_c(\"Web\", { attrs: { \"size\": 20 } })], 1)];\n } }], null, false, 270852355) }, [_c(\"div\", { attrs: { \"role\": \"dialog\", \"aria-labelledby\": _vm.timezoneDialogHeaderId } }, [_c(\"div\", { staticClass: \"timezone-popover-wrapper__label\" }, [_c(\"strong\", { attrs: { \"id\": _vm.timezoneDialogHeaderId } }, [_vm._v(\" \" + _vm._s(_vm.t(\"Please select a time zone:\")) + \" \")])]), _c(\"NcTimezonePicker\", { staticClass: \"timezone-popover-wrapper__timezone-select\", on: { \"input\": function($event) {\n return _vm.$emit(\"update:timezone-id\", arguments[0]);\n } }, model: { value: _vm.tzVal, callback: function($$v) {\n _vm.tzVal = $$v;\n }, expression: \"tzVal\" } })], 1)]) : _c(\"CalendarBlank\", { attrs: { \"size\": 20 } })];\n }, proxy: true }, _vm._l(_vm.$scopedSlots, function(_, slot) {\n return { key: slot, fn: function(scope) {\n return [_vm._t(slot, null, null, scope)];\n } };\n })], null, true) }, \"DatePicker\", _vm.$attrs, false), _vm.$listeners));\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"4727c294\"\n);\nconst NcDateTimePicker = __component__.exports;\nScopeComponent(NcDateTimePicker);\nexport {\n NcDateTimePicker as default\n};\n","import '../assets/NcDateTimePickerNative-BAcKr0B3.css';\nimport { n as normalizeComponent } from \"../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nimport { S as ScopeComponent } from \"../chunks/ScopeComponent-_wrdOOmW.mjs\";\nconst inputDateTypes = [\"date\", \"datetime-local\", \"month\", \"time\", \"week\"];\nconst _sfc_main = {\n name: \"NcDateTimePickerNative\",\n inheritAttrs: false,\n props: {\n /**\n * The date is – like the `Date` object in JavaScript – tied to UTC.\n * The selected time zone does not have an influence of the selected time and date value.\n * You have to translate the time yourself when you want to factor in time zones.\n * Pass null to clear the input field.\n */\n value: {\n type: Date,\n default: null\n },\n /**\n * id attribute of the input field\n */\n id: {\n type: String,\n required: true\n },\n /**\n * type attribute of the input field\n * default type: String\n * The type of the input element, it can be `date`, `datetime-local`, `month`, `time`, `week`\n */\n type: {\n type: String,\n default: \"date\",\n validate: (name) => inputDateTypes.includes(name)\n },\n /**\n * text inside the label element\n * default type: String\n */\n label: {\n type: String,\n default: \"Please choose a date\"\n },\n /**\n * min attribute of the input field\n * default type: null\n */\n min: {\n type: [Date, Boolean],\n default: null\n },\n /**\n * max attribute of the input field\n * default type: null\n */\n max: {\n type: [Date, Boolean],\n default: null\n },\n /**\n * Flag to hide the label\n * default type: String\n * The hidden input label for accessibility purposes.\n */\n hideLabel: {\n type: Boolean,\n default: false\n },\n /**\n * Class to add to the input field.\n * Necessary to use NcDateTimePickerNative in the NcActionInput component.\n */\n inputClass: {\n type: [Object, String],\n default: \"\"\n }\n },\n emits: [\n \"input\"\n ],\n computed: {\n formattedValue() {\n return this.formatValue(this.value);\n },\n formattedMin() {\n if (this.min) {\n return this.formatValue(this.min);\n }\n return false;\n },\n formattedMax() {\n if (this.max) {\n return this.formatValue(this.max);\n }\n return false;\n },\n listeners() {\n return {\n ...this.$listeners,\n /**\n * Handle the input event\n *\n * @param {InputEvent} $event input event payload\n * @return {Date|string} new chosen Date() or an empty string\n */\n input: ($event) => {\n if (isNaN($event.target.valueAsNumber)) {\n return this.$emit(\"input\", null);\n }\n if (this.type === \"time\") {\n const time = $event.target.value;\n if (this.value === \"\") {\n const { yyyy: yyyy2, MM: MM2, dd: dd2 } = this.getReadableDate(/* @__PURE__ */ new Date());\n return this.$emit(\"input\", new Date(\"\".concat(yyyy2, \"-\").concat(MM2, \"-\").concat(dd2, \"T\").concat(time)));\n }\n const { yyyy, MM, dd } = this.getReadableDate(this.value);\n return this.$emit(\"input\", new Date(\"\".concat(yyyy, \"-\").concat(MM, \"-\").concat(dd, \"T\").concat(time)));\n } else if (this.type === \"month\") {\n const MM = (new Date($event.target.value).getMonth() + 1).toString().padStart(2, \"0\");\n if (this.value === \"\") {\n const { yyyy: yyyy2, dd: dd2, hh: hh2, mm: mm2 } = this.getReadableDate(/* @__PURE__ */ new Date());\n return this.$emit(\"input\", new Date(\"\".concat(yyyy2, \"-\").concat(MM, \"-\").concat(dd2, \"T\").concat(hh2, \":\").concat(mm2)));\n }\n const { yyyy, dd, hh, mm } = this.getReadableDate(this.value);\n return this.$emit(\"input\", new Date(\"\".concat(yyyy, \"-\").concat(MM, \"-\").concat(dd, \"T\").concat(hh, \":\").concat(mm)));\n }\n const timezoneOffsetSeconds = new Date($event.target.valueAsNumber).getTimezoneOffset() * 1e3 * 60;\n const inputDateWithTimezone = $event.target.valueAsNumber + timezoneOffsetSeconds;\n return this.$emit(\"input\", new Date(inputDateWithTimezone));\n }\n };\n }\n },\n methods: {\n /**\n * Returns Object with string values of a Date\n *\n * @param {Date} value The selected value\n * @return {object|undefined}\n */\n getReadableDate(value) {\n if (value instanceof Date) {\n const yyyy = value.getFullYear().toString().padStart(4, \"0\");\n const MM = (value.getMonth() + 1).toString().padStart(2, \"0\");\n const dd = value.getDate().toString().padStart(2, \"0\");\n const hh = value.getHours().toString().padStart(2, \"0\");\n const mm = value.getMinutes().toString().padStart(2, \"0\");\n return { yyyy, MM, dd, hh, mm };\n }\n },\n /**\n * Returns preformatted value for the input field\n *\n * @param {Date} value The selected value\n * @return {string|undefined}\n */\n formatValue(value) {\n if (value instanceof Date) {\n const { yyyy, MM, dd, hh, mm } = this.getReadableDate(value);\n if (this.type === \"datetime-local\") {\n return \"\".concat(yyyy, \"-\").concat(MM, \"-\").concat(dd, \"T\").concat(hh, \":\").concat(mm);\n } else if (this.type === \"date\") {\n return \"\".concat(yyyy, \"-\").concat(MM, \"-\").concat(dd);\n } else if (this.type === \"month\") {\n return \"\".concat(yyyy, \"-\").concat(MM);\n } else if (this.type === \"time\") {\n return \"\".concat(hh, \":\").concat(mm);\n } else if (this.type === \"week\") {\n const startDate = new Date(yyyy, 0, 1);\n const daysSinceBeginningOfYear = Math.floor((value - startDate) / (24 * 60 * 60 * 1e3));\n const weekNumber = Math.ceil(daysSinceBeginningOfYear / 7);\n return \"\".concat(yyyy, \"-W\").concat(weekNumber);\n }\n } else {\n return \"\";\n }\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"div\", { staticClass: \"native-datetime-picker\" }, [_c(\"label\", { class: { \"hidden-visually\": _vm.hideLabel }, attrs: { \"for\": _vm.id } }, [_vm._v(_vm._s(_vm.label))]), _c(\"input\", _vm._g(_vm._b({ staticClass: \"native-datetime-picker--input\", class: _vm.inputClass, attrs: { \"id\": _vm.id, \"type\": _vm.type, \"min\": _vm.formattedMin, \"max\": _vm.formattedMax }, domProps: { \"value\": _vm.formattedValue } }, \"input\", _vm.$attrs, false), _vm.listeners))]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"fbe2ff4a\"\n);\nconst NcDateTimePickerNative = __component__.exports;\nScopeComponent(NcDateTimePickerNative);\nexport {\n NcDateTimePickerNative as default\n};\n","import { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n name: \"AlertCircleOutlineIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon alert-circle-outline-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"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\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n null\n);\nconst AlertCircle = __component__.exports;\nexport {\n AlertCircle as A\n};\n","import '../assets/NcInputField-CQc5dRbY.css';\nimport NcButton from \"./NcButton.mjs\";\nimport { G as GenRandomId } from \"../chunks/GenRandomId-CMooMQt0.mjs\";\nimport { A as AlertCircle } from \"../chunks/AlertCircleOutline-DU3QwU5Y.mjs\";\nimport { C as Check } from \"../chunks/Check-XHAzUBkX.mjs\";\nimport { n as normalizeComponent } from \"../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n name: \"NcInputField\",\n components: {\n NcButton,\n AlertCircle,\n Check\n },\n inheritAttrs: false,\n props: {\n /**\n * The value of the input field\n * If type is 'number' and a number is passed as value than the type of `update:value` will also be 'number'\n */\n value: {\n type: [String, Number],\n required: true\n },\n /**\n * The type of the input element\n */\n type: {\n type: String,\n default: \"text\",\n validator: (value) => [\n \"text\",\n \"password\",\n \"email\",\n \"tel\",\n \"url\",\n \"search\",\n \"number\"\n ].includes(value)\n },\n /**\n * The input label, always provide one for accessibility purposes.\n * This will also be used as a placeholder unless the placeholder\n * prop is populated with a different string.\n *\n * Note: If the background color is not `--color-main-background` consider using an external label instead (see `labelOutside`).\n */\n label: {\n type: String,\n default: void 0\n },\n /**\n * Pass in true if you want to use an external label. This is useful\n * if you need a label that looks different from the one provided by\n * this component\n */\n labelOutside: {\n type: Boolean,\n default: false\n },\n /**\n * The placeholder of the input. This defaults as the string that's\n * passed into the label prop. In order to remove the placeholder,\n * pass in an empty string.\n */\n placeholder: {\n type: String,\n default: void 0\n },\n /**\n * Controls whether to display the trailing button.\n */\n showTrailingButton: {\n type: Boolean,\n default: false\n },\n /**\n * Label of the trailing button\n *\n * Required when showTrailingButton is set\n */\n trailingButtonLabel: {\n type: String,\n default: \"\"\n },\n /**\n * Toggles the success state of the component. Adds a checkmark icon.\n * this cannot be used together with canClear.\n */\n success: {\n type: Boolean,\n default: false\n },\n /**\n * Toggles the error state of the component. Adds an error icon.\n * this cannot be used together with canClear.\n */\n error: {\n type: Boolean,\n default: false\n },\n /**\n * Additional helper text message\n *\n * This will be displayed beneath the input field. In case the field is\n * also marked as having an error, the text will be displayed in red.\n */\n helperText: {\n type: String,\n default: \"\"\n },\n /**\n * Disable the input field\n */\n disabled: {\n type: Boolean,\n default: false\n },\n /**\n * Specifies whether the input should have a pill form.\n * By default, input has rounded corners.\n */\n pill: {\n type: Boolean,\n default: false\n },\n /**\n * Class to add to the input field.\n * Necessary to use NcInputField in the NcActionInput component.\n */\n inputClass: {\n type: [Object, String],\n default: \"\"\n }\n },\n emits: [\n \"update:value\",\n \"trailing-button-click\"\n ],\n computed: {\n computedId() {\n return this.$attrs.id && this.$attrs.id !== \"\" ? this.$attrs.id : this.inputName;\n },\n inputName() {\n return \"input\" + GenRandomId();\n },\n hasLeadingIcon() {\n return this.$slots.default;\n },\n hasTrailingIcon() {\n return this.success;\n },\n hasPlaceholder() {\n return this.placeholder !== \"\" && this.placeholder !== void 0;\n },\n computedPlaceholder() {\n return this.hasPlaceholder ? this.placeholder : this.label;\n },\n isValidLabel() {\n const isValidLabel = this.label || this.labelOutside;\n if (!isValidLabel) {\n console.warn(\"You need to add a label to the NcInputField component. Either use the prop label or use an external one, as per the example in the documentation.\");\n }\n return isValidLabel;\n },\n ariaDescribedby() {\n const ariaDescribedby = [];\n if (this.helperText.length > 0) {\n ariaDescribedby.push(\"\".concat(this.inputName, \"-helper-text\"));\n }\n if (this.$attrs[\"aria-describedby\"]) {\n ariaDescribedby.push(this.$attrs[\"aria-describedby\"]);\n }\n return ariaDescribedby.join(\" \") || null;\n }\n },\n methods: {\n /**\n * Focus the input element\n *\n * @public\n */\n focus() {\n this.$refs.input.focus();\n },\n /**\n * Select all the text in the input\n *\n * @public\n */\n select() {\n this.$refs.input.select();\n },\n handleInput(event) {\n this.$emit(\"update:value\", this.type === \"number\" && typeof this.value === \"number\" ? parseFloat(event.target.value, 10) : event.target.value);\n },\n handleTrailingButtonClick(event) {\n this.$emit(\"trailing-button-click\", event);\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"div\", { staticClass: \"input-field\", class: {\n \"input-field--disabled\": _vm.disabled,\n \"input-field--label-outside\": _vm.labelOutside || !_vm.isValidLabel,\n \"input-field--leading-icon\": _vm.hasLeadingIcon,\n \"input-field--trailing-icon\": _vm.showTrailingButton || _vm.hasTrailingIcon,\n \"input-field--pill\": _vm.pill\n } }, [_c(\"div\", { staticClass: \"input-field__main-wrapper\" }, [_c(\"input\", _vm._g(_vm._b({ ref: \"input\", staticClass: \"input-field__input\", class: [\n _vm.inputClass,\n {\n \"input-field__input--success\": _vm.success,\n \"input-field__input--error\": _vm.error\n }\n ], attrs: { \"id\": _vm.computedId, \"type\": _vm.type, \"disabled\": _vm.disabled, \"placeholder\": _vm.computedPlaceholder, \"aria-describedby\": _vm.ariaDescribedby, \"aria-live\": \"polite\" }, domProps: { \"value\": _vm.value.toString() }, on: { \"input\": _vm.handleInput } }, \"input\", _vm.$attrs, false), _vm.$listeners)), !_vm.labelOutside && _vm.isValidLabel ? _c(\"label\", { staticClass: \"input-field__label\", attrs: { \"for\": _vm.computedId } }, [_vm._v(\" \" + _vm._s(_vm.label) + \" \")]) : _vm._e(), _c(\"div\", { directives: [{ name: \"show\", rawName: \"v-show\", value: _vm.hasLeadingIcon, expression: \"hasLeadingIcon\" }], staticClass: \"input-field__icon input-field__icon--leading\" }, [_vm._t(\"default\")], 2), _vm.showTrailingButton ? _c(\"NcButton\", { staticClass: \"input-field__trailing-button\", attrs: { \"type\": \"tertiary-no-background\", \"aria-label\": _vm.trailingButtonLabel, \"disabled\": _vm.disabled }, on: { \"click\": _vm.handleTrailingButtonClick }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_vm._t(\"trailing-button-icon\")];\n }, proxy: true }], null, true) }) : _vm.success || _vm.error ? _c(\"div\", { staticClass: \"input-field__icon input-field__icon--trailing\" }, [_vm.success ? _c(\"Check\", { staticStyle: { \"color\": \"var(--color-success-text)\" }, attrs: { \"size\": 20 } }) : _vm.error ? _c(\"AlertCircle\", { staticStyle: { \"color\": \"var(--color-error-text)\" }, attrs: { \"size\": 20 } }) : _vm._e()], 1) : _vm._e()], 1), _vm.helperText.length > 0 ? _c(\"p\", { staticClass: \"input-field__helper-text-message\", class: {\n \"input-field__helper-text-message--error\": _vm.error,\n \"input-field__helper-text-message--success\": _vm.success\n }, attrs: { \"id\": \"\".concat(_vm.inputName, \"-helper-text\") } }, [_vm.success ? _c(\"Check\", { staticClass: \"input-field__helper-text-message__icon\", attrs: { \"size\": 18 } }) : _vm.error ? _c(\"AlertCircle\", { staticClass: \"input-field__helper-text-message__icon\", attrs: { \"size\": 18 } }) : _vm._e(), _vm._v(\" \" + _vm._s(_vm.helperText) + \" \")], 1) : _vm._e()]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"374fffac\"\n);\nconst NcInputField = __component__.exports;\nexport {\n NcInputField as default\n};\n","function debounce(function_, wait = 100, options = {}) {\n\tif (typeof function_ !== 'function') {\n\t\tthrow new TypeError(`Expected the first parameter to be a function, got \\`${typeof function_}\\`.`);\n\t}\n\n\tif (wait < 0) {\n\t\tthrow new RangeError('`wait` must not be negative.');\n\t}\n\n\t// TODO: Deprecate the boolean parameter at some point.\n\tconst {immediate} = typeof options === 'boolean' ? {immediate: options} : options;\n\n\tlet storedContext;\n\tlet storedArguments;\n\tlet timeoutId;\n\tlet timestamp;\n\tlet result;\n\n\tfunction run() {\n\t\tconst callContext = storedContext;\n\t\tconst callArguments = storedArguments;\n\t\tstoredContext = undefined;\n\t\tstoredArguments = undefined;\n\t\tresult = function_.apply(callContext, callArguments);\n\t\treturn result;\n\t}\n\n\tfunction later() {\n\t\tconst last = Date.now() - timestamp;\n\n\t\tif (last < wait && last >= 0) {\n\t\t\ttimeoutId = setTimeout(later, wait - last);\n\t\t} else {\n\t\t\ttimeoutId = undefined;\n\n\t\t\tif (!immediate) {\n\t\t\t\tresult = run();\n\t\t\t}\n\t\t}\n\t}\n\n\tconst debounced = function (...arguments_) {\n\t\tif (storedContext && this !== storedContext) {\n\t\t\tthrow new Error('Debounced method called with different contexts.');\n\t\t}\n\n\t\tstoredContext = this; // eslint-disable-line unicorn/no-this-assignment\n\t\tstoredArguments = arguments_;\n\t\ttimestamp = Date.now();\n\n\t\tconst callNow = immediate && !timeoutId;\n\n\t\tif (!timeoutId) {\n\t\t\ttimeoutId = setTimeout(later, wait);\n\t\t}\n\n\t\tif (callNow) {\n\t\t\tresult = run();\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tdebounced.clear = () => {\n\t\tif (!timeoutId) {\n\t\t\treturn;\n\t\t}\n\n\t\tclearTimeout(timeoutId);\n\t\ttimeoutId = undefined;\n\t};\n\n\tdebounced.flush = () => {\n\t\tif (!timeoutId) {\n\t\t\treturn;\n\t\t}\n\n\t\tdebounced.trigger();\n\t};\n\n\tdebounced.trigger = () => {\n\t\tresult = run();\n\n\t\tdebounced.clear();\n\t};\n\n\treturn debounced;\n}\n\n// Adds compatibility for ES modules\nmodule.exports.debounce = debounce;\n\nmodule.exports = debounce;\n","import '../assets/NcPasswordField-DWd5gg73.css';\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nimport NcInputField from \"../Components/NcInputField.mjs\";\nimport debounce from \"debounce\";\nimport axios from \"@nextcloud/axios\";\nimport { loadState } from \"@nextcloud/initial-state\";\nimport { generateOcsUrl } from \"@nextcloud/router\";\nimport { r as register, E as t28, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nimport { getLoggerBuilder } from \"@nextcloud/logger\";\nconst _sfc_main$2 = {\n name: \"EyeIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$2 = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon eye-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$2 = [];\nvar __component__$2 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$2,\n _sfc_render$2,\n _sfc_staticRenderFns$2,\n false,\n null,\n null\n);\nconst Eye = __component__$2.exports;\nconst _sfc_main$1 = {\n name: \"EyeOffIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$1 = function render2() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon eye-off-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$1 = [];\nvar __component__$1 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$1,\n _sfc_render$1,\n _sfc_staticRenderFns$1,\n false,\n null,\n null\n);\nconst EyeOff = __component__$1.exports;\nregister(t28);\nconst logger = getLoggerBuilder().detectUser().setApp(\"@nextcloud/vue\").build();\nconst passwordPolicy = loadState(\"core\", \"capabilities\", {}).password_policy || null;\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props));\nconst _sfc_main = {\n name: \"NcPasswordField\",\n components: {\n NcInputField,\n Eye,\n EyeOff\n },\n // Allow forwarding all attributes\n inheritAttrs: false,\n props: {\n /**\n * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\n */\n // Not an actual prop but needed to show in vue-styleguidist docs\n // eslint-disable-next-line\n \" \": {},\n // Reuse all the props from NcInputField for better typing and documentation\n ...NcInputField.props,\n // Redefined props\n /**\n * Controls whether to display the trailing button.\n */\n showTrailingButton: {\n type: Boolean,\n default: true\n },\n // Removed NcInputField props, defined only by this component\n trailingButtonLabel: void 0,\n // Custom props\n /**\n * Check if the user entered a valid password using the password_policy\n * app if available.\n *\n * Warning: this doesn't replace server side checking and will do nothing\n * if the password_policy app is disabled.\n */\n checkPasswordStrength: {\n type: Boolean,\n default: false\n },\n /**\n * The minlength property defines the minimum number of characters\n * (as UTF-16 code units) the user can enter\n */\n minlength: {\n type: Number,\n default: 0\n },\n /**\n * The maxlength property defines the maximum number of characters\n * (as UTF-16 code units) the user can enter\n */\n maxlength: {\n type: Number,\n default: null\n },\n /**\n * Render as input[type=text] that looks like password field.\n * Allows to avoid unwanted password-specific browser behavior,\n * such as save or generate password prompt.\n * Useful for secret token fields.\n * Note: autocomplete=\"off\" is ignored by browsers.\n */\n asText: {\n type: Boolean,\n default: false\n }\n },\n emits: [\n \"valid\",\n \"invalid\",\n \"update:value\"\n ],\n data() {\n return {\n isPasswordHidden: true,\n internalHelpMessage: \"\",\n isValid: null\n };\n },\n computed: {\n computedError() {\n return this.error || this.isValid === false;\n },\n computedSuccess() {\n return this.success || this.isValid === true;\n },\n computedHelperText() {\n if (this.helperText.length > 0) {\n return this.helperText;\n }\n return this.internalHelpMessage;\n },\n rules() {\n const { minlength } = this;\n return {\n minlength: minlength != null ? minlength : passwordPolicy == null ? void 0 : passwordPolicy.minLength\n };\n },\n trailingButtonLabelPassword() {\n return this.isPasswordHidden ? t(\"Show password\") : t(\"Hide password\");\n },\n propsAndAttrsToForward() {\n return {\n // Proxy all the HTML attributes\n ...this.$attrs,\n // Proxy original NcInputField's props\n ...Object.fromEntries(\n Object.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key))\n )\n };\n }\n },\n watch: {\n value(newValue) {\n if (this.checkPasswordStrength) {\n if (passwordPolicy === null) {\n return;\n }\n this.checkPassword(newValue);\n }\n }\n },\n methods: {\n /**\n * Focus the input element\n *\n * @public\n */\n focus() {\n this.$refs.inputField.focus();\n },\n /**\n * Select all the text in the input\n *\n * @public\n */\n select() {\n this.$refs.inputField.select();\n },\n handleInput(event) {\n this.$emit(\"update:value\", event.target.value);\n },\n togglePasswordVisibility() {\n this.isPasswordHidden = !this.isPasswordHidden;\n },\n checkPassword: debounce(async function(password) {\n try {\n const { data } = await axios.post(generateOcsUrl(\"apps/password_policy/api/v1/validate\"), { password });\n this.isValid = data.ocs.data.passed;\n if (data.ocs.data.passed) {\n this.internalHelpMessage = t(\"Password is secure\");\n this.$emit(\"valid\");\n return;\n }\n this.internalHelpMessage = data.ocs.data.reason;\n this.$emit(\"invalid\");\n } catch (e) {\n logger.error(\"Password policy returned an error\", e);\n }\n }, 500)\n }\n};\nvar _sfc_render = function render3() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"NcInputField\", _vm._g(_vm._b({ ref: \"inputField\", attrs: { \"type\": _vm.isPasswordHidden && !_vm.asText ? \"password\" : \"text\", \"trailing-button-label\": _vm.trailingButtonLabelPassword, \"helper-text\": _vm.computedHelperText, \"error\": _vm.computedError, \"success\": _vm.computedSuccess, \"minlength\": _vm.rules.minlength, \"input-class\": { \"password-field__input--secure-text\": _vm.isPasswordHidden && _vm.asText } }, on: { \"trailing-button-click\": _vm.togglePasswordVisibility, \"input\": _vm.handleInput }, scopedSlots: _vm._u([{ key: \"trailing-button-icon\", fn: function() {\n return [_vm.isPasswordHidden ? _c(\"Eye\", { attrs: { \"size\": 18 } }) : _c(\"EyeOff\", { attrs: { \"size\": 18 } })];\n }, proxy: true }]) }, \"NcInputField\", _vm.propsAndAttrsToForward, false), _vm.$listeners), [_vm._t(\"default\")], 2);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"d984b8e5\"\n);\nconst NcPasswordField = __component__.exports;\nexport {\n NcPasswordField as N\n};\n","import { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n name: \"ArrowRightIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon arrow-right-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n null\n);\nconst ArrowRight = __component__.exports;\nexport {\n ArrowRight as A\n};\n","import NcInputField from \"../Components/NcInputField.mjs\";\nimport { C as Close } from \"./Close-B6ccm1RP.mjs\";\nimport { A as ArrowRight } from \"./ArrowRight-KsL2PC-o.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nimport { r as register, c as t47, d as t17, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nconst _sfc_main$1 = {\n name: \"UndoVariantIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$1 = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon undo-variant-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M13.5,7A6.5,6.5 0 0,1 20,13.5A6.5,6.5 0 0,1 13.5,20H10V18H13.5C16,18 18,16 18,13.5C18,11 16,9 13.5,9H7.83L10.91,12.09L9.5,13.5L4,8L9.5,2.5L10.92,3.91L7.83,7H13.5M6,18H8V20H6V18Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$1 = [];\nvar __component__$1 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$1,\n _sfc_render$1,\n _sfc_staticRenderFns$1,\n false,\n null,\n null\n);\nconst Undo = __component__$1.exports;\nregister(t17, t47);\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props));\nconst _sfc_main = {\n name: \"NcTextField\",\n components: {\n NcInputField,\n Close,\n ArrowRight,\n Undo\n },\n // Allow forwarding all attributes\n inheritAttrs: false,\n props: {\n /**\n * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\n */\n // Not an actual prop but needed to show in vue-styleguidist docs\n // eslint-disable-next-line\n \" \": {},\n // Reuse all the props from NcInputField for better typing and documentation\n ...NcInputField.props,\n /**\n * The `aria-label` to set on the trailing button\n * If no explicit value is set it will default to the one matching the `trailingButtonIcon`:\n * @default 'Clear text'|'Save changes'|'Undo changes'\n */\n trailingButtonLabel: {\n type: String,\n default: \"\"\n },\n // Custom props\n /**\n * Specifies which material design icon should be used for the trailing\n * button.\n * @type {'close'|'arrowRight'|'undo'}\n */\n trailingButtonIcon: {\n type: String,\n default: \"close\",\n validator: (value) => [\n \"close\",\n \"arrowRight\",\n \"undo\"\n ].includes(value)\n }\n },\n emits: [\n \"update:value\"\n ],\n computed: {\n propsAndAttrsToForward() {\n const predefinedLabels = {\n undo: t(\"Undo changes\"),\n close: t(\"Clear text\"),\n arrowRight: t(\"Save changes\")\n };\n return {\n // Proxy all the HTML attributes\n ...this.$attrs,\n // Proxy original NcInputField's props\n ...Object.fromEntries(\n Object.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key))\n ),\n // Adjust aria-label for predefined trailing buttons\n trailingButtonLabel: this.trailingButtonLabel || predefinedLabels[this.trailingButtonIcon]\n };\n }\n },\n methods: {\n /**\n * Focus the input element\n *\n * @public\n */\n focus() {\n this.$refs.inputField.focus();\n },\n /**\n * Select all the text in the input\n *\n * @public\n */\n select() {\n this.$refs.inputField.select();\n },\n handleInput(event) {\n this.$emit(\"update:value\", event.target.value);\n }\n }\n};\nvar _sfc_render = function render2() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"NcInputField\", _vm._g(_vm._b({ ref: \"inputField\", on: { \"input\": _vm.handleInput }, scopedSlots: _vm._u([_vm.type !== \"search\" ? { key: \"trailing-button-icon\", fn: function() {\n return [_vm.trailingButtonIcon === \"close\" ? _c(\"Close\", { attrs: { \"size\": 20 } }) : _vm.trailingButtonIcon === \"arrowRight\" ? _c(\"ArrowRight\", { attrs: { \"size\": 20 } }) : _vm.trailingButtonIcon === \"undo\" ? _c(\"Undo\", { attrs: { \"size\": 20 } }) : _vm._e()];\n }, proxy: true } : null], null, true) }, \"NcInputField\", _vm.propsAndAttrsToForward, false), _vm.$listeners), [_vm._t(\"default\")], 2);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n null\n);\nconst NcTextField = __component__.exports;\nexport {\n NcTextField as N\n};\n","import '../assets/NcActionInput-C_3Csa6A.css';\nimport NcDateTimePicker from \"../Components/NcDateTimePicker.mjs\";\nimport NcDateTimePickerNative from \"../Components/NcDateTimePickerNative.mjs\";\nimport { N as NcPasswordField } from \"./NcPasswordField-BbbShH-t.mjs\";\nimport { N as NcSelect } from \"./NcSelect-kmuffooC.mjs\";\nimport { N as NcTextField } from \"./NcTextField-DWfgnCsS.mjs\";\nimport { A as ActionGlobalMixin } from \"./actionGlobal-DqVa7c7G.mjs\";\nimport { G as GenRandomId } from \"./GenRandomId-CMooMQt0.mjs\";\nimport { r as register, f as t45, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nregister(t45);\nconst _sfc_main = {\n name: \"NcActionInput\",\n components: {\n NcDateTimePicker,\n NcDateTimePickerNative,\n NcPasswordField,\n NcSelect,\n NcTextField\n },\n mixins: [ActionGlobalMixin],\n props: {\n /**\n * id attribute of the checkbox element\n */\n id: {\n type: String,\n default: () => \"action-\" + GenRandomId(),\n validator: (id) => id.trim() !== \"\"\n },\n /**\n * id attribute of the text input element\n */\n inputId: {\n type: String,\n default: () => \"action-input-\" + GenRandomId(),\n validator: (id) => id.trim() !== \"\"\n },\n /**\n * Icon to show with the action, can be either a CSS class or an URL\n */\n icon: {\n type: String,\n default: \"\"\n },\n /**\n * type attribute of the input field\n */\n type: {\n type: String,\n default: \"text\",\n validator(type) {\n return [\n \"date\",\n \"datetime-local\",\n \"month\",\n \"multiselect\",\n \"number\",\n \"password\",\n \"search\",\n \"tel\",\n \"text\",\n \"time\",\n \"url\",\n \"week\",\n \"color\",\n \"email\"\n ].indexOf(type) > -1;\n }\n },\n /**\n * id attribute for the native date time picker\n */\n idNativeDateTimePicker: {\n type: String,\n default: \"date-time-picker_id\"\n },\n /**\n * Flag to use a native date time picker\n */\n isNativePicker: {\n type: Boolean,\n default: false\n },\n /**\n * The visible input label for accessibility purposes.\n */\n label: {\n type: String,\n default: null\n },\n /**\n * If you want to show the label just above the\n * input field, pass in `true` to this prop.\n */\n labelOutside: {\n type: Boolean,\n default: true\n },\n /**\n * value attribute of the input field\n */\n value: {\n type: [String, Date, Number, Array],\n default: \"\"\n },\n /**\n * disabled state of the input field\n */\n disabled: {\n type: Boolean,\n default: false\n },\n /**\n * aria-label attribute of the input field\n */\n ariaLabel: {\n type: String,\n default: \"\"\n },\n /**\n * @deprecated To be removed in @nextcloud/vue 9. Migration guide: remove ariaHidden prop from NcAction* components.\n * @todo Add a check in @nextcloud/vue 9 that this prop is not provided,\n * otherwise root element will inherit incorrect aria-hidden.\n */\n ariaHidden: {\n type: Boolean,\n default: null\n },\n /**\n * Attribute forwarded to the underlying NcPasswordField and NcTextField\n */\n showTrailingButton: {\n type: Boolean,\n default: true\n },\n /**\n * Trailing button label forwarded to the underlying NcTextField\n */\n trailingButtonLabel: {\n type: String,\n default: t(\"Submit\")\n }\n },\n emits: [\n \"input\",\n \"submit\",\n \"change\",\n \"update:value\"\n ],\n computed: {\n isIconUrl() {\n try {\n return new URL(this.icon);\n } catch (error) {\n return false;\n }\n },\n isMultiselectType() {\n return this.type === \"multiselect\";\n },\n nativeDatePickerType() {\n switch (this.type) {\n case \"date\":\n case \"month\":\n case \"time\":\n case \"week\":\n case \"datetime-local\":\n return this.type;\n }\n return false;\n },\n datePickerType() {\n if (!this.isNativePicker) {\n switch (this.type) {\n case \"date\":\n case \"month\":\n case \"time\":\n return this.type;\n case \"datetime-local\":\n return \"datetime\";\n }\n }\n return false;\n },\n /**\n * determines if the action is focusable\n *\n * @return {boolean} is the action focusable ?\n */\n isFocusable() {\n return !this.disabled;\n }\n },\n methods: {\n // closing datepicker popup on mouseleave = unfocus\n onLeave() {\n if (this.$refs.datetimepicker && this.$refs.datetimepicker.$refs.datepicker) {\n this.$refs.datetimepicker.$refs.datepicker.closePopup();\n }\n },\n onInput(event) {\n this.$emit(\"input\", event);\n this.$emit(\"update:value\", event.target ? event.target.value : event);\n },\n onSubmit(event) {\n event.preventDefault();\n event.stopPropagation();\n if (!this.disabled) {\n this.$emit(\"submit\", event);\n } else {\n return false;\n }\n },\n onChange(event) {\n this.$emit(\"change\", event);\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"li\", { staticClass: \"action\", class: { \"action--disabled\": _vm.disabled } }, [_c(\"span\", { staticClass: \"action-input\", class: {\n \"action-input-picker--disabled\": _vm.disabled,\n \"action-input--visible-label\": _vm.labelOutside && _vm.label\n }, on: { \"mouseleave\": _vm.onLeave } }, [_c(\"span\", { staticClass: \"action-input__icon-wrapper\" }, [_vm._t(\"icon\", function() {\n return [_c(\"span\", { staticClass: \"action-input__icon\", class: [_vm.isIconUrl ? \"action-input__icon--url\" : _vm.icon], style: { backgroundImage: _vm.isIconUrl ? \"url(\".concat(_vm.icon, \")\") : null }, attrs: { \"aria-hidden\": \"true\" } })];\n })], 2), _c(\"form\", { ref: \"form\", staticClass: \"action-input__form\", attrs: { \"disabled\": _vm.disabled }, on: { \"submit\": function($event) {\n $event.preventDefault();\n return _vm.onSubmit.apply(null, arguments);\n } } }, [_c(\"div\", { staticClass: \"action-input__container\" }, [_vm.label && _vm.labelOutside ? _c(\"label\", { staticClass: \"action-input__text-label\", class: { \"action-input__text-label--hidden\": !_vm.labelOutside }, attrs: { \"for\": _vm.inputId } }, [_vm._v(\" \" + _vm._s(_vm.label) + \" \")]) : _vm._e(), _c(\"div\", { staticClass: \"action-input__input-container\" }, [_vm.datePickerType ? _c(\"NcDateTimePicker\", _vm._b({ ref: \"datetimepicker\", staticClass: \"action-input__datetimepicker\", staticStyle: { \"z-index\": \"99999999999\" }, attrs: { \"value\": _vm.value, \"placeholder\": _vm.text, \"disabled\": _vm.disabled, \"type\": _vm.datePickerType, \"input-class\": [\"mx-input\", { focusable: _vm.isFocusable }] }, on: { \"input\": _vm.onInput, \"change\": _vm.onChange } }, \"NcDateTimePicker\", _vm.$attrs, false)) : _vm.isNativePicker ? _c(\"NcDateTimePickerNative\", _vm._b({ staticClass: \"action-input__datetimepicker\", attrs: { \"id\": _vm.idNativeDateTimePicker, \"value\": _vm.value, \"type\": _vm.nativeDatePickerType, \"input-class\": { focusable: _vm.isFocusable } }, on: { \"input\": function($event) {\n return _vm.$emit(\"input\", $event);\n }, \"change\": function($event) {\n return _vm.$emit(\"change\", $event);\n } } }, \"NcDateTimePickerNative\", _vm.$attrs, false)) : _vm.isMultiselectType ? _c(\"NcSelect\", _vm._g(_vm._b({ staticClass: \"action-input__multi\", attrs: { \"value\": _vm.value, \"placeholder\": _vm.text, \"disabled\": _vm.disabled, \"append-to-body\": _vm.$attrs.appendToBody || _vm.$attrs[\"append-to-body\"] || false, \"input-class\": { focusable: _vm.isFocusable } } }, \"NcSelect\", _vm.$attrs, false), _vm.$listeners)) : _vm.type === \"password\" ? _c(\"NcPasswordField\", _vm._g(_vm._b({ attrs: { \"id\": _vm.inputId, \"value\": _vm.value, \"label\": _vm.label, \"label-outside\": !_vm.label || _vm.labelOutside, \"placeholder\": _vm.text, \"disabled\": _vm.disabled, \"input-class\": { focusable: _vm.isFocusable }, \"show-trailing-button\": _vm.showTrailingButton && !_vm.disabled }, on: { \"input\": _vm.onInput, \"change\": _vm.onChange } }, \"NcPasswordField\", _vm.$attrs, false), _vm.$listeners)) : _vm.type === \"color\" ? _c(\"div\", { staticClass: \"action-input__container\" }, [_vm.label && _vm.type === \"color\" ? _c(\"label\", { staticClass: \"action-input__text-label\", class: { \"action-input__text-label--hidden\": !_vm.labelOutside }, attrs: { \"for\": _vm.inputId } }, [_vm._v(\" \" + _vm._s(_vm.label) + \" \")]) : _vm._e(), _c(\"div\", { staticClass: \"action-input__input-container\" }, [_c(\"NcColorPicker\", _vm._g(_vm._b({ staticClass: \"colorpicker__trigger\", attrs: { \"id\": \"inputId\", \"value\": _vm.value }, on: { \"input\": _vm.onInput, \"submit\": function($event) {\n return _vm.$refs.form.requestSubmit();\n } } }, \"NcColorPicker\", _vm.$attrs, false), _vm.$listeners), [_c(\"button\", { staticClass: \"colorpicker__preview\", class: { focusable: _vm.isFocusable }, style: { \"background-color\": _vm.value } })])], 1)]) : _c(\"NcTextField\", _vm._g(_vm._b({ attrs: { \"id\": _vm.inputId, \"value\": _vm.value, \"label\": _vm.label, \"label-outside\": !_vm.label || _vm.labelOutside, \"placeholder\": _vm.text, \"disabled\": _vm.disabled, \"input-class\": { focusable: _vm.isFocusable }, \"type\": _vm.type, \"trailing-button-icon\": \"arrowRight\", \"trailing-button-label\": _vm.trailingButtonLabel, \"show-trailing-button\": _vm.showTrailingButton && !_vm.disabled }, on: { \"trailing-button-click\": function($event) {\n return _vm.$refs.form.requestSubmit();\n }, \"input\": _vm.onInput, \"change\": _vm.onChange } }, \"NcTextField\", _vm.$attrs, false), _vm.$listeners))], 1)])])])]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"6ba44c48\"\n);\nconst NcActionInput = __component__.exports;\nexport {\n NcActionInput as N\n};\n","import '../assets/NcAppContent-DVBVZyuW.css';\nimport NcButton from \"../Components/NcButton.mjs\";\nimport { r as register, C as t26, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nimport \"../Directives/Tooltip.mjs\";\nimport { emit } from \"@nextcloud/event-bus\";\nimport { A as ArrowRight } from \"./ArrowRight-KsL2PC-o.mjs\";\nimport { useIsMobile } from \"../Composables/useIsMobile.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nimport { VTooltip } from \"floating-vue\";\nimport { getBuilder } from \"@nextcloud/browser-storage\";\nimport { useSwipe } from \"@vueuse/core\";\nimport { Pane, Splitpanes } from \"splitpanes\";\nimport \"splitpanes/dist/splitpanes.css\";\nregister(t26);\nconst _sfc_main$1 = {\n name: \"NcAppDetailsToggle\",\n directives: {\n tooltip: VTooltip\n },\n components: {\n NcButton,\n ArrowRight\n },\n setup() {\n return {\n isMobile: useIsMobile()\n };\n },\n computed: {\n title() {\n return t(\"Go back to the list\");\n }\n },\n watch: {\n isMobile: {\n immediate: true,\n handler() {\n this.toggleAppNavigationButton(this.isMobile);\n }\n }\n },\n beforeDestroy() {\n if (this.isMobile) {\n this.toggleAppNavigationButton(false);\n }\n },\n methods: {\n toggleAppNavigationButton(hide = true) {\n const appNavigationToggle = document.querySelector(\".app-navigation .app-navigation-toggle\");\n if (appNavigationToggle) {\n appNavigationToggle.style.display = hide ? \"none\" : null;\n if (hide === true) {\n emit(\"toggle-navigation\", { open: false });\n }\n }\n }\n }\n};\nvar _sfc_render$1 = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"NcButton\", { directives: [{ name: \"tooltip\", rawName: \"v-tooltip\", value: _vm.title, expression: \"title\" }], staticClass: \"app-details-toggle\", class: { \"app-details-toggle--mobile\": _vm.isMobile }, attrs: { \"type\": \"tertiary\", \"aria-label\": _vm.title }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_c(\"ArrowRight\", { attrs: { \"size\": 20 } })];\n }, proxy: true }]) });\n};\nvar _sfc_staticRenderFns$1 = [];\nvar __component__$1 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$1,\n _sfc_render$1,\n _sfc_staticRenderFns$1,\n false,\n null,\n \"7692fc78\"\n);\nconst NcAppDetailsToggle = __component__$1.exports;\nconst browserStorage = getBuilder(\"nextcloud\").persist().build();\nconst _sfc_main = {\n name: \"NcAppContent\",\n components: {\n NcAppDetailsToggle,\n Pane,\n Splitpanes\n },\n props: {\n /**\n * Allows to disable the control by swipe of the app navigation open state\n */\n allowSwipeNavigation: {\n type: Boolean,\n default: true\n },\n /**\n * Allows you to set the default width of the resizable list in % on vertical-split\n * Allows you to set the default height of the resizable list in % on horizontal-split\n * Must be between listMinWidth and listMaxWidth\n */\n listSize: {\n type: Number,\n default: 20\n },\n /**\n * Allows you to set the minimum width of the list column in % on vertical-split\n * Allows you to set the minimum height of the list column in % on horizontal-split\n */\n listMinWidth: {\n type: Number,\n default: 15\n },\n /**\n * Allows you to set the maximum width of the list column in % on vertical-split\n * Allows you to set the maximum height of the list column in % on horizontal-split\n */\n listMaxWidth: {\n type: Number,\n default: 40\n },\n /**\n * Specify the config key for the pane config sizes\n * Default is the global var appName if you use the webpack-vue-config\n */\n paneConfigKey: {\n type: String,\n default: \"\"\n },\n /**\n * When in mobile view, only the list or the details are shown\n * If you provide a list, you need to provide a variable\n * that will be set to true by the user when an element of\n * the list gets selected. The details will then show a back\n * arrow to return to the list that will update this prop to false.\n */\n showDetails: {\n type: Boolean,\n default: true\n },\n /**\n * Specify the `` page heading\n */\n pageHeading: {\n type: String,\n default: null\n },\n /**\n * Content layout used when there is a list together with content:\n * - `vertical-split` - a 2-column layout with list and default content separated vertically\n * - `no-split` - a single column layout; List is shown when `showDetails` is `false`, otherwise the default slot content is shown with a back button to return to the list.\n * - 'horizontal-split' - a 2-column layout with list and default content separated horizontally\n * On mobile screen `no-split` layout is forced.\n */\n layout: {\n type: String,\n default: \"vertical-split\",\n validator(value) {\n return [\"no-split\", \"vertical-split\", \"horizontal-split\"].includes(value);\n }\n }\n },\n emits: [\n \"update:showDetails\",\n \"resize:list\"\n ],\n setup() {\n return {\n isMobile: useIsMobile()\n };\n },\n data() {\n return {\n contentHeight: 0,\n hasList: false,\n hasContent: false,\n swiping: {},\n listPaneSize: this.restorePaneConfig()\n };\n },\n computed: {\n paneConfigID() {\n if (this.paneConfigKey !== \"\") {\n return \"pane-list-size-\".concat(this.paneConfigKey);\n }\n try {\n return \"pane-list-size-\".concat(appName);\n } catch (e) {\n console.info(\"[INFO] AppContent:\", \"falling back to global nextcloud pane config\");\n return \"pane-list-size-nextcloud\";\n }\n },\n detailsPaneSize() {\n if (this.listPaneSize) {\n return 100 - this.listPaneSize;\n }\n return this.paneDefaults.details.size;\n },\n paneDefaults() {\n return {\n list: {\n size: this.listSize,\n min: this.listMinWidth,\n max: this.listMaxWidth\n },\n // set the inverse values of the details column\n // based on the provided (or default) values of the list column\n details: {\n size: 100 - this.listSize,\n min: 100 - this.listMaxWidth,\n max: 100 - this.listMinWidth\n }\n };\n }\n },\n updated() {\n this.checkSlots();\n },\n mounted() {\n if (this.allowSwipeNavigation) {\n this.swiping = useSwipe(this.$el, {\n onSwipeEnd: this.handleSwipe\n });\n }\n this.checkSlots();\n this.restorePaneConfig();\n },\n methods: {\n /**\n * handle the swipe event\n *\n * @param {TouchEvent} e The touch event\n * @param {import('@vueuse/core').SwipeDirection} direction The swipe direction of the event\n */\n handleSwipe(e, direction) {\n const minSwipeX = 70;\n const touchZone = 300;\n if (Math.abs(this.swiping.lengthX) > minSwipeX) {\n if (this.swiping.coordsStart.x < touchZone / 2 && direction === \"right\") {\n emit(\"toggle-navigation\", {\n open: true\n });\n } else if (this.swiping.coordsStart.x < touchZone * 1.5 && direction === \"left\") {\n emit(\"toggle-navigation\", {\n open: false\n });\n }\n }\n },\n handlePaneResize(event) {\n const listPaneSize = parseInt(event[0].size, 10);\n browserStorage.setItem(this.paneConfigID, JSON.stringify(listPaneSize));\n this.listPaneSize = listPaneSize;\n this.$emit(\"resize:list\", { size: listPaneSize });\n console.debug(\"AppContent pane config\", listPaneSize);\n },\n // $slots is not reactive, we need to update this manually\n checkSlots() {\n this.hasList = !!this.$scopedSlots.list;\n this.hasContent = !!this.$scopedSlots.default;\n },\n // browserStorage is not reactive, we need to update this manually\n restorePaneConfig() {\n const listPaneSize = parseInt(browserStorage.getItem(this.paneConfigID), 10);\n if (!isNaN(listPaneSize) && listPaneSize !== this.listPaneSize) {\n console.debug(\"AppContent pane config\", listPaneSize);\n this.listPaneSize = listPaneSize;\n return listPaneSize;\n }\n },\n /**\n * The user clicked the back arrow from the details view\n */\n hideDetails() {\n this.$emit(\"update:showDetails\", false);\n }\n }\n};\nvar _sfc_render = function render2() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"main\", { staticClass: \"app-content no-snapper\", class: { \"app-content--has-list\": _vm.hasList }, attrs: { \"id\": \"app-content-vue\" } }, [_vm.pageHeading ? _c(\"h1\", { staticClass: \"hidden-visually\" }, [_vm._v(\" \" + _vm._s(_vm.pageHeading) + \" \")]) : _vm._e(), _vm.hasList ? [_vm.isMobile || _vm.layout === \"no-split\" ? _c(\"div\", { staticClass: \"app-content-wrapper app-content-wrapper--no-split\", class: {\n \"app-content-wrapper--show-details\": _vm.showDetails,\n \"app-content-wrapper--show-list\": !_vm.showDetails,\n \"app-content-wrapper--mobile\": _vm.isMobile\n } }, [_vm.showDetails ? _c(\"NcAppDetailsToggle\", { nativeOn: { \"click\": function($event) {\n $event.stopPropagation();\n $event.preventDefault();\n return _vm.hideDetails.apply(null, arguments);\n } } }) : _vm._e(), !_vm.showDetails ? _vm._t(\"list\") : _vm._t(\"default\")], 2) : _vm.layout === \"vertical-split\" || _vm.layout === \"horizontal-split\" ? _c(\"div\", { staticClass: \"app-content-wrapper\" }, [_c(\"Splitpanes\", { staticClass: \"default-theme\", class: {\n \"splitpanes--horizontal\": _vm.layout === \"horizontal-split\",\n \"splitpanes--vertical\": _vm.layout === \"vertical-split\"\n }, attrs: { \"horizontal\": _vm.layout === \"horizontal-split\" }, on: { \"resized\": _vm.handlePaneResize } }, [_c(\"Pane\", { staticClass: \"splitpanes__pane-list\", attrs: { \"size\": _vm.listPaneSize || _vm.paneDefaults.list.size, \"min-size\": _vm.paneDefaults.list.min, \"max-size\": _vm.paneDefaults.list.max } }, [_vm._t(\"list\")], 2), _c(\"Pane\", { staticClass: \"splitpanes__pane-details\", attrs: { \"size\": _vm.detailsPaneSize, \"min-size\": _vm.paneDefaults.details.min, \"max-size\": _vm.paneDefaults.details.max } }, [_vm._t(\"default\")], 2)], 1)], 1) : _vm._e()] : _vm._e(), !_vm.hasList ? _vm._t(\"default\") : _vm._e()], 2);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"de6986e3\"\n);\nconst NcAppContent = __component__.exports;\nexport {\n NcAppContent as N\n};\n","import '../assets/NcAppNavigationToggle-DvYpNzHv.css';\nimport NcButton from \"../Components/NcButton.mjs\";\nimport { r as register, B as t19, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nregister(t19);\nconst _sfc_main$2 = {\n name: \"MenuIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$2 = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon menu-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$2 = [];\nvar __component__$2 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$2,\n _sfc_render$2,\n _sfc_staticRenderFns$2,\n false,\n null,\n null\n);\nconst MenuIcon = __component__$2.exports;\nconst _sfc_main$1 = {\n name: \"MenuOpenIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$1 = function render2() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon menu-open-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M21,15.61L19.59,17L14.58,12L19.59,7L21,8.39L17.44,12L21,15.61M3,6H16V8H3V6M3,13V11H13V13H3M3,18V16H16V18H3Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$1 = [];\nvar __component__$1 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$1,\n _sfc_render$1,\n _sfc_staticRenderFns$1,\n false,\n null,\n null\n);\nconst MenuOpenIcon = __component__$1.exports;\nconst _sfc_main = {\n name: \"NcAppNavigationToggle\",\n components: {\n NcButton,\n MenuIcon,\n MenuOpenIcon\n },\n props: {\n /**\n * Tracks whether the toggle has been clicked or not.\n * If it has been clicked, switches between the different MenuIcons\n * and emits a boolean indicating its opened status\n */\n open: {\n type: Boolean,\n required: true\n }\n },\n emits: [\"update:open\"],\n computed: {\n label() {\n return this.open ? t(\"Close navigation\") : t(\"Open navigation\");\n }\n },\n methods: {\n /**\n * Once the toggle has been clicked, emits the toggle status\n * so parent components can gauge the status of the navigation button\n */\n toggleNavigation() {\n this.$emit(\"update:open\", !this.open);\n }\n }\n};\nvar _sfc_render = function render3() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"div\", { staticClass: \"app-navigation-toggle-wrapper\" }, [_c(\"NcButton\", { staticClass: \"app-navigation-toggle\", attrs: { \"type\": \"tertiary\", \"aria-expanded\": _vm.open ? \"true\" : \"false\", \"aria-label\": _vm.label, \"title\": _vm.label, \"aria-controls\": \"app-navigation-vue\" }, on: { \"click\": _vm.toggleNavigation }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_vm.open ? _c(\"MenuOpenIcon\", { attrs: { \"size\": 20 } }) : _c(\"MenuIcon\", { attrs: { \"size\": 20 } })];\n }, proxy: true }]) })], 1);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"b6024aba\"\n);\nconst NcAppNavigationToggle = __component__.exports;\nexport {\n NcAppNavigationToggle as N\n};\n","import { n as normalizeComponent } from \"../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n name: \"NcVNodes\",\n props: {\n /**\n * The vnodes to render\n */\n vnodes: {\n type: [Array, Object],\n default: null\n }\n },\n /**\n * The render function to display the component\n *\n * @param {Function} h The function to create VNodes\n * @return {object} The created VNode\n */\n render(h) {\n var _a, _b, _c;\n return this.vnodes || ((_a = this.$slots) == null ? void 0 : _a.default) || ((_c = (_b = this.$scopedSlots) == null ? void 0 : _b.default) == null ? void 0 : _c.call(_b));\n }\n};\nconst _sfc_render = null;\nconst _sfc_staticRenderFns = null;\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n null\n);\nconst NcVNodes = __component__.exports;\nexport {\n NcVNodes as default\n};\n","import { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n name: \"ChevronUpIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon chevron-up-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n null\n);\nconst ChevronUp = __component__.exports;\nexport {\n ChevronUp as C\n};\n","import '../assets/NcInputConfirmCancel-SGr0-6w8.css';\nimport NcButton from \"../Components/NcButton.mjs\";\nimport { r as register, o as t13, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nimport { A as ArrowRight } from \"./ArrowRight-KsL2PC-o.mjs\";\nimport { C as Close } from \"./Close-B6ccm1RP.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nregister(t13);\nconst _sfc_main = {\n name: \"NcInputConfirmCancel\",\n components: {\n NcButton,\n ArrowRight,\n Close\n },\n props: {\n /**\n * If this element is used on a primary element set to true for primary styling.\n */\n primary: {\n default: false,\n type: Boolean\n },\n placeholder: {\n default: \"\",\n type: String\n },\n value: {\n default: \"\",\n type: String\n }\n },\n emits: [\n \"input\",\n \"confirm\",\n \"cancel\"\n ],\n data() {\n return {\n labelConfirm: t(\"Confirm changes\"),\n labelCancel: t(\"Cancel changes\")\n };\n },\n computed: {\n valueModel: {\n get() {\n return this.value;\n },\n set(newValue) {\n this.$emit(\"input\", newValue);\n }\n }\n },\n methods: {\n confirm() {\n this.$emit(\"confirm\");\n },\n cancel() {\n this.$emit(\"cancel\");\n },\n focusInput() {\n this.$refs.input.focus();\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"div\", { staticClass: \"app-navigation-input-confirm\" }, [_c(\"form\", { on: { \"submit\": function($event) {\n $event.preventDefault();\n return _vm.confirm.apply(null, arguments);\n }, \"keydown\": function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"esc\", 27, $event.key, [\"Esc\", \"Escape\"])) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.stopPropagation();\n $event.preventDefault();\n return _vm.cancel.apply(null, arguments);\n }, \"click\": function($event) {\n $event.stopPropagation();\n $event.preventDefault();\n } } }, [_c(\"input\", { directives: [{ name: \"model\", rawName: \"v-model\", value: _vm.valueModel, expression: \"valueModel\" }], ref: \"input\", staticClass: \"app-navigation-input-confirm__input\", attrs: { \"type\": \"text\", \"placeholder\": _vm.placeholder }, domProps: { \"value\": _vm.valueModel }, on: { \"input\": function($event) {\n if ($event.target.composing) return;\n _vm.valueModel = $event.target.value;\n } } }), _c(\"NcButton\", { attrs: { \"native-type\": \"submit\", \"type\": \"primary\", \"aria-label\": _vm.labelConfirm }, on: { \"click\": function($event) {\n $event.stopPropagation();\n $event.preventDefault();\n return _vm.confirm.apply(null, arguments);\n } }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_c(\"ArrowRight\", { attrs: { \"size\": 20 } })];\n }, proxy: true }]) }), _c(\"NcButton\", { attrs: { \"native-type\": \"reset\", \"type\": _vm.primary ? \"primary\" : \"tertiary\", \"aria-label\": _vm.labelCancel }, on: { \"click\": function($event) {\n $event.stopPropagation();\n $event.preventDefault();\n return _vm.cancel.apply(null, arguments);\n } }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_c(\"Close\", { attrs: { \"size\": 20 } })];\n }, proxy: true }]) })], 1)]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"0e795eb7\"\n);\nconst NcInputConfirmCancel = __component__.exports;\nexport {\n NcInputConfirmCancel as N\n};\n","import '../assets/NcAppNavigationItem-Vg0-UrGT.css';\nimport { N as NcActions } from \"./NcActions-D77YAhAy.mjs\";\nimport NcActionButton from \"../Components/NcActionButton.mjs\";\nimport NcLoadingIcon from \"../Components/NcLoadingIcon.mjs\";\nimport NcVNodes from \"../Components/NcVNodes.mjs\";\nimport NcButton from \"../Components/NcButton.mjs\";\nimport { r as register, K as t20, a as t, c as t47, L as t21 } from \"./_l10n-B4dEPXsr.mjs\";\nimport { C as ChevronDown } from \"./ChevronDown-D3Tfshug.mjs\";\nimport { C as ChevronUp } from \"./ChevronUp-ljACquzS.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nimport { useIsMobile } from \"../Composables/useIsMobile.mjs\";\nimport { N as NcInputConfirmCancel } from \"./NcInputConfirmCancel-CTMBdhFf.mjs\";\nimport { G as GenRandomId } from \"./GenRandomId-CMooMQt0.mjs\";\nregister(t20);\nconst _sfc_main$3 = {\n name: \"NcAppNavigationIconCollapsible\",\n components: {\n NcButton,\n ChevronDown,\n ChevronUp\n },\n props: {\n open: {\n type: Boolean,\n default: true\n }\n },\n emits: [\"click\"],\n computed: {\n labelButton() {\n return this.open ? t(\"Collapse menu\") : t(\"Open menu\");\n }\n },\n methods: {\n onClick(e) {\n this.$emit(\"click\", e);\n }\n }\n};\nvar _sfc_render$3 = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"NcButton\", { staticClass: \"icon-collapse\", class: { \"icon-collapse--open\": _vm.open }, attrs: { \"type\": \"tertiary\", \"aria-label\": _vm.labelButton }, on: { \"click\": _vm.onClick }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_vm.open ? _c(\"ChevronUp\", { attrs: { \"size\": 20 } }) : _c(\"ChevronDown\", { attrs: { \"size\": 20 } })];\n }, proxy: true }]) });\n};\nvar _sfc_staticRenderFns$3 = [];\nvar __component__$3 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$3,\n _sfc_render$3,\n _sfc_staticRenderFns$3,\n false,\n null,\n \"cadd59ae\"\n);\nconst NcAppNavigationIconCollapsible = __component__$3.exports;\nregister(t21, t47);\nconst _sfc_main$2 = {\n name: \"PencilIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$2 = function render2() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon pencil-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$2 = [];\nvar __component__$2 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$2,\n _sfc_render$2,\n _sfc_staticRenderFns$2,\n false,\n null,\n null\n);\nconst Pencil = __component__$2.exports;\nconst _sfc_main$1 = {\n name: \"UndoIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$1 = function render3() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon undo-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M12.5,8C9.85,8 7.45,9 5.6,10.6L2,7V16H11L7.38,12.38C8.77,11.22 10.54,10.5 12.5,10.5C16.04,10.5 19.05,12.81 20.1,16L22.47,15.22C21.08,11.03 17.15,8 12.5,8Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$1 = [];\nvar __component__$1 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$1,\n _sfc_render$1,\n _sfc_staticRenderFns$1,\n false,\n null,\n null\n);\nconst Undo = __component__$1.exports;\nconst _sfc_main = {\n name: \"NcAppNavigationItem\",\n components: {\n NcActions,\n NcActionButton,\n NcAppNavigationIconCollapsible,\n NcInputConfirmCancel,\n NcLoadingIcon,\n NcVNodes,\n Pencil,\n Undo\n },\n props: {\n /**\n * If you are not using vue-router you can use the property to set this item as the active navigation entry.\n * When using vue-router and the `to` property this is set automatically.\n */\n active: {\n type: Boolean,\n default: false\n },\n /**\n * The main text content of the entry.\n */\n name: {\n type: String,\n required: true\n },\n /**\n * The title attribute of the element.\n */\n title: {\n type: String,\n default: null\n },\n /**\n * id attribute of the list item element\n */\n id: {\n type: String,\n default: () => \"app-navigation-item-\" + GenRandomId(),\n validator: (id) => id.trim() !== \"\"\n },\n /**\n * Refers to the icon on the left, this prop accepts a class\n * like 'icon-category-enabled'.\n */\n icon: {\n type: String,\n default: \"\"\n },\n /**\n * Displays a loading animated icon on the left of the element\n * instead of the icon.\n */\n loading: {\n type: Boolean,\n default: false\n },\n /**\n * Passing in a route will make the root element of this\n * component a `` that points to that route.\n * By leaving this blank, the root element will be a ``.\n */\n to: {\n type: [String, Object],\n default: null\n },\n /**\n * A direct link. This will be used as the `href` attribute.\n * This will ignore any `to` prop being defined.\n */\n href: {\n type: String,\n default: null\n },\n /**\n * Pass in `true` if you want the matching behaviour to\n * be non-inclusive: https://router.vuejs.org/api/#exact\n */\n exact: {\n type: Boolean,\n default: false\n },\n /**\n * Gives the possibility to collapse the children elements into the\n * parent element (true) or expands the children elements (false).\n */\n allowCollapse: {\n type: Boolean,\n default: false\n },\n /**\n * Makes the name of the item editable by providing an `ActionButton`\n * component that toggles a form\n */\n editable: {\n type: Boolean,\n default: false\n },\n /**\n * Only for 'editable' items, sets label for the edit action button.\n */\n editLabel: {\n type: String,\n default: \"\"\n },\n /**\n * Only for items in 'editable' mode, sets the placeholder text for the editing form.\n */\n editPlaceholder: {\n type: String,\n default: \"\"\n },\n /**\n * Pins the item to the bottom left area, above the settings. Do not\n * place 'non-pinned' `AppnavigationItem` components below `pinned`\n * ones.\n */\n pinned: {\n type: Boolean,\n default: false\n },\n /**\n * Puts the item in the 'undo' state.\n */\n undo: {\n type: Boolean,\n default: false\n },\n /**\n * The navigation collapsible state (synced)\n */\n open: {\n type: Boolean,\n default: false\n },\n /**\n * The actions menu open state (synced)\n */\n menuOpen: {\n type: Boolean,\n default: false\n },\n /**\n * Force the actions to display in a three dot menu\n */\n forceMenu: {\n type: Boolean,\n default: false\n },\n /**\n * The action's menu default icon\n */\n menuIcon: {\n type: String,\n default: void 0\n },\n /**\n * The action's menu direction\n */\n menuPlacement: {\n type: String,\n default: \"bottom\"\n },\n /**\n * Entry aria details\n */\n ariaDescription: {\n type: String,\n default: null\n },\n /**\n * To be used only when the elements in the actions menu are very important\n */\n forceDisplayActions: {\n type: Boolean,\n default: false\n },\n /**\n * Number of action items outside the menu\n */\n inlineActions: {\n type: Number,\n default: 0\n }\n },\n emits: [\n \"update:menuOpen\",\n \"update:open\",\n \"update:name\",\n \"click\",\n \"undo\"\n ],\n setup() {\n return {\n isMobile: useIsMobile()\n };\n },\n mounted() {\n this.actionsBoundariesElement = document.querySelector(\"#content-vue\") || void 0;\n },\n data() {\n return {\n editingValue: \"\",\n opened: this.open,\n // Collapsible state\n editingActive: false,\n hasChildren: false,\n /**\n * Tracks the open state of the actions menu\n */\n menuOpenLocalValue: false,\n focused: false,\n collapsible: false,\n actionsBoundariesElement: void 0\n };\n },\n computed: {\n isRouterLink() {\n return this.to && !this.href;\n },\n // Checks if the component is already a children of another\n // instance of AppNavigationItem\n canHaveChildren() {\n if (this.$parent.$options._componentTag === \"AppNavigationItem\") {\n return false;\n } else {\n return true;\n }\n },\n hasUtils() {\n if (this.$slots.actions || this.$slots.counter || this.editable || this.undo) {\n return true;\n }\n return false;\n },\n editButtonAriaLabel() {\n return this.editLabel ? this.editLabel : t(\"Edit item\");\n },\n undoButtonAriaLabel() {\n return t(\"Undo changes\");\n }\n },\n watch: {\n open(newVal) {\n this.opened = newVal;\n }\n },\n created() {\n this.updateSlotInfo();\n },\n beforeUpdate() {\n this.updateSlotInfo();\n },\n methods: {\n // sync opened menu state with prop\n onMenuToggle(state) {\n this.$emit(\"update:menuOpen\", state);\n this.menuOpenLocalValue = state;\n },\n // toggle the collapsible state\n toggleCollapse() {\n this.opened = !this.opened;\n this.$emit(\"update:open\", this.opened);\n },\n /**\n * Handle link click\n *\n * @param {PointerEvent} event - Native click event\n * @param {Function} [navigate] - VueRouter link's navigate if any\n * @param {string} [routerLinkHref] - VueRouter link's href\n */\n onClick(event, navigate, routerLinkHref) {\n this.$emit(\"click\", event);\n if (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) {\n return;\n }\n if (routerLinkHref) {\n navigate == null ? void 0 : navigate(event);\n event.preventDefault();\n }\n },\n // Edition methods\n handleEdit() {\n this.editingValue = this.name;\n this.editingActive = true;\n this.onMenuToggle(false);\n this.$nextTick(() => {\n this.$refs.editingInput.focusInput();\n });\n },\n cancelEditing() {\n this.editingActive = false;\n },\n handleEditingDone() {\n this.$emit(\"update:name\", this.editingValue);\n this.editingValue = \"\";\n this.editingActive = false;\n },\n // Undo methods\n handleUndo() {\n this.$emit(\"undo\");\n },\n updateSlotInfo() {\n this.hasChildren = !!this.$slots.default;\n this.collapsible = this.allowCollapse && !!this.$slots.default;\n },\n /**\n * Show actions upon focus\n */\n handleFocus() {\n this.focused = true;\n },\n handleBlur() {\n this.focused = false;\n },\n /**\n * This method checks if the root element of the component is focused and\n * if that's the case it focuses the actions button if available\n *\n * @param {Event} e the keydown event\n */\n handleTab(e) {\n if (!this.$refs.actions) {\n return;\n }\n if (this.focused) {\n e.preventDefault();\n this.$refs.actions.$refs.menuButton.$el.focus();\n this.focused = false;\n } else {\n this.$refs.actions.$refs.menuButton.$el.blur();\n }\n },\n /**\n * Is this an external link\n *\n * @param {string} href The link to check\n * @return {boolean} Whether it is external or not\n */\n isExternal(href) {\n return href && href.match(/[a-z]+:\\/\\//i);\n }\n }\n};\nvar _sfc_render = function render4() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"li\", { staticClass: \"app-navigation-entry-wrapper\", class: {\n \"app-navigation-entry--opened\": _vm.opened,\n \"app-navigation-entry--pinned\": _vm.pinned,\n \"app-navigation-entry--collapsible\": _vm.collapsible\n }, attrs: { \"id\": _vm.id } }, [_c(_vm.isRouterLink ? \"router-link\" : \"NcVNodes\", { tag: \"component\", attrs: { \"custom\": _vm.isRouterLink ? true : false, \"to\": _vm.to, \"exact\": _vm.isRouterLink ? _vm.exact : null }, scopedSlots: _vm._u([{ key: \"default\", fn: function({ href: routerLinkHref, navigate, isActive }) {\n return [_c(\"div\", { staticClass: \"app-navigation-entry\", class: {\n \"app-navigation-entry--editing\": _vm.editingActive,\n \"app-navigation-entry--deleted\": _vm.undo,\n \"active\": isActive && _vm.to || _vm.active\n } }, [!_vm.undo ? _c(\"a\", { staticClass: \"app-navigation-entry-link\", attrs: { \"aria-current\": _vm.active || isActive && _vm.to ? \"page\" : void 0, \"aria-description\": _vm.ariaDescription, \"aria-expanded\": _vm.hasChildren ? _vm.opened.toString() : void 0, \"href\": _vm.href || routerLinkHref || \"#\", \"target\": _vm.isExternal(_vm.href) ? \"_blank\" : void 0, \"title\": _vm.title || _vm.name }, on: { \"blur\": _vm.handleBlur, \"click\": function($event) {\n return _vm.onClick($event, navigate, routerLinkHref);\n }, \"focus\": _vm.handleFocus, \"keydown\": function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"tab\", 9, $event.key, \"Tab\")) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n return _vm.handleTab.apply(null, arguments);\n } } }, [_c(\"div\", { staticClass: \"app-navigation-entry-icon\", class: { [_vm.icon]: _vm.icon } }, [_vm.loading ? _c(\"NcLoadingIcon\") : _vm._t(\"icon\")], 2), !_vm.editingActive ? _c(\"span\", { staticClass: \"app-navigation-entry__name\" }, [_vm._v(\" \" + _vm._s(_vm.name) + \" \")]) : _vm._e(), _vm.editingActive ? _c(\"div\", { staticClass: \"editingContainer\" }, [_c(\"NcInputConfirmCancel\", { ref: \"editingInput\", attrs: { \"placeholder\": _vm.editPlaceholder !== \"\" ? _vm.editPlaceholder : _vm.name, \"primary\": isActive && _vm.to || _vm.active }, on: { \"cancel\": _vm.cancelEditing, \"confirm\": _vm.handleEditingDone }, model: { value: _vm.editingValue, callback: function($$v) {\n _vm.editingValue = $$v;\n }, expression: \"editingValue\" } })], 1) : _vm._e()]) : _vm._e(), _vm.undo ? _c(\"div\", { staticClass: \"app-navigation-entry__deleted\" }, [_c(\"div\", { staticClass: \"app-navigation-entry__deleted-description\" }, [_vm._v(\" \" + _vm._s(_vm.name) + \" \")])]) : _vm._e(), _vm.hasUtils && !_vm.editingActive ? _c(\"div\", { staticClass: \"app-navigation-entry__utils\", class: { \"app-navigation-entry__utils--display-actions\": _vm.forceDisplayActions || _vm.menuOpenLocalValue || _vm.menuOpen } }, [_vm.$slots.counter ? _c(\"div\", { staticClass: \"app-navigation-entry__counter-wrapper\" }, [_vm._t(\"counter\")], 2) : _vm._e(), _vm.$slots.actions || _vm.editable && !_vm.editingActive || _vm.undo ? _c(\"NcActions\", { ref: \"actions\", staticClass: \"app-navigation-entry__actions\", attrs: { \"inline\": _vm.inlineActions, \"container\": \"#app-navigation-vue\", \"boundaries-element\": _vm.actionsBoundariesElement, \"placement\": _vm.menuPlacement, \"open\": _vm.menuOpen, \"type\": isActive && _vm.to || _vm.active ? \"primary\" : null, \"force-menu\": _vm.forceMenu, \"default-icon\": _vm.menuIcon }, on: { \"update:open\": _vm.onMenuToggle }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_vm._t(\"menu-icon\")];\n }, proxy: true }], null, true) }, [_vm.editable && !_vm.editingActive ? _c(\"NcActionButton\", { attrs: { \"aria-label\": _vm.editButtonAriaLabel }, on: { \"click\": _vm.handleEdit }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_c(\"Pencil\", { attrs: { \"size\": 20 } })];\n }, proxy: true }], null, true) }, [_vm._v(\" \" + _vm._s(_vm.editLabel) + \" \")]) : _vm._e(), _vm.undo ? _c(\"NcActionButton\", { attrs: { \"aria-label\": _vm.undoButtonAriaLabel }, on: { \"click\": _vm.handleUndo }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_c(\"Undo\", { attrs: { \"size\": 20 } })];\n }, proxy: true }], null, true) }) : _vm._e(), _vm._t(\"actions\")], 2) : _vm._e()], 1) : _vm._e(), _vm.collapsible ? _c(\"NcAppNavigationIconCollapsible\", { attrs: { \"open\": _vm.opened }, on: { \"click\": function($event) {\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.toggleCollapse.apply(null, arguments);\n } } }) : _vm._e(), _vm._t(\"extra\")], 2)];\n } }], null, true) }), _vm.canHaveChildren && _vm.hasChildren ? _c(\"ul\", { staticClass: \"app-navigation-entry__children\" }, [_vm._t(\"default\")], 2) : _vm._e()], 1);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"018c4203\"\n);\nconst NcAppNavigationItem = __component__.exports;\nexport {\n NcAppNavigationItem as N\n};\n","import '../assets/NcAppNavigationSearch-BLGG_WBn.css';\nimport { useFocusWithin } from \"@vueuse/core\";\nimport { useSlots, ref, watch, nextTick } from \"vue\";\nimport { r as register, m as t41, n as t15, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nimport { C as Close } from \"./Close-B6ccm1RP.mjs\";\nimport NcInputField from \"../Components/NcInputField.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nregister(t15, t41);\nconst __default__ = {\n name: \"NcAppNavigationSearch\",\n model: {\n event: \"update:modelValue\",\n prop: \"modelValue\"\n }\n};\nconst _sfc_main = /* @__PURE__ */ Object.assign(__default__, {\n props: {\n /**\n * Current search input\n */\n modelValue: {\n type: String,\n default: \"\"\n },\n /**\n * Text used to label the search input\n */\n label: {\n type: String,\n default: t(\"Search…\")\n },\n /**\n * Placeholder of the search input\n * By default the value of `label` is used.\n */\n placeholder: {\n type: String,\n default: null\n }\n },\n emits: [\"update:modelValue\"],\n setup(__props, { emit }) {\n const slots = useSlots();\n const inputElement = ref();\n const { focused: inputHasFocus } = useFocusWithin(inputElement);\n const transitionTimeout = Number.parseInt(window.getComputedStyle(window.document.body).getPropertyValue(\"--animation-quick\")) || 100;\n const actionsContainer = ref();\n const hasActions = () => !!slots.actions;\n const showActions = ref(true);\n const timeoutId = ref();\n const hideActions = ref(false);\n watch(inputHasFocus, () => {\n showActions.value = !inputHasFocus.value;\n });\n watch(showActions, (show) => {\n window.clearTimeout(timeoutId.value);\n if (show) {\n hideActions.value = false;\n } else {\n window.setTimeout(() => {\n hideActions.value = !show;\n }, transitionTimeout);\n }\n });\n function onCloseSearch() {\n emit(\"update:modelValue\", \"\");\n if (hasActions()) {\n showActions.value = true;\n nextTick(() => {\n var _a;\n return (_a = actionsContainer.value.querySelector(\"button\")) == null ? void 0 : _a.focus();\n });\n }\n }\n return { __sfc: true, emit, slots, inputElement, inputHasFocus, transitionTimeout, actionsContainer, hasActions, showActions, timeoutId, hideActions, onCloseSearch, t, IconClose: Close, NcInputField };\n }\n});\nvar _sfc_render = function render() {\n var _a;\n var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;\n return _c(\"div\", { staticClass: \"app-navigation-search\", class: {\n \"app-navigation-search--has-actions\": _setup.hasActions()\n } }, [_c(_setup.NcInputField, { ref: \"inputElement\", staticClass: \"app-navigation-search__input\", attrs: { \"aria-label\": _vm.label, \"label-outside\": \"\", \"placeholder\": (_a = _vm.placeholder) != null ? _a : _vm.label, \"show-trailing-button\": \"\", \"trailing-button-label\": _setup.t(\"Clear search\"), \"type\": \"search\", \"value\": _vm.modelValue }, on: { \"update:value\": function($event) {\n return _vm.$emit(\"update:modelValue\", $event);\n }, \"trailing-button-click\": _setup.onCloseSearch }, scopedSlots: _vm._u([{ key: \"trailing-button-icon\", fn: function() {\n return [_c(_setup.IconClose, { attrs: { \"size\": 20 } })];\n }, proxy: true }]) }), _setup.hasActions() ? _c(\"div\", { ref: \"actionsContainer\", staticClass: \"app-navigation-search__actions\", class: {\n \"app-navigation-search__actions--hidden\": !_setup.showActions,\n \"hidden-visually\": _setup.hideActions\n } }, [_vm._t(\"actions\")], 2) : _vm._e()], 1);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"70fd8f35\"\n);\nconst NcAppNavigationSearch = __component__.exports;\nexport {\n NcAppNavigationSearch as N\n};\n","import '../assets/NcMentionBubble-C6t8od-_.css';\nimport '../assets/NcAppNavigationSettings-AzpTlUym.css';\nimport { r as register, v as t43, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nimport clickOutsideOptions from \"../Mixins/clickOutsideOptions.mjs\";\nimport \"../Composables/useIsFullscreen.mjs\";\nimport \"../Composables/useIsMobile.mjs\";\nimport \"@nextcloud/router\";\n/* empty css */\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nimport \"linkify-string\";\nimport \"escape-html\";\nimport \"striptags\";\nimport \"vue\";\nimport \"@nextcloud/auth\";\nimport \"@nextcloud/axios\";\nimport \"@nextcloud/capabilities\";\nimport { vOnClickOutside } from \"@vueuse/components\";\nregister(t43);\nconst _sfc_main$1 = {\n name: \"CogIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$1 = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon cog-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$1 = [];\nvar __component__$1 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$1,\n _sfc_render$1,\n _sfc_staticRenderFns$1,\n false,\n null,\n null\n);\nconst Cog = __component__$1.exports;\nconst _sfc_main = {\n directives: {\n ClickOutside: vOnClickOutside\n },\n components: {\n Cog\n },\n mixins: [\n clickOutsideOptions\n ],\n props: {\n name: {\n type: String,\n required: false,\n default: t(\"Settings\")\n }\n },\n data() {\n return {\n open: false\n };\n },\n computed: {\n clickOutsideConfig() {\n return [\n this.closeMenu,\n this.clickOutsideOptions\n ];\n }\n },\n methods: {\n toggleMenu() {\n this.open = !this.open;\n },\n closeMenu() {\n this.open = false;\n }\n }\n};\nvar _sfc_render = function render2() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"div\", { directives: [{ name: \"click-outside\", rawName: \"v-click-outside\", value: _vm.clickOutsideConfig, expression: \"clickOutsideConfig\" }], class: { open: _vm.open }, attrs: { \"id\": \"app-settings\" } }, [_c(\"div\", { attrs: { \"id\": \"app-settings__header\" } }, [_c(\"button\", { staticClass: \"settings-button\", attrs: { \"type\": \"button\", \"aria-expanded\": _vm.open ? \"true\" : \"false\", \"aria-controls\": \"app-settings__content\" }, on: { \"click\": _vm.toggleMenu } }, [_c(\"Cog\", { staticClass: \"settings-button__icon\", attrs: { \"size\": 20 } }), _c(\"span\", { staticClass: \"settings-button__label\" }, [_vm._v(_vm._s(_vm.name))])], 1)]), _c(\"Transition\", { attrs: { \"name\": \"slide-up\" } }, [_c(\"div\", { directives: [{ name: \"show\", rawName: \"v-show\", value: _vm.open, expression: \"open\" }], attrs: { \"id\": \"app-settings__content\" } }, [_vm._t(\"default\")], 2)])], 1);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"981e215c\"\n);\nconst NcAppNavigationSettings = __component__.exports;\nexport {\n NcAppNavigationSettings as N\n};\n","import '../assets/NcAppSettingsDialog-QF6aTZ3s.css';\nimport { N as NcDialog } from \"./NcDialog-DXRkgfxf.mjs\";\nimport NcVNodes from \"../Components/NcVNodes.mjs\";\nimport { useIsMobile } from \"../Composables/useIsMobile.mjs\";\nimport { r as register, l as t44, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nimport debounce from \"debounce\";\nimport Vue from \"vue\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nregister(t44);\nconst _sfc_main = {\n name: \"NcAppSettingsDialog\",\n components: {\n NcDialog,\n NcVNodes\n },\n provide() {\n return {\n registerSection: this.registerSection,\n unregisterSection: this.unregisterSection\n };\n },\n props: {\n /**\n * Determines the open / closed state of the modal\n */\n open: {\n type: Boolean,\n required: true\n },\n /**\n * Shows the navigation on desktop if true\n */\n showNavigation: {\n type: Boolean,\n default: false\n },\n /**\n * Selector for the popover container\n */\n container: {\n type: String,\n default: \"body\"\n },\n /**\n * Name of the settings\n */\n name: {\n type: String,\n default: \"\"\n },\n /**\n * Additional elements to add to the focus trap\n */\n additionalTrapElements: {\n type: Array,\n default: () => []\n }\n },\n emits: [\"update:open\"],\n setup() {\n return {\n isMobile: useIsMobile()\n };\n },\n data() {\n return {\n selectedSection: \"\",\n linkClicked: false,\n addedScrollListener: false,\n scroller: null,\n /**\n * Currently registered settings sections\n * @type {{ id: string, name: string, icon?: import('vue').VNode[] }[]}\n */\n sections: []\n };\n },\n computed: {\n dialogProperties() {\n return {\n additionalTrapElements: this.additionalTrapElements,\n closeOnClickOutside: true,\n class: \"app-settings\",\n container: this.container,\n contentClasses: \"app-settings__content\",\n size: \"large\",\n name: this.name,\n navigationClasses: \"app-settings__navigation\"\n };\n },\n /**\n * Check if one or more navigation entries provide icons\n */\n hasNavigationIcons() {\n return this.sections.some(({ icon }) => !!icon);\n },\n hasNavigation() {\n if (this.isMobile || !this.showNavigation) {\n return false;\n } else {\n return true;\n }\n },\n settingsNavigationAriaLabel() {\n return t(\"Settings navigation\");\n }\n },\n updated() {\n if (!this.$refs.settingsScroller) {\n return;\n }\n this.scroller = this.$refs.settingsScroller;\n if (!this.addedScrollListener) {\n this.scroller.addEventListener(\"scroll\", this.handleScroll);\n this.addedScrollListener = true;\n }\n },\n methods: {\n /**\n * Called when a new section is registered\n * @param {string} id The section ID\n * @param {string} name The section name\n * @param {import('vue').VNode[]|undefined} icon Optional icon component\n */\n registerSection(id, name, icon) {\n if (this.sections.some(({ id: otherId }) => id === otherId)) {\n throw new Error(\"Duplicate section id found: \".concat(id, \". Settings navigation sections must have unique section ids.\"));\n }\n if (this.sections.some(({ name: otherName }) => name === otherName)) {\n Vue.util.warn(\"Duplicate section name found: \".concat(name, \". Settings navigation sections must have unique section names.\"));\n }\n const newSections = [...this.sections, { id, name, icon }];\n this.sections = newSections.sort(({ id: idA }, { id: idB }) => {\n const indexOf = (id2) => {\n var _a, _b, _c;\n return (_c = (_b = (_a = this.$slots.default) == null ? void 0 : _a.findIndex) == null ? void 0 : _b.call(_a, (vnode) => {\n var _a2, _b2;\n return ((_b2 = (_a2 = vnode == null ? void 0 : vnode.componentOptions) == null ? void 0 : _a2.propsData) == null ? void 0 : _b2.id) === id2;\n })) != null ? _c : -1;\n };\n return indexOf(idA) - indexOf(idB);\n });\n if (this.sections.length === 1) {\n this.selectedSection = id;\n }\n },\n /**\n * Called when a section is unregistered to remove it from dialog\n * @param {string} id The section ID\n */\n unregisterSection(id) {\n var _a, _b;\n this.sections = this.sections.filter(({ id: otherId }) => id !== otherId);\n if (this.selectedSection === id) {\n this.selectedSection = (_b = (_a = this.sections[0]) == null ? void 0 : _a.id) != null ? _b : \"\";\n }\n },\n /**\n * Scrolls the content to the selected settings section.absolute\n *\n * @param {string} item the ID of the section\n */\n handleSettingsNavigationClick(item) {\n this.linkClicked = true;\n document.getElementById(\"settings-section_\" + item).scrollIntoView({\n behavior: \"smooth\",\n inline: \"nearest\"\n });\n this.selectedSection = item;\n setTimeout(() => {\n this.linkClicked = false;\n }, 1e3);\n },\n handleCloseModal(isOpen) {\n if (isOpen) {\n return;\n }\n this.$emit(\"update:open\", false);\n this.scroller.removeEventListener(\"scroll\", this.handleScroll);\n this.addedScrollListener = false;\n this.scroller.scrollTop = 0;\n },\n handleScroll() {\n if (!this.linkClicked) {\n this.unfocusNavigationItem();\n }\n },\n // Remove selected section once the user starts scrolling\n unfocusNavigationItem: debounce(function() {\n this.selectedSection = \"\";\n if (document.activeElement.className.includes(\"navigation-list__link\")) {\n document.activeElement.blur();\n }\n }, 300)\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _vm.open ? _c(\"NcDialog\", _vm._b({ attrs: { \"navigation-aria-label\": _vm.settingsNavigationAriaLabel }, on: { \"update:open\": _vm.handleCloseModal }, scopedSlots: _vm._u([_vm.hasNavigation ? { key: \"navigation\", fn: function({ isCollapsed }) {\n return [!isCollapsed ? _c(\"ul\", { staticClass: \"navigation-list\" }, _vm._l(_vm.sections, function(section) {\n return _c(\"li\", { key: section.id }, [_c(\"a\", { class: {\n \"navigation-list__link\": true,\n \"navigation-list__link--active\": section.id === _vm.selectedSection,\n \"navigation-list__link--icon\": _vm.hasNavigationIcons\n }, attrs: { \"aria-current\": \"\".concat(section.id === _vm.selectedSection), \"href\": \"#settings-section_\".concat(section.id), \"tabindex\": \"0\" }, on: { \"click\": function($event) {\n $event.preventDefault();\n return _vm.handleSettingsNavigationClick(section.id);\n }, \"keydown\": function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"enter\", 13, $event.key, \"Enter\")) return null;\n return _vm.handleSettingsNavigationClick(section.id);\n } } }, [_vm.hasNavigationIcons ? _c(\"div\", { staticClass: \"navigation-list__link-icon\" }, [section.icon ? _c(\"NcVNodes\", { attrs: { \"vnodes\": section.icon } }) : _vm._e()], 1) : _vm._e(), _c(\"span\", { staticClass: \"navigation-list__link-text\" }, [_vm._v(\" \" + _vm._s(section.name) + \" \")])])]);\n }), 0) : _vm._e()];\n } } : null], null, true) }, \"NcDialog\", _vm.dialogProperties, false), [_c(\"div\", { ref: \"settingsScroller\" }, [_vm._t(\"default\")], 2)]) : _vm._e();\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"0674bd2e\"\n);\nconst NcAppSettingsDialog = __component__.exports;\nexport {\n NcAppSettingsDialog as N\n};\n","let urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\nlet customAlphabet = (alphabet, defaultSize = 21) => {\n return (size = defaultSize) => {\n let id = ''\n let i = size\n while (i--) {\n id += alphabet[(Math.random() * alphabet.length) | 0]\n }\n return id\n }\n}\nlet nanoid = (size = 21) => {\n let id = ''\n let i = size\n while (i--) {\n id += urlAlphabet[(Math.random() * 64) | 0]\n }\n return id\n}\nexport { nanoid, customAlphabet }\n","\n/**\n * vue-simple-portal\n * version: 0.1.5,\n * (c) Thorsten Lünborg, 2021 - present\n * LICENCE: Apache-2.0\n * http://github.com/linusborg/vue-simple-portal\n*/\nimport Vue from 'vue';\nimport { nanoid } from 'nanoid/non-secure';\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nvar config = {\n selector: \"vue-portal-target-\".concat(nanoid())\n};\nvar setSelector = function setSelector(selector) {\n return config.selector = selector;\n};\nvar isBrowser = typeof window !== 'undefined' && (typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) !== undefined;\n\nvar TargetContainer = Vue.extend({\n // as an abstract component, it doesn't appear in\n // the $parent chain of components.\n // which means the next parent of any component rendered inside of this oen\n // will be the parent from which is was sent\n // @ts-expect-error\n abstract: true,\n name: 'PortalOutlet',\n props: ['nodes', 'tag'],\n data: function data(vm) {\n return {\n updatedNodes: vm.nodes\n };\n },\n render: function render(h) {\n var nodes = this.updatedNodes && this.updatedNodes();\n if (!nodes) return h();\n return nodes.length === 1 && !nodes[0].text ? nodes : h(this.tag || 'DIV', nodes);\n },\n destroyed: function destroyed() {\n var el = this.$el;\n el && el.parentNode.removeChild(el);\n }\n});\n\nvar Portal = Vue.extend({\n name: 'VueSimplePortal',\n props: {\n disabled: {\n type: Boolean\n },\n prepend: {\n type: Boolean\n },\n selector: {\n type: String,\n default: function _default() {\n return \"#\".concat(config.selector);\n }\n },\n tag: {\n type: String,\n default: 'DIV'\n }\n },\n render: function render(h) {\n if (this.disabled) {\n var nodes = this.$scopedSlots && this.$scopedSlots.default();\n if (!nodes) return h();\n return nodes.length < 2 && !nodes[0].text ? nodes : h(this.tag, nodes);\n }\n\n return h();\n },\n created: function created() {\n if (!this.getTargetEl()) {\n this.insertTargetEl();\n }\n },\n updated: function updated() {\n var _this = this;\n\n // We only update the target container component\n // if the scoped slot function is a fresh one\n // The new slot syntax (since Vue 2.6) can cache unchanged slot functions\n // and we want to respect that here.\n this.$nextTick(function () {\n if (!_this.disabled && _this.slotFn !== _this.$scopedSlots.default) {\n _this.container.updatedNodes = _this.$scopedSlots.default;\n }\n\n _this.slotFn = _this.$scopedSlots.default;\n });\n },\n beforeDestroy: function beforeDestroy() {\n this.unmount();\n },\n watch: {\n disabled: {\n immediate: true,\n handler: function handler(disabled) {\n disabled ? this.unmount() : this.$nextTick(this.mount);\n }\n }\n },\n methods: {\n // This returns the element into which the content should be mounted.\n getTargetEl: function getTargetEl() {\n if (!isBrowser) return;\n return document.querySelector(this.selector);\n },\n insertTargetEl: function insertTargetEl() {\n if (!isBrowser) return;\n var parent = document.querySelector('body');\n var child = document.createElement(this.tag);\n child.id = this.selector.substring(1);\n parent.appendChild(child);\n },\n mount: function mount() {\n if (!isBrowser) return;\n var targetEl = this.getTargetEl();\n var el = document.createElement('DIV');\n\n if (this.prepend && targetEl.firstChild) {\n targetEl.insertBefore(el, targetEl.firstChild);\n } else {\n targetEl.appendChild(el);\n }\n\n this.container = new TargetContainer({\n el: el,\n parent: this,\n propsData: {\n tag: this.tag,\n nodes: this.$scopedSlots.default\n }\n });\n },\n unmount: function unmount() {\n if (this.container) {\n this.container.$destroy();\n delete this.container;\n }\n }\n }\n});\n\nfunction install(_Vue) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _Vue.component(options.name || 'portal', Portal);\n\n if (options.defaultSelector) {\n setSelector(options.defaultSelector);\n }\n}\n\nif (typeof window !== 'undefined' && window.Vue && window.Vue === Vue) {\n // plugin was inlcuded directly in a browser\n Vue.use(install);\n}\n\nexport default install;\nexport { Portal, config, setSelector };\n","import '../assets/NcCheckboxRadioSwitch-D5gP42gi.css';\nimport { r as register } from \"./_l10n-B4dEPXsr.mjs\";\nregister();\n","import '../assets/NcEmptyContent-BU0QVo3d.css';\nimport { n as normalizeComponent } from \"../chunks/_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n name: \"NcEmptyContent\",\n props: {\n /**\n * A header message about an empty content shown\n * @example 'No comments'\n */\n name: {\n type: String,\n default: \"\"\n },\n /**\n * Desription of the empty content\n * @example 'No comments yet, start the conversation!'\n */\n description: {\n type: String,\n default: \"\"\n }\n },\n computed: {\n hasName() {\n return this.name !== \"\";\n },\n /**\n * Check if a description is given as either property or slot\n */\n hasDescription() {\n var _a;\n return this.description !== \"\" || ((_a = this.$slots.description) == null ? void 0 : _a[0]);\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"div\", { staticClass: \"empty-content\", attrs: { \"role\": \"note\" } }, [_vm.$slots.icon ? _c(\"div\", { staticClass: \"empty-content__icon\", attrs: { \"aria-hidden\": \"true\" } }, [_vm._t(\"icon\")], 2) : _vm._e(), _vm._t(\"name\", function() {\n return [_vm.hasName ? _c(\"span\", { staticClass: \"empty-content__name\" }, [_vm._v(\" \" + _vm._s(_vm.name) + \" \")]) : _vm._e()];\n }), _vm.hasDescription ? _c(\"p\", { staticClass: \"empty-content__description\" }, [_vm._t(\"description\", function() {\n return [_vm._v(\" \" + _vm._s(_vm.description) + \" \")];\n })], 2) : _vm._e(), _vm.$slots.action ? _c(\"div\", { staticClass: \"empty-content__action\" }, [_vm._t(\"action\")], 2) : _vm._e()], 2);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"fede0c71\"\n);\nconst NcEmptyContent = __component__.exports;\nexport {\n NcEmptyContent as default\n};\n","import '../assets/NcAppSidebar-CpV7czJx.css';\nimport { Portal } from \"@linusborg/vue-simple-portal\";\nimport NcVNodes from \"../Components/NcVNodes.mjs\";\nimport { N as NcCheckboxRadioSwitch } from \"./NcCheckboxRadioSwitch-D1Iu7jy1.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nimport { N as NcActions } from \"./NcActions-D77YAhAy.mjs\";\nimport NcLoadingIcon from \"../Components/NcLoadingIcon.mjs\";\nimport NcButton from \"../Components/NcButton.mjs\";\nimport NcEmptyContent from \"../Components/NcEmptyContent.mjs\";\nimport { directive } from \"../Directives/Focus.mjs\";\nimport { directive as directive$1 } from \"../Directives/Linkify.mjs\";\nimport { useIsSmallMobile } from \"../Composables/useIsMobile.mjs\";\nimport { G as GenRandomId } from \"./GenRandomId-CMooMQt0.mjs\";\nimport { g as getTrapStack } from \"./focusTrap-Cecv_gjR.mjs\";\nimport { r as register, P as t14, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nimport { A as ArrowRight } from \"./ArrowRight-KsL2PC-o.mjs\";\nimport { C as Close } from \"./Close-B6ccm1RP.mjs\";\nimport { vOnClickOutside } from \"@vueuse/components\";\nimport { createFocusTrap } from \"focus-trap\";\nconst _sfc_main$4 = {\n name: \"NcAppSidebarTabs\",\n components: {\n NcCheckboxRadioSwitch,\n NcVNodes\n },\n provide() {\n return {\n registerTab: this.registerTab,\n unregisterTab: this.unregisterTab,\n // Getter as an alternative to Vue 2.7 computed(() => this.activeTab)\n getActiveTab: () => this.activeTab,\n // Used to check whether the tab header is shown so the tabs can reference the tab header for `aria-labelledby` or not\n isTablistShown: () => this.hasMultipleTabs\n };\n },\n props: {\n /**\n * Id of the tab to activate\n */\n active: {\n type: String,\n default: \"\"\n },\n /**\n * Force the tab navigation to display even if there is only one tab\n */\n forceTabs: {\n type: Boolean,\n default: false\n }\n },\n emits: [\"update:active\"],\n data() {\n return {\n /**\n * Tab descriptions from the passed NcSidebarTab components' props to build the tab navbar from.\n */\n tabs: [],\n /**\n * Local active (open) tab's ID. It allows to use component without active.sync\n */\n activeTab: \"\"\n };\n },\n computed: {\n /**\n * Has multiple tabs. If only one tab - its content is shown without navigation\n *\n * @return {boolean}\n */\n hasMultipleTabs() {\n return this.tabs.length > 1;\n },\n showForSingleTab() {\n return this.forceTabs && this.tabs.length === 1;\n },\n currentTabIndex() {\n return this.tabs.findIndex((tab) => tab.id === this.activeTab);\n }\n },\n watch: {\n active(active) {\n if (active !== this.activeTab) {\n this.updateActive();\n }\n }\n },\n methods: {\n /**\n * Set the current active tab\n *\n * @param {string} id the id of the tab\n */\n setActive(id) {\n this.activeTab = id;\n this.$emit(\"update:active\", this.activeTab);\n },\n /**\n * Focus the previous tab\n * and emit to the parent component\n */\n focusPreviousTab() {\n if (this.currentTabIndex > 0) {\n this.setActive(this.tabs[this.currentTabIndex - 1].id);\n }\n this.focusActiveTab();\n },\n /**\n * Focus the next tab\n * and emit to the parent component\n */\n focusNextTab() {\n if (this.currentTabIndex < this.tabs.length - 1) {\n this.setActive(this.tabs[this.currentTabIndex + 1].id);\n }\n this.focusActiveTab();\n },\n /**\n * Focus the first tab\n * and emit to the parent component\n */\n focusFirstTab() {\n this.setActive(this.tabs[0].id);\n this.focusActiveTab();\n },\n /**\n * Focus the last tab\n * and emit to the parent component\n */\n focusLastTab() {\n this.setActive(this.tabs[this.tabs.length - 1].id);\n this.focusActiveTab();\n },\n /**\n * Focus the current active tab\n */\n focusActiveTab() {\n this.$el.querySelector(\"#tab-button-\".concat(this.activeTab)).focus();\n },\n /**\n * Focus the content on tab\n * see aria accessibility guidelines\n */\n focusActiveTabContent() {\n this.$el.querySelector(\"#tab-\" + this.activeTab).focus();\n },\n /**\n * Update the current active tab\n */\n updateActive() {\n this.activeTab = this.active && this.tabs.some((tab) => tab.id === this.active) ? this.active : this.tabs.length > 0 ? this.tabs[0].id : \"\";\n },\n /**\n * Register child tab in the tabs\n *\n * @param {object} tab child tab passed to slot\n */\n registerTab(tab) {\n this.tabs.push(tab);\n this.tabs.sort((a, b) => {\n if (a.order === b.order) {\n return OC.Util.naturalSortCompare(a.name, b.name);\n }\n return a.order - b.order;\n });\n this.updateActive();\n },\n /**\n * Unregister child tab from the tabs\n *\n * @param {string} id tab's id\n */\n unregisterTab(id) {\n const tabIndex = this.tabs.findIndex((tab) => tab.id === id);\n if (tabIndex !== -1) {\n this.tabs.splice(tabIndex, 1);\n }\n if (this.activeTab === id) {\n this.updateActive();\n }\n }\n }\n};\nvar _sfc_render$4 = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"div\", { staticClass: \"app-sidebar-tabs\" }, [_vm.hasMultipleTabs || _vm.showForSingleTab ? _c(\"div\", { staticClass: \"app-sidebar-tabs__nav\", attrs: { \"role\": \"tablist\" }, on: { \"keydown\": [function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"left\", 37, $event.key, [\"Left\", \"ArrowLeft\"])) return null;\n if (\"button\" in $event && $event.button !== 0) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.focusPreviousTab.apply(null, arguments);\n }, function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"right\", 39, $event.key, [\"Right\", \"ArrowRight\"])) return null;\n if (\"button\" in $event && $event.button !== 2) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.focusNextTab.apply(null, arguments);\n }, function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"tab\", 9, $event.key, \"Tab\")) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.focusActiveTabContent.apply(null, arguments);\n }, function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"home\", void 0, $event.key, void 0)) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.focusFirstTab.apply(null, arguments);\n }, function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"end\", void 0, $event.key, void 0)) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.focusLastTab.apply(null, arguments);\n }, function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"page-up\", void 0, $event.key, void 0)) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.focusFirstTab.apply(null, arguments);\n }, function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"page-down\", void 0, $event.key, void 0)) return null;\n if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) return null;\n $event.preventDefault();\n $event.stopPropagation();\n return _vm.focusLastTab.apply(null, arguments);\n }] } }, _vm._l(_vm.tabs, function(tab) {\n return _c(\"NcCheckboxRadioSwitch\", { key: tab.id, staticClass: \"app-sidebar-tabs__tab\", class: { active: tab.id === _vm.activeTab }, attrs: { \"aria-controls\": \"tab-\".concat(tab.id), \"aria-selected\": String(_vm.activeTab === tab.id), \"button-variant\": true, \"checked\": _vm.activeTab === tab.id, \"wrapper-id\": \"tab-button-\".concat(tab.id), \"tabindex\": _vm.activeTab === tab.id ? 0 : -1, \"button-variant-grouped\": \"horizontal\", \"role\": \"tab\", \"type\": \"button\" }, on: { \"update:checked\": function($event) {\n return _vm.setActive(tab.id);\n } }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_c(\"NcVNodes\", { attrs: { \"vnodes\": tab.renderIcon() } }, [_c(\"span\", { staticClass: \"app-sidebar-tabs__tab-icon\", class: tab.icon })])];\n }, proxy: true }], null, true) }, [_c(\"span\", { staticClass: \"app-sidebar-tabs__tab-caption\" }, [_vm._v(\" \" + _vm._s(tab.name) + \" \")])]);\n }), 1) : _vm._e(), _c(\"div\", { staticClass: \"app-sidebar-tabs__content\", class: { \"app-sidebar-tabs__content--multiple\": _vm.hasMultipleTabs } }, [_vm._t(\"default\")], 2)]);\n};\nvar _sfc_staticRenderFns$4 = [];\nvar __component__$4 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$4,\n _sfc_render$4,\n _sfc_staticRenderFns$4,\n false,\n null,\n \"77326a9c\"\n);\nconst NcAppSidebarTabs = __component__$4.exports;\nregister(t14);\nconst _sfc_main$3 = {\n name: \"DockRightIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$3 = function render2() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon dock-right-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M20 4H4A2 2 0 0 0 2 6V18A2 2 0 0 0 4 20H20A2 2 0 0 0 22 18V6A2 2 0 0 0 20 4M15 18H4V6H15Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$3 = [];\nvar __component__$3 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$3,\n _sfc_render$3,\n _sfc_staticRenderFns$3,\n false,\n null,\n null\n);\nconst IconDockRight = __component__$3.exports;\nconst _sfc_main$2 = {\n name: \"StarIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$2 = function render3() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon star-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$2 = [];\nvar __component__$2 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$2,\n _sfc_render$2,\n _sfc_staticRenderFns$2,\n false,\n null,\n null\n);\nconst Star = __component__$2.exports;\nconst _sfc_main$1 = {\n name: \"StarOutlineIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render$1 = function render4() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon star-outline-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M12,15.39L8.24,17.66L9.23,13.38L5.91,10.5L10.29,10.13L12,6.09L13.71,10.13L18.09,10.5L14.77,13.38L15.76,17.66M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns$1 = [];\nvar __component__$1 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$1,\n _sfc_render$1,\n _sfc_staticRenderFns$1,\n false,\n null,\n null\n);\nconst StarOutline = __component__$1.exports;\nconst _sfc_main = {\n name: \"NcAppSidebar\",\n components: {\n Teleport: Portal,\n NcActions,\n NcAppSidebarTabs,\n ArrowRight,\n IconDockRight,\n NcButton,\n NcLoadingIcon,\n NcEmptyContent,\n Close,\n Star,\n StarOutline\n },\n directives: {\n focus: directive,\n linkify: directive$1,\n ClickOutside: vOnClickOutside\n },\n inject: {\n ncContentSelector: {\n from: \"NcContent:selector\",\n default: void 0\n }\n },\n props: {\n active: {\n type: String,\n default: \"\"\n },\n name: {\n type: String,\n default: \"\",\n required: true\n },\n /**\n * Allow to edit the sidebar name.\n */\n nameEditable: {\n type: Boolean,\n default: false\n },\n namePlaceholder: {\n type: String,\n default: \"\"\n },\n subname: {\n type: String,\n default: \"\"\n },\n /**\n * Title to display for the subname.\n */\n subtitle: {\n type: String,\n default: \"\"\n },\n /**\n * Url to the top header background image\n * Applied with css\n */\n background: {\n type: String,\n default: \"\"\n },\n /**\n * Enable the favourite icon if not null\n * See fired events\n */\n starred: {\n type: Boolean,\n default: null\n },\n /**\n * Show loading spinner instead of the star icon\n */\n starLoading: {\n type: Boolean,\n default: false\n },\n /**\n * Show loading spinner instead of tabs\n */\n loading: {\n type: Boolean,\n default: false\n },\n /**\n * Display the sidebar in compact mode\n */\n compact: {\n type: Boolean,\n default: false\n },\n /**\n * Only display close button and default slot content.\n * Don't display other header content and primary and secondary actions.\n * Useful when showing the EmptyContent component as content.\n */\n empty: {\n type: Boolean,\n default: false\n },\n /**\n * Force the actions to display in a three dot menu\n */\n forceMenu: {\n type: Boolean,\n default: false\n },\n /**\n * Force the tab navigation to display even if there is only one tab\n */\n forceTabs: {\n type: Boolean,\n default: false\n },\n /**\n * Linkify the name\n */\n linkifyName: {\n type: Boolean,\n default: false\n },\n /**\n * Title to display for the name.\n * Can be set to the same text in case it's too long.\n */\n title: {\n type: String,\n default: \"\"\n },\n /**\n * Allow to conditionally show the sidebar\n * You can also use `v-if` on the sidebar, but using the open prop allow to keep\n * the sidebar inside the DOM for performance if it is opened and closed multiple times.\n *\n * When using the `open` property to close the sidebar a built-in toggle button will be shown to reopen it,\n * similar to the app navigation. You can remove this button with the `no-toggle` prop.\n */\n open: {\n type: Boolean,\n default: true\n },\n /**\n * Custom classes to assign to the sidebar toggle button.\n * If needed this can be used to assign styles to the button using `:deep()` selector.\n */\n toggleClasses: {\n type: [String, Array, Object],\n default: \"\"\n },\n /**\n * Custom attrs to assign to the sidebar toggle button.\n */\n toggleAttrs: {\n type: Object,\n default: void 0\n },\n /**\n * Do not add the built-in toggle button with `open` prop.\n */\n noToggle: {\n type: Boolean,\n default: false\n }\n },\n emits: [\n \"close\",\n \"closing\",\n \"closed\",\n \"opening\",\n \"opened\",\n \"figure-click\",\n \"update:active\",\n \"update:name\",\n \"update:nameEditable\",\n \"update:open\",\n \"update:starred\",\n \"submit-name\",\n \"dismiss-editing\"\n ],\n setup() {\n return {\n uid: GenRandomId(),\n isMobile: useIsSmallMobile()\n };\n },\n data() {\n return {\n changeNameTranslated: t(\"Change name\"),\n closeTranslated: t(\"Close sidebar\"),\n favoriteTranslated: t(\"Favorite\"),\n isStarred: this.starred,\n focusTrap: null,\n elementToReturnFocus: null\n };\n },\n computed: {\n canStar() {\n return this.isStarred !== null;\n },\n hasFigure() {\n return this.$slots.header || this.background;\n },\n hasFigureClickListener() {\n return this.$listeners[\"figure-click\"];\n }\n },\n watch: {\n starred() {\n this.isStarred = this.starred;\n },\n isMobile() {\n this.toggleFocusTrap();\n },\n open() {\n this.checkToggleButtonContainerAvailability();\n }\n },\n created() {\n this.preserveElementToReturnFocus();\n this.checkToggleButtonContainerAvailability();\n },\n beforeDestroy() {\n var _a;\n this.$emit(\"closed\");\n (_a = this.focusTrap) == null ? void 0 : _a.deactivate();\n },\n methods: {\n t,\n preserveElementToReturnFocus() {\n if (document.activeElement && document.activeElement !== document.body) {\n this.elementToReturnFocus = document.activeElement;\n if (this.elementToReturnFocus.getAttribute(\"role\") === \"menuitem\") {\n const menu = this.elementToReturnFocus.closest('[role=\"menu\"]');\n if (menu) {\n const menuTrigger = document.querySelector('[aria-controls=\"'.concat(menu.id, '\"]'));\n this.elementToReturnFocus = menuTrigger;\n }\n }\n }\n },\n initFocusTrap() {\n if (this.focusTrap) {\n return;\n }\n this.focusTrap = createFocusTrap([\n // The sidebar itself\n this.$refs.sidebar,\n // Nextcloud Server header navigarion\n document.querySelector(\"#header\")\n ], {\n allowOutsideClick: true,\n fallbackFocus: this.$refs.closeButton,\n trapStack: getTrapStack(),\n escapeDeactivates: false\n });\n },\n /**\n * Activate focus trap if it is currently needed, otherwise deactivate\n */\n toggleFocusTrap() {\n var _a;\n if (this.open && this.isMobile) {\n this.initFocusTrap();\n this.focusTrap.activate();\n } else {\n (_a = this.focusTrap) == null ? void 0 : _a.deactivate();\n }\n },\n /**\n * Close the sidebar on pressing the escape key on mobile\n *\n * @param {KeyboardEvent} event key down event\n */\n onKeydownEsc(event) {\n if (this.isMobile) {\n event.stopPropagation();\n this.closeSidebar();\n }\n },\n onBeforeEnter(element) {\n this.$emit(\"opening\", element);\n },\n onAfterEnter(element) {\n if (this.elementToReturnFocus) {\n this.focus();\n }\n this.toggleFocusTrap();\n this.$emit(\"opened\", element);\n },\n onBeforeLeave(element) {\n this.$emit(\"closing\", element);\n },\n onAfterLeave(element) {\n var _a;\n this.$emit(\"closed\", element);\n this.toggleFocusTrap();\n (_a = this.elementToReturnFocus) == null ? void 0 : _a.focus({ focusVisible: true });\n this.elementToReturnFocus = null;\n },\n /**\n * Used to tell parent component the user asked to close the sidebar\n *\n * @param {Event} e close icon click event\n */\n closeSidebar(e) {\n this.$emit(\"close\", e);\n this.$emit(\"update:open\", false);\n },\n /**\n * Emit figure click event to parent component\n *\n * @param {Event} e click event\n */\n onFigureClick(e) {\n this.$emit(\"figure-click\", e);\n },\n /**\n * Toggle the favourite state\n * and emit to the parent component\n */\n toggleStarred() {\n this.isStarred = !this.isStarred;\n this.$emit(\"update:starred\", this.isStarred);\n },\n editName() {\n this.$emit(\"update:nameEditable\", true);\n if (this.nameEditable) {\n this.$nextTick(\n () => this.$refs.nameInput.focus()\n );\n }\n },\n /**\n * Focus the sidebar\n * @public\n */\n focus() {\n this.$refs.header.focus();\n },\n /**\n * Focus the active tab\n * @public\n */\n focusActiveTabContent() {\n this.preserveElementToReturnFocus();\n this.$refs.tabs.focusActiveTabContent();\n },\n /**\n * Check if the toggle button container is available\n */\n checkToggleButtonContainerAvailability() {\n if (this.open === false && !this.noToggle && !this.ncContentSelector) {\n console.warn(\n \"[NcAppSidebar] It looks like you want to use NcAppSidebar with the built-in toggle button. This feature is only available when NcAppSidebar is used in NcContent.\"\n );\n }\n },\n /**\n * Emit name change event to parent component\n *\n * @param {Event} event input event\n */\n onNameInput(event) {\n this.$emit(\"update:name\", event.target.value);\n },\n /**\n * Emit when the name form edit confirm button is pressed in order\n * to change the name.\n *\n * @param {Event} event submit event\n */\n onSubmitName(event) {\n this.$emit(\"update:nameEditable\", false);\n this.$emit(\"submit-name\", event);\n },\n onDismissEditing() {\n this.$emit(\"update:nameEditable\", false);\n this.$emit(\"dismiss-editing\");\n },\n onUpdateActive(activeTab) {\n this.$emit(\"update:active\", activeTab);\n }\n }\n};\nvar _sfc_render = function render5() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"transition\", { attrs: { \"appear\": \"\", \"name\": \"slide-right\" }, on: { \"before-enter\": _vm.onBeforeEnter, \"after-enter\": _vm.onAfterEnter, \"before-leave\": _vm.onBeforeLeave, \"after-leave\": _vm.onAfterLeave } }, [_c(\"aside\", { directives: [{ name: \"show\", rawName: \"v-show\", value: _vm.open, expression: \"open\" }], ref: \"sidebar\", staticClass: \"app-sidebar\", attrs: { \"id\": \"app-sidebar-vue\", \"aria-labelledby\": \"app-sidebar-vue-\".concat(_vm.uid, \"__header\") }, on: { \"keydown\": function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"esc\", 27, $event.key, [\"Esc\", \"Escape\"])) return null;\n return _vm.onKeydownEsc.apply(null, arguments);\n } } }, [_vm.ncContentSelector && !_vm.open && !_vm.noToggle ? _c(\"Teleport\", { attrs: { \"selector\": _vm.ncContentSelector } }, [_c(\"NcButton\", _vm._b({ staticClass: \"app-sidebar__toggle\", class: _vm.toggleClasses, attrs: { \"aria-label\": _vm.t(\"Open sidebar\"), \"type\": \"tertiary\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"update:open\", true);\n } }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_vm._t(\"toggle-icon\", function() {\n return [_c(\"IconDockRight\", { attrs: { \"size\": 20 } })];\n })];\n }, proxy: true }], null, true) }, \"NcButton\", _vm.toggleAttrs, false))], 1) : _vm._e(), _c(\"header\", { staticClass: \"app-sidebar-header\", class: {\n \"app-sidebar-header--with-figure\": _vm.hasFigure,\n \"app-sidebar-header--compact\": _vm.compact\n } }, [_c(\"div\", { staticClass: \"app-sidebar-header__info\" }, [_vm.hasFigure && !_vm.empty ? _c(\"div\", { staticClass: \"app-sidebar-header__figure\", class: {\n \"app-sidebar-header__figure--with-action\": _vm.hasFigureClickListener\n }, style: {\n backgroundImage: \"url(\".concat(_vm.background, \")\")\n }, attrs: { \"tabindex\": \"0\" }, on: { \"click\": _vm.onFigureClick, \"keydown\": function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"enter\", 13, $event.key, \"Enter\")) return null;\n return _vm.onFigureClick.apply(null, arguments);\n } } }, [_vm._t(\"header\")], 2) : _vm._e(), !_vm.empty ? _c(\"div\", { staticClass: \"app-sidebar-header__desc\", class: {\n \"app-sidebar-header__desc--with-tertiary-action\": _vm.canStar || _vm.$slots[\"tertiary-actions\"],\n \"app-sidebar-header__desc--editable\": _vm.nameEditable && !_vm.subname,\n \"app-sidebar-header__desc--with-subname--editable\": _vm.nameEditable && _vm.subname,\n \"app-sidebar-header__desc--without-actions\": !_vm.$slots[\"secondary-actions\"]\n } }, [_vm.canStar || _vm.$slots[\"tertiary-actions\"] ? _c(\"div\", { staticClass: \"app-sidebar-header__tertiary-actions\" }, [_vm._t(\"tertiary-actions\", function() {\n return [_vm.canStar ? _c(\"NcButton\", { staticClass: \"app-sidebar-header__star\", attrs: { \"aria-label\": _vm.favoriteTranslated, \"pressed\": _vm.isStarred, \"type\": \"secondary\" }, on: { \"click\": function($event) {\n $event.preventDefault();\n return _vm.toggleStarred.apply(null, arguments);\n } }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_vm.starLoading ? _c(\"NcLoadingIcon\") : _vm.isStarred ? _c(\"Star\", { attrs: { \"size\": 20 } }) : _c(\"StarOutline\", { attrs: { \"size\": 20 } })];\n }, proxy: true }], null, false, 2575459756) }) : _vm._e()];\n })], 2) : _vm._e(), _c(\"div\", { staticClass: \"app-sidebar-header__name-container\" }, [_c(\"div\", { staticClass: \"app-sidebar-header__mainname-container\" }, [_c(\"h2\", { directives: [{ name: \"show\", rawName: \"v-show\", value: !_vm.nameEditable, expression: \"!nameEditable\" }, { name: \"linkify\", rawName: \"v-linkify\", value: { text: _vm.name, linkify: _vm.linkifyName }, expression: \"{text: name, linkify: linkifyName}\" }], ref: \"header\", staticClass: \"app-sidebar-header__mainname\", attrs: { \"id\": \"app-sidebar-vue-\".concat(_vm.uid, \"__header\"), \"aria-label\": _vm.title, \"title\": _vm.title, \"tabindex\": _vm.nameEditable ? 0 : -1 }, on: { \"click\": function($event) {\n if ($event.target !== $event.currentTarget) return null;\n return _vm.editName.apply(null, arguments);\n } } }, [_vm._v(\" \" + _vm._s(_vm.name) + \" \")]), _vm.nameEditable ? [_c(\"form\", { directives: [{ name: \"click-outside\", rawName: \"v-click-outside\", value: () => _vm.onSubmitName(), expression: \"() => onSubmitName()\" }], staticClass: \"app-sidebar-header__mainname-form\", on: { \"submit\": function($event) {\n $event.preventDefault();\n return _vm.onSubmitName.apply(null, arguments);\n } } }, [_c(\"input\", { directives: [{ name: \"focus\", rawName: \"v-focus\" }], ref: \"nameInput\", staticClass: \"app-sidebar-header__mainname-input\", attrs: { \"type\": \"text\", \"placeholder\": _vm.namePlaceholder }, domProps: { \"value\": _vm.name }, on: { \"keydown\": function($event) {\n if (!$event.type.indexOf(\"key\") && _vm._k($event.keyCode, \"esc\", 27, $event.key, [\"Esc\", \"Escape\"])) return null;\n $event.stopPropagation();\n return _vm.onDismissEditing.apply(null, arguments);\n }, \"input\": _vm.onNameInput } }), _c(\"NcButton\", { attrs: { \"type\": \"tertiary-no-background\", \"aria-label\": _vm.changeNameTranslated, \"native-type\": \"submit\" }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_c(\"ArrowRight\", { attrs: { \"size\": 20 } })];\n }, proxy: true }], null, false, 1252225425) })], 1)] : _vm._e(), _vm.$slots[\"secondary-actions\"] ? _c(\"NcActions\", { staticClass: \"app-sidebar-header__menu\", attrs: { \"force-menu\": _vm.forceMenu } }, [_vm._t(\"secondary-actions\")], 2) : _vm._e()], 2), _vm.subname.trim() !== \"\" || _vm.$slots[\"subname\"] ? _c(\"p\", { staticClass: \"app-sidebar-header__subname\", attrs: { \"title\": _vm.subtitle || void 0 } }, [_vm._t(\"subname\", function() {\n return [_vm._v(\" \" + _vm._s(_vm.subname) + \" \")];\n })], 2) : _vm._e()])]) : _vm._e()]), _c(\"NcButton\", { ref: \"closeButton\", staticClass: \"app-sidebar__close\", attrs: { \"title\": _vm.closeTranslated, \"aria-label\": _vm.closeTranslated, \"type\": \"tertiary\" }, on: { \"click\": function($event) {\n $event.preventDefault();\n return _vm.closeSidebar.apply(null, arguments);\n } }, scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_c(\"Close\", { attrs: { \"size\": 20 } })];\n }, proxy: true }]) }), _vm.$slots[\"description\"] && !_vm.empty ? _c(\"div\", { staticClass: \"app-sidebar-header__description\" }, [_vm._t(\"description\")], 2) : _vm._e()], 1), _c(\"NcAppSidebarTabs\", { directives: [{ name: \"show\", rawName: \"v-show\", value: !_vm.loading, expression: \"!loading\" }], ref: \"tabs\", attrs: { \"active\": _vm.active, \"force-tabs\": _vm.forceTabs }, on: { \"update:active\": _vm.onUpdateActive } }, [_vm._t(\"default\")], 2), _vm.loading ? _c(\"NcEmptyContent\", { scopedSlots: _vm._u([{ key: \"icon\", fn: function() {\n return [_c(\"NcLoadingIcon\", { attrs: { \"size\": 64 } })];\n }, proxy: true }], null, false, 826850984) }) : _vm._e()], 1)]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"2d142c0a\"\n);\nconst NcAppSidebar = __component__.exports;\nexport {\n NcAppSidebar as N\n};\n","import '../assets/NcCollectionList-ETQTqkqt.css';\nimport debounce from \"debounce\";\nimport { ref, set } from \"vue\";\nimport { r as register, I as t7, J as t27, a as t } from \"./_l10n-B4dEPXsr.mjs\";\nimport { N as NcAvatar } from \"./NcAvatar-BFV6oZYX.mjs\";\nimport { N as NcSelect } from \"./NcSelect-kmuffooC.mjs\";\nimport { g as getRoute } from \"./autolink-cbuFALXr.mjs\";\nimport { N as NcActions } from \"./NcActions-D77YAhAy.mjs\";\nimport NcActionButton from \"../Components/NcActionButton.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nimport axios from \"@nextcloud/axios\";\nimport { generateOcsUrl } from \"@nextcloud/router\";\nregister(t7);\nregister(t27);\nconst _sfc_main$1 = {\n name: \"NcCollectionListItem\",\n components: {\n NcAvatar,\n NcActions,\n NcActionButton\n },\n props: {\n collection: {\n type: Object,\n default: null\n },\n error: {\n type: String,\n default: void 0\n }\n },\n emits: [\"remove-resource\", \"rename-collection\"],\n data() {\n return {\n detailsOpen: false,\n newName: null\n };\n },\n computed: {\n getIcon() {\n return (resource) => [resource.iconClass];\n },\n typeClass() {\n return (resource) => \"resource-type-\" + resource.type;\n },\n resources() {\n var _a, _b;\n return (_b = (_a = this.collection.resources) == null ? void 0 : _a.filter((resource) => !Array.isArray(resource))) != null ? _b : [];\n },\n getComponent() {\n return (resource) => {\n const route = getRoute(this.$router, resource.link);\n return route ? { component: \"router-link\", to: route, href: void 0 } : { component: \"a\", to: void 0, href: resource.link };\n };\n },\n iconUrl() {\n return (resource) => {\n if (resource.mimetype) {\n return OC.MimeType.getIconUrl(resource.mimetype);\n }\n if (resource.iconUrl) {\n return resource.iconUrl;\n }\n return \"\";\n };\n }\n },\n methods: {\n t,\n toggleDetails() {\n this.detailsOpen = !this.detailsOpen;\n },\n showDetails() {\n this.detailsOpen = true;\n },\n removeResource(collection, resource) {\n this.$emit(\"remove-resource\", {\n collectionId: collection.id,\n resourceType: resource.type,\n resourceId: resource.id\n });\n },\n openRename() {\n this.newName = this.collection.name;\n },\n renameCollection() {\n if (this.newName) {\n this.$emit(\"rename-collection\", {\n collectionId: this.collection.id,\n name: this.newName\n });\n }\n this.newName = null;\n }\n }\n};\nvar _sfc_render$1 = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"li\", { staticClass: \"collection-list-item\" }, [_c(\"NcAvatar\", { staticClass: \"collection-avatar\", attrs: { \"display-name\": _vm.collection.name, \"allow-placeholder\": \"\" } }), _vm.newName === null ? _c(\"span\", { staticClass: \"collection-item-name\", attrs: { \"title\": \"\" }, on: { \"click\": _vm.showDetails } }, [_vm._v(_vm._s(_vm.collection.name))]) : _c(\"form\", { class: { \"should-shake\": _vm.error }, on: { \"submit\": function($event) {\n $event.preventDefault();\n return _vm.renameCollection.apply(null, arguments);\n } } }, [_c(\"input\", { directives: [{ name: \"model\", rawName: \"v-model\", value: _vm.newName, expression: \"newName\" }], attrs: { \"type\": \"text\", \"autocomplete\": \"off\", \"autocapitalize\": \"off\" }, domProps: { \"value\": _vm.newName }, on: { \"input\": function($event) {\n if ($event.target.composing) return;\n _vm.newName = $event.target.value;\n } } }), _c(\"input\", { staticClass: \"icon-confirm\", attrs: { \"type\": \"submit\", \"value\": \"\" } })]), !_vm.detailsOpen && _vm.newName === null ? _c(\"div\", { staticClass: \"linked-icons\" }, _vm._l(_vm.resources.slice(0, 2), function(resource) {\n return _c(_vm.getComponent(resource).component, { key: resource.type + \"|\" + resource.id, tag: \"component\", class: _vm.typeClass(resource), attrs: { \"title\": resource.name, \"to\": _vm.getComponent(resource).to, \"href\": _vm.getComponent(resource).href } }, [_c(\"img\", { attrs: { \"src\": _vm.iconUrl(resource), \"alt\": resource.name } })]);\n }), 1) : _vm._e(), _vm.newName === null ? _c(\"span\", { staticClass: \"sharingOptionsGroup\" }, [_c(\"NcActions\", [_c(\"NcActionButton\", { attrs: { \"icon\": \"icon-info\" }, on: { \"click\": function($event) {\n $event.preventDefault();\n return _vm.toggleDetails.apply(null, arguments);\n } } }, [_vm._v(\" \" + _vm._s(_vm.detailsOpen ? _vm.t(\"Hide details\") : _vm.t(\"Show details\")) + \" \")]), _c(\"NcActionButton\", { attrs: { \"icon\": \"icon-rename\" }, on: { \"click\": function($event) {\n $event.preventDefault();\n return _vm.openRename.apply(null, arguments);\n } } }, [_vm._v(\" \" + _vm._s(_vm.t(\"Rename project\")) + \" \")])], 1)], 1) : _vm._e(), _c(\"transition\", { attrs: { \"name\": \"fade\" } }, [_vm.error ? _c(\"div\", { staticClass: \"error\" }, [_vm._v(\" \" + _vm._s(_vm.error) + \" \")]) : _vm._e()]), _c(\"transition\", { attrs: { \"name\": \"fade\" } }, [_vm.detailsOpen ? _c(\"ul\", { staticClass: \"resource-list-details\" }, _vm._l(_vm.resources, function(resource) {\n return _c(\"li\", { key: resource.type + \"|\" + resource.id, class: _vm.typeClass(resource) }, [_c(_vm.getComponent(resource).component, { tag: \"component\", attrs: { \"to\": _vm.getComponent(resource).to, \"href\": _vm.getComponent(resource).href } }, [_c(\"img\", { attrs: { \"src\": _vm.iconUrl(resource), \"alt\": resource.name } }), _c(\"span\", { staticClass: \"resource-name\" }, [_vm._v(_vm._s(resource.name || \"\"))])]), _c(\"span\", { staticClass: \"icon-close\", on: { \"click\": function($event) {\n return _vm.removeResource(_vm.collection, resource);\n } } })], 1);\n }), 0) : _vm._e()])], 1);\n};\nvar _sfc_staticRenderFns$1 = [];\nvar __component__$1 = /* @__PURE__ */ normalizeComponent(\n _sfc_main$1,\n _sfc_render$1,\n _sfc_staticRenderFns$1,\n false,\n null,\n \"878b819f\"\n);\nconst NcCollectionListItem = __component__$1.exports;\nfunction extractOcsData(response) {\n return response.data.ocs.data;\n}\nfunction renameCollectionService(collectionId, collectionName) {\n return axios.put(generateOcsUrl(\"collaboration/resources/collections/{collectionId}\", { collectionId }), { collectionName }).then(extractOcsData);\n}\nfunction getCollectionsByResourceService(resourceType, resourceId) {\n return axios.get(generateOcsUrl(\"collaboration/resources/{resourceType}/{resourceId}\", { resourceType, resourceId })).then(extractOcsData);\n}\nfunction createCollectionService(resourceType, resourceId, name) {\n return axios.post(generateOcsUrl(\"collaboration/resources/{resourceType}/{resourceId}\", { resourceType, resourceId }), { name }).then(extractOcsData);\n}\nfunction addResourceService(collectionId, resourceType, resourceId) {\n return axios.post(generateOcsUrl(\"collaboration/resources/collections/{collectionId}\", { collectionId }), { resourceType, resourceId }).then(extractOcsData);\n}\nfunction removeResourceService(collectionId, resourceType, resourceId) {\n return axios.delete(generateOcsUrl(\"collaboration/resources/collections/{collectionId}\", { collectionId }), { params: { resourceType, resourceId } }).then(extractOcsData);\n}\nfunction searchService(query) {\n return axios.get(generateOcsUrl(\"collaboration/resources/collections/search/{query}\", { query })).then(extractOcsData);\n}\nfunction useCollections() {\n const storedCollections = ref([]);\n const addCollections = (collections) => {\n set(storedCollections, \"value\", collections);\n };\n const addCollection = (collection) => {\n set(storedCollections, \"value\", [...storedCollections.value, collection]);\n };\n const removeCollection = (collectionId) => {\n set(storedCollections, \"value\", storedCollections.value.filter((item) => item.id !== collectionId));\n };\n const updateCollection = (collection) => {\n const index = storedCollections.value.findIndex((item) => item.id === collection.id);\n if (index !== -1) {\n set(storedCollections.value, index, collection);\n } else {\n addCollection(collection);\n }\n };\n const fetchCollectionsByResource = async ({ resourceType, resourceId }) => {\n const collections = await getCollectionsByResourceService(resourceType, resourceId);\n addCollections(collections);\n };\n const createCollection = async ({ baseResourceType, baseResourceId, resourceType, resourceId, name }) => {\n const collection = await createCollectionService(baseResourceType, baseResourceId, name);\n addCollection(collection);\n await addResourceToCollection({\n collectionId: collection.id,\n resourceType,\n resourceId\n });\n };\n const renameCollection = async ({ collectionId, name }) => {\n const collection = await renameCollectionService(collectionId, name);\n updateCollection(collection);\n };\n const addResourceToCollection = async ({ collectionId, resourceType, resourceId }) => {\n const collection = await addResourceService(collectionId, resourceType, String(resourceId));\n updateCollection(collection);\n };\n const removeResourceFromCollection = async ({ collectionId, resourceType, resourceId }) => {\n const collection = await removeResourceService(collectionId, resourceType, String(resourceId));\n if (collection.resources.length > 0) {\n updateCollection(collection);\n } else {\n removeCollection(collectionId);\n }\n };\n return {\n storedCollections,\n fetchCollectionsByResource,\n createCollection,\n renameCollection,\n addResourceToCollection,\n removeResourceFromCollection\n };\n}\nconst METHOD_CREATE_COLLECTION = 0;\nconst METHOD_ADD_TO_COLLECTION = 1;\nconst _sfc_main = {\n name: \"NcCollectionList\",\n components: {\n NcCollectionListItem,\n NcAvatar,\n NcSelect\n },\n props: {\n /**\n * Resource type identifier\n */\n type: {\n type: String,\n default: null\n },\n /**\n * Unique id of the resource\n */\n id: {\n type: String,\n default: null\n },\n /**\n * Name of the resource\n */\n name: {\n type: String,\n default: \"\"\n },\n /**\n * Whether the component is active (to start fetch resources)\n */\n isActive: {\n type: Boolean,\n default: true\n }\n },\n setup() {\n const {\n storedCollections,\n fetchCollectionsByResource,\n createCollection,\n addResourceToCollection,\n removeResourceFromCollection,\n renameCollection\n } = useCollections();\n const searchCollections = ref([]);\n const search = debounce(function(query, loading) {\n if (query !== \"\") {\n loading(true);\n searchService(query).then((collections) => {\n searchCollections.value = collections;\n }).catch((e) => {\n console.error(\"Failed to search for collections\", e);\n }).finally(() => {\n loading(false);\n });\n }\n }, 500);\n return {\n storedCollections,\n fetchCollectionsByResource,\n createCollection,\n addResourceToCollection,\n removeResourceFromCollection,\n renameCollection,\n searchCollections,\n search\n };\n },\n data() {\n return {\n selectIsOpen: false,\n generatingCodes: false,\n codes: void 0,\n value: null,\n model: {},\n collectionsError: {},\n error: null,\n isSelectOpen: false\n };\n },\n computed: {\n collections() {\n return this.storedCollections.filter(\n (collection) => collection.resources.some((resource) => resource && resource.id === String(this.id) && resource.type === this.type)\n );\n },\n placeholder() {\n return this.isSelectOpen ? t(\"Type to search for existing projects\") : t(\"Add to a project\");\n },\n options() {\n const options = [];\n window.OCP.Collaboration.getTypes().sort().forEach((type) => {\n options.push({\n method: METHOD_CREATE_COLLECTION,\n type,\n title: window.OCP.Collaboration.getLabel(type),\n class: window.OCP.Collaboration.getIcon(type),\n action: () => window.OCP.Collaboration.trigger(type)\n });\n });\n for (const index in this.searchCollections) {\n if (!this.collections.find((collection) => collection.id === this.searchCollections[index].id)) {\n options.push({\n method: METHOD_ADD_TO_COLLECTION,\n title: this.searchCollections[index].name,\n collectionId: this.searchCollections[index].id\n });\n }\n }\n return options;\n },\n resourceIdentifier() {\n return {\n resourceType: this.type,\n resourceId: this.id,\n isActive: this.isActive\n };\n }\n },\n watch: {\n resourceIdentifier: {\n deep: true,\n immediate: true,\n handler(resourceIdentifier) {\n if (!resourceIdentifier.isActive || !resourceIdentifier.resourceId || !resourceIdentifier.resourceType) {\n return;\n }\n this.fetchCollectionsByResource(resourceIdentifier);\n }\n }\n },\n methods: {\n t,\n select(selectedOption) {\n if (selectedOption.method === METHOD_CREATE_COLLECTION) {\n selectedOption.action().then((resourceId) => {\n this.createCollection({\n baseResourceType: this.type,\n baseResourceId: this.id,\n resourceType: selectedOption.type,\n resourceId,\n name: this.name\n }).catch((e) => {\n this.setError(t(\"Failed to create a project\"), e);\n });\n }).catch((e) => {\n console.error(\"No resource selected\", e);\n });\n }\n if (selectedOption.method === METHOD_ADD_TO_COLLECTION) {\n this.addResourceToCollection({\n collectionId: selectedOption.collectionId,\n resourceType: this.type,\n resourceId: this.id\n }).catch((e) => {\n this.setError(t(\"Failed to add the item to the project\"), e);\n });\n }\n this.value = null;\n },\n showSelect() {\n this.selectIsOpen = true;\n this.$refs.select.$el.focus();\n },\n setError(error, e) {\n console.error(error, e);\n this.error = error;\n setTimeout(() => {\n this.error = null;\n }, 5e3);\n },\n renameCollectionFromItem({ collectionId, name }) {\n this.renameCollection({ collectionId, name }).catch((e) => {\n console.error(t(\"Failed to rename the project\"), e);\n this.collectionsError[collectionId] = t(\"Failed to rename the project\");\n setTimeout(() => {\n this.collectionsError[collectionId] = null;\n }, 5e3);\n });\n }\n }\n};\nvar _sfc_render = function render2() {\n var _vm = this, _c = _vm._self._c;\n return _vm.collections && _vm.type && _vm.id ? _c(\"ul\", { staticClass: \"collection-list\", attrs: { \"id\": \"collection-list\" } }, [_c(\"li\", { on: { \"click\": _vm.showSelect } }, [_vm._m(0), _c(\"div\", { attrs: { \"id\": \"collection-select-container\" } }, [_c(\"NcSelect\", { ref: \"select\", attrs: { \"aria-label-combobox\": _vm.t(\"Add to a project\"), \"options\": _vm.options, \"placeholder\": _vm.placeholder, \"label\": \"title\", \"limit\": 5 }, on: { \"close\": function($event) {\n _vm.isSelectOpen = false;\n }, \"open\": function($event) {\n _vm.isSelectOpen = true;\n }, \"option:selected\": _vm.select, \"search\": _vm.search }, scopedSlots: _vm._u([{ key: \"selected-option\", fn: function(option) {\n return [_c(\"span\", { staticClass: \"option__desc\" }, [_c(\"span\", { staticClass: \"option__title\" }, [_vm._v(_vm._s(option.title))])])];\n } }, { key: \"option\", fn: function(option) {\n return [_c(\"span\", { staticClass: \"option__wrapper\" }, [option.class ? _c(\"span\", { staticClass: \"avatar\", class: option.class }) : option.method !== 2 ? _c(\"NcAvatar\", { attrs: { \"allow-placeholder\": \"\", \"display-name\": option.title } }) : _vm._e(), _c(\"span\", { staticClass: \"option__title\" }, [_vm._v(_vm._s(option.title))])], 1)];\n } }], null, false, 2397208459), model: { value: _vm.value, callback: function($$v) {\n _vm.value = $$v;\n }, expression: \"value\" } }, [_c(\"p\", { staticClass: \"hint\" }, [_vm._v(\" \" + _vm._s(_vm.t(\"Connect items to a project to make them easier to find\")) + \" \")])])], 1)]), _c(\"transition\", { attrs: { \"name\": \"fade\" } }, [_vm.error ? _c(\"li\", { staticClass: \"error\" }, [_vm._v(\" \" + _vm._s(_vm.error) + \" \")]) : _vm._e()]), _vm._l(_vm.collections, function(collection) {\n return _c(\"NcCollectionListItem\", { key: collection.id, attrs: { \"collection\": collection, \"error\": _vm.collectionsError[collection.id] }, on: { \"rename-collection\": _vm.renameCollectionFromItem, \"remove-resource\": _vm.removeResourceFromCollection } });\n })], 2) : _vm._e();\n};\nvar _sfc_staticRenderFns = [function() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"div\", { staticClass: \"avatar\" }, [_c(\"span\", { staticClass: \"icon-projects\" })]);\n}];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n \"efe8beb8\"\n);\nconst NcCollectionList = __component__.exports;\nexport {\n NcCollectionList as N\n};\n","import { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nconst _sfc_main = {\n name: \"ArrowLeftIcon\",\n emits: [\"click\"],\n props: {\n title: {\n type: String\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n};\nvar _sfc_render = function render() {\n var _vm = this, _c = _vm._self._c;\n return _c(\"span\", _vm._b({ staticClass: \"material-design-icon arrow-left-icon\", attrs: { \"aria-hidden\": _vm.title ? null : true, \"aria-label\": _vm.title, \"role\": \"img\" }, on: { \"click\": function($event) {\n return _vm.$emit(\"click\", $event);\n } } }, \"span\", _vm.$attrs, false), [_c(\"svg\", { staticClass: \"material-design-icon__svg\", attrs: { \"fill\": _vm.fillColor, \"width\": _vm.size, \"height\": _vm.size, \"viewBox\": \"0 0 24 24\" } }, [_c(\"path\", { attrs: { \"d\": \"M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z\" } }, [_vm.title ? _c(\"title\", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n _sfc_main,\n _sfc_render,\n _sfc_staticRenderFns,\n false,\n null,\n null\n);\nconst ArrowLeft = __component__.exports;\nexport {\n ArrowLeft as A\n};\n","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.VueColor=t():e.VueColor=t()}(\"undefined\"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,\"a\",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p=\"\",t(t.s=60)}([function(e,t){function n(e,t){var n=e[1]||\"\",i=e[3];if(!i)return n;if(t&&\"function\"==typeof btoa){var o=r(i);return[n].concat(i.sources.map(function(e){return\"/*# sourceURL=\"+i.sourceRoot+e+\" */\"})).concat([o]).join(\"\\n\")}return[n].join(\"\\n\")}function r(e){return\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+\" */\"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?\"@media \"+t[2]+\"{\"+r+\"}\":r}).join(\"\")},t.i=function(e,n){\"string\"==typeof e&&(e=[[null,e,\"\"]]);for(var r={},i=0;in.parts.length&&(r.parts.length=n.parts.length)}else{for(var a=[],i=0;i0?(0,o.default)(e.hex):e&&e.hsv?(0,o.default)(e.hsv):e&&e.rgba?(0,o.default)(e.rgba):e&&e.rgb?(0,o.default)(e.rgb):(0,o.default)(e))||void 0!==n._a&&null!==n._a||n.setAlpha(r||1);var i=n.toHsl(),a=n.toHsv();return 0===i.s&&(a.h=i.h=e.h||e.hsl&&e.hsl.h||t||0),{hsl:i,hex:n.toHexString().toUpperCase(),hex8:n.toHex8String().toUpperCase(),rgba:n.toRgb(),hsv:a,oldHue:e.h||t||i.h,source:e.source,a:e.a||n.getAlpha()}}Object.defineProperty(t,\"__esModule\",{value:!0});var i=n(65),o=function(e){return e&&e.__esModule?e:{default:e}}(i);t.default={props:[\"value\"],data:function(){return{val:r(this.value)}},computed:{colors:{get:function(){return this.val},set:function(e){this.val=e,this.$emit(\"input\",e)}}},watch:{value:function(e){this.val=r(e)}},methods:{colorChange:function(e,t){this.oldHue=this.colors.hsl.h,this.colors=r(e,t||this.oldHue)},isValidHex:function(e){return(0,o.default)(e).isValid()},simpleCheckForValidColor:function(e){for(var t=[\"r\",\"g\",\"b\",\"a\",\"h\",\"s\",\"l\",\"v\"],n=0,r=0,i=0;i0?r:n)(e)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError(\"Can't call method on \"+e);return e}},function(e,t,n){var r=n(12);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&\"function\"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if(\"function\"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&\"function\"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError(\"Can't convert object to primitive value\")}},function(e,t){e.exports={}},function(e,t,n){var r=n(46),i=n(30);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(29)(\"keys\"),i=n(19);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(15),i=n(4),o=i[\"__core-js_shared__\"]||(i[\"__core-js_shared__\"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})(\"versions\",[]).push({version:r.version,mode:n(14)?\"pure\":\"global\",copyright:\"© 2019 Denis Pushkarev (zloirock.ru)\"})},function(e,t){e.exports=\"constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf\".split(\",\")},function(e,t,n){var r=n(8).f,i=n(6),o=n(11)(\"toStringTag\");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){t.f=n(11)},function(e,t,n){var r=n(4),i=n(15),o=n(14),a=n(32),s=n(8).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});\"_\"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){\"use strict\";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,\"__esModule\",{value:!0});var i=n(3),o=r(i),a=n(5),s=r(a),c=[\"#4D4D4D\",\"#999999\",\"#FFFFFF\",\"#F44E3B\",\"#FE9200\",\"#FCDC00\",\"#DBDF00\",\"#A4DD00\",\"#68CCCA\",\"#73D8FF\",\"#AEA1FF\",\"#FDA1FF\",\"#333333\",\"#808080\",\"#CCCCCC\",\"#D33115\",\"#E27300\",\"#FCC400\",\"#B0BC00\",\"#68BC00\",\"#16A5A5\",\"#009CE0\",\"#7B64FF\",\"#FA28FF\",\"#000000\",\"#666666\",\"#B3B3B3\",\"#9F0500\",\"#C45100\",\"#FB9E00\",\"#808900\",\"#194D33\",\"#0C797D\",\"#0062B1\",\"#653294\",\"#AB149E\"];t.default={name:\"Compact\",mixins:[o.default],props:{palette:{type:Array,default:function(){return c}}},components:{\"ed-in\":s.default},computed:{pick:function(){return this.colors.hex.toUpperCase()}},methods:{handlerClick:function(e){this.colorChange({hex:e,source:\"hex\"})}}}},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default={name:\"editableInput\",props:{label:String,labelText:String,desc:String,value:[String,Number],max:Number,min:Number,arrowOffset:{type:Number,default:1}},computed:{val:{get:function(){return this.value},set:function(e){if(!(void 0!==this.max&&+e>this.max))return e;this.$refs.input.value=this.max}},labelId:function(){return\"input__label__\"+this.label+\"__\"+Math.random().toString().slice(2,5)},labelSpanText:function(){return this.labelText||this.label}},methods:{update:function(e){this.handleChange(e.target.value)},handleChange:function(e){var t={};t[this.label]=e,void 0===t.hex&&void 0===t[\"#\"]?this.$emit(\"change\",t):e.length>5&&this.$emit(\"change\",t)},handleKeyDown:function(e){var t=this.val,n=Number(t);if(n){var r=this.arrowOffset||1;38===e.keyCode&&(t=n+r,this.handleChange(t),e.preventDefault()),40===e.keyCode&&(t=n-r,this.handleChange(t),e.preventDefault())}}}}},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var r=n(3),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=[\"#FFFFFF\",\"#F2F2F2\",\"#E6E6E6\",\"#D9D9D9\",\"#CCCCCC\",\"#BFBFBF\",\"#B3B3B3\",\"#A6A6A6\",\"#999999\",\"#8C8C8C\",\"#808080\",\"#737373\",\"#666666\",\"#595959\",\"#4D4D4D\",\"#404040\",\"#333333\",\"#262626\",\"#0D0D0D\",\"#000000\"];t.default={name:\"Grayscale\",mixins:[i.default],props:{palette:{type:Array,default:function(){return o}}},components:{},computed:{pick:function(){return this.colors.hex.toUpperCase()}},methods:{handlerClick:function(e){this.colorChange({hex:e,source:\"hex\"})}}}},function(e,t,n){\"use strict\";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,\"__esModule\",{value:!0});var i=n(5),o=r(i),a=n(3),s=r(a);t.default={name:\"Material\",mixins:[s.default],components:{\"ed-in\":o.default},methods:{onChange:function(e){e&&(e.hex?this.isValidHex(e.hex)&&this.colorChange({hex:e.hex,source:\"hex\"}):(e.r||e.g||e.b)&&this.colorChange({r:e.r||this.colors.rgba.r,g:e.g||this.colors.rgba.g,b:e.b||this.colors.rgba.b,a:e.a||this.colors.rgba.a,source:\"rgba\"}))}}}},function(e,t,n){\"use strict\";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,\"__esModule\",{value:!0});var i=n(81),o=r(i),a=n(3),s=r(a),c=n(13),l=r(c);t.default={name:\"Slider\",mixins:[s.default],props:{swatches:{type:Array,default:function(){return[{s:.5,l:.8},{s:.5,l:.65},{s:.5,l:.5},{s:.5,l:.35},{s:.5,l:.2}]}}},components:{hue:l.default},computed:{normalizedSwatches:function(){return this.swatches.map(function(e){return\"object\"!==(void 0===e?\"undefined\":(0,o.default)(e))?{s:.5,l:e}:e})}},methods:{isActive:function(e,t){var n=this.colors.hsl;return 1===n.l&&1===e.l||(0===n.l&&0===e.l||Math.abs(n.l-e.l)<.01&&Math.abs(n.s-e.s)<.01)},hueChange:function(e){this.colorChange(e)},handleSwClick:function(e,t){this.colorChange({h:this.colors.hsl.h,s:t.s,l:t.l,source:\"hsl\"})}}}},function(e,t,n){\"use strict\";var r=n(14),i=n(41),o=n(44),a=n(7),s=n(26),c=n(88),l=n(31),u=n(95),f=n(11)(\"iterator\"),d=!([].keys&&\"next\"in[].keys()),h=function(){return this};e.exports=function(e,t,n,p,v,g,b){c(n,t,p);var x,m,_,w=function(e){if(!d&&e in F)return F[e];switch(e){case\"keys\":case\"values\":return function(){return new n(this,e)}}return function(){return new n(this,e)}},y=t+\" Iterator\",C=\"values\"==v,k=!1,F=e.prototype,S=F[f]||F[\"@@iterator\"]||v&&F[v],A=S||w(v),O=v?C?w(\"entries\"):A:void 0,E=\"Array\"==t?F.entries||S:S;if(E&&(_=u(E.call(new e)))!==Object.prototype&&_.next&&(l(_,y,!0),r||\"function\"==typeof _[f]||a(_,f,h)),C&&S&&\"values\"!==S.name&&(k=!0,A=function(){return S.call(this)}),r&&!b||!d&&!k&&F[f]||a(F,f,A),s[t]=A,s[y]=h,v)if(x={values:C?A:w(\"values\"),keys:g?A:w(\"keys\"),entries:O},b)for(m in x)m in F||o(F,m,x[m]);else i(i.P+i.F*(d||k),t,x);return x}},function(e,t,n){var r=n(4),i=n(15),o=n(86),a=n(7),s=n(6),c=function(e,t,n){var l,u,f,d=e&c.F,h=e&c.G,p=e&c.S,v=e&c.P,g=e&c.B,b=e&c.W,x=h?i:i[t]||(i[t]={}),m=x.prototype,_=h?r:p?r[t]:(r[t]||{}).prototype;h&&(n=t);for(l in n)(u=!d&&_&&void 0!==_[l])&&s(x,l)||(f=u?_[l]:n[l],x[l]=h&&\"function\"!=typeof _[l]?n[l]:g&&u?o(f,r):b&&_[l]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&\"function\"==typeof f?o(Function.call,f):f,v&&((x.virtual||(x.virtual={}))[l]=f,e&c.R&&m&&!m[l]&&a(m,l,f)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){e.exports=!n(9)&&!n(17)(function(){return 7!=Object.defineProperty(n(43)(\"div\"),\"a\",{get:function(){return 7}}).a})},function(e,t,n){var r=n(12),i=n(4).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){e.exports=n(7)},function(e,t,n){var r=n(16),i=n(89),o=n(30),a=n(28)(\"IE_PROTO\"),s=function(){},c=function(){var e,t=n(43)(\"iframe\"),r=o.length;for(t.style.display=\"none\",n(94).appendChild(t),t.src=\"javascript:\",e=t.contentWindow.document,e.open(),e.write(\"\n\n\n\n\n","/**\n * @copyright Copyright (c) 2023 Louis Chmn \n *\n * @author Louis Chmn \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport type { BasicFileInfo } from './models'\n\nconst livePictureExt = ['jpg', 'jpeg', 'png']\nconst livePictureExtRegex = new RegExp(`\\\\.(${livePictureExt.join('|')})$`, 'i')\n\n/**\n * Return the peer live photo from a list of files based on its fileId\n * @param peerFileId\n * @param fileList\n */\nexport function findLivePhotoPeerFromFileId(peerFileId: number, fileList: BasicFileInfo[]): BasicFileInfo | undefined {\n\treturn fileList.find(file => file.fileid === peerFileId)\n}\n\n/**\n * Return the peer live photo from a list of files based on the original file name.\n * @param referenceFile\n * @param fileList\n */\nexport function findLivePhotoPeerFromName(referenceFile: BasicFileInfo, fileList: BasicFileInfo[]): BasicFileInfo | undefined {\n\treturn fileList.find(comparedFile => {\n\t\t// if same filename and extension is allowed\n\t\treturn comparedFile.filename !== referenceFile.filename\n\t\t\t\t&& (comparedFile.basename.startsWith(referenceFile.name) && livePictureExtRegex.test(comparedFile.basename))\n\t})\n}\n","\n\n\n\t\n\t\t\n\n\t\t\n\t\t\t 1\n\t\t\t\t}\"\n\t\t\t\t:src=\"data\"\n\t\t\t\t:style=\"imgStyle\"\n\t\t\t\t@error.capture.prevent.stop.once=\"onFail\"\n\t\t\t\t@load=\"updateImgSize\"\n\t\t\t\t@wheel.stop.prevent=\"updateZoom\"\n\t\t\t\t@dblclick.prevent=\"onDblclick\"\n\t\t\t\t@pointerdown.prevent=\"pointerDown\"\n\t\t\t\t@pointerup.prevent=\"pointerUp\"\n\t\t\t\t@pointermove.prevent=\"pointerMove\">\n\n\t\t\t\n\t\t\t\t 1\n\t\t\t\t\t}\"\n\t\t\t\t\t:style=\"imgStyle\"\n\t\t\t\t\t:playsinline=\"true\"\n\t\t\t\t\t:poster=\"data\"\n\t\t\t\t\t:src=\"livePhotoSrc\"\n\t\t\t\t\tpreload=\"metadata\"\n\t\t\t\t\t@canplaythrough=\"doneLoadingLivePhoto\"\n\t\t\t\t\t@loadedmetadata=\"updateImgSize\"\n\t\t\t\t\t@wheel.stop.prevent=\"updateZoom\"\n\t\t\t\t\t@error.capture.prevent.stop.once=\"onFail\"\n\t\t\t\t\t@dblclick.prevent=\"onDblclick\"\n\t\t\t\t\t@pointerdown.prevent=\"pointerDown\"\n\t\t\t\t\t@pointerup.prevent=\"pointerUp\"\n\t\t\t\t\t@pointermove.prevent=\"pointerMove\"\n\t\t\t\t\t@ended=\"stopLivePhoto\" />\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{{ t('viewer', 'LIVE') }}\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\n\n\n\n\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport { loadState } from '@nextcloud/initial-state'\nimport logger from '../services/logger.js'\nimport Images from '../components/Images.vue'\n\nconst enabledPreviewProviders = loadState(appName, 'enabled_preview_providers', [])\n\n/**\n * Those mimes needs a proper preview to be displayed\n * if they are not enabled on the server, let's not activate them.\n */\nconst previewSupportedMimes = [\n\t'image/heic',\n\t'image/heif',\n\t'image/tiff',\n\t'image/x-xbitmap',\n\t'image/emf',\n]\n\n/**\n * Those mimes are always supported by the browser\n * Since we fallback to the source image if there is no\n * preview, we can always include them.\n */\nconst browserSupportedMimes = [\n\t'image/apng',\n\t'image/bmp',\n\t'image/gif',\n\t'image/jpeg',\n\t'image/png',\n\t'image/svg+xml',\n\t'image/webp',\n\t'image/x-icon',\n]\n\n// Filter out supported mimes that are _not_\n// enabled in the preview API\nconst filterEnabledMimes = () => {\n\treturn previewSupportedMimes.filter(filter => {\n\t\treturn enabledPreviewProviders.findIndex(mimeRegex => {\n\t\t\t// Remove leading and trailing slash from string regex\n\t\t\tconst regex = new RegExp(mimeRegex.replace(/^\\/|\\/$/g, ''), 'i')\n\t\t\treturn filter.match(regex)\n\t\t}) > -1\n\t})\n}\n\nconst enabledMimes = filterEnabledMimes()\nconst ignoredMimes = previewSupportedMimes.filter(x => !enabledMimes.includes(x))\nif (ignoredMimes.length > 0) {\n\tlogger.warn('Some mimes were ignored because they are not enabled in the server previews config', { ignoredMimes })\n}\n\nexport default {\n\tid: 'images',\n\tgroup: 'media',\n\tmimes: [\n\t\t...browserSupportedMimes,\n\t\t...enabledMimes,\n\t],\n\tcomponent: Images,\n}\n","\n\n\n\t\n\t\n\t\t\n\t\t\t\n\n\t\t\t\t\n\n\t\t\t\t{{ t('viewer', 'Your browser does not support videos.') }}\n\t\t\t\n\t\t\n\t\n\n\n\n\n\n\n\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport Videos from '../components/Videos.vue'\n\nexport default {\n\tid: 'videos',\n\tgroup: 'media',\n\tmimes: [\n\t\t'video/mpeg',\n\t\t'video/ogg',\n\t\t'video/webm',\n\t\t'video/mp4',\n\t\t'video/x-m4v',\n\t\t'video/x-flv',\n\t\t'video/quicktime',\n\t],\n\tmimesAliases: {\n\t\t'video/x-matroska': 'video/webm',\n\t},\n\tcomponent: Videos,\n}\n","\n\n\n\t\n\t\n\t\t\n\t\t\t\n\n\t\t\t\t\n\n\t\t\t\t{{ t('viewer', 'Your browser does not support audio.') }}\n\t\t\t\n\t\t\n\t\n\n\n\n\n\n","/**\n * @copyright Copyright (c) 2020 Daniel Kesselberg \n *\n * @author Daniel Kesselberg \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport Audios from '../components/Audios.vue'\n\nexport default {\n\tid: 'audios',\n\tgroup: 'media',\n\tmimes: [\n\t\t'audio/aac',\n\t\t'audio/aacp',\n\t\t'audio/flac',\n\t\t'audio/mp4',\n\t\t'audio/mpeg',\n\t\t'audio/ogg',\n\t\t'audio/vorbis',\n\t\t'audio/wav',\n\t\t'audio/webm',\n\t],\n\tcomponent: Audios,\n}\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport Images from '../models/images.js'\nimport Videos from '../models/videos.js'\nimport Audios from '../models/audios.js'\nimport logger from './logger.js'\n\n/**\n * Handler type definition\n *\n * @typedef {object} Handler\n * @property {string} id unique identifier for the handler\n * @property {string[]} mimes list of mime types that are supported for opening\n * @property {object} component Vue component to render the file\n * @property {string} group group identifier to combine for navigating to the next/previous files\n * @property {?string} theme viewer modal theme (one of 'dark', 'light', 'default')\n * @property {boolean} canCompare Indicate support for comparing two files\n */\n\n/**\n * File info type definition\n *\n * @typedef {object} Fileinfo\n * @property {string} filename File path of the remote item\n * @property {string} basename Base filename of the remote item, no path\n * @property {?string} source absolute path of a non-dav file, e.g. a static resource or provided by an app route\n * @property {string} mime file MIME type in the format type/sub-type\n * @property {string} [previewUrl] URL of the file preview\n * @property {boolean} hasPreview is there a WebDAV preview of this file?\n * @property {number} fileid Nextcloud file ID\n */\n\nexport default class Viewer {\n\n\t_state\n\t_mimetypes\n\t_mimetypesCompare\n\n\tconstructor() {\n\t\tthis._mimetypes = []\n\t\tthis._mimetypesCompare = []\n\t\tthis._state = {}\n\t\tthis._state.file = ''\n\t\tthis._state.fileInfo = null\n\t\tthis._state.compareFileInfo = null\n\t\tthis._state.files = []\n\t\tthis._state.enableSidebar = true\n\t\tthis._state.el = null\n\t\tthis._state.loadMore = () => ([])\n\t\tthis._state.onPrev = () => {}\n\t\tthis._state.onNext = () => {}\n\t\tthis._state.onClose = () => {}\n\t\tthis._state.canLoop = true\n\t\tthis._state.handlers = []\n\t\tthis._state.overrideHandlerId = null\n\n\t\t// ! built-in handlers\n\t\tthis.registerHandler(Images)\n\t\tthis.registerHandler(Videos)\n\t\tthis.registerHandler(Audios)\n\n\t\tlogger.debug('OCA.Viewer initialized')\n\t}\n\n\t/**\n\t * Return the registered handlers\n\t *\n\t * @readonly\n\t * @memberof Viewer\n\t * @return {Handler[]}\n\t */\n\tget availableHandlers() {\n\t\treturn this._state.handlers\n\t}\n\n\t/**\n\t * Register a new handler\n\t *\n\t * @memberof Viewer\n\t * @param {Handler} handler a new unregistered handler\n\t */\n\tregisterHandler(handler) {\n\t\tconst error = this.validateHandler(handler)\n\t\tif (error) {\n\t\t\tlogger.error('Could not register handler', { error, handler })\n\t\t\treturn\n\t\t}\n\n\t\tthis._state.handlers.push(handler)\n\t\tconst handledMimes = [\n\t\t\t...handler.mimes,\n\t\t\t...Object.keys(handler.mimesAliases || {}),\n\t\t]\n\t\tthis._mimetypes.push.apply(this._mimetypes, handledMimes)\n\t\tif (handler?.canCompare === true) {\n\t\t\tthis._mimetypesCompare.push.apply(this._mimetypesCompare, handledMimes)\n\t\t}\n\t}\n\n\tvalidateHandler({ id, mimes, mimesAliases, component }) {\n\t\t// checking valid handler id\n\t\tif (!id || id.trim() === '' || typeof id !== 'string') {\n\t\t\treturn 'The handler doesn\\'t have a valid id'\n\t\t}\n\n\t\t// checking if handler is not already registered\n\t\tif (this._state.handlers.find(h => h.id === id)) {\n\t\t\treturn 'The handler is already registered'\n\t\t}\n\n\t\t// Nothing available to process! Failure\n\t\tif (!(mimes && Array.isArray(mimes)) && !mimesAliases) {\n\t\t\treturn 'Handler needs a valid mime array or mimesAliases'\n\t\t}\n\n\t\t// checking valid handler component data\n\t\tif ((!component || (typeof component !== 'object' && typeof component !== 'function'))) {\n\t\t\treturn 'The handler doesn\\'t have a valid component'\n\t\t}\n\t}\n\n\t/**\n\t * Get the current opened file\n\t *\n\t * @memberof Viewer\n\t * @return {string} the currently opened file\n\t */\n\tget file() {\n\t\treturn this._state.file\n\t}\n\n\t/**\n\t * Get the current opened file fileInfo\n\t *\n\t * @memberof Viewer\n\t * @return {?Fileinfo} the currently opened file fileInfo\n\t */\n\tget fileInfo() {\n\t\treturn this._state.fileInfo\n\t}\n\n\t/**\n\t * Get the current comparison view opened file fileInfo\n\t *\n\t * @memberof Viewer\n\t * @return {?Fileinfo} the currently opened file fileInfo\n\t */\n\tget compareFileInfo() {\n\t\treturn this._state.compareFileInfo\n\t}\n\n\t/**\n\t * Get the current files list\n\t *\n\t * @memberof Viewer\n\t * @return {Fileinfo[]} the current files list\n\t */\n\tget files() {\n\t\treturn this._state.files\n\t}\n\n\t/**\n\t * Whether to enable the sidebar or not\n\t *\n\t * @memberof Viewer\n\t * @return {boolean} whether to enable the sidebar or not\n\t */\n\tget enableSidebar() {\n\t\treturn this._state.enableSidebar\n\t}\n\n\t/**\n\t * Get the element to render the current file in\n\t *\n\t * @memberof Viewer\n\t * @return {string} selector of the element\n\t */\n\tget el() {\n\t\treturn this._state.el\n\t}\n\n\t/**\n\t * Get the supported mimetypes that can be opened with the viewer\n\t *\n\t * @memberof Viewer\n\t * @return {Array} list of mimetype strings that the viewer can open\n\t */\n\tget mimetypes() {\n\t\treturn this._mimetypes\n\t}\n\n\t/**\n\t * Get the supported mimetypes that can be opened side by side for comparison\n\t *\n\t * @memberof Viewer\n\t * @return {Array} list of mimetype strings that the viewer can open side by side for comparison\n\t */\n\tget mimetypesCompare() {\n\t\treturn this._mimetypesCompare\n\t}\n\n\t/**\n\t * Return the method provided to fetch more results\n\t *\n\t * @memberof Viewer\n\t * @return {Function}\n\t */\n\tget loadMore() {\n\t\treturn this._state.loadMore\n\t}\n\n\t/**\n\t * Get the method to run on previous navigation\n\t *\n\t * @memberof Viewer\n\t * @return {Function}\n\t */\n\tget onPrev() {\n\t\treturn this._state.onPrev\n\t}\n\n\t/**\n\t * Get the method to run on next navigation\n\t *\n\t * @memberof Viewer\n\t * @return {Function}\n\t */\n\tget onNext() {\n\t\treturn this._state.onNext\n\t}\n\n\t/**\n\t * Get the method to run on viewer close\n\t *\n\t * @memberof Viewer\n\t * @return {Function}\n\t */\n\tget onClose() {\n\t\treturn this._state.onClose\n\t}\n\n\t/**\n\t * Is looping over the provided list allowed?\n\t *\n\t * @memberof Viewer\n\t * @return {boolean}\n\t */\n\tget canLoop() {\n\t\treturn this._state.canLoop\n\t}\n\n\t/**\n\t * If this handler is set, it should be used for viewing the next file.\n\t *\n\t * @memberof Viewer\n\t */\n\tget overrideHandlerId() {\n\t\treturn this._state.overrideHandlerId\n\t}\n\n\t/**\n\t * Set element to open viewer in\n\t *\n\t * @memberof Viewer\n\t * @param {string} el selector of the element to render the file in\n\t */\n\tsetRootElement(el = null) {\n\t\tif (this._state.file) {\n\t\t\tthrow new Error('Please set root element before calling Viewer.open().')\n\t\t}\n\t\tthis._state.el = el\n\t}\n\n\t/**\n\t * Open the path into the viewer\n\t *\n\t * @memberof Viewer\n\t * @param {object} options Options for opening the viewer\n\t * @param {?string} options.path path of the file to open\n\t * @param {?Fileinfo} options.fileInfo file info of the file to open\n\t * @param {Fileinfo[]} [options.list] the list of files as objects (fileinfo) format\n\t * @param {boolean} options.enableSidebar whether to enable the sidebar or not\n\t * @param {Function} options.loadMore callback for loading more files\n\t * @param {boolean} options.canLoop can the viewer loop over the array\n\t * @param {Function} options.onPrev callback when navigating back to previous file\n\t * @param {Function} options.onNext callback when navigation forward to next file\n\t * @param {Function} options.onClose callback when closing the viewer\n\t */\n\topen({ path, fileInfo, list = [], enableSidebar = true, loadMore = () => ([]), canLoop = true, onPrev = () => {}, onNext = () => {}, onClose = () => {} } = {}) {\n\t\tif (typeof arguments[0] === 'string') {\n\t\t\tthrow new Error('Opening the viewer with a single string parameter is deprecated. Please use a destructuring object instead', `OCA.Viewer.open({ path: '${path}' })`)\n\t\t}\n\t\tif (!path && !fileInfo) {\n\t\t\tthrow new Error('Viewer needs either an URL or path to open. None given')\n\t\t}\n\n\t\tif (path && !path.startsWith('/')) {\n\t\t\tthrow new Error('Please use an absolute path')\n\t\t}\n\n\t\tif (!Array.isArray(list)) {\n\t\t\tthrow new Error('The files list must be an array')\n\t\t}\n\n\t\tif (typeof loadMore !== 'function') {\n\t\t\tthrow new Error('The loadMore method must be a function')\n\t\t}\n\n\t\t// Only assign the one that is used to prevent false watcher runs\n\t\tif (path) {\n\t\t\tthis._state.file = path\n\t\t} else {\n\t\t\tthis._state.fileInfo = fileInfo\n\t\t}\n\t\tif (!this._state.el) {\n\t\t\tthis._state.files = list\n\t\t\tthis._state.enableSidebar = enableSidebar\n\t\t\tthis._state.loadMore = loadMore\n\t\t\tthis._state.onPrev = onPrev\n\t\t\tthis._state.onNext = onNext\n\t\t\tthis._state.onClose = onClose\n\t\t\tthis._state.canLoop = canLoop\n\t\t}\n\t}\n\n\t/**\n\t * Open the path into the viewer\n\t *\n\t * @memberof Viewer\n\t * @param {object} handlerId ID of the handler with which to open the files\n\t * @param {object} options Options for opening the viewer\n\t * @param {string} options.path path of the file to open\n\t * @param {object[]} [options.list] the list of files as objects (fileinfo) format\n\t * @param {boolean} [options.enableSidebar] Whether to enable the sidebar or not\n\t * @param {Function} options.loadMore callback for loading more files\n\t * @param {boolean} options.canLoop can the viewer loop over the array\n\t * @param {Function} options.onPrev callback when navigating back to previous file\n\t * @param {Function} options.onNext callback when navigation forward to next file\n\t * @param {Function} options.onClose callback when closing the viewer\n\t */\n\topenWith(handlerId, options = {}) {\n\t\tthis._state.overrideHandlerId = handlerId\n\t\tthis.open(options)\n\t}\n\n\t/**\n\t * Open the viewer with two files side by side\n\t *\n\t * @memberof Viewer\n\t * @param {Fileinfo} fileInfo current file\n\t * @param {Fileinfo} compareFileInfo older file to compare\n\t */\n\tcompare(fileInfo, compareFileInfo) {\n\t\tthis.open({\n\t\t\tfileInfo,\n\t\t})\n\t\tthis._state.compareFileInfo = compareFileInfo\n\t}\n\n\t/**\n\t * Close the opened file\n\t *\n\t * @memberof Viewer\n\t */\n\tclose() {\n\t\tthis._state.file = ''\n\t\tthis._state.fileInfo = null\n\t\tthis._state.files = []\n\t\tthis._state.enableSidebar = true\n\t\tthis._state.canLoop = true\n\t\tthis._state.loadMore = () => ([])\n\t\tthis._state.overrideHandlerId = null\n\t}\n\n}\n","/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { registerViewerAction } from './files_actions/viewerAction'\nimport ViewerService from './services/Viewer.js'\n\n// Register the files action\nregisterViewerAction()\n\n// Init Viewer Service\nwindow.OCA = window.OCA ?? {}\nwindow.OCA.Viewer = new ViewerService()\nwindow.OCA.Viewer.version = appVersion\n"],"file":"js/viewer-init.mjs"} \ No newline at end of file diff --git a/src/files_actions/viewerAction.ts b/src/files_actions/viewerAction.ts new file mode 100644 index 000000000..36922575b --- /dev/null +++ b/src/files_actions/viewerAction.ts @@ -0,0 +1,67 @@ +/** + * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +import type { Node, View } from '@nextcloud/files' + +import { DefaultType, FileAction, Permission, registerFileAction } from '@nextcloud/files' +import { t } from '@nextcloud/l10n' +import svgEye from '@mdi/svg/svg/eye.svg?raw' + +/** + * @param node The file to open + * @param view any The files view + * @param dir the directory path + */ +function pushToHistory(node: Node, view: View, dir: string) { + window.OCP.Files.Router.goToRoute( + null, + { view: view.id, fileid: String(node.fileid) }, + { dir, openfile: 'true' }, + true, + ) +} + +/** + * Execute the viewer files action + * @param node The active node + * @param view The current view + * @param dir The current path + */ +async function execAction(node: Node, view: View, dir: string): Promise { + const onClose = () => { + // This can sometime be called with the openfile set to true already. But we don't want to keep openfile when closing the viewer. + const newQuery = { ...window.OCP.Files.Router.query } + delete newQuery.openfile + window.OCP.Files.Router.goToRoute(null, window.OCP.Files.Router.params, newQuery) + } + + pushToHistory(node, view, dir) + window.OCA.Viewer.open({ path: node.path, onPrev: pushToHistory, onNext: pushToHistory, onClose }) + + return null +} + +/** + * Register the viewer action on the files API + */ +export function registerViewerAction() { + registerFileAction(new FileAction({ + id: 'view', + displayName: () => t('viewer', 'View'), + iconSvgInline: () => svgEye, + default: DefaultType.DEFAULT, + enabled: (nodes) => { + // Disable if not located in user root + if (nodes.some(node => !(node.isDavRessource && node.root?.startsWith('/files')))) { + return false + } + + return nodes.every((node) => + Boolean(node.permissions & Permission.READ) + && window.OCA.Viewer.mimetypes.includes(node.mime), + ) + }, + exec: execAction, + })) +}