UNPKG

webcom

Version:

Webcom library

20 lines 76.3 kB
/*! * Webcom. Build realtime apps. Share and sync data instantly between your clients * * Module name: Webcom * Version: 3.10.1 * Created: 2025-11-07T12:56:10.314Z * * Copyright (C) <2015-2025> Orange * * This software is confidential and proprietary information of Orange. * You shall not disclose such Confidential Information and shall use it only in * accordance with the terms of the agreement you entered into. * Unauthorized copying of this file, via any medium is strictly prohibited. * * If you are Orange employee you shall use this software in accordance with * the Orange Source Charter (http://opensource.itn.ftgroup/index.php/Orange_Source_Charter) */ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,()=>(()=>{var t={29:(t,e,n)=>{"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,{A:()=>r})},33:(t,e,n)=>{"use strict";n.d(e,{$f:()=>c,Rd:()=>l,a6:()=>f,e8:()=>p,kj:()=>d,l8:()=>h,sc:()=>v});var r=n(296),i=n(203),o=n(779),a=n.n(o),s=n(412);function u(t){return decodeURIComponent(t.replace(/\+/g," "))}function c(){var t=2147483648;return Math.floor(Math.random()*t).toString(36)+Math.abs(Math.floor(Math.random()*t)^Date.now()).toString(36)}function h(t){var e={};return t.replace(/^[^?]*\?/,"").split("&").forEach(function(t){var n=t.indexOf("=");if(n<0)e[u(t)]=!0;else{var r=u(t.substring(0,n));e[r]=u(t.substring(n+1))}}),e}function l(t){if(!t)return"";var e=[];return Object.entries(t).forEach(function(t){var n=(0,r.A)(t,2),i=n[0],o=n[1];null!=o&&((0,s.Gv)(o)&&(o=JSON.stringify(o)),e.push(encodeURIComponent(i)+"="+encodeURIComponent(o)))}),e.join("&")}function f(t,e){var n=t.indexOf("?"),r=e?(n<0?"?":"&")+l(e):"",i=t.indexOf("#");return i<0?t+r:t.substring(0,i)+r+t.substring(i)}function d(t){for(var e,n,r=[],o=0,a=0;a<t.length;a++)(e=t.charCodeAt(a))>=55296&&e<=56319&&(n=e-55296,a++,(0,i.vA)(a<t.length,"Surrogate pair missing trail surrogate."),e=65536+(n<<10)+(t.charCodeAt(a)-56320)),e<128?r[o++]=e:e<2048?(r[o++]=e>>6|192,r[o++]=63&e|128):e<65536?(r[o++]=e>>12|224,r[o++]=e>>6&63|128,r[o++]=63&e|128):(r[o++]=e>>18|240,r[o++]=e>>12&63|128,r[o++]=e>>6&63|128,r[o++]=63&e|128);return r}function p(t,e){return a().codec.base64.fromBits(a().hash.sha1.hash(t),!1,e)}function v(t,e){return a().codec.base64.fromBits(a().hash.sha256.hash(t),!1,e)}},55:(t,e,n)=>{"use strict";n.d(e,{A:()=>h});var r=n(816);function i(t,e,n){return(e=(0,r.A)(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var o=n(29),a=n(901),s=n(203),u=n(487),c=n(243),h=function(){function t(e){(0,o.A)(this,t),this.mode=e,e===d&&(this.childEventFilter=i(i(i({},v,!1),y,!1),g,!1))}return(0,a.A)(t,[{key:"isValueChange",get:function(){return this.mode!==d}},{key:"isValueChangeWithoutData",get:function(){return this.mode===p}},{key:"isChildEvent",get:function(){return this.mode===d}},{key:"isChildAddition",get:function(){return this.isChildEvent&&this.childEventFilter[v]}},{key:"isChildRemoval",get:function(){return this.isChildEvent&&this.childEventFilter[y]}},{key:"isChildChange",get:function(){return this.isChildEvent&&this.childEventFilter[g]}},{key:"excludeRevocations",value:function(){return(0,s.ar)(["EventDescriptor","#excludeRevocations"],arguments),this.receivesRevocations=!1,this}}],[{key:"ValueChange",get:function(){var e=new t(f);return(0,u.gB)(e,"WithoutData",function(){return e.mode=p,e}),e}},{key:"Child",get:function(){var e=new t(d);return l(e,"Addition",v),l(e,"Removal",y),l(e,"Change",g),e}}])}();function l(t,e,n){(0,u.gB)(t,e,function(){return t.childEventFilter[n]=!0,t})}var f="value",d="childEvent",p="noData",v="added",y="removed",g="changed";i(i(i({},v,c.u4),g,c._t),y,c.yL)},128:(t,e,n)=>{"use strict";n.r(e),n.d(e,{_this_init4browsers:()=>u,_this_listenLts:()=>l,_this_setLtsContext:()=>d,_this_unlistenLts:()=>f});var r=n(458),i=n(296),o=n(317),a=n(203),s=n(364);function u(){var t=this;this._ltsListeners=[],this._saveLts=h,this._auth.subscribe(function(e,n){e||n.isRequired()||(t._ltsAuth&&t._ltsAuth.isAuthenticated()&&p.call(t,function(e,n){return e.uid!==n.uid||!s.e7[e.data.kind]||(s.dO.call(t,n,e.data.id,!0).catch(function(n){return t._logger.error("Failed to cancel a long term subscription #%s: %s",e.data.id,n.message)}),!1)}),t._ltsAuth=n,v.call(t))},!0)}function c(t){return t.filter(function(t){return t.data.encryption}).map(function(t){return[t.data.encryption,1e3*t.data.expirationTimestampSeconds]})}function h(t){var e=c.call(this,t);this._ltsListeners.forEach(function(t){return t(e)}),e.forEach(function(t){var e=(0,i.A)(t,1)[0];return Object.keys(e).filter(function(t){return"alg"!==t&&"kid"!==t}).forEach(function(t){return delete e[t]})}),s.B$.call(this,t)}function l(t,e,n){(0,a.ar)([].concat((0,r.A)(e),["#_listenLts"]),n,a.Pc),this._ltsListeners.push(t),t(c.call(this,o.H.get(this._ltsKey)))}function f(t,e,n){(0,a.ar)([].concat((0,r.A)(e),["#_unlistenLts"]),n,a.Pc),this._ltsListeners=this._ltsListeners.filter(function(e){return e!==t})}function d(t,e,n,i){(0,a.ar)([].concat((0,r.A)(n),["#_setLtsContext"]),i,a.Yj,a.Yj),s.e7[t]=e,v.call(this)}function p(t){var e=o.H.get(this._ltsKey);if(e){var n,r=null===(n=this._ltsAuth)||void 0===n?void 0:n.details,i=[];e.forEach(function(e){Date.now()<1e3*e.data.expirationTimestampSeconds&&t(e,r)&&i.push(e)}),this._saveLts(i)}}function v(){var t=this;p.call(this,function(e,n){if(n&&e.startDate&&e.uid===n.uid){var r=e.data,i=s.e7[r.kind];if(i&&i!==r.context)return t._logger.log("Refresh the context of the long term subscription #%s: %s --\x3e %s",r.id,r.context,i),s.dO.call(t,n,r.id,!0).then(function(){return delete r.id,s.Gj.call(t,n,!0,(0,s.hH)(r,{context:i}),e.startDate)}).catch(function(e){return t._logger.error("Failed to refresh the long term subscription #%s: %s",r.id,e.message)}),!1}return!0})}},145:(t,e,n)=>{"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}n.d(e,{A:()=>r})},171:(t,e,n)=>{"use strict";n.d(e,{J:()=>r});var r=function(){if("undefined"!=typeof globalThis)return globalThis;return"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:Function("return this")()}()},172:t=>{t.exports=function(t,e){this.v=t,this.k=e},t.exports.__esModule=!0,t.exports.default=t.exports},176:(t,e,n)=>{"use strict";n.d(e,{Ay:()=>h,w8:()=>d,wT:()=>f});var r=n(296),i=n(29),o=n(901),a=n(203),s=n(204),u=n(412),c="WebcomApp",h=(0,o.A)(function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.A)(this,t),(0,a.ar)(["new ",c],arguments,(0,a.cK)(/^[a-z0-9](?:[-a-z0-9]{0,38}[a-z0-9])?$/),(0,a.lq)((0,a.gP)(a.Ik,a.Yj))),this._logger=(0,s.h)("api.WebcomApp",c),this._services={},this.appId=e,this.config={},(0,u.Kg)(n)&&(n=Object.keys(d).reduce(function(t,e){return t[e]={baseUrl:n},t},{})),this._fillConfig(n),this._logger.log("Initialized %s with options %s",e,JSON.stringify(this.config))},[{key:"dispose",value:function(){(0,a.ar)([c,"#dispose"],arguments),Object.values(this._services).forEach(function(t){return t._dispose()}),this._services={}}},{key:"_fillConfig",value:function(t){l.call(this,t,d)}},{key:"toString",value:function(){return"".concat(this.appId,"{").concat(Object.keys(this._services).join(","),"}")}}]);function l(t,e){var n=this,i=function(t,e,o,s){var u=function(t){return"".concat(c,".Configuration.").concat(s.concat(t).join("."))};e=Object.assign({},e),Object.entries(o).forEach(function(o){var c=(0,r.A)(o,2),h=c[0],l=c[1];if(l instanceof Object&&!(l instanceof Array))t[h]=t[h]||{},i(t[h],e[h]||{},l,s.concat(h));else{var f=e[h],d=l[1]||function(t){return t};try{t[h]=d(void 0===f?void 0===t[h]?l.length?l[0]:l:t[h]:f)}catch(e){var p=u(h);void 0===e.value?(0,a.$8)(p,e.message):(n._logger.warn("%s: %s",p,e.message),t[h]=e.value)}}delete e[h]}),Object.keys(e).forEach(function(t){return n._logger.warn("%s: unknown config key",u(t))})};i(this.config,t,e,[])}function f(t,e,n){return"".concat(n.key,":").concat(e,":").concat(function(t,e){var n=e.baseUrl;return"/".concat(n.protocol.slice(0,-1),"/").concat(n.host,"/").concat(t.appId,"/")}(t,n))}var d={}},203:(t,e,n)=>{"use strict";n.d(e,{$8:()=>l,$x:()=>d,Ik:()=>S,Pc:()=>k,WP:()=>O,Yj:()=>b,ar:()=>f,cK:()=>R,gP:()=>x,gp:()=>g,lq:()=>p,se:()=>h,vA:()=>s,vD:()=>m,vM:()=>w,y:()=>y,zB:()=>v,zM:()=>A,zR:()=>a});var r=n(284),i=n(458),o=n(412),a="Webcom internal error";function s(t,e){t||l(a,e)}var u={values:[]};function c(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];Object.assign(u,{method:t,args:e||[],checkers:r})}function h(t,e,n){u.values.push({name:t,value:e,checker:n})}var l=function(t,e){var n;throw new Error("".concat((n="").concat.apply(n,(0,i.A)(t)),": ").concat(e))};function f(t,e){if(!u.method){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];c.apply(void 0,[t,e].concat(r))}var o=u.method,a=u.args,s=u.checkers,h=u.values;Object.assign(u,{method:void 0,args:void 0,checkers:void 0,values:[]}),a.length>s.length&&l(o,"too many arguments, ".concat(a.length," instead of ").concat(s.length)),s.forEach(function(t,e){return d(t,a[e],o,function(t){return"argument #".concat(e+1," ").concat(t)})}),h.forEach(function(t){var e=t.name,n=t.value;return d(t.checker,n,o,function(t){return"".concat(e," ").concat(t)})})}function d(t,e,n,r){var i=t(e);i&&l(n,r(i))}function p(t){return function(e){return _("undefined")(e)&&t&&t(e)}}function v(t){return function(e){return null===e?"must not be null":t&&t(e)}}var y=function(t){return void 0===t?"is missing":""};function g(t){return function(e){return!(e instanceof t)&&"must be an instance of ".concat(t.name)}}function _(t){return function(e){return(0,r.A)(e)!==t&&"must be a ".concat(t)}}var m=_("undefined"),b=_("string"),k=_("function"),A=_("boolean"),w=P(Number.isFinite,"must be a finite number"),S=_("object");function x(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return e.every(function(e){return e(t)})&&"either ".concat(e.map(function(e){return e(t)}).join(" or "))}}function O(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){var n;return e.some(function(e){return n=e(t)})&&n}}var j="is not valid";function P(t,e){return function(n){return!t(n)&&(e||j)}}P(function(t){return(0,o.Et)(t)&&Math.floor(t)===t},"must be an integer");function R(t,e){return P(function(e){return t.test(e)},e)}},204:(t,e,n)=>{"use strict";n.d(e,{MX:()=>O,d1:()=>Y,h:()=>G,Ay:()=>q});var r=n(458),i=n(29),o=n(901),a=n(296),s=n(171),u=n(854),c=n(412),h="console",l=u.y[h],f=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var o=function(t){return(0,c.Gv)(t)?JSON.stringify(t):(t||"undefined").toString()};if((0,c.Kg)(t)){var a=0;return[t=t.replace(/%(.)/g,function(t,e){switch(e){case"%":return"%";case"s":case"o":case"O":return o(n[a++]);case"d":case"i":case"f":return n[a++];default:return t}})].concat((0,r.A)(n.slice(a).map(o))).join(" ")}return[t].concat(n).map(o).join(" ")};function d(t,e,n,r,i){if(!n||!r||!i){var o=e,a=function(t){return function(e){return o("[".concat(t,"] ").concat(e))}};n=n||a("INFO"),r=r||a("WARN"),i=i||a("ERR!"),e=a("LOG ")}return{log:function(){return e.call(t,f.apply(void 0,arguments))},info:function(){return n.call(t,f.apply(void 0,arguments))},warn:function(){return r.call(t,f.apply(void 0,arguments))},error:function(){return i.call(t,f.apply(void 0,arguments))}}}if((0,c.Tn)(l))l=d(s.J,l);else if((0,c.Gv)(l)&&l){var p=l,v=p.log,y=p.info,g=p.warn,_=p.error;l=d(l,v,y,g,_)}else{l=d(s.J[h],s.J[h].log,s.J[h].info,s.J[h].warn,s.J[h].error)}(0,u.aZ)(h,function(){return l},function(t){return l=t});var m=n(203),b=n(304),k={};function A(t,e){var n=t.length;return n>=e?t.substring(0,e):t+O.substring(0,e-n)}function w(t){return t.map(function(t){return(0,c.Tn)(t)?t():t})}var S=(0,o.A)(function t(e,n,r,o){(0,i.A)(this,t),this._fqdn=e,this._prefix=n;var a=e.join(".");this._count=void 0===k[a]?k[a]=0:++k[a],this.displayTimestamp=r,this.setPrefixWidth(o||8),this._log=this._emitLog.bind(this,l.log),this._info=this._emitLog.bind(this,l.info),this._warn=this._emitLog.bind(this,l.warn),this._error=this._emitLog.bind(this,l.error),this._enabled=!0},[{key:"fqdn",get:function(){return this._fqdn}},{key:"_emitLog",value:function(t,e){var n=this.displayTimestamp?[(new Date).toISOString()]:[];n.push(this._displayedPrefix);for(var i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];(0,c.Kg)(e)?(n.push(e),e=n.join(" "),t.apply(void 0,[e].concat((0,r.A)(w(o))))):t.apply(void 0,n.concat((0,r.A)(w([e].concat(o)))))}},{key:"setPrefixWidth",value:function(t){this._displayedPrefix="".concat(A(this._prefix,t)," #").concat(A(this._count.toString(),3))}},{key:"setLevel",value:function(t){this._enabled=t>=0,this.log=t>=q.LOG?this._log:b.lQ,this.info=t>=q.INFO?this._info:b.lQ,this.warn=t>=q.WARN?this._warn:b.lQ,this.error=t>=q.ERROR?this._error:b.lQ}},{key:"updateLevel",value:function(t){this._enabled&&this.setLevel(t)}}]),x=-1,O=" ",j=!1,P=15,R=[],E={},I={},C={},T="_leaf_";function L(t){return t?t.split("."):[]}function D(t){return{disabledDepth:M(t,C),enabledDepth:M(t,I)}}function N(t,e,n,r){for(var i=0;i<t.length;){var o=t[i++];e.hasOwnProperty(o)||(e[o]={}),e=e[o]}r&&Object.keys(e).forEach(function(t){return delete e[t]}),e[T]=n}function H(t,e){for(var n=0;n<t.length;){var r=t[n++];if(!e.hasOwnProperty(r))return;e=e[r]}delete e[T]}function M(t,e){var n=-1,r=0;do{e.hasOwnProperty(T)&&(n=r)}while(r<t.length&&(e=e[t[r++]]));return n}function F(t,e){Object.entries(t||{}).forEach(function(t){var n=(0,a.A)(t,2),r=n[0],i=n[1];r===T?e(i):F(i,e)})}function J(t,e){for(var n=[],r=0;e&&r<t.length;)e=e[t[r++]];return F(e,function(t){return n.push(t)}),n}function U(t){j=t,R.forEach(function(t){return t.displayTimestamp=j})}var Y="LogManager",q=function(){function t(){(0,i.A)(this,t)}return(0,o.A)(t,null,[{key:"enable",value:function(e){(0,m.ar)([Y,".enable"],arguments,(0,m.lq)(m.Yj));var n=L(e),r=D(n),i=r.enabledDepth,o=r.disabledDepth;i<=o&&(o<0&&t.disable(),N(n,I,!0,!0),H(n,C),J(n,E).forEach(function(t){return t.setLevel(W)}))}},{key:"disable",value:function(t){(0,m.ar)([Y,".disable"],arguments,(0,m.lq)(m.Yj));var e=L(t),n=D(e),r=n.enabledDepth;n.disabledDepth<=r&&(N(e,C,!0,!0),H(e,I),J(e,E).forEach(function(t){return t.setLevel(x)}))}},{key:"showTimestamp",value:function(){(0,m.ar)([Y,".showTimestamp"],arguments),U(!0)}},{key:"hideTimestamp",value:function(){(0,m.ar)([Y,".hideTimestamp"],arguments),U(!1)}},{key:"setPrefixWidth",value:function(t){(0,m.ar)([Y,".setPrefixWidth"],arguments,m.vM),t<0?t=0:t>O.length&&(t=O.length),P=t,R.forEach(function(t){return t.setPrefixWidth(P)})}},{key:"level",get:function(){return W},set:function(t){(0,m.ar)([Y,".level"],arguments,m.vM),t>x&&t!==W&&(R.forEach(function(e){return e.updateLevel(t)}),W=t)}},{key:"LOG",get:function(){return 4}},{key:"INFO",get:function(){return 3}},{key:"WARN",get:function(){return 2}},{key:"ERROR",get:function(){return 1}},{key:"NONE",get:function(){return 0}},{key:"debugOnCallback",value:function(t){var e=t&&t.toUpperCase();return function(t,n){return l.log("********** UPDATE ".concat(e||t.ref().pathString()," **********"),t.toString(),n?"[<<".concat(n,"]"):"")}}},{key:"debugOnCompletionCallback",value:function(t,e){var n=t&&t.toUpperCase();return function(t){return t?l.log("********** REVOKED ".concat(n," **********"),t):l.log("********** COMPLETED ".concat(n," **********")),e}}},{key:"debugOnCallbackWithCancel",value:function(e){var n=e&&e.toUpperCase();return[t.debugOnCallback(e),function(t){return l.log.apply(l,["********** COMPLETE ".concat(n," **********")].concat((0,r.A)(t?["FAILED:",t.code,t.message]:["cancelled"])))}]}}])}();function G(t,e){var n=L(t),r=new S(n,e||n[n.length-1],j,P);return function(t){var e=t.fqdn;N(e,E,t),R.push(t);var n=D(e),r=n.disabledDepth,i=n.enabledDepth;t.setLevel(i>=r?W:x)}(r),r}var W=q.INFO},243:(t,e,n)=>{"use strict";n.d(e,{$k:()=>u,Qg:()=>c,_t:()=>s,q:()=>h,u4:()=>o,yL:()=>a});var r=n(29),i=n(901),o="child_added",a="child_removed",s="child_changed",u="child_ack",c="value",h="value_ack";!function(){function t(e,n,i){var o=i.childName,a=i.prevChildName,s=i.acknowledged;(0,r.A)(this,t),this.type=e,this.snapshotNode=n,this.childName=o,this.prevName=a,this.acknowledged=s}(0,i.A)(t,null,[{key:"Value",value:function(e,n){return new t(n?h:c,e,{acknowledged:e.acknowledged()})}},{key:"ChildChanged",value:function(e,n,r,i){return new t(i?u:s,e,{childName:n,prevChildName:r,acknowledged:e.acknowledged()})}},{key:"ChildRemoved",value:function(e,n,r){return e.isEmpty()?new t(u,e,{childName:n,acknowledged:r}):new t(a,e,{childName:n,acknowledged:r})}},{key:"ChildAdded",value:function(e,n,r){return new t(o,e,{childName:n,prevChildName:r,acknowledged:e.acknowledged()})}}])}()},280:(t,e,n)=>{"use strict";n.d(e,{vG:()=>f,wg:()=>a,yb:()=>h});var r=n(171),i=n(854),o="setTimeout",a=i.y[o];a||(a=r.J[o]),(0,i.aZ)(o,function(){return a},function(t){return a=t}),r.J[o]||(r.J[o]=a),r.J.setImmediate||(r.J.setImmediate=a);var s="clearTimeout",u=i.y[s];u||(u=r.J[s]),(0,i.aZ)(s,function(){return u},function(t){return u=t}),r.J[s]||(r.J[s]=u),r.J.clearImmediate||(r.J.clearImmediate=u);var c="setInterval",h=i.y[c];h||(h=r.J[c]),(0,i.aZ)(c,function(){return h},function(t){return h=t});var l="clearInterval",f=i.y[l];f||(f=r.J[l]),(0,i.aZ)(l,function(){return f},function(t){return f=t})},284:(t,e,n)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}n.d(e,{A:()=>r})},296:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(800);function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||(0,r.A)(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},304:(t,e,n)=>{"use strict";n.d(e,{lQ:()=>r});n(280);var r=Function.prototype},317:(t,e,n)=>{"use strict";n.d(e,{H:()=>v,s:()=>y});var r=n(901),i=n(29),o=n(854),a=n(171),s=(0,r.A)(function t(){(0,i.A)(this,t),this.cache_={}},[{key:"length",get:function(){return Object.keys(this.cache_).length}},{key:"key",value:function(t){var e=Object.keys(this.cache_);return 0<=t&&t<e.length?e[t]:null}},{key:"getItem",value:function(t){return this.cache_.hasOwnProperty(t)?this.cache_[t]:null}},{key:"setItem",value:function(t,e){this.cache_[t]=e}},{key:"removeItem",value:function(t){delete this.cache_[t]}},{key:"clear",value:function(){this.cache_={}}}]),u="localStorage",c=o.y[u];c||(c=a.J[u]||new s),(0,o.aZ)(u,function(){return c},function(t){return c=t});var h="sessionStorage",l=o.y[h];l||(l=a.J[h]||null),(0,o.aZ)(h,function(){return l},function(t){return l=t});var f=n(203);function d(t){return"webcom:"+t}var p=(0,r.A)(function t(e,n){(0,i.A)(this,t);var r=e();if(r){var o=d("sentinel");r.setItem(o,""),r.removeItem(o)}function a(){return e()||(0,f.$8)("JSONStorage","the ".concat(n," implementation could not be found!"))}this.set=function(t,e){if(null===e)a().removeItem(d(t));else{var n=JSON.stringify(e);a().setItem(d(t),"string"==typeof n?n:"null")}},this.get=function(t){var e=a().getItem(d(t));return e&&JSON.parse(e)},this.remove=function(t){a().removeItem(d(t))}}),v=new p(function(){return c},"localStorage"),y=new p(function(){return l},"sessionStorage")},347:(t,e,n)=>{"use strict";function r(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(r=function(){return!!t})()}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function o(t,e,n){if(r())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var a=new(t.bind.apply(t,o));return n&&i(a,n.prototype),a}n.d(e,{Dv:()=>N,HY:()=>D,Jt:()=>I,F6:()=>L,bE:()=>T,yJ:()=>C});var a=n(296),s=n(458),u=n(901),c=n(29),h=n(33),l=n(585),f=n(204),d=n(915),p=n(412),v=n(171),y=n(854),g=n(203);var _="XMLHttpRequest",m=y.y[_];m||(void 0===(m=v.J[_])||function(){if(d.Ls&&"Microsoft Internet Explorer"===window.navigator.appName){var t=window.navigator.userAgent.match(/MSIE (\d+[.\d]*)/);return t&&t.length>1&&parseFloat(t[1])<10}return!1}())&&(0,g.$8)(g.zR,"XMLHttpRequest not found"),(0,y.aZ)(_,function(){return m},function(t){return m=t});var b=(0,f.h)("network.HttpRequest","HttpRequest"),k="application/x-www-form-urlencoded",A="application/json",w="Content-Type",S="PUT",x="PATCH",O="POST",j="DELETE",P="GET",R=(0,u.A)(function t(e,n){(0,c.A)(this,t),this.name=e,this.value=n}),E=(0,u.A)(function t(e,n){(0,c.A)(this,t);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];this.url=(0,h.a6)([n].concat((0,s.A)(i.filter(function(t){return t&&t.length}).map(function(t){return encodeURIComponent(t)}))).join("/"),{c:d.Ov}),this.method=e.toUpperCase(),this.headers={Accept:"application/json, text/plain"}},[{key:"addQueryParameters",value:function(t){return this.url=(0,h.a6)(this.url,t),this}},{key:"addJson",value:function(t){return this.contentType=A,this.data=t,this}},{key:"addForm",value:function(t){return this.contentType=k,this.data=t,this}},{key:"addHeader",value:function(t){return(0,g.ar)(["HttpRequest","#addHeader"],arguments,(0,g.lq)((0,g.gp)(R))),t&&(this.headers[t.name]=t.value),this}},{key:"readResponseHeaders",value:function(){return this.readHeaders=!0,this}},{key:"send",value:function(){var t=this;return new Promise(function(e,n){var r=null;void 0!==t.data&&[O,S,x].indexOf(t.method)>=0&&((r=t.contentType===k?(0,h.Rd)(t.data):t.contentType===A?JSON.stringify(t.data):t.data)?t.headers[w]=t.contentType:delete t.headers[w]),b.log("==> ".concat(t.method," ").concat(t.url)),Object.keys(t.headers).forEach(function(e){return b.log(" > HEADER ".concat(e,": ").concat(t.headers[e]))}),r&&b.log(" > DATA: ".concat(r)),t._open(r,e,function(t){b.log("<== ERROR: ".concat(JSON.stringify(t))),n((0,l.G)(t))})})}},{key:"_open",value:function(t,e,n){var r=this,i=new m,o="RESPONSE_PAYLOAD_ERROR";i.onreadystatechange=function(){if(4===i.readyState){var t=i.responseText,a=i.status;if(a>=500)n({code:o,message:"HTTP status ".concat(a)});else try{var s=t.length?JSON.parse(t):{};if(a>=400)n(s.error||s);else if(a>=200&&a<300||304===a){var u={body:s},c=u.body.error||null;c?n((0,p.Gv)(c)?c:{code:u.body.status,message:c}):(r.readHeaders&&(u.headers=function(t){var e=t.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};return e.forEach(function(t){var e=t.indexOf(": "),r=t.substring(0,e).toLowerCase();n[r]=t.substring(e+2)}),n}(i)),b.log("<== ".concat(JSON.stringify(u))),e(u))}else n({code:o,message:"HTTP status ".concat(a)})}catch(t){n({code:o,message:"invalid response payload, not a Json content type"})}}},i.open(this.method,this.url,!0),Object.entries(this.headers).forEach(function(t){var e=(0,a.A)(t,2),n=e[0],r=e[1];return i.setRequestHeader(n,r)}),i.send(t)}}]);function I(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return o(E,[P,t].concat(n))}function C(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return o(E,[S,t].concat(n))}function T(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return o(E,[O,t].concat(n))}function L(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return o(E,[x,t].concat(n))}function D(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return o(E,[j,t].concat(n))}function N(t){if(t)return new R("Authorization","Bearer ".concat(t))}},364:(t,e,n)=>{"use strict";n.d(e,{hH:()=>U,dO:()=>D,Gj:()=>T,B$:()=>A,e7:()=>b,Rs:()=>j,Rx:()=>C,_y:()=>I,CM:()=>k,Ae:()=>w,bY:()=>x,y1:()=>R});var r=n(458);function i(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function o(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function s(t){i(a,r,o,s,u,"next",t)}function u(t){i(a,r,o,s,u,"throw",t)}s(void 0)})}}var a=n(756),s=n.n(a),u=n(317),c=n(347),h=n(29),l=n(901),f=n(203),d=n(55),p=n(487),v="LongTermSubscription",y=(0,l.A)(function t(e,n,r,i){(0,h.A)(this,t),this.data=e,this.uid=n,this.startDate=r,(0,p.ty)(this,"_db",i)},[{key:"id",get:function(){return this.data.id}},{key:"path",get:function(){return this.data.path}},{key:"kind",get:function(){return this.data.kind}},{key:"context",get:function(){return this.data.context}},{key:"destination",get:function(){return this.data.destination}},{key:"mode",get:function(){return this.data.mode}},{key:"childEventFilter",get:function(){return this.data.childEventFilter}},{key:"expirationDate",get:function(){return new Date(1e3*this.data.expirationTimestampSeconds)}},{key:"cancel",value:function(){var t=[v,"#cancel"];return(0,f.ar)(t,arguments),j.call(this._db,t,this)}},{key:"update",value:function(t){var e=[v,"#update"];return(0,f.ar)(e,arguments,(0,f.gp)(d.A)),R.call(this._db,e,this,t)}}]),g=n(176),_="none",m="subscriptions",b={};function k(t,e){this._auth=t.authentication,this._ltsKey=(0,g.wT)(t,m,e),this._datasyncRoute="".concat(e.baseUrl.href,"/datasync/v2/").concat(t.appId),n(128)._this_init4browsers.call(this)}function A(t){u.H.set(this._ltsKey,t)}function w(t,e,n,r){return S.apply(this,arguments)}function S(){return(S=o(s().mark(function t(e,n,r,i){var o;return s().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=this._auth._getCurrentAuthenticationDetails(e),t.next=1,T.call(this,o,!0,J(n,r,i,b));case 1:return t.abrupt("return",t.sent);case 2:case"end":return t.stop()}},t,this)}))).apply(this,arguments)}function x(t,e,n,r){return O.apply(this,arguments)}function O(){return(O=o(s().mark(function t(e,n,r,i){var o,a;return s().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=this._auth._getCurrentAuthenticationDetails(e),a=d.A.ValueChange,i||a.excludeRevocations(),t.next=1,T.call(this,o,!1,J(n,a,r,b));case 1:return t.abrupt("return",t.sent);case 2:case"end":return t.stop()}},t,this)}))).apply(this,arguments)}function j(t,e){return P.apply(this,arguments)}function P(){return(P=o(s().mark(function t(e,n){var r;return s().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this._auth._getCurrentAuthenticationDetails(e),t.next=1,D.call(this,r,n.id);case 1:return t.abrupt("return",t.sent);case 2:case"end":return t.stop()}},t,this)}))).apply(this,arguments)}function R(t,e,n){return E.apply(this,arguments)}function E(){return(E=o(s().mark(function t(e,n,r){var i;return s().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=this._auth._getCurrentAuthenticationDetails(e),t.next=1,H.call(this,i,n.data,n.startDate,r);case 1:return t.abrupt("return",t.sent);case 2:case"end":return t.stop()}},t,this)}))).apply(this,arguments)}function I(t,e){var n=this,i=[].concat((0,r.A)(t),["#getLongTermSubscriptions"]);(0,f.ar)(i,e);var o=this._auth._getCurrentAuthenticationDetails(i);return F.call(this).filter(function(t){return t.uid===o.uid}).map(function(t){return new y(t.data,t.uid,t.startDate,n)})}function C(t,e){var n=[].concat((0,r.A)(t),["#cleanLongTermSubscriptions"]);(0,f.ar)(n,e);var i=this._auth._getCurrentAuthenticationDetails(n),o=F.call(this).filter(function(t){return t.uid!==i.uid});this._saveLts(o)}function T(t,e,n,r){return L.apply(this,arguments)}function L(){return(L=o(s().mark(function t(e,n,r,i){var o,a,u,h;return s().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!((o=F.call(this).find(function(t){return t.uid===e.uid&&t.data.path===r.path&&t.data.kind===r.kind&&t.data.context===r.context&&t.data.destination===r.destination}))&&n&&Y(o.data,o.startDate,r))){t.next=1;break}return t.abrupt("return",new y(o.data,o.uid,o.startDate,this));case 1:return t.next=2,(0,c.bE)("".concat(this._datasyncRoute,"/subscriptions"),e.uid).addHeader((0,c.Dv)(e.webcomAuthToken)).addQueryParameters(n?{allowsUpdate:!0}:{delete:!0}).addJson(r).send();case 2:return a=t.sent,u=F.call(this).filter(function(t){return t.data.id!==(o&&o.data.id)}),n&&(h=new y(a.body,e.uid,i||Math.floor(Date.now()/1e3),this),u.push(Object.assign({},h))),this._saveLts(u),t.abrupt("return",h);case 3:case"end":return t.stop()}},t,this)}))).apply(this,arguments)}function D(t,e,n){return N.apply(this,arguments)}function N(){return(N=o(s().mark(function t(e,n,r){var i;return s().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,(0,c.HY)("".concat(this._datasyncRoute,"/subscriptions"),e.uid,n).addHeader((0,c.Dv)(e.webcomAuthToken)).send();case 1:r||(i=F.call(this).filter(function(t){return t.data.id!==n}),this._saveLts(i));case 2:case"end":return t.stop()}},t,this)}))).apply(this,arguments)}function H(t,e,n,r){return M.apply(this,arguments)}function M(){return(M=o(s().mark(function t(e,n,r,i){var o,a,u;return s().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,(0,c.yJ)("".concat(this._datasyncRoute,"/subscriptions"),e.uid,n.id).addHeader((0,c.Dv)(e.webcomAuthToken)).addJson(U(n,i)).send();case 1:return o=t.sent,a=new y(o.body,e.uid,r,this),u=F.call(this).filter(function(t){return t.data.id!==o.body.id}),u.push(Object.assign({},a)),this._saveLts(u),t.abrupt("return",a);case 2:case"end":return t.stop()}},t,this)}))).apply(this,arguments)}function F(){return u.H.get(this._ltsKey)||[]}function J(t,e,n,r){var i={context:r&&r[n.kind]||n.context};return Object.assign({path:t.toString()},n,e,i)}function U(t,e){return Object.assign({},t,t.encryption?{encryption:{alg:t.encryption.alg}}:{},e)}function Y(t,e,n){var r,i;if(t.receivesRevocations!==n.receivesRevocations||t.mode!==n.mode)return!1;if("childEvent"===t.mode){var o=t.childEventFilter,a=n.childEventFilter;if(o.added!==a.added||o.removed!==a.removed||o.changed!==a.changed)return!1}if(((null===(r=t.encryption)||void 0===r?void 0:r.alg)||_)!==((null===(i=n.encryption)||void 0===i?void 0:i.alg)||_))return!1;var s=t.expirationTimestampSeconds;return(Math.floor(Date.now()/1e3)-e)/(s-e)<.5}},373:t=>{t.exports=function(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function t(){for(;n.length;)if((r=n.pop())in e)return t.value=r,t.done=!1,t;return t.done=!0,t}},t.exports.__esModule=!0,t.exports.default=t.exports},412:(t,e,n)=>{"use strict";n.d(e,{Et:()=>s,Gv:()=>c,Kg:()=>a,Lm:()=>o,Tn:()=>u,yi:()=>h});var r=n(284),i=n(915);function o(t){return"boolean"==typeof t}function a(t){return"string"==typeof t}function s(t){return"number"==typeof t}function u(t){return"function"==typeof t}function c(t){return"object"===(0,r.A)(t)}function h(){return i.Ls&&(window.navigator.userAgent.match(/CriOS|Twitter for iPhone|FBAN\/FBIOS|Windows Phone/)||window.navigator.standalone)}},458:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(145);var i=n(800);function o(t){return function(t){if(Array.isArray(t))return(0,r.A)(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||(0,i.A)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},487:(t,e,n)=>{"use strict";function r(t,e,n,r){return o(t.prototype,e,n,r)}function i(t,e,n,r){return a(t.prototype,e,n,r)}function o(t,e,n,r){return s(t,e,{value:n},r)}function a(t,e,n,r){return s(t,e,{get:n},r)}function s(t,e,n,r){return Object.defineProperty(t,e,Object.assign(n,{enumerable:r,configurable:!0}))}n.d(e,{gB:()=>a,nA:()=>i,os:()=>r,ty:()=>o})},546:t=>{function e(n,r,i,o){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}t.exports=e=function(t,n,r,i){function o(n,r){e(t,n,function(t){return this._invoke(n,r,t)})}n?a?a(t,n,{value:r,enumerable:!i,configurable:!i,writable:!i}):t[n]=r:(o("next",0),o("throw",1),o("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,r,i,o)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},579:(t,e,n)=>{var r=n(738).default;t.exports=function(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(r(t)+" is not iterable")},t.exports.__esModule=!0,t.exports.default=t.exports},585:(t,e,n)=>{"use strict";function r(t){var e=t.code||"UNKNOWN_ERROR",n=t.message||JSON.stringify(t),r=new Error("".concat(e,"[").concat(n,"]"));return r.code=e,r}n.d(e,{G:()=>r})},633:(t,e,n)=>{var r=n(172),i=n(993),o=n(869),a=n(887),s=n(791),u=n(373),c=n(579);function h(){"use strict";var e=i(),n=e.m(h),l=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function f(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))}var d={throw:1,return:2,break:3,continue:3};function p(t){var e,n;return function(r){e||(e={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(t,e){return n(r.a,d[t],e)},delegateYield:function(t,i,o){return e.resultName=i,n(r.d,c(t),o)},finish:function(t){return n(r.f,t)}},n=function(t,n,i){r.p=e.prev,r.n=e.next;try{return t(n,i)}finally{e.next=r.n}}),e.resultName&&(e[e.resultName]=r.v,e.resultName=void 0),e.sent=r.v,e.next=r.n;try{return t.call(this,e)}finally{r.p=e.prev,r.n=e.next}}}return(t.exports=h=function(){return{wrap:function(t,n,r,i){return e.w(p(t),n,r,i&&i.reverse())},isGeneratorFunction:f,mark:e.m,awrap:function(t,e){return new r(t,e)},AsyncIterator:s,async:function(t,e,n,r,i){return(f(e)?a:o)(p(t),e,n,r,i)},keys:u,values:c}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=h,t.exports.__esModule=!0,t.exports.default=t.exports},738:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},756:(t,e,n)=>{var r=n(633)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},779:(t,e)=>{"use strict";var n,r={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(t){this.toString=function(){return"CORRUPT: "+this.message},this.message=t},invalid:function(t){this.toString=function(){return"INVALID: "+this.message},this.message=t},bug:function(t){this.toString=function(){return"BUG: "+this.message},this.message=t},notReady:function(t){this.toString=function(){return"NOT READY: "+this.message},this.message=t}}};r.bitArray={bitSlice:function(t,e,n){return t=r.bitArray._shiftRight(t.slice(e/32),32-(31&e)).slice(1),void 0===n?t:r.bitArray.clamp(t,n-e)},extract:function(t,e,n){var r=Math.floor(-e-n&31);return(-32&(e+n-1^e)?t[e/32|0]<<32-r^t[e/32+1|0]>>>r:t[e/32|0]>>>r)&(1<<n)-1},concat:function(t,e){if(0===t.length||0===e.length)return t.concat(e);var n=t[t.length-1],i=r.bitArray.getPartial(n);return 32===i?t.concat(e):r.bitArray._shiftRight(e,i,0|n,t.slice(0,t.length-1))},bitLength:function(t){var e,n=t.length;return 0===n?0:(e=t[n-1],32*(n-1)+r.bitArray.getPartial(e))},clamp:function(t,e){if(32*t.length<e)return t;var n=(t=t.slice(0,Math.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=r.bitArray.partial(e,t[n-1]&2147483648>>e-1,1)),t},partial:function(t,e,n){return 32===t?e:(n?0|e:e<<32-t)+1099511627776*t},getPartial:function(t){return Math.round(t/1099511627776)||32},equal:function(t,e){if(r.bitArray.bitLength(t)!==r.bitArray.bitLength(e))return!1;var n,i=0;for(n=0;n<t.length;n++)i|=t[n]^e[n];return 0===i},_shiftRight:function(t,e,n,i){var o,a,s;for(void 0===i&&(i=[]);e>=32;e-=32)i.push(n),n=0;if(0===e)return i.concat(t);for(o=0;o<t.length;o++)i.push(n|t[o]>>>e),n=t[o]<<32-e;return a=t.length?t[t.length-1]:0,s=r.bitArray.getPartial(a),i.push(r.bitArray.partial(e+s&31,e+s>32?n:i.pop(),1)),i},_xor4:function(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]},byteswapM:function(t){var e,n;for(e=0;e<t.length;++e)n=t[e],t[e]=n>>>24|n>>>8&65280|(65280&n)<<8|n<<24;return t}},r.codec.utf8String={fromBits:function(t){var e,n,i="",o=r.bitArray.bitLength(t);for(e=0;e<o/8;e++)3&e||(n=t[e/4]),i+=String.fromCharCode(n>>>8>>>8>>>8),n<<=8;return decodeURIComponent(escape(i))},toBits:function(t){t=unescape(encodeURIComponent(t));var e,n=[],i=0;for(e=0;e<t.length;e++)i=i<<8|t.charCodeAt(e),3&~e||(n.push(i),i=0);return 3&e&&n.push(r.bitArray.partial(8*(3&e),i)),n}},r.codec.base64={_chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(t,e,n){var i,o="",a=0,s=r.codec.base64._chars,u=0,c=r.bitArray.bitLength(t);for(n&&(s=s.substr(0,62)+"-_"),i=0;6*o.length<c;)o+=s.charAt((u^t[i]>>>a)>>>26),a<6?(u=t[i]<<6-a,a+=26,i++):(u<<=6,a-=6);for(;3&o.length&&!e;)o+="=";return o},toBits:function(t,e){t=t.replace(/\s|=/g,"");var n,i,o=[],a=0,s=r.codec.base64._chars,u=0;for(e&&(s=s.substr(0,62)+"-_"),n=0;n<t.length;n++){if((i=s.indexOf(t.charAt(n)))<0)throw new r.exception.invalid("this isn't base64!");a>26?(a-=26,o.push(u^i>>>a),u=i<<32-a):u^=i<<32-(a+=6)}return 56&a&&o.push(r.bitArray.partial(56&a,u,1)),o}},r.codec.base64url={fromBits:function(t){return r.codec.base64.fromBits(t,1,1)},toBits:function(t){return r.codec.base64.toBits(t,1)}},r.hash.sha256=function(t){this._key[0]||this._precompute(),t?(this._h=t._h.slice(0),this._buffer=t._buffer.slice(0),this._length=t._length):this.reset()},r.hash.sha256.hash=function(t){return(new r.hash.sha256).update(t).finalize()},r.hash.sha256.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(t){"string"==typeof t&&(t=r.codec.utf8String.toBits(t));var e,n=this._buffer=r.bitArray.concat(this._buffer,t),i=this._length,o=this._length=i+r.bitArray.bitLength(t);if(o>9007199254740991)throw new r.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var a=new Uint32Array(n),s=0;for(e=512+i-(512+i&511);e<=o;e+=512)this._block(a.subarray(16*s,16*(s+1))),s+=1;n.splice(0,16*s)}else for(e=512+i-(512+i&511);e<=o;e+=512)this._block(n.splice(0,16));return this},finalize:function(){var t,e=this._buffer,n=this._h;for(t=(e=r.bitArray.concat(e,[r.bitArray.partial(1,1)])).length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this._length/4294967296)),e.push(0|this._length);e.length;)this._block(e.splice(0,16));return this.reset(),n},_init:[],_key:[],_precompute:function(){var t,e,n=0,r=2;function i(t){return 4294967296*(t-Math.floor(t))|0}for(;n<64;r++){for(e=!0,t=2;t*t<=r;t++)if(r%t===0){e=!1;break}e&&(n<8&&(this._init[n]=i(Math.pow(r,.5))),this._key[n]=i(Math.pow(r,1/3)),n++)}},_block:function(t){var e,n,r,i,o=this._h,a=this._key,s=o[0],u=o[1],c=o[2],h=o[3],l=o[4],f=o[5],d=o[6],p=o[7];for(e=0;e<64;e++)e<16?n=t[e]:(r=t[e+1&15],i=t[e+14&15],n=t[15&e]=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(i>>>17^i>>>19^i>>>10^i<<15^i<<13)+t[15&e]+t[e+9&15]|0),n=n+p+(l>>>6^l>>>11^l>>>25^l<<26^l<<21^l<<7)+(d^l&(f^d))+a[e],p=d,d=f,f=l,l=h+n|0,h=c,c=u,s=n+((u=s)&c^h&(u^c))+(u>>>2^u>>>13^u>>>22^u<<30^u<<19^u<<10)|0;o[0]=o[0]+s|0,o[1]=o[1]+u|0,o[2]=o[2]+c|0,o[3]=o[3]+h|0,o[4]=o[4]+l|0,o[5]=o[5]+f|0,o[6]=o[6]+d|0,o[7]=o[7]+p|0}},r.hash.sha1=function(t){t?(this._h=t._h.slice(0),this._buffer=t._buffer.slice(0),this._length=t._length):this.reset()},r.hash.sha1.hash=function(t){return(new r.hash.sha1).update(t).finalize()},r.hash.sha1.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(t){"string"==typeof t&&(t=r.codec.utf8String.toBits(t));var e,n=this._buffer=r.bitArray.concat(this._buffer,t),i=this._length,o=this._length=i+r.bitArray.bitLength(t);if(o>9007199254740991)throw new r.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var a=new Uint32Array(n),s=0;for(e=this.blockSize+i-(this.blockSize+i&this.blockSize-1);e<=o;e+=this.blockSize)this._block(a.subarray(16*s,16*(s+1))),s+=1;n.splice(0,16*s)}else for(e=this.blockSize+i-(this.blockSize+i&this.blockSize-1);e<=o;e+=this.blockSize)this._block(n.splice(0,16));return this},finalize:function(){var t,e=this._buffer,n=this._h;for(t=(e=r.bitArray.concat(e,[r.bitArray.partial(1,1)])).length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this._length/4294967296)),e.push(0|this._length);e.length;)this._block(e.splice(0,16));return this.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(t,e,n,r){return t<=19?e&n|~e&r:t<=39?e^n^r:t<=59?e&n|e&r|n&r:t<=79?e^n^r:void 0},_S:function(t,e){return e<<t|e>>>32-t},_block:function(t){var e,n,r,i,o,a,s,u,c=this._h;if("undefined"!=typeof Uint32Array){u=Array(80);for(var h=0;h<16;h++)u[h]=t[h]}else u=t;for(r=c[0],i=c[1],o=c[2],a=c[3],s=c[4],e=0;e<=79;e++)e>=16&&(u[e]=this._S(1,u[e-3]^u[e-8]^u[e-14]^u[e-16])),n=this._S(5,r)+this._f(e,i,o,a)+s+u[e]+this._key[Math.floor(e/20)]|0,s=a,a=o,o=this._S(30,i),i=r,r=n;c[0]=c[0]+r|0,c[1]=c[1]+i|0,c[2]=c[2]+o|0,c[3]=c[3]+a|0,c[4]=c[4]+s|0}},t.exports&&(t.exports=r),void 0===(n=function(){return r}.apply(e,[]))||(t.exports=n)},791:(t,e,n)=>{var r=n(172),i=n(546);t.exports=function t(e,n){function o(t,i,a,s){try{var u=e[t](i),c=u.value;return c instanceof r?n.resolve(c.v).then(function(t){o("next",t,a,s)},function(t){o("throw",t,a,s)}):n.resolve(c).then(function(t){u.value=t,a(u)},function(t){return o("throw",t,a,s)})}catch(t){s(t)}}var a;this.next||(i(t.prototype),i(t.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),i(this,"_invoke",function(t,e,r){function i(){return new n(function(e,n){o(t,r,e,n)})}return a=a?a.then(i,i):i()},!0)},t.exports.__esModule=!0,t.exports.default=t.exports},800:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(145);function i(t,e){if(t){if("string"==typeof t)return(0,r.A)(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.A)(t,e):void 0}}},816:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(284);function i(t){var e=function(t,e){if("object"!=(0,r.A)(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=(0,r.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==(0,r.A)(e)?e:e+""}},854:(t,e,n)=>{"use strict";n.d(e,{El:()=>i,aZ:()=>o,y:()=>r});var r=n(171).J.WebcomDependencies||{},i={};function o(t,e,n){Object.defineProperty(i,t,{enumerable:!0,get:e,set:n})}},869:(t,e,n)=>{var r=n(887);t.exports=function(t,e,n,i,o){var a=r(t,e,n,i,o);return a.next().then(function(t){return t.done?t.value:a.next()})},t.exports.__esModule=!0,t.exports.default=t.exports},887:(t,e,n)=>{var r=n(993),i=n(791);t.exports=function(t,e,n,o,a){return new i(r().w(t,e,n,o),a||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports},901:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(816);function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(0,r.A)(i.key),i)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}},915:(t,e,n)=>{"use strict";n.d(e,{Ls:()=>l,Ov:()=>h});var r=n(171),i=n(854),o="browser",a="mobile/",s="".concat(a,"android"),u="".concat(a,"iOS"),c={};c[o]="b",c[s]="a",c[u]="i",c.node="n";var h,l=!0,f="device",d=i.y[f];if(!d){var p=r.J.window;p&&p.location?p.location.href.indexOf("webview.datasync.orange.com")<0?v(o):v(s):v(u)}function v(t){d=t,l=t===o,0===t.indexOf(a),h=(c[t]||"")+"3.10.1"}(0,i.aZ)(f,function(){return d},function(t){return v(t)})},993:(t,e,n)=>{var r=n(546);function i(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e,n,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.toStringTag||"@@toStringTag";function u(t,i,o,a){var s=i&&i.prototype instanceof h?i:h,u=Object.create(s.prototype);return r(u,"_invoke",function(t,r,i){var o,a,s,u=0,h=i||[],l=!1,f={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return o=t,a=0,s=e,f.n=n,c}};function d(t,r){for(a=t,s=r,n=0;!l&&u&&!i&&n<h.length;n++){var i,o=h[n],d=f.p,p=o[2];t>3?(i=p===r)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=d&&((i=t<2&&d<o[1])?(a=0,f.v=r,f.n=o[1]):d<p&&(i=t<3||o[0]>r||r>p)&&(o[4]=t,o[5]=r,f.n=p,a=0))}if(i||t>1)return c;throw l=!0,r}return function(i,h,p){if(u>1)throw TypeError("Generator is already running");for(l&&1===h&&d(h,p),a=h,s=p;(n=a<2?e:s)||!l;){o||(a?a<3?(a>1&&(f.n=-1),d(a,s)):f.n=s:f.v=s);try{if(u=2,o){if(a||(i="next"),n=o[i]){if(!(n=n.call(o,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,a<2&&(a=0)}else 1===a&&(n=o.return)&&n.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((n=(l=f.n<0)?s:t.call(r,f))!==c)break}catch(t){o=e,a=1,s=t}finally{u=1}}return{value:n,done:l}}}(t,o,a),!0),u}var c={};function h(){}function l(){}function f(){}n=Object.getPrototypeOf;var d=[][a]?n(n([][a]())):(r(n={},a,function(){return this}),n),p=f.prototype=h.prototype=Object.create(d);function v(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,r(t,s,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=f,r(p,"constructor",f),r(f,"constructor",l),l.displayName="GeneratorFunction",r(f,s,"GeneratorFunction"),r(p),r(p,s,"Generator"),r(p,a,function(){return this}),r(p,"toString",function(){return"[object Generator]"}),(t.exports=i=function(){return{w:u,m:v}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.d(r,{default:()=>l});var t=n(171),e=n(29),i=n(901),o=n(176),a=n(204),s=n(854),u=n(203),c="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";var h="Webcom",l=(0,i.A)(function t(){(0,e.A)(this,t),this._init.apply(this,arguments)},[{key:"_init",value:function(){(0,u.$8)(["new ",h],"this static class cannot be instantiated")}}],[{key:"SDK_VERSION",get:function(){return"3.10.1"}},{key:"Log",get:function(){return a.Ay}},{key:"App",value:function(t,e){return new o.Ay(t,e)}},{key:"getUniqueKeyDate",value:function(t){return new Date(function(t){for(var e=t.substring(0,8),n=0,r=0;r<8;++r)n=64*n+c.indexOf(e[r]);return n}(t))}},{key:"dependencies",get:function(){return s.El}}]),f=(0,a.h)("api.Webcom",h),d=n(458),p=n(296),v=n(915);function y(t){"http:"===t.protocol&&v.Ls&&"https:"===window.location.protocol&&this._logger.warn("Insecure access to a Webcom service from a secure page. Please setup your service with an https protocol.")}var g=new RegExp("^(?:([^:]+:)//)?(?:[^/@]+@)?([^/:]+(?::\\d+)?)(?:/.*)?$"),_="io.datasync.orange.com";function m(e){if(e&&(t.J.URL&&e instanceof URL||e.href&&e.protocol&&e.host))return e;var n=e?g.exec(e):[_,void 0,_];if(n){var r=(0,p.A)(n,3),i=r[0],o=r[1],a=r[2];return o||(i="".concat(o="https:","//").concat(i)),{href:i,protocol:o,host:a}}throw new Error("cannot parse base URL: ".concat(e))}function b(t,e){return function(n){var r=t(n);if(r)throw new Error(r);return e?e(n):n}}var k=n(487),A="some",w="required",S="none",x=(0,i.A)(function t(n,r){(0,e.A)(this,t),(0,u.vA)(n===A||n===w||n===S,"Wrong state value for a new State object: expecting 'some', 'required' or 'none'."),this.state=n,(0,u.vA)(n!==A||r&&r.webcomAuthToken,"Missing details or webcomAuthToken for a new 'some' State"),this.details=r},[{key:"isUnauthenticated",value:function(){return this.state===S}},{key:"isAuthenticated",value:function(){return this.state===A}},{key:"isRequired",value:function(){return this.state===w}},{key:"isSameAs",value:function(t){return this.state===t.state&&(this.state!==A||this.details.webcomAuthToken===t.details.webcomAuthToken)}}]),O=new x(S),j=(new x(w),function(t){return new x(A,t)});var P,R="Authentication";function E(t){switch((0,u.ar)([h,".avatarURL"],arguments,u.Ik),t&&t.provider){case"facebook":return"https://graph.facebook.com/".concat(t.providerUid,"/picture?type=large");case"github":return t.providerProfile.avatar_url;cas