UNPKG

webcom

Version:

Webcom library

20 lines 162 kB
/*! * Webcom. Build realtime apps. Share and sync data instantly between your clients * * Module name: Webcom * Version: 3.10.1 * Created: 2025-11-07T12:55:52.136Z * * 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(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(this,()=>(()=>{var e={29:(e,t,n)=>{"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{A:()=>i})},33:(e,t,n)=>{"use strict";n.d(t,{$f:()=>c,Rd:()=>h,a6:()=>d,e8:()=>v,kj:()=>f,l8:()=>l,sc:()=>p});var i=n(296),r=n(203),o=n(779),a=n.n(o),s=n(412);function u(e){return decodeURIComponent(e.replace(/\+/g," "))}function c(){var e=2147483648;return Math.floor(Math.random()*e).toString(36)+Math.abs(Math.floor(Math.random()*e)^Date.now()).toString(36)}function l(e){var t={};return e.replace(/^[^?]*\?/,"").split("&").forEach(function(e){var n=e.indexOf("=");if(n<0)t[u(e)]=!0;else{var i=u(e.substring(0,n));t[i]=u(e.substring(n+1))}}),t}function h(e){if(!e)return"";var t=[];return Object.entries(e).forEach(function(e){var n=(0,i.A)(e,2),r=n[0],o=n[1];null!=o&&((0,s.Gv)(o)&&(o=JSON.stringify(o)),t.push(encodeURIComponent(r)+"="+encodeURIComponent(o)))}),t.join("&")}function d(e,t){var n=e.indexOf("?"),i=t?(n<0?"?":"&")+h(t):"",r=e.indexOf("#");return r<0?e+i:e.substring(0,r)+i+e.substring(r)}function f(e){for(var t,n,i=[],o=0,a=0;a<e.length;a++)(t=e.charCodeAt(a))>=55296&&t<=56319&&(n=t-55296,a++,(0,r.vA)(a<e.length,"Surrogate pair missing trail surrogate."),t=65536+(n<<10)+(e.charCodeAt(a)-56320)),t<128?i[o++]=t:t<2048?(i[o++]=t>>6|192,i[o++]=63&t|128):t<65536?(i[o++]=t>>12|224,i[o++]=t>>6&63|128,i[o++]=63&t|128):(i[o++]=t>>18|240,i[o++]=t>>12&63|128,i[o++]=t>>6&63|128,i[o++]=63&t|128);return i}function v(e,t){return a().codec.base64.fromBits(a().hash.sha1.hash(e),!1,t)}function p(e,t){return a().codec.base64.fromBits(a().hash.sha256.hash(e),!1,t)}},128:(e,t,n)=>{"use strict";n.r(t),n.d(t,{_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(364);function u(){var e=this;this._ltsListeners=[],this._saveLts=l,this._auth.subscribe(function(t,n){t||n.isRequired()||(e._ltsAuth&&e._ltsAuth.isAuthenticated()&&v.call(e,function(t,n){return t.uid!==n.uid||!s.e7[t.data.kind]||(s.dO.call(e,n,t.data.id,!0).catch(function(n){return e._logger.error("Failed to cancel a long term subscription #%s: %s",t.data.id,n.message)}),!1)}),e._ltsAuth=n,p.call(e))},!0)}function c(e){return e.filter(function(e){return e.data.encryption}).map(function(e){return[e.data.encryption,1e3*e.data.expirationTimestampSeconds]})}function l(e){var t=c.call(this,e);this._ltsListeners.forEach(function(e){return e(t)}),t.forEach(function(e){var t=(0,r.A)(e,1)[0];return Object.keys(t).filter(function(e){return"alg"!==e&&"kid"!==e}).forEach(function(e){return delete t[e]})}),s.B$.call(this,e)}function h(e,t,n){(0,a.ar)([].concat((0,i.A)(t),["#_listenLts"]),n,a.Pc),this._ltsListeners.push(e),e(c.call(this,o.H.get(this._ltsKey)))}function d(e,t,n){(0,a.ar)([].concat((0,i.A)(t),["#_unlistenLts"]),n,a.Pc),this._ltsListeners=this._ltsListeners.filter(function(t){return t!==e})}function f(e,t,n,r){(0,a.ar)([].concat((0,i.A)(n),["#_setLtsContext"]),r,a.Yj,a.Yj),s.e7[e]=t,p.call(this)}function v(e){var t=o.H.get(this._ltsKey);if(t){var n,i=null===(n=this._ltsAuth)||void 0===n?void 0:n.details,r=[];t.forEach(function(t){Date.now()<1e3*t.data.expirationTimestampSeconds&&e(t,i)&&r.push(t)}),this._saveLts(r)}}function p(){var e=this;v.call(this,function(t,n){if(n&&t.startDate&&t.uid===n.uid){var i=t.data,r=s.e7[i.kind];if(r&&r!==i.context)return e._logger.log("Refresh the context of the long term subscription #%s: %s --\x3e %s",i.id,i.context,r),s.dO.call(e,n,i.id,!0).then(function(){return delete i.id,s.Gj.call(e,n,!0,(0,s.hH)(i,{context:r}),t.startDate)}).catch(function(t){return e._logger.error("Failed to refresh the long term subscription #%s: %s",i.id,t.message)}),!1}return!0})}},133:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>N,MX:()=>h,d1:()=>D,h:()=>R});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="_leaf_";function m(e){return e?e.split("."):[]}function k(e){return{disabledDepth:C(e,g),enabledDepth:C(e,_)}}function b(e,t,n,i){for(var r=0;r<e.length;){var o=e[r++];t.hasOwnProperty(o)||(t[o]={}),t=t[o]}i&&Object.keys(t).forEach(function(e){return delete t[e]}),t[y]=n}function w(e,t){for(var n=0;n<e.length;){var i=e[n++];if(!t.hasOwnProperty(i))return;t=t[i]}delete t[y]}function C(e,t){var n=-1,i=0;do{t.hasOwnProperty(y)&&(n=i)}while(i<e.length&&(t=t[e[i++]]));return n}function A(e,t){Object.entries(e||{}).forEach(function(e){var n=(0,a.A)(e,2),i=n[0],r=n[1];i===y?t(r):A(r,t)})}function E(e,t){for(var n=[],i=0;t&&i<e.length;)t=t[e[i++]];return A(t,function(e){return n.push(e)}),n}function S(e){d=e,v.forEach(function(e){return e.displayTimestamp=d})}var D="LogManager",N=function(){function e(){(0,r.A)(this,e)}return(0,o.A)(e,null,[{key:"enable",value:function(t){(0,c.ar)([D,".enable"],arguments,(0,c.lq)(c.Yj));var n=m(t),i=k(n),r=i.enabledDepth,o=i.disabledDepth;r<=o&&(o<0&&e.disable(),b(n,_,!0,!0),w(n,g),E(n,p).forEach(function(e){return e.setLevel(O)}))}},{key:"disable",value:function(e){(0,c.ar)([D,".disable"],arguments,(0,c.lq)(c.Yj));var t=m(e),n=k(t),i=n.enabledDepth;n.disabledDepth<=i&&(b(t,g,!0,!0),w(t,_),E(t,p).forEach(function(e){return e.setLevel(l)}))}},{key:"showTimestamp",value:function(){(0,c.ar)([D,".showTimestamp"],arguments),S(!0)}},{key:"hideTimestamp",value:function(){(0,c.ar)([D,".hideTimestamp"],arguments),S(!1)}},{key:"setPrefixWidth",value:function(e){(0,c.ar)([D,".setPrefixWidth"],arguments,c.vM),e<0?e=0:e>h.length&&(e=h.length),f=e,v.forEach(function(e){return e.setPrefixWidth(f)})}},{key:"level",get:function(){return O},set:function(e){(0,c.ar)([D,".level"],arguments,c.vM),e>l&&e!==O&&(v.forEach(function(t){return t.updateLevel(e)}),O=e)}},{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(e){var t=e&&e.toUpperCase();return function(e,n){return u.k.log("********** UPDATE ".concat(t||e.ref().pathString()," **********"),e.toString(),n?"[<<".concat(n,"]"):"")}}},{key:"debugOnCompletionCallback",value:function(e,t){var n=e&&e.toUpperCase();return function(e){return e?u.k.log("********** REVOKED ".concat(n," **********"),e):u.k.log("********** COMPLETED ".concat(n," **********")),t}}},{key:"debugOnCallbackWithCancel",value:function(t){var n=t&&t.toUpperCase();return[e.debugOnCallback(t),function(e){return u.k.log.apply(u.k,["********** COMPLETE ".concat(n," **********")].concat((0,i.A)(e?["FAILED:",e.code,e.message]:["cancelled"])))}]}}])}();function R(e,t){var n=m(e),i=new s.A(n,t||n[n.length-1],d,f);return function(e){var t=e.fqdn;b(t,p,e),v.push(e);var n=k(t),i=n.disabledDepth,r=n.enabledDepth;e.setLevel(r>=i?O:l)}(i),i}var O=N.INFO},145:(e,t,n)=>{"use strict";function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}n.d(t,{A:()=>i})},170:(e,t,n)=>{"use strict";n.d(t,{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(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(e){return(0,a.Gv)(e)?JSON.stringify(e):(e||"undefined").toString()};if((0,a.Kg)(e)){var s=0;return[e=e.replace(/%(.)/g,function(e,t){switch(t){case"%":return"%";case"s":case"o":case"O":return o(n[s++]);case"d":case"i":case"f":return n[s++];default:return e}})].concat((0,i.A)(n.slice(s).map(o))).join(" ")}return[e].concat(n).map(o).join(" ")};function l(e,t,n,i,r){if(!n||!i||!r){var o=t,a=function(e){return function(t){return o("[".concat(e,"] ").concat(t))}};n=n||a("INFO"),i=i||a("WARN"),r=r||a("ERR!"),t=a("LOG ")}return{log:function(){return t.call(e,c.apply(void 0,arguments))},info:function(){return n.call(e,c.apply(void 0,arguments))},warn:function(){return i.call(e,c.apply(void 0,arguments))},error:function(){return r.call(e,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(e){return u=e})},171:(e,t,n)=>{"use strict";n.d(t,{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:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},176:(e,t,n)=>{"use strict";n.d(t,{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 e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,r.A)(this,e),(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=t,this.config={},(0,u.Kg)(n)&&(n=Object.keys(v).reduce(function(e,t){return e[t]={baseUrl:n},e},{})),this._fillConfig(n),this._logger.log("Initialized %s with options %s",t,JSON.stringify(this.config))},[{key:"dispose",value:function(){(0,a.ar)([c,"#dispose"],arguments),Object.values(this._services).forEach(function(e){return e._dispose()}),this._services={}}},{key:"_fillConfig",value:function(e){h.call(this,e,v)}},{key:"toString",value:function(){return"".concat(this.appId,"{").concat(Object.keys(this._services).join(","),"}")}}]);function h(e,t){var n=this,r=function(e,t,o,s){var u=function(e){return"".concat(c,".Configuration.").concat(s.concat(e).join("."))};t=Object.assign({},t),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))e[l]=e[l]||{},r(e[l],t[l]||{},h,s.concat(l));else{var d=t[l],f=h[1]||function(e){return e};try{e[l]=f(void 0===d?void 0===e[l]?h.length?h[0]:h:e[l]:d)}catch(t){var v=u(l);void 0===t.value?(0,a.$8)(v,t.message):(n._logger.warn("%s: %s",v,t.message),e[l]=t.value)}}delete t[l]}),Object.keys(t).forEach(function(e){return n._logger.warn("%s: unknown config key",u(e))})};r(this.config,e,t,[])}function d(e,t){var n=t.baseUrl;return"/".concat(n.protocol.slice(0,-1),"/").concat(n.host,"/").concat(e.appId,"/")}function f(e,t,n){return"".concat(n.key,":").concat(t,":").concat(d(e,n))}var v={}},203:(e,t,n)=>{"use strict";n.d(t,{$8:()=>d,$x:()=>v,Ik:()=>E,Pc:()=>w,WP:()=>D,YD:()=>l,Yj:()=>b,ar:()=>f,b0:()=>s,cK:()=>T,gP:()=>S,gp:()=>y,lq:()=>p,se:()=>h,vA:()=>u,vD:()=>k,vM:()=>A,y:()=>g,yL:()=>N,zB:()=>_,zM:()=>C,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(e,t){e||d(a,t)}var c={values:[]};function l(e,t){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:e,args:t||[],checkers:i})}function h(e,t,n){c.values.push({name:e,value:t,checker:n})}var d=function(e,t){var n;throw new Error("".concat((n="").concat.apply(n,(0,r.A)(e)),": ").concat(t))};function f(e,t){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,[e,t].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(e,t){return v(e,a[t],o,function(e){return"argument #".concat(t+1," ").concat(e)})}),u.forEach(function(e){var t=e.name,n=e.value;return v(e.checker,n,o,function(e){return"".concat(t," ").concat(e)})})}function v(e,t,n,i){var r=e(t);r&&d(n,i(r))}function p(e){return function(t){return m("undefined")(t)&&e&&e(t)}}function _(e){return function(t){return null===t?"must not be null":e&&e(t)}}var g=function(e){return void 0===e?"is missing":""};function y(e){return function(t){return!(t instanceof e)&&"must be an instance of ".concat(e.name)}}function m(e){return function(t){return(0,i.A)(t)!==e&&"must be a ".concat(e)}}var k=m("undefined"),b=m("string"),w=m("function"),C=m("boolean"),A=O(Number.isFinite,"must be a finite number"),E=m("object");function S(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.every(function(t){return t(e)})&&"either ".concat(t.map(function(t){return t(e)}).join(" or "))}}function D(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){var n;return t.some(function(t){return n=t(e)})&&n}}function N(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.every(function(t){return t!==e})&&"must be either ".concat(t.join(" or "))}}var R="is not valid";function O(e,t){return function(n){return!e(n)&&(t||R)}}O(function(e){return(0,o.Et)(e)&&Math.floor(e)===e},"must be an integer");function T(e,t){return O(function(t){return e.test(t)},t)}},224:(e,t,n)=>{"use strict";n.d(t,{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(e,t){var n=e.length;return n>=t?e.substring(0,t):e+a.MX.substring(0,t-n)}function f(e){return e.map(function(e){return(0,u.Tn)(e)?e():e})}function v(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,c.$8)(c.zR,s.a.apply(void 0,(0,o.A)(f(t))))}var p=(0,r.A)(function e(t,n,r,o){(0,i.A)(this,e),this._fqdn=t,this._prefix=n;var a=t.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(e,t){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)(t)?(n.push(t),t=n.join(" "),e.apply(void 0,[t].concat((0,o.A)(f(r))))):e.apply(void 0,n.concat((0,o.A)(f([t].concat(r)))))}},{key:"setPrefixWidth",value:function(e){this._displayedPrefix="".concat(d(this._prefix,e)," #").concat(d(this._count.toString(),3))}},{key:"setLevel",value:function(e){this._enabled=e>=0,this.log=e>=a.Ay.LOG?this._log:l.lQ,this.info=e>=a.Ay.INFO?this._info:l.lQ,this.warn=e>=a.Ay.WARN?this._warn:l.lQ,this.error=e>=a.Ay.ERROR?this._error:l.lQ}},{key:"updateLevel",value:function(e){this._enabled&&this.setLevel(e)}}])},243:(e,t,n)=>{"use strict";n.d(t,{$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 e(t,n,r){var o=r.childName,a=r.prevChildName,s=r.acknowledged;(0,i.A)(this,e),this.type=t,this.snapshotNode=n,this.childName=o,this.prevName=a,this.acknowledged=s}return(0,r.A)(e,null,[{key:"Value",value:function(t,n){return new e(n?l:c,t,{acknowledged:t.acknowledged()})}},{key:"ChildChanged",value:function(t,n,i,r){return new e(r?u:s,t,{childName:n,prevChildName:i,acknowledged:t.acknowledged()})}},{key:"ChildRemoved",value:function(t,n,i){return t.isEmpty()?new e(u,t,{childName:n,acknowledged:i}):new e(a,t,{childName:n,acknowledged:i})}},{key:"ChildAdded",value:function(t,n,i){return new e(o,t,{childName:n,prevChildName:i,acknowledged:t.acknowledged()})}}])}()},280:(e,t,n)=>{"use strict";n.d(t,{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(e){return a=e}),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(e){return u=e}),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(e){return l=e});var h="clearInterval",d=r.y[h];d||(d=i.J[h]),(0,r.aZ)(h,function(){return d},function(e){return d=e})},284:(e,t,n)=>{"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(t,{A:()=>i})},296:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var i=n(800);function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,t)||(0,i.A)(e,t)||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:(e,t,n)=>{"use strict";n.d(t,{P2:()=>o,cs:()=>a,lQ:()=>r,si:()=>s});var i=n(280),r=Function.prototype;function o(e){try{e()}catch(e){(0,i.wg)(function(){throw e})}}function a(e,t){var n=e||r;try{return t(n)}catch(e){n(e)}}function s(e){return new Promise(function(t,n){return e(function(e,i){return e&&n(e)||t(i)})})}},306:(e,t,n)=>{"use strict";function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}n.d(t,{Dv:()=>I,HY:()=>L,Jt:()=>T,bE:()=>x,yJ:()=>P});var r=n(662);function o(e,t,n){if(i())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,t);var a=new(e.bind.apply(e,o));return n&&(0,r.A)(a,n.prototype),a}var a=n(296),s=n(458),u=n(901),c=n(29),l=n(33),h=n(585),d=n(133),f=n(915),v=n(412),p=n(171),_=n(854),g=n(203);var y="XMLHttpRequest",m=_.y[y];m||(void 0===(m=p.J[y])||function(){if(f.Ls&&"Microsoft Internet Explorer"===window.navigator.appName){var e=window.navigator.userAgent.match(/MSIE (\d+[.\d]*)/);return e&&e.length>1&&parseFloat(e[1])<10}return!1}())&&(0,g.$8)(g.zR,"XMLHttpRequest not found"),(0,_.aZ)(y,function(){return m},function(e){return m=e});var k=(0,d.h)("network.HttpRequest","HttpRequest"),b="application/x-www-form-urlencoded",w="application/json",C="Content-Type",A="PUT",E="PATCH",S="POST",D="DELETE",N="GET",R=(0,u.A)(function e(t,n){(0,c.A)(this,e),this.name=t,this.value=n}),O=(0,u.A)(function e(t,n){(0,c.A)(this,e);for(var i=arguments.length,r=new Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];this.url=(0,l.a6)([n].concat((0,s.A)(r.filter(function(e){return e&&e.length}).map(function(e){return encodeURIComponent(e)}))).join("/"),{c:f.Ov}),this.method=t.toUpperCase(),this.headers={Accept:"application/json, text/plain"}},[{key:"addQueryParameters",value:function(e){return this.url=(0,l.a6)(this.url,e),this}},{key:"addJson",value:function(e){return this.contentType=w,this.data=e,this}},{key:"addForm",value:function(e){return this.contentType=b,this.data=e,this}},{key:"addHeader",value:function(e){return(0,g.ar)(["HttpRequest","#addHeader"],arguments,(0,g.lq)((0,g.gp)(R))),e&&(this.headers[e.name]=e.value),this}},{key:"readResponseHeaders",value:function(){return this.readHeaders=!0,this}},{key:"send",value:function(){var e=this;return new Promise(function(t,n){var i=null;void 0!==e.data&&[S,A,E].indexOf(e.method)>=0&&((i=e.contentType===b?(0,l.Rd)(e.data):e.contentType===w?JSON.stringify(e.data):e.data)?e.headers[C]=e.contentType:delete e.headers[C]),k.log("==> ".concat(e.method," ").concat(e.url)),Object.keys(e.headers).forEach(function(t){return k.log(" > HEADER ".concat(t,": ").concat(e.headers[t]))}),i&&k.log(" > DATA: ".concat(i)),e._open(i,t,function(e){k.log("<== ERROR: ".concat(JSON.stringify(e))),n((0,h.G)(e))})})}},{key:"_open",value:function(e,t,n){var i=this,r=new m,o="RESPONSE_PAYLOAD_ERROR";r.onreadystatechange=function(){if(4===r.readyState){var e=r.responseText,a=r.status;if(a>=500)n({code:o,message:"HTTP status ".concat(a)});else try{var s=e.length?JSON.parse(e):{};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,v.Gv)(c)?c:{code:u.body.status,message:c}):(i.readHeaders&&(u.headers=function(e){var t=e.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};return t.forEach(function(e){var t=e.indexOf(": "),i=e.substring(0,t).toLowerCase();n[i]=e.substring(t+2)}),n}(r)),k.log("<== ".concat(JSON.stringify(u))),t(u))}else n({code:o,message:"HTTP status ".concat(a)})}catch(e){n({code:o,message:"invalid response payload, not a Json content type"})}}},r.open(this.method,this.url,!0),Object.entries(this.headers).forEach(function(e){var t=(0,a.A)(e,2),n=t[0],i=t[1];return r.setRequestHeader(n,i)}),r.send(e)}}]);function T(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return o(O,[N,e].concat(n))}function P(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return o(O,[A,e].concat(n))}function x(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return o(O,[S,e].concat(n))}function L(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return o(O,[D,e].concat(n))}function I(e){if(e)return new R("Authorization","Bearer ".concat(e))}},317:(e,t,n)=>{"use strict";n.d(t,{H:()=>p,s:()=>_});var i=n(901),r=n(29),o=n(854),a=n(171),s=(0,i.A)(function e(){(0,r.A)(this,e),this.cache_={}},[{key:"length",get:function(){return Object.keys(this.cache_).length}},{key:"key",value:function(e){var t=Object.keys(this.cache_);return 0<=e&&e<t.length?t[e]:null}},{key:"getItem",value:function(e){return this.cache_.hasOwnProperty(e)?this.cache_[e]:null}},{key:"setItem",value:function(e,t){this.cache_[e]=t}},{key:"removeItem",value:function(e){delete this.cache_[e]}},{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(e){return c=e});var l="sessionStorage",h=o.y[l];h||(h=a.J[l]||null),(0,o.aZ)(l,function(){return h},function(e){return h=e});var d=n(203);function f(e){return"webcom:"+e}var v=(0,i.A)(function e(t,n){(0,r.A)(this,e);var i=t();if(i){var o=f("sentinel");i.setItem(o,""),i.removeItem(o)}function a(){return t()||(0,d.$8)("JSONStorage","the ".concat(n," implementation could not be found!"))}this.set=function(e,t){if(null===t)a().removeItem(f(e));else{var n=JSON.stringify(t);a().setItem(f(e),"string"==typeof n?n:"null")}},this.get=function(e){var t=a().getItem(f(e));return t&&JSON.parse(t)},this.remove=function(e){a().removeItem(f(e))}}),p=new v(function(){return c},"localStorage"),_=new v(function(){return h},"sessionStorage")},364:(e,t,n)=>{"use strict";n.d(t,{hH:()=>Q,dO:()=>I,Gj:()=>x,B$:()=>w,e7:()=>k,Rs:()=>D,Rx:()=>P,_y:()=>T,CM:()=>b,Ae:()=>C,bY:()=>E,y1:()=>R});var i=n(458);function r(e,t,n,i,r,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function o(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,u,"next",e)}function u(e){r(a,i,o,s,u,"throw",e)}s(void 0)})}}var a=n(756),s=n.n(a),u=n(317),c=n(306),l=n(29),h=n(901),d=n(203),f=n(451),v=n(487),p="LongTermSubscription",_=(0,h.A)(function e(t,n,i,r){(0,l.A)(this,e),this.data=t,this.uid=n,this.startDate=i,(0,v.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 e=[p,"#cancel"];return(0,d.ar)(e,arguments),D.call(this._db,e,this)}},{key:"update",value:function(e){var t=[p,"#update"];return(0,d.ar)(t,arguments,(0,d.gp)(f.A)),R.call(this._db,t,this,e)}}]),g=n(176),y="none",m="subscriptions",k={};function b(e,t){this._auth=e.authentication,this._ltsKey=(0,g.wT)(e,m,t),this._datasyncRoute="".concat(t.baseUrl.href,"/datasync/v2/").concat(e.appId),n(128)._this_init4browsers.call(this)}function w(e){u.H.set(this._ltsKey,e)}function C(e,t,n,i){return A.apply(this,arguments)}function A(){return(A=o(s().mark(function e(t,n,i,r){var o;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=this._auth._getCurrentAuthenticationDetails(t),e.next=1,x.call(this,o,!0,V(n,i,r,k));case 1:return e.abrupt("return",e.sent);case 2:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function E(e,t,n,i){return S.apply(this,arguments)}function S(){return(S=o(s().mark(function e(t,n,i,r){var o,a;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=this._auth._getCurrentAuthenticationDetails(t),a=f.A.ValueChange,r||a.excludeRevocations(),e.next=1,x.call(this,o,!1,V(n,a,i,k));case 1:return e.abrupt("return",e.sent);case 2:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function D(e,t){return N.apply(this,arguments)}function N(){return(N=o(s().mark(function e(t,n){var i;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._auth._getCurrentAuthenticationDetails(t),e.next=1,I.call(this,i,n.id);case 1:return e.abrupt("return",e.sent);case 2:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function R(e,t,n){return O.apply(this,arguments)}function O(){return(O=o(s().mark(function e(t,n,i){var r;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._auth._getCurrentAuthenticationDetails(t),e.next=1,F.call(this,r,n.data,n.startDate,i);case 1:return e.abrupt("return",e.sent);case 2:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function T(e,t){var n=this,r=[].concat((0,i.A)(e),["#getLongTermSubscriptions"]);(0,d.ar)(r,t);var o=this._auth._getCurrentAuthenticationDetails(r);return q.call(this).filter(function(e){return e.uid===o.uid}).map(function(e){return new _(e.data,e.uid,e.startDate,n)})}function P(e,t){var n=[].concat((0,i.A)(e),["#cleanLongTermSubscriptions"]);(0,d.ar)(n,t);var r=this._auth._getCurrentAuthenticationDetails(n),o=q.call(this).filter(function(e){return e.uid!==r.uid});this._saveLts(o)}function x(e,t,n,i){return L.apply(this,arguments)}function L(){return(L=o(s().mark(function e(t,n,i,r){var o,a,u,l;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!((o=q.call(this).find(function(e){return e.uid===t.uid&&e.data.path===i.path&&e.data.kind===i.kind&&e.data.context===i.context&&e.data.destination===i.destination}))&&n&&U(o.data,o.startDate,i))){e.next=1;break}return e.abrupt("return",new _(o.data,o.uid,o.startDate,this));case 1:return e.next=2,(0,c.bE)("".concat(this._datasyncRoute,"/subscriptions"),t.uid).addHeader((0,c.Dv)(t.webcomAuthToken)).addQueryParameters(n?{allowsUpdate:!0}:{delete:!0}).addJson(i).send();case 2:return a=e.sent,u=q.call(this).filter(function(e){return e.data.id!==(o&&o.data.id)}),n&&(l=new _(a.body,t.uid,r||Math.floor(Date.now()/1e3),this),u.push(Object.assign({},l))),this._saveLts(u),e.abrupt("return",l);case 3:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function I(e,t,n){return j.apply(this,arguments)}function j(){return(j=o(s().mark(function e(t,n,i){var r;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,(0,c.HY)("".concat(this._datasyncRoute,"/subscriptions"),t.uid,n).addHeader((0,c.Dv)(t.webcomAuthToken)).send();case 1:i||(r=q.call(this).filter(function(e){return e.data.id!==n}),this._saveLts(r));case 2:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function F(e,t,n,i){return M.apply(this,arguments)}function M(){return(M=o(s().mark(function e(t,n,i,r){var o,a,u;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,(0,c.yJ)("".concat(this._datasyncRoute,"/subscriptions"),t.uid,n.id).addHeader((0,c.Dv)(t.webcomAuthToken)).addJson(Q(n,r)).send();case 1:return o=e.sent,a=new _(o.body,t.uid,i,this),u=q.call(this).filter(function(e){return e.data.id!==o.body.id}),u.push(Object.assign({},a)),this._saveLts(u),e.abrupt("return",a);case 2:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function q(){return u.H.get(this._ltsKey)||[]}function V(e,t,n,i){var r={context:i&&i[n.kind]||n.context};return Object.assign({path:e.toString()},n,t,r)}function Q(e,t){return Object.assign({},e,e.encryption?{encryption:{alg:e.encryption.alg}}:{},t)}function U(e,t,n){var i,r;if(e.receivesRevocations!==n.receivesRevocations||e.mode!==n.mode)return!1;if("childEvent"===e.mode){var o=e.childEventFilter,a=n.childEventFilter;if(o.added!==a.added||o.removed!==a.removed||o.changed!==a.changed)return!1}if(((null===(i=e.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=e.expirationTimestampSeconds;return(Math.floor(Date.now()/1e3)-t)/(s-t)<.5}},373:e=>{e.exports=function(e){var t=Object(e),n=[];for(var i in t)n.unshift(i);return function e(){for(;n.length;)if((i=n.pop())in t)return e.value=i,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},412:(e,t,n)=>{"use strict";n.d(t,{Et:()=>s,Gv:()=>c,Kg:()=>a,Lm:()=>o,Tn:()=>u,yi:()=>l});var i=n(284),r=n(915);function o(e){return"boolean"==typeof e}function a(e){return"string"==typeof e}function s(e){return"number"==typeof e}function u(e){return"function"==typeof e}function c(e){return"object"===(0,i.A)(e)}function l(){return r.Ls&&(window.navigator.userAgent.match(/CriOS|Twitter for iPhone|FBAN\/FBIOS|Windows Phone/)||window.navigator.standalone)}},451:(e,t,n)=>{"use strict";n.d(t,{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(243),l=function(){function e(t){(0,o.A)(this,e),this.mode=t,t===v&&(this.childEventFilter=(0,r.A)((0,r.A)((0,r.A)({},_,!1),g,!1),y,!1))}return(0,a.A)(e,[{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[_]}},{key:"isChildRemoval",get:function(){return this.isChildEvent&&this.childEventFilter[g]}},{key:"isChildChange",get:function(){return this.isChildEvent&&this.childEventFilter[y]}},{key:"excludeRevocations",value:function(){return(0,s.ar)(["EventDescriptor","#excludeRevocations"],arguments),this.receivesRevocations=!1,this}}],[{key:"ValueChange",get:function(){var t=new e(f);return(0,u.gB)(t,"WithoutData",function(){return t.mode=p,t}),t}},{key:"Child",get:function(){var t=new e(v);return d(t,"Addition",_),d(t,"Removal",g),d(t,"Change",y),t}}])}();function h(e,t){var n;return e.mode===v?(n=Object.entries(e.childEventFilter).filter(function(e){var t=(0,i.A)(e,2);t[0];return t[1]}).map(function(e){var t=(0,i.A)(e,1)[0];return m[t]}),t&&n.push(c.$k)):(n=[c.Qg],t&&n.push(c.q)),n}function d(e,t,n){(0,u.gB)(e,t,function(){return e.childEventFilter[n]=!0,e})}var f="value",v="childEvent",p="noData",_="added",g="removed",y="changed",m=(0,r.A)((0,r.A)((0,r.A)({},_,c.u4),y,c._t),g,c.yL)},458:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(145);var r=n(800);function o(e){return function(e){if(Array.isArray(e))return(0,i.A)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,r.A)(e)||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:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var i=n(816);function r(e,t,n){return(t=(0,i.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},487:(e,t,n)=>{"use strict";function i(e,t,n,i){return o(e.prototype,t,n,i)}function r(e,t,n,i){return a(e.prototype,t,n,i)}function o(e,t,n,i){return s(e,t,{value:n},i)}function a(e,t,n,i){return s(e,t,{get:n},i)}function s(e,t,n,i){return Object.defineProperty(e,t,Object.assign(n,{enumerable:i,configurable:!0}))}n.d(t,{gB:()=>a,nA:()=>r,os:()=>i,ty:()=>o})},546:e=>{function t(n,i,r,o){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}e.exports=t=function(e,n,i,r){function o(n,i){t(e,n,function(e){return this._invoke(n,i,e)})}n?a?a(e,n,{value:i,enumerable:!r,configurable:!r,writable:!r}):e[n]=i:(o("next",0),o("throw",1),o("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,i,r,o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},579:(e,t,n)=>{var i=n(738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(i(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},585:(e,t,n)=>{"use strict";function i(e){var t=e.code||"UNKNOWN_ERROR",n=e.message||JSON.stringify(e),i=new Error("".concat(t,"[").concat(n,"]"));return i.code=t,i}n.d(t,{G:()=>i})},633:(e,t,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 t=r(),n=t.m(l),h=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function d(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))}var f={throw:1,return:2,break:3,continue:3};function v(e){var t,n;return function(i){t||(t={stop:function(){return n(i.a,2)},catch:function(){return i.v},abrupt:function(e,t){return n(i.a,f[e],t)},delegateYield:function(e,r,o){return t.resultName=r,n(i.d,c(e),o)},finish:function(e){return n(i.f,e)}},n=function(e,n,r){i.p=t.prev,i.n=t.next;try{return e(n,r)}finally{t.next=i.n}}),t.resultName&&(t[t.resultName]=i.v,t.resultName=void 0),t.sent=i.v,t.next=i.n;try{return e.call(this,t)}finally{i.p=t.prev,i.n=t.next}}}return(e.exports=l=function(){return{wrap:function(e,n,i,r){return t.w(v(e),n,i,r&&r.reverse())},isGeneratorFunction:d,mark:t.m,awrap:function(e,t){return new i(e,t)},AsyncIterator:s,async:function(e,t,n,i,r){return(d(t)?a:o)(v(e),t,n,i,r)},keys:u,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports},662:(e,t,n)=>{"use strict";function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}n.d(t,{A:()=>i})},738:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},756:(e,t,n)=>{var i=n(633)();e.exports=i;try{regeneratorRuntime=i}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=i:Function("r","regeneratorRuntime = r")(i)}},779:(e,t)=>{"use strict";var n,i={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(e){this.toString=function(){return"CORRUPT: "+this.message},this.message=e},invalid:function(e){this.toString=function(){return"INVALID: "+this.message},this.message=e},bug:function(e){this.toString=function(){return"BUG: "+this.message},this.message=e},notReady:function(e){this.toString=function(){return"NOT READY: "+this.message},this.message=e}}};i.bitArray={bitSlice:function(e,t,n){return e=i.bitArray._shiftRight(e.slice(t/32),32-(31&t)).slice(1),void 0===n?e:i.bitArray.clamp(e,n-t)},extract:function(e,t,n){var i=Math.floor(-t-n&31);return(-32&(t+n-1^t)?e[t/32|0]<<32-i^e[t/32+1|0]>>>i:e[t/32|0]>>>i)&(1<<n)-1},concat:function(e,t){if(0===e.length||0===t.length)return e.concat(t);var n=e[e.length-1],r=i.bitArray.getPartial(n);return 32===r?e.concat(t):i.bitArray._shiftRight(t,r,0|n,e.slice(0,e.length-1))},bitLength:function(e){var t,n=e.length;return 0===n?0:(t=e[n-1],32*(n-1)+i.bitArray.getPartial(t))},clamp:function(e,t){if(32*e.length<t)return e;var n=(e=e.slice(0,Math.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=i.bitArray.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial:function(e,t,n){return 32===e?t:(n?0|t:t<<32-e)+1099511627776*e},getPartial:function(e){return Math.round(e/1099511627776)||32},equal:function(e,t){if(i.bitArray.bitLength(e)!==i.bitArray.bitLength(t))return!1;var n,r=0;for(n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r},_shiftRight:function(e,t,n,r){var o,a,s;for(void 0===r&&(r=[]);t>=32;t-=32)r.push(n),n=0;if(0===t)return r.concat(e);for(o=0;o<e.length;o++)r.push(n|e[o]>>>t),n=e[o]<<32-t;return a=e.length?e[e.length-1]:0,s=i.bitArray.getPartial(a),r.push(i.bitArray.partial(t+s&31,t+s>32?n:r.pop(),1)),r},_xor4:function(e,t){return[e[0]^t[0],e[1]^t[1],e[2]^t[2],e[3]^t[3]]},byteswapM:function(e){var t,n;for(t=0;t<e.length;++t)n=e[t],e[t]=n>>>24|n>>>8&65280|(65280&n)<<8|n<<24;return e}},i.codec.utf8String={fromBits:function(e){var t,n,r="",o=i.bitArray.bitLength(e);for(t=0;t<o/8;t++)3&t||(n=e[t/4]),r+=String.fromCharCode(n>>>8>>>8>>>8),n<<=8;return decodeURIComponent(escape(r))},toBits:function(e){e=unescape(encodeURIComponent(e));var t,n=[],r=0;for(t=0;t<e.length;t++)r=r<<8|e.charCodeAt(t),3&~t||(n.push(r),r=0);return 3&t&&n.push(i.bitArray.partial(8*(3&t),r)),n}},i.codec.base64={_chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(e,t,n){var r,o="",a=0,s=i.codec.base64._chars,u=0,c=i.bitArray.bitLength(e);for(n&&(s=s.substr(0,62)+"-_"),r=0;6*o.length<c;)o+=s.charAt((u^e[r]>>>a)>>>26),a<6?(u=e[r]<<6-a,a+=26,r++):(u<<=6,a-=6);for(;3&o.length&&!t;)o+="=";return o},toBits:function(e,t){e=e.replace(/\s|=/g,"");var n,r,o=[],a=0,s=i.codec.base64._chars,u=0;for(t&&(s=s.substr(0,62)+"-_"),n=0;n<e.length;n++){if((r=s.indexOf(e.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(e){return i.codec.base64.fromBits(e,1,1)},toBits:function(e){return i.codec.base64.toBits(e,1)}},i.hash.sha256=function(e){this._key[0]||this._precompute(),e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()},i.hash.sha256.hash=function(e){return(new i.hash.sha256).update(e).finalize()},i.hash.sha256.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(e){"string"==typeof e&&(e=i.codec.utf8String.toBits(e));var t,n=this._buffer=i.bitArray.concat(this._buffer,e),r=this._length,o=this._length=r+i.bitArray.bitLength(e);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(t=512+r-(512+r&511);t<=o;t+=512)this._block(a.subarray(16*s,16*(s+1))),s+=1;n.splice(0,16*s)}else for(t=512+r-(512+r&511);t<=o;t+=512)this._block(n.splice(0,16));return this},finalize:function(){var e,t=this._buffer,n=this._h;for(e=(t=i.bitArray.concat(t,[i.bitArray.partial(1,1)])).length+2;15&e;e++)t.push(0);for(t.push(Math.floor(this._length/4294967296)),t.push(0|this._length);t.length;)this._block(t.splice(0,16));return this.reset(),n},_init:[],_key:[],_precompute:function(){var e,t,n=0,i=2;function r(e){return 4294967296*(e-Math.floor(e))|0}for(;n<64;i++){for(t=!0,e=2;e*e<=i;e++)if(i%e===0){t=!1;break}t&&(n<8&&(this._init[n]=r(Math.pow(i,.5))),this._key[n]=r(Math.pow(i,1/3)),n++)}},_block:function(e){var t,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(t=0;t<64;t++)t<16?n=e[t]:(i=e[t+1&15],r=e[t+14&15],n=e[15&t]=(i>>>7^i>>>18^i>>>3^i<<25^i<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+e[15&t]+e[t+9&15]|0),n=n+v+(h>>>6^h>>>11^h>>>25^h<<26^h<<21^h<<7)+(f^h&(d^f))+a[t],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(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()},i.hash.sha1.hash=function(e){return(new i.hash.sha1).update(e).finalize()},i.hash.sha1.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(e){"string"==typeof e&&(e=i.codec.utf8String.toBits(e));var t,n=this._buffer=i.bitArray.concat(this._buffer,e),r=this._length,o=this._length=r+i.bitArray.bitLength(e);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(t=this.blockSize+r-(this.blockSize+r&this.blockSize-1);t<=o;t+=this.blockSize)this._block(a.subarray(16*s,16*(s+1))),s+=1;n.splice(0,16*s)}else for(t=this.blockSize+r-(this.blockSize+r&this.blockSize-1);t<=o;t+=this.blockSize)this._block(n.splice(0,16));return this},finalize:function(){var e,t=this._buffer,n=this._h;for(e=(t=i.bitArray.concat(t,[i.bitArray.partial(1,1)])).length+2;15&e;e++)t.push(0);for(t.push(Math.floor(this._length/4294967296)),t.push(0|this._length);t.length;)this._block(t.splice(0,16));return this.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(e,t,n,i){return e<=19?t&n|~t&i:e<=39?t^n^i:e<=59?t&n|t&i|n&i:e<=79?t^n^i:void 0},_S:function(e,t){return t<<e|t>>>32-e},_block:function(e){var t,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]=e[l]}else u=e;for(i=c[0],r=c[1],o=c[2],a=c[3],s=c[4],t=0;t<=79;t++)t>=16&&(u[t]=this._S(1,u[t-3]^u[t-8]^u[t-14]^u[t-16])),n=this._S(5,i)+this._f(t,r,o,a)+s+u[t]+this._key[Math.floor(t/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}},e.exports&&(e.exports=i),void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n)},791:(e,t,n)=>{var i=n(172),r=n(546);e.exports=function e(t,n){function o(e,r,a,s){try{var u=t[e](r),c=u.value;return c instanceof i?n.resolve(c.v).then(function(e){o("next",e,a,s)},function(e){o("throw",e,a,s)}):n.resolve(c).then(function(e){u.value=e,a(u)},function(e){return o("throw",e,a,s)})}catch(e){s(e)}}var a;this.next||(r(e.prototype),r(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),r(this,"_invoke",function(e,t,i){function r(){return new n(function(t,n){o(e,i,t,n)})}return a=a?a.then(r,r):r()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},800:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var i=n(145);function r(e,t){if(e){if("string"==typeof e)return(0,i.A)(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,i.A)(e,t):void 0}}},816:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var i=n(284);function r(e){var t=function(e,t){if("object"!=(0,i.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=(0,i.A)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==(0,i.A)(t)?t:t+""}},854:(e,t,n)=>{"use strict";n.d(t,{El:()=>r,aZ:()=>o,y:()=>i});var i=n(171).J.WebcomDependencies||{},r={};function o(e,t,n){Object.defineProperty(r,e,{enumerable:!0,get:t,set:n})}},869:(e,t,n)=>{var i=n(887);e.exports=function(e,t,n,r,o){var a=i(e,t,n,r,o);return a.next().then(function(e){return e.done?e.value:a.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,n)=>{var i=n(993),r=n(791);e.exports=function(e,t,n,o,a){return new r(i().w(e,t,n,o),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},901:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(816);function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(0,i.A)(r.key),r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},915:(e,t,n)=>{"use strict";n.d(t,{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?_(o):_(s):_(u)}function _(e){v=e,h=e===o,d=0===e.indexOf(a),l=(c[e]||"")+"3.10.1"}(0,r.aZ)(f,function(){return v},function(e){return _(e)})},993:(e,t,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 t,n,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.toStringTag||"@@toStringTag";function u(e,r,o,a){var s=r&&r.prototype instanceof l?r:l,u=Object.create(s.prototype);return i(u,"_invoke",function(e,i,r){var o,a,s,u=0,l=r||[],h=!1,d={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,n){return o=e,a=0,s=t,d.n=n,c}};function f(e,i){for(a=e,s=i,n=0;!h&&u&&!r&&n<l.length;n++){var r,o=l[n],f=d.p,v=o[2];e>3?(r=v===i)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=t):o[0]<=f&&((r=e<2&&f<o[1])?(a=0,d.v=i,d.n=o[1]):f<v&&(r=e<3||o[0]>i||i>v)&&(o[4]=e,o[5]=i,d.n=v,a=0))}if(r||e>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?t: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=t}else if((n=(h=d.n<0)?s:e.call(i,d))!==c)break}catch(e){o=t,a=1,s=e}finally{u=1}}return{value:n,done:h}}}(e,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(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,i(e,s,"GeneratorFunction")),e.prototype=Object.create(v),e}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]"}),(e.exports=r=function(){return{w:u,m:p}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.d(i,{default:()=>v});var e=n(171),t=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(e){for(var t=e.substring(0,8),n=0,i=0;i<8;++i)n=64*n+c.indexOf(t[i]);return n}var f="Webcom",v=(0,r.A)(function e(){(0,t.A)(this,e),this._init.apply(this,arguments)},[{key:"_init",value:function(){(0,u.$8)(["new ",f],"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(e,t){return new o.Ay(e,t)}},{key:"getUniqueKeyDate",value:function(e){return new Date(d(e))}},{key:"dependencies",get:function(){return s.El}}]),p=(0,a.h)("api.Webcom",f),_=n(458),g=n(296),y=n(915);function m(e){"http:"===e.protocol&&y.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 k=new RegExp("^(?:([^:]+:)//)?(?:[^/@]+@)?([^/:]+(?::\\d+)?)(?:/.*)?$"),b="io.datasync.orange.com";function w(t){if(t&&(e.J.URL&&t instanceof URL||t.href&&t.protocol&&t.host))return t;var n=t?k.exec(t):[b,void 0,b];if