/*!
 * Webcom. Build realtime apps. Share and sync data instantly between your clients
 *
 * Module name: Webcom
 * Version:     3.2.0
 * Created:     2022-07-28T09:14:28.033Z
 *
 * Copyright (C) <2015-2022> Orange
 *
 * This software is confidential and proprietary information of Orange.
 * You shall not disclose such Confidential Information and shall use it only in
 * accordance with the terms of the agreement you entered into.
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 *
 * If you are Orange employee you shall use this software in accordance with
 * the Orange Source Charter (http://opensource.itn.ftgroup/index.php/Orange_Source_Charter)
 */
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var e={};t.d(e,{default:()=>ve});var n=function(){if("undefined"!=typeof globalThis)return globalThis;return"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t.g?t.g:Function("return this")()}();function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(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,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e){if(t){if("string"==typeof t)return u(t,e);var n=Object.prototype.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)?u(t,e):void 0}}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],u=!0,a=!1;try{for(n=n.call(t);!(u=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);u=!0);}catch(t){a=!0,i=t}finally{try{u||null==n.return||n.return()}finally{if(a)throw i}}return o}}(t,e)||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.")}()}function c(t){return c="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},c(t)}function h(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||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.")}()}var l=n.WebcomDependencies||{},f={};function d(t,e,n){Object.defineProperty(f,t,{enumerable:!0,get:e,set:n})}var p="browser",v="mobile/",g="".concat(v,"android"),y="".concat(v,"iOS"),m={browser:"b"};m[g]="a",m[y]="i",m.node="n";var _,b=!0,k="device",w=l.device;if(!w){var S=n.window;S&&S.location?S.location.href.indexOf("webview.datasync.orange.com")<0?A(p):A(g):A(y)}function A(t){w=t,b=t===p,0===t.indexOf(v),_=(m[t]||"")+"3.2.0"}function O(t){return"boolean"==typeof t}function R(t){return"string"==typeof t}function I(t){return"function"==typeof t}function E(t){return"object"===c(t)}d(k,(function(){return w}),(function(t){return A(t)}));var P="Webcom internal error";function N(t,e){t||x(P,e)}var C={values:[]};function T(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];Object.assign(C,{method:t,args:e||[],checkers:r})}var x=function(t,e){var n;throw new Error("".concat((n="").concat.apply(n,h(t)),": ").concat(e))};function j(t,e){if(!C.method){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];T.apply(void 0,[t,e].concat(r))}var o=C.method,u=C.args,a=C.checkers,s=C.values;Object.assign(C,{method:void 0,args:void 0,checkers:void 0,values:[]}),u.length>a.length&&x(o,"too many arguments, ".concat(u.length," instead of ").concat(a.length)),a.forEach((function(t,e){return F(t,u[e],o,(function(t){return"argument #".concat(e+1," ").concat(t)}))})),s.forEach((function(t){var e=t.name,n=t.value;return F(t.checker,n,o,(function(t){return"".concat(e," ").concat(t)}))}))}function F(t,e,n,r){var i=t(e);i&&x(n,r(i))}function H(t){return function(e){return W("undefined")(e)&&t&&t(e)}}var U=function(t){return void 0===t?"is missing":""};function L(t){return function(e){return!(e instanceof t)&&"must be an instance of ".concat(t.name)}}function W(t){return function(e){return c(e)!==t&&"must be a ".concat(t)}}var D=W("string"),J=W("function"),M=W("boolean"),K=W("number"),q=W("object");function V(){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 G(){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 z(t,e){return function(n){return!t(n)&&(e||"is not valid")}}z((function(t){return"number"==typeof t&&Math.floor(t)===t}),"must be an integer");var B="console",Q=l.console,X=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 i=function(t){return E(t)?JSON.stringify(t):(t||"undefined").toString()};if(R(t)){var o=0;return[t=t.replace(/%(.)/g,(function(t,e){switch(e){case"%":return"%";case"s":case"o":case"O":return i(n[o++]);case"d":case"i":case"f":return n[o++];default:return t}}))].concat(h(n.slice(o).map(i))).join(" ")}return[t].concat(n).map(i).join(" ")};function Y(t,e,n,r,i){if(!n||!r||!i){var o=e,u=function(t){return function(e){return o("[".concat(t,"] ").concat(e))}};n=n||u("INFO"),r=r||u("WARN"),i=i||u("ERR!"),e=u("LOG ")}return{log:function(){return e.call(t,X.apply(void 0,arguments))},info:function(){return n.call(t,X.apply(void 0,arguments))},warn:function(){return r.call(t,X.apply(void 0,arguments))},error:function(){return i.call(t,X.apply(void 0,arguments))}}}if(I(Q))Q=Y(n,Q);else if(E(Q)&&Q){var $=Q,Z=$.log,tt=$.info,et=$.warn,nt=$.error;Q=Y(Q,Z,tt,et,nt)}else{Q=Y(n.console,n.console.log,n.console.info,n.console.warn,n.console.error)}d(B,(function(){return Q}),(function(t){return Q=t}));var rt="setTimeout",it=l.setTimeout;it||(it=n.setTimeout),d(rt,(function(){return it}),(function(t){return it=t})),n.setTimeout||(n.setTimeout=it),n.setImmediate||(n.setImmediate=it);var ot="clearTimeout",ut=l.clearTimeout;ut||(ut=n.clearTimeout),d(ot,(function(){return ut}),(function(t){return ut=t})),n.clearTimeout||(n.clearTimeout=ut),n.clearImmediate||(n.clearImmediate=ut);var at="setInterval",st=l.setInterval;st||(st=n.setInterval),d(at,(function(){return st}),(function(t){return st=t}));var ct="clearInterval",ht=l.clearInterval;ht||(ht=n.clearInterval),d(ct,(function(){return ht}),(function(t){return ht=t}));var lt=Function.prototype;var ft={};function dt(t,e){var n=t.length;return n>=e?t.substring(0,e):t+yt.substring(0,e-n)}function pt(t){return t.map((function(t){return I(t)?t():t}))}var vt=function(){function t(e,n,i,o){r(this,t),this._name=e,this._prefix=n,this._count=void 0===ft[e]?ft[e]=0:++ft[e],this.displayTimestamp=i,this.setPrefixWidth(o||8),this._log=this._emitLog.bind(this,Q.log),this._info=this._emitLog.bind(this,Q.info),this._warn=this._emitLog.bind(this,Q.warn),this._error=this._emitLog.bind(this,Q.error),this._enabled=!0}return o(t,[{key:"name",get:function(){return this._name}},{key:"_emitLog",value:function(t,e){var n=this.displayTimestamp?[(new Date).toISOString()]:[];n.push(this._displayedPrefix);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];R(e)?(n.push(e),e=n.join(" "),t.apply(void 0,[e].concat(h(pt(i))))):t.apply(void 0,n.concat(h(pt([e].concat(i)))))}},{key:"setPrefixWidth",value:function(t){this._displayedPrefix="".concat(dt(this._prefix,t)," #").concat(dt(this._count.toString(),3))}},{key:"setLevel",value:function(t){this._enabled=t>=0,this.log=t>=Rt.LOG?this._log:lt,this.info=t>=Rt.INFO?this._info:lt,this.warn=t>=Rt.WARN?this._warn:lt,this.error=t>=Rt.ERROR?this._error:lt}},{key:"updateLevel",value:function(t){this._enabled&&this.setLevel(t)}}]),t}(),gt=-1,yt="                                                  ",mt=!1,_t=15,bt=[],kt=[""];function wt(t,e,n){t.name.substring(0,e.length)===e&&t.setLevel(n)}function St(t){mt=t,bt.forEach((function(t){return t.displayTimestamp=mt}))}function At(t,e){for(var n={index:-1,subsumed:!1},r=!!e,i=0;i<kt.length;++i){var o=kt[i];if(t===o){if(n.index=i,!r||n.subsumed)break}else if(!n.subsumed)if(t.substring(0,o.length)===o){if(n.subsumed=!0,r&&e.splice(0,e.length),n.index>-1)break}else r&&o.substring(0,t.length)===t&&e.push(o)}return n}var Ot="LogManager",Rt=function(){function t(){r(this,t)}return o(t,null,[{key:"enable",value:function(t){j([Ot,".enable"],arguments,D),1===kt.length&&""===kt[0]&&(kt.splice(0,1),bt.forEach((function(t){return wt(t,"",gt)})));var e=At(t),n=e.index,r=e.subsumed;n<0&&(kt.push(t),r||bt.forEach((function(e){return wt(e,t,Et)})))}},{key:"disable",value:function(t){j([Ot,".disable"],arguments,D);var e=[],n=At(t,e),r=n.index,i=n.subsumed;r>=0&&(kt.splice(r,1),i||bt.forEach((function(n){for(var r=!0,i=0;i<e.length;++i){var o=e[i];if(n.name.substring(0,o.length)===o){r=!1;break}}r&&wt(n,t,gt)})))}},{key:"showTimestamp",value:function(){j([Ot,".showTimestamp"],arguments),St(!0)}},{key:"hideTimestamp",value:function(){j([Ot,".hideTimestamp"],arguments),St(!1)}},{key:"setPrefixWidth",value:function(t){j([Ot,".setPrefixWidth"],arguments,K),t<0?t=0:t>yt.length&&(t=yt.length),_t=t,bt.forEach((function(t){return t.setPrefixWidth(_t)}))}},{key:"level",get:function(){return Et},set:function(t){j([Ot,".level"],arguments,K),t>gt&&t!==Et&&(bt.forEach((function(e){return e.updateLevel(t)})),Et=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 Q.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?Q.log("********** REVOKED ".concat(n," **********"),t):Q.log("********** COMPLETED ".concat(n," **********")),e}}},{key:"debugOnCallbackWithCancel",value:function(e){var n=e&&e.toUpperCase();return[t.debugOnCallback(e),function(t){return Q.log.apply(Q,["********** COMPLETE ".concat(n," **********")].concat(h(t?["FAILED:",t.code,t.message]:["cancelled"])))}]}}]),t}();function It(t,e){var n=new vt(t,e||t,mt,_t);return bt.push(n),n.setLevel(Et),n}var Et=Rt.INFO,Pt="WebcomApp",Nt=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,t),this._logger=It("api.WebcomApp",Pt),this._logger.log("Initializing ".concat(e," with options ").concat(n)),this._services={},this.appId=e,this.config={},R(n)&&(n=Object.keys(Tt).reduce((function(t,e){return t[e]={baseUrl:n},t}),{})),this._fillConfig(n)}return o(t,[{key:"dispose",value:function(){j([Pt,"#dispose"],arguments),Object.values(this._services).forEach((function(t){return t._dispose()})),this._services={}}},{key:"_fillConfig",value:function(t){Ct.call(this,t,Tt)}},{key:"toString",value:function(){return"".concat(this.appId,"{").concat(Object.keys(this._services).join(","),"}")}}]),t}();function Ct(t,e){var n=this;!function t(e,r,i,o){Object.entries(i).forEach((function(i){var u=s(i,2),a=u[0],c=u[1];if(c instanceof Object&&!(c instanceof Array))e[a]=e[a]||{},t(e[a],r[a]||{},c,o.concat(a));else{var h=r[a],l=c[1]||function(t){return t};try{e[a]=l(void 0===h?void 0===e[a]?c.length?c[0]:c:e[a]:h)}catch(t){var f="".concat(Pt,".Configuration.").concat(o.concat(a).join("."));void 0===t.value?x(f,t.message):(n._logger.warn("%s: %s",f,t.message),e[a]=t.value)}}}))}(this.config,t,e,[])}var Tt={};function xt(t,e){if(0===t.length||0===e.length)return t.concat(e);var n=t[t.length-1],r=Ht(n);return 32===r?t.concat(e):Ut(e,r,0|n,t.slice(0,t.length-1))}function jt(t){var e=t.length;return 0===e?0:32*(e-1)+Ht(t[e-1])}function Ft(t,e,n){return 32===t?e:(n?0|e:e<<32-t)+1099511627776*t}function Ht(t){return Math.round(t/1099511627776)||32}function Ut(t,e,n,r){var i,o;for(void 0===r&&(r=[]);e>=32;e-=32)r.push(n),n=0;if(0===e)return r.concat(t);for(i=0;i<t.length;i++)r.push(n|t[i]>>>e),n=t[i]<<32-e;return o=Ht(t.length?t[t.length-1]:0),r.push(Ft(e+o&31,e+o>32?n:r.pop(),1)),r}(function(){function t(e){r(this,t),this.message=e}o(t,[{key:"toString",value:function(){return"CORRUPT: "+this.message}}])})(),function(){function t(e){r(this,t),this.message=e}o(t,[{key:"toString",value:function(){return"INVALID: "+this.message}}])}(),function(){function t(e){r(this,t),this.message=e}o(t,[{key:"toString",value:function(){return"BUG: "+this.message}}])}(),function(){function t(e){r(this,t),this.message=e}o(t,[{key:"toString",value:function(){return"NOT READY: "+this.message}}])}();var Lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var Wt=[1732584193,4023233417,2562383102,271733878,3285377520],Dt=[1518500249,1859775393,2400959708,3395469782],Jt=function(){function t(e){r(this,t),e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()}return o(t,[{key:"reset",value:function(){return this._h=Wt.slice(0),this._buffer=[],this._length=0,this}},{key:"update",value:function(t){"string"==typeof t&&(t=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==(3&e)&&(n.push(r),r=0);return 3&e&&n.push(Ft(8*(3&e),r)),n}(t));var e,n=this._buffer=xt(this._buffer,t),r=this._length,i=this._length=r+jt(t);for(e=512+r&-512;e<=i;e+=512)this._block(n.splice(0,16));return this}},{key:"finalize",value:function(){var t,e=this._buffer,n=this._h;for(t=(e=xt(e,[Ft(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}},{key:"_f",value:function(t,e,n,r){return t<=19?e&n|~e&r:t<=39?e^n^r:t<=59?e&n|e&r|n&r:t<=79?e^n^r:void 0}},{key:"_S",value:function(t,e){return e<<t|e>>>32-t}},{key:"_block",value:function(t){var e,n,r,i,o,u,a,s=t.slice(0),c=this._h;for(r=c[0],i=c[1],o=c[2],u=c[3],a=c[4],e=0;e<=79;e++)e>=16&&(s[e]=this._S(1,s[e-3]^s[e-8]^s[e-14]^s[e-16])),n=this._S(5,r)+this._f(e,i,o,u)+a+s[e]+Dt[Math.floor(e/20)]|0,a=u,u=o,o=this._S(30,i),i=r,r=n;c[0]=c[0]+r|0,c[1]=c[1]+i|0,c[2]=c[2]+o|0,c[3]=c[3]+u|0,c[4]=c[4]+a|0}}],[{key:"hash",value:function(e){return(new t).update(e).finalize()}}]),t}();function Mt(t){return decodeURIComponent(t.replace(/\+/g," "))}function Kt(){var t=2147483648;return Math.floor(Math.random()*t).toString(36)+Math.abs(Math.floor(Math.random()*t)^Date.now()).toString(36)}function qt(t){var e={};return t.replace(/^[^?]*\?/,"").split("&").forEach((function(t){var n=t.indexOf("=");if(n<0)e[Mt(t)]=!0;else{var r=Mt(t.substring(0,n));e[r]=Mt(t.substring(n+1))}})),e}function Vt(t){if(!t)return"";var e=[];return Object.entries(t).forEach((function(t){var n=s(t,2),r=n[0],i=n[1];null!=i&&(E(i)&&(i=JSON.stringify(i)),e.push(encodeURIComponent(r)+"="+encodeURIComponent(i)))})),e.join("&")}function Gt(t,e){var n=(t.indexOf("?")<0?"?":"&")+Vt(e),r=t.indexOf("#");return r<0?t+n:t.substring(0,r)+n+t.substring(r)}function zt(t,e){return function(t,e,n){var r,i="",o=0,u=Lt,a=0,s=jt(t);for(n&&(u=u.substr(0,62)+"-_"),r=0;6*i.length<s;)i+=u.charAt((a^t[r]>>>o)>>>26),o<6?(a=t[r]<<6-o,o+=26,r++):(a<<=6,o-=6);for(;3&i.length&&!e;)i+="=";return i}(Jt.hash(t),!1,e)}function Bt(t){return t!=t||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY}var Qt=/^(?:#|\.hash\.)(.+)$/,Xt=function(){function t(e,n){switch(r(this,t),arguments.length){case 0:this.isRoot_=!0,this.pieces_=[],this.pieceNum_=0;break;case 1:O(e)?(this.isRoot_=e,this.pieces_=[]):(this.isRoot_=!0,this.pieces_=e.split("/").filter((function(t){return t.length>0}))),this.pieceNum_=0;break;default:this.isRoot_=!0,this.pieces_=e,this.pieceNum_=n}}return o(t,[{key:"getFront",value:function(){return this.pieceNum_>=this.pieces_.length?null:this.pieces_[this.pieceNum_]}},{key:"popFront",value:function(){var e=this.pieceNum_;return e<this.pieces_.length&&e++,new t(this.pieces_,e)}},{key:"getBack",value:function(){return this.pieceNum_<this.pieces_.length?this.pieces_[this.pieces_.length-1]:null}},{key:"toString",value:function(){for(var t="",e=this.pieceNum_;e<this.pieces_.length;e++)this.pieces_[e]&&(t+="/"+this.pieces_[e]);return t||"/"}},{key:"parent",value:function(){if(this.pieceNum_>=this.pieces_.length)return null;for(var e=[],n=this.pieceNum_;n<this.pieces_.length-1;n++)e.push(this.pieces_[n]);return new t(e,0)}},{key:"child",value:function(e){var n=this,r=function(t,e){return F(e,t,"Invalid path",(function(e){return"".concat(t," ").concat(e)}))},i=this.pieces_.slice(this.pieceNum_);return e instanceof t?i.push.apply(i,h(e.pieces_.slice(e.pieceNum_))):(r(e,D),e.split("/").forEach((function(e){switch(e){case"":case".":break;case"..":i.pop();break;case t.InfoKey:if(n.isRoot_&&0===i.length){i.push(e);break}default:var o=Qt.exec(e);if(o){var u=o[1];r(u,fe);var a=zt(u,!0);i.push(".list."+a.substring(0,2)),i.push(a.substring(2,4)),i.push(a.substring(4,6)),i.push(u)}else r(e,fe),i.push(e)}}))),new t(i,0)}},{key:"isEmpty",value:function(){return this.pieceNum_>=this.pieces_.length}},{key:"length",value:function(){return this.pieces_.length-this.pieceNum_}},{key:"contains",value:function(t){if(this.length()>t.length())return!1;for(var e=this.pieceNum_,n=t.pieceNum_;e<this.pieces_.length;){if(this.pieces_[e]!==t.pieces_[n])return!1;++e,++n}return!0}}],[{key:"RelativePath",value:function(e,n){var r=e.getFront(),i=n.getFront();return null===r?n:r===i?t.RelativePath(e.popFront(),n.popFront()):void x(P,"innerPath (".concat(n,") is not within outerPath (").concat(e,")"))}},{key:"Empty",get:function(){return Yt}},{key:"Info",get:function(){return $t}},{key:"InfoKey",get:function(){return".info"}}]),t}(),Yt=new Xt,$t=new Xt(Xt.InfoKey),Zt="child_added",te="child_removed",ee="child_changed",ne="child_ack",re="value",ie="value_ack",oe=(function(){function t(e,n,i){var o=i.childName,u=i.prevChildName,a=i.acknowledged;r(this,t),this.type=e,this.snapshotNode=n,this.childName=o,this.prevName=u,this.acknowledged=a}o(t,null,[{key:"Value",value:function(e,n){return new t(n?ie:re,e,{acknowledged:e.acknowledged()})}},{key:"ChildChanged",value:function(e,n,r,i){return new t(i?ne:ee,e,{childName:n,prevChildName:r,acknowledged:e.acknowledged()})}},{key:"ChildRemoved",value:function(e,n,r){return e.isEmpty()?new t(ne,e,{childName:n,acknowledged:r}):new t(te,e,{childName:n,acknowledged:r})}},{key:"ChildAdded",value:function(e,n,r){return new t(Zt,e,{childName:n,prevChildName:r,acknowledged:e.acknowledged()})}}])}(),10485760),ue="(?:".concat(["list","item"].map((function(t){return"\\.".concat(t,"\\.")})).join("|"),")?").concat("[^.$\\[\\]#/\\u0000-\\u001f\\u007f]","+"),ae=new RegExp("^".concat(ue,"$"));function se(t,e){if(e.length>1e3)return"contains a cyclic object value (".concat(e.slice(0,100).join("."),"...)");switch(c(t)){case"undefined":return"contains undefined".concat(ce(e));case"function":return"contains a function".concat(ce(e));case"number":return Bt(t)?"contains ".concat(t).concat(ce(e)):"";case"string":return t.length>oe/3&&function(t){for(var e,n,r=[],i=0,o=0;o<t.length;o++)(e=t.charCodeAt(o))>=55296&&e<=56319&&(n=e-55296,N(++o<t.length,"Surrogate pair missing trail surrogate."),e=65536+(n<<10)+(t.charCodeAt(o)-56320)),e<128?r[i++]=e:e<2048?(r[i++]=e>>6|192,r[i++]=63&e|128):e<65536?(r[i++]=e>>12|224,r[i++]=e>>6&63|128,r[i++]=63&e|128):(r[i++]=e>>18|240,r[i++]=e>>12&63|128,r[i++]=e>>6&63|128,r[i++]=63&e|128);return r}(t).length>oe?"contains a string greater than ".concat(oe," utf8 bytes").concat(ce(e)," ('").concat(t.substring(0,50),"...')"):"";case"object":if(t){var n="";return Object.entries(t).some((function(t){var r=s(t,2),i=r[0],o=r[1];return n=".sv"!==i&&!ae.test(i)&&"contains an invalid key (".concat(i,")").concat(ce(e))||se(o,e.concat(i))})),n}default:return""}}function ce(t){return t.length?" in property '".concat(t.join("."),"'"):""}G((he=q,function(t){return null===t?"must not be null":he&&he(t)}),(function(t){return se(t,[])}));var he,le,fe=(le=ae,z((function(t){return le.test(t)}),"must be a valid key (non-empty, with no '.', '#', '$', '/', '[' nor ']')")),de=G(D,fe),pe="Webcom",ve=function(){function t(){r(this,t),this._init.apply(this,arguments)}return o(t,[{key:"_init",value:function(){x(["new ",pe],"this static class cannot be instantiated")}}],[{key:"SDK_VERSION",get:function(){return"3.2.0"}},{key:"Log",get:function(){return Rt}},{key:"App",value:function(t,e){return j([pe,".App"],arguments,de,H(V(q,D))),new Nt(t,e)}},{key:"dependencies",get:function(){return f}}]),t}();function ge(t){"http:"===t.protocol&&b&&"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 ye=new RegExp("^(?:([^:]+:)//)?(?:[^/@]+@)?([^/:]+(?::\\d+)?)(?:/.*)?$"),me="io.datasync.orange.com";function _e(t,e){return function(n){var r=t(n);if(r)throw new Error(r);return e?e(n):n}}function be(t,e,n,r){return ke(t,e,{value:n},r)}function ke(t,e,n,r){return Object.defineProperty(t,e,Object.assign(n,{enumerable:r,configurable:!0}))}var we="some",Se="required",Ae="none",Oe=function(){function t(e,n){r(this,t),N(e===we||e===Se||e===Ae,"Wrong state value for a new State object: expecting 'some', 'required' or 'none'."),this.state=e,N(e!==we||n&&n.webcomAuthToken,"Missing details or webcomAuthToken for a new 'some' State"),this.details=n}return o(t,[{key:"isUnauthenticated",value:function(){return this.state===Ae}},{key:"isAuthenticated",value:function(){return this.state===we}},{key:"isRequired",value:function(){return this.state===Se}},{key:"isSameAs",value:function(t){return this.state===t.state&&(this.state!==we||this.details.webcomAuthToken===t.details.webcomAuthToken)}}]),t}(),Re=new Oe(Ae),Ie=(new Oe(Se),function(t){return new Oe(we,t)});var Ee,Pe="Authentication";Tt.Authentication={from:[void 0,_e(H(L(Nt)))],baseUrl:[null,function(t){if(t&&(n.URL&&t instanceof URL||t.href&&t.protocol&&t.host))return t;var e=t?ye.exec(t):[me,void 0,me];if(e){var r=s(e,3),i=r[0],o=r[1],u=r[2];return o||(i="".concat(o="https:","//").concat(i)),{href:i,protocol:o,host:u}}throw new Error("cannot parse base URL: ".concat(t))}],storage:[void 0,_e(H(V(D,J)))],initialState:[void 0,function(t){return t&&JSON.parse(t)}]},function(t,e,n,r){(function(t,e,n,r){ke(t,e,{get:n},r)})(t.prototype,e,n,r)}(Nt,"authentication",(function(){var t=this._services.Authentication;if(!t){var e=this.config.Authentication.from;t=e?e.authentication:Ee(this),this._services.Authentication=t}return t}));function Ne(t){var e=t.code||"UNKNOWN_ERROR",n=t.message||JSON.stringify(t),r=new Error("".concat("Authentication",": ").concat(e,"[").concat(n,"]"));return r.code=e,r}var Ce=function(){function t(){r(this,t),this.cache_={}}return o(t,[{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_={}}}]),t}(),Te="localStorage",xe=l.localStorage;xe||(xe=n.localStorage||new Ce),d(Te,(function(){return xe}),(function(t){return xe=t}));var je="sessionStorage",Fe=l.sessionStorage;function He(t){return"webcom:"+t}Fe||(Fe=n.sessionStorage||null),d(je,(function(){return Fe}),(function(t){return Fe=t}));var Ue=o((function t(e,n){if(r(this,t),e){var i=He("sentinel");e.setItem(i,""),e.removeItem(i),this.set=function(t,n){null===n?e.removeItem(He(t)):e.setItem(He(t),JSON.stringify(n))},this.get=function(t){var n=e.getItem(He(t));return n&&JSON.parse(n)},this.remove=function(t){e.removeItem(He(t))}}else this.set=this.get=this.remove=function(){x("JSONStorage","the ".concat(n," implementation could not be found!"))}})),Le=new Ue(xe,"localStorage"),We=new Ue(Fe,"sessionStorage");function De(t,e){return De=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},De(t,e)}function Je(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Me(t,e,n){return Me=Je()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&De(i,n.prototype),i},Me.apply(null,arguments)}var Ke="XMLHttpRequest",qe=l.XMLHttpRequest;qe||(void 0===(qe=n.XMLHttpRequest)||function(){if(b&&"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}())&&x(P,"XMLHttpRequest not found"),d(Ke,(function(){return qe}),(function(t){return qe=t}));var Ve=It("network.HttpRequest","HttpRequest"),Ge="application/x-www-form-urlencoded",ze="application/json",Be="Content-Type",Qe="PUT",Xe="PATCH",Ye="POST",$e="DELETE",Ze="GET",tn=o((function t(e,n){r(this,t),this.name=e,this.value=n})),en="HttpRequest",nn=function(){function t(e){r(this,t);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];this.url=Gt(i.filter((function(t){return t&&t.length})).join("/"),{c:_}),this.method=e.toUpperCase(),this.headers={Accept:"application/json;text/plain"}}return o(t,[{key:"addQueryParameters",value:function(t){return this.url=Gt(this.url,t),this}},{key:"addJson",value:function(t){return this.contentType=ze,this.data=t,this}},{key:"addForm",value:function(t){return this.contentType=Ge,this.data=t,this}},{key:"addHeader",value:function(t){return j([en,"#addHeader"],arguments,L(tn)),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){Ve.log("==> ".concat(t.method," ").concat(t.url)),Object.keys(t.headers).forEach((function(e){return Ve.log("  > HEADER ".concat(e,": ").concat(t.headers[e]))})),t.data&&Ve.log("  > DATA: ".concat(JSON.stringify(t.data)));var r=null;void 0!==t.data&&[Ye,Qe,Xe].indexOf(t.method)>=0&&((r=t.contentType===Ge?Vt(t.data):t.contentType===ze?JSON.stringify(t.data):t.data)?t.headers[Be]=t.contentType:delete t.headers[Be]),rn.call(t,r,e,(function(t){Ve.log("<== ERROR: ".concat(JSON.stringify(t))),n(Ne(t))}))}))}}]),t}();function rn(t,e,n){var r=this,i=new qe;i.onreadystatechange=function(){if(4===i.readyState)try{var t=i.responseText,o=i.status,u=t.length?JSON.parse(t):{};if(o>=400&&o<500)n(u.error||u);else if(o>=200&&o<300||304===o||1223===o){var a={body:u},s=a.body.error||null;s?n(E(s)?s:{code:a.body.status,message:s}):(r.readHeaders&&(a.headers=function(t){return function(){var e=t.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};return e.forEach((function(t){var e=t.indexOf(": "),r=t.substring(0,e).toLowerCase();n[r]=t.substring(e+2)})),n}}(i)),Ve.log("<== ".concat(JSON.stringify(a))),e(a))}else n({code:"RESPONSE_PAYLOAD_ERROR",message:"HTTP status ".concat(o)})}catch(t){n({code:"RESPONSE_PAYLOAD_ERROR",message:t.toString()})}},i.open(this.method,this.url,!0),Object.entries(this.headers).forEach((function(t){var e=s(t,2),n=e[0],r=e[1];return i.setRequestHeader(n,r)})),i.send(t)}function on(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Me(nn,[Ze].concat(e))}function un(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Me(nn,[Qe].concat(e))}function an(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Me(nn,[Ye].concat(e))}function sn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Me(nn,[$e].concat(e))}function cn(t){return new tn("Authorization","Bearer ".concat(t))}be(ve,"avatarURL",(function(t){switch(j([pe,".avatarURL"],arguments,q),t&&t.provider){case"facebook":return"https://graph.facebook.com/".concat(t.providerUid,"/picture?type=large");case"github":return t.providerProfile.avatar_url;case"gitlab":case"google":return t.providerProfile.picture}}));var hn={code:"USER_DENIED",message:"The user aborted authentication"},ln={facebook:{height:650,width:680},google:{height:460,width:490},github:{height:760,width:340},gitlab:{height:710,width:800},orange:{height:700,width:1e3},mobileconnectOFR:{height:540,width:700}},fn={menubar:0,location:0,resizable:0,scrollbars:1,status:0,dialog:1,width:700,height:375},dn={};function pn(t,e,n){return R(t.storage)?t.storage:"auth:".concat(e,":").concat(n)}function vn(t,e,n){it((function(){return t(e,n)}))}var gn=function(){function t(e){r(this,t),this._logger=It("api.Authentication",Pe),this._logger.log("Initializing with options ".concat(JSON.stringify(e.config.Authentication))),this._app=e,this._init(e)}return o(t,[{key:"_init",value:function(t){var e=t.config.Authentication;ge.call(this,e.baseUrl);var n,r,i,o=(r=t,i=e.baseUrl,(n="/".concat(i.protocol.slice(0,-1),"/").concat(i.host,"/").concat(r.appId,"/"))+(dn[n]=(dn[n]||0)+1));this._currentState=function(t){try{return new Oe(t.state,t.details)}catch(t){return Re}}(function(t,e){return t.initialState||(I(t.storage)?{}:Le.get(pn(t,"state",e)))}(e,o)),this._authStateSetter=function(t,e){if(I(t.storage))return function(e){return t.storage(JSON.stringify(e))};var n=pn(t,"state",e);return function(t){return t&&!t.isUnauthenticated()?Le.set(n,t):Le.remove(n)}}(e,o),this._oauthSessionKey=pn({},"ongoing",o),this.isAuthContextual=!1,this._firstSubscriptions=[],this._lastSubscriptions=[],this._authRoute="".concat(e.baseUrl.href,"/auth/v2/").concat(t.appId),this._resumeAuthState(),this._logger.log("Initialized for appId %s",t.appId)}},{key:"_dispose",value:function(){}},{key:"currentState",get:function(){return this._currentState},set:function(t){this._currentState.isSameAs(t)||(this._currentState=function(t){if(t.isAuthenticated()){var e=Object.assign({},t.details);return delete e.extra,Ie(e)}return t}(t),this._authStateSetter(this._currentState),this._notifyErrorOrAuthStateChanged(null,t))}},{key:"_resumeAuthState",value:function(){var t=this;if(b){if(Le.get(this._oauthSessionKey))return document.body.style.display="none",void Le.set(this._oauthSessionKey,qt(location.search).__wcsession);var e=We.get(this._oauthSessionKey);if(e){var n=qt(location.search);return void this.resumeSession(n.__wcsession,e).finally((function(){return We.remove(t._oauthSessionKey)})).catch(lt)}}this._logger.info("Authentication state resumed: %s",this.currentState.state),this._logger.log("Authentication details are: %o",this.currentState.details)}},{key:"subscribe",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return j([Pe,"#subscribe"],arguments,J,H(M)),e?this._firstSubscriptions.push(t):this._lastSubscriptions.unshift(t),vn(t,null,this.currentState),t}},{key:"unsubscribe",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;j([Pe,"#unsubscribe"],arguments,H(J),H(M));var n=this._firstSubscriptions.length+this._lastSubscriptions.length,r=function(e){return t&&t!==e};return!1!==e&&(this._firstSubscriptions=this._firstSubscriptions.filter(r)),!0!==e&&(this._lastSubscriptions=this._lastSubscriptions.filter(r)),n-this._firstSubscriptions.length-this._lastSubscriptions.length}},{key:"_notifyErrorOrAuthStateChanged",value:function(t,e){this._firstSubscriptions.forEach((function(n){return vn(n,t,e)})),this._lastSubscriptions.forEach((function(n){return vn(n,t,e)}))}},{key:"authenticationRevoked",value:function(t,e){j([Pe,"#authenticationRevoked"],arguments,L(Oe),D);var n=new Error("Authentication was revoked by the server: ".concat(e));n.code="AUTH_REVOKED",this._notifyErrorOrAuthStateChanged(n,null),this.currentState=t}},{key:"resumeSession",value:function(t,e){return j("AuthenticationImpl#resumeSession",arguments,D,D),this._logger.info("fetching authentication state from an ongoing OAuth2 session..."),an(this._authRoute,"session").addJson({sessionKey:t,requestKey:e}).send().then(this._updateStateFromHttpResponse(),this._notifyErrorFromHttpResponse.bind(this))}},{key:"_extendHttpRequest",value:function(t){var e=this,n=t;return n.addAuthContext=function(){var n=e._contextAuthToken();return n?t.addHeader(cn(n)):t},n}},{key:"_httpGet",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._extendHttpRequest(on.apply(void 0,[this._authRoute].concat(e)))}},{key:"_httpPost",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._extendHttpRequest(an.apply(void 0,[this._authRoute].concat(e)))}},{key:"_httpPut",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._extendHttpRequest(un.apply(void 0,[this._authRoute].concat(e)))}},{key:"_httpDelete",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._extendHttpRequest(sn.apply(void 0,[this._authRoute].concat(e)))}},{key:"_updateStateFromHttpResponse",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return function(n){var r=e(n).body,i=r.token,o=r.user;if(i)return o.webcomAuthToken=i,t.currentState=Ie(o),new Promise((function(t){return it((function(){return t(o)}))}));throw Ne({code:"UNEXPECTED_RESPONSE",message:"the 'token' property is missing."})}}},{key:"_notifyErrorFromHttpResponse",value:function(t){throw this._notifyErrorOrAuthStateChanged(t,null),t}},{key:"useCurrentContextForNextAuthOperation",value:function(){j([Pe,"#useCurrentContextForNextAuthOperation"],arguments),this.isAuthContextual=!0}},{key:"useNewContextForNextAuthOperation",value:function(){j([Pe,"#useNewContextForNextAuthOperation"],arguments),this.isAuthContextual=!1}},{key:"_contextAuthToken",value:function(){var t=this.isAuthContextual?this.currentState.details:null;return this.isAuthContextual=!1,t&&t.webcomAuthToken}},{key:"signInWithToken",value:function(t){return j([Pe,"#signInWithToken"],arguments,D),this._httpGet("decode").addHeader(cn(t)).send().then(this._updateStateFromHttpResponse((function(e){var n=e.body;return{body:{token:t,user:n.data}}})),this._notifyErrorFromHttpResponse.bind(this))}},{key:"signInAsGuest",value:function(){return j([Pe,"#signInAsGuest"],arguments),this._httpPost("anonymous","signin").addAuthContext().send().then(this._updateStateFromHttpResponse(),this._notifyErrorFromHttpResponse.bind(this))}},{key:"signInWithCredentials",value:function(t,e){return j([Pe,"#signInWithCredentials"],arguments,D,q),this._httpPost(t,"signin").addAuthContext().addJson(e).send().then(this._updateStateFromHttpResponse(),this._notifyErrorFromHttpResponse.bind(this))}},{key:"sendOtp",value:function(t,e,n){return j([Pe,"#sendOtp"],arguments,D,D,H(q)),this._httpPost(t,"otps").addQueryParameters(n).addJson(e).send().then((function(t){return t.body}))}},{key:"signInWithCustomProvider",value:function(t,e){return j([Pe,"#signInWithCustomProvider"],arguments,D,D),this._httpPost("custom.".concat(t),"signin").addAuthContext().addForm({token:e}).send().then(this._updateStateFromHttpResponse(),this._notifyErrorFromHttpResponse.bind(this))}},{key:"signInWithOAuth",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};j([Pe,"#signInWithOAuth"],arguments,D,H(q)),e.mode=e.mode||"popup";var n=e.mode;return"code"===n?this._loginViaOAuthCode(t,e):this._loginViaOAuth(t,e)}},{key:"signInWithWassup",value:function(t){return j([Pe,"#signInWithWassup"],arguments,q),this._httpPost("wassup","signin").addAuthContext().addForm(t).send().then(this._updateStateFromHttpResponse(),this._notifyErrorFromHttpResponse.bind(this))}},{key:"signOut",value:function(){return j([Pe,"#signOut"],arguments),this.currentState=Re,new Promise((function(t){return it((function(){return t()}))}))}},{key:"_loginViaOAuthCode",value:function(t,e){return e.code&&e.state||this._logger.warn("authWithOAuth(): options.code or options.state is missing!"),this._httpGet(t,"callback").addQueryParameters(e).send().then(this._updateStateFromHttpResponse(),this._notifyErrorFromHttpResponse.bind(this))}},{key:"_loginViaOAuth",value:function(t,e){if(b&&(We.get(this._oauthSessionKey)||Le.get(this._oauthSessionKey)))return Promise.reject(Ne({code:"ONGOING_OAUTH",message:"An OAuth authentication is already ongoing"}));var n=!b||"redirect"===e.mode||b&&(window.navigator.userAgent.match(/CriOS|Twitter for iPhone|FBAN\/FBIOS|Windows Phone/)||window.navigator.standalone);e.token=this._contextAuthToken(),e.mode="redirect",!e.to&&b&&(e.to=location.href.replace(/[?&]__wcsession=[^&]+/,"")),!e.from&&b&&(e.from=Kt()+Kt()+Kt()+Kt());var r=e.from;e.from=zt(r,!0),e.pm="1";var i=e.popupFeatures||{};delete e.popupFeatures;var o=Gt("".concat(this._authRoute,"/").concat(t,"/signin"),e);if(!n)return this._oauthLoginViaPopup(t,i,o,r);try{return b&&(We.set(this._oauthSessionKey,r),document.location=o),Promise.resolve(o)}catch(t){return Promise.reject(t)}}},{key:"_oauthLoginViaPopup",value:function(t,e,n,r){var i=this,o=Object.assign({},fn,ln[t],e),u=o.target||"_blank";delete o.target,Le.set(this._oauthSessionKey,"popup");var a=window.open(n,u,Object.entries(o).map((function(t){var e=s(t,2),n=e[0],r=e[1];return"".concat(n,"=").concat(r)})).join(","));return new Promise((function(t,e){if(a)var o=st((function(){var n=Le.get(i._oauthSessionKey);(a.closed||"popup"!==n)&&(ht(o),a.close(),Le.remove(i._oauthSessionKey),"popup"===n?e(Ne(hn)):t(i.resumeSession(n,r)))}),250);else e(Ne(function(t){return{code:"POPUP_FAILED",message:"Could not open popup at ".concat(t)}}(n)))}))}},{key:"addIdentity",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return j([Pe,"#addIdentity"],arguments,D,q,H(q)),this._httpPost(t,"identities").addAuthContext().addQueryParameters(n).addJson(e).send().then((function(t){return t.body}))}},{key:"removeIdentity",value:function(){var t=[Pe,"#removeIdentity"];j(t,arguments);try{var e=this._getCurrentAuthenticationDetails(t);return this._httpDelete(e.provider,"identities",encodeURIComponent(e.providerUid)).addHeader(cn(e.webcomAuthToken)).send().then((function(){}))}catch(t){return Promise.reject(t)}}},{key:"removeAccount",value:function(){var t=[Pe,"#removeAccount"];j(t,arguments);try{var e=this._getCurrentAuthenticationDetails(t);return this._httpDelete("accounts",e.uid).addHeader(cn(e.webcomAuthToken)).send().then((function(){}))}catch(t){return Promise.reject(t)}}},{key:"verifyIdentity",value:function(t,e,n){return j([Pe,"#verifyIdentity"],arguments,D,D,q),n.auth&&(n.challenge=n.auth.verificationPending,delete n.auth),this._httpPost(t,"identities",e,"verify").addAuthContext().addJson(n).send().then(this._updateStateFromHttpResponse(),this._notifyErrorFromHttpResponse.bind(this))}},{key:"updateIdentityProfile",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[Pe,"#updateIdentityProfile"];j(n,arguments,U,H(D));try{var r=this._getCurrentAuthenticationDetails(n);return this._httpPut(r.provider,"identities",encodeURIComponent(r.providerUid),"providerProfile",e).addHeader(cn(r.webcomAuthToken)).addJson(t).send().then((function(t){return t.body}))}catch(t){return Promise.reject(t)}}},{key:"_getCurrentAuthenticationDetails",value:function(t){var e;if(!this.currentState.isAuthenticated())throw Ne({code:"AUTH_MISSING",message:"".concat((e="").concat.apply(e,h(t))," failed: needs to be authenticated")});return this.currentState.details}},{key:"updatePassword",value:function(t,e,n){return j([Pe,"#updatePassword"],arguments,D,D,D),this._httpPut("password","identities",encodeURIComponent(t),"password").addForm({password:e,newPassword:n}).send().then((function(t){return t.body}))}},{key:"sendPasswordResetCode",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return j([Pe,"#sendPasswordResetCode"],arguments,D,D,H(q)),this._httpPost(t,"identities",encodeURIComponent(e),"reset").addQueryParameters(n).send().then((function(t){return t.body}))}},{key:"sendVerificationCode",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return j([Pe,"#sendVerificationCode"],arguments,D,D,H(q)),this._httpPost(t,"identities",e,"sendVerification").addQueryParameters(n).send().then((function(t){return t.body}))}}]),t}();return Ee=function(t){return new gn(t)},n.Webcom=ve,e=e.default})()));