@agendize/vue-tools 1.1.0-beta4818-1 → 1.1.0-beta4818-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15204,8 +15204,8 @@ class qi extends fe {
15204
15204
  async getICS(e2, t2) {
15205
15205
  let r2 = this.getAxiosConfig(e2), n2 = t2;
15206
15206
  if (t2.indexOf("calendar.google.com/calendar") > 0) {
15207
- const a2 = t2.indexOf("://"), c2 = a2 > 0 ? t2.substring(a2 + 3) : t2;
15208
- n2 = "/api/2.3/forward/https//" + c2;
15207
+ const a2 = t2.indexOf("://");
15208
+ n2 = "/api/2.3/forward/https//" + (a2 > 0 ? t2.substring(a2 + 3) : t2);
15209
15209
  }
15210
15210
  const i2 = this.instance.get(
15211
15211
  n2,
@@ -46,7 +46,7 @@ Vous \xEAtes num\xE9ro {'{'}number_in_line{'}'} de la file d'attente.`,placehold
46
46
 
47
47
  See the Apache Version 2.0 License for specific language governing permissions
48
48
  and limitations under the License.
49
- ***************************************************************************** */var nc;(function(t){(function(e){var r=typeof Ae=="object"?Ae:typeof self=="object"?self:typeof this=="object"?this:Function("return this;")(),n=a(t);typeof r.Reflect>"u"?r.Reflect=t:n=a(r.Reflect,n),e(n);function a(i,o){return function(s,l){typeof i[s]!="function"&&Object.defineProperty(i,s,{configurable:!0,writable:!0,value:l}),o&&o(s,l)}}})(function(e){var r=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",a=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",i=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",o=typeof Object.create=="function",s={__proto__:[]}instanceof Array,l=!o&&!s,u={create:o?function(){return m(Object.create(null))}:s?function(){return m({__proto__:null})}:function(){return m({})},has:l?function(h,p){return r.call(h,p)}:function(h,p){return p in h},get:l?function(h,p){return r.call(h,p)?h[p]:void 0}:function(h,p){return h[p]}},f=Object.getPrototypeOf(Function),w=typeof process=="object"&&process.env&&{}.REFLECT_METADATA_USE_MAP_POLYFILL==="true",y=!w&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:c(),x=!w&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:v(),S=!w&&typeof WeakMap=="function"?WeakMap:d(),T=new S;function N(h,p,k,R){if(F(k)){if(!Ie(h))throw new TypeError;if(!ae(p))throw new TypeError;return B(h,p)}else{if(!Ie(h))throw new TypeError;if(!K(p))throw new TypeError;if(!K(R)&&!F(R)&&!ee(R))throw new TypeError;return ee(R)&&(R=void 0),k=Be(k),G(h,p,k,R)}}e("decorate",N);function C(h,p){function k(R,U){if(!K(R))throw new TypeError;if(!F(U)&&!_(U))throw new TypeError;V(h,p,R,U)}return k}e("metadata",C);function E(h,p,k,R){if(!K(k))throw new TypeError;return F(R)||(R=Be(R)),V(h,p,k,R)}e("defineMetadata",E);function A(h,p,k){if(!K(p))throw new TypeError;return F(k)||(k=Be(k)),L(h,p,k)}e("hasMetadata",A);function I(h,p,k){if(!K(p))throw new TypeError;return F(k)||(k=Be(k)),q(h,p,k)}e("hasOwnMetadata",I);function D(h,p,k){if(!K(p))throw new TypeError;return F(k)||(k=Be(k)),W(h,p,k)}e("getMetadata",D);function P(h,p,k){if(!K(p))throw new TypeError;return F(k)||(k=Be(k)),j(h,p,k)}e("getOwnMetadata",P);function z(h,p){if(!K(h))throw new TypeError;return F(p)||(p=Be(p)),Z(h,p)}e("getMetadataKeys",z);function Y(h,p){if(!K(h))throw new TypeError;return F(p)||(p=Be(p)),se(h,p)}e("getOwnMetadataKeys",Y);function Q(h,p,k){if(!K(p))throw new TypeError;F(k)||(k=Be(k));var R=re(p,k,!1);if(F(R)||!R.delete(h))return!1;if(R.size>0)return!0;var U=T.get(p);return U.delete(k),U.size>0||T.delete(p),!0}e("deleteMetadata",Q);function B(h,p){for(var k=h.length-1;k>=0;--k){var R=h[k],U=R(p);if(!F(U)&&!ee(U)){if(!ae(U))throw new TypeError;p=U}}return p}function G(h,p,k,R){for(var U=h.length-1;U>=0;--U){var H=h[U],J=H(p,k,R);if(!F(J)&&!ee(J)){if(!K(J))throw new TypeError;R=J}}return R}function re(h,p,k){var R=T.get(h);if(F(R)){if(!k)return;R=new y,T.set(h,R)}var U=R.get(p);if(F(U)){if(!k)return;U=new y,R.set(p,U)}return U}function L(h,p,k){var R=q(h,p,k);if(R)return!0;var U=M(p);return ee(U)?!1:L(h,U,k)}function q(h,p,k){var R=re(p,k,!1);return F(R)?!1:Oe(R.has(h))}function W(h,p,k){var R=q(h,p,k);if(R)return j(h,p,k);var U=M(p);if(!ee(U))return W(h,U,k)}function j(h,p,k){var R=re(p,k,!1);if(!F(R))return R.get(h)}function V(h,p,k,R){var U=re(k,R,!0);U.set(h,p)}function Z(h,p){var k=se(h,p),R=M(h);if(R===null)return k;var U=Z(R,p);if(U.length<=0)return k;if(k.length<=0)return U;for(var H=new x,J=[],X=0,oe=k;X<oe.length;X++){var fe=oe[X],pe=H.has(fe);pe||(H.add(fe),J.push(fe))}for(var ve=0,Se=U;ve<Se.length;ve++){var fe=Se[ve],pe=H.has(fe);pe||(H.add(fe),J.push(fe))}return J}function se(h,p){var k=[],R=re(h,p,!1);if(F(R))return k;for(var U=R.keys(),H=O(U),J=0;;){var X=le(H);if(!X)return k.length=J,k;var oe=te(X);try{k[J]=oe}catch(fe){try{de(H)}finally{throw fe}}J++}}function ie(h){if(h===null)return 1;switch(typeof h){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return h===null?1:6;default:return 6}}function F(h){return h===void 0}function ee(h){return h===null}function ne(h){return typeof h=="symbol"}function K(h){return typeof h=="object"?h!==null:typeof h=="function"}function xe(h,p){switch(ie(h)){case 0:return h;case 1:return h;case 2:return h;case 3:return h;case 4:return h;case 5:return h}var k=p===3?"string":p===5?"number":"default",R=b(h,a);if(R!==void 0){var U=R.call(h,k);if(K(U))throw new TypeError;return U}return _e(h,k==="default"?"number":k)}function _e(h,p){if(p==="string"){var k=h.toString;if($(k)){var R=k.call(h);if(!K(R))return R}var U=h.valueOf;if($(U)){var R=U.call(h);if(!K(R))return R}}else{var U=h.valueOf;if($(U)){var R=U.call(h);if(!K(R))return R}var H=h.toString;if($(H)){var R=H.call(h);if(!K(R))return R}}throw new TypeError}function Oe(h){return!!h}function ye(h){return""+h}function Be(h){var p=xe(h,3);return ne(p)?p:ye(p)}function Ie(h){return Array.isArray?Array.isArray(h):h instanceof Object?h instanceof Array:Object.prototype.toString.call(h)==="[object Array]"}function $(h){return typeof h=="function"}function ae(h){return typeof h=="function"}function _(h){switch(ie(h)){case 3:return!0;case 4:return!0;default:return!1}}function b(h,p){var k=h[p];if(k!=null){if(!$(k))throw new TypeError;return k}}function O(h){var p=b(h,i);if(!$(p))throw new TypeError;var k=p.call(h);if(!K(k))throw new TypeError;return k}function te(h){return h.value}function le(h){var p=h.next();return p.done?!1:p}function de(h){var p=h.return;p&&p.call(h)}function M(h){var p=Object.getPrototypeOf(h);if(typeof h!="function"||h===f||p!==f)return p;var k=h.prototype,R=k&&Object.getPrototypeOf(k);if(R==null||R===Object.prototype)return p;var U=R.constructor;return typeof U!="function"||U===h?p:U}function c(){var h={},p=[],k=function(){function J(X,oe,fe){this._index=0,this._keys=X,this._values=oe,this._selector=fe}return J.prototype["@@iterator"]=function(){return this},J.prototype[i]=function(){return this},J.prototype.next=function(){var X=this._index;if(X>=0&&X<this._keys.length){var oe=this._selector(this._keys[X],this._values[X]);return X+1>=this._keys.length?(this._index=-1,this._keys=p,this._values=p):this._index++,{value:oe,done:!1}}return{value:void 0,done:!0}},J.prototype.throw=function(X){throw this._index>=0&&(this._index=-1,this._keys=p,this._values=p),X},J.prototype.return=function(X){return this._index>=0&&(this._index=-1,this._keys=p,this._values=p),{value:X,done:!0}},J}();return function(){function J(){this._keys=[],this._values=[],this._cacheKey=h,this._cacheIndex=-2}return Object.defineProperty(J.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),J.prototype.has=function(X){return this._find(X,!1)>=0},J.prototype.get=function(X){var oe=this._find(X,!1);return oe>=0?this._values[oe]:void 0},J.prototype.set=function(X,oe){var fe=this._find(X,!0);return this._values[fe]=oe,this},J.prototype.delete=function(X){var oe=this._find(X,!1);if(oe>=0){for(var fe=this._keys.length,pe=oe+1;pe<fe;pe++)this._keys[pe-1]=this._keys[pe],this._values[pe-1]=this._values[pe];return this._keys.length--,this._values.length--,X===this._cacheKey&&(this._cacheKey=h,this._cacheIndex=-2),!0}return!1},J.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=h,this._cacheIndex=-2},J.prototype.keys=function(){return new k(this._keys,this._values,R)},J.prototype.values=function(){return new k(this._keys,this._values,U)},J.prototype.entries=function(){return new k(this._keys,this._values,H)},J.prototype["@@iterator"]=function(){return this.entries()},J.prototype[i]=function(){return this.entries()},J.prototype._find=function(X,oe){return this._cacheKey!==X&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=X)),this._cacheIndex<0&&oe&&(this._cacheIndex=this._keys.length,this._keys.push(X),this._values.push(void 0)),this._cacheIndex},J}();function R(J,X){return J}function U(J,X){return X}function H(J,X){return[J,X]}}function v(){return function(){function h(){this._map=new y}return Object.defineProperty(h.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),h.prototype.has=function(p){return this._map.has(p)},h.prototype.add=function(p){return this._map.set(p,p),this},h.prototype.delete=function(p){return this._map.delete(p)},h.prototype.clear=function(){this._map.clear()},h.prototype.keys=function(){return this._map.keys()},h.prototype.values=function(){return this._map.values()},h.prototype.entries=function(){return this._map.entries()},h.prototype["@@iterator"]=function(){return this.keys()},h.prototype[i]=function(){return this.keys()},h}()}function d(){var h=16,p=u.create(),k=R();return function(){function oe(){this._key=R()}return oe.prototype.has=function(fe){var pe=U(fe,!1);return pe!==void 0?u.has(pe,this._key):!1},oe.prototype.get=function(fe){var pe=U(fe,!1);return pe!==void 0?u.get(pe,this._key):void 0},oe.prototype.set=function(fe,pe){var ve=U(fe,!0);return ve[this._key]=pe,this},oe.prototype.delete=function(fe){var pe=U(fe,!1);return pe!==void 0?delete pe[this._key]:!1},oe.prototype.clear=function(){this._key=R()},oe}();function R(){var oe;do oe="@@WeakMap@@"+X();while(u.has(p,oe));return p[oe]=!0,oe}function U(oe,fe){if(!r.call(oe,k)){if(!fe)return;Object.defineProperty(oe,k,{value:u.create()})}return oe[k]}function H(oe,fe){for(var pe=0;pe<fe;++pe)oe[pe]=Math.random()*255|0;return oe}function J(oe){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(oe)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(oe)):H(new Uint8Array(oe),oe):H(new Array(oe),oe)}function X(){var oe=J(h);oe[6]=oe[6]&79|64,oe[8]=oe[8]&191|128;for(var fe="",pe=0;pe<h;++pe){var ve=oe[pe];(pe===4||pe===6||pe===8)&&(fe+="-"),ve<16&&(fe+="0"),fe+=ve.toString(16).toLowerCase()}return fe}}function m(h){return h.__=void 0,delete h.__,h}})})(nc||(nc={}));var pn={};Object.defineProperty(pn,"__esModule",{value:!0}),pn.Channel=void 0;var k1=function(){function t(){this.subscriptions=new Map}return t.prototype.publish=function(e,r){var n=this,a=this.subscriptions.get(e);a&&a.forEach(function(i){i(r,e,n,i)})},t.prototype.subscribe=function(e,r){var n=this.subscriptions.get(e);n||(n=[],this.subscriptions.set(e,n)),n.push(r)},t.prototype.unsubscribe=function(e,r){var n=this.subscriptions.get(e);n&&(n=n.filter(function(a){return a!==r}),n.length?this.subscriptions.set(e,n):this.subscriptions.delete(e))},t.prototype.unsubscribeAll=function(){this.subscriptions.clear()},t}();pn.Channel=k1;var gn={};Object.defineProperty(gn,"__esModule",{value:!0}),gn.PubSub=void 0;var A1=pn;gn.PubSub=new A1.Channel;var Jn={},fr={};Object.defineProperty(fr,"__esModule",{value:!0}),fr.SUBSCRIPTIONS_METADATA_KEY=fr.CHANNEL_METADATA_KEY=void 0,fr.CHANNEL_METADATA_KEY=Symbol("pubsub:channel"),fr.SUBSCRIPTIONS_METADATA_KEY=Symbol("pubsub:subscriptions"),Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.Subscribe=void 0;var ac=fr;function D1(t){return function(e,r,n){var a=Reflect.getMetadata(ac.SUBSCRIPTIONS_METADATA_KEY,e)||new Set;a.add({message:t,handler:n.value}),Reflect.defineMetadata(ac.SUBSCRIPTIONS_METADATA_KEY,a,e)}}Jn.Subscribe=D1;var Xn={},N1=Ae&&Ae.__spreadArray||function(t,e){for(var r=0,n=e.length,a=t.length;r<n;r++,a++)t[a]=e[r];return t};Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.Subscriber=void 0;var ki=fr,O1=gn;function R1(t){var e=(t==null?void 0:t.channel)||O1.PubSub;return function(r){Reflect.defineMetadata(ki.CHANNEL_METADATA_KEY,e,r.prototype);var n=function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var o=r,s=new(o.bind.apply(o,N1([void 0],a))),l=Reflect.getMetadata(ki.SUBSCRIPTIONS_METADATA_KEY,r.prototype);if(l){var u=[];Reflect.defineMetadata(ki.SUBSCRIPTIONS_METADATA_KEY,u,s),l.forEach(function(f){var w=f.handler.bind(s);u.push({message:f.message,handler:w}),e.subscribe(f.message,w)})}return s};return n.prototype=r.prototype,t!=null&&t.createInstance&&new n(t.constructorParameters),n}}Xn.Subscriber=R1;var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.Unsubscribe=void 0;var ic=fr;function L1(){return function(t,e,r){var n=r.value;return r.value=function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var o=Reflect.getMetadata(ic.CHANNEL_METADATA_KEY,t),s=Reflect.getMetadata(ic.SUBSCRIPTIONS_METADATA_KEY,this);return o&&s&&s.forEach(function(l){o.unsubscribe(l.message,l.handler)}),n(a)},r}}Qn.Unsubscribe=L1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Unsubscribe=t.Subscriber=t.Subscribe=t.PubSub=t.Channel=void 0;var e=pn;Object.defineProperty(t,"Channel",{enumerable:!0,get:function(){return e.Channel}});var r=gn;Object.defineProperty(t,"PubSub",{enumerable:!0,get:function(){return r.PubSub}});var n=Jn;Object.defineProperty(t,"Subscribe",{enumerable:!0,get:function(){return n.Subscribe}});var a=Xn;Object.defineProperty(t,"Subscriber",{enumerable:!0,get:function(){return a.Subscriber}});var i=Qn;Object.defineProperty(t,"Unsubscribe",{enumerable:!0,get:function(){return i.Unsubscribe}})}(Me);const _t=new Me.Channel;class M1 extends wr{async getAllStaffs(e,r,n){const a=this.instance.get(`/api/2.1/scheduling/companies/${n}/staff?account=${encodeURIComponent(r)}`,this.getAxiosConfig(e));if(a!==null)try{return(await a).items}catch(i){throw i}else throw new Ne(ke.INTERNAL_ERROR)}async getById(e,r,n,a){let i=`/api/2.1/scheduling/companies/${n}/staff/${a}?account=${encodeURIComponent(r)}`;const o=this.instance.get(i,this.getAxiosConfig(e));if(o!==null)try{return await o}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}async createStaff(e,r,n,a){let i=`/api/2.1/scheduling/companies/${n}/staff?account=${encodeURIComponent(r)}`;const o=this.instance.post(i,a,this.getAxiosConfig(e));if(o!==null)try{return await o}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}async updateStaff(e,r,n,a,i){let o=`/api/2.1/scheduling/companies/${n}/staff/${a}?account=${encodeURIComponent(r)}`;const s=this.instance.put(o,i,this.getAxiosConfig(e));if(s!==null)try{return await s}catch(l){throw l}else throw new Ne(ke.INTERNAL_ERROR)}async patchAllStaff(e,r,n,a){let i=`/api/2.1/scheduling/companies/${n}/staff?account=${encodeURIComponent(r)}`;const o=this.instance.patch(i,a,this.getAxiosConfig(e));if(o!==null)try{await o;return}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}async delete(e,r,n,a){let i=`/api/2.1/scheduling/companies/${n}/staff/${a}?account=${encodeURIComponent(r)}`;const o=this.instance.delete(i,this.getAxiosConfig(e));if(o!==null)try{await o}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}filteredDataLog(e){return e!=null&&e.items?e==null?void 0:e.items.map(r=>({id:r.id})):e}}class oc{constructor(e){g(this,"indexedDb"),this.indexedDb=e}async getAllStaffs(e){return(await this.indexedDb.getAllValue(zr)||[]).filter(r=>{var n;return((n=r.company)==null?void 0:n.id)===e})}async getById(e,r){var n;const a=await this.indexedDb.getValue(zr,r);if(((n=a==null?void 0:a.company)==null?void 0:n.id)===e)return a;throw sr}async saveAllStaffs(e){await this.indexedDb.putBulkValue(zr,e)}async deleteById(e,r){await this.indexedDb.deleteValue(zr,r)}async deleteByStaffIds(e){await this.indexedDb.deleteValues(zr,e)}async drop(){await this.indexedDb.deleteAllValues(zr)}updateServiceSkills(e,r,n){this.getAllStaffs(e).then(async a=>{const i=a.filter(o=>{var s;return(s=o.servicesSkill)==null?void 0:s.includes(r)});i&&i.length>0&&(i.forEach(o=>{var s,l,u;const f=(s=o.servicesSkill)==null?void 0:s.findIndex(w=>w===r);f!=null&&(n?(l=o.servicesSkill)==null||l.splice(f,1,n):(u=o.servicesSkill)==null||u.splice(f,1))}),await this.saveAllStaffs(i))})}}var P1=Object.defineProperty,F1=Object.getOwnPropertyDescriptor,Ai=(t,e,r,n)=>{for(var a=n>1?void 0:n?F1(e,r):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(a=(n?o(e,r,a):o(a))||a);return n&&a&&P1(e,r,a),a};const vn=new Me.Channel;let ea=class extends lr{constructor(t,e,r,n){super("staff",n),g(this,"staffDb"),g(this,"staffService"),this.staffDb=new oc(e),this.staffService=new M1(r,t,n)}dispose(){}async onCascadeDelete(t,e,r,n){r==_t&&await this.cascadeDelete({account:t.account,companyId:t.companyId},a=>{var i;return((i=a==null?void 0:a.company)==null?void 0:i.id)===t.companyId})}async getAllStaffs(t,e,r,n=Le.LOCAL_THEN_REMOTE){return this.list(t,n,{account:e,companyId:r})}async getStaff(t,e,r,n,a=Le.LOCAL_THEN_REMOTE){return this.getById(t,a,{account:e,companyId:r,staffId:n})}async createStaff(t,e,r,n){const a=await this.create(t,Le.REMOTE_THEN_LOCAL,{account:e,companyId:r},n);return vn.publish(Je.CREATE,{account:e,companyId:r,staff:a}),a}async updateStaff(t,e,r,n,a){const i=await this.update(t,Le.REMOTE_THEN_LOCAL,{account:e,companyId:r,staffId:n},a);return vn.publish(Je.UPDATE,{account:e,companyId:r,staffId:n,staff:i}),i}async patchAllStaff(t,e,r,n,a){let i=new Yt;return n&&(i.workingHours=n),a&&(i.vacations=a),await this.staffService.patchAllStaff(t,e,r,i),this.getAllStaffs(t,e,r,Le.REMOTE_THEN_LOCAL)}async deleteStaff(t,e,r,n){await this.deleteById(t,{account:e,companyId:r,staffId:n}),vn.publish(Je.DELETE,{account:e,companyId:r,staffId:n})}async remoteList(t,e){return(await this.staffService.getAllStaffs(t,e.account,e.companyId)).map(r=>Yt.fromStaffDto(r))}async remoteGet(t,e){this.checkNullable(e);const r=await this.staffService.getById(t,e.account,e.companyId,e.staffId);return Yt.fromStaffDto(r)}async remoteCreate(t,e,r){const n=Yt.toStaffDto(r),a=await this.staffService.createStaff(t,e.account,e.companyId,n);return Yt.fromStaffDto(a)}async remoteUpdate(t,e,r){this.checkNullable(e);const n=Yt.toStaffDto(r),a=await this.staffService.updateStaff(t,e.account,e.companyId,e.staffId,n);return Yt.fromStaffDto(a)}async remoteDelete(t,e){this.checkNullable(e),await this.staffService.delete(t,e.account,e.companyId,e.staffId)}async localList(t){return this.staffDb.getAllStaffs(t.companyId)}async localGet(t){return this.checkNullable(t),this.staffDb.getById(t.companyId,t.staffId)}async localBulkSave(t,e){await this.staffDb.saveAllStaffs(e)}async localDelete(t){this.checkNullable(t),await this.staffDb.deleteById(t.companyId,t.staffId)}async localBulkDelete(t){await this.staffDb.deleteByStaffIds(t.map(e=>e.id||""))}checkNullable(t){if(!t.staffId)throw Error("Invalid state:"+JSON.stringify(t))}};Ai([Me.Unsubscribe()],ea.prototype,"dispose",1),Ai([Me.Subscribe(Je.DELETE)],ea.prototype,"onCascadeDelete",1),ea=Ai([Me.Subscriber({channel:_t})],ea);class z1 extends wr{async getAllServices(e,r,n){const a=this.instance.get(`/api/2.1/scheduling/companies/${n}/services?account=${encodeURIComponent(r)}`,this.getAxiosConfig(e));if(a!==null)try{return(await a).items}catch(i){throw i}else throw new Ne(ke.INTERNAL_ERROR)}async getById(e,r,n,a){let i=`/api/2.1/scheduling/companies/${n}/services/${a}?account=${encodeURIComponent(r)}`;const o=this.instance.get(i,this.getAxiosConfig(e));if(o!==null)try{return await o}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}async createService(e,r,n,a){let i=`/api/2.1/scheduling/companies/${n}/services?account=${encodeURIComponent(r)}`;const o=this.instance.post(i,a,this.getAxiosConfig(e));if(o!==null)try{return await o}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}async updateService(e,r,n,a,i){let o=`/api/2.1/scheduling/companies/${n}/services/${a}?account=${encodeURIComponent(r)}`;const s=this.instance.put(o,i,this.getAxiosConfig(e));if(s!==null)try{return await s}catch(l){throw l}else throw new Ne(ke.INTERNAL_ERROR)}async delete(e,r,n,a){let i=`/api/2.1/scheduling/companies/${n}/services/${a}?account=${encodeURIComponent(r)}`;const o=this.instance.delete(i,this.getAxiosConfig(e));if(o!==null)try{await o}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}filteredDataLog(e){return e!=null&&e.items?e==null?void 0:e.items.map(r=>({id:r.id})):e}}class sc{constructor(e){g(this,"indexedDb"),this.indexedDb=e}async getAllServiceGroups(e){return(await this.indexedDb.getAllValue(Vr)||[]).filter(r=>r.companyId===e)}async saveAllServiceGroups(e){await this.indexedDb.putBulkValue(Vr,e)}async getById(e,r){const n=await this.indexedDb.getValue(Vr,r);if((n==null?void 0:n.companyId)===e)return n;throw sr}async deleteById(e,r){await this.getById(e,r),await this.indexedDb.deleteValue(Vr,r),new oc(this.indexedDb).updateServiceSkills(e,r,void 0)}async deleteByServiceGroupIds(e){await this.indexedDb.deleteValues(Vr,e)}async drop(){await this.indexedDb.deleteAllValues(Vr)}updateServices(e,r,n){this.getAllServiceGroups(e).then(async a=>{const i=a.filter(o=>{var s;return(s=o.members)==null?void 0:s.find(l=>l.id===r)});i&&i.length>0&&(i.forEach(o=>{var s,l,u;const f=(s=o.members)==null?void 0:s.findIndex(w=>w.id===r);f!=null&&(n?(l=o.members)==null||l.splice(f,1,n):(u=o.members)==null||u.splice(f,1))}),await this.saveAllServiceGroups(i))})}}class lc{constructor(e){g(this,"indexedDb"),this.indexedDb=e}async getAllServices(e){return(await this.indexedDb.getAllValue(Br)||[]).filter(r=>{var n;return((n=r.company)==null?void 0:n.id)===e})}async saveAllServices(e){await this.indexedDb.putBulkValue(Br,e)}async getById(e,r){var n;const a=await this.indexedDb.getValue(Br,r);if(((n=a==null?void 0:a.company)==null?void 0:n.id)===e)return a;throw sr}async deleteById(e,r){await this.getById(e,r),await this.indexedDb.deleteValue(Br,r),new sc(this.indexedDb).updateServices(e,r,void 0)}async deleteByServiceIds(e){await this.indexedDb.deleteValues(Br,e)}async drop(){await this.indexedDb.deleteAllValues(Br)}updateStaffSkills(e,r,n){this.getAllServices(e).then(async a=>{const i=a.filter(o=>{var s;return(s=o.staffsSkill)==null?void 0:s.includes(r)});i&&i.length>0&&(i.forEach(o=>{var s,l,u;const f=(s=o.staffsSkill)==null?void 0:s.findIndex(w=>w===r);f!=null&&(n?(l=o.staffsSkill)==null||l.splice(f,1,n):(u=o.staffsSkill)==null||u.splice(f,1))}),await this.saveAllServices(i))})}}var B1=Object.defineProperty,U1=Object.getOwnPropertyDescriptor,Di=(t,e,r,n)=>{for(var a=n>1?void 0:n?U1(e,r):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(a=(n?o(e,r,a):o(a))||a);return n&&a&&B1(e,r,a),a};const yn=new Me.Channel;let ta=class extends lr{constructor(t,e,r,n){super("service",n),g(this,"serviceDb"),g(this,"serviceService"),this.serviceDb=new lc(e),this.serviceService=new z1(r,t,n)}dispose(){}async onCascadeDelete(t,e,r,n){r==_t&&await this.cascadeDelete({account:t.account,companyId:t.companyId},a=>{var i;return((i=a==null?void 0:a.company)==null?void 0:i.id)===t.companyId})}async getAllServices(t,e,r,n=Le.LOCAL_THEN_REMOTE){return this.list(t,n,{account:e,companyId:r})}async getService(t,e,r,n,a=Le.LOCAL_THEN_REMOTE){return this.getById(t,a,{account:e,companyId:r,serviceId:n})}async createService(t,e,r,n){const a=await super.create(t,Le.REMOTE_THEN_LOCAL,{account:e,companyId:r},n);return yn.publish(Je.CREATE,{account:e,companyId:r,service:a}),a}async updateService(t,e,r,n,a){const i=await super.update(t,Le.REMOTE_THEN_LOCAL,{account:e,companyId:r,serviceId:n},a);return yn.publish(Je.UPDATE,{account:e,companyId:r,serviceId:n,service:i}),i}async deleteService(t,e,r,n){await this.deleteById(t,{account:e,companyId:r,serviceId:n}),yn.publish(Je.DELETE,{account:e,companyId:r,serviceId:n})}async remoteList(t,e){return(await this.serviceService.getAllServices(t,e.account,e.companyId)).map(r=>ar.fromServiceDto(r))}async remoteGet(t,e){this.checkNullable(e);const r=await this.serviceService.getById(t,e.account,e.companyId,e.serviceId);return ar.fromServiceDto(r)}async remoteCreate(t,e,r){const n=ar.toServiceDto(r),a=await this.serviceService.createService(t,e.account,e.companyId,n);return ar.fromServiceDto(a)}async remoteUpdate(t,e,r){this.checkNullable(e);const n=ar.toServiceDto(r),a=await this.serviceService.updateService(t,e.account,e.companyId,e.serviceId,n);return ar.fromServiceDto(a)}async remoteDelete(t,e){this.checkNullable(e),await this.serviceService.delete(t,e.account,e.companyId,e.serviceId)}async localList(t){return this.serviceDb.getAllServices(t.companyId)}async localGet(t){return this.checkNullable(t),this.serviceDb.getById(t.companyId,t.serviceId)}async localBulkSave(t,e){await this.serviceDb.saveAllServices(e)}async localDelete(t){this.checkNullable(t),await this.serviceDb.deleteById(t.companyId,t.serviceId)}async localBulkDelete(t){await this.serviceDb.deleteByServiceIds(t.map(e=>e.id||""))}checkNullable(t){if(!t.serviceId)throw Error("Invalid state:"+JSON.stringify(t))}};Di([Me.Unsubscribe()],ta.prototype,"dispose",1),Di([Me.Subscribe(Je.DELETE)],ta.prototype,"onCascadeDelete",1),ta=Di([Me.Subscriber({channel:_t})],ta);class V1 extends wr{async searchContacts(e,r,n,a=100,i=!0){let o="/api/2.3/clients",s=this.getAxiosConfig(e);s.params.q=r,s.params.maxResult=a,n&&(s.params.account=n);const l=this.instance.get(o,s);if(l!==null)try{const u=await l;return i?u.items:u}catch(u){throw u}else throw new Ne(ke.INTERNAL_ERROR)}async advancedSearchContacts(e,r,n,a=100,i=!0){let o="/api/2.3/clients/search",s=this.getAxiosConfig(e);s.params.maxResult=a,n&&(s.params.account=n);const l=this.instance.post(o,r,s);if(l!==null)try{const u=await l;return i?u.items:u}catch(u){throw u}else throw new Ne(ke.INTERNAL_ERROR)}async createContact(e,r,n){const a=this.instance.post(`/api/2.0/clients?account=${encodeURIComponent(r)}`,n,this.getAxiosConfig(e));if(a!==null)try{return await a}catch(i){throw i}else throw new Ne(ke.INTERNAL_ERROR)}async updateContact(e,r,n,a){const i=this.instance.put(`/api/2.0/clients/${n}?account=${encodeURIComponent(r)}`,a,this.getAxiosConfig(e));if(i!==null)try{return await i}catch(o){throw o}else throw new Ne(ke.INTERNAL_ERROR)}async getById(e,r,n){let a=`/api/2.3/clients/${n}?account=${encodeURIComponent(r)}`;const i=this.instance.get(a,this.getAxiosConfig(e));if(i!==null)try{return await i}catch(o){throw o}else throw new Ne(ke.INTERNAL_ERROR)}async deleteBy(e,r,n){let a=`/api/2.0/clients/${n}?account=${encodeURIComponent(r)}`;const i=this.instance.delete(a,this.getAxiosConfig(e));if(i!==null)try{await i}catch(o){throw o}else throw new Ne(ke.INTERNAL_ERROR)}filteredDataLog(e){return e!=null&&e.items?e==null?void 0:e.items.map(r=>({id:r.id})):e}}class j1{constructor(e){g(this,"indexedDb"),this.indexedDb=e}async getAllContacts(){return this.indexedDb.getAllValue(hn)}async saveAllContacts(e){await this.indexedDb.putBulkValue(hn,e)}async getById(e){return this.indexedDb.getValue(hn,e)}async deleteById(e){await this.indexedDb.deleteValue(hn,e)}async drop(){this.indexedDb.deleteAllValues(hn)}}function q1(t){t||(t=[]),G1(t);let e="",r="";for(const n of t)e+=r+n,r=",";return e}function H1(){const t=[];return t.push(Xe.ID),t.push(Xe.START),t.push(Xe.END),t.push(Xe.STAFF),t.push(Xe.SERVICE),t.push(Xe.STATUS),t.push(Xe.COMPANY),t.push(Xe.OWNER),t.push(Xe.CLIENT),t.push(Xe.ONLINE_MEETING),t.push(Xe.FORM),t.push(Xe.PRICE),t.push(Xe.SOURCE),t.push(Xe.SUMMARY),t.push(Xe.NOTES),t.push(Xe.PREPARATION_DURATION),t.push(Xe.BUFFER_DURATION),t}function G1(t){t.push(Xe.ID),t.push(Xe.START),t.push(Xe.END),t.push(Xe.SOURCE)}var Xe=(t=>(t.ID="id",t.START="start",t.END="end",t.OWNER="owner",t.NOTES="notes",t.CREATED="created",t.STAFF="staff",t.HISTORY="history",t.SOURCE="source",t.REFERENCE="reference",t.SERVICE="service",t.ENCRYPTED_ID="encryptedId",t.PAID="paid",t.CLIENT="client",t.COMPANY="company",t.STATUS="status",t.SUMMARY="summary",t.RESOURCE="resource",t.SERVICE_RESOURCE="service-resource",t.PARENT="parent",t.RESCHEDULE_LINK="rescheduleLink",t.ONLINE_MEETING="onlineMeeting",t.PRICE="price",t.FORM="form",t.PREPARATION_DURATION="preparationDuration",t.BUFFER_DURATION="bufferDuration",t))(Xe||{});class $1 extends wr{async createEvent(e,r,n,a,i){let o=`/api/2.1/scheduling/companies/${n}/appointments?account=${encodeURIComponent(r)}`;i&&(o=o+"&force=true"),a.form=await this._prepareFormFields(a.form);const s=this.instance.post(o,a,this.getAxiosConfig(e));if(s!==null)try{return await s}catch(l){throw l}else throw new Ne(ke.INTERNAL_ERROR)}async updateEvent(e,r,n,a,i=!1){let o=`/api/2.1/scheduling/companies/${n}/appointments/${a.id}?account=${encodeURIComponent(r)}`;i&&(o=o+"&force=true"),a.form=await this._prepareFormFields(a.form);const s=this.instance.put(o,a,this.getAxiosConfig(e));if(s!==null)try{return await s}catch(l){throw l}else throw new Ne(ke.INTERNAL_ERROR)}async updateEventStatus(e,r,n,a,i){let o=`/api/2.1/scheduling/companies/${n}/appointments/${a}?account=${encodeURIComponent(r)}`;const s=this.instance.put(o,{status:i},this.getAxiosConfig(e));if(s!==null)try{return await s}catch(l){throw l}else throw new Ne(ke.INTERNAL_ERROR)}async getExternalAppointments(e,r,n,a,i){let o=this.getAxiosConfig(e);o.params.userIds=r,o.params.start=n,o.params.end=a,o.params.timeZone=i;const s=this.instance.get("/api/2.1/scheduling/externalAppointments",o);if(s!==null)try{return(await s).items}catch(l){throw l}else throw new Ne(ke.INTERNAL_ERROR)}async getICS(e,r){let n=this.getAxiosConfig(e),a=r;if(r.indexOf("calendar.google.com/calendar")>0){const o=r.indexOf("://"),s=o>0?r.substring(o+3):r;a="/api/2.3/forward/https//"+s}const i=this.instance.get(a,n);if(i!==null)try{return await i}catch(o){throw o}else throw new Ne(ke.INTERNAL_ERROR)}async getAllEvents(e,r,n,a,i,o,s){let l=this.getAxiosConfig(e);l.params.userIds=r,l.params.start=n,l.params.end=a,l.params.levelDetail="full",i&&(l.params.personalAppointments=!0),l.params.showDeleted=o,s&&s.length>0?l.params.fields=q1(s):l.params.fields=H1().map(f=>`${f}`).join(",");const u=this.instance.get("/api/2.1/scheduling/appointments",l);if(u!==null)try{return(await u).items}catch(f){throw f}else throw new Ne(ke.INTERNAL_ERROR)}async getById(e,r,n){let a=this.getAxiosConfig(e);a.params.levelDetail="full",n&&(a.params.personalAppointments=!0);let i=`/api/2.1/scheduling/appointments/${r}`;const o=this.instance.get(i,a);if(o!==null)try{return await o}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}async _prepareFormFields(e){var r;if(e){const n=e.filter(a=>a.inputType!=="file"||a.inputType==="file"&&a.value!==void 0);try{n.forEach(a=>{var i;a.values&&(a.values=(i=a.values)==null?void 0:i.filter(o=>typeof a.value=="string"&&a.value===o.value||Array.isArray(a.value)&&a.value.indexOf(o.value)!==-1),Array.isArray(a.value)&&(a.value=void 0))});for(const a of n.filter(i=>i.inputType==="rating"&&i.value!==void 0&&i.value!==""))a.values=[{id:a.value,value:a.value,name:a.value}];for(const a of n.filter(i=>i.inputType==="file"))a.fileName=a.value.name,a.value=await Jm(a.value)}catch(a){(r=this.logger)==null||r.error("js-calendar-api","Error while prepared form fields",a)}return n}}filteredDataLog(e){return e!=null&&e.items?e==null?void 0:e.items.map(r=>({id:r.id})):e}}class W1{constructor(e){g(this,"indexedDb"),this.indexedDb=e}async saveAllEvents(e){await this.indexedDb.putBulkValue(ur,e)}async saveEvent(e){await this.indexedDb.putValue(ur,e)}async deleteEvent(e){await this.indexedDb.deleteValue(ur,e)}async deleteByEventIds(e){await this.indexedDb.deleteValues(ur,e)}async getAllEvents(e,r,n){return(await this.indexedDb.getAllValue(ur)||[]).filter(a=>{var i,o,s;const l=e===void 0||e.includes(((i=a.staff)==null?void 0:i.userId)||"")||((o=a.staff)==null?void 0:o.userId)==="0"&&e.includes(a.staff.id);return((s=a.staff)==null?void 0:s.userId)!==void 0&&l&&(r===void 0||a.start.getTime()>=r.getTime())&&(n===void 0||a.end.getTime()<=n.getTime())})}async getFirstEventByChildEventId(e){const r=(await this.indexedDb.getAllValue(ur)||[]).filter(n=>{var a;return(a=n.events)==null?void 0:a.some(i=>i.id===e)});return(r==null?void 0:r.length)>0?r[0]:void 0}async getById(e){return this.indexedDb.getValue(ur,e)}async drop(){await this.indexedDb.deleteAllValues(ur)}}class ra extends Map{static fromStorage(e){let r=new ra;return e&&Object.entries(JSON.parse(e)).forEach(n=>{r.set(n[0],n[1])}),r}}class Y1{constructor(){g(this,"STORAGE_KEY","eventCoverage")}getCoverage(e,r,n,a){return this.getLocalCoverage(e,new cc(Ct.fromDate(r),Ct.fromDate(n)),a)}getLocalCoverage(e,r,n){let a=ra.fromStorage(localStorage.getItem(this.STORAGE_KEY)),i=[],o=[],s=[];r.getRange().forEach(y=>{e.forEach(x=>{s.push({userId:x,year:y.year,month:y.month})})}),s.forEach(y=>{let x=a.get(y.userId);K1(new Ct(y.year,y.month),x||[])?i.push(y):o.push(y)}),n==null||n.debug("js-calendar-api","Month to load (local): ",i),n==null||n.debug("js-calendar-api","Month to load (remote): ",o);let l=uc(i),u=uc(o),f=fc(l),w=fc(u);return{local:f,remote:w}}saveCoverage(e,r,n,a){return this.saveLocalCoverage(e,new cc(Ct.fromDate(r),Ct.fromDate(n)),a)}saveLocalCoverage(e,r,n){let a=ra.fromStorage(localStorage.getItem(this.STORAGE_KEY));e.forEach(i=>{let o=a==null?void 0:a.get(i),s=o?o.filter(l=>{r.isIn(l.month,l.year)}):[];r.getRange().forEach(l=>{s.push({userId:i,year:l.year,month:l.month})}),n==null||n.debug("js-calendar-api",`Add coverage ${i} ${JSON.stringify(s)}`),a==null||a.set(i,s)}),localStorage.setItem(this.STORAGE_KEY,JSON.stringify(Object.fromEntries(a)))}clearStorage(){localStorage.removeItem(this.STORAGE_KEY)}}class cc{constructor(e,r){g(this,"start"),g(this,"end"),this.start=e,this.end=r}isIn(e,r){let n=Ct.toNumber(r,e);return this.start.toNumber()<=n&&this.end.toNumber()>=n}getRange(){let e=this.start.year,r=this.start.month,n=[];do n.push(new Ct(e,r)),r++,r==12&&(r=0,e++);while(Ct.toNumber(e,r)<=this.end.toNumber());return n}}class Ct{constructor(e,r){g(this,"month"),g(this,"year"),this.year=e,this.month=r}toNumber(){return Ct.toNumber(this.year,this.month)}static fromDate(e){return new Ct(e.getFullYear(),e.getMonth())}static toNumber(e,r){return e*12+r}}const na=t=>{const e=t.month+1;return new Date(t.year+"-"+(e<10?"0"+e:e)+"-01")},Z1=(t,e,r,n)=>t===r&&Math.abs(e-n)===1||Math.abs(t-r)===1&&Math.abs(e-n)===11,K1=(t,e)=>e.filter(r=>r.year===t.year&&r.month===t.month).length>0,uc=t=>{const e=(a,i)=>Ct.toNumber(a.year,a.month)-Ct.toNumber(i.year,i.month);t.sort(e);let r=[];if(t.length===0)return r;let n;return t.forEach((a,i)=>{i===0?n={userId:[a.userId],month:a.month,year:a.year}:a.month===n.month&&a.year===n.year?n.userId.push(a.userId):(r.push(n),n={userId:[a.userId],month:a.month,year:a.year}),i===t.length-1&&r.push(n)}),r};function dc(t,e,r){return{userId:t.userId,start:{year:e.year,month:e.month},end:{year:r.month==11?r.year+1:r.year,month:r.month==11?0:r.month+1}}}const fc=t=>{let e=[];if(t.length===0)return e;let r,n;return t.sort((a,i)=>a.year<i.year?-1:a.year>i.year||a.month>i.month?1:a.month<i.month?-1:0),t.forEach((a,i)=>{if(i===0)r=a,n=a;else if(Z1(a.year,a.month,n.year,n.month))n=a;else{let o=dc(a,r,n);e.push(o),r=a,n=a}if(i===t.length-1){let o=dc(a,r,n);e.push(o)}}),e};var J1=Object.defineProperty,X1=Object.getOwnPropertyDescriptor,Ni=(t,e,r,n)=>{for(var a=n>1?void 0:n?X1(e,r):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(a=(n?o(e,r,a):o(a))||a);return n&&a&&J1(e,r,a),a};const bn=new Me.Channel;let aa=class extends lr{constructor(t,e,r,n){super("event",n),g(this,"REPOSITORY_NAME","Appointment"),g(this,"USE_EVENT_COVERAGE",!1),g(this,"eventDb"),g(this,"eventService"),g(this,"eventMetaStorage"),this.eventDb=new W1(e),this.eventService=new $1(r,t,n),this.eventMetaStorage=new Y1}dispose(){}async onCascadeDelete(t,e,r,n){r==_t&&await this.cascadeDelete({account:t.account,companyId:t.companyId},a=>{var i;return((i=a==null?void 0:a.company)==null?void 0:i.id)===t.companyId})}async createEvent(t,e,r,n,a,i){const o=await this.create(t,Le.REMOTE_THEN_LOCAL,{account:e,companyId:r,timeZone:a,force:i},n);return bn.publish(Je.CREATE,{account:e,companyId:r,event:o}),o}async updateEvent(t,e,r,n,a,i){let o=await this.update(t,Le.REMOTE_THEN_LOCAL,{account:e,companyId:r,timeZone:a,force:i},n);return bn.publish(Je.UPDATE,{account:e,companyId:r,event:o}),o}async updateEventStatus(t,e,r,n,a){let i=await this.remoteUpdateStatus(t,{account:e,companyId:r,eventId:n},a);return bn.publish(Je.UPDATE,{account:e,companyId:r,event:i}),i}async getEvent(t,e,r,n=Le.LOCAL_THEN_REMOTE){return this.getById(t,n,{eventId:e,showPersonal:r})}async getAllEvents(t,e,r,n,a,i,o,s,l=Le.LOCAL_THEN_REMOTE){let u=!0,f=[];if(l===Le.REMOTE_ONLY)f=await this.remoteList(t,{userIds:e.join(","),start:r,end:n,timeZone:o,showPersonal:a,showDeleted:i,fields:s}),await this.localBulkSave({},f),u=!1;else if(l===Le.LOCAL_ONLY)f=await this.localList({userIds:e.join(","),start:r,end:n,showPersonal:a,showDeleted:i});else if(l==Le.REMOTE_THEN_LOCAL){const w=await this.list(t,Le.REMOTE_THEN_LOCAL,{userIds:e.join(","),start:r,end:n,timeZone:o,showPersonal:a,showDeleted:i,fields:s});f=w.results,u=w.local}else if(l==Le.LOCAL_THEN_REMOTE)if(this.USE_EVENT_COVERAGE){let w=await this.getEventWithCoverage(t,e,r,n,a,i,o,s,l);u=w.local,f=w.results}else f=await this.remoteList(t,{userIds:e.join(","),start:r,end:n,timeZone:o,showPersonal:a,showDeleted:i,fields:s}),await this.localBulkSave({},f),u=!1;return{local:u,results:f}}async getEventWithCoverage(t,e,r,n,a,i,o,s,l=Le.LOCAL_THEN_REMOTE){var u,f;let w=!0,y=[],x=this.eventMetaStorage.getCoverage(e,r,n,this.logger);for(const S of x.local){(u=this.logger)==null||u.debug("js-calendar-api",`getAllEvents coverage local: ${JSON.stringify(S)}`);const T=await this.list(t,Le.LOCAL_THEN_REMOTE,{userIds:e.join(","),start:na(S.start),end:na(S.end),timeZone:o,showPersonal:a,showDeleted:i,fields:s});y=y.concat(T.results)}for(const S of x.remote){(f=this.logger)==null||f.debug("js-calendar-api",`getAllEvents coverage remote: ${JSON.stringify(S)}`);const T=await this.list(t,Le.REMOTE_THEN_LOCAL,{userIds:e.join(","),start:na(S.start),end:na(S.end),timeZone:o,showPersonal:a,showDeleted:i,fields:s});y=y.concat(T.results)}return w=x.remote.length===0,{local:w,results:y}}async deleteAllEvents(){return this.eventDb.drop()}async getExternalEvent(t,e,r,n,a){const i=Bn(r,a),o=Bn(n,a);return(await this.eventService.getExternalAppointments(t,e.join(","),i,o,a)).map(s=>Rt.fromEventDto(s,fl.EXTERNAL))}async remoteList(t,e){if(!e.start||!e.end||!e.userIds)throw Error("Invalid state:"+JSON.stringify(e));const r=Bn(e.start,e.timeZone),n=Bn(e.end,e.timeZone),a=await this.eventService.getAllEvents(t,e.userIds,r,n,e.showPersonal,e.showDeleted,e.fields);return this.eventMetaStorage.saveCoverage(e.userIds.split(","),e.start,e.end,this.logger),a.map(i=>Rt.fromEventDto(i))}async remoteGet(t,e){if(!e.eventId)throw Error("Invalid state:"+JSON.stringify(e));const r=await this.eventService.getById(t,e.eventId,e.showPersonal);return Rt.fromEventDto(r)}async remoteCreate(t,e,r){if(!e.account||!e.companyId)throw Error("Invalid state:"+JSON.stringify(e));const n=Rt.toEventDto(r,e.timeZone),a=await this.eventService.createEvent(t,e.account,e.companyId,n,e.force||!1);return Rt.fromEventDto(a)}async remoteUpdate(t,e,r){if(!e.account||!e.companyId)throw Error("Invalid state:"+JSON.stringify(e));let n=Rt.toEventDto(r,e.timeZone);const a=await this.eventService.updateEvent(t,e.account,e.companyId,n,e.force);return Rt.fromEventDto(a)}async remoteUpdateStatus(t,e,r){if(!e.account||!e.companyId||!e.eventId)throw Error("Invalid state:"+JSON.stringify(e));const n=await this.eventService.updateEventStatus(t,e.account,e.companyId,e.eventId,r);return Rt.fromEventDto(n)}async remoteDelete(t,e){throw new Error("Method not implemented.")}async localList(t){var e;return this.eventDb.getAllEvents((e=t.userIds)==null?void 0:e.split(","),t.start,t.end)}async localGet(t){if(!t.eventId)throw Error("Invalid state:"+JSON.stringify(t));return this.eventDb.getById(t.eventId)}async localBulkSave(t,e){await this.eventDb.saveAllEvents(e)}async localDelete(t){throw new Error("Method not implemented.")}async localBulkDelete(t){await this.eventDb.deleteByEventIds(t.map(e=>e.id||""))}};Ni([Me.Unsubscribe()],aa.prototype,"dispose",1),Ni([Me.Subscribe(Je.DELETE)],aa.prototype,"onCascadeDelete",1),aa=Ni([Me.Subscriber({channel:_t})],aa);var Q1=Object.defineProperty,e0=Object.getOwnPropertyDescriptor,hc=(t,e,r,n)=>{for(var a=n>1?void 0:n?e0(e,r):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(a=(n?o(e,r,a):o(a))||a);return n&&a&&Q1(e,r,a),a};const mc=new Me.Channel;let Oi=class extends lr{constructor(t,e,r,n){super("contact",n),g(this,"contactDb"),g(this,"contactService"),this.contactDb=new j1(e),this.contactService=new V1(r,t,n)}async onCascadeChange(t,e,r,n){var a,i,o,s;r==bn&&(i=(a=t.event)==null?void 0:a.client)!=null&&i.id&&await this.cascadeDeleteItem({account:t.account,contactId:(s=(o=t.event)==null?void 0:o.client)==null?void 0:s.id})}async searchContacts(t,e,r){return this.list(t,Le.REMOTE_THEN_LOCAL,{account:r||"",query:e})}async searchContactWithPages(t,e,r,n){let a;return typeof e=="string"?a=await this.contactService.searchContacts(t,e||"",r,100,!1):a=await this.contactService.advancedSearchContacts(t,e,r,100,!1),oi.fromContactSearchDto(a)}async createContact(t,e,r){return r.address===void 0&&(r.address=new fn,r.address.country="FR"),this.create(t,Le.REMOTE_THEN_LOCAL,{account:e},r)}async updateContact(t,e,r,n){return this.update(t,Le.REMOTE_THEN_LOCAL,{account:e,contactId:r},n)}async deleteContact(t,e,r){return this.deleteById(t,{account:e,contactId:r})}async getContact(t,e,r,n=Le.LOCAL_THEN_REMOTE){return this.getById(t,n,{account:e,contactId:r})}async remoteList(t,e){return(await this.contactService.searchContacts(t,e.query||"",e.account)).map(r=>Zt.fromContactDto(r))}async remoteGet(t,e){this.checkNullable(e);const r=await this.contactService.getById(t,e.account,e.contactId);return Zt.fromContactDto(r)}async remoteCreate(t,e,r){const n=Zt.toContactDto(r),a=await this.contactService.createContact(t,e.account,n);return Zt.fromContactDto(a)}async remoteUpdate(t,e,r){this.checkNullable(e);const n=Zt.toContactDto(r),a=await this.contactService.updateContact(t,e.account,e.contactId,n);return Zt.fromContactDto(a)}async remoteDelete(t,e){this.checkNullable(e),await this.contactService.deleteBy(t,e.account,e.contactId)}async localList(t){return this.contactDb.getAllContacts()}async localGet(t){return this.checkNullable(t),this.contactDb.getById(t.contactId)}async localBulkSave(t,e){await this.contactDb.saveAllContacts(e)}async localDelete(t){this.checkNullable(t),await this.contactDb.deleteById(t.contactId)}localBulkDelete(t){return Promise.resolve(void 0)}checkNullable(t){if(!t.contactId)throw Error("Invalid state:"+JSON.stringify(t))}};hc([Me.Subscribe(Je.UPDATE),Me.Subscribe(Je.CREATE)],Oi.prototype,"onCascadeChange",1),Oi=hc([Me.Subscriber({channel:bn})],Oi);const pc=new Me.Channel;var t0={exports:{}};function r0(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gc={exports:{}};const n0={},a0=Object.freeze(Object.defineProperty({__proto__:null,default:n0},Symbol.toStringTag,{value:"Module"})),i0=Dp(a0);var vc;function ze(){return vc||(vc=1,function(t,e){(function(r,n){t.exports=n()})(Ae,function(){var r=r||function(n,a){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof Ae<"u"&&Ae.crypto&&(i=Ae.crypto),!i&&typeof r0=="function")try{i=i0}catch{}var o=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function E(){}return function(A){var I;return E.prototype=A,I=new E,E.prototype=null,I}}(),l={},u=l.lib={},f=u.Base=function(){return{extend:function(E){var A=s(this);return E&&A.mixIn(E),(!A.hasOwnProperty("init")||this.init===A.init)&&(A.init=function(){A.$super.init.apply(this,arguments)}),A.init.prototype=A,A.$super=this,A},create:function(){var E=this.extend();return E.init.apply(E,arguments),E},init:function(){},mixIn:function(E){for(var A in E)E.hasOwnProperty(A)&&(this[A]=E[A]);E.hasOwnProperty("toString")&&(this.toString=E.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),w=u.WordArray=f.extend({init:function(E,A){E=this.words=E||[],A!=a?this.sigBytes=A:this.sigBytes=E.length*4},toString:function(E){return(E||x).stringify(this)},concat:function(E){var A=this.words,I=E.words,D=this.sigBytes,P=E.sigBytes;if(this.clamp(),D%4)for(var z=0;z<P;z++){var Y=I[z>>>2]>>>24-z%4*8&255;A[D+z>>>2]|=Y<<24-(D+z)%4*8}else for(var Q=0;Q<P;Q+=4)A[D+Q>>>2]=I[Q>>>2];return this.sigBytes+=P,this},clamp:function(){var E=this.words,A=this.sigBytes;E[A>>>2]&=4294967295<<32-A%4*8,E.length=n.ceil(A/4)},clone:function(){var E=f.clone.call(this);return E.words=this.words.slice(0),E},random:function(E){for(var A=[],I=0;I<E;I+=4)A.push(o());return new w.init(A,E)}}),y=l.enc={},x=y.Hex={stringify:function(E){for(var A=E.words,I=E.sigBytes,D=[],P=0;P<I;P++){var z=A[P>>>2]>>>24-P%4*8&255;D.push((z>>>4).toString(16)),D.push((z&15).toString(16))}return D.join("")},parse:function(E){for(var A=E.length,I=[],D=0;D<A;D+=2)I[D>>>3]|=parseInt(E.substr(D,2),16)<<24-D%8*4;return new w.init(I,A/2)}},S=y.Latin1={stringify:function(E){for(var A=E.words,I=E.sigBytes,D=[],P=0;P<I;P++){var z=A[P>>>2]>>>24-P%4*8&255;D.push(String.fromCharCode(z))}return D.join("")},parse:function(E){for(var A=E.length,I=[],D=0;D<A;D++)I[D>>>2]|=(E.charCodeAt(D)&255)<<24-D%4*8;return new w.init(I,A)}},T=y.Utf8={stringify:function(E){try{return decodeURIComponent(escape(S.stringify(E)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(E){return S.parse(unescape(encodeURIComponent(E)))}},N=u.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new w.init,this._nDataBytes=0},_append:function(E){typeof E=="string"&&(E=T.parse(E)),this._data.concat(E),this._nDataBytes+=E.sigBytes},_process:function(E){var A,I=this._data,D=I.words,P=I.sigBytes,z=this.blockSize,Y=z*4,Q=P/Y;E?Q=n.ceil(Q):Q=n.max((Q|0)-this._minBufferSize,0);var B=Q*z,G=n.min(B*4,P);if(B){for(var re=0;re<B;re+=z)this._doProcessBlock(D,re);A=D.splice(0,B),I.sigBytes-=G}return new w.init(A,G)},clone:function(){var E=f.clone.call(this);return E._data=this._data.clone(),E},_minBufferSize:0});u.Hasher=N.extend({cfg:f.extend(),init:function(E){this.cfg=this.cfg.extend(E),this.reset()},reset:function(){N.reset.call(this),this._doReset()},update:function(E){return this._append(E),this._process(),this},finalize:function(E){E&&this._append(E);var A=this._doFinalize();return A},blockSize:16,_createHelper:function(E){return function(A,I){return new E.init(I).finalize(A)}},_createHmacHelper:function(E){return function(A,I){return new C.HMAC.init(E,I).finalize(A)}}});var C=l.algo={};return l}(Math);return r})}(gc)),gc.exports}var yc={exports:{}},bc;function ia(){return bc||(bc=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(n){var a=r,i=a.lib,o=i.Base,s=i.WordArray,l=a.x64={};l.Word=o.extend({init:function(u,f){this.high=u,this.low=f}}),l.WordArray=o.extend({init:function(u,f){u=this.words=u||[],f!=n?this.sigBytes=f:this.sigBytes=u.length*8},toX32:function(){for(var u=this.words,f=u.length,w=[],y=0;y<f;y++){var x=u[y];w.push(x.high),w.push(x.low)}return s.create(w,this.sigBytes)},clone:function(){for(var u=o.clone.call(this),f=u.words=this.words.slice(0),w=f.length,y=0;y<w;y++)f[y]=f[y].clone();return u}})}(),r})}(yc)),yc.exports}var Ec={exports:{}},wc;function o0(){return wc||(wc=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(){if(typeof ArrayBuffer=="function"){var n=r,a=n.lib,i=a.WordArray,o=i.init,s=i.init=function(l){if(l instanceof ArrayBuffer&&(l=new Uint8Array(l)),(l instanceof Int8Array||typeof Uint8ClampedArray<"u"&&l instanceof Uint8ClampedArray||l instanceof Int16Array||l instanceof Uint16Array||l instanceof Int32Array||l instanceof Uint32Array||l instanceof Float32Array||l instanceof Float64Array)&&(l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength)),l instanceof Uint8Array){for(var u=l.byteLength,f=[],w=0;w<u;w++)f[w>>>2]|=l[w]<<24-w%4*8;o.call(this,f,u)}else o.apply(this,arguments)};s.prototype=i}}(),r.lib.WordArray})}(Ec)),Ec.exports}var xc={exports:{}},_c;function s0(){return _c||(_c=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,o=n.enc;o.Utf16=o.Utf16BE={stringify:function(l){for(var u=l.words,f=l.sigBytes,w=[],y=0;y<f;y+=2){var x=u[y>>>2]>>>16-y%4*8&65535;w.push(String.fromCharCode(x))}return w.join("")},parse:function(l){for(var u=l.length,f=[],w=0;w<u;w++)f[w>>>1]|=l.charCodeAt(w)<<16-w%2*16;return i.create(f,u*2)}},o.Utf16LE={stringify:function(l){for(var u=l.words,f=l.sigBytes,w=[],y=0;y<f;y+=2){var x=s(u[y>>>2]>>>16-y%4*8&65535);w.push(String.fromCharCode(x))}return w.join("")},parse:function(l){for(var u=l.length,f=[],w=0;w<u;w++)f[w>>>1]|=s(l.charCodeAt(w)<<16-w%2*16);return i.create(f,u*2)}};function s(l){return l<<8&4278255360|l>>>8&16711935}}(),r.enc.Utf16})}(xc)),xc.exports}var Sc={exports:{}},Ic;function Gr(){return Ic||(Ic=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,o=n.enc;o.Base64={stringify:function(l){var u=l.words,f=l.sigBytes,w=this._map;l.clamp();for(var y=[],x=0;x<f;x+=3)for(var S=u[x>>>2]>>>24-x%4*8&255,T=u[x+1>>>2]>>>24-(x+1)%4*8&255,N=u[x+2>>>2]>>>24-(x+2)%4*8&255,C=S<<16|T<<8|N,E=0;E<4&&x+E*.75<f;E++)y.push(w.charAt(C>>>6*(3-E)&63));var A=w.charAt(64);if(A)for(;y.length%4;)y.push(A);return y.join("")},parse:function(l){var u=l.length,f=this._map,w=this._reverseMap;if(!w){w=this._reverseMap=[];for(var y=0;y<f.length;y++)w[f.charCodeAt(y)]=y}var x=f.charAt(64);if(x){var S=l.indexOf(x);S!==-1&&(u=S)}return s(l,u,w)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function s(l,u,f){for(var w=[],y=0,x=0;x<u;x++)if(x%4){var S=f[l.charCodeAt(x-1)]<<x%4*2,T=f[l.charCodeAt(x)]>>>6-x%4*2,N=S|T;w[y>>>2]|=N<<24-y%4*8,y++}return i.create(w,y)}}(),r.enc.Base64})}(Sc)),Sc.exports}var Cc={exports:{}},Tc;function l0(){return Tc||(Tc=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,o=n.enc;o.Base64url={stringify:function(l,u=!0){var f=l.words,w=l.sigBytes,y=u?this._safe_map:this._map;l.clamp();for(var x=[],S=0;S<w;S+=3)for(var T=f[S>>>2]>>>24-S%4*8&255,N=f[S+1>>>2]>>>24-(S+1)%4*8&255,C=f[S+2>>>2]>>>24-(S+2)%4*8&255,E=T<<16|N<<8|C,A=0;A<4&&S+A*.75<w;A++)x.push(y.charAt(E>>>6*(3-A)&63));var I=y.charAt(64);if(I)for(;x.length%4;)x.push(I);return x.join("")},parse:function(l,u=!0){var f=l.length,w=u?this._safe_map:this._map,y=this._reverseMap;if(!y){y=this._reverseMap=[];for(var x=0;x<w.length;x++)y[w.charCodeAt(x)]=x}var S=w.charAt(64);if(S){var T=l.indexOf(S);T!==-1&&(f=T)}return s(l,f,y)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function s(l,u,f){for(var w=[],y=0,x=0;x<u;x++)if(x%4){var S=f[l.charCodeAt(x-1)]<<x%4*2,T=f[l.charCodeAt(x)]>>>6-x%4*2,N=S|T;w[y>>>2]|=N<<24-y%4*8,y++}return i.create(w,y)}}(),r.enc.Base64url})}(Cc)),Cc.exports}var kc={exports:{}},Ac;function $r(){return Ac||(Ac=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(n){var a=r,i=a.lib,o=i.WordArray,s=i.Hasher,l=a.algo,u=[];(function(){for(var T=0;T<64;T++)u[T]=n.abs(n.sin(T+1))*4294967296|0})();var f=l.MD5=s.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(T,N){for(var C=0;C<16;C++){var E=N+C,A=T[E];T[E]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360}var I=this._hash.words,D=T[N+0],P=T[N+1],z=T[N+2],Y=T[N+3],Q=T[N+4],B=T[N+5],G=T[N+6],re=T[N+7],L=T[N+8],q=T[N+9],W=T[N+10],j=T[N+11],V=T[N+12],Z=T[N+13],se=T[N+14],ie=T[N+15],F=I[0],ee=I[1],ne=I[2],K=I[3];F=w(F,ee,ne,K,D,7,u[0]),K=w(K,F,ee,ne,P,12,u[1]),ne=w(ne,K,F,ee,z,17,u[2]),ee=w(ee,ne,K,F,Y,22,u[3]),F=w(F,ee,ne,K,Q,7,u[4]),K=w(K,F,ee,ne,B,12,u[5]),ne=w(ne,K,F,ee,G,17,u[6]),ee=w(ee,ne,K,F,re,22,u[7]),F=w(F,ee,ne,K,L,7,u[8]),K=w(K,F,ee,ne,q,12,u[9]),ne=w(ne,K,F,ee,W,17,u[10]),ee=w(ee,ne,K,F,j,22,u[11]),F=w(F,ee,ne,K,V,7,u[12]),K=w(K,F,ee,ne,Z,12,u[13]),ne=w(ne,K,F,ee,se,17,u[14]),ee=w(ee,ne,K,F,ie,22,u[15]),F=y(F,ee,ne,K,P,5,u[16]),K=y(K,F,ee,ne,G,9,u[17]),ne=y(ne,K,F,ee,j,14,u[18]),ee=y(ee,ne,K,F,D,20,u[19]),F=y(F,ee,ne,K,B,5,u[20]),K=y(K,F,ee,ne,W,9,u[21]),ne=y(ne,K,F,ee,ie,14,u[22]),ee=y(ee,ne,K,F,Q,20,u[23]),F=y(F,ee,ne,K,q,5,u[24]),K=y(K,F,ee,ne,se,9,u[25]),ne=y(ne,K,F,ee,Y,14,u[26]),ee=y(ee,ne,K,F,L,20,u[27]),F=y(F,ee,ne,K,Z,5,u[28]),K=y(K,F,ee,ne,z,9,u[29]),ne=y(ne,K,F,ee,re,14,u[30]),ee=y(ee,ne,K,F,V,20,u[31]),F=x(F,ee,ne,K,B,4,u[32]),K=x(K,F,ee,ne,L,11,u[33]),ne=x(ne,K,F,ee,j,16,u[34]),ee=x(ee,ne,K,F,se,23,u[35]),F=x(F,ee,ne,K,P,4,u[36]),K=x(K,F,ee,ne,Q,11,u[37]),ne=x(ne,K,F,ee,re,16,u[38]),ee=x(ee,ne,K,F,W,23,u[39]),F=x(F,ee,ne,K,Z,4,u[40]),K=x(K,F,ee,ne,D,11,u[41]),ne=x(ne,K,F,ee,Y,16,u[42]),ee=x(ee,ne,K,F,G,23,u[43]),F=x(F,ee,ne,K,q,4,u[44]),K=x(K,F,ee,ne,V,11,u[45]),ne=x(ne,K,F,ee,ie,16,u[46]),ee=x(ee,ne,K,F,z,23,u[47]),F=S(F,ee,ne,K,D,6,u[48]),K=S(K,F,ee,ne,re,10,u[49]),ne=S(ne,K,F,ee,se,15,u[50]),ee=S(ee,ne,K,F,B,21,u[51]),F=S(F,ee,ne,K,V,6,u[52]),K=S(K,F,ee,ne,Y,10,u[53]),ne=S(ne,K,F,ee,W,15,u[54]),ee=S(ee,ne,K,F,P,21,u[55]),F=S(F,ee,ne,K,L,6,u[56]),K=S(K,F,ee,ne,ie,10,u[57]),ne=S(ne,K,F,ee,G,15,u[58]),ee=S(ee,ne,K,F,Z,21,u[59]),F=S(F,ee,ne,K,Q,6,u[60]),K=S(K,F,ee,ne,j,10,u[61]),ne=S(ne,K,F,ee,z,15,u[62]),ee=S(ee,ne,K,F,q,21,u[63]),I[0]=I[0]+F|0,I[1]=I[1]+ee|0,I[2]=I[2]+ne|0,I[3]=I[3]+K|0},_doFinalize:function(){var T=this._data,N=T.words,C=this._nDataBytes*8,E=T.sigBytes*8;N[E>>>5]|=128<<24-E%32;var A=n.floor(C/4294967296),I=C;N[(E+64>>>9<<4)+15]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360,N[(E+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,T.sigBytes=(N.length+1)*4,this._process();for(var D=this._hash,P=D.words,z=0;z<4;z++){var Y=P[z];P[z]=(Y<<8|Y>>>24)&16711935|(Y<<24|Y>>>8)&4278255360}return D},clone:function(){var T=s.clone.call(this);return T._hash=this._hash.clone(),T}});function w(T,N,C,E,A,I,D){var P=T+(N&C|~N&E)+A+D;return(P<<I|P>>>32-I)+N}function y(T,N,C,E,A,I,D){var P=T+(N&E|C&~E)+A+D;return(P<<I|P>>>32-I)+N}function x(T,N,C,E,A,I,D){var P=T+(N^C^E)+A+D;return(P<<I|P>>>32-I)+N}function S(T,N,C,E,A,I,D){var P=T+(C^(N|~E))+A+D;return(P<<I|P>>>32-I)+N}a.MD5=s._createHelper(f),a.HmacMD5=s._createHmacHelper(f)}(Math),r.MD5})}(kc)),kc.exports}var Dc={exports:{}},Nc;function Ri(){return Nc||(Nc=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,o=a.Hasher,s=n.algo,l=[],u=s.SHA1=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(f,w){for(var y=this._hash.words,x=y[0],S=y[1],T=y[2],N=y[3],C=y[4],E=0;E<80;E++){if(E<16)l[E]=f[w+E]|0;else{var A=l[E-3]^l[E-8]^l[E-14]^l[E-16];l[E]=A<<1|A>>>31}var I=(x<<5|x>>>27)+C+l[E];E<20?I+=(S&T|~S&N)+1518500249:E<40?I+=(S^T^N)+1859775393:E<60?I+=(S&T|S&N|T&N)-1894007588:I+=(S^T^N)-899497514,C=N,N=T,T=S<<30|S>>>2,S=x,x=I}y[0]=y[0]+x|0,y[1]=y[1]+S|0,y[2]=y[2]+T|0,y[3]=y[3]+N|0,y[4]=y[4]+C|0},_doFinalize:function(){var f=this._data,w=f.words,y=this._nDataBytes*8,x=f.sigBytes*8;return w[x>>>5]|=128<<24-x%32,w[(x+64>>>9<<4)+14]=Math.floor(y/4294967296),w[(x+64>>>9<<4)+15]=y,f.sigBytes=w.length*4,this._process(),this._hash},clone:function(){var f=o.clone.call(this);return f._hash=this._hash.clone(),f}});n.SHA1=o._createHelper(u),n.HmacSHA1=o._createHmacHelper(u)}(),r.SHA1})}(Dc)),Dc.exports}var Oc={exports:{}},Rc;function Lc(){return Rc||(Rc=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(n){var a=r,i=a.lib,o=i.WordArray,s=i.Hasher,l=a.algo,u=[],f=[];(function(){function x(C){for(var E=n.sqrt(C),A=2;A<=E;A++)if(!(C%A))return!1;return!0}function S(C){return(C-(C|0))*4294967296|0}for(var T=2,N=0;N<64;)x(T)&&(N<8&&(u[N]=S(n.pow(T,1/2))),f[N]=S(n.pow(T,1/3)),N++),T++})();var w=[],y=l.SHA256=s.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(x,S){for(var T=this._hash.words,N=T[0],C=T[1],E=T[2],A=T[3],I=T[4],D=T[5],P=T[6],z=T[7],Y=0;Y<64;Y++){if(Y<16)w[Y]=x[S+Y]|0;else{var Q=w[Y-15],B=(Q<<25|Q>>>7)^(Q<<14|Q>>>18)^Q>>>3,G=w[Y-2],re=(G<<15|G>>>17)^(G<<13|G>>>19)^G>>>10;w[Y]=B+w[Y-7]+re+w[Y-16]}var L=I&D^~I&P,q=N&C^N&E^C&E,W=(N<<30|N>>>2)^(N<<19|N>>>13)^(N<<10|N>>>22),j=(I<<26|I>>>6)^(I<<21|I>>>11)^(I<<7|I>>>25),V=z+j+L+f[Y]+w[Y],Z=W+q;z=P,P=D,D=I,I=A+V|0,A=E,E=C,C=N,N=V+Z|0}T[0]=T[0]+N|0,T[1]=T[1]+C|0,T[2]=T[2]+E|0,T[3]=T[3]+A|0,T[4]=T[4]+I|0,T[5]=T[5]+D|0,T[6]=T[6]+P|0,T[7]=T[7]+z|0},_doFinalize:function(){var x=this._data,S=x.words,T=this._nDataBytes*8,N=x.sigBytes*8;return S[N>>>5]|=128<<24-N%32,S[(N+64>>>9<<4)+14]=n.floor(T/4294967296),S[(N+64>>>9<<4)+15]=T,x.sigBytes=S.length*4,this._process(),this._hash},clone:function(){var x=s.clone.call(this);return x._hash=this._hash.clone(),x}});a.SHA256=s._createHelper(y),a.HmacSHA256=s._createHmacHelper(y)}(Math),r.SHA256})}(Oc)),Oc.exports}var Mc={exports:{}},Pc;function c0(){return Pc||(Pc=1,function(t,e){(function(r,n,a){t.exports=n(ze(),Lc())})(Ae,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,o=n.algo,s=o.SHA256,l=o.SHA224=s.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=s._doFinalize.call(this);return u.sigBytes-=4,u}});n.SHA224=s._createHelper(l),n.HmacSHA224=s._createHmacHelper(l)}(),r.SHA224})}(Mc)),Mc.exports}var Fc={exports:{}},zc;function Bc(){return zc||(zc=1,function(t,e){(function(r,n,a){t.exports=n(ze(),ia())})(Ae,function(r){return function(){var n=r,a=n.lib,i=a.Hasher,o=n.x64,s=o.Word,l=o.WordArray,u=n.algo;function f(){return s.create.apply(s,arguments)}var w=[f(1116352408,3609767458),f(1899447441,602891725),f(3049323471,3964484399),f(3921009573,2173295548),f(961987163,4081628472),f(1508970993,3053834265),f(2453635748,2937671579),f(2870763221,3664609560),f(3624381080,2734883394),f(310598401,1164996542),f(607225278,1323610764),f(1426881987,3590304994),f(1925078388,4068182383),f(2162078206,991336113),f(2614888103,633803317),f(3248222580,3479774868),f(3835390401,2666613458),f(4022224774,944711139),f(264347078,2341262773),f(604807628,2007800933),f(770255983,1495990901),f(1249150122,1856431235),f(1555081692,3175218132),f(1996064986,2198950837),f(2554220882,3999719339),f(2821834349,766784016),f(2952996808,2566594879),f(3210313671,3203337956),f(3336571891,1034457026),f(3584528711,2466948901),f(113926993,3758326383),f(338241895,168717936),f(666307205,1188179964),f(773529912,1546045734),f(1294757372,1522805485),f(1396182291,2643833823),f(1695183700,2343527390),f(1986661051,1014477480),f(2177026350,1206759142),f(2456956037,344077627),f(2730485921,1290863460),f(2820302411,3158454273),f(3259730800,3505952657),f(3345764771,106217008),f(3516065817,3606008344),f(3600352804,1432725776),f(4094571909,1467031594),f(275423344,851169720),f(430227734,3100823752),f(506948616,1363258195),f(659060556,3750685593),f(883997877,3785050280),f(958139571,3318307427),f(1322822218,3812723403),f(1537002063,2003034995),f(1747873779,3602036899),f(1955562222,1575990012),f(2024104815,1125592928),f(2227730452,2716904306),f(2361852424,442776044),f(2428436474,593698344),f(2756734187,3733110249),f(3204031479,2999351573),f(3329325298,3815920427),f(3391569614,3928383900),f(3515267271,566280711),f(3940187606,3454069534),f(4118630271,4000239992),f(116418474,1914138554),f(174292421,2731055270),f(289380356,3203993006),f(460393269,320620315),f(685471733,587496836),f(852142971,1086792851),f(1017036298,365543100),f(1126000580,2618297676),f(1288033470,3409855158),f(1501505948,4234509866),f(1607167915,987167468),f(1816402316,1246189591)],y=[];(function(){for(var S=0;S<80;S++)y[S]=f()})();var x=u.SHA512=i.extend({_doReset:function(){this._hash=new l.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(S,T){for(var N=this._hash.words,C=N[0],E=N[1],A=N[2],I=N[3],D=N[4],P=N[5],z=N[6],Y=N[7],Q=C.high,B=C.low,G=E.high,re=E.low,L=A.high,q=A.low,W=I.high,j=I.low,V=D.high,Z=D.low,se=P.high,ie=P.low,F=z.high,ee=z.low,ne=Y.high,K=Y.low,xe=Q,_e=B,Oe=G,ye=re,Be=L,Ie=q,$=W,ae=j,_=V,b=Z,O=se,te=ie,le=F,de=ee,M=ne,c=K,v=0;v<80;v++){var d,m,h=y[v];if(v<16)m=h.high=S[T+v*2]|0,d=h.low=S[T+v*2+1]|0;else{var p=y[v-15],k=p.high,R=p.low,U=(k>>>1|R<<31)^(k>>>8|R<<24)^k>>>7,H=(R>>>1|k<<31)^(R>>>8|k<<24)^(R>>>7|k<<25),J=y[v-2],X=J.high,oe=J.low,fe=(X>>>19|oe<<13)^(X<<3|oe>>>29)^X>>>6,pe=(oe>>>19|X<<13)^(oe<<3|X>>>29)^(oe>>>6|X<<26),ve=y[v-7],Se=ve.high,Ee=ve.low,be=y[v-16],ce=be.high,Ve=be.low;d=H+Ee,m=U+Se+(d>>>0<H>>>0?1:0),d=d+pe,m=m+fe+(d>>>0<pe>>>0?1:0),d=d+Ve,m=m+ce+(d>>>0<Ve>>>0?1:0),h.high=m,h.low=d}var we=_&O^~_&le,We=b&te^~b&de,Qe=xe&Oe^xe&Be^Oe&Be,mt=_e&ye^_e&Ie^ye&Ie,ge=(xe>>>28|_e<<4)^(xe<<30|_e>>>2)^(xe<<25|_e>>>7),nt=(_e>>>28|xe<<4)^(_e<<30|xe>>>2)^(_e<<25|xe>>>7),Ht=(_>>>14|b<<18)^(_>>>18|b<<14)^(_<<23|b>>>9),Tt=(b>>>14|_<<18)^(b>>>18|_<<14)^(b<<23|_>>>9),kt=w[v],At=kt.high,pt=kt.low,ct=c+Tt,ut=M+Ht+(ct>>>0<c>>>0?1:0),ct=ct+We,ut=ut+we+(ct>>>0<We>>>0?1:0),ct=ct+pt,ut=ut+At+(ct>>>0<pt>>>0?1:0),ct=ct+d,ut=ut+m+(ct>>>0<d>>>0?1:0),hr=nt+mt,Wr=ge+Qe+(hr>>>0<nt>>>0?1:0);M=le,c=de,le=O,de=te,O=_,te=b,b=ae+ct|0,_=$+ut+(b>>>0<ae>>>0?1:0)|0,$=Be,ae=Ie,Be=Oe,Ie=ye,Oe=xe,ye=_e,_e=ct+hr|0,xe=ut+Wr+(_e>>>0<ct>>>0?1:0)|0}B=C.low=B+_e,C.high=Q+xe+(B>>>0<_e>>>0?1:0),re=E.low=re+ye,E.high=G+Oe+(re>>>0<ye>>>0?1:0),q=A.low=q+Ie,A.high=L+Be+(q>>>0<Ie>>>0?1:0),j=I.low=j+ae,I.high=W+$+(j>>>0<ae>>>0?1:0),Z=D.low=Z+b,D.high=V+_+(Z>>>0<b>>>0?1:0),ie=P.low=ie+te,P.high=se+O+(ie>>>0<te>>>0?1:0),ee=z.low=ee+de,z.high=F+le+(ee>>>0<de>>>0?1:0),K=Y.low=K+c,Y.high=ne+M+(K>>>0<c>>>0?1:0)},_doFinalize:function(){var S=this._data,T=S.words,N=this._nDataBytes*8,C=S.sigBytes*8;T[C>>>5]|=128<<24-C%32,T[(C+128>>>10<<5)+30]=Math.floor(N/4294967296),T[(C+128>>>10<<5)+31]=N,S.sigBytes=T.length*4,this._process();var E=this._hash.toX32();return E},clone:function(){var S=i.clone.call(this);return S._hash=this._hash.clone(),S},blockSize:1024/32});n.SHA512=i._createHelper(x),n.HmacSHA512=i._createHmacHelper(x)}(),r.SHA512})}(Fc)),Fc.exports}var Uc={exports:{}},Vc;function u0(){return Vc||(Vc=1,function(t,e){(function(r,n,a){t.exports=n(ze(),ia(),Bc())})(Ae,function(r){return function(){var n=r,a=n.x64,i=a.Word,o=a.WordArray,s=n.algo,l=s.SHA512,u=s.SHA384=l.extend({_doReset:function(){this._hash=new o.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var f=l._doFinalize.call(this);return f.sigBytes-=16,f}});n.SHA384=l._createHelper(u),n.HmacSHA384=l._createHmacHelper(u)}(),r.SHA384})}(Uc)),Uc.exports}var jc={exports:{}},qc;function d0(){return qc||(qc=1,function(t,e){(function(r,n,a){t.exports=n(ze(),ia())})(Ae,function(r){return function(n){var a=r,i=a.lib,o=i.WordArray,s=i.Hasher,l=a.x64,u=l.Word,f=a.algo,w=[],y=[],x=[];(function(){for(var N=1,C=0,E=0;E<24;E++){w[N+5*C]=(E+1)*(E+2)/2%64;var A=C%5,I=(2*N+3*C)%5;N=A,C=I}for(var N=0;N<5;N++)for(var C=0;C<5;C++)y[N+5*C]=C+(2*N+3*C)%5*5;for(var D=1,P=0;P<24;P++){for(var z=0,Y=0,Q=0;Q<7;Q++){if(D&1){var B=(1<<Q)-1;B<32?Y^=1<<B:z^=1<<B-32}D&128?D=D<<1^113:D<<=1}x[P]=u.create(z,Y)}})();var S=[];(function(){for(var N=0;N<25;N++)S[N]=u.create()})();var T=f.SHA3=s.extend({cfg:s.cfg.extend({outputLength:512}),_doReset:function(){for(var N=this._state=[],C=0;C<25;C++)N[C]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(N,C){for(var E=this._state,A=this.blockSize/2,I=0;I<A;I++){var D=N[C+2*I],P=N[C+2*I+1];D=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,P=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360;var z=E[I];z.high^=P,z.low^=D}for(var Y=0;Y<24;Y++){for(var Q=0;Q<5;Q++){for(var B=0,G=0,re=0;re<5;re++){var z=E[Q+5*re];B^=z.high,G^=z.low}var L=S[Q];L.high=B,L.low=G}for(var Q=0;Q<5;Q++)for(var q=S[(Q+4)%5],W=S[(Q+1)%5],j=W.high,V=W.low,B=q.high^(j<<1|V>>>31),G=q.low^(V<<1|j>>>31),re=0;re<5;re++){var z=E[Q+5*re];z.high^=B,z.low^=G}for(var Z=1;Z<25;Z++){var B,G,z=E[Z],se=z.high,ie=z.low,F=w[Z];F<32?(B=se<<F|ie>>>32-F,G=ie<<F|se>>>32-F):(B=ie<<F-32|se>>>64-F,G=se<<F-32|ie>>>64-F);var ee=S[y[Z]];ee.high=B,ee.low=G}var ne=S[0],K=E[0];ne.high=K.high,ne.low=K.low;for(var Q=0;Q<5;Q++)for(var re=0;re<5;re++){var Z=Q+5*re,z=E[Z],xe=S[Z],_e=S[(Q+1)%5+5*re],Oe=S[(Q+2)%5+5*re];z.high=xe.high^~_e.high&Oe.high,z.low=xe.low^~_e.low&Oe.low}var z=E[0],ye=x[Y];z.high^=ye.high,z.low^=ye.low}},_doFinalize:function(){var N=this._data,C=N.words;this._nDataBytes*8;var E=N.sigBytes*8,A=this.blockSize*32;C[E>>>5]|=1<<24-E%32,C[(n.ceil((E+1)/A)*A>>>5)-1]|=128,N.sigBytes=C.length*4,this._process();for(var I=this._state,D=this.cfg.outputLength/8,P=D/8,z=[],Y=0;Y<P;Y++){var Q=I[Y],B=Q.high,G=Q.low;B=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360,G=(G<<8|G>>>24)&16711935|(G<<24|G>>>8)&4278255360,z.push(G),z.push(B)}return new o.init(z,D)},clone:function(){for(var N=s.clone.call(this),C=N._state=this._state.slice(0),E=0;E<25;E++)C[E]=C[E].clone();return N}});a.SHA3=s._createHelper(T),a.HmacSHA3=s._createHmacHelper(T)}(Math),r.SHA3})}(jc)),jc.exports}var Hc={exports:{}},Gc;function f0(){return Gc||(Gc=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){/** @preserve
49
+ ***************************************************************************** */var nc;(function(t){(function(e){var r=typeof Ae=="object"?Ae:typeof self=="object"?self:typeof this=="object"?this:Function("return this;")(),n=a(t);typeof r.Reflect>"u"?r.Reflect=t:n=a(r.Reflect,n),e(n);function a(i,o){return function(s,l){typeof i[s]!="function"&&Object.defineProperty(i,s,{configurable:!0,writable:!0,value:l}),o&&o(s,l)}}})(function(e){var r=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",a=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",i=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",o=typeof Object.create=="function",s={__proto__:[]}instanceof Array,l=!o&&!s,u={create:o?function(){return m(Object.create(null))}:s?function(){return m({__proto__:null})}:function(){return m({})},has:l?function(h,p){return r.call(h,p)}:function(h,p){return p in h},get:l?function(h,p){return r.call(h,p)?h[p]:void 0}:function(h,p){return h[p]}},f=Object.getPrototypeOf(Function),w=typeof process=="object"&&process.env&&{}.REFLECT_METADATA_USE_MAP_POLYFILL==="true",y=!w&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:c(),x=!w&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:v(),S=!w&&typeof WeakMap=="function"?WeakMap:d(),T=new S;function N(h,p,k,R){if(F(k)){if(!Ie(h))throw new TypeError;if(!ae(p))throw new TypeError;return B(h,p)}else{if(!Ie(h))throw new TypeError;if(!K(p))throw new TypeError;if(!K(R)&&!F(R)&&!ee(R))throw new TypeError;return ee(R)&&(R=void 0),k=Be(k),G(h,p,k,R)}}e("decorate",N);function C(h,p){function k(R,U){if(!K(R))throw new TypeError;if(!F(U)&&!_(U))throw new TypeError;V(h,p,R,U)}return k}e("metadata",C);function E(h,p,k,R){if(!K(k))throw new TypeError;return F(R)||(R=Be(R)),V(h,p,k,R)}e("defineMetadata",E);function A(h,p,k){if(!K(p))throw new TypeError;return F(k)||(k=Be(k)),L(h,p,k)}e("hasMetadata",A);function I(h,p,k){if(!K(p))throw new TypeError;return F(k)||(k=Be(k)),q(h,p,k)}e("hasOwnMetadata",I);function D(h,p,k){if(!K(p))throw new TypeError;return F(k)||(k=Be(k)),W(h,p,k)}e("getMetadata",D);function P(h,p,k){if(!K(p))throw new TypeError;return F(k)||(k=Be(k)),j(h,p,k)}e("getOwnMetadata",P);function z(h,p){if(!K(h))throw new TypeError;return F(p)||(p=Be(p)),Z(h,p)}e("getMetadataKeys",z);function Y(h,p){if(!K(h))throw new TypeError;return F(p)||(p=Be(p)),se(h,p)}e("getOwnMetadataKeys",Y);function Q(h,p,k){if(!K(p))throw new TypeError;F(k)||(k=Be(k));var R=re(p,k,!1);if(F(R)||!R.delete(h))return!1;if(R.size>0)return!0;var U=T.get(p);return U.delete(k),U.size>0||T.delete(p),!0}e("deleteMetadata",Q);function B(h,p){for(var k=h.length-1;k>=0;--k){var R=h[k],U=R(p);if(!F(U)&&!ee(U)){if(!ae(U))throw new TypeError;p=U}}return p}function G(h,p,k,R){for(var U=h.length-1;U>=0;--U){var H=h[U],J=H(p,k,R);if(!F(J)&&!ee(J)){if(!K(J))throw new TypeError;R=J}}return R}function re(h,p,k){var R=T.get(h);if(F(R)){if(!k)return;R=new y,T.set(h,R)}var U=R.get(p);if(F(U)){if(!k)return;U=new y,R.set(p,U)}return U}function L(h,p,k){var R=q(h,p,k);if(R)return!0;var U=M(p);return ee(U)?!1:L(h,U,k)}function q(h,p,k){var R=re(p,k,!1);return F(R)?!1:Oe(R.has(h))}function W(h,p,k){var R=q(h,p,k);if(R)return j(h,p,k);var U=M(p);if(!ee(U))return W(h,U,k)}function j(h,p,k){var R=re(p,k,!1);if(!F(R))return R.get(h)}function V(h,p,k,R){var U=re(k,R,!0);U.set(h,p)}function Z(h,p){var k=se(h,p),R=M(h);if(R===null)return k;var U=Z(R,p);if(U.length<=0)return k;if(k.length<=0)return U;for(var H=new x,J=[],X=0,oe=k;X<oe.length;X++){var fe=oe[X],pe=H.has(fe);pe||(H.add(fe),J.push(fe))}for(var ve=0,Se=U;ve<Se.length;ve++){var fe=Se[ve],pe=H.has(fe);pe||(H.add(fe),J.push(fe))}return J}function se(h,p){var k=[],R=re(h,p,!1);if(F(R))return k;for(var U=R.keys(),H=O(U),J=0;;){var X=le(H);if(!X)return k.length=J,k;var oe=te(X);try{k[J]=oe}catch(fe){try{de(H)}finally{throw fe}}J++}}function ie(h){if(h===null)return 1;switch(typeof h){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return h===null?1:6;default:return 6}}function F(h){return h===void 0}function ee(h){return h===null}function ne(h){return typeof h=="symbol"}function K(h){return typeof h=="object"?h!==null:typeof h=="function"}function xe(h,p){switch(ie(h)){case 0:return h;case 1:return h;case 2:return h;case 3:return h;case 4:return h;case 5:return h}var k=p===3?"string":p===5?"number":"default",R=b(h,a);if(R!==void 0){var U=R.call(h,k);if(K(U))throw new TypeError;return U}return _e(h,k==="default"?"number":k)}function _e(h,p){if(p==="string"){var k=h.toString;if($(k)){var R=k.call(h);if(!K(R))return R}var U=h.valueOf;if($(U)){var R=U.call(h);if(!K(R))return R}}else{var U=h.valueOf;if($(U)){var R=U.call(h);if(!K(R))return R}var H=h.toString;if($(H)){var R=H.call(h);if(!K(R))return R}}throw new TypeError}function Oe(h){return!!h}function ye(h){return""+h}function Be(h){var p=xe(h,3);return ne(p)?p:ye(p)}function Ie(h){return Array.isArray?Array.isArray(h):h instanceof Object?h instanceof Array:Object.prototype.toString.call(h)==="[object Array]"}function $(h){return typeof h=="function"}function ae(h){return typeof h=="function"}function _(h){switch(ie(h)){case 3:return!0;case 4:return!0;default:return!1}}function b(h,p){var k=h[p];if(k!=null){if(!$(k))throw new TypeError;return k}}function O(h){var p=b(h,i);if(!$(p))throw new TypeError;var k=p.call(h);if(!K(k))throw new TypeError;return k}function te(h){return h.value}function le(h){var p=h.next();return p.done?!1:p}function de(h){var p=h.return;p&&p.call(h)}function M(h){var p=Object.getPrototypeOf(h);if(typeof h!="function"||h===f||p!==f)return p;var k=h.prototype,R=k&&Object.getPrototypeOf(k);if(R==null||R===Object.prototype)return p;var U=R.constructor;return typeof U!="function"||U===h?p:U}function c(){var h={},p=[],k=function(){function J(X,oe,fe){this._index=0,this._keys=X,this._values=oe,this._selector=fe}return J.prototype["@@iterator"]=function(){return this},J.prototype[i]=function(){return this},J.prototype.next=function(){var X=this._index;if(X>=0&&X<this._keys.length){var oe=this._selector(this._keys[X],this._values[X]);return X+1>=this._keys.length?(this._index=-1,this._keys=p,this._values=p):this._index++,{value:oe,done:!1}}return{value:void 0,done:!0}},J.prototype.throw=function(X){throw this._index>=0&&(this._index=-1,this._keys=p,this._values=p),X},J.prototype.return=function(X){return this._index>=0&&(this._index=-1,this._keys=p,this._values=p),{value:X,done:!0}},J}();return function(){function J(){this._keys=[],this._values=[],this._cacheKey=h,this._cacheIndex=-2}return Object.defineProperty(J.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),J.prototype.has=function(X){return this._find(X,!1)>=0},J.prototype.get=function(X){var oe=this._find(X,!1);return oe>=0?this._values[oe]:void 0},J.prototype.set=function(X,oe){var fe=this._find(X,!0);return this._values[fe]=oe,this},J.prototype.delete=function(X){var oe=this._find(X,!1);if(oe>=0){for(var fe=this._keys.length,pe=oe+1;pe<fe;pe++)this._keys[pe-1]=this._keys[pe],this._values[pe-1]=this._values[pe];return this._keys.length--,this._values.length--,X===this._cacheKey&&(this._cacheKey=h,this._cacheIndex=-2),!0}return!1},J.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=h,this._cacheIndex=-2},J.prototype.keys=function(){return new k(this._keys,this._values,R)},J.prototype.values=function(){return new k(this._keys,this._values,U)},J.prototype.entries=function(){return new k(this._keys,this._values,H)},J.prototype["@@iterator"]=function(){return this.entries()},J.prototype[i]=function(){return this.entries()},J.prototype._find=function(X,oe){return this._cacheKey!==X&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=X)),this._cacheIndex<0&&oe&&(this._cacheIndex=this._keys.length,this._keys.push(X),this._values.push(void 0)),this._cacheIndex},J}();function R(J,X){return J}function U(J,X){return X}function H(J,X){return[J,X]}}function v(){return function(){function h(){this._map=new y}return Object.defineProperty(h.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),h.prototype.has=function(p){return this._map.has(p)},h.prototype.add=function(p){return this._map.set(p,p),this},h.prototype.delete=function(p){return this._map.delete(p)},h.prototype.clear=function(){this._map.clear()},h.prototype.keys=function(){return this._map.keys()},h.prototype.values=function(){return this._map.values()},h.prototype.entries=function(){return this._map.entries()},h.prototype["@@iterator"]=function(){return this.keys()},h.prototype[i]=function(){return this.keys()},h}()}function d(){var h=16,p=u.create(),k=R();return function(){function oe(){this._key=R()}return oe.prototype.has=function(fe){var pe=U(fe,!1);return pe!==void 0?u.has(pe,this._key):!1},oe.prototype.get=function(fe){var pe=U(fe,!1);return pe!==void 0?u.get(pe,this._key):void 0},oe.prototype.set=function(fe,pe){var ve=U(fe,!0);return ve[this._key]=pe,this},oe.prototype.delete=function(fe){var pe=U(fe,!1);return pe!==void 0?delete pe[this._key]:!1},oe.prototype.clear=function(){this._key=R()},oe}();function R(){var oe;do oe="@@WeakMap@@"+X();while(u.has(p,oe));return p[oe]=!0,oe}function U(oe,fe){if(!r.call(oe,k)){if(!fe)return;Object.defineProperty(oe,k,{value:u.create()})}return oe[k]}function H(oe,fe){for(var pe=0;pe<fe;++pe)oe[pe]=Math.random()*255|0;return oe}function J(oe){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(oe)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(oe)):H(new Uint8Array(oe),oe):H(new Array(oe),oe)}function X(){var oe=J(h);oe[6]=oe[6]&79|64,oe[8]=oe[8]&191|128;for(var fe="",pe=0;pe<h;++pe){var ve=oe[pe];(pe===4||pe===6||pe===8)&&(fe+="-"),ve<16&&(fe+="0"),fe+=ve.toString(16).toLowerCase()}return fe}}function m(h){return h.__=void 0,delete h.__,h}})})(nc||(nc={}));var pn={};Object.defineProperty(pn,"__esModule",{value:!0}),pn.Channel=void 0;var k1=function(){function t(){this.subscriptions=new Map}return t.prototype.publish=function(e,r){var n=this,a=this.subscriptions.get(e);a&&a.forEach(function(i){i(r,e,n,i)})},t.prototype.subscribe=function(e,r){var n=this.subscriptions.get(e);n||(n=[],this.subscriptions.set(e,n)),n.push(r)},t.prototype.unsubscribe=function(e,r){var n=this.subscriptions.get(e);n&&(n=n.filter(function(a){return a!==r}),n.length?this.subscriptions.set(e,n):this.subscriptions.delete(e))},t.prototype.unsubscribeAll=function(){this.subscriptions.clear()},t}();pn.Channel=k1;var gn={};Object.defineProperty(gn,"__esModule",{value:!0}),gn.PubSub=void 0;var A1=pn;gn.PubSub=new A1.Channel;var Jn={},fr={};Object.defineProperty(fr,"__esModule",{value:!0}),fr.SUBSCRIPTIONS_METADATA_KEY=fr.CHANNEL_METADATA_KEY=void 0,fr.CHANNEL_METADATA_KEY=Symbol("pubsub:channel"),fr.SUBSCRIPTIONS_METADATA_KEY=Symbol("pubsub:subscriptions"),Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.Subscribe=void 0;var ac=fr;function D1(t){return function(e,r,n){var a=Reflect.getMetadata(ac.SUBSCRIPTIONS_METADATA_KEY,e)||new Set;a.add({message:t,handler:n.value}),Reflect.defineMetadata(ac.SUBSCRIPTIONS_METADATA_KEY,a,e)}}Jn.Subscribe=D1;var Xn={},N1=Ae&&Ae.__spreadArray||function(t,e){for(var r=0,n=e.length,a=t.length;r<n;r++,a++)t[a]=e[r];return t};Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.Subscriber=void 0;var ki=fr,O1=gn;function R1(t){var e=(t==null?void 0:t.channel)||O1.PubSub;return function(r){Reflect.defineMetadata(ki.CHANNEL_METADATA_KEY,e,r.prototype);var n=function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var o=r,s=new(o.bind.apply(o,N1([void 0],a))),l=Reflect.getMetadata(ki.SUBSCRIPTIONS_METADATA_KEY,r.prototype);if(l){var u=[];Reflect.defineMetadata(ki.SUBSCRIPTIONS_METADATA_KEY,u,s),l.forEach(function(f){var w=f.handler.bind(s);u.push({message:f.message,handler:w}),e.subscribe(f.message,w)})}return s};return n.prototype=r.prototype,t!=null&&t.createInstance&&new n(t.constructorParameters),n}}Xn.Subscriber=R1;var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.Unsubscribe=void 0;var ic=fr;function L1(){return function(t,e,r){var n=r.value;return r.value=function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var o=Reflect.getMetadata(ic.CHANNEL_METADATA_KEY,t),s=Reflect.getMetadata(ic.SUBSCRIPTIONS_METADATA_KEY,this);return o&&s&&s.forEach(function(l){o.unsubscribe(l.message,l.handler)}),n(a)},r}}Qn.Unsubscribe=L1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Unsubscribe=t.Subscriber=t.Subscribe=t.PubSub=t.Channel=void 0;var e=pn;Object.defineProperty(t,"Channel",{enumerable:!0,get:function(){return e.Channel}});var r=gn;Object.defineProperty(t,"PubSub",{enumerable:!0,get:function(){return r.PubSub}});var n=Jn;Object.defineProperty(t,"Subscribe",{enumerable:!0,get:function(){return n.Subscribe}});var a=Xn;Object.defineProperty(t,"Subscriber",{enumerable:!0,get:function(){return a.Subscriber}});var i=Qn;Object.defineProperty(t,"Unsubscribe",{enumerable:!0,get:function(){return i.Unsubscribe}})}(Me);const _t=new Me.Channel;class M1 extends wr{async getAllStaffs(e,r,n){const a=this.instance.get(`/api/2.1/scheduling/companies/${n}/staff?account=${encodeURIComponent(r)}`,this.getAxiosConfig(e));if(a!==null)try{return(await a).items}catch(i){throw i}else throw new Ne(ke.INTERNAL_ERROR)}async getById(e,r,n,a){let i=`/api/2.1/scheduling/companies/${n}/staff/${a}?account=${encodeURIComponent(r)}`;const o=this.instance.get(i,this.getAxiosConfig(e));if(o!==null)try{return await o}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}async createStaff(e,r,n,a){let i=`/api/2.1/scheduling/companies/${n}/staff?account=${encodeURIComponent(r)}`;const o=this.instance.post(i,a,this.getAxiosConfig(e));if(o!==null)try{return await o}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}async updateStaff(e,r,n,a,i){let o=`/api/2.1/scheduling/companies/${n}/staff/${a}?account=${encodeURIComponent(r)}`;const s=this.instance.put(o,i,this.getAxiosConfig(e));if(s!==null)try{return await s}catch(l){throw l}else throw new Ne(ke.INTERNAL_ERROR)}async patchAllStaff(e,r,n,a){let i=`/api/2.1/scheduling/companies/${n}/staff?account=${encodeURIComponent(r)}`;const o=this.instance.patch(i,a,this.getAxiosConfig(e));if(o!==null)try{await o;return}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}async delete(e,r,n,a){let i=`/api/2.1/scheduling/companies/${n}/staff/${a}?account=${encodeURIComponent(r)}`;const o=this.instance.delete(i,this.getAxiosConfig(e));if(o!==null)try{await o}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}filteredDataLog(e){return e!=null&&e.items?e==null?void 0:e.items.map(r=>({id:r.id})):e}}class oc{constructor(e){g(this,"indexedDb"),this.indexedDb=e}async getAllStaffs(e){return(await this.indexedDb.getAllValue(zr)||[]).filter(r=>{var n;return((n=r.company)==null?void 0:n.id)===e})}async getById(e,r){var n;const a=await this.indexedDb.getValue(zr,r);if(((n=a==null?void 0:a.company)==null?void 0:n.id)===e)return a;throw sr}async saveAllStaffs(e){await this.indexedDb.putBulkValue(zr,e)}async deleteById(e,r){await this.indexedDb.deleteValue(zr,r)}async deleteByStaffIds(e){await this.indexedDb.deleteValues(zr,e)}async drop(){await this.indexedDb.deleteAllValues(zr)}updateServiceSkills(e,r,n){this.getAllStaffs(e).then(async a=>{const i=a.filter(o=>{var s;return(s=o.servicesSkill)==null?void 0:s.includes(r)});i&&i.length>0&&(i.forEach(o=>{var s,l,u;const f=(s=o.servicesSkill)==null?void 0:s.findIndex(w=>w===r);f!=null&&(n?(l=o.servicesSkill)==null||l.splice(f,1,n):(u=o.servicesSkill)==null||u.splice(f,1))}),await this.saveAllStaffs(i))})}}var P1=Object.defineProperty,F1=Object.getOwnPropertyDescriptor,Ai=(t,e,r,n)=>{for(var a=n>1?void 0:n?F1(e,r):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(a=(n?o(e,r,a):o(a))||a);return n&&a&&P1(e,r,a),a};const vn=new Me.Channel;let ea=class extends lr{constructor(t,e,r,n){super("staff",n),g(this,"staffDb"),g(this,"staffService"),this.staffDb=new oc(e),this.staffService=new M1(r,t,n)}dispose(){}async onCascadeDelete(t,e,r,n){r==_t&&await this.cascadeDelete({account:t.account,companyId:t.companyId},a=>{var i;return((i=a==null?void 0:a.company)==null?void 0:i.id)===t.companyId})}async getAllStaffs(t,e,r,n=Le.LOCAL_THEN_REMOTE){return this.list(t,n,{account:e,companyId:r})}async getStaff(t,e,r,n,a=Le.LOCAL_THEN_REMOTE){return this.getById(t,a,{account:e,companyId:r,staffId:n})}async createStaff(t,e,r,n){const a=await this.create(t,Le.REMOTE_THEN_LOCAL,{account:e,companyId:r},n);return vn.publish(Je.CREATE,{account:e,companyId:r,staff:a}),a}async updateStaff(t,e,r,n,a){const i=await this.update(t,Le.REMOTE_THEN_LOCAL,{account:e,companyId:r,staffId:n},a);return vn.publish(Je.UPDATE,{account:e,companyId:r,staffId:n,staff:i}),i}async patchAllStaff(t,e,r,n,a){let i=new Yt;return n&&(i.workingHours=n),a&&(i.vacations=a),await this.staffService.patchAllStaff(t,e,r,i),this.getAllStaffs(t,e,r,Le.REMOTE_THEN_LOCAL)}async deleteStaff(t,e,r,n){await this.deleteById(t,{account:e,companyId:r,staffId:n}),vn.publish(Je.DELETE,{account:e,companyId:r,staffId:n})}async remoteList(t,e){return(await this.staffService.getAllStaffs(t,e.account,e.companyId)).map(r=>Yt.fromStaffDto(r))}async remoteGet(t,e){this.checkNullable(e);const r=await this.staffService.getById(t,e.account,e.companyId,e.staffId);return Yt.fromStaffDto(r)}async remoteCreate(t,e,r){const n=Yt.toStaffDto(r),a=await this.staffService.createStaff(t,e.account,e.companyId,n);return Yt.fromStaffDto(a)}async remoteUpdate(t,e,r){this.checkNullable(e);const n=Yt.toStaffDto(r),a=await this.staffService.updateStaff(t,e.account,e.companyId,e.staffId,n);return Yt.fromStaffDto(a)}async remoteDelete(t,e){this.checkNullable(e),await this.staffService.delete(t,e.account,e.companyId,e.staffId)}async localList(t){return this.staffDb.getAllStaffs(t.companyId)}async localGet(t){return this.checkNullable(t),this.staffDb.getById(t.companyId,t.staffId)}async localBulkSave(t,e){await this.staffDb.saveAllStaffs(e)}async localDelete(t){this.checkNullable(t),await this.staffDb.deleteById(t.companyId,t.staffId)}async localBulkDelete(t){await this.staffDb.deleteByStaffIds(t.map(e=>e.id||""))}checkNullable(t){if(!t.staffId)throw Error("Invalid state:"+JSON.stringify(t))}};Ai([Me.Unsubscribe()],ea.prototype,"dispose",1),Ai([Me.Subscribe(Je.DELETE)],ea.prototype,"onCascadeDelete",1),ea=Ai([Me.Subscriber({channel:_t})],ea);class z1 extends wr{async getAllServices(e,r,n){const a=this.instance.get(`/api/2.1/scheduling/companies/${n}/services?account=${encodeURIComponent(r)}`,this.getAxiosConfig(e));if(a!==null)try{return(await a).items}catch(i){throw i}else throw new Ne(ke.INTERNAL_ERROR)}async getById(e,r,n,a){let i=`/api/2.1/scheduling/companies/${n}/services/${a}?account=${encodeURIComponent(r)}`;const o=this.instance.get(i,this.getAxiosConfig(e));if(o!==null)try{return await o}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}async createService(e,r,n,a){let i=`/api/2.1/scheduling/companies/${n}/services?account=${encodeURIComponent(r)}`;const o=this.instance.post(i,a,this.getAxiosConfig(e));if(o!==null)try{return await o}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}async updateService(e,r,n,a,i){let o=`/api/2.1/scheduling/companies/${n}/services/${a}?account=${encodeURIComponent(r)}`;const s=this.instance.put(o,i,this.getAxiosConfig(e));if(s!==null)try{return await s}catch(l){throw l}else throw new Ne(ke.INTERNAL_ERROR)}async delete(e,r,n,a){let i=`/api/2.1/scheduling/companies/${n}/services/${a}?account=${encodeURIComponent(r)}`;const o=this.instance.delete(i,this.getAxiosConfig(e));if(o!==null)try{await o}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}filteredDataLog(e){return e!=null&&e.items?e==null?void 0:e.items.map(r=>({id:r.id})):e}}class sc{constructor(e){g(this,"indexedDb"),this.indexedDb=e}async getAllServiceGroups(e){return(await this.indexedDb.getAllValue(Vr)||[]).filter(r=>r.companyId===e)}async saveAllServiceGroups(e){await this.indexedDb.putBulkValue(Vr,e)}async getById(e,r){const n=await this.indexedDb.getValue(Vr,r);if((n==null?void 0:n.companyId)===e)return n;throw sr}async deleteById(e,r){await this.getById(e,r),await this.indexedDb.deleteValue(Vr,r),new oc(this.indexedDb).updateServiceSkills(e,r,void 0)}async deleteByServiceGroupIds(e){await this.indexedDb.deleteValues(Vr,e)}async drop(){await this.indexedDb.deleteAllValues(Vr)}updateServices(e,r,n){this.getAllServiceGroups(e).then(async a=>{const i=a.filter(o=>{var s;return(s=o.members)==null?void 0:s.find(l=>l.id===r)});i&&i.length>0&&(i.forEach(o=>{var s,l,u;const f=(s=o.members)==null?void 0:s.findIndex(w=>w.id===r);f!=null&&(n?(l=o.members)==null||l.splice(f,1,n):(u=o.members)==null||u.splice(f,1))}),await this.saveAllServiceGroups(i))})}}class lc{constructor(e){g(this,"indexedDb"),this.indexedDb=e}async getAllServices(e){return(await this.indexedDb.getAllValue(Br)||[]).filter(r=>{var n;return((n=r.company)==null?void 0:n.id)===e})}async saveAllServices(e){await this.indexedDb.putBulkValue(Br,e)}async getById(e,r){var n;const a=await this.indexedDb.getValue(Br,r);if(((n=a==null?void 0:a.company)==null?void 0:n.id)===e)return a;throw sr}async deleteById(e,r){await this.getById(e,r),await this.indexedDb.deleteValue(Br,r),new sc(this.indexedDb).updateServices(e,r,void 0)}async deleteByServiceIds(e){await this.indexedDb.deleteValues(Br,e)}async drop(){await this.indexedDb.deleteAllValues(Br)}updateStaffSkills(e,r,n){this.getAllServices(e).then(async a=>{const i=a.filter(o=>{var s;return(s=o.staffsSkill)==null?void 0:s.includes(r)});i&&i.length>0&&(i.forEach(o=>{var s,l,u;const f=(s=o.staffsSkill)==null?void 0:s.findIndex(w=>w===r);f!=null&&(n?(l=o.staffsSkill)==null||l.splice(f,1,n):(u=o.staffsSkill)==null||u.splice(f,1))}),await this.saveAllServices(i))})}}var B1=Object.defineProperty,U1=Object.getOwnPropertyDescriptor,Di=(t,e,r,n)=>{for(var a=n>1?void 0:n?U1(e,r):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(a=(n?o(e,r,a):o(a))||a);return n&&a&&B1(e,r,a),a};const yn=new Me.Channel;let ta=class extends lr{constructor(t,e,r,n){super("service",n),g(this,"serviceDb"),g(this,"serviceService"),this.serviceDb=new lc(e),this.serviceService=new z1(r,t,n)}dispose(){}async onCascadeDelete(t,e,r,n){r==_t&&await this.cascadeDelete({account:t.account,companyId:t.companyId},a=>{var i;return((i=a==null?void 0:a.company)==null?void 0:i.id)===t.companyId})}async getAllServices(t,e,r,n=Le.LOCAL_THEN_REMOTE){return this.list(t,n,{account:e,companyId:r})}async getService(t,e,r,n,a=Le.LOCAL_THEN_REMOTE){return this.getById(t,a,{account:e,companyId:r,serviceId:n})}async createService(t,e,r,n){const a=await super.create(t,Le.REMOTE_THEN_LOCAL,{account:e,companyId:r},n);return yn.publish(Je.CREATE,{account:e,companyId:r,service:a}),a}async updateService(t,e,r,n,a){const i=await super.update(t,Le.REMOTE_THEN_LOCAL,{account:e,companyId:r,serviceId:n},a);return yn.publish(Je.UPDATE,{account:e,companyId:r,serviceId:n,service:i}),i}async deleteService(t,e,r,n){await this.deleteById(t,{account:e,companyId:r,serviceId:n}),yn.publish(Je.DELETE,{account:e,companyId:r,serviceId:n})}async remoteList(t,e){return(await this.serviceService.getAllServices(t,e.account,e.companyId)).map(r=>ar.fromServiceDto(r))}async remoteGet(t,e){this.checkNullable(e);const r=await this.serviceService.getById(t,e.account,e.companyId,e.serviceId);return ar.fromServiceDto(r)}async remoteCreate(t,e,r){const n=ar.toServiceDto(r),a=await this.serviceService.createService(t,e.account,e.companyId,n);return ar.fromServiceDto(a)}async remoteUpdate(t,e,r){this.checkNullable(e);const n=ar.toServiceDto(r),a=await this.serviceService.updateService(t,e.account,e.companyId,e.serviceId,n);return ar.fromServiceDto(a)}async remoteDelete(t,e){this.checkNullable(e),await this.serviceService.delete(t,e.account,e.companyId,e.serviceId)}async localList(t){return this.serviceDb.getAllServices(t.companyId)}async localGet(t){return this.checkNullable(t),this.serviceDb.getById(t.companyId,t.serviceId)}async localBulkSave(t,e){await this.serviceDb.saveAllServices(e)}async localDelete(t){this.checkNullable(t),await this.serviceDb.deleteById(t.companyId,t.serviceId)}async localBulkDelete(t){await this.serviceDb.deleteByServiceIds(t.map(e=>e.id||""))}checkNullable(t){if(!t.serviceId)throw Error("Invalid state:"+JSON.stringify(t))}};Di([Me.Unsubscribe()],ta.prototype,"dispose",1),Di([Me.Subscribe(Je.DELETE)],ta.prototype,"onCascadeDelete",1),ta=Di([Me.Subscriber({channel:_t})],ta);class V1 extends wr{async searchContacts(e,r,n,a=100,i=!0){let o="/api/2.3/clients",s=this.getAxiosConfig(e);s.params.q=r,s.params.maxResult=a,n&&(s.params.account=n);const l=this.instance.get(o,s);if(l!==null)try{const u=await l;return i?u.items:u}catch(u){throw u}else throw new Ne(ke.INTERNAL_ERROR)}async advancedSearchContacts(e,r,n,a=100,i=!0){let o="/api/2.3/clients/search",s=this.getAxiosConfig(e);s.params.maxResult=a,n&&(s.params.account=n);const l=this.instance.post(o,r,s);if(l!==null)try{const u=await l;return i?u.items:u}catch(u){throw u}else throw new Ne(ke.INTERNAL_ERROR)}async createContact(e,r,n){const a=this.instance.post(`/api/2.0/clients?account=${encodeURIComponent(r)}`,n,this.getAxiosConfig(e));if(a!==null)try{return await a}catch(i){throw i}else throw new Ne(ke.INTERNAL_ERROR)}async updateContact(e,r,n,a){const i=this.instance.put(`/api/2.0/clients/${n}?account=${encodeURIComponent(r)}`,a,this.getAxiosConfig(e));if(i!==null)try{return await i}catch(o){throw o}else throw new Ne(ke.INTERNAL_ERROR)}async getById(e,r,n){let a=`/api/2.3/clients/${n}?account=${encodeURIComponent(r)}`;const i=this.instance.get(a,this.getAxiosConfig(e));if(i!==null)try{return await i}catch(o){throw o}else throw new Ne(ke.INTERNAL_ERROR)}async deleteBy(e,r,n){let a=`/api/2.0/clients/${n}?account=${encodeURIComponent(r)}`;const i=this.instance.delete(a,this.getAxiosConfig(e));if(i!==null)try{await i}catch(o){throw o}else throw new Ne(ke.INTERNAL_ERROR)}filteredDataLog(e){return e!=null&&e.items?e==null?void 0:e.items.map(r=>({id:r.id})):e}}class j1{constructor(e){g(this,"indexedDb"),this.indexedDb=e}async getAllContacts(){return this.indexedDb.getAllValue(hn)}async saveAllContacts(e){await this.indexedDb.putBulkValue(hn,e)}async getById(e){return this.indexedDb.getValue(hn,e)}async deleteById(e){await this.indexedDb.deleteValue(hn,e)}async drop(){this.indexedDb.deleteAllValues(hn)}}function q1(t){t||(t=[]),G1(t);let e="",r="";for(const n of t)e+=r+n,r=",";return e}function H1(){const t=[];return t.push(Xe.ID),t.push(Xe.START),t.push(Xe.END),t.push(Xe.STAFF),t.push(Xe.SERVICE),t.push(Xe.STATUS),t.push(Xe.COMPANY),t.push(Xe.OWNER),t.push(Xe.CLIENT),t.push(Xe.ONLINE_MEETING),t.push(Xe.FORM),t.push(Xe.PRICE),t.push(Xe.SOURCE),t.push(Xe.SUMMARY),t.push(Xe.NOTES),t.push(Xe.PREPARATION_DURATION),t.push(Xe.BUFFER_DURATION),t}function G1(t){t.push(Xe.ID),t.push(Xe.START),t.push(Xe.END),t.push(Xe.SOURCE)}var Xe=(t=>(t.ID="id",t.START="start",t.END="end",t.OWNER="owner",t.NOTES="notes",t.CREATED="created",t.STAFF="staff",t.HISTORY="history",t.SOURCE="source",t.REFERENCE="reference",t.SERVICE="service",t.ENCRYPTED_ID="encryptedId",t.PAID="paid",t.CLIENT="client",t.COMPANY="company",t.STATUS="status",t.SUMMARY="summary",t.RESOURCE="resource",t.SERVICE_RESOURCE="service-resource",t.PARENT="parent",t.RESCHEDULE_LINK="rescheduleLink",t.ONLINE_MEETING="onlineMeeting",t.PRICE="price",t.FORM="form",t.PREPARATION_DURATION="preparationDuration",t.BUFFER_DURATION="bufferDuration",t))(Xe||{});class $1 extends wr{async createEvent(e,r,n,a,i){let o=`/api/2.1/scheduling/companies/${n}/appointments?account=${encodeURIComponent(r)}`;i&&(o=o+"&force=true"),a.form=await this._prepareFormFields(a.form);const s=this.instance.post(o,a,this.getAxiosConfig(e));if(s!==null)try{return await s}catch(l){throw l}else throw new Ne(ke.INTERNAL_ERROR)}async updateEvent(e,r,n,a,i=!1){let o=`/api/2.1/scheduling/companies/${n}/appointments/${a.id}?account=${encodeURIComponent(r)}`;i&&(o=o+"&force=true"),a.form=await this._prepareFormFields(a.form);const s=this.instance.put(o,a,this.getAxiosConfig(e));if(s!==null)try{return await s}catch(l){throw l}else throw new Ne(ke.INTERNAL_ERROR)}async updateEventStatus(e,r,n,a,i){let o=`/api/2.1/scheduling/companies/${n}/appointments/${a}?account=${encodeURIComponent(r)}`;const s=this.instance.put(o,{status:i},this.getAxiosConfig(e));if(s!==null)try{return await s}catch(l){throw l}else throw new Ne(ke.INTERNAL_ERROR)}async getExternalAppointments(e,r,n,a,i){let o=this.getAxiosConfig(e);o.params.userIds=r,o.params.start=n,o.params.end=a,o.params.timeZone=i;const s=this.instance.get("/api/2.1/scheduling/externalAppointments",o);if(s!==null)try{return(await s).items}catch(l){throw l}else throw new Ne(ke.INTERNAL_ERROR)}async getICS(e,r){let n=this.getAxiosConfig(e),a=r;if(r.indexOf("calendar.google.com/calendar")>0){const o=r.indexOf("://");a="/api/2.3/forward/https//"+(o>0?r.substring(o+3):r)}const i=this.instance.get(a,n);if(i!==null)try{return await i}catch(o){throw o}else throw new Ne(ke.INTERNAL_ERROR)}async getAllEvents(e,r,n,a,i,o,s){let l=this.getAxiosConfig(e);l.params.userIds=r,l.params.start=n,l.params.end=a,l.params.levelDetail="full",i&&(l.params.personalAppointments=!0),l.params.showDeleted=o,s&&s.length>0?l.params.fields=q1(s):l.params.fields=H1().map(f=>`${f}`).join(",");const u=this.instance.get("/api/2.1/scheduling/appointments",l);if(u!==null)try{return(await u).items}catch(f){throw f}else throw new Ne(ke.INTERNAL_ERROR)}async getById(e,r,n){let a=this.getAxiosConfig(e);a.params.levelDetail="full",n&&(a.params.personalAppointments=!0);let i=`/api/2.1/scheduling/appointments/${r}`;const o=this.instance.get(i,a);if(o!==null)try{return await o}catch(s){throw s}else throw new Ne(ke.INTERNAL_ERROR)}async _prepareFormFields(e){var r;if(e){const n=e.filter(a=>a.inputType!=="file"||a.inputType==="file"&&a.value!==void 0);try{n.forEach(a=>{var i;a.values&&(a.values=(i=a.values)==null?void 0:i.filter(o=>typeof a.value=="string"&&a.value===o.value||Array.isArray(a.value)&&a.value.indexOf(o.value)!==-1),Array.isArray(a.value)&&(a.value=void 0))});for(const a of n.filter(i=>i.inputType==="rating"&&i.value!==void 0&&i.value!==""))a.values=[{id:a.value,value:a.value,name:a.value}];for(const a of n.filter(i=>i.inputType==="file"))a.fileName=a.value.name,a.value=await Jm(a.value)}catch(a){(r=this.logger)==null||r.error("js-calendar-api","Error while prepared form fields",a)}return n}}filteredDataLog(e){return e!=null&&e.items?e==null?void 0:e.items.map(r=>({id:r.id})):e}}class W1{constructor(e){g(this,"indexedDb"),this.indexedDb=e}async saveAllEvents(e){await this.indexedDb.putBulkValue(ur,e)}async saveEvent(e){await this.indexedDb.putValue(ur,e)}async deleteEvent(e){await this.indexedDb.deleteValue(ur,e)}async deleteByEventIds(e){await this.indexedDb.deleteValues(ur,e)}async getAllEvents(e,r,n){return(await this.indexedDb.getAllValue(ur)||[]).filter(a=>{var i,o,s;const l=e===void 0||e.includes(((i=a.staff)==null?void 0:i.userId)||"")||((o=a.staff)==null?void 0:o.userId)==="0"&&e.includes(a.staff.id);return((s=a.staff)==null?void 0:s.userId)!==void 0&&l&&(r===void 0||a.start.getTime()>=r.getTime())&&(n===void 0||a.end.getTime()<=n.getTime())})}async getFirstEventByChildEventId(e){const r=(await this.indexedDb.getAllValue(ur)||[]).filter(n=>{var a;return(a=n.events)==null?void 0:a.some(i=>i.id===e)});return(r==null?void 0:r.length)>0?r[0]:void 0}async getById(e){return this.indexedDb.getValue(ur,e)}async drop(){await this.indexedDb.deleteAllValues(ur)}}class ra extends Map{static fromStorage(e){let r=new ra;return e&&Object.entries(JSON.parse(e)).forEach(n=>{r.set(n[0],n[1])}),r}}class Y1{constructor(){g(this,"STORAGE_KEY","eventCoverage")}getCoverage(e,r,n,a){return this.getLocalCoverage(e,new cc(Ct.fromDate(r),Ct.fromDate(n)),a)}getLocalCoverage(e,r,n){let a=ra.fromStorage(localStorage.getItem(this.STORAGE_KEY)),i=[],o=[],s=[];r.getRange().forEach(y=>{e.forEach(x=>{s.push({userId:x,year:y.year,month:y.month})})}),s.forEach(y=>{let x=a.get(y.userId);K1(new Ct(y.year,y.month),x||[])?i.push(y):o.push(y)}),n==null||n.debug("js-calendar-api","Month to load (local): ",i),n==null||n.debug("js-calendar-api","Month to load (remote): ",o);let l=uc(i),u=uc(o),f=fc(l),w=fc(u);return{local:f,remote:w}}saveCoverage(e,r,n,a){return this.saveLocalCoverage(e,new cc(Ct.fromDate(r),Ct.fromDate(n)),a)}saveLocalCoverage(e,r,n){let a=ra.fromStorage(localStorage.getItem(this.STORAGE_KEY));e.forEach(i=>{let o=a==null?void 0:a.get(i),s=o?o.filter(l=>{r.isIn(l.month,l.year)}):[];r.getRange().forEach(l=>{s.push({userId:i,year:l.year,month:l.month})}),n==null||n.debug("js-calendar-api",`Add coverage ${i} ${JSON.stringify(s)}`),a==null||a.set(i,s)}),localStorage.setItem(this.STORAGE_KEY,JSON.stringify(Object.fromEntries(a)))}clearStorage(){localStorage.removeItem(this.STORAGE_KEY)}}class cc{constructor(e,r){g(this,"start"),g(this,"end"),this.start=e,this.end=r}isIn(e,r){let n=Ct.toNumber(r,e);return this.start.toNumber()<=n&&this.end.toNumber()>=n}getRange(){let e=this.start.year,r=this.start.month,n=[];do n.push(new Ct(e,r)),r++,r==12&&(r=0,e++);while(Ct.toNumber(e,r)<=this.end.toNumber());return n}}class Ct{constructor(e,r){g(this,"month"),g(this,"year"),this.year=e,this.month=r}toNumber(){return Ct.toNumber(this.year,this.month)}static fromDate(e){return new Ct(e.getFullYear(),e.getMonth())}static toNumber(e,r){return e*12+r}}const na=t=>{const e=t.month+1;return new Date(t.year+"-"+(e<10?"0"+e:e)+"-01")},Z1=(t,e,r,n)=>t===r&&Math.abs(e-n)===1||Math.abs(t-r)===1&&Math.abs(e-n)===11,K1=(t,e)=>e.filter(r=>r.year===t.year&&r.month===t.month).length>0,uc=t=>{const e=(a,i)=>Ct.toNumber(a.year,a.month)-Ct.toNumber(i.year,i.month);t.sort(e);let r=[];if(t.length===0)return r;let n;return t.forEach((a,i)=>{i===0?n={userId:[a.userId],month:a.month,year:a.year}:a.month===n.month&&a.year===n.year?n.userId.push(a.userId):(r.push(n),n={userId:[a.userId],month:a.month,year:a.year}),i===t.length-1&&r.push(n)}),r};function dc(t,e,r){return{userId:t.userId,start:{year:e.year,month:e.month},end:{year:r.month==11?r.year+1:r.year,month:r.month==11?0:r.month+1}}}const fc=t=>{let e=[];if(t.length===0)return e;let r,n;return t.sort((a,i)=>a.year<i.year?-1:a.year>i.year||a.month>i.month?1:a.month<i.month?-1:0),t.forEach((a,i)=>{if(i===0)r=a,n=a;else if(Z1(a.year,a.month,n.year,n.month))n=a;else{let o=dc(a,r,n);e.push(o),r=a,n=a}if(i===t.length-1){let o=dc(a,r,n);e.push(o)}}),e};var J1=Object.defineProperty,X1=Object.getOwnPropertyDescriptor,Ni=(t,e,r,n)=>{for(var a=n>1?void 0:n?X1(e,r):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(a=(n?o(e,r,a):o(a))||a);return n&&a&&J1(e,r,a),a};const bn=new Me.Channel;let aa=class extends lr{constructor(t,e,r,n){super("event",n),g(this,"REPOSITORY_NAME","Appointment"),g(this,"USE_EVENT_COVERAGE",!1),g(this,"eventDb"),g(this,"eventService"),g(this,"eventMetaStorage"),this.eventDb=new W1(e),this.eventService=new $1(r,t,n),this.eventMetaStorage=new Y1}dispose(){}async onCascadeDelete(t,e,r,n){r==_t&&await this.cascadeDelete({account:t.account,companyId:t.companyId},a=>{var i;return((i=a==null?void 0:a.company)==null?void 0:i.id)===t.companyId})}async createEvent(t,e,r,n,a,i){const o=await this.create(t,Le.REMOTE_THEN_LOCAL,{account:e,companyId:r,timeZone:a,force:i},n);return bn.publish(Je.CREATE,{account:e,companyId:r,event:o}),o}async updateEvent(t,e,r,n,a,i){let o=await this.update(t,Le.REMOTE_THEN_LOCAL,{account:e,companyId:r,timeZone:a,force:i},n);return bn.publish(Je.UPDATE,{account:e,companyId:r,event:o}),o}async updateEventStatus(t,e,r,n,a){let i=await this.remoteUpdateStatus(t,{account:e,companyId:r,eventId:n},a);return bn.publish(Je.UPDATE,{account:e,companyId:r,event:i}),i}async getEvent(t,e,r,n=Le.LOCAL_THEN_REMOTE){return this.getById(t,n,{eventId:e,showPersonal:r})}async getAllEvents(t,e,r,n,a,i,o,s,l=Le.LOCAL_THEN_REMOTE){let u=!0,f=[];if(l===Le.REMOTE_ONLY)f=await this.remoteList(t,{userIds:e.join(","),start:r,end:n,timeZone:o,showPersonal:a,showDeleted:i,fields:s}),await this.localBulkSave({},f),u=!1;else if(l===Le.LOCAL_ONLY)f=await this.localList({userIds:e.join(","),start:r,end:n,showPersonal:a,showDeleted:i});else if(l==Le.REMOTE_THEN_LOCAL){const w=await this.list(t,Le.REMOTE_THEN_LOCAL,{userIds:e.join(","),start:r,end:n,timeZone:o,showPersonal:a,showDeleted:i,fields:s});f=w.results,u=w.local}else if(l==Le.LOCAL_THEN_REMOTE)if(this.USE_EVENT_COVERAGE){let w=await this.getEventWithCoverage(t,e,r,n,a,i,o,s,l);u=w.local,f=w.results}else f=await this.remoteList(t,{userIds:e.join(","),start:r,end:n,timeZone:o,showPersonal:a,showDeleted:i,fields:s}),await this.localBulkSave({},f),u=!1;return{local:u,results:f}}async getEventWithCoverage(t,e,r,n,a,i,o,s,l=Le.LOCAL_THEN_REMOTE){var u,f;let w=!0,y=[],x=this.eventMetaStorage.getCoverage(e,r,n,this.logger);for(const S of x.local){(u=this.logger)==null||u.debug("js-calendar-api",`getAllEvents coverage local: ${JSON.stringify(S)}`);const T=await this.list(t,Le.LOCAL_THEN_REMOTE,{userIds:e.join(","),start:na(S.start),end:na(S.end),timeZone:o,showPersonal:a,showDeleted:i,fields:s});y=y.concat(T.results)}for(const S of x.remote){(f=this.logger)==null||f.debug("js-calendar-api",`getAllEvents coverage remote: ${JSON.stringify(S)}`);const T=await this.list(t,Le.REMOTE_THEN_LOCAL,{userIds:e.join(","),start:na(S.start),end:na(S.end),timeZone:o,showPersonal:a,showDeleted:i,fields:s});y=y.concat(T.results)}return w=x.remote.length===0,{local:w,results:y}}async deleteAllEvents(){return this.eventDb.drop()}async getExternalEvent(t,e,r,n,a){const i=Bn(r,a),o=Bn(n,a);return(await this.eventService.getExternalAppointments(t,e.join(","),i,o,a)).map(s=>Rt.fromEventDto(s,fl.EXTERNAL))}async remoteList(t,e){if(!e.start||!e.end||!e.userIds)throw Error("Invalid state:"+JSON.stringify(e));const r=Bn(e.start,e.timeZone),n=Bn(e.end,e.timeZone),a=await this.eventService.getAllEvents(t,e.userIds,r,n,e.showPersonal,e.showDeleted,e.fields);return this.eventMetaStorage.saveCoverage(e.userIds.split(","),e.start,e.end,this.logger),a.map(i=>Rt.fromEventDto(i))}async remoteGet(t,e){if(!e.eventId)throw Error("Invalid state:"+JSON.stringify(e));const r=await this.eventService.getById(t,e.eventId,e.showPersonal);return Rt.fromEventDto(r)}async remoteCreate(t,e,r){if(!e.account||!e.companyId)throw Error("Invalid state:"+JSON.stringify(e));const n=Rt.toEventDto(r,e.timeZone),a=await this.eventService.createEvent(t,e.account,e.companyId,n,e.force||!1);return Rt.fromEventDto(a)}async remoteUpdate(t,e,r){if(!e.account||!e.companyId)throw Error("Invalid state:"+JSON.stringify(e));let n=Rt.toEventDto(r,e.timeZone);const a=await this.eventService.updateEvent(t,e.account,e.companyId,n,e.force);return Rt.fromEventDto(a)}async remoteUpdateStatus(t,e,r){if(!e.account||!e.companyId||!e.eventId)throw Error("Invalid state:"+JSON.stringify(e));const n=await this.eventService.updateEventStatus(t,e.account,e.companyId,e.eventId,r);return Rt.fromEventDto(n)}async remoteDelete(t,e){throw new Error("Method not implemented.")}async localList(t){var e;return this.eventDb.getAllEvents((e=t.userIds)==null?void 0:e.split(","),t.start,t.end)}async localGet(t){if(!t.eventId)throw Error("Invalid state:"+JSON.stringify(t));return this.eventDb.getById(t.eventId)}async localBulkSave(t,e){await this.eventDb.saveAllEvents(e)}async localDelete(t){throw new Error("Method not implemented.")}async localBulkDelete(t){await this.eventDb.deleteByEventIds(t.map(e=>e.id||""))}};Ni([Me.Unsubscribe()],aa.prototype,"dispose",1),Ni([Me.Subscribe(Je.DELETE)],aa.prototype,"onCascadeDelete",1),aa=Ni([Me.Subscriber({channel:_t})],aa);var Q1=Object.defineProperty,e0=Object.getOwnPropertyDescriptor,hc=(t,e,r,n)=>{for(var a=n>1?void 0:n?e0(e,r):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(a=(n?o(e,r,a):o(a))||a);return n&&a&&Q1(e,r,a),a};const mc=new Me.Channel;let Oi=class extends lr{constructor(t,e,r,n){super("contact",n),g(this,"contactDb"),g(this,"contactService"),this.contactDb=new j1(e),this.contactService=new V1(r,t,n)}async onCascadeChange(t,e,r,n){var a,i,o,s;r==bn&&(i=(a=t.event)==null?void 0:a.client)!=null&&i.id&&await this.cascadeDeleteItem({account:t.account,contactId:(s=(o=t.event)==null?void 0:o.client)==null?void 0:s.id})}async searchContacts(t,e,r){return this.list(t,Le.REMOTE_THEN_LOCAL,{account:r||"",query:e})}async searchContactWithPages(t,e,r,n){let a;return typeof e=="string"?a=await this.contactService.searchContacts(t,e||"",r,100,!1):a=await this.contactService.advancedSearchContacts(t,e,r,100,!1),oi.fromContactSearchDto(a)}async createContact(t,e,r){return r.address===void 0&&(r.address=new fn,r.address.country="FR"),this.create(t,Le.REMOTE_THEN_LOCAL,{account:e},r)}async updateContact(t,e,r,n){return this.update(t,Le.REMOTE_THEN_LOCAL,{account:e,contactId:r},n)}async deleteContact(t,e,r){return this.deleteById(t,{account:e,contactId:r})}async getContact(t,e,r,n=Le.LOCAL_THEN_REMOTE){return this.getById(t,n,{account:e,contactId:r})}async remoteList(t,e){return(await this.contactService.searchContacts(t,e.query||"",e.account)).map(r=>Zt.fromContactDto(r))}async remoteGet(t,e){this.checkNullable(e);const r=await this.contactService.getById(t,e.account,e.contactId);return Zt.fromContactDto(r)}async remoteCreate(t,e,r){const n=Zt.toContactDto(r),a=await this.contactService.createContact(t,e.account,n);return Zt.fromContactDto(a)}async remoteUpdate(t,e,r){this.checkNullable(e);const n=Zt.toContactDto(r),a=await this.contactService.updateContact(t,e.account,e.contactId,n);return Zt.fromContactDto(a)}async remoteDelete(t,e){this.checkNullable(e),await this.contactService.deleteBy(t,e.account,e.contactId)}async localList(t){return this.contactDb.getAllContacts()}async localGet(t){return this.checkNullable(t),this.contactDb.getById(t.contactId)}async localBulkSave(t,e){await this.contactDb.saveAllContacts(e)}async localDelete(t){this.checkNullable(t),await this.contactDb.deleteById(t.contactId)}localBulkDelete(t){return Promise.resolve(void 0)}checkNullable(t){if(!t.contactId)throw Error("Invalid state:"+JSON.stringify(t))}};hc([Me.Subscribe(Je.UPDATE),Me.Subscribe(Je.CREATE)],Oi.prototype,"onCascadeChange",1),Oi=hc([Me.Subscriber({channel:bn})],Oi);const pc=new Me.Channel;var t0={exports:{}};function r0(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gc={exports:{}};const n0={},a0=Object.freeze(Object.defineProperty({__proto__:null,default:n0},Symbol.toStringTag,{value:"Module"})),i0=Dp(a0);var vc;function ze(){return vc||(vc=1,function(t,e){(function(r,n){t.exports=n()})(Ae,function(){var r=r||function(n,a){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof Ae<"u"&&Ae.crypto&&(i=Ae.crypto),!i&&typeof r0=="function")try{i=i0}catch{}var o=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function E(){}return function(A){var I;return E.prototype=A,I=new E,E.prototype=null,I}}(),l={},u=l.lib={},f=u.Base=function(){return{extend:function(E){var A=s(this);return E&&A.mixIn(E),(!A.hasOwnProperty("init")||this.init===A.init)&&(A.init=function(){A.$super.init.apply(this,arguments)}),A.init.prototype=A,A.$super=this,A},create:function(){var E=this.extend();return E.init.apply(E,arguments),E},init:function(){},mixIn:function(E){for(var A in E)E.hasOwnProperty(A)&&(this[A]=E[A]);E.hasOwnProperty("toString")&&(this.toString=E.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),w=u.WordArray=f.extend({init:function(E,A){E=this.words=E||[],A!=a?this.sigBytes=A:this.sigBytes=E.length*4},toString:function(E){return(E||x).stringify(this)},concat:function(E){var A=this.words,I=E.words,D=this.sigBytes,P=E.sigBytes;if(this.clamp(),D%4)for(var z=0;z<P;z++){var Y=I[z>>>2]>>>24-z%4*8&255;A[D+z>>>2]|=Y<<24-(D+z)%4*8}else for(var Q=0;Q<P;Q+=4)A[D+Q>>>2]=I[Q>>>2];return this.sigBytes+=P,this},clamp:function(){var E=this.words,A=this.sigBytes;E[A>>>2]&=4294967295<<32-A%4*8,E.length=n.ceil(A/4)},clone:function(){var E=f.clone.call(this);return E.words=this.words.slice(0),E},random:function(E){for(var A=[],I=0;I<E;I+=4)A.push(o());return new w.init(A,E)}}),y=l.enc={},x=y.Hex={stringify:function(E){for(var A=E.words,I=E.sigBytes,D=[],P=0;P<I;P++){var z=A[P>>>2]>>>24-P%4*8&255;D.push((z>>>4).toString(16)),D.push((z&15).toString(16))}return D.join("")},parse:function(E){for(var A=E.length,I=[],D=0;D<A;D+=2)I[D>>>3]|=parseInt(E.substr(D,2),16)<<24-D%8*4;return new w.init(I,A/2)}},S=y.Latin1={stringify:function(E){for(var A=E.words,I=E.sigBytes,D=[],P=0;P<I;P++){var z=A[P>>>2]>>>24-P%4*8&255;D.push(String.fromCharCode(z))}return D.join("")},parse:function(E){for(var A=E.length,I=[],D=0;D<A;D++)I[D>>>2]|=(E.charCodeAt(D)&255)<<24-D%4*8;return new w.init(I,A)}},T=y.Utf8={stringify:function(E){try{return decodeURIComponent(escape(S.stringify(E)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(E){return S.parse(unescape(encodeURIComponent(E)))}},N=u.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new w.init,this._nDataBytes=0},_append:function(E){typeof E=="string"&&(E=T.parse(E)),this._data.concat(E),this._nDataBytes+=E.sigBytes},_process:function(E){var A,I=this._data,D=I.words,P=I.sigBytes,z=this.blockSize,Y=z*4,Q=P/Y;E?Q=n.ceil(Q):Q=n.max((Q|0)-this._minBufferSize,0);var B=Q*z,G=n.min(B*4,P);if(B){for(var re=0;re<B;re+=z)this._doProcessBlock(D,re);A=D.splice(0,B),I.sigBytes-=G}return new w.init(A,G)},clone:function(){var E=f.clone.call(this);return E._data=this._data.clone(),E},_minBufferSize:0});u.Hasher=N.extend({cfg:f.extend(),init:function(E){this.cfg=this.cfg.extend(E),this.reset()},reset:function(){N.reset.call(this),this._doReset()},update:function(E){return this._append(E),this._process(),this},finalize:function(E){E&&this._append(E);var A=this._doFinalize();return A},blockSize:16,_createHelper:function(E){return function(A,I){return new E.init(I).finalize(A)}},_createHmacHelper:function(E){return function(A,I){return new C.HMAC.init(E,I).finalize(A)}}});var C=l.algo={};return l}(Math);return r})}(gc)),gc.exports}var yc={exports:{}},bc;function ia(){return bc||(bc=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(n){var a=r,i=a.lib,o=i.Base,s=i.WordArray,l=a.x64={};l.Word=o.extend({init:function(u,f){this.high=u,this.low=f}}),l.WordArray=o.extend({init:function(u,f){u=this.words=u||[],f!=n?this.sigBytes=f:this.sigBytes=u.length*8},toX32:function(){for(var u=this.words,f=u.length,w=[],y=0;y<f;y++){var x=u[y];w.push(x.high),w.push(x.low)}return s.create(w,this.sigBytes)},clone:function(){for(var u=o.clone.call(this),f=u.words=this.words.slice(0),w=f.length,y=0;y<w;y++)f[y]=f[y].clone();return u}})}(),r})}(yc)),yc.exports}var Ec={exports:{}},wc;function o0(){return wc||(wc=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(){if(typeof ArrayBuffer=="function"){var n=r,a=n.lib,i=a.WordArray,o=i.init,s=i.init=function(l){if(l instanceof ArrayBuffer&&(l=new Uint8Array(l)),(l instanceof Int8Array||typeof Uint8ClampedArray<"u"&&l instanceof Uint8ClampedArray||l instanceof Int16Array||l instanceof Uint16Array||l instanceof Int32Array||l instanceof Uint32Array||l instanceof Float32Array||l instanceof Float64Array)&&(l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength)),l instanceof Uint8Array){for(var u=l.byteLength,f=[],w=0;w<u;w++)f[w>>>2]|=l[w]<<24-w%4*8;o.call(this,f,u)}else o.apply(this,arguments)};s.prototype=i}}(),r.lib.WordArray})}(Ec)),Ec.exports}var xc={exports:{}},_c;function s0(){return _c||(_c=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,o=n.enc;o.Utf16=o.Utf16BE={stringify:function(l){for(var u=l.words,f=l.sigBytes,w=[],y=0;y<f;y+=2){var x=u[y>>>2]>>>16-y%4*8&65535;w.push(String.fromCharCode(x))}return w.join("")},parse:function(l){for(var u=l.length,f=[],w=0;w<u;w++)f[w>>>1]|=l.charCodeAt(w)<<16-w%2*16;return i.create(f,u*2)}},o.Utf16LE={stringify:function(l){for(var u=l.words,f=l.sigBytes,w=[],y=0;y<f;y+=2){var x=s(u[y>>>2]>>>16-y%4*8&65535);w.push(String.fromCharCode(x))}return w.join("")},parse:function(l){for(var u=l.length,f=[],w=0;w<u;w++)f[w>>>1]|=s(l.charCodeAt(w)<<16-w%2*16);return i.create(f,u*2)}};function s(l){return l<<8&4278255360|l>>>8&16711935}}(),r.enc.Utf16})}(xc)),xc.exports}var Sc={exports:{}},Ic;function Gr(){return Ic||(Ic=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,o=n.enc;o.Base64={stringify:function(l){var u=l.words,f=l.sigBytes,w=this._map;l.clamp();for(var y=[],x=0;x<f;x+=3)for(var S=u[x>>>2]>>>24-x%4*8&255,T=u[x+1>>>2]>>>24-(x+1)%4*8&255,N=u[x+2>>>2]>>>24-(x+2)%4*8&255,C=S<<16|T<<8|N,E=0;E<4&&x+E*.75<f;E++)y.push(w.charAt(C>>>6*(3-E)&63));var A=w.charAt(64);if(A)for(;y.length%4;)y.push(A);return y.join("")},parse:function(l){var u=l.length,f=this._map,w=this._reverseMap;if(!w){w=this._reverseMap=[];for(var y=0;y<f.length;y++)w[f.charCodeAt(y)]=y}var x=f.charAt(64);if(x){var S=l.indexOf(x);S!==-1&&(u=S)}return s(l,u,w)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function s(l,u,f){for(var w=[],y=0,x=0;x<u;x++)if(x%4){var S=f[l.charCodeAt(x-1)]<<x%4*2,T=f[l.charCodeAt(x)]>>>6-x%4*2,N=S|T;w[y>>>2]|=N<<24-y%4*8,y++}return i.create(w,y)}}(),r.enc.Base64})}(Sc)),Sc.exports}var Cc={exports:{}},Tc;function l0(){return Tc||(Tc=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,o=n.enc;o.Base64url={stringify:function(l,u=!0){var f=l.words,w=l.sigBytes,y=u?this._safe_map:this._map;l.clamp();for(var x=[],S=0;S<w;S+=3)for(var T=f[S>>>2]>>>24-S%4*8&255,N=f[S+1>>>2]>>>24-(S+1)%4*8&255,C=f[S+2>>>2]>>>24-(S+2)%4*8&255,E=T<<16|N<<8|C,A=0;A<4&&S+A*.75<w;A++)x.push(y.charAt(E>>>6*(3-A)&63));var I=y.charAt(64);if(I)for(;x.length%4;)x.push(I);return x.join("")},parse:function(l,u=!0){var f=l.length,w=u?this._safe_map:this._map,y=this._reverseMap;if(!y){y=this._reverseMap=[];for(var x=0;x<w.length;x++)y[w.charCodeAt(x)]=x}var S=w.charAt(64);if(S){var T=l.indexOf(S);T!==-1&&(f=T)}return s(l,f,y)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function s(l,u,f){for(var w=[],y=0,x=0;x<u;x++)if(x%4){var S=f[l.charCodeAt(x-1)]<<x%4*2,T=f[l.charCodeAt(x)]>>>6-x%4*2,N=S|T;w[y>>>2]|=N<<24-y%4*8,y++}return i.create(w,y)}}(),r.enc.Base64url})}(Cc)),Cc.exports}var kc={exports:{}},Ac;function $r(){return Ac||(Ac=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(n){var a=r,i=a.lib,o=i.WordArray,s=i.Hasher,l=a.algo,u=[];(function(){for(var T=0;T<64;T++)u[T]=n.abs(n.sin(T+1))*4294967296|0})();var f=l.MD5=s.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(T,N){for(var C=0;C<16;C++){var E=N+C,A=T[E];T[E]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360}var I=this._hash.words,D=T[N+0],P=T[N+1],z=T[N+2],Y=T[N+3],Q=T[N+4],B=T[N+5],G=T[N+6],re=T[N+7],L=T[N+8],q=T[N+9],W=T[N+10],j=T[N+11],V=T[N+12],Z=T[N+13],se=T[N+14],ie=T[N+15],F=I[0],ee=I[1],ne=I[2],K=I[3];F=w(F,ee,ne,K,D,7,u[0]),K=w(K,F,ee,ne,P,12,u[1]),ne=w(ne,K,F,ee,z,17,u[2]),ee=w(ee,ne,K,F,Y,22,u[3]),F=w(F,ee,ne,K,Q,7,u[4]),K=w(K,F,ee,ne,B,12,u[5]),ne=w(ne,K,F,ee,G,17,u[6]),ee=w(ee,ne,K,F,re,22,u[7]),F=w(F,ee,ne,K,L,7,u[8]),K=w(K,F,ee,ne,q,12,u[9]),ne=w(ne,K,F,ee,W,17,u[10]),ee=w(ee,ne,K,F,j,22,u[11]),F=w(F,ee,ne,K,V,7,u[12]),K=w(K,F,ee,ne,Z,12,u[13]),ne=w(ne,K,F,ee,se,17,u[14]),ee=w(ee,ne,K,F,ie,22,u[15]),F=y(F,ee,ne,K,P,5,u[16]),K=y(K,F,ee,ne,G,9,u[17]),ne=y(ne,K,F,ee,j,14,u[18]),ee=y(ee,ne,K,F,D,20,u[19]),F=y(F,ee,ne,K,B,5,u[20]),K=y(K,F,ee,ne,W,9,u[21]),ne=y(ne,K,F,ee,ie,14,u[22]),ee=y(ee,ne,K,F,Q,20,u[23]),F=y(F,ee,ne,K,q,5,u[24]),K=y(K,F,ee,ne,se,9,u[25]),ne=y(ne,K,F,ee,Y,14,u[26]),ee=y(ee,ne,K,F,L,20,u[27]),F=y(F,ee,ne,K,Z,5,u[28]),K=y(K,F,ee,ne,z,9,u[29]),ne=y(ne,K,F,ee,re,14,u[30]),ee=y(ee,ne,K,F,V,20,u[31]),F=x(F,ee,ne,K,B,4,u[32]),K=x(K,F,ee,ne,L,11,u[33]),ne=x(ne,K,F,ee,j,16,u[34]),ee=x(ee,ne,K,F,se,23,u[35]),F=x(F,ee,ne,K,P,4,u[36]),K=x(K,F,ee,ne,Q,11,u[37]),ne=x(ne,K,F,ee,re,16,u[38]),ee=x(ee,ne,K,F,W,23,u[39]),F=x(F,ee,ne,K,Z,4,u[40]),K=x(K,F,ee,ne,D,11,u[41]),ne=x(ne,K,F,ee,Y,16,u[42]),ee=x(ee,ne,K,F,G,23,u[43]),F=x(F,ee,ne,K,q,4,u[44]),K=x(K,F,ee,ne,V,11,u[45]),ne=x(ne,K,F,ee,ie,16,u[46]),ee=x(ee,ne,K,F,z,23,u[47]),F=S(F,ee,ne,K,D,6,u[48]),K=S(K,F,ee,ne,re,10,u[49]),ne=S(ne,K,F,ee,se,15,u[50]),ee=S(ee,ne,K,F,B,21,u[51]),F=S(F,ee,ne,K,V,6,u[52]),K=S(K,F,ee,ne,Y,10,u[53]),ne=S(ne,K,F,ee,W,15,u[54]),ee=S(ee,ne,K,F,P,21,u[55]),F=S(F,ee,ne,K,L,6,u[56]),K=S(K,F,ee,ne,ie,10,u[57]),ne=S(ne,K,F,ee,G,15,u[58]),ee=S(ee,ne,K,F,Z,21,u[59]),F=S(F,ee,ne,K,Q,6,u[60]),K=S(K,F,ee,ne,j,10,u[61]),ne=S(ne,K,F,ee,z,15,u[62]),ee=S(ee,ne,K,F,q,21,u[63]),I[0]=I[0]+F|0,I[1]=I[1]+ee|0,I[2]=I[2]+ne|0,I[3]=I[3]+K|0},_doFinalize:function(){var T=this._data,N=T.words,C=this._nDataBytes*8,E=T.sigBytes*8;N[E>>>5]|=128<<24-E%32;var A=n.floor(C/4294967296),I=C;N[(E+64>>>9<<4)+15]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360,N[(E+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,T.sigBytes=(N.length+1)*4,this._process();for(var D=this._hash,P=D.words,z=0;z<4;z++){var Y=P[z];P[z]=(Y<<8|Y>>>24)&16711935|(Y<<24|Y>>>8)&4278255360}return D},clone:function(){var T=s.clone.call(this);return T._hash=this._hash.clone(),T}});function w(T,N,C,E,A,I,D){var P=T+(N&C|~N&E)+A+D;return(P<<I|P>>>32-I)+N}function y(T,N,C,E,A,I,D){var P=T+(N&E|C&~E)+A+D;return(P<<I|P>>>32-I)+N}function x(T,N,C,E,A,I,D){var P=T+(N^C^E)+A+D;return(P<<I|P>>>32-I)+N}function S(T,N,C,E,A,I,D){var P=T+(C^(N|~E))+A+D;return(P<<I|P>>>32-I)+N}a.MD5=s._createHelper(f),a.HmacMD5=s._createHmacHelper(f)}(Math),r.MD5})}(kc)),kc.exports}var Dc={exports:{}},Nc;function Ri(){return Nc||(Nc=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,o=a.Hasher,s=n.algo,l=[],u=s.SHA1=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(f,w){for(var y=this._hash.words,x=y[0],S=y[1],T=y[2],N=y[3],C=y[4],E=0;E<80;E++){if(E<16)l[E]=f[w+E]|0;else{var A=l[E-3]^l[E-8]^l[E-14]^l[E-16];l[E]=A<<1|A>>>31}var I=(x<<5|x>>>27)+C+l[E];E<20?I+=(S&T|~S&N)+1518500249:E<40?I+=(S^T^N)+1859775393:E<60?I+=(S&T|S&N|T&N)-1894007588:I+=(S^T^N)-899497514,C=N,N=T,T=S<<30|S>>>2,S=x,x=I}y[0]=y[0]+x|0,y[1]=y[1]+S|0,y[2]=y[2]+T|0,y[3]=y[3]+N|0,y[4]=y[4]+C|0},_doFinalize:function(){var f=this._data,w=f.words,y=this._nDataBytes*8,x=f.sigBytes*8;return w[x>>>5]|=128<<24-x%32,w[(x+64>>>9<<4)+14]=Math.floor(y/4294967296),w[(x+64>>>9<<4)+15]=y,f.sigBytes=w.length*4,this._process(),this._hash},clone:function(){var f=o.clone.call(this);return f._hash=this._hash.clone(),f}});n.SHA1=o._createHelper(u),n.HmacSHA1=o._createHmacHelper(u)}(),r.SHA1})}(Dc)),Dc.exports}var Oc={exports:{}},Rc;function Lc(){return Rc||(Rc=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){return function(n){var a=r,i=a.lib,o=i.WordArray,s=i.Hasher,l=a.algo,u=[],f=[];(function(){function x(C){for(var E=n.sqrt(C),A=2;A<=E;A++)if(!(C%A))return!1;return!0}function S(C){return(C-(C|0))*4294967296|0}for(var T=2,N=0;N<64;)x(T)&&(N<8&&(u[N]=S(n.pow(T,1/2))),f[N]=S(n.pow(T,1/3)),N++),T++})();var w=[],y=l.SHA256=s.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(x,S){for(var T=this._hash.words,N=T[0],C=T[1],E=T[2],A=T[3],I=T[4],D=T[5],P=T[6],z=T[7],Y=0;Y<64;Y++){if(Y<16)w[Y]=x[S+Y]|0;else{var Q=w[Y-15],B=(Q<<25|Q>>>7)^(Q<<14|Q>>>18)^Q>>>3,G=w[Y-2],re=(G<<15|G>>>17)^(G<<13|G>>>19)^G>>>10;w[Y]=B+w[Y-7]+re+w[Y-16]}var L=I&D^~I&P,q=N&C^N&E^C&E,W=(N<<30|N>>>2)^(N<<19|N>>>13)^(N<<10|N>>>22),j=(I<<26|I>>>6)^(I<<21|I>>>11)^(I<<7|I>>>25),V=z+j+L+f[Y]+w[Y],Z=W+q;z=P,P=D,D=I,I=A+V|0,A=E,E=C,C=N,N=V+Z|0}T[0]=T[0]+N|0,T[1]=T[1]+C|0,T[2]=T[2]+E|0,T[3]=T[3]+A|0,T[4]=T[4]+I|0,T[5]=T[5]+D|0,T[6]=T[6]+P|0,T[7]=T[7]+z|0},_doFinalize:function(){var x=this._data,S=x.words,T=this._nDataBytes*8,N=x.sigBytes*8;return S[N>>>5]|=128<<24-N%32,S[(N+64>>>9<<4)+14]=n.floor(T/4294967296),S[(N+64>>>9<<4)+15]=T,x.sigBytes=S.length*4,this._process(),this._hash},clone:function(){var x=s.clone.call(this);return x._hash=this._hash.clone(),x}});a.SHA256=s._createHelper(y),a.HmacSHA256=s._createHmacHelper(y)}(Math),r.SHA256})}(Oc)),Oc.exports}var Mc={exports:{}},Pc;function c0(){return Pc||(Pc=1,function(t,e){(function(r,n,a){t.exports=n(ze(),Lc())})(Ae,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,o=n.algo,s=o.SHA256,l=o.SHA224=s.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=s._doFinalize.call(this);return u.sigBytes-=4,u}});n.SHA224=s._createHelper(l),n.HmacSHA224=s._createHmacHelper(l)}(),r.SHA224})}(Mc)),Mc.exports}var Fc={exports:{}},zc;function Bc(){return zc||(zc=1,function(t,e){(function(r,n,a){t.exports=n(ze(),ia())})(Ae,function(r){return function(){var n=r,a=n.lib,i=a.Hasher,o=n.x64,s=o.Word,l=o.WordArray,u=n.algo;function f(){return s.create.apply(s,arguments)}var w=[f(1116352408,3609767458),f(1899447441,602891725),f(3049323471,3964484399),f(3921009573,2173295548),f(961987163,4081628472),f(1508970993,3053834265),f(2453635748,2937671579),f(2870763221,3664609560),f(3624381080,2734883394),f(310598401,1164996542),f(607225278,1323610764),f(1426881987,3590304994),f(1925078388,4068182383),f(2162078206,991336113),f(2614888103,633803317),f(3248222580,3479774868),f(3835390401,2666613458),f(4022224774,944711139),f(264347078,2341262773),f(604807628,2007800933),f(770255983,1495990901),f(1249150122,1856431235),f(1555081692,3175218132),f(1996064986,2198950837),f(2554220882,3999719339),f(2821834349,766784016),f(2952996808,2566594879),f(3210313671,3203337956),f(3336571891,1034457026),f(3584528711,2466948901),f(113926993,3758326383),f(338241895,168717936),f(666307205,1188179964),f(773529912,1546045734),f(1294757372,1522805485),f(1396182291,2643833823),f(1695183700,2343527390),f(1986661051,1014477480),f(2177026350,1206759142),f(2456956037,344077627),f(2730485921,1290863460),f(2820302411,3158454273),f(3259730800,3505952657),f(3345764771,106217008),f(3516065817,3606008344),f(3600352804,1432725776),f(4094571909,1467031594),f(275423344,851169720),f(430227734,3100823752),f(506948616,1363258195),f(659060556,3750685593),f(883997877,3785050280),f(958139571,3318307427),f(1322822218,3812723403),f(1537002063,2003034995),f(1747873779,3602036899),f(1955562222,1575990012),f(2024104815,1125592928),f(2227730452,2716904306),f(2361852424,442776044),f(2428436474,593698344),f(2756734187,3733110249),f(3204031479,2999351573),f(3329325298,3815920427),f(3391569614,3928383900),f(3515267271,566280711),f(3940187606,3454069534),f(4118630271,4000239992),f(116418474,1914138554),f(174292421,2731055270),f(289380356,3203993006),f(460393269,320620315),f(685471733,587496836),f(852142971,1086792851),f(1017036298,365543100),f(1126000580,2618297676),f(1288033470,3409855158),f(1501505948,4234509866),f(1607167915,987167468),f(1816402316,1246189591)],y=[];(function(){for(var S=0;S<80;S++)y[S]=f()})();var x=u.SHA512=i.extend({_doReset:function(){this._hash=new l.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(S,T){for(var N=this._hash.words,C=N[0],E=N[1],A=N[2],I=N[3],D=N[4],P=N[5],z=N[6],Y=N[7],Q=C.high,B=C.low,G=E.high,re=E.low,L=A.high,q=A.low,W=I.high,j=I.low,V=D.high,Z=D.low,se=P.high,ie=P.low,F=z.high,ee=z.low,ne=Y.high,K=Y.low,xe=Q,_e=B,Oe=G,ye=re,Be=L,Ie=q,$=W,ae=j,_=V,b=Z,O=se,te=ie,le=F,de=ee,M=ne,c=K,v=0;v<80;v++){var d,m,h=y[v];if(v<16)m=h.high=S[T+v*2]|0,d=h.low=S[T+v*2+1]|0;else{var p=y[v-15],k=p.high,R=p.low,U=(k>>>1|R<<31)^(k>>>8|R<<24)^k>>>7,H=(R>>>1|k<<31)^(R>>>8|k<<24)^(R>>>7|k<<25),J=y[v-2],X=J.high,oe=J.low,fe=(X>>>19|oe<<13)^(X<<3|oe>>>29)^X>>>6,pe=(oe>>>19|X<<13)^(oe<<3|X>>>29)^(oe>>>6|X<<26),ve=y[v-7],Se=ve.high,Ee=ve.low,be=y[v-16],ce=be.high,Ve=be.low;d=H+Ee,m=U+Se+(d>>>0<H>>>0?1:0),d=d+pe,m=m+fe+(d>>>0<pe>>>0?1:0),d=d+Ve,m=m+ce+(d>>>0<Ve>>>0?1:0),h.high=m,h.low=d}var we=_&O^~_&le,We=b&te^~b&de,Qe=xe&Oe^xe&Be^Oe&Be,mt=_e&ye^_e&Ie^ye&Ie,ge=(xe>>>28|_e<<4)^(xe<<30|_e>>>2)^(xe<<25|_e>>>7),nt=(_e>>>28|xe<<4)^(_e<<30|xe>>>2)^(_e<<25|xe>>>7),Ht=(_>>>14|b<<18)^(_>>>18|b<<14)^(_<<23|b>>>9),Tt=(b>>>14|_<<18)^(b>>>18|_<<14)^(b<<23|_>>>9),kt=w[v],At=kt.high,pt=kt.low,ct=c+Tt,ut=M+Ht+(ct>>>0<c>>>0?1:0),ct=ct+We,ut=ut+we+(ct>>>0<We>>>0?1:0),ct=ct+pt,ut=ut+At+(ct>>>0<pt>>>0?1:0),ct=ct+d,ut=ut+m+(ct>>>0<d>>>0?1:0),hr=nt+mt,Wr=ge+Qe+(hr>>>0<nt>>>0?1:0);M=le,c=de,le=O,de=te,O=_,te=b,b=ae+ct|0,_=$+ut+(b>>>0<ae>>>0?1:0)|0,$=Be,ae=Ie,Be=Oe,Ie=ye,Oe=xe,ye=_e,_e=ct+hr|0,xe=ut+Wr+(_e>>>0<ct>>>0?1:0)|0}B=C.low=B+_e,C.high=Q+xe+(B>>>0<_e>>>0?1:0),re=E.low=re+ye,E.high=G+Oe+(re>>>0<ye>>>0?1:0),q=A.low=q+Ie,A.high=L+Be+(q>>>0<Ie>>>0?1:0),j=I.low=j+ae,I.high=W+$+(j>>>0<ae>>>0?1:0),Z=D.low=Z+b,D.high=V+_+(Z>>>0<b>>>0?1:0),ie=P.low=ie+te,P.high=se+O+(ie>>>0<te>>>0?1:0),ee=z.low=ee+de,z.high=F+le+(ee>>>0<de>>>0?1:0),K=Y.low=K+c,Y.high=ne+M+(K>>>0<c>>>0?1:0)},_doFinalize:function(){var S=this._data,T=S.words,N=this._nDataBytes*8,C=S.sigBytes*8;T[C>>>5]|=128<<24-C%32,T[(C+128>>>10<<5)+30]=Math.floor(N/4294967296),T[(C+128>>>10<<5)+31]=N,S.sigBytes=T.length*4,this._process();var E=this._hash.toX32();return E},clone:function(){var S=i.clone.call(this);return S._hash=this._hash.clone(),S},blockSize:1024/32});n.SHA512=i._createHelper(x),n.HmacSHA512=i._createHmacHelper(x)}(),r.SHA512})}(Fc)),Fc.exports}var Uc={exports:{}},Vc;function u0(){return Vc||(Vc=1,function(t,e){(function(r,n,a){t.exports=n(ze(),ia(),Bc())})(Ae,function(r){return function(){var n=r,a=n.x64,i=a.Word,o=a.WordArray,s=n.algo,l=s.SHA512,u=s.SHA384=l.extend({_doReset:function(){this._hash=new o.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var f=l._doFinalize.call(this);return f.sigBytes-=16,f}});n.SHA384=l._createHelper(u),n.HmacSHA384=l._createHmacHelper(u)}(),r.SHA384})}(Uc)),Uc.exports}var jc={exports:{}},qc;function d0(){return qc||(qc=1,function(t,e){(function(r,n,a){t.exports=n(ze(),ia())})(Ae,function(r){return function(n){var a=r,i=a.lib,o=i.WordArray,s=i.Hasher,l=a.x64,u=l.Word,f=a.algo,w=[],y=[],x=[];(function(){for(var N=1,C=0,E=0;E<24;E++){w[N+5*C]=(E+1)*(E+2)/2%64;var A=C%5,I=(2*N+3*C)%5;N=A,C=I}for(var N=0;N<5;N++)for(var C=0;C<5;C++)y[N+5*C]=C+(2*N+3*C)%5*5;for(var D=1,P=0;P<24;P++){for(var z=0,Y=0,Q=0;Q<7;Q++){if(D&1){var B=(1<<Q)-1;B<32?Y^=1<<B:z^=1<<B-32}D&128?D=D<<1^113:D<<=1}x[P]=u.create(z,Y)}})();var S=[];(function(){for(var N=0;N<25;N++)S[N]=u.create()})();var T=f.SHA3=s.extend({cfg:s.cfg.extend({outputLength:512}),_doReset:function(){for(var N=this._state=[],C=0;C<25;C++)N[C]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(N,C){for(var E=this._state,A=this.blockSize/2,I=0;I<A;I++){var D=N[C+2*I],P=N[C+2*I+1];D=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,P=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360;var z=E[I];z.high^=P,z.low^=D}for(var Y=0;Y<24;Y++){for(var Q=0;Q<5;Q++){for(var B=0,G=0,re=0;re<5;re++){var z=E[Q+5*re];B^=z.high,G^=z.low}var L=S[Q];L.high=B,L.low=G}for(var Q=0;Q<5;Q++)for(var q=S[(Q+4)%5],W=S[(Q+1)%5],j=W.high,V=W.low,B=q.high^(j<<1|V>>>31),G=q.low^(V<<1|j>>>31),re=0;re<5;re++){var z=E[Q+5*re];z.high^=B,z.low^=G}for(var Z=1;Z<25;Z++){var B,G,z=E[Z],se=z.high,ie=z.low,F=w[Z];F<32?(B=se<<F|ie>>>32-F,G=ie<<F|se>>>32-F):(B=ie<<F-32|se>>>64-F,G=se<<F-32|ie>>>64-F);var ee=S[y[Z]];ee.high=B,ee.low=G}var ne=S[0],K=E[0];ne.high=K.high,ne.low=K.low;for(var Q=0;Q<5;Q++)for(var re=0;re<5;re++){var Z=Q+5*re,z=E[Z],xe=S[Z],_e=S[(Q+1)%5+5*re],Oe=S[(Q+2)%5+5*re];z.high=xe.high^~_e.high&Oe.high,z.low=xe.low^~_e.low&Oe.low}var z=E[0],ye=x[Y];z.high^=ye.high,z.low^=ye.low}},_doFinalize:function(){var N=this._data,C=N.words;this._nDataBytes*8;var E=N.sigBytes*8,A=this.blockSize*32;C[E>>>5]|=1<<24-E%32,C[(n.ceil((E+1)/A)*A>>>5)-1]|=128,N.sigBytes=C.length*4,this._process();for(var I=this._state,D=this.cfg.outputLength/8,P=D/8,z=[],Y=0;Y<P;Y++){var Q=I[Y],B=Q.high,G=Q.low;B=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360,G=(G<<8|G>>>24)&16711935|(G<<24|G>>>8)&4278255360,z.push(G),z.push(B)}return new o.init(z,D)},clone:function(){for(var N=s.clone.call(this),C=N._state=this._state.slice(0),E=0;E<25;E++)C[E]=C[E].clone();return N}});a.SHA3=s._createHelper(T),a.HmacSHA3=s._createHmacHelper(T)}(Math),r.SHA3})}(jc)),jc.exports}var Hc={exports:{}},Gc;function f0(){return Gc||(Gc=1,function(t,e){(function(r,n){t.exports=n(ze())})(Ae,function(r){/** @preserve
50
50
  (c) 2012 by Cédric Mesnil. All rights reserved.
51
51
 
52
52
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agendize/vue-tools",
3
- "version": "1.1.0-beta4818-1",
3
+ "version": "1.1.0-beta4818-2",
4
4
  "description": "Agendize tools",
5
5
  "type": "module",
6
6
  "private": false,
@@ -46,7 +46,7 @@
46
46
  "qr-code-styling":"^1.5.0",
47
47
  "pinia": "^2.0.30",
48
48
  "@agendize/design-system": "1.3.7-beta4818-1",
49
- "@agendize/js-calendar-api": "1.3.0-beta.4834.2",
49
+ "@agendize/js-calendar-api": "1.3.0-beta.4834.3",
50
50
  "@agendize/az-i18n": "^1.0.18"
51
51
  },
52
52
  "devDependencies": {