webcom
Version:
Webcom library
20 lines • 262 kB
JavaScript
/*!
* Webcom. Build realtime apps. Share and sync data instantly between your clients
*
* Module name: Webcom
* Version: 3.10.1
* Created: 2025-11-07T12:56:22.553Z
*
* 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 i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(this,()=>(()=>{var t={29:(t,e,n)=>{"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,{A:()=>i})},33:(t,e,n)=>{"use strict";n.d(e,{$f:()=>c,Rd:()=>h,a6:()=>d,e8:()=>v,kj:()=>f,l8:()=>l,sc:()=>p,wd:()=>u});var i=n(296),r=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 l(t){var e={};return t.replace(/^[^?]*\?/,"").split("&").forEach(function(t){var n=t.indexOf("=");if(n<0)e[u(t)]=!0;else{var i=u(t.substring(0,n));e[i]=u(t.substring(n+1))}}),e}function h(t){if(!t)return"";var e=[];return Object.entries(t).forEach(function(t){var n=(0,i.A)(t,2),r=n[0],o=n[1];null!=o&&((0,s.Gv)(o)&&(o=JSON.stringify(o)),e.push(encodeURIComponent(r)+"="+encodeURIComponent(o)))}),e.join("&")}function d(t,e){var n=t.indexOf("?"),i=e?(n<0?"?":"&")+h(e):"",r=t.indexOf("#");return r<0?t+i:t.substring(0,r)+i+t.substring(r)}function f(t){for(var e,n,i=[],o=0,a=0;a<t.length;a++)(e=t.charCodeAt(a))>=55296&&e<=56319&&(n=e-55296,a++,(0,r.vA)(a<t.length,"Surrogate pair missing trail surrogate."),e=65536+(n<<10)+(t.charCodeAt(a)-56320)),e<128?i[o++]=e:e<2048?(i[o++]=e>>6|192,i[o++]=63&e|128):e<65536?(i[o++]=e>>12|224,i[o++]=e>>6&63|128,i[o++]=63&e|128):(i[o++]=e>>18|240,i[o++]=e>>12&63|128,i[o++]=e>>6&63|128,i[o++]=63&e|128);return i}function v(t,e){return a().codec.base64.fromBits(a().hash.sha1.hash(t),!1,e)}function p(t,e){return a().codec.base64.fromBits(a().hash.sha256.hash(t),!1,e)}},128:(t,e,n)=>{"use strict";n.r(e),n.d(e,{_this_init4browsers:()=>u,_this_listenLts:()=>h,_this_setLtsContext:()=>f,_this_unlistenLts:()=>d});var i=n(458),r=n(296),o=n(317),a=n(203),s=n(801);function u(){var t=this;this._ltsListeners=[],this._saveLts=l,this._auth.subscribe(function(e,n){e||n.isRequired()||(t._ltsAuth&&t._ltsAuth.isAuthenticated()&&v.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,p.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 l(t){var e=c.call(this,t);this._ltsListeners.forEach(function(t){return t(e)}),e.forEach(function(t){var e=(0,r.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 h(t,e,n){(0,a.ar)([].concat((0,i.A)(e),["#_listenLts"]),n,a.Pc),this._ltsListeners.push(t),t(c.call(this,o.H.get(this._ltsKey)))}function d(t,e,n){(0,a.ar)([].concat((0,i.A)(e),["#_unlistenLts"]),n,a.Pc),this._ltsListeners=this._ltsListeners.filter(function(e){return e!==t})}function f(t,e,n,r){(0,a.ar)([].concat((0,i.A)(n),["#_setLtsContext"]),r,a.Yj,a.Yj),s.e7[t]=e,p.call(this)}function v(t){var e=o.H.get(this._ltsKey);if(e){var n,i=null===(n=this._ltsAuth)||void 0===n?void 0:n.details,r=[];e.forEach(function(e){Date.now()<1e3*e.data.expirationTimestampSeconds&&t(e,i)&&r.push(e)}),this._saveLts(r)}}function p(){var t=this;v.call(this,function(e,n){if(n&&e.startDate&&e.uid===n.uid){var i=e.data,r=s.e7[i.kind];if(r&&r!==i.context)return t._logger.log("Refresh the context of the long term subscription #%s: %s --\x3e %s",i.id,i.context,r),s.dO.call(t,n,i.id,!0).then(function(){return delete i.id,s.Gj.call(t,n,!0,(0,s.hH)(i,{context:r}),e.startDate)}).catch(function(e){return t._logger.error("Failed to refresh the long term subscription #%s: %s",i.id,e.message)}),!1}return!0})}},133:(t,e,n)=>{"use strict";n.d(e,{Ay:()=>O,MX:()=>h,d1:()=>E,h:()=>N});var i=n(458),r=n(29),o=n(901),a=n(296),s=n(224),u=n(170),c=n(203),l=-1,h=" ",d=!1,f=15,v=[],p={},g={},y={},m="_leaf_";function _(t){return t?t.split("."):[]}function k(t){return{disabledDepth:A(t,y),enabledDepth:A(t,g)}}function b(t,e,n,i){for(var r=0;r<t.length;){var o=t[r++];e.hasOwnProperty(o)||(e[o]={}),e=e[o]}i&&Object.keys(e).forEach(function(t){return delete e[t]}),e[m]=n}function w(t,e){for(var n=0;n<t.length;){var i=t[n++];if(!e.hasOwnProperty(i))return;e=e[i]}delete e[m]}function A(t,e){var n=-1,i=0;do{e.hasOwnProperty(m)&&(n=i)}while(i<t.length&&(e=e[t[i++]]));return n}function C(t,e){Object.entries(t||{}).forEach(function(t){var n=(0,a.A)(t,2),i=n[0],r=n[1];i===m?e(r):C(r,e)})}function D(t,e){for(var n=[],i=0;e&&i<t.length;)e=e[t[i++]];return C(e,function(t){return n.push(t)}),n}function S(t){d=t,v.forEach(function(t){return t.displayTimestamp=d})}var E="LogManager",O=function(){function t(){(0,r.A)(this,t)}return(0,o.A)(t,null,[{key:"enable",value:function(e){(0,c.ar)([E,".enable"],arguments,(0,c.lq)(c.Yj));var n=_(e),i=k(n),r=i.enabledDepth,o=i.disabledDepth;r<=o&&(o<0&&t.disable(),b(n,g,!0,!0),w(n,y),D(n,p).forEach(function(t){return t.setLevel(R)}))}},{key:"disable",value:function(t){(0,c.ar)([E,".disable"],arguments,(0,c.lq)(c.Yj));var e=_(t),n=k(e),i=n.enabledDepth;n.disabledDepth<=i&&(b(e,y,!0,!0),w(e,g),D(e,p).forEach(function(t){return t.setLevel(l)}))}},{key:"showTimestamp",value:function(){(0,c.ar)([E,".showTimestamp"],arguments),S(!0)}},{key:"hideTimestamp",value:function(){(0,c.ar)([E,".hideTimestamp"],arguments),S(!1)}},{key:"setPrefixWidth",value:function(t){(0,c.ar)([E,".setPrefixWidth"],arguments,c.vM),t<0?t=0:t>h.length&&(t=h.length),f=t,v.forEach(function(t){return t.setPrefixWidth(f)})}},{key:"level",get:function(){return R},set:function(t){(0,c.ar)([E,".level"],arguments,c.vM),t>l&&t!==R&&(v.forEach(function(e){return e.updateLevel(t)}),R=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 u.k.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?u.k.log("********** REVOKED ".concat(n," **********"),t):u.k.log("********** COMPLETED ".concat(n," **********")),e}}},{key:"debugOnCallbackWithCancel",value:function(e){var n=e&&e.toUpperCase();return[t.debugOnCallback(e),function(t){return u.k.log.apply(u.k,["********** COMPLETE ".concat(n," **********")].concat((0,i.A)(t?["FAILED:",t.code,t.message]:["cancelled"])))}]}}])}();function N(t,e){var n=_(t),i=new s.A(n,e||n[n.length-1],d,f);return function(t){var e=t.fqdn;b(e,p,t),v.push(t);var n=k(e),i=n.disabledDepth,r=n.enabledDepth;t.setLevel(r>=i?R:l)}(i),i}var R=O.INFO},145:(t,e,n)=>{"use strict";function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}n.d(e,{A:()=>i})},170:(t,e,n)=>{"use strict";n.d(e,{a:()=>c,k:()=>u});var i=n(458),r=n(171),o=n(854),a=n(412),s="console",u=o.y[s],c=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=function(t){return(0,a.Gv)(t)?JSON.stringify(t):(t||"undefined").toString()};if((0,a.Kg)(t)){var s=0;return[t=t.replace(/%(.)/g,function(t,e){switch(e){case"%":return"%";case"s":case"o":case"O":return o(n[s++]);case"d":case"i":case"f":return n[s++];default:return t}})].concat((0,i.A)(n.slice(s).map(o))).join(" ")}return[t].concat(n).map(o).join(" ")};function l(t,e,n,i,r){if(!n||!i||!r){var o=e,a=function(t){return function(e){return o("[".concat(t,"] ").concat(e))}};n=n||a("INFO"),i=i||a("WARN"),r=r||a("ERR!"),e=a("LOG ")}return{log:function(){return e.call(t,c.apply(void 0,arguments))},info:function(){return n.call(t,c.apply(void 0,arguments))},warn:function(){return i.call(t,c.apply(void 0,arguments))},error:function(){return r.call(t,c.apply(void 0,arguments))}}}if((0,a.Tn)(u))u=l(r.J,u);else if((0,a.Gv)(u)&&u){var h=u,d=h.log,f=h.info,v=h.warn,p=h.error;u=l(u,d,f,v,p)}else{u=l(r.J[s],r.J[s].log,r.J[s].info,r.J[s].warn,r.J[s].error)}(0,o.aZ)(s,function(){return u},function(t){return u=t})},171:(t,e,n)=>{"use strict";n.d(e,{J:()=>i});var i=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:()=>l,RU:()=>d,w8:()=>v,wT:()=>f});var i=n(296),r=n(29),o=n(901),a=n(203),s=n(133),u=n(412),c="WebcomApp",l=(0,o.A)(function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,r.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(v).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){h.call(this,t,v)}},{key:"toString",value:function(){return"".concat(this.appId,"{").concat(Object.keys(this._services).join(","),"}")}}]);function h(t,e){var n=this,r=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,i.A)(o,2),l=c[0],h=c[1];if(h instanceof Object&&!(h instanceof Array))t[l]=t[l]||{},r(t[l],e[l]||{},h,s.concat(l));else{var d=e[l],f=h[1]||function(t){return t};try{t[l]=f(void 0===d?void 0===t[l]?h.length?h[0]:h:t[l]:d)}catch(e){var v=u(l);void 0===e.value?(0,a.$8)(v,e.message):(n._logger.warn("%s: %s",v,e.message),t[l]=e.value)}}delete e[l]}),Object.keys(e).forEach(function(t){return n._logger.warn("%s: unknown config key",u(t))})};r(this.config,t,e,[])}function d(t,e){var n=e.baseUrl;return"/".concat(n.protocol.slice(0,-1),"/").concat(n.host,"/").concat(t.appId,"/")}function f(t,e,n){return"".concat(n.key,":").concat(e,":").concat(d(t,n))}var v={}},203:(t,e,n)=>{"use strict";n.d(e,{$8:()=>d,$x:()=>v,Ik:()=>D,Pc:()=>w,Tq:()=>T,WP:()=>E,YD:()=>l,Yj:()=>b,ar:()=>f,b0:()=>s,cK:()=>x,gP:()=>S,gp:()=>m,lq:()=>p,nd:()=>P,se:()=>h,vA:()=>u,vD:()=>k,vM:()=>C,y:()=>y,yL:()=>O,zB:()=>g,zM:()=>A,zR:()=>a});var i=n(284),r=n(458),o=n(412),a="Webcom internal error";function s(){d(a,"not (yet) implemented abstract member!")}function u(t,e){t||d(a,e)}var c={values:[]};function l(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];Object.assign(c,{method:t,args:e||[],checkers:i})}function h(t,e,n){c.values.push({name:t,value:e,checker:n})}var d=function(t,e){var n;throw new Error("".concat((n="").concat.apply(n,(0,r.A)(t)),": ").concat(e))};function f(t,e){if(!c.method){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];l.apply(void 0,[t,e].concat(i))}var o=c.method,a=c.args,s=c.checkers,u=c.values;Object.assign(c,{method:void 0,args:void 0,checkers:void 0,values:[]}),a.length>s.length&&d(o,"too many arguments, ".concat(a.length," instead of ").concat(s.length)),s.forEach(function(t,e){return v(t,a[e],o,function(t){return"argument #".concat(e+1," ").concat(t)})}),u.forEach(function(t){var e=t.name,n=t.value;return v(t.checker,n,o,function(t){return"".concat(e," ").concat(t)})})}function v(t,e,n,i){var r=t(e);r&&d(n,i(r))}function p(t){return function(e){return _("undefined")(e)&&t&&t(e)}}function g(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 m(t){return function(e){return!(e instanceof t)&&"must be an instance of ".concat(t.name)}}function _(t){return function(e){return(0,i.A)(e)!==t&&"must be a ".concat(t)}}var k=_("undefined"),b=_("string"),w=_("function"),A=_("boolean"),C=R(Number.isFinite,"must be a finite number"),D=_("object");function S(){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 E(){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}}function O(){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})&&"must be either ".concat(e.join(" or "))}}var N="is not valid";function R(t,e){return function(n){return!t(n)&&(e||N)}}var P=R(function(t){return(0,o.Et)(t)&&Math.floor(t)===t},"must be an integer");function T(t,e){return R(function(n){return n>=t&&n<(void 0===e?1/0:e)},"must be between ".concat(t," and ").concat(e))}function x(t,e){return R(function(e){return t.test(e)},e)}},224:(t,e,n)=>{"use strict";n.d(e,{A:()=>p,h:()=>v});var i=n(29),r=n(901),o=n(458),a=n(133),s=n(170),u=n(412),c=n(203),l=n(304),h={};function d(t,e){var n=t.length;return n>=e?t.substring(0,e):t+a.MX.substring(0,e-n)}function f(t){return t.map(function(t){return(0,u.Tn)(t)?t():t})}function v(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];(0,c.$8)(c.zR,s.a.apply(void 0,(0,o.A)(f(e))))}var p=(0,r.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===h[a]?h[a]=0:++h[a],this.displayTimestamp=r,this.setPrefixWidth(o||8),this._log=this._emitLog.bind(this,s.k.log),this._info=this._emitLog.bind(this,s.k.info),this._warn=this._emitLog.bind(this,s.k.warn),this._error=this._emitLog.bind(this,s.k.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,r=new Array(i>2?i-2:0),a=2;a<i;a++)r[a-2]=arguments[a];(0,u.Kg)(e)?(n.push(e),e=n.join(" "),t.apply(void 0,[e].concat((0,o.A)(f(r))))):t.apply(void 0,n.concat((0,o.A)(f([e].concat(r)))))}},{key:"setPrefixWidth",value:function(t){this._displayedPrefix="".concat(d(this._prefix,t)," #").concat(d(this._count.toString(),3))}},{key:"setLevel",value:function(t){this._enabled=t>=0,this.log=t>=a.Ay.LOG?this._log:l.lQ,this.info=t>=a.Ay.INFO?this._info:l.lQ,this.warn=t>=a.Ay.WARN?this._warn:l.lQ,this.error=t>=a.Ay.ERROR?this._error:l.lQ}},{key:"updateLevel",value:function(t){this._enabled&&this.setLevel(t)}}])},243:(t,e,n)=>{"use strict";function i(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(i=function(){return!!t})()}n.d(e,{A:()=>o});var r=n(662);function o(t,e,n){if(i())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var a=new(t.bind.apply(t,o));return n&&(0,r.A)(a,n.prototype),a}},280:(t,e,n)=>{"use strict";n.d(e,{DJ:()=>u,vG:()=>d,wg:()=>a,yb:()=>l});var i=n(171),r=n(854),o="setTimeout",a=r.y[o];a||(a=i.J[o]),(0,r.aZ)(o,function(){return a},function(t){return a=t}),i.J[o]||(i.J[o]=a),i.J.setImmediate||(i.J.setImmediate=a);var s="clearTimeout",u=r.y[s];u||(u=i.J[s]),(0,r.aZ)(s,function(){return u},function(t){return u=t}),i.J[s]||(i.J[s]=u),i.J.clearImmediate||(i.J.clearImmediate=u);var c="setInterval",l=r.y[c];l||(l=i.J[c]),(0,r.aZ)(c,function(){return l},function(t){return l=t});var h="clearInterval",d=r.y[h];d||(d=i.J[h]),(0,r.aZ)(h,function(){return d},function(t){return d=t})},284:(t,e,n)=>{"use strict";function i(t){return i="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},i(t)}n.d(e,{A:()=>i})},296:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});var i=n(800);function r(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 i,r,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=(i=o.call(n)).done)&&(s.push(i.value),s.length!==e);u=!0);}catch(t){c=!0,r=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(t,e)||(0,i.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,{P2:()=>o,cs:()=>a,lQ:()=>r,si:()=>s});var i=n(280),r=Function.prototype;function o(t){try{t()}catch(t){(0,i.wg)(function(){throw t})}}function a(t,e){var n=t||r;try{return e(n)}catch(t){n(t)}}function s(t){return new Promise(function(e,n){return t(function(t,i){return t&&n(t)||e(i)})})}},317:(t,e,n)=>{"use strict";n.d(e,{H:()=>p,s:()=>g});var i=n(901),r=n(29),o=n(854),a=n(171),s=(0,i.A)(function t(){(0,r.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 l="sessionStorage",h=o.y[l];h||(h=a.J[l]||null),(0,o.aZ)(l,function(){return h},function(t){return h=t});var d=n(203);function f(t){return"webcom:"+t}var v=(0,i.A)(function t(e,n){(0,r.A)(this,t);var i=e();if(i){var o=f("sentinel");i.setItem(o,""),i.removeItem(o)}function a(){return e()||(0,d.$8)("JSONStorage","the ".concat(n," implementation could not be found!"))}this.set=function(t,e){if(null===e)a().removeItem(f(t));else{var n=JSON.stringify(e);a().setItem(f(t),"string"==typeof n?n:"null")}},this.get=function(t){var e=a().getItem(f(t));return e&&JSON.parse(e)},this.remove=function(t){a().removeItem(f(t))}}),p=new v(function(){return c},"localStorage"),g=new v(function(){return h},"sessionStorage")},373:t=>{t.exports=function(t){var e=Object(t),n=[];for(var i in e)n.unshift(i);return function t(){for(;n.length;)if((i=n.pop())in e)return t.value=i,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:()=>l});var i=n(284),r=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,i.A)(t)}function l(){return r.Ls&&(window.navigator.userAgent.match(/CriOS|Twitter for iPhone|FBAN\/FBIOS|Windows Phone/)||window.navigator.standalone)}},451:(t,e,n)=>{"use strict";n.d(e,{A:()=>l,Q:()=>h});var i=n(296),r=n(467),o=n(29),a=n(901),s=n(203),u=n(487),c=n(624),l=function(){function t(e){(0,o.A)(this,t),this.mode=e,e===v&&(this.childEventFilter=(0,r.A)((0,r.A)((0,r.A)({},g,!1),y,!1),m,!1))}return(0,a.A)(t,[{key:"isValueChange",get:function(){return this.mode!==v}},{key:"isValueChangeWithoutData",get:function(){return this.mode===p}},{key:"isChildEvent",get:function(){return this.mode===v}},{key:"isChildAddition",get:function(){return this.isChildEvent&&this.childEventFilter[g]}},{key:"isChildRemoval",get:function(){return this.isChildEvent&&this.childEventFilter[y]}},{key:"isChildChange",get:function(){return this.isChildEvent&&this.childEventFilter[m]}},{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(v);return d(e,"Addition",g),d(e,"Removal",y),d(e,"Change",m),e}}])}();function h(t,e){var n;return t.mode===v?(n=Object.entries(t.childEventFilter).filter(function(t){var e=(0,i.A)(t,2);e[0];return e[1]}).map(function(t){var e=(0,i.A)(t,1)[0];return _[e]}),e&&n.push(c.$k)):(n=[c.Qg],e&&n.push(c.q)),n}function d(t,e,n){(0,u.gB)(t,e,function(){return t.childEventFilter[n]=!0,t})}var f="value",v="childEvent",p="noData",g="added",y="removed",m="changed",_=(0,r.A)((0,r.A)((0,r.A)({},g,c.u4),m,c._t),y,c.yL)},458:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var i=n(145);var r=n(800);function o(t){return function(t){if(Array.isArray(t))return(0,i.A)(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||(0,r.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.")}()}},467:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});var i=n(816);function r(t,e,n){return(e=(0,i.A)(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},487:(t,e,n)=>{"use strict";n.d(e,{c2:()=>l,gB:()=>u,nA:()=>a,os:()=>o,ty:()=>s});var i=n(296),r=n(284);function o(t,e,n,i){return s(t.prototype,e,n,i)}function a(t,e,n,i){return u(t.prototype,e,n,i)}function s(t,e,n,i){return c(t,e,{value:n},i)}function u(t,e,n,i){return c(t,e,{get:n},i)}function c(t,e,n,i){return Object.defineProperty(t,e,Object.assign(n,{enumerable:i,configurable:!0}))}function l(t,e){var n=(0,r.A)(t);if(n!==(0,r.A)(e))return!1;if("object"!==n)return t===e;if(t===e)return!0;if(!t||!e)return!1;var o=Object.entries(t);return o.length===Object.keys(e).length&&o.every(function(t){var n=(0,i.A)(t,2),r=n[0];return l(n[1],e[r])})}},546:t=>{function e(n,i,r,o){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}t.exports=e=function(t,n,i,r){function o(n,i){e(t,n,function(t){return this._invoke(n,i,t)})}n?a?a(t,n,{value:i,enumerable:!r,configurable:!r,writable:!r}):t[n]=i:(o("next",0),o("throw",1),o("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,i,r,o)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},579:(t,e,n)=>{var i=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(i(t)+" is not iterable")},t.exports.__esModule=!0,t.exports.default=t.exports},585:(t,e,n)=>{"use strict";function i(t){var e=t.code||"UNKNOWN_ERROR",n=t.message||JSON.stringify(t),i=new Error("".concat(e,"[").concat(n,"]"));return i.code=e,i}n.d(e,{G:()=>i})},624:(t,e,n)=>{"use strict";n.d(e,{$k:()=>u,Ay:()=>h,Qg:()=>c,_t:()=>s,q:()=>l,u4:()=>o,yL:()=>a});var i=n(29),r=n(901),o="child_added",a="child_removed",s="child_changed",u="child_ack",c="value",l="value_ack",h=function(){function t(e,n,r){var o=r.childName,a=r.prevChildName,s=r.acknowledged;(0,i.A)(this,t),this.type=e,this.snapshotNode=n,this.childName=o,this.prevName=a,this.acknowledged=s}return(0,r.A)(t,null,[{key:"Value",value:function(e,n){return new t(n?l:c,e,{acknowledged:e.acknowledged()})}},{key:"ChildChanged",value:function(e,n,i,r){return new t(r?u:s,e,{childName:n,prevChildName:i,acknowledged:e.acknowledged()})}},{key:"ChildRemoved",value:function(e,n,i){return e.isEmpty()?new t(u,e,{childName:n,acknowledged:i}):new t(a,e,{childName:n,acknowledged:i})}},{key:"ChildAdded",value:function(e,n,i){return new t(o,e,{childName:n,prevChildName:i,acknowledged:e.acknowledged()})}}])}()},633:(t,e,n)=>{var i=n(172),r=n(993),o=n(869),a=n(887),s=n(791),u=n(373),c=n(579);function l(){"use strict";var e=r(),n=e.m(l),h=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function d(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))}var f={throw:1,return:2,break:3,continue:3};function v(t){var e,n;return function(i){e||(e={stop:function(){return n(i.a,2)},catch:function(){return i.v},abrupt:function(t,e){return n(i.a,f[t],e)},delegateYield:function(t,r,o){return e.resultName=r,n(i.d,c(t),o)},finish:function(t){return n(i.f,t)}},n=function(t,n,r){i.p=e.prev,i.n=e.next;try{return t(n,r)}finally{e.next=i.n}}),e.resultName&&(e[e.resultName]=i.v,e.resultName=void 0),e.sent=i.v,e.next=i.n;try{return t.call(this,e)}finally{i.p=e.prev,i.n=e.next}}}return(t.exports=l=function(){return{wrap:function(t,n,i,r){return e.w(v(t),n,i,r&&r.reverse())},isGeneratorFunction:d,mark:e.m,awrap:function(t,e){return new i(t,e)},AsyncIterator:s,async:function(t,e,n,i,r){return(d(e)?a:o)(v(t),e,n,i,r)},keys:u,values:c}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=l,t.exports.__esModule=!0,t.exports.default=t.exports},662:(t,e,n)=>{"use strict";function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}n.d(e,{A:()=>i})},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 i=n(633)();t.exports=i;try{regeneratorRuntime=i}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=i:Function("r","regeneratorRuntime = r")(i)}},779:(t,e)=>{"use strict";var n,i={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}}};i.bitArray={bitSlice:function(t,e,n){return t=i.bitArray._shiftRight(t.slice(e/32),32-(31&e)).slice(1),void 0===n?t:i.bitArray.clamp(t,n-e)},extract:function(t,e,n){var i=Math.floor(-e-n&31);return(-32&(e+n-1^e)?t[e/32|0]<<32-i^t[e/32+1|0]>>>i:t[e/32|0]>>>i)&(1<<n)-1},concat:function(t,e){if(0===t.length||0===e.length)return t.concat(e);var n=t[t.length-1],r=i.bitArray.getPartial(n);return 32===r?t.concat(e):i.bitArray._shiftRight(e,r,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)+i.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]=i.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(i.bitArray.bitLength(t)!==i.bitArray.bitLength(e))return!1;var n,r=0;for(n=0;n<t.length;n++)r|=t[n]^e[n];return 0===r},_shiftRight:function(t,e,n,r){var o,a,s;for(void 0===r&&(r=[]);e>=32;e-=32)r.push(n),n=0;if(0===e)return r.concat(t);for(o=0;o<t.length;o++)r.push(n|t[o]>>>e),n=t[o]<<32-e;return a=t.length?t[t.length-1]:0,s=i.bitArray.getPartial(a),r.push(i.bitArray.partial(e+s&31,e+s>32?n:r.pop(),1)),r},_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}},i.codec.utf8String={fromBits:function(t){var e,n,r="",o=i.bitArray.bitLength(t);for(e=0;e<o/8;e++)3&e||(n=t[e/4]),r+=String.fromCharCode(n>>>8>>>8>>>8),n<<=8;return decodeURIComponent(escape(r))},toBits:function(t){t=unescape(encodeURIComponent(t));var e,n=[],r=0;for(e=0;e<t.length;e++)r=r<<8|t.charCodeAt(e),3&~e||(n.push(r),r=0);return 3&e&&n.push(i.bitArray.partial(8*(3&e),r)),n}},i.codec.base64={_chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(t,e,n){var r,o="",a=0,s=i.codec.base64._chars,u=0,c=i.bitArray.bitLength(t);for(n&&(s=s.substr(0,62)+"-_"),r=0;6*o.length<c;)o+=s.charAt((u^t[r]>>>a)>>>26),a<6?(u=t[r]<<6-a,a+=26,r++):(u<<=6,a-=6);for(;3&o.length&&!e;)o+="=";return o},toBits:function(t,e){t=t.replace(/\s|=/g,"");var n,r,o=[],a=0,s=i.codec.base64._chars,u=0;for(e&&(s=s.substr(0,62)+"-_"),n=0;n<t.length;n++){if((r=s.indexOf(t.charAt(n)))<0)throw new i.exception.invalid("this isn't base64!");a>26?(a-=26,o.push(u^r>>>a),u=r<<32-a):u^=r<<32-(a+=6)}return 56&a&&o.push(i.bitArray.partial(56&a,u,1)),o}},i.codec.base64url={fromBits:function(t){return i.codec.base64.fromBits(t,1,1)},toBits:function(t){return i.codec.base64.toBits(t,1)}},i.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()},i.hash.sha256.hash=function(t){return(new i.hash.sha256).update(t).finalize()},i.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=i.codec.utf8String.toBits(t));var e,n=this._buffer=i.bitArray.concat(this._buffer,t),r=this._length,o=this._length=r+i.bitArray.bitLength(t);if(o>9007199254740991)throw new i.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var a=new Uint32Array(n),s=0;for(e=512+r-(512+r&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+r-(512+r&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=i.bitArray.concat(e,[i.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,i=2;function r(t){return 4294967296*(t-Math.floor(t))|0}for(;n<64;i++){for(e=!0,t=2;t*t<=i;t++)if(i%t===0){e=!1;break}e&&(n<8&&(this._init[n]=r(Math.pow(i,.5))),this._key[n]=r(Math.pow(i,1/3)),n++)}},_block:function(t){var e,n,i,r,o=this._h,a=this._key,s=o[0],u=o[1],c=o[2],l=o[3],h=o[4],d=o[5],f=o[6],v=o[7];for(e=0;e<64;e++)e<16?n=t[e]:(i=t[e+1&15],r=t[e+14&15],n=t[15&e]=(i>>>7^i>>>18^i>>>3^i<<25^i<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+t[15&e]+t[e+9&15]|0),n=n+v+(h>>>6^h>>>11^h>>>25^h<<26^h<<21^h<<7)+(f^h&(d^f))+a[e],v=f,f=d,d=h,h=l+n|0,l=c,c=u,s=n+((u=s)&c^l&(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]+l|0,o[4]=o[4]+h|0,o[5]=o[5]+d|0,o[6]=o[6]+f|0,o[7]=o[7]+v|0}},i.hash.sha1=function(t){t?(this._h=t._h.slice(0),this._buffer=t._buffer.slice(0),this._length=t._length):this.reset()},i.hash.sha1.hash=function(t){return(new i.hash.sha1).update(t).finalize()},i.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=i.codec.utf8String.toBits(t));var e,n=this._buffer=i.bitArray.concat(this._buffer,t),r=this._length,o=this._length=r+i.bitArray.bitLength(t);if(o>9007199254740991)throw new i.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+r-(this.blockSize+r&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+r-(this.blockSize+r&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=i.bitArray.concat(e,[i.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,i){return t<=19?e&n|~e&i:t<=39?e^n^i:t<=59?e&n|e&i|n&i:t<=79?e^n^i:void 0},_S:function(t,e){return e<<t|e>>>32-t},_block:function(t){var e,n,i,r,o,a,s,u,c=this._h;if("undefined"!=typeof Uint32Array){u=Array(80);for(var l=0;l<16;l++)u[l]=t[l]}else u=t;for(i=c[0],r=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,i)+this._f(e,r,o,a)+s+u[e]+this._key[Math.floor(e/20)]|0,s=a,a=o,o=this._S(30,r),r=i,i=n;c[0]=c[0]+i|0,c[1]=c[1]+r|0,c[2]=c[2]+o|0,c[3]=c[3]+a|0,c[4]=c[4]+s|0}},t.exports&&(t.exports=i),void 0===(n=function(){return i}.apply(e,[]))||(t.exports=n)},791:(t,e,n)=>{var i=n(172),r=n(546);t.exports=function t(e,n){function o(t,r,a,s){try{var u=e[t](r),c=u.value;return c instanceof i?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||(r(t.prototype),r(t.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),r(this,"_invoke",function(t,e,i){function r(){return new n(function(e,n){o(t,i,e,n)})}return a=a?a.then(r,r):r()},!0)},t.exports.__esModule=!0,t.exports.default=t.exports},800:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});var i=n(145);function r(t,e){if(t){if("string"==typeof t)return(0,i.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,i.A)(t,e):void 0}}},801:(t,e,n)=>{"use strict";n.d(e,{hH:()=>F,dO:()=>I,Gj:()=>T,B$:()=>b,e7:()=>_,Rs:()=>S,Rx:()=>P,_y:()=>R,CM:()=>k,Ae:()=>w,bY:()=>C,y1:()=>O});var i=n(458),r=n(848),o=n(756),a=n.n(o),s=n(317),u=n(982),c=n(29),l=n(901),h=n(203),d=n(451),f=n(487),v="LongTermSubscription",p=(0,l.A)(function t(e,n,i,r){(0,c.A)(this,t),this.data=e,this.uid=n,this.startDate=i,(0,f.ty)(this,"_db",r)},[{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,h.ar)(t,arguments),S.call(this._db,t,this)}},{key:"update",value:function(t){var e=[v,"#update"];return(0,h.ar)(e,arguments,(0,h.gp)(d.A)),O.call(this._db,e,this,t)}}]),g=n(176),y="none",m="subscriptions",_={};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 b(t){s.H.set(this._ltsKey,t)}function w(t,e,n,i){return A.apply(this,arguments)}function A(){return(A=(0,r.A)(a().mark(function t(e,n,i,r){var o;return a().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,M(n,i,r,_));case 1:return t.abrupt("return",t.sent);case 2:case"end":return t.stop()}},t,this)}))).apply(this,arguments)}function C(t,e,n,i){return D.apply(this,arguments)}function D(){return(D=(0,r.A)(a().mark(function t(e,n,i,r){var o,s;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=this._auth._getCurrentAuthenticationDetails(e),s=d.A.ValueChange,r||s.excludeRevocations(),t.next=1,T.call(this,o,!1,M(n,s,i,_));case 1:return t.abrupt("return",t.sent);case 2:case"end":return t.stop()}},t,this)}))).apply(this,arguments)}function S(t,e){return E.apply(this,arguments)}function E(){return(E=(0,r.A)(a().mark(function t(e,n){var i;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=this._auth._getCurrentAuthenticationDetails(e),t.next=1,I.call(this,i,n.id);case 1:return t.abrupt("return",t.sent);case 2:case"end":return t.stop()}},t,this)}))).apply(this,arguments)}function O(t,e,n){return N.apply(this,arguments)}function N(){return(N=(0,r.A)(a().mark(function t(e,n,i){var r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this._auth._getCurrentAuthenticationDetails(e),t.next=1,j.call(this,r,n.data,n.startDate,i);case 1:return t.abrupt("return",t.sent);case 2:case"end":return t.stop()}},t,this)}))).apply(this,arguments)}function R(t,e){var n=this,r=[].concat((0,i.A)(t),["#getLongTermSubscriptions"]);(0,h.ar)(r,e);var o=this._auth._getCurrentAuthenticationDetails(r);return L.call(this).filter(function(t){return t.uid===o.uid}).map(function(t){return new p(t.data,t.uid,t.startDate,n)})}function P(t,e){var n=[].concat((0,i.A)(t),["#cleanLongTermSubscriptions"]);(0,h.ar)(n,e);var r=this._auth._getCurrentAuthenticationDetails(n),o=L.call(this).filter(function(t){return t.uid!==r.uid});this._saveLts(o)}function T(t,e,n,i){return x.apply(this,arguments)}function x(){return(x=(0,r.A)(a().mark(function t(e,n,i,r){var o,s,c,l;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!((o=L.call(this).find(function(t){return t.uid===e.uid&&t.data.path===i.path&&t.data.kind===i.kind&&t.data.context===i.context&&t.data.destination===i.destination}))&&n&&U(o.data,o.startDate,i))){t.next=1;break}return t.abrupt("return",new p(o.data,o.uid,o.startDate,this));case 1:return t.next=2,(0,u.bE)("".concat(this._datasyncRoute,"/subscriptions"),e.uid).addHeader((0,u.Dv)(e.webcomAuthToken)).addQueryParameters(n?{allowsUpdate:!0}:{delete:!0}).addJson(i).send();case 2:return s=t.sent,c=L.call(this).filter(function(t){return t.data.id!==(o&&o.data.id)}),n&&(l=new p(s.body,e.uid,r||Math.floor(Date.now()/1e3),this),c.push(Object.assign({},l))),this._saveLts(c),t.abrupt("return",l);case 3:case"end":return t.stop()}},t,this)}))).apply(this,arguments)}function I(t,e,n){return W.apply(this,arguments)}function W(){return(W=(0,r.A)(a().mark(function t(e,n,i){var r;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,(0,u.HY)("".concat(this._datasyncRoute,"/subscriptions"),e.uid,n).addHeader((0,u.Dv)(e.webcomAuthToken)).send();case 1:i||(r=L.call(this).filter(function(t){return t.data.id!==n}),this._saveLts(r));case 2:case"end":return t.stop()}},t,this)}))).apply(this,arguments)}function j(t,e,n,i){return q.apply(this,arguments)}function q(){return(q=(0,r.A)(a().mark(function t(e,n,i,r){var o,s,c;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,(0,u.yJ)("".concat(this._datasyncRoute,"/subscriptions"),e.uid,n.id).addHeader((0,u.Dv)(e.webcomAuthToken)).addJson(F(n,r)).send();case 1:return o=t.sent,s=new p(o.body,e.uid,i,this),c=L.call(this).filter(function(t){return t.data.id!==o.body.id}),c.push(Object.assign({},s)),this._saveLts(c),t.abrupt("return",s);case 2:case"end":return t.stop()}},t,this)}))).apply(this,arguments)}function L(){return s.H.get(this._ltsKey)||[]}function M(t,e,n,i){var r={context:i&&i[n.kind]||n.context};return Object.assign({path:t.toString()},n,e,r)}function F(t,e){return Object.assign({},t,t.encryption?{encryption:{alg:t.encryption.alg}}:{},e)}function U(t,e,n){var i,r;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===(i=t.encryption)||void 0===i?void 0:i.alg)||y)!==((null===(r=n.encryption)||void 0===r?void 0:r.alg)||y))return!1;var s=t.expirationTimestampSeconds;return(Math.floor(Date.now()/1e3)-e)/(s-e)<.5}},816:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});var i=n(284);function r(t){var e=function(t,e){if("object"!=(0,i.A)(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=(0,i.A)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==(0,i.A)(e)?e:e+""}},848:(t,e,n)=>{"use strict";function i(t,e,n,i,r,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(i,r)}function r(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)})}}n.d(e,{A:()=>r})},854:(t,e,n)=>{"use strict";n.d(e,{El:()=>r,aZ:()=>o,y:()=>i});var i=n(171).J.WebcomDependencies||{},r={};function o(t,e,n){Object.defineProperty(r,t,{enumerable:!0,get:e,set:n})}},869:(t,e,n)=>{var i=n(887);t.exports=function(t,e,n,r,o){var a=i(t,e,n,r,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 i=n(993),r=n(791);t.exports=function(t,e,n,o,a){return new r(i().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 i=n(816);function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(0,i.A)(r.key),r)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}},915:(t,e,n)=>{"use strict";n.d(e,{Ls:()=>h,Ov:()=>l,Xb:()=>d});var i=n(171),r=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 l,h=!0,d=!1,f="device",v=r.y[f];if(!v){var p=i.J.window;p&&p.location?p.location.href.indexOf("webview.datasync.orange.com")<0?g(o):g(s):g(u)}function g(t){v=t,h=t===o,d=0===t.indexOf(a),l=(c[t]||"")+"3.10.1"}(0,r.aZ)(f,function(){return v},function(t){return g(t)})},982:(t,e,n)=>{"use strict";n.d(e,{Dv:()=>I,HY:()=>x,Jt:()=>N,F6:()=>T,bE:()=>P,yJ:()=>R});var i=n(243),r=n(296),o=n(458),a=n(901),s=n(29),u=n(33),c=n(585),l=n(133),h=n(915),d=n(412),f=n(171),v=n(854),p=n(203);var g="XMLHttpRequest",y=v.y[g];y||(void 0===(y=f.J[g])||function(){if(h.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,p.$8)(p.zR,"XMLHttpRequest not found"),(0,v.aZ)(g,function(){return y},function(t){return y=t});var m=(0,l.h)("network.HttpRequest","HttpRequest"),_="application/x-www-form-urlencoded",k="application/json",b="Content-Type",w="PUT",A="PATCH",C="POST",D="DELETE",S="GET",E=(0,a.A)(function t(e,n){(0,s.A)(this,t),this.name=e,this.value=n}),O=(0,a.A)(function t(e,n){(0,s.A)(this,t);for(var i=arguments.length,r=new Array(i>2?i-2:0),a=2;a<i;a++)r[a-2]=arguments[a];this.url=(0,u.a6)([n].concat((0,o.A)(r.filter(function(t){return t&&t.length}).map(function(t){return encodeURIComponent(t)}))).join("/"),{c:h.Ov}),this.method=e.toUpperCase(),this.headers={Accept:"application/json, text/plain"}},[{key:"addQueryParameters",value:function(t){return this.url=(0,u.a6)(this.url,t),this}},{key:"addJson",value:function(t){return this.contentType=k,this.data=t,this}},{key:"addForm",value:function(t){return this.contentType=_,this.data=t,this}},{key:"addHeader",value:function(t){return(0,p.ar)(["HttpRequest","#addHeader"],arguments,(0,p.lq)((0,p.gp)(E))),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 i=null;void 0!==t.data&&[C,w,A].indexOf(t.method)>=0&&((i=t.contentType===_?(0,u.Rd)(t.data):t.contentType===k?JSON.stringify(t.data):t.data)?t.headers[b]=t.contentType:delete t.headers[b]),m.log("==> ".concat(t.method," ").concat(t.url)),Object.keys(t.headers).forEach(function(e){return m.log(" > HEADER ".concat(e,": ").concat(t.headers[e]))}),i&&m.log(" > DATA: ".concat(i)),t._open(i,e,function(t){m.log("<== ERROR: ".concat(JSON.stringify(t))),n((0,c.G)(t))})})}},{key:"_open",value:function(t,e,n){var i=this,o=new y,a="RESPONSE_PAYLOAD_ERROR";o.onreadystatechange=function(){if(4===o.readyState){var t=o.responseText,r=o.status;if(r>=500)n({code:a,message:"HTTP status ".concat(r)});else try{var s=t.length?JSON.parse(t):{};if(r>=400)n(s.error||s);else if(r>=200&&r<300||304===r){var u={body:s},c=u.body.error||null;c?n((0,d.Gv)(c)?c:{code:u.body.status,message:c}):(i.readHeaders&&(u.headers=function(t){var e=t.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};return e.forEach(function(t){var e=t.indexOf(": "),i=t.substring(0,e).toLowerCase();n[i]=t.substring(e+2)}),n}(o)),m.log("<== ".concat(JSON.stringify(u))),e(u))}else n({code:a,message:"HTTP status ".concat(r)})}catch(t){n({code:a,message:"invalid response payload, not a Json content type"})}}},o.open(this.method,this.url,!0),Object.entries(this.headers).forEach(function(t){var e=(0,r.A)(t,2),n=e[0],i=e[1];return o.setRequestHeader(n,i)}),o.send(t)}}]);function N(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(0,i.A)(O,[S,t].concat(n))}function R(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(0,i.A)(O,[w,t].concat(n))}function P(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(0,i.A)(O,[C,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(0,i.A)(O,[A,t].concat(n))}function x(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(0,i.A)(O,[D,t].concat(n))}function I(t){if(t)return new E("Authorization","Bearer ".concat(t))}},993:(t,e,n)=>{var i=n(546);function r(){
/*! 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,r,o,a){var s=r&&r.prototype instanceof l?r:l,u=Object.create(s.prototype);return i(u,"_invoke",function(t,i,r){var o,a,s,u=0,l=r||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,a=0,s=e,d.n=n,c}};function f(t,i){for(a=t,s=i,n=0;!h&&u&&!r&&n<l.length;n++){var r,o=l[n],f=d.p,v=o[2];t>3?(r=v===i)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=f&&((r=t<2&&f<o[1])?(a=0,d.v=i,d.n=o[1]):f<v&&(r=t<3||o[0]>i||i>v)&&(o[4]=t,o[5]=i,d.n=v,a=0))}if(r||t>1)return c;throw h=!0,i}return function(r,l,v){if(u>1)throw TypeError("Generator is already running");for(h&&1===l&&f(l,v),a=l,s=v;(n=a<2?e:s)||!h;){o||(a?a<3?(a>1&&(d.n=-1),f(a,s)):d.n=s:d.v=s);try{if(u=2,o){if(a||(r="next"),n=o[r]){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 '"+r+"' method"),a=1);o=e}else if((n=(h=d.n<0)?s:t.call(i,d))!==c)break}catch(t){o=e,a=1,s=t}finally{u=1}}return{value:n,done:h}}}(t,o,a),!0),u}var c={};function l(){}function h(){}function d(){}n=Object.getPrototypeOf;var f=[][a]?n(n([][a]())):(i(n={},a,function(){return this}),n),v=d.prototype=l.prototype=Object.create(f);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,i(t,s,"GeneratorFunction")),t.prototype=Object.create(v),t}return h.prototype=d,i(v,"constructor",d),i(d,"constructor",h),h.displayName="GeneratorFunction",i(d,s,"GeneratorFunction"),i(v),i(v,s,"Generator"),i(v,a,function(){return this}),i(v,"toString",function(){return"[object Generator]"}),(t.exports=r=function(){return{w:u,m:p}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i](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 i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},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 i={};return(()=>{"use strict";n.d(i,{default:()=>p});var t=n(171),e=n(29),r=n(901),o=n(176),a=n(133),s=n(854),u=n(203),c="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",l=0,h=[];function d(t){var e=t===l;l=t;var n,i=new Array(8);for(n=7;n>=0;n--)i[n]=c.charAt(t%64),t=Math.floor(t/64);(0,u.vA)(0===t,"Cannot push at time == 0");var r=i.join("");if(e){for(n=11;n>=0&&63===h[n];n--)h[n]=0;h[n]++}else for(n=0;n<12;n++)h[n]=Math.floor(64*Math.random(