!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SkillsClient={})}(this,function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r,i={exports:{}},o=i.exports;
/*!
	 * js-logger - http://github.com/jonnyreeves/js-logger
	 * Jonny Reeves, http://jonnyreeves.co.uk/
	 * js-logger may be freely distributed under the MIT license.
	 */var s,a,c,l,u,h,d=(r||(r=1,function(e){!function(t){var n,r={VERSION:"1.6.1"},i={},o=function(e,t){return function(){return t.apply(e,arguments)}},s=function(){var e,t,n=arguments,r=n[0];for(t=1;t<n.length;t++)for(e in n[t])!(e in r)&&n[t].hasOwnProperty(e)&&(r[e]=n[t][e]);return r},a=function(e,t){return{value:e,name:t}};r.TRACE=a(1,"TRACE"),r.DEBUG=a(2,"DEBUG"),r.INFO=a(3,"INFO"),r.TIME=a(4,"TIME"),r.WARN=a(5,"WARN"),r.ERROR=a(8,"ERROR"),r.OFF=a(99,"OFF");var c=function(e){this.context=e,this.setLevel(e.filterLevel),this.log=this.info};c.prototype={setLevel:function(e){e&&"value"in e&&(this.context.filterLevel=e)},getLevel:function(){return this.context.filterLevel},enabledFor:function(e){var t=this.context.filterLevel;return e.value>=t.value},trace:function(){this.invoke(r.TRACE,arguments)},debug:function(){this.invoke(r.DEBUG,arguments)},info:function(){this.invoke(r.INFO,arguments)},warn:function(){this.invoke(r.WARN,arguments)},error:function(){this.invoke(r.ERROR,arguments)},time:function(e){"string"==typeof e&&e.length>0&&this.invoke(r.TIME,[e,"start"])},timeEnd:function(e){"string"==typeof e&&e.length>0&&this.invoke(r.TIME,[e,"end"])},invoke:function(e,t){n&&this.enabledFor(e)&&n(t,s({level:e},this.context))}};var l,u=new c({filterLevel:r.OFF});(l=r).enabledFor=o(u,u.enabledFor),l.trace=o(u,u.trace),l.debug=o(u,u.debug),l.time=o(u,u.time),l.timeEnd=o(u,u.timeEnd),l.info=o(u,u.info),l.warn=o(u,u.warn),l.error=o(u,u.error),l.log=l.info,r.setHandler=function(e){n=e},r.setLevel=function(e){for(var t in u.setLevel(e),i)i.hasOwnProperty(t)&&i[t].setLevel(e)},r.getLevel=function(){return u.getLevel()},r.get=function(e){return i[e]||(i[e]=new c(s({name:e},u.context)))},r.createDefaultHandler=function(e){(e=e||{}).formatter=e.formatter||function(e,t){t.name&&e.unshift("["+t.name+"]")};var t={},n=function(e,t){Function.prototype.apply.call(e,console,t)};return"undefined"==typeof console?function(){}:function(i,o){i=Array.prototype.slice.call(i);var s,a=console.log;o.level===r.TIME?(s=(o.name?"["+o.name+"] ":"")+i[0],"start"===i[1]?console.time?console.time(s):t[s]=(new Date).getTime():console.timeEnd?console.timeEnd(s):n(a,[s+": "+((new Date).getTime()-t[s])+"ms"])):(o.level===r.WARN&&console.warn?a=console.warn:o.level===r.ERROR&&console.error?a=console.error:o.level===r.INFO&&console.info?a=console.info:o.level===r.DEBUG&&console.debug?a=console.debug:o.level===r.TRACE&&console.trace&&(a=console.trace),e.formatter(i,o),n(a,i))}},r.useDefaults=function(e){r.setLevel(e&&e.defaultLevel||r.DEBUG),r.setHandler(r.createDefaultHandler(e))},r.setDefaults=r.useDefaults,e.exports?e.exports=r:(r._prevLogger=t.Logger,r.noConflict=function(){return t.Logger=r._prevLogger,r},t.Logger=r)}(o)}(i)),i.exports),f=n(d),p={exports:{}},m={};function g(){if(c)return a;c=1;var e=(s||(s=1,t.crypto&&t.crypto.getRandomValues?m.randomBytes=function(e){var n=new Uint8Array(e);return t.crypto.getRandomValues(n),n}:m.randomBytes=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=Math.floor(256*Math.random());return t}),m),n="abcdefghijklmnopqrstuvwxyz012345";return a={string:function(t){for(var r=e.randomBytes(t),i=[],o=0;o<t;o++)i.push(n.substr(r[o]%32,1));return i.join("")},number:function(e){return Math.floor(Math.random()*e)},numberString:function(e){var t=(""+(e-1)).length;return(new Array(t+1).join("0")+this.number(e)).slice(-t)}}}function y(){return l||(l=1,function(e){var n=g(),r={},i=!1,o=t.chrome&&t.chrome.app&&t.chrome.app.runtime;e.exports={attachEvent:function(e,n){void 0!==t.addEventListener?t.addEventListener(e,n,!1):t.document&&t.attachEvent&&(t.document.attachEvent("on"+e,n),t.attachEvent("on"+e,n))},detachEvent:function(e,n){void 0!==t.addEventListener?t.removeEventListener(e,n,!1):t.document&&t.detachEvent&&(t.document.detachEvent("on"+e,n),t.detachEvent("on"+e,n))},unloadAdd:function(e){if(o)return null;var t=n.string(8);return r[t]=e,i&&setTimeout(this.triggerUnloadCallbacks,0),t},unloadDel:function(e){e in r&&delete r[e]},triggerUnloadCallbacks:function(){for(var e in r)r[e](),delete r[e]}};o||e.exports.attachEvent("unload",function(){i||(i=!0,e.exports.triggerUnloadCallbacks())})}(p)),p.exports}var b,v,w,S,_,E={};function k(){if(w)return v;w=1;var e=h?u:(h=1,u=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}),n=function(){if(b)return E;b=1;var e=Object.prototype.hasOwnProperty;function t(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function n(e){try{return encodeURIComponent(e)}catch(e){return null}}return E.stringify=function(t,r){r=r||"";var i,o,s=[];for(o in"string"!=typeof r&&(r="?"),t)if(e.call(t,o)){if((i=t[o])||null!=i&&!isNaN(i)||(i=""),o=n(o),i=n(i),null===o||null===i)continue;s.push(o+"="+i)}return s.length?r+s.join("&"):""},E.parse=function(e){for(var n,r=/([^=?#&]+)=?([^&]*)/g,i={};n=r.exec(e);){var o=t(n[1]),s=t(n[2]);null===o||null===s||o in i||(i[o]=s)}return i},E}(),r=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i=/[\n\r\t]/g,o=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,s=/:\d+$/,a=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function l(e){return(e||"").toString().replace(r,"")}var d=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],f={hash:1,query:1};function p(e){var n,r=("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{}).location||{},i={},s=typeof(e=e||r);if("blob:"===e.protocol)i=new y(unescape(e.pathname),{});else if("string"===s)for(n in i=new y(e,{}),f)delete i[n];else if("object"===s){for(n in e)n in f||(i[n]=e[n]);void 0===i.slashes&&(i.slashes=o.test(e.href))}return i}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function g(e,t){e=(e=l(e)).replace(i,""),t=t||{};var n,r=a.exec(e),o=r[1]?r[1].toLowerCase():"",s=!!r[2],c=!!r[3],u=0;return s?c?(n=r[2]+r[3]+r[4],u=r[2].length+r[3].length):(n=r[2]+r[4],u=r[2].length):c?(n=r[3]+r[4],u=r[3].length):n=r[4],"file:"===o?u>=2&&(n=n.slice(2)):m(o)?n=r[4]:o?s&&(n=n.slice(2)):u>=2&&m(t.protocol)&&(n=r[4]),{protocol:o,slashes:s||m(o),slashesCount:u,rest:n}}function y(t,r,o){if(t=(t=l(t)).replace(i,""),!(this instanceof y))return new y(t,r,o);var s,a,u,h,f,b,v=d.slice(),w=typeof r,S=this,_=0;for("object"!==w&&"string"!==w&&(o=r,r=null),o&&"function"!=typeof o&&(o=n.parse),s=!(a=g(t||"",r=p(r))).protocol&&!a.slashes,S.slashes=a.slashes||s&&r.slashes,S.protocol=a.protocol||r.protocol||"",t=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||c.test(t))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(S.protocol)))&&(v[3]=[/(.*)/,"pathname"]);_<v.length;_++)"function"!=typeof(h=v[_])?(u=h[0],b=h[1],u!=u?S[b]=t:"string"==typeof u?~(f="@"===u?t.lastIndexOf(u):t.indexOf(u))&&("number"==typeof h[2]?(S[b]=t.slice(0,f),t=t.slice(f+h[2])):(S[b]=t.slice(f),t=t.slice(0,f))):(f=u.exec(t))&&(S[b]=f[1],t=t.slice(0,f.index)),S[b]=S[b]||s&&h[3]&&r[b]||"",h[4]&&(S[b]=S[b].toLowerCase())):t=h(t,S);o&&(S.query=o(S.query)),s&&r.slashes&&"/"!==S.pathname.charAt(0)&&(""!==S.pathname||""!==r.pathname)&&(S.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,i=n[r-1],o=!1,s=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),s++):s&&(0===r&&(o=!0),n.splice(r,1),s--);return o&&n.unshift(""),"."!==i&&".."!==i||n.push(""),n.join("/")}(S.pathname,r.pathname)),"/"!==S.pathname.charAt(0)&&m(S.protocol)&&(S.pathname="/"+S.pathname),e(S.port,S.protocol)||(S.host=S.hostname,S.port=""),S.username=S.password="",S.auth&&(~(f=S.auth.indexOf(":"))?(S.username=S.auth.slice(0,f),S.username=encodeURIComponent(decodeURIComponent(S.username)),S.password=S.auth.slice(f+1),S.password=encodeURIComponent(decodeURIComponent(S.password))):S.username=encodeURIComponent(decodeURIComponent(S.auth)),S.auth=S.password?S.username+":"+S.password:S.username),S.origin="file:"!==S.protocol&&m(S.protocol)&&S.host?S.protocol+"//"+S.host:"null",S.href=S.toString()}return y.prototype={set:function(t,r,i){var o=this;switch(t){case"query":"string"==typeof r&&r.length&&(r=(i||n.parse)(r)),o[t]=r;break;case"port":o[t]=r,e(r,o.protocol)?r&&(o.host=o.hostname+":"+r):(o.host=o.hostname,o[t]="");break;case"hostname":o[t]=r,o.port&&(r+=":"+o.port),o.host=r;break;case"host":o[t]=r,s.test(r)?(r=r.split(":"),o.port=r.pop(),o.hostname=r.join(":")):(o.hostname=r,o.port="");break;case"protocol":o.protocol=r.toLowerCase(),o.slashes=!i;break;case"pathname":case"hash":if(r){var a="pathname"===t?"/":"#";o[t]=r.charAt(0)!==a?a+r:r}else o[t]=r;break;case"username":case"password":o[t]=encodeURIComponent(r);break;case"auth":var c=r.indexOf(":");~c?(o.username=r.slice(0,c),o.username=encodeURIComponent(decodeURIComponent(o.username)),o.password=r.slice(c+1),o.password=encodeURIComponent(decodeURIComponent(o.password))):o.username=encodeURIComponent(decodeURIComponent(r))}for(var l=0;l<d.length;l++){var u=d[l];u[4]&&(o[u[1]]=o[u[1]].toLowerCase())}return o.auth=o.password?o.username+":"+o.password:o.username,o.origin="file:"!==o.protocol&&m(o.protocol)&&o.host?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(e){e&&"function"==typeof e||(e=n.stringify);var t,r=this,i=r.host,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var a=o+(r.protocol&&r.slashes||m(r.protocol)?"//":"");return r.username?(a+=r.username,r.password&&(a+=":"+r.password),a+="@"):r.password?(a+=":"+r.password,a+="@"):"file:"!==r.protocol&&m(r.protocol)&&!i&&"/"!==r.pathname&&(a+="@"),(":"===i[i.length-1]||s.test(r.hostname)&&!r.port)&&(i+=":"),a+=i+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(a+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(a+=r.hash),a}},y.extractProtocol=g,y.location=p,y.trimLeft=l,y.qs=n,v=y}function O(){if(_)return S;_=1;var e=k();return S={getOrigin:function(t){if(!t)return null;var n=new e(t);if("file:"===n.protocol)return null;var r=n.port;return r||(r="https:"===n.protocol?"443":"80"),n.protocol+"//"+n.hostname+":"+r},isOriginEqual:function(e,t){return this.getOrigin(e)===this.getOrigin(t)},isSchemeEqual:function(e,t){return e.split(":")[0]===t.split(":")[0]},addPath:function(e,t){var n=e.split("?");return n[0]+t+(n[1]?"?"+n[1]:"")},addQuery:function(e,t){return e+(-1===e.indexOf("?")?"?"+t:"&"+t)},isLoopbackAddr:function(e){return/^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(e)||/^\[::1\]$/.test(e)}}}var C,R={exports:{}};function T(){return C||(C=1,"function"==typeof Object.create?R.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:R.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),R.exports}var A,x,I,N={};function P(){if(x)return A;function e(){this._listeners={}}return x=1,e.prototype.addEventListener=function(e,t){e in this._listeners||(this._listeners[e]=[]);var n=this._listeners[e];-1===n.indexOf(t)&&(n=n.concat([t])),this._listeners[e]=n},e.prototype.removeEventListener=function(e,t){var n=this._listeners[e];if(n){var r=n.indexOf(t);-1===r||(n.length>1?this._listeners[e]=n.slice(0,r).concat(n.slice(r+1)):delete this._listeners[e])}},e.prototype.dispatchEvent=function(){var e=arguments[0],t=e.type,n=1===arguments.length?[e]:Array.apply(null,arguments);if(this["on"+t]&&this["on"+t].apply(this,n),t in this._listeners)for(var r=this._listeners[t],i=0;i<r.length;i++)r[i].apply(this,n)},A=e}function L(){if(I)return N;I=1;var e=T(),t=P();function n(){t.call(this)}return e(n,t),n.prototype.removeAllListeners=function(e){e?delete this._listeners[e]:this._listeners={}},n.prototype.once=function(e,t){var n=this,r=!1;this.on(e,function i(){n.removeListener(e,i),r||(r=!0,t.apply(this,arguments))})},n.prototype.emit=function(){var e=arguments[0],t=this._listeners[e];if(t){for(var n=arguments.length,r=new Array(n-1),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=0;o<t.length;o++)t[o].apply(this,r)}},n.prototype.on=n.prototype.addListener=t.prototype.addEventListener,n.prototype.removeListener=t.prototype.removeEventListener,N.EventEmitter=n,N}var U,j,D,B,F,$,H,M,W,q,V,z,J,G,K,X,Q,Z,Y,ee,te,ne,re,ie,oe,se,ae,ce,le,ue,he,de,fe,pe,me,ge={exports:{}};function ye(){if(D)return j;D=1;var e=y(),n=O(),r=T(),i=L().EventEmitter,o=function(){if(U)return ge.exports;U=1;var e=t.WebSocket||t.MozWebSocket;return ge.exports=e?function(t){return new e(t)}:void 0,ge.exports}();function s(t,r,a){if(!s.enabled())throw new Error("Transport created when disabled");i.call(this);var c=this,l=n.addPath(t,"/websocket");l="https"===l.slice(0,5)?"wss"+l.slice(5):"ws"+l.slice(4),this.url=l,this.ws=new o(this.url,[],a),this.ws.onmessage=function(e){e.data,c.emit("message",e.data)},this.unloadRef=e.unloadAdd(function(){c.ws.close()}),this.ws.onclose=function(e){e.code,e.reason,c.emit("close",e.code,e.reason),c._cleanup()},this.ws.onerror=function(e){c.emit("close",1006,"WebSocket connection broken"),c._cleanup()}}return r(s,i),s.prototype.send=function(e){var t="["+e+"]";this.ws.send(t)},s.prototype.close=function(){var e=this.ws;this._cleanup(),e&&e.close()},s.prototype._cleanup=function(){var t=this.ws;t&&(t.onmessage=t.onclose=t.onerror=null),e.unloadDel(this.unloadRef),this.unloadRef=this.ws=null,this.removeAllListeners()},s.enabled=function(){return!!o},s.transportName="websocket",s.roundTrips=2,j=s}function be(){if(W)return M;W=1;var e=T(),t=O(),n=function(){if(F)return B;F=1;var e=T(),t=L().EventEmitter;function n(e,n){t.call(this),this.sendBuffer=[],this.sender=n,this.url=e}return e(n,t),n.prototype.send=function(e){this.sendBuffer.push(e),this.sendStop||this.sendSchedule()},n.prototype.sendScheduleWait=function(){var e,t=this;this.sendStop=function(){t.sendStop=null,clearTimeout(e)},e=setTimeout(function(){t.sendStop=null,t.sendSchedule()},25)},n.prototype.sendSchedule=function(){this.sendBuffer.length;var e=this;if(this.sendBuffer.length>0){var t="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,t,function(t){e.sendStop=null,t?(e.emit("close",t.code||1006,"Sending error: "+t),e.close()):e.sendScheduleWait()}),this.sendBuffer=[]}},n.prototype._cleanup=function(){this.removeAllListeners()},n.prototype.close=function(){this._cleanup(),this.sendStop&&(this.sendStop(),this.sendStop=null)},B=n}(),r=function(){if(H)return $;H=1;var e=T(),t=L().EventEmitter;function n(e,n,r){t.call(this),this.Receiver=e,this.receiveUrl=n,this.AjaxObject=r,this._scheduleReceiver()}return e(n,t),n.prototype._scheduleReceiver=function(){var e=this,t=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);t.on("message",function(t){e.emit("message",t)}),t.once("close",function(n,r){e.pollIsClosing,e.poll=t=null,e.pollIsClosing||("network"===r?e._scheduleReceiver():(e.emit("close",n||1006,r),e.removeAllListeners()))})},n.prototype.abort=function(){this.removeAllListeners(),this.pollIsClosing=!0,this.poll&&this.poll.abort()},$=n}();function i(e,i,o,s,a){var c=t.addPath(e,i),l=this;n.call(this,e,o),this.poll=new r(s,c,a),this.poll.on("message",function(e){l.emit("message",e)}),this.poll.once("close",function(e,t){l.poll=null,l.emit("close",e,t),l.close()})}return e(i,n),i.prototype.close=function(){n.prototype.close.call(this),this.removeAllListeners(),this.poll&&(this.poll.abort(),this.poll=null)},M=i}function ve(){if(V)return q;V=1;var e=T(),t=O(),n=be();function r(e,r,i,o){n.call(this,e,r,function(e){return function(n,r,i){var o={};"string"==typeof r&&(o.headers={"Content-type":"text/plain"});var s=t.addPath(n,"/xhr_send"),a=new e("POST",s,r,o);return a.once("finish",function(e){if(a=null,200!==e&&204!==e)return i(new Error("http status "+e));i()}),function(){a.close(),a=null;var e=new Error("Aborted");e.code=1e3,i(e)}}}(o),i,o)}return e(r,n),q=r}function we(){if(J)return z;J=1;var e=T(),t=L().EventEmitter;function n(e,n){t.call(this);var r=this;this.bufferPosition=0,this.xo=new n("POST",e,null),this.xo.on("chunk",this._chunkHandler.bind(this)),this.xo.once("finish",function(e,t){r._chunkHandler(e,t),r.xo=null;var n=200===e?"network":"permanent";r.emit("close",null,n),r._cleanup()})}return e(n,t),n.prototype._chunkHandler=function(e,t){if(200===e&&t)for(var n=-1;;this.bufferPosition+=n+1){var r=t.slice(this.bufferPosition);if(-1===(n=r.indexOf("\n")))break;var i=r.slice(0,n);i&&this.emit("message",i)}},n.prototype._cleanup=function(){this.removeAllListeners()},n.prototype.abort=function(){this.xo&&(this.xo.close(),this.emit("close",null,"user"),this.xo=null),this._cleanup()},z=n}function Se(){if(K)return G;K=1;var e=L().EventEmitter,n=T(),r=y(),i=O(),o=t.XMLHttpRequest;function s(t,n,r,i){var o=this;e.call(this),setTimeout(function(){o._start(t,n,r,i)},0)}n(s,e),s.prototype._start=function(e,t,n,a){var c=this;try{this.xhr=new o}catch(e){}if(!this.xhr)return this.emit("finish",0,"no xhr support"),void this._cleanup();t=i.addQuery(t,"t="+ +new Date),this.unloadRef=r.unloadAdd(function(){c._cleanup(!0)});try{this.xhr.open(e,t,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){c.emit("finish",0,""),c._cleanup(!1)})}catch(e){return this.emit("finish",0,""),void this._cleanup(!1)}if(a&&a.noCredentials||!s.supportsCORS||(this.xhr.withCredentials=!0),a&&a.headers)for(var l in a.headers)this.xhr.setRequestHeader(l,a.headers[l]);this.xhr.onreadystatechange=function(){if(c.xhr){var e,t,n=c.xhr;switch(n.readyState,n.readyState){case 3:try{t=n.status,e=n.responseText}catch(e){}1223===t&&(t=204),200===t&&e&&e.length>0&&c.emit("chunk",t,e);break;case 4:1223===(t=n.status)&&(t=204),12005!==t&&12029!==t||(t=0),n.responseText,c.emit("finish",t,n.responseText),c._cleanup(!1)}}};try{c.xhr.send(n)}catch(e){c.emit("finish",0,""),c._cleanup(!1)}},s.prototype._cleanup=function(e){if(this.xhr){if(this.removeAllListeners(),r.unloadDel(this.unloadRef),this.xhr.onreadystatechange=function(){},this.xhr.ontimeout&&(this.xhr.ontimeout=null),e)try{this.xhr.abort()}catch(e){}this.unloadRef=this.xhr=null}},s.prototype.close=function(){this._cleanup(!0)},s.enabled=!!o;var a=["Active"].concat("Object").join("X");!s.enabled&&a in t&&(o=function(){try{return new t[a]("Microsoft.XMLHTTP")}catch(e){return null}},s.enabled=!!new o);var c=!1;try{c="withCredentials"in new o}catch(e){}return s.supportsCORS=c,G=s}function _e(){if(Q)return X;Q=1;var e=T(),t=Se();function n(e,n,r,i){t.call(this,e,n,r,i)}return e(n,t),n.enabled=t.enabled&&t.supportsCORS,X=n}function Ee(){if(Y)return Z;Y=1;var e=T(),t=Se();function n(e,n,r){t.call(this,e,n,r,{noCredentials:!0})}return e(n,t),n.enabled=t.enabled,Z=n}function ke(){return te?ee:(te=1,ee={isOpera:function(){return t.navigator&&/opera/i.test(t.navigator.userAgent)},isKonqueror:function(){return t.navigator&&/konqueror/i.test(t.navigator.userAgent)},hasDomain:function(){if(!t.document)return!0;try{return!!t.document.domain}catch(e){return!1}}})}function Oe(){if(re)return ne;re=1;var e=T(),n=ve(),r=we(),i=_e(),o=Ee(),s=ke();function a(e){if(!o.enabled&&!i.enabled)throw new Error("Transport created when disabled");n.call(this,e,"/xhr_streaming",r,i)}return e(a,n),a.enabled=function(e){return!e.nullOrigin&&(!s.isOpera()&&i.enabled)},a.transportName="xhr-streaming",a.roundTrips=2,a.needBody=!!t.document,ne=a}function Ce(){if(oe)return ie;oe=1;var e=L().EventEmitter,n=T(),r=y(),i=ke(),o=O();function s(t,n,r){var i=this;e.call(this),setTimeout(function(){i._start(t,n,r)},0)}return n(s,e),s.prototype._start=function(e,n,i){var s=this,a=new t.XDomainRequest;n=o.addQuery(n,"t="+ +new Date),a.onerror=function(){s._error()},a.ontimeout=function(){s._error()},a.onprogress=function(){a.responseText,s.emit("chunk",200,a.responseText)},a.onload=function(){s.emit("finish",200,a.responseText),s._cleanup(!1)},this.xdr=a,this.unloadRef=r.unloadAdd(function(){s._cleanup(!0)});try{this.xdr.open(e,n),this.timeout&&(this.xdr.timeout=this.timeout),this.xdr.send(i)}catch(e){this._error()}},s.prototype._error=function(){this.emit("finish",0,""),this._cleanup(!1)},s.prototype._cleanup=function(e){if(this.xdr){if(this.removeAllListeners(),r.unloadDel(this.unloadRef),this.xdr.ontimeout=this.xdr.onerror=this.xdr.onprogress=this.xdr.onload=null,e)try{this.xdr.abort()}catch(e){}this.unloadRef=this.xdr=null}},s.prototype.close=function(){this._cleanup(!0)},s.enabled=!(!t.XDomainRequest||!i.hasDomain()),ie=s}function Re(){if(ae)return se;ae=1;var e=T(),t=ve(),n=we(),r=Ce();function i(e){if(!r.enabled)throw new Error("Transport created when disabled");t.call(this,e,"/xhr_streaming",n,r)}return e(i,t),i.enabled=function(e){return!e.cookie_needed&&!e.nullOrigin&&(r.enabled&&e.sameScheme)},i.transportName="xdr-streaming",i.roundTrips=2,se=i}function Te(){return le?ce:(le=1,ce=t.EventSource)}function Ae(){if(fe)return de;fe=1;var e=T(),t=ve(),n=function(){if(he)return ue;he=1;var e=T(),t=L().EventEmitter,n=Te();function r(e){t.call(this);var r=this,i=this.es=new n(e);i.onmessage=function(e){e.data,r.emit("message",decodeURI(e.data))},i.onerror=function(e){i.readyState;var t=2!==i.readyState?"network":"permanent";r._cleanup(),r._close(t)}}return e(r,t),r.prototype.abort=function(){this._cleanup(),this._close("user")},r.prototype._cleanup=function(){var e=this.es;e&&(e.onmessage=e.onerror=null,e.close(),this.es=null)},r.prototype._close=function(e){var t=this;setTimeout(function(){t.emit("close",null,e),t.removeAllListeners()},200)},ue=r}(),r=_e(),i=Te();function o(e){if(!o.enabled())throw new Error("Transport created when disabled");t.call(this,e,"/eventsource",n,r)}return e(o,t),o.enabled=function(){return!!i},o.transportName="eventsource",o.roundTrips=2,de=o}function xe(){return me?pe:(me=1,pe="1.6.1")}var Ie,Ne,Pe,Le,Ue,je,De,Be,Fe,$e,He,Me,We,qe,Ve,ze,Je,Ge,Ke,Xe,Qe,Ze,Ye,et={exports:{}};function tt(){return Ie||(Ie=1,function(e){var n=y(),r=ke();e.exports={WPrefix:"_jp",currentWindowId:null,polluteGlobalNamespace:function(){e.exports.WPrefix in t||(t[e.exports.WPrefix]={})},postMessage:function(n,r){t.parent!==t&&t.parent.postMessage(JSON.stringify({windowId:e.exports.currentWindowId,type:n,data:r||""}),"*")},createIframe:function(e,r){var i,o,s=t.document.createElement("iframe"),a=function(){clearTimeout(i);try{s.onload=null}catch(e){}s.onerror=null},c=function(){s&&(a(),setTimeout(function(){s&&s.parentNode.removeChild(s),s=null},0),n.unloadDel(o))},l=function(e){s&&(c(),r(e))};return s.src=e,s.style.display="none",s.style.position="absolute",s.onerror=function(){l("onerror")},s.onload=function(){clearTimeout(i),i=setTimeout(function(){l("onload timeout")},2e3)},t.document.body.appendChild(s),i=setTimeout(function(){l("timeout")},15e3),o=n.unloadAdd(c),{post:function(e,t){setTimeout(function(){try{s&&s.contentWindow&&s.contentWindow.postMessage(e,t)}catch(e){}},0)},cleanup:c,loaded:a}},createHtmlfile:function(r,i){var o,s,a,c=["Active"].concat("Object").join("X"),l=new t[c]("htmlfile"),u=function(){clearTimeout(o),a.onerror=null},h=function(){l&&(u(),n.unloadDel(s),a.parentNode.removeChild(a),a=l=null,CollectGarbage())},d=function(e){l&&(h(),i(e))};l.open(),l.write('<html><script>document.domain="'+t.document.domain+'";<\/script></html>'),l.close(),l.parentWindow[e.exports.WPrefix]=t[e.exports.WPrefix];var f=l.createElement("div");return l.body.appendChild(f),a=l.createElement("iframe"),f.appendChild(a),a.src=r,a.onerror=function(){d("onerror")},o=setTimeout(function(){d("timeout")},15e3),s=n.unloadAdd(h),{post:function(e,t){try{setTimeout(function(){a&&a.contentWindow&&a.contentWindow.postMessage(e,t)},0)}catch(e){}},cleanup:h,loaded:u}}},e.exports.iframeEnabled=!1,t.document&&(e.exports.iframeEnabled=("function"==typeof t.postMessage||"object"==typeof t.postMessage)&&!r.isKonqueror())}(et)),et.exports}function nt(){if(Pe)return Ne;Pe=1;var e=T(),t=L().EventEmitter,n=xe(),r=O(),i=tt(),o=y(),s=g();function a(e,n,c){if(!a.enabled())throw new Error("Transport created when disabled");t.call(this);var l=this;this.origin=r.getOrigin(c),this.baseUrl=c,this.transUrl=n,this.transport=e,this.windowId=s.string(8);var u=r.addPath(c,"/iframe.html")+"#"+this.windowId;this.iframeObj=i.createIframe(u,function(e){l.emit("close",1006,"Unable to load an iframe ("+e+")"),l.close()}),this.onmessageCallback=this._message.bind(this),o.attachEvent("message",this.onmessageCallback)}return e(a,t),a.prototype.close=function(){if(this.removeAllListeners(),this.iframeObj){o.detachEvent("message",this.onmessageCallback);try{this.postMessage("c")}catch(e){}this.iframeObj.cleanup(),this.iframeObj=null,this.onmessageCallback=this.iframeObj=null}},a.prototype._message=function(e){if(e.data,!r.isOriginEqual(e.origin,this.origin))return e.origin,void this.origin;var t;try{t=JSON.parse(e.data)}catch(t){return void e.data}if(t.windowId!==this.windowId)return t.windowId,void this.windowId;switch(t.type){case"s":this.iframeObj.loaded(),this.postMessage("s",JSON.stringify([n,this.transport,this.transUrl,this.baseUrl]));break;case"t":this.emit("message",t.data);break;case"c":var i;try{i=JSON.parse(t.data)}catch(e){return void t.data}this.emit("close",i[0],i[1]),this.close()}},a.prototype.postMessage=function(e,t){this.iframeObj.post(JSON.stringify({windowId:this.windowId,type:e,data:t||""}),this.origin)},a.prototype.send=function(e){this.postMessage("m",e)},a.enabled=function(){return i.iframeEnabled},a.transportName="iframe",a.roundTrips=2,Ne=a}function rt(){return Ue||(Ue=1,Le={isObject:function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},extend:function(e){if(!this.isObject(e))return e;for(var t,n,r=1,i=arguments.length;r<i;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}}),Le}function it(){if(De)return je;De=1;var e=T(),n=nt(),r=rt();return je=function(i){function o(e,t){n.call(this,i.transportName,e,t)}return e(o,n),o.enabled=function(e,o){if(!t.document)return!1;var s=r.extend({},o);return s.sameOrigin=!0,i.enabled(s)&&n.enabled()},o.transportName="iframe-"+i.transportName,o.needBody=!0,o.roundTrips=n.roundTrips+i.roundTrips-1,o.facadeTransport=i,o},je}function ot(){if(He)return $e;He=1;var e=T(),n=function(){if(Fe)return Be;Fe=1;var e=T(),n=tt(),r=O(),i=L().EventEmitter,o=g();function s(e){i.call(this);var a=this;n.polluteGlobalNamespace(),this.id="a"+o.string(6),e=r.addQuery(e,"c="+decodeURIComponent(n.WPrefix+"."+this.id)),s.htmlfileEnabled;var c=s.htmlfileEnabled?n.createHtmlfile:n.createIframe;t[n.WPrefix][this.id]={start:function(){a.iframeObj.loaded()},message:function(e){a.emit("message",e)},stop:function(){a._cleanup(),a._close("network")}},this.iframeObj=c(e,function(){a._cleanup(),a._close("permanent")})}e(s,i),s.prototype.abort=function(){this._cleanup(),this._close("user")},s.prototype._cleanup=function(){this.iframeObj&&(this.iframeObj.cleanup(),this.iframeObj=null),delete t[n.WPrefix][this.id]},s.prototype._close=function(e){this.emit("close",null,e),this.removeAllListeners()},s.htmlfileEnabled=!1;var a=["Active"].concat("Object").join("X");if(a in t)try{s.htmlfileEnabled=!!new t[a]("htmlfile")}catch(e){}return s.enabled=s.htmlfileEnabled||n.iframeEnabled,Be=s}(),r=Ee(),i=ve();function o(e){if(!n.enabled)throw new Error("Transport created when disabled");i.call(this,e,"/htmlfile",n,r)}return e(o,i),o.enabled=function(e){return n.enabled&&e.sameOrigin},o.transportName="htmlfile",o.roundTrips=2,$e=o}function st(){if(We)return Me;We=1;var e=T(),t=ve(),n=we(),r=_e(),i=Ee();function o(e){if(!i.enabled&&!r.enabled)throw new Error("Transport created when disabled");t.call(this,e,"/xhr",n,r)}return e(o,t),o.enabled=function(e){return!e.nullOrigin&&(!(!i.enabled||!e.sameOrigin)||r.enabled)},o.transportName="xhr-polling",o.roundTrips=2,Me=o}function at(){if(Ve)return qe;Ve=1;var e=T(),t=ve(),n=Re(),r=we(),i=Ce();function o(e){if(!i.enabled)throw new Error("Transport created when disabled");t.call(this,e,"/xhr",r,i)}return e(o,t),o.enabled=n.enabled,o.transportName="xdr-polling",o.roundTrips=2,qe=o}function ct(){if(Ke)return Ge;Ke=1;var e,n,r=g(),i=O();return Ge=function(o,s,a){e||((e=t.document.createElement("form")).style.display="none",e.style.position="absolute",e.method="POST",e.enctype="application/x-www-form-urlencoded",e.acceptCharset="UTF-8",(n=t.document.createElement("textarea")).name="d",e.appendChild(n),t.document.body.appendChild(e));var c="a"+r.string(8);e.target=c,e.action=i.addQuery(i.addPath(o,"/jsonp_send"),"i="+c);var l=function(e){try{return t.document.createElement('<iframe name="'+e+'">')}catch(r){var n=t.document.createElement("iframe");return n.name=e,n}}(c);l.id=c,l.style.display="none",e.appendChild(l);try{n.value=s}catch(e){}e.submit();var u=function(e){l.onerror&&(l.onreadystatechange=l.onerror=l.onload=null,setTimeout(function(){l.parentNode.removeChild(l),l=null},500),n.value="",a(e))};return l.onerror=function(){u()},l.onload=function(){u()},l.onreadystatechange=function(e){l.readyState,"complete"===l.readyState&&u()},function(){u(new Error("Aborted"))}},Ge}function lt(){if(Qe)return Xe;Qe=1;var e=T(),n=be(),r=function(){if(Je)return ze;Je=1;var e=tt(),n=g(),r=ke(),i=O(),o=T(),s=L().EventEmitter;function a(r){var o=this;s.call(this),e.polluteGlobalNamespace(),this.id="a"+n.string(6);var c=i.addQuery(r,"c="+encodeURIComponent(e.WPrefix+"."+this.id));t[e.WPrefix][this.id]=this._callback.bind(this),this._createScript(c),this.timeoutId=setTimeout(function(){o._abort(new Error("JSONP script loaded abnormally (timeout)"))},a.timeout)}return o(a,s),a.prototype.abort=function(){if(t[e.WPrefix][this.id]){var n=new Error("JSONP user aborted read");n.code=1e3,this._abort(n)}},a.timeout=35e3,a.scriptErrorTimeout=1e3,a.prototype._callback=function(e){this._cleanup(),this.aborting||(e&&this.emit("message",e),this.emit("close",null,"network"),this.removeAllListeners())},a.prototype._abort=function(e){this._cleanup(),this.aborting=!0,this.emit("close",e.code,e.message),this.removeAllListeners()},a.prototype._cleanup=function(){if(clearTimeout(this.timeoutId),this.script2&&(this.script2.parentNode.removeChild(this.script2),this.script2=null),this.script){var n=this.script;n.parentNode.removeChild(n),n.onreadystatechange=n.onerror=n.onload=n.onclick=null,this.script=null}delete t[e.WPrefix][this.id]},a.prototype._scriptError=function(){var e=this;this.errorTimer||(this.errorTimer=setTimeout(function(){e.loadedOkay||e._abort(new Error("JSONP script loaded abnormally (onerror)"))},a.scriptErrorTimeout))},a.prototype._createScript=function(e){var i,o=this,s=this.script=t.document.createElement("script");if(s.id="a"+n.string(8),s.src=e,s.type="text/javascript",s.charset="UTF-8",s.onerror=this._scriptError.bind(this),s.onload=function(){o._abort(new Error("JSONP script loaded abnormally (onload)"))},s.onreadystatechange=function(){if(s.readyState,/loaded|closed/.test(s.readyState)){if(s&&s.htmlFor&&s.onclick){o.loadedOkay=!0;try{s.onclick()}catch(e){}}s&&o._abort(new Error("JSONP script loaded abnormally (onreadystatechange)"))}},void 0===s.async&&t.document.attachEvent)if(r.isOpera())(i=this.script2=t.document.createElement("script")).text="try{var a = document.getElementById('"+s.id+"'); if(a)a.onerror();}catch(x){};",s.async=i.async=!1;else{try{s.htmlFor=s.id,s.event="onclick"}catch(e){}s.async=!0}void 0!==s.async&&(s.async=!0);var a=t.document.getElementsByTagName("head")[0];a.insertBefore(s,a.firstChild),i&&a.insertBefore(i,a.firstChild)},ze=a}(),i=ct();function o(e){if(!o.enabled())throw new Error("Transport created when disabled");n.call(this,e,"/jsonp",i,r)}return e(o,n),o.enabled=function(){return!!t.document},o.transportName="jsonp-polling",o.roundTrips=1,o.needBody=!0,Xe=o}function ut(){return Ye?Ze:(Ye=1,Ze=[ye(),Oe(),Re(),Ae(),it()(Ae()),ot(),it()(ot()),st(),at(),it()(st()),lt()])}var ht,dt,ft,pt,mt,gt,yt,bt,vt,wt,St,_t,Et,kt,Ot,Ct,Rt,Tt,At,xt,It,Nt,Pt,Lt,Ut,jt,Dt,Bt,Ft,$t,Ht,Mt,Wt,qt={};function Vt(){if(ht)return qt;ht=1;var e,t=Array.prototype,n=Object.prototype,r=Function.prototype,i=String.prototype,o=t.slice,s=n.toString,a=function(e){return"[object Function]"===n.toString.call(e)},c=function(e){return"[object String]"===s.call(e)},l=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}();e=l?function(e,t,n,r){!r&&t in e||Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:n})}:function(e,t,n,r){!r&&t in e||(e[t]=n)};var u=function(t,r,i){for(var o in r)n.hasOwnProperty.call(r,o)&&e(t,o,r[o],i)},h=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)};function d(){}u(r,{bind:function(e){var t=this;if(!a(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var n=o.call(arguments,1),r=Math.max(0,t.length-n.length),i=[],s=0;s<r;s++)i.push("$"+s);var c=Function("binder","return function ("+i.join(",")+"){ return binder.apply(this, arguments); }")(function(){if(this instanceof c){var r=t.apply(this,n.concat(o.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(o.call(arguments)))});return t.prototype&&(d.prototype=t.prototype,c.prototype=new d,d.prototype=null),c}}),u(Array,{isArray:function(e){return"[object Array]"===s.call(e)}});var f,p,m,g=Object("a"),y="a"!==g[0]||!(0 in g);u(t,{forEach:function(e){var t=h(this),n=y&&c(this)?this.split(""):t,r=arguments[1],i=-1,o=n.length>>>0;if(!a(e))throw new TypeError;for(;++i<o;)i in n&&e.call(r,n[i],i,t)}},(f=t.forEach,p=!0,m=!0,f&&(f.call("foo",function(e,t,n){"object"!=typeof n&&(p=!1)}),f.call([1],function(){m="string"==typeof this},"x")),!(f&&p&&m)));var b=Array.prototype.indexOf&&-1!==[0,1].indexOf(1,2);u(t,{indexOf:function(e){var t=y&&c(this)?this.split(""):h(this),n=t.length>>>0;if(!n)return-1;var r,i=0;for(arguments.length>1&&((r=+arguments[1])!=r?r=0:0!==r&&r!==1/0&&r!==-1/0&&(r=(r>0||-1)*Math.floor(Math.abs(r))),i=r),i=i>=0?i:Math.max(0,n+i);i<n;i++)if(i in t&&t[i]===e)return i;return-1}},b);var v,w=i.split;2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?(v=void 0===/()??/.exec("")[1],i.split=function(e,n){var r=this;if(void 0===e&&0===n)return[];if("[object RegExp]"!==s.call(e))return w.call(this,e,n);var i,o,a,c,l=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),h=0;for(e=new RegExp(e.source,u+"g"),r+="",v||(i=new RegExp("^"+e.source+"$(?!\\s)",u)),n=void 0===n?-1>>>0:n>>>0;(o=e.exec(r))&&!((a=o.index+o[0].length)>h&&(l.push(r.slice(h,o.index)),!v&&o.length>1&&o[0].replace(i,function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(o[e]=void 0)}),o.length>1&&o.index<r.length&&t.push.apply(l,o.slice(1)),c=o[0].length,h=a,l.length>=n));)e.lastIndex===o.index&&e.lastIndex++;return h===r.length?!c&&e.test("")||l.push(""):l.push(r.slice(h)),l.length>n?l.slice(0,n):l}):"0".split(void 0,0).length&&(i.split=function(e,t){return void 0===e&&0===t?[]:w.call(this,e,t)});var S=i.substr,_="".substr&&"b"!=="0b".substr(-1);return u(i,{substr:function(e,t){return S.call(this,e<0&&(e=this.length+e)<0?0:e,t)}},_),qt}function zt(){if(ft)return dt;ft=1;var e,t=/[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g;return dt={quote:function(n){var r=JSON.stringify(n);return t.lastIndex=0,t.test(r)?(e||(e=function(e){var t,n={},r=[];for(t=0;t<65536;t++)r.push(String.fromCharCode(t));return e.lastIndex=0,r.join("").replace(e,function(e){return n[e]="\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4),""}),e.lastIndex=0,n}(t)),r.replace(t,function(t){return e[t]})):r}}}function Jt(){if(mt)return pt;mt=1;return pt=function(e){return{filterToEnabled:function(t,n){var r={main:[],facade:[]};return t?"string"==typeof t&&(t=[t]):t=[],e.forEach(function(e){e&&("websocket"===e.transportName&&!1===n.websocket||(t.length&&-1===t.indexOf(e.transportName)?e.transportName:e.enabled(n)?(e.transportName,r.main.push(e),e.facadeTransport&&r.facade.push(e.facadeTransport)):e.transportName))}),r}}}}function Gt(){if(yt)return gt;yt=1;var e={};return["log","debug","warn"].forEach(function(n){var r;try{r=t.console&&t.console[n]&&t.console[n].apply}catch(e){}e[n]=r?function(){return t.console[n].apply(t.console,arguments)}:"log"===n?function(){}:e.log}),gt=e}function Kt(){if(vt)return bt;function e(e){this.type=e}return vt=1,e.prototype.initEvent=function(e,t,n){return this.type=e,this.bubbles=t,this.cancelable=n,this.timeStamp=+new Date,this},e.prototype.stopPropagation=function(){},e.prototype.preventDefault=function(){},e.CAPTURING_PHASE=1,e.AT_TARGET=2,e.BUBBLING_PHASE=3,bt=e}function Xt(){return St?wt:(St=1,wt=t.location||{origin:"http://localhost:80",protocol:"http:",host:"localhost",port:80,href:"http://localhost/",hash:""})}function Qt(){if(At)return Tt;At=1;var e=L().EventEmitter,t=T(),n=rt();function r(t,r){e.call(this);var i=this,o=+new Date;this.xo=new r("GET",t),this.xo.once("finish",function(e,t){var r,s;if(200===e){if(s=+new Date-o,t)try{r=JSON.parse(t)}catch(e){}n.isObject(r)||(r={})}i.emit("finish",r,s),i.removeAllListeners()})}return t(r,e),r.prototype.close=function(){this.removeAllListeners(),this.xo.close()},Tt=r}function Zt(){if(It)return xt;It=1;var e=T(),t=L().EventEmitter,n=Ee(),r=Qt();function i(e){var i=this;t.call(this),this.ir=new r(e,n),this.ir.once("finish",function(e,t){i.ir=null,i.emit("message",JSON.stringify([e,t]))})}return e(i,t),i.transportName="iframe-info-receiver",i.prototype.close=function(){this.ir&&(this.ir.close(),this.ir=null),this.removeAllListeners()},xt=i}function Yt(){if(Ut)return Lt;Ut=1;var e=L().EventEmitter,n=T(),r=O(),i=Ce(),o=_e(),s=Ee(),a=function(){if(Rt)return Ct;Rt=1;var e=L().EventEmitter;function t(){var n=this;e.call(this),this.to=setTimeout(function(){n.emit("finish",200,"{}")},t.timeout)}return T()(t,e),t.prototype.close=function(){clearTimeout(this.to)},t.timeout=2e3,Ct=t}(),c=function(){if(Pt)return Nt;Pt=1;var e=L().EventEmitter,n=T(),r=y(),i=nt(),o=Zt();function s(n,s){var a=this;e.call(this);var c=function(){var e=a.ifr=new i(o.transportName,s,n);e.once("message",function(e){if(e){var t;try{t=JSON.parse(e)}catch(e){return a.emit("finish"),void a.close()}var n=t[0],r=t[1];a.emit("finish",n,r)}a.close()}),e.once("close",function(){a.emit("finish"),a.close()})};t.document.body?c():r.attachEvent("load",c)}return n(s,e),s.enabled=function(){return i.enabled()},s.prototype.close=function(){this.ifr&&this.ifr.close(),this.removeAllListeners(),this.ifr=null},Nt=s}(),l=Qt();function u(t,n){var r=this;e.call(this),setTimeout(function(){r.doXhr(t,n)},0)}return n(u,e),u._getReceiver=function(e,t,n){return n.sameOrigin?new l(t,s):o.enabled?new l(t,o):i.enabled&&n.sameScheme?new l(t,i):c.enabled()?new c(e,t):new l(t,a)},u.prototype.doXhr=function(e,t){var n=this,i=r.addPath(e,"/info");this.xo=u._getReceiver(e,i,t),this.timeoutRef=setTimeout(function(){n._cleanup(!1),n.emit("finish")},u.timeout),this.xo.once("finish",function(e,t){n._cleanup(!0),n.emit("finish",e,t)})},u.prototype._cleanup=function(e){clearTimeout(this.timeoutRef),this.timeoutRef=null,!e&&this.xo&&this.xo.close(),this.xo=null},u.prototype.close=function(){this.removeAllListeners(),this._cleanup(!1)},u.timeout=8e3,Lt=u}function en(){if(Ft)return Bt;Ft=1;var e=O(),t=y(),n=function(){if(Dt)return jt;Dt=1;var e=tt();function t(e){this._transport=e,e.on("message",this._transportMessage.bind(this)),e.on("close",this._transportClose.bind(this))}return t.prototype._transportClose=function(t,n){e.postMessage("c",JSON.stringify([t,n]))},t.prototype._transportMessage=function(t){e.postMessage("t",t)},t.prototype._send=function(e){this._transport.send(e)},t.prototype._close=function(){this._transport.close(),this._transport.removeAllListeners()},jt=t}(),r=Zt(),i=tt(),o=Xt();return Bt=function(s,a){var c,l={};a.forEach(function(e){e.facadeTransport&&(l[e.facadeTransport.transportName]=e.facadeTransport)}),l[r.transportName]=r,s.bootstrap_iframe=function(){var r;i.currentWindowId=o.hash.slice(1);t.attachEvent("message",function(t){if(t.source===parent&&(void 0===c&&(c=t.origin),t.origin===c)){var a;try{a=JSON.parse(t.data)}catch(e){return void t.data}if(a.windowId===i.currentWindowId)switch(a.type){case"s":var u;try{u=JSON.parse(a.data)}catch(e){a.data;break}var h=u[0],d=u[1],f=u[2],p=u[3];if(h!==s.version)throw new Error('Incompatible SockJS! Main site uses: "'+h+'", the iframe: "'+s.version+'".');if(!e.isOriginEqual(f,o.href)||!e.isOriginEqual(p,o.href))throw new Error("Can't connect to different domain from within an iframe. ("+o.href+", "+f+", "+p+")");r=new n(new l[d](f,p));break;case"m":r._send(a.data);break;case"c":r&&r._close(),r=null}}}),i.postMessage("s")}},Bt}function tn(){if(Ht)return $t;Ht=1,Vt();var e,n=k(),r=T(),i=g(),o=zt(),s=O(),a=y(),c=Jt(),l=rt(),u=ke(),h=Gt(),d=Kt(),f=P(),p=Xt(),m=function(){if(Et)return _t;Et=1;var e=T(),t=Kt();function n(){t.call(this),this.initEvent("close",!1,!1),this.wasClean=!1,this.code=0,this.reason=""}return e(n,t),_t=n}(),b=function(){if(Ot)return kt;Ot=1;var e=T(),t=Kt();function n(e){t.call(this),this.initEvent("message",!1,!1),this.data=e}return e(n,t),kt=n}(),v=Yt(),w=function(){};function S(e,t,r){if(!(this instanceof S))return new S(e,t,r);if(arguments.length<1)throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present");f.call(this),this.readyState=S.CONNECTING,this.extensions="",this.protocol="",(r=r||{}).protocols_whitelist&&h.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead."),this._transportsWhitelist=r.transports,this._transportOptions=r.transportOptions||{},this._timeout=r.timeout||0;var o=r.sessionId||8;if("function"==typeof o)this._generateSessionId=o;else{if("number"!=typeof o)throw new TypeError("If sessionId is used in the options, it needs to be a number or a function.");this._generateSessionId=function(){return i.string(o)}}this._server=r.server||i.numberString(1e3);var a=new n(e);if(!a.host||!a.protocol)throw new SyntaxError("The URL '"+e+"' is invalid");if(a.hash)throw new SyntaxError("The URL must not contain a fragment");if("http:"!==a.protocol&&"https:"!==a.protocol)throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '"+a.protocol+"' is not allowed.");var c="https:"===a.protocol;if("https:"===p.protocol&&!c&&!s.isLoopbackAddr(a.hostname))throw new Error("SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS");t?Array.isArray(t)||(t=[t]):t=[];var l=t.sort();l.forEach(function(e,t){if(!e)throw new SyntaxError("The protocols entry '"+e+"' is invalid.");if(t<l.length-1&&e===l[t+1])throw new SyntaxError("The protocols entry '"+e+"' is duplicated.")});var d=s.getOrigin(p.href);this._origin=d?d.toLowerCase():null,a.set("pathname",a.pathname.replace(/\/+$/,"")),this.url=a.href,this.url,this._urlInfo={nullOrigin:!u.hasDomain(),sameOrigin:s.isOriginEqual(this.url,p.href),sameScheme:s.isSchemeEqual(this.url,p.href)},this._ir=new v(this.url,this._urlInfo),this._ir.once("finish",this._receiveInfo.bind(this))}function _(e){return 1e3===e||e>=3e3&&e<=4999}return r(S,f),S.prototype.close=function(e,t){if(e&&!_(e))throw new Error("InvalidAccessError: Invalid code");if(t&&t.length>123)throw new SyntaxError("reason argument has an invalid length");if(this.readyState!==S.CLOSING&&this.readyState!==S.CLOSED){this._close(e||1e3,t||"Normal closure",!0)}},S.prototype.send=function(e){if("string"!=typeof e&&(e=""+e),this.readyState===S.CONNECTING)throw new Error("InvalidStateError: The connection has not been established yet");this.readyState===S.OPEN&&this._transport.send(o.quote(e))},S.version=xe(),S.CONNECTING=0,S.OPEN=1,S.CLOSING=2,S.CLOSED=3,S.prototype._receiveInfo=function(t,n){if(this._ir=null,t){this._rto=this.countRTO(n),this._transUrl=t.base_url?t.base_url:this.url,t=l.extend(t,this._urlInfo);var r=e.filterToEnabled(this._transportsWhitelist,t);this._transports=r.main,this._transports.length,this._connect()}else this._close(1002,"Cannot connect to server")},S.prototype._connect=function(){for(var e=this._transports.shift();e;e=this._transports.shift()){if(w(e.transportName),e.needBody&&(!t.document.body||void 0!==t.document.readyState&&"complete"!==t.document.readyState&&"interactive"!==t.document.readyState))return this._transports.unshift(e),void a.attachEvent("load",this._connect.bind(this));var n=Math.max(this._timeout,this._rto*e.roundTrips||5e3);this._transportTimeoutId=setTimeout(this._transportTimeout.bind(this),n);var r=s.addPath(this._transUrl,"/"+this._server+"/"+this._generateSessionId()),i=this._transportOptions[e.transportName],o=new e(r,this._transUrl,i);return o.on("message",this._transportMessage.bind(this)),o.once("close",this._transportClose.bind(this)),o.transportName=e.transportName,void(this._transport=o)}this._close(2e3,"All transports failed",!1)},S.prototype._transportTimeout=function(){this.readyState===S.CONNECTING&&(this._transport&&this._transport.close(),this._transportClose(2007,"Transport timed out"))},S.prototype._transportMessage=function(e){var t,n=this,r=e.slice(0,1),i=e.slice(1);switch(r){case"o":return void this._open();case"h":return this.dispatchEvent(new d("heartbeat")),void this.transport}if(i)try{t=JSON.parse(i)}catch(e){}if(void 0!==t)switch(r){case"a":Array.isArray(t)&&t.forEach(function(e){n.transport,n.dispatchEvent(new b(e))});break;case"m":this.transport,this.dispatchEvent(new b(t));break;case"c":Array.isArray(t)&&2===t.length&&this._close(t[0],t[1],!0)}},S.prototype._transportClose=function(e,t){this.transport,this._transport&&(this._transport.removeAllListeners(),this._transport=null,this.transport=null),_(e)||2e3===e||this.readyState!==S.CONNECTING?this._close(e,t):this._connect()},S.prototype._open=function(){this._transport&&this._transport.transportName,this.readyState,this.readyState===S.CONNECTING?(this._transportTimeoutId&&(clearTimeout(this._transportTimeoutId),this._transportTimeoutId=null),this.readyState=S.OPEN,this.transport=this._transport.transportName,this.dispatchEvent(new d("open")),this.transport):this._close(1006,"Server lost session")},S.prototype._close=function(e,t,n){this.transport,this.readyState;var r=!1;if(this._ir&&(r=!0,this._ir.close(),this._ir=null),this._transport&&(this._transport.close(),this._transport=null,this.transport=null),this.readyState===S.CLOSED)throw new Error("InvalidStateError: SockJS has already been closed");this.readyState=S.CLOSING,setTimeout(function(){this.readyState=S.CLOSED,r&&this.dispatchEvent(new d("error"));var i=new m("close");i.wasClean=n||!1,i.code=e||1e3,i.reason=t,this.dispatchEvent(i),this.onmessage=this.onclose=this.onerror=null}.bind(this),0)},S.prototype.countRTO=function(e){return e>100?4*e:300+e},$t=function(t){return e=c(t),en()(S,t),S}}var nn,rn=function(){if(Wt)return Mt;Wt=1;var e=ut();return Mt=tn()(e),"_sockjs_onload"in t&&setTimeout(t._sockjs_onload,1),Mt}(),on=n(rn),sn={exports:{}};function an(){return nn||(nn=1,function(e,t){!function(e){function t(e,t){e.terminate=function(){const n=()=>{};this.onerror=n,this.onmessage=n,this.onopen=n;const r=new Date,i=Math.random().toString().substring(2,8),o=this.onclose;this.onclose=e=>{const n=(new Date).getTime()-r.getTime();t(`Discarded socket (#${i})  closed after ${n}ms, with code/reason: ${e.code}/${e.reason}`)},this.close(),o?.call(e,{code:4001,reason:`Quick discarding socket (#${i}) without waiting for the shutdown sequence.`,wasClean:!1})}}const n={LF:"\n",NULL:"\0"};class r{get body(){return!this._body&&this.isBinaryBody&&(this._body=(new TextDecoder).decode(this._binaryBody)),this._body||""}get binaryBody(){return this._binaryBody||this.isBinaryBody||(this._binaryBody=(new TextEncoder).encode(this._body)),this._binaryBody}constructor(e){const{command:t,headers:n,body:r,binaryBody:i,escapeHeaderValues:o,skipContentLengthHeader:s}=e;this.command=t,this.headers=Object.assign({},n||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=r||"",this.isBinaryBody=!1),this.escapeHeaderValues=o||!1,this.skipContentLengthHeader=s||!1}static fromRawFrame(e,t){const n={},i=e=>e.replace(/^\s+|\s+$/g,"");for(const o of e.headers.reverse()){o.indexOf(":");const s=i(o[0]);let a=i(o[1]);t&&"CONNECT"!==e.command&&"CONNECTED"!==e.command&&(a=r.hdrValueUnEscape(a)),n[s]=a}return new r({command:e.command,headers:n,binaryBody:e.binaryBody,escapeHeaderValues:t})}toString(){return this.serializeCmdAndHeaders()}serialize(){const e=this.serializeCmdAndHeaders();return this.isBinaryBody?r.toUnit8Array(e,this._binaryBody).buffer:e+this._body+n.NULL}serializeCmdAndHeaders(){const e=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const t of Object.keys(this.headers||{})){const n=this.headers[t];this.escapeHeaderValues&&"CONNECT"!==this.command&&"CONNECTED"!==this.command?e.push(`${t}:${r.hdrValueEscape(`${n}`)}`):e.push(`${t}:${n}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&e.push(`content-length:${this.bodyLength()}`),e.join(n.LF)+n.LF+n.LF}isBodyEmpty(){return 0===this.bodyLength()}bodyLength(){const e=this.binaryBody;return e?e.length:0}static sizeOfUTF8(e){return e?(new TextEncoder).encode(e).length:0}static toUnit8Array(e,t){const n=(new TextEncoder).encode(e),r=new Uint8Array([0]),i=new Uint8Array(n.length+t.length+r.length);return i.set(n),i.set(t,n.length),i.set(r,n.length+t.length),i}static marshall(e){return new r(e).serialize()}static hdrValueEscape(e){return e.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(e){return e.replace(/\\r/g,"\r").replace(/\\n/g,"\n").replace(/\\c/g,":").replace(/\\\\/g,"\\")}}const i=0,o=10,s=13,a=58;class c{constructor(e,t){this.onFrame=e,this.onIncomingPing=t,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(e,t=!1){let n;if(n="string"==typeof e?this._encoder.encode(e):new Uint8Array(e),t&&0!==n[n.length-1]){const e=new Uint8Array(n.length+1);e.set(n,0),e[n.length]=0,n=e}for(let e=0;e<n.length;e++){const t=n[e];this._onByte(t)}}_collectFrame(e){e!==i&&e!==s&&(e!==o?(this._onByte=this._collectCommand,this._reinjectByte(e)):this.onIncomingPing())}_collectCommand(e){if(e!==s)return e===o?(this._results.command=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_collectHeaders(e){e!==s&&(e!==o?(this._onByte=this._collectHeaderKey,this._reinjectByte(e)):this._setupCollectBody())}_reinjectByte(e){this._onByte(e)}_collectHeaderKey(e){if(e===a)return this._headerKey=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaderValue);this._consumeByte(e)}_collectHeaderValue(e){if(e!==s)return e===o?(this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,void(this._onByte=this._collectHeaders)):void this._consumeByte(e)}_setupCollectBody(){const e=this._results.headers.filter(e=>"content-length"===e[0])[0];e?(this._bodyBytesRemaining=parseInt(e[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(e){e!==i?this._consumeByte(e):this._retrievedBody()}_collectBodyFixedSize(e){0!==this._bodyBytesRemaining--?this._consumeByte(e):this._retrievedBody()}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw();try{this.onFrame(this._results)}catch(e){console.log("Ignoring an exception thrown by a frame handler. Original exception: ",e)}this._initState()}_consumeByte(e){this._token.push(e)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const e=new Uint8Array(this._token);return this._token=[],e}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var l,u,h,d;e.StompSocketState=void 0,(d=e.StompSocketState||(e.StompSocketState={}))[d.CONNECTING=0]="CONNECTING",d[d.OPEN=1]="OPEN",d[d.CLOSING=2]="CLOSING",d[d.CLOSED=3]="CLOSED",e.ActivationState=void 0,(h=e.ActivationState||(e.ActivationState={}))[h.ACTIVE=0]="ACTIVE",h[h.DEACTIVATING=1]="DEACTIVATING",h[h.INACTIVE=2]="INACTIVE",e.ReconnectionTimeMode=void 0,(u=e.ReconnectionTimeMode||(e.ReconnectionTimeMode={}))[u.LINEAR=0]="LINEAR",u[u.EXPONENTIAL=1]="EXPONENTIAL",e.TickerStrategy=void 0,(l=e.TickerStrategy||(e.TickerStrategy={})).Interval="interval",l.Worker="worker";class f{constructor(t,n=e.TickerStrategy.Interval,r){this._interval=t,this._strategy=n,this._debug=r,this._workerScript=`\n    var startTime = Date.now();\n    setInterval(function() {\n        self.postMessage(Date.now() - startTime);\n    }, ${this._interval});\n  `}start(e){this.stop(),this.shouldUseWorker()?this.runWorker(e):this.runInterval(e)}stop(){this.disposeWorker(),this.disposeInterval()}shouldUseWorker(){return"undefined"!=typeof Worker&&this._strategy===e.TickerStrategy.Worker}runWorker(e){this._debug("Using runWorker for outgoing pings"),this._worker||(this._worker=new Worker(URL.createObjectURL(new Blob([this._workerScript],{type:"text/javascript"}))),this._worker.onmessage=t=>e(t.data))}runInterval(e){if(this._debug("Using runInterval for outgoing pings"),!this._timer){const t=Date.now();this._timer=setInterval(()=>{e(Date.now()-t)},this._interval)}}disposeWorker(){this._worker&&(this._worker.terminate(),delete this._worker,this._debug("Outgoing ping disposeWorker"))}disposeInterval(){this._timer&&(clearInterval(this._timer),delete this._timer,this._debug("Outgoing ping disposeInterval"))}}class p{constructor(e){this.versions=e}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map(e=>`v${e.replace(".","")}.stomp`)}}p.V1_0="1.0",p.V1_1="1.1",p.V1_2="1.2",p.default=new p([p.V1_2,p.V1_1,p.V1_0]);class m{get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}constructor(e,t,n){this._client=e,this._webSocket=t,this._connected=!1,this._serverFrameHandlers={CONNECTED:e=>{this.debug(`connected to server ${e.headers.server}`),this._connected=!0,this._connectedVersion=e.headers.version,this._connectedVersion===p.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(e.headers),this.onConnect(e)},MESSAGE:e=>{const t=e.headers.subscription,n=this._subscriptions[t]||this.onUnhandledMessage,r=e,i=this,o=this._connectedVersion===p.V1_2?r.headers.ack:r.headers["message-id"];r.ack=(e={})=>i.ack(o,t,e),r.nack=(e={})=>i.nack(o,t,e),n(r)},RECEIPT:e=>{const t=this._receiptWatchers[e.headers["receipt-id"]];t?(t(e),delete this._receiptWatchers[e.headers["receipt-id"]]):this.onUnhandledReceipt(e)},ERROR:e=>{this.onStompError(e)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.debug=n.debug,this.stompVersions=n.stompVersions,this.connectHeaders=n.connectHeaders,this.disconnectHeaders=n.disconnectHeaders,this.heartbeatIncoming=n.heartbeatIncoming,this.heartbeatToleranceMultiplier=n.heartbeatGracePeriods,this.heartbeatOutgoing=n.heartbeatOutgoing,this.splitLargeFrames=n.splitLargeFrames,this.maxWebSocketChunkSize=n.maxWebSocketChunkSize,this.forceBinaryWSFrames=n.forceBinaryWSFrames,this.logRawCommunication=n.logRawCommunication,this.appendMissingNULLonIncoming=n.appendMissingNULLonIncoming,this.discardWebsocketOnCommFailure=n.discardWebsocketOnCommFailure,this.onConnect=n.onConnect,this.onDisconnect=n.onDisconnect,this.onStompError=n.onStompError,this.onWebSocketClose=n.onWebSocketClose,this.onWebSocketError=n.onWebSocketError,this.onUnhandledMessage=n.onUnhandledMessage,this.onUnhandledReceipt=n.onUnhandledReceipt,this.onUnhandledFrame=n.onUnhandledFrame,this.onHeartbeatReceived=n.onHeartbeatReceived,this.onHeartbeatLost=n.onHeartbeatLost}start(){const t=new c(e=>{const t=r.fromRawFrame(e,this._escapeHeaderValues);this.logRawCommunication||this.debug(`<<< ${t}`),(this._serverFrameHandlers[t.command]||this.onUnhandledFrame)(t)},()=>{this.debug("<<< PONG"),this.onHeartbeatReceived()});this._webSocket.onmessage=e=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const t=e.data instanceof ArrayBuffer?(new TextDecoder).decode(e.data):e.data;this.debug(`<<< ${t}`)}t.parseChunk(e.data,this.appendMissingNULLonIncoming)},this._webSocket.onclose=e=>{this.debug(`Connection closed to ${this._webSocket.url}`),this._cleanUp(),this.onWebSocketClose(e)},this._webSocket.onerror=e=>{this.onWebSocketError(e)};const n=()=>{const e=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),e["accept-version"]=this.stompVersions.supportedVersions(),e["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:e})};this._webSocket.readyState===e.StompSocketState.OPEN?n():this._webSocket.onopen=n}_setupHeartbeat(t){if(t.version!==p.V1_1&&t.version!==p.V1_2)return;if(!t["heart-beat"])return;const[r,i]=t["heart-beat"].split(",").map(e=>parseInt(e,10));if(0!==this.heartbeatOutgoing&&0!==i){const t=Math.max(this.heartbeatOutgoing,i);this.debug(`send PING every ${t}ms`),this._pinger=new f(t,this._client.heartbeatStrategy,this.debug),this._pinger.start(()=>{this._webSocket.readyState===e.StompSocketState.OPEN&&(this._webSocket.send(n.LF),this.debug(">>> PING"))})}if(0!==this.heartbeatIncoming&&0!==r){const e=Math.max(this.heartbeatIncoming,r);this.debug(`check PONG every ${e}ms`),this._ponger=setInterval(()=>{const t=Date.now()-this._lastServerActivityTS;t>e*this.heartbeatToleranceMultiplier&&(this.debug(`did not receive server activity for the last ${t}ms`),this.onHeartbeatLost(),this._closeOrDiscardWebsocket())},e)}}_closeOrDiscardWebsocket(){this.discardWebsocketOnCommFailure?(this.debug("Discarding websocket, the underlying socket may linger for a while"),this.discardWebsocket()):(this.debug("Issuing close on the websocket"),this._closeWebsocket())}forceDisconnect(){this._webSocket&&(this._webSocket.readyState!==e.StompSocketState.CONNECTING&&this._webSocket.readyState!==e.StompSocketState.OPEN||this._closeOrDiscardWebsocket())}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}discardWebsocket(){"function"!=typeof this._webSocket.terminate&&t(this._webSocket,e=>this.debug(e)),this._webSocket.terminate()}_transmit(e){const{command:t,headers:n,body:i,binaryBody:o,skipContentLengthHeader:s}=e,a=new r({command:t,headers:n,body:i,binaryBody:o,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:s});let c=a.serialize();if(this.logRawCommunication?this.debug(`>>> ${c}`):this.debug(`>>> ${a}`),this.forceBinaryWSFrames&&"string"==typeof c&&(c=(new TextEncoder).encode(c)),"string"==typeof c&&this.splitLargeFrames){let e=c;for(;e.length>0;){const t=e.substring(0,this.maxWebSocketChunkSize);e=e.substring(this.maxWebSocketChunkSize),this._webSocket.send(t),this.debug(`chunk sent = ${t.length}, remaining = ${e.length}`)}}else this._webSocket.send(c)}dispose(){if(this.connected)try{const e=Object.assign({},this.disconnectHeaders);e.receipt||(e.receipt="close-"+this._counter++),this.watchForReceipt(e.receipt,e=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(e)}),this._transmit({command:"DISCONNECT",headers:e})}catch(e){this.debug(`Ignoring error during disconnect ${e}`)}else this._webSocket.readyState!==e.StompSocketState.CONNECTING&&this._webSocket.readyState!==e.StompSocketState.OPEN||this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&(this._pinger.stop(),this._pinger=void 0),this._ponger&&(clearInterval(this._ponger),this._ponger=void 0)}publish(e){const{destination:t,headers:n,body:r,binaryBody:i,skipContentLengthHeader:o}=e,s=Object.assign({destination:t},n);this._transmit({command:"SEND",headers:s,body:r,binaryBody:i,skipContentLengthHeader:o})}watchForReceipt(e,t){this._receiptWatchers[e]=t}subscribe(e,t,n={}){(n=Object.assign({},n)).id||(n.id="sub-"+this._counter++),n.destination=e,this._subscriptions[n.id]=t,this._transmit({command:"SUBSCRIBE",headers:n});const r=this;return{id:n.id,unsubscribe:e=>r.unsubscribe(n.id,e)}}unsubscribe(e,t={}){t=Object.assign({},t),delete this._subscriptions[e],t.id=e,this._transmit({command:"UNSUBSCRIBE",headers:t})}begin(e){const t=e||"tx-"+this._counter++;this._transmit({command:"BEGIN",headers:{transaction:t}});const n=this;return{id:t,commit(){n.commit(t)},abort(){n.abort(t)}}}commit(e){this._transmit({command:"COMMIT",headers:{transaction:e}})}abort(e){this._transmit({command:"ABORT",headers:{transaction:e}})}ack(e,t,n={}){n=Object.assign({},n),this._connectedVersion===p.V1_2?n.id=e:n["message-id"]=e,n.subscription=t,this._transmit({command:"ACK",headers:n})}nack(e,t,n={}){return n=Object.assign({},n),this._connectedVersion===p.V1_2?n.id=e:n["message-id"]=e,n.subscription=t,this._transmit({command:"NACK",headers:n})}}class g{get webSocket(){return this._stompHandler?._webSocket}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(e){this._disconnectHeaders=e,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)}get connected(){return!!this._stompHandler&&this._stompHandler.connected}get connectedVersion(){return this._stompHandler?this._stompHandler.connectedVersion:void 0}get active(){return this.state===e.ActivationState.ACTIVE}_changeState(e){this.state=e,this.onChangeState(e)}constructor(t={}){this.stompVersions=p.default,this.connectionTimeout=0,this.reconnectDelay=5e3,this._nextReconnectDelay=0,this.maxReconnectDelay=9e5,this.reconnectTimeMode=e.ReconnectionTimeMode.LINEAR,this.heartbeatIncoming=1e4,this.heartbeatToleranceMultiplier=2,this.heartbeatOutgoing=1e4,this.heartbeatStrategy=e.TickerStrategy.Interval,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8192,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this.discardWebsocketOnCommFailure=!1,this.state=e.ActivationState.INACTIVE;const n=()=>{};this.debug=n,this.beforeConnect=n,this.onConnect=n,this.onDisconnect=n,this.onUnhandledMessage=n,this.onUnhandledReceipt=n,this.onUnhandledFrame=n,this.onHeartbeatReceived=n,this.onHeartbeatLost=n,this.onStompError=n,this.onWebSocketClose=n,this.onWebSocketError=n,this.logRawCommunication=!1,this.onChangeState=n,this.connectHeaders={},this._disconnectHeaders={},this.configure(t)}configure(e){Object.assign(this,e),this.maxReconnectDelay>0&&this.maxReconnectDelay<this.reconnectDelay&&(this.debug(`Warning: maxReconnectDelay (${this.maxReconnectDelay}ms) is less than reconnectDelay (${this.reconnectDelay}ms). Using reconnectDelay as the maxReconnectDelay delay.`),this.maxReconnectDelay=this.reconnectDelay)}activate(){const t=()=>{this.active?this.debug("Already ACTIVE, ignoring request to activate"):(this._changeState(e.ActivationState.ACTIVE),this._nextReconnectDelay=this.reconnectDelay,this._connect())};this.state===e.ActivationState.DEACTIVATING?(this.debug("Waiting for deactivation to finish before activating"),this.deactivate().then(()=>{t()})):t()}async _connect(){if(await this.beforeConnect(this),this._stompHandler)return void this.debug("There is already a stompHandler, skipping the call to connect");if(!this.active)return void this.debug("Client has been marked inactive, will not attempt to connect");this.connectionTimeout>0&&(this._connectionWatcher&&clearTimeout(this._connectionWatcher),this._connectionWatcher=setTimeout(()=>{this.connected||(this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`),this.forceDisconnect())},this.connectionTimeout)),this.debug("Opening Web Socket...");const t=this._createWebSocket();this._stompHandler=new m(this,t,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatGracePeriods:this.heartbeatToleranceMultiplier,heartbeatOutgoing:this.heartbeatOutgoing,heartbeatStrategy:this.heartbeatStrategy,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,discardWebsocketOnCommFailure:this.discardWebsocketOnCommFailure,onConnect:e=>{if(this._connectionWatcher&&(clearTimeout(this._connectionWatcher),this._connectionWatcher=void 0),this._nextReconnectDelay=this.reconnectDelay,!this.active)return this.debug("STOMP got connected while deactivate was issued, will disconnect now"),void this._disposeStompHandler();this.onConnect(e)},onDisconnect:e=>{this.onDisconnect(e)},onStompError:e=>{this.onStompError(e)},onWebSocketClose:t=>{this._stompHandler=void 0,this.state===e.ActivationState.DEACTIVATING&&this._changeState(e.ActivationState.INACTIVE),this.onWebSocketClose(t),this.active&&this._schedule_reconnect()},onWebSocketError:e=>{this.onWebSocketError(e)},onUnhandledMessage:e=>{this.onUnhandledMessage(e)},onUnhandledReceipt:e=>{this.onUnhandledReceipt(e)},onUnhandledFrame:e=>{this.onUnhandledFrame(e)},onHeartbeatReceived:()=>{this.onHeartbeatReceived()},onHeartbeatLost:()=>{this.onHeartbeatLost()}}),this._stompHandler.start()}_createWebSocket(){let e;if(this.webSocketFactory)e=this.webSocketFactory();else{if(!this.brokerURL)throw new Error("Either brokerURL or webSocketFactory must be provided");e=new WebSocket(this.brokerURL,this.stompVersions.protocolVersions())}return e.binaryType="arraybuffer",e}_schedule_reconnect(){this._nextReconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this._nextReconnectDelay}ms`),this._reconnector=setTimeout(()=>{this.reconnectTimeMode===e.ReconnectionTimeMode.EXPONENTIAL&&(this._nextReconnectDelay=2*this._nextReconnectDelay,0!==this.maxReconnectDelay&&(this._nextReconnectDelay=Math.min(this._nextReconnectDelay,this.maxReconnectDelay))),this._connect()},this._nextReconnectDelay))}async deactivate(t={}){const n=t.force||!1,r=this.active;let i;if(this.state===e.ActivationState.INACTIVE)return this.debug("Already INACTIVE, nothing more to do"),Promise.resolve();if(this._changeState(e.ActivationState.DEACTIVATING),this._nextReconnectDelay=0,this._reconnector&&(clearTimeout(this._reconnector),this._reconnector=void 0),!this._stompHandler||this.webSocket.readyState===e.StompSocketState.CLOSED)return this._changeState(e.ActivationState.INACTIVE),Promise.resolve();{const e=this._stompHandler.onWebSocketClose;i=new Promise((t,n)=>{this._stompHandler.onWebSocketClose=n=>{e(n),t()}})}return n?this._stompHandler?.discardWebsocket():r&&this._disposeStompHandler(),i}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&this._stompHandler.dispose()}publish(e){this._checkConnection(),this._stompHandler.publish(e)}_checkConnection(){if(!this.connected)throw new TypeError("There is no underlying STOMP connection")}watchForReceipt(e,t){this._checkConnection(),this._stompHandler.watchForReceipt(e,t)}subscribe(e,t,n={}){return this._checkConnection(),this._stompHandler.subscribe(e,t,n)}unsubscribe(e,t={}){this._checkConnection(),this._stompHandler.unsubscribe(e,t)}begin(e){return this._checkConnection(),this._stompHandler.begin(e)}commit(e){this._checkConnection(),this._stompHandler.commit(e)}abort(e){this._checkConnection(),this._stompHandler.abort(e)}ack(e,t,n={}){this._checkConnection(),this._stompHandler.ack(e,t,n)}nack(e,t,n={}){this._checkConnection(),this._stompHandler.nack(e,t,n)}}class y{}class b{}class v{constructor(e){this.client=e}get outgoing(){return this.client.heartbeatOutgoing}set outgoing(e){this.client.heartbeatOutgoing=e}get incoming(){return this.client.heartbeatIncoming}set incoming(e){this.client.heartbeatIncoming=e}}class w extends g{constructor(e){super(),this.maxWebSocketFrameSize=16384,this._heartbeatInfo=new v(this),this.reconnect_delay=0,this.webSocketFactory=e,this.debug=(...e)=>{console.log(...e)}}_parseConnect(...e){let t,n,r,i={};if(e.length<2)throw new Error("Connect requires at least 2 arguments");return"function"==typeof e[1]?[i,n,r,t]=e:6===e.length?[i.login,i.passcode,n,r,t,i.host]=e:[i.login,i.passcode,n,r,t]=e,[i,n,r,t]}connect(...e){const t=this._parseConnect(...e);t[0]&&(this.connectHeaders=t[0]),t[1]&&(this.onConnect=t[1]),t[2]&&(this.onStompError=t[2]),t[3]&&(this.onWebSocketClose=t[3]),super.activate()}disconnect(e,t={}){e&&(this.onDisconnect=e),this.disconnectHeaders=t,super.deactivate()}send(e,t={},n=""){const r=!1===(t=Object.assign({},t))["content-length"];r&&delete t["content-length"],this.publish({destination:e,headers:t,body:n,skipContentLengthHeader:r})}set reconnect_delay(e){this.reconnectDelay=e}get ws(){return this.webSocket}get version(){return this.connectedVersion}get onreceive(){return this.onUnhandledMessage}set onreceive(e){this.onUnhandledMessage=e}get onreceipt(){return this.onUnhandledReceipt}set onreceipt(e){this.onUnhandledReceipt=e}get heartbeat(){return this._heartbeatInfo}set heartbeat(e){this.heartbeatIncoming=e.incoming,this.heartbeatOutgoing=e.outgoing}}class S{static client(e,t){return null==t&&(t=p.default.protocolVersions()),new w(()=>new(S.WebSocketClass||WebSocket)(e,t))}static over(e){let t;return"function"==typeof e?t=e:(console.warn("Stomp.over did not receive a factory, auto reconnect will not work. Please see https://stomp-js.github.io/api-docs/latest/classes/Stomp.html#over"),t=()=>e),new w(t)}}S.WebSocketClass=null,e.Client=g,e.CompatClient=w,e.FrameImpl=r,e.Parser=c,e.Stomp=S,e.StompConfig=y,e.StompHeaders=b,e.Versions=p}(t)}(0,sn.exports)),sn.exports}var cn=an(),ln={sendLogMessage:(e,t,n)=>new Promise((r,i)=>{const o=new XMLHttpRequest;o.open("POST",`${e}/public/log`),o.onreadystatechange=()=>{4===o.readyState&&(200!==o.status?i(new Error(`Unable to send client log message.  Received status [${o.status}]`)):r(JSON.parse(o.response)))},o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.send(JSON.stringify({message:t[0],level:n.level}))}),configureLogging(e,t){if(!!t.clientLib&&"true"===t.clientLib.loggingEnabled){const n=f.createDefaultHandler();f.setHandler((t,r)=>{n(t,r),this.sendLogMessage(e,t,r)});let r=f[t.clientLib.loggingLevel];f.setLevel(r),r||(r=f.INFO,f.warn(`SkillsClient::SkillService::Unknown log level [${t.clientLib.loggingLevel}], defaulting to INFO`)),f.info(`SkillsClient::SkillService::Logger enabled, log level set to [${r.name}]`)}},reportSkillsClientVersion:e=>new Promise((t,n)=>{const r=new XMLHttpRequest;r.open("POST",`${e.getServiceUrl()}/api/projects/${e.getProjectId()}/skillsClientVersion`),r.withCredentials=e.isPKIMode(),e.isPKIMode()||r.setRequestHeader("Authorization",`Bearer ${e.getAuthToken()}`),r.onreadystatechange=()=>{4===r.readyState&&(200!==r.status?n(new Error(`Unable to report skillsClientVersion.  Received status [${r.status}]`)):t(JSON.parse(r.response)))},r.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.send(JSON.stringify({skillsClientVersion:e.skillsClientVersion}))}),getServiceStatus:e=>new Promise((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e),r.onreadystatechange=()=>{4===r.readyState&&(200!==r.status?n(new Error(`Unable to retrieve client configuration.  Received status [${r.status}]`)):t(JSON.parse(r.response)))},r.send()}),isOAuthMode:(e,t)=>"string"==typeof e&&e.startsWith(`${t}/oauth2/authorization`),assignWindowLocation(e){window.location.assign(e)},getAuthenticationToken(e,t,n,r=!1){return new Promise((i,o)=>{const s=this.isOAuthMode(e,t),a=new XMLHttpRequest;s?a.open("GET",`${t}/api/projects/${n}/token`):a.open("GET",e),a.onreadystatechange=()=>{if(4===a.readyState)if(200!==a.status)if(s&&r&&401===a.status){const t=`${e}?skillsRedirectUri=${encodeURIComponent(window.location.href)}`;f.info(`SkillsClient::SkillService::unable to get oAuth token, navigating to [${t}]`),this.assignWindowLocation(t),i()}else o(new Error(`SkillTree: Unable to authenticate using [${e}] endpoint. Response Code=[${a.status}].\n\n    Ideas to diagnose:\n\n        (1) verify that the authenticator property is correct.\n\n        (2) verify that the server providing the authenticator endpoint is responding (ex. daemon is running, network path is clear).\n\n        (3) check logs on the server providing authenticator endpoint.\n\n  Full Response=[${a.response}]`));else{const t=JSON.parse(a.response);t.access_token?i(t.access_token):o(new Error(`SkillTree: Response from [${e}] endpoint did have NOT have 'access_token' attribute. \n\n    Ideas to diagnose:\n\n        (1) verify that the authenticator property is correct.\n\n        (2) check implementation of the authenticator endpoint; it must return payload that has 'access_token' attribute.\n\n  Full Response=[${a.response}]`))}},a.send()})}};window.process||(window.process={env:{DEBUG:void 0}});let un=null,hn=null,dn=!1,fn=!1;const pn=()=>{un||(un=new Promise((e,t)=>{hn={resolve:e,reject:t}}))},mn=e=>{f.debug("SkillsClient::SkillsConfiguration::calling initializedResolvers"),hn.resolve(),ln.reportSkillsClientVersion(e),dn=!0,f.debug("SkillsClient::SkillsConfiguration::initialized")},gn=()=>{f.info("SkillsClient::SkillConfiguration::configured"),fn=!0};pn();const yn={configure({serviceUrl:e,projectId:t,authenticator:n,authToken:r,oauthRedirect:i=!1,enabled:o=!0}){if(!this.isInitialized()){if(f.debug(`SkillsConfiguration::configure params serviceUrl=[${e}], projectId=[${t}], authenticator=[${n}], authToken=[${r}], oauthRedirect=${i}, enabled=${o}`),this.enabled=o,!o)return f.useDefaults(),f.setLevel(f.TRACE),f.info("SkillsConfiguration is disabled."),Promise.resolve();if(this.skillsClientVersion||(this.skillsClientVersion="@skilltree/skills-client-js-3.6.5"),!t||"null"===t)throw new Error(`SkillTree: SkillsConfiguration.configure received invalid parameter for projectId=[${t}]`);if(!e||"null"===e)throw new Error(`SkillTree: SkillsConfiguration.configure received invalid parameter for serviceUrl=[${e}]`);if(!(r||n&&"null"!==n))throw new Error(`SkillTree: SkillsConfiguration.configure received invalid parameter for authenticator=[${n}]`);return this.projectId=t,this.serviceUrl=`${e}`.trim().replace(/\/$/,""),this.authenticator=n,this.authToken=r,ln.getServiceStatus(`${this.getServiceUrl()}/public/status`).then(e=>{if(this.status=e.status,ln.configureLogging(this.getServiceUrl(),e),f.info(`Returned status [${JSON.stringify(e)}]`),e.oAuthProviders&&e.oAuthProviders.includes(n)&&(this.authenticator=`${this.getServiceUrl()}/oauth2/authorization/${n}`,f.info(`Auto configured authenticator [${this.authenticator}] for provider [${n}]`)),!this.isPKIMode()&&!this.getAuthToken())return ln.getAuthenticationToken(this.getAuthenticator(),this.getServiceUrl(),this.getProjectId(),i).then(e=>{this.setAuthToken(e),mn(this),gn()});mn(this),gn()}).catch(e=>{console.error("Error getting service status",e),gn(),hn.resolve()})}f.warn("SkillsConfiguration already initialized.")},afterConfigure:()=>un,validate(){if(!this.serviceUrl||!this.projectId||!this.authenticator){throw new Error("SkillTree: SkillsConfiguration was not configured and serviceUrl, projectId and authenticationUrl are missing. Please call: \n      SkillsConfiguration.configure(serviceUrl, myProjectId, authenticator);\nSkillsConfiguration is a singleton and you only have to do this once. Please see the docs for more info.")}},isPKIMode(){return"pki"===this.getAuthenticator()||"pki"===this.getAuthToken()},isOAuthMode(){return ln.isOAuthMode(this.authenticator,this.serviceUrl)},isInitialized:()=>dn,wasConfigureCalled:()=>fn,getProjectId(){return this.projectId},isDisabled(){return!this.enabled},getServiceUrl(){return this.serviceUrl},getAuthenticator(){return this.authenticator},getAuthToken(){return this.authToken},getServiceStatus(){return this.status},setAuthToken(e){this.authToken=e},logout(){hn=null,un=null,fn=!1,dn=!1,pn(),this.setAuthToken(null)}},bn=new Set,vn=new Set;let wn=null;let Sn;const _n=e=>{if(Sn&&Sn.active)f.warn("SkillsClient::SkillsReporter::websocket already connecting, preventing duplicate connection.",Sn.active);else{const t=`${e}/skills-websocket`;f.info(`SkillsClient::SkillsReporter::connecting websocket using SockJS to [${t}]`),Sn||(Sn=new cn.Client);let n={};yn.isPKIMode()||(f.debug("SkillsClient::SkillsReporter::adding Authorization header to web socket connection"),n={Authorization:`Bearer ${yn.getAuthToken()}`}),Sn.configure({webSocketFactory:()=>new on(t),connectHeaders:n,onConnect:()=>{f.info("SkillsClient::SkillsReporter::stompClient connected");const e=`/user/queue/${yn.getProjectId()}-skill-updates`;f.info(`SkillsClient::SkillsReporter::stompClient subscribing to topic [${e}]`),Sn.subscribe(e,t=>{f.debug(`SkillsClient::SkillsReporter::ws message [${t.body}] received over topic [${e}]. calling success handlers...`),(e=>{bn.forEach(t=>t(e))})(JSON.parse(t.body)),f.debug("SkillsClient::SkillsReporter::Done calling success handlers...")}),window.postMessage({skillsWebsocketConnected:!0},window.location.origin),f.debug("SkillsClient::SkillsReporter::window.postMessage skillsWebsocketConnected")},onStompError:e=>{f.error(`Received STOMP error event. headers [${JSON.stringify(n)}] frame [${e}]`),!yn.isPKIMode()&&e&&e.headers&&e.headers.message&&e.headers.message.includes("invalid_token")&&ln.getAuthenticationToken(yn.getAuthenticator(),yn.getServiceUrl(),yn.getProjectId()).then(e=>{yn.setAuthToken(e),Sn.deactivate(),_n(yn.getServiceUrl())}).catch(e=>{f.error(`SkillsReporter::Unable to retrieve auth token when attempting to reconnect web socket [${e}]`)})},onDisconnect:e=>{f.info(`Received disconnect event.  frame [${e}]`)}}),f.debug("SkillsClient::SkillsReporter::activating stompClient..."),Sn.activate(),f.debug("SkillsClient::SkillsReporter::stompClient activated")}},En="skillTreeRetryQueue",kn=6e4,On=function(){const e=JSON.parse(localStorage.getItem(En));localStorage.removeItem(En),null!==e&&e.forEach(e=>{f.info(`SkillsClient::SkillsReporter::retryErrors retrying skillId [${e.skillId}], timestamp [${e.timestamp}], retryAttempt [${e.retryAttempt}]`),this.reportSkill(e.skillId,e.timestamp,!0,e.retryAttempt)})},Cn=(e,t,n,r,i)=>{const o=r?r.status:null;if(f.info(`SkillsClient::SkillsReporter::addToRetryQueue [${e}], timeReported [${t}], retryAttempt[${n}], status [${o}]`),r&&r.response){const e=JSON.parse(r.response);if(e&&"SkillNotFound"===e.errorCode)return void f.info("not adding to retry queue because the skillId does not exist.")}let s=JSON.parse(localStorage.getItem(En));if(null==s&&(s=[]),s.length<i){const r=null==t?Date.now():t;s.push({skillId:e,timestamp:r,retryAttempt:n}),localStorage.setItem(En,JSON.stringify(s))}else f.warn(`Max retry queue size has been reached (${i}), Unable to retry skillId [${e}]`)},Rn=(e,t,n,r,i,o,s,a,c)=>{yn.validate();const l=new XMLHttpRequest;l.open("POST",`${yn.getServiceUrl()}/api/projects/${yn.getProjectId()}/skills/${n}`),l.withCredentials=yn.isPKIMode(),yn.isPKIMode()||l.setRequestHeader("Authorization",`Bearer ${yn.getAuthToken()}`),l.onreadystatechange=()=>{4===l.readyState&&(200!==l.status?(o<=s?(401!==l.status&&0!==l.status||yn.isPKIMode()||yn.setAuthToken(null),Cn(n,r,o,l,a)):f.warn(`Max retry attempts has been reached (${s}), Unable to retry skillId [${n}]`),l.response?t(JSON.parse(l.response)):t(new Error(`Error occurred reporting skill [${n}], status returned [${l.status}]`))):e(JSON.parse(l.response)))};const u=JSON.stringify({timestamp:r,notifyIfSkillNotApplied:c,isRetry:i});l.setRequestHeader("Content-Type","application/json;charset=UTF-8"),l.send(u),f.info(`SkillsClient::SkillsReporter::reporting skill request sent: ${u}`)},Tn={configure({notifyIfSkillNotApplied:e,retryInterval:t=6e4,maxRetryQueueSize:n=1e3,maxRetryAttempts:r=1440}){this.notifyIfSkillNotApplied=e,this.retryInterval=t,this.maxRetryQueueSize=n,this.maxRetryAttempts=r,yn.isDisabled()?f.info("SkillsClient::SkillsReporter::configure: SkillsConfiguration is disabled. No reporting will occur"):(null!=t&&this.cancelRetryChecker(),f.info(`SkillsClient::SkillsReporter::Enabling retries. retryInterval [${this.retryInterval}]`),wn=setInterval(()=>{On.call(this)},this.retryInterval||kn))},addSuccessHandler(e){yn.isDisabled()?f.info("SkillsClient::SkillsReporter::addSuccessHandler: SkillsConfiguration is disabled handler is not added"):(bn.add(e),f.info(`SkillsClient::SkillsReporter::added success handler. successHandlerCache size [${bn.size}]`))},addErrorHandler(e){yn.isDisabled()?f.info("SkillsClient::SkillsReporter::addErrorHandler: SkillsConfiguration is disabled handler is not added"):(vn.add(e),f.info(`SkillsClient::SkillsReporter::added error handler. errorHandlerCache size [${vn.size}]`))},reportSkill(e,t=null,n=!1,r=void 0){if(yn.isDisabled())return f.info(`SkillsClient::SkillsReporter::reportSkill: SkillsConfiguration is disabled. No reporting will occur for skillId=[${e}]`),Promise.resolve();f.info(`SkillsClient::SkillsReporter::reporting skill [${e}] retryAttempt [${r}]`),yn.validate(),null==wn&&(f.info(`SkillsClient::SkillsReporter::Enabling retries. retryInterval [${this.retryInterval}]`),wn=setInterval(()=>{On.call(this)},this.retryInterval||kn));let i=1;void 0!==r&&(i=r+1);const o=this.maxRetryAttempts||1440,s=this.maxRetryQueueSize||1e3,a=new Promise((r,a)=>{yn.getAuthToken()||yn.isPKIMode()?Rn(r,a,e,t,n,i,o,s,this.notifyIfSkillNotApplied):ln.getAuthenticationToken(yn.getAuthenticator(),yn.getServiceUrl(),yn.getProjectId()).then(c=>{yn.setAuthToken(c),Rn(r,a,e,t,n,i,o,s,this.notifyIfSkillNotApplied)}).catch(n=>{i<=o?Cn(e,t,i,null,s):f.warn(`Max retry attempts has been reached (${this.maxRetryAttempts}), Unable to retry skillId [${e}]`),f.error(`SkillsReporter::Unable to retrieve auth token reporting skill [${e}]`),a(n)})});return a.catch(e=>{(e=>{console.error("Error reporting skill:",e),vn.forEach(t=>t(e))})(e)}),a},getConf:()=>yn,cancelRetryChecker(){null!=wn&&(clearInterval(wn),wn=null)}};yn.afterConfigure().then(()=>{_n(yn.getServiceUrl()),wn||(f.info(`SkillsClient::SkillsReporter::Enabling retries. retryInterval [${Tn.retryInterval}]`),wn=setInterval(()=>{On.call(Tn)},Tn.retryInterval||kn))});
/**
	  postmate - A powerful, simple, promise-based postMessage library
	  @version v1.5.2
	  @link https://github.com/dollarshaveclub/postmate
	  @author Jacob Kelley <jakie8@gmail.com>
	  @license MIT
	**/
var An="application/x-postmate-v1+json",xn=0,In={handshake:1,"handshake-reply":1,call:1,emit:1,reply:1,request:1},Nn=function(e,t){return("string"!=typeof t||e.origin===t)&&(!!e.data&&(("object"!=typeof e.data||"postmate"in e.data)&&(e.data.type===An&&!!In[e.data.postmate])))},Pn=function(){function e(e){var t=this;this.parent=e.parent,this.frame=e.frame,this.child=e.child,this.childOrigin=e.childOrigin,this.events={},this.listener=function(e){if(!Nn(e,t.childOrigin))return!1;var n=((e||{}).data||{}).value||{},r=n.data,i=n.name;"emit"===e.data.postmate&&i in t.events&&t.events[i].call(t,r)},this.parent.addEventListener("message",this.listener,!1)}var t=e.prototype;return t.get=function(e){var t=this;return new Un.Promise(function(n){var r=++xn;t.parent.addEventListener("message",function e(i){i.data.uid===r&&"reply"===i.data.postmate&&(t.parent.removeEventListener("message",e,!1),n(i.data.value))},!1),t.child.postMessage({postmate:"request",type:An,property:e,uid:r},t.childOrigin)})},t.call=function(e,t){this.child.postMessage({postmate:"call",type:An,property:e,data:t},this.childOrigin)},t.on=function(e,t){this.events[e]=t},t.destroy=function(){window.removeEventListener("message",this.listener,!1),this.frame.parentNode.removeChild(this.frame)},e}(),Ln=function(){function e(e){var t=this;this.model=e.model,this.parent=e.parent,this.parentOrigin=e.parentOrigin,this.child=e.child,this.child.addEventListener("message",function(e){if(Nn(e,t.parentOrigin)){var n=e.data,r=n.property,i=n.uid,o=n.data;"call"!==e.data.postmate?function(e,t){var n="function"==typeof e[t]?e[t]():e[t];return Un.Promise.resolve(n)}(t.model,r).then(function(t){return e.source.postMessage({property:r,postmate:"reply",type:An,uid:i,value:t},e.origin)}):r in t.model&&"function"==typeof t.model[r]&&t.model[r](o)}})}return e.prototype.emit=function(e,t){this.parent.postMessage({postmate:"emit",type:An,value:{name:e,data:t}},this.parentOrigin)},e}(),Un=function(){function e(e){var t=e.container,n=void 0===t?void 0!==n?n:document.body:t,r=e.model,i=e.url,o=e.name,s=e.classListArray,a=void 0===s?[]:s;return this.parent=window,this.frame=document.createElement("iframe"),this.frame.name=o||"",this.frame.classList.add.apply(this.frame.classList,a),n.appendChild(this.frame),this.child=this.frame.contentWindow||this.frame.contentDocument.parentWindow,this.model=r||{},this.sendHandshake(i)}return e.prototype.sendHandshake=function(t){var n,r=this,i=function(e){var t=document.createElement("a");t.href=e;var n=t.protocol.length>4?t.protocol:window.location.protocol,r=t.host.length?"80"===t.port||"443"===t.port?t.hostname:t.host:window.location.host;return t.origin||n+"//"+r}(t),o=0;return new e.Promise(function(e,s){r.parent.addEventListener("message",function t(o){return!!Nn(o,i)&&("handshake-reply"===o.data.postmate?(clearInterval(n),r.parent.removeEventListener("message",t,!1),r.childOrigin=o.origin,e(new Pn(r))):s("Failed handshake"))},!1);var a=function(){o++,r.child.postMessage({postmate:"handshake",type:An,model:r.model},i),5===o&&clearInterval(n)},c=function(){a(),n=setInterval(a,500)};r.frame.attachEvent?r.frame.attachEvent("onload",c):r.frame.onload=c,r.frame.src=t})},e}();Un.debug=!1,Un.Promise=function(){try{return window?window.Promise:Promise}catch(e){return null}}(),Un.Model=function(){function e(e){return this.child=window,this.model=e,this.parent=this.child.parent,this.sendHandshakeReply()}return e.prototype.sendHandshakeReply=function(){var e=this;return new Un.Promise(function(t,n){e.child.addEventListener("message",function r(i){if(i.data.postmate){if("handshake"===i.data.postmate){e.child.removeEventListener("message",r,!1),i.source.postMessage({postmate:"handshake-reply",type:An},i.origin),e.parentOrigin=i.origin;var o=i.data.model;return o&&Object.keys(o).forEach(function(t){e.model[t]=o[t]}),t(new Ln(e))}return n("Handshake Reply Failed")}},!1)})},e}();var jn={removeAllChildren(e){let t=e.lastElementChild;for(;t;)e.removeChild(t),t=e.lastElementChild;return e},buildErrorPage(){const e=(e,t,n,r)=>{const i=document.createElement(e);return t&&t.appendChild(i),n&&i.appendChild(document.createTextNode(n)),r&&i.setAttribute("style",r),i},t=e("div",void 0,void 0,"text-align: center; padding-top: 3rem; color: #3e3c3c;"),n=e("p",t);return e("span",n,"😕","font-size: 6rem; border: 1px solid #ccc !important; border-radius: 4px; padding: 1rem 4rem 1rem 4rem;"),e("p",t,"Could NOT reach Skilltree Service.","font-size: 2rem; color: #460f0f;"),e("div",t,"Please contact the skilltree server administrator. "),t}};let Dn,Bn=0;const Fn="skillsClientDisplayPath",$n=[];function Hn(e,t){return function(){return e.apply(t,arguments)}}const{toString:Mn}=Object.prototype,{getPrototypeOf:Wn}=Object,{iterator:qn,toStringTag:Vn}=Symbol,zn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Jn=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),Gn=(e,t,n)=>e===Object.prototype||!n&&null===t,Kn=(e,t)=>{let n=e;const r=[];for(;null!=n;){if(-1!==r.indexOf(n))return!1;r.push(n);const i=Wn(n);if(Gn(n,i,n===e))return!1;if(zn(n,t))return!0;n=i}return!1},Xn=(Qn=Object.create(null),e=>{const t=Mn.call(e);return Qn[t]||(Qn[t]=t.slice(8,-1).toLowerCase())});var Qn;const Zn=e=>(e=e.toLowerCase(),t=>Xn(t)===e),Yn=e=>t=>typeof t===e,{isArray:er}=Array,tr=Yn("undefined");function nr(e){return null!==e&&!tr(e)&&null!==e.constructor&&!tr(e.constructor)&&or(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const rr=Zn("ArrayBuffer");const ir=Yn("string"),or=Yn("function"),sr=Yn("number"),ar=e=>null!==e&&"object"==typeof e,cr=e=>{if(!ar(e))return!1;const t=Wn(e);return!(null!==t&&t!==Object.prototype&&null!==Wn(t)||Kn(e,Vn)||Kn(e,qn))},lr=Zn("Date"),ur=Zn("File"),hr=Zn("Blob"),dr=Zn("FileList"),fr=Zn("Set");const pr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},mr=void 0!==pr.FormData?pr.FormData:void 0,gr=Zn("URLSearchParams"),[yr,br,vr,wr]=["ReadableStream","Request","Response","Headers"].map(Zn);function Sr(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),er(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(nr(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let s;for(r=0;r<o;r++)s=i[r],t.call(null,e[s],s,e)}}function _r(e,t){if(nr(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const Er="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,kr=e=>!tr(e)&&e!==Er;const Or=(Cr="undefined"!=typeof Uint8Array&&Wn(Uint8Array),e=>Cr&&e instanceof Cr);var Cr;const Rr=Zn("HTMLFormElement"),{propertyIsEnumerable:Tr}=Object.prototype,Ar=Zn("RegExp"),xr=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Sr(n,(n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)}),Object.defineProperties(e,r)};const Ir=Zn("AsyncFunction"),Nr=(Pr="function"==typeof setImmediate,Lr=or(Er.postMessage),Pr?setImmediate:Lr?(Ur=`axios@${Math.random()}`,jr=[],Er.addEventListener("message",({source:e,data:t})=>{e===Er&&t===Ur&&jr.length&&jr.shift()()},!1),e=>{jr.push(e),Er.postMessage(Ur,"*")}):e=>setTimeout(e));var Pr,Lr,Ur,jr;const Dr="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Er):"undefined"!=typeof process&&process.nextTick||Nr,Br=e=>null!=e&&or(e[qn]);var Fr={isArray:er,isArrayBuffer:rr,isBuffer:nr,isFormData:e=>{if(!e)return!1;if(mr&&e instanceof mr)return!0;const t=Wn(e);if(!t||t===Object.prototype)return!1;if(!or(e.append))return!1;const n=Xn(e);return"formdata"===n||"object"===n&&or(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&rr(e.buffer),t},isString:ir,isNumber:sr,isBoolean:e=>!0===e||!1===e,isObject:ar,isPlainObject:cr,isEmptyObject:e=>{if(!ar(e)||nr(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:yr,isRequest:br,isResponse:vr,isHeaders:wr,isUndefined:tr,isDate:lr,isFile:ur,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:hr,isRegExp:Ar,isFunction:or,isStream:e=>ar(e)&&or(e.pipe),isURLSearchParams:gr,isTypedArray:Or,isFileList:dr,forEach:Sr,merge:function e(...t){const{caseless:n,skipUndefined:r}=kr(this)&&this||{},i={},o=(t,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;const s=n&&"string"==typeof o&&_r(i,o)||o,a=zn(i,s)?i[s]:void 0;cr(a)&&cr(t)?i[s]=e(a,t):cr(t)?i[s]=e({},t):er(t)?i[s]=t.slice():r&&tr(t)||(i[s]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||nr(n))continue;if(Sr(n,o),"object"!=typeof n||er(n))continue;const r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){const t=r[e];Tr.call(n,t)&&o(n[t],t)}}return i},extend:(e,t,n,{allOwnKeys:r}={})=>(Sr(t,(t,r)=>{n&&or(t)?Object.defineProperty(e,r,{__proto__:null,value:Hn(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&Wn(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Xn,kindOfTest:Zn,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(er(e))return e;let t=e.length;if(!sr(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[qn]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Rr,hasOwnProperty:zn,hasOwnProp:zn,hasOwnInPrototypeChain:Kn,getSafeProp:(e,t)=>null!=e&&Kn(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;const t=Wn(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(t=>{if(Jn(t))return!1;const n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable})})(e))return e;const n=Object.create(null),r=Object.create(null),i=[];let o=e;for(;null!=o&&-1===i.indexOf(o);){i.push(o);const s=o===e?t:Wn(o);if(Gn(o,s,o===e))break;const a=Object.getOwnPropertyNames(o);Object.getOwnPropertySymbols&&a.push(...Object.getOwnPropertySymbols(o));for(const t of a)Jn(t)||zn(r,t)||(n[t]=e[t],r[t]=!0);o=s}return n},reduceDescriptors:xr,freezeMethods:e=>{xr(e,(t,n)=>{if(or(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];or(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return er(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:_r,global:Er,isContextDefined:kr,isSpecCompliantForm:function(e){return!!(e&&or(e.append)&&"FormData"===e[Vn]&&e[qn])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(ar(e)){if(t.has(e))return;if(nr(e))return e;if(!("toJSON"in e)){let r;if(t.add(e),fr(e)){r=[];for(const t of e){const e=n(t);!tr(e)&&r.push(e)}}else r=er(e)?[]:{},Sr(e,(e,t)=>{const i=n(e);!tr(i)&&(r[t]=i)});return t.delete(e),r}}return e};return n(e)},isAsyncFn:Ir,isThenable:e=>e&&(ar(e)||or(e))&&or(e.then)&&or(e.catch),setImmediate:Nr,asap:Dr,isIterable:Br,isSafeIterable:e=>null!=e&&Kn(e,qn)&&Br(e)};const $r=Fr.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Hr=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Mr=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Wr(e,t){return Fr.isArray(e)?e.map(e=>Wr(e,t)):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function qr(e){const t=Object.create(null);return Fr.forEach(e.toJSON(),(e,n)=>{t[n]=(e=>Wr(e,Mr))(e)}),t}const Vr=Symbol("internals");function zr(e){return e&&String(e).trim().toLowerCase()}function Jr(e){return!1===e||null==e?e:Fr.isArray(e)?e.map(Jr):(e=>Wr(e,Hr))(String(e))}const Gr=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Kr(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function Xr(e,t,n,r,i){return Fr.isFunction(r)?r.call(this,t,n):(i&&(t=n),Fr.isString(t)?Fr.isString(r)?-1!==t.indexOf(r):Fr.isRegExp(r)?r.test(t):void 0:void 0)}let Qr=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=zr(t);if(!i)return;const o=Fr.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=Jr(e))}const o=(e,t)=>Fr.forEach(e,(e,n)=>i(e,n,t));if(Fr.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Fr.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim();const o=Fr.hasOwnProp(t,n);!n||o&&Fr.hasOwnProp($r,n)||("set-cookie"===n?o?t[n].push(r):t[n]=[r]:t[n]=o?t[n]+", "+r:r)}),t})(e),t);else if(Fr.isObject(e)&&Fr.isSafeIterable(e)){let n,r,i=Object.create(null);for(const t of e){if(!Fr.isArray(t))throw new TypeError("Object iterator must return a key-value pair");r=t[0],Fr.hasOwnProp(i,r)?(n=i[r],i[r]=Fr.isArray(n)?[...n,t[1]]:[n,t[1]]):i[r]=t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=zr(e)){const n=Fr.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Fr.isFunction(t))return t.call(this,e,n);if(Fr.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=zr(e)){const n=Fr.findKey(this,e);return!(!n||void 0===this[n]||t&&!Xr(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=zr(e)){const i=Fr.findKey(n,e);!i||t&&!Xr(0,n[i],i,t)||(delete n[i],r=!0)}}return Fr.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!Xr(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return Fr.forEach(this,(r,i)=>{const o=Fr.findKey(n,i);if(o)return t[o]=Jr(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();s!==i&&delete t[i],t[s]=Jr(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Fr.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Fr.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){const e=this.get("set-cookie");return Fr.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let r=0,i=!1,o=!1;function s(e){const i=Kr(n.slice(r,e)),o=i.indexOf("=");if(o<1)return;const s=Kr(i.slice(0,o));if(!Gr.test(s))return;const a=s.toLowerCase();if("__proto__"===a||"constructor"===a||"prototype"===a)return;const c=Kr(i.slice(o+1));t[a]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let r=1;r<t;r++){const i=e.charCodeAt(r);if(34===i)return e;if(92===i&&(r+=1,r>=t))return e;n+=e[r]}return n}(c)}for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);i?o?o=!1:92===t?o=!0:34===t&&(i=!1):34===t?i=!0:44!==t&&59!==t||(s(e),r=e+1)}return s(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Vr]=this[Vr]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=zr(e);t[r]||(!function(e,t){const n=Fr.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return Fr.isArray(e)?e.forEach(r):r(e),this}};Qr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Fr.reduceDescriptors(Qr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Fr.freezeMethods(Qr);const Zr="[REDACTED ****]";function Yr(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(null===e||"object"!=typeof e)return e;if(Fr.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof Qr&&(e=e.toJSON()),r.push(e),Fr.isArray(e))t=[],e.forEach((e,n)=>{const r=i(e);Fr.isUndefined(r)||(t[n]=r)});else{if(!Fr.isPlainObject(e)&&function(e){if(Fr.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Fr.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,o]of Object.entries(e)){const e=n.has(r.toLowerCase())?Zr:i(o);Fr.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}function ei(e){try{return String(e)}catch(e){return""}}let ti=class e extends Error{static from(t,n,r,i,o,s){let a=t.message;!a&&Fr.isArray(t.errors)&&t.errors.length&&(a=function(e){const t=e.errors.map(e=>{try{return e&&e.message?ei(e.message):ei(e)}catch(e){return""}}).filter(Boolean).join("; ");return t||e.name||"AggregateError"}(t));const c=new e(a,n||t.code,r,i,o);return Object.defineProperty(c,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),c.name=t.name,null!=t.status&&null==c.status&&(c.status=t.status),s&&Object.assign(c,s),c}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){const e=this.config,t=e&&Fr.hasOwnProp(e,"redact")?e.redact:void 0,n=Fr.isArray(t)&&t.length>0?Yr(e,t):Fr.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};ti.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ti.ERR_BAD_OPTION="ERR_BAD_OPTION",ti.ECONNABORTED="ECONNABORTED",ti.ETIMEDOUT="ETIMEDOUT",ti.ECONNREFUSED="ECONNREFUSED",ti.ERR_NETWORK="ERR_NETWORK",ti.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ti.ERR_DEPRECATED="ERR_DEPRECATED",ti.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ti.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ti.ERR_CANCELED="ERR_CANCELED",ti.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ti.ERR_INVALID_URL="ERR_INVALID_URL",ti.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";function ni(e){return Fr.isPlainObject(e)||Fr.isArray(e)}function ri(e){return Fr.endsWith(e,"[]")?e.slice(0,-2):e}function ii(e,t,n){return e?e.concat(t).map(function(e,t){return e=ri(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const oi=Fr.toFlatObject(Fr,{},null,function(e){return/^is[A-Z]/.test(e)});function si(e,t,n){if(!Fr.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(e,t)=>{const r=Fr.getSafeProp(n,e);return Fr.isUndefined(r)?t:r},i=r("metaTokens",!0),o=r("visitor")||p,s=r("dots",!1),a=r("indexes",!1),c=r("Blob")||"undefined"!=typeof Blob&&Blob,l=r("maxDepth",100),u=c&&Fr.isSpecCompliantForm(t),h=[];if(!Fr.isFunction(o))throw new TypeError("visitor must be a function");function d(e){if(null===e)return"";if(Fr.isDate(e))return e.toISOString();if(Fr.isBoolean(e))return e.toString();if(!u&&Fr.isBlob(e))throw new ti("Blob is not supported. Use a Buffer instead.");if(Fr.isArrayBuffer(e)||Fr.isTypedArray(e)){if(u&&"function"==typeof c)return new c([e]);throw new ti("Blob is not supported. Use a Buffer instead.",ti.ERR_NOT_SUPPORT)}return e}function f(e){if(e>l)throw new ti("Object is too deeply nested ("+e+" levels). Max depth: "+l,ti.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,n,r){let o=e;if(Fr.isReactNative(t)&&Fr.isReactNativeBlob(e))return t.append(ii(r,n,s),d(e)),!1;if(e&&!r&&"object"==typeof e)if(Fr.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=function(e,t){if(l===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,function(e,r){if(!Fr.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),f(t+n.length-1),r})}(e,1);else if(Fr.isArray(e)&&function(e){return Fr.isArray(e)&&!e.some(ni)}(e)||(Fr.isFileList(e)||Fr.endsWith(n,"[]"))&&(o=Fr.toArray(e)))return n=ri(n),o.forEach(function(e,r){!Fr.isUndefined(e)&&null!==e&&t.append(!0===a?ii([n],r,s):null===a?n:n+"[]",d(e))}),!1;return!!ni(e)||(t.append(ii(r,n,s),d(e)),!1)}const m=Object.assign(oi,{defaultVisitor:p,convertValue:d,isVisitable:ni});if(!Fr.isObject(e))throw new TypeError("data must be an object");return function e(n,r,i=0){if(!Fr.isUndefined(n)){if(f(i),-1!==h.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));h.push(n),Fr.forEach(n,function(n,s){!0===(!(Fr.isUndefined(n)||null===n)&&o.call(t,n,Fr.isString(s)?s.trim():s,r,m))&&e(n,r?r.concat(s):[s],i+1)}),h.pop()}}(e),t}function ai(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function ci(e,t){this._pairs=[],e&&si(e,this,t)}const li=ci.prototype;function ui(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function hi(e,t,n){if(!t)return e;e=e||"";const r=Fr.isFunction(n)?{serialize:n}:n,i=Fr.getSafeProp(r,"encode")||ui,o=Fr.getSafeProp(r,"serialize");let s;if(s=o?o(t,r):Fr.isURLSearchParams(t)?t.toString():new ci(t,r).toString(i),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}li.append=function(e,t){this._pairs.push([e,t])},li.toString=function(e){const t=e?t=>e.call(this,t,ai):ai;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const di=Symbol("internals");function fi(e){return e?e.length:0}function pi(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function mi(e,t){const n=e.handlers,r=fi(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):r!==t.handlersLength&&(r?t.handlerEntries.forEach(function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)}):t.handlerEntries.clear()),t.handlersLength=r}class gi{constructor(){this.handlers=[],this[di]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){const r={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},i=this[di];null==this.handlers&&(this.handlers=[]),mi(this,i);const o=i.nextId++;return this.handlers.push(r),i.handlerEntries.set(o,{handler:r,index:this.handlers.length-1}),i.handlersLength=this.handlers.length,o}eject(e){const t=this[di];mi(this,t);const n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(pi(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],mi(this,this[di]))}forEach(e){const t=this[di];mi(this,t),t.iterationDepth++;try{Fr.forEach(this.handlers,function(t){null!==t&&e(t)})}finally{--t.iterationDepth||(mi(this,t),pi(this.handlers),t.handlersLength=fi(this.handlers))}}}var yi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},bi={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ci,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const vi="undefined"!=typeof window&&"undefined"!=typeof document,wi="object"==typeof navigator&&navigator||void 0,Si=vi&&(!wi||["ReactNative","NativeScript","NS"].indexOf(wi.product)<0),_i="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ei=vi&&window.location.href||"http://localhost";var ki={...Object.freeze({__proto__:null,hasBrowserEnv:vi,hasStandardBrowserEnv:Si,hasStandardBrowserWebWorkerEnv:_i,navigator:wi,origin:Ei}),...bi};function Oi(e){if(e>100)throw new ti("FormData field is too deeply nested ("+e+" levels). Max depth: 100",ti.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Ci(e){function t(e,n,r,i){Oi(i);let o=e[i++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),a=i>=e.length;if(o=!o&&Fr.isArray(r)?r.length:o,a)return Fr.hasOwnProp(r,o)?r[o]=Fr.isArray(r[o])?r[o].concat(n):[r[o],n]:r[o]=n,!s;Fr.hasOwnProp(r,o)&&Fr.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],i)&&Fr.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}(r[o])),!s}if(Fr.isFormData(e)&&Fr.isFunction(e.entries)){const n={};return Fr.forEachEntry(e,(e,r)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;null!==(r=n.exec(e));)Oi(t.length),t.push("[]"===r[0]?"":r[1]||r[0]);return t}(e),r,n,0)}),n}return null}const Ri=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Ti=(e,t)=>null!=e&&Fr.hasOwnProp(e,t)?e[t]:void 0;const Ai={transitional:yi,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=Fr.isObject(e);i&&Fr.isHTMLForm(e)&&(e=new FormData(e));if(Fr.isFormData(e))return r?JSON.stringify(Ci(e)):e;if(Fr.isArrayBuffer(e)||Fr.isBuffer(e)||Fr.isStream(e)||Fr.isFile(e)||Fr.isBlob(e)||Fr.isReadableStream(e))return e;if(Fr.isArrayBufferView(e))return e.buffer;if(Fr.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){const t=Ti(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return si(e,new ki.classes.URLSearchParams,{visitor:function(e,t,n,r){return ki.isNode&&Fr.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((o=Fr.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Ti(this,"env"),r=n&&n.FormData;return si(o?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(Fr.isString(e))try{return(t||JSON.parse)(e),Fr.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Ti(this,"transitional")||Ai.transitional,n=t&&t.forcedJSONParsing,r=Ti(this,"responseType"),i="json"===r;if(Fr.isResponse(e)||Fr.isReadableStream(e))return e;if(e&&Fr.isString(e)&&(n&&!r||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Ti(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw ti.from(e,ti.ERR_BAD_RESPONSE,this,null,Ti(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ki.classes.FormData,Blob:ki.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function xi(e,t){const n=this||Ai,r=t||n,i=Qr.from(r.headers);let o=r.data;return Fr.forEach(e,function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function Ii(e){return!(!e||!e.__CANCEL__)}Fr.forEach(Ri,e=>{Ai.headers[e]={}});let Ni=class extends ti{constructor(e,t,n){super(null==e?"canceled":e,ti.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Pi(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ti("Request failed with status code "+n.status,n.status>=400&&n.status<500?ti.ERR_BAD_REQUEST:ti.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Li=/[\t\n\r]/g;function Ui(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(Li,"")}function ji(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}const Di=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[s];i||(i=c),n[o]=a,r[o]=c;let u=s,h=0;for(;u!==o;)h+=n[u++],u%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const d=l&&c-l;return d?Math.round(1e3*h/d):void 0}}(50,250);return function(e,t){let n,r,i=0,o=1e3/t;const s=(t,o=Date.now())=>{i=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-i;a>=o?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},o-a)))},()=>n&&s(n),(...e)=>s(e)]}(n=>{if(!n||!Fr.isNumber(n.loaded))return;const o=n.loaded,s=n.lengthComputable?n.total:void 0,a=Math.max(0,null!=s?Math.min(o,s):o),c=Math.max(0,a-r),l=i(c);r=Math.max(r,a);e({loaded:a,total:s,progress:s?a/s:void 0,bytes:c,rate:l||void 0,estimated:l&&s?(s-a)/l:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},Bi=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Fi=(e,t=Fr.asap)=>(...n)=>t(()=>e(...n));var $i=ki.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ki.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ki.origin),ki.navigator&&/(msie|trident)/i.test(ki.navigator.userAgent)):()=>!0,Hi=ki.hasStandardBrowserEnv?{write(e,t,n,r,i,o,s){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Fr.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Fr.isString(r)&&a.push(`path=${r}`),Fr.isString(i)&&a.push(`domain=${i}`),!0===o&&a.push("secure"),Fr.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),i=r.indexOf("=");if(-1!==i&&r.slice(0,i)===e)try{return decodeURIComponent(r.slice(i+1))}catch(e){return r.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};const Mi=/^https?:(?!\/\/)/i;function Wi(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Zr}@`),n=t.indexOf("#"),r=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Zr}`);return-1===n?r:`${r}#${i=t.slice(n+1),i?i.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n="")=>`${t}${n}${Zr}`):i}`;var i}function qi(e,t){if("string"==typeof e){const n=Ui(e);if(Mi.test(n))throw new ti(`Invalid URL ${JSON.stringify(Wi(n))}: missing "//" after protocol`,ti.ERR_INVALID_URL,t)}}function Vi(e,t,n,r){qi(t,r);let i=!function(e){return"string"==typeof e&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t);return e&&(i||!1===n)?(qi(e,r),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}const zi=e=>e instanceof Qr?{...e}:e;function Ji(e,t){e=e||{},t=t||{};const n=Object.create(null);function r(e,t,n,r){return Fr.isPlainObject(e)&&Fr.isPlainObject(t)?Fr.merge.call({caseless:r},e,t):Fr.isPlainObject(t)?Fr.merge({},t):Fr.isArray(t)?t.slice():t}function i(e,t,n,i){return Fr.isUndefined(t)?Fr.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!Fr.isUndefined(t))return r(void 0,t)}function s(e,t){return Fr.isUndefined(t)?Fr.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,o){return Fr.hasOwnProp(t,o)?r(n,i):Fr.hasOwnProp(e,o)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutErrorMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>i(zi(e),zi(t),0,!0)};var l;return Fr.forEach((l={...e,...t},Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(l).concat(Object.getOwnPropertySymbols(l).filter(e=>Object.getOwnPropertyDescriptor(l,e).enumerable)):Object.keys(l)),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=Fr.hasOwnProp(c,r)?c[r]:i,s=o(Fr.hasOwnProp(e,r)?e[r]:void 0,Fr.hasOwnProp(t,r)?t[r]:void 0,r);Fr.isUndefined(s)&&o!==a||(n[r]=s)}),Fr.hasOwnProp(t,"validateStatus")&&Fr.isUndefined(t.validateStatus)&&!1===function(n){const r=Fr.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Fr.isUndefined(r)){if(!Fr.isPlainObject(r))return;if(Fr.hasOwnProp(r,n))return r[n]}const i=Fr.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Fr.isPlainObject(i)&&Fr.hasOwnProp(i,n))return i[n]}("validateStatusUndefinedResolves")&&(Fr.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const Gi=["content-type","content-length"];function Ki(e){const t=Ji({},e),n=e=>Fr.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let i=n("withXSRFToken");const o=n("xsrfHeaderName"),s=n("xsrfCookieName");let a=n("headers");const c=n("auth"),l=n("baseURL"),u=n("allowAbsoluteUrls"),h=n("url");if(t.headers=a=Qr.from(a),t.url=hi(Vi(l,h,u,t),n("params"),n("paramsSerializer")),c){const t=Fr.getSafeProp(c,"username")||"",n=Fr.getSafeProp(c,"password")||"";try{a.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw ti.from(t,ti.ERR_BAD_OPTION_VALUE,e)}}if(Fr.isFormData(r)){const e=Fr.getSafeProp(r,"getHeaders");ki.hasStandardBrowserEnv||ki.hasStandardBrowserWebWorkerEnv||Fr.isReactNative(r)?a.setContentType(void 0):Fr.isFunction(e)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(([t,n])=>{Gi.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}(a,e.call(r),n("formDataHeaderPolicy"))}if(ki.hasStandardBrowserEnv){Fr.isFunction(i)&&(i=i(t));if(!0===i||null==i&&$i(t.url)){const e=o&&s&&Hi.read(s);e&&a.set(o,e)}}return t}var Xi="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Ki(e);let i=r.data;const o=Qr.from(r.headers).normalize();let s,a,c,l,u,h,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=r;function m(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let g=new XMLHttpRequest;function y(i){if(!g)return;if(!(0!==g.status||"file"===(ji(Ui(r.url))||ji(ki.origin))||g.responseURL&&g.responseURL.startsWith("file:")))return n(new ti("Request aborted",ti.ECONNABORTED,e,g)),m(),void(g=null);try{i?h&&h(i):u&&u()}catch(e){setTimeout(()=>{throw e})}if(!g)return;const o=Qr.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Pi(function(e){t(e),m()},function(e){n(e),m()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:o,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&g.responseURL.startsWith("file:"))&&setTimeout(y)},g.onabort=function(){g&&(n(new ti("Request aborted",ti.ECONNABORTED,e,g)),m(),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",i=new ti(r,ti.ERR_NETWORK,e,g);i.event=t||null,n(i),m(),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||yi;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new ti(t,i.clarifyTimeoutError?ti.ETIMEDOUT:ti.ECONNABORTED,e,g)),m(),g=null},void 0===i&&o.setContentType(null),"setRequestHeader"in g&&Fr.forEach(qr(o),function(e,t){g.setRequestHeader(t,e)}),Fr.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),p&&([c,u,h]=Di(p,!0),g.addEventListener("progress",c)),f&&g.upload&&([a,l]=Di(f),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(s=t=>{g&&(n(!t||t.type?new Ni(null,e,g):t),g.abort(),m(),g=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const b=ji(r.url);if(b&&!ki.protocols.includes(b))return n(new ti("Unsupported protocol "+b+":",ti.ERR_BAD_REQUEST,e)),void m();g.send(i||null)})};const Qi=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const i=function(e){if(!r){r=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof ti?t:new Ni(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,i(new ti(`timeout of ${t}ms exceeded`,ti.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>{r||(e.aborted?i.call(e):e.addEventListener("abort",i,{once:!0}))});const{signal:a}=n;return a.unsubscribe=()=>Fr.asap(s),a},Zi=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},Yi=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},eo=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of Yi(e))yield*Zi(n,t)}(e,t);let o,s=0,a=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return a(),void e.close();let o=r.byteLength;if(n){let e=s+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),i.return())},{highWaterMark:2})},to=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,no=(e,t,n)=>t+2<n&&to(e.charCodeAt(t+1))&&to(e.charCodeAt(t+2)),ro=e=>e<=57?e-48:(223&e)-55,io=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,oo=e=>9===e||10===e||12===e||13===e||32===e,so=e=>{const t=e.length;let n=0,r=0,i=!1;for(let o=0;o<t;o++){let s=e.charCodeAt(o);37===s&&no(e,o,t)&&(s=16*ro(e.charCodeAt(o+1))+ro(e.charCodeAt(o+2)),o+=2),oo(s)||(61!==s?!io(s)||r>0?i=!0:n++:r++)}return i||r>2||r>0&&(n+r)%4!=0||n%4==1?(e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)})(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)};function ao(e){const t="string"==typeof e?e.indexOf("#"):-1;return((e,t)=>{if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const r=e.slice(5,n),i=e.slice(n+1);if(/;base64/i.test(r))return t(i);let o=0;for(let e=0,t=i.length;e<t;e++){const n=i.charCodeAt(e);if(37===n&&no(i,e,t))o+=1,e+=2;else if(n<128)o+=1;else if(n<2048)o+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=i.charCodeAt(e+1);t>=56320&&t<=57343?(o+=4,e++):o+=3}else o+=3}return o})(-1===t?e:e.slice(0,t),so)}const co="1.20.0",lo={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:uo}=Fr,ho=e=>{if(!Fr.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},fo=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},po=e=>{const t=void 0!==Fr.global&&null!==Fr.global?Fr.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=Fr.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:i,Request:o,Response:s}=e,a=i?uo(i):"function"==typeof fetch,c=uo(o),l=uo(s);if(!a)return!1;const u=a&&uo(n),h=a&&("function"==typeof r?(d=new r,e=>d.encode(e)):async e=>new Uint8Array(await new o(e).arrayBuffer()));var d;const f=c&&u&&fo(()=>{let e=!1;const t=new o(ki.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),p=l&&u&&fo(()=>Fr.isReadableStream(new s("").body)),m={stream:p&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new ti(`Response type '${e}' is not supported`,ti.ERR_NOT_SUPPORT,n)})});const g=async e=>{if(null==e)return 0;if(Fr.isBlob(e))return e.size;if(Fr.isSpecCompliantForm(e)){const t=new o(ki.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Fr.isArrayBufferView(e)||Fr.isArrayBuffer(e)?e.byteLength:(Fr.isURLSearchParams(e)&&(e+=""),Fr.isString(e)?(await h(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:a,signal:l,cancelToken:h,timeout:d,onDownloadProgress:y,onUploadProgress:b,responseType:v,headers:w,withCredentials:S="same-origin",fetchOptions:_,maxContentLength:E,maxBodyLength:k,maxRedirects:O}=Ki(e);const C=Fr.isNumber(E)&&E>-1,R=Fr.isNumber(k)&&k>-1;let T=i||fetch;v=v?(v+"").toLowerCase():"text";let A=Qi([l,h&&h.toAbortSignal()],d),x=null;const I=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let N,P=null;const L=()=>new ti("Request body larger than maxBodyLength limit",ti.ERR_BAD_REQUEST,e,x);try{let i;const l=(j="auth",Fr.hasOwnProp(e,j)?e[j]:void 0);if(l){const e=Fr.getSafeProp(l,"username")||"";i={username:e,password:Fr.getSafeProp(l,"password")||""}}if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,ki.origin);if(!i&&(e.username||e.password)){const t=ho(e.username);i={username:t,password:ho(e.password)}}(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(i&&(w.delete("authorization"),w.set("Authorization","Basic "+btoa((U=(i.username||"")+":"+(i.password||""),encodeURIComponent(U).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))),C&&"string"==typeof t&&t.startsWith("data:")){if(ao(t)>E)throw new ti("maxContentLength size of "+E+" exceeded",ti.ERR_BAD_RESPONSE,e,x)}if(R&&"get"!==n&&"head"!==n){const e=await g(a);if("number"==typeof e&&isFinite(e)&&(N=e,e>k))throw L()}const h=R&&(Fr.isReadableStream(a)||Fr.isStream(a)),d=(e,t,n)=>eo(e,65536,e=>{if(R&&e>k)throw P=L();t&&t(e)},n);if(f&&"get"!==n&&"head"!==n&&(b||h)){if(N=null==N?await(async(e,t)=>{const n=Fr.toFiniteNumber(e.getContentLength());return null==n?g(t):n})(w,a):N,0!==N||h){let e,n=new o(t,{method:"POST",body:a,duplex:"half"});if(Fr.isFormData(a)&&(e=n.headers.get("content-type"))&&w.setContentType(e),n.body){const[e,t]=b&&Bi(N,Di(Fi(b)))||[];a=d(n.body,e,t)}}}else if(h&&!c&&u&&"get"!==n&&"head"!==n)a=d(a);else if(h&&c&&!f&&"get"!==n&&"head"!==n)throw new ti("Stream request bodies are not supported by the current fetch implementation",ti.ERR_NOT_SUPPORT,e,x);Fr.isString(S)||(S=S?"include":"omit");const D=c&&"credentials"in o.prototype;if(Fr.isFormData(a)){const e=w.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&w.delete("content-type")}w.set("User-Agent","axios/"+co,!1);const B=null==_?_:Object.assign(Object.create(null),_);B&&(delete B.body,delete B.headers,delete B.method,delete B.signal,delete B.duplex,delete B.credentials);const F=Object.assign(Object.create(null),B,{signal:A,method:n.toUpperCase(),headers:qr(w.normalize()),body:a,duplex:"half",credentials:D?S:void 0});c&&(Fr.forEach(lo,(e,t)=>{void 0===F[t]&&(F[t]=e)}),void 0===F.signal&&(F.signal=null),void 0===F.body&&(F.body=null)),0===O&&(F.redirect="manual",B&&(B.redirect="manual")),x=c&&new o(t,F);let $=await(c?T(x,B):T(t,F));const H=Qr.from($.headers);if(C){const t=Fr.toFiniteNumber(H.getContentLength());if(null!=t&&t>E)throw new ti("maxContentLength size of "+E+" exceeded",ti.ERR_BAD_RESPONSE,e,x)}const M=p&&("stream"===v||"response"===v);if(p&&$.body&&(y||C||M&&I)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=$[e]});const n=Fr.toFiniteNumber(H.getContentLength()),[r,i]=y&&Bi(n,Di(Fi(y),!0))||[];let o=0;const a=t=>{if(C&&(o=t,o>E))throw new ti("maxContentLength size of "+E+" exceeded",ti.ERR_BAD_RESPONSE,e,x);r&&r(t)};$=new s(eo($.body,65536,a,()=>{i&&i(),I&&I()}),t)}v=v||"text";let W=await m[Fr.findKey(m,v)||"text"]($,e);if(C&&!p&&!M){let t;if(null!=W&&("number"==typeof W.byteLength?t=W.byteLength:"number"==typeof W.size?t=W.size:"string"==typeof W&&(t="function"==typeof r?(new r).encode(W).byteLength:W.length)),"number"==typeof t&&t>E)throw new ti("maxContentLength size of "+E+" exceeded",ti.ERR_BAD_RESPONSE,e,x)}return!M&&I&&I(),await new Promise((t,n)=>{Pi(t,n,{data:W,headers:Qr.from($.headers),status:$.status,statusText:$.statusText,config:e,request:x})})}catch(t){if(I&&I(),A&&A.aborted&&A.reason instanceof ti){const n=A.reason;throw n.config=e,x&&(n.request=x),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(P)throw x&&!P.request&&(P.request=x),P;if(t instanceof ti)throw x&&!t.request&&(t.request=x),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new ti("Network Error",ti.ERR_NETWORK,e,x,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw ti.from(t,t&&t.code,e,x,t&&t.response)}var U,j}},mo=new Map,go=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let s,a,c=o.length,l=mo;for(;c--;)s=o[c],a=l.get(s),void 0===a&&l.set(s,a=c?new Map:po(t)),l=a;return a};go();const yo={http:null,xhr:Xi,fetch:{get:go}};Fr.forEach(yo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const bo=e=>`- ${e}`,vo=e=>Fr.isFunction(e)||null===e||!1===e;var wo={getAdapter:function(e,t){e=Fr.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let s=0;s<n;s++){let n;if(r=e[s],i=r,!vo(r)&&(i=yo[(n=String(r)).toLowerCase()],void 0===i))throw new ti(`Unknown adapter '${n}'`);if(i&&(Fr.isFunction(i)||(i=i.get(t))))break;o[n||"#"+s]=i}if(!i){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(bo).join("\n"):" "+bo(e[0]):"as no adapter specified";throw new ti("There is no suitable adapter to dispatch the request "+t,ti.ERR_NOT_SUPPORT)}return i},adapters:yo};function So(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ni(null,e)}function _o(e){const t=Fr.toSafeFlatObject(e);So(t),t.headers=Qr.from(Fr.getSafeProp(t,"headers")),t.data=xi.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return wo.getAdapter(t.adapter||Ai.adapter,t)(t).then(function(e){So(t),t.response=e;try{e.data=xi.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=Qr.from(e.headers),e},function(e){if(!Ii(e)&&(So(t),e&&e.response)){t.response=e.response;try{e.response.data=xi.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=Qr.from(e.response.headers)}return Promise.reject(e)})}const Eo={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Eo[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const ko={};Eo.transitional=function(e,t,n){function r(e,t){return"[Axios v"+co+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new ti(r(i," has been removed"+(t?" in "+t:"")),ti.ERR_DEPRECATED);return t&&!ko[i]&&(ko[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},Eo.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Oo={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new ti("options must be an object",ti.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new ti("option "+o+" must be "+n,ti.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new ti("Unknown option "+o,ti.ERR_BAD_OPTION)}},validators:Eo};const Co=Oo.validators;let Ro=class{constructor(e){this.defaults=e||{},this.interceptors={request:new gi,response:new gi}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack;let r="";if("string"==typeof n){const e=n.indexOf("\n");r=-1===e?"":n.slice(e+1)}if(e.stack){if(r){const t=r.indexOf("\n"),n=-1===t?-1:r.indexOf("\n",t+1),i=-1===n?"":r.slice(n+1);String(e.stack).endsWith(i)||(e.stack+="\n"+r)}}else e.stack=r}catch(e){}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ji(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Oo.assertOptions(n,{silentJSONParsing:Co.transitional(Co.boolean),forcedJSONParsing:Co.transitional(Co.boolean),clarifyTimeoutError:Co.transitional(Co.boolean),legacyInterceptorReqResOrdering:Co.transitional(Co.boolean),advertiseZstdAcceptEncoding:Co.transitional(Co.boolean),validateStatusUndefinedResolves:Co.transitional(Co.boolean)},!1),null!=r&&(Fr.isFunction(r)?t.paramsSerializer={serialize:r}:Oo.assertOptions(r,{encode:Co.function,serialize:Co.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Oo.assertOptions(t,{baseUrl:Co.spelling("baseURL"),withXsrfToken:Co.spelling("withXSRFToken")},!0),t.method=(Fr.getSafeProp(t,"method")||Fr.getSafeProp(this.defaults,"method")||"get").toLowerCase();let o=i&&Fr.merge(i.common,i[t.method]);i&&Fr.forEach(Ri.concat("common"),e=>{delete i[e]}),t.headers=Qr.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||yi;n&&n.legacyInterceptorReqResOrdering?s.unshift(e.fulfilled,e.rejected):s.push(e.fulfilled,e.rejected)});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,h=0;if(!a){const e=[_o.bind(this),void 0];for(e.unshift(...s),e.push(...c),u=e.length,l=Promise.resolve(t);h<u;)l=l.then(e[h++],e[h++]);return l}u=s.length;let d=t;for(;h<u;){const e=s[h++],t=s[h++];try{d=e?e(d):d}catch(e){if(!t){l=Promise.reject(e);break}try{const n=t.call(this,e);Fr.isThenable(n)&&(l=Promise.resolve(n).then(()=>_o.call(this,d)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=_o.call(this,d)}catch(e){l=Promise.reject(e)}for(h=0,u=c.length;h<u;)l=l.then(c[h++],c[h++]);return l}getUri(e){return hi(Vi((e=Ji(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}};Fr.forEach(["delete","get","head","options"],function(e){Ro.prototype[e]=function(t,n){return this.request(Ji(n||{},{method:e,url:t,data:n&&Fr.hasOwnProp(n,"data")?n.data:void 0}))}}),Fr.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,r,i){return this.request(Ji(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ro.prototype[e]=t(),"query"!==e&&(Ro.prototype[e+"Form"]=t(!0))});const To={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(To).forEach(([e,t])=>{void 0===To[t]&&(To[t]=e)});const Ao=function e(t){const n=new Ro(t),r=Hn(Ro.prototype.request,n);return Fr.extend(r,Ro.prototype,n,{allOwnKeys:!0}),Fr.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ji(t,n))},r}(Ai);Ao.Axios=Ro,Ao.CanceledError=Ni,Ao.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new Ni(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},Ao.isCancel=Ii,Ao.VERSION=co,Ao.toFormData=si,Ao.AxiosError=ti,Ao.Cancel=Ao.CanceledError,Ao.all=function(e){return Promise.all(e)},Ao.spread=function(e){return function(t){return e.apply(null,t)}},Ao.isAxiosError=function(e){return Fr.isObject(e)&&!0===e.isAxiosError},Ao.mergeConfig=Ji,Ao.AxiosHeaders=Qr,Ao.formToJSON=e=>Ci(Fr.isHTMLForm(e)?new FormData(e):e),Ao.getAdapter=wo.getAdapter,Ao.HttpStatusCode=To,Ao.default=Ao;const{Axios:xo,AxiosError:Io,CanceledError:No,isCancel:Po,CancelToken:Lo,VERSION:Uo,all:jo,Cancel:Do,isAxiosError:Bo,spread:Fo,toFormData:$o,AxiosHeaders:Ho,HttpStatusCode:Mo,formToJSON:Wo,getAdapter:qo,mergeConfig:Vo,create:zo}=Ao;e.FAILURE_EVENT="skills-report-error",e.Logger=f,e.SUCCESS_EVENT="skills-report-success",e.SkillsConfiguration=yn,e.SkillsDisplayJS=class{constructor({options:e,theme:t,version:n,handleRouteChanged:r,userId:i}={}){f.debug(`SkillsClient::SkillsDisplayJS::Constructing with options [${e}], theme [${t}], version [${n}], userId [${i}]`),this._options={parentPath:window.location.pathname,...e},this._theme=t,this._version=n,this._handleRouteChanged=r,this._userId=i}currentIframeId(){return Bn}navigate(e=this.skillsDisplayPath,t=!0,n=!0){this._childFrame&&null!=e&&this._childFrame.call("navigate",{path:e,replace:n,query:{skipParentHistory:t}})}attachTo(e){if(yn.isDisabled())return void f.info("SkillsClient::SkillsDisplayJS::attachTo: SkillsConfiguration is disabled Skills Display will not be initialized");f.info(`SkillsClient::SkillsDisplayJS::attaching to [${e?e.toString():e}]`);let t=e;if("string"==typeof e&&(t=document.querySelector(e),f.debug(`SkillsClient::SkillsDisplayJS::document.querySelector returned [${t?t.toString():t}]`)),!t)throw new Error(`Can't find element with selector='${e?e.toString():e}'`);Bn+=1;const n=`client-display-iframe-${Bn}`,r=this.options.isSummaryOnly?600:960,i=new Un({container:t,url:`${this.configuration.serviceUrl}/static/clientPortal/index.html`,classListArray:[n],model:{serviceUrl:this.configuration.serviceUrl,projectId:this.configuration.projectId,version:this.version,userId:"pki"===this.configuration.authenticator?this.userId:null,theme:this.theme,options:this.options,minHeight:`${r}px`,isSummaryOnly:this.options.isSummaryOnly,internalBackButton:null!=this.options.internalBackButton&&this.options.internalBackButton}}),o=document.querySelector(`.${n}`);o.setAttribute("style","border: 0; height: 100%; width: 100%"),o.setAttribute("aria-label","SkillTree Skills Display"),t.height=0,t.style.height="0px",Dn=()=>{this.navigate(this.skillsDisplayPath||"/",!0)},window.addEventListener("popstate",Dn),window.addEventListener("hashchange",Dn),i.then(e=>{const n=e.frame.className,i=$n.indexOf(n);if(i>-1)return f.info(`SkillsClient::SkillsDisplayJS::handshake: child frame [${n}] already marked for destruction, not initializing.`),void(e&&(e.destroy(),$n.splice(i,1)));this._childFrame=e,e.on("height-changed",e=>{f.debug(`SkillsClient::SkillsDisplayJS::height-changed: data [${e}]`);const n=Math.max(e,r);t.height=n,t.style.height=`${n}px`}),e.on("do-scroll",e=>{let t=0;this.options.scrollTopOffset&&(t=this.options.scrollTopOffset);const n=Math.max(o.getBoundingClientRect().top,0),r=e,i=n+r-t;f.debug(`do-scroll fromTopToIframe=[${n}], withinIframe=[${r}], additionalOffset=[${t}], toScroll=[${i}]`),window.scroll({top:i,behavior:"smooth"})}),e.on("route-changed",e=>{const n=e?e.path:null;if(f.debug(`SkillsClient::SkillsDisplayJS::route-changed - newPath [${n}]`),null!=n){const t=n.endsWith("index.html")?"/":n;if(this._shouldUpdateHistory(e)){const e=new URLSearchParams(window.location.search);e.set(Fn,t);const r=`${window.location.pathname}?${e.toString()}${window.location.hash}`;window.history.pushState({skillsClientDisplayPath:n},"",r)}this._handleRouteChanged&&this._handleRouteChanged(t)}if(!this.options.disableAutoScroll){let e=t;if("top-offset"===this.options.autoScrollStrategy){let t=0;this.options.scrollTopOffset&&(t=this.options.scrollTopOffset);const n=e.offsetTop-t;window.scroll({top:n,behavior:"smooth"})}else"top-of-page"===this.options.autoScrollStrategy&&(e=document.querySelector("body")),e.scrollIntoView({behavior:"smooth"})}}),e.on("needs-authentication",()=>{f.debug("SkillsClient::SkillsDisplayJS::needs-authentication");const t="pki"===this.configuration.authenticator;this.authenticationPromise||t?t&&(e.call("updateAuthenticationToken","pki"),this.navigate()):this.authenticationPromise=ln.getAuthenticationToken(this.configuration.authenticator,this.configuration.serviceUrl,this.configuration.projectId).then(t=>{e.call("updateAuthenticationToken",t),this.navigate()}).finally(()=>{this.authenticationPromise=null})})}),f.debug("SkillsClient::SkillsDisplayJS::calling _checkAndHandleServiceStatus"),this._checkAndHandleServiceStatus(t)}_checkAndHandleServiceStatus(e){this.status=yn.getServiceStatus(),this.status||(f.info("SkillsClient::SkillsDisplayJS::SkillsConfiguration.configure() was not called, checking status endpoint."),ln.getServiceStatus(`${this.configuration.serviceUrl}/public/status`).then(e=>{this.status=e.status,ln.configureLogging(this,e)}).catch(t=>{let n="Please ensure the skilltree server is running";this.configuration.serviceUrl&&this.configuration.serviceUrl.startsWith("https")&&(n+=" and that your browser trusts the server's certificate"),n+=`. skilltree service URL: ${this.configuration.serviceUrl}`,console.error(n),f.error(`SkillsClient::SkillsDisplayJS::${n}`,t),jn.removeAllChildren(e),e.appendChild(jn.buildErrorPage()),e.setAttribute("style","border: 5px; height: 20rem; width: 100%")}))}_shouldUpdateHistory(e){const t="true"!==e.query.skipParentHistory&&!0!==e.query.skipParentHistory;return(null==this.options.updateHistory||!0===this.options.updateHistory)&&t}set version(e){f.info(`SkillsClient::SkillsDisplayJS::setting version [${e}]`),this._version=e,this._childFrame.call("updateVersion",e)}get options(){return this._options}get theme(){return this._theme}get version(){return this._version}get userId(){return this._userId}get configuration(){return{serviceUrl:this._options.serviceUrl?this._options.serviceUrl:yn.getServiceUrl(),authenticator:this._options.authenticator?this._options.authenticator:yn.getAuthenticator(),projectId:this._options.projectId?this._options.projectId:yn.getProjectId()}}get skillsDisplayPath(){return new URLSearchParams(window.location.search).get(Fn)}destroy(){if(f.info(`SkillsClient::SkillsDisplayJS::destroy called. _childFrame [${this._childFrame}]`),this._childFrame)this._childFrame.destroy();else{const e=`client-display-iframe-${Bn}`;f.info(`SkillsClient::SkillsDisplayJS::destroy child frame [${e}] not yet initialized, marking for future destruction`),$n.push(e)}new URLSearchParams(window.location.search).delete(Fn),window.removeEventListener("popstate",Dn),window.removeEventListener("hashchange",Dn)}},e.SkillsLevelJS=class{constructor(e){if(!yn.wasConfigureCalled()){const e="SkillsConfiguration.configure must be called before invoking SkillsLevelJS constructor.";throw f.error(`SkillsClient::SkillsLevelJS::${e}`),new Error(e)}this._projectId=e}attachTo(e){if(yn.isDisabled())return void f.info("SkillsLevelJS.js::attachTo: SkillsConfiguration is disabled Level will not be initialized");f.info(`SkillsClient::SkillsLevelJS::attaching to [${e}]`);let t=e;if("string"==typeof e&&(t=document.querySelector(e),f.debug(`SkillsClient::SkillsLevelJS::document.querySelector returned [${t}]`)),!t)throw new Error(`Can't find element with selector='${e}'`);this._skillLevelElement=t,yn.afterConfigure().then(()=>{this._projectId||(this._projectId=yn.getProjectId(),f.debug(`SkillsClient::SkillsLevelJS::getting projectId from SkillsConfiguration: [${this._projectId}]`));const e={withCredentials:yn.isPKIMode()};if(!yn.isPKIMode()){const t=yn.getAuthToken();e.headers={Authorization:`Bearer ${t}`}}Ao.get(`${yn.getServiceUrl()}/api/projects/${this._projectId}/level`,e).then(e=>{this.setSkillLevel(e.data),Tn.addSuccessHandler(this.update.bind(this)),f.info(`SkillsClient::SkillsLevelJS::received initial skill level [${e.data}]`)})})}update(e){const t=e.completed||[];this._skillLevel=t.filter(e=>"OVERALL"===e.id).reduce((e,t)=>{const n=t.level;return e<n?n:e},this._skillLevel),this.setSkillLevel(this._skillLevel),f.info(`SkillsClient::SkillsLevelJS::updated skill level [${this._skillLevel}]`)}setSkillLevel(e){this._skillLevel=e,this._skillLevelElement.innerText=`Level ${e}`}get projectId(){return this._projectId}get skillLevel(){return this._skillLevel}},e.SkillsReporter=Tn});
//# sourceMappingURL=skills-client-js.umd.min.js.map
