var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};function e(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}var i=function(){return(i=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function r(t,e,i,r){var n,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var s=t.length-1;s>=0;s--)(n=t[s])&&(a=(o<3?n(a):o>3?n(e,i,a):n(e,i))||a);return o>3&&a&&Object.defineProperty(e,i,a),a}function n(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function o(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],r=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var r,n,o=i.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){n={error:t}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a}function s(t,e,i){if(i||2===arguments.length)for(var r,n=0,o=e.length;n<o;n++)!r&&n in e||(r||(r=Array.prototype.slice.call(e,0,n)),r[n]=e[n]);return t.concat(r||Array.prototype.slice.call(e))}
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const l=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,d=Symbol(),c=new Map;class h{constructor(t,e){if(this._$cssResult$=!0,e!==d)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=c.get(this.cssText);return l&&void 0===t&&(c.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const u=l?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new h("string"==typeof t?t:t+"",d))(e)})(t):t
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */;var p;const f=window.trustedTypes,m=f?f.emptyScript:"",g=window.reactiveElementPolyfillSupport,b={toAttribute(t,e){switch(e){case Boolean:t=t?m:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},v=(t,e)=>e!==t&&(e==e||t==t),y={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:v};class _ extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;null!==(e=this.l)&&void 0!==e||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const r=this._$Eh(i,e);void 0!==r&&(this._$Eu.set(r,i),t.push(r))})),t}static createProperty(t,e=y){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,r=this.getPropertyDescriptor(t,i,e);void 0!==r&&Object.defineProperty(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(r){const n=this[t];this[e]=r,this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||y}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(u(t))}else void 0!==t&&e.push(u(t));return e}static _$Eh(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$Eg)&&void 0!==e?e:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$Eg)||void 0===e||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{l?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),r=window.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,t.appendChild(i)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ES(t,e,i=y){var r,n;const o=this.constructor._$Eh(t,i);if(void 0!==o&&!0===i.reflect){const a=(null!==(n=null===(r=i.converter)||void 0===r?void 0:r.toAttribute)&&void 0!==n?n:b.toAttribute)(e,i.type);this._$Ei=t,null==a?this.removeAttribute(o):this.setAttribute(o,a),this._$Ei=null}}_$AK(t,e){var i,r,n;const o=this.constructor,a=o._$Eu.get(t);if(void 0!==a&&this._$Ei!==a){const t=o.getPropertyOptions(a),s=t.converter,l=null!==(n=null!==(r=null===(i=s)||void 0===i?void 0:i.fromAttribute)&&void 0!==r?r:"function"==typeof s?s:null)&&void 0!==n?n:b.fromAttribute;this._$Ei=a,this[a]=l(e,t.type),this._$Ei=null}}requestUpdate(t,e,i){let r=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||v)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Ei!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):r=!1),!this.isUpdatePending&&r&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,e)=>this[e]=t)),this._$Et=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$Eg)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$ES(e,this[e],t))),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
var w;_.finalized=!0,_.elementProperties=new Map,_.elementStyles=[],_.shadowRootOptions={mode:"open"},null==g||g({ReactiveElement:_}),(null!==(p=globalThis.reactiveElementVersions)&&void 0!==p?p:globalThis.reactiveElementVersions=[]).push("1.3.2");const x=globalThis.trustedTypes,M=x?x.createPolicy("lit-html",{createHTML:t=>t}):void 0,k=`lit$${(Math.random()+"").slice(9)}$`,S="?"+k,E=`<${S}>`,A=document,T=(t="")=>A.createComment(t),R=t=>null===t||"object"!=typeof t&&"function"!=typeof t,I=Array.isArray,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,O=/-->/g,P=/>/g,L=/>|[ 	\n\r](?:([^\s"'>=/]+)([ 	\n\r]*=[ 	\n\r]*(?:[^ 	\n\r"'`<>=]|("|')|))|$)/g,$=/'/g,N=/"/g,B=/^(?:script|style|textarea|title)$/i,D=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),j=Symbol.for("lit-noChange"),z=Symbol.for("lit-nothing"),F=new WeakMap,U=(t,e,i)=>{var r,n;const o=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:e;let a=o._$litPart$;if(void 0===a){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;o._$litPart$=a=new K(e.insertBefore(T(),t),t,void 0,null!=i?i:{})}return a._$AI(t),a},q=A.createTreeWalker(A,129,null,!1),H=(t,e)=>{const i=t.length-1,r=[];let n,o=2===e?"<svg>":"",a=C;for(let e=0;e<i;e++){const i=t[e];let s,l,d=-1,c=0;for(;c<i.length&&(a.lastIndex=c,l=a.exec(i),null!==l);)c=a.lastIndex,a===C?"!--"===l[1]?a=O:void 0!==l[1]?a=P:void 0!==l[2]?(B.test(l[2])&&(n=RegExp("</"+l[2],"g")),a=L):void 0!==l[3]&&(a=L):a===L?">"===l[0]?(a=null!=n?n:C,d=-1):void 0===l[1]?d=-2:(d=a.lastIndex-l[2].length,s=l[1],a=void 0===l[3]?L:'"'===l[3]?N:$):a===N||a===$?a=L:a===O||a===P?a=C:(a=L,n=void 0);const h=a===L&&t[e+1].startsWith("/>")?" ":"";o+=a===C?i+E:d>=0?(r.push(s),i.slice(0,d)+"$lit$"+i.slice(d)+k+h):i+k+(-2===d?(r.push(void 0),e):h)}const s=o+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==M?M.createHTML(s):s,r]};class V{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,o=0;const a=t.length-1,s=this.parts,[l,d]=H(t,e);if(this.el=V.createElement(l,i),q.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(r=q.nextNode())&&s.length<a;){if(1===r.nodeType){if(r.hasAttributes()){const t=[];for(const e of r.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(k)){const i=d[o++];if(t.push(e),void 0!==i){const t=r.getAttribute(i.toLowerCase()+"$lit$").split(k),e=/([.?@])?(.*)/.exec(i);s.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?Y:"?"===e[1]?J:"@"===e[1]?Q:X})}else s.push({type:6,index:n})}for(const e of t)r.removeAttribute(e)}if(B.test(r.tagName)){const t=r.textContent.split(k),e=t.length-1;if(e>0){r.textContent=x?x.emptyScript:"";for(let i=0;i<e;i++)r.append(t[i],T()),q.nextNode(),s.push({type:2,index:++n});r.append(t[e],T())}}}else if(8===r.nodeType)if(r.data===S)s.push({type:2,index:n});else{let t=-1;for(;-1!==(t=r.data.indexOf(k,t+1));)s.push({type:7,index:n}),t+=k.length-1}n++}}static createElement(t,e){const i=A.createElement("template");return i.innerHTML=t,i}}function W(t,e,i=t,r){var n,o,a,s;if(e===j)return e;let l=void 0!==r?null===(n=i._$Cl)||void 0===n?void 0:n[r]:i._$Cu;const d=R(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==d&&(null===(o=null==l?void 0:l._$AO)||void 0===o||o.call(l,!1),void 0===d?l=void 0:(l=new d(t),l._$AT(t,i,r)),void 0!==r?(null!==(a=(s=i)._$Cl)&&void 0!==a?a:s._$Cl=[])[r]=l:i._$Cu=l),void 0!==l&&(e=W(t,l._$AS(t,e.values),l,r)),e}class G{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:r}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:A).importNode(i,!0);q.currentNode=n;let o=q.nextNode(),a=0,s=0,l=r[0];for(;void 0!==l;){if(a===l.index){let e;2===l.type?e=new K(o,o.nextSibling,this,t):1===l.type?e=new l.ctor(o,l.name,l.strings,this,t):6===l.type&&(e=new tt(o,this,t)),this.v.push(e),l=r[++s]}a!==(null==l?void 0:l.index)&&(o=q.nextNode(),a++)}return n}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class K{constructor(t,e,i,r){var n;this.type=2,this._$AH=z,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cg=null===(n=null==r?void 0:r.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=W(this,t,e),R(t)?t===z||null==t||""===t?(this._$AH!==z&&this._$AR(),this._$AH=z):t!==this._$AH&&t!==j&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>{var e;return I(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.S(t):this.$(t)}M(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==z&&R(this._$AH)?this._$AA.nextSibling.data=t:this.k(A.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:r}=t,n="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=V.createElement(r.h,this.options)),r);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.m(i);else{const t=new G(n,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=F.get(t.strings);return void 0===e&&F.set(t.strings,e=new V(t)),e}S(t){I(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const n of t)r===e.length?e.push(i=new K(this.M(T()),this.M(T()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class X{constructor(t,e,i,r,n){this.type=1,this._$AH=z,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=z}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,r){const n=this.strings;let o=!1;if(void 0===n)t=W(this,t,e,0),o=!R(t)||t!==this._$AH&&t!==j,o&&(this._$AH=t);else{const r=t;let a,s;for(t=n[0],a=0;a<n.length-1;a++)s=W(this,r[i+a],e,a),s===j&&(s=this._$AH[a]),o||(o=!R(s)||s!==this._$AH[a]),s===z?t=z:t!==z&&(t+=(null!=s?s:"")+n[a+1]),this._$AH[a]=s}o&&!r&&this.C(t)}C(t){t===z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class Y extends X{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===z?void 0:t}}const Z=x?x.emptyScript:"";class J extends X{constructor(){super(...arguments),this.type=4}C(t){t&&t!==z?this.element.setAttribute(this.name,Z):this.element.removeAttribute(this.name)}}class Q extends X{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=W(this,t,e,0))&&void 0!==i?i:z)===j)return;const r=this._$AH,n=t===z&&r!==z||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==z&&(r===z||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class tt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){W(this,t)}}const et=window.litHtmlPolyfillSupport;null==et||et(V,K),(null!==(w=globalThis.litHtmlVersions)&&void 0!==w?w:globalThis.litHtmlVersions=[]).push("2.2.3");
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const it=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,rt=Symbol(),nt=new Map;class ot{constructor(t,e){if(this._$cssResult$=!0,e!==rt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=nt.get(this.cssText);return it&&void 0===t&&(nt.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const at=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,r)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1]),t[0]);return new ot(i,rt)},st=it?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new ot("string"==typeof t?t:t+"",rt))(e)})(t):t
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */;var lt;const dt=window.trustedTypes,ct=dt?dt.emptyScript:"",ht=window.reactiveElementPolyfillSupport,ut={toAttribute(t,e){switch(e){case Boolean:t=t?ct:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},pt=(t,e)=>e!==t&&(e==e||t==t),ft={attribute:!0,type:String,converter:ut,reflect:!1,hasChanged:pt};class mt extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;null!==(e=this.l)&&void 0!==e||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const r=this._$Eh(i,e);void 0!==r&&(this._$Eu.set(r,i),t.push(r))})),t}static createProperty(t,e=ft){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,r=this.getPropertyDescriptor(t,i,e);void 0!==r&&Object.defineProperty(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(r){const n=this[t];this[e]=r,this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||ft}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(st(t))}else void 0!==t&&e.push(st(t));return e}static _$Eh(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$Eg)&&void 0!==e?e:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$Eg)||void 0===e||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{it?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),r=window.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,t.appendChild(i)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ES(t,e,i=ft){var r,n;const o=this.constructor._$Eh(t,i);if(void 0!==o&&!0===i.reflect){const a=(null!==(n=null===(r=i.converter)||void 0===r?void 0:r.toAttribute)&&void 0!==n?n:ut.toAttribute)(e,i.type);this._$Ei=t,null==a?this.removeAttribute(o):this.setAttribute(o,a),this._$Ei=null}}_$AK(t,e){var i,r,n;const o=this.constructor,a=o._$Eu.get(t);if(void 0!==a&&this._$Ei!==a){const t=o.getPropertyOptions(a),s=t.converter,l=null!==(n=null!==(r=null===(i=s)||void 0===i?void 0:i.fromAttribute)&&void 0!==r?r:"function"==typeof s?s:null)&&void 0!==n?n:ut.fromAttribute;this._$Ei=a,this[a]=l(e,t.type),this._$Ei=null}}requestUpdate(t,e,i){let r=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||pt)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Ei!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):r=!1),!this.isUpdatePending&&r&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,e)=>this[e]=t)),this._$Et=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$Eg)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$ES(e,this[e],t))),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
var gt,bt;mt.finalized=!0,mt.elementProperties=new Map,mt.elementStyles=[],mt.shadowRootOptions={mode:"open"},null==ht||ht({ReactiveElement:mt}),(null!==(lt=globalThis.reactiveElementVersions)&&void 0!==lt?lt:globalThis.reactiveElementVersions=[]).push("1.3.2");class vt extends mt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=U(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return j}}vt.finalized=!0,vt._$litElement$=!0,null===(gt=globalThis.litElementHydrateSupport)||void 0===gt||gt.call(globalThis,{LitElement:vt});const yt=globalThis.litElementPolyfillSupport;null==yt||yt({LitElement:vt}),(null!==(bt=globalThis.litElementVersions)&&void 0!==bt?bt:globalThis.litElementVersions=[]).push("3.2.0");
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const _t=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:r}=e;return{kind:i,elements:r,finisher(e){window.customElements.define(t,e)}}})(t,e)
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */,wt=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function xt(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):wt(t,e)
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */}function Mt(t){return xt({...t,state:!0})}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const kt=({finisher:t,descriptor:e})=>(i,r)=>{var n;if(void 0===r){const r=null!==(n=i.originalKey)&&void 0!==n?n:i.key,o=null!=e?{kind:"method",placement:"prototype",key:r,descriptor:e(i.key)}:{...i,key:r};return null!=t&&(o.finisher=function(e){t(e,r)}),o}{const n=i.constructor;void 0!==e&&Object.defineProperty(i,r,e(r)),null==t||t(n,r)}}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */;function St(t){return kt({finisher:(e,i)=>{Object.assign(e.prototype[i],t)}})}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function Et(t,e){return kt({descriptor:i=>{const r={get(){var e,i;return null!==(i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t))&&void 0!==i?i:null},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof i?Symbol():"__"+i;r.get=function(){var i,r;return void 0===this[e]&&(this[e]=null!==(r=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t))&&void 0!==r?r:null),this[e]}}return r}})}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function At(t){return kt({descriptor:e=>({async get(){var e;return await this.updateComplete,null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t)},enumerable:!0,configurable:!0})})}
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */var Tt;const Rt=null!=(null===(Tt=window.HTMLSlotElement)||void 0===Tt?void 0:Tt.prototype.assignedElements)?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter((t=>t.nodeType===Node.ELEMENT_NODE));
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
function It(t,e,i){let r,n=t;return"object"==typeof t?(n=t.slot,r=t):r={flatten:e},i?function(t){const{slot:e,selector:i}=null!=t?t:{};return kt({descriptor:r=>({get(){var r;const n="slot"+(e?`[name=${e}]`:":not([name])"),o=null===(r=this.renderRoot)||void 0===r?void 0:r.querySelector(n),a=null!=o?Rt(o,t):[];return i?a.filter((t=>t.matches(i))):a},enumerable:!0,configurable:!0})})}({slot:n,flatten:e,selector:i}):kt({descriptor:t=>({get(){var t,e;const i="slot"+(n?`[name=${n}]`:":not([name])"),o=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(i);return null!==(e=null==o?void 0:o.assignedNodes(r))&&void 0!==e?e:[]},enumerable:!0,configurable:!0})})}function Ct(t,e,i){return Object.entries(Pt(e||{})).reduce(((t,[e,i])=>t.replace(new RegExp(`{{[  ]*${e}[  ]*}}`,"gm"),String(Pt(i)))),t)}function Ot(t,e){const i=t.split(".");let r=e.strings;for(;null!=r&&i.length>0;)r=r[i.shift()];return null!=r?r.toString():null}function Pt(t){return"function"==typeof t?t():t}let Lt={loader:()=>Promise.resolve({}),empty:t=>`[${t}]`,lookup:Ot,interpolate:Ct,translationCache:{}};function $t(t){return Lt=Object.assign(Object.assign({},Lt),t)}function Nt(t,e,i=Lt){var r;r={previousStrings:i.strings,previousLang:i.lang,lang:i.lang=t,strings:i.strings=e},window.dispatchEvent(new CustomEvent("langChanged",{detail:r}))}async function Bt(t,e=Lt){const i=await e.loader(t,e);e.translationCache={},Nt(t,i,e)}function Dt(t,e,i=Lt){let r=i.translationCache[t]||(i.translationCache[t]=i.lookup(t,i)||i.empty(t,i));return null!=(e=null!=e?Pt(e):null)?i.interpolate(r,e,i):r}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const jt=1,zt=2,Ft=3,Ut=4,qt=t=>(...e)=>({_$litDirective$:t,values:e});class Ht{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const Vt=t=>void 0===t.strings,Wt={},Gt=(t,e)=>{var i,r;const n=t._$AN;if(void 0===n)return!1;for(const t of n)null===(r=(i=t)._$AO)||void 0===r||r.call(i,e,!1),Gt(t,e);return!0},Kt=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===(null==i?void 0:i.size))},Xt=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),Jt(e)}};
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function Yt(t){void 0!==this._$AN?(Kt(this),this._$AM=t,Xt(this)):this._$AM=t}function Zt(t,e=!1,i=0){const r=this._$AH,n=this._$AN;if(void 0!==n&&0!==n.size)if(e)if(Array.isArray(r))for(let t=i;t<r.length;t++)Gt(r[t],!1),Kt(r[t]);else null!=r&&(Gt(r,!1),Kt(r));else Gt(this,t)}const Jt=t=>{var e,i,r,n;t.type==zt&&(null!==(e=(r=t)._$AP)&&void 0!==e||(r._$AP=Zt),null!==(i=(n=t)._$AQ)&&void 0!==i||(n._$AQ=Yt))};class Qt extends Ht{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),Xt(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,r;t!==this.isConnected&&(this.isConnected=t,t?null===(i=this.reconnected)||void 0===i||i.call(this):null===(r=this.disconnected)||void 0===r||r.call(this)),e&&(Gt(this,t),Kt(this))}setValue(t){if(Vt(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}class te extends Qt{constructor(){super(...arguments),this.langChangedSubscription=null,this.getValue=()=>""}renderValue(t){return this.getValue=t,this.subscribe(),this.getValue()}langChanged(t){this.setValue(this.getValue(t))}subscribe(){null==this.langChangedSubscription&&(this.langChangedSubscription=function(t,e){const i=e=>t(e.detail);return window.addEventListener("langChanged",i,e),()=>window.removeEventListener("langChanged",i)}(this.langChanged.bind(this)))}unsubscribe(){null!=this.langChangedSubscription&&this.langChangedSubscription()}disconnected(){this.unsubscribe()}reconnected(){this.subscribe()}}class ee extends te{render(t,e,i){return this.renderValue((()=>Dt(t,e,i)))}}const ie=qt(ee);
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */class re extends Ht{constructor(t){if(super(t),this.it=z,t.type!==zt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===z||null==t)return this.ft=void 0,this.it=t;if(t===j)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.ft;this.it=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}re.directiveName="unsafeHTML",re.resultType=1;const ne=qt(re),oe=t=>e=>class extends e{connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=t.subscribe((()=>this.stateChanged(t.getState()))),this.stateChanged(t.getState())}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}stateChanged(t){}}
/**
@license
Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/;
/**
@license
Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/function ae(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function se(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function le(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?se(Object(i),!0).forEach((function(e){ae(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):se(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function de(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var ce="function"==typeof Symbol&&Symbol.observable||"@@observable",he=function(){return Math.random().toString(36).substring(7).split("").join(".")},ue={INIT:"@@redux/INIT"+he(),REPLACE:"@@redux/REPLACE"+he(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+he()}};function pe(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function fe(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function me(t){return function(e){var i=e.dispatch,r=e.getState;return function(e){return function(n){return"function"==typeof n?n(i,r,t):e(n)}}}}var ge=me();ge.withExtraArgument=me;var be=ge;
/**
@license
Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/const ve=(t,e={})=>i=>{if(!0!==["/summary","/job","/pipeline","/experiment","/data","/statistics","/usersettings","/agent","/resource","/user","/credential","/environment","/settings","/maintenance","/information","/github","/import"].includes(t)){const i=t.split(/[/]+/);i.length>1&&""===i[0]&&(t=i[1],e.requestURL=i.slice(2).join("/"))}let r;e.queryString=window.location.search,"index.html"!==t&&""!==t||(t="/"),r=["/","build","/build","app","/app"].includes(t)?"summary":"/"===t[0]?t.slice(1):t,i(ye(r,e)),i(Me(!1))},ye=(t,e={})=>i=>{switch(t){case"summary":import("./backend-ai-summary-view-59bb821d.js").then((t=>{}));break;case"job":import("./backend-ai-session-view-7cf34017.js");break;case"pipeline":import("./backend-ai-pipeline-view-a6a39334.js");break;case"data":import("./backend-ai-data-view-b5651544.js");break;case"usersettings":import("./backend-ai-usersettings-view-d9183203.js");break;case"agent":case"resource":import("./backend-ai-agent-view-5c9b4870.js");break;case"credential":case"user":import("./backend-ai-credential-view-a8509deb.js");break;case"environment":import("./backend-ai-environment-view-688eb86b.js");break;case"settings":import("./backend-ai-settings-view-43d75c92.js");break;case"maintenance":import("./backend-ai-maintenance-view-b86bc36d.js");break;case"information":import("./backend-ai-information-view-0a024afe.js");break;case"statistics":import("./backend-ai-statistics-view-f19279b7.js");break;case"verify-email":import("./backend-ai-email-verification-view-e7b56ec2.js");break;case"change-password":import("./backend-ai-change-forgot-password-view-f84f550c.js");break;case"github":case"gitlab":case"import":import("./backend-ai-import-view-4c1acced.js");break;case"edu-applauncher":import("./backend-ai-edu-applauncher-dec184b7.js");break;case"unauthorized":import("./backend-ai-permission-denied-view-26c9200b.js");break;case"error":default:if(void 0!==globalThis.backendaiPages){for(const t of globalThis.backendaiPages)"url"in t&&import("./plugins/"+t.url+".js");break}document.addEventListener("backend-ai-plugin-loaded",(()=>{})),import("./backend-ai-error-view-f10941a3.js").then((t=>{}))}i(_e(t,e))},_e=(t,e)=>({type:"UPDATE_PAGE",page:t,params:e});
/**
 @license
 Copyright (c) 2015-2022 Lablup Inc. All rights reserved.
 */let we;const xe=t=>(e,i)=>{t!==i().app.offline&&e((t=>{t({type:"OPEN_SNACKBAR"}),window.clearTimeout(we),we=window.setTimeout((()=>t({type:"CLOSE_SNACKBAR"})),3e3)})),e({type:"UPDATE_OFFLINE",offline:t})},Me=t=>({type:"UPDATE_DRAWER_STATE",opened:t}),ke={page:"",params:{},offline:!1,drawerOpened:!1,offlineIndicatorOpened:!1},Se=function t(e,i,r){var n;if("function"==typeof i&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(de(0));if("function"==typeof i&&void 0===r&&(r=i,i=void 0),void 0!==r){if("function"!=typeof r)throw new Error(de(1));return r(t)(e,i)}if("function"!=typeof e)throw new Error(de(2));var o=e,a=i,s=[],l=s,d=!1;function c(){l===s&&(l=s.slice())}function h(){if(d)throw new Error(de(3));return a}function u(t){if("function"!=typeof t)throw new Error(de(4));if(d)throw new Error(de(5));var e=!0;return c(),l.push(t),function(){if(e){if(d)throw new Error(de(6));e=!1,c();var i=l.indexOf(t);l.splice(i,1),s=null}}}function p(t){if(!pe(t))throw new Error(de(7));if(void 0===t.type)throw new Error(de(8));if(d)throw new Error(de(9));try{d=!0,a=o(a,t)}finally{d=!1}for(var e=s=l,i=0;i<e.length;i++){(0,e[i])()}return t}function f(t){if("function"!=typeof t)throw new Error(de(10));o=t,p({type:ue.REPLACE})}function m(){var t,e=u;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(de(11));function i(){t.next&&t.next(h())}return i(),{unsubscribe:e(i)}}})[ce]=function(){return this},t}return p({type:ue.INIT}),(n={dispatch:p,subscribe:u,getState:h,replaceReducer:f})[ce]=m,n}((t=>t),(window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||fe)((t=>e=>(i,r)=>{let n={};const o=e(i,r);return Object.assign({},o,{addReducers(e){const i=Object.assign({},n,e);this.replaceReducer(t(n=i))}})})((function(t){for(var e=Object.keys(t),i={},r=0;r<e.length;r++){var n=e[r];"function"==typeof t[n]&&(i[n]=t[n])}var o,a=Object.keys(i);try{!function(t){Object.keys(t).forEach((function(e){var i=t[e];if(void 0===i(void 0,{type:ue.INIT}))throw new Error(de(12));if(void 0===i(void 0,{type:ue.PROBE_UNKNOWN_ACTION()}))throw new Error(de(13))}))}(i)}catch(t){o=t}return function(t,e){if(void 0===t&&(t={}),o)throw o;for(var r=!1,n={},s=0;s<a.length;s++){var l=a[s],d=i[l],c=t[l],h=d(c,e);if(void 0===h)throw e&&e.type,new Error(de(14));n[l]=h,r=r||h!==c}return(r=r||a.length!==Object.keys(t).length)?n:t}})),function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return function(){var i=t.apply(void 0,arguments),r=function(){throw new Error(de(15))},n={getState:i.getState,dispatch:function(){return r.apply(void 0,arguments)}},o=e.map((function(t){return t(n)}));return r=fe.apply(void 0,o)(i.dispatch),le(le({},i),{},{dispatch:r})}}}(be)));Se.addReducers({app:(t=ke,e)=>{switch(e.type){case"UPDATE_PAGE":return{...t,page:e.page,params:e.params};case"UPDATE_OFFLINE":return{...t,offline:e.offline};case"UPDATE_DRAWER_STATE":return{...t,drawerOpened:e.opened};case"OPEN_SNACKBAR":return{...t,offlineIndicatorOpened:!0};case"CLOSE_SNACKBAR":return{...t,offlineIndicatorOpened:!1};default:return t}}});
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const Ee=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:r}=e;return{kind:i,elements:r,finisher(e){window.customElements.define(t,e)}}})(t,e)
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */;var Ae;null===(Ae=window.HTMLSlotElement)||void 0===Ae||Ae.prototype.assignedElements,
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
console.warn("The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information."),
/**
 * @license
 * Copyright 2016 Google Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
(()=>{var t,e,i;const r=Symbol(),n=Symbol(),o=Symbol(),a=Symbol(),s=Symbol(),l=Symbol(),d=Symbol(),c=Symbol(),h=Symbol(),u=Symbol(),p=Symbol(),f=Symbol(),m=Symbol();class g{constructor(){this[t]=[],this[e]=[],this[i]=new Set}destructor(){this[h](this[o]);const t=this;t[r]=null,t[o]=null,t[n]=null}get top(){const t=this[r];return t[t.length-1]||null}push(t){t&&t!==this.top&&(this.remove(t),this[l](t),this[r].push(t))}remove(t){const e=this[r].indexOf(t);return-1!==e&&(this[r].splice(e,1),e===this[r].length&&this[l](this.top),!0)}pop(){const t=this.top;return t&&this.remove(t),t}has(t){return-1!==this[r].indexOf(t)}[(t=r,e=o,i=n,l)](t){const e=this[n],i=this[o];if(!t)return this[h](i),e.clear(),void(this[o]=[]);const r=this[u](t);if(r[r.length-1].parentNode!==document.body)throw Error("Non-connected element cannot be a blocking element");this[o]=r;const a=this[p](t);if(!i.length)return void this[c](r,a,e);let s=i.length-1,l=r.length-1;for(;s>0&&l>0&&i[s]===r[l];)s--,l--;i[s]!==r[l]&&this[d](i[s],r[l]),s>0&&this[h](i.slice(0,s)),l>0&&this[c](r.slice(0,l),a,null)}[d](t,e){const i=t[a];this[f](t)&&!t.inert&&(t.inert=!0,i.add(t)),i.has(e)&&(e.inert=!1,i.delete(e)),e[s]=t[s],e[a]=i,t[s]=void 0,t[a]=void 0}[h](t){for(const e of t){e[s].disconnect(),e[s]=void 0;const t=e[a];for(const e of t)e.inert=!1;e[a]=void 0}}[c](t,e,i){for(const r of t){const t=r.parentNode,n=t.children,o=new Set;for(let t=0;t<n.length;t++){const a=n[t];a===r||!this[f](a)||e&&e.has(a)||(i&&a.inert?i.add(a):(a.inert=!0,o.add(a)))}r[a]=o;const l=new MutationObserver(this[m].bind(this));r[s]=l;let d=t;const c=d;c.__shady&&c.host&&(d=c.host),l.observe(d,{childList:!0})}}[m](t){const e=this[o],i=this[n];for(const r of t){const t=r.target.host||r.target,n=t===document.body?e.length:e.indexOf(t),o=e[n-1],s=o[a];for(let t=0;t<r.removedNodes.length;t++){const e=r.removedNodes[t];if(e===o)return console.info("Detected removal of the top Blocking Element."),void this.pop();s.has(e)&&(e.inert=!1,s.delete(e))}for(let t=0;t<r.addedNodes.length;t++){const e=r.addedNodes[t];this[f](e)&&(i&&e.inert?i.add(e):(e.inert=!0,s.add(e)))}}}[f](t){return!1===/^(style|template|script)$/.test(t.localName)}[u](t){const e=[];let i=t;for(;i&&i!==document.body;)if(i.nodeType===Node.ELEMENT_NODE&&e.push(i),i.assignedSlot){for(;i=i.assignedSlot;)e.push(i);i=e.pop()}else i=i.parentNode||i.host;return e}[p](t){const e=t.shadowRoot;if(!e)return null;const i=new Set;let r,n,o;const a=e.querySelectorAll("slot");if(a.length&&a[0].assignedNodes)for(r=0;r<a.length;r++)for(o=a[r].assignedNodes({flatten:!0}),n=0;n<o.length;n++)o[n].nodeType===Node.ELEMENT_NODE&&i.add(o[n]);return i}}document.$blockingElements=new g})();var Te=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();function Re(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}!function(){if("undefined"!=typeof window){var t=Array.prototype.slice,e=Element.prototype.matches||Element.prototype.msMatchesSelector,i=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","[contenteditable]"].join(","),r=function(){function r(t,e){Re(this,r),this._inertManager=e,this._rootElement=t,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}return Te(r,[{key:"destructor",value:function(){this._observer.disconnect(),this._rootElement&&(null!==this._savedAriaHidden?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach((function(t){this._unmanageNode(t.node)}),this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(t){var e=this;a(t,(function(t){return e._visitNode(t)}));var i=document.activeElement;if(!document.body.contains(t)){for(var r=t,n=void 0;r;){if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){n=r;break}r=r.parentNode}n&&(i=n.activeElement)}t.contains(i)&&(i.blur(),i===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(t){if(t.nodeType===Node.ELEMENT_NODE){var r=t;r!==this._rootElement&&r.hasAttribute("inert")&&this._adoptInertRoot(r),(e.call(r,i)||r.hasAttribute("tabindex"))&&this._manageNode(r)}}},{key:"_manageNode",value:function(t){var e=this._inertManager.register(t,this);this._managedNodes.add(e)}},{key:"_unmanageNode",value:function(t){var e=this._inertManager.deregister(t,this);e&&this._managedNodes.delete(e)}},{key:"_unmanageSubtree",value:function(t){var e=this;a(t,(function(t){return e._unmanageNode(t)}))}},{key:"_adoptInertRoot",value:function(t){var e=this._inertManager.getInertRoot(t);e||(this._inertManager.setInert(t,!0),e=this._inertManager.getInertRoot(t)),e.managedNodes.forEach((function(t){this._manageNode(t.node)}),this)}},{key:"_onMutation",value:function(e,i){e.forEach((function(e){var i=e.target;if("childList"===e.type)t.call(e.addedNodes).forEach((function(t){this._makeSubtreeUnfocusable(t)}),this),t.call(e.removedNodes).forEach((function(t){this._unmanageSubtree(t)}),this);else if("attributes"===e.type)if("tabindex"===e.attributeName)this._manageNode(i);else if(i!==this._rootElement&&"inert"===e.attributeName&&i.hasAttribute("inert")){this._adoptInertRoot(i);var r=this._inertManager.getInertRoot(i);this._managedNodes.forEach((function(t){i.contains(t.node)&&r._manageNode(t.node)}))}}),this)}},{key:"managedNodes",get:function(){return new Set(this._managedNodes)}},{key:"hasSavedAriaHidden",get:function(){return null!==this._savedAriaHidden}},{key:"savedAriaHidden",set:function(t){this._savedAriaHidden=t},get:function(){return this._savedAriaHidden}}]),r}(),n=function(){function t(e,i){Re(this,t),this._node=e,this._overrodeFocusMethod=!1,this._inertRoots=new Set([i]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}return Te(t,[{key:"destructor",value:function(){if(this._throwIfDestroyed(),this._node&&this._node.nodeType===Node.ELEMENT_NODE){var t=this._node;null!==this._savedTabIndex?t.setAttribute("tabindex",this._savedTabIndex):t.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete t.focus}this._node=null,this._inertRoots=null,this._destroyed=!0}},{key:"_throwIfDestroyed",value:function(){if(this.destroyed)throw new Error("Trying to access destroyed InertNode")}},{key:"ensureUntabbable",value:function(){if(this.node.nodeType===Node.ELEMENT_NODE){var t=this.node;if(e.call(t,i)){if(-1===t.tabIndex&&this.hasSavedTabIndex)return;t.hasAttribute("tabindex")&&(this._savedTabIndex=t.tabIndex),t.setAttribute("tabindex","-1"),t.nodeType===Node.ELEMENT_NODE&&(t.focus=function(){},this._overrodeFocusMethod=!0)}else t.hasAttribute("tabindex")&&(this._savedTabIndex=t.tabIndex,t.removeAttribute("tabindex"))}}},{key:"addInertRoot",value:function(t){this._throwIfDestroyed(),this._inertRoots.add(t)}},{key:"removeInertRoot",value:function(t){this._throwIfDestroyed(),this._inertRoots.delete(t),0===this._inertRoots.size&&this.destructor()}},{key:"destroyed",get:function(){return this._destroyed}},{key:"hasSavedTabIndex",get:function(){return null!==this._savedTabIndex}},{key:"node",get:function(){return this._throwIfDestroyed(),this._node}},{key:"savedTabIndex",set:function(t){this._throwIfDestroyed(),this._savedTabIndex=t},get:function(){return this._throwIfDestroyed(),this._savedTabIndex}}]),t}(),o=new(function(){function i(t){if(Re(this,i),!t)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=t,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),s(t.head||t.body||t.documentElement),"loading"===t.readyState?t.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}return Te(i,[{key:"setInert",value:function(t,e){if(e){if(this._inertRoots.has(t))return;var i=new r(t,this);if(t.setAttribute("inert",""),this._inertRoots.set(t,i),!this._document.body.contains(t))for(var n=t.parentNode;n;)11===n.nodeType&&s(n),n=n.parentNode}else{if(!this._inertRoots.has(t))return;this._inertRoots.get(t).destructor(),this._inertRoots.delete(t),t.removeAttribute("inert")}}},{key:"getInertRoot",value:function(t){return this._inertRoots.get(t)}},{key:"register",value:function(t,e){var i=this._managedNodes.get(t);return void 0!==i?i.addInertRoot(e):i=new n(t,e),this._managedNodes.set(t,i),i}},{key:"deregister",value:function(t,e){var i=this._managedNodes.get(t);return i?(i.removeInertRoot(e),i.destroyed&&this._managedNodes.delete(t),i):null}},{key:"_onDocumentLoaded",value:function(){t.call(this._document.querySelectorAll("[inert]")).forEach((function(t){this.setInert(t,!0)}),this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}},{key:"_watchForInert",value:function(i,r){var n=this;i.forEach((function(i){switch(i.type){case"childList":t.call(i.addedNodes).forEach((function(i){if(i.nodeType===Node.ELEMENT_NODE){var r=t.call(i.querySelectorAll("[inert]"));e.call(i,"[inert]")&&r.unshift(i),r.forEach((function(t){this.setInert(t,!0)}),n)}}),n);break;case"attributes":if("inert"!==i.attributeName)return;var r=i.target,o=r.hasAttribute("inert");n.setInert(r,o)}}),this)}}]),i}())(document);Element.prototype.hasOwnProperty("inert")||Object.defineProperty(Element.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(t){o.setInert(this,t)}})}function a(t,e,i){if(t.nodeType==Node.ELEMENT_NODE){var r=t;e&&e(r);var n=r.shadowRoot;if(n)return void a(n,e);if("content"==r.localName){for(var o=r,s=o.getDistributedNodes?o.getDistributedNodes():[],l=0;l<s.length;l++)a(s[l],e);return}if("slot"==r.localName){for(var d=r,c=d.assignedNodes?d.assignedNodes({flatten:!0}):[],h=0;h<c.length;h++)a(c[h],e);return}}for(var u=t.firstChild;null!=u;)a(u,e),u=u.nextSibling}function s(t){if(!t.querySelector("style#inert-style, link#inert-style")){var e=document.createElement("style");e.setAttribute("id","inert-style"),e.textContent="\n[inert] {\n  pointer-events: none;\n  cursor: default;\n}\n\n[inert], [inert] * {\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n",t.appendChild(e)}}}();
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var Ie={ANIMATE:"mdc-drawer--animate",CLOSING:"mdc-drawer--closing",DISMISSIBLE:"mdc-drawer--dismissible",MODAL:"mdc-drawer--modal",OPEN:"mdc-drawer--open",OPENING:"mdc-drawer--opening",ROOT:"mdc-drawer"},Ce={APP_CONTENT_SELECTOR:".mdc-drawer-app-content",CLOSE_EVENT:"MDCDrawer:closed",OPEN_EVENT:"MDCDrawer:opened",SCRIM_SELECTOR:".mdc-drawer-scrim",LIST_SELECTOR:".mdc-list,.mdc-deprecated-list",LIST_ITEM_ACTIVATED_SELECTOR:".mdc-list-item--activated,.mdc-deprecated-list-item--activated"},Oe=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),Pe=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.animationFrame=0,n.animationTimer=0,n}return e(r,t),Object.defineProperty(r,"strings",{get:function(){return Ce},enumerable:!1,configurable:!0}),Object.defineProperty(r,"cssClasses",{get:function(){return Ie},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},elementHasClass:function(){return!1},notifyClose:function(){},notifyOpen:function(){},saveFocus:function(){},restoreFocus:function(){},focusActiveNavigationItem:function(){},trapFocus:function(){},releaseFocus:function(){}}},enumerable:!1,configurable:!0}),r.prototype.destroy=function(){this.animationFrame&&cancelAnimationFrame(this.animationFrame),this.animationTimer&&clearTimeout(this.animationTimer)},r.prototype.open=function(){var t=this;this.isOpen()||this.isOpening()||this.isClosing()||(this.adapter.addClass(Ie.OPEN),this.adapter.addClass(Ie.ANIMATE),this.runNextAnimationFrame((function(){t.adapter.addClass(Ie.OPENING)})),this.adapter.saveFocus())},r.prototype.close=function(){!this.isOpen()||this.isOpening()||this.isClosing()||this.adapter.addClass(Ie.CLOSING)},r.prototype.isOpen=function(){return this.adapter.hasClass(Ie.OPEN)},r.prototype.isOpening=function(){return this.adapter.hasClass(Ie.OPENING)||this.adapter.hasClass(Ie.ANIMATE)},r.prototype.isClosing=function(){return this.adapter.hasClass(Ie.CLOSING)},r.prototype.handleKeydown=function(t){var e=t.keyCode;("Escape"===t.key||27===e)&&this.close()},r.prototype.handleTransitionEnd=function(t){var e=Ie.OPENING,i=Ie.CLOSING,r=Ie.OPEN,n=Ie.ANIMATE,o=Ie.ROOT;this.isElement(t.target)&&this.adapter.elementHasClass(t.target,o)&&(this.isClosing()?(this.adapter.removeClass(r),this.closed(),this.adapter.restoreFocus(),this.adapter.notifyClose()):(this.adapter.focusActiveNavigationItem(),this.opened(),this.adapter.notifyOpen()),this.adapter.removeClass(n),this.adapter.removeClass(e),this.adapter.removeClass(i))},r.prototype.opened=function(){},r.prototype.closed=function(){},r.prototype.runNextAnimationFrame=function(t){var e=this;cancelAnimationFrame(this.animationFrame),this.animationFrame=requestAnimationFrame((function(){e.animationFrame=0,clearTimeout(e.animationTimer),e.animationTimer=setTimeout(t,0)}))},r.prototype.isElement=function(t){return Boolean(t.classList)},r}(Oe),Le=Pe,$e=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return e(i,t),i.prototype.handleScrimClick=function(){this.close()},i.prototype.opened=function(){this.adapter.trapFocus()},i.prototype.closed=function(){this.adapter.releaseFocus()},i}(Pe);
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
const Ne=t=>t.nodeType===Node.ELEMENT_NODE;function Be(t){return{addClass:e=>{t.classList.add(e)},removeClass:e=>{t.classList.remove(e)},hasClass:e=>t.classList.contains(e)}}let De=!1;const je=()=>{},ze={get passive(){return De=!0,!1}};document.addEventListener("x",je,ze),document.removeEventListener("x",je);const Fe=De,Ue=(t=window.document)=>{let e=t.activeElement;const i=[];if(!e)return i;for(;e&&(i.push(e),e.shadowRoot);)e=e.shadowRoot.activeElement;return i},qe=t=>{const e=Ue();if(!e.length)return!1;const i=e[e.length-1],r=new Event("check-if-focused",{bubbles:!0,composed:!0});let n=[];const o=t=>{n=t.composedPath()};return document.body.addEventListener("check-if-focused",o),i.dispatchEvent(r),document.body.removeEventListener("check-if-focused",o),-1!==n.indexOf(t)};
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class He extends vt{click(){if(this.mdcRoot)return this.mdcRoot.focus(),void this.mdcRoot.click();super.click()}createFoundation(){void 0!==this.mdcFoundation&&this.mdcFoundation.destroy(),this.mdcFoundationClass&&(this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init())}firstUpdated(){this.createFoundation()}}
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Ve=t=>(e,i)=>{if(e.constructor._observers){if(!e.constructor.hasOwnProperty("_observers")){const t=e.constructor._observers;e.constructor._observers=new Map,t.forEach(((t,i)=>e.constructor._observers.set(i,t)))}}else{e.constructor._observers=new Map;const t=e.updated;e.updated=function(e){t.call(this,e),e.forEach(((t,e)=>{const i=this.constructor._observers.get(e);void 0!==i&&i.call(this,this[e],t)}))}}e.constructor._observers.set(i,t)}
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */,We=qt(class extends Ht{constructor(t){var e;if(super(t),t.type!==jt||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var i,r;if(void 0===this.et){this.et=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(i=this.st)||void 0===i?void 0:i.has(t))&&this.et.add(t);return this.render(e)}const n=t.element.classList;this.et.forEach((t=>{t in e||(n.remove(t),this.et.delete(t))}));for(const t in e){const i=!!e[t];i===this.et.has(t)||(null===(r=this.st)||void 0===r?void 0:r.has(t))||(i?(n.add(t),this.et.add(t)):(n.remove(t),this.et.delete(t)))}return j}}),Ge=document.$blockingElements;class Ke extends He{constructor(){super(...arguments),this._previousFocus=null,this.open=!1,this.hasHeader=!1,this.type=""}get mdcFoundationClass(){return"modal"===this.type?$e:Le}createAdapter(){return Object.assign(Object.assign({},Be(this.mdcRoot)),{elementHasClass:(t,e)=>t.classList.contains(e),saveFocus:()=>{this._previousFocus=this.getRootNode().activeElement},restoreFocus:()=>{this._previousFocus&&this._previousFocus.focus&&this._previousFocus.focus()},notifyClose:()=>{this.open=!1,this.dispatchEvent(new Event(Ce.CLOSE_EVENT,{bubbles:!0,cancelable:!0}))},notifyOpen:()=>{this.open=!0,this.dispatchEvent(new Event(Ce.OPEN_EVENT,{bubbles:!0,cancelable:!0}))},focusActiveNavigationItem:()=>{},trapFocus:()=>{Ge.push(this),this.appContent.inert=!0},releaseFocus:()=>{Ge.remove(this),this.appContent.inert=!1}})}_handleScrimClick(){this.mdcFoundation instanceof $e&&this.mdcFoundation.handleScrimClick()}render(){const t="dismissible"===this.type||"modal"===this.type,e="modal"===this.type,i=this.hasHeader?D`
      <div class="mdc-drawer__header">
        <h3 class="mdc-drawer__title"><slot name="title"></slot></h3>
        <h6 class="mdc-drawer__subtitle"><slot name="subtitle"></slot></h6>
        <slot name="header"></slot>
      </div>
      `:"";return D`
      <aside class="mdc-drawer ${We({"mdc-drawer--dismissible":t,"mdc-drawer--modal":e})}">
        ${i}
        <div class="mdc-drawer__content"><slot></slot></div>
      </aside>
      ${e?D`<div class="mdc-drawer-scrim"
                          @click="${this._handleScrimClick}"></div>`:""}
      <div class="mdc-drawer-app-content">
        <slot name="appContent"></slot>
      </div>
      `}firstUpdated(){this.mdcRoot.addEventListener("keydown",(t=>this.mdcFoundation.handleKeydown(t))),this.mdcRoot.addEventListener("transitionend",(t=>this.mdcFoundation.handleTransitionEnd(t)))}updated(t){t.has("type")&&this.createFoundation()}}r([Et(".mdc-drawer")],Ke.prototype,"mdcRoot",void 0),r([Et(".mdc-drawer-app-content")],Ke.prototype,"appContent",void 0),r([Ve((function(t){""!==this.type&&(t?this.mdcFoundation.open():this.mdcFoundation.close())})),xt({type:Boolean,reflect:!0})],Ke.prototype,"open",void 0),r([xt({type:Boolean})],Ke.prototype,"hasHeader",void 0),r([xt({reflect:!0})],Ke.prototype,"type",void 0);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const Xe=at`.mdc-drawer{border-color:rgba(0, 0, 0, 0.12);background-color:#fff;background-color:var(--mdc-theme-surface, #fff);border-top-left-radius:0;border-top-right-radius:0;border-top-right-radius:var(--mdc-shape-large, 0);border-bottom-right-radius:0;border-bottom-right-radius:var(--mdc-shape-large, 0);border-bottom-left-radius:0;z-index:6;width:256px;display:flex;flex-direction:column;flex-shrink:0;box-sizing:border-box;height:100%;border-right-width:1px;border-right-style:solid;overflow:hidden;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.mdc-drawer .mdc-drawer__title{color:rgba(0, 0, 0, 0.87)}.mdc-drawer .mdc-deprecated-list-group__subheader{color:rgba(0, 0, 0, 0.6)}.mdc-drawer .mdc-drawer__subtitle{color:rgba(0, 0, 0, 0.6)}.mdc-drawer .mdc-deprecated-list-item__graphic{color:rgba(0, 0, 0, 0.6)}.mdc-drawer .mdc-deprecated-list-item{color:rgba(0, 0, 0, 0.87)}.mdc-drawer .mdc-deprecated-list-item--activated .mdc-deprecated-list-item__graphic{color:#6200ee}.mdc-drawer .mdc-deprecated-list-item--activated{color:rgba(98, 0, 238, 0.87)}[dir=rtl] .mdc-drawer,.mdc-drawer[dir=rtl]{border-top-left-radius:0;border-top-left-radius:var(--mdc-shape-large, 0);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;border-bottom-left-radius:var(--mdc-shape-large, 0)}.mdc-drawer .mdc-deprecated-list-item{border-radius:4px;border-radius:var(--mdc-shape-small, 4px)}.mdc-drawer.mdc-drawer--open:not(.mdc-drawer--closing)+.mdc-drawer-app-content{margin-left:256px;margin-right:0}[dir=rtl] .mdc-drawer.mdc-drawer--open:not(.mdc-drawer--closing)+.mdc-drawer-app-content,.mdc-drawer.mdc-drawer--open:not(.mdc-drawer--closing)+.mdc-drawer-app-content[dir=rtl]{margin-left:0;margin-right:256px}[dir=rtl] .mdc-drawer,.mdc-drawer[dir=rtl]{border-right-width:0;border-left-width:1px;border-right-style:none;border-left-style:solid}.mdc-drawer .mdc-deprecated-list-item{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-subtitle2-font-size, 0.875rem);line-height:1.375rem;line-height:var(--mdc-typography-subtitle2-line-height, 1.375rem);font-weight:500;font-weight:var(--mdc-typography-subtitle2-font-weight, 500);letter-spacing:0.0071428571em;letter-spacing:var(--mdc-typography-subtitle2-letter-spacing, 0.0071428571em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle2-text-transform, inherit);height:calc(48px - 2 * 4px);margin:8px 8px;padding:0 8px}.mdc-drawer .mdc-deprecated-list-item:nth-child(1){margin-top:2px}.mdc-drawer .mdc-deprecated-list-item:nth-last-child(1){margin-bottom:0}.mdc-drawer .mdc-deprecated-list-group__subheader{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-body2-font-size, 0.875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight, 400);letter-spacing:0.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, 0.0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform, inherit);display:block;margin-top:0;line-height:normal;margin:0;padding:0 16px}.mdc-drawer .mdc-deprecated-list-group__subheader::before{display:inline-block;width:0;height:24px;content:"";vertical-align:0}.mdc-drawer .mdc-deprecated-list-divider{margin:3px 0 4px}.mdc-drawer .mdc-deprecated-list-item__text,.mdc-drawer .mdc-deprecated-list-item__graphic{pointer-events:none}.mdc-drawer--animate{transform:translateX(-100%)}[dir=rtl] .mdc-drawer--animate,.mdc-drawer--animate[dir=rtl]{transform:translateX(100%)}.mdc-drawer--opening{transform:translateX(0);transition-duration:250ms}[dir=rtl] .mdc-drawer--opening,.mdc-drawer--opening[dir=rtl]{transform:translateX(0)}.mdc-drawer--closing{transform:translateX(-100%);transition-duration:200ms}[dir=rtl] .mdc-drawer--closing,.mdc-drawer--closing[dir=rtl]{transform:translateX(100%)}.mdc-drawer__header{flex-shrink:0;box-sizing:border-box;min-height:64px;padding:0 16px 4px}.mdc-drawer__title{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-headline6-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1.25rem;font-size:var(--mdc-typography-headline6-font-size, 1.25rem);line-height:2rem;line-height:var(--mdc-typography-headline6-line-height, 2rem);font-weight:500;font-weight:var(--mdc-typography-headline6-font-weight, 500);letter-spacing:0.0125em;letter-spacing:var(--mdc-typography-headline6-letter-spacing, 0.0125em);text-decoration:inherit;text-decoration:var(--mdc-typography-headline6-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-headline6-text-transform, inherit);display:block;margin-top:0;line-height:normal;margin-bottom:-20px}.mdc-drawer__title::before{display:inline-block;width:0;height:36px;content:"";vertical-align:0}.mdc-drawer__title::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-drawer__subtitle{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-body2-font-size, 0.875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight, 400);letter-spacing:0.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, 0.0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform, inherit);display:block;margin-top:0;line-height:normal;margin-bottom:0}.mdc-drawer__subtitle::before{display:inline-block;width:0;height:20px;content:"";vertical-align:0}.mdc-drawer__content{height:100%;overflow-y:auto;-webkit-overflow-scrolling:touch}.mdc-drawer--dismissible{left:0;right:initial;display:none;position:absolute}[dir=rtl] .mdc-drawer--dismissible,.mdc-drawer--dismissible[dir=rtl]{left:initial;right:0}.mdc-drawer--dismissible.mdc-drawer--open{display:flex}.mdc-drawer-app-content{margin-left:0;margin-right:0;position:relative}[dir=rtl] .mdc-drawer-app-content,.mdc-drawer-app-content[dir=rtl]{margin-left:0;margin-right:0}.mdc-drawer--modal{box-shadow:0px 8px 10px -5px rgba(0, 0, 0, 0.2),0px 16px 24px 2px rgba(0, 0, 0, 0.14),0px 6px 30px 5px rgba(0,0,0,.12);left:0;right:initial;display:none;position:fixed}.mdc-drawer--modal+.mdc-drawer-scrim{background-color:rgba(0, 0, 0, 0.32)}[dir=rtl] .mdc-drawer--modal,.mdc-drawer--modal[dir=rtl]{left:initial;right:0}.mdc-drawer--modal.mdc-drawer--open{display:flex}.mdc-drawer-scrim{display:none;position:fixed;top:0;left:0;width:100%;height:100%;z-index:5;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.mdc-drawer--open+.mdc-drawer-scrim{display:block}.mdc-drawer--animate+.mdc-drawer-scrim{opacity:0}.mdc-drawer--opening+.mdc-drawer-scrim{transition-duration:250ms;opacity:1}.mdc-drawer--closing+.mdc-drawer-scrim{transition-duration:200ms;opacity:0}.mdc-drawer-app-content{overflow:auto;flex:1}:host{display:flex;height:100%}.mdc-drawer{width:256px;width:var(--mdc-drawer-width, 256px)}.mdc-drawer.mdc-drawer--open:not(.mdc-drawer--closing)+.mdc-drawer-app-content{margin-left:256px;margin-left:var(--mdc-drawer-width, 256px);margin-right:0}[dir=rtl] .mdc-drawer.mdc-drawer--open:not(.mdc-drawer--closing)+.mdc-drawer-app-content,.mdc-drawer.mdc-drawer--open:not(.mdc-drawer--closing)+.mdc-drawer-app-content[dir=rtl]{margin-left:0;margin-right:256px;margin-right:var(--mdc-drawer-width, 256px)}`;let Ye=class extends Ke{static get styles(){return[Xe,at`
    .mdc-drawer {
      background-color: var(--mdc-drawer-background-color, '#ffffff');
      width: var(--mdc-drawer-width, 256px);
      border-left: var(--mdc-drawer-border-left, 1px solid rgba(0,0,0,0.12));
      border-right:var(--mdc-drawer-border-right, 1px solid rgba(0,0,0,0.12));
    }
    .mdc-drawer.mdc-drawer--open:not(.mdc-drawer--closing) + .mdc-drawer-app-content {
      margin-left: var(--mdc-drawer-width, 256px)!important;
      width: calc(100% - var(--mdc-drawer-width, 256px));
    }`]}};Ye=r([Ee("mwc-drawer")],Ye);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const Ze=at`.mdc-top-app-bar{background-color:#6200ee;background-color:var(--mdc-theme-primary, #6200ee);color:white;display:flex;position:fixed;flex-direction:column;justify-content:space-between;box-sizing:border-box;width:100%;z-index:4}.mdc-top-app-bar .mdc-top-app-bar__action-item,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon{color:#fff;color:var(--mdc-theme-on-primary, #fff)}.mdc-top-app-bar .mdc-top-app-bar__action-item::before,.mdc-top-app-bar .mdc-top-app-bar__action-item::after,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon::before,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon::after{background-color:#fff;background-color:var(--mdc-ripple-color, var(--mdc-theme-on-primary, #fff))}.mdc-top-app-bar .mdc-top-app-bar__action-item:hover::before,.mdc-top-app-bar .mdc-top-app-bar__action-item.mdc-ripple-surface--hover::before,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon:hover::before,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon.mdc-ripple-surface--hover::before{opacity:0.08;opacity:var(--mdc-ripple-hover-opacity, 0.08)}.mdc-top-app-bar .mdc-top-app-bar__action-item.mdc-ripple-upgraded--background-focused::before,.mdc-top-app-bar .mdc-top-app-bar__action-item:not(.mdc-ripple-upgraded):focus::before,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon.mdc-ripple-upgraded--background-focused::before,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-top-app-bar .mdc-top-app-bar__action-item:not(.mdc-ripple-upgraded)::after,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-top-app-bar .mdc-top-app-bar__action-item:not(.mdc-ripple-upgraded):active::after,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-top-app-bar .mdc-top-app-bar__action-item.mdc-ripple-upgraded,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-top-app-bar__row{display:flex;position:relative;box-sizing:border-box;width:100%;height:64px}.mdc-top-app-bar__section{display:inline-flex;flex:1 1 auto;align-items:center;min-width:0;padding:8px 12px;z-index:1}.mdc-top-app-bar__section--align-start{justify-content:flex-start;order:-1}.mdc-top-app-bar__section--align-end{justify-content:flex-end;order:1}.mdc-top-app-bar__title{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-headline6-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1.25rem;font-size:var(--mdc-typography-headline6-font-size, 1.25rem);line-height:2rem;line-height:var(--mdc-typography-headline6-line-height, 2rem);font-weight:500;font-weight:var(--mdc-typography-headline6-font-weight, 500);letter-spacing:0.0125em;letter-spacing:var(--mdc-typography-headline6-letter-spacing, 0.0125em);text-decoration:inherit;text-decoration:var(--mdc-typography-headline6-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-headline6-text-transform, inherit);padding-left:20px;padding-right:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;z-index:1}[dir=rtl] .mdc-top-app-bar__title,.mdc-top-app-bar__title[dir=rtl]{padding-left:0;padding-right:20px}.mdc-top-app-bar--short-collapsed{border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:24px;border-bottom-left-radius:0}[dir=rtl] .mdc-top-app-bar--short-collapsed,.mdc-top-app-bar--short-collapsed[dir=rtl]{border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:24px}.mdc-top-app-bar--short{top:0;right:auto;left:0;width:100%;transition:width 250ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl] .mdc-top-app-bar--short,.mdc-top-app-bar--short[dir=rtl]{right:0;left:auto}.mdc-top-app-bar--short .mdc-top-app-bar__row{height:56px}.mdc-top-app-bar--short .mdc-top-app-bar__section{padding:4px}.mdc-top-app-bar--short .mdc-top-app-bar__title{transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.mdc-top-app-bar--short-collapsed{box-shadow:0px 2px 4px -1px rgba(0, 0, 0, 0.2),0px 4px 5px 0px rgba(0, 0, 0, 0.14),0px 1px 10px 0px rgba(0,0,0,.12);width:56px;transition:width 300ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-top-app-bar--short-collapsed .mdc-top-app-bar__title{display:none}.mdc-top-app-bar--short-collapsed .mdc-top-app-bar__action-item{transition:padding 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-top-app-bar--short-collapsed.mdc-top-app-bar--short-has-action-item{width:112px}.mdc-top-app-bar--short-collapsed.mdc-top-app-bar--short-has-action-item .mdc-top-app-bar__section--align-end{padding-left:0;padding-right:12px}[dir=rtl] .mdc-top-app-bar--short-collapsed.mdc-top-app-bar--short-has-action-item .mdc-top-app-bar__section--align-end,.mdc-top-app-bar--short-collapsed.mdc-top-app-bar--short-has-action-item .mdc-top-app-bar__section--align-end[dir=rtl]{padding-left:12px;padding-right:0}.mdc-top-app-bar--dense .mdc-top-app-bar__row{height:48px}.mdc-top-app-bar--dense .mdc-top-app-bar__section{padding:0 4px}.mdc-top-app-bar--dense .mdc-top-app-bar__title{padding-left:12px;padding-right:0}[dir=rtl] .mdc-top-app-bar--dense .mdc-top-app-bar__title,.mdc-top-app-bar--dense .mdc-top-app-bar__title[dir=rtl]{padding-left:0;padding-right:12px}.mdc-top-app-bar--prominent .mdc-top-app-bar__row{height:128px}.mdc-top-app-bar--prominent .mdc-top-app-bar__title{align-self:flex-end;padding-bottom:2px}.mdc-top-app-bar--prominent .mdc-top-app-bar__action-item,.mdc-top-app-bar--prominent .mdc-top-app-bar__navigation-icon{align-self:flex-start}.mdc-top-app-bar--fixed{transition:box-shadow 200ms linear}.mdc-top-app-bar--fixed-scrolled{box-shadow:0px 2px 4px -1px rgba(0, 0, 0, 0.2),0px 4px 5px 0px rgba(0, 0, 0, 0.14),0px 1px 10px 0px rgba(0,0,0,.12);transition:box-shadow 200ms linear}.mdc-top-app-bar--dense.mdc-top-app-bar--prominent .mdc-top-app-bar__row{height:96px}.mdc-top-app-bar--dense.mdc-top-app-bar--prominent .mdc-top-app-bar__section{padding:0 12px}.mdc-top-app-bar--dense.mdc-top-app-bar--prominent .mdc-top-app-bar__title{padding-left:20px;padding-right:0;padding-bottom:9px}[dir=rtl] .mdc-top-app-bar--dense.mdc-top-app-bar--prominent .mdc-top-app-bar__title,.mdc-top-app-bar--dense.mdc-top-app-bar--prominent .mdc-top-app-bar__title[dir=rtl]{padding-left:0;padding-right:20px}.mdc-top-app-bar--fixed-adjust{padding-top:64px}.mdc-top-app-bar--dense-fixed-adjust{padding-top:48px}.mdc-top-app-bar--short-fixed-adjust{padding-top:56px}.mdc-top-app-bar--prominent-fixed-adjust{padding-top:128px}.mdc-top-app-bar--dense-prominent-fixed-adjust{padding-top:96px}@media(max-width: 599px){.mdc-top-app-bar__row{height:56px}.mdc-top-app-bar__section{padding:4px}.mdc-top-app-bar--short{transition:width 200ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-top-app-bar--short-collapsed{transition:width 250ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-top-app-bar--short-collapsed .mdc-top-app-bar__section--align-end{padding-left:0;padding-right:12px}[dir=rtl] .mdc-top-app-bar--short-collapsed .mdc-top-app-bar__section--align-end,.mdc-top-app-bar--short-collapsed .mdc-top-app-bar__section--align-end[dir=rtl]{padding-left:12px;padding-right:0}.mdc-top-app-bar--prominent .mdc-top-app-bar__title{padding-bottom:6px}.mdc-top-app-bar--fixed-adjust{padding-top:56px}}:host{display:block}.mdc-top-app-bar{color:#fff;color:var(--mdc-theme-on-primary, #fff);width:100%;width:var(--mdc-top-app-bar-width, 100%)}.mdc-top-app-bar--prominent #navigation ::slotted(*),.mdc-top-app-bar--prominent #actions ::slotted(*){align-self:flex-start}#navigation ::slotted(*),#actions ::slotted(*){--mdc-icon-button-ripple-opacity: 0.24}.mdc-top-app-bar--short-collapsed #actions ::slotted(*){transition:padding 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-top-app-bar__section--align-center{justify-content:center}.mdc-top-app-bar__section--align-center .mdc-top-app-bar__title{padding-left:0;padding-right:0}.center-title .mdc-top-app-bar__section--align-start,.center-title .mdc-top-app-bar__section--align-end{flex-basis:0}.mdc-top-app-bar--dense.mdc-top-app-bar--prominent .mdc-top-app-bar__section--align-center .mdc-top-app-bar__title{padding-left:0;padding-right:0}.mdc-top-app-bar--fixed-scrolled{box-shadow:var(--mdc-top-app-bar-fixed-box-shadow, 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12))}`
/**
 @license
 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
 This code may only be used under the BSD style license found at
 http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
 http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
 found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
 part of the polymer project is also subject to an additional IP rights grant
 found at http://polymer.github.io/PATENTS.txt

 Modified for Backend.AI Console Project / Lit-element with TypeScript
 */,Je=[at`
    :host > *, html {
      /* Material Design color palette for Google products */
      --google-red-100: #f4c7c3;
      --google-red-300: #e67c73;
      --google-red-500: #db4437;
      --google-red-700: #c53929;

      --google-blue-100: #c6dafc;
      --google-blue-300: #7baaf7;
      --google-blue-500: #4285f4;
      --google-blue-700: #3367d6;

      --google-green-100: #b7e1cd;
      --google-green-300: #57bb8a;
      --google-green-500: #0f9d58;
      --google-green-700: #0b8043;

      --google-yellow-100: #fce8b2;
      --google-yellow-300: #f7cb4d;
      --google-yellow-500: #f4b400;
      --google-yellow-700: #f09300;

      --google-grey-100: #f5f5f5;
      --google-grey-300: #e0e0e0;
      --google-grey-500: #9e9e9e;
      --google-grey-700: #616161;

      /* Material Design color palette from online spec document */

      --paper-red-50: #ffebee;
      --paper-red-100: #ffcdd2;
      --paper-red-200: #ef9a9a;
      --paper-red-300: #e57373;
      --paper-red-400: #ef5350;
      --paper-red-500: #f44336;
      --paper-red-600: #e53935;
      --paper-red-700: #d32f2f;
      --paper-red-800: #c62828;
      --paper-red-900: #b71c1c;
      --paper-red-a100: #ff8a80;
      --paper-red-a200: #ff5252;
      --paper-red-a400: #ff1744;
      --paper-red-a700: #d50000;

      --paper-pink-50: #fce4ec;
      --paper-pink-100: #f8bbd0;
      --paper-pink-200: #f48fb1;
      --paper-pink-300: #f06292;
      --paper-pink-400: #ec407a;
      --paper-pink-500: #e91e63;
      --paper-pink-600: #d81b60;
      --paper-pink-700: #c2185b;
      --paper-pink-800: #ad1457;
      --paper-pink-900: #880e4f;
      --paper-pink-a100: #ff80ab;
      --paper-pink-a200: #ff4081;
      --paper-pink-a400: #f50057;
      --paper-pink-a700: #c51162;

      --paper-purple-50: #f3e5f5;
      --paper-purple-100: #e1bee7;
      --paper-purple-200: #ce93d8;
      --paper-purple-300: #ba68c8;
      --paper-purple-400: #ab47bc;
      --paper-purple-500: #9c27b0;
      --paper-purple-600: #8e24aa;
      --paper-purple-700: #7b1fa2;
      --paper-purple-800: #6a1b9a;
      --paper-purple-900: #4a148c;
      --paper-purple-a100: #ea80fc;
      --paper-purple-a200: #e040fb;
      --paper-purple-a400: #d500f9;
      --paper-purple-a700: #aa00ff;

      --paper-deep-purple-50: #ede7f6;
      --paper-deep-purple-100: #d1c4e9;
      --paper-deep-purple-200: #b39ddb;
      --paper-deep-purple-300: #9575cd;
      --paper-deep-purple-400: #7e57c2;
      --paper-deep-purple-500: #673ab7;
      --paper-deep-purple-600: #5e35b1;
      --paper-deep-purple-700: #512da8;
      --paper-deep-purple-800: #4527a0;
      --paper-deep-purple-900: #311b92;
      --paper-deep-purple-a100: #b388ff;
      --paper-deep-purple-a200: #7c4dff;
      --paper-deep-purple-a400: #651fff;
      --paper-deep-purple-a700: #6200ea;

      --paper-indigo-50: #e8eaf6;
      --paper-indigo-100: #c5cae9;
      --paper-indigo-200: #9fa8da;
      --paper-indigo-300: #7986cb;
      --paper-indigo-400: #5c6bc0;
      --paper-indigo-500: #3f51b5;
      --paper-indigo-600: #3949ab;
      --paper-indigo-700: #303f9f;
      --paper-indigo-800: #283593;
      --paper-indigo-900: #1a237e;
      --paper-indigo-a100: #8c9eff;
      --paper-indigo-a200: #536dfe;
      --paper-indigo-a400: #3d5afe;
      --paper-indigo-a700: #304ffe;

      --paper-blue-50: #e3f2fd;
      --paper-blue-100: #bbdefb;
      --paper-blue-200: #90caf9;
      --paper-blue-300: #64b5f6;
      --paper-blue-400: #42a5f5;
      --paper-blue-500: #2196f3;
      --paper-blue-600: #1e88e5;
      --paper-blue-700: #1976d2;
      --paper-blue-800: #1565c0;
      --paper-blue-900: #0d47a1;
      --paper-blue-a100: #82b1ff;
      --paper-blue-a200: #448aff;
      --paper-blue-a400: #2979ff;
      --paper-blue-a700: #2962ff;

      --paper-light-blue-50: #e1f5fe;
      --paper-light-blue-100: #b3e5fc;
      --paper-light-blue-200: #81d4fa;
      --paper-light-blue-300: #4fc3f7;
      --paper-light-blue-400: #29b6f6;
      --paper-light-blue-500: #03a9f4;
      --paper-light-blue-600: #039be5;
      --paper-light-blue-700: #0288d1;
      --paper-light-blue-800: #0277bd;
      --paper-light-blue-900: #01579b;
      --paper-light-blue-a100: #80d8ff;
      --paper-light-blue-a200: #40c4ff;
      --paper-light-blue-a400: #00b0ff;
      --paper-light-blue-a700: #0091ea;

      --paper-cyan-50: #e0f7fa;
      --paper-cyan-100: #b2ebf2;
      --paper-cyan-200: #80deea;
      --paper-cyan-300: #4dd0e1;
      --paper-cyan-400: #26c6da;
      --paper-cyan-500: #00bcd4;
      --paper-cyan-600: #00acc1;
      --paper-cyan-700: #0097a7;
      --paper-cyan-800: #00838f;
      --paper-cyan-900: #006064;
      --paper-cyan-a100: #84ffff;
      --paper-cyan-a200: #18ffff;
      --paper-cyan-a400: #00e5ff;
      --paper-cyan-a700: #00b8d4;

      --paper-teal-50: #e0f2f1;
      --paper-teal-100: #b2dfdb;
      --paper-teal-200: #80cbc4;
      --paper-teal-300: #4db6ac;
      --paper-teal-400: #26a69a;
      --paper-teal-500: #009688;
      --paper-teal-600: #00897b;
      --paper-teal-700: #00796b;
      --paper-teal-800: #00695c;
      --paper-teal-900: #004d40;
      --paper-teal-a100: #a7ffeb;
      --paper-teal-a200: #64ffda;
      --paper-teal-a400: #1de9b6;
      --paper-teal-a700: #00bfa5;

      --paper-green-50: #e8f5e9;
      --paper-green-100: #c8e6c9;
      --paper-green-200: #a5d6a7;
      --paper-green-300: #81c784;
      --paper-green-400: #66bb6a;
      --paper-green-500: #4caf50;
      --paper-green-600: #43a047;
      --paper-green-700: #388e3c;
      --paper-green-800: #2e7d32;
      --paper-green-900: #1b5e20;
      --paper-green-a100: #b9f6ca;
      --paper-green-a200: #69f0ae;
      --paper-green-a400: #00e676;
      --paper-green-a700: #00c853;

      --paper-light-green-50: #f1f8e9;
      --paper-light-green-100: #dcedc8;
      --paper-light-green-200: #c5e1a5;
      --paper-light-green-300: #aed581;
      --paper-light-green-400: #9ccc65;
      --paper-light-green-500: #8bc34a;
      --paper-light-green-600: #7cb342;
      --paper-light-green-700: #689f38;
      --paper-light-green-800: #558b2f;
      --paper-light-green-900: #33691e;
      --paper-light-green-a100: #ccff90;
      --paper-light-green-a200: #b2ff59;
      --paper-light-green-a400: #76ff03;
      --paper-light-green-a700: #64dd17;

      --paper-lime-50: #f9fbe7;
      --paper-lime-100: #f0f4c3;
      --paper-lime-200: #e6ee9c;
      --paper-lime-300: #dce775;
      --paper-lime-400: #d4e157;
      --paper-lime-500: #cddc39;
      --paper-lime-600: #c0ca33;
      --paper-lime-700: #afb42b;
      --paper-lime-800: #9e9d24;
      --paper-lime-900: #827717;
      --paper-lime-a100: #f4ff81;
      --paper-lime-a200: #eeff41;
      --paper-lime-a400: #c6ff00;
      --paper-lime-a700: #aeea00;

      --paper-yellow-50: #fffde7;
      --paper-yellow-100: #fff9c4;
      --paper-yellow-200: #fff59d;
      --paper-yellow-300: #fff176;
      --paper-yellow-400: #ffee58;
      --paper-yellow-500: #ffeb3b;
      --paper-yellow-600: #fdd835;
      --paper-yellow-700: #fbc02d;
      --paper-yellow-800: #f9a825;
      --paper-yellow-900: #f57f17;
      --paper-yellow-a100: #ffff8d;
      --paper-yellow-a200: #ffff00;
      --paper-yellow-a400: #ffea00;
      --paper-yellow-a700: #ffd600;

      --paper-amber-50: #fff8e1;
      --paper-amber-100: #ffecb3;
      --paper-amber-200: #ffe082;
      --paper-amber-300: #ffd54f;
      --paper-amber-400: #ffca28;
      --paper-amber-500: #ffc107;
      --paper-amber-600: #ffb300;
      --paper-amber-700: #ffa000;
      --paper-amber-800: #ff8f00;
      --paper-amber-900: #ff6f00;
      --paper-amber-a100: #ffe57f;
      --paper-amber-a200: #ffd740;
      --paper-amber-a400: #ffc400;
      --paper-amber-a700: #ffab00;

      --paper-orange-50: #fff3e0;
      --paper-orange-100: #ffe0b2;
      --paper-orange-200: #ffcc80;
      --paper-orange-300: #ffb74d;
      --paper-orange-400: #ffa726;
      --paper-orange-500: #ff9800;
      --paper-orange-600: #fb8c00;
      --paper-orange-700: #f57c00;
      --paper-orange-800: #ef6c00;
      --paper-orange-900: #e65100;
      --paper-orange-a100: #ffd180;
      --paper-orange-a200: #ffab40;
      --paper-orange-a400: #ff9100;
      --paper-orange-a700: #ff6500;

      --paper-deep-orange-50: #fbe9e7;
      --paper-deep-orange-100: #ffccbc;
      --paper-deep-orange-200: #ffab91;
      --paper-deep-orange-300: #ff8a65;
      --paper-deep-orange-400: #ff7043;
      --paper-deep-orange-500: #ff5722;
      --paper-deep-orange-600: #f4511e;
      --paper-deep-orange-700: #e64a19;
      --paper-deep-orange-800: #d84315;
      --paper-deep-orange-900: #bf360c;
      --paper-deep-orange-a100: #ff9e80;
      --paper-deep-orange-a200: #ff6e40;
      --paper-deep-orange-a400: #ff3d00;
      --paper-deep-orange-a700: #dd2c00;

      --paper-brown-50: #efebe9;
      --paper-brown-100: #d7ccc8;
      --paper-brown-200: #bcaaa4;
      --paper-brown-300: #a1887f;
      --paper-brown-400: #8d6e63;
      --paper-brown-500: #795548;
      --paper-brown-600: #6d4c41;
      --paper-brown-700: #5d4037;
      --paper-brown-800: #4e342e;
      --paper-brown-900: #3e2723;

      --paper-grey-50: #fafafa;
      --paper-grey-100: #f5f5f5;
      --paper-grey-200: #eeeeee;
      --paper-grey-300: #e0e0e0;
      --paper-grey-400: #bdbdbd;
      --paper-grey-500: #9e9e9e;
      --paper-grey-600: #757575;
      --paper-grey-700: #616161;
      --paper-grey-800: #424242;
      --paper-grey-900: #212121;

      --paper-blue-grey-50: #eceff1;
      --paper-blue-grey-100: #cfd8dc;
      --paper-blue-grey-200: #b0bec5;
      --paper-blue-grey-300: #90a4ae;
      --paper-blue-grey-400: #78909c;
      --paper-blue-grey-500: #607d8b;
      --paper-blue-grey-600: #546e7a;
      --paper-blue-grey-700: #455a64;
      --paper-blue-grey-800: #37474f;
      --paper-blue-grey-900: #263238;

      /* opacity for dark text on a light background */
      --dark-divider-opacity: 0.12;
      --dark-disabled-opacity: 0.38; /* or hint text or icon */
      --dark-secondary-opacity: 0.54;
      --dark-primary-opacity: 0.87;

      /* opacity for light text on a dark background */
      --light-divider-opacity: 0.12;
      --light-disabled-opacity: 0.3; /* or hint text or icon */
      --light-secondary-opacity: 0.7;
      --light-primary-opacity: 1.0;
    }
  `,at`
    :host > *, html {
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
      --general-menu-background-color: transparent;
      --general-menu-background-color-less: rgba(255, 255, 255, 0.6);
      --general-menu-background-border: rgba(23, 23, 23, 1);
      --general-menu-background-opacity: 1;
      --general-menu-color-2: #242424;
      --general-menu-color: #efefef;
      --general-navbar-footer-background-color-r: 255;
      --general-navbar-footer-background-color-g: 255;
      --general-navbar-footer-background-color-b: 255;
      --general-navbar-footer-background-color: #2a2c30;
      --general-navbar-footer-background-color-less: rgba(255, 255, 255, 0.6);
      --general-navbar-footer-background-border: rgba(23, 23, 23, 1);
      --general-navbar-footer-background-opacity: 1;
      --general-navbar-footer-color: #424242;
      --general-panel-width: 280px;
      --general-big-panel-width: 560px;
      --general-content-container-width: 980px;
      --general-background-color: rgba(247, 246, 246, 1);
      --general-sidebar-color: #949494;
      --general-sidebar-background-color: #2a2c30;
      --general-sidebar-h3-color: #cccccc;
      --general-sidebar-h3-border-color: 1px solid #444444;
      --general-sidebar-topbar-background-color-3: #383e48;
      --general-sidebar-topbar-background-color-2: rgba(103, 172, 91, 1.00);
      --general-sidebar-topbar-background-color-4: var(--paper-grey-200);
      --general-sidebar-topbar-color-4: #222222;
      --general-sidebar-topbar-background-color: rgba(24, 24, 24, 1);
      --general-sidebar-topbar-color: #efefef;
      --general-sidebar-selected-color: #72EB51; /*var(--paper-green-400);*/
      --general-sidebar-selected-background-color: transparent;
      --general-sidebar-selected-background-gradient-color: transparent;
      --general-sidebar-selected-border-left: 3px solid var(--general-sidebar-selected-color);
      --general-sidebar-footer-color: #777777;
      --general-sidebar-navbar-footer-color: #222222;
      --general-sidebar-item-even-background-color: transparent;
      --general-sidebar-item-odd-background-color: rgba(239, 240, 242, 0.95);
      --general-sidepanel-color: #dddddd;
      --general-sidepanel-background-color: #ffffff; /*rgba(244, 245, 247, 1); rgba(48, 48, 48, 1.0);*/
      --general-tabbar-background-color: var(--general-sidebar-background-color);
      --general-tabbar-tab-disabled-color: var(--general-sidebar-color);
      --general-tabbar-button-color: var(--general-sidebar-selected-color);
      --general-textfield-selected-color: #27824F;
      --general-textfield-idle-color: #27824F;
      --general-dropdown-color: var(--general-sidebar-color);
      --general-checkbox-color: var(--general-textfield-selected-color);
      --general-textarea-color: var(--general-textfield-selected-color);
      --general-textarea-idle-color: var(--general-textfield-selected-color);
      --general-select-color: var(--general-textfield-selected-color);
      --general-select-idle-color: var(--general-textfield-selected-color);
      --general-button-background-color: #27824F;
      --general-button-color: #ffffff;
      --general-switch-off-color: #AAA;
      --general-switch-on-color: #27824F;
      --general-switch-on-background-color: #E3E7D8; 
      --general-slider-color: var(--general-textfield-selected-color);
      --general-dialog-background-color: #ffffff;
      --general-font-family: 'Ubuntu', Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", AppleSDGothic, "Apple SD Gothic Neo", NanumGothic, "NanumGothicOTF", "Nanum Gothic", "Malgun Gothic", sans-serif;
      --general-monospace-font-family: 'Ubuntu Mono', Menlo, Courier, "Courier New", RobotoMono, sans-serif;
      --general-progress-bar-bg: #e8e8e8;
      --general-progress-bar-reserved: linear-gradient(to left, #722cd7, #5c7cfa);
      --general-progress-bar-using: linear-gradient(to left, #18aa7c, #60bb43),
                                       linear-gradient(to left, #722cd7, #5c7cfa);
    }

    body {
      background-color: var(--general-background-color, #fafafa);
      font-family: var(--general-font-family);
      font-weight: 400;
      font-size: 14px;
      color: #222222;
      margin: 0;
      overflow-x: hidden;
      word-break: keep-all;
    }

    [unresolved] {
      background-repeat: no-repeat;
      background-position: 50% 50vh;
      background-color: var(--general-background-color, #fafafa);
    }

    span,
    wl-icon {
      pointer-events: none;
    }

    body,
    .fonts-loaded body {
      font-family: 'Ubuntu', Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Sans KR", "Noto Sans", AppleSDGothic, NanumGothic, "NanumGothicOTF", "Nanum Gothic", "Malgun Gothic", sans-serif;
    }

    section {
      padding: 5px 0;
    }

    a {
      text-decoration: none;
      cursor: pointer;
    }

    fieldset {
      padding: 0;
      border: 0;
    }

    footer {
      bottom: 0;
      text-align: center;
      color: #aaaaaa;
    }

    footer a {
      color: #cccccc !important;
    }

    #content {
      padding: 0;
      margin: 0 auto 5px auto;
    }

    .monospace {
      font-family: var(--general-monospace-font-family);
    }

    .clearfix:after {
      content: ".";
      visibility: hidden;
      display: block;
      height: 0;
      clear: both;
    }

    div.ui-draggable {
      width: 100%;
    }

    .lazyload {
      opacity: 0;
      transform: scale(0.8);
    }

    .lazyloaded {
      opacity: 1;
      transform: scale(1);
      transition: all 400ms;
    }

    .wl-card-title {
      font-weight: 200;
    }

    wl-select {
      --input-font-family: var(--general-font-family);
    }

    ::-webkit-scrollbar {
      max-width: 2px;
      background-color: transparent;
    }

    ::-webkit-scrollbar-thumb {
      border-radius: 6px;
      background-color: #464646;
    }

    .paper-header {
      height: 60px;
      font-size: 16px;
      line-height: 60px;
      padding: 0 10px;
      color: white;
      transition: height 0.2s;
    }

    .paper-header a {
      color: white;
    }

    .paper-header.tall {
      height: 120px;
    }

    .paper-header.medium-tall {
      height: 100px;
      line-height: 50px;
    }

    .cover {
      margin: 60px;
    }

    wl-icon.tiny {
      --icon-size: 12px;
    }

    wl-card,
    div.card {
      display: block;
      background: white;
      box-sizing: border-box;
      padding: 0;
      border-radius: 2px;
    }

    div.item {
      color: #000000;
    }

    #content > wl-card,
    #content > div.card {
      max-width: var(--general-content-container-width, 980px);
    }

    @media screen and (max-width: 399px) {
      wl-card, div.card {
        margin-left: 0;
        margin-right: 0;
      }
    }

    @media screen and (max-width: 449px) {
      #content > wl-card, #content > div.card {
        width: 100%;
      }
    }

    @media screen and (min-width: 450px) {
      #content > wl-card,
      #content > div,
      #content > div.card {
        width: 100%;
        --card-elevation: 0;
        --card-padding: 0;
      }

      #content > wl-card,
      #content > div.card {
        margin: 0 !important;
      }
    }

    @media screen and (max-width: 899px) {
      .item div.layout {
        -ms-flex-pack: center;
        -webkit-justify-content: center;
        justify-content: center;
      }
    }

    wl-button.primary-action[raised] {
      background-image: linear-gradient(to bottom, #69cee0 0%, #38bd73 100%);
      height: 20px;
    }

    mwc-multi-select {
      --mdc-select-min-width: 100px; /* Fallback to apply width */
    }

    mwc-button.primary-action,
    mwc-button.primary-action[outlined],
    mwc-button.primary-action[raised],
    mwc-button.primary-action[unelevated] {
      border-radius: 5px;
      background-image: linear-gradient(to bottom, #69cee0 0%, #38bd73 100%);
      --mdc-theme-primary: transparent; /* gradient-color doesn't work in mwc-button styling */
      --mdc-theme-on-primary: var(--general-button-color);
    }


    mwc-button.operation {
      margin: 0px 5px;
    }

    mwc-icon-button.pagination {
      --mdc-icon-button-size: 30px;
      --mdc-theme-text-disabled-on-light: var(--paper-grey-400);
      color: var(--general-button-background-color);
      box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2);
      border-radius: 5px;
    }

    mwc-icon-button[disabled].pagination {
      background-color: var(--paper-grey-100);
    }

    mwc-list mwc-list-item {
      font-size: 14px;
      font-family: var(--general-font-family);
      --mdc-typography-font-family: var(--general-font-family);
    }

    mwc-switch {
      --mdc-switch-unselected-handle-color: var(--general-switch-off-color);
      --mdc-switch-unselected-track-color: var(--general-switch-on-background-color) !important;
      --mdc-switch-unselected-hover-handle-color: var(--general-switch-off-color);
      --mdc-switch-unselected-hover-track-color: var(--general-switch-on-background-color);
      --mdc-switch-unselected-focus-handle-color: var(--general-switch-off-color);
      --mdc-switch-unselected-focus-track-color: var(--general-switch-on-background-color);
      --mdc-switch-unselected-pressed-handle-color: var(--general-switch-off-color);
      --mdc-switch-unselected-pressed-track-color: var(--general-switch-on-background-color);
      --mdc-switch-selected-handle-color: var(--general-switch-on-color);
      --mdc-switch-selected-track-color: var(--general-switch-on-background-color) !important;
      --mdc-switch-selected-hover-handle-color: var(--general-switch-on-color);
      --mdc-switch-selected-hover-track-color: var(--general-switch-on-background-color);
      --mdc-switch-selected-hover-state-layer-color: var(--general-switch-on-color);
      --mdc-switch-selected-focus-handle-color: var(--general-switch-on-color);
      --mdc-switch-selected-focus-track-color: var(--general-switch-on-background-color);
      --mdc-switch-selected-focus-state-layer-color: var(--general-switch-on-color);
      --mdc-switch-selected-pressed-handle-color: var(--general-switch-on-color);
      --mdc-switch-selected-pressed-track-color: var(--general-switch-on-background-color);
      --mdc-switch-selected-pressed-state-layer-color: var(--general-switch-on-color);
    }

    wl-card p,
    div.card p {
      padding: 10px;
    }

    wl-card > .entry > p,
    div.card > .entry > p {
      padding: 5px;
    }

    wl-card .commands,
    div.card .commands {
      margin: 0;
      border-top: 1px solid #dddddd;
      text-align: left;
    }

    wl-card.item div.items,
    div.card.item div.items {
      padding-bottom: 10px;
    }

    wl-card .commands.float,
    div.card .commands.float {
      border-top: none;
      position: fixed;
      right: 0;
      bottom: 0;
      left: 0;
    }

    .panels wl-card,
    .panels div.card,
    .panels div {
      width: var(--general-panel-width);
    }

    .wide-panels {
      margin: 0 0 10px 0;
    }

    .wide-panels wl-card,
    .wide-panels div.card {
      width: 100%;
      margin: 0 0 16px 0;
    }

    .line {
      margin-bottom: 10px;
      display: -ms-flexbox;
      display: -webkit-flex;
      display: flex;
      -ms-flex-direction: row;
      -webkit-flex-direction: row;
      flex-direction: row;
    }

    .line span {
      margin-left: 24px;
    }

    .line {
      display: inline-block;
      width: auto;
      height: 1px;
      border: 0;
      border-top: 1px solid #ccc;
      margin: 20px;
      padding: 0;
    }

    .resource-line {
      border-bottom: 1px solid #ccc;
      height: 1px;
      width: 60%;
      margin-left: 80px;
      margin-bottom: 10px;
    }

    wl-card > h3,
    div.card > h3 {
      font-size: 20px;
      font-weight: 400;
      padding: 10px 20px;
      margin: 0;
      display: block;
      border-bottom: 1px solid #dddddd;
    }

    wl-card > h3 > .date,
    div.card > h3 > .date {
      font-size: 12px;
      text-align: right;
      color: #888888;
      margin-left: 20px;
    }

    wl-card > h3.blue,
    wl-card > h4.blue,
    div.card > h3.blue,
    div.card > h4.blue {
      border-left: 3px solid var(--paper-light-blue-400);
    }

    wl-card > h3.red,
    wl-card > h4.red,
    div.card > h3.red,
    div.card > h4.red {
      border-left: 3px solid var(--paper-red-400);
    }

    wl-card > h3.green,
    wl-card > h4.green,
    div.card > h3.green,
    div.card > h4.green {
      border-left: 3px solid var(--paper-green-400);
    }

    wl-card > h3.orange,
    wl-card > h4.orange,
    div.card > h3.orange,
    div.card > h4.orange {

      border-left: 3px solid var(--paper-orange-400);
    }

    wl-card > h3.cyan,
    wl-card > h4.cyan,
    div.card > h3.cyan,
    div.card > h4.cyan {

      border-left: 3px solid var(--paper-cyan-400);
    }

    wl-card > h3.lime,
    wl-card > h4.lime,
    div.card > h3.lime,
    div.card > h4.lime {
      border-left: 3px solid var(--paper-lime-400);
    }

    wl-card > h3.pink,
    wl-card > h4.pink,
    div.card > h3.pink,
    div.card > h4.pink {
      border-left: 3px solid var(--paper-pink-400);
    }

    wl-card > h4,
    div.card > h4 {
      font-size: 14px;
      padding: 5px 15px 5px 20px;
      margin: 0 0 10px 0;
      display: block;
      border-bottom: 1px solid #dddddd;
      -ms-flex-pack: justify;
      -webkit-justify-content: space-between;
      justify-content: space-between;
    }

    wl-card .flex
    div.card .flex {
      display: flex;
    }

    wl-card.entries > div,
    div.card.entries > div {
      margin: 20px;
    }

    wl-backdrop {
      --backdrop-bg: rgba(255, 0, 0, 0.3);
      background: rgba(255, 0, 0, 0.3) !important;
    }

    paper-toolbar {
      --paper-toolbar-sm-height: 45px;
    }

    mwc-button, mwc-button[unelevated] {
      background-image: none;
      --mdc-theme-primary: var(--general-button-background-color);
      --mdc-on-theme-primary: var(--general-button-background-color);
      --mdc-typography-font-family: var(--general-font-family);
    }

    mwc-textfield {
      --mdc-text-field-fill-color: transparent;
      --mdc-theme-primary: var(--general-textfield-selected-color);
      --mdc-text-field-hover-line-color: transparent;
      --mdc-text-field-idle-line-color: var(--general-textfield-idle-color);
      --mdc-text-field-fill-color: rgb(250, 250, 250);
      font-family: var(--general-font-family);
      --mdc-typography-font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-size: 14px;
      --mdc-typography-subtitle1-font-color: black;
      --mdc-typography-subtitle1-font-weight: 400;
      --mdc-typography-subtitle1-line-height: 16px;
    }

    mwc-textarea {
      --mdc-text-field-fill-color: transparent;
      --mdc-theme-primary: var(--general-textarea-color);
      --mdc-text-area-outlined-idle-border-color: var(--general-textarea-idle-color);
      font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-size: 14px;
      --mdc-typography-subtitle1-font-color: black;
      --mdc-typography-subtitle1-font-weight: 400;
      --mdc-typography-subtitle1-line-height: 16px;
    }

    mwc-select {
      font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-size: 14px;
      --mdc-typography-subtitle1-font-color: black;
      --mdc-typography-subtitle1-font-weight: 400;
      --mdc-typography-subtitle1-line-height: 16px;
      --mdc-theme-primary: var(--general-select-color);
      --mdc-select-idle-line-color: var(--general-select-idle-color);
      --mdc-select-hover-line-color: var(--general-select-color);
      --mdc-select-outlined-idle-border-color: var(--general-select-idle-color);
      --mdc-select-outlined-hover-border-color: var(--general-select-color);
      --mdc-select-outlined-disabled-border-color: rgba(255, 255, 255, 0.87);
      --mdc-select-fill-color: transparent;
      --mdc-select-disabled-fill-color: transparent;
      --mdc-select-ink-color: black;
      --mdc-select-label-ink-color: black;
      --mdc-select-focused-label-color: rgba(24, 24, 24, 1.0);
      --mdc-select-disabled-ink-color: rgba(255, 255, 255, 1.0);
      --mdc-select-dropdown-icon-color: #747474;
      --mdc-select-focused-dropdown-icon-color: rgba(255, 255, 255, 0.42);
      --mdc-select-disabled-dropdown-icon-color: #747474;
    }

    .bg-blue {
      background-color: var(--paper-light-blue-400);
      --mdc-theme-primary: var(--paper-light-blue-400);
    }

    .bg-red {
      background-color: var(--paper-red-400);
      --mdc-theme-primary: var(--paper-red-400);
    }

    .bg-yellow {
      background-color: var(--paper-yellow-400);
      --mdc-theme-primary: var(--paper-yellow-400);
    }

    .bg-orange {
      background-color: var(--paper-amber-400);
      --mdc-theme-primary: var(--paper-amber-400);
    }

    .bg-green {
      background-color: var(--paper-green-400);
      --mdc-theme-primary: var(--paper-green-400);
    }

    .bg-cyan {
      background-color: var(--paper-cyan-400);
      --mdc-theme-primary: var(--paper-cyan-400);
    }

    .bg-lime {
      background-color: var(--paper-lime-400);
      --mdc-theme-primary: var(--paper-lime-400);
    }

    .bg-pink {
      background-color: var(--paper-pink-a200);
      --mdc-theme-primary: var(--paper-pink-a200);
    }

    .bg-purple {
      background-color: var(--paper-purple-400);
      --mdc-theme-primary: var(--paper-purple-400);
    }

    .white {
      color: #ffffff !important;
    }

    .black {
      color: #222222 !important;
    }

    .fg.black {
      color: #222222;
    }

    .fg.blue {
      color: var(--paper-light-blue-400) !important;
      --mdc-theme-on-primary: var(--paper-light-blue-400) !important;
    }

    .fg.red {
      color: var(--paper-red-400) !important;
      --mdc-theme-on-primary: var(--paper-red-400) !important;
    }

    .fg.yellow {
      color: var(--paper-yellow-400) !important;
      --mdc-theme-on-primary: var(--paper-yellow-400) !important;
    }

    .fg.orange {
      color: var(--paper-amber-400) !important;
      --mdc-theme-on-primary: var(--paper-amber-400) !important;
    }

    .fg.green {
      color: var(--paper-green-400) !important;
      --mdc-theme-on-primary: var(--paper-green-400) !important;
    }

    .fg.teal {
      color: var(--paper-teal-400) !important;
      --mdc-theme-on-primary: var(--paper-teal-400) !important;
    }

    .fg.cyan {
      color: var(--paper-cyan-400) !important;
      --mdc-theme-on-primary: var(--paper-cyan-400) !important;
    }

    .fg.lime {
      color: var(--paper-lime-400) !important;
      --mdc-theme-on-primary: var(--paper-lime-400) !important;
    }

    .fg.pink {
      color: var(--paper-pink-a200) !important;
      --mdc-theme-on-primary: var(--paper-pink-a200) !important;
    }

    .fg.purple {
      color: var(--paper-purple-400) !important;
      --mdc-theme-on-primary: var(--paper-purple-400) !important;
    }

    /* Layout */
    .flex-1-container {
      -ms-flex: 1 1 0.000000001px;
      -webkit-flex: 1;
      flex: 1;
      -webkit-flex-basis: 0.000000001px;
      flex-basis: 0.000000001px;
    }

    .centered {
      max-width: 400px;
      margin-left: auto;
      margin-right: auto;
    }

    .distancing {
      margin: 15px;
    }

    wl-card > h4,
    div.card > h4 {
      font-weight: 200;
    }

    /* Loading spinner */
    #lablup-loading-spinner {
      position: fixed;
      width: 30px;
      height: 30px;
      bottom: 6px;
      left: 6px;
      z-index: 1000;
    }

    /* Tab on head */
    wl-card h3.tab,
    div.card h3.tab {
      padding-top: 0;
      padding-bottom: 0;
      padding-left: 0;
    }

    /* Button */
    wl-button {
      --button-padding: 8px;
      --button-font-size: 14px;
    }

    wl-button.full-size,
    wl-button.full {
      width: 100%;
    }

    wl-button,
    wl-expansion,
    wl-textfield {
      --font-family-serif: var(--general-font-family);
      --font-family-sans-serif: var(--general-font-family);
    }

    lablup-progress-bar {
      --progress-bar-width: 186px;
      --progress-bar-height: 17px;
      --progres-bar-font-family: var(--general-font-family);
      --progress-bar-border-radius: 3px;
      --progress-bar-font-color-inverse: white;
      --progress-bar-font-color: black;
      margin-bottom: 5px;
    }

    lablup-progress-bar.start {
      --progress-bar-background: var(--general-progress-bar-reserved);
    }

    lablup-progress-bar.end {
      --progress-bar-background: var(--general-progress-bar-using);
    }

    div.progress-bar {
      position: relative;
    }

    div.progress-bar > span.gauge-label {
      position: absolute;
      left: 0.5em;
      top: 25%;
      z-index: 1;
      color: #2f2f2f;
    }

    .gauge-label {
      width: inherit;
      font-weight: bold;
      font-size: 10px;
      color: #2f2f2f;
    }

    .gauge-name {
      float: right;
      font-size: 14px;
      font-weight: bold;
      color: #2f2f2f;
    }

    span.percentage {
      font-size: 10px;
      color: #2f2f2f;
    }

    span.start-bar {
      margin-bottom: 5px;
      margin-left: 5px;
      padding-bottom: 5px;
    }

    span.end-bar {
      margin-top: 5px;
      margin-left: 5px;
      padding-bottom: 5px;
    }

    span.helper-text {
      font-size: 0.75rem;
      font-weight: bold;
      color: var(--general-textfield-selected-color);
    }

    .resource-name {
      width: 60px;
      text-align: right;
      display: inline-block !important;
      margin: auto 20px auto 0px;
    }

    .resource-legend-stack {
      margin-bottom: 5px;
    }

    span.resource-legend {
      color: var(--general-sidebar-color);
      margin-right: 5px;
    }

    .resource-legend-icon {
      width:10px;
      height: 10px;
      margin-top: 2px;
      margin-left: 10px;
      margin-right: 3px;
      border-radius: 4px;
    }

    .resource-legend-icon.start {
      background-color: rgba(103, 82, 232, 1);
    }

    .resource-legend-icon.end {
      background-color: rgba(58, 178, 97, 1);
    }

    .resource-legend-icon.total {
      background-color: #E0E0E0;
    }

    .vertical-card {
      margin: 20px;
    }

    vaadin-grid {
      font-family: var(--general-font-family);
    }

    backend-ai-session-launcher#session-launcher {
      --component-color: #ffffff;
      --component-bg: rgb(104, 185, 155);
      --component-bg: linear-gradient(rgba(56,189,115, 0.5), rgba(56,189,115, 0.5)), linear-gradient(to bottom, #69cee0 0%, #38bd73 100%);
      --component-bg-hover: linear-gradient(180deg, rgba(98, 180, 131, 1) 0%, rgba(104, 185, 155, 1) 50%, rgba(93, 178, 113, 1) 100%);
      --component-bg-active: rgb(104, 185, 155);
      --component-shadow-color: #37c995;
    }

    .temporarily-hide {
      display: none !important;
    }
  `];
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var Qe={FIXED_CLASS:"mdc-top-app-bar--fixed",FIXED_SCROLLED_CLASS:"mdc-top-app-bar--fixed-scrolled",SHORT_CLASS:"mdc-top-app-bar--short",SHORT_COLLAPSED_CLASS:"mdc-top-app-bar--short-collapsed",SHORT_HAS_ACTION_ITEM_CLASS:"mdc-top-app-bar--short-has-action-item"},ti={DEBOUNCE_THROTTLE_RESIZE_TIME_MS:100,MAX_TOP_APP_BAR_HEIGHT:128},ei={ACTION_ITEM_SELECTOR:".mdc-top-app-bar__action-item",NAVIGATION_EVENT:"MDCTopAppBar:nav",NAVIGATION_ICON_SELECTOR:".mdc-top-app-bar__navigation-icon",ROOT_SELECTOR:".mdc-top-app-bar",TITLE_SELECTOR:".mdc-top-app-bar__title"},ii=function(t){function r(e){return t.call(this,i(i({},r.defaultAdapter),e))||this}return e(r,t),Object.defineProperty(r,"strings",{get:function(){return ei},enumerable:!1,configurable:!0}),Object.defineProperty(r,"cssClasses",{get:function(){return Qe},enumerable:!1,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return ti},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},getTopAppBarHeight:function(){return 0},notifyNavigationIconClicked:function(){},getViewportScrollY:function(){return 0},getTotalActionItems:function(){return 0}}},enumerable:!1,configurable:!0}),r.prototype.handleTargetScroll=function(){},r.prototype.handleWindowResize=function(){},r.prototype.handleNavigationClick=function(){this.adapter.notifyNavigationIconClicked()},r}(Oe),ri=function(t){function i(e){var i=t.call(this,e)||this;return i.wasDocked=!0,i.isDockedShowing=!0,i.currentAppBarOffsetTop=0,i.isCurrentlyBeingResized=!1,i.resizeThrottleId=0,i.resizeDebounceId=0,i.lastScrollPosition=i.adapter.getViewportScrollY(),i.topAppBarHeight=i.adapter.getTopAppBarHeight(),i}return e(i,t),i.prototype.destroy=function(){t.prototype.destroy.call(this),this.adapter.setStyle("top","")},i.prototype.handleTargetScroll=function(){var t=Math.max(this.adapter.getViewportScrollY(),0),e=t-this.lastScrollPosition;this.lastScrollPosition=t,this.isCurrentlyBeingResized||(this.currentAppBarOffsetTop-=e,this.currentAppBarOffsetTop>0?this.currentAppBarOffsetTop=0:Math.abs(this.currentAppBarOffsetTop)>this.topAppBarHeight&&(this.currentAppBarOffsetTop=-this.topAppBarHeight),this.moveTopAppBar())},i.prototype.handleWindowResize=function(){var t=this;this.resizeThrottleId||(this.resizeThrottleId=setTimeout((function(){t.resizeThrottleId=0,t.throttledResizeHandler()}),ti.DEBOUNCE_THROTTLE_RESIZE_TIME_MS)),this.isCurrentlyBeingResized=!0,this.resizeDebounceId&&clearTimeout(this.resizeDebounceId),this.resizeDebounceId=setTimeout((function(){t.handleTargetScroll(),t.isCurrentlyBeingResized=!1,t.resizeDebounceId=0}),ti.DEBOUNCE_THROTTLE_RESIZE_TIME_MS)},i.prototype.checkForUpdate=function(){var t=-this.topAppBarHeight,e=this.currentAppBarOffsetTop<0,i=this.currentAppBarOffsetTop>t,r=e&&i;if(r)this.wasDocked=!1;else{if(!this.wasDocked)return this.wasDocked=!0,!0;if(this.isDockedShowing!==i)return this.isDockedShowing=i,!0}return r},i.prototype.moveTopAppBar=function(){if(this.checkForUpdate()){var t=this.currentAppBarOffsetTop;Math.abs(t)>=this.topAppBarHeight&&(t=-ti.MAX_TOP_APP_BAR_HEIGHT),this.adapter.setStyle("top",t+"px")}},i.prototype.throttledResizeHandler=function(){var t=this.adapter.getTopAppBarHeight();this.topAppBarHeight!==t&&(this.wasDocked=!1,this.currentAppBarOffsetTop-=this.topAppBarHeight-t,this.topAppBarHeight=t),this.handleTargetScroll()},i}(ii),ni=ri;
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
const oi=Fe?{passive:!0}:void 0;class si extends He{constructor(){super(...arguments),this.centerTitle=!1,this.handleTargetScroll=()=>{this.mdcFoundation.handleTargetScroll()},this.handleNavigationClick=()=>{this.mdcFoundation.handleNavigationClick()}}get scrollTarget(){return this._scrollTarget||window}set scrollTarget(t){this.unregisterScrollListener();const e=this.scrollTarget;this._scrollTarget=t,this.updateRootPosition(),this.requestUpdate("scrollTarget",e),this.registerScrollListener()}updateRootPosition(){if(this.mdcRoot){const t=this.scrollTarget===window;this.mdcRoot.style.position=t?"":"absolute"}}render(){let t=D`<span class="mdc-top-app-bar__title"><slot name="title"></slot></span>`;return this.centerTitle&&(t=D`<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-center">${t}</section>`),D`
      <header class="mdc-top-app-bar ${We(this.barClasses())}">
      <div class="mdc-top-app-bar__row">
        <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start" id="navigation">
          <slot name="navigationIcon"
            @click=${this.handleNavigationClick}></slot>
          ${this.centerTitle?null:t}
        </section>
        ${this.centerTitle?t:null}
        <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end" id="actions" role="toolbar">
          <slot name="actionItems"></slot>
        </section>
      </div>
    </header>
    <div class="${We(this.contentClasses())}">
      <slot></slot>
    </div>
    `}createAdapter(){return Object.assign(Object.assign({},Be(this.mdcRoot)),{setStyle:(t,e)=>this.mdcRoot.style.setProperty(t,e),getTopAppBarHeight:()=>this.mdcRoot.clientHeight,notifyNavigationIconClicked:()=>{this.dispatchEvent(new Event(ei.NAVIGATION_EVENT,{bubbles:!0,cancelable:!0}))},getViewportScrollY:()=>this.scrollTarget instanceof Window?this.scrollTarget.pageYOffset:this.scrollTarget.scrollTop,getTotalActionItems:()=>this._actionItemsSlot.assignedNodes({flatten:!0}).length})}registerListeners(){this.registerScrollListener()}unregisterListeners(){this.unregisterScrollListener()}registerScrollListener(){this.scrollTarget.addEventListener("scroll",this.handleTargetScroll,oi)}unregisterScrollListener(){this.scrollTarget.removeEventListener("scroll",this.handleTargetScroll)}firstUpdated(){super.firstUpdated(),this.updateRootPosition(),this.registerListeners()}disconnectedCallback(){super.disconnectedCallback(),this.unregisterListeners()}}r([Et(".mdc-top-app-bar")],si.prototype,"mdcRoot",void 0),r([Et('slot[name="actionItems"]')],si.prototype,"_actionItemsSlot",void 0),r([xt({type:Boolean})],si.prototype,"centerTitle",void 0),r([xt({type:Object})],si.prototype,"scrollTarget",null);
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class li extends si{constructor(){super(...arguments),this.mdcFoundationClass=ni,this.prominent=!1,this.dense=!1,this.handleResize=()=>{this.mdcFoundation.handleWindowResize()}}barClasses(){return{"mdc-top-app-bar--dense":this.dense,"mdc-top-app-bar--prominent":this.prominent,"center-title":this.centerTitle}}contentClasses(){return{"mdc-top-app-bar--fixed-adjust":!this.dense&&!this.prominent,"mdc-top-app-bar--dense-fixed-adjust":this.dense&&!this.prominent,"mdc-top-app-bar--prominent-fixed-adjust":!this.dense&&this.prominent,"mdc-top-app-bar--dense-prominent-fixed-adjust":this.dense&&this.prominent}}registerListeners(){super.registerListeners(),window.addEventListener("resize",this.handleResize,oi)}unregisterListeners(){super.unregisterListeners(),window.removeEventListener("resize",this.handleResize)}}r([xt({type:Boolean,reflect:!0})],li.prototype,"prominent",void 0),r([xt({type:Boolean,reflect:!0})],li.prototype,"dense",void 0);
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var di=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.wasScrolled=!1,e}return e(i,t),i.prototype.handleTargetScroll=function(){this.adapter.getViewportScrollY()<=0?this.wasScrolled&&(this.adapter.removeClass(Qe.FIXED_SCROLLED_CLASS),this.wasScrolled=!1):this.wasScrolled||(this.adapter.addClass(Qe.FIXED_SCROLLED_CLASS),this.wasScrolled=!0)},i}(ri);
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class ci extends li{constructor(){super(...arguments),this.mdcFoundationClass=di}barClasses(){return Object.assign(Object.assign({},super.barClasses()),{"mdc-top-app-bar--fixed":!0})}registerListeners(){this.scrollTarget.addEventListener("scroll",this.handleTargetScroll,oi)}unregisterListeners(){this.scrollTarget.removeEventListener("scroll",this.handleTargetScroll)}}let hi=class extends ci{static get styles(){return[Ze,Je,at`
        .mdc-top-app-bar {
          width: calc(100% - var(--mdc-drawer-width, 256px));
        }
        .mdc-top-app-bar__title {
          padding-left:0;
        }
        .mdc-top-app-bar--prominent .mdc-top-app-bar__row {
          height: 96px;
        }
        .mdc-top-app-bar--prominent-fixed-adjust {
          padding-top: 96px;
        }

        /* min-width for mobile-view */
        @media screen and (max-width: 375px) {
          .mdc-top-app-bar {
            min-width: 375px !important;
          }
        }
      `]}};hi=r([_t("mwc-top-app-bar-fixed")],hi);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const ui=at`:host{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}`
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;let pi=class extends vt{render(){return D`<span><slot></slot></span>`}};function fi(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */pi.styles=[ui],pi=r([_t("mwc-icon")],pi);var mi={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},gi={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},bi={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var vi=["touchstart","pointerdown","mousedown","keydown"],yi=["touchend","pointerup","mouseup","contextmenu"],_i=[],wi=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.activationAnimationHasEnded=!1,n.activationTimer=0,n.fgDeactivationRemovalTimer=0,n.fgScale="0",n.frame={width:0,height:0},n.initialSize=0,n.layoutFrame=0,n.maxRadius=0,n.unboundedCoords={left:0,top:0},n.activationState=n.defaultActivationState(),n.activationTimerCallback=function(){n.activationAnimationHasEnded=!0,n.runDeactivationUXLogicIfReady()},n.activateHandler=function(t){n.activateImpl(t)},n.deactivateHandler=function(){n.deactivateImpl()},n.focusHandler=function(){n.handleFocus()},n.blurHandler=function(){n.handleBlur()},n.resizeHandler=function(){n.layout()},n}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return mi},enumerable:!1,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return gi},enumerable:!1,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return bi},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!1,configurable:!0}),r.prototype.init=function(){var t=this,e=this.supportsPressRipple();if(this.registerRootHandlers(e),e){var i=r.cssClasses,n=i.ROOT,o=i.UNBOUNDED;requestAnimationFrame((function(){t.adapter.addClass(n),t.adapter.isUnbounded()&&(t.adapter.addClass(o),t.layoutInternal())}))}},r.prototype.destroy=function(){var t=this;if(this.supportsPressRipple()){this.activationTimer&&(clearTimeout(this.activationTimer),this.activationTimer=0,this.adapter.removeClass(r.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer&&(clearTimeout(this.fgDeactivationRemovalTimer),this.fgDeactivationRemovalTimer=0,this.adapter.removeClass(r.cssClasses.FG_DEACTIVATION));var e=r.cssClasses,i=e.ROOT,n=e.UNBOUNDED;requestAnimationFrame((function(){t.adapter.removeClass(i),t.adapter.removeClass(n),t.removeCssVars()}))}this.deregisterRootHandlers(),this.deregisterDeactivationHandlers()},r.prototype.activate=function(t){this.activateImpl(t)},r.prototype.deactivate=function(){this.deactivateImpl()},r.prototype.layout=function(){var t=this;this.layoutFrame&&cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame((function(){t.layoutInternal(),t.layoutFrame=0}))},r.prototype.setUnbounded=function(t){var e=r.cssClasses.UNBOUNDED;t?this.adapter.addClass(e):this.adapter.removeClass(e)},r.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter.addClass(r.cssClasses.BG_FOCUSED)}))},r.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter.removeClass(r.cssClasses.BG_FOCUSED)}))},r.prototype.supportsPressRipple=function(){return this.adapter.browserSupportsCssVars()},r.prototype.defaultActivationState=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},r.prototype.registerRootHandlers=function(t){var e,i;if(t){try{for(var r=o(vi),n=r.next();!n.done;n=r.next()){var a=n.value;this.adapter.registerInteractionHandler(a,this.activateHandler)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler)}this.adapter.registerInteractionHandler("focus",this.focusHandler),this.adapter.registerInteractionHandler("blur",this.blurHandler)},r.prototype.registerDeactivationHandlers=function(t){var e,i;if("keydown"===t.type)this.adapter.registerInteractionHandler("keyup",this.deactivateHandler);else try{for(var r=o(yi),n=r.next();!n.done;n=r.next()){var a=n.value;this.adapter.registerDocumentInteractionHandler(a,this.deactivateHandler)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}},r.prototype.deregisterRootHandlers=function(){var t,e;try{for(var i=o(vi),r=i.next();!r.done;r=i.next()){var n=r.value;this.adapter.deregisterInteractionHandler(n,this.activateHandler)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}this.adapter.deregisterInteractionHandler("focus",this.focusHandler),this.adapter.deregisterInteractionHandler("blur",this.blurHandler),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler)},r.prototype.deregisterDeactivationHandlers=function(){var t,e;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler);try{for(var i=o(yi),r=i.next();!r.done;r=i.next()){var n=r.value;this.adapter.deregisterDocumentInteractionHandler(n,this.deactivateHandler)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},r.prototype.removeCssVars=function(){var t=this,e=r.strings;Object.keys(e).forEach((function(i){0===i.indexOf("VAR_")&&t.adapter.updateCssVariable(e[i],null)}))},r.prototype.activateImpl=function(t){var e=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState;if(!i.isActivated){var r=this.previousActivationEvent;if(!(r&&void 0!==t&&r.type!==t.type))i.isActivated=!0,i.isProgrammatic=void 0===t,i.activationEvent=t,i.wasActivatedByPointer=!i.isProgrammatic&&(void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type)),void 0!==t&&_i.length>0&&_i.some((function(t){return e.adapter.containsEventTarget(t)}))?this.resetActivationState():(void 0!==t&&(_i.push(t.target),this.registerDeactivationHandlers(t)),i.wasElementMadeActive=this.checkElementMadeActive(t),i.wasElementMadeActive&&this.animateActivation(),requestAnimationFrame((function(){_i=[],i.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(i.wasElementMadeActive=e.checkElementMadeActive(t),i.wasElementMadeActive&&e.animateActivation()),i.wasElementMadeActive||(e.activationState=e.defaultActivationState())})))}}},r.prototype.checkElementMadeActive=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},r.prototype.animateActivation=function(){var t=this,e=r.strings,i=e.VAR_FG_TRANSLATE_START,n=e.VAR_FG_TRANSLATE_END,o=r.cssClasses,a=o.FG_DEACTIVATION,s=o.FG_ACTIVATION,l=r.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal();var d="",c="";if(!this.adapter.isUnbounded()){var h=this.getFgTranslationCoordinates(),u=h.startPoint,p=h.endPoint;d=u.x+"px, "+u.y+"px",c=p.x+"px, "+p.y+"px"}this.adapter.updateCssVariable(i,d),this.adapter.updateCssVariable(n,c),clearTimeout(this.activationTimer),clearTimeout(this.fgDeactivationRemovalTimer),this.rmBoundedActivationClasses(),this.adapter.removeClass(a),this.adapter.computeBoundingRect(),this.adapter.addClass(s),this.activationTimer=setTimeout((function(){t.activationTimerCallback()}),l)},r.prototype.getFgTranslationCoordinates=function(){var t,e=this.activationState,i=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,i){if(!t)return{x:0,y:0};var r,n,o=e.x,a=e.y,s=o+i.left,l=a+i.top;if("touchstart"===t.type){var d=t;r=d.changedTouches[0].pageX-s,n=d.changedTouches[0].pageY-l}else{var c=t;r=c.pageX-s,n=c.pageY-l}return{x:r,y:n}}(i,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame.width/2,y:this.frame.height/2}).x-this.initialSize/2,y:t.y-this.initialSize/2},endPoint:{x:this.frame.width/2-this.initialSize/2,y:this.frame.height/2-this.initialSize/2}}},r.prototype.runDeactivationUXLogicIfReady=function(){var t=this,e=r.cssClasses.FG_DEACTIVATION,i=this.activationState,n=i.hasDeactivationUXRun,o=i.isActivated;(n||!o)&&this.activationAnimationHasEnded&&(this.rmBoundedActivationClasses(),this.adapter.addClass(e),this.fgDeactivationRemovalTimer=setTimeout((function(){t.adapter.removeClass(e)}),bi.FG_DEACTIVATION_MS))},r.prototype.rmBoundedActivationClasses=function(){var t=r.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded=!1,this.adapter.computeBoundingRect()},r.prototype.resetActivationState=function(){var t=this;this.previousActivationEvent=this.activationState.activationEvent,this.activationState=this.defaultActivationState(),setTimeout((function(){return t.previousActivationEvent=void 0}),r.numbers.TAP_DELAY_MS)},r.prototype.deactivateImpl=function(){var t=this,e=this.activationState;if(e.isActivated){var r=i({},e);e.isProgrammatic?(requestAnimationFrame((function(){t.animateDeactivation(r)})),this.resetActivationState()):(this.deregisterDeactivationHandlers(),requestAnimationFrame((function(){t.activationState.hasDeactivationUXRun=!0,t.animateDeactivation(r),t.resetActivationState()})))}},r.prototype.animateDeactivation=function(t){var e=t.wasActivatedByPointer,i=t.wasElementMadeActive;(e||i)&&this.runDeactivationUXLogicIfReady()},r.prototype.layoutInternal=function(){var t=this;this.frame=this.adapter.computeBoundingRect();var e=Math.max(this.frame.height,this.frame.width);this.maxRadius=this.adapter.isUnbounded()?e:Math.sqrt(Math.pow(t.frame.width,2)+Math.pow(t.frame.height,2))+r.numbers.PADDING;var i=Math.floor(e*r.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&i%2!=0?this.initialSize=i-1:this.initialSize=i,this.fgScale=""+this.maxRadius/this.initialSize,this.updateLayoutCssVars()},r.prototype.updateLayoutCssVars=function(){var t=r.strings,e=t.VAR_FG_SIZE,i=t.VAR_LEFT,n=t.VAR_TOP,o=t.VAR_FG_SCALE;this.adapter.updateCssVariable(e,this.initialSize+"px"),this.adapter.updateCssVariable(o,this.fgScale),this.adapter.isUnbounded()&&(this.unboundedCoords={left:Math.round(this.frame.width/2-this.initialSize/2),top:Math.round(this.frame.height/2-this.initialSize/2)},this.adapter.updateCssVariable(i,this.unboundedCoords.left+"px"),this.adapter.updateCssVariable(n,this.unboundedCoords.top+"px"))},r}(Oe);
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const xi=qt(class extends Ht{constructor(t){var e;if(super(t),t.type!==jt||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const r=t[i];return null==r?e:e+`${i=i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ct){this.ct=new Set;for(const t in e)this.ct.add(t);return this.render(e)}this.ct.forEach((t=>{null==e[t]&&(this.ct.delete(t),t.includes("-")?i.removeProperty(t):i[t]="")}));for(const t in e){const r=e[t];null!=r&&(this.ct.add(t),t.includes("-")?i.setProperty(t,r):i[t]=r)}return j}});
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Mi extends He{constructor(){super(...arguments),this.primary=!1,this.accent=!1,this.unbounded=!1,this.disabled=!1,this.activated=!1,this.selected=!1,this.internalUseStateLayerCustomProperties=!1,this.hovering=!1,this.bgFocused=!1,this.fgActivation=!1,this.fgDeactivation=!1,this.fgScale="",this.fgSize="",this.translateStart="",this.translateEnd="",this.leftPos="",this.topPos="",this.mdcFoundationClass=wi}get isActive(){return fi(this.parentElement||this,":active")}createAdapter(){return{browserSupportsCssVars:()=>!0,isUnbounded:()=>this.unbounded,isSurfaceActive:()=>this.isActive,isSurfaceDisabled:()=>this.disabled,addClass:t=>{switch(t){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!0;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!0;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!0}},removeClass:t=>{switch(t){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!1;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!1;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!1}},containsEventTarget:()=>!0,registerInteractionHandler:()=>{},deregisterInteractionHandler:()=>{},registerDocumentInteractionHandler:()=>{},deregisterDocumentInteractionHandler:()=>{},registerResizeHandler:()=>{},deregisterResizeHandler:()=>{},updateCssVariable:(t,e)=>{switch(t){case"--mdc-ripple-fg-scale":this.fgScale=e;break;case"--mdc-ripple-fg-size":this.fgSize=e;break;case"--mdc-ripple-fg-translate-end":this.translateEnd=e;break;case"--mdc-ripple-fg-translate-start":this.translateStart=e;break;case"--mdc-ripple-left":this.leftPos=e;break;case"--mdc-ripple-top":this.topPos=e}},computeBoundingRect:()=>(this.parentElement||this).getBoundingClientRect(),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset})}}startPress(t){this.waitForFoundation((()=>{this.mdcFoundation.activate(t)}))}endPress(){this.waitForFoundation((()=>{this.mdcFoundation.deactivate()}))}startFocus(){this.waitForFoundation((()=>{this.mdcFoundation.handleFocus()}))}endFocus(){this.waitForFoundation((()=>{this.mdcFoundation.handleBlur()}))}startHover(){this.hovering=!0}endHover(){this.hovering=!1}waitForFoundation(t){this.mdcFoundation?t():this.updateComplete.then(t)}update(t){t.has("disabled")&&this.disabled&&this.endHover(),super.update(t)}render(){const t=this.activated&&(this.primary||!this.accent),e=this.selected&&(this.primary||!this.accent),i={"mdc-ripple-surface--accent":this.accent,"mdc-ripple-surface--primary--activated":t,"mdc-ripple-surface--accent--activated":this.accent&&this.activated,"mdc-ripple-surface--primary--selected":e,"mdc-ripple-surface--accent--selected":this.accent&&this.selected,"mdc-ripple-surface--disabled":this.disabled,"mdc-ripple-surface--hover":this.hovering,"mdc-ripple-surface--primary":this.primary,"mdc-ripple-surface--selected":this.selected,"mdc-ripple-upgraded--background-focused":this.bgFocused,"mdc-ripple-upgraded--foreground-activation":this.fgActivation,"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation,"mdc-ripple-upgraded--unbounded":this.unbounded,"mdc-ripple-surface--internal-use-state-layer-custom-properties":this.internalUseStateLayerCustomProperties};return D`
        <div class="mdc-ripple-surface mdc-ripple-upgraded ${We(i)}"
          style="${xi({"--mdc-ripple-fg-scale":this.fgScale,"--mdc-ripple-fg-size":this.fgSize,"--mdc-ripple-fg-translate-end":this.translateEnd,"--mdc-ripple-fg-translate-start":this.translateStart,"--mdc-ripple-left":this.leftPos,"--mdc-ripple-top":this.topPos})}"></div>`}}r([Et(".mdc-ripple-surface")],Mi.prototype,"mdcRoot",void 0),r([xt({type:Boolean})],Mi.prototype,"primary",void 0),r([xt({type:Boolean})],Mi.prototype,"accent",void 0),r([xt({type:Boolean})],Mi.prototype,"unbounded",void 0),r([xt({type:Boolean})],Mi.prototype,"disabled",void 0),r([xt({type:Boolean})],Mi.prototype,"activated",void 0),r([xt({type:Boolean})],Mi.prototype,"selected",void 0),r([xt({type:Boolean})],Mi.prototype,"internalUseStateLayerCustomProperties",void 0),r([Mt()],Mi.prototype,"hovering",void 0),r([Mt()],Mi.prototype,"bgFocused",void 0),r([Mt()],Mi.prototype,"fgActivation",void 0),r([Mt()],Mi.prototype,"fgDeactivation",void 0),r([Mt()],Mi.prototype,"fgScale",void 0),r([Mt()],Mi.prototype,"fgSize",void 0),r([Mt()],Mi.prototype,"translateStart",void 0),r([Mt()],Mi.prototype,"translateEnd",void 0),r([Mt()],Mi.prototype,"leftPos",void 0),r([Mt()],Mi.prototype,"topPos",void 0);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const ki=at`.mdc-ripple-surface{--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:transform,opacity;position:relative;outline:none;overflow:hidden}.mdc-ripple-surface::before,.mdc-ripple-surface::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface::before,.mdc-ripple-surface::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-upgraded--unbounded::before,.mdc-ripple-upgraded--unbounded::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface::before,.mdc-ripple-surface::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-ripple-surface:hover::before,.mdc-ripple-surface.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}:host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;display:block}:host .mdc-ripple-surface{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;will-change:unset}.mdc-ripple-surface--primary::before,.mdc-ripple-surface--primary::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary:hover::before,.mdc-ripple-surface--primary.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface--primary.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--primary.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--primary--activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}.mdc-ripple-surface--primary--activated::before,.mdc-ripple-surface--primary--activated::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary--activated:hover::before,.mdc-ripple-surface--primary--activated.mdc-ripple-surface--hover::before{opacity:0.16;opacity:var(--mdc-ripple-hover-opacity, 0.16)}.mdc-ripple-surface--primary--activated.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--primary--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--primary--selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}.mdc-ripple-surface--primary--selected::before,.mdc-ripple-surface--primary--selected::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary--selected:hover::before,.mdc-ripple-surface--primary--selected.mdc-ripple-surface--hover::before{opacity:0.12;opacity:var(--mdc-ripple-hover-opacity, 0.12)}.mdc-ripple-surface--primary--selected.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--primary--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--accent::before,.mdc-ripple-surface--accent::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent:hover::before,.mdc-ripple-surface--accent.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface--accent.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--accent.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--accent--activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}.mdc-ripple-surface--accent--activated::before,.mdc-ripple-surface--accent--activated::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent--activated:hover::before,.mdc-ripple-surface--accent--activated.mdc-ripple-surface--hover::before{opacity:0.16;opacity:var(--mdc-ripple-hover-opacity, 0.16)}.mdc-ripple-surface--accent--activated.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--accent--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--accent--selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}.mdc-ripple-surface--accent--selected::before,.mdc-ripple-surface--accent--selected::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent--selected:hover::before,.mdc-ripple-surface--accent--selected.mdc-ripple-surface--hover::before{opacity:0.12;opacity:var(--mdc-ripple-hover-opacity, 0.12)}.mdc-ripple-surface--accent--selected.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--accent--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--disabled{opacity:0}.mdc-ripple-surface--internal-use-state-layer-custom-properties::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties::after{background-color:#000;background-color:var(--mdc-ripple-hover-state-layer-color, #000)}.mdc-ripple-surface--internal-use-state-layer-custom-properties:hover::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-state-layer-opacity, 0.04)}.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-state-layer-opacity, 0.12)}.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-pressed-state-layer-opacity, 0.12)}.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-pressed-state-layer-opacity, 0.12)}`
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;let Si=class extends Mi{};function Ei(t,e,i){if(void 0!==e)
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
return function(t,e,i){const r=t.constructor;if(!i){const t=`__${e}`;if(!(i=r.getPropertyDescriptor(e,t)))throw new Error("@ariaProperty must be used after a @property decorator")}const n=i;let o="";if(!n.set)throw new Error(`@ariaProperty requires a setter for ${e}`);if(t.dispatchWizEvent)return i;const a={configurable:!0,enumerable:!0,set(t){if(""===o){const t=r.getPropertyOptions(e);o="string"==typeof t.attribute?t.attribute:e}this.hasAttribute(o)&&this.removeAttribute(o),n.set.call(this,t)}};return n.get&&(a.get=function(){return n.get.call(this)}),a}(t,e,i);throw new Error("@ariaProperty only supports TypeScript Decorators")}
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */Si.styles=[ki],Si=r([_t("mwc-ripple")],Si);class Ai{constructor(t){this.startPress=e=>{t().then((t=>{t&&t.startPress(e)}))},this.endPress=()=>{t().then((t=>{t&&t.endPress()}))},this.startFocus=()=>{t().then((t=>{t&&t.startFocus()}))},this.endFocus=()=>{t().then((t=>{t&&t.endFocus()}))},this.startHover=()=>{t().then((t=>{t&&t.startHover()}))},this.endHover=()=>{t().then((t=>{t&&t.endHover()}))}}}
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const Ti=t=>null!=t?t:z
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;class Ri extends vt{constructor(){super(...arguments),this.raised=!1,this.unelevated=!1,this.outlined=!1,this.dense=!1,this.disabled=!1,this.trailingIcon=!1,this.fullwidth=!1,this.icon="",this.label="",this.expandContent=!1,this.shouldRenderRipple=!1,this.rippleHandlers=new Ai((()=>(this.shouldRenderRipple=!0,this.ripple)))}renderOverlay(){return D``}renderRipple(){const t=this.raised||this.unelevated;return this.shouldRenderRipple?D`<mwc-ripple class="ripple" .primary="${!t}" .disabled="${this.disabled}"></mwc-ripple>`:""}focus(){const t=this.buttonElement;t&&(this.rippleHandlers.startFocus(),t.focus())}blur(){const t=this.buttonElement;t&&(this.rippleHandlers.endFocus(),t.blur())}getRenderClasses(){return{"mdc-button--raised":this.raised,"mdc-button--unelevated":this.unelevated,"mdc-button--outlined":this.outlined,"mdc-button--dense":this.dense}}render(){return D`
      <button
          id="button"
          class="mdc-button ${We(this.getRenderClasses())}"
          ?disabled="${this.disabled}"
          aria-label="${this.label||this.icon}"
          aria-haspopup="${Ti(this.ariaHasPopup)}"
          @focus="${this.handleRippleFocus}"
          @blur="${this.handleRippleBlur}"
          @mousedown="${this.handleRippleActivate}"
          @mouseenter="${this.handleRippleMouseEnter}"
          @mouseleave="${this.handleRippleMouseLeave}"
          @touchstart="${this.handleRippleActivate}"
          @touchend="${this.handleRippleDeactivate}"
          @touchcancel="${this.handleRippleDeactivate}">
        ${this.renderOverlay()}
        ${this.renderRipple()}
        <span class="leading-icon">
          <slot name="icon">
            ${this.icon&&!this.trailingIcon?this.renderIcon():""}
          </slot>
        </span>
        <span class="mdc-button__label">${this.label}</span>
        <span class="slot-container ${We({flex:this.expandContent})}">
          <slot></slot>
        </span>
        <span class="trailing-icon">
          <slot name="trailingIcon">
            ${this.icon&&this.trailingIcon?this.renderIcon():""}
          </slot>
        </span>
      </button>`}renderIcon(){return D`
    <mwc-icon class="mdc-button__icon">
      ${this.icon}
    </mwc-icon>`}handleRippleActivate(t){const e=()=>{window.removeEventListener("mouseup",e),this.handleRippleDeactivate()};window.addEventListener("mouseup",e),this.rippleHandlers.startPress(t)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}}Ri.shadowRootOptions={mode:"open",delegatesFocus:!0},r([Ei,xt({type:String,attribute:"aria-haspopup"})],Ri.prototype,"ariaHasPopup",void 0),r([xt({type:Boolean,reflect:!0})],Ri.prototype,"raised",void 0),r([xt({type:Boolean,reflect:!0})],Ri.prototype,"unelevated",void 0),r([xt({type:Boolean,reflect:!0})],Ri.prototype,"outlined",void 0),r([xt({type:Boolean})],Ri.prototype,"dense",void 0),r([xt({type:Boolean,reflect:!0})],Ri.prototype,"disabled",void 0),r([xt({type:Boolean,attribute:"trailingicon"})],Ri.prototype,"trailingIcon",void 0),r([xt({type:Boolean,reflect:!0})],Ri.prototype,"fullwidth",void 0),r([xt({type:String})],Ri.prototype,"icon",void 0),r([xt({type:String})],Ri.prototype,"label",void 0),r([xt({type:Boolean})],Ri.prototype,"expandContent",void 0),r([Et("#button")],Ri.prototype,"buttonElement",void 0),r([At("mwc-ripple")],Ri.prototype,"ripple",void 0),r([Mt()],Ri.prototype,"shouldRenderRipple",void 0),r([St({passive:!0})],Ri.prototype,"handleRippleActivate",null);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const Ii=at`.mdc-button{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-button-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-button-font-size, 0.875rem);line-height:2.25rem;line-height:var(--mdc-typography-button-line-height, 2.25rem);font-weight:500;font-weight:var(--mdc-typography-button-font-weight, 500);letter-spacing:0.0892857143em;letter-spacing:var(--mdc-typography-button-letter-spacing, 0.0892857143em);text-decoration:none;text-decoration:var(--mdc-typography-button-text-decoration, none);text-transform:uppercase;text-transform:var(--mdc-typography-button-text-transform, uppercase)}.mdc-touch-target-wrapper{display:inline}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:0;opacity:var(--mdc-elevation-overlay-opacity, 0);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:#fff;background-color:var(--mdc-elevation-overlay-color, #fff)}.mdc-button{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;user-select:none;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:transparent}.mdc-button .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button .mdc-button__icon{margin-left:0;margin-right:8px;display:inline-block;position:relative;vertical-align:top}[dir=rtl] .mdc-button .mdc-button__icon,.mdc-button .mdc-button__icon[dir=rtl]{margin-left:8px;margin-right:0}.mdc-button .mdc-button__label{position:relative}.mdc-button .mdc-button__touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}.mdc-button__label+.mdc-button__icon{margin-left:8px;margin-right:0}[dir=rtl] .mdc-button__label+.mdc-button__icon,.mdc-button__label+.mdc-button__icon[dir=rtl]{margin-left:0;margin-right:8px}svg.mdc-button__icon{fill:currentColor}.mdc-button--touch{margin-top:6px;margin-bottom:6px}.mdc-button{padding:0 8px 0 8px}.mdc-button--unelevated{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);padding:0 16px 0 16px}.mdc-button--unelevated.mdc-button--icon-trailing{padding:0 12px 0 16px}.mdc-button--unelevated.mdc-button--icon-leading{padding:0 16px 0 12px}.mdc-button--raised{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);padding:0 16px 0 16px}.mdc-button--raised.mdc-button--icon-trailing{padding:0 12px 0 16px}.mdc-button--raised.mdc-button--icon-leading{padding:0 16px 0 12px}.mdc-button--outlined{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-button--outlined .mdc-button__ripple{border-style:solid;border-color:transparent}.mdc-button{height:36px;border-radius:4px;border-radius:var(--mdc-shape-small, 4px)}.mdc-button:not(:disabled){color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}.mdc-button:disabled{color:rgba(0, 0, 0, 0.38)}.mdc-button .mdc-button__icon{font-size:1.125rem;width:1.125rem;height:1.125rem}.mdc-button .mdc-button__ripple{border-radius:4px;border-radius:var(--mdc-shape-small, 4px)}.mdc-button--raised,.mdc-button--unelevated{height:36px;border-radius:4px;border-radius:var(--mdc-shape-small, 4px)}.mdc-button--raised:not(:disabled),.mdc-button--unelevated:not(:disabled){background-color:#6200ee;background-color:var(--mdc-theme-primary, #6200ee)}.mdc-button--raised:disabled,.mdc-button--unelevated:disabled{background-color:rgba(0, 0, 0, 0.12)}.mdc-button--raised:not(:disabled),.mdc-button--unelevated:not(:disabled){color:#fff;color:var(--mdc-theme-on-primary, #fff)}.mdc-button--raised:disabled,.mdc-button--unelevated:disabled{color:rgba(0, 0, 0, 0.38)}.mdc-button--raised .mdc-button__icon,.mdc-button--unelevated .mdc-button__icon{font-size:1.125rem;width:1.125rem;height:1.125rem}.mdc-button--raised .mdc-button__ripple,.mdc-button--unelevated .mdc-button__ripple{border-radius:4px;border-radius:var(--mdc-shape-small, 4px)}.mdc-button--outlined{height:36px;border-radius:4px;border-radius:var(--mdc-shape-small, 4px);padding:0 15px 0 15px;border-width:1px}.mdc-button--outlined:not(:disabled){color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}.mdc-button--outlined:disabled{color:rgba(0, 0, 0, 0.38)}.mdc-button--outlined .mdc-button__icon{font-size:1.125rem;width:1.125rem;height:1.125rem}.mdc-button--outlined .mdc-button__ripple{border-radius:4px;border-radius:var(--mdc-shape-small, 4px)}.mdc-button--outlined:not(:disabled){border-color:rgba(0, 0, 0, 0.12)}.mdc-button--outlined:disabled{border-color:rgba(0, 0, 0, 0.12)}.mdc-button--outlined.mdc-button--icon-trailing{padding:0 11px 0 15px}.mdc-button--outlined.mdc-button--icon-leading{padding:0 15px 0 11px}.mdc-button--outlined .mdc-button__ripple{top:calc(-1 * 1px);left:calc(-1 * 1px);border-width:1px}.mdc-button--outlined .mdc-button__touch{left:calc(-1 * 1px);width:calc(100% + 2 * 1px)}.mdc-button--raised{box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2),0px 2px 2px 0px rgba(0, 0, 0, 0.14),0px 1px 5px 0px rgba(0,0,0,.12);transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-button--raised:hover,.mdc-button--raised:focus{box-shadow:0px 2px 4px -1px rgba(0, 0, 0, 0.2),0px 4px 5px 0px rgba(0, 0, 0, 0.14),0px 1px 10px 0px rgba(0,0,0,.12)}.mdc-button--raised:active{box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2),0px 8px 10px 1px rgba(0, 0, 0, 0.14),0px 3px 14px 2px rgba(0,0,0,.12)}.mdc-button--raised:disabled{box-shadow:0px 0px 0px 0px rgba(0, 0, 0, 0.2),0px 0px 0px 0px rgba(0, 0, 0, 0.14),0px 0px 0px 0px rgba(0,0,0,.12)}:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:transparent;vertical-align:top}:host([fullwidth]){width:100%}:host([raised]),:host([unelevated]){--mdc-ripple-color:#fff;--mdc-ripple-focus-opacity:0.24;--mdc-ripple-hover-opacity:0.08;--mdc-ripple-press-opacity:0.24}.trailing-icon ::slotted(*),.trailing-icon .mdc-button__icon,.leading-icon ::slotted(*),.leading-icon .mdc-button__icon{margin-left:0;margin-right:8px;display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}[dir=rtl] .trailing-icon ::slotted(*),[dir=rtl] .trailing-icon .mdc-button__icon,[dir=rtl] .leading-icon ::slotted(*),[dir=rtl] .leading-icon .mdc-button__icon,.trailing-icon ::slotted(*[dir=rtl]),.trailing-icon .mdc-button__icon[dir=rtl],.leading-icon ::slotted(*[dir=rtl]),.leading-icon .mdc-button__icon[dir=rtl]{margin-left:8px;margin-right:0}.trailing-icon ::slotted(*),.trailing-icon .mdc-button__icon{margin-left:8px;margin-right:0}[dir=rtl] .trailing-icon ::slotted(*),[dir=rtl] .trailing-icon .mdc-button__icon,.trailing-icon ::slotted(*[dir=rtl]),.trailing-icon .mdc-button__icon[dir=rtl]{margin-left:0;margin-right:8px}.slot-container{display:inline-flex;align-items:center;justify-content:center}.slot-container.flex{flex:auto}.mdc-button{flex:auto;overflow:hidden;padding-left:8px;padding-left:var(--mdc-button-horizontal-padding, 8px);padding-right:8px;padding-right:var(--mdc-button-horizontal-padding, 8px)}.mdc-button--raised{box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-button-raised-box-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mdc-button--raised:focus{box-shadow:0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-button-raised-box-shadow-focus, var(--mdc-button-raised-box-shadow-hover, 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12)))}.mdc-button--raised:hover{box-shadow:0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-button-raised-box-shadow-hover, 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12))}.mdc-button--raised:active{box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-button-raised-box-shadow-active, 0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12))}.mdc-button--raised:disabled{box-shadow:0px 0px 0px 0px rgba(0, 0, 0, 0.2), 0px 0px 0px 0px rgba(0, 0, 0, 0.14), 0px 0px 0px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-button-raised-box-shadow-disabled, 0px 0px 0px 0px rgba(0, 0, 0, 0.2), 0px 0px 0px 0px rgba(0, 0, 0, 0.14), 0px 0px 0px 0px rgba(0, 0, 0, 0.12))}.mdc-button--raised,.mdc-button--unelevated{padding-left:16px;padding-left:var(--mdc-button-horizontal-padding, 16px);padding-right:16px;padding-right:var(--mdc-button-horizontal-padding, 16px)}.mdc-button--outlined{border-width:1px;border-width:var(--mdc-button-outline-width, 1px);padding-left:calc(16px - 1px);padding-left:calc(var(--mdc-button-horizontal-padding, 16px) - var(--mdc-button-outline-width, 1px));padding-right:calc(16px - 1px);padding-right:calc(var(--mdc-button-horizontal-padding, 16px) - var(--mdc-button-outline-width, 1px))}.mdc-button--outlined:not(:disabled){border-color:rgba(0, 0, 0, 0.12);border-color:var(--mdc-button-outline-color, rgba(0, 0, 0, 0.12))}.mdc-button--outlined .ripple{top:calc(-1 * 1px);top:calc(-1 * var(--mdc-button-outline-width, 1px));left:calc(-1 * 1px);left:calc(-1 * var(--mdc-button-outline-width, 1px));right:initial;right:initial;border-width:1px;border-width:var(--mdc-button-outline-width, 1px);border-style:solid;border-color:transparent}[dir=rtl] .mdc-button--outlined .ripple,.mdc-button--outlined .ripple[dir=rtl]{left:initial;left:initial;right:calc(-1 * 1px);right:calc(-1 * var(--mdc-button-outline-width, 1px))}.mdc-button--dense{height:28px;margin-top:0;margin-bottom:0}.mdc-button--dense .mdc-button__touch{height:100%}:host([disabled]){pointer-events:none}:host([disabled]) .mdc-button{color:rgba(0, 0, 0, 0.38);color:var(--mdc-button-disabled-ink-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-button--raised,:host([disabled]) .mdc-button--unelevated{background-color:rgba(0, 0, 0, 0.12);background-color:var(--mdc-button-disabled-fill-color, rgba(0, 0, 0, 0.12))}:host([disabled]) .mdc-button--outlined{border-color:rgba(0, 0, 0, 0.12);border-color:var(--mdc-button-disabled-outline-color, rgba(0, 0, 0, 0.12))}`
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;let Ci=class extends Ri{};Ci.styles=[Ii],Ci=r([_t("mwc-button")],Ci);
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class Oi extends vt{constructor(){super(...arguments),this.disabled=!1,this.icon="",this.shouldRenderRipple=!1,this.rippleHandlers=new Ai((()=>(this.shouldRenderRipple=!0,this.ripple)))}renderRipple(){return this.shouldRenderRipple?D`
            <mwc-ripple
                .disabled="${this.disabled}"
                unbounded>
            </mwc-ripple>`:""}focus(){const t=this.buttonElement;t&&(this.rippleHandlers.startFocus(),t.focus())}blur(){const t=this.buttonElement;t&&(this.rippleHandlers.endFocus(),t.blur())}render(){return D`<button
        class="mdc-icon-button mdc-icon-button--display-flex"
        aria-label="${this.ariaLabel||this.icon}"
        aria-haspopup="${Ti(this.ariaHasPopup)}"
        ?disabled="${this.disabled}"
        @focus="${this.handleRippleFocus}"
        @blur="${this.handleRippleBlur}"
        @mousedown="${this.handleRippleMouseDown}"
        @mouseenter="${this.handleRippleMouseEnter}"
        @mouseleave="${this.handleRippleMouseLeave}"
        @touchstart="${this.handleRippleTouchStart}"
        @touchend="${this.handleRippleDeactivate}"
        @touchcancel="${this.handleRippleDeactivate}"
    >${this.renderRipple()}
    <i class="material-icons">${this.icon}</i>
    <span
      ><slot></slot
    ></span>
  </button>`}handleRippleMouseDown(t){const e=()=>{window.removeEventListener("mouseup",e),this.handleRippleDeactivate()};window.addEventListener("mouseup",e),this.rippleHandlers.startPress(t)}handleRippleTouchStart(t){this.rippleHandlers.startPress(t)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}}r([xt({type:Boolean,reflect:!0})],Oi.prototype,"disabled",void 0),r([xt({type:String})],Oi.prototype,"icon",void 0),r([Ei,xt({type:String,attribute:"aria-label"})],Oi.prototype,"ariaLabel",void 0),r([Ei,xt({type:String,attribute:"aria-haspopup"})],Oi.prototype,"ariaHasPopup",void 0),r([Et("button")],Oi.prototype,"buttonElement",void 0),r([At("mwc-ripple")],Oi.prototype,"ripple",void 0),r([Mt()],Oi.prototype,"shouldRenderRipple",void 0),r([St({passive:!0})],Oi.prototype,"handleRippleMouseDown",null),r([St({passive:!0})],Oi.prototype,"handleRippleTouchStart",null);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const Pi=at`.material-icons{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}.mdc-icon-button{font-size:24px;width:48px;height:48px;padding:12px}.mdc-icon-button.mdc-icon-button--reduced-size .mdc-icon-button__ripple{width:40px;height:40px;margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-icon-button:disabled{color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-disabled-on-light, rgba(0, 0, 0, 0.38))}.mdc-icon-button svg,.mdc-icon-button img{width:24px;height:24px}.mdc-icon-button{display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:transparent;fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;user-select:none;z-index:0;overflow:visible}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-icon-button:disabled{cursor:default;pointer-events:none}.mdc-icon-button--display-flex{align-items:center;display:inline-flex;justify-content:center}.mdc-icon-button__icon{display:inline-block}.mdc-icon-button__icon.mdc-icon-button__icon--on{display:none}.mdc-icon-button--on .mdc-icon-button__icon{display:none}.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on{display:inline-block}.mdc-icon-button{display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:transparent;fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;user-select:none;z-index:0;overflow:visible}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-icon-button:disabled{cursor:default;pointer-events:none}.mdc-icon-button--display-flex{align-items:center;display:inline-flex;justify-content:center}.mdc-icon-button__icon{display:inline-block}.mdc-icon-button__icon.mdc-icon-button__icon--on{display:none}.mdc-icon-button--on .mdc-icon-button__icon{display:none}.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on{display:inline-block}:host{display:inline-block;outline:none}:host([disabled]){pointer-events:none}.mdc-icon-button i,.mdc-icon-button svg,.mdc-icon-button img,.mdc-icon-button ::slotted(*){display:block}:host{--mdc-ripple-color: currentcolor;-webkit-tap-highlight-color:transparent}:host,.mdc-icon-button{vertical-align:top}.mdc-icon-button{width:var(--mdc-icon-button-size, 48px);height:var(--mdc-icon-button-size, 48px);padding:calc( (var(--mdc-icon-button-size, 48px) - var(--mdc-icon-size, 24px)) / 2 )}.mdc-icon-button i,.mdc-icon-button svg,.mdc-icon-button img,.mdc-icon-button ::slotted(*){display:block;width:var(--mdc-icon-size, 24px);height:var(--mdc-icon-size, 24px)}`
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;let Li=class extends Oi{};Li.styles=[Pi],Li=r([_t("mwc-icon-button")],Li);
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class $i extends vt{constructor(){super(...arguments),this.disabled=!1,this.onIcon="",this.offIcon="",this.on=!1,this.shouldRenderRipple=!1,this.rippleHandlers=new Ai((()=>(this.shouldRenderRipple=!0,this.ripple)))}handleClick(){this.on=!this.on,this.dispatchEvent(new CustomEvent("icon-button-toggle-change",{detail:{isOn:this.on},bubbles:!0}))}click(){this.mdcRoot.focus(),this.mdcRoot.click()}focus(){this.rippleHandlers.startFocus(),this.mdcRoot.focus()}blur(){this.rippleHandlers.endFocus(),this.mdcRoot.blur()}renderRipple(){return this.shouldRenderRipple?D`
            <mwc-ripple
                .disabled="${this.disabled}"
                unbounded>
            </mwc-ripple>`:""}render(){const t={"mdc-icon-button--on":this.on},e=void 0!==this.ariaLabelOn&&void 0!==this.ariaLabelOff,i=e?void 0:this.on,r=e?this.on?this.ariaLabelOn:this.ariaLabelOff:this.ariaLabel;return D`<button
          class="mdc-icon-button mdc-icon-button--display-flex ${We(t)}"
          aria-pressed="${Ti(i)}"
          aria-label="${Ti(r)}"
          @click="${this.handleClick}"
          ?disabled="${this.disabled}"
          @focus="${this.handleRippleFocus}"
          @blur="${this.handleRippleBlur}"
          @mousedown="${this.handleRippleMouseDown}"
          @mouseenter="${this.handleRippleMouseEnter}"
          @mouseleave="${this.handleRippleMouseLeave}"
          @touchstart="${this.handleRippleTouchStart}"
          @touchend="${this.handleRippleDeactivate}"
          @touchcancel="${this.handleRippleDeactivate}"
        >${this.renderRipple()}
        <span class="mdc-icon-button__icon"
          ><slot name="offIcon"
            ><i class="material-icons">${this.offIcon}</i
          ></slot
        ></span>
        <span class="mdc-icon-button__icon mdc-icon-button__icon--on"
          ><slot name="onIcon"
            ><i class="material-icons">${this.onIcon}</i
          ></slot
        ></span>
      </button>`}handleRippleMouseDown(t){const e=()=>{window.removeEventListener("mouseup",e),this.handleRippleDeactivate()};window.addEventListener("mouseup",e),this.rippleHandlers.startPress(t)}handleRippleTouchStart(t){this.rippleHandlers.startPress(t)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}}r([Et(".mdc-icon-button")],$i.prototype,"mdcRoot",void 0),r([Ei,xt({type:String,attribute:"aria-label"})],$i.prototype,"ariaLabel",void 0),r([xt({type:Boolean,reflect:!0})],$i.prototype,"disabled",void 0),r([xt({type:String})],$i.prototype,"onIcon",void 0),r([xt({type:String})],$i.prototype,"offIcon",void 0),r([xt({type:String})],$i.prototype,"ariaLabelOn",void 0),r([xt({type:String})],$i.prototype,"ariaLabelOff",void 0),r([xt({type:Boolean,reflect:!0})],$i.prototype,"on",void 0),r([At("mwc-ripple")],$i.prototype,"ripple",void 0),r([Mt()],$i.prototype,"shouldRenderRipple",void 0),r([St({passive:!0})],$i.prototype,"handleRippleMouseDown",null),r([St({passive:!0})],$i.prototype,"handleRippleTouchStart",null);
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
let Ni=class extends $i{};Ni.styles=[Pi],Ni=r([_t("mwc-icon-button-toggle")],Ni);
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class Bi extends vt{constructor(){super(...arguments),this.value="",this.group=null,this.tabindex=-1,this.disabled=!1,this.twoline=!1,this.activated=!1,this.graphic=null,this.multipleGraphics=!1,this.hasMeta=!1,this.noninteractive=!1,this.selected=!1,this.shouldRenderRipple=!1,this._managingList=null,this.boundOnClick=this.onClick.bind(this),this._firstChanged=!0,this._skipPropRequest=!1,this.rippleHandlers=new Ai((()=>(this.shouldRenderRipple=!0,this.ripple))),this.listeners=[{target:this,eventNames:["click"],cb:()=>{this.onClick()}},{target:this,eventNames:["mouseenter"],cb:this.rippleHandlers.startHover},{target:this,eventNames:["mouseleave"],cb:this.rippleHandlers.endHover},{target:this,eventNames:["focus"],cb:this.rippleHandlers.startFocus},{target:this,eventNames:["blur"],cb:this.rippleHandlers.endFocus},{target:this,eventNames:["mousedown","touchstart"],cb:t=>{const e=t.type;this.onDown("mousedown"===e?"mouseup":"touchend",t)}}]}get text(){const t=this.textContent;return t?t.trim():""}render(){const t=this.renderText(),e=this.graphic?this.renderGraphic():D``,i=this.hasMeta?this.renderMeta():D``;return D`
      ${this.renderRipple()}
      ${e}
      ${t}
      ${i}`}renderRipple(){return this.shouldRenderRipple?D`
      <mwc-ripple
        .activated=${this.activated}>
      </mwc-ripple>`:this.activated?D`<div class="fake-activated-ripple"></div>`:""}renderGraphic(){const t={multi:this.multipleGraphics};return D`
      <span class="mdc-deprecated-list-item__graphic material-icons ${We(t)}">
        <slot name="graphic"></slot>
      </span>`}renderMeta(){return D`
      <span class="mdc-deprecated-list-item__meta material-icons">
        <slot name="meta"></slot>
      </span>`}renderText(){const t=this.twoline?this.renderTwoline():this.renderSingleLine();return D`
      <span class="mdc-deprecated-list-item__text">
        ${t}
      </span>`}renderSingleLine(){return D`<slot></slot>`}renderTwoline(){return D`
      <span class="mdc-deprecated-list-item__primary-text">
        <slot></slot>
      </span>
      <span class="mdc-deprecated-list-item__secondary-text">
        <slot name="secondary"></slot>
      </span>
    `}onClick(){this.fireRequestSelected(!this.selected,"interaction")}onDown(t,e){const i=()=>{window.removeEventListener(t,i),this.rippleHandlers.endPress()};window.addEventListener(t,i),this.rippleHandlers.startPress(e)}fireRequestSelected(t,e){if(this.noninteractive)return;const i=new CustomEvent("request-selected",{bubbles:!0,composed:!0,detail:{source:e,selected:t}});this.dispatchEvent(i)}connectedCallback(){super.connectedCallback(),this.noninteractive||this.setAttribute("mwc-list-item","");for(const t of this.listeners)for(const e of t.eventNames)t.target.addEventListener(e,t.cb,{passive:!0})}disconnectedCallback(){super.disconnectedCallback();for(const t of this.listeners)for(const e of t.eventNames)t.target.removeEventListener(e,t.cb);this._managingList&&(this._managingList.debouncedLayout?this._managingList.debouncedLayout(!0):this._managingList.layout(!0))}firstUpdated(){const t=new Event("list-item-rendered",{bubbles:!0,composed:!0});this.dispatchEvent(t)}}r([Et("slot")],Bi.prototype,"slotElement",void 0),r([At("mwc-ripple")],Bi.prototype,"ripple",void 0),r([xt({type:String})],Bi.prototype,"value",void 0),r([xt({type:String,reflect:!0})],Bi.prototype,"group",void 0),r([xt({type:Number,reflect:!0})],Bi.prototype,"tabindex",void 0),r([xt({type:Boolean,reflect:!0}),Ve((function(t){t?this.setAttribute("aria-disabled","true"):this.setAttribute("aria-disabled","false")}))],Bi.prototype,"disabled",void 0),r([xt({type:Boolean,reflect:!0})],Bi.prototype,"twoline",void 0),r([xt({type:Boolean,reflect:!0})],Bi.prototype,"activated",void 0),r([xt({type:String,reflect:!0})],Bi.prototype,"graphic",void 0),r([xt({type:Boolean})],Bi.prototype,"multipleGraphics",void 0),r([xt({type:Boolean})],Bi.prototype,"hasMeta",void 0),r([xt({type:Boolean,reflect:!0}),Ve((function(t){t?(this.removeAttribute("aria-checked"),this.removeAttribute("mwc-list-item"),this.selected=!1,this.activated=!1,this.tabIndex=-1):this.setAttribute("mwc-list-item","")}))],Bi.prototype,"noninteractive",void 0),r([xt({type:Boolean,reflect:!0}),Ve((function(t){const e=this.getAttribute("role"),i="gridcell"===e||"option"===e||"row"===e||"tab"===e;i&&t?this.setAttribute("aria-selected","true"):i&&this.setAttribute("aria-selected","false"),this._firstChanged?this._firstChanged=!1:this._skipPropRequest||this.fireRequestSelected(t,"property")}))],Bi.prototype,"selected",void 0),r([Mt()],Bi.prototype,"shouldRenderRipple",void 0),r([Mt()],Bi.prototype,"_managingList",void 0);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const Di=at`:host{cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;height:48px;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:var(--mdc-list-side-padding, 16px);padding-right:var(--mdc-list-side-padding, 16px);outline:none;height:48px;color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host:focus{outline:none}:host([activated]){color:#6200ee;color:var(--mdc-theme-primary, #6200ee);--mdc-ripple-color: var( --mdc-theme-primary, #6200ee )}:host([activated]) .mdc-deprecated-list-item__graphic{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host([activated]) .fake-activated-ripple::before{position:absolute;display:block;top:0;bottom:0;left:0;right:0;width:100%;height:100%;pointer-events:none;z-index:1;content:"";opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12);background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-deprecated-list-item__graphic{flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;display:inline-flex}.mdc-deprecated-list-item__graphic ::slotted(*){flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;width:100%;height:100%;text-align:center}.mdc-deprecated-list-item__meta{width:var(--mdc-list-item-meta-size, 24px);height:var(--mdc-list-item-meta-size, 24px);margin-left:auto;margin-right:0;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-hint-on-background, rgba(0, 0, 0, 0.38))}.mdc-deprecated-list-item__meta.multi{width:auto}.mdc-deprecated-list-item__meta ::slotted(*){width:var(--mdc-list-item-meta-size, 24px);line-height:var(--mdc-list-item-meta-size, 24px)}.mdc-deprecated-list-item__meta ::slotted(.material-icons),.mdc-deprecated-list-item__meta ::slotted(mwc-icon){line-height:var(--mdc-list-item-meta-size, 24px) !important}.mdc-deprecated-list-item__meta ::slotted(:not(.material-icons):not(mwc-icon)){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-caption-font-size, 0.75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight, 400);letter-spacing:0.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, 0.0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform, inherit)}[dir=rtl] .mdc-deprecated-list-item__meta,.mdc-deprecated-list-item__meta[dir=rtl]{margin-left:0;margin-right:auto}.mdc-deprecated-list-item__meta ::slotted(*){width:100%;height:100%}.mdc-deprecated-list-item__text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mdc-deprecated-list-item__text ::slotted([for]),.mdc-deprecated-list-item__text[for]{pointer-events:none}.mdc-deprecated-list-item__primary-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;line-height:normal;margin-bottom:-20px;display:block}.mdc-deprecated-list-item__primary-text::before{display:inline-block;width:0;height:32px;content:"";vertical-align:0}.mdc-deprecated-list-item__primary-text::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-deprecated-list-item__secondary-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-body2-font-size, 0.875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight, 400);letter-spacing:0.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, 0.0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform, inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;line-height:normal;display:block}.mdc-deprecated-list-item__secondary-text::before{display:inline-block;width:0;height:20px;content:"";vertical-align:0}.mdc-deprecated-list--dense .mdc-deprecated-list-item__secondary-text{font-size:inherit}* ::slotted(a),a{color:inherit;text-decoration:none}:host([twoline]){height:72px}:host([twoline]) .mdc-deprecated-list-item__text{align-self:flex-start}:host([disabled]),:host([noninteractive]){cursor:default;pointer-events:none}:host([disabled]) .mdc-deprecated-list-item__text ::slotted(*){opacity:.38}:host([disabled]) .mdc-deprecated-list-item__text ::slotted(*),:host([disabled]) .mdc-deprecated-list-item__primary-text ::slotted(*),:host([disabled]) .mdc-deprecated-list-item__secondary-text ::slotted(*){color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-deprecated-list-item__secondary-text ::slotted(*){color:rgba(0, 0, 0, 0.54);color:var(--mdc-theme-text-secondary-on-background, rgba(0, 0, 0, 0.54))}.mdc-deprecated-list-item__graphic ::slotted(*){background-color:transparent;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-icon-on-background, rgba(0, 0, 0, 0.38))}.mdc-deprecated-list-group__subheader ::slotted(*){color:rgba(0, 0, 0, 0.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 40px);height:var(--mdc-list-item-graphic-size, 40px)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 40px);line-height:var(--mdc-list-item-graphic-size, 40px)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 40px) !important}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(*){border-radius:50%}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic,:host([graphic=medium]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic,:host([graphic=control]) .mdc-deprecated-list-item__graphic{margin-left:0;margin-right:var(--mdc-list-item-graphic-margin, 16px)}[dir=rtl] :host([graphic=avatar]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=medium]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=large]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=control]) .mdc-deprecated-list-item__graphic,:host([graphic=avatar]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=medium]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=large]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=control]) .mdc-deprecated-list-item__graphic[dir=rtl]{margin-left:var(--mdc-list-item-graphic-margin, 16px);margin-right:0}:host([graphic=icon]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 24px);height:var(--mdc-list-item-graphic-size, 24px);margin-left:0;margin-right:var(--mdc-list-item-graphic-margin, 32px)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 24px);line-height:var(--mdc-list-item-graphic-size, 24px)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 24px) !important}[dir=rtl] :host([graphic=icon]) .mdc-deprecated-list-item__graphic,:host([graphic=icon]) .mdc-deprecated-list-item__graphic[dir=rtl]{margin-left:var(--mdc-list-item-graphic-margin, 32px);margin-right:0}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:56px}:host([graphic=medium]:not([twoLine])),:host([graphic=large]:not([twoLine])){height:72px}:host([graphic=medium]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 56px);height:var(--mdc-list-item-graphic-size, 56px)}:host([graphic=medium]) .mdc-deprecated-list-item__graphic.multi,:host([graphic=large]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(*),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 56px);line-height:var(--mdc-list-item-graphic-size, 56px)}:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 56px) !important}:host([graphic=large]){padding-left:0px}`
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;let ji=class extends Bi{};ji.styles=[Di],ji=r([_t("mwc-list-item")],ji);
/**
 * @license
 * Copyright 2020 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var zi="Unknown",Fi="Backspace",Ui="Enter",qi="Spacebar",Hi="PageUp",Vi="PageDown",Wi="End",Gi="Home",Ki="ArrowLeft",Xi="ArrowUp",Yi="ArrowRight",Zi="ArrowDown",Ji="Delete",Qi="Escape",tr="Tab",er=new Set;er.add(Fi),er.add(Ui),er.add(qi),er.add(Hi),er.add(Vi),er.add(Wi),er.add(Gi),er.add(Ki),er.add(Xi),er.add(Yi),er.add(Zi),er.add(Ji),er.add(Qi),er.add(tr);var ir=8,rr=13,nr=32,or=33,ar=34,sr=35,lr=36,dr=37,cr=38,hr=39,ur=40,pr=46,fr=27,mr=9,gr=new Map;gr.set(ir,Fi),gr.set(rr,Ui),gr.set(nr,qi),gr.set(or,Hi),gr.set(ar,Vi),gr.set(sr,Wi),gr.set(lr,Gi),gr.set(dr,Ki),gr.set(cr,Xi),gr.set(hr,Yi),gr.set(ur,Zi),gr.set(pr,Ji),gr.set(fr,Qi),gr.set(mr,tr);var br,vr,yr=new Set;function _r(t){var e=t.key;if(er.has(e))return e;var i=gr.get(t.keyCode);return i||zi}
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */yr.add(Hi),yr.add(Vi),yr.add(Wi),yr.add(Gi),yr.add(Ki),yr.add(Xi),yr.add(Yi),yr.add(Zi);var wr="mdc-list-item--activated",xr="mdc-list-item",Mr="mdc-list-item--disabled",kr="mdc-list-item--selected",Sr="mdc-list-item__text",Er="mdc-list-item__primary-text",Ar="mdc-list";(br={})[""+wr]="mdc-list-item--activated",br[""+xr]="mdc-list-item",br[""+Mr]="mdc-list-item--disabled",br[""+kr]="mdc-list-item--selected",br[""+Er]="mdc-list-item__primary-text",br[""+Ar]="mdc-list";var Tr=((vr={})[""+wr]="mdc-deprecated-list-item--activated",vr[""+xr]="mdc-deprecated-list-item",vr[""+Mr]="mdc-deprecated-list-item--disabled",vr[""+kr]="mdc-deprecated-list-item--selected",vr[""+Sr]="mdc-deprecated-list-item__text",vr[""+Er]="mdc-deprecated-list-item__primary-text",vr[""+Ar]="mdc-deprecated-list",vr),Rr={ACTION_EVENT:"MDCList:action",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",ARIA_INTERACTIVE_ROLES_SELECTOR:'[role="listbox"], [role="menu"]',ARIA_MULTI_SELECTABLE_SELECTOR:'[aria-multiselectable="true"]',CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"], input[type="radio"]',CHECKBOX_SELECTOR:'input[type="checkbox"]',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"\n    ."+xr+" button:not(:disabled),\n    ."+xr+" a,\n    ."+Tr[xr]+" button:not(:disabled),\n    ."+Tr[xr]+" a\n  ",DEPRECATED_SELECTOR:".mdc-deprecated-list",FOCUSABLE_CHILD_ELEMENTS:"\n    ."+xr+" button:not(:disabled),\n    ."+xr+" a,\n    ."+xr+' input[type="radio"]:not(:disabled),\n    .'+xr+' input[type="checkbox"]:not(:disabled),\n    .'+Tr[xr]+" button:not(:disabled),\n    ."+Tr[xr]+" a,\n    ."+Tr[xr]+' input[type="radio"]:not(:disabled),\n    .'+Tr[xr]+' input[type="checkbox"]:not(:disabled)\n  ',RADIO_SELECTOR:'input[type="radio"]',SELECTED_ITEM_SELECTOR:'[aria-selected="true"], [aria-current="true"]'},Ir={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300};
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
const Cr=(t,e)=>t-e,Or=["input","button","textarea","select"];function Pr(t){return t instanceof Set}const Lr=t=>{const e=t===Ir.UNSET_INDEX?new Set:t;return Pr(e)?new Set(e):new Set([e])};class $r extends Oe{constructor(t){super(Object.assign(Object.assign({},$r.defaultAdapter),t)),this.isMulti_=!1,this.wrapFocus_=!1,this.isVertical_=!0,this.selectedIndex_=Ir.UNSET_INDEX,this.focusedItemIndex_=Ir.UNSET_INDEX,this.useActivatedClass_=!1,this.ariaCurrentAttrValue_=null}static get strings(){return Rr}static get numbers(){return Ir}static get defaultAdapter(){return{focusItemAtIndex:()=>{},getFocusedElementIndex:()=>0,getListItemCount:()=>0,isFocusInsideList:()=>!1,isRootFocused:()=>!1,notifyAction:()=>{},notifySelected:()=>{},getSelectedStateForElementIndex:()=>!1,setDisabledStateForElementIndex:()=>{},getDisabledStateForElementIndex:()=>!1,setSelectedStateForElementIndex:()=>{},setActivatedStateForElementIndex:()=>{},setTabIndexForElementIndex:()=>{},setAttributeForElementIndex:()=>{},getAttributeForElementIndex:()=>null}}setWrapFocus(t){this.wrapFocus_=t}setMulti(t){this.isMulti_=t;const e=this.selectedIndex_;if(t){if(!Pr(e)){const t=e===Ir.UNSET_INDEX;this.selectedIndex_=t?new Set:new Set([e])}}else if(Pr(e))if(e.size){const t=Array.from(e).sort(Cr);this.selectedIndex_=t[0]}else this.selectedIndex_=Ir.UNSET_INDEX}setVerticalOrientation(t){this.isVertical_=t}setUseActivatedClass(t){this.useActivatedClass_=t}getSelectedIndex(){return this.selectedIndex_}setSelectedIndex(t){this.isIndexValid_(t)&&(this.isMulti_?this.setMultiSelectionAtIndex_(Lr(t)):this.setSingleSelectionAtIndex_(t))}handleFocusIn(t,e){e>=0&&this.adapter.setTabIndexForElementIndex(e,0)}handleFocusOut(t,e){e>=0&&this.adapter.setTabIndexForElementIndex(e,-1),setTimeout((()=>{this.adapter.isFocusInsideList()||this.setTabindexToFirstSelectedItem_()}),0)}handleKeydown(t,e,i){const r="ArrowLeft"===_r(t),n="ArrowUp"===_r(t),o="ArrowRight"===_r(t),a="ArrowDown"===_r(t),s="Home"===_r(t),l="End"===_r(t),d="Enter"===_r(t),c="Spacebar"===_r(t);if(this.adapter.isRootFocused())return void(n||l?(t.preventDefault(),this.focusLastElement()):(a||s)&&(t.preventDefault(),this.focusFirstElement()));let h,u=this.adapter.getFocusedElementIndex();if(!(-1===u&&(u=i,u<0))){if(this.isVertical_&&a||!this.isVertical_&&o)this.preventDefaultEvent(t),h=this.focusNextElement(u);else if(this.isVertical_&&n||!this.isVertical_&&r)this.preventDefaultEvent(t),h=this.focusPrevElement(u);else if(s)this.preventDefaultEvent(t),h=this.focusFirstElement();else if(l)this.preventDefaultEvent(t),h=this.focusLastElement();else if((d||c)&&e){const e=t.target;if(e&&"A"===e.tagName&&d)return;this.preventDefaultEvent(t),this.setSelectedIndexOnAction_(u,!0)}this.focusedItemIndex_=u,void 0!==h&&(this.setTabindexAtIndex_(h),this.focusedItemIndex_=h)}}handleSingleSelection(t,e,i){t!==Ir.UNSET_INDEX&&(this.setSelectedIndexOnAction_(t,e,i),this.setTabindexAtIndex_(t),this.focusedItemIndex_=t)}focusNextElement(t){let e=t+1;if(e>=this.adapter.getListItemCount()){if(!this.wrapFocus_)return t;e=0}return this.adapter.focusItemAtIndex(e),e}focusPrevElement(t){let e=t-1;if(e<0){if(!this.wrapFocus_)return t;e=this.adapter.getListItemCount()-1}return this.adapter.focusItemAtIndex(e),e}focusFirstElement(){return this.adapter.focusItemAtIndex(0),0}focusLastElement(){const t=this.adapter.getListItemCount()-1;return this.adapter.focusItemAtIndex(t),t}setEnabled(t,e){this.isIndexValid_(t)&&this.adapter.setDisabledStateForElementIndex(t,!e)}preventDefaultEvent(t){const e=`${t.target.tagName}`.toLowerCase();-1===Or.indexOf(e)&&t.preventDefault()}setSingleSelectionAtIndex_(t,e=!0){this.selectedIndex_!==t&&(this.selectedIndex_!==Ir.UNSET_INDEX&&(this.adapter.setSelectedStateForElementIndex(this.selectedIndex_,!1),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(this.selectedIndex_,!1)),e&&this.adapter.setSelectedStateForElementIndex(t,!0),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(t,!0),this.setAriaForSingleSelectionAtIndex_(t),this.selectedIndex_=t,this.adapter.notifySelected(t))}setMultiSelectionAtIndex_(t,e=!0){const i=((t,e)=>{const i=Array.from(t),r=Array.from(e),n={added:[],removed:[]},o=i.sort(Cr),a=r.sort(Cr);let s=0,l=0;for(;s<o.length||l<a.length;){const t=o[s],e=a[l];t!==e?void 0!==t&&(void 0===e||t<e)?(n.removed.push(t),s++):void 0!==e&&(void 0===t||e<t)&&(n.added.push(e),l++):(s++,l++)}return n})(Lr(this.selectedIndex_),t);if(i.removed.length||i.added.length){for(const t of i.removed)e&&this.adapter.setSelectedStateForElementIndex(t,!1),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(t,!1);for(const t of i.added)e&&this.adapter.setSelectedStateForElementIndex(t,!0),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(t,!0);this.selectedIndex_=t,this.adapter.notifySelected(t,i)}}setAriaForSingleSelectionAtIndex_(t){this.selectedIndex_===Ir.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter.getAttributeForElementIndex(t,Rr.ARIA_CURRENT));const e=null!==this.ariaCurrentAttrValue_,i=e?Rr.ARIA_CURRENT:Rr.ARIA_SELECTED;this.selectedIndex_!==Ir.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,i,"false");const r=e?this.ariaCurrentAttrValue_:"true";this.adapter.setAttributeForElementIndex(t,i,r)}setTabindexAtIndex_(t){this.focusedItemIndex_===Ir.UNSET_INDEX&&0!==t?this.adapter.setTabIndexForElementIndex(0,-1):this.focusedItemIndex_>=0&&this.focusedItemIndex_!==t&&this.adapter.setTabIndexForElementIndex(this.focusedItemIndex_,-1),this.adapter.setTabIndexForElementIndex(t,0)}setTabindexToFirstSelectedItem_(){let t=0;"number"==typeof this.selectedIndex_&&this.selectedIndex_!==Ir.UNSET_INDEX?t=this.selectedIndex_:Pr(this.selectedIndex_)&&this.selectedIndex_.size>0&&(t=Math.min(...this.selectedIndex_)),this.setTabindexAtIndex_(t)}isIndexValid_(t){if(t instanceof Set){if(!this.isMulti_)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");if(0===t.size)return!0;{let e=!1;for(const i of t)if(e=this.isIndexInRange_(i),e)break;return e}}if("number"==typeof t){if(this.isMulti_)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return t===Ir.UNSET_INDEX||this.isIndexInRange_(t)}return!1}isIndexInRange_(t){const e=this.adapter.getListItemCount();return t>=0&&t<e}setSelectedIndexOnAction_(t,e,i){if(this.adapter.getDisabledStateForElementIndex(t))return;let r=t;if(this.isMulti_&&(r=new Set([t])),this.isIndexValid_(r)){if(this.isMulti_)this.toggleMultiAtIndex(t,i,e);else if(e||i)this.setSingleSelectionAtIndex_(t,e);else{this.selectedIndex_===t&&this.setSingleSelectionAtIndex_(Ir.UNSET_INDEX)}e&&this.adapter.notifyAction(t)}}toggleMultiAtIndex(t,e,i=!0){let r=!1;r=void 0===e?!this.adapter.getSelectedStateForElementIndex(t):e;const n=Lr(this.selectedIndex_);r?n.add(t):n.delete(t),this.setMultiSelectionAtIndex_(n,i)}}
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Nr=t=>t.hasAttribute("mwc-list-item");function Br(){const t=this.itemsReadyResolver;this.itemsReady=new Promise((t=>this.itemsReadyResolver=t)),t()}class Dr extends He{constructor(){super(),this.mdcAdapter=null,this.mdcFoundationClass=$r,this.activatable=!1,this.multi=!1,this.wrapFocus=!1,this.itemRoles=null,this.innerRole=null,this.innerAriaLabel=null,this.rootTabbable=!1,this.previousTabindex=null,this.noninteractive=!1,this.itemsReadyResolver=()=>{},this.itemsReady=Promise.resolve([]),this.items_=[];const t=function(t,e=50){let i;return function(r=!0){clearTimeout(i),i=setTimeout((()=>{t(r)}),e)}}(this.layout.bind(this));this.debouncedLayout=(e=!0)=>{Br.call(this),t(e)}}async getUpdateComplete(){const t=await super.getUpdateComplete();return await this.itemsReady,t}get items(){return this.items_}updateItems(){var t;const e=null!==(t=this.assignedElements)&&void 0!==t?t:[],i=[];for(const t of e)Nr(t)&&(i.push(t),t._managingList=this),t.hasAttribute("divider")&&!t.hasAttribute("role")&&t.setAttribute("role","separator");this.items_=i;const r=new Set;if(this.items_.forEach(((t,e)=>{this.itemRoles?t.setAttribute("role",this.itemRoles):t.removeAttribute("role"),t.selected&&r.add(e)})),this.multi)this.select(r);else{const t=r.size?r.entries().next().value[1]:-1;this.select(t)}const n=new Event("items-updated",{bubbles:!0,composed:!0});this.dispatchEvent(n)}get selected(){const t=this.index;if(!Pr(t))return-1===t?null:this.items[t];const e=[];for(const i of t)e.push(this.items[i]);return e}get index(){return this.mdcFoundation?this.mdcFoundation.getSelectedIndex():-1}render(){const t=null===this.innerRole?void 0:this.innerRole,e=null===this.innerAriaLabel?void 0:this.innerAriaLabel,i=this.rootTabbable?"0":"-1";return D`
      <!-- @ts-ignore -->
      <ul
          tabindex=${i}
          role="${Ti(t)}"
          aria-label="${Ti(e)}"
          class="mdc-deprecated-list"
          @keydown=${this.onKeydown}
          @focusin=${this.onFocusIn}
          @focusout=${this.onFocusOut}
          @request-selected=${this.onRequestSelected}
          @list-item-rendered=${this.onListItemConnected}>
        <slot></slot>
        ${this.renderPlaceholder()}
      </ul>
    `}renderPlaceholder(){var t;const e=null!==(t=this.assignedElements)&&void 0!==t?t:[];return void 0!==this.emptyMessage&&0===e.length?D`
        <mwc-list-item noninteractive>${this.emptyMessage}</mwc-list-item>
      `:null}firstUpdated(){super.firstUpdated(),this.items.length||(this.mdcFoundation.setMulti(this.multi),this.layout())}onFocusIn(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t);this.mdcFoundation.handleFocusIn(t,e)}}onFocusOut(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t);this.mdcFoundation.handleFocusOut(t,e)}}onKeydown(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t),i=t.target,r=Nr(i);this.mdcFoundation.handleKeydown(t,r,e)}}onRequestSelected(t){if(this.mdcFoundation){let e=this.getIndexOfTarget(t);if(-1===e&&(this.layout(),e=this.getIndexOfTarget(t),-1===e))return;if(this.items[e].disabled)return;const i=t.detail.selected,r=t.detail.source;this.mdcFoundation.handleSingleSelection(e,"interaction"===r,i),t.stopPropagation()}}getIndexOfTarget(t){const e=this.items,i=t.composedPath();for(const t of i){let i=-1;if(Ne(t)&&Nr(t)&&(i=e.indexOf(t)),-1!==i)return i}return-1}createAdapter(){return this.mdcAdapter={getListItemCount:()=>this.mdcRoot?this.items.length:0,getFocusedElementIndex:this.getFocusedItemIndex,getAttributeForElementIndex:(t,e)=>{if(!this.mdcRoot)return"";const i=this.items[t];return i?i.getAttribute(e):""},setAttributeForElementIndex:(t,e,i)=>{if(!this.mdcRoot)return;const r=this.items[t];r&&r.setAttribute(e,i)},focusItemAtIndex:t=>{const e=this.items[t];e&&e.focus()},setTabIndexForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.tabindex=e)},notifyAction:t=>{const e={bubbles:!0,composed:!0};e.detail={index:t};const i=new CustomEvent("action",e);this.dispatchEvent(i)},notifySelected:(t,e)=>{const i={bubbles:!0,composed:!0};i.detail={index:t,diff:e};const r=new CustomEvent("selected",i);this.dispatchEvent(r)},isFocusInsideList:()=>qe(this),isRootFocused:()=>{const t=this.mdcRoot;return t.getRootNode().activeElement===t},setDisabledStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.disabled=e)},getDisabledStateForElementIndex:t=>{const e=this.items[t];return!!e&&e.disabled},setSelectedStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.selected=e)},getSelectedStateForElementIndex:t=>{const e=this.items[t];return!!e&&e.selected},setActivatedStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.activated=e)}},this.mdcAdapter}selectUi(t,e=!1){const i=this.items[t];i&&(i.selected=!0,i.activated=e)}deselectUi(t){const e=this.items[t];e&&(e.selected=!1,e.activated=!1)}select(t){this.mdcFoundation&&this.mdcFoundation.setSelectedIndex(t)}toggle(t,e){this.multi&&this.mdcFoundation.toggleMultiAtIndex(t,e)}onListItemConnected(t){const e=t.target;this.layout(-1===this.items.indexOf(e))}layout(t=!0){t&&this.updateItems();const e=this.items[0];for(const t of this.items)t.tabindex=-1;e&&(this.noninteractive?this.previousTabindex||(this.previousTabindex=e):e.tabindex=0),this.itemsReadyResolver()}getFocusedItemIndex(){if(!this.mdcRoot)return-1;if(!this.items.length)return-1;const t=Ue();if(!t.length)return-1;for(let e=t.length-1;e>=0;e--){const i=t[e];if(Nr(i))return this.items.indexOf(i)}return-1}focusItemAtIndex(t){for(const t of this.items)if(0===t.tabindex){t.tabindex=-1;break}this.items[t].tabindex=0,this.items[t].focus()}focus(){const t=this.mdcRoot;t&&t.focus()}blur(){const t=this.mdcRoot;t&&t.blur()}}r([xt({type:String})],Dr.prototype,"emptyMessage",void 0),r([Et(".mdc-deprecated-list")],Dr.prototype,"mdcRoot",void 0),r([It("",!0,"*")],Dr.prototype,"assignedElements",void 0),r([It("",!0,'[tabindex="0"]')],Dr.prototype,"tabbableElements",void 0),r([xt({type:Boolean}),Ve((function(t){this.mdcFoundation&&this.mdcFoundation.setUseActivatedClass(t)}))],Dr.prototype,"activatable",void 0),r([xt({type:Boolean}),Ve((function(t,e){this.mdcFoundation&&this.mdcFoundation.setMulti(t),void 0!==e&&this.layout()}))],Dr.prototype,"multi",void 0),r([xt({type:Boolean}),Ve((function(t){this.mdcFoundation&&this.mdcFoundation.setWrapFocus(t)}))],Dr.prototype,"wrapFocus",void 0),r([xt({type:String}),Ve((function(t,e){void 0!==e&&this.updateItems()}))],Dr.prototype,"itemRoles",void 0),r([xt({type:String})],Dr.prototype,"innerRole",void 0),r([xt({type:String})],Dr.prototype,"innerAriaLabel",void 0),r([xt({type:Boolean})],Dr.prototype,"rootTabbable",void 0),r([xt({type:Boolean,reflect:!0}),Ve((function(t){var e,i;if(t){const t=null!==(i=null===(e=this.tabbableElements)||void 0===e?void 0:e[0])&&void 0!==i?i:null;this.previousTabindex=t,t&&t.setAttribute("tabindex","-1")}else!t&&this.previousTabindex&&(this.previousTabindex.setAttribute("tabindex","0"),this.previousTabindex=null)}))],Dr.prototype,"noninteractive",void 0);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const jr=at`@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}:host{display:block}.mdc-deprecated-list{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);line-height:1.5rem;margin:0;padding:8px 0;list-style-type:none;color:rgba(0, 0, 0, 0.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87));padding:var(--mdc-list-vertical-padding, 8px) 0}.mdc-deprecated-list:focus{outline:none}.mdc-deprecated-list-item{height:48px}.mdc-deprecated-list--dense{padding-top:4px;padding-bottom:4px;font-size:.812rem}.mdc-deprecated-list ::slotted([divider]){height:0;margin:0;border:none;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgba(0, 0, 0, 0.12)}.mdc-deprecated-list ::slotted([divider][padded]){margin:0 var(--mdc-list-side-padding, 16px)}.mdc-deprecated-list ::slotted([divider][inset]){margin-left:var(--mdc-list-inset-margin, 72px);margin-right:0;width:calc( 100% - var(--mdc-list-inset-margin, 72px) )}[dir=rtl] .mdc-deprecated-list ::slotted([divider][inset]),.mdc-deprecated-list ::slotted([divider][inset][dir=rtl]){margin-left:0;margin-right:var(--mdc-list-inset-margin, 72px)}.mdc-deprecated-list ::slotted([divider][inset][padded]){width:calc( 100% - var(--mdc-list-inset-margin, 72px) - var(--mdc-list-side-padding, 16px) )}.mdc-deprecated-list--dense ::slotted([mwc-list-item]){height:40px}.mdc-deprecated-list--dense ::slotted([mwc-list]){--mdc-list-item-graphic-size: 20px}.mdc-deprecated-list--two-line.mdc-deprecated-list--dense ::slotted([mwc-list-item]),.mdc-deprecated-list--avatar-list.mdc-deprecated-list--dense ::slotted([mwc-list-item]){height:60px}.mdc-deprecated-list--avatar-list.mdc-deprecated-list--dense ::slotted([mwc-list]){--mdc-list-item-graphic-size: 36px}:host([noninteractive]){pointer-events:none;cursor:default}.mdc-deprecated-list--dense ::slotted(.mdc-deprecated-list-item__primary-text){display:block;margin-top:0;line-height:normal;margin-bottom:-20px}.mdc-deprecated-list--dense ::slotted(.mdc-deprecated-list-item__primary-text)::before{display:inline-block;width:0;height:24px;content:"";vertical-align:0}.mdc-deprecated-list--dense ::slotted(.mdc-deprecated-list-item__primary-text)::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}`
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;let zr=class extends Dr{};zr.styles=[jr],zr=r([_t("mwc-list")],zr);
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var Fr,Ur,qr={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},Hr={CLOSED_EVENT:"MDCMenuSurface:closed",CLOSING_EVENT:"MDCMenuSurface:closing",OPENED_EVENT:"MDCMenuSurface:opened",FOCUSABLE_ELEMENTS:["button:not(:disabled)",'[href]:not([aria-disabled="true"])',"input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'].join(", ")},Vr={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67,TOUCH_EVENT_WAIT_MS:30};!function(t){t[t.BOTTOM=1]="BOTTOM",t[t.CENTER=2]="CENTER",t[t.RIGHT=4]="RIGHT",t[t.FLIP_RTL=8]="FLIP_RTL"}(Fr||(Fr={})),function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=4]="TOP_RIGHT",t[t.BOTTOM_LEFT=1]="BOTTOM_LEFT",t[t.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",t[t.TOP_START=8]="TOP_START",t[t.TOP_END=12]="TOP_END",t[t.BOTTOM_START=9]="BOTTOM_START",t[t.BOTTOM_END=13]="BOTTOM_END"}(Ur||(Ur={}));
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var Wr=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.isSurfaceOpen=!1,n.isQuickOpen=!1,n.isHoistedElement=!1,n.isFixedPosition=!1,n.isHorizontallyCenteredOnViewport=!1,n.maxHeight=0,n.openBottomBias=0,n.openAnimationEndTimerId=0,n.closeAnimationEndTimerId=0,n.animationRequestId=0,n.anchorCorner=Ur.TOP_START,n.originCorner=Ur.TOP_START,n.anchorMargin={top:0,right:0,bottom:0,left:0},n.position={x:0,y:0},n}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return qr},enumerable:!1,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return Hr},enumerable:!1,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return Vr},enumerable:!1,configurable:!0}),Object.defineProperty(r,"Corner",{get:function(){return Ur},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyOpen:function(){},notifyClosing:function(){}}},enumerable:!1,configurable:!0}),r.prototype.init=function(){var t=r.cssClasses,e=t.ROOT,i=t.OPEN;if(!this.adapter.hasClass(e))throw new Error(e+" class required in root element.");this.adapter.hasClass(i)&&(this.isSurfaceOpen=!0)},r.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},r.prototype.setAnchorCorner=function(t){this.anchorCorner=t},r.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^Fr.RIGHT},r.prototype.setAnchorMargin=function(t){this.anchorMargin.top=t.top||0,this.anchorMargin.right=t.right||0,this.anchorMargin.bottom=t.bottom||0,this.anchorMargin.left=t.left||0},r.prototype.setIsHoisted=function(t){this.isHoistedElement=t},r.prototype.setFixedPosition=function(t){this.isFixedPosition=t},r.prototype.isFixed=function(){return this.isFixedPosition},r.prototype.setAbsolutePosition=function(t,e){this.position.x=this.isFinite(t)?t:0,this.position.y=this.isFinite(e)?e:0},r.prototype.setIsHorizontallyCenteredOnViewport=function(t){this.isHorizontallyCenteredOnViewport=t},r.prototype.setQuickOpen=function(t){this.isQuickOpen=t},r.prototype.setMaxHeight=function(t){this.maxHeight=t},r.prototype.setOpenBottomBias=function(t){this.openBottomBias=t},r.prototype.isOpen=function(){return this.isSurfaceOpen},r.prototype.open=function(){var t=this;this.isSurfaceOpen||(this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(r.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(r.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame((function(){t.dimensions=t.adapter.getInnerDimensions(),t.autoposition(),t.adapter.addClass(r.cssClasses.OPEN),t.openAnimationEndTimerId=setTimeout((function(){t.openAnimationEndTimerId=0,t.adapter.removeClass(r.cssClasses.ANIMATING_OPEN),t.adapter.notifyOpen()}),Vr.TRANSITION_OPEN_DURATION)})),this.isSurfaceOpen=!0))},r.prototype.close=function(t){var e=this;if(void 0===t&&(t=!1),this.isSurfaceOpen){if(this.adapter.notifyClosing(),this.isQuickOpen)return this.isSurfaceOpen=!1,t||this.maybeRestoreFocus(),this.adapter.removeClass(r.cssClasses.OPEN),this.adapter.removeClass(r.cssClasses.IS_OPEN_BELOW),void this.adapter.notifyClose();this.adapter.addClass(r.cssClasses.ANIMATING_CLOSED),requestAnimationFrame((function(){e.adapter.removeClass(r.cssClasses.OPEN),e.adapter.removeClass(r.cssClasses.IS_OPEN_BELOW),e.closeAnimationEndTimerId=setTimeout((function(){e.closeAnimationEndTimerId=0,e.adapter.removeClass(r.cssClasses.ANIMATING_CLOSED),e.adapter.notifyClose()}),Vr.TRANSITION_CLOSE_DURATION)})),this.isSurfaceOpen=!1,t||this.maybeRestoreFocus()}},r.prototype.handleBodyClick=function(t){var e=t.target;this.adapter.isElementInContainer(e)||this.close()},r.prototype.handleKeydown=function(t){var e=t.keyCode;("Escape"===t.key||27===e)&&this.close()},r.prototype.autoposition=function(){var t;this.measurements=this.getAutoLayoutmeasurements();var e=this.getoriginCorner(),i=this.getMenuSurfaceMaxHeight(e),n=this.hasBit(e,Fr.BOTTOM)?"bottom":"top",o=this.hasBit(e,Fr.RIGHT)?"right":"left",a=this.getHorizontalOriginOffset(e),s=this.getVerticalOriginOffset(e),l=this.measurements,d=l.anchorSize,c=l.surfaceSize,h=((t={})[o]=a,t[n]=s,t);d.width/c.width>Vr.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(o="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(h),this.adapter.setTransformOrigin(o+" "+n),this.adapter.setPosition(h),this.adapter.setMaxHeight(i?i+"px":""),this.hasBit(e,Fr.BOTTOM)||this.adapter.addClass(r.cssClasses.IS_OPEN_BELOW)},r.prototype.getAutoLayoutmeasurements=function(){var t=this.adapter.getAnchorDimensions(),e=this.adapter.getBodyDimensions(),i=this.adapter.getWindowDimensions(),r=this.adapter.getWindowScroll();return t||(t={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:t,bodySize:e,surfaceSize:this.dimensions,viewportDistance:{top:t.top,right:i.width-t.right,bottom:i.height-t.bottom,left:t.left},viewportSize:i,windowScroll:r}},r.prototype.getoriginCorner=function(){var t,e,i=this.originCorner,n=this.measurements,o=n.viewportDistance,a=n.anchorSize,s=n.surfaceSize,l=r.numbers.MARGIN_TO_EDGE;this.hasBit(this.anchorCorner,Fr.BOTTOM)?(t=o.top-l+this.anchorMargin.bottom,e=o.bottom-l-this.anchorMargin.bottom):(t=o.top-l+this.anchorMargin.top,e=o.bottom-l+a.height-this.anchorMargin.top),!(e-s.height>0)&&t>e+this.openBottomBias&&(i=this.setBit(i,Fr.BOTTOM));var d,c,h=this.adapter.isRtl(),u=this.hasBit(this.anchorCorner,Fr.FLIP_RTL),p=this.hasBit(this.anchorCorner,Fr.RIGHT)||this.hasBit(i,Fr.RIGHT),f=!1;(f=h&&u?!p:p)?(d=o.left+a.width+this.anchorMargin.right,c=o.right-this.anchorMargin.right):(d=o.left+this.anchorMargin.left,c=o.right+a.width-this.anchorMargin.left);var m=d-s.width>0,g=c-s.width>0,b=this.hasBit(i,Fr.FLIP_RTL)&&this.hasBit(i,Fr.RIGHT);return g&&b&&h||!m&&b?i=this.unsetBit(i,Fr.RIGHT):(m&&f&&h||m&&!f&&p||!g&&d>=c)&&(i=this.setBit(i,Fr.RIGHT)),i},r.prototype.getMenuSurfaceMaxHeight=function(t){if(this.maxHeight>0)return this.maxHeight;var e=this.measurements.viewportDistance,i=0,n=this.hasBit(t,Fr.BOTTOM),o=this.hasBit(this.anchorCorner,Fr.BOTTOM),a=r.numbers.MARGIN_TO_EDGE;return n?(i=e.top+this.anchorMargin.top-a,o||(i+=this.measurements.anchorSize.height)):(i=e.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-a,o&&(i-=this.measurements.anchorSize.height)),i},r.prototype.getHorizontalOriginOffset=function(t){var e=this.measurements.anchorSize,i=this.hasBit(t,Fr.RIGHT),r=this.hasBit(this.anchorCorner,Fr.RIGHT);if(i){var n=r?e.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?n-(this.measurements.viewportSize.width-this.measurements.bodySize.width):n}return r?e.width-this.anchorMargin.right:this.anchorMargin.left},r.prototype.getVerticalOriginOffset=function(t){var e=this.measurements.anchorSize,i=this.hasBit(t,Fr.BOTTOM),r=this.hasBit(this.anchorCorner,Fr.BOTTOM);return i?r?e.height-this.anchorMargin.top:-this.anchorMargin.bottom:r?e.height+this.anchorMargin.bottom:this.anchorMargin.top},r.prototype.adjustPositionForHoistedElement=function(t){var e,i,r=this.measurements,n=r.windowScroll,a=r.viewportDistance,s=r.surfaceSize,l=r.viewportSize,d=Object.keys(t);try{for(var c=o(d),h=c.next();!h.done;h=c.next()){var u=h.value,p=t[u]||0;!this.isHorizontallyCenteredOnViewport||"left"!==u&&"right"!==u?(p+=a[u],this.isFixedPosition||("top"===u?p+=n.y:"bottom"===u?p-=n.y:"left"===u?p+=n.x:p-=n.x),t[u]=p):t[u]=(l.width-s.width)/2}}catch(t){e={error:t}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(e)throw e.error}}},r.prototype.maybeRestoreFocus=function(){var t=this,e=this.adapter.isFocused(),i=document.activeElement&&this.adapter.isElementInContainer(document.activeElement);(e||i)&&setTimeout((function(){t.adapter.restoreFocus()}),Vr.TOUCH_EVENT_WAIT_MS)},r.prototype.hasBit=function(t,e){return Boolean(t&e)},r.prototype.setBit=function(t,e){return t|e},r.prototype.unsetBit=function(t,e){return t^e},r.prototype.isFinite=function(t){return"number"==typeof t&&isFinite(t)},r}(Oe),Gr=Wr;
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
const Kr={TOP_LEFT:Ur.TOP_LEFT,TOP_RIGHT:Ur.TOP_RIGHT,BOTTOM_LEFT:Ur.BOTTOM_LEFT,BOTTOM_RIGHT:Ur.BOTTOM_RIGHT,TOP_START:Ur.TOP_START,TOP_END:Ur.TOP_END,BOTTOM_START:Ur.BOTTOM_START,BOTTOM_END:Ur.BOTTOM_END};class Xr extends He{constructor(){super(...arguments),this.mdcFoundationClass=Gr,this.absolute=!1,this.fullwidth=!1,this.fixed=!1,this.x=null,this.y=null,this.quick=!1,this.open=!1,this.stayOpenOnBodyClick=!1,this.bitwiseCorner=Ur.TOP_START,this.previousMenuCorner=null,this.menuCorner="START",this.corner="TOP_START",this.styleTop="",this.styleLeft="",this.styleRight="",this.styleBottom="",this.styleMaxHeight="",this.styleTransformOrigin="",this.anchor=null,this.previouslyFocused=null,this.previousAnchor=null,this.onBodyClickBound=()=>{}}render(){const t={"mdc-menu-surface--fixed":this.fixed,"mdc-menu-surface--fullwidth":this.fullwidth},e={top:this.styleTop,left:this.styleLeft,right:this.styleRight,bottom:this.styleBottom,"max-height":this.styleMaxHeight,"transform-origin":this.styleTransformOrigin};return D`
      <div
          class="mdc-menu-surface ${We(t)}"
          style="${xi(e)}"
          @keydown=${this.onKeydown}
          @opened=${this.registerBodyClick}
          @closed=${this.deregisterBodyClick}>
        <slot></slot>
      </div>`}createAdapter(){return Object.assign(Object.assign({},Be(this.mdcRoot)),{hasAnchor:()=>!!this.anchor,notifyClose:()=>{const t=new CustomEvent("closed",{bubbles:!0,composed:!0});this.open=!1,this.mdcRoot.dispatchEvent(t)},notifyClosing:()=>{const t=new CustomEvent("closing",{bubbles:!0,composed:!0});this.mdcRoot.dispatchEvent(t)},notifyOpen:()=>{const t=new CustomEvent("opened",{bubbles:!0,composed:!0});this.open=!0,this.mdcRoot.dispatchEvent(t)},isElementInContainer:()=>!1,isRtl:()=>!!this.mdcRoot&&"rtl"===getComputedStyle(this.mdcRoot).direction,setTransformOrigin:t=>{this.mdcRoot&&(this.styleTransformOrigin=t)},isFocused:()=>qe(this),saveFocus:()=>{const t=Ue(),e=t.length;e||(this.previouslyFocused=null),this.previouslyFocused=t[e-1]},restoreFocus:()=>{this.previouslyFocused&&"focus"in this.previouslyFocused&&this.previouslyFocused.focus()},getInnerDimensions:()=>{const t=this.mdcRoot;return t?{width:t.offsetWidth,height:t.offsetHeight}:{width:0,height:0}},getAnchorDimensions:()=>{const t=this.anchor;return t?t.getBoundingClientRect():null},getBodyDimensions:()=>({width:document.body.clientWidth,height:document.body.clientHeight}),getWindowDimensions:()=>({width:window.innerWidth,height:window.innerHeight}),getWindowScroll:()=>({x:window.pageXOffset,y:window.pageYOffset}),setPosition:t=>{this.mdcRoot&&(this.styleLeft="left"in t?`${t.left}px`:"",this.styleRight="right"in t?`${t.right}px`:"",this.styleTop="top"in t?`${t.top}px`:"",this.styleBottom="bottom"in t?`${t.bottom}px`:"")},setMaxHeight:async t=>{this.mdcRoot&&(this.styleMaxHeight=t,await this.updateComplete,this.styleMaxHeight=`var(--mdc-menu-max-height, ${t})`)}})}onKeydown(t){this.mdcFoundation&&this.mdcFoundation.handleKeydown(t)}onBodyClick(t){if(this.stayOpenOnBodyClick)return;-1===t.composedPath().indexOf(this)&&this.close()}registerBodyClick(){this.onBodyClickBound=this.onBodyClick.bind(this),document.body.addEventListener("click",this.onBodyClickBound,{passive:!0,capture:!0})}deregisterBodyClick(){document.body.removeEventListener("click",this.onBodyClickBound,{capture:!0})}close(){this.open=!1}show(){this.open=!0}}r([Et(".mdc-menu-surface")],Xr.prototype,"mdcRoot",void 0),r([Et("slot")],Xr.prototype,"slotElement",void 0),r([xt({type:Boolean}),Ve((function(t){this.mdcFoundation&&!this.fixed&&this.mdcFoundation.setIsHoisted(t)}))],Xr.prototype,"absolute",void 0),r([xt({type:Boolean})],Xr.prototype,"fullwidth",void 0),r([xt({type:Boolean}),Ve((function(t){this.mdcFoundation&&!this.absolute&&this.mdcFoundation.setFixedPosition(t)}))],Xr.prototype,"fixed",void 0),r([xt({type:Number}),Ve((function(t){this.mdcFoundation&&null!==this.y&&null!==t&&(this.mdcFoundation.setAbsolutePosition(t,this.y),this.mdcFoundation.setAnchorMargin({left:t,top:this.y,right:-t,bottom:this.y}))}))],Xr.prototype,"x",void 0),r([xt({type:Number}),Ve((function(t){this.mdcFoundation&&null!==this.x&&null!==t&&(this.mdcFoundation.setAbsolutePosition(this.x,t),this.mdcFoundation.setAnchorMargin({left:this.x,top:t,right:-this.x,bottom:t}))}))],Xr.prototype,"y",void 0),r([xt({type:Boolean}),Ve((function(t){this.mdcFoundation&&this.mdcFoundation.setQuickOpen(t)}))],Xr.prototype,"quick",void 0),r([xt({type:Boolean,reflect:!0}),Ve((function(t,e){this.mdcFoundation&&(t?this.mdcFoundation.open():void 0!==e&&this.mdcFoundation.close())}))],Xr.prototype,"open",void 0),r([xt({type:Boolean})],Xr.prototype,"stayOpenOnBodyClick",void 0),r([Mt(),Ve((function(t){this.mdcFoundation&&this.mdcFoundation.setAnchorCorner(t)}))],Xr.prototype,"bitwiseCorner",void 0),r([xt({type:String}),Ve((function(t){if(this.mdcFoundation){const e="START"===t||"END"===t,i=null===this.previousMenuCorner,r=!i&&t!==this.previousMenuCorner,n=i&&"END"===t;e&&(r||n)&&(this.bitwiseCorner=this.bitwiseCorner^Fr.RIGHT,this.mdcFoundation.flipCornerHorizontally(),this.previousMenuCorner=t)}}))],Xr.prototype,"menuCorner",void 0),r([xt({type:String}),Ve((function(t){if(this.mdcFoundation&&t){let e=Kr[t];"END"===this.menuCorner&&(e^=Fr.RIGHT),this.bitwiseCorner=e}}))],Xr.prototype,"corner",void 0),r([Mt()],Xr.prototype,"styleTop",void 0),r([Mt()],Xr.prototype,"styleLeft",void 0),r([Mt()],Xr.prototype,"styleRight",void 0),r([Mt()],Xr.prototype,"styleBottom",void 0),r([Mt()],Xr.prototype,"styleMaxHeight",void 0),r([Mt()],Xr.prototype,"styleTransformOrigin",void 0);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const Yr=at`.mdc-menu-surface{display:none;position:absolute;box-sizing:border-box;max-width:calc(100vw - 32px);max-width:var(--mdc-menu-max-width, calc(100vw - 32px));max-height:calc(100vh - 32px);max-height:var(--mdc-menu-max-height, calc(100vh - 32px));margin:0;padding:0;transform:scale(1);transform-origin:top left;opacity:0;overflow:auto;will-change:transform,opacity;z-index:8;transition:opacity .03s linear,transform .12s cubic-bezier(0, 0, 0.2, 1),height 250ms cubic-bezier(0, 0, 0.2, 1);box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2),0px 8px 10px 1px rgba(0, 0, 0, 0.14),0px 3px 14px 2px rgba(0,0,0,.12);background-color:#fff;background-color:var(--mdc-theme-surface, #fff);color:#000;color:var(--mdc-theme-on-surface, #000);border-radius:4px;border-radius:var(--mdc-shape-medium, 4px);transform-origin-left:top left;transform-origin-right:top right}.mdc-menu-surface:focus{outline:none}.mdc-menu-surface--animating-open{display:inline-block;transform:scale(0.8);opacity:0}.mdc-menu-surface--open{display:inline-block;transform:scale(1);opacity:1}.mdc-menu-surface--animating-closed{display:inline-block;opacity:0;transition:opacity .075s linear}[dir=rtl] .mdc-menu-surface,.mdc-menu-surface[dir=rtl]{transform-origin-left:top right;transform-origin-right:top left}.mdc-menu-surface--anchor{position:relative;overflow:visible}.mdc-menu-surface--fixed{position:fixed}.mdc-menu-surface--fullwidth{width:100%}:host(:not([open])){display:none}.mdc-menu-surface{z-index:8;z-index:var(--mdc-menu-z-index, 8);min-width:112px;min-width:var(--mdc-menu-min-width, 112px)}`
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;let Zr=class extends Xr{};Zr.styles=[Yr],Zr=r([_t("mwc-menu-surface")],Zr);
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var Jr,Qr={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},tn={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list,.mdc-deprecated-list",SELECTED_EVENT:"MDCMenu:selected",SKIP_RESTORE_FOCUS:"data-menu-item-skip-restore-focus"},en={FOCUS_ROOT_INDEX:-1};!function(t){t[t.NONE=0]="NONE",t[t.LIST_ROOT=1]="LIST_ROOT",t[t.FIRST_ITEM=2]="FIRST_ITEM",t[t.LAST_ITEM=3]="LAST_ITEM"}(Jr||(Jr={}));
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var rn=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.closeAnimationEndTimerId=0,n.defaultFocusState=Jr.LIST_ROOT,n.selectedIndex=-1,n}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return Qr},enumerable:!1,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return tn},enumerable:!1,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return en},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},getAttributeFromElementAtIndex:function(){return null},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return-1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return-1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!1,configurable:!0}),r.prototype.destroy=function(){this.closeAnimationEndTimerId&&clearTimeout(this.closeAnimationEndTimerId),this.adapter.closeSurface()},r.prototype.handleKeydown=function(t){var e=t.key,i=t.keyCode;("Tab"===e||9===i)&&this.adapter.closeSurface(!0)},r.prototype.handleItemAction=function(t){var e=this,i=this.adapter.getElementIndex(t);if(!(i<0)){this.adapter.notifySelected({index:i});var r="true"===this.adapter.getAttributeFromElementAtIndex(i,tn.SKIP_RESTORE_FOCUS);this.adapter.closeSurface(r),this.closeAnimationEndTimerId=setTimeout((function(){var i=e.adapter.getElementIndex(t);i>=0&&e.adapter.isSelectableItemAtIndex(i)&&e.setSelectedIndex(i)}),Wr.numbers.TRANSITION_CLOSE_DURATION)}},r.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState){case Jr.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case Jr.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case Jr.NONE:break;default:this.adapter.focusListRoot()}},r.prototype.setDefaultFocusState=function(t){this.defaultFocusState=t},r.prototype.getSelectedIndex=function(){return this.selectedIndex},r.prototype.setSelectedIndex=function(t){if(this.validatedIndex(t),!this.adapter.isSelectableItemAtIndex(t))throw new Error("MDCMenuFoundation: No selection group at specified index.");var e=this.adapter.getSelectedSiblingOfItemAtIndex(t);e>=0&&(this.adapter.removeAttributeFromElementAtIndex(e,tn.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(e,Qr.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(t,Qr.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(t,tn.ARIA_CHECKED_ATTR,"true"),this.selectedIndex=t},r.prototype.setEnabled=function(t,e){this.validatedIndex(t),e?(this.adapter.removeClassFromElementAtIndex(t,Mr),this.adapter.addAttributeToElementAtIndex(t,tn.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(t,Mr),this.adapter.addAttributeToElementAtIndex(t,tn.ARIA_DISABLED_ATTR,"true"))},r.prototype.validatedIndex=function(t){var e=this.adapter.getMenuItemCount();if(!(t>=0&&t<e))throw new Error("MDCMenuFoundation: No list item at specified index.")},r}(Oe);
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class nn extends He{constructor(){super(...arguments),this.mdcFoundationClass=rn,this.listElement_=null,this.anchor=null,this.open=!1,this.quick=!1,this.wrapFocus=!1,this.innerRole="menu",this.innerAriaLabel=null,this.corner="TOP_START",this.x=null,this.y=null,this.absolute=!1,this.multi=!1,this.activatable=!1,this.fixed=!1,this.forceGroupSelection=!1,this.fullwidth=!1,this.menuCorner="START",this.stayOpenOnBodyClick=!1,this.defaultFocus="LIST_ROOT",this._listUpdateComplete=null}get listElement(){return this.listElement_||(this.listElement_=this.renderRoot.querySelector("mwc-list")),this.listElement_}get items(){const t=this.listElement;return t?t.items:[]}get index(){const t=this.listElement;return t?t.index:-1}get selected(){const t=this.listElement;return t?t.selected:null}render(){const t="menu"===this.innerRole?"menuitem":"option";return D`
      <mwc-menu-surface
          ?hidden=${!this.open}
          .anchor=${this.anchor}
          .open=${this.open}
          .quick=${this.quick}
          .corner=${this.corner}
          .x=${this.x}
          .y=${this.y}
          .absolute=${this.absolute}
          .fixed=${this.fixed}
          .fullwidth=${this.fullwidth}
          .menuCorner=${this.menuCorner}
          ?stayOpenOnBodyClick=${this.stayOpenOnBodyClick}
          class="mdc-menu mdc-menu-surface"
          @closed=${this.onClosed}
          @opened=${this.onOpened}
          @keydown=${this.onKeydown}>
        <mwc-list
          rootTabbable
          .innerAriaLabel=${this.innerAriaLabel}
          .innerRole=${this.innerRole}
          .multi=${this.multi}
          class="mdc-deprecated-list"
          .itemRoles=${t}
          .wrapFocus=${this.wrapFocus}
          .activatable=${this.activatable}
          @action=${this.onAction}>
        <slot></slot>
      </mwc-list>
    </mwc-menu-surface>`}createAdapter(){return{addClassToElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const r=i.items[t];r&&("mdc-menu-item--selected"===e?this.forceGroupSelection&&!r.selected&&i.toggle(t,!0):r.classList.add(e))},removeClassFromElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const r=i.items[t];r&&("mdc-menu-item--selected"===e?r.selected&&i.toggle(t,!1):r.classList.remove(e))},addAttributeToElementAtIndex:(t,e,i)=>{const r=this.listElement;if(!r)return;const n=r.items[t];n&&n.setAttribute(e,i)},removeAttributeFromElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const r=i.items[t];r&&r.removeAttribute(e)},getAttributeFromElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return null;const r=i.items[t];return r?r.getAttribute(e):null},elementContainsClass:(t,e)=>t.classList.contains(e),closeSurface:()=>{this.open=!1},getElementIndex:t=>{const e=this.listElement;return e?e.items.indexOf(t):-1},notifySelected:()=>{},getMenuItemCount:()=>{const t=this.listElement;return t?t.items.length:0},focusItemAtIndex:t=>{const e=this.listElement;if(!e)return;const i=e.items[t];i&&i.focus()},focusListRoot:()=>{this.listElement&&this.listElement.focus()},getSelectedSiblingOfItemAtIndex:t=>{const e=this.listElement;if(!e)return-1;const i=e.items[t];if(!i||!i.group)return-1;for(let r=0;r<e.items.length;r++){if(r===t)continue;const n=e.items[r];if(n.selected&&n.group===i.group)return r}return-1},isSelectableItemAtIndex:t=>{const e=this.listElement;if(!e)return!1;const i=e.items[t];return!!i&&i.hasAttribute("group")}}}onKeydown(t){this.mdcFoundation&&this.mdcFoundation.handleKeydown(t)}onAction(t){const e=this.listElement;if(this.mdcFoundation&&e){const i=t.detail.index,r=e.items[i];r&&this.mdcFoundation.handleItemAction(r)}}onOpened(){this.open=!0,this.mdcFoundation&&this.mdcFoundation.handleMenuSurfaceOpened()}onClosed(){this.open=!1}async getUpdateComplete(){await this._listUpdateComplete;return await super.getUpdateComplete()}async firstUpdated(){super.firstUpdated();const t=this.listElement;t&&(this._listUpdateComplete=t.updateComplete,await this._listUpdateComplete)}select(t){const e=this.listElement;e&&e.select(t)}close(){this.open=!1}show(){this.open=!0}getFocusedItemIndex(){const t=this.listElement;return t?t.getFocusedItemIndex():-1}focusItemAtIndex(t){const e=this.listElement;e&&e.focusItemAtIndex(t)}layout(t=!0){const e=this.listElement;e&&e.layout(t)}}r([Et(".mdc-menu")],nn.prototype,"mdcRoot",void 0),r([Et("slot")],nn.prototype,"slotElement",void 0),r([xt({type:Object})],nn.prototype,"anchor",void 0),r([xt({type:Boolean,reflect:!0})],nn.prototype,"open",void 0),r([xt({type:Boolean})],nn.prototype,"quick",void 0),r([xt({type:Boolean})],nn.prototype,"wrapFocus",void 0),r([xt({type:String})],nn.prototype,"innerRole",void 0),r([xt({type:String})],nn.prototype,"innerAriaLabel",void 0),r([xt({type:String})],nn.prototype,"corner",void 0),r([xt({type:Number})],nn.prototype,"x",void 0),r([xt({type:Number})],nn.prototype,"y",void 0),r([xt({type:Boolean})],nn.prototype,"absolute",void 0),r([xt({type:Boolean})],nn.prototype,"multi",void 0),r([xt({type:Boolean})],nn.prototype,"activatable",void 0),r([xt({type:Boolean})],nn.prototype,"fixed",void 0),r([xt({type:Boolean})],nn.prototype,"forceGroupSelection",void 0),r([xt({type:Boolean})],nn.prototype,"fullwidth",void 0),r([xt({type:String})],nn.prototype,"menuCorner",void 0),r([xt({type:Boolean})],nn.prototype,"stayOpenOnBodyClick",void 0),r([xt({type:String}),Ve((function(t){this.mdcFoundation&&this.mdcFoundation.setDefaultFocusState(Jr[t])}))],nn.prototype,"defaultFocus",void 0);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const on=at`mwc-list ::slotted([mwc-list-item]:not([twoline])),mwc-list ::slotted([noninteractive]:not([twoline])){height:var(--mdc-menu-item-height, 48px)}`
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;let an=class extends nn{};an.styles=[on],an=r([_t("mwc-menu")],an);
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var sn={NOTCH_ELEMENT_SELECTOR:".mdc-notched-outline__notch"},ln={NOTCH_ELEMENT_PADDING:8},dn={NO_LABEL:"mdc-notched-outline--no-label",OUTLINE_NOTCHED:"mdc-notched-outline--notched",OUTLINE_UPGRADED:"mdc-notched-outline--upgraded"},cn=function(t){function r(e){return t.call(this,i(i({},r.defaultAdapter),e))||this}return e(r,t),Object.defineProperty(r,"strings",{get:function(){return sn},enumerable:!1,configurable:!0}),Object.defineProperty(r,"cssClasses",{get:function(){return dn},enumerable:!1,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return ln},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNotchWidthProperty:function(){},removeNotchWidthProperty:function(){}}},enumerable:!1,configurable:!0}),r.prototype.notch=function(t){var e=r.cssClasses.OUTLINE_NOTCHED;t>0&&(t+=ln.NOTCH_ELEMENT_PADDING),this.adapter.setNotchWidthProperty(t),this.adapter.addClass(e)},r.prototype.closeNotch=function(){var t=r.cssClasses.OUTLINE_NOTCHED;this.adapter.removeClass(t),this.adapter.removeNotchWidthProperty()},r}(Oe);
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class hn extends He{constructor(){super(...arguments),this.mdcFoundationClass=cn,this.width=0,this.open=!1,this.lastOpen=this.open}createAdapter(){return{addClass:t=>this.mdcRoot.classList.add(t),removeClass:t=>this.mdcRoot.classList.remove(t),setNotchWidthProperty:t=>this.notchElement.style.setProperty("width",`${t}px`),removeNotchWidthProperty:()=>this.notchElement.style.removeProperty("width")}}openOrClose(t,e){this.mdcFoundation&&(t&&void 0!==e?this.mdcFoundation.notch(e):this.mdcFoundation.closeNotch())}render(){this.openOrClose(this.open,this.width);const t=We({"mdc-notched-outline--notched":this.open});return D`
      <span class="mdc-notched-outline ${t}">
        <span class="mdc-notched-outline__leading"></span>
        <span class="mdc-notched-outline__notch">
          <slot></slot>
        </span>
        <span class="mdc-notched-outline__trailing"></span>
      </span>`}}r([Et(".mdc-notched-outline")],hn.prototype,"mdcRoot",void 0),r([xt({type:Number})],hn.prototype,"width",void 0),r([xt({type:Boolean,reflect:!0})],hn.prototype,"open",void 0),r([Et(".mdc-notched-outline__notch")],hn.prototype,"notchElement",void 0);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const un=at`.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline,.mdc-notched-outline[dir=rtl]{text-align:right}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{box-sizing:border-box;height:100%;border-top:1px solid;border-bottom:1px solid;pointer-events:none}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;width:12px}[dir=rtl] .mdc-notched-outline__leading,.mdc-notched-outline__leading[dir=rtl]{border-left:none;border-right:1px solid}.mdc-notched-outline__trailing{border-left:none;border-right:1px solid;flex-grow:1}[dir=rtl] .mdc-notched-outline__trailing,.mdc-notched-outline__trailing[dir=rtl]{border-left:1px solid;border-right:none}.mdc-notched-outline__notch{flex:0 0 auto;width:auto;max-width:calc(100% - 12px * 2)}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(100% / 0.75)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch,.mdc-notched-outline--notched .mdc-notched-outline__notch[dir=rtl]{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}:host{display:block;position:absolute;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] :host,:host([dir=rtl]){text-align:right}::slotted(.mdc-floating-label){display:inline-block;position:relative;top:17px;bottom:auto;max-width:100%}::slotted(.mdc-floating-label--float-above){text-overflow:clip}.mdc-notched-outline--upgraded ::slotted(.mdc-floating-label--float-above){max-width:calc(100% / 0.75)}.mdc-notched-outline .mdc-notched-outline__leading{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}[dir=rtl] .mdc-notched-outline .mdc-notched-outline__leading,.mdc-notched-outline .mdc-notched-outline__leading[dir=rtl]{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}@supports(top: max(0%)){.mdc-notched-outline .mdc-notched-outline__leading{width:max(12px, var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-notched-outline .mdc-notched-outline__notch{max-width:calc(100% - max(12px, var(--mdc-shape-small, 4px)) * 2)}}.mdc-notched-outline .mdc-notched-outline__trailing{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}[dir=rtl] .mdc-notched-outline .mdc-notched-outline__trailing,.mdc-notched-outline .mdc-notched-outline__trailing[dir=rtl]{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{border-color:var(--mdc-notched-outline-border-color, var(--mdc-theme-primary, #6200ee));border-width:1px;border-width:var(--mdc-notched-outline-stroke-width, 1px)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:0;padding-top:var(--mdc-notched-outline-notch-offset, 0)}`
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;let pn=class extends hn{};pn.styles=[un],pn=r([_t("mwc-notched-outline")],pn);
/**
 * @license
 * Copyright 2020 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var fn,mn,gn=["input","button","textarea","select"],bn=function(t){var e=t.target;if(e){var i=(""+e.tagName).toLowerCase();-1===gn.indexOf(i)&&t.preventDefault()}};function vn(t,e){for(var i=new Map,r=0;r<t;r++){var n=e(r).trim();if(n){var o=n[0].toLowerCase();i.has(o)||i.set(o,[]),i.get(o).push({text:n.toLowerCase(),index:r})}}return i.forEach((function(t){t.sort((function(t,e){return t.index-e.index}))})),i}function yn(t,e){var i,r=t.nextChar,n=t.focusItemAtIndex,o=t.sortedIndexByFirstChar,a=t.focusedItemIndex,s=t.skipFocus,l=t.isItemAtIndexDisabled;return clearTimeout(e.bufferClearTimeout),e.bufferClearTimeout=setTimeout((function(){!function(t){t.typeaheadBuffer=""}(e)}),Ir.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS),e.typeaheadBuffer=e.typeaheadBuffer+r,-1===(i=1===e.typeaheadBuffer.length?function(t,e,i,r){var n=r.typeaheadBuffer[0],o=t.get(n);if(!o)return-1;if(n===r.currentFirstChar&&o[r.sortedIndexCursor].index===e){r.sortedIndexCursor=(r.sortedIndexCursor+1)%o.length;var a=o[r.sortedIndexCursor].index;if(!i(a))return a}r.currentFirstChar=n;var s,l=-1;for(s=0;s<o.length;s++)if(!i(o[s].index)){l=s;break}for(;s<o.length;s++)if(o[s].index>e&&!i(o[s].index)){l=s;break}if(-1!==l)return r.sortedIndexCursor=l,o[r.sortedIndexCursor].index;return-1}(o,a,l,e):function(t,e,i){var r=i.typeaheadBuffer[0],n=t.get(r);if(!n)return-1;var o=n[i.sortedIndexCursor];if(0===o.text.lastIndexOf(i.typeaheadBuffer,0)&&!e(o.index))return o.index;var a=(i.sortedIndexCursor+1)%n.length,s=-1;for(;a!==i.sortedIndexCursor;){var l=n[a],d=0===l.text.lastIndexOf(i.typeaheadBuffer,0),c=!e(l.index);if(d&&c){s=a;break}a=(a+1)%n.length}if(-1!==s)return i.sortedIndexCursor=s,n[i.sortedIndexCursor].index;return-1}(o,l,e))||s||n(i),i}function _n(t){return t.typeaheadBuffer.length>0}const wn=null!==(mn=null===(fn=window.ShadyDOM)||void 0===fn?void 0:fn.inUse)&&void 0!==mn&&mn;class xn extends He{constructor(){super(...arguments),this.disabled=!1,this.containingForm=null,this.formDataListener=t=>{this.disabled||this.setFormData(t.formData)}}findFormElement(){if(!this.shadowRoot||wn)return null;const t=this.getRootNode().querySelectorAll("form");for(const e of Array.from(t))if(e.contains(this))return e;return null}connectedCallback(){var t;super.connectedCallback(),this.containingForm=this.findFormElement(),null===(t=this.containingForm)||void 0===t||t.addEventListener("formdata",this.formDataListener)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this.containingForm)||void 0===t||t.removeEventListener("formdata",this.formDataListener),this.containingForm=null}click(){this.formElement&&!this.disabled&&(this.formElement.focus(),this.formElement.click())}firstUpdated(){super.firstUpdated(),this.shadowRoot&&this.mdcRoot.addEventListener("change",(t=>{this.dispatchEvent(new Event("change",t))}))}}xn.shadowRootOptions={mode:"open",delegatesFocus:!0},r([xt({type:Boolean})],xn.prototype,"disabled",void 0);
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var Mn={LABEL_FLOAT_ABOVE:"mdc-floating-label--float-above",LABEL_REQUIRED:"mdc-floating-label--required",LABEL_SHAKE:"mdc-floating-label--shake",ROOT:"mdc-floating-label"},kn=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.shakeAnimationEndHandler=function(){n.handleShakeAnimationEnd()},n}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return Mn},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},getWidth:function(){return 0},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}}},enumerable:!1,configurable:!0}),r.prototype.init=function(){this.adapter.registerInteractionHandler("animationend",this.shakeAnimationEndHandler)},r.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("animationend",this.shakeAnimationEndHandler)},r.prototype.getWidth=function(){return this.adapter.getWidth()},r.prototype.shake=function(t){var e=r.cssClasses.LABEL_SHAKE;t?this.adapter.addClass(e):this.adapter.removeClass(e)},r.prototype.float=function(t){var e=r.cssClasses,i=e.LABEL_FLOAT_ABOVE,n=e.LABEL_SHAKE;t?this.adapter.addClass(i):(this.adapter.removeClass(i),this.adapter.removeClass(n))},r.prototype.setRequired=function(t){var e=r.cssClasses.LABEL_REQUIRED;t?this.adapter.addClass(e):this.adapter.removeClass(e)},r.prototype.handleShakeAnimationEnd=function(){var t=r.cssClasses.LABEL_SHAKE;this.adapter.removeClass(t)},r}(Oe);
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */const Sn=qt(class extends Ht{constructor(t){switch(super(t),this.foundation=null,this.previousPart=null,t.type){case jt:case Ft:break;default:throw new Error("FloatingLabel directive only support attribute and property parts")}}update(t,[e]){if(t!==this.previousPart){this.foundation&&this.foundation.destroy(),this.previousPart=t;const e=t.element;e.classList.add("mdc-floating-label");const i=(t=>({addClass:e=>t.classList.add(e),removeClass:e=>t.classList.remove(e),getWidth:()=>t.scrollWidth,registerInteractionHandler:(e,i)=>{t.addEventListener(e,i)},deregisterInteractionHandler:(e,i)=>{t.removeEventListener(e,i)}}))(e);this.foundation=new kn(i),this.foundation.init()}return this.render(e)}render(t){return this.foundation}});
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */var En={LINE_RIPPLE_ACTIVE:"mdc-line-ripple--active",LINE_RIPPLE_DEACTIVATING:"mdc-line-ripple--deactivating"},An=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.transitionEndHandler=function(t){n.handleTransitionEnd(t)},n}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return En},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){}}},enumerable:!1,configurable:!0}),r.prototype.init=function(){this.adapter.registerEventHandler("transitionend",this.transitionEndHandler)},r.prototype.destroy=function(){this.adapter.deregisterEventHandler("transitionend",this.transitionEndHandler)},r.prototype.activate=function(){this.adapter.removeClass(En.LINE_RIPPLE_DEACTIVATING),this.adapter.addClass(En.LINE_RIPPLE_ACTIVE)},r.prototype.setRippleCenter=function(t){this.adapter.setStyle("transform-origin",t+"px center")},r.prototype.deactivate=function(){this.adapter.addClass(En.LINE_RIPPLE_DEACTIVATING)},r.prototype.handleTransitionEnd=function(t){var e=this.adapter.hasClass(En.LINE_RIPPLE_DEACTIVATING);"opacity"===t.propertyName&&e&&(this.adapter.removeClass(En.LINE_RIPPLE_ACTIVE),this.adapter.removeClass(En.LINE_RIPPLE_DEACTIVATING))},r}(Oe);
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */const Tn=qt(class extends Ht{constructor(t){switch(super(t),this.previousPart=null,this.foundation=null,t.type){case jt:case Ft:return;default:throw new Error("LineRipple only support attribute and property parts.")}}update(t,e){if(this.previousPart!==t){this.foundation&&this.foundation.destroy(),this.previousPart=t;const e=t.element;e.classList.add("mdc-line-ripple");const i=(t=>({addClass:e=>t.classList.add(e),removeClass:e=>t.classList.remove(e),hasClass:e=>t.classList.contains(e),setStyle:(e,i)=>t.style.setProperty(e,i),registerEventHandler:(e,i)=>{t.addEventListener(e,i)},deregisterEventHandler:(e,i)=>{t.removeEventListener(e,i)}}))(e);this.foundation=new An(i),this.foundation.init()}return this.render()}render(){return this.foundation}});
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */var Rn={ACTIVATED:"mdc-select--activated",DISABLED:"mdc-select--disabled",FOCUSED:"mdc-select--focused",INVALID:"mdc-select--invalid",MENU_INVALID:"mdc-select__menu--invalid",OUTLINED:"mdc-select--outlined",REQUIRED:"mdc-select--required",ROOT:"mdc-select",WITH_LEADING_ICON:"mdc-select--with-leading-icon"},In={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",ARIA_SELECTED_ATTR:"aria-selected",CHANGE_EVENT:"MDCSelect:change",HIDDEN_INPUT_SELECTOR:'input[type="hidden"]',LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-select__icon",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",MENU_SELECTOR:".mdc-select__menu",OUTLINE_SELECTOR:".mdc-notched-outline",SELECTED_TEXT_SELECTOR:".mdc-select__selected-text",SELECT_ANCHOR_SELECTOR:".mdc-select__anchor",VALUE_ATTR:"data-value"},Cn={LABEL_SCALE:.75,UNSET_INDEX:-1,CLICK_DEBOUNCE_TIMEOUT_MS:330},On=function(t){function r(e,n){void 0===n&&(n={});var o=t.call(this,i(i({},r.defaultAdapter),e))||this;return o.disabled=!1,o.isMenuOpen=!1,o.useDefaultValidation=!0,o.customValidity=!0,o.lastSelectedIndex=Cn.UNSET_INDEX,o.clickDebounceTimeout=0,o.recentlyClicked=!1,o.leadingIcon=n.leadingIcon,o.helperText=n.helperText,o}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return Rn},enumerable:!1,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return Cn},enumerable:!1,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return In},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},activateBottomLine:function(){},deactivateBottomLine:function(){},getSelectedIndex:function(){return-1},setSelectedIndex:function(){},hasLabel:function(){return!1},floatLabel:function(){},getLabelWidth:function(){return 0},setLabelRequired:function(){},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){},setRippleCenter:function(){},notifyChange:function(){},setSelectedText:function(){},isSelectAnchorFocused:function(){return!1},getSelectAnchorAttr:function(){return""},setSelectAnchorAttr:function(){},removeSelectAnchorAttr:function(){},addMenuClass:function(){},removeMenuClass:function(){},openMenu:function(){},closeMenu:function(){},getAnchorElement:function(){return null},setMenuAnchorElement:function(){},setMenuAnchorCorner:function(){},setMenuWrapFocus:function(){},focusMenuItemAtIndex:function(){},getMenuItemCount:function(){return 0},getMenuItemValues:function(){return[]},getMenuItemTextAtIndex:function(){return""},isTypeaheadInProgress:function(){return!1},typeaheadMatchItem:function(){return-1}}},enumerable:!1,configurable:!0}),r.prototype.getSelectedIndex=function(){return this.adapter.getSelectedIndex()},r.prototype.setSelectedIndex=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1),t>=this.adapter.getMenuItemCount()||(t===Cn.UNSET_INDEX?this.adapter.setSelectedText(""):this.adapter.setSelectedText(this.adapter.getMenuItemTextAtIndex(t).trim()),this.adapter.setSelectedIndex(t),e&&this.adapter.closeMenu(),i||this.lastSelectedIndex===t||this.handleChange(),this.lastSelectedIndex=t)},r.prototype.setValue=function(t,e){void 0===e&&(e=!1);var i=this.adapter.getMenuItemValues().indexOf(t);this.setSelectedIndex(i,!1,e)},r.prototype.getValue=function(){var t=this.adapter.getSelectedIndex(),e=this.adapter.getMenuItemValues();return t!==Cn.UNSET_INDEX?e[t]:""},r.prototype.getDisabled=function(){return this.disabled},r.prototype.setDisabled=function(t){this.disabled=t,this.disabled?(this.adapter.addClass(Rn.DISABLED),this.adapter.closeMenu()):this.adapter.removeClass(Rn.DISABLED),this.leadingIcon&&this.leadingIcon.setDisabled(this.disabled),this.disabled?this.adapter.removeSelectAnchorAttr("tabindex"):this.adapter.setSelectAnchorAttr("tabindex","0"),this.adapter.setSelectAnchorAttr("aria-disabled",this.disabled.toString())},r.prototype.openMenu=function(){this.adapter.addClass(Rn.ACTIVATED),this.adapter.openMenu(),this.isMenuOpen=!0,this.adapter.setSelectAnchorAttr("aria-expanded","true")},r.prototype.setHelperTextContent=function(t){this.helperText&&this.helperText.setContent(t)},r.prototype.layout=function(){if(this.adapter.hasLabel()){var t=this.getValue().length>0,e=this.adapter.hasClass(Rn.FOCUSED),i=t||e,r=this.adapter.hasClass(Rn.REQUIRED);this.notchOutline(i),this.adapter.floatLabel(i),this.adapter.setLabelRequired(r)}},r.prototype.layoutOptions=function(){var t=this.adapter.getMenuItemValues().indexOf(this.getValue());this.setSelectedIndex(t,!1,!0)},r.prototype.handleMenuOpened=function(){if(0!==this.adapter.getMenuItemValues().length){var t=this.getSelectedIndex(),e=t>=0?t:0;this.adapter.focusMenuItemAtIndex(e)}},r.prototype.handleMenuClosing=function(){this.adapter.setSelectAnchorAttr("aria-expanded","false")},r.prototype.handleMenuClosed=function(){this.adapter.removeClass(Rn.ACTIVATED),this.isMenuOpen=!1,this.adapter.isSelectAnchorFocused()||this.blur()},r.prototype.handleChange=function(){this.layout(),this.adapter.notifyChange(this.getValue()),this.adapter.hasClass(Rn.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},r.prototype.handleMenuItemAction=function(t){this.setSelectedIndex(t,!0)},r.prototype.handleFocus=function(){this.adapter.addClass(Rn.FOCUSED),this.layout(),this.adapter.activateBottomLine()},r.prototype.handleBlur=function(){this.isMenuOpen||this.blur()},r.prototype.handleClick=function(t){this.disabled||this.recentlyClicked||(this.setClickDebounceTimeout(),this.isMenuOpen?this.adapter.closeMenu():(this.adapter.setRippleCenter(t),this.openMenu()))},r.prototype.handleKeydown=function(t){if(!this.isMenuOpen&&this.adapter.hasClass(Rn.FOCUSED)){var e=_r(t)===Ui,i=_r(t)===qi,r=_r(t)===Xi,n=_r(t)===Zi;if(!(t.ctrlKey||t.metaKey)&&(!i&&t.key&&1===t.key.length||i&&this.adapter.isTypeaheadInProgress())){var o=i?" ":t.key,a=this.adapter.typeaheadMatchItem(o,this.getSelectedIndex());return a>=0&&this.setSelectedIndex(a),void t.preventDefault()}(e||i||r||n)&&(r&&this.getSelectedIndex()>0?this.setSelectedIndex(this.getSelectedIndex()-1):n&&this.getSelectedIndex()<this.adapter.getMenuItemCount()-1&&this.setSelectedIndex(this.getSelectedIndex()+1),this.openMenu(),t.preventDefault())}},r.prototype.notchOutline=function(t){if(this.adapter.hasOutline()){var e=this.adapter.hasClass(Rn.FOCUSED);if(t){var i=Cn.LABEL_SCALE,r=this.adapter.getLabelWidth()*i;this.adapter.notchOutline(r)}else e||this.adapter.closeOutline()}},r.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon&&this.leadingIcon.setAriaLabel(t)},r.prototype.setLeadingIconContent=function(t){this.leadingIcon&&this.leadingIcon.setContent(t)},r.prototype.getUseDefaultValidation=function(){return this.useDefaultValidation},r.prototype.setUseDefaultValidation=function(t){this.useDefaultValidation=t},r.prototype.setValid=function(t){this.useDefaultValidation||(this.customValidity=t),this.adapter.setSelectAnchorAttr("aria-invalid",(!t).toString()),t?(this.adapter.removeClass(Rn.INVALID),this.adapter.removeMenuClass(Rn.MENU_INVALID)):(this.adapter.addClass(Rn.INVALID),this.adapter.addMenuClass(Rn.MENU_INVALID)),this.syncHelperTextValidity(t)},r.prototype.isValid=function(){return this.useDefaultValidation&&this.adapter.hasClass(Rn.REQUIRED)&&!this.adapter.hasClass(Rn.DISABLED)?this.getSelectedIndex()!==Cn.UNSET_INDEX&&(0!==this.getSelectedIndex()||Boolean(this.getValue())):this.customValidity},r.prototype.setRequired=function(t){t?this.adapter.addClass(Rn.REQUIRED):this.adapter.removeClass(Rn.REQUIRED),this.adapter.setSelectAnchorAttr("aria-required",t.toString()),this.adapter.setLabelRequired(t)},r.prototype.getRequired=function(){return"true"===this.adapter.getSelectAnchorAttr("aria-required")},r.prototype.init=function(){var t=this.adapter.getAnchorElement();t&&(this.adapter.setMenuAnchorElement(t),this.adapter.setMenuAnchorCorner(Ur.BOTTOM_START)),this.adapter.setMenuWrapFocus(!1),this.setDisabled(this.adapter.hasClass(Rn.DISABLED)),this.syncHelperTextValidity(!this.adapter.hasClass(Rn.INVALID)),this.layout(),this.layoutOptions()},r.prototype.blur=function(){this.adapter.removeClass(Rn.FOCUSED),this.layout(),this.adapter.deactivateBottomLine(),this.adapter.hasClass(Rn.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},r.prototype.syncHelperTextValidity=function(t){if(this.helperText){this.helperText.setValidity(t);var e=this.helperText.isVisible(),i=this.helperText.getId();e&&i?this.adapter.setSelectAnchorAttr(In.ARIA_DESCRIBEDBY,i):this.adapter.removeSelectAnchorAttr(In.ARIA_DESCRIBEDBY)}},r.prototype.setClickDebounceTimeout=function(){var t=this;clearTimeout(this.clickDebounceTimeout),this.clickDebounceTimeout=setTimeout((function(){t.recentlyClicked=!1}),Cn.CLICK_DEBOUNCE_TIMEOUT_MS),this.recentlyClicked=!0},r}(Oe);
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
const Pn=(t={})=>{const e={};for(const i in t)e[i]=t[i];return Object.assign({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1},e)};class Ln extends xn{constructor(){super(...arguments),this.mdcFoundationClass=On,this.disabled=!1,this.outlined=!1,this.label="",this.outlineOpen=!1,this.outlineWidth=0,this.value="",this.name="",this.selectedText="",this.icon="",this.menuOpen=!1,this.helper="",this.validateOnInitialRender=!1,this.validationMessage="",this.required=!1,this.naturalMenuWidth=!1,this.isUiValid=!0,this.fixedMenuPosition=!1,this.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},this.sortedIndexByFirstChar=new Map,this.menuElement_=null,this.listeners=[],this.onBodyClickBound=()=>{},this._menuUpdateComplete=null,this.valueSetDirectly=!1,this.validityTransform=null,this._validity=Pn()}get items(){return this.menuElement_||(this.menuElement_=this.menuElement),this.menuElement_?this.menuElement_.items:[]}get selected(){const t=this.menuElement;return t?t.selected:null}get index(){const t=this.menuElement;return t?t.index:-1}get shouldRenderHelperText(){return!!this.helper||!!this.validationMessage}get validity(){return this._checkValidity(this.value),this._validity}render(){const t={"mdc-select--disabled":this.disabled,"mdc-select--no-label":!this.label,"mdc-select--filled":!this.outlined,"mdc-select--outlined":this.outlined,"mdc-select--with-leading-icon":!!this.icon,"mdc-select--required":this.required,"mdc-select--invalid":!this.isUiValid},e={"mdc-select__menu--invalid":!this.isUiValid},i=this.label?"label":void 0,r=this.shouldRenderHelperText?"helper-text":void 0;return D`
      <div
          class="mdc-select ${We(t)}">
        <input
            class="formElement"
            name="${this.name}"
            .value="${this.value}"
            hidden
            ?disabled="${this.disabled}"
            ?required=${this.required}>
        <!-- @ts-ignore -->
        <div class="mdc-select__anchor"
            aria-autocomplete="none"
            role="combobox"
            aria-expanded=${this.menuOpen}
            aria-invalid=${!this.isUiValid}
            aria-haspopup="listbox"
            aria-labelledby=${Ti(i)}
            aria-required=${this.required}
            aria-describedby=${Ti(r)}
            @click=${this.onClick}
            @focus=${this.onFocus}
            @blur=${this.onBlur}
            @keydown=${this.onKeydown}>
          ${this.renderRipple()}
          ${this.outlined?this.renderOutline():this.renderLabel()}
          ${this.renderLeadingIcon()}
          <span class="mdc-select__selected-text-container">
            <span class="mdc-select__selected-text">${this.selectedText}</span>
          </span>
          <span class="mdc-select__dropdown-icon">
            <svg
                class="mdc-select__dropdown-icon-graphic"
                viewBox="7 10 10 5"
                focusable="false">
              <polygon
                  class="mdc-select__dropdown-icon-inactive"
                  stroke="none"
                  fill-rule="evenodd"
                  points="7 10 12 15 17 10">
              </polygon>
              <polygon
                  class="mdc-select__dropdown-icon-active"
                  stroke="none"
                  fill-rule="evenodd"
                  points="7 15 12 10 17 15">
              </polygon>
            </svg>
          </span>
          ${this.renderLineRipple()}
        </div>
        <mwc-menu
            innerRole="listbox"
            wrapFocus
            class="mdc-select__menu mdc-menu mdc-menu-surface ${We(e)}"
            activatable
            .fullwidth=${!this.fixedMenuPosition&&!this.naturalMenuWidth}
            .open=${this.menuOpen}
            .anchor=${this.anchorElement}
            .fixed=${this.fixedMenuPosition}
            @selected=${this.onSelected}
            @opened=${this.onOpened}
            @closed=${this.onClosed}
            @items-updated=${this.onItemsUpdated}
            @keydown=${this.handleTypeahead}>
          <slot></slot>
        </mwc-menu>
      </div>
      ${this.renderHelperText()}`}renderRipple(){return this.outlined?z:D`
      <span class="mdc-select__ripple"></span>
    `}renderOutline(){return this.outlined?D`
      <mwc-notched-outline
          .width=${this.outlineWidth}
          .open=${this.outlineOpen}
          class="mdc-notched-outline">
        ${this.renderLabel()}
      </mwc-notched-outline>`:z}renderLabel(){return this.label?D`
      <span
          .floatingLabelFoundation=${Sn(this.label)}
          id="label">${this.label}</span>
    `:z}renderLeadingIcon(){return this.icon?D`<mwc-icon class="mdc-select__icon"><div>${this.icon}</div></mwc-icon>`:z}renderLineRipple(){return this.outlined?z:D`
      <span .lineRippleFoundation=${Tn()}></span>
    `}renderHelperText(){if(!this.shouldRenderHelperText)return z;const t=this.validationMessage&&!this.isUiValid;return D`
        <p
          class="mdc-select-helper-text ${We({"mdc-select-helper-text--validation-msg":t})}"
          id="helper-text">${t?this.validationMessage:this.helper}</p>`}createAdapter(){return Object.assign(Object.assign({},Be(this.mdcRoot)),{activateBottomLine:()=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.activate()},deactivateBottomLine:()=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.deactivate()},hasLabel:()=>!!this.label,floatLabel:t=>{this.labelElement&&this.labelElement.floatingLabelFoundation.float(t)},getLabelWidth:()=>this.labelElement?this.labelElement.floatingLabelFoundation.getWidth():0,setLabelRequired:t=>{this.labelElement&&this.labelElement.floatingLabelFoundation.setRequired(t)},hasOutline:()=>this.outlined,notchOutline:t=>{this.outlineElement&&!this.outlineOpen&&(this.outlineWidth=t,this.outlineOpen=!0)},closeOutline:()=>{this.outlineElement&&(this.outlineOpen=!1)},setRippleCenter:t=>{if(this.lineRippleElement){this.lineRippleElement.lineRippleFoundation.setRippleCenter(t)}},notifyChange:async t=>{if(!this.valueSetDirectly&&t===this.value)return;this.valueSetDirectly=!1,this.value=t,await this.updateComplete;const e=new Event("change",{bubbles:!0});this.dispatchEvent(e)},setSelectedText:t=>this.selectedText=t,isSelectAnchorFocused:()=>{const t=this.anchorElement;if(!t)return!1;return t.getRootNode().activeElement===t},getSelectAnchorAttr:t=>{const e=this.anchorElement;return e?e.getAttribute(t):null},setSelectAnchorAttr:(t,e)=>{const i=this.anchorElement;i&&i.setAttribute(t,e)},removeSelectAnchorAttr:t=>{const e=this.anchorElement;e&&e.removeAttribute(t)},openMenu:()=>{this.menuOpen=!0},closeMenu:()=>{this.menuOpen=!1},addMenuClass:()=>{},removeMenuClass:()=>{},getAnchorElement:()=>this.anchorElement,setMenuAnchorElement:()=>{},setMenuAnchorCorner:()=>{const t=this.menuElement;t&&(t.corner="BOTTOM_START")},setMenuWrapFocus:t=>{const e=this.menuElement;e&&(e.wrapFocus=t)},focusMenuItemAtIndex:t=>{const e=this.menuElement;if(!e)return;const i=e.items[t];i&&i.focus()},getMenuItemCount:()=>{const t=this.menuElement;return t?t.items.length:0},getMenuItemValues:()=>{const t=this.menuElement;if(!t)return[];return t.items.map((t=>t.value))},getMenuItemTextAtIndex:t=>{const e=this.menuElement;if(!e)return"";const i=e.items[t];return i?i.text:""},getSelectedIndex:()=>this.index,setSelectedIndex:()=>{},isTypeaheadInProgress:()=>_n(this.typeaheadState),typeaheadMatchItem:(t,e)=>{if(!this.menuElement)return-1;const i=yn({focusItemAtIndex:t=>{this.menuElement.focusItemAtIndex(t)},focusedItemIndex:e||this.menuElement.getFocusedItemIndex(),nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:!1,isItemAtIndexDisabled:t=>this.items[t].disabled},this.typeaheadState);return-1!==i&&this.select(i),i}})}checkValidity(){const t=this._checkValidity(this.value);if(!t){const t=new Event("invalid",{bubbles:!1,cancelable:!0});this.dispatchEvent(t)}return t}reportValidity(){const t=this.checkValidity();return this.isUiValid=t,t}_checkValidity(t){const e=this.formElement.validity;let i=Pn(e);if(this.validityTransform){const e=this.validityTransform(t,i);i=Object.assign(Object.assign({},i),e)}return this._validity=i,this._validity.valid}setCustomValidity(t){this.validationMessage=t,this.formElement.setCustomValidity(t)}async getUpdateComplete(){await this._menuUpdateComplete;return await super.getUpdateComplete()}async firstUpdated(){const t=this.menuElement;if(t&&(this._menuUpdateComplete=t.updateComplete,await this._menuUpdateComplete),super.firstUpdated(),this.mdcFoundation.isValid=()=>!0,this.mdcFoundation.setValid=()=>{},this.mdcFoundation.setDisabled(this.disabled),this.validateOnInitialRender&&this.reportValidity(),!this.selected){!this.items.length&&this.slotElement&&this.slotElement.assignedNodes({flatten:!0}).length&&(await new Promise((t=>requestAnimationFrame(t))),await this.layout());const t=this.items.length&&""===this.items[0].value;if(!this.value&&t)return void this.select(0);this.selectByValue(this.value)}this.sortedIndexByFirstChar=vn(this.items.length,(t=>this.items[t].text))}onItemsUpdated(){this.sortedIndexByFirstChar=vn(this.items.length,(t=>this.items[t].text))}select(t){const e=this.menuElement;e&&e.select(t)}selectByValue(t){let e=-1;for(let i=0;i<this.items.length;i++){if(this.items[i].value===t){e=i;break}}this.valueSetDirectly=!0,this.select(e),this.mdcFoundation.handleChange()}disconnectedCallback(){super.disconnectedCallback();for(const t of this.listeners)t.target.removeEventListener(t.name,t.cb)}focus(){const t=new CustomEvent("focus"),e=this.anchorElement;e&&(e.dispatchEvent(t),e.focus())}blur(){const t=new CustomEvent("blur"),e=this.anchorElement;e&&(e.dispatchEvent(t),e.blur())}onFocus(){this.mdcFoundation&&this.mdcFoundation.handleFocus()}onBlur(){this.mdcFoundation&&this.mdcFoundation.handleBlur();const t=this.menuElement;t&&!t.open&&this.reportValidity()}onClick(t){if(this.mdcFoundation){this.focus();const e=t.target.getBoundingClientRect();let i=0;i="touches"in t?t.touches[0].clientX:t.clientX;const r=i-e.left;this.mdcFoundation.handleClick(r)}}onKeydown(t){const e=_r(t)===Xi,i=_r(t)===Zi;if(i||e){const r=e&&this.index>0,n=i&&this.index<this.items.length-1;return r?this.select(this.index-1):n&&this.select(this.index+1),t.preventDefault(),void this.mdcFoundation.openMenu()}this.mdcFoundation.handleKeydown(t)}handleTypeahead(t){if(!this.menuElement)return;const e=this.menuElement.getFocusedItemIndex(),i=Ne(t.target)?t.target:null;!function(t,e){var i=t.event,r=t.isTargetListItem,n=t.focusedItemIndex,o=t.focusItemAtIndex,a=t.sortedIndexByFirstChar,s=t.isItemAtIndexDisabled,l="ArrowLeft"===_r(i),d="ArrowUp"===_r(i),c="ArrowRight"===_r(i),h="ArrowDown"===_r(i),u="Home"===_r(i),p="End"===_r(i),f="Enter"===_r(i),m="Spacebar"===_r(i);i.ctrlKey||i.metaKey||l||d||c||h||u||p||f||(m||1!==i.key.length?m&&(r&&bn(i),r&&_n(e)&&yn({focusItemAtIndex:o,focusedItemIndex:n,nextChar:" ",sortedIndexByFirstChar:a,skipFocus:!1,isItemAtIndexDisabled:s},e)):(bn(i),yn({focusItemAtIndex:o,focusedItemIndex:n,nextChar:i.key.toLowerCase(),sortedIndexByFirstChar:a,skipFocus:!1,isItemAtIndexDisabled:s},e)))}
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */({event:t,focusItemAtIndex:t=>{this.menuElement.focusItemAtIndex(t)},focusedItemIndex:e,isTargetListItem:!!i&&i.hasAttribute("mwc-list-item"),sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:t=>this.items[t].disabled},this.typeaheadState)}async onSelected(t){this.mdcFoundation||await this.updateComplete,this.mdcFoundation.handleMenuItemAction(t.detail.index);const e=this.items[t.detail.index];e&&(this.value=e.value)}onOpened(){this.mdcFoundation&&(this.menuOpen=!0,this.mdcFoundation.handleMenuOpened())}onClosed(){this.mdcFoundation&&(this.menuOpen=!1,this.mdcFoundation.handleMenuClosed())}setFormData(t){this.name&&null!==this.selected&&t.append(this.name,this.value)}async layout(t=!0){this.mdcFoundation&&this.mdcFoundation.layout(),await this.updateComplete;const e=this.menuElement;e&&e.layout(t);const i=this.labelElement;if(!i)return void(this.outlineOpen=!1);const r=!!this.label&&!!this.value;if(i.floatingLabelFoundation.float(r),!this.outlined)return;this.outlineOpen=r,await this.updateComplete;const n=i.floatingLabelFoundation.getWidth();this.outlineOpen&&(this.outlineWidth=n)}async layoutOptions(){this.mdcFoundation&&this.mdcFoundation.layoutOptions()}}r([Et(".mdc-select")],Ln.prototype,"mdcRoot",void 0),r([Et(".formElement")],Ln.prototype,"formElement",void 0),r([Et("slot")],Ln.prototype,"slotElement",void 0),r([Et("select")],Ln.prototype,"nativeSelectElement",void 0),r([Et("input")],Ln.prototype,"nativeInputElement",void 0),r([Et(".mdc-line-ripple")],Ln.prototype,"lineRippleElement",void 0),r([Et(".mdc-floating-label")],Ln.prototype,"labelElement",void 0),r([Et("mwc-notched-outline")],Ln.prototype,"outlineElement",void 0),r([Et(".mdc-menu")],Ln.prototype,"menuElement",void 0),r([Et(".mdc-select__anchor")],Ln.prototype,"anchorElement",void 0),r([xt({type:Boolean,attribute:"disabled",reflect:!0}),Ve((function(t){this.mdcFoundation&&this.mdcFoundation.setDisabled(t)}))],Ln.prototype,"disabled",void 0),r([xt({type:Boolean}),Ve((function(t,e){void 0!==e&&this.outlined!==e&&this.layout(!1)}))],Ln.prototype,"outlined",void 0),r([xt({type:String}),Ve((function(t,e){void 0!==e&&this.label!==e&&this.layout(!1)}))],Ln.prototype,"label",void 0),r([Mt()],Ln.prototype,"outlineOpen",void 0),r([Mt()],Ln.prototype,"outlineWidth",void 0),r([xt({type:String}),Ve((function(t){if(this.mdcFoundation){const e=null===this.selected&&!!t,i=this.selected&&this.selected.value!==t;(e||i)&&this.selectByValue(t),this.reportValidity()}}))],Ln.prototype,"value",void 0),r([xt()],Ln.prototype,"name",void 0),r([Mt()],Ln.prototype,"selectedText",void 0),r([xt({type:String})],Ln.prototype,"icon",void 0),r([Mt()],Ln.prototype,"menuOpen",void 0),r([xt({type:String})],Ln.prototype,"helper",void 0),r([xt({type:Boolean})],Ln.prototype,"validateOnInitialRender",void 0),r([xt({type:String})],Ln.prototype,"validationMessage",void 0),r([xt({type:Boolean})],Ln.prototype,"required",void 0),r([xt({type:Boolean})],Ln.prototype,"naturalMenuWidth",void 0),r([Mt()],Ln.prototype,"isUiValid",void 0),r([xt({type:Boolean})],Ln.prototype,"fixedMenuPosition",void 0),r([St({capture:!0})],Ln.prototype,"handleTypeahead",null);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const $n=at`.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);position:absolute;left:0;-webkit-transform-origin:left top;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform;transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl] .mdc-floating-label,.mdc-floating-label[dir=rtl]{right:0;left:auto;-webkit-transform-origin:right top;transform-origin:right top;text-align:right}.mdc-floating-label--float-above{cursor:auto}.mdc-floating-label--required::after{margin-left:1px;margin-right:0px;content:"*"}[dir=rtl] .mdc-floating-label--required::after,.mdc-floating-label--required[dir=rtl]::after{margin-left:0;margin-right:1px}.mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-standard 250ms 1}@keyframes mdc-floating-label-shake-float-above-standard{0%{transform:translateX(calc(0 - 0%)) translateY(-106%) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(-106%) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(-106%) scale(0.75)}100%{transform:translateX(calc(0 - 0%)) translateY(-106%) scale(0.75)}}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{border-bottom-width:1px;z-index:1}.mdc-line-ripple::after{transform:scaleX(0);border-bottom-width:2px;opacity:0;z-index:2}.mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline,.mdc-notched-outline[dir=rtl]{text-align:right}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{box-sizing:border-box;height:100%;border-top:1px solid;border-bottom:1px solid;pointer-events:none}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;width:12px}[dir=rtl] .mdc-notched-outline__leading,.mdc-notched-outline__leading[dir=rtl]{border-left:none;border-right:1px solid}.mdc-notched-outline__trailing{border-left:none;border-right:1px solid;flex-grow:1}[dir=rtl] .mdc-notched-outline__trailing,.mdc-notched-outline__trailing[dir=rtl]{border-left:1px solid;border-right:none}.mdc-notched-outline__notch{flex:0 0 auto;width:auto;max-width:calc(100% - 12px * 2)}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(100% / 0.75)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch,.mdc-notched-outline--notched .mdc-notched-outline__notch[dir=rtl]{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-select{display:inline-flex;position:relative}.mdc-select:not(.mdc-select--disabled) .mdc-select__selected-text{color:rgba(0, 0, 0, 0.87)}.mdc-select.mdc-select--disabled .mdc-select__selected-text{color:rgba(0, 0, 0, 0.38)}.mdc-select:not(.mdc-select--disabled) .mdc-floating-label{color:rgba(0, 0, 0, 0.6)}.mdc-select:not(.mdc-select--disabled).mdc-select--focused .mdc-floating-label{color:rgba(98, 0, 238, 0.87)}.mdc-select.mdc-select--disabled .mdc-floating-label{color:rgba(0, 0, 0, 0.38)}.mdc-select:not(.mdc-select--disabled) .mdc-select__dropdown-icon{fill:rgba(0, 0, 0, 0.54)}.mdc-select:not(.mdc-select--disabled).mdc-select--focused .mdc-select__dropdown-icon{fill:#6200ee;fill:var(--mdc-theme-primary, #6200ee)}.mdc-select.mdc-select--disabled .mdc-select__dropdown-icon{fill:rgba(0, 0, 0, 0.38)}.mdc-select:not(.mdc-select--disabled)+.mdc-select-helper-text{color:rgba(0, 0, 0, 0.6)}.mdc-select.mdc-select--disabled+.mdc-select-helper-text{color:rgba(0, 0, 0, 0.38)}.mdc-select:not(.mdc-select--disabled) .mdc-select__icon{color:rgba(0, 0, 0, 0.54)}.mdc-select.mdc-select--disabled .mdc-select__icon{color:rgba(0, 0, 0, 0.38)}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-select.mdc-select--disabled .mdc-select__selected-text{color:GrayText}.mdc-select.mdc-select--disabled .mdc-select__dropdown-icon{fill:red}.mdc-select.mdc-select--disabled .mdc-floating-label{color:GrayText}.mdc-select.mdc-select--disabled .mdc-line-ripple::before{border-bottom-color:GrayText}.mdc-select.mdc-select--disabled .mdc-notched-outline__leading,.mdc-select.mdc-select--disabled .mdc-notched-outline__notch,.mdc-select.mdc-select--disabled .mdc-notched-outline__trailing{border-color:GrayText}.mdc-select.mdc-select--disabled .mdc-select__icon{color:GrayText}.mdc-select.mdc-select--disabled+.mdc-select-helper-text{color:GrayText}}.mdc-select .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-select .mdc-select__anchor{padding-left:16px;padding-right:0}[dir=rtl] .mdc-select .mdc-select__anchor,.mdc-select .mdc-select__anchor[dir=rtl]{padding-left:0;padding-right:16px}.mdc-select.mdc-select--with-leading-icon .mdc-select__anchor{padding-left:0;padding-right:0}[dir=rtl] .mdc-select.mdc-select--with-leading-icon .mdc-select__anchor,.mdc-select.mdc-select--with-leading-icon .mdc-select__anchor[dir=rtl]{padding-left:0;padding-right:0}.mdc-select .mdc-select__icon{width:24px;height:24px;font-size:24px}.mdc-select .mdc-select__dropdown-icon{width:24px;height:24px}.mdc-select .mdc-select__menu .mdc-deprecated-list-item{padding-left:16px;padding-right:16px}[dir=rtl] .mdc-select .mdc-select__menu .mdc-deprecated-list-item,.mdc-select .mdc-select__menu .mdc-deprecated-list-item[dir=rtl]{padding-left:16px;padding-right:16px}.mdc-select .mdc-select__menu .mdc-deprecated-list-item__graphic{margin-left:0;margin-right:12px}[dir=rtl] .mdc-select .mdc-select__menu .mdc-deprecated-list-item__graphic,.mdc-select .mdc-select__menu .mdc-deprecated-list-item__graphic[dir=rtl]{margin-left:12px;margin-right:0}.mdc-select__dropdown-icon{margin-left:12px;margin-right:12px;display:inline-flex;position:relative;align-self:center;align-items:center;justify-content:center;flex-shrink:0;pointer-events:none}.mdc-select__dropdown-icon .mdc-select__dropdown-icon-active,.mdc-select__dropdown-icon .mdc-select__dropdown-icon-inactive{position:absolute;top:0;left:0}.mdc-select__dropdown-icon .mdc-select__dropdown-icon-graphic{width:41.6666666667%;height:20.8333333333%}.mdc-select__dropdown-icon .mdc-select__dropdown-icon-inactive{opacity:1;transition:opacity 75ms linear 75ms}.mdc-select__dropdown-icon .mdc-select__dropdown-icon-active{opacity:0;transition:opacity 75ms linear}[dir=rtl] .mdc-select__dropdown-icon,.mdc-select__dropdown-icon[dir=rtl]{margin-left:12px;margin-right:12px}.mdc-select--activated .mdc-select__dropdown-icon .mdc-select__dropdown-icon-inactive{opacity:0;transition:opacity 49.5ms linear}.mdc-select--activated .mdc-select__dropdown-icon .mdc-select__dropdown-icon-active{opacity:1;transition:opacity 100.5ms linear 49.5ms}.mdc-select__anchor{width:200px;min-width:0;flex:1 1 auto;position:relative;box-sizing:border-box;overflow:hidden;outline:none;cursor:pointer}.mdc-select__anchor .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-select__selected-text-container{display:flex;appearance:none;pointer-events:none;box-sizing:border-box;width:auto;min-width:0;flex-grow:1;height:28px;border:none;outline:none;padding:0;background-color:transparent;color:inherit}.mdc-select__selected-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;width:100%;text-align:left}[dir=rtl] .mdc-select__selected-text,.mdc-select__selected-text[dir=rtl]{text-align:right}.mdc-select--invalid:not(.mdc-select--disabled) .mdc-floating-label{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-floating-label{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--invalid+.mdc-select-helper-text--validation-msg{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled) .mdc-select__dropdown-icon{fill:#b00020;fill:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-select__dropdown-icon{fill:#b00020;fill:var(--mdc-theme-error, #b00020)}.mdc-select--disabled{cursor:default;pointer-events:none}.mdc-select--with-leading-icon .mdc-select__menu .mdc-deprecated-list-item{padding-left:12px;padding-right:12px}[dir=rtl] .mdc-select--with-leading-icon .mdc-select__menu .mdc-deprecated-list-item,.mdc-select--with-leading-icon .mdc-select__menu .mdc-deprecated-list-item[dir=rtl]{padding-left:12px;padding-right:12px}.mdc-select__menu .mdc-deprecated-list .mdc-select__icon,.mdc-select__menu .mdc-list .mdc-select__icon{margin-left:0;margin-right:0}[dir=rtl] .mdc-select__menu .mdc-deprecated-list .mdc-select__icon,[dir=rtl] .mdc-select__menu .mdc-list .mdc-select__icon,.mdc-select__menu .mdc-deprecated-list .mdc-select__icon[dir=rtl],.mdc-select__menu .mdc-list .mdc-select__icon[dir=rtl]{margin-left:0;margin-right:0}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--activated,.mdc-select__menu .mdc-list .mdc-deprecated-list-item--selected,.mdc-select__menu .mdc-list .mdc-deprecated-list-item--activated{color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected .mdc-deprecated-list-item__graphic,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--activated .mdc-deprecated-list-item__graphic,.mdc-select__menu .mdc-list .mdc-deprecated-list-item--selected .mdc-deprecated-list-item__graphic,.mdc-select__menu .mdc-list .mdc-deprecated-list-item--activated .mdc-deprecated-list-item__graphic{color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-select__menu .mdc-list-item__start{display:inline-flex;align-items:center}.mdc-select__option{padding-left:16px;padding-right:16px}[dir=rtl] .mdc-select__option,.mdc-select__option[dir=rtl]{padding-left:16px;padding-right:16px}.mdc-select__one-line-option.mdc-list-item--with-one-line{height:48px}.mdc-select__two-line-option.mdc-list-item--with-two-lines{height:64px}.mdc-select__two-line-option.mdc-list-item--with-two-lines .mdc-list-item__start{margin-top:20px}.mdc-select__two-line-option.mdc-list-item--with-two-lines .mdc-list-item__primary-text{display:block;margin-top:0;line-height:normal;margin-bottom:-20px}.mdc-select__two-line-option.mdc-list-item--with-two-lines .mdc-list-item__primary-text::before{display:inline-block;width:0;height:28px;content:"";vertical-align:0}.mdc-select__two-line-option.mdc-list-item--with-two-lines .mdc-list-item__primary-text::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-select__two-line-option.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end{display:block;margin-top:0;line-height:normal}.mdc-select__two-line-option.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end::before{display:inline-block;width:0;height:36px;content:"";vertical-align:0}.mdc-select__option-with-leading-content{padding-left:0;padding-right:12px}.mdc-select__option-with-leading-content.mdc-list-item{padding-left:0;padding-right:auto}[dir=rtl] .mdc-select__option-with-leading-content.mdc-list-item,.mdc-select__option-with-leading-content.mdc-list-item[dir=rtl]{padding-left:auto;padding-right:0}.mdc-select__option-with-leading-content .mdc-list-item__start{margin-left:12px;margin-right:0}[dir=rtl] .mdc-select__option-with-leading-content .mdc-list-item__start,.mdc-select__option-with-leading-content .mdc-list-item__start[dir=rtl]{margin-left:0;margin-right:12px}.mdc-select__option-with-leading-content .mdc-list-item__start{width:36px;height:24px}[dir=rtl] .mdc-select__option-with-leading-content,.mdc-select__option-with-leading-content[dir=rtl]{padding-left:12px;padding-right:0}.mdc-select__option-with-meta.mdc-list-item{padding-left:auto;padding-right:0}[dir=rtl] .mdc-select__option-with-meta.mdc-list-item,.mdc-select__option-with-meta.mdc-list-item[dir=rtl]{padding-left:0;padding-right:auto}.mdc-select__option-with-meta .mdc-list-item__end{margin-left:12px;margin-right:12px}[dir=rtl] .mdc-select__option-with-meta .mdc-list-item__end,.mdc-select__option-with-meta .mdc-list-item__end[dir=rtl]{margin-left:12px;margin-right:12px}.mdc-select--filled .mdc-select__anchor{height:56px;display:flex;align-items:baseline}.mdc-select--filled .mdc-select__anchor::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}.mdc-select--filled.mdc-select--no-label .mdc-select__anchor .mdc-select__selected-text::before{content:"​"}.mdc-select--filled.mdc-select--no-label .mdc-select__anchor .mdc-select__selected-text-container{height:100%;display:inline-flex;align-items:center}.mdc-select--filled.mdc-select--no-label .mdc-select__anchor::before{display:none}.mdc-select--filled .mdc-select__anchor{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-select--filled:not(.mdc-select--disabled) .mdc-select__anchor{background-color:whitesmoke}.mdc-select--filled.mdc-select--disabled .mdc-select__anchor{background-color:#fafafa}.mdc-select--filled:not(.mdc-select--disabled) .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.42)}.mdc-select--filled:not(.mdc-select--disabled):hover .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.87)}.mdc-select--filled:not(.mdc-select--disabled) .mdc-line-ripple::after{border-bottom-color:#6200ee;border-bottom-color:var(--mdc-theme-primary, #6200ee)}.mdc-select--filled.mdc-select--disabled .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.06)}.mdc-select--filled .mdc-floating-label{max-width:calc(100% - 64px)}.mdc-select--filled .mdc-floating-label--float-above{max-width:calc(100% / 0.75 - 64px / 0.75)}.mdc-select--filled .mdc-menu-surface--is-open-below{border-top-left-radius:0px;border-top-right-radius:0px}.mdc-select--filled.mdc-select--focused.mdc-line-ripple::after{transform:scale(1, 2);opacity:1}.mdc-select--filled .mdc-floating-label{left:16px;right:initial}[dir=rtl] .mdc-select--filled .mdc-floating-label,.mdc-select--filled .mdc-floating-label[dir=rtl]{left:initial;right:16px}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{left:48px;right:initial}[dir=rtl] .mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label,.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label[dir=rtl]{left:initial;right:48px}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{max-width:calc(100% - 96px)}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label--float-above{max-width:calc(100% / 0.75 - 96px / 0.75)}.mdc-select--invalid:not(.mdc-select--disabled) .mdc-line-ripple::before{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled):hover .mdc-line-ripple::before{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled) .mdc-line-ripple::after{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-select--outlined{border:none}.mdc-select--outlined .mdc-select__anchor{height:56px}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1)}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--float-above{font-size:.75rem}.mdc-select--outlined .mdc-select__anchor.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-select--outlined .mdc-select__anchor.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-select-outlined-56px 250ms 1}@keyframes mdc-floating-label-shake-float-above-select-outlined-56px{0%{transform:translateX(calc(0 - 0%)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - 0%)) translateY(-34.75px) scale(0.75)}}.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__leading{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}[dir=rtl] .mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__leading[dir=rtl]{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}@supports(top: max(0%)){.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px, var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:calc(100% - max(12px, var(--mdc-shape-small, 4px)) * 2)}}.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}[dir=rtl] .mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__trailing,.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__trailing[dir=rtl]{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}@supports(top: max(0%)){.mdc-select--outlined .mdc-select__anchor{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}[dir=rtl] .mdc-select--outlined .mdc-select__anchor,.mdc-select--outlined .mdc-select__anchor[dir=rtl]{padding-left:0}@supports(top: max(0%)){[dir=rtl] .mdc-select--outlined .mdc-select__anchor,.mdc-select--outlined .mdc-select__anchor[dir=rtl]{padding-right:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}@supports(top: max(0%)){.mdc-select--outlined+.mdc-select-helper-text{margin-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}[dir=rtl] .mdc-select--outlined+.mdc-select-helper-text,.mdc-select--outlined+.mdc-select-helper-text[dir=rtl]{margin-left:0}@supports(top: max(0%)){[dir=rtl] .mdc-select--outlined+.mdc-select-helper-text,.mdc-select--outlined+.mdc-select-helper-text[dir=rtl]{margin-right:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-select--outlined:not(.mdc-select--disabled) .mdc-select__anchor{background-color:transparent}.mdc-select--outlined.mdc-select--disabled .mdc-select__anchor{background-color:transparent}.mdc-select--outlined:not(.mdc-select--disabled) .mdc-notched-outline__leading,.mdc-select--outlined:not(.mdc-select--disabled) .mdc-notched-outline__notch,.mdc-select--outlined:not(.mdc-select--disabled) .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.38)}.mdc-select--outlined:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.87)}.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__trailing{border-width:2px}.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__trailing{border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-select--outlined.mdc-select--disabled .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--disabled .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--disabled .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.06)}.mdc-select--outlined .mdc-select__anchor :not(.mdc-notched-outline--notched) .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mdc-select--outlined .mdc-select__anchor{display:flex;align-items:baseline;overflow:visible}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-select-outlined 250ms 1}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1)}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--float-above{font-size:.75rem}.mdc-select--outlined .mdc-select__anchor.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-select--outlined .mdc-select__anchor.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-select--outlined .mdc-select__anchor .mdc-select__selected-text::before{content:"​"}.mdc-select--outlined .mdc-select__anchor .mdc-select__selected-text-container{height:100%;display:inline-flex;align-items:center}.mdc-select--outlined .mdc-select__anchor::before{display:none}.mdc-select--outlined .mdc-select__selected-text-container{display:flex;border:none;z-index:1;background-color:transparent}.mdc-select--outlined .mdc-select__icon{z-index:2}.mdc-select--outlined .mdc-floating-label{line-height:1.15rem;left:4px;right:initial}[dir=rtl] .mdc-select--outlined .mdc-floating-label,.mdc-select--outlined .mdc-floating-label[dir=rtl]{left:initial;right:4px}.mdc-select--outlined.mdc-select--focused .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled) .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled) .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled) .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__trailing{border-width:2px}.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label{left:36px;right:initial}[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label,.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label[dir=rtl]{left:initial;right:36px}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--float-above{transform:translateY(-37.25px) translateX(-32px) scale(1)}[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--float-above,.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--float-above[dir=rtl]{transform:translateY(-37.25px) translateX(32px) scale(1)}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--float-above{font-size:.75rem}.mdc-select--outlined.mdc-select--with-leading-icon.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined.mdc-select--with-leading-icon .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) translateX(-32px) scale(0.75)}[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon.mdc-notched-outline--upgraded .mdc-floating-label--float-above,[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined.mdc-select--with-leading-icon.mdc-notched-outline--upgraded .mdc-floating-label--float-above[dir=rtl],.mdc-select--outlined.mdc-select--with-leading-icon .mdc-notched-outline--upgraded .mdc-floating-label--float-above[dir=rtl]{transform:translateY(-34.75px) translateX(32px) scale(0.75)}.mdc-select--outlined.mdc-select--with-leading-icon.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined.mdc-select--with-leading-icon .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-select-outlined-leading-icon-56px 250ms 1}@keyframes mdc-floating-label-shake-float-above-select-outlined-leading-icon-56px{0%{transform:translateX(calc(0 - 32px)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 32px)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 32px)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - 32px)) translateY(-34.75px) scale(0.75)}}[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--shake,.mdc-select--outlined.mdc-select--with-leading-icon[dir=rtl] .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-select-outlined-leading-icon-56px 250ms 1}@keyframes mdc-floating-label-shake-float-above-select-outlined-leading-icon-56px-rtl{0%{transform:translateX(calc(0 - -32px)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - -32px)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - -32px)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - -32px)) translateY(-34.75px) scale(0.75)}}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-select__anchor :not(.mdc-notched-outline--notched) .mdc-notched-outline__notch{max-width:calc(100% - 96px)}.mdc-select--outlined .mdc-menu-surface{margin-bottom:8px}.mdc-select--outlined.mdc-select--no-label .mdc-menu-surface,.mdc-select--outlined .mdc-menu-surface--is-open-below{margin-bottom:0}.mdc-select__anchor{--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:transform,opacity}.mdc-select__anchor .mdc-select__ripple::before,.mdc-select__anchor .mdc-select__ripple::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-select__anchor .mdc-select__ripple::before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-select__anchor .mdc-select__ripple::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-select__anchor.mdc-ripple-upgraded .mdc-select__ripple::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-select__anchor.mdc-ripple-upgraded .mdc-select__ripple::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-select__anchor.mdc-ripple-upgraded--unbounded .mdc-select__ripple::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-select__anchor.mdc-ripple-upgraded--foreground-activation .mdc-select__ripple::after{animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-select__anchor.mdc-ripple-upgraded--foreground-deactivation .mdc-select__ripple::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-select__anchor .mdc-select__ripple::before,.mdc-select__anchor .mdc-select__ripple::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-select__anchor.mdc-ripple-upgraded .mdc-select__ripple::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-select__anchor .mdc-select__ripple::before,.mdc-select__anchor .mdc-select__ripple::after{background-color:rgba(0, 0, 0, 0.87);background-color:var(--mdc-ripple-color, rgba(0, 0, 0, 0.87))}.mdc-select__anchor:hover .mdc-select__ripple::before,.mdc-select__anchor.mdc-ripple-surface--hover .mdc-select__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-select__anchor.mdc-ripple-upgraded--background-focused .mdc-select__ripple::before,.mdc-select__anchor:not(.mdc-ripple-upgraded):focus .mdc-select__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-select__anchor .mdc-select__ripple{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected .mdc-deprecated-list-item__ripple::before,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected .mdc-deprecated-list-item__ripple::after{background-color:#000;background-color:var(--mdc-ripple-color, var(--mdc-theme-on-surface, #000))}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:hover .mdc-deprecated-list-item__ripple::before,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected.mdc-ripple-surface--hover .mdc-deprecated-list-item__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected.mdc-ripple-upgraded--background-focused .mdc-deprecated-list-item__ripple::before,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:not(.mdc-ripple-upgraded):focus .mdc-deprecated-list-item__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:not(.mdc-ripple-upgraded) .mdc-deprecated-list-item__ripple::after{transition:opacity 150ms linear}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:not(.mdc-ripple-upgraded):active .mdc-deprecated-list-item__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected .mdc-list-item__ripple::before,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected .mdc-list-item__ripple::after{background-color:#000;background-color:var(--mdc-ripple-color, var(--mdc-theme-on-surface, #000))}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:hover .mdc-list-item__ripple::before,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected.mdc-ripple-surface--hover .mdc-list-item__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected.mdc-ripple-upgraded--background-focused .mdc-list-item__ripple::before,.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:not(.mdc-ripple-upgraded):focus .mdc-list-item__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:not(.mdc-ripple-upgraded) .mdc-list-item__ripple::after{transition:opacity 150ms linear}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected:not(.mdc-ripple-upgraded):active .mdc-list-item__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-select-helper-text{margin:0;margin-left:16px;margin-right:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-caption-font-size, 0.75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight, 400);letter-spacing:0.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, 0.0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform, inherit);display:block;margin-top:0;line-height:normal}[dir=rtl] .mdc-select-helper-text,.mdc-select-helper-text[dir=rtl]{margin-left:16px;margin-right:16px}.mdc-select-helper-text::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}.mdc-select-helper-text--validation-msg{opacity:0;transition:opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-select--invalid+.mdc-select-helper-text--validation-msg,.mdc-select-helper-text--validation-msg-persistent{opacity:1}.mdc-select--with-leading-icon .mdc-select__icon{display:inline-block;box-sizing:border-box;border:none;text-decoration:none;cursor:pointer;user-select:none;flex-shrink:0;align-self:center;background-color:transparent;fill:currentColor}.mdc-select--with-leading-icon .mdc-select__icon{margin-left:12px;margin-right:12px}[dir=rtl] .mdc-select--with-leading-icon .mdc-select__icon,.mdc-select--with-leading-icon .mdc-select__icon[dir=rtl]{margin-left:12px;margin-right:12px}.mdc-select__icon:not([tabindex]),.mdc-select__icon[tabindex="-1"]{cursor:default;pointer-events:none}.material-icons{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}:host{display:inline-block;vertical-align:top;outline:none}.mdc-select{width:100%}[hidden]{display:none}.mdc-select__icon{z-index:2}.mdc-select--with-leading-icon{--mdc-list-item-graphic-margin: calc( 48px - var(--mdc-list-item-graphic-size, 24px) - var(--mdc-list-side-padding, 16px) )}.mdc-select .mdc-select__anchor .mdc-select__selected-text{overflow:hidden}.mdc-select .mdc-select__anchor *{display:inline-flex}.mdc-select .mdc-select__anchor .mdc-floating-label{display:inline-block}mwc-notched-outline{--mdc-notched-outline-border-color: var( --mdc-select-outlined-idle-border-color, rgba(0, 0, 0, 0.38) );--mdc-notched-outline-notch-offset: 1px}:host(:not([disabled]):hover) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) mwc-notched-outline{--mdc-notched-outline-border-color: var( --mdc-select-outlined-hover-border-color, rgba(0, 0, 0, 0.87) )}:host(:not([disabled])) .mdc-select:not(.mdc-select--disabled) .mdc-select__selected-text{color:rgba(0, 0, 0, 0.87);color:var(--mdc-select-ink-color, rgba(0, 0, 0, 0.87))}:host(:not([disabled])) .mdc-select:not(.mdc-select--disabled) .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.42);border-bottom-color:var(--mdc-select-idle-line-color, rgba(0, 0, 0, 0.42))}:host(:not([disabled])) .mdc-select:not(.mdc-select--disabled):hover .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.87);border-bottom-color:var(--mdc-select-hover-line-color, rgba(0, 0, 0, 0.87))}:host(:not([disabled])) .mdc-select:not(.mdc-select--outlined):not(.mdc-select--disabled) .mdc-select__anchor{background-color:whitesmoke;background-color:var(--mdc-select-fill-color, whitesmoke)}:host(:not([disabled])) .mdc-select.mdc-select--invalid .mdc-select__dropdown-icon{fill:var(--mdc-select-error-dropdown-icon-color, var(--mdc-select-error-color, var(--mdc-theme-error, #b00020)))}:host(:not([disabled])) .mdc-select.mdc-select--invalid .mdc-floating-label,:host(:not([disabled])) .mdc-select.mdc-select--invalid .mdc-floating-label::after{color:var(--mdc-select-error-color, var(--mdc-theme-error, #b00020))}:host(:not([disabled])) .mdc-select.mdc-select--invalid mwc-notched-outline{--mdc-notched-outline-border-color: var(--mdc-select-error-color, var(--mdc-theme-error, #b00020))}.mdc-select__menu--invalid{--mdc-theme-primary: var(--mdc-select-error-color, var(--mdc-theme-error, #b00020))}:host(:not([disabled])) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-floating-label,:host(:not([disabled])) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-floating-label::after{color:rgba(0, 0, 0, 0.6);color:var(--mdc-select-label-ink-color, rgba(0, 0, 0, 0.6))}:host(:not([disabled])) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-select__dropdown-icon{fill:rgba(0, 0, 0, 0.54);fill:var(--mdc-select-dropdown-icon-color, rgba(0, 0, 0, 0.54))}:host(:not([disabled])) .mdc-select.mdc-select--focused mwc-notched-outline{--mdc-notched-outline-stroke-width: 2px;--mdc-notched-outline-notch-offset: 2px}:host(:not([disabled])) .mdc-select.mdc-select--focused:not(.mdc-select--invalid) mwc-notched-outline{--mdc-notched-outline-border-color: var( --mdc-select-focused-label-color, var(--mdc-theme-primary, rgba(98, 0, 238, 0.87)) )}:host(:not([disabled])) .mdc-select.mdc-select--focused:not(.mdc-select--invalid) .mdc-select__dropdown-icon{fill:rgba(98,0,238,.87);fill:var(--mdc-select-focused-dropdown-icon-color, var(--mdc-theme-primary, rgba(98, 0, 238, 0.87)))}:host(:not([disabled])) .mdc-select.mdc-select--focused:not(.mdc-select--invalid) .mdc-floating-label{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host(:not([disabled])) .mdc-select.mdc-select--focused:not(.mdc-select--invalid) .mdc-floating-label::after{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host(:not([disabled])) .mdc-select-helper-text:not(.mdc-select-helper-text--validation-msg){color:var(--mdc-select-label-ink-color, rgba(0, 0, 0, 0.6))}:host([disabled]){pointer-events:none}:host([disabled]) .mdc-select:not(.mdc-select--outlined).mdc-select--disabled .mdc-select__anchor{background-color:#fafafa;background-color:var(--mdc-select-disabled-fill-color, #fafafa)}:host([disabled]) .mdc-select.mdc-select--outlined mwc-notched-outline{--mdc-notched-outline-border-color: var( --mdc-select-outlined-disabled-border-color, rgba(0, 0, 0, 0.06) )}:host([disabled]) .mdc-select .mdc-select__dropdown-icon{fill:rgba(0, 0, 0, 0.38);fill:var(--mdc-select-disabled-dropdown-icon-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-floating-label,:host([disabled]) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-floating-label::after{color:rgba(0, 0, 0, 0.38);color:var(--mdc-select-disabled-ink-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-select-helper-text{color:rgba(0, 0, 0, 0.38);color:var(--mdc-select-disabled-ink-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-select__selected-text{color:rgba(0, 0, 0, 0.38);color:var(--mdc-select-disabled-ink-color, rgba(0, 0, 0, 0.38))}`
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;let Nn=class extends Ln{};Nn.styles=[$n],Nn=r([_t("mwc-select")],Nn);
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class Bn extends vt{constructor(){super(...arguments),this.indeterminate=!1,this.progress=0,this.density=0,this.closed=!1}open(){this.closed=!1}close(){this.closed=!0}render(){const t={"mdc-circular-progress--closed":this.closed,"mdc-circular-progress--indeterminate":this.indeterminate},e=48+4*this.density,i={width:`${e}px`,height:`${e}px`};return D`
      <div
        class="mdc-circular-progress ${We(t)}"
        style="${xi(i)}"
        role="progressbar"
        aria-label="${Ti(this.ariaLabel)}"
        aria-valuemin="0"
        aria-valuemax="1"
        aria-valuenow="${Ti(this.indeterminate?void 0:this.progress)}">
        ${this.renderDeterminateContainer()}
        ${this.renderIndeterminateContainer()}
      </div>`}renderDeterminateContainer(){const t=48+4*this.density,e=t/2,i=this.density>=-3?18+11*this.density/6:12.5+5*(this.density+3)/4,r=6.2831852*i,n=(1-this.progress)*r,o=this.density>=-3?4+this.density*(1/3):3+(this.density+3)*(1/6);return D`
      <div class="mdc-circular-progress__determinate-container">
        <svg class="mdc-circular-progress__determinate-circle-graphic"
             viewBox="0 0 ${t} ${t}">
          <circle class="mdc-circular-progress__determinate-track"
                  cx="${e}" cy="${e}" r="${i}"
                  stroke-width="${o}"></circle>
          <circle class="mdc-circular-progress__determinate-circle"
                  cx="${e}" cy="${e}" r="${i}"
                  stroke-dasharray="${6.2831852*i}"
                  stroke-dashoffset="${n}"
                  stroke-width="${o}"></circle>
        </svg>
      </div>`}renderIndeterminateContainer(){return D`
      <div class="mdc-circular-progress__indeterminate-container">
        <div class="mdc-circular-progress__spinner-layer">
          ${this.renderIndeterminateSpinnerLayer()}
        </div>
      </div>`}renderIndeterminateSpinnerLayer(){const t=48+4*this.density,e=t/2,i=this.density>=-3?18+11*this.density/6:12.5+5*(this.density+3)/4,r=6.2831852*i,n=.5*r,o=this.density>=-3?4+this.density*(1/3):3+(this.density+3)*(1/6);return D`
        <div class="mdc-circular-progress__circle-clipper mdc-circular-progress__circle-left">
          <svg class="mdc-circular-progress__indeterminate-circle-graphic"
               viewBox="0 0 ${t} ${t}">
            <circle cx="${e}" cy="${e}" r="${i}"
                    stroke-dasharray="${r}"
                    stroke-dashoffset="${n}"
                    stroke-width="${o}"></circle>
          </svg>
        </div>
        <div class="mdc-circular-progress__gap-patch">
          <svg class="mdc-circular-progress__indeterminate-circle-graphic"
               viewBox="0 0 ${t} ${t}">
            <circle cx="${e}" cy="${e}" r="${i}"
                    stroke-dasharray="${r}"
                    stroke-dashoffset="${n}"
                    stroke-width="${.8*o}"></circle>
          </svg>
        </div>
        <div class="mdc-circular-progress__circle-clipper mdc-circular-progress__circle-right">
          <svg class="mdc-circular-progress__indeterminate-circle-graphic"
               viewBox="0 0 ${t} ${t}">
            <circle cx="${e}" cy="${e}" r="${i}"
                    stroke-dasharray="${r}"
                    stroke-dashoffset="${n}"
                    stroke-width="${o}"></circle>
          </svg>
        </div>`}update(t){super.update(t),t.has("progress")&&(this.progress>1&&(this.progress=1),this.progress<0&&(this.progress=0))}}r([xt({type:Boolean,reflect:!0})],Bn.prototype,"indeterminate",void 0),r([xt({type:Number,reflect:!0})],Bn.prototype,"progress",void 0),r([xt({type:Number,reflect:!0})],Bn.prototype,"density",void 0),r([xt({type:Boolean,reflect:!0})],Bn.prototype,"closed",void 0),r([Ei,xt({type:String,attribute:"aria-label"})],Bn.prototype,"ariaLabel",void 0);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const Dn=at`.mdc-circular-progress__determinate-circle,.mdc-circular-progress__indeterminate-circle-graphic{stroke:#6200ee;stroke:var(--mdc-theme-primary, #6200ee)}.mdc-circular-progress__determinate-track{stroke:transparent}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-color-1-fade-in-out{from{opacity:.99}25%{opacity:.99}26%{opacity:0}89%{opacity:0}90%{opacity:.99}to{opacity:.99}}@keyframes mdc-circular-progress-color-2-fade-in-out{from{opacity:0}15%{opacity:0}25%{opacity:.99}50%{opacity:.99}51%{opacity:0}to{opacity:0}}@keyframes mdc-circular-progress-color-3-fade-in-out{from{opacity:0}40%{opacity:0}50%{opacity:.99}75%{opacity:.99}76%{opacity:0}to{opacity:0}}@keyframes mdc-circular-progress-color-4-fade-in-out{from{opacity:0}65%{opacity:0}75%{opacity:.99}90%{opacity:.99}to{opacity:0}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}.mdc-circular-progress{display:inline-flex;position:relative;direction:ltr;line-height:0;transition:opacity 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:transparent}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{animation:mdc-circular-progress-container-rotate 1568.2352941176ms linear infinite}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__color-1{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both,mdc-circular-progress-color-1-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__color-2{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both,mdc-circular-progress-color-2-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__color-3{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both,mdc-circular-progress-color-3-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__color-4{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both,mdc-circular-progress-color-4-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--closed{opacity:0}:host{display:inline-flex}.mdc-circular-progress__determinate-track{stroke:transparent;stroke:var(--mdc-circular-progress-track-color, transparent)}`
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;let jn=class extends Bn{};function zn(t,e,i,r){void 0===r&&(r=!1);for(var n,o,a=0,s="",l=e;o=l.exec(t);)n=t.substring(a,o.index),a=l.lastIndex,s+=n,s+=i&&"function"==typeof i?i(t,o):i;return s+=t.substring(a),l.test(s)&&!0===r?zn(s,new RegExp(l),i,!0):s}function Fn(t){var e=new RegExp("^\\s*\\[(\\[)?(.*?)\\]\\]?(?= *$)((?:[\\w\\W](?!^\\s*\\[))*)","gm"),i={};return zn(t=(t="["===t[0]?t:"[]\n"+t).replace(/('{3,}(?:(?!'{3,})[\w\W]+?)'{3,})/gm,(function(t,e){if(e)return e.replace(/^(\s*)(\[)/gm,"$1__>>[<<__")})),e,(function(t,e){e[1]?qn(i,e[2].trim(),Un(e[3]),!0):""===e[2]?i=Object.assign({},i,Un(e[3])):qn(i,e[2].trim(),Un(e[3]),!1)})),JSON.parse(JSON.stringify(i,Hn),Vn)}function Un(t){var e=new RegExp("^[ \t]*(.+?) *[=:] *(?:\"((?!\")[\\w\\W]+?)\"|'{3,}((?!'{3,})[\\w\\W]+?)'{3,}|(\\[[\\w\\W]+?(?:(?: *])+ *$\\n*)+)|(\\{[\\w\\W]+?(?:(?: *})+ *$\\n*)+)|(.+) *)|^(.+)$","gm"),i={};return zn(t,e,(function(t,e){var r,n;if(e[1]){if("#"===e[1].charAt(0))return;return r='"'===e[1].charAt(0)&&'"'===e[1].charAt(e[1].length-1)?e[1].slice(1,-1):e[1],(e[2]||e[3])&&(n=e[2]||e[3].replace(/^(\s*)(__>>\[<<__)/gm,"$1[")),(e[4]||e[5])&&(n=JSON.parse(""+(e[4]||e[5]))),e[6]&&(e[6]=e[6].trim(),n=+e[6]==+e[6]?Number(e[6]):"true"===e[6]||"false"===e[6]?"true"===e[6]:"inf"===e[6]||"+inf"===e[6]?1/0:"-inf"===e[6]?-1/0:parseInt(e[6],16).toString(16)===e[6].toLowerCase()?parseInt(e[6],16):parseInt(e[6],8).toString(8)===e[6].toLowerCase()?parseInt(e[6],8):parseInt(e[6],2).toString(2)===e[6].toLowerCase()?parseInt(e[6],2):e[6]),i[r]=n,""}if(e[7])return""})),i}function qn(t,e,i,r){r=!!r,e.split&&(e=e.split("."));for(var n,o=0,a=e.length,s=t;o<a;++o)e[o]=e[o].trim(),e[o]='"'===e[o].substr(0,1)&&'"'===e[o].substr(-1)?e[o].slice(1,-1):e[o],s instanceof Array?(n=s[s.length-1],o--):n=s[e[o]],o===a-1?n instanceof Array?s[e[o]].push(i):s[e[o]]=r?[i]:i:s=n instanceof Array?n:s[e[o]]=null==n?{}:n}jn.styles=[Dn],jn=r([_t("mwc-circular-progress")],jn);var Hn=function(t,e){return e!=e?"__>>NaN<<__":e===1/0?"__>>Inf<<__":e===-1/0?"__>>-Inf<<__":e},Vn=function(t,e){return"__>>NaN<<__"===e?NaN:"__>>Inf<<__"===e?1/0:"__>>-Inf<<__"===e?-1/0:e};function Wn(t,e){t.tabIndex=e?-1:t.tabIndex<0?0:t.tabIndex}
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */const Gn="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,Kn=(t,e,i=null)=>{for(;e!==i;){const i=e.nextSibling;t.removeChild(e),e=i}},Xn=`{{lit-${String(Math.random()).slice(2)}}}`,Yn=`\x3c!--${Xn}--\x3e`,Zn=new RegExp(`${Xn}|${Yn}`);class Jn{constructor(t,e){this.parts=[],this.element=e;const i=[],r=[],n=document.createTreeWalker(e.content,133,null,!1);let o=0,a=-1,s=0;const{strings:l,values:{length:d}}=t;for(;s<d;){const t=n.nextNode();if(null!==t){if(a++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:i}=e;let r=0;for(let t=0;t<i;t++)Qn(e[t].name,"$lit$")&&r++;for(;r-- >0;){const e=l[s],i=io.exec(e)[2],r=i.toLowerCase()+"$lit$",n=t.getAttribute(r);t.removeAttribute(r);const o=n.split(Zn);this.parts.push({type:"attribute",index:a,name:i,strings:o}),s+=o.length-1}}"TEMPLATE"===t.tagName&&(r.push(t),n.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(Xn)>=0){const r=t.parentNode,n=e.split(Zn),o=n.length-1;for(let e=0;e<o;e++){let i,o=n[e];if(""===o)i=eo();else{const t=io.exec(o);null!==t&&Qn(t[2],"$lit$")&&(o=o.slice(0,t.index)+t[1]+t[2].slice(0,-"$lit$".length)+t[3]),i=document.createTextNode(o)}r.insertBefore(i,t),this.parts.push({type:"node",index:++a})}""===n[o]?(r.insertBefore(eo(),t),i.push(t)):t.data=n[o],s+=o}}else if(8===t.nodeType)if(t.data===Xn){const e=t.parentNode;null!==t.previousSibling&&a!==o||(a++,e.insertBefore(eo(),t)),o=a,this.parts.push({type:"node",index:a}),null===t.nextSibling?t.data="":(i.push(t),a--),s++}else{let e=-1;for(;-1!==(e=t.data.indexOf(Xn,e+1));)this.parts.push({type:"node",index:-1}),s++}}else n.currentNode=r.pop()}for(const t of i)t.parentNode.removeChild(t)}}const Qn=(t,e)=>{const i=t.length-e.length;return i>=0&&t.slice(i)===e},to=t=>-1!==t.index,eo=()=>document.createComment(""),io=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function ro(t,e){const{element:{content:i},parts:r}=t,n=document.createTreeWalker(i,133,null,!1);let o=oo(r),a=r[o],s=-1,l=0;const d=[];let c=null;for(;n.nextNode();){s++;const t=n.currentNode;for(t.previousSibling===c&&(c=null),e.has(t)&&(d.push(t),null===c&&(c=t)),null!==c&&l++;void 0!==a&&a.index===s;)a.index=null!==c?-1:a.index-l,o=oo(r,o),a=r[o]}d.forEach((t=>t.parentNode.removeChild(t)))}const no=t=>{let e=11===t.nodeType?0:1;const i=document.createTreeWalker(t,133,null,!1);for(;i.nextNode();)e++;return e},oo=(t,e=-1)=>{for(let i=e+1;i<t.length;i++){const e=t[i];if(to(e))return i}return-1};
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */
const ao=new WeakMap,so=t=>"function"==typeof t&&ao.has(t),lo={},co={};
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */
class ho{constructor(t,e,i){this.__parts=[],this.template=t,this.processor=e,this.options=i}update(t){let e=0;for(const i of this.__parts)void 0!==i&&i.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const t=Gn?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],i=this.template.parts,r=document.createTreeWalker(t,133,null,!1);let n,o=0,a=0,s=r.nextNode();for(;o<i.length;)if(n=i[o],to(n)){for(;a<n.index;)a++,"TEMPLATE"===s.nodeName&&(e.push(s),r.currentNode=s.content),null===(s=r.nextNode())&&(r.currentNode=e.pop(),s=r.nextNode());if("node"===n.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(s.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(s,n.name,n.strings,this.options));o++}else this.__parts.push(void 0),o++;return Gn&&(document.adoptNode(t),customElements.upgrade(t)),t}}
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */const uo=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),po=` ${Xn} `;class fo{constructor(t,e,i,r){this.strings=t,this.values=e,this.type=i,this.processor=r}getHTML(){const t=this.strings.length-1;let e="",i=!1;for(let r=0;r<t;r++){const t=this.strings[r],n=t.lastIndexOf("\x3c!--");i=(n>-1||i)&&-1===t.indexOf("--\x3e",n+1);const o=io.exec(t);e+=null===o?t+(i?po:Yn):t.substr(0,o.index)+o[1]+o[2]+"$lit$"+o[3]+Xn}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==uo&&(e=uo.createHTML(e)),t.innerHTML=e,t}}class mo extends fo{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const t=super.getTemplateElement(),e=t.content,i=e.firstChild;return e.removeChild(i),((t,e,i=null,r=null)=>{for(;e!==i;){const i=e.nextSibling;t.insertBefore(e,r),e=i}})(e,i.firstChild),t}}
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */const go=t=>null===t||!("object"==typeof t||"function"==typeof t),bo=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class vo{constructor(t,e,i){this.dirty=!0,this.element=t,this.name=e,this.strings=i,this.parts=[];for(let t=0;t<i.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new yo(this)}_getValue(){const t=this.strings,e=t.length-1,i=this.parts;if(1===e&&""===t[0]&&""===t[1]){const t=i[0].value;if("symbol"==typeof t)return String(t);if("string"==typeof t||!bo(t))return t}let r="";for(let n=0;n<e;n++){r+=t[n];const e=i[n];if(void 0!==e){const t=e.value;if(go(t)||!bo(t))r+="string"==typeof t?t:String(t);else for(const e of t)r+="string"==typeof e?e:String(e)}}return r+=t[e],r}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class yo{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===lo||go(t)&&t===this.value||(this.value=t,so(t)||(this.committer.dirty=!0))}commit(){for(;so(this.value);){const t=this.value;this.value=lo,t(this)}this.value!==lo&&this.committer.commit()}}class _o{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(eo()),this.endNode=t.appendChild(eo())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=eo()),t.__insert(this.endNode=eo())}insertAfterPart(t){t.__insert(this.startNode=eo()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;so(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=lo,t(this)}const t=this.__pendingValue;t!==lo&&(go(t)?t!==this.value&&this.__commitText(t):t instanceof fo?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):bo(t)?this.__commitIterable(t):t===co?(this.value=co,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,i="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=i:this.__commitNode(document.createTextNode(i)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof ho&&this.value.template===e)this.value.update(t.values);else{const i=new ho(e,t.processor,this.options),r=i._clone();i.update(t.values),this.__commitNode(r),this.value=i}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let i,r=0;for(const n of t)i=e[r],void 0===i&&(i=new _o(this.options),e.push(i),0===r?i.appendIntoPart(this):i.insertAfterPart(e[r-1])),i.setValue(n),i.commit(),r++;r<e.length&&(e.length=r,this.clear(i&&i.endNode))}clear(t=this.startNode){Kn(this.startNode.parentNode,t.nextSibling,this.endNode)}}class wo{constructor(t,e,i){if(this.value=void 0,this.__pendingValue=void 0,2!==i.length||""!==i[0]||""!==i[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=i}setValue(t){this.__pendingValue=t}commit(){for(;so(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=lo,t(this)}if(this.__pendingValue===lo)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=lo}}class xo extends vo{constructor(t,e,i){super(t,e,i),this.single=2===i.length&&""===i[0]&&""===i[1]}_createPart(){return new Mo(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class Mo extends yo{}let ko=!1;(()=>{try{const t={get capture(){return ko=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class So{constructor(t,e,i){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=i,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;so(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=lo,t(this)}if(this.__pendingValue===lo)return;const t=this.__pendingValue,e=this.value,i=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),r=null!=t&&(null==e||i);i&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),r&&(this.__options=Eo(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=lo}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const Eo=t=>t&&(ko?{capture:t.capture,passive:t.passive,once:t.once}:t.capture)
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */;function Ao(t){let e=To.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},To.set(t.type,e));let i=e.stringsArray.get(t.strings);if(void 0!==i)return i;const r=t.strings.join(Xn);return i=e.keyString.get(r),void 0===i&&(i=new Jn(t,t.getTemplateElement()),e.keyString.set(r,i)),e.stringsArray.set(t.strings,i),i}const To=new Map,Ro=new WeakMap;
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */const Io=new
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */
class{handleAttributeExpressions(t,e,i,r){const n=e[0];if("."===n){return new xo(t,e.slice(1),i).parts}if("@"===n)return[new So(t,e.slice(1),r.eventContext)];if("?"===n)return[new wo(t,e.slice(1),i)];return new vo(t,e,i).parts}handleTextExpression(t){return new _o(t)}};
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const Co=(t,...e)=>new fo(t,e,"html",Io),Oo=(t,...e)=>new mo(t,e,"svg",Io)
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */,Po=(t,e)=>`${t}--${e}`;let Lo=!0;void 0===window.ShadyCSS?Lo=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),Lo=!1);const $o=t=>e=>{const i=Po(e.type,t);let r=To.get(i);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},To.set(i,r));let n=r.stringsArray.get(e.strings);if(void 0!==n)return n;const o=e.strings.join(Xn);if(n=r.keyString.get(o),void 0===n){const i=e.getTemplateElement();Lo&&window.ShadyCSS.prepareTemplateDom(i,t),n=new Jn(e,i),r.keyString.set(o,n)}return r.stringsArray.set(e.strings,n),n},No=["html","svg"],Bo=new Set,Do=(t,e,i)=>{Bo.add(t);const r=i?i.element:document.createElement("template"),n=e.querySelectorAll("style"),{length:o}=n;if(0===o)return void window.ShadyCSS.prepareTemplateStyles(r,t);const a=document.createElement("style");for(let t=0;t<o;t++){const e=n[t];e.parentNode.removeChild(e),a.textContent+=e.textContent}(t=>{No.forEach((e=>{const i=To.get(Po(e,t));void 0!==i&&i.keyString.forEach((t=>{const{element:{content:e}}=t,i=new Set;Array.from(e.querySelectorAll("style")).forEach((t=>{i.add(t)})),ro(t,i)}))}))})(t);const s=r.content;i?function(t,e,i=null){const{element:{content:r},parts:n}=t;if(null==i)return void r.appendChild(e);const o=document.createTreeWalker(r,133,null,!1);let a=oo(n),s=0,l=-1;for(;o.nextNode();)for(l++,o.currentNode===i&&(s=no(e),i.parentNode.insertBefore(e,i));-1!==a&&n[a].index===l;){if(s>0){for(;-1!==a;)n[a].index+=s,a=oo(n,a);return}a=oo(n,a)}}(i,a,s.firstChild):s.insertBefore(a,s.firstChild),window.ShadyCSS.prepareTemplateStyles(r,t);const l=s.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(i){s.insertBefore(a,s.firstChild);const t=new Set;t.add(a),ro(i,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const jo={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},zo=(t,e)=>e!==t&&(e==e||t==t),Fo={attribute:!0,type:String,converter:jo,reflect:!1,hasChanged:zo};class Uo extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach(((e,i)=>{const r=this._attributeNameForProperty(i,e);void 0!==r&&(this._attributeToPropertyMap.set(r,i),t.push(r))})),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach(((t,e)=>this._classProperties.set(e,t)))}}static createProperty(t,e=Fo){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const i="symbol"==typeof t?Symbol():`__${t}`,r=this.getPropertyDescriptor(t,i,e);void 0!==r&&Object.defineProperty(this.prototype,t,r)}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(r){const n=this[t];this[e]=r,this.requestUpdateInternal(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||Fo}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty("finalized")||t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const i of e)this.createProperty(i,t[i])}}static _attributeNameForProperty(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,i=zo){return i(t,e)}static _propertyValueFromAttribute(t,e){const i=e.type,r=e.converter||jo,n="function"==typeof r?r:r.fromAttribute;return n?n(t,i):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const i=e.type,r=e.converter;return(r&&r.toAttribute||jo.toAttribute)(t,i)}initialize(){this._updateState=0,this._updatePromise=new Promise((t=>this._enableUpdatingResolver=t)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((t,e)=>this[e]=t)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,i){e!==i&&this._attributeToProperty(t,i)}_propertyToAttribute(t,e,i=Fo){const r=this.constructor,n=r._attributeNameForProperty(t,i);if(void 0!==n){const t=r._propertyValueToAttribute(e,i);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(n):this.setAttribute(n,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const i=this.constructor,r=i._attributeToPropertyMap.get(t);if(void 0!==r){const t=i.getPropertyOptions(r);this._updateState=16|this._updateState,this[r]=i._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,i){let r=!0;if(void 0!==t){const n=this.constructor;i=i||n.getPropertyOptions(t),n._valueHasChanged(this[t],e,i.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,i))):r=!1}!this._hasRequestedUpdate&&r&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(t){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((t,e)=>this._propertyToAttribute(e,this[e],t))),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}Uo.finalized=!0;
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */
const qo=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:r}=e;return{kind:i,elements:r,finisher(e){window.customElements.define(t,e)}}})(t,e),Ho=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?Object.assign(Object.assign({},e),{finisher(i){i.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function Vo(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):Ho(t,e)}function Wo(t,e){return(i,r)=>{const n={get(){return this.renderRoot.querySelector(t)},enumerable:!0,configurable:!0};if(e){const e=void 0!==r?r:i.key,o="symbol"==typeof e?Symbol():`__${e}`;n.get=function(){return void 0===this[o]&&(this[o]=this.renderRoot.querySelector(t)),this[o]}}return void 0!==r?Go(n,i,r):Ko(n,i)}}const Go=(t,e,i)=>{Object.defineProperty(e,i,t)},Ko=(t,e)=>({kind:"method",placement:"prototype",key:e.key,descriptor:t})
/**
@license
Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/,Xo=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Yo=Symbol();class Zo{constructor(t,e){if(e!==Yo)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(Xo?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const Jo=t=>new Zo(String(t),Yo);
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const Qo={};class ta extends Uo{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,i)=>t.reduceRight(((t,i)=>Array.isArray(i)?e(i,t):(t.add(i),t)),i),i=e(t,new Set),r=[];i.forEach((t=>r.unshift(t))),this._styles=r}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!Xo){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return Jo(e)}return t}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Xo?this.renderRoot.adoptedStyleSheets=t.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((t=>t.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==Qo&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)})))}render(){return Qo}}function ea(t){return Jo(t)}function ia(t,e){for(const i in e){const r=!0===e[i]?"":e[i];r||""===r||0===r?t.getAttribute(i)!==r&&t.setAttribute(i,r.toString()):t.hasAttribute(i)&&t.removeAttribute(i)}}function ra(t,e){if(null==t.shadowRoot)return[];const i=t.shadowRoot.host.getRootNode(),r=i.querySelectorAll(e);return r.length>0?Array.from(r):ra(i,e)}function na(t=document.activeElement){return null!=t&&null!=t.shadowRoot&&null!=t.shadowRoot.activeElement?na(t.shadowRoot.activeElement):t}function oa(t){return Array.from(t.querySelector("slot").assignedNodes()).filter((t=>"#text"!==t.nodeName))}function aa(t){for(;t.firstChild;)t.firstChild.remove()}function sa(t,e){return null!=e?"none"===e.display:null===t.offsetParent}function la(t,e,i=document.documentElement){i.style.setProperty(t,e)}ta.finalized=!0,ta.render=(t,e,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const r=i.scopeName,n=Ro.has(e),o=Lo&&11===e.nodeType&&!!e.host,a=o&&!Bo.has(r),s=a?document.createDocumentFragment():e;if(((t,e,i)=>{let r=Ro.get(e);void 0===r&&(Kn(e,e.firstChild),Ro.set(e,r=new _o(Object.assign({templateFactory:Ao},i))),r.appendInto(e)),r.setValue(t),r.commit()})(t,s,Object.assign({templateFactory:$o(r)},i)),a){const t=Ro.get(s);Ro.delete(s);const i=t.value instanceof ho?t.value.template:void 0;Do(r,s,i),Kn(e,e.firstChild),e.appendChild(s),Ro.set(e,t)}!n&&o&&window.ShadyCSS.styleElement(e.host)},ta.shadowRootOptions={mode:"open"};const da=new Map;function ca(t,e,i){const r=da.get(i);null!=r&&window.clearTimeout(r),da.set(i,window.setTimeout((()=>{t(),da.delete(i)}),e))}function ha(t,e,i,r,n){const o=Array.isArray(e)?e:[e],a=Math.random().toString(),s=t=>null==n?i(t):ca((()=>i(t)),n,a);return o.forEach((e=>t.addEventListener(e,s,r))),()=>o.forEach((e=>t.removeEventListener(e,s,r)))}function ua(t){t.forEach((t=>t())),t.length=0}function pa(t){t.preventDefault(),t.stopPropagation()}var fa,ma;function ga({anchorOriginX:t,anchorOriginY:e},{left:i,top:r,width:n=0,height:o=0}){switch(t){case fa.CENTER:i+=n/2;break;case fa.RIGHT:i+=n}switch(e){case ma.CENTER:r+=o/2;break;case ma.BOTTOM:r+=o}return{left:i,top:r}}function ba(t,e){const i=function(t){return new WebKitCSSMatrix(t.webkitTransform)}(t);return{x:0===(null==e?t.getPropertyValue("width"):e.width)?0:i.a,y:0===(null==e?t.getPropertyValue("height"):e.height)?0:i.d}}function va(t){if("0px"===t.getPropertyValue("width")||"0px"===t.getPropertyValue("height"))return 0;const e=t.getPropertyValue("opacity");return isNaN(+e)?0:Number(e)}function ya(t,e,i,r=20,n=0){let o=[];if(n>=r)return o;const a=t=>{const o=t.assignedNodes().filter((t=>1===t.nodeType));return o.length>0?ya(o[0].parentElement,e,i,r,n+1):[]},s=Array.from(t.children||[]);for(const t of s)e(t)||(i(t)&&o.push(t),null!=t.shadowRoot?o.push(...ya(t.shadowRoot,e,i,r,n+1)):"SLOT"===t.tagName?o.push(...a(t)):o.push(...ya(t,e,i,r,n+1)));return o}function _a(t){return t.hasAttribute("hidden")||t.hasAttribute("aria-hidden")&&"false"!==t.getAttribute("aria-hidden")||"none"===t.style.display||"0"===t.style.opacity||"hidden"===t.style.visibility||"collapse"===t.style.visibility}function wa(t){return"-1"!==t.getAttribute("tabindex")&&!_a(t)&&!function(t){return t.hasAttribute("disabled")||t.hasAttribute("aria-disabled")&&"false"!==t.getAttribute("aria-disabled")}(t)&&(t.hasAttribute("tabindex")||(t instanceof HTMLAnchorElement||t instanceof HTMLAreaElement)&&t.hasAttribute("href")||t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t instanceof HTMLIFrameElement)}!function(t){t.LEFT="left",t.CENTER="center",t.RIGHT="right"}(fa||(fa={})),function(t){t.TOP="top",t.CENTER="center",t.BOTTOM="bottom"}(ma||(ma={}));const xa=document.createElement("template");xa.innerHTML='\n\t<div id="start"></div>\n\t<div id="backup"></div>\n\t<slot></slot>\n\t<div id="end"></div>\n';class Ma extends HTMLElement{constructor(){super(),this.debounceId=Math.random().toString(),this._focused=!1;const t=this.attachShadow({mode:"open"});t.appendChild(xa.content.cloneNode(!0)),this.$backup=t.querySelector("#backup"),this.$start=t.querySelector("#start"),this.$end=t.querySelector("#end"),this.focusLastElement=this.focusLastElement.bind(this),this.focusFirstElement=this.focusFirstElement.bind(this),this.onFocusIn=this.onFocusIn.bind(this),this.onFocusOut=this.onFocusOut.bind(this)}static get observedAttributes(){return["inactive"]}get inactive(){return this.hasAttribute("inactive")}set inactive(t){t?this.setAttribute("inactive",""):this.removeAttribute("inactive")}get focused(){return this._focused}connectedCallback(){this.$start.addEventListener("focus",this.focusLastElement),this.$end.addEventListener("focus",this.focusFirstElement),this.addEventListener("focusin",this.onFocusIn),this.addEventListener("focusout",this.onFocusOut),this.render()}disconnectedCallback(){this.$start.removeEventListener("focus",this.focusLastElement),this.$end.removeEventListener("focus",this.focusFirstElement),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut)}attributeChangedCallback(){this.render()}focusFirstElement(){this.trapFocus()}focusLastElement(){this.trapFocus(!0)}getFocusableElements(){return ya(this,_a,wa)}trapFocus(t){if(this.inactive)return;let e=this.getFocusableElements();e.length>0?(t?e[e.length-1].focus():e[0].focus(),this.$backup.setAttribute("tabindex","-1")):(this.$backup.setAttribute("tabindex","0"),this.$backup.focus())}onFocusIn(){this.updateFocused(!0)}onFocusOut(){this.updateFocused(!1)}updateFocused(t){ca((()=>{this.focused!==t&&(this._focused=t,this.render())}),0,this.debounceId)}render(){this.$start.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.$end.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.focused?this.setAttribute("focused",""):this.removeAttribute("focused")}}window.customElements.define("focus-trap",Ma);let ka=class extends ta{constructor(){super(...arguments),this.role="presentation"}render(){return Co``}};function Sa(t){t.onfinish=null,t.pause()}function Ea(t){for(const e of t)Sa(e);t.length=0}ka.styles=[ea(":host{background:var(--backdrop-bg,rgba(0,0,0,.6));position:absolute;top:0;left:0;width:100%;height:100%;outline:none}")],r([Vo({type:String,reflect:!0}),n("design:type",String)],ka.prototype,"role",void 0),ka=r([qo("wl-backdrop")],ka);const Aa="ResizeObserver"in window;function Ta(t,e,{debounceMs:i}={}){const r=new ResizeObserver((t=>{t.forEach((({contentRect:t})=>null==i?e(t):ca((()=>e(t)),i,Math.random().toString())))}));return r.observe(t),()=>r.disconnect()}function Ra(t=10){return`_${Math.random().toString(36).substr(2,t)}`}const Ia="cubic-bezier(0.4, 0, 0.2, 1)",Ca="Enter",Oa="ArrowRight",Pa="ArrowLeft",La="ArrowUp",$a="ArrowDown";const Na=ea("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}");var Ba;!function(t){t.DID_SHOW="didShow",t.DID_HIDE="didHide"}(Ba||(Ba={}));const Da=document.documentElement,ja=t=>`overlay-${t}`;class za extends ta{constructor(){super(...arguments),this.open=!1,this.disableFocusTrap=!1,this.backdrop=!1,this.fixed=!1,this.persistent=!1,this.blockScrolling=!1,this.duration=200,this.scrollContainer=Da,this.activeInAnimations=[],this.activeOutAnimations=[],this.resolvers=[],this.overlayId=Ra(),this.listeners=[]}get $blockableScrollContainer(){return this.scrollContainer instanceof HTMLElement?this.scrollContainer:Da}get animationConfig(){return{duration:this.duration,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"both"}}trapFocus(){null!=this.$focusTrap&&(this.storeCurrentActiveElement(),this.$focusTrap.focusFirstElement())}storeCurrentActiveElement(){this.activeElementBeforeOpen=na()}show(t){return this.activeInAnimations.length>0||(this.prepareShowAnimation(t),this.animateIn(),this.open=!0),this.createResolver()}hide(t){this.activeOutAnimations.length>0||(this.prepareHideAnimation(),this.animateOut(t))}updated(t){super.updated(t),t.has("open")&&(this.open?this.removeAttribute("tabindex"):this.setAttribute("tabindex","-1")),this.updateAria()}updateAria(){ia(this,{"aria-hidden":!this.open})}createResolver(){return new Promise((t=>{this.resolvers.push(t)}))}resolve(t){for(const e of this.resolvers)e(t);this.resolvers.length=0}clickAway(){!this.persistent&&this.open&&this.hide()}dispatchOverlayEvent(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,composed:!0,bubbles:!0}))}setConfig(t){Object.assign(this,t)}pauseAnimations(){this.pauseInAnimations(),this.pauseOutAnimations()}pauseInAnimations(){Ea(this.activeInAnimations)}pauseOutAnimations(){Ea(this.activeOutAnimations)}prepareShowAnimation(t){if(this.listeners.push(ha(this.scrollContainer,"scroll",this.updatePosition.bind(this),{passive:!0}),Aa?Ta(this,this.updatePosition.bind(this),{debounceMs:100}):ha(window,"resize",this.updatePosition.bind(this),{passive:!0})),this.pauseAnimations(),null!=t&&this.setConfig(t),this.blockScrolling){const t=this.$blockableScrollContainer;t.style.overflow="hidden",t.classList.add(ja(this.overlayId))}}prepareHideAnimation(){ua(this.listeners),this.pauseAnimations()}didShow(){this.activeInAnimations.length=0,this.listeners.push(ha(this,"keydown",this.onKeyDown.bind(this))),this.disableFocusTrap||this.trapFocus(),this.dispatchOverlayEvent(Ba.DID_SHOW)}didHide(t){if(this.blockScrolling){const t=this.$blockableScrollContainer,e=t.className.match(new RegExp("overlay","gm"));(null===e||null!=e&&1===e.length)&&(t.style.overflow=""),t.classList.remove(ja(this.overlayId))}null!=this.activeElementBeforeOpen&&(this.activeElementBeforeOpen.focus(),this.activeElementBeforeOpen=void 0),this.activeOutAnimations.length=0,this.open=!1,this.dispatchOverlayEvent(Ba.DID_HIDE,t)}updatePosition(){}onKeyDown(t){switch(t.code){case"Escape":this.open&&!this.persistent&&(this.hide(),pa(t))}}}za.styles=[Na,ea(":host([backdrop]) #backdrop{display:block}#backdrop{display:none;pointer-events:all}")],r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],za.prototype,"open",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],za.prototype,"disableFocusTrap",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],za.prototype,"backdrop",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],za.prototype,"fixed",void 0),r([Vo({type:Boolean}),n("design:type",Boolean)],za.prototype,"persistent",void 0),r([Vo({type:Boolean}),n("design:type",Boolean)],za.prototype,"blockScrolling",void 0),r([Vo({type:Number}),n("design:type",Number)],za.prototype,"duration",void 0),r([Vo({type:Object}),n("design:type",EventTarget)],za.prototype,"scrollContainer",void 0);fa.LEFT,ma.TOP,fa.LEFT,ma.TOP;let Fa=class extends za{constructor(){super(...arguments),this.closeOnClick=!1,this.noFallback=!1,this.transformOriginX=fa.LEFT,this.transformOriginY=ma.TOP,this.anchorOriginX=fa.LEFT,this.anchorOriginY=ma.TOP,this.role="menu",this.clickAwayListeners=[],this.anchorOpenEventListeners=[],this.anchorCloseEventListeners=[]}get $focusTrap(){return this.$content}disconnectedCallback(){super.disconnectedCallback(),this.detachClickAwayListeners(),ua(this.anchorOpenEventListeners),ua(this.anchorCloseEventListeners)}updated(t){super.updated(t),t.has("anchorOpenEvents")&&null!=this.anchorOpenEvents&&this.attachEventListenersToAnchor(this.anchorOpenEventListeners,this.anchorOpenEvents,(()=>!this.open&&this.show())),t.has("anchorCloseEvents")&&null!=this.anchorCloseEvents&&this.attachEventListenersToAnchor(this.anchorCloseEventListeners,this.anchorCloseEvents,(()=>this.open&&this.hide()))}showAtPosition(t,e){return this.anchorPosition=t,this.show(e)}getPositionStrategy(){return{transformOriginX:this.transformOriginX,transformOriginY:this.transformOriginY,anchorOriginX:this.anchorOriginX,anchorOriginY:this.anchorOriginY}}didShow(){super.didShow(),this.$focusTrap.focusFirstElement(),this.attachClickAwayListeners()}didHide(t){super.didHide(t),this.anchorPosition=void 0}attachEventListenersToAnchor(t,e,i){ua(t);const r=this.getAnchor();if(null==r)return this.throwNoAnchorError();t.push(ha(r,e,i))}throwNoAnchorError(){throw new Error(`No anchor could be found for the popover. "${this.anchor}" provided as anchor.`)}attachClickAwayListeners(){var t,e;this.clickAwayListeners.push((t=[this.$container],e=this.clickAway.bind(this),ha(window,["mousedown","pointerdown"],(i=>{if(!("composedPath"in i))return;const r=i.composedPath();null==t.find((t=>r.includes(t)))&&e()}),{passive:!0})),ha(this.$container,"click",this.onContainerClick.bind(this)))}detachClickAwayListeners(){ua(this.clickAwayListeners)}animateIn(){let t=!1;const e=()=>{t||(t=!0,this.didShow())},i=this.$backdrop.animate({opacity:[va(window.getComputedStyle(this.$backdrop)).toString(),"1"]},this.animationConfig),r=window.getComputedStyle(this.$content),n=ba(r,this.$content.getBoundingClientRect()),o=va(r),a=this.$content.animate({transform:[`scale(${n.x}, ${n.y})`,"scale(1)"],opacity:[`${o>.5?o:0}`,1]},this.animationConfig);a.onfinish=e,i.onfinish=e,this.activeInAnimations.push(a,i),this.updatePosition()}animateOut(t){let e=!1;const i=()=>{e||(e=!0,this.resolve(t),this.didHide(t))},r=this.$backdrop.animate({opacity:[va(window.getComputedStyle(this.$backdrop)).toString(),"0"]},this.animationConfig),n=window.getComputedStyle(this.$content),o=ba(n,this.$content.getBoundingClientRect()),a=va(n),s=this.$content.animate({opacity:[a.toString(),0],transform:[`scale(${o.x}, ${o.y})`,"scale(0)"]},this.animationConfig);r.onfinish=i,s.onfinish=i,this.detachClickAwayListeners(),this.activeOutAnimations.push(r,s)}updatePosition(){super.updatePosition(),requestAnimationFrame((()=>{const t=this.getAnchor();let e,i=this.getPositionStrategy(),r=!1,n=null;if(null!=this.anchorPosition)e=this.anchorPosition;else{if(null==t)return this.throwNoAnchorError();n=t.getBoundingClientRect(),e=ga(i,n)}if(!this.noFallback){const t=function({transformOriginX:t,transformOriginY:e,anchorOriginX:i,anchorOriginY:r},{top:n,left:o},a){const{innerHeight:s,innerWidth:l}=window;switch(e){case ma.TOP:n+a.height>s&&(e=ma.BOTTOM,r=ma.TOP);break;case ma.BOTTOM:}switch(t){case fa.LEFT:o+a.width>l&&(t=fa.RIGHT,i=fa.LEFT)}return{transformOriginY:e,transformOriginX:t,anchorOriginX:i,anchorOriginY:r}}(i,e,this.$container.getBoundingClientRect());a=t,r=(o=i).transformOriginX!==a.transformOriginX||o.transformOriginY!==a.transformOriginY||o.anchorOriginX!==a.anchorOriginX||o.anchorOriginY!==a.anchorOriginY,r&&(i=t,e=ga(t,n||e))}var o,a;const s=function({transformOriginX:t,transformOriginY:e}){let i=0,r=0;switch(t){case fa.CENTER:i="-50%";break;case fa.RIGHT:i="-100%"}switch(e){case ma.CENTER:r="-50%";break;case ma.BOTTOM:r="-100%"}return{x:i,y:r}}(i);this.$content.style.transformOrigin=`${i.transformOriginX} ${i.transformOriginY}`,Object.assign(this.$container.style,{top:`${e.top}px`,left:`${e.left}px`,transform:`translate(${s.x}, ${s.y})`}),ia(this.$container,{"data-fallback-strategy":r,"data-anchor-origin-x":i.anchorOriginX,"data-anchor-origin-y":i.anchorOriginY,"data-transform-origin-x":i.transformOriginX,"data-transform-origin-y":i.transformOriginY});const{maxWidth:l,maxHeight:d}=function({transformOriginX:t,transformOriginY:e},{left:i,top:r}){const{innerHeight:n,innerWidth:o}=window;return{maxWidth:t===fa.RIGHT?i:o-i,maxHeight:e===ma.BOTTOM?r:n-r}}(i,e);la("--popover-container-max-width",`${l}px`,this.$container),la("--popover-container-max-height",`${d}px`,this.$container)}))}getAnchor(){let t=this.anchor;if("string"==typeof t||t instanceof String){const e=ra(this,t);t=e.length>0?e[0]:void 0}return t}onContainerClick(){this.open&&this.closeOnClick&&this.hide()}renderContent(){return Co` <slot></slot> `}render(){return Co` <wl-backdrop id="backdrop" @click="${this.clickAway}"></wl-backdrop> <div id="container" aria-expanded="${this.open.toString()}"> <focus-trap id="content" ?inactive="${!this.open||this.disableFocusTrap}"> ${this.renderContent()} </focus-trap> </div> `}};Fa.styles=[...za.styles,ea(":host{display:none;outline:none;pointer-events:none}:host([fixed]){z-index:var(--popover-z-index,12345678);position:fixed;top:0;left:0;width:100%;height:100%}:host([fixed]) #container{position:absolute}#content,:host([open]){display:block}#content{z-index:1;pointer-events:all}")],r([Vo({type:Boolean}),n("design:type",Boolean)],Fa.prototype,"closeOnClick",void 0),r([Vo({type:Boolean}),n("design:type",Boolean)],Fa.prototype,"noFallback",void 0),r([Vo({type:String,reflect:!0}),n("design:type",String)],Fa.prototype,"transformOriginX",void 0),r([Vo({type:String,reflect:!0}),n("design:type",String)],Fa.prototype,"transformOriginY",void 0),r([Vo({type:String,reflect:!0}),n("design:type",String)],Fa.prototype,"anchorOriginX",void 0),r([Vo({type:String,reflect:!0}),n("design:type",String)],Fa.prototype,"anchorOriginY",void 0),r([Vo({type:String,reflect:!0}),n("design:type",String)],Fa.prototype,"role",void 0),r([Vo({type:String}),n("design:type",Object)],Fa.prototype,"anchor",void 0),r([Vo({type:Array}),n("design:type",Array)],Fa.prototype,"anchorOpenEvents",void 0),r([Vo({type:Array}),n("design:type",Array)],Fa.prototype,"anchorCloseEvents",void 0),r([Wo("#content"),n("design:type",Ma)],Fa.prototype,"$content",void 0),r([Wo("#container"),n("design:type",HTMLElement)],Fa.prototype,"$container",void 0),r([Wo("#backdrop"),n("design:type",ka)],Fa.prototype,"$backdrop",void 0),Fa=r([qo("wl-popover")],Fa);let Ua=class extends ta{constructor(){super(...arguments),this.hoverable=!1}render(){return Co` <slot></slot> `}};Ua.styles=[Na,ea(":host{color:var(--card-color,hsl(var(--foreground,var(--foreground-hue,230),var(--foreground-saturation,70%),var(--foreground-lightness,5%))));background:var(--card-bg,hsl(var(--background,var(--background-hue,0),var(--background-saturation,0%),var(--background-lightness,100%))));transition:var(--card-transition,box-shadow var(--transition-duration-fast,.12s) var(--transition-timing-function-ease,ease));box-shadow:var(--card-elevation,var(--elevation-1,0 .3125rem .625rem -.125rem hsla(var(--shadow,var(--shadow-hue,230),var(--shadow-saturation,70%),var(--shadow-lightness,5%)),.15)));border-radius:var(--card-border-radius,.5rem);padding:var(--card-padding,0);display:flex;flex-direction:column;text-align:left}:host([hoverable]:hover){box-shadow:var(--card-elevation-hover,var(--elevation-4,0 .5rem 1rem -.125rem hsla(var(--shadow,var(--shadow-hue,230),var(--shadow-saturation,70%),var(--shadow-lightness,5%)),.15)))}")],r([Vo({reflect:!0,type:Boolean}),n("design:type",Boolean)],Ua.prototype,"hoverable",void 0),Ua=r([qo("wl-card")],Ua);let qa=class extends ta{render(){return Co` <svg id="arrow" viewBox="0 0 100 100" preserveAspectRatio="none"> <polygon points="50 0, 100 100, 0 100"/> </svg> <wl-card id="content"> <slot></slot> </wl-card> `}};qa.styles=[Na,ea(":host{--card-elevation:var(--popover-card-elevation,var(--elevation-4,0px 0.5rem 1rem -0.125rem hsla(var(--shadow,var(--shadow-hue,230),var(--shadow-saturation,70%),var(--shadow-lightness,5%)),0.15)));display:flex;flex-direction:var(--_flex-direction,column)}#content{transform:translate(calc(var(--popover-card-arrow-width, .625rem) * var(--_content-translate-x-multiplier, 0)),calc(var(--popover-card-arrow-width, .625rem) * var(--_content-translate-y-multiplier, 0)));overflow:hidden}#arrow{transform:rotate(var(--_arrow-rotation,0deg)) translate(calc(50% * var(--_arrow-translate-x-multiplier, 0)),calc(50% * var(--_arrow-translate-y-multiplier, 0)));left:var(--_arrow-offset-x,unset);top:var(--_arrow-offset-y,unset);justify-self:var(--_justify-content,flex-start);align-self:var(--_align-items,flex-start);pointer-events:none;position:relative;width:var(--popover-card-arrow-width,.625rem);height:var(--popover-card-arrow-height,.375rem);fill:var(--popover-card-arrow-fill,var(--card-bg,hsl(var(--background,var(--background-hue,0),var(--background-saturation,0%),var(--background-lightness,100%)))));z-index:1;display:none}:host-context([data-transform-origin-x][data-transform-origin-y]) #arrow{display:block}:host-context([data-transform-origin-x=left]){--_align-items:flex-start}:host-context([data-transform-origin-x=center]){--_align-items:center}:host-context([data-transform-origin-x=right]){--_align-items:flex-end}:host-context([data-transform-origin-y=top]){--_justify-content:flex-start}:host-context([data-transform-origin-y=center]){--_justify-content:center}:host-context([data-transform-origin-y=bottom]){--_flex-direction:column-reverse}:host-context([data-transform-origin-x=center][data-transform-origin-y=center]) #arrow{display:none}:host-context([data-transform-origin-x=left][data-transform-origin-y=top]){--_content-translate-x-multiplier:-2;--_arrow-translate-x-multiplier:-1}:host-context([data-transform-origin-x=right][data-transform-origin-y=top]){--_content-translate-x-multiplier:2;--_arrow-translate-x-multiplier:1}:host-context([data-transform-origin-y=bottom]){--_arrow-rotation:180deg}:host-context([data-transform-origin-x=left][data-transform-origin-y=bottom]){--_content-translate-x-multiplier:-2;--_arrow-translate-x-multiplier:1}:host-context([data-transform-origin-x=right][data-transform-origin-y=bottom]){--_content-translate-x-multiplier:2;--_arrow-translate-x-multiplier:-1}:host-context([data-transform-origin-y=center]){--_arrow-translate-x-multiplier:0;--_align-items:center}:host-context([data-transform-origin-x=left][data-transform-origin-y=center]){--_flex-direction:row;--_arrow-rotation:-90deg}:host-context([data-transform-origin-x=left][data-transform-origin-y=center]) #content{transform:translateX(calc(((var(--popover-card-arrow-width, .625rem) - var(--popover-card-arrow-height, .375rem)) / 2) * -1))}:host-context([data-transform-origin-x=right][data-transform-origin-y=center]){--_flex-direction:row-reverse;--_arrow-rotation:90deg}:host-context([data-transform-origin-x=right][data-transform-origin-y=center]) #content{transform:translateX(calc((var(--popover-card-arrow-width, .625rem) - var(--popover-card-arrow-height, .375rem)) / 2))}")],qa=r([qo("wl-popover-card")],qa);
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class Ha extends xn{constructor(){super(...arguments),this.checked=!1,this.indeterminate=!1,this.disabled=!1,this.name="",this.value="on",this.reducedTouchTarget=!1,this.animationClass="",this.shouldRenderRipple=!1,this.focused=!1,this.mdcFoundationClass=void 0,this.mdcFoundation=void 0,this.rippleElement=null,this.rippleHandlers=new Ai((()=>(this.shouldRenderRipple=!0,this.ripple.then((t=>this.rippleElement=t)),this.ripple)))}createAdapter(){return{}}update(t){const e=t.get("indeterminate"),i=t.get("checked"),r=t.get("disabled");if(void 0!==e||void 0!==i||void 0!==r){const t=this.calculateAnimationStateName(!!i,!!e,!!r),n=this.calculateAnimationStateName(this.checked,this.indeterminate,this.disabled);this.animationClass=`${t}-${n}`}super.update(t)}calculateAnimationStateName(t,e,i){return i?"disabled":e?"indeterminate":t?"checked":"unchecked"}renderRipple(){return this.shouldRenderRipple?this.renderRippleTemplate():""}renderRippleTemplate(){return D`<mwc-ripple
        .disabled="${this.disabled}"
        unbounded></mwc-ripple>`}render(){const t=this.indeterminate||this.checked,e={"mdc-checkbox--disabled":this.disabled,"mdc-checkbox--selected":t,"mdc-checkbox--touch":!this.reducedTouchTarget,"mdc-ripple-upgraded--background-focused":this.focused,"mdc-checkbox--anim-checked-indeterminate":"checked-indeterminate"==this.animationClass,"mdc-checkbox--anim-checked-unchecked":"checked-unchecked"==this.animationClass,"mdc-checkbox--anim-indeterminate-checked":"indeterminate-checked"==this.animationClass,"mdc-checkbox--anim-indeterminate-unchecked":"indeterminate-unchecked"==this.animationClass,"mdc-checkbox--anim-unchecked-checked":"unchecked-checked"==this.animationClass,"mdc-checkbox--anim-unchecked-indeterminate":"unchecked-indeterminate"==this.animationClass},i=this.indeterminate?"mixed":void 0;return D`
      <div class="mdc-checkbox mdc-checkbox--upgraded ${We(e)}">
        <input type="checkbox"
              class="mdc-checkbox__native-control"
              name="${Ti(this.name)}"
              aria-checked="${Ti(i)}"
              aria-label="${Ti(this.ariaLabel)}"
              aria-labelledby="${Ti(this.ariaLabelledBy)}"
              aria-describedby="${Ti(this.ariaDescribedBy)}"
              data-indeterminate="${this.indeterminate?"true":"false"}"
              ?disabled="${this.disabled}"
              .indeterminate="${this.indeterminate}"
              .checked="${this.checked}"
              .value="${this.value}"
              @change="${this.handleChange}"
              @focus="${this.handleFocus}"
              @blur="${this.handleBlur}"
              @mousedown="${this.handleRippleMouseDown}"
              @mouseenter="${this.handleRippleMouseEnter}"
              @mouseleave="${this.handleRippleMouseLeave}"
              @touchstart="${this.handleRippleTouchStart}"
              @touchend="${this.handleRippleDeactivate}"
              @touchcancel="${this.handleRippleDeactivate}">
        <div class="mdc-checkbox__background"
          @animationend="${this.resetAnimationClass}">
          <svg class="mdc-checkbox__checkmark"
              viewBox="0 0 24 24">
            <path class="mdc-checkbox__checkmark-path"
                  fill="none"
                  d="M1.73,12.91 8.1,19.28 22.79,4.59"></path>
          </svg>
          <div class="mdc-checkbox__mixedmark"></div>
        </div>
        ${this.renderRipple()}
      </div>`}setFormData(t){this.name&&this.checked&&t.append(this.name,this.value)}handleFocus(){this.focused=!0,this.handleRippleFocus()}handleBlur(){this.focused=!1,this.handleRippleBlur()}handleRippleMouseDown(t){const e=()=>{window.removeEventListener("mouseup",e),this.handleRippleDeactivate()};window.addEventListener("mouseup",e),this.rippleHandlers.startPress(t)}handleRippleTouchStart(t){this.rippleHandlers.startPress(t)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}handleChange(){this.checked=this.formElement.checked,this.indeterminate=this.formElement.indeterminate}resetAnimationClass(){this.animationClass=""}get isRippleActive(){var t;return(null===(t=this.rippleElement)||void 0===t?void 0:t.isActive)||!1}}r([Et(".mdc-checkbox")],Ha.prototype,"mdcRoot",void 0),r([Et("input")],Ha.prototype,"formElement",void 0),r([xt({type:Boolean,reflect:!0})],Ha.prototype,"checked",void 0),r([xt({type:Boolean})],Ha.prototype,"indeterminate",void 0),r([xt({type:Boolean,reflect:!0})],Ha.prototype,"disabled",void 0),r([xt({type:String,reflect:!0})],Ha.prototype,"name",void 0),r([xt({type:String})],Ha.prototype,"value",void 0),r([Ei,xt({type:String,attribute:"aria-label"})],Ha.prototype,"ariaLabel",void 0),r([Ei,xt({type:String,attribute:"aria-labelledby"})],Ha.prototype,"ariaLabelledBy",void 0),r([Ei,xt({type:String,attribute:"aria-describedby"})],Ha.prototype,"ariaDescribedBy",void 0),r([xt({type:Boolean})],Ha.prototype,"reducedTouchTarget",void 0),r([Mt()],Ha.prototype,"animationClass",void 0),r([Mt()],Ha.prototype,"shouldRenderRipple",void 0),r([Mt()],Ha.prototype,"focused",void 0),r([At("mwc-ripple")],Ha.prototype,"ripple",void 0),r([St({passive:!0})],Ha.prototype,"handleRippleTouchStart",null);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const Va=at`.mdc-checkbox{padding:calc((40px - 18px) / 2);padding:calc((var(--mdc-checkbox-ripple-size, 40px) - 18px) / 2);margin:calc((40px - 40px) / 2);margin:calc((var(--mdc-checkbox-touch-target-size, 40px) - 40px) / 2)}.mdc-checkbox .mdc-checkbox__ripple::before,.mdc-checkbox .mdc-checkbox__ripple::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-checkbox:hover .mdc-checkbox__ripple::before,.mdc-checkbox.mdc-ripple-surface--hover .mdc-checkbox__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-checkbox.mdc-ripple-upgraded--background-focused .mdc-checkbox__ripple::before,.mdc-checkbox:not(.mdc-ripple-upgraded):focus .mdc-checkbox__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-checkbox:not(.mdc-ripple-upgraded) .mdc-checkbox__ripple::after{transition:opacity 150ms linear}.mdc-checkbox:not(.mdc-ripple-upgraded):active .mdc-checkbox__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-checkbox.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-checkbox.mdc-checkbox--selected .mdc-checkbox__ripple::before,.mdc-checkbox.mdc-checkbox--selected .mdc-checkbox__ripple::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-checkbox.mdc-checkbox--selected:hover .mdc-checkbox__ripple::before,.mdc-checkbox.mdc-checkbox--selected.mdc-ripple-surface--hover .mdc-checkbox__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-checkbox.mdc-checkbox--selected.mdc-ripple-upgraded--background-focused .mdc-checkbox__ripple::before,.mdc-checkbox.mdc-checkbox--selected:not(.mdc-ripple-upgraded):focus .mdc-checkbox__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-checkbox.mdc-checkbox--selected:not(.mdc-ripple-upgraded) .mdc-checkbox__ripple::after{transition:opacity 150ms linear}.mdc-checkbox.mdc-checkbox--selected:not(.mdc-ripple-upgraded):active .mdc-checkbox__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-checkbox.mdc-checkbox--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-checkbox.mdc-ripple-upgraded--background-focused.mdc-checkbox--selected .mdc-checkbox__ripple::before,.mdc-checkbox.mdc-ripple-upgraded--background-focused.mdc-checkbox--selected .mdc-checkbox__ripple::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-checkbox .mdc-checkbox__background{top:calc((40px - 18px) / 2);top:calc((var(--mdc-checkbox-ripple-size, 40px) - 18px) / 2);left:calc((40px - 18px) / 2);left:calc((var(--mdc-checkbox-ripple-size, 40px) - 18px) / 2)}.mdc-checkbox .mdc-checkbox__native-control{top:calc((40px - 40px) / 2);top:calc((40px - var(--mdc-checkbox-touch-target-size, 40px)) / 2);right:calc((40px - 40px) / 2);right:calc((40px - var(--mdc-checkbox-touch-target-size, 40px)) / 2);left:calc((40px - 40px) / 2);left:calc((40px - var(--mdc-checkbox-touch-target-size, 40px)) / 2);width:40px;width:var(--mdc-checkbox-touch-target-size, 40px);height:40px;height:var(--mdc-checkbox-touch-target-size, 40px)}.mdc-checkbox .mdc-checkbox__native-control:enabled:not(:checked):not(:indeterminate):not([data-indeterminate=true])~.mdc-checkbox__background{border-color:rgba(0, 0, 0, 0.54);border-color:var(--mdc-checkbox-unchecked-color, rgba(0, 0, 0, 0.54));background-color:transparent}.mdc-checkbox .mdc-checkbox__native-control:enabled:checked~.mdc-checkbox__background,.mdc-checkbox .mdc-checkbox__native-control:enabled:indeterminate~.mdc-checkbox__background,.mdc-checkbox .mdc-checkbox__native-control[data-indeterminate=true]:enabled~.mdc-checkbox__background{border-color:#018786;border-color:var(--mdc-checkbox-checked-color, var(--mdc-theme-secondary, #018786));background-color:#018786;background-color:var(--mdc-checkbox-checked-color, var(--mdc-theme-secondary, #018786))}@keyframes mdc-checkbox-fade-in-background-8A000000FF01878600000000FF018786{0%{border-color:rgba(0, 0, 0, 0.54);border-color:var(--mdc-checkbox-unchecked-color, rgba(0, 0, 0, 0.54));background-color:transparent}50%{border-color:#018786;border-color:var(--mdc-checkbox-checked-color, var(--mdc-theme-secondary, #018786));background-color:#018786;background-color:var(--mdc-checkbox-checked-color, var(--mdc-theme-secondary, #018786))}}@keyframes mdc-checkbox-fade-out-background-8A000000FF01878600000000FF018786{0%,80%{border-color:#018786;border-color:var(--mdc-checkbox-checked-color, var(--mdc-theme-secondary, #018786));background-color:#018786;background-color:var(--mdc-checkbox-checked-color, var(--mdc-theme-secondary, #018786))}100%{border-color:rgba(0, 0, 0, 0.54);border-color:var(--mdc-checkbox-unchecked-color, rgba(0, 0, 0, 0.54));background-color:transparent}}.mdc-checkbox.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__native-control:enabled~.mdc-checkbox__background,.mdc-checkbox.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__native-control:enabled~.mdc-checkbox__background{animation-name:mdc-checkbox-fade-in-background-8A000000FF01878600000000FF018786}.mdc-checkbox.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__native-control:enabled~.mdc-checkbox__background,.mdc-checkbox.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__native-control:enabled~.mdc-checkbox__background{animation-name:mdc-checkbox-fade-out-background-8A000000FF01878600000000FF018786}.mdc-checkbox .mdc-checkbox__native-control[disabled]:not(:checked):not(:indeterminate):not([data-indeterminate=true])~.mdc-checkbox__background{border-color:rgba(0, 0, 0, 0.38);border-color:var(--mdc-checkbox-disabled-color, rgba(0, 0, 0, 0.38));background-color:transparent}.mdc-checkbox .mdc-checkbox__native-control[disabled]:checked~.mdc-checkbox__background,.mdc-checkbox .mdc-checkbox__native-control[disabled]:indeterminate~.mdc-checkbox__background,.mdc-checkbox .mdc-checkbox__native-control[data-indeterminate=true][disabled]~.mdc-checkbox__background{border-color:transparent;background-color:rgba(0, 0, 0, 0.38);background-color:var(--mdc-checkbox-disabled-color, rgba(0, 0, 0, 0.38))}.mdc-checkbox .mdc-checkbox__native-control:enabled~.mdc-checkbox__background .mdc-checkbox__checkmark{color:#fff;color:var(--mdc-checkbox-ink-color, #fff)}.mdc-checkbox .mdc-checkbox__native-control:enabled~.mdc-checkbox__background .mdc-checkbox__mixedmark{border-color:#fff;border-color:var(--mdc-checkbox-ink-color, #fff)}.mdc-checkbox .mdc-checkbox__native-control:disabled~.mdc-checkbox__background .mdc-checkbox__checkmark{color:#fff;color:var(--mdc-checkbox-ink-color, #fff)}.mdc-checkbox .mdc-checkbox__native-control:disabled~.mdc-checkbox__background .mdc-checkbox__mixedmark{border-color:#fff;border-color:var(--mdc-checkbox-ink-color, #fff)}.mdc-touch-target-wrapper{display:inline}@keyframes mdc-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:29.7833385}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}100%{stroke-dashoffset:0}}@keyframes mdc-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mdc-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);opacity:1;stroke-dashoffset:0}to{opacity:0;stroke-dashoffset:-29.7833385}}@keyframes mdc-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(45deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(45deg);opacity:0}to{transform:rotate(360deg);opacity:1}}@keyframes mdc-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:mdc-animation-deceleration-curve-timing-function;transform:rotate(-45deg);opacity:0}to{transform:rotate(0deg);opacity:1}}@keyframes mdc-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(315deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;transform:scaleX(1);opacity:1}32.8%,100%{transform:scaleX(0);opacity:0}}.mdc-checkbox{display:inline-block;position:relative;flex:0 0 18px;box-sizing:content-box;width:18px;height:18px;line-height:0;white-space:nowrap;cursor:pointer;vertical-align:bottom}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-checkbox__native-control[disabled]:not(:checked):not(:indeterminate):not([data-indeterminate=true])~.mdc-checkbox__background{border-color:GrayText;border-color:var(--mdc-checkbox-disabled-color, GrayText);background-color:transparent}.mdc-checkbox__native-control[disabled]:checked~.mdc-checkbox__background,.mdc-checkbox__native-control[disabled]:indeterminate~.mdc-checkbox__background,.mdc-checkbox__native-control[data-indeterminate=true][disabled]~.mdc-checkbox__background{border-color:GrayText;background-color:transparent;background-color:var(--mdc-checkbox-disabled-color, transparent)}.mdc-checkbox__native-control:disabled~.mdc-checkbox__background .mdc-checkbox__checkmark{color:GrayText;color:var(--mdc-checkbox-ink-color, GrayText)}.mdc-checkbox__native-control:disabled~.mdc-checkbox__background .mdc-checkbox__mixedmark{border-color:GrayText;border-color:var(--mdc-checkbox-ink-color, GrayText)}.mdc-checkbox__mixedmark{margin:0 1px}}.mdc-checkbox--disabled{cursor:default;pointer-events:none}.mdc-checkbox__background{display:inline-flex;position:absolute;align-items:center;justify-content:center;box-sizing:border-box;width:18px;height:18px;border:2px solid currentColor;border-radius:2px;background-color:transparent;pointer-events:none;will-change:background-color,border-color;transition:background-color 90ms 0ms cubic-bezier(0.4, 0, 0.6, 1),border-color 90ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-checkbox__checkmark{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;opacity:0;transition:opacity 180ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-checkbox--upgraded .mdc-checkbox__checkmark{opacity:1}.mdc-checkbox__checkmark-path{transition:stroke-dashoffset 180ms 0ms cubic-bezier(0.4, 0, 0.6, 1);stroke:currentColor;stroke-width:3.12px;stroke-dashoffset:29.7833385;stroke-dasharray:29.7833385}.mdc-checkbox__mixedmark{width:100%;height:0;transform:scaleX(0) rotate(0deg);border-width:1px;border-style:solid;opacity:0;transition:opacity 90ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__background,.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__background,.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__background,.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__background{animation-duration:180ms;animation-timing-function:linear}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-unchecked-checked-checkmark-path 180ms linear 0s;transition:none}.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-unchecked-indeterminate-mixedmark 90ms linear 0s;transition:none}.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-checked-unchecked-checkmark-path 90ms linear 0s;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__checkmark{animation:mdc-checkbox-checked-indeterminate-checkmark 90ms linear 0s;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-checked-indeterminate-mixedmark 90ms linear 0s;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__checkmark{animation:mdc-checkbox-indeterminate-checked-checkmark 500ms linear 0s;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-checked-mixedmark 500ms linear 0s;transition:none}.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-unchecked-mixedmark 300ms linear 0s;transition:none}.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background,.mdc-checkbox__native-control[data-indeterminate=true]~.mdc-checkbox__background{transition:border-color 90ms 0ms cubic-bezier(0, 0, 0.2, 1),background-color 90ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-checkbox__native-control:checked~.mdc-checkbox__background .mdc-checkbox__checkmark-path,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background .mdc-checkbox__checkmark-path,.mdc-checkbox__native-control[data-indeterminate=true]~.mdc-checkbox__background .mdc-checkbox__checkmark-path{stroke-dashoffset:0}.mdc-checkbox__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit}.mdc-checkbox__native-control:disabled{cursor:default;pointer-events:none}.mdc-checkbox--touch{margin:calc((48px - 40px) / 2);margin:calc((var(--mdc-checkbox-state-layer-size, 48px) - var(--mdc-checkbox-state-layer-size, 40px)) / 2)}.mdc-checkbox--touch .mdc-checkbox__native-control{top:calc((40px - 48px) / 2);top:calc((var(--mdc-checkbox-state-layer-size, 40px) - var(--mdc-checkbox-state-layer-size, 48px)) / 2);right:calc((40px - 48px) / 2);right:calc((var(--mdc-checkbox-state-layer-size, 40px) - var(--mdc-checkbox-state-layer-size, 48px)) / 2);left:calc((40px - 48px) / 2);left:calc((var(--mdc-checkbox-state-layer-size, 40px) - var(--mdc-checkbox-state-layer-size, 48px)) / 2);width:48px;width:var(--mdc-checkbox-state-layer-size, 48px);height:48px;height:var(--mdc-checkbox-state-layer-size, 48px)}.mdc-checkbox__native-control:checked~.mdc-checkbox__background .mdc-checkbox__checkmark{transition:opacity 180ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 180ms 0ms cubic-bezier(0, 0, 0.2, 1);opacity:1}.mdc-checkbox__native-control:checked~.mdc-checkbox__background .mdc-checkbox__mixedmark{transform:scaleX(1) rotate(-45deg)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background .mdc-checkbox__checkmark,.mdc-checkbox__native-control[data-indeterminate=true]~.mdc-checkbox__background .mdc-checkbox__checkmark{transform:rotate(45deg);opacity:0;transition:opacity 90ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background .mdc-checkbox__mixedmark,.mdc-checkbox__native-control[data-indeterminate=true]~.mdc-checkbox__background .mdc-checkbox__mixedmark{transform:scaleX(1) rotate(0deg);opacity:1}.mdc-checkbox.mdc-checkbox--upgraded .mdc-checkbox__background,.mdc-checkbox.mdc-checkbox--upgraded .mdc-checkbox__checkmark,.mdc-checkbox.mdc-checkbox--upgraded .mdc-checkbox__checkmark-path,.mdc-checkbox.mdc-checkbox--upgraded .mdc-checkbox__mixedmark{transition:none}:host{outline:none;display:inline-flex;-webkit-tap-highlight-color:transparent}:host([checked]),:host([indeterminate]){--mdc-ripple-color:var(--mdc-theme-secondary, #018786)}.mdc-checkbox .mdc-checkbox__background::before{content:none}`
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;let Wa=class extends Ha{};Wa.styles=[Va],Wa=r([_t("mwc-checkbox")],Wa);
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var Ga={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",INPUT_SELECTOR:".mdc-text-field__input",LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-text-field__icon--leading",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",OUTLINE_SELECTOR:".mdc-notched-outline",PREFIX_SELECTOR:".mdc-text-field__affix--prefix",SUFFIX_SELECTOR:".mdc-text-field__affix--suffix",TRAILING_ICON_SELECTOR:".mdc-text-field__icon--trailing"},Ka={DISABLED:"mdc-text-field--disabled",FOCUSED:"mdc-text-field--focused",HELPER_LINE:"mdc-text-field-helper-line",INVALID:"mdc-text-field--invalid",LABEL_FLOATING:"mdc-text-field--label-floating",NO_LABEL:"mdc-text-field--no-label",OUTLINED:"mdc-text-field--outlined",ROOT:"mdc-text-field",TEXTAREA:"mdc-text-field--textarea",WITH_LEADING_ICON:"mdc-text-field--with-leading-icon",WITH_TRAILING_ICON:"mdc-text-field--with-trailing-icon",WITH_INTERNAL_COUNTER:"mdc-text-field--with-internal-counter"},Xa={LABEL_SCALE:.75},Ya=["pattern","min","max","required","step","minlength","maxlength"],Za=["color","date","datetime-local","month","range","time","week"],Ja=["mousedown","touchstart"],Qa=["click","keydown"],ts=function(t){function r(e,n){void 0===n&&(n={});var o=t.call(this,i(i({},r.defaultAdapter),e))||this;return o.isFocused=!1,o.receivedUserInput=!1,o.valid=!0,o.useNativeValidation=!0,o.validateOnValueChange=!0,o.helperText=n.helperText,o.characterCounter=n.characterCounter,o.leadingIcon=n.leadingIcon,o.trailingIcon=n.trailingIcon,o.inputFocusHandler=function(){o.activateFocus()},o.inputBlurHandler=function(){o.deactivateFocus()},o.inputInputHandler=function(){o.handleInput()},o.setPointerXOffset=function(t){o.setTransformOrigin(t)},o.textFieldInteractionHandler=function(){o.handleTextFieldInteraction()},o.validationAttributeChangeHandler=function(t){o.handleValidationAttributeChange(t)},o}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return Ka},enumerable:!1,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return Ga},enumerable:!1,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return Xa},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"shouldAlwaysFloat",{get:function(){var t=this.getNativeInput().type;return Za.indexOf(t)>=0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"shouldFloat",{get:function(){return this.shouldAlwaysFloat||this.isFocused||!!this.getValue()||this.isBadInput()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"shouldShake",{get:function(){return!this.isFocused&&!this.isValid()&&!!this.getValue()},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!0},setInputAttr:function(){},removeInputAttr:function(){},registerTextFieldInteractionHandler:function(){},deregisterTextFieldInteractionHandler:function(){},registerInputInteractionHandler:function(){},deregisterInputInteractionHandler:function(){},registerValidationAttributeChangeHandler:function(){return new MutationObserver((function(){}))},deregisterValidationAttributeChangeHandler:function(){},getNativeInput:function(){return null},isFocused:function(){return!1},activateLineRipple:function(){},deactivateLineRipple:function(){},setLineRippleTransformOrigin:function(){},shakeLabel:function(){},floatLabel:function(){},setLabelRequired:function(){},hasLabel:function(){return!1},getLabelWidth:function(){return 0},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){}}},enumerable:!1,configurable:!0}),r.prototype.init=function(){var t,e,i,r;this.adapter.hasLabel()&&this.getNativeInput().required&&this.adapter.setLabelRequired(!0),this.adapter.isFocused()?this.inputFocusHandler():this.adapter.hasLabel()&&this.shouldFloat&&(this.notchOutline(!0),this.adapter.floatLabel(!0),this.styleFloating(!0)),this.adapter.registerInputInteractionHandler("focus",this.inputFocusHandler),this.adapter.registerInputInteractionHandler("blur",this.inputBlurHandler),this.adapter.registerInputInteractionHandler("input",this.inputInputHandler);try{for(var n=o(Ja),a=n.next();!a.done;a=n.next()){var s=a.value;this.adapter.registerInputInteractionHandler(s,this.setPointerXOffset)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}try{for(var l=o(Qa),d=l.next();!d.done;d=l.next()){s=d.value;this.adapter.registerTextFieldInteractionHandler(s,this.textFieldInteractionHandler)}}catch(t){i={error:t}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}this.validationObserver=this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler),this.setcharacterCounter(this.getValue().length)},r.prototype.destroy=function(){var t,e,i,r;this.adapter.deregisterInputInteractionHandler("focus",this.inputFocusHandler),this.adapter.deregisterInputInteractionHandler("blur",this.inputBlurHandler),this.adapter.deregisterInputInteractionHandler("input",this.inputInputHandler);try{for(var n=o(Ja),a=n.next();!a.done;a=n.next()){var s=a.value;this.adapter.deregisterInputInteractionHandler(s,this.setPointerXOffset)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}try{for(var l=o(Qa),d=l.next();!d.done;d=l.next()){s=d.value;this.adapter.deregisterTextFieldInteractionHandler(s,this.textFieldInteractionHandler)}}catch(t){i={error:t}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver)},r.prototype.handleTextFieldInteraction=function(){var t=this.adapter.getNativeInput();t&&t.disabled||(this.receivedUserInput=!0)},r.prototype.handleValidationAttributeChange=function(t){var e=this;t.some((function(t){return Ya.indexOf(t)>-1&&(e.styleValidity(!0),e.adapter.setLabelRequired(e.getNativeInput().required),!0)})),t.indexOf("maxlength")>-1&&this.setcharacterCounter(this.getValue().length)},r.prototype.notchOutline=function(t){if(this.adapter.hasOutline()&&this.adapter.hasLabel())if(t){var e=this.adapter.getLabelWidth()*Xa.LABEL_SCALE;this.adapter.notchOutline(e)}else this.adapter.closeOutline()},r.prototype.activateFocus=function(){this.isFocused=!0,this.styleFocused(this.isFocused),this.adapter.activateLineRipple(),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),!this.helperText||!this.helperText.isPersistent()&&this.helperText.isValidation()&&this.valid||this.helperText.showToScreenReader()},r.prototype.setTransformOrigin=function(t){if(!this.isDisabled()&&!this.adapter.hasOutline()){var e=t.touches,i=e?e[0]:t,r=i.target.getBoundingClientRect(),n=i.clientX-r.left;this.adapter.setLineRippleTransformOrigin(n)}},r.prototype.handleInput=function(){this.autoCompleteFocus(),this.setcharacterCounter(this.getValue().length)},r.prototype.autoCompleteFocus=function(){this.receivedUserInput||this.activateFocus()},r.prototype.deactivateFocus=function(){this.isFocused=!1,this.adapter.deactivateLineRipple();var t=this.isValid();this.styleValidity(t),this.styleFocused(this.isFocused),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.shouldFloat||(this.receivedUserInput=!1)},r.prototype.getValue=function(){return this.getNativeInput().value},r.prototype.setValue=function(t){if(this.getValue()!==t&&(this.getNativeInput().value=t),this.setcharacterCounter(t.length),this.validateOnValueChange){var e=this.isValid();this.styleValidity(e)}this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating(this.shouldFloat),this.validateOnValueChange&&this.adapter.shakeLabel(this.shouldShake))},r.prototype.isValid=function(){return this.useNativeValidation?this.isNativeInputValid():this.valid},r.prototype.setValid=function(t){this.valid=t,this.styleValidity(t);var e=!t&&!this.isFocused&&!!this.getValue();this.adapter.hasLabel()&&this.adapter.shakeLabel(e)},r.prototype.setValidateOnValueChange=function(t){this.validateOnValueChange=t},r.prototype.getValidateOnValueChange=function(){return this.validateOnValueChange},r.prototype.setUseNativeValidation=function(t){this.useNativeValidation=t},r.prototype.isDisabled=function(){return this.getNativeInput().disabled},r.prototype.setDisabled=function(t){this.getNativeInput().disabled=t,this.styleDisabled(t)},r.prototype.setHelperTextContent=function(t){this.helperText&&this.helperText.setContent(t)},r.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon&&this.leadingIcon.setAriaLabel(t)},r.prototype.setLeadingIconContent=function(t){this.leadingIcon&&this.leadingIcon.setContent(t)},r.prototype.setTrailingIconAriaLabel=function(t){this.trailingIcon&&this.trailingIcon.setAriaLabel(t)},r.prototype.setTrailingIconContent=function(t){this.trailingIcon&&this.trailingIcon.setContent(t)},r.prototype.setcharacterCounter=function(t){if(this.characterCounter){var e=this.getNativeInput().maxLength;if(-1===e)throw new Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");this.characterCounter.setCounterValue(t,e)}},r.prototype.isBadInput=function(){return this.getNativeInput().validity.badInput||!1},r.prototype.isNativeInputValid=function(){return this.getNativeInput().validity.valid},r.prototype.styleValidity=function(t){var e=r.cssClasses.INVALID;if(t?this.adapter.removeClass(e):this.adapter.addClass(e),this.helperText){if(this.helperText.setValidity(t),!this.helperText.isValidation())return;var i=this.helperText.isVisible(),n=this.helperText.getId();i&&n?this.adapter.setInputAttr(Ga.ARIA_DESCRIBEDBY,n):this.adapter.removeInputAttr(Ga.ARIA_DESCRIBEDBY)}},r.prototype.styleFocused=function(t){var e=r.cssClasses.FOCUSED;t?this.adapter.addClass(e):this.adapter.removeClass(e)},r.prototype.styleDisabled=function(t){var e=r.cssClasses,i=e.DISABLED,n=e.INVALID;t?(this.adapter.addClass(i),this.adapter.removeClass(n)):this.adapter.removeClass(i),this.leadingIcon&&this.leadingIcon.setDisabled(t),this.trailingIcon&&this.trailingIcon.setDisabled(t)},r.prototype.styleFloating=function(t){var e=r.cssClasses.LABEL_FLOATING;t?this.adapter.addClass(e):this.adapter.removeClass(e)},r.prototype.getNativeInput=function(){return(this.adapter?this.adapter.getNativeInput():null)||{disabled:!1,maxLength:-1,required:!1,type:"input",validity:{badInput:!1,valid:!0},value:""}},r}(Oe);
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const es=qt(class extends Ht{constructor(t){if(super(t),t.type!==Ft&&t.type!==jt&&t.type!==Ut)throw Error("The `live` directive is not allowed on child or event bindings");if(!Vt(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===j||e===z)return e;const i=t.element,r=t.name;if(t.type===Ft){if(e===i[r])return j}else if(t.type===Ut){if(!!e===i.hasAttribute(r))return j}else if(t.type===jt&&i.getAttribute(r)===e+"")return j;return((t,e=Wt)=>{t._$AH=e})(t),e}}),is=["touchstart","touchmove","scroll","mousewheel"],rs=(t={})=>{const e={};for(const i in t)e[i]=t[i];return Object.assign({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1},e)};
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class ns extends xn{constructor(){super(...arguments),this.mdcFoundationClass=ts,this.value="",this.type="text",this.placeholder="",this.label="",this.icon="",this.iconTrailing="",this.disabled=!1,this.required=!1,this.minLength=-1,this.maxLength=-1,this.outlined=!1,this.helper="",this.validateOnInitialRender=!1,this.validationMessage="",this.autoValidate=!1,this.pattern="",this.min="",this.max="",this.step=null,this.size=null,this.helperPersistent=!1,this.charCounter=!1,this.endAligned=!1,this.prefix="",this.suffix="",this.name="",this.readOnly=!1,this.autocapitalize="",this.outlineOpen=!1,this.outlineWidth=0,this.isUiValid=!0,this.focused=!1,this._validity=rs(),this.validityTransform=null}get validity(){return this._checkValidity(this.value),this._validity}get willValidate(){return this.formElement.willValidate}get selectionStart(){return this.formElement.selectionStart}get selectionEnd(){return this.formElement.selectionEnd}focus(){const t=new CustomEvent("focus");this.formElement.dispatchEvent(t),this.formElement.focus()}blur(){const t=new CustomEvent("blur");this.formElement.dispatchEvent(t),this.formElement.blur()}select(){this.formElement.select()}setSelectionRange(t,e,i){this.formElement.setSelectionRange(t,e,i)}update(t){t.has("autoValidate")&&this.mdcFoundation&&this.mdcFoundation.setValidateOnValueChange(this.autoValidate),t.has("value")&&"string"!=typeof this.value&&(this.value=`${this.value}`),super.update(t)}setFormData(t){this.name&&t.append(this.name,this.value)}render(){const t=this.charCounter&&-1!==this.maxLength,e=!!this.helper||!!this.validationMessage||t,i={"mdc-text-field--disabled":this.disabled,"mdc-text-field--no-label":!this.label,"mdc-text-field--filled":!this.outlined,"mdc-text-field--outlined":this.outlined,"mdc-text-field--with-leading-icon":this.icon,"mdc-text-field--with-trailing-icon":this.iconTrailing,"mdc-text-field--end-aligned":this.endAligned};return D`
      <label class="mdc-text-field ${We(i)}">
        ${this.renderRipple()}
        ${this.outlined?this.renderOutline():this.renderLabel()}
        ${this.renderLeadingIcon()}
        ${this.renderPrefix()}
        ${this.renderInput(e)}
        ${this.renderSuffix()}
        ${this.renderTrailingIcon()}
        ${this.renderLineRipple()}
      </label>
      ${this.renderHelperText(e,t)}
    `}updated(t){t.has("value")&&void 0!==t.get("value")&&(this.mdcFoundation.setValue(this.value),this.autoValidate&&this.reportValidity())}renderRipple(){return this.outlined?"":D`
      <span class="mdc-text-field__ripple"></span>
    `}renderOutline(){return this.outlined?D`
      <mwc-notched-outline
          .width=${this.outlineWidth}
          .open=${this.outlineOpen}
          class="mdc-notched-outline">
        ${this.renderLabel()}
      </mwc-notched-outline>`:""}renderLabel(){return this.label?D`
      <span
          .floatingLabelFoundation=${Sn(this.label)}
          id="label">${this.label}</span>
    `:""}renderLeadingIcon(){return this.icon?this.renderIcon(this.icon):""}renderTrailingIcon(){return this.iconTrailing?this.renderIcon(this.iconTrailing,!0):""}renderIcon(t,e=!1){return D`<i class="material-icons mdc-text-field__icon ${We({"mdc-text-field__icon--leading":!e,"mdc-text-field__icon--trailing":e})}">${t}</i>`}renderPrefix(){return this.prefix?this.renderAffix(this.prefix):""}renderSuffix(){return this.suffix?this.renderAffix(this.suffix,!0):""}renderAffix(t,e=!1){return D`<span class="mdc-text-field__affix ${We({"mdc-text-field__affix--prefix":!e,"mdc-text-field__affix--suffix":e})}">
        ${t}</span>`}renderInput(t){const e=-1===this.minLength?void 0:this.minLength,i=-1===this.maxLength?void 0:this.maxLength,r=this.autocapitalize?this.autocapitalize:void 0,n=this.validationMessage&&!this.isUiValid,o=this.label?"label":void 0,a=t?"helper-text":void 0,s=this.focused||this.helperPersistent||n?"helper-text":void 0;return D`
      <input
          aria-labelledby=${Ti(o)}
          aria-controls="${Ti(a)}"
          aria-describedby="${Ti(s)}"
          class="mdc-text-field__input"
          type="${this.type}"
          .value="${es(this.value)}"
          ?disabled="${this.disabled}"
          placeholder="${this.placeholder}"
          ?required="${this.required}"
          ?readonly="${this.readOnly}"
          minlength="${Ti(e)}"
          maxlength="${Ti(i)}"
          pattern="${Ti(this.pattern?this.pattern:void 0)}"
          min="${Ti(""===this.min?void 0:this.min)}"
          max="${Ti(""===this.max?void 0:this.max)}"
          step="${Ti(null===this.step?void 0:this.step)}"
          size="${Ti(null===this.size?void 0:this.size)}"
          name="${Ti(""===this.name?void 0:this.name)}"
          inputmode="${Ti(this.inputMode)}"
          autocapitalize="${Ti(r)}"
          @input="${this.handleInputChange}"
          @focus="${this.onInputFocus}"
          @blur="${this.onInputBlur}">`}renderLineRipple(){return this.outlined?"":D`
      <span .lineRippleFoundation=${Tn()}></span>
    `}renderHelperText(t,e){const i=this.validationMessage&&!this.isUiValid,r={"mdc-text-field-helper-text--persistent":this.helperPersistent,"mdc-text-field-helper-text--validation-msg":i},n=this.focused||this.helperPersistent||i?void 0:"true",o=i?this.validationMessage:this.helper;return t?D`
      <div class="mdc-text-field-helper-line">
        <div id="helper-text"
             aria-hidden="${Ti(n)}"
             class="mdc-text-field-helper-text ${We(r)}"
             >${o}</div>
        ${this.renderCharCounter(e)}
      </div>`:""}renderCharCounter(t){const e=Math.min(this.value.length,this.maxLength);return t?D`
      <span class="mdc-text-field-character-counter"
            >${e} / ${this.maxLength}</span>`:""}onInputFocus(){this.focused=!0}onInputBlur(){this.focused=!1,this.reportValidity()}checkValidity(){const t=this._checkValidity(this.value);if(!t){const t=new Event("invalid",{bubbles:!1,cancelable:!0});this.dispatchEvent(t)}return t}reportValidity(){const t=this.checkValidity();return this.mdcFoundation.setValid(t),this.isUiValid=t,t}_checkValidity(t){const e=this.formElement.validity;let i=rs(e);if(this.validityTransform){const e=this.validityTransform(t,i);i=Object.assign(Object.assign({},i),e),this.mdcFoundation.setUseNativeValidation(!1)}else this.mdcFoundation.setUseNativeValidation(!0);return this._validity=i,this._validity.valid}setCustomValidity(t){this.validationMessage=t,this.formElement.setCustomValidity(t)}handleInputChange(){this.value=this.formElement.value}createAdapter(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.getRootAdapterMethods()),this.getInputAdapterMethods()),this.getLabelAdapterMethods()),this.getLineRippleAdapterMethods()),this.getOutlineAdapterMethods())}getRootAdapterMethods(){return Object.assign({registerTextFieldInteractionHandler:(t,e)=>this.addEventListener(t,e),deregisterTextFieldInteractionHandler:(t,e)=>this.removeEventListener(t,e),registerValidationAttributeChangeHandler:t=>{const e=new MutationObserver((e=>{t((t=>t.map((t=>t.attributeName)).filter((t=>t)))(e))}));return e.observe(this.formElement,{attributes:!0}),e},deregisterValidationAttributeChangeHandler:t=>t.disconnect()},Be(this.mdcRoot))}getInputAdapterMethods(){return{getNativeInput:()=>this.formElement,setInputAttr:()=>{},removeInputAttr:()=>{},isFocused:()=>!!this.shadowRoot&&this.shadowRoot.activeElement===this.formElement,registerInputInteractionHandler:(t,e)=>this.formElement.addEventListener(t,e,{passive:t in is}),deregisterInputInteractionHandler:(t,e)=>this.formElement.removeEventListener(t,e)}}getLabelAdapterMethods(){return{floatLabel:t=>this.labelElement&&this.labelElement.floatingLabelFoundation.float(t),getLabelWidth:()=>this.labelElement?this.labelElement.floatingLabelFoundation.getWidth():0,hasLabel:()=>Boolean(this.labelElement),shakeLabel:t=>this.labelElement&&this.labelElement.floatingLabelFoundation.shake(t),setLabelRequired:t=>{this.labelElement&&this.labelElement.floatingLabelFoundation.setRequired(t)}}}getLineRippleAdapterMethods(){return{activateLineRipple:()=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.activate()},deactivateLineRipple:()=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.deactivate()},setLineRippleTransformOrigin:t=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.setRippleCenter(t)}}}async getUpdateComplete(){var t;const e=await super.getUpdateComplete();return await(null===(t=this.outlineElement)||void 0===t?void 0:t.updateComplete),e}firstUpdated(){var t;super.firstUpdated(),this.mdcFoundation.setValidateOnValueChange(this.autoValidate),this.validateOnInitialRender&&this.reportValidity(),null===(t=this.outlineElement)||void 0===t||t.updateComplete.then((()=>{var t;this.outlineWidth=(null===(t=this.labelElement)||void 0===t?void 0:t.floatingLabelFoundation.getWidth())||0}))}getOutlineAdapterMethods(){return{closeOutline:()=>this.outlineElement&&(this.outlineOpen=!1),hasOutline:()=>Boolean(this.outlineElement),notchOutline:t=>{this.outlineElement&&!this.outlineOpen&&(this.outlineWidth=t,this.outlineOpen=!0)}}}async layout(){await this.updateComplete;const t=this.labelElement;if(!t)return void(this.outlineOpen=!1);const e=!!this.label&&!!this.value;if(t.floatingLabelFoundation.float(e),!this.outlined)return;this.outlineOpen=e,await this.updateComplete;const i=t.floatingLabelFoundation.getWidth();this.outlineOpen&&(this.outlineWidth=i,await this.updateComplete)}}r([Et(".mdc-text-field")],ns.prototype,"mdcRoot",void 0),r([Et("input")],ns.prototype,"formElement",void 0),r([Et(".mdc-floating-label")],ns.prototype,"labelElement",void 0),r([Et(".mdc-line-ripple")],ns.prototype,"lineRippleElement",void 0),r([Et("mwc-notched-outline")],ns.prototype,"outlineElement",void 0),r([Et(".mdc-notched-outline__notch")],ns.prototype,"notchElement",void 0),r([xt({type:String})],ns.prototype,"value",void 0),r([xt({type:String})],ns.prototype,"type",void 0),r([xt({type:String})],ns.prototype,"placeholder",void 0),r([xt({type:String}),Ve((function(t,e){void 0!==e&&this.label!==e&&this.layout()}))],ns.prototype,"label",void 0),r([xt({type:String})],ns.prototype,"icon",void 0),r([xt({type:String})],ns.prototype,"iconTrailing",void 0),r([xt({type:Boolean,reflect:!0})],ns.prototype,"disabled",void 0),r([xt({type:Boolean})],ns.prototype,"required",void 0),r([xt({type:Number})],ns.prototype,"minLength",void 0),r([xt({type:Number})],ns.prototype,"maxLength",void 0),r([xt({type:Boolean,reflect:!0}),Ve((function(t,e){void 0!==e&&this.outlined!==e&&this.layout()}))],ns.prototype,"outlined",void 0),r([xt({type:String})],ns.prototype,"helper",void 0),r([xt({type:Boolean})],ns.prototype,"validateOnInitialRender",void 0),r([xt({type:String})],ns.prototype,"validationMessage",void 0),r([xt({type:Boolean})],ns.prototype,"autoValidate",void 0),r([xt({type:String})],ns.prototype,"pattern",void 0),r([xt({type:String})],ns.prototype,"min",void 0),r([xt({type:String})],ns.prototype,"max",void 0),r([xt({type:String})],ns.prototype,"step",void 0),r([xt({type:Number})],ns.prototype,"size",void 0),r([xt({type:Boolean})],ns.prototype,"helperPersistent",void 0),r([xt({type:Boolean})],ns.prototype,"charCounter",void 0),r([xt({type:Boolean})],ns.prototype,"endAligned",void 0),r([xt({type:String})],ns.prototype,"prefix",void 0),r([xt({type:String})],ns.prototype,"suffix",void 0),r([xt({type:String})],ns.prototype,"name",void 0),r([xt({type:String})],ns.prototype,"inputMode",void 0),r([xt({type:Boolean})],ns.prototype,"readOnly",void 0),r([xt({type:String})],ns.prototype,"autocapitalize",void 0),r([Mt()],ns.prototype,"outlineOpen",void 0),r([Mt()],ns.prototype,"outlineWidth",void 0),r([Mt()],ns.prototype,"isUiValid",void 0),r([Mt()],ns.prototype,"focused",void 0),r([St({passive:!0})],ns.prototype,"handleInputChange",null);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const os=at`.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);position:absolute;left:0;-webkit-transform-origin:left top;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform;transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl] .mdc-floating-label,.mdc-floating-label[dir=rtl]{right:0;left:auto;-webkit-transform-origin:right top;transform-origin:right top;text-align:right}.mdc-floating-label--float-above{cursor:auto}.mdc-floating-label--required::after{margin-left:1px;margin-right:0px;content:"*"}[dir=rtl] .mdc-floating-label--required::after,.mdc-floating-label--required[dir=rtl]::after{margin-left:0;margin-right:1px}.mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-standard 250ms 1}@keyframes mdc-floating-label-shake-float-above-standard{0%{transform:translateX(calc(0 - 0%)) translateY(-106%) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(-106%) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(-106%) scale(0.75)}100%{transform:translateX(calc(0 - 0%)) translateY(-106%) scale(0.75)}}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{border-bottom-width:1px;z-index:1}.mdc-line-ripple::after{transform:scaleX(0);border-bottom-width:2px;opacity:0;z-index:2}.mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline,.mdc-notched-outline[dir=rtl]{text-align:right}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{box-sizing:border-box;height:100%;border-top:1px solid;border-bottom:1px solid;pointer-events:none}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;width:12px}[dir=rtl] .mdc-notched-outline__leading,.mdc-notched-outline__leading[dir=rtl]{border-left:none;border-right:1px solid}.mdc-notched-outline__trailing{border-left:none;border-right:1px solid;flex-grow:1}[dir=rtl] .mdc-notched-outline__trailing,.mdc-notched-outline__trailing[dir=rtl]{border-left:1px solid;border-right:none}.mdc-notched-outline__notch{flex:0 0 auto;width:auto;max-width:calc(100% - 12px * 2)}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(100% / 0.75)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch,.mdc-notched-outline--notched .mdc-notched-outline__notch[dir=rtl]{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-text-field--filled{--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:transform,opacity}.mdc-text-field--filled .mdc-text-field__ripple::before,.mdc-text-field--filled .mdc-text-field__ripple::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-text-field--filled .mdc-text-field__ripple::before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-text-field--filled .mdc-text-field__ripple::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-text-field--filled.mdc-ripple-upgraded .mdc-text-field__ripple::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-text-field--filled.mdc-ripple-upgraded .mdc-text-field__ripple::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-text-field--filled.mdc-ripple-upgraded--unbounded .mdc-text-field__ripple::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-text-field--filled.mdc-ripple-upgraded--foreground-activation .mdc-text-field__ripple::after{animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-text-field--filled.mdc-ripple-upgraded--foreground-deactivation .mdc-text-field__ripple::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-text-field--filled .mdc-text-field__ripple::before,.mdc-text-field--filled .mdc-text-field__ripple::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-text-field--filled.mdc-ripple-upgraded .mdc-text-field__ripple::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-text-field__ripple{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.mdc-text-field{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0;display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-floating-label{color:rgba(0, 0, 0, 0.6)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__input{color:rgba(0, 0, 0, 0.87)}@media all{.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:rgba(0, 0, 0, 0.54)}}@media all{.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:rgba(0, 0, 0, 0.54)}}.mdc-text-field .mdc-text-field__input{caret-color:#6200ee;caret-color:var(--mdc-theme-primary, #6200ee)}.mdc-text-field:not(.mdc-text-field--disabled)+.mdc-text-field-helper-line .mdc-text-field-helper-text{color:rgba(0, 0, 0, 0.6)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field-character-counter,.mdc-text-field:not(.mdc-text-field--disabled)+.mdc-text-field-helper-line .mdc-text-field-character-counter{color:rgba(0, 0, 0, 0.6)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon--leading{color:rgba(0, 0, 0, 0.54)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon--trailing{color:rgba(0, 0, 0, 0.54)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:rgba(0, 0, 0, 0.6)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:rgba(0, 0, 0, 0.6)}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-text-field__input{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);height:28px;transition:opacity 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);width:100%;min-width:0;border:none;border-radius:0;background:none;appearance:none;padding:0}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input::-webkit-calendar-picker-indicator{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}@media all{.mdc-text-field__input::placeholder{transition:opacity 67ms 0ms cubic-bezier(0.4, 0, 0.2, 1);opacity:0}}@media all{.mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms 0ms cubic-bezier(0.4, 0, 0.2, 1);opacity:0}}@media all{.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}}@media all{.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}}.mdc-text-field__affix{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);height:28px;transition:opacity 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);opacity:0;white-space:nowrap}.mdc-text-field--label-floating .mdc-text-field__affix,.mdc-text-field--no-label .mdc-text-field__affix{opacity:1}@supports(-webkit-hyphens: none){.mdc-text-field--outlined .mdc-text-field__affix{align-items:center;align-self:center;display:inline-flex;height:100%}}.mdc-text-field__affix--prefix{padding-left:0;padding-right:2px}[dir=rtl] .mdc-text-field__affix--prefix,.mdc-text-field__affix--prefix[dir=rtl]{padding-left:2px;padding-right:0}.mdc-text-field--end-aligned .mdc-text-field__affix--prefix{padding-left:0;padding-right:12px}[dir=rtl] .mdc-text-field--end-aligned .mdc-text-field__affix--prefix,.mdc-text-field--end-aligned .mdc-text-field__affix--prefix[dir=rtl]{padding-left:12px;padding-right:0}.mdc-text-field__affix--suffix{padding-left:12px;padding-right:0}[dir=rtl] .mdc-text-field__affix--suffix,.mdc-text-field__affix--suffix[dir=rtl]{padding-left:0;padding-right:12px}.mdc-text-field--end-aligned .mdc-text-field__affix--suffix{padding-left:2px;padding-right:0}[dir=rtl] .mdc-text-field--end-aligned .mdc-text-field__affix--suffix,.mdc-text-field--end-aligned .mdc-text-field__affix--suffix[dir=rtl]{padding-left:0;padding-right:2px}.mdc-text-field--filled{height:56px}.mdc-text-field--filled .mdc-text-field__ripple::before,.mdc-text-field--filled .mdc-text-field__ripple::after{background-color:rgba(0, 0, 0, 0.87);background-color:var(--mdc-ripple-color, rgba(0, 0, 0, 0.87))}.mdc-text-field--filled:hover .mdc-text-field__ripple::before,.mdc-text-field--filled.mdc-ripple-surface--hover .mdc-text-field__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-text-field--filled.mdc-ripple-upgraded--background-focused .mdc-text-field__ripple::before,.mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-text-field--filled::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:whitesmoke}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.42)}.mdc-text-field--filled:not(.mdc-text-field--disabled):hover .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.87)}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-color:#6200ee;border-bottom-color:var(--mdc-theme-primary, #6200ee)}.mdc-text-field--filled .mdc-floating-label{left:16px;right:initial}[dir=rtl] .mdc-text-field--filled .mdc-floating-label,.mdc-text-field--filled .mdc-floating-label[dir=rtl]{left:initial;right:16px}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled.mdc-text-field--no-label::before{display:none}@supports(-webkit-hyphens: none){.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__affix{align-items:center;align-self:center;display:inline-flex;height:100%}}.mdc-text-field--outlined{height:56px;overflow:visible}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1)}.mdc-text-field--outlined .mdc-floating-label--float-above{font-size:.75rem}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-text-field--outlined .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-text-field-outlined 250ms 1}@keyframes mdc-floating-label-shake-float-above-text-field-outlined{0%{transform:translateX(calc(0 - 0%)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - 0%)) translateY(-34.75px) scale(0.75)}}.mdc-text-field--outlined .mdc-text-field__input{height:100%}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.38)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.87)}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__trailing{border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}[dir=rtl] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading[dir=rtl]{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}@supports(top: max(0%)){.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px, var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:calc(100% - max(12px, var(--mdc-shape-small, 4px)) * 2)}}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}[dir=rtl] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing,.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing[dir=rtl]{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}@supports(top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px, var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined+.mdc-text-field-helper-line{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined+.mdc-text-field-helper-line{padding-right:max(16px, var(--mdc-shape-small, 4px))}}.mdc-text-field--outlined.mdc-text-field--with-leading-icon{padding-left:0}@supports(top: max(0%)){.mdc-text-field--outlined.mdc-text-field--with-leading-icon{padding-right:max(16px, var(--mdc-shape-small, 4px))}}[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-leading-icon,.mdc-text-field--outlined.mdc-text-field--with-leading-icon[dir=rtl]{padding-right:0}@supports(top: max(0%)){[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-leading-icon,.mdc-text-field--outlined.mdc-text-field--with-leading-icon[dir=rtl]{padding-left:max(16px, var(--mdc-shape-small, 4px))}}.mdc-text-field--outlined.mdc-text-field--with-trailing-icon{padding-right:0}@supports(top: max(0%)){.mdc-text-field--outlined.mdc-text-field--with-trailing-icon{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-trailing-icon,.mdc-text-field--outlined.mdc-text-field--with-trailing-icon[dir=rtl]{padding-left:0}@supports(top: max(0%)){[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-trailing-icon,.mdc-text-field--outlined.mdc-text-field--with-trailing-icon[dir=rtl]{padding-right:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-text-field--outlined.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:0;padding-right:0}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--outlined .mdc-text-field__ripple::before,.mdc-text-field--outlined .mdc-text-field__ripple::after{content:none}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:initial}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label,.mdc-text-field--outlined .mdc-floating-label[dir=rtl]{left:initial;right:4px}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:transparent}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mdc-text-field--textarea{flex-direction:column;align-items:center;width:auto;height:auto;padding:0;transition:none}.mdc-text-field--textarea .mdc-floating-label{top:19px}.mdc-text-field--textarea .mdc-floating-label:not(.mdc-floating-label--float-above){transform:none}.mdc-text-field--textarea .mdc-text-field__input{flex-grow:1;height:auto;min-height:1.5rem;overflow-x:hidden;overflow-y:auto;box-sizing:border-box;resize:none;padding:0 16px;line-height:1.5rem}.mdc-text-field--textarea.mdc-text-field--filled::before{display:none}.mdc-text-field--textarea.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-10.25px) scale(0.75)}.mdc-text-field--textarea.mdc-text-field--filled .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-textarea-filled 250ms 1}@keyframes mdc-floating-label-shake-float-above-textarea-filled{0%{transform:translateX(calc(0 - 0%)) translateY(-10.25px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(-10.25px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(-10.25px) scale(0.75)}100%{transform:translateX(calc(0 - 0%)) translateY(-10.25px) scale(0.75)}}.mdc-text-field--textarea.mdc-text-field--filled .mdc-text-field__input{margin-top:23px;margin-bottom:9px}.mdc-text-field--textarea.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{margin-top:16px;margin-bottom:16px}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:0}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-27.25px) scale(1)}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label--float-above{font-size:.75rem}.mdc-text-field--textarea.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--textarea.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-24.75px) scale(0.75)}.mdc-text-field--textarea.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--textarea.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-textarea-outlined 250ms 1}@keyframes mdc-floating-label-shake-float-above-textarea-outlined{0%{transform:translateX(calc(0 - 0%)) translateY(-24.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(-24.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(-24.75px) scale(0.75)}100%{transform:translateX(calc(0 - 0%)) translateY(-24.75px) scale(0.75)}}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-text-field__input{margin-top:16px;margin-bottom:16px}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label{top:18px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field__input{margin-bottom:2px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field-character-counter{align-self:flex-end;padding:0 16px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field-character-counter::after{display:inline-block;width:0;height:16px;content:"";vertical-align:-16px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field-character-counter::before{display:none}.mdc-text-field__resizer{align-self:stretch;display:inline-flex;flex-direction:column;flex-grow:1;max-height:100%;max-width:100%;min-height:56px;min-width:fit-content;min-width:-moz-available;min-width:-webkit-fill-available;overflow:hidden;resize:both}.mdc-text-field--filled .mdc-text-field__resizer{transform:translateY(-1px)}.mdc-text-field--filled .mdc-text-field__resizer .mdc-text-field__input,.mdc-text-field--filled .mdc-text-field__resizer .mdc-text-field-character-counter{transform:translateY(1px)}.mdc-text-field--outlined .mdc-text-field__resizer{transform:translateX(-1px) translateY(-1px)}[dir=rtl] .mdc-text-field--outlined .mdc-text-field__resizer,.mdc-text-field--outlined .mdc-text-field__resizer[dir=rtl]{transform:translateX(1px) translateY(-1px)}.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field__input,.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field-character-counter{transform:translateX(1px) translateY(1px)}[dir=rtl] .mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field__input,[dir=rtl] .mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field-character-counter,.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field__input[dir=rtl],.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field-character-counter[dir=rtl]{transform:translateX(-1px) translateY(1px)}.mdc-text-field--with-leading-icon{padding-left:0;padding-right:16px}[dir=rtl] .mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon[dir=rtl]{padding-left:16px;padding-right:0}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px);left:48px;right:initial}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label[dir=rtl]{left:initial;right:48px}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label--float-above{max-width:calc(100% / 0.75 - 64px / 0.75)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label{left:36px;right:initial}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label[dir=rtl]{left:initial;right:36px}.mdc-text-field--with-leading-icon.mdc-text-field--outlined :not(.mdc-notched-outline--notched) .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) translateX(-32px) scale(1)}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above[dir=rtl]{transform:translateY(-37.25px) translateX(32px) scale(1)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above{font-size:.75rem}.mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) translateX(-32px) scale(0.75)}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above[dir=rtl],.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above[dir=rtl]{transform:translateY(-34.75px) translateX(32px) scale(0.75)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-text-field-outlined-leading-icon 250ms 1}@keyframes mdc-floating-label-shake-float-above-text-field-outlined-leading-icon{0%{transform:translateX(calc(0 - 32px)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 32px)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 32px)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - 32px)) translateY(-34.75px) scale(0.75)}}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--shake,.mdc-text-field--with-leading-icon.mdc-text-field--outlined[dir=rtl] .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-text-field-outlined-leading-icon 250ms 1}@keyframes mdc-floating-label-shake-float-above-text-field-outlined-leading-icon-rtl{0%{transform:translateX(calc(0 - -32px)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - -32px)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - -32px)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - -32px)) translateY(-34.75px) scale(0.75)}}.mdc-text-field--with-trailing-icon{padding-left:16px;padding-right:0}[dir=rtl] .mdc-text-field--with-trailing-icon,.mdc-text-field--with-trailing-icon[dir=rtl]{padding-left:0;padding-right:16px}.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 64px)}.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label--float-above{max-width:calc(100% / 0.75 - 64px / 0.75)}.mdc-text-field--with-trailing-icon.mdc-text-field--outlined :not(.mdc-notched-outline--notched) .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:0;padding-right:0}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 96px)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label--float-above{max-width:calc(100% / 0.75 - 96px / 0.75)}.mdc-text-field-helper-line{display:flex;justify-content:space-between;box-sizing:border-box}.mdc-text-field+.mdc-text-field-helper-line{padding-right:16px;padding-left:16px}.mdc-form-field>.mdc-text-field+label{align-self:flex-start}.mdc-text-field--focused:not(.mdc-text-field--disabled) .mdc-floating-label{color:rgba(98, 0, 238, 0.87)}.mdc-text-field--focused .mdc-notched-outline__leading,.mdc-text-field--focused .mdc-notched-outline__notch,.mdc-text-field--focused .mdc-notched-outline__trailing{border-width:2px}.mdc-text-field--focused+.mdc-text-field-helper-line .mdc-text-field-helper-text:not(.mdc-text-field-helper-text--validation-msg){opacity:1}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-text-field--focused.mdc-text-field--outlined.mdc-text-field--textarea .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:0}.mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-line-ripple::before{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-floating-label{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--invalid+.mdc-text-field-helper-line .mdc-text-field-helper-text--validation-msg{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid .mdc-text-field__input{caret-color:#b00020;caret-color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__icon--trailing{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__leading,.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__notch,.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__notch,.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__leading,.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__notch,.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid+.mdc-text-field-helper-line .mdc-text-field-helper-text--validation-msg{opacity:1}.mdc-text-field--disabled{pointer-events:none}.mdc-text-field--disabled .mdc-text-field__input{color:rgba(0, 0, 0, 0.38)}@media all{.mdc-text-field--disabled .mdc-text-field__input::placeholder{color:rgba(0, 0, 0, 0.38)}}@media all{.mdc-text-field--disabled .mdc-text-field__input:-ms-input-placeholder{color:rgba(0, 0, 0, 0.38)}}.mdc-text-field--disabled .mdc-floating-label{color:rgba(0, 0, 0, 0.38)}.mdc-text-field--disabled+.mdc-text-field-helper-line .mdc-text-field-helper-text{color:rgba(0, 0, 0, 0.38)}.mdc-text-field--disabled .mdc-text-field-character-counter,.mdc-text-field--disabled+.mdc-text-field-helper-line .mdc-text-field-character-counter{color:rgba(0, 0, 0, 0.38)}.mdc-text-field--disabled .mdc-text-field__icon--leading{color:rgba(0, 0, 0, 0.3)}.mdc-text-field--disabled .mdc-text-field__icon--trailing{color:rgba(0, 0, 0, 0.3)}.mdc-text-field--disabled .mdc-text-field__affix--prefix{color:rgba(0, 0, 0, 0.38)}.mdc-text-field--disabled .mdc-text-field__affix--suffix{color:rgba(0, 0, 0, 0.38)}.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.06)}.mdc-text-field--disabled .mdc-notched-outline__leading,.mdc-text-field--disabled .mdc-notched-outline__notch,.mdc-text-field--disabled .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.06)}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-text-field--disabled .mdc-text-field__input::placeholder{color:GrayText}}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-text-field--disabled .mdc-text-field__input:-ms-input-placeholder{color:GrayText}}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-text-field--disabled .mdc-floating-label{color:GrayText}}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-text-field--disabled+.mdc-text-field-helper-line .mdc-text-field-helper-text{color:GrayText}}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-text-field--disabled .mdc-text-field-character-counter,.mdc-text-field--disabled+.mdc-text-field-helper-line .mdc-text-field-character-counter{color:GrayText}}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-text-field--disabled .mdc-text-field__icon--leading{color:GrayText}}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-text-field--disabled .mdc-text-field__icon--trailing{color:GrayText}}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-text-field--disabled .mdc-text-field__affix--prefix{color:GrayText}}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-text-field--disabled .mdc-text-field__affix--suffix{color:GrayText}}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:GrayText}}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-text-field--disabled .mdc-notched-outline__leading,.mdc-text-field--disabled .mdc-notched-outline__notch,.mdc-text-field--disabled .mdc-notched-outline__trailing{border-color:GrayText}}@media screen and (forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--disabled .mdc-floating-label{cursor:default}.mdc-text-field--disabled.mdc-text-field--filled{background-color:#fafafa}.mdc-text-field--disabled.mdc-text-field--filled .mdc-text-field__ripple{display:none}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--end-aligned .mdc-text-field__input{text-align:right}[dir=rtl] .mdc-text-field--end-aligned .mdc-text-field__input,.mdc-text-field--end-aligned .mdc-text-field__input[dir=rtl]{text-align:left}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__input,[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__input,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix{direction:ltr}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--prefix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--prefix{padding-left:0;padding-right:2px}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--suffix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--suffix{padding-left:12px;padding-right:0}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__icon--leading,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__icon--leading{order:1}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--suffix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--suffix{order:2}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__input,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__input{order:3}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--prefix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--prefix{order:4}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__icon--trailing,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__icon--trailing{order:5}[dir=rtl] .mdc-text-field--ltr-text.mdc-text-field--end-aligned .mdc-text-field__input,.mdc-text-field--ltr-text.mdc-text-field--end-aligned[dir=rtl] .mdc-text-field__input{text-align:right}[dir=rtl] .mdc-text-field--ltr-text.mdc-text-field--end-aligned .mdc-text-field__affix--prefix,.mdc-text-field--ltr-text.mdc-text-field--end-aligned[dir=rtl] .mdc-text-field__affix--prefix{padding-right:12px}[dir=rtl] .mdc-text-field--ltr-text.mdc-text-field--end-aligned .mdc-text-field__affix--suffix,.mdc-text-field--ltr-text.mdc-text-field--end-aligned[dir=rtl] .mdc-text-field__affix--suffix{padding-left:2px}.mdc-text-field-helper-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-caption-font-size, 0.75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight, 400);letter-spacing:0.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, 0.0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform, inherit);display:block;margin-top:0;line-height:normal;margin:0;opacity:0;will-change:opacity;transition:opacity 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-text-field-helper-text::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}.mdc-text-field-helper-text--persistent{transition:none;opacity:1;will-change:initial}.mdc-text-field-character-counter{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-caption-font-size, 0.75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight, 400);letter-spacing:0.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, 0.0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform, inherit);display:block;margin-top:0;line-height:normal;margin-left:auto;margin-right:0;padding-left:16px;padding-right:0;white-space:nowrap}.mdc-text-field-character-counter::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}[dir=rtl] .mdc-text-field-character-counter,.mdc-text-field-character-counter[dir=rtl]{margin-left:0;margin-right:auto}[dir=rtl] .mdc-text-field-character-counter,.mdc-text-field-character-counter[dir=rtl]{padding-left:0;padding-right:16px}.mdc-text-field__icon{align-self:center;cursor:pointer}.mdc-text-field__icon:not([tabindex]),.mdc-text-field__icon[tabindex="-1"]{cursor:default;pointer-events:none}.mdc-text-field__icon svg{display:block}.mdc-text-field__icon--leading{margin-left:16px;margin-right:8px}[dir=rtl] .mdc-text-field__icon--leading,.mdc-text-field__icon--leading[dir=rtl]{margin-left:8px;margin-right:16px}.mdc-text-field__icon--trailing{padding:12px;margin-left:0px;margin-right:0px}[dir=rtl] .mdc-text-field__icon--trailing,.mdc-text-field__icon--trailing[dir=rtl]{margin-left:0px;margin-right:0px}.material-icons{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}:host{display:inline-flex;flex-direction:column;outline:none}.mdc-text-field{width:100%}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.42);border-bottom-color:var(--mdc-text-field-idle-line-color, rgba(0, 0, 0, 0.42))}.mdc-text-field:not(.mdc-text-field--disabled):hover .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.87);border-bottom-color:var(--mdc-text-field-hover-line-color, rgba(0, 0, 0, 0.87))}.mdc-text-field.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.06);border-bottom-color:var(--mdc-text-field-disabled-line-color, rgba(0, 0, 0, 0.06))}.mdc-text-field.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-text-field__input{direction:inherit}mwc-notched-outline{--mdc-notched-outline-border-color: var( --mdc-text-field-outlined-idle-border-color, rgba(0, 0, 0, 0.38) )}:host(:not([disabled]):hover) :not(.mdc-text-field--invalid):not(.mdc-text-field--focused) mwc-notched-outline{--mdc-notched-outline-border-color: var( --mdc-text-field-outlined-hover-border-color, rgba(0, 0, 0, 0.87) )}:host(:not([disabled])) .mdc-text-field:not(.mdc-text-field--outlined){background-color:var(--mdc-text-field-fill-color, whitesmoke)}:host(:not([disabled])) .mdc-text-field.mdc-text-field--invalid mwc-notched-outline{--mdc-notched-outline-border-color: var( --mdc-text-field-error-color, var(--mdc-theme-error, #b00020) )}:host(:not([disabled])) .mdc-text-field.mdc-text-field--invalid+.mdc-text-field-helper-line .mdc-text-field-character-counter,:host(:not([disabled])) .mdc-text-field.mdc-text-field--invalid .mdc-text-field__icon{color:var(--mdc-text-field-error-color, var(--mdc-theme-error, #b00020))}:host(:not([disabled])) .mdc-text-field:not(.mdc-text-field--invalid):not(.mdc-text-field--focused) .mdc-floating-label,:host(:not([disabled])) .mdc-text-field:not(.mdc-text-field--invalid):not(.mdc-text-field--focused) .mdc-floating-label::after{color:var(--mdc-text-field-label-ink-color, rgba(0, 0, 0, 0.6))}:host(:not([disabled])) .mdc-text-field.mdc-text-field--focused mwc-notched-outline{--mdc-notched-outline-stroke-width: 2px}:host(:not([disabled])) .mdc-text-field.mdc-text-field--focused:not(.mdc-text-field--invalid) mwc-notched-outline{--mdc-notched-outline-border-color: var( --mdc-text-field-focused-label-color, var(--mdc-theme-primary, rgba(98, 0, 238, 0.87)) )}:host(:not([disabled])) .mdc-text-field.mdc-text-field--focused:not(.mdc-text-field--invalid) .mdc-floating-label{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host(:not([disabled])) .mdc-text-field .mdc-text-field__input{color:var(--mdc-text-field-ink-color, rgba(0, 0, 0, 0.87))}:host(:not([disabled])) .mdc-text-field .mdc-text-field__input::placeholder{color:var(--mdc-text-field-label-ink-color, rgba(0, 0, 0, 0.6))}:host(:not([disabled])) .mdc-text-field-helper-line .mdc-text-field-helper-text:not(.mdc-text-field-helper-text--validation-msg),:host(:not([disabled])) .mdc-text-field-helper-line:not(.mdc-text-field--invalid) .mdc-text-field-character-counter{color:var(--mdc-text-field-label-ink-color, rgba(0, 0, 0, 0.6))}:host([disabled]) .mdc-text-field:not(.mdc-text-field--outlined){background-color:var(--mdc-text-field-disabled-fill-color, #fafafa)}:host([disabled]) .mdc-text-field.mdc-text-field--outlined mwc-notched-outline{--mdc-notched-outline-border-color: var( --mdc-text-field-outlined-disabled-border-color, rgba(0, 0, 0, 0.06) )}:host([disabled]) .mdc-text-field:not(.mdc-text-field--invalid):not(.mdc-text-field--focused) .mdc-floating-label,:host([disabled]) .mdc-text-field:not(.mdc-text-field--invalid):not(.mdc-text-field--focused) .mdc-floating-label::after{color:var(--mdc-text-field-disabled-ink-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-text-field .mdc-text-field__input,:host([disabled]) .mdc-text-field .mdc-text-field__input::placeholder{color:var(--mdc-text-field-disabled-ink-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-text-field-helper-line .mdc-text-field-helper-text,:host([disabled]) .mdc-text-field-helper-line .mdc-text-field-character-counter{color:var(--mdc-text-field-disabled-ink-color, rgba(0, 0, 0, 0.38))}`
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */;let as=class extends ns{};function ss(t,e,i){return t<e?e:t>i?i:t}function ls(t,e){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2))/2}as.styles=[os],as=r([_t("mwc-textfield")],as),function(){let t;function e(e){return!!function(){if(void 0===t){t=!1;try{const e=Object.defineProperty({},"passive",{get:()=>{t=!0}});window.addEventListener("test",null,e)}catch(t){}}return t}()&&{passive:e}}function i(t,e=t,i=t){let r=t;if(e>i)throw new RangeError(`'min' ${e} should be lower than 'max' ${i}`);return t<e&&(r=e),t>i&&(r=i),r}function r(t,e,i){i?t.setAttribute(e,""):t.removeAttribute(e)}function n(t,e){return t.hasAttribute(e)}function o(t,e,i){t.setAttribute(e,i)}function a(t,e,i=0){const r=t.getAttribute(e);return null===r?i:parseInt(r,10)}function s(t){if("touchstart"===t.type||"touchmove"===t.type||"touchend"===t.type){const e=t.targetTouches[0]||t.changedTouches[0];return{x:e.clientX,y:e.clientY,id:e.identifier,event:t}}return{x:t.clientX,y:t.clientY,id:null,event:t}}const l=document.createElement("template");l.innerHTML='<style>:host{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;contain:content;-webkit-tap-highlight-color:rgba(0,0,0,0);--macro-carousel-gap:16px;--macro-carousel-background-color:transparent;--macro-carousel-slide-min-height:0px;--macro-carousel-slide-max-height:none;--macro-carousel-transition-duration:0.6s;--macro-carousel-transition-timing-function:cubic-bezier(0.25,0.46,0.45,0.94);--macro-carousel-pagination-gap:2px;--macro-carousel-pagination-height:44px;--macro-carousel-fallback-message-color-background:#fff;--macro-carousel__internal__slides-per-view:1}:host([hidden]){display:none}:host-context(.js-focus-visible) ::slotted(:focus:not(.focus-visible)),:host-context(.js-focus-visible) :focus:not(.focus-visible){outline:0}#externalWrapper{height:100%;overflow:hidden;contain:paint;background-color:var(--macro-carousel-background-color);-ms-touch-action:pan-y pinch-zoom;touch-action:pan-y pinch-zoom;cursor:-webkit-grab;cursor:grab}#externalWrapper:active{cursor:-webkit-grabbing;cursor:grabbing}:host([disable-drag]) #externalWrapper{cursor:default}#slidesWrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;height:100%;min-height:var(--macro-carousel-slide-min-height);max-height:var(--macro-carousel-slide-max-height);will-change:transform}:host([transitioning]) #slidesWrapper{-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;-webkit-transition-duration:var(--macro-carousel-transition-duration);transition-duration:var(--macro-carousel-transition-duration);-webkit-transition-timing-function:var(--macro-carousel-transition-timing-function);transition-timing-function:var(--macro-carousel-transition-timing-function)}#slidesWrapper ::slotted(*){-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;-ms-flex-preferred-size:calc((100% - (var(--macro-carousel__internal__slides-per-view) - 1) * var(--macro-carousel-gap)) / var(--macro-carousel__internal__slides-per-view));flex-basis:calc((100% - (var(--macro-carousel__internal__slides-per-view) - 1) * var(--macro-carousel-gap)) / var(--macro-carousel__internal__slides-per-view));min-height:var(--macro-carousel-slide-min-height);max-height:var(--macro-carousel-slide-max-height);margin-right:var(--macro-carousel-gap);overflow:hidden;outline:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.slidesFallback{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin:0;padding:.5em 1em;width:100%;background-color:var(--macro-carousel-fallback-message-color-background)}:host([disable-drag]) #slidesWrapper ::slotted(*){-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}#pagination{display:none}:host([pagination]) #pagination{-ms-flex-item-align:center;align-self:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:100%;height:var(--macro-carousel-pagination-height);contain:strict;font-size:0}div ::slotted(macro-carousel-pagination-indicator){margin:0 calc(var(--macro-carousel-pagination-gap) / 2);padding:0;font-size:inherit;opacity:.8}div ::slotted(macro-carousel-pagination-indicator.selected),div ::slotted(macro-carousel-pagination-indicator:hover){opacity:1}#navigation{display:none}:host([navigation]) #navigation{display:block}div ::slotted(macro-carousel-nav-button){position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}:host([pagination]) div ::slotted(macro-carousel-nav-button){top:calc(50% - var(--macro-carousel-pagination-height) / 2)}div ::slotted(.macro-carousel-previous){left:0}div ::slotted(.macro-carousel-next){right:0}#aria-live ::slotted(*){position:absolute;height:1px;width:1px;margin:-1px;padding:0;clip:rect(0 0 0 0);overflow:hidden;border:0}@media print{#slidesWrapper ::slotted(*){margin-right:0;margin-bottom:.2em;outline:1px solid #000;color:#000;page-break-inside:avoid}:host([navigation]) #navigation,:host([pagination]) #pagination{display:none}#slidesWrapper{display:block;-webkit-transform:none!important;transform:none!important;-webkit-transition:0s;transition:0s}}</style> <div id="externalWrapper"> <div id="slidesWrapper"> <slot id="slidesSlot"> <p class="slidesFallback">No content available</p> </slot> </div> </div> <div id="navigation"> <slot id="navigationSlot" name="navigationSlot"></slot> </div> <div id="pagination"> <slot id="paginationSlot" name="paginationSlot"></slot> </div> <div id="aria-live"> <slot id="ariaSlot" name="ariaSlot"></slot> </div> ',window.ShadyCSS&&window.ShadyCSS.prepareTemplate(l,"macro-carousel");const d=Math.abs((35,Math.round(100*Math.tan(35*Math.PI/180))/100));window.customElements.define("macro-carousel",class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(l.content.cloneNode(!0)),this.t=this.shadowRoot.querySelector("#externalWrapper"),this.i=this.shadowRoot.querySelector("#slidesWrapper"),this.s=this.shadowRoot.querySelector("#slidesSlot"),this.e=this.shadowRoot.querySelector("#ariaSlot"),this.o=this.shadowRoot.querySelector("#paginationSlot"),this.a=[],this.n=this.shadowRoot.querySelector("#navigationSlot"),this.r=void 0,this.h=void 0,this.c=[],this.l=-1,this.d=!1,this.u=0,this.m=0,this.g=0,this.p=0,this.b=0,this.v=0,this.w=void 0,this.f=!1,this.k=!1,this._=void 0,this.S=void 0,this.z=void 0,this.M=void 0,this.C=void 0,this.W=void 0,this.P=void 0,this.L=void 0,this.G=[],this.F=!1,this.I=50,this.$=20,this.A=.7,this.D=.04,this.T=0,this.N=!1}connectedCallback(){window.ShadyCSS&&window.ShadyCSS.styleElement(this),this.hasAttribute("role")||this.setAttribute("role","list"),this.j("selected"),this.j("loop"),this.j("navigation"),this.j("pagination"),this.j("disableDrag"),this.j("slidesPerView"),this.j("reducedMotion"),this.j("autoFocus"),this.m=this.selected,this.O(),this.s.addEventListener("slotchange",this),window.addEventListener("resize",this,e(!0)),this.addEventListener("keydown",this),window.addEventListener("touchmove",(function(){})),this.q()}disconnectedCallback(){this.s.removeEventListener("slotchange",this),window.removeEventListener("resize",this),this.disableDrag||(this.t.removeEventListener("touchstart",this),this.t.removeEventListener("mousedown",this)),this.navigation&&(this.r.removeEventListener("macro-carousel-nav-button-clicked",this),this.h.removeEventListener("macro-carousel-nav-button-clicked",this)),this.pagination&&this.a.forEach((t=>{t.removeEventListener("macro-carousel-pagination-indicator-clicked",this)}))}handleEvent(t){"resize"===t.type&&t.target===window?(this.B(),this.update()):"slotchange"===t.type&&t.target===this.s?this.q():"macro-carousel-pagination-indicator-clicked"===t.type&&this.pagination?this.V(t):"macro-carousel-nav-button-clicked"===t.type&&this.navigation?t.target===this.r?this.previous():t.target===this.h&&this.next():"keydown"===t.type?37===t.keyCode||38===t.keyCode?this.previous():39!==t.keyCode&&40!==t.keyCode||this.next():"transitionend"===t.type&&t.target===this.i?(this.H(),this.R(),this.X()):"touchstart"===t.type||"mousedown"===t.type?this.Y(s(t)):"touchmove"===t.type||"mousemove"===t.type?this.U(s(t)):"touchend"===t.type||"mouseup"===t.type?this.J(s(t)):"touchcancel"===t.type&&this.K()}j(t){if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this[t]=e}}update(){clearTimeout(this.w),this.B(),this.w=setTimeout((()=>{this.Q()}),50)}Q(){this.Z(),this.tt(),this.it(),this.st(this.c.map((t=>t.layoutIndex)),!0),this.et(this.selected),this.ot(),this.at(),this.nt(),this.H(),this.X(),this.O()}previous(){this.selected=this.rt(this.selected)}rt(t){let e=t;return t>0?e=t-1:this.loop&&(this.d&&(this.u-=1),e=this.l),i(e,0,this.l)}next(){this.selected=this.ht(this.selected)}ht(t){let e=t;return t<this.l?e=t+1:this.loop&&(this.d&&(this.u+=1),e=0),i(e,0,this.l)}static get observedAttributes(){return["selected","loop","navigation","pagination","disable-drag","slides-per-view","reduced-motion","auto-focus"]}attributeChangedCallback(t,e,i){switch(0===this.c.length&&this.q(),t){case"selected":const t=parseInt(i,10);if(!Number.isFinite(t)||t>this.l||t<0)return void(this.selected=e||0);if(this.d){const t=this.selected+this.u*(this.l+1),e=this.m-t,i=[],r=e<0?this.slidesPerView+e:0;for(let n=-1;n<Math.abs(e);n++)i.push(n+t+r);this.st(i),this.m=t}this.et(this.selected),this.ot(),this.at(),this.dispatchEvent(new CustomEvent("macro-carousel-selected-changed",{detail:this.selected,bubbles:!0})),this.f||this.N||(this.H(),this.R(),this.X());break;case"loop":this.tt(),this.it(),this.st(this.c.map(((t,e)=>e))),this.at(),this.ot(),this.H(),this.R(),this.X(),window.ShadyCSS&&window.ShadyCSS.styleSubtree(this);break;case"navigation":this.update(),window.ShadyCSS&&window.ShadyCSS.styleSubtree(this);break;case"pagination":this.ot(),window.ShadyCSS&&window.ShadyCSS.styleSubtree(this);break;case"disable-drag":this.nt();break;case"slides-per-view":const r=parseInt(i,10);if(!Number.isFinite(r)||r<1||r>this.c.length)return void(this.slidesPerView=e||1);this.update(),window.ShadyCSS&&window.ShadyCSS.styleSubtree(this);break;case"reduced-motion":null!==i?this.B():this.O()}}set selected(t){o(this,"selected",t)}get selected(){return a(this,"selected")}set loop(t){r(this,"loop",t)}get loop(){return n(this,"loop")}set navigation(t){r(this,"navigation",t)}get navigation(){return n(this,"navigation")}set pagination(t){r(this,"pagination",t)}get pagination(){return n(this,"pagination")}set disableDrag(t){r(this,"disable-drag",t)}get disableDrag(){return n(this,"disable-drag")}set slidesPerView(t){o(this,"slides-per-view",t)}get slidesPerView(){return a(this,"slides-per-view",1)}set reducedMotion(t){r(this,"reduced-motion",t)}get reducedMotion(){return n(this,"reduced-motion")}set autoFocus(t){r(this,"auto-focus",t)}get autoFocus(){return n(this,"auto-focus")}B(){this.f=!1,this.removeAttribute("transitioning"),this.i.removeEventListener("transitionend",this,!1)}O(){this.reducedMotion||requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.f=!0,this.setAttribute("transitioning",""),this.i.addEventListener("transitionend",this,!1)}))}))}Z(){this.g=this.i.getBoundingClientRect().width,this.p=this.ct(),this.b=this.lt()}lt(){return(this.g-(this.slidesPerView-1)*this.p)/this.slidesPerView}ct(){/\d$/.test(function(t,e){const i=getComputedStyle(t);return String(i.getPropertyValue("--macro-carousel-gap")).trim()}(this))&&console.warn("Warning: it looks like --macro-carousel-gap has a unitless value.\nAdd CSS units to its value to avoid breaking the slides layout.");const t=parseInt(getComputedStyle(this.c[0].element)["margin-right"],10);return Number.isFinite(t)?t:0}it(){var t,e;t="--macro-carousel__internal__slides-per-view",e=`${this.slidesPerView}`,this.style.setProperty(t,e),window.ShadyCSS&&window.ShadyCSS.styleSubtree(this,{[t]:e}),this.l=this.d?this.c.length-1:this.dt(),!this.d&&this.selected>this.l&&(this.selected=this.l)}dt(){return Math.max(0,this.c.length-this.slidesPerView)}ut(t){let e=t;for(;e<0;)e+=this.c.length;return e%this.c.length}st(t,e=!1){let i;t.forEach((t=>{!e&&this.c.find((e=>e.layoutIndex===t))||(i=this.ut(t),this.c[i].layoutIndex=t,this.c[i].position=this.mt(t),this.c[i].element.style.transform=`translateX(${this.mt(i-t)}px)`)}))}mt(t){return-t*(this.b+this.p)}gt(t){this.i.style.transform=`translate3d(${t}px, 0, 0)`,this.v=t}et(t){this.i&&!this.N&&this.gt(this.c[t].position)}R(){this.autoFocus&&this.c[this.selected].element.focus()}H(){const t=[];for(let e=0;e<this.slidesPerView;e++)t.push((this.selected+e)%this.c.length);let e;this.c.map((t=>t.element)).forEach(((i,r)=>{e=void 0!==t.find((t=>t===r)),i.setAttribute("aria-hidden",e?"false":"true"),e?(i.removeAttribute("inert"),i.setAttribute("tabindex",-1)):i.setAttribute("inert","")}))}ot(){if((!this.pagination||this.pagination&&this.o.assignedNodes().length!==this.l+1)&&(this.a.forEach((t=>{t.removeEventListener("macro-carousel-pagination-indicator-clicked",this),this.removeChild(t)})),this.a.length=0),this.pagination){if(this.o.assignedNodes().length!==this.l+1){const t=document.createDocumentFragment();for(let e=0;e<=this.l;e++){const i=document.createElement("macro-carousel-pagination-indicator");i.textContent=e,i.setAttribute("slot","paginationSlot"),i.setAttribute("aria-label",`Go to item ${e+1}`),i.addEventListener("macro-carousel-pagination-indicator-clicked",this),t.appendChild(i),this.a.push(i)}this.appendChild(t)}this.a.forEach(((t,e)=>{e===this.selected?t.classList.add("selected"):t.classList.remove("selected")}))}}V(t){this.selected=parseInt(t.target.textContent,10)}pt(t){const e=document.createElement("macro-carousel-nav-button");return e.classList.add(t),e.setAttribute("slot","navigationSlot"),e.addEventListener("macro-carousel-nav-button-clicked",this),/next/.test(t)&&e.setAttribute("flipped",""),e}at(){(!this.navigation||this.navigation&&2!==this.n.assignedNodes().length)&&(this.n.assignedNodes().forEach((t=>{t.removeEventListener("macro-carousel-nav-button-clicked",this),this.removeChild(t)})),this.r=void 0,this.h=void 0),this.navigation&&(2!==this.n.assignedNodes().length&&(this.r=this.pt("macro-carousel-previous"),this.appendChild(this.r),this.h=this.pt("macro-carousel-next"),this.appendChild(this.h)),this.r.disabled=!this.loop&&0===this.selected,this.h.disabled=!this.loop&&this.selected===this.l,this.r.setAttribute("aria-label",`Go to ${this.loop&&0===this.selected?"last":"previous"} item`),this.h.setAttribute("aria-label",`Go to ${this.loop&&this.selected===this.l?"first":"next"} item`))}tt(){this.d=this.loop&&this.dt()>1}bt(){return this.s.assignedNodes({flatten:!0}).forEach((t=>{t.nodeType===Node.TEXT_NODE&&t.parentNode&&t.parentNode.removeChild(t)})),this.s.assignedNodes({flatten:!0}).filter((t=>t.nodeType===Node.ELEMENT_NODE)).map(((t,e)=>({element:t,layoutIndex:e,position:this.mt(e)})))||[]}q(){this.c=this.bt(),this.c.forEach((t=>{t.element.hasAttribute("tabindex")||t.element.setAttribute("tabindex",-1),"list"===this.getAttribute("role")&&t.element.setAttribute("role","listitem")}));const t=this.c.length>0&&-1===this.l;this.Q(),t&&(this.selected=this.selected)}X(){1!==this.e.assignedNodes().length&&(this.vt=document.createElement("div"),this.vt.setAttribute("slot","ariaSlot"),this.vt.setAttribute("aria-live","polite"),this.vt.setAttribute("aria-atomic","true"),this.appendChild(this.vt));const t=this.c[this.selected].layoutIndex;let e="";for(let i=0;i<this.slidesPerView;i++)e+=(t+i)%this.c.length+1,i<this.slidesPerView-2?e+=", ":i<this.slidesPerView-1&&(e+=" and ");this.vt.textContent=`Item${this.slidesPerView>1?"s":""} ${e} of ${this.c.length} visible`}nt(){this.disableDrag?(this.t.removeEventListener("touchstart",this),this.t.removeEventListener("mousedown",this)):(this.t.addEventListener("touchstart",this,e(!0)),this.t.addEventListener("mousedown",this,e(!0)))}Y(t){this.k||(this.N=!1,this.k=!0,this._=t.id,this.S=this.M=this.W=t.x,this.z=this.C=this.P=t.y,this.L=this.c[this.selected].layoutIndex,this.G=[],this.wt(this.M),window.addEventListener("touchmove",this,e(!1)),window.addEventListener("mousemove",this,e(!1)),window.addEventListener("mouseup",this),window.addEventListener("touchend",this),window.addEventListener("touchcancel",this))}U(t){if(this.k&&t.id===this._){this.W=t.x,this.P=t.y;const e=Math.abs(this.W-this.S),i=Math.abs(this.P-this.z);e/i>d||0===i||i>e&&i-e<5?(t.event.preventDefault(),this.wt(this.M),this.B(),this.ft()):this.K()}}J(t){this.k&&t.id===this._&&this.K()}K(){this.k=!1,this._=void 0,this.wt(this.M),window.removeEventListener("touchmove",this),window.removeEventListener("mousemove",this),window.removeEventListener("touchend",this),window.removeEventListener("mouseup",this),window.removeEventListener("touchcancel",this),this.kt()}wt(t){const e=Date.now();for(;this.G.length>0&&!(e-this.G[0].time<=100);)this.G.shift();this.G.push({x:t,time:e})}ft(){this.F||requestAnimationFrame(this.xt.bind(this)),this.F=!0}xt(){const t=this.v+this.W-this.M;let e,i;if(this.c.forEach(((r,n)=>{r.position>=t&&(void 0===i||r.position<i)&&(i=r.position,e=n)})),this.d){let t;if(void 0===e){const i=this.c.slice(0).sort(((t,e)=>t.layoutIndex>e.layoutIndex))[0];for(e=i.layoutIndex-1;e<0;)e+=this.c.length;e%=this.c.length,t=i.layoutIndex-2}else t=this.c[e].layoutIndex-1;const i=[],r=t+this.slidesPerView+2;for(let e=t;e<r;e++)i.push(e);this.st(i)}else e=e||0;this.L=this.c[e].layoutIndex,this.gt(t),this.M=this.W,this.C=this.P,this.F=!1}kt(){this.N=!0;const t=this.G[this.G.length-1],e=this.G[0],r=t.x-e.x||0;this.u=Math.floor(this.L/this.c.length);const n=this.ut(this.L);let o;if(0===r)this.T=0,o=this.c[n].position-this.v>this.b/2?this.ht(n):n;else{this.T=function(t,e,r){if(0===t)throw new RangeError("x must be different from `0`");return t/Math.abs(t)*i(Math.abs(t),e,r)}(r,this.$,this.I);let t=1;const e=.5*this.g;for(;Math.abs(r)>e*t&&t<this.slidesPerView+2;)t+=1;r>0&&(t-=1);let a=n;for(let e=0;e<t;e++)a=r<0?this.ht(a):this.rt(a);o=a}this.selected=i(o,0,this.l),requestAnimationFrame(this.yt.bind(this))}yt(){if(!this.N)return;const t=this.c[this.selected].position;this.T+=this.D*(t-this.v),this.T*=this.A;const e=this.v+this.T;(Math.abs(t-e)>=1||Math.abs(this.T)>=1)&&!this.reducedMotion?(this.gt(e),requestAnimationFrame(this.yt.bind(this))):(this.gt(t),this.N=!1,this.O(),requestAnimationFrame((()=>{this.H(),this.R(),this.X()})))}});class c extends HTMLElement{constructor(){super();const t=Object.getPrototypeOf(this).constructor.template;this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(t.content.cloneNode(!0))}connectedCallback(){window.ShadyCSS&&window.ShadyCSS.styleElement(this),this._t=0,this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("tabindex")?this._t=this.getAttribute("tabindex"):this.setAttribute("tabindex",this._t),this.j("disabled"),this.addEventListener("keydown",this),this.addEventListener("click",this)}j(t){if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this[t]=e}}static get observedAttributes(){return["disabled"]}set disabled(t){r(this,"disabled",t)}get disabled(){return n(this,"disabled")}attributeChangedCallback(t,e,i){switch(t){case"disabled":if(e===i)return;this.disabled?(this._t=this.getAttribute("tabindex"),this.removeAttribute("tabindex"),this.setAttribute("aria-disabled","true")):(this.setAttribute("tabindex",this._t),this.setAttribute("aria-disabled","false"))}}handleEvent(t){this.disabled?t.preventDefault():"click"===t.type?this.St&&this.St():"keydown"!==t.type||32!==t.keyCode&&13!==t.keyCode||(t.preventDefault(),this.St&&this.St())}}const h=document.createElement("template");h.innerHTML='<style>:host{--macro-carousel-navigation-color:#000;--macro-carousel-navigation-color-focus:var(--macro-carousel-navigation-color);--macro-carousel-navigation-color-background:transparent;--macro-carousel-navigation-color-background-focus:#f0f0f0;--macro-carousel-navigation-button-size:48px;--macro-carousel-navigation-icon-size:24px;--macro-carousel-navigation-icon-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 24 24\'%3E%3Cpath d=\'M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\'/%3E%3C/svg%3E");position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;min-width:var(--macro-carousel-navigation-button-size);min-height:var(--macro-carousel-navigation-button-size);border-radius:50%;overflow:hidden;cursor:pointer;contain:paint}:host([disabled]){opacity:.2}.bg,.content{position:absolute;top:0;right:0;bottom:0;left:0}.content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;background-color:var(--macro-carousel-navigation-color-background)}.bg{z-index:0;background-color:var(--macro-carousel-navigation-color-background-focus);opacity:0;will-change:opacity}.icon{position:relative;z-index:1;width:var(--macro-carousel-navigation-icon-size);height:var(--macro-carousel-navigation-icon-size);color:var(--macro-carousel-navigation-color);background:var(--macro-carousel-navigation-icon-mask)}@supports ((-webkit-mask-image:var(--macro-carousel-navigation-icon-mask)) or (mask-image:var(--macro-carousel-navigation-icon-mask))){.icon{background:var(--macro-carousel-navigation-color);-webkit-mask-image:var(--macro-carousel-navigation-icon-mask);mask-image:var(--macro-carousel-navigation-icon-mask)}}:host([flipped]) .icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host(.focus-visible) .bg,:host(:active:not([disabled])) .bg,:host(:focus:not([disabled])) .bg,:host(:hover:not([disabled])) .bg{opacity:1}:host-context(.js-focus-visible):host(:focus:not(:active):not(:hover):not(.focus-visible)) .bg{opacity:0}@supports ((-webkit-mask-image:var(--macro-carousel-navigation-icon-mask)) or (mask-image:var(--macro-carousel-navigation-icon-mask))){:host(.focus-visible) .icon,:host(:active:not([disabled])) .icon,:host(:focus:not([disabled])) .icon,:host(:hover:not([disabled])) .icon{background:var(--macro-carousel-navigation-color-focus)}:host-context(.js-focus-visible):host(:focus:not(:active):not(:hover):not(.focus-visible)) .icon{background:var(--macro-carousel-navigation-color)}}</style> <div class="content"> <div class="bg"></div> <div class="icon"></div> </div> ',window.ShadyCSS&&window.ShadyCSS.prepareTemplate(h,"macro-carousel-nav-button"),window.customElements.define("macro-carousel-nav-button",class extends c{static get template(){return h}St(){this.dispatchEvent(new CustomEvent("macro-carousel-nav-button-clicked"))}});const u=document.createElement("template");u.innerHTML='<style>:host{--macro-carousel-pagination-color:#999;--macro-carousel-pagination-color-selected:#000;--macro-carousel-pagination-size-clickable:24px;--macro-carousel-pagination-size-dot:8px;--macro-carousel-pagination-border:1px solid var(--macro-carousel-pagination-color);--macro-carousel-pagination-border-selected:1px solid var(--macro-carousel-pagination-color-selected);position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:var(--macro-carousel-pagination-size-clickable);height:var(--macro-carousel-pagination-size-clickable);overflow:hidden;cursor:pointer;contain:paint}.bg,.fg,:host{border-radius:50%}.bg,.fg{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:block;width:var(--macro-carousel-pagination-size-dot);height:var(--macro-carousel-pagination-size-dot);-webkit-box-sizing:border-box;box-sizing:border-box;background-color:var(--macro-carousel-pagination-color);content:""}.bg{-webkit-transform:translate(-50%,-50%) scale(2);transform:translate(-50%,-50%) scale(2);opacity:0;will-change:opacity}.fg{border:var(--macro-carousel-pagination-border)}:host(.focus-visible) .bg,:host(:hover) .bg{opacity:.2}:host(.selected) .fg{background-color:var(--macro-carousel-pagination-color-selected);border:var(--macro-carousel-pagination-border-selected)}</style> <div class="bg"></div> <div class="fg"></div> ',window.ShadyCSS&&window.ShadyCSS.prepareTemplate(u,"macro-carousel-pagination-indicator"),window.customElements.define("macro-carousel-pagination-indicator",class extends c{static get template(){return u}St(){this.dispatchEvent(new CustomEvent("macro-carousel-pagination-indicator-clicked"))}})}();var ds;!function(t){t.INDETERMINATE="indeterminate",t.DETERMINATE="determinate"}(ds||(ds={}));class cs extends ta{constructor(){super(...arguments),this.mode=ds.INDETERMINATE,this.value=0,this.max=1,this.min=0,this.buffer=0,this.bufferMax=1,this.bufferMin=0,this.role="progressbar"}get progressPerc(){return ss(this.value/(this.max-this.min),0,1)}get bufferPerc(){return ss(this.buffer/(this.bufferMax-this.bufferMin),0,1)}connectedCallback(){super.connectedCallback(),this.setAttribute("role",this.role)}updateAria(){ia(this,{"aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this.value,"aria-valuetext":100*this.progressPerc+"%","aria-busy":"true","aria-live":"polite"})}updated(t){super.updated(t),this.updateAria()}}cs.styles=[Na,ea("")],r([Vo({type:String,reflect:!0}),n("design:type",String)],cs.prototype,"mode",void 0),r([Vo({type:Number}),n("design:type",Number)],cs.prototype,"value",void 0),r([Vo({type:Number}),n("design:type",Number)],cs.prototype,"max",void 0),r([Vo({type:Number}),n("design:type",Number)],cs.prototype,"min",void 0),r([Vo({type:Number}),n("design:type",Number)],cs.prototype,"buffer",void 0),r([Vo({type:Number}),n("design:type",Number)],cs.prototype,"bufferMax",void 0),r([Vo({type:Number}),n("design:type",Number)],cs.prototype,"bufferMin",void 0),r([Vo({type:String,reflect:!0}),n("design:type",String)],cs.prototype,"role",void 0);let hs=class extends cs{render(){return Co`
			<svg focusable="false" preserveAspectRatio="xMidYMid meet" viewBox="0 0 100 100">
				${this.bufferPerc>0?Oo`<circle id="buffer" cx="50%" cy="50%" r="45" fill="transparent" style="stroke-dashoffset: ${285-285*this.bufferPerc}px"></circle>`:""}
				<circle
					id="progress"
					cx="50%"
					cy="50%"
					r="45"
					fill="transparent"
					style="${this.mode===ds.DETERMINATE?`stroke-dashoffset: ${285-285*this.progressPerc}px;`:""}"
				></circle>
			</svg>
		`}};hs.styles=[...cs.styles,ea(":host{width:var(--progress-spinner-size,3rem);height:var(--progress-spinner-size,3rem);contain:strict;position:relative;display:inline-block}svg{width:100%;height:100%;position:absolute;transform:rotate(-90deg);top:0;left:0;transform-origin:center center;overflow:visible}#buffer,#progress{stroke-width:var(--progress-spinner-stroke-width,10%);stroke-dasharray:285px;transition-property:stroke;transform-origin:center}#buffer{stroke:var(--progress-spinner-buffer-color,hsla(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%)),.2))}#progress{stroke:var(--progress-spinner-color,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))))}:host([mode=indeterminate]) svg{animation:rotate var(--progress-spinner-indeterminate-container-duration,2s) linear infinite}:host([mode=indeterminate]) #progress{animation-duration:var(--progress-spinner-indeterminate-progress-duration,4s);animation-timing-function:var(--progress-spinner-indeterminate-timing-function,var(--transition-timing-function-standard-curve,cubic-bezier(.4,0,.2,1)));animation-iteration-count:infinite;animation-name:indeterminate}#buffer,:host([mode=determinate]) #progress{transition:var(--progress-spinner-determinate-progress-transition,stroke-dashoffset var(--transition-timing-function-linear,linear))}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes indeterminate{0%{stroke-dashoffset:268px;transform:rotate(0)}12.5%{stroke-dashoffset:56px;transform:rotate(0)}12.5001%{stroke-dashoffset:56px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56px;transform:rotateX(180deg) rotate(341.5deg)}to{stroke-dashoffset:268px;transform:rotateX(180deg) rotate(341.5deg)}}")],hs=r([qo("wl-progress-spinner")],hs);
/**
 @license
 Copyright (c) 2015-2022 Lablup Inc. All rights reserved.
 */
let us=class extends vt{constructor(){super(),this.active=!1}static get styles(){return[at`
        wl-progress-spinner {
          --progress-spinner-size: 48px;
          --progress-spinner-stroke-width: 12px;
          width: 48px;
          height: 48px;
          position: fixed;
          bottom: 60px;
          right: 60px;
        }
      `]}render(){return D`
      <wl-progress-spinner id="spinner"></wl-progress-spinner>
    `}shouldUpdate(){return this.active}firstUpdated(){this.spinner=this.shadowRoot.querySelector("#spinner"),this.active=!0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}async show(){this.active=!0,await this.updateComplete,this.spinner.style.display="block"}async hide(){this.active=!0,await this.updateComplete,this.spinner.style.display="none",this.active=!1}async toggle(){await this.updateComplete,!0===this.spinner.active?(this.active=!0,this.spinner.style.display="none",this.active=!1):(this.active=!0,this.spinner.style.display="block")}};r([xt({type:Object})],us.prototype,"spinner",void 0),r([xt({type:Boolean})],us.prototype,"active",void 0),us=r([_t("lablup-loading-spinner")],us);const ps={easing:"ease-out",fill:"both"};let fs=class extends ta{constructor(){super(...arguments),this.unbounded=!1,this.centered=!1,this.overlay=!1,this.disabled=!1,this.focusable=!1,this.autoRelease=!1,this.initialDuration=350,this.releaseDuration=500,this.role="presentation",this.target=this,this.listeners=[],this.rippleAnimationListeners=[]}connectedCallback(){super.connectedCallback(),this.addListeners()}disconnectedCallback(){super.disconnectedCallback(),this.removeListeners()}updated(t){super.updated(t),t.has("target")&&null!=this.target&&(this.removeListeners(),this.addListeners())}addListeners(){null!=this.target&&this.listeners.push(ha(this.target,"mousedown",(t=>this.spawnRipple(t)),{passive:!0}),ha(this.target,"focusin",this.onFocusIn.bind(this),{passive:!0}),ha(this.target,"focusout",this.onFocusOut.bind(this),{passive:!0}))}removeListeners(){ua(this.listeners)}spawnRipple(t,e){if(this.disabled)return()=>{};this.releaseRipple();const i=this.getBoundingClientRect();let r=0,n=0;if(this.centered||null==t)r=i.width/2,n=i.height/2;else{let{clientX:e,clientY:o}=function(t){let e,i=!1;null!=t.changedTouches?(e=t.changedTouches[0],i=!0):e=t;let{clientX:r,clientY:n,pageX:o,pageY:a}=e;return{clientX:r,clientY:n,pageX:o,pageY:a,isTouch:i}}(t);r=e-i.left,n=o-i.top}const o=this.showRippleAtCoords({x:r,y:n},e);return this.rippleAnimationListeners.push(o),null==this.target||this.focusable||this.rippleAnimationListeners.push(ha(window,"mouseup",this.releaseRipple.bind(this),{passive:!0})),o}releaseRipple(){ua(this.rippleAnimationListeners)}showRippleAtCoords({x:t,y:e},i){const{offsetWidth:r,offsetHeight:n}=this,o=ba(window.getComputedStyle(this)),{releaseDuration:a=this.releaseDuration,initialDuration:s=this.initialDuration,autoRelease:l=this.autoRelease}=i||{};t*=0===o.x?1:1/o.x,e*=0===o.y?1:1/o.y;const d=document.createElement("div");d.classList.add("ripple");const c=ls(r,n),h=ls(Math.abs(r/2-t),Math.abs(n/2-e)),u=Math.round(c+2*h),p=2*u;Object.assign(d.style,{left:t-u+"px",top:e-u+"px",height:`${p}px`,width:`${p}px`,position:"absolute"});let f=!1;const m=()=>{if(f)return;f=!0;const t=va(window.getComputedStyle(d));d.animate({opacity:[t.toString(),"0"]},{...ps,duration:a}).onfinish=()=>{requestAnimationFrame((()=>{this.shadowRoot.contains(d)&&this.shadowRoot.removeChild(d)}))}};return this.shadowRoot.appendChild(d),l&&m(),d.animate({transform:["scale(0)","scale(1)"]},{...ps,duration:s}),m}onFocusIn(){this.focusable&&this.spawnRipple(void 0,{autoRelease:!1})}onFocusOut(){this.focusable&&this.releaseRipple()}render(){return Co``}};fs.styles=[Na,ea(":host{position:relative;display:block;outline:none;-webkit-user-select:none;user-select:none}:host(:not([unbounded])){overflow:hidden}:host([overlay]){position:absolute;top:50%;left:50%;width:100%;height:100%;transform:translate(-50%,-50%)}.ripple{background:var(--ripple-color,currentcolor);opacity:var(--ripple-opacity,.15);border-radius:100%;pointer-events:none;will-change:opacity,transform}")],r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],fs.prototype,"unbounded",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],fs.prototype,"centered",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],fs.prototype,"overlay",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],fs.prototype,"disabled",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],fs.prototype,"focusable",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],fs.prototype,"autoRelease",void 0),r([Vo({type:Number}),n("design:type",Number)],fs.prototype,"initialDuration",void 0),r([Vo({type:Number}),n("design:type",Number)],fs.prototype,"releaseDuration",void 0),r([Vo({type:String,reflect:!0}),n("design:type",String)],fs.prototype,"role",void 0),r([Vo({type:Object}),n("design:type",EventTarget)],fs.prototype,"target",void 0),fs=r([qo("wl-ripple")],fs);
/**
 * @license
 * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */
const ms=new WeakMap,gs=(t=>(...e)=>{const i=t(...e);return ao.set(i,!0),i})((t=>e=>{const i=ms.get(e);if(void 0===t&&e instanceof yo){if(void 0!==i||!ms.has(e)){const t=e.committer.name;e.committer.element.removeAttribute(t)}}else t!==i&&e.setValue(t);ms.set(e,t)}));class bs extends ta{constructor(){super(...arguments),this.disabled=!1,this.readonly=!1,this.required=!1,this.value="",this.formElementId=Ra(),this.listeners=[]}get validationMessage(){return this.$formElement.validationMessage}get valid(){return null==this.validity||this.validity.valid}get validity(){return this.$formElement.validity}get willValidate(){return this.$formElement.willValidate}get form(){return this.$formElement.form}checkValidity(){return this.$formElement.checkValidity()}setCustomValidity(t){return this.$formElement.setCustomValidity(t)}firstUpdated(t){super.firstUpdated(t),this.$formElement=this.queryFormElement(),this.appendChild(this.$formElement)}disconnectedCallback(){super.disconnectedCallback(),ua(this.listeners)}updated(t){super.updated(t),t.has("disabled")&&ia(this,{"aria-disabled":this.disabled.toString()}),this.updateTabindex(t)}updateTabindex(t){t.has("disabled")&&Wn(this,this.disabled)}getFormItemValue(){return null!=this.$formElement?this.$formElement.value:this.initialValue||""}queryFormElement(){return this.shadowRoot.querySelector(`#${this.formElementId}`)}}bs.styles=[Na,ea("")],r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],bs.prototype,"disabled",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],bs.prototype,"readonly",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],bs.prototype,"required",void 0),r([Vo({type:String}),n("design:type",String)],bs.prototype,"name",void 0),r([Vo({type:String}),n("design:type",String)],bs.prototype,"value",void 0);class vs extends bs{constructor(){super(...arguments),this.type="submit"}connectedCallback(){super.connectedCallback(),this.listeners.push(ha(this,"click",this.onClick.bind(this)),ha(this,"keydown",this.onKeyDown.bind(this)))}onKeyDown(t){t instanceof KeyboardEvent&&("Enter"===t.code||"Space"===t.code)&&(this.click(),pa(t),null!=this.$ripple&&this.$ripple.spawnRipple(void 0,{autoRelease:!0}))}onClick(t){this.disabled?pa(t):t.target!=this||t.defaultPrevented||this.$formElement.dispatchEvent(new MouseEvent("click",{relatedTarget:this,composed:!0}))}renderFormElement(){return Co` <button style="display: none;" id="${this.formElementId}" aria-hidden="true" tabindex="-1" type="${this.type}" ?disabled="${this.disabled}" name="${gs(this.name)}" value="${gs(this.value)}"></button> `}}vs.styles=[...bs.styles,ea("")],r([Vo({type:String}),n("design:type",String)],vs.prototype,"type",void 0);let ys=class extends vs{constructor(){super(...arguments),this.inverted=!1,this.fab=!1,this.outlined=!1,this.noRipple=!1,this.flat=!1,this.role="button"}render(){return Co` <wl-ripple id="ripple" overlay .target="${this}" ?disabled="${this.disabled||this.noRipple}"></wl-ripple> <slot></slot> ${this.renderFormElement()} `}};ys.styles=[...vs.styles,ea(':host{--_button-color:var(--button-color,hsl(var(--primary-500-contrast,var(--primary-hue-contrast,0),var(--primary-saturation-contrast,100%),var(--primary-lightness-contrast,100%))));--_button-bg:var(--button-bg,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))));--_button-shadow-color:var(--button-shadow-color,hsla(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%)),0.2));color:var(--_button-color);background:var(--_button-bg);box-shadow:var(--elevation-1,0 .3125rem .625rem -.125rem var(--_button-shadow-color));padding:var(--button-padding,.75rem 1.5rem);font-size:var(--button-font-size,1rem);border-radius:var(--button-border-radius,.5rem);font-family:var(--button-font-family,var(--font-family-sans-serif,"Roboto Condensed",helvetica,sans-serif));transition:var(--button-transition,box-shadow var(--transition-duration-slow,.25s) var(--transition-timing-function-ease,ease),background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease));letter-spacing:var(--button-letter-spacing,.125rem);line-height:1;text-transform:uppercase;cursor:pointer;text-align:center;-webkit-user-select:none;user-select:none;outline:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;z-index:0}:host,:host([fab]){display:inline-flex;align-items:center;justify-content:center}:host([fab]){width:var(--button-fab-size,2.5rem);height:var(--button-fab-size,2.5rem);padding:0;letter-spacing:0;border-radius:100%}:host([inverted]){color:var(--_button-bg);background:var(--_button-color)}:host([outlined]){border:var(--button-border-outlined,.125rem solid currentColor)}:host(:focus),:host(:hover){--_button-color:var(--button-color-hover,hsl(var(--primary-400-contrast,var(--primary-hue-contrast,0),var(--primary-saturation-contrast,100%),var(--primary-lightness-contrast,100%))));--_button-bg:var(--button-bg-hover,hsl(var(--primary-400,var(--primary-hue,224),var(--primary-saturation,42%),var(--primary-lightness,52%))));--_button-shadow-color:var(--button-shadow-color-hover,hsla(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%)),0.5));will-change:background,color,box-shadow}:host(:active){--_button-color:var(--button-color-active,hsl(var(--primary-500-contrast,var(--primary-hue-contrast,0),var(--primary-saturation-contrast,100%),var(--primary-lightness-contrast,100%))));--_button-bg:var(--button-bg-active,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))));box-shadow:var(--elevation-4,0 .5rem 1rem -.125rem var(--_button-shadow-color))}:host([flat]:focus){background:var(--button-bg-active-flat,hsla(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%)),.08))}:host([disabled]){--_button-color:var(--button-color-disabled,hsl(var(--shade-400-contrast,var(--shade-hue-contrast,0),var(--shade-saturation-contrast,100%),var(--shade-lightness-contrast,100%))));--_button-bg:var(--button-bg-disabled,hsl(var(--shade-400,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,65%))));box-shadow:none;cursor:default;pointer-events:none}:host([flat]){box-shadow:none;background:none}#ripple{z-index:-1}')],r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],ys.prototype,"inverted",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],ys.prototype,"fab",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],ys.prototype,"outlined",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],ys.prototype,"noRipple",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],ys.prototype,"flat",void 0),r([Vo({type:String,reflect:!0}),n("design:type",String)],ys.prototype,"role",void 0),r([Wo("#ripple"),n("design:type",fs)],ys.prototype,"$ripple",void 0),ys=r([qo("wl-button")],ys);let _s=class extends ta{constructor(){super(...arguments),this.role="presentation"}render(){return Co` <slot></slot> `}};_s.styles=[ea(':host{font-size:var(--icon-size,1.5em);font-family:var(--icon-font,"Material Icons");font-weight:400;font-style:normal;color:inherit;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased}'),Na],r([Vo({type:String,reflect:!0}),n("design:type",String)],_s.prototype,"role",void 0),_s=r([qo("wl-icon")],_s);var ws=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();function xs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}!function(){if("undefined"!=typeof window){var t=Array.prototype.slice,e=Element.prototype.matches||Element.prototype.msMatchesSelector,i=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","[contenteditable]"].join(","),r=function(){function r(t,e){xs(this,r),this._inertManager=e,this._rootElement=t,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}return ws(r,[{key:"destructor",value:function(){this._observer.disconnect(),this._rootElement&&(null!==this._savedAriaHidden?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach((function(t){this._unmanageNode(t.node)}),this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(t){var e=this;a(t,(function(t){return e._visitNode(t)}));var i=document.activeElement;if(!document.body.contains(t)){for(var r=t,n=void 0;r;){if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){n=r;break}r=r.parentNode}n&&(i=n.activeElement)}t.contains(i)&&(i.blur(),i===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(t){if(t.nodeType===Node.ELEMENT_NODE){var r=t;r!==this._rootElement&&r.hasAttribute("inert")&&this._adoptInertRoot(r),(e.call(r,i)||r.hasAttribute("tabindex"))&&this._manageNode(r)}}},{key:"_manageNode",value:function(t){var e=this._inertManager.register(t,this);this._managedNodes.add(e)}},{key:"_unmanageNode",value:function(t){var e=this._inertManager.deregister(t,this);e&&this._managedNodes.delete(e)}},{key:"_unmanageSubtree",value:function(t){var e=this;a(t,(function(t){return e._unmanageNode(t)}))}},{key:"_adoptInertRoot",value:function(t){var e=this._inertManager.getInertRoot(t);e||(this._inertManager.setInert(t,!0),e=this._inertManager.getInertRoot(t)),e.managedNodes.forEach((function(t){this._manageNode(t.node)}),this)}},{key:"_onMutation",value:function(e,i){e.forEach((function(e){var i=e.target;if("childList"===e.type)t.call(e.addedNodes).forEach((function(t){this._makeSubtreeUnfocusable(t)}),this),t.call(e.removedNodes).forEach((function(t){this._unmanageSubtree(t)}),this);else if("attributes"===e.type)if("tabindex"===e.attributeName)this._manageNode(i);else if(i!==this._rootElement&&"inert"===e.attributeName&&i.hasAttribute("inert")){this._adoptInertRoot(i);var r=this._inertManager.getInertRoot(i);this._managedNodes.forEach((function(t){i.contains(t.node)&&r._manageNode(t.node)}))}}),this)}},{key:"managedNodes",get:function(){return new Set(this._managedNodes)}},{key:"hasSavedAriaHidden",get:function(){return null!==this._savedAriaHidden}},{key:"savedAriaHidden",set:function(t){this._savedAriaHidden=t},get:function(){return this._savedAriaHidden}}]),r}(),n=function(){function t(e,i){xs(this,t),this._node=e,this._overrodeFocusMethod=!1,this._inertRoots=new Set([i]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}return ws(t,[{key:"destructor",value:function(){if(this._throwIfDestroyed(),this._node&&this._node.nodeType===Node.ELEMENT_NODE){var t=this._node;null!==this._savedTabIndex?t.setAttribute("tabindex",this._savedTabIndex):t.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete t.focus}this._node=null,this._inertRoots=null,this._destroyed=!0}},{key:"_throwIfDestroyed",value:function(){if(this.destroyed)throw new Error("Trying to access destroyed InertNode")}},{key:"ensureUntabbable",value:function(){if(this.node.nodeType===Node.ELEMENT_NODE){var t=this.node;if(e.call(t,i)){if(-1===t.tabIndex&&this.hasSavedTabIndex)return;t.hasAttribute("tabindex")&&(this._savedTabIndex=t.tabIndex),t.setAttribute("tabindex","-1"),t.nodeType===Node.ELEMENT_NODE&&(t.focus=function(){},this._overrodeFocusMethod=!0)}else t.hasAttribute("tabindex")&&(this._savedTabIndex=t.tabIndex,t.removeAttribute("tabindex"))}}},{key:"addInertRoot",value:function(t){this._throwIfDestroyed(),this._inertRoots.add(t)}},{key:"removeInertRoot",value:function(t){this._throwIfDestroyed(),this._inertRoots.delete(t),0===this._inertRoots.size&&this.destructor()}},{key:"destroyed",get:function(){return this._destroyed}},{key:"hasSavedTabIndex",get:function(){return null!==this._savedTabIndex}},{key:"node",get:function(){return this._throwIfDestroyed(),this._node}},{key:"savedTabIndex",set:function(t){this._throwIfDestroyed(),this._savedTabIndex=t},get:function(){return this._throwIfDestroyed(),this._savedTabIndex}}]),t}(),o=new(function(){function i(t){if(xs(this,i),!t)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=t,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),s(t.head||t.body||t.documentElement),"loading"===t.readyState?t.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}return ws(i,[{key:"setInert",value:function(t,e){if(e){if(this._inertRoots.has(t))return;var i=new r(t,this);if(t.setAttribute("inert",""),this._inertRoots.set(t,i),!this._document.body.contains(t))for(var n=t.parentNode;n;)11===n.nodeType&&s(n),n=n.parentNode}else{if(!this._inertRoots.has(t))return;this._inertRoots.get(t).destructor(),this._inertRoots.delete(t),t.removeAttribute("inert")}}},{key:"getInertRoot",value:function(t){return this._inertRoots.get(t)}},{key:"register",value:function(t,e){var i=this._managedNodes.get(t);return void 0!==i?i.addInertRoot(e):i=new n(t,e),this._managedNodes.set(t,i),i}},{key:"deregister",value:function(t,e){var i=this._managedNodes.get(t);return i?(i.removeInertRoot(e),i.destroyed&&this._managedNodes.delete(t),i):null}},{key:"_onDocumentLoaded",value:function(){t.call(this._document.querySelectorAll("[inert]")).forEach((function(t){this.setInert(t,!0)}),this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}},{key:"_watchForInert",value:function(i,r){var n=this;i.forEach((function(i){switch(i.type){case"childList":t.call(i.addedNodes).forEach((function(i){if(i.nodeType===Node.ELEMENT_NODE){var r=t.call(i.querySelectorAll("[inert]"));e.call(i,"[inert]")&&r.unshift(i),r.forEach((function(t){this.setInert(t,!0)}),n)}}),n);break;case"attributes":if("inert"!==i.attributeName)return;var r=i.target,o=r.hasAttribute("inert");n.setInert(r,o)}}),this)}}]),i}())(document);Element.prototype.hasOwnProperty("inert")||Object.defineProperty(Element.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(t){o.setInert(this,t)}})}function a(t,e,i){if(t.nodeType==Node.ELEMENT_NODE){var r=t;e&&e(r);var n=r.shadowRoot;if(n)return void a(n,e);if("content"==r.localName){for(var o=r,s=o.getDistributedNodes?o.getDistributedNodes():[],l=0;l<s.length;l++)a(s[l],e);return}if("slot"==r.localName){for(var d=r,c=d.assignedNodes?d.assignedNodes({flatten:!0}):[],h=0;h<c.length;h++)a(c[h],e);return}}for(var u=t.firstChild;null!=u;)a(u,e),u=u.nextSibling}function s(t){if(!t.querySelector("style#inert-style, link#inert-style")){var e=document.createElement("style");e.setAttribute("id","inert-style"),e.textContent="\n[inert] {\n  pointer-events: none;\n  cursor: default;\n}\n\n[inert], [inert] * {\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n",t.appendChild(e)}}}();
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var Ms,ks={CLOSING:"mdc-dialog--closing",OPEN:"mdc-dialog--open",OPENING:"mdc-dialog--opening",SCROLLABLE:"mdc-dialog--scrollable",SCROLL_LOCK:"mdc-dialog-scroll-lock",STACKED:"mdc-dialog--stacked",FULLSCREEN:"mdc-dialog--fullscreen",SCROLL_DIVIDER_HEADER:"mdc-dialog-scroll-divider-header",SCROLL_DIVIDER_FOOTER:"mdc-dialog-scroll-divider-footer",SURFACE_SCRIM_SHOWN:"mdc-dialog__surface-scrim--shown",SURFACE_SCRIM_SHOWING:"mdc-dialog__surface-scrim--showing",SURFACE_SCRIM_HIDING:"mdc-dialog__surface-scrim--hiding",SCRIM_HIDDEN:"mdc-dialog__scrim--hidden"},Ss={ACTION_ATTRIBUTE:"data-mdc-dialog-action",BUTTON_DEFAULT_ATTRIBUTE:"data-mdc-dialog-button-default",BUTTON_SELECTOR:".mdc-dialog__button",CLOSED_EVENT:"MDCDialog:closed",CLOSE_ACTION:"close",CLOSING_EVENT:"MDCDialog:closing",CONTAINER_SELECTOR:".mdc-dialog__container",CONTENT_SELECTOR:".mdc-dialog__content",DESTROY_ACTION:"destroy",INITIAL_FOCUS_ATTRIBUTE:"data-mdc-dialog-initial-focus",OPENED_EVENT:"MDCDialog:opened",OPENING_EVENT:"MDCDialog:opening",SCRIM_SELECTOR:".mdc-dialog__scrim",SUPPRESS_DEFAULT_PRESS_SELECTOR:["textarea",".mdc-menu .mdc-list-item",".mdc-menu .mdc-deprecated-list-item"].join(", "),SURFACE_SELECTOR:".mdc-dialog__surface"},Es={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},As=function(){function t(){this.rafIDs=new Map}return t.prototype.request=function(t,e){var i=this;this.cancel(t);var r=requestAnimationFrame((function(r){i.rafIDs.delete(t),e(r)}));this.rafIDs.set(t,r)},t.prototype.cancel=function(t){var e=this.rafIDs.get(t);e&&(cancelAnimationFrame(e),this.rafIDs.delete(t))},t.prototype.cancelAll=function(){var t=this;this.rafIDs.forEach((function(e,i){t.cancel(i)}))},t.prototype.getQueue=function(){var t=[];return this.rafIDs.forEach((function(e,i){t.push(i)})),t},t}();!function(t){t.POLL_SCROLL_POS="poll_scroll_position",t.POLL_LAYOUT_CHANGE="poll_layout_change"}(Ms||(Ms={}));var Ts=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.dialogOpen=!1,n.isFullscreen=!1,n.animationFrame=0,n.animationTimer=0,n.escapeKeyAction=Ss.CLOSE_ACTION,n.scrimClickAction=Ss.CLOSE_ACTION,n.autoStackButtons=!0,n.areButtonsStacked=!1,n.suppressDefaultPressSelector=Ss.SUPPRESS_DEFAULT_PRESS_SELECTOR,n.animFrame=new As,n.contentScrollHandler=function(){n.handleScrollEvent()},n.windowResizeHandler=function(){n.layout()},n.windowOrientationChangeHandler=function(){n.layout()},n}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return ks},enumerable:!1,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return Ss},enumerable:!1,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return Es},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addBodyClass:function(){},addClass:function(){},areButtonsStacked:function(){return!1},clickDefaultButton:function(){},eventTargetMatches:function(){return!1},getActionFromEvent:function(){return""},getInitialFocusEl:function(){return null},hasClass:function(){return!1},isContentScrollable:function(){return!1},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},releaseFocus:function(){},removeBodyClass:function(){},removeClass:function(){},reverseButtons:function(){},trapFocus:function(){},registerContentEventHandler:function(){},deregisterContentEventHandler:function(){},isScrollableContentAtTop:function(){return!1},isScrollableContentAtBottom:function(){return!1},registerWindowEventHandler:function(){},deregisterWindowEventHandler:function(){}}},enumerable:!1,configurable:!0}),r.prototype.init=function(){this.adapter.hasClass(ks.STACKED)&&this.setAutoStackButtons(!1),this.isFullscreen=this.adapter.hasClass(ks.FULLSCREEN)},r.prototype.destroy=function(){this.animationTimer&&(clearTimeout(this.animationTimer),this.handleAnimationTimerEnd()),this.isFullscreen&&this.adapter.deregisterContentEventHandler("scroll",this.contentScrollHandler),this.animFrame.cancelAll(),this.adapter.deregisterWindowEventHandler("resize",this.windowResizeHandler),this.adapter.deregisterWindowEventHandler("orientationchange",this.windowOrientationChangeHandler)},r.prototype.open=function(t){var e=this;this.dialogOpen=!0,this.adapter.notifyOpening(),this.adapter.addClass(ks.OPENING),this.isFullscreen&&this.adapter.registerContentEventHandler("scroll",this.contentScrollHandler),t&&t.isAboveFullscreenDialog&&this.adapter.addClass(ks.SCRIM_HIDDEN),this.adapter.registerWindowEventHandler("resize",this.windowResizeHandler),this.adapter.registerWindowEventHandler("orientationchange",this.windowOrientationChangeHandler),this.runNextAnimationFrame((function(){e.adapter.addClass(ks.OPEN),e.adapter.addBodyClass(ks.SCROLL_LOCK),e.layout(),e.animationTimer=setTimeout((function(){e.handleAnimationTimerEnd(),e.adapter.trapFocus(e.adapter.getInitialFocusEl()),e.adapter.notifyOpened()}),Es.DIALOG_ANIMATION_OPEN_TIME_MS)}))},r.prototype.close=function(t){var e=this;void 0===t&&(t=""),this.dialogOpen&&(this.dialogOpen=!1,this.adapter.notifyClosing(t),this.adapter.addClass(ks.CLOSING),this.adapter.removeClass(ks.OPEN),this.adapter.removeBodyClass(ks.SCROLL_LOCK),this.isFullscreen&&this.adapter.deregisterContentEventHandler("scroll",this.contentScrollHandler),this.adapter.deregisterWindowEventHandler("resize",this.windowResizeHandler),this.adapter.deregisterWindowEventHandler("orientationchange",this.windowOrientationChangeHandler),cancelAnimationFrame(this.animationFrame),this.animationFrame=0,clearTimeout(this.animationTimer),this.animationTimer=setTimeout((function(){e.adapter.releaseFocus(),e.handleAnimationTimerEnd(),e.adapter.notifyClosed(t)}),Es.DIALOG_ANIMATION_CLOSE_TIME_MS))},r.prototype.showSurfaceScrim=function(){var t=this;this.adapter.addClass(ks.SURFACE_SCRIM_SHOWING),this.runNextAnimationFrame((function(){t.adapter.addClass(ks.SURFACE_SCRIM_SHOWN)}))},r.prototype.hideSurfaceScrim=function(){this.adapter.removeClass(ks.SURFACE_SCRIM_SHOWN),this.adapter.addClass(ks.SURFACE_SCRIM_HIDING)},r.prototype.handleSurfaceScrimTransitionEnd=function(){this.adapter.removeClass(ks.SURFACE_SCRIM_HIDING),this.adapter.removeClass(ks.SURFACE_SCRIM_SHOWING)},r.prototype.isOpen=function(){return this.dialogOpen},r.prototype.getEscapeKeyAction=function(){return this.escapeKeyAction},r.prototype.setEscapeKeyAction=function(t){this.escapeKeyAction=t},r.prototype.getScrimClickAction=function(){return this.scrimClickAction},r.prototype.setScrimClickAction=function(t){this.scrimClickAction=t},r.prototype.getAutoStackButtons=function(){return this.autoStackButtons},r.prototype.setAutoStackButtons=function(t){this.autoStackButtons=t},r.prototype.getSuppressDefaultPressSelector=function(){return this.suppressDefaultPressSelector},r.prototype.setSuppressDefaultPressSelector=function(t){this.suppressDefaultPressSelector=t},r.prototype.layout=function(){var t=this;this.animFrame.request(Ms.POLL_LAYOUT_CHANGE,(function(){t.layoutInternal()}))},r.prototype.handleClick=function(t){if(this.adapter.eventTargetMatches(t.target,Ss.SCRIM_SELECTOR)&&""!==this.scrimClickAction)this.close(this.scrimClickAction);else{var e=this.adapter.getActionFromEvent(t);e&&this.close(e)}},r.prototype.handleKeydown=function(t){var e="Enter"===t.key||13===t.keyCode;if(e&&!this.adapter.getActionFromEvent(t)){var i=t.composedPath?t.composedPath()[0]:t.target,r=!this.suppressDefaultPressSelector||!this.adapter.eventTargetMatches(i,this.suppressDefaultPressSelector);e&&r&&this.adapter.clickDefaultButton()}},r.prototype.handleDocumentKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&""!==this.escapeKeyAction&&this.close(this.escapeKeyAction)},r.prototype.handleScrollEvent=function(){var t=this;this.animFrame.request(Ms.POLL_SCROLL_POS,(function(){t.toggleScrollDividerHeader(),t.toggleScrollDividerFooter()}))},r.prototype.layoutInternal=function(){this.autoStackButtons&&this.detectStackedButtons(),this.toggleScrollableClasses()},r.prototype.handleAnimationTimerEnd=function(){this.animationTimer=0,this.adapter.removeClass(ks.OPENING),this.adapter.removeClass(ks.CLOSING)},r.prototype.runNextAnimationFrame=function(t){var e=this;cancelAnimationFrame(this.animationFrame),this.animationFrame=requestAnimationFrame((function(){e.animationFrame=0,clearTimeout(e.animationTimer),e.animationTimer=setTimeout(t,0)}))},r.prototype.detectStackedButtons=function(){this.adapter.removeClass(ks.STACKED);var t=this.adapter.areButtonsStacked();t&&this.adapter.addClass(ks.STACKED),t!==this.areButtonsStacked&&(this.adapter.reverseButtons(),this.areButtonsStacked=t)},r.prototype.toggleScrollableClasses=function(){this.adapter.removeClass(ks.SCROLLABLE),this.adapter.isContentScrollable()&&(this.adapter.addClass(ks.SCROLLABLE),this.isFullscreen&&(this.toggleScrollDividerHeader(),this.toggleScrollDividerFooter()))},r.prototype.toggleScrollDividerHeader=function(){this.adapter.isScrollableContentAtTop()?this.adapter.hasClass(ks.SCROLL_DIVIDER_HEADER)&&this.adapter.removeClass(ks.SCROLL_DIVIDER_HEADER):this.adapter.addClass(ks.SCROLL_DIVIDER_HEADER)},r.prototype.toggleScrollDividerFooter=function(){this.adapter.isScrollableContentAtBottom()?this.adapter.hasClass(ks.SCROLL_DIVIDER_FOOTER)&&this.adapter.removeClass(ks.SCROLL_DIVIDER_FOOTER):this.adapter.addClass(ks.SCROLL_DIVIDER_FOOTER)},r}(Oe);
/**
 * @license
 * Copyright 2019 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
function Rs(t){return void 0===t&&(t=window),!!function(t){void 0===t&&(t=window);var e=!1;try{var i={get passive(){return e=!0,!1}},r=function(){};t.document.addEventListener("test",r,i),t.document.removeEventListener("test",r,i)}catch(t){e=!1}return e}
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */(t)&&{passive:!0}}const Is=document.$blockingElements;class Cs extends He{constructor(){super(...arguments),this.hideActions=!1,this.stacked=!1,this.heading="",this.scrimClickAction="close",this.escapeKeyAction="close",this.open=!1,this.defaultAction="close",this.actionAttribute="dialogAction",this.initialFocusAttribute="dialogInitialFocus",this.initialSupressDefaultPressSelector="",this.mdcFoundationClass=Ts,this.boundHandleClick=null,this.boundHandleKeydown=null,this.boundHandleDocumentKeydown=null}set suppressDefaultPressSelector(t){this.mdcFoundation?this.mdcFoundation.setSuppressDefaultPressSelector(t):this.initialSupressDefaultPressSelector=t}get suppressDefaultPressSelector(){return this.mdcFoundation?this.mdcFoundation.getSuppressDefaultPressSelector():this.initialSupressDefaultPressSelector}get primaryButton(){let t=this.primarySlot.assignedNodes();t=t.filter((t=>t instanceof HTMLElement));const e=t[0];return e||null}emitNotification(t,e){const i=new CustomEvent(t,{detail:e?{action:e}:{}});this.dispatchEvent(i)}getInitialFocusEl(){const t=`[${this.initialFocusAttribute}]`,e=this.querySelector(t);if(e)return e;const i=this.primarySlot.assignedNodes({flatten:!0}),r=this.searchNodeTreesForAttribute(i,this.initialFocusAttribute);if(r)return r;const n=this.secondarySlot.assignedNodes({flatten:!0}),o=this.searchNodeTreesForAttribute(n,this.initialFocusAttribute);if(o)return o;const a=this.contentSlot.assignedNodes({flatten:!0});return this.searchNodeTreesForAttribute(a,this.initialFocusAttribute)}searchNodeTreesForAttribute(t,e){for(const i of t)if(i instanceof HTMLElement){if(i.hasAttribute(e))return i;{const t=i.querySelector(`[${e}]`);if(t)return t}}return null}createAdapter(){return Object.assign(Object.assign({},Be(this.mdcRoot)),{addBodyClass:()=>document.body.style.overflow="hidden",removeBodyClass:()=>document.body.style.overflow="",areButtonsStacked:()=>this.stacked,clickDefaultButton:()=>{const t=this.primaryButton;t&&t.click()},eventTargetMatches:(t,e)=>!!t&&fi(t,e),getActionFromEvent:t=>{if(!t.target)return"";const e=
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
function(t,e){if(t.closest)return t.closest(e);for(var i=t;i;){if(fi(i,e))return i;i=i.parentElement}return null}(t.target,`[${this.actionAttribute}]`);return e&&e.getAttribute(this.actionAttribute)},getInitialFocusEl:()=>this.getInitialFocusEl(),isContentScrollable:()=>{const t=this.contentElement;return!!t&&t.scrollHeight>t.offsetHeight},notifyClosed:t=>this.emitNotification("closed",t),notifyClosing:t=>{this.closingDueToDisconnect||(this.open=!1),this.emitNotification("closing",t)},notifyOpened:()=>this.emitNotification("opened"),notifyOpening:()=>{this.open=!0,this.emitNotification("opening")},reverseButtons:()=>{},releaseFocus:()=>{Is.remove(this)},trapFocus:t=>{this.isConnected&&(Is.push(this),t&&t.focus())},registerContentEventHandler:(t,e)=>{this.contentElement.addEventListener(t,e)},deregisterContentEventHandler:(t,e)=>{this.contentElement.removeEventListener(t,e)},isScrollableContentAtTop:()=>{const t=this.contentElement;return!!t&&0===t.scrollTop},isScrollableContentAtBottom:()=>{const t=this.contentElement;return!!t&&Math.ceil(t.scrollHeight-t.scrollTop)===t.clientHeight},registerWindowEventHandler:(t,e)=>{window.addEventListener(t,e,Rs())},deregisterWindowEventHandler:(t,e)=>{window.removeEventListener(t,e,Rs())}})}render(){const t={[ks.STACKED]:this.stacked};let e=D``;this.heading&&(e=this.renderHeading());const i={"mdc-dialog__actions":!this.hideActions};return D`
    <div class="mdc-dialog ${We(t)}"
        role="alertdialog"
        aria-modal="true"
        aria-labelledby="title"
        aria-describedby="content">
      <div class="mdc-dialog__container">
        <div class="mdc-dialog__surface">
          ${e}
          <div id="content" class="mdc-dialog__content">
            <slot id="contentSlot"></slot>
          </div>
          <footer
              id="actions"
              class="${We(i)}">
            <span>
              <slot name="secondaryAction"></slot>
            </span>
            <span>
             <slot name="primaryAction"></slot>
            </span>
          </footer>
        </div>
      </div>
      <div class="mdc-dialog__scrim"></div>
    </div>`}renderHeading(){return D`
      <h2 id="title" class="mdc-dialog__title">${this.heading}</h2>`}firstUpdated(){super.firstUpdated(),this.mdcFoundation.setAutoStackButtons(!0),this.initialSupressDefaultPressSelector?this.suppressDefaultPressSelector=this.initialSupressDefaultPressSelector:this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,"mwc-textarea","mwc-menu mwc-list-item","mwc-select mwc-list-item"].join(", "),this.boundHandleClick=this.mdcFoundation.handleClick.bind(this.mdcFoundation),this.boundHandleKeydown=this.mdcFoundation.handleKeydown.bind(this.mdcFoundation),this.boundHandleDocumentKeydown=this.mdcFoundation.handleDocumentKeydown.bind(this.mdcFoundation)}connectedCallback(){super.connectedCallback(),this.open&&this.mdcFoundation&&!this.mdcFoundation.isOpen()&&(this.setEventListeners(),this.mdcFoundation.open())}disconnectedCallback(){super.disconnectedCallback(),this.open&&this.mdcFoundation&&(this.removeEventListeners(),this.closingDueToDisconnect=!0,this.mdcFoundation.close(this.currentAction||this.defaultAction),this.closingDueToDisconnect=!1,this.currentAction=void 0,Is.remove(this))}forceLayout(){this.mdcFoundation.layout()}focus(){const t=this.getInitialFocusEl();t&&t.focus()}blur(){if(!this.shadowRoot)return;const t=this.shadowRoot.activeElement;if(t)t instanceof HTMLElement&&t.blur();else{const t=this.getRootNode(),e=t instanceof Document?t.activeElement:null;e instanceof HTMLElement&&e.blur()}}setEventListeners(){this.boundHandleClick&&this.mdcRoot.addEventListener("click",this.boundHandleClick),this.boundHandleKeydown&&this.mdcRoot.addEventListener("keydown",this.boundHandleKeydown,Rs()),this.boundHandleDocumentKeydown&&document.addEventListener("keydown",this.boundHandleDocumentKeydown,Rs())}removeEventListeners(){this.boundHandleClick&&this.mdcRoot.removeEventListener("click",this.boundHandleClick),this.boundHandleKeydown&&this.mdcRoot.removeEventListener("keydown",this.boundHandleKeydown),this.boundHandleDocumentKeydown&&document.removeEventListener("keydown",this.boundHandleDocumentKeydown)}close(){this.open=!1}show(){this.open=!0}}r([Et(".mdc-dialog")],Cs.prototype,"mdcRoot",void 0),r([Et('slot[name="primaryAction"]')],Cs.prototype,"primarySlot",void 0),r([Et('slot[name="secondaryAction"]')],Cs.prototype,"secondarySlot",void 0),r([Et("#contentSlot")],Cs.prototype,"contentSlot",void 0),r([Et(".mdc-dialog__content")],Cs.prototype,"contentElement",void 0),r([Et(".mdc-container")],Cs.prototype,"conatinerElement",void 0),r([xt({type:Boolean})],Cs.prototype,"hideActions",void 0),r([xt({type:Boolean}),Ve((function(){this.forceLayout()}))],Cs.prototype,"stacked",void 0),r([xt({type:String})],Cs.prototype,"heading",void 0),r([xt({type:String}),Ve((function(t){this.mdcFoundation.setScrimClickAction(t)}))],Cs.prototype,"scrimClickAction",void 0),r([xt({type:String}),Ve((function(t){this.mdcFoundation.setEscapeKeyAction(t)}))],Cs.prototype,"escapeKeyAction",void 0),r([xt({type:Boolean,reflect:!0}),Ve((function(t){this.mdcFoundation&&this.isConnected&&(t?(this.setEventListeners(),this.mdcFoundation.open()):(this.removeEventListeners(),this.mdcFoundation.close(this.currentAction||this.defaultAction),this.currentAction=void 0))}))],Cs.prototype,"open",void 0),r([xt()],Cs.prototype,"defaultAction",void 0),r([xt()],Cs.prototype,"actionAttribute",void 0),r([xt()],Cs.prototype,"initialFocusAttribute",void 0);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const Os=at`.mdc-dialog .mdc-dialog__surface{background-color:#fff;background-color:var(--mdc-theme-surface, #fff)}.mdc-dialog .mdc-dialog__scrim{background-color:rgba(0,0,0,.32)}.mdc-dialog .mdc-dialog__surface-scrim{background-color:rgba(0,0,0,.32)}.mdc-dialog .mdc-dialog__title{color:rgba(0,0,0,.87)}.mdc-dialog .mdc-dialog__content{color:rgba(0,0,0,.6)}.mdc-dialog .mdc-dialog__close{color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-dialog .mdc-dialog__close .mdc-icon-button__ripple::before,.mdc-dialog .mdc-dialog__close .mdc-icon-button__ripple::after{background-color:#000;background-color:var(--mdc-ripple-color, var(--mdc-theme-on-surface, #000))}.mdc-dialog .mdc-dialog__close:hover .mdc-icon-button__ripple::before,.mdc-dialog .mdc-dialog__close.mdc-ripple-surface--hover .mdc-icon-button__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-dialog .mdc-dialog__close.mdc-ripple-upgraded--background-focused .mdc-icon-button__ripple::before,.mdc-dialog .mdc-dialog__close:not(.mdc-ripple-upgraded):focus .mdc-icon-button__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-dialog .mdc-dialog__close:not(.mdc-ripple-upgraded) .mdc-icon-button__ripple::after{transition:opacity 150ms linear}.mdc-dialog .mdc-dialog__close:not(.mdc-ripple-upgraded):active .mdc-icon-button__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-dialog .mdc-dialog__close.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__title,.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__actions,.mdc-dialog.mdc-dialog--scrollable.mdc-dialog-scroll-divider-footer .mdc-dialog__actions{border-color:rgba(0,0,0,.12)}.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__title{border-bottom:1px solid rgba(0,0,0,.12);margin-bottom:0}.mdc-dialog.mdc-dialog-scroll-divider-header.mdc-dialog--fullscreen .mdc-dialog__header{box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2),0px 2px 2px 0px rgba(0, 0, 0, 0.14),0px 1px 5px 0px rgba(0,0,0,.12)}.mdc-dialog .mdc-dialog__surface{border-radius:4px;border-radius:var(--mdc-shape-medium, 4px)}.mdc-dialog__surface{box-shadow:0px 11px 15px -7px rgba(0, 0, 0, 0.2),0px 24px 38px 3px rgba(0, 0, 0, 0.14),0px 9px 46px 8px rgba(0,0,0,.12)}.mdc-dialog__title{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-headline6-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1.25rem;font-size:var(--mdc-typography-headline6-font-size, 1.25rem);line-height:2rem;line-height:var(--mdc-typography-headline6-line-height, 2rem);font-weight:500;font-weight:var(--mdc-typography-headline6-font-weight, 500);letter-spacing:0.0125em;letter-spacing:var(--mdc-typography-headline6-letter-spacing, 0.0125em);text-decoration:inherit;text-decoration:var(--mdc-typography-headline6-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-headline6-text-transform, inherit)}.mdc-dialog__content{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-body1-font-size, 1rem);line-height:1.5rem;line-height:var(--mdc-typography-body1-line-height, 1.5rem);font-weight:400;font-weight:var(--mdc-typography-body1-font-weight, 400);letter-spacing:0.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, 0.03125em);text-decoration:inherit;text-decoration:var(--mdc-typography-body1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform, inherit)}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:0;opacity:var(--mdc-elevation-overlay-opacity, 0);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:#fff;background-color:var(--mdc-elevation-overlay-color, #fff)}.mdc-dialog,.mdc-dialog__scrim{position:fixed;top:0;left:0;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%}.mdc-dialog{display:none;z-index:7;z-index:var(--mdc-dialog-z-index, 7)}.mdc-dialog .mdc-dialog__content{padding:20px 24px 20px 24px}.mdc-dialog .mdc-dialog__surface{min-width:280px}@media(max-width: 592px){.mdc-dialog .mdc-dialog__surface{max-width:calc(100vw - 32px)}}@media(min-width: 592px){.mdc-dialog .mdc-dialog__surface{max-width:560px}}.mdc-dialog .mdc-dialog__surface{max-height:calc(100% - 32px)}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{max-width:none}@media(max-width: 960px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{max-height:560px;width:560px}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__close{right:-12px}}@media(max-width: 720px)and (max-width: 672px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{width:calc(100vw - 112px)}}@media(max-width: 720px)and (min-width: 672px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{width:560px}}@media(max-width: 720px)and (max-height: 720px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{max-height:calc(100vh - 160px)}}@media(max-width: 720px)and (min-height: 720px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{max-height:560px}}@media(max-width: 720px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__close{right:-12px}}@media(max-width: 720px)and (max-height: 400px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{height:100%;max-height:100vh;max-width:100vw;width:100vw;border-radius:0}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__close{order:-1;left:-12px}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__header{padding:0 16px 9px;justify-content:flex-start}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__title{margin-left:calc(16px - 2 * 12px)}}@media(max-width: 600px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{height:100%;max-height:100vh;max-width:100vw;width:100vw;border-radius:0}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__close{order:-1;left:-12px}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__header{padding:0 16px 9px;justify-content:flex-start}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__title{margin-left:calc(16px - 2 * 12px)}}@media(min-width: 960px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{width:calc(100vw - 400px)}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__close{right:-12px}}.mdc-dialog.mdc-dialog__scrim--hidden .mdc-dialog__scrim{opacity:0}.mdc-dialog__scrim{opacity:0;z-index:-1}.mdc-dialog__container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;transform:scale(0.8);opacity:0;pointer-events:none}.mdc-dialog__surface{position:relative;display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;max-width:100%;max-height:100%;pointer-events:auto;overflow-y:auto}.mdc-dialog__surface .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}[dir=rtl] .mdc-dialog__surface,.mdc-dialog__surface[dir=rtl]{text-align:right}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-dialog__surface{outline:2px solid windowText}}.mdc-dialog__surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid transparent;border-radius:inherit;content:"";pointer-events:none}@media screen and (-ms-high-contrast: active),screen and (-ms-high-contrast: none){.mdc-dialog__surface::before{content:none}}.mdc-dialog__title{display:block;margin-top:0;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:0 24px 9px}.mdc-dialog__title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mdc-dialog__title,.mdc-dialog__title[dir=rtl]{text-align:right}.mdc-dialog--scrollable .mdc-dialog__title{margin-bottom:1px;padding-bottom:15px}.mdc-dialog--fullscreen .mdc-dialog__header{align-items:baseline;border-bottom:1px solid transparent;display:inline-flex;justify-content:space-between;padding:0 24px 9px;z-index:1}.mdc-dialog--fullscreen .mdc-dialog__header .mdc-dialog__close{right:-12px}.mdc-dialog--fullscreen .mdc-dialog__title{margin-bottom:0;padding:0;border-bottom:0}.mdc-dialog--fullscreen.mdc-dialog--scrollable .mdc-dialog__title{border-bottom:0;margin-bottom:0}.mdc-dialog--fullscreen .mdc-dialog__close{top:5px}.mdc-dialog--fullscreen.mdc-dialog--scrollable .mdc-dialog__actions{border-top:1px solid transparent}.mdc-dialog__content{flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;-webkit-overflow-scrolling:touch}.mdc-dialog__content>:first-child{margin-top:0}.mdc-dialog__content>:last-child{margin-bottom:0}.mdc-dialog__title+.mdc-dialog__content,.mdc-dialog__header+.mdc-dialog__content{padding-top:0}.mdc-dialog--scrollable .mdc-dialog__title+.mdc-dialog__content{padding-top:8px;padding-bottom:8px}.mdc-dialog__content .mdc-deprecated-list:first-child:last-child{padding:6px 0 0}.mdc-dialog--scrollable .mdc-dialog__content .mdc-deprecated-list:first-child:last-child{padding:0}.mdc-dialog__actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;justify-content:flex-end;box-sizing:border-box;min-height:52px;margin:0;padding:8px;border-top:1px solid transparent}.mdc-dialog--stacked .mdc-dialog__actions{flex-direction:column;align-items:flex-end}.mdc-dialog__button{margin-left:8px;margin-right:0;max-width:100%;text-align:right}[dir=rtl] .mdc-dialog__button,.mdc-dialog__button[dir=rtl]{margin-left:0;margin-right:8px}.mdc-dialog__button:first-child{margin-left:0;margin-right:0}[dir=rtl] .mdc-dialog__button:first-child,.mdc-dialog__button:first-child[dir=rtl]{margin-left:0;margin-right:0}[dir=rtl] .mdc-dialog__button,.mdc-dialog__button[dir=rtl]{text-align:left}.mdc-dialog--stacked .mdc-dialog__button:not(:first-child){margin-top:12px}.mdc-dialog--open,.mdc-dialog--opening,.mdc-dialog--closing{display:flex}.mdc-dialog--opening .mdc-dialog__scrim{transition:opacity 150ms linear}.mdc-dialog--opening .mdc-dialog__container{transition:opacity 75ms linear,transform 150ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-dialog--closing .mdc-dialog__scrim,.mdc-dialog--closing .mdc-dialog__container{transition:opacity 75ms linear}.mdc-dialog--closing .mdc-dialog__container{transform:none}.mdc-dialog--open .mdc-dialog__scrim{opacity:1}.mdc-dialog--open .mdc-dialog__container{transform:none;opacity:1}.mdc-dialog--open.mdc-dialog__surface-scrim--shown .mdc-dialog__surface-scrim{opacity:1;z-index:1}.mdc-dialog--open.mdc-dialog__surface-scrim--hiding .mdc-dialog__surface-scrim{transition:opacity 75ms linear}.mdc-dialog--open.mdc-dialog__surface-scrim--showing .mdc-dialog__surface-scrim{transition:opacity 150ms linear}.mdc-dialog__surface-scrim{display:none;opacity:0;position:absolute;width:100%;height:100%}.mdc-dialog__surface-scrim--shown .mdc-dialog__surface-scrim,.mdc-dialog__surface-scrim--showing .mdc-dialog__surface-scrim,.mdc-dialog__surface-scrim--hiding .mdc-dialog__surface-scrim{display:block}.mdc-dialog-scroll-lock{overflow:hidden}#actions:not(.mdc-dialog__actions){display:none}.mdc-dialog__surface{box-shadow:var(--mdc-dialog-box-shadow, 0px 11px 15px -7px rgba(0, 0, 0, 0.2), 0px 24px 38px 3px rgba(0, 0, 0, 0.14), 0px 9px 46px 8px rgba(0, 0, 0, 0.12))}@media(min-width: 560px){.mdc-dialog .mdc-dialog__surface{max-width:560px;max-width:var(--mdc-dialog-max-width, 560px)}}.mdc-dialog .mdc-dialog__scrim{background-color:rgba(0, 0, 0, 0.32);background-color:var(--mdc-dialog-scrim-color, rgba(0, 0, 0, 0.32))}.mdc-dialog .mdc-dialog__title{color:rgba(0, 0, 0, 0.87);color:var(--mdc-dialog-heading-ink-color, rgba(0, 0, 0, 0.87))}.mdc-dialog .mdc-dialog__content{color:rgba(0, 0, 0, 0.6);color:var(--mdc-dialog-content-ink-color, rgba(0, 0, 0, 0.6))}.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__title,.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__actions{border-color:rgba(0, 0, 0, 0.12);border-color:var(--mdc-dialog-scroll-divider-color, rgba(0, 0, 0, 0.12))}.mdc-dialog .mdc-dialog__surface{min-width:280px;min-width:var(--mdc-dialog-min-width, 280px)}.mdc-dialog .mdc-dialog__surface{max-height:var(--mdc-dialog-max-height, calc(100% - 32px))}#actions ::slotted(*){margin-left:8px;margin-right:0;max-width:100%;text-align:right}[dir=rtl] #actions ::slotted(*),#actions ::slotted(*[dir=rtl]){margin-left:0;margin-right:8px}[dir=rtl] #actions ::slotted(*),#actions ::slotted(*[dir=rtl]){text-align:left}.mdc-dialog--stacked #actions{flex-direction:column-reverse}.mdc-dialog--stacked #actions *:not(:last-child) ::slotted(*){flex-basis:.000000001px;margin-top:12px}`;let Ps=class extends Cs{static get styles(){return[Os,at`
    .mdc-dialog .mdc-dialog__content {
      padding: 0;
    }
    .mdc-dialog .mdc-dialog__container,
    .mdc-dialog .mdc-dialog__surface {
      height: var(--mdc-dialog-height, auto)!important;
      width: var(--mdc-dialog-width, auto)!important;
    }
    `]}};Ps=r([Ee("mwc-dialog")],Ps);
/**
 @license
 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
 This code may only be used under the BSD style license found at
 http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
 http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
 found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
 part of the polymer project is also subject to an additional IP rights grant
 found at http://polymer.github.io/PATENTS.txt
 */
const Ls=at`
    /* Most common used flex styles*/
    .layout.horizontal,
    .layout.vertical {
      display: -ms-flexbox;
      display: -webkit-flex;
      display: flex;
    }

    .layout.inline {
      display: -ms-inline-flexbox;
      display: -webkit-inline-flex;
      display: inline-flex;
    }

    .layout.horizontal {
      -ms-flex-direction: row;
      -webkit-flex-direction: row;
      flex-direction: row;
    }

    .layout.vertical {
      -ms-flex-direction: column;
      -webkit-flex-direction: column;
      flex-direction: column;
    }

    .layout.wrap {
      -ms-flex-wrap: wrap;
      -webkit-flex-wrap: wrap;
      flex-wrap: wrap;
    }

    .layout.no-wrap {
      -ms-flex-wrap: nowrap;
      -webkit-flex-wrap: nowrap;
      flex-wrap: nowrap;
    }

    .layout.center,
    .layout.center-center {
      -ms-flex-align: center;
      -webkit-align-items: center;
      align-items: center;
    }

    .layout.center-justified,
    .layout.center-center {
      -ms-flex-pack: center;
      -webkit-justify-content: center;
      justify-content: center;
    }

    .flex {
      -ms-flex: 1 1 0.000000001px;
      -webkit-flex: 1;
      flex: 1;
      -webkit-flex-basis: 0.000000001px;
      flex-basis: 0.000000001px;
    }

    .flex-auto {
      -ms-flex: 1 1 auto;
      -webkit-flex: 1 1 auto;
      flex: 1 1 auto;
    }

    .flex-none {
      -ms-flex: none;
      -webkit-flex: none;
      flex: none;
    }
  `;at`
    .layout.horizontal-reverse,
    .layout.vertical-reverse {
      display: -ms-flexbox;
      display: -webkit-flex;
      display: flex;
    }

    .layout.horizontal-reverse {
      -ms-flex-direction: row-reverse;
      -webkit-flex-direction: row-reverse;
      flex-direction: row-reverse;
    }

    .layout.vertical-reverse {
      -ms-flex-direction: column-reverse;
      -webkit-flex-direction: column-reverse;
      flex-direction: column-reverse;
    }

    .layout.wrap-reverse {
      -ms-flex-wrap: wrap-reverse;
      -webkit-flex-wrap: wrap-reverse;
      flex-wrap: wrap-reverse;
    }
  `;const $s=at`

    /**
     * Alignment in cross axis.
     */
    .layout.start {
      -ms-flex-align: start;
      -webkit-align-items: flex-start;
      align-items: flex-start;
    }

    .layout.center,
    .layout.center-center {
      -ms-flex-align: center;
      -webkit-align-items: center;
      align-items: center;
    }

    .layout.end {
      -ms-flex-align: end;
      -webkit-align-items: flex-end;
      align-items: flex-end;
    }

    .layout.baseline {
      -ms-flex-align: baseline;
      -webkit-align-items: baseline;
      align-items: baseline;
    }

    /**
     * Alignment in main axis.
     */
    .layout.start-justified {
      -ms-flex-pack: start;
      -webkit-justify-content: flex-start;
      justify-content: flex-start;
    }

    .layout.center-justified,
    .layout.center-center {
      -ms-flex-pack: center;
      -webkit-justify-content: center;
      justify-content: center;
    }

    .layout.end-justified {
      -ms-flex-pack: end;
      -webkit-justify-content: flex-end;
      justify-content: flex-end;
    }

    .layout.around-justified {
      -ms-flex-pack: distribute;
      -webkit-justify-content: space-around;
      justify-content: space-around;
    }

    .layout.justified {
      -ms-flex-pack: justify;
      -webkit-justify-content: space-between;
      justify-content: space-between;
    }

    /**
     * Self alignment.
     */
    .self-start {
      -ms-align-self: flex-start;
      -webkit-align-self: flex-start;
      align-self: flex-start;
    }

    .self-center {
      -ms-align-self: center;
      -webkit-align-self: center;
      align-self: center;
    }

    .self-end {
      -ms-align-self: flex-end;
      -webkit-align-self: flex-end;
      align-self: flex-end;
    }

    .self-stretch {
      -ms-align-self: stretch;
      -webkit-align-self: stretch;
      align-self: stretch;
    }

    .self-baseline {
      -ms-align-self: baseline;
      -webkit-align-self: baseline;
      align-self: baseline;
    }

    /**
     * multi-line alignment in main axis.
     */
    .layout.start-aligned {
      -ms-flex-line-pack: start; /* IE10 */
      -ms-align-content: flex-start;
      -webkit-align-content: flex-start;
      align-content: flex-start;
    }

    .layout.end-aligned {
      -ms-flex-line-pack: end; /* IE10 */
      -ms-align-content: flex-end;
      -webkit-align-content: flex-end;
      align-content: flex-end;
    }

    .layout.center-aligned {
      -ms-flex-line-pack: center; /* IE10 */
      -ms-align-content: center;
      -webkit-align-content: center;
      align-content: center;
    }

    .layout.between-aligned {
      -ms-flex-line-pack: justify; /* IE10 */
      -ms-align-content: space-between;
      -webkit-align-content: space-between;
      align-content: space-between;
    }

    .layout.around-aligned {
      -ms-flex-line-pack: distribute; /* IE10 */
      -ms-align-content: space-around;
      -webkit-align-content: space-around;
      align-content: space-around;
    }
  `,Ns=at`
    .flex,
    .flex-1 {
      -ms-flex: 1 1 0.000000001px;
      -webkit-flex: 1;
      flex: 1;
      -webkit-flex-basis: 0.000000001px;
      flex-basis: 0.000000001px;
    }

    .flex-2 {
      -ms-flex: 2;
      -webkit-flex: 2;
      flex: 2;
    }

    .flex-3 {
      -ms-flex: 3;
      -webkit-flex: 3;
      flex: 3;
    }

    .flex-4 {
      -ms-flex: 4;
      -webkit-flex: 4;
      flex: 4;
    }

    .flex-5 {
      -ms-flex: 5;
      -webkit-flex: 5;
      flex: 5;
    }

    .flex-6 {
      -ms-flex: 6;
      -webkit-flex: 6;
      flex: 6;
    }

    .flex-7 {
      -ms-flex: 7;
      -webkit-flex: 7;
      flex: 7;
    }

    .flex-8 {
      -ms-flex: 8;
      -webkit-flex: 8;
      flex: 8;
    }

    .flex-9 {
      -ms-flex: 9;
      -webkit-flex: 9;
      flex: 9;
    }

    .flex-10 {
      -ms-flex: 10;
      -webkit-flex: 10;
      flex: 10;
    }

    .flex-11 {
      -ms-flex: 11;
      -webkit-flex: 11;
      flex: 11;
    }

    .flex-12 {
      -ms-flex: 12;
      -webkit-flex: 12;
      flex: 12;
    }`,Bs=at`
    .block {
      display: block;
    }

    [hidden] {
      display: none !important;
    }

    .invisible {
      visibility: hidden !important;
    }

    .relative {
      position: relative;
    }

    .fit {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
    }

    body.fullbleed {
      margin: 0;
      height: 100vh;
    }

    .scroll {
      -webkit-overflow-scrolling: touch;
      overflow: auto;
    }

    /* fixed position */
    .fixed-bottom,
    .fixed-left,
    .fixed-right,
    .fixed-top {
      position: fixed;
    }

    .fixed-top {
      top: 0;
      left: 0;
      right: 0;
    }

    .fixed-right {
      top: 0;
      right: 0;
      bottom: 0;
    }

    .fixed-bottom {
      right: 0;
      bottom: 0;
      left: 0;
    }

    .fixed-left {
      top: 0;
      bottom: 0;
      left: 0;
    }
  `;let Ds=class extends vt{constructor(){super(),this.fixed=!1,this.narrowLayout=!1,this.scrollable=!1,this.backdrop=!1,this.noclosebutton=!1,this.persistent=!1,this.blockscrolling=!1,this.hideActions=!0,this.open=!1,this.type="normal",this.closeWithConfirmation=!1,this.escapeKeyAction="close"}static get styles(){return[Je,Ls,$s,at`
        mwc-dialog {
          --mdc-dialog-min-width: var(--component-min-width, auto);
          --mdc-dialog-max-width: var(--component-max-width, 100%);
          --mdc-dialog-min-height: var(--component-min-height, auto);
          --mdc-dialog-max-height: var(--component-max-height, calc(100vh - 45px));
          --mdc-dialog-width: var(--component-width, auto);
          --mdc-dialog-height: var(--component-height, auto);
          --mdc-typography-body1-font-family: var(--general-font-family);
          --mdc-typography-body1-font-color: black;
          --mdc-typography-headline6-font-family: var(--general-font-family);
          --mdc-typography-headline6-font-color: black;
          --mdc-shape-medium: 10px;
        }

        mwc-dialog > div.card {
          padding:0;
          margin:0;
        }

        mwc-dialog > div.card > h3 {
          background-color: var(--general-dialog-background-color, #ffffff);
        }

        mwc-dialog.warning h3 {
          color: red;
        }

        mwc-dialog div.content {
          padding: var(--component-padding, 15px);
          font-size: var(--component-font-size, 14px);
          word-break: keep-all;
          overflow-x: hidden;
        }

        mwc-dialog div.footer {
          padding: 5px 15px 15px 15px;
        }

        mwc-dialog[narrow] div.content,
        mwc-dialog[narrow] div.footer {
          padding: 0;
          margin: 0;
        }

        mwc-dialog[scrollable]::slotted([slot="content"]),
        mwc-dialog[scrollable] div.content-area {
          overflow-y: scroll; /* Has to be scroll (not auto) to get smooth scrolling on iOS */
          -webkit-overflow-scrolling: touch;
          max-height: calc(80vh - 127px);
        }

        mwc-dialog div.content h4 {
          font-size: 14px;
          padding: 5px 15px 5px 12px;
          margin: 0 0 10px 0;
          display: block;
          height: 20px;
          border-bottom: 1px solid #DDD !important;
        }
      `]}firstUpdated(){this.open=this.dialog.open,this.persistent&&(this.dialog.scrimClickAction=""),this.dialog.addEventListener("opened",(()=>{this.open=this.dialog.open})),this.dialog.addEventListener("closed",(t=>{if("dialog"===t.target.id&&"action"in t.detail&&"persistent"===t.detail.action?this.show():this.open=this.dialog.open,"dialog"===t.target.id&&"action"in t.detail&&"close"===t.detail.action){const t=new CustomEvent("dialog-closed",{detail:""});this.dispatchEvent(t)}}))}connectedCallback(){super.connectedCallback()}_hideDialog(){this.hide()}show(){this.dialog.show()}hide(){if(this.closeWithConfirmation){const t=new CustomEvent("dialog-closing-confirm",{detail:""});this.dispatchEvent(t)}else this.dialog.close(),this._resetScroll()}_resetScroll(){this.shadowRoot.querySelector(".content-area").scrollTo(0,0)}render(){return D`
      <link rel="stylesheet" href="resources/custom.css">
      <mwc-dialog id="dialog"
                    ?fixed="${this.fixed}"
                    ?narrow="${this.narrowLayout}"
                    ?backdrop="${this.backdrop}"
                    ?persistent="${this.persistent}"
                    ?scrollable="${this.scrollable}"
                    escapeKeyAction="${this.escapeKeyAction}"
                    blockscrolling="${this.blockscrolling}"
                    hideActions="${this.hideActions}"
                    style="padding:0;" class="${this.type}">
        <div elevation="1" class="card" style="margin: 0;padding:0;">
          <h3 class="horizontal justified layout" style="font-weight:bold">
            <span class="vertical center-justified layout"><slot name="title"></slot></span>
            <div class="flex"></div>
            <slot name="action"></slot>
            ${this.noclosebutton?D``:D`
            <mwc-icon-button icon="close" fab flat inverted @click="${()=>this._hideDialog()}">
            </mwc-icon-button>
            `}
          </h3>
          <div class="content content-area">
            <slot name="content"></slot>
          </div>
          <div class="footer horizontal flex layout">
            <slot name="footer"></slot>
          </div>
        </div>
      </mwc-dialog>
      `}};r([xt({type:Boolean})],Ds.prototype,"fixed",void 0),r([xt({type:Boolean})],Ds.prototype,"narrowLayout",void 0),r([xt({type:Boolean})],Ds.prototype,"scrollable",void 0),r([xt({type:Boolean})],Ds.prototype,"backdrop",void 0),r([xt({type:Boolean})],Ds.prototype,"noclosebutton",void 0),r([xt({type:Boolean})],Ds.prototype,"persistent",void 0),r([xt({type:Boolean})],Ds.prototype,"blockscrolling",void 0),r([xt({type:Boolean})],Ds.prototype,"hideActions",void 0),r([xt({type:Boolean})],Ds.prototype,"open",void 0),r([xt({type:String})],Ds.prototype,"type",void 0),r([xt({type:Boolean})],Ds.prototype,"closeWithConfirmation",void 0),r([xt({type:String})],Ds.prototype,"escapeKeyAction",void 0),r([Et("#dialog")],Ds.prototype,"dialog",void 0),Ds=r([_t("backend-ai-dialog")],Ds),$t({loader:t=>fetch(`/resources/i18n/${t}.json`).then((t=>t.json()))});class js extends vt{constructor(){super(),this.active=!1,this.hasLoadedStrings=!1,this.active=!1,this.tasker=globalThis.tasker}get activeConnected(){return this.active&&void 0!==globalThis.backendaiclient&&null!==globalThis.backendaiclient&&!0===globalThis.backendaiclient.ready}get connected(){return void 0!==globalThis.backendaiclient&&null!==globalThis.backendaiclient&&!0===globalThis.backendaiclient.ready}_viewStateChanged(t){}shouldUpdate(){return this.active}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}attributeChangedCallback(t,e,i){"active"==t&&null!==i?(this.active=!0,this._viewStateChanged(!0)):"active"===t&&(this.active=!1,this._viewStateChanged(!1)),super.attributeChangedCallback(t,e,i)}_hideDialog(t){t.target.closest("backend-ai-dialog").hide()}_addInputValidator(t){if(!t.hasAttribute("auto-validate"))return;let e;null===t.validityTransform&&(e=t.getAttribute("error-message")?t.getAttribute("error-message"):t.getAttribute("validationMessage")?t.getAttribute("validationMessage"):Dt("credential.validation.ValidationFailed"),t.validityTransform=(i,r)=>r.valid?{valid:r.valid}:r.patternMismatch?(t.validationMessage=e,{valid:r.valid,patternMismatch:!r.valid}):r.valueMissing?(t.validationMessage=Dt("explorer.ValueRequired"),{valid:r.valid,valueMissing:!r.valid}):r.tooShort?(t.validationMessage=Dt("explorer.InputTooShort"),{valid:r.valid,valueMissing:!r.valid}):(t.validationMessage=e,{valid:r.valid,patternMismatch:!r.valid}))}}r([xt({type:Boolean})],js.prototype,"active",void 0),r([xt({type:Boolean})],js.prototype,"hasLoadedStrings",void 0);let zs=class extends js{constructor(){super(),this.active=!0,this.condition="running",this.jobs=Object(),this.appTemplate=Object(),this.imageInfo=Object(),this._selected_items=[],this.refreshing=!1,this.notification=Object(),this.spinner=Object(),this.refreshTimer=Object(),this.kernel_labels=Object(),this.indicator=Object(),this.sshPort=0,this.vncPort=0,this.xrdpPort=0,this.tensorboardPath="",this.isPathConfigured=!1,this.appLaunchBeforeTunneling=["nniboard","mlflow-ui"],this.appController=Object(),this.openPortToPublic=!1,this.appSupportWithCategory=[],this.appEnvs=Object(),this.appArgs=Object(),this.appSupportList=[],this.appSupportOption=[]}static get styles(){return[Je,Ls,$s,at`
        mwc-icon-button.apps {
          --mdc-icon-button-size: 48px;
          --mdc-icon-size: 36px;
          padding: 3px;
        }

        mwc-icon-button#tensorboard-button {
          background-color: #e9852e;
          color: white;
          --mdc-icon-button-size: 24px;
          --mdc-icon-size: 24px;
          padding: 10px;
          margin-left: 10px;
          border-radius: 10px;
        }

        mwc-textfield#tensorboard-path {
          width: 100%;
          --mdc-text-field-fill-color: transparent;
          --mdc-theme-primary: var(--general-textfield-selected-color);
          --mdc-typography-font-family: var(--general-font-family);
        }

        #ssh-dialog {
          --component-width: 330px;
        }

        .app-icon {
          margin-left: 15px;
          margin-right: 5px;
        }

        .app-icon .label {
          display: block;
          width: 80px;
          text-align: center;
          line-height: 15px;
          height: 25px;
          font-size: 13px;
        }

        #app-launch-confirmation-dialog {
          --component-width: 400px;
          --component-font-size: 14px;
        }
        #tensorboard-dialog {
          --component-width: 400px;
        }

        #app-dialog {
          --component-width: 400px;
        }

        #allowed-client-ips-container {
          margin-left: 2em;
          margin-bottom: 1em;
          display:none;
        }

        mwc-textfield {
          --mdc-shape-small: 14px;
        }

        macro-carousel {
          max-width: 700px;
          height: 450px;
          padding: 0 30px;
          margin: 0 10px;
        }

        .slide {
          display: flex;
          align-items: center;
          justify-content: center;
        }

        .slide > span {
          width: 100%;
          height: 100%;
          display: flex;
          justify-content: center;
          align-items: center;
          background-repeat: no-repeat;
          background-size: contain;
          background-position: top center;
        }

        .slide > p {
          font-size: 14px;
        }

        macro-carousel-pagination-indicator {
          /* Change the dots color */
          --macro-carousel-pagination-color: var(--paper-grey-400);
          /* Change the aspect of the selected dot */
          --macro-carousel-pagination-color-selected: var(--paper-green-400);
          /* Change the dots size */
          --macro-carousel-pagination-size-clickable: 32px;
          --macro-carousel-pagination-size-dot: 10px;
        }

        span.keyboard {
          font-family: Menlo, Courier, "Courier New";
          padding: 20px;
          background-color: var(--paper-grey-200);
          border-radius: 10px;
          margin: 0px 10px;
        }

        span.invert {
          font-size: 26px;
          color: var(--paper-grey-200);
          background-color: transparent;
          margin: 0px 10px;
        }

        span.one-key {
          text-align: center;
          width: 24px;
        }

        mwc-checkbox#hide-guide {
          margin-right: 10px;
        }

        p code {
          font: 12px Monaco, "Courier New", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace;
          color: #52595d;
          -webkit-border-radius: 3px;
          -moz-border-radius: 3px;
          border-radius: 3px;
          -moz-background-clip: padding;
          -webkit-background-clip: padding-box;
          background-clip: padding-box;
          border: 1px solid #cccccc;
          background-color: #f9f9f9;
          padding: 0px 3px;
          display: inline-block;
        }

        @media screen and (max-width: 810px) {
          #terminal-guide {
            --component-width: calc(100% - 50px);
          }
        }
      `]}firstUpdated(){this._initializeAppTemplate(),this.refreshTimer=null,fetch("resources/image_metadata.json").then((t=>t.json())).then((t=>{this.imageInfo=t.imageInfo;for(const t in this.imageInfo)({}).hasOwnProperty.call(this.imageInfo,t)&&(this.kernel_labels[t]=[],"label"in this.imageInfo[t]?this.kernel_labels[t]=this.imageInfo[t].label:this.kernel_labels[t]=[])})),this._createTerminalGuide(),this._createDonotShowOption(),this.notification=globalThis.lablupNotification;this.shadowRoot.querySelector("#hide-guide").addEventListener("change",(t=>{t.target.checked?localStorage.setItem("backendaiwebui.terminalguide","false"):localStorage.setItem("backendaiwebui.terminalguide","true")}))}async _viewStateChanged(t){await this.updateComplete}_initializeAppTemplate(){fetch("resources/app_template.json").then((t=>t.json())).then((t=>{this.appTemplate=t.appTemplate;const e=Object.keys(this.appTemplate);e.sort(((t,e)=>this.appTemplate[t][0].category>this.appTemplate[e][0].category?1:-1)),this.appOrder=e}))}async sendRequest(t){let e,i;try{"GET"==t.method&&(t.body=void 0),e=await fetch(t.uri,t);const r=e.headers.get("Content-Type");if(null===r){if(i=e.ok,!e.ok)throw new Error(e)}else i=r.startsWith("application/json")||r.startsWith("application/problem+json")?await e.json():r.startsWith("text/")?await e.text():await e.blob();if(!e.ok)throw i}catch(t){return e}return i}_getProxyURL(){let t="http://127.0.0.1:5050/";return void 0!==globalThis.__local_proxy?t=globalThis.__local_proxy:void 0!==globalThis.backendaiclient._config.proxyURL&&(t=globalThis.backendaiclient._config.proxyURL),t}showLauncher(t){this._showAppLauncher(t)}_showAppLauncher(t){const e=t["session-uuid"],i=t["access-key"],r=t["app-services"],n="app-services-option"in t?t["app-services-option"]:{};if("runtime"in t){const i={};return i["session-uuid"]=e,i["app-name"]=t.runtime,i["url-postfix"]="",i["file-name"]=t.filename,"jupyter"===i["app-name"]&&(i["url-postfix"]="&redirect=/notebooks/"+i["file-name"]),"arguments"in t&&(i.args=t.arguments),this._runAppWithParameters(i)}this.appSupportList=[],r.includes("ttyd")||this.appSupportList.push({name:"ttyd",title:"Console",category:"0.Default",redirect:"",src:"./resources/icons/terminal.svg"}),r.forEach((t=>{t in this.appTemplate||(this.appTemplate[t]=[],this.appTemplate[t].push({name:t,title:t,category:"99.",redirect:"",src:"./resources/icons/default_app.svg"}))})),r.sort(((t,e)=>this.appTemplate[t][0].category>this.appTemplate[e][0].category?1:-1));let o="";Object.keys(n).length>0&&(this.appSupportOption=n),r.forEach((t=>{t in this.appTemplate?("sshd"!==t||"sshd"===t&&globalThis.isElectron)&&(o!==this.appTemplate[t][0].category&&(this.appSupportList.push({name:this.appTemplate[t][0].category.substring(2),title:this.appTemplate[t][0].category.substring(2),category:"divider",redirect:"",src:""}),o=this.appTemplate[t][0].category),this.appTemplate[t].forEach((t=>{this.appSupportList.push(t)}))):["ttyd","ipython"].includes(t)||this.appSupportList.push({name:t,title:t,category:"Default",redirect:"",src:"./resources/icons/default_app.svg"})})),this.openPortToPublic=globalThis.backendaiclient._config.openPortToPublic,this._toggleChkOpenToPublic();const a=this.shadowRoot.querySelector("#app-dialog");a.setAttribute("session-uuid",e),a.setAttribute("access-key",i),this.shadowRoot.querySelector("#app-dialog").show()}_hideAppLauncher(){this.shadowRoot.querySelector("#app-dialog").hide()}async _resolveV1ProxyUri(t,e){const i={endpoint:globalThis.backendaiclient._config.endpoint};if("SESSION"===globalThis.backendaiclient._config.connectionMode?(i.mode="SESSION",i.session=globalThis.backendaiclient._config._session_id):(i.mode="API",i.access_key=globalThis.backendaiclient._config.accessKey,i.secret_key=globalThis.backendaiclient._config.secretKey),i.api_version=globalThis.backendaiclient.APIMajorVersion,globalThis.isElectron&&void 0===globalThis.__local_proxy)return this.indicator.end(),this.notification.text=Dt("session.launcher.ProxyNotReady"),void this.notification.show();const r={method:"PUT",body:JSON.stringify(i),headers:{Accept:"application/json","Content-Type":"application/json"},uri:this._getProxyURL()+"conf"};this.indicator.set(20,Dt("session.launcher.SettingUpProxyForApp"));const n=await this.sendRequest(r);if(void 0===n)return this.indicator.end(),this.notification.text=Dt("session.launcher.ProxyConfiguratorNotResponding"),void this.notification.show();const o=n.token;return new URL(`proxy/${o}/${t}/add?app=${e}`,this._getProxyURL()).href}async _resolveV2ProxyUri(t,e,i=null,r=null,n=null){const o=await globalThis.backendaiclient.computeSession.startService(t,e,i,r,n);if(void 0===o)return this.indicator.end(),this.notification.text=Dt("session.launcher.ProxyConfiguratorNotResponding"),void this.notification.show();const a=o.token;return new URL(`v2/proxy/${a}/${t}/add?app=${e}`,o.wsproxy_addr).href}async _open_wsproxy(t,e="jupyter",i=null,r=null,n=null){var o;if(void 0===globalThis.backendaiclient||null===globalThis.backendaiclient||!1===globalThis.backendaiclient.ready)return!1;const a=await globalThis.backendaiclient.computeSession.get(["scaling_group"],t);if(void 0===a)return this.indicator.end(),this.notification.text=Dt("session.CreationFailed"),this.notification.show(),Promise.resolve(!1);const s=a.compute_session.scaling_group,l=globalThis.backendaiclient.current_group_id();let d="v1"==(globalThis.isElectron?"v1":(await globalThis.backendaiclient.scalingGroup.getWsproxyVersion(s,l)).wsproxy_version)?await this._resolveV1ProxyUri(t,e):await this._resolveV2ProxyUri(t,e,i,r,n);if(!d)return Promise.resolve(!1);const c=this.shadowRoot.querySelector("#chk-open-to-public"),h=null===(o=this.shadowRoot.querySelector("#allowed-client-ips"))||void 0===o?void 0:o.value;let u=!1;null==c||(u=c.checked,c.checked=!1),null!==i&&i>1024&&i<65535&&(d+=`&port=${i}`),u&&(d+="&open_to_public=true"),u&&(null==h?void 0:h.length)>0&&(d+="&allowed_client_ips="+h.replace(/\s/g,"")),null!==r&&Object.keys(r).length>0&&(d=d+"&envs="+encodeURI(JSON.stringify(r))),null!==n&&Object.keys(n).length>0&&(d=d+"&args="+encodeURI(JSON.stringify(n))),this.indicator.set(50,Dt("session.launcher.AddingKernelToSocketQueue"));const p={method:"GET",app:e,uri:d};return await this.sendRequest(p)}async _close_wsproxy(t,e="jupyter"){if(void 0===globalThis.backendaiclient||null===globalThis.backendaiclient||!1===globalThis.backendaiclient.ready)return!1;const i=globalThis.backendaiclient._config.accessKey,r={method:"GET",app:e,uri:this._getProxyURL()+`proxy/${i}/${t}/delete?app=${e}`,credentials:"include",mode:"cors"};return await this.sendRequest(r)}async _runAppWithParameters(t){const e=t["session-uuid"];let i=t["url-postfix"];const r=t["app-name"];let n=null;if(null!=r)if(null==i&&(i=""),"args"in t&&(n=t.args),"tensorboard"!==r){if(void 0===globalThis.backendaiwsproxy||null===globalThis.backendaiwsproxy){this._hideAppLauncher(),this.indicator=await globalThis.lablupIndicator.start();let t=null;globalThis.isElectron&&"sshd"===r&&(t=globalThis.backendaioptions.get("custom_ssh_port",0),"0"!==t&&0!==t||(t=null)),this._open_wsproxy(e,r,t,null,n).then((async t=>{t.url&&(await this._connectToProxyWorker(t.url,i),this.indicator.set(100,Dt("session.applauncher.Prepared")),setTimeout((()=>{globalThis.open(t.url+i,"_blank")}),1e3))}))}}else this._openTensorboardDialog()}async _connectToProxyWorker(t,e){const i={method:"GET",uri:t+e,mode:"no-cors",redirect:"follow",credentials:"include"};let r=0;for(;r<5;){const t=await this.sendRequest(i);"object"==typeof t&&"status"in t&&[500,501,502].includes(t.status)?(await this._sleep(1e3),r+=1):r=6}}async _sleep(t){return new Promise((e=>setTimeout(e,t)))}async _runThisAppWithConfirmationIfNeeded(t){const e=t.target["app-name"];if(!this.appLaunchBeforeTunneling.includes(e))return this._runThisApp(t);{const e=t.target;this.appController["app-name"]=e["app-name"];const i=e.closest("#app-dialog");this.appController["session-uuid"]=i.getAttribute("session-uuid"),this.appController["url-postfix"]=e["url-postfix"],this._openAppLaunchConfirmationDialog(t)}}async _runThisApp(t){const e=t.target.closest("mwc-icon-button");this.appController["app-name"]=e["app-name"];const i=e.closest("#app-dialog");return this.appController["session-uuid"]=i.getAttribute("session-uuid"),this.appController["url-postfix"]=e["url-postfix"],this._runApp(this.appController)}async _runApp(t){const e=t["app-name"],i=t["session-uuid"];let r=t["url-postfix"];if(null!=e)if(null==r&&(r=""),"tensorboard"!==e){if("ttyd"===e){const t=localStorage.getItem("backendaiwebui.terminalguide");t&&"true"!==t||this._openTerminalGuideDialog()}if(void 0===globalThis.backendaiwsproxy||null===globalThis.backendaiwsproxy){let t;this._hideAppLauncher(),this.indicator=await globalThis.lablupIndicator.start(),globalThis.isElectron&&"sshd"===e&&(t=globalThis.backendaioptions.get("custom_ssh_port",0),"0"!==t&&0!==t||(t=null));const n=this.shadowRoot.querySelector("#chk-preferred-port").checked,o=parseInt(this.shadowRoot.querySelector("#app-port").value);n&&o&&(t=o),this._open_wsproxy(i,e,t,null,null).then((async t=>{await this._connectToProxyWorker(t.url,r),"sshd"===e?(this.indicator.set(100,Dt("session.applauncher.Prepared")),this.sshPort=t.port,this._readSSHKey(i),this._openSSHDialog(),setTimeout((()=>{this.indicator.end()}),1e3)):"vnc"===e?(this.indicator.set(100,Dt("session.applauncher.Prepared")),this.vncPort=t.port,this._openVNCDialog()):"xrdp"===e?(this.indicator.set(100,Dt("session.applauncher.Prepared")),this.xrdpPort=t.port,this._openXRDPDialog()):t.url&&(this.indicator.set(100,Dt("session.applauncher.Prepared")),setTimeout((()=>{globalThis.open(t.url+r,"_blank")}),1e3))}))}}else this._openTensorboardDialog()}async _readSSHKey(t){const e=this.shadowRoot.querySelector("#sshkey-download-link"),i=await globalThis.backendaiclient.download_single(t,"/home/work/id_container"),r=(await i.text()).indexOf("-----"),n=await i.slice(r,i.size,i.type);e.href=globalThis.URL.createObjectURL(n),e.download="id_container"}async runTerminal(t){const e=localStorage.getItem("backendaiwebui.terminalguide");e&&"true"!==e||this._openTerminalGuideDialog(),null!=globalThis.backendaiwsproxy&&null!=globalThis.backendaiwsproxy||(this.indicator=await globalThis.lablupIndicator.start(),this._open_wsproxy(t,"ttyd").then((async t=>{await this._connectToProxyWorker(t.url,""),t.url&&(this.indicator.set(100,Dt("session.applauncher.Prepared")),setTimeout((()=>{globalThis.open(t.url,"_blank"),this.indicator.end()}),1e3))})))}_openAppLaunchConfirmationDialog(t){this.shadowRoot.querySelector("#app-launch-confirmation-dialog").show()}_openSSHDialog(){this.shadowRoot.querySelector("#ssh-dialog").show()}_openVNCDialog(){this.shadowRoot.querySelector("#vnc-dialog").show()}_openXRDPDialog(){this.shadowRoot.querySelector("#xrdp-dialog").show()}_openTensorboardDialog(){this.shadowRoot.querySelector("#tensorboard-dialog").show()}_hideTensorboardDialog(){this.shadowRoot.querySelector("#tensorboard-dialog").hide()}async _addTensorboardPath(t){this.tensorboardPath=this.shadowRoot.querySelector("#tensorboard-path").value;const e=t.target;e.setAttribute("disabled",!0);try{const t=null,i=this.appController["app-name"],r=this.appController["session-uuid"],n=this.appController["url-postfix"];this.indicator=await globalThis.lablupIndicator.start(),this.indicator.set(50,"Shutdown TensorBoard instance if exist..."),await globalThis.backendaiclient.shutdown_service(r,"tensorboard"),this.indicator.set(70,"Clean up TensorBoard proxy..."),await this._close_wsproxy(r,"tensorboard"),this.indicator.set(100,"Proxy is ready."),this.tensorboardPath=""===this.tensorboardPath?"/home/work/logs":this.tensorboardPath;const o={"--logdir":this.tensorboardPath};this._open_wsproxy(r,i,t,null,o).then((async t=>{await this._connectToProxyWorker(t.url,n),this._hideAppLauncher(),this._hideTensorboardDialog(),e.removeAttribute("disabled"),setTimeout((()=>{globalThis.open(t.url+n,"_blank"),console.log(i+" proxy loaded: "),console.log(r)}),1e3)}))}catch(t){e.removeAttribute("disabled")}}_openTerminalGuideDialog(){this.shadowRoot.querySelector("#terminal-guide").show()}_createDonotShowOption(){const t=this.shadowRoot.querySelector("#terminal-guide"),e=t.children[t.children.length-1],i=document.createElement("div");i.setAttribute("class","horizontal layout flex center");const r=document.createElement("mwc-checkbox");r.setAttribute("id","hide-guide");const n=document.createElement("span");n.innerHTML=`${Dt("dialog.hide.DonotShowThisAgain")}`,i.appendChild(r),i.appendChild(n),e.appendChild(i)}_adjustPreferredAppPortNumber(t){const e=t.target.value;e?(e<1025||e>65534)&&(this.shadowRoot.querySelector("#app-port").value=10250):this.shadowRoot.querySelector("#app-port").value=10250}_createTerminalGuide(){const t=this.shadowRoot.querySelector("#terminal-guide").children[1],e=document.createElement("div");e.setAttribute("class","vertical layout flex");let i=globalThis.backendaioptions.get("current_language");["en","ko","ru","fr","mn","id"].includes(i)||(i="en"),e.innerHTML=`\n      <macro-carousel pagination navigation selected="0" auto-focus reduced-motion disable-drag>\n        <article class="slide vertical layout center">\n          <span class="flex" style="background-image:url(/resources/images/web-terminal-guide-1.png); border:none;">\n            <span class="keyboard">Ctrl</span>\n            <span class="keyboard invert">+</span>\n            <span class="keyboard one-key">B</span>\n          </span>\n          <p>${Dt("webTerminalUsageGuide.CopyGuideOne")}</p>\n        </article>\n        <article class="slide vertical layout center">\n          <span style="background-image:url(/resources/images/web-terminal-guide-2.png);"></span>\n          <p>${Dt("webTerminalUsageGuide.CopyGuideTwo")}</p>\n        </article>\n        <article class="slide vertical layout center">\n          <span style="background-image:url(/resources/images/web-terminal-guide-3.png);"></span>\n          <p>${Dt("webTerminalUsageGuide.CopyGuideThree")}</p>\n        </article>\n        <article class="slide vertical layout center">\n          <span style="background-image:url(/resources/images/web-terminal-guide-4.png);">\n            <span class="keyboard">Ctrl</span>\n            <span class="keyboard invert">+</span>\n            <span class="keyboard one-key">B</span>\n          </span>\n          <div class="flex layout center-justified vertical center">\n            <p>${Dt("webTerminalUsageGuide.CopyGuideFour")}</p>\n            <a href="https://console.docs.backend.ai/${i}/latest/sessions_all/sessions_all.html#advanced-web-terminal-usage"\n               target="_blank" style="width:100%;text-align:right;">\n              <p>${Dt("webTerminalUsageGuide.LearnMore")}</p>\n            </a>\n          </div>\n        </article>\n      </macro-carousel>`,t.appendChild(e)}_toggleChkOpenToPublic(){const t=this.shadowRoot.querySelector("#chk-open-to-public"),e=this.shadowRoot.querySelector("#allowed-client-ips-container");t&&e&&(t.checked?e.style.display="block":e.style.display="none")}render(){return D`
      <backend-ai-dialog id="app-dialog" fixed backdrop narrowLayout>
        <div slot="title" class="horizontal layout center">
          <span>App</span>
        </div>
        <div slot="content">
          <div style="padding:15px 0;" class="horizontal layout wrap center start-justified">
            ${this.appSupportList.map((t=>D`
              ${"divider"===t.category?D`
                <h3 style="width:100%;padding-left:15px;border-bottom:1px solid #ccc;">${t.title}</h3>
              `:D`
                <div class="vertical layout center center-justified app-icon">
                  <mwc-icon-button class="fg apps green" .app="${t.name}" .app-name="${t.name}"
                                   .url-postfix="${t.redirect}"
                                   @click="${t=>this._runThisAppWithConfirmationIfNeeded(t)}">
                    <img src="${t.src}"/>
                  </mwc-icon-button>
                  <span class="label">${t.title}</span>
                </div>`}
            `))}
          </div>
          <div style="padding:10px 20px 15px 20px">
            ${globalThis.isElectron||!this.openPortToPublic?"":D`
              <div class="horizontal layout center">
                <mwc-checkbox id="chk-open-to-public" style="margin-right:0.5em;"
                              @change="${this._toggleChkOpenToPublic}"></mwc-checkbox>
                ${ie("session.OpenToPublic")}
              </div>
              <div class="horizontal layout center" id="allowed-client-ips-container">
                ${ie("session.AllowedClientIps")}
                <mwc-textfield id="allowed-client-ips" style="margin-left:1em;" helperPersistent
                               .helper="(${ie("session.CommaSeparated")})"></mwc-textfield>
              </div>
            `}
            <div class="horizontal layout center">
              <mwc-checkbox id="chk-preferred-port" style="margin-right:0.5em;"></mwc-checkbox>
              ${ie("session.TryPreferredPort")}
              <mwc-textfield id="app-port" type="number" no-label-float value="10250"
                             min="1025" max="65534" style="margin-left:1em;width:90px;"
                             @change="${t=>this._adjustPreferredAppPortNumber(t)}"></mwc-textfield>
            </div>
          </div>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="ssh-dialog" fixed backdrop>
        <span slot="title">SSH / SFTP connection</span>
        <div slot="content" style="padding:15px;">
          <div style="padding:15px 0;">${ie("session.SFTPDescription")}</div>
          <section class="vertical layout wrap start start-justified">
            <h4>${ie("session.ConnectionInformation")}</h4>
            <div><span>SSH URL:</span> <a href="ssh://127.0.0.1:${this.sshPort}">ssh://127.0.0.1:${this.sshPort}</a>
            </div>
            <div><span>SFTP URL:</span> <a href="sftp://127.0.0.1:${this.sshPort}">sftp://127.0.0.1:${this.sshPort}</a>
            </div>
            <div><span>Port:</span> ${this.sshPort}</div>
          </section>
        </div>
        <div slot="footer" class="horizontal center-justified flex layout">
          <a id="sshkey-download-link" style="margin-top:15px;width:100%;" href="">
            <mwc-button unelevated fullwidth>${ie("DownloadSSHKey")}</mwc-button>
          </a>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="tensorboard-dialog" fixed>
        <span slot="title">${ie("session.TensorboardPath")}</span>
        <div slot="content" class="vertical layout">
          <div>${ie("session.InputTensorboardPath")}</div>
          <mwc-textfield id="tensorboard-path" value="${ie("session.DefaultTensorboardPath")}"></mwc-textfield>
        </div>
        <div slot="footer" class="horizontal end-justified center flex layout">
          <mwc-button unelevated fullwidth
              icon="rowing" class="bg green" @click="${t=>this._addTensorboardPath(t)}">
            ${ie("session.UseThisPath")}
          </mwc-button>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="argument-dialog" fixed>
        <span slot="title">${ie("session.Arguments")}</span>
        <div slot="content" class="vertical layout" style="padding:15px 10px;">
          <div>${ie("session.ModifyArguments")}</div>
          <mwc-textfield value=""></mwc-textfield>
        </div>
        <div slot="footer" class="horizontal center-justified flex layout">
          <mwc-button unelevated fullwidth class="fg apps green" @click="${t=>this._addTensorboardPath(t)}">
            ${ie("session.UseThisArguments")}
          </mwc-button>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="vnc-dialog" fixed backdrop>
        <span slot="title">${ie("session.VNCconnection")}</span>
        <div slot="content" style="padding:15px;">
          <div style="padding:15px 0;">${ie("session.UseYourFavoriteVNCApp")}</div>
          <section class="vertical layout wrap start start-justified">
            <h4>${ie("session.ConnectionInformation")}</h4>
            <div><span>VNC URL:</span> <a href="ssh://127.0.0.1:${this.vncPort}">vnc://127.0.0.1:${this.vncPort}</a>
            </div>
          </section>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="xrdp-dialog" fixed backdrop>
        <span slot="title">${ie("session.XRDPconnection")}</span>
        <div slot="content" style="padding:15px;">
          <div style="padding:15px 0;">${ie("session.UseYourFavoriteMSTSCApp")}</div>
          <section class="vertical layout wrap start start-justified">
            <h4>${ie("session.ConnectionInformation")}</h4>
            <div><span>RDP URL:</span> <a href="rdp://127.0.0.1:${this.xrdpPort}">rdp://127.0.0.1:${this.xrdpPort}</a>
            </div>
          </section>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="app-launch-confirmation-dialog" warning fixed backdrop>
        <span slot="title">${ie("session.applauncher.AppMustBeRun")}</span>
        <div slot="content" class="vertical layout">
          <p>${ie("session.applauncher.AppMustBeRunDialog")}</p>
          <p>${ie("dialog.ask.DoYouWantToProceed")}</p>
        </div>
        <div slot="footer" class="horizontal center-justified flex layout">
          <mwc-button
            raised
            id="app-launch-confirmation-button"
            icon="rowing"
            label="${ie("session.applauncher.ConfirmAndRun")}"
            fullwidth
            @click="${()=>this._runApp(this.appController)}">
          </mwc-button>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="terminal-guide" fixed backdrop>
        <span slot="title">${ie("webTerminalUsageGuide.CopyGuide")}</span>
        <div slot="content"></div>
        <div slot="footer"></div>
      </backend-ai-dialog>
    `}};r([xt({type:Boolean})],zs.prototype,"active",void 0),r([xt({type:String})],zs.prototype,"condition",void 0),r([xt({type:Object})],zs.prototype,"jobs",void 0),r([xt({type:Array})],zs.prototype,"appSupportList",void 0),r([xt({type:Array})],zs.prototype,"appSupportOption",void 0),r([xt({type:Object})],zs.prototype,"appTemplate",void 0),r([xt({type:Object})],zs.prototype,"imageInfo",void 0),r([xt({type:Array})],zs.prototype,"_selected_items",void 0),r([xt({type:Boolean})],zs.prototype,"refreshing",void 0),r([xt({type:Object})],zs.prototype,"notification",void 0),r([xt({type:Object})],zs.prototype,"spinner",void 0),r([xt({type:Object})],zs.prototype,"refreshTimer",void 0),r([xt({type:Object})],zs.prototype,"kernel_labels",void 0),r([xt({type:Object})],zs.prototype,"indicator",void 0),r([xt({type:Number})],zs.prototype,"sshPort",void 0),r([xt({type:Number})],zs.prototype,"vncPort",void 0),r([xt({type:Number})],zs.prototype,"xrdpPort",void 0),r([xt({type:String})],zs.prototype,"tensorboardPath",void 0),r([xt({type:Boolean})],zs.prototype,"isPathConfigured",void 0),r([xt({type:Array})],zs.prototype,"appLaunchBeforeTunneling",void 0),r([xt({type:Object})],zs.prototype,"appController",void 0),r([xt({type:Object})],zs.prototype,"openPortToPublic",void 0),r([xt({type:Array})],zs.prototype,"appOrder",void 0),r([xt({type:Array})],zs.prototype,"appSupportWithCategory",void 0),r([xt({type:Object})],zs.prototype,"appEnvs",void 0),r([xt({type:Object})],zs.prototype,"appArgs",void 0),zs=r([_t("backend-ai-app-launcher")],zs);let Fs=class extends js{constructor(){super(),this.options=Object()}_readRecentProjectGroup(){const t=globalThis.backendaiclient._config.endpointHost.replace(/\./g,"_"),e=globalThis.backendaioptions.get("projectGroup."+t);return e?globalThis.backendaiclient.groups.length>0&&globalThis.backendaiclient.groups.includes(e)?e:(this._deleteRecentProjectGroupInfo(),globalThis.backendaiclient.current_group):globalThis.backendaiclient.current_group}_writeRecentProjectGroup(t){const e=globalThis.backendaiclient._config.endpointHost.replace(/\./g,"_");globalThis.backendaioptions.set("projectGroup."+e,t||globalThis.backendaiclient.current_group)}_deleteRecentProjectGroupInfo(){const t=globalThis.backendaiclient._config.endpointHost.replace(/\./g,"_");globalThis.backendaioptions.delete("projectGroup."+t)}_humanReadableFileSize(t,e=2){if(0===t)return"0 Bytes";const i=Math.pow(2,10),r=e<0?0:e;let n=Math.floor(Math.log(t)/Math.log(i));return n=n<0?0:n,parseFloat((t/Math.pow(i,n)).toFixed(r))+" "+["Bytes","KiB","MiB","GiB","TiB","PiB"][n]}_maskString(t="",e="*",i=0,r=0){return r=i+r>t.length?t.length:r,t.substring(0,i)+e.repeat(r)+t.substring(i+r,t.length)}deleteNestedKeyFromObject(t,e,i="."){if(!t||t.constructor!==Object||!e)return t;const r=e.split(i),n=r.pop();return n&&delete r.reduce(((t,e)=>t[e]),t)[n],t}mergeNestedObjects(t,e){if(!t||!e)return t||e||{};return[t,e].reduce((function t(e,i){return Object.entries(i).reduce(((e,[i,r])=>(e[i]=r&&r.constructor===Object?t(e[i]=e[i]||(Array.isArray(r)?[]:{}),r):r,e)),e)}),{})}render(){return D`
    `}};r([xt({type:Object})],Fs.prototype,"options",void 0),Fs=r([_t("backend-ai-common-utils")],Fs);var Us=Fs;let qs=class extends js{constructor(){super(),this.lang="default",this.manualURL="",this.disabled=!1,this.URLmatchingTable={"":"summary/summary.html",summary:"summary/summary.html",job:"sessions_all/sessions_all.html",import:"import_run/import_run.html",data:"vfolder/vfolder.html",statistics:"statistics/statistics.html",credential:"admin_menu/admin_menu.html",environment:"admin_menu/admin_menu.html#manage-images",agent:"admin_menu/admin_menu.html#query-agent-nodes",settings:"admin_menu/admin_menu.html#system-settings",mainetenance:"admin_menu/admin_menu.html#server-management",information:"admin_menu/admin_menu.html#detailed-information",usersettings:"user_settings/user_settings.html"}}static get styles(){return[at`
    mwc-icon-button {
      color: white;
    }
    `]}firstUpdated(){this.currentPage}connectedCallback(){super.connectedCallback()}get currentPage(){const t=globalThis.location.toString().split(/[/]+/).pop();return void 0===this.page?this.page="error":this.page=t,this.page}showHelpPage(){let t="";if(""!==this.manualURL)t=this.manualURL;else if(this.currentPage in this.URLmatchingTable){t=this.URLmatchingTable[this.currentPage];const e=globalThis.backendaioptions.get("current_language");["ko","en"].includes(e)?this.lang=e:this.lang="en"}this.showOnlineHelpPage(t)}showOnlineHelpPage(t){window.open(`https://webui.docs.backend.ai/${this.lang}/latest/`+t,"_blank")}render(){return D`
      <mwc-icon-button id="help-page-button" icon="help_outline" @click="${()=>this.showHelpPage()}"></mwc-icon-button>
    `}};r([xt({type:String})],qs.prototype,"lang",void 0),r([xt({type:String})],qs.prototype,"manualURL",void 0),r([xt({type:String})],qs.prototype,"page",void 0),r([xt({type:Boolean})],qs.prototype,"disabled",void 0),r([xt({type:Object})],qs.prototype,"URLmatchingTable",void 0),qs=r([_t("backend-ai-help-button")],qs);var Hs;!function(t){t.SMALL="small",t.MEDIUM="medium",t.LARGE="large",t.AUTO="auto",t.FULLSCREEN="fullscreen"}(Hs||(Hs={})),Hs.MEDIUM;let Vs=class extends za{constructor(){super(...arguments),this.scrollable=!1,this.role="dialog"}get $focusTrap(){return this.$dialog}animateIn(){let t=!1;const e=()=>{t||(t=!0,this.didShow())},i=this.$dialog.animate([{transform:"scale(0.9) translate(0, 30px)",opacity:"0"},{transform:"scale(1) translate(0, 0)",opacity:"1"}],this.animationConfig),r=this.$backdrop.animate([{opacity:"0"},{opacity:"1"}],this.animationConfig);i.onfinish=e,r.onfinish=e,this.activeInAnimations.push(i,r)}animateOut(t){let e=!1;const i=()=>{e||(e=!0,this.resolve(t),this.didHide(t))},r=this.$dialog.animate([{transform:"translateY(0)",opacity:"1"},{transform:"translateY(30px)",opacity:"0"}],this.animationConfig),n=this.$backdrop.animate([{opacity:"1"},{opacity:"0"}],this.animationConfig);r.onfinish=i,n.onfinish=i,this.activeOutAnimations.push(r,n)}render(){return Co` <wl-backdrop id="backdrop" @click="${this.clickAway}"></wl-backdrop> <focus-trap id="dialog" ?inactive="${!this.open||this.disableFocusTrap}"> <slot name="header"></slot> <slot name="content"></slot> <slot></slot> <slot name="footer"></slot> </focus-trap> `}};Vs.styles=[...za.styles,ea(":host{--_dialog-width:var(--dialog-width,auto);--_dialog-height:var(--dialog-height,auto);text-align:left;display:none;position:relative;outline:none}:host([scrollable]) #dialog{overflow:hidden}:host([scrollable]) ::slotted([slot=header]){padding:var(--dialog-header-padding-scrollable,1.5rem);border-bottom:var(--dialog-scrollable-border,.0625rem solid hsl(var(--shade-400,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,65%))))}:host([scrollable]) ::slotted([slot=footer]){border-top:var(--dialog-scrollable-border,.0625rem solid hsl(var(--shade-400,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,65%))))}:host([scrollable]) ::slotted([slot=content]){overflow-y:scroll;-webkit-overflow-scrolling:touch}:host([open]){display:flex;align-items:center;justify-content:center}::slotted([slot=header]){--h-margin:0;padding:var(--dialog-header-padding,1.5rem 1.5rem 0);margin:0;flex-shrink:0}::slotted([slot=footer]){padding:var(--dialog-footer-padding,.75rem);display:flex;align-items:center;justify-content:flex-end;flex-shrink:0}::slotted([slot=content]){padding:var(--dialog-content-padding,1.5rem);flex-grow:1}:host([fixed]){z-index:var(--dialog-z-index,1234567);will-change:transform,opacity;position:fixed;top:0;left:0;width:100%;height:100%}:host([fixed]) #dialog{min-width:var(--dialog-min-width,260px);min-height:var(--dialog-min-height,auto);max-width:var(--dialog-max-width,100vw);max-height:var(--dialog-max-height,100vh)}:host([size=small][fixed]){--_dialog-width:var(--dialog-width-s,40%);--_dialog-height:var(--dialog-height-s,40%)}:host([size=medium][fixed]){--_dialog-width:var(--dialog-width-m,50%);--_dialog-height:var(--dialog-height-m,50%)}:host([size=large][fixed]){--_dialog-width:var(--dialog-width-l,60%);--_dialog-height:var(--dialog-height-l,60%)}:host([size=auto][fixed]){--_dialog-width:var(--dialog-width-auto,auto);--_dialog-height:var(--dialog-height-auto,auto)}:host([size=fullscreen][fixed]){--_dialog-width:var(--dialog-width-fullscreen,100%);--_dialog-height:var(--dialog-height-fullscreen,100%)}:host([size=fullscreen][fixed]) #dialog{border-radius:0}#dialog{width:var(--_dialog-width);height:var(--_dialog-height);box-shadow:var(--dialog-elevation,var(--elevation-4,0 .5rem 1rem -.125rem hsla(var(--shadow,var(--shadow-hue,230),var(--shadow-saturation,70%),var(--shadow-lightness,5%)),.15)));border-radius:var(--dialog-border-radius,.5rem);background:var(--dialog-bg,hsl(var(--background,var(--background-hue,0),var(--background-saturation,0%),var(--background-lightness,100%))));color:var(--dialog-color,hsl(var(--foreground,var(--foreground-hue,230),var(--foreground-saturation,70%),var(--foreground-lightness,5%))));padding:0;margin:0;outline:none;display:flex;flex-direction:column;align-items:stretch;border:none;overflow-y:auto;overscroll-behavior:contain;position:relative;z-index:1}")],r([Vo({type:String,reflect:!0}),n("design:type",String)],Vs.prototype,"size",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],Vs.prototype,"scrollable",void 0),r([Vo({type:String,reflect:!0}),n("design:type",String)],Vs.prototype,"role",void 0),r([Wo("#dialog"),n("design:type",Ma)],Vs.prototype,"$dialog",void 0),r([Wo("#backdrop"),n("design:type",ka)],Vs.prototype,"$backdrop",void 0),Vs=r([qo("wl-dialog")],Vs);let Ws=class extends ta{constructor(){super(...arguments),this.role="separator",this.vertical=!1}render(){return Co` <slot></slot> `}};Ws.styles=[ea(":host{background:var(--divider-color,rgba(0,0,0,.15));height:var(--divider-size,.0625rem);display:block;width:100%}:host([vertical]){width:var(--divider-size,.0625rem);height:100%}"),Na],r([Vo({type:String,reflect:!0}),n("design:type",String)],Ws.prototype,"role",void 0),r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],Ws.prototype,"vertical",void 0),Ws=r([qo("wl-divider")],Ws);let Gs=class extends ta{constructor(){super(...arguments),this.role="banner"}render(){return Co` <div id="content"> <slot name="icon"></slot> <slot></slot> </div> <div id="actions"> <slot name="action"></slot> </div> <wl-divider id="divider"></wl-divider> `}};Gs.styles=[Na,ea(":host{padding:var(--banner-padding,.375rem);color:var(--banner-color,hsl(var(--foreground,var(--foreground-hue,230),var(--foreground-saturation,70%),var(--foreground-lightness,5%))));background:var(--banner-bg,hsl(var(--background,var(--background-hue,0),var(--background-saturation,0%),var(--background-lightness,100%))));flex-wrap:wrap;justify-content:flex-end;text-align:left;position:relative}#actions,#content,:host{display:flex;align-items:center;flex-wrap:wrap}::slotted([slot=icon]){margin:var(--banner-icon-margin,0 .75rem 0 0);color:var(--banner-icon-color,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))))}#content{padding:var(--banner-content-padding,.375rem .75rem);flex-grow:1}#divider{position:absolute;left:0;bottom:0;width:100%}")],r([Vo({type:String,reflect:!0}),n("design:type",String)],Gs.prototype,"role",void 0),Gs=r([qo("wl-banner")],Gs);let Ks=class extends cs{render(){return Co`
			${this.bufferPerc>0?Co`
						<div id="buffer" style="transform: scaleX(${this.bufferPerc})"></div>
				  `:""}
			<div id="progress" style="${this.mode===ds.DETERMINATE?`transform: scaleX(${this.progressPerc})`:""}">
				<div id="before"></div>
				<div id="after"></div>
			</div>
		`}};Ks.styles=[...cs.styles,ea(":host{height:var(--progress-bar-height,.25rem);background:var(--progress-bar-bg,hsl(var(--shade-300,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,75%))));contain:strict;position:relative;display:block;overflow:hidden}#progress{background:var(--progress-bar-color,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))))}#buffer{background:var(--progress-bar-buffer-color,hsla(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%)),.5))}:host([mode=indeterminate]) #progress #after,:host([mode=indeterminate]) #progress #before{background-color:inherit;position:absolute;height:100%;left:0;top:0;bottom:0;animation-duration:var(--progress-bar-indeterminate-duration,2.1s);animation-timing-function:var(--progress-bar-indeterminate-timing-function,var(--transition-timing-function-standard-curve,cubic-bezier(.4,0,.2,1)));animation-iteration-count:infinite}:host([mode=indeterminate]) #progress #before{animation-name:indeterminate}:host([mode=indeterminate]) #progress #after{animation-name:indeterminate-short;animation-delay:var(--progress-bar-indeterminate-short-delay,1.15s)}#buffer,:host([mode=determinate]) #progress{transition:var(--progress-bar-determinate-transition,transform var(--transition-timing-function-linear,linear));transform-origin:top left;position:absolute;top:0;left:0;height:100%;width:100%}@keyframes indeterminate{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@keyframes indeterminate-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}")],Ks=r([qo("wl-progress-bar")],Ks);let Xs=class extends ta{constructor(){super(...arguments),this.level=1,this.nowrap=!1,this.role="heading"}updated(t){super.updated(t),t.has("level")&&ia(this,{"aria-level":this.level})}render(){return Co` <slot></slot> `}};Xs.styles=[Na,ea(':host{margin:var(--title-margin,0 0 .2em);font-family:var(--title-font-family,var(--font-family-sans-serif,"Roboto Condensed",helvetica,sans-serif));font-weight:var(--title-font-weight,var(--font-weight-bold,800));line-height:var(--title-line-height,var(--line-height-m,1.5em));display:block}:host([nowrap]){white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;line-height:1.1}:host([level="1"]){font-size:var(--title-font-size-level-1,1.875rem)}:host([level="2"]){font-size:var(--title-font-size-level-2,1.5625rem)}:host([level="3"]){font-size:var(--title-font-size-level-3,1.25rem)}:host([level="4"]){font-size:var(--title-font-size-level-4,1rem)}:host([level="5"]){font-size:var(--title-font-size-level-5,.75rem)}:host([level="6"]){font-size:var(--title-font-size-level-6,.5rem)}')],r([Vo({type:Number,reflect:!0}),n("design:type",Number)],Xs.prototype,"level",void 0),r([Vo({type:Boolean}),n("design:type",Boolean)],Xs.prototype,"nowrap",void 0),r([Vo({type:String,reflect:!0}),n("design:type",String)],Xs.prototype,"role",void 0),Xs=r([qo("wl-title")],Xs);let Ys=class extends vt{constructor(){super(),this.value=0,this.delay=1e3,this.text="",this.mode="determinate"}static get styles(){return[at`
        wl-dialog {
          position: fixed;
          right: 20px;
          bottom: 20px;
          z-index: 9000;
          --dialog-height: 80px;
          --dialog-width: 250px;
          --dialog-content-padding: 15px;
        }
      `]}firstUpdated(){this.dialog=this.shadowRoot.querySelector("#app-progress-dialog")}connectedCallback(){super.connectedCallback()}async start(t="determinate"){this.value=0,this.mode=t,await this.updateComplete,this.dialog.show()}set(t,e=""){this.value=t/100,this.text=e,this.value>=1&&this.end(this.delay)}end(t=1e3){0!==t&&(this.delay=t),setTimeout((()=>{this.dialog.hide()}),t)}render(){return D`
      <wl-dialog id="app-progress-dialog" blockscrolling>
        <wl-title level="5" id="app-progress-text" slot="header">${this.text}</wl-title>
        <div slot="content">
        <wl-progress-bar .mode="${this.mode}" id="app-progress" .value="${this.value}"></wl-progress-bar>
        </div>
      </wl-dialog>
    `}};r([xt({type:Number})],Ys.prototype,"value",void 0),r([xt({type:Number})],Ys.prototype,"delay",void 0),r([xt({type:String})],Ys.prototype,"text",void 0),r([xt({type:String})],Ys.prototype,"mode",void 0),r([xt({type:Object})],Ys.prototype,"dialog",void 0),Ys=r([_t("backend-ai-indicator")],Ys);let Zs=class extends vt{constructor(){super(),this.value=0,this.step=0,this.text="",this.mode="determinate",this.pool=[]}static get styles(){return[]}firstUpdated(){this.dialog=this.shadowRoot.querySelector("#app-progress-dialog")}connectedCallback(){super.connectedCallback()}async start(t="determinate"){this.gc();const e=document.createElement("backend-ai-indicator");return e.value=0,e.text=Dt("notification.Initializing"),e.mode=t,e.style.bottom=20+90*this.step+"px",document.body.appendChild(e),this.pool.push(e),this.step=this.pool.length,await this.updateComplete,await e.start(),e}removeIndicator(t){const e=this.pool.filter((e=>e===t));if(e.length>0){const t=this.pool.indexOf(e[0]);t>-1&&this.pool.splice(t,1),document.body.removeChild(e[0]),e[0].remove(),console.log("deleted")}}gc(){const t=[];this.pool.forEach((e=>{console.log(e.value),e.value>=1&&t.push(e)})),t.forEach((t=>{setTimeout((()=>{this.removeIndicator(t)}),t.delay+500)}))}render(){return D`
    `}};r([xt({type:Number})],Zs.prototype,"value",void 0),r([xt({type:Number})],Zs.prototype,"step",void 0),r([xt({type:String})],Zs.prototype,"text",void 0),r([xt({type:String})],Zs.prototype,"mode",void 0),r([xt({type:Object})],Zs.prototype,"dialog",void 0),r([xt({type:Array})],Zs.prototype,"pool",void 0),Zs=r([_t("backend-ai-indicator-pool")],Zs);let Js=class extends vt{constructor(){super(),this.app="",this.description="",this.color="green",this.appColor="grey",this.ui="flat"}static get styles(){return[Ls,$s,Ns,Bs,at`
        .text {
          font-family: 'DejaVu Sans', Verdana, Geneva, sans-serif;
          font-size: 11px;
          line-height: 11px;
          padding: 4px;
          display: block;
          color: #ffffff;
        }

        .round {
          border-radius: 4px;
        }
        .round-left {
          border-top-left-radius: 4px;
          border-bottom-left-radius: 4px;
        }
        .round-right {
          border-top-right-radius: 4px;
          border-bottom-right-radius: 4px;
        }
      `]}get _colorScheme(){return{brightgreen:{colorB:"#44cc11",colorT:"#222222"},lightgreen:{colorB:"#f3f5d0",colorT:"#222222"},green:{colorB:"#97ca00"},darkgreen:{colorB:"#457b3b"},yellow:{colorB:"#dfb317"},yellowgreen:{colorB:"#a4a61d"},orange:{colorB:"#fe7d37"},red:{colorB:"#e05d44"},blue:{colorB:"#007ec6"},purple:{colorB:"#ab47bc"},lightblue:{colorB:"#caedfc",colorT:"#222222"},grey:{colorB:"#555555"},gray:{colorB:"#555555"},lightgrey:{colorB:"#9f9f9f"},lightgray:{colorB:"#9f9f9f"}}}render(){return D`
      <div class="shields layout horizontal flex">
        <div id="app" class="app horizontal layout center">
          <slot name="app-icon"></slot>
          <span id="app-text" class="text app-text">${this.app}</span></div>
        <div id="description" class="desc horizontal layout center">
          <slot name="desc-icon"></slot>
          <span id="desc-text" class="text desc-text">${this.description}</span></div>
      </div>
    `}firstUpdated(){this._colorChanged(),this._appColorChanged(),this._formatItem(),this._descriptionChanged(),""==this.app&&(this.shadowRoot.querySelector("#app-text").style.display="none")}connectedCallback(){super.connectedCallback()}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),"app"==t&&(this.app=i,this._appChanged()),"description"==t&&(this.description=i,this._descriptionChanged())}updated(t){t.has("color")&&this._colorChanged(),t.has("appColor")&&this._appColorChanged()}_classChanged(){this._formatItem()}_colorChanged(){this._colorScheme[this.color]&&(this.shadowRoot.querySelector(".desc").style.backgroundColor=this._colorScheme[this.color].colorB,this._colorScheme[this.color].colorT&&(this.shadowRoot.querySelector(".desc-text").style.color=this._colorScheme[this.color].colorT))}_appColorChanged(){this._colorScheme[this.appColor]?(this.shadowRoot.querySelector(".app").style.backgroundColor=this._colorScheme[this.appColor].colorB,this._colorScheme[this.appColor].colorT&&(this.shadowRoot.querySelector(".app-text").style.color=this._colorScheme[this.appColor].colorT)):this.shadowRoot.querySelector(".app").style.backgroundColor="#555"}async _appChanged(){await this.updateComplete,void 0===this.app||"undefined"==this.app||""===this.app?this.shadowRoot.querySelector("#app").style.display="none":this.shadowRoot.querySelector("#app").style.display="block"}async _descriptionChanged(){await this.updateComplete,void 0===this.description||"undefined"==this.description||""===this.description?this.shadowRoot.querySelector("#description").style.display="none":this.shadowRoot.querySelector("#description").style.display="block"}_formatItem(){["round"].indexOf(this.ui)>=0&&(this.shadowRoot.querySelector(".shields").classList.add(this.ui),void 0===this.description||"undefined"==this.description||""===this.description?void 0===this.app||"undefined"==this.app||""===this.app||this.shadowRoot.querySelector("#app").classList.add(this.ui):void 0===this.app||"undefined"==this.app||""===this.app?this.shadowRoot.querySelector("#description").classList.add(this.ui):(this.shadowRoot.querySelector("#app").classList.add(this.ui+"-left"),this.shadowRoot.querySelector("#description").classList.add(this.ui+"-right")))}};r([xt({type:String})],Js.prototype,"app",void 0),r([xt({type:String})],Js.prototype,"description",void 0),r([xt({type:String})],Js.prototype,"color",void 0),r([xt({type:String})],Js.prototype,"appColor",void 0),r([xt({type:String})],Js.prototype,"ui",void 0),Js=r([_t("lablup-shields")],Js);var Qs;!function(t){t.CHANGE="change"}(Qs||(Qs={}));class tl extends bs{constructor(){super(...arguments),this.checked=!1,this.ariaChecked=this.checked.toString(),this.role="checkbox",this.formElementType="checkbox"}firstUpdated(t){super.firstUpdated(t),this.onClick=this.onClick.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.attachListeners()}updated(t){super.updated(t),this.updateAria(t)}updateAria(t){t.has("checked")&&(this.ariaChecked=this.checked.toString())}attachListeners(){this.listeners.push(ha(this,"click",this.onClick.bind(this)),ha(this,"keydown",this.onKeyDown.bind(this)))}onClick(t){this.disabled?pa(t):this.toggle()}toggle(){this.checked=!this.checked,this.dispatchChangeEvent()}dispatchChangeEvent(){requestAnimationFrame((()=>{this.dispatchEvent(new CustomEvent(Qs.CHANGE,{composed:!0,bubbles:!0,detail:this.checked}))}))}onKeyDown(t){"Space"!==t.code&&"Enter"!==t.code||(this.click(),pa(t))}renderFormElement(){return Co` <input style="display: none;" id="${this.formElementId}" type="${this.formElementType}" ?checked="${this.checked}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" .value="${this.value}" name="${gs(this.name)}" aria-hidden="true" tabindex="-1"> `}}tl.styles=[...bs.styles,ea("")],r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],tl.prototype,"checked",void 0),r([Vo({type:String,reflect:!0,attribute:"aria-checked"}),n("design:type",String)],tl.prototype,"ariaChecked",void 0),r([Vo({type:String,reflect:!0}),n("design:type",String)],tl.prototype,"role",void 0);class el extends tl{constructor(){super(...arguments),this.indeterminate=!1}toggle(){this.indeterminate&&(this.indeterminate=!1),this.checked=!this.checked,this.dispatchChangeEvent()}updateAria(t){(t.has("checked")||t.has("indeterminate"))&&(this.ariaChecked=this.indeterminate?"mixed":this.checked.toString())}}el.styles=[...tl.styles,ea("")],r([Vo({type:Boolean,reflect:!0}),n("design:type",Boolean)],el.prototype,"indeterminate",void 0);let il=class extends el{render(){return Co` <svg id="checkmark" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" preserveAspectRatio="none" viewBox="0 0 24 24"> <path id="checkmark-path" fill="none" d="M1.73,12.91 8.1,19.28 22.79,4.59"></path> <line id="indeterminate-path" fill="none" x1="0" y1="12.5" x2="24" y2="12.5"/> </svg> <wl-ripple id="ripple" .target="${this}" focusable overlay unbounded centered initialDuration="200"></wl-ripple> <slot></slot> ${this.renderFormElement()} `}};il.styles=[...tl.styles,ea(":host{--_checkbox-bg:var(--checkbox-bg,transparent);--_checkbox-color:var(--checkbox-color,hsl(var(--shade-500,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,55%))));background:var(--_checkbox-bg);color:var(--_checkbox-color);width:var(--checkbox-size,1.25rem);height:var(--checkbox-size,1.25rem);border:var(--checkbox-border-config,.125rem solid) currentColor;border-radius:var(--checkbox-border-radius,.375rem);transition:var(--checkbox-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),border-color var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));position:relative;display:inline-flex;align-items:center;justify-content:center;outline:none;-webkit-user-select:none;user-select:none}:host(:not([disabled])){cursor:pointer}:host([checked]),:host([indeterminate]){--_checkbox-bg:var(--checkbox-bg-checked,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))));--_checkbox-color:var(--checkbox-color-checked,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))))}:host([checked]:not([indeterminate])) #checkmark-path,:host([indeterminate]) #indeterminate-path{stroke-dashoffset:0}:host(:focus),:host(:hover){will-change:border,background}:host(:focus) #checkmark-path,:host(:hover) #checkmark-path{will-change:stroke-dashoffset}:host([disabled]){--_checkbox-bg:var(--checkbox-bg-disabled,transparent);--_checkbox-color:var(--checkbox-color-disabled,hsl(var(--shade-400,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,65%))));pointer-events:none}:host([disabled][checked]),:host([disabled][indeterminate]){--_checkbox-bg:var(--checkbox-bg-disabled-checked,hsl(var(--shade-500,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,55%))));--_checkbox-color:var(--checkbox-color-disabled-checked,hsl(var(--shade-500,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,55%))))}#checkmark{width:var(--checkbox-checkmark-size,.75rem);height:var(--checkbox-checkmark-size,.75rem)}#checkmark-path,#indeterminate-path{stroke-width:var(--checkbox-checkmark-path-width,.1875rem);stroke:var(--checkbox-checkmark-stroke-color,hsl(var(--primary-500-contrast,var(--primary-hue-contrast,0),var(--primary-saturation-contrast,100%),var(--primary-lightness-contrast,100%))));stroke-dasharray:var(--checkbox-checkmark-path-dasharray,30);stroke-dashoffset:var(--checkbox-checkmark-path-dasharray,30);transition:var(--checkbox-checkmark-transition,stroke-dashoffset var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)))}#checkmark-path{transition-delay:var(--checkbox-checkmark-path-delay,50ms)}#ripple{transform:var(--checkbox-ripple-transform,translate(-50%,-50%) scale(1.8))}")],il=r([qo("wl-checkbox")],il);class rl{static relieve(t){if(void 0===t)return"Problem occurred.";if(console.log("Error:",t),!0===globalThis.backendaiwebui.debug)return t;if({}.hasOwnProperty.call(this.errorMessageTable,t))return Dt(this.errorMessageTable[t]);for(const e of Object.keys(this.regexTable))if(RegExp(e).test(t))return Dt(this.regexTable[e]);return t}}rl.errorMessageTable={"Cannot read property 'map' of null":"error.APINotSupported","TypeError: NetworkError when attempting to fetch resource.":"error.NetworkConnectionFailed","Login failed. Check login information.":"error.LoginFailed","User credential mismatch.":"error.LoginFailed","Authentication failed. Check information and manager status.":"error.AuthenticationFailed","Too many failed login attempts":"error.TooManyLoginFailures","server responded failure: 400 Bad Request - The virtual folder already exists with the same name.":"error.VirtualFolderAlreadyExist","400 Bad Request - The virtual folder already exists with the same name.":"error.VirtualFolderAlreadyExist","server responded failure: 400 Bad Request - One of your accessible vfolders already has the name you requested.":"error.VirtualFolderAlreadyExist","server responded failure: 400 Bad Request - You cannot create more vfolders.":"error.MaximumVfolderCreation","server responded failure: 400 Bad Request - Missing or invalid API parameters. (You cannot create more vfolders.)":"error.MaximumVfolderCreation","server responded failure: 400 Bad Request - Cannot change the options of a vfolder that is not owned by myself.":"error.CannotChangeVirtualFolderOption","server responded failure: 412 Precondition Failed - You have reached your resource limit.":"error.ReachedResourceLimit","Cannot read property 'split' of undefined":"error.UserHasNoGroup"},rl.regexTable={"\\w*not found matched token with email\\w*":"error.InvalidSignupToken","\\w*Access key not found\\w*":"error.LoginInformationMismatch","\\w*401 Unauthorized - Credential/signature mismatch\\w*":"error.LoginInformationMismatch",'integrity error: duplicate key value violates unique constraint "pk_resource_presets"[\\n]DETAIL:  Key \\(name\\)=\\([\\w]+\\) already exists.[\\n]':"error.ResourcePolicyAlreadyExist",'integrity error: duplicate key value violates unique constraint "pk_scaling_groups"[\\n]DETAIL:  Key \\(name\\)=\\([\\w]+\\) already exists.[\\n]':"error.ScalingGroupAlreadyExist",'integrity error: duplicate key value violates unique constraint "uq_users_username"[\\n]DETAIL:  Key \\(username\\)=\\([\\w]+\\) already exists.[\\n]':"error.UserNameAlreadyExist","server responded failure: 400 Bad Request - Missing or invalid API parameters. (Your resource quota is exceeded. (cpu=24 mem=512g cuda.shares=80))":"error.ResourceLimitExceed",'integrity error: update or delete on table "keypair_resource_policies" violates foreign key constraint "fk_keypairs_resource_policy_keypair_resource_policies" on table "keypairs"[\\n]DETAIL:  Key \\(name\\)=\\([\\w]+\\) is still referenced from table "keypairs".[\\n]':"error.ResourcePolicyStillReferenced","Your resource request is smaller than the minimum required by the image. (\\w*)":"error.SmallerResourceThenImageRequires"};let nl=class extends vt{constructor(){super(),this.tosEntryURL="/resources/documents/terms-of-service.en.html",this.tosEntry="terms-of-service",this.tosContent="",this.tosLanguage="en",this.tosLanguages=[{code:"ko",text:Dt("language.Korean")},{code:"en",text:Dt("language.English")}],this.title="",this.show=!1,this.approved=!1,this.block=!1,this.approveCheckbox=Object(),this.dialog=Object()}static get styles(){return[Je,Ls,$s,Ns,Bs,at`
        @media screen and (max-width: 669px) {
          backend-ai-dialog.terms-of-service-dialog {
            --component-width: auto !important;
            --component-height: 80vh;
          }
        }

        @media screen and (min-width: 670px) {
          backend-ai-dialog.terms-of-service-dialog {
            --component-width: 650px !important;
            --component-height: 80vh;
          }
        }

        mwc-select {
          width: 135px;
          font-family: var(--general-font-family);
          --mdc-typography-subtitle1-font-family: var(--general-font-family);
          --mdc-theme-primary: var(--general-sidebar-color);
          --mdc-select-fill-color: transparent;
          --mdc-select-label-ink-color: rgba(0, 0, 0, 0.75);
          --mdc-select-focused-dropdown-icon-color: var(--general-sidebar-color);
          --mdc-select-disabled-dropdown-icon-color: var(--general-sidebar-color);
          --mdc-select-idle-line-color: rgba(0, 0, 0, 0.42);
          --mdc-select-hover-line-color: var(--general-sidebar-color);
          --mdc-select-outlined-idle-border-color: var(--general-sidebar-color);
          --mdc-select-outlined-hover-border-color: var(--general-sidebar-color);
          --mdc-theme-surface: white;
          --mdc-list-vertical-padding: 5px;
          --mdc-list-side-padding: 25px;
          --mdc-list-item__primary-text: {
            height: 20px;
          };
        }

        #terms-of-service-dialog-content h1 {
          line-height: 1.2em;
        }
      `]}tos_contents(){return D`
    `}render(){return D`
      <backend-ai-dialog id="terms-of-service-dialog" class="terms-of-service-dialog" fixed blockscrolling persistent scrollable @dialog-closed=${()=>this.close()}>
        <span slot="title">${this.title}</span>
        <div slot="action" class="horizontal end-justified center flex layout">
          ${this.tosLanguages?D`
            <mwc-select id="select-language" label="${Dt("language.Language")}"
              @change=${()=>this.changeLanguage()}>
              ${this.tosLanguages.map((t=>D`
                <mwc-list-item value="${t.text}" ?selected="${this.tosLanguage===t.code}">${t.text}</mwc-list-item>
              `))}
            </mwc-select>
          `:D``}
        </div>
        <div slot="content">
          <div id="terms-of-service-dialog-content"></div>
          <div class="horizontal end-justified flex layout">
            <div class="flex"></div>
            <mwc-button
                unelevated
                id="dismiss-button"
                label=${ie("button.Dismiss")}
                @click="${()=>{this.close()}}"></mwc-button>
          </div>
        </div>
      </backend-ai-dialog>
    `}firstUpdated(){this.notification=globalThis.lablupNotification,this.dialog=this.shadowRoot.querySelector("#terms-of-service-dialog"),this.dialog.addEventListener("didShow",(()=>{this._syncOpenState()})),this.dialog.addEventListener("didHide",(()=>{this._syncOpenState()})),this.block&&(this.dialog.backdrop=!0),this.show&&this._showTOSdialog()}_syncOpenState(){this.show=this.dialog.open}async open(){await this.updateComplete,this._showTOSdialog()}close(){this.show=!1,this._hideTOSdialog()}changeLanguage(){const t=this.shadowRoot.querySelector("#select-language").value;this.tosContent="",this.tosLanguage=this.tosLanguages.filter((e=>e.text===t)).map((t=>t.code)).toString(),this._showTOSdialog(!0)}async sendRequest(t){let e,i;try{"GET"==t.method&&(t.body=void 0),e=await fetch(t.uri,t);const r=e.headers.get("Content-Type");if(i=r.startsWith("application/json")||r.startsWith("application/problem+json")?await e.json():r.startsWith("text/")?await e.text():await e.blob(),!e.ok)throw i}catch(t){console.log(t)}return i}_showTOSdialog(t=!1){if("default"===this.tosLanguage&&globalThis.backendaioptions.exists("current_language")&&(this.tosLanguage=globalThis.backendaioptions.get("current_language")),["ko","en"].includes(this.tosLanguage)||(this.tosLanguage="en"),this.tosEntryURL="/resources/documents/"+this.tosEntry+"."+this.tosLanguage+".html",""==this.tosContent){const e={method:"GET",uri:this.tosEntryURL,body:JSON.stringify({mode:"dialog"})};this.sendRequest(e).then((e=>{this.tosContent=void 0!==e?e:"",this.shadowRoot.querySelector("#terms-of-service-dialog-content").innerHTML=this.tosContent,this.show=!0,!1===t&&this.dialog.show()})).catch((t=>{console.log(t),t&&t.message&&(this.notification.text=rl.relieve(t.title),this.notification.detail=t.message,this.notification.show(!0,t)),this.shadowRoot.querySelector("#terms-of-service-dialog-content").innerHTML="Problem found while loading contents. Please try again later."}))}else this.show=!0,!1===t&&this.dialog.show()}_hideTOSdialog(){this.show=!1,this.dialog.hide()}_changeApproved(){return!0===this.approveCheckbox.checked?(this.show=!1,this.dialog.hide(),void(this.approved=!0)):void(this.approved=!1)}};r([xt({type:String})],nl.prototype,"tosEntryURL",void 0),r([xt({type:String})],nl.prototype,"tosEntry",void 0),r([xt({type:String})],nl.prototype,"tosContent",void 0),r([xt({type:String})],nl.prototype,"tosLanguage",void 0),r([xt({type:Array})],nl.prototype,"tosLanguages",void 0),r([xt({type:String})],nl.prototype,"title",void 0),r([xt({type:Boolean})],nl.prototype,"show",void 0),r([xt({type:Boolean})],nl.prototype,"approved",void 0),r([xt({type:Boolean})],nl.prototype,"block",void 0),r([xt({type:Object})],nl.prototype,"notification",void 0),r([xt({type:Object})],nl.prototype,"approveCheckbox",void 0),r([xt({type:Object})],nl.prototype,"dialog",void 0),nl=r([_t("lablup-terms-of-service")],nl),function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).ai=t()}((function(){for(var t=function(t){var e;return function(i){return e||t(e={exports:{},parent:i},e.exports),e.exports}},e=t((function(t,e){(function(e,n){(function(){var a;t.exports=A,A.ReadableState=E,tt.EventEmitter;var s,l=function(t,e){return t.listeners(e).length},d=w({}).Buffer,c=n.Uint8Array||function(){},h=_({});s=h&&h.debuglog?h.debuglog("stream"):function(){};var u,p,f,m=Ro.getHighWaterMark,g=ko.codes,v=g.ERR_INVALID_ARG_TYPE,y=g.ERR_STREAM_PUSH_AFTER_EOF,x=g.ERR_METHOD_NOT_IMPLEMENTED,M=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;J(A,go);var k=Mo.errorOrDestroy,S=["error","close","destroy","pause","resume"];function E(t,e,i){a=a||o({}),t=t||{},"boolean"!=typeof i&&(i=e instanceof a),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=m(this,t,"readableHighWaterMark",i),this.buffer=new xo,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(u||(u=b({}).StringDecoder),this.decoder=new u(t.encoding),this.encoding=t.encoding)}function A(t){if(a=a||o({}),!(this instanceof A))return new A(t);var e=this instanceof a;this._readableState=new E(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),go.call(this)}function T(t,e,i,r,n){s("readableAddChunk",e);var o,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(s("onEofChunk"),!e.ended){if(e.decoder){var i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?C(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,O(t)))}}(t,a);else if(n||(o=function(t,e){var i,r;return r=e,d.isBuffer(r)||r instanceof c||"string"==typeof e||void 0===e||t.objectMode||(i=new v("chunk",["string","Buffer","Uint8Array"],e)),i}(a,e)),o)k(t,o);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===d.prototype||(e=function(t){return d.from(t)}(e)),r)a.endEmitted?k(t,new M):R(t,a,e,!0);else if(a.ended)k(t,new y);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!i?(e=a.decoder.write(e),a.objectMode||0!==e.length?R(t,a,e,!1):P(t,a)):R(t,a,e,!1)}else r||(a.reading=!1,P(t,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function R(t,e,i,r){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.needReadable&&C(t)),P(t,e)}function I(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function C(t){var i=t._readableState;s("emitReadable",i.needReadable,i.emittedReadable),i.needReadable=!1,i.emittedReadable||(s("emitReadable",i.flowing),i.emittedReadable=!0,e.nextTick(O,t))}function O(t){var e=t._readableState;s("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,D(t)}function P(t,i){i.readingMore||(i.readingMore=!0,e.nextTick(L,t,i))}function L(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var i=e.length;if(s("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}function $(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){s("readable nexttick read 0"),t.read(0)}function B(t,e){s("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),D(t),e.flowing&&!e.reading&&t.read(0)}function D(t){var e=t._readableState;for(s("flow",e.flowing);e.flowing&&null!==t.read(););}function j(t,e){return 0===e.length?null:(e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i);var i}function z(t){var i=t._readableState;s("endReadable",i.endEmitted),i.endEmitted||(i.ended=!0,e.nextTick(F,i,t))}function F(t,e){if(s("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var i=e._writableState;(!i||i.autoDestroy&&i.finished)&&e.destroy()}}function U(t,e){for(var i=0,r=t.length;i<r;i++)if(t[i]===e)return i;return-1}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),A.prototype.destroy=Mo.destroy,A.prototype._undestroy=Mo.undestroy,A.prototype._destroy=function(t,e){e(t)},A.prototype.push=function(t,e){var i,r=this._readableState;return r.objectMode?i=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=d.from(t,e),e=""),i=!0),T(this,t,e,!1,i)},A.prototype.unshift=function(t){return T(this,t,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){u||(u=b({}).StringDecoder);var e=new u(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var i=this._readableState.buffer.head,r="";null!==i;)r+=e.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this},A.prototype.read=function(t){s("read",t),t=parseInt(t,10);var e=this._readableState,i=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return s("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?z(this):C(this),null;if(0===(t=I(t,e))&&e.ended)return 0===e.length&&z(this),null;var r,n=e.needReadable;return s("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&s("length less than watermark",n=!0),e.ended||e.reading?s("reading or ended",n=!1):n&&(s("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=I(i,e))),null===(r=t>0?j(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&z(this)),null!==r&&this.emit("data",r),r},A.prototype._read=function(t){k(this,new x("_read()"))},A.prototype.pipe=function(t,i){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,s("pipe count=%d opts=%j",n.pipesCount,i);var o=i&&!1===i.end||t===e.stdout||t===e.stderr?m:a;function a(){s("onend"),t.end()}n.endEmitted?e.nextTick(o):r.once("end",o),t.on("unpipe",(function e(i,o){s("onunpipe"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,s("cleanup"),t.removeListener("close",p),t.removeListener("finish",f),t.removeListener("drain",d),t.removeListener("error",u),t.removeListener("unpipe",e),r.removeListener("end",a),r.removeListener("end",m),r.removeListener("data",h),c=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||d())}));var d=function(t){return function(){var e=t._readableState;s("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&l(t,"data")&&(e.flowing=!0,D(t))}}(r);t.on("drain",d);var c=!1;function h(e){s("ondata");var i=t.write(e);s("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==U(n.pipes,t))&&!c&&(s("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function u(e){s("onerror",e),m(),t.removeListener("error",u),0===l(t,"error")&&k(t,e)}function p(){t.removeListener("finish",f),m()}function f(){s("onfinish"),t.removeListener("close",p),m()}function m(){s("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,i){if("function"==typeof t.prependListener)return t.prependListener("error",i);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(i):t._events.error=[i,t._events.error]:t.on("error",i)}(t,0,u),t.once("close",p),t.once("finish",f),t.emit("pipe",r),n.flowing||(s("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,i={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,i)),this;if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=U(e.pipes,t);return-1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,i)),this},A.prototype.on=function(t,i){var r=go.prototype.on.call(this,t,i),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,s("on readable",n.length,n.reading),n.length?C(this):n.reading||e.nextTick(N,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,i){var r=go.prototype.removeListener.call(this,t,i);return"readable"===t&&e.nextTick($,this),r},A.prototype.removeAllListeners=function(t){var i=go.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||e.nextTick($,this),i},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(s("resume"),t.flowing=!t.readableListening,function(t,i){i.resumeScheduled||(i.resumeScheduled=!0,e.nextTick(B,t,i))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,i=this._readableState,r=!1;for(var n in t.on("end",(function(){if(s("wrapped end"),i.decoder&&!i.ended){var t=i.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){s("wrapped data"),i.decoder&&(n=i.decoder.write(n)),i.objectMode&&null==n||(i.objectMode||n&&n.length)&&(e.push(n)||(r=!0,t.pause()))})),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var o=0;o<S.length;o++)t.on(S[o],this.emit.bind(this,S[o]));return this._read=function(e){s("wrapped _read",e),r&&(r=!1,t.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===p&&(p=r({})),p(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),A._fromList=j,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,e){return void 0===f&&(f=i({})),f(A,t,e)})}).call(this)}).call(this,D,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),i=t((function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}})),r=t((function(t,e){(function(e){(function(){var i;function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var o=n({}),a=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),d=Symbol("ended"),c=Symbol("lastPromise"),h=Symbol("handlePromise"),u=Symbol("stream");function p(t,e){return{value:t,done:e}}function f(t){var e=t[a];if(null!==e){var i=t[u].read();null!==i&&(t[c]=null,t[a]=null,t[s]=null,e(p(i,!1)))}}var m=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((r(i={get stream(){return this[u]},next:function(){var t=this,i=this[l];if(null!==i)return Promise.reject(i);if(this[d])return Promise.resolve(p(void 0,!0));if(this[u].destroyed)return new Promise((function(i,r){e.nextTick((function(){t[l]?r(t[l]):i(p(void 0,!0))}))}));var r,n=this[c];if(n)r=new Promise(function(t,e){return function(i,r){t.then((function(){e[d]?i(p(void 0,!0)):e[h](i,r)}),r)}}(n,this));else{var o=this[u].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[h])}return this[c]=r,r}},Symbol.asyncIterator,(function(){return this})),r(i,"return",(function(){var t=this;return new Promise((function(e,i){t[u].destroy(null,(function(t){t?i(t):e(p(void 0,!0))}))}))})),i),m);t.exports=function(t){var i,n=Object.create(g,(r(i={},u,{value:t,writable:!0}),r(i,a,{value:null,writable:!0}),r(i,s,{value:null,writable:!0}),r(i,l,{value:null,writable:!0}),r(i,d,{value:t._readableState.endEmitted,writable:!0}),r(i,h,{value:function(t,e){var i=n[u].read();i?(n[c]=null,n[a]=null,n[s]=null,t(p(i,!1))):(n[a]=t,n[s]=e)},writable:!0}),i));return n[c]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[s];return null!==e&&(n[c]=null,n[a]=null,n[s]=null,e(t)),void(n[l]=t)}var i=n[a];null!==i&&(n[c]=null,n[a]=null,n[s]=null,i(p(void 0,!0))),n[d]=!0})),t.on("readable",function(t){e.nextTick(f,t)}.bind(null,n)),n}}).call(this)}).call(this,D)})),n=t((function(t,e){var i=ko.codes.ERR_STREAM_PREMATURE_CLOSE;function r(){}t.exports=function t(e,n,o){if("function"==typeof n)return t(e,null,n);n||(n={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];t.apply(this,r)}}}(o||r);var a=n.readable||!1!==n.readable&&e.readable,s=n.writable||!1!==n.writable&&e.writable,l=function(){e.writable||c()},d=e._writableState&&e._writableState.finished,c=function(){s=!1,d=!0,a||o.call(e)},h=e._readableState&&e._readableState.endEmitted,u=function(){a=!1,h=!0,s||o.call(e)},p=function(t){o.call(e,t)},f=function(){var t;return a&&!h?(e._readableState&&e._readableState.ended||(t=new i),o.call(e,t)):s&&!d?(e._writableState&&e._writableState.ended||(t=new i),o.call(e,t)):void 0},m=function(){e.req.on("finish",c)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",c),e.on("abort",f),e.req?m():e.on("request",m)):s&&!e._writableState&&(e.on("end",l),e.on("close",l)),e.on("end",u),e.on("finish",c),!1!==n.error&&e.on("error",p),e.on("close",f),function(){e.removeListener("complete",c),e.removeListener("abort",f),e.removeListener("request",m),e.req&&e.req.removeListener("finish",c),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("end",u),e.removeListener("error",p),e.removeListener("close",f)}}})),o=t((function(t,i){(function(i){(function(){var r=Object.keys||function(t){var e=[];for(var i in t)e.push(i);return e};t.exports=c;var n=e({}),o=a({});J(c,n);for(var s=r(o.prototype),l=0;l<s.length;l++){var d=s[l];c.prototype[d]||(c.prototype[d]=o.prototype[d])}function c(t){if(!(this instanceof c))return new c(t);n.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||i.nextTick(u,this)}function u(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this)}).call(this,D)})),a=t((function(t,e){(function(e,i){(function(){function r(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,i){var r=t.entry;for(t.entry=null;r;){var n=r.callback;e.pendingcb--,n(void 0),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}var n;t.exports=k,k.WritableState=M;var a,s={deprecate:At},l=w({}).Buffer,d=i.Uint8Array||function(){},c=Ro.getHighWaterMark,h=ko.codes,u=h.ERR_INVALID_ARG_TYPE,p=h.ERR_METHOD_NOT_IMPLEMENTED,f=h.ERR_MULTIPLE_CALLBACK,m=h.ERR_STREAM_CANNOT_PIPE,g=h.ERR_STREAM_DESTROYED,b=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,y=h.ERR_UNKNOWN_ENCODING,_=Mo.errorOrDestroy;function x(){}function M(t,i,a){n=n||o({}),t=t||{},"boolean"!=typeof a&&(a=i instanceof n),this.objectMode=!!t.objectMode,a&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=c(this,t,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,i){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new f;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),i)!function(t,i,r,n,o){--i.pendingcb,r?(e.nextTick(o,n),e.nextTick(I,t,i),t._writableState.errorEmitted=!0,_(t,n)):(o(n),t._writableState.errorEmitted=!0,_(t,n),I(t,i))}(t,r,n,i,o);else{var a=T(r)||t.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||A(t,r),n?e.nextTick(E,t,r,a,o):E(t,r,a,o)}}(i,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function k(t){var e=this instanceof(n=n||o({}));if(!e&&!a.call(k,this))return new k(t);this._writableState=new M(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),go.call(this)}function S(t,e,i,r,n,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new g("write")):i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function E(t,e,i,r){i||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),I(t,e)}function A(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){var n=e.bufferedRequestCount,o=new Array(n),a=e.corkedRequestsFree;a.entry=i;for(var s=0,l=!0;i;)o[s]=i,i.isBuf||(l=!1),i=i.next,s+=1;o.allBuffers=l,S(t,e,!0,e.length,o,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new r(e),e.bufferedRequestCount=0}else{for(;i;){var d=i.chunk,c=i.encoding,h=i.callback;if(S(t,e,!1,e.objectMode?1:d.length,d,c,h),i=i.next,e.bufferedRequestCount--,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}function T(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function R(t,e){t._final((function(i){e.pendingcb--,i&&_(t,i),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,i){var r=T(i);if(r&&(function(t,i){i.prefinished||i.finalCalled||("function"!=typeof t._final||i.destroyed?(i.prefinished=!0,t.emit("prefinish")):(i.pendingcb++,i.finalCalled=!0,e.nextTick(R,t,i)))}(t,i),0===i.pendingcb&&(i.finished=!0,t.emit("finish"),i.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}J(k,go),M.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(M.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(t){return!!a.call(this,t)||this===k&&t&&t._writableState instanceof M}})):a=function(t){return t instanceof this},k.prototype.pipe=function(){_(this,new m)},k.prototype.write=function(t,i,r){var n,o=this._writableState,a=!1,s=!o.objectMode&&(n=t,l.isBuffer(n)||n instanceof d);return s&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"==typeof i&&(r=i,i=null),s?i="buffer":i||(i=o.defaultEncoding),"function"!=typeof r&&(r=x),o.ending?function(t,i){var r=new v;_(t,r),e.nextTick(i,r)}(this,r):(s||function(t,i,r,n){var o;return null===r?o=new b:"string"==typeof r||i.objectMode||(o=new u("chunk",["string","Buffer"],r)),!o||(_(t,o),e.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,a=function(t,e,i,r,n,o){if(!i){var a=function(t,e,i){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,i)),e}(e,r,n);r!==a&&(i=!0,n="buffer",r=a)}var s=e.objectMode?1:r.length;e.length+=s;var d=e.length<e.highWaterMark;if(d||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:n,isBuf:i,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else S(t,e,!1,s,r,n,o);return d}(this,o,s,t,i,r)),a},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||A(this,t))},k.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new y(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,i){i(new p("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,i,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,i=null):"function"==typeof i&&(r=i,i=null),null!=t&&this.write(t,i),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,i,r){i.ending=!0,I(t,i),r&&(i.finished?e.nextTick(r):t.once("finish",r)),i.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=Mo.destroy,k.prototype._undestroy=Mo.undestroy,k.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,D,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),s=t((function(t,e){(function(e,i){(function(){var r;t.exports=A,A.ReadableState=E,tt.EventEmitter;var n,o=function(t,e){return t.listeners(e).length},a=w({}).Buffer,s=i.Uint8Array||function(){},c=_({});n=c&&c.debuglog?c.debuglog("stream"):function(){};var u,p,f,m=$i.getHighWaterMark,g=Ii.codes,v=g.ERR_INVALID_ARG_TYPE,y=g.ERR_STREAM_PUSH_AFTER_EOF,x=g.ERR_METHOD_NOT_IMPLEMENTED,M=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;J(A,xi);var k=Ri.errorOrDestroy,S=["error","close","destroy","pause","resume"];function E(t,e,i){r=r||h({}),t=t||{},"boolean"!=typeof i&&(i=e instanceof r),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=m(this,t,"readableHighWaterMark",i),this.buffer=new Ti,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(u||(u=b({}).StringDecoder),this.decoder=new u(t.encoding),this.encoding=t.encoding)}function A(t){if(r=r||h({}),!(this instanceof A))return new A(t);var e=this instanceof r;this._readableState=new E(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),xi.call(this)}function T(t,e,i,r,o){n("readableAddChunk",e);var l,d=t._readableState;if(null===e)d.reading=!1,function(t,e){if(n("onEofChunk"),!e.ended){if(e.decoder){var i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?C(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,O(t)))}}(t,d);else if(o||(l=function(t,e){var i,r;return r=e,a.isBuffer(r)||r instanceof s||"string"==typeof e||void 0===e||t.objectMode||(i=new v("chunk",["string","Buffer","Uint8Array"],e)),i}(d,e)),l)k(t,l);else if(d.objectMode||e&&e.length>0)if("string"==typeof e||d.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),r)d.endEmitted?k(t,new M):R(t,d,e,!0);else if(d.ended)k(t,new y);else{if(d.destroyed)return!1;d.reading=!1,d.decoder&&!i?(e=d.decoder.write(e),d.objectMode||0!==e.length?R(t,d,e,!1):P(t,d)):R(t,d,e,!1)}else r||(d.reading=!1,P(t,d));return!d.ended&&(d.length<d.highWaterMark||0===d.length)}function R(t,e,i,r){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.needReadable&&C(t)),P(t,e)}function I(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function C(t){var i=t._readableState;n("emitReadable",i.needReadable,i.emittedReadable),i.needReadable=!1,i.emittedReadable||(n("emitReadable",i.flowing),i.emittedReadable=!0,e.nextTick(O,t))}function O(t){var e=t._readableState;n("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,D(t)}function P(t,i){i.readingMore||(i.readingMore=!0,e.nextTick(L,t,i))}function L(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var i=e.length;if(n("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}function $(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){n("readable nexttick read 0"),t.read(0)}function B(t,e){n("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),D(t),e.flowing&&!e.reading&&t.read(0)}function D(t){var e=t._readableState;for(n("flow",e.flowing);e.flowing&&null!==t.read(););}function j(t,e){return 0===e.length?null:(e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i);var i}function z(t){var i=t._readableState;n("endReadable",i.endEmitted),i.endEmitted||(i.ended=!0,e.nextTick(F,i,t))}function F(t,e){if(n("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var i=e._writableState;(!i||i.autoDestroy&&i.finished)&&e.destroy()}}function U(t,e){for(var i=0,r=t.length;i<r;i++)if(t[i]===e)return i;return-1}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),A.prototype.destroy=Ri.destroy,A.prototype._undestroy=Ri.undestroy,A.prototype._destroy=function(t,e){e(t)},A.prototype.push=function(t,e){var i,r=this._readableState;return r.objectMode?i=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=a.from(t,e),e=""),i=!0),T(this,t,e,!1,i)},A.prototype.unshift=function(t){return T(this,t,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){u||(u=b({}).StringDecoder);var e=new u(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var i=this._readableState.buffer.head,r="";null!==i;)r+=e.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this},A.prototype.read=function(t){n("read",t),t=parseInt(t,10);var e=this._readableState,i=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return n("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?z(this):C(this),null;if(0===(t=I(t,e))&&e.ended)return 0===e.length&&z(this),null;var r,o=e.needReadable;return n("need readable",o),(0===e.length||e.length-t<e.highWaterMark)&&n("length less than watermark",o=!0),e.ended||e.reading?n("reading or ended",o=!1):o&&(n("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=I(i,e))),null===(r=t>0?j(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&z(this)),null!==r&&this.emit("data",r),r},A.prototype._read=function(t){k(this,new x("_read()"))},A.prototype.pipe=function(t,i){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,i);var s=i&&!1===i.end||t===e.stdout||t===e.stderr?m:l;function l(){n("onend"),t.end()}a.endEmitted?e.nextTick(s):r.once("end",s),t.on("unpipe",(function e(i,o){n("onunpipe"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,n("cleanup"),t.removeListener("close",p),t.removeListener("finish",f),t.removeListener("drain",d),t.removeListener("error",u),t.removeListener("unpipe",e),r.removeListener("end",l),r.removeListener("end",m),r.removeListener("data",h),c=!0,!a.awaitDrain||t._writableState&&!t._writableState.needDrain||d())}));var d=function(t){return function(){var e=t._readableState;n("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,D(t))}}(r);t.on("drain",d);var c=!1;function h(e){n("ondata");var i=t.write(e);n("dest.write",i),!1===i&&((1===a.pipesCount&&a.pipes===t||a.pipesCount>1&&-1!==U(a.pipes,t))&&!c&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),r.pause())}function u(e){n("onerror",e),m(),t.removeListener("error",u),0===o(t,"error")&&k(t,e)}function p(){t.removeListener("finish",f),m()}function f(){n("onfinish"),t.removeListener("close",p),m()}function m(){n("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,i){if("function"==typeof t.prependListener)return t.prependListener("error",i);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(i):t._events.error=[i,t._events.error]:t.on("error",i)}(t,0,u),t.once("close",p),t.once("finish",f),t.emit("pipe",r),a.flowing||(n("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,i={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,i)),this;if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=U(e.pipes,t);return-1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,i)),this},A.prototype.on=function(t,i){var r=xi.prototype.on.call(this,t,i),o=this._readableState;return"data"===t?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===t&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,n("on readable",o.length,o.reading),o.length?C(this):o.reading||e.nextTick(N,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,i){var r=xi.prototype.removeListener.call(this,t,i);return"readable"===t&&e.nextTick($,this),r},A.prototype.removeAllListeners=function(t){var i=xi.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||e.nextTick($,this),i},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(n("resume"),t.flowing=!t.readableListening,function(t,i){i.resumeScheduled||(i.resumeScheduled=!0,e.nextTick(B,t,i))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,i=this._readableState,r=!1;for(var o in t.on("end",(function(){if(n("wrapped end"),i.decoder&&!i.ended){var t=i.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(o){n("wrapped data"),i.decoder&&(o=i.decoder.write(o)),i.objectMode&&null==o||(i.objectMode||o&&o.length)&&(e.push(o)||(r=!0,t.pause()))})),t)void 0===this[o]&&"function"==typeof t[o]&&(this[o]=function(e){return function(){return t[e].apply(t,arguments)}}(o));for(var a=0;a<S.length;a++)t.on(S[a],this.emit.bind(this,S[a]));return this._read=function(e){n("wrapped _read",e),r&&(r=!1,t.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===p&&(p=d({})),p(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),A._fromList=j,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,e){return void 0===f&&(f=l({})),f(A,t,e)})}).call(this)}).call(this,D,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),l=t((function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}})),d=t((function(t,e){(function(e){(function(){var i;function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var n=c({}),o=Symbol("lastResolve"),a=Symbol("lastReject"),s=Symbol("error"),l=Symbol("ended"),d=Symbol("lastPromise"),h=Symbol("handlePromise"),u=Symbol("stream");function p(t,e){return{value:t,done:e}}function f(t){var e=t[o];if(null!==e){var i=t[u].read();null!==i&&(t[d]=null,t[o]=null,t[a]=null,e(p(i,!1)))}}var m=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((r(i={get stream(){return this[u]},next:function(){var t=this,i=this[s];if(null!==i)return Promise.reject(i);if(this[l])return Promise.resolve(p(void 0,!0));if(this[u].destroyed)return new Promise((function(i,r){e.nextTick((function(){t[s]?r(t[s]):i(p(void 0,!0))}))}));var r,n=this[d];if(n)r=new Promise(function(t,e){return function(i,r){t.then((function(){e[l]?i(p(void 0,!0)):e[h](i,r)}),r)}}(n,this));else{var o=this[u].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[h])}return this[d]=r,r}},Symbol.asyncIterator,(function(){return this})),r(i,"return",(function(){var t=this;return new Promise((function(e,i){t[u].destroy(null,(function(t){t?i(t):e(p(void 0,!0))}))}))})),i),m);t.exports=function(t){var i,c=Object.create(g,(r(i={},u,{value:t,writable:!0}),r(i,o,{value:null,writable:!0}),r(i,a,{value:null,writable:!0}),r(i,s,{value:null,writable:!0}),r(i,l,{value:t._readableState.endEmitted,writable:!0}),r(i,h,{value:function(t,e){var i=c[u].read();i?(c[d]=null,c[o]=null,c[a]=null,t(p(i,!1))):(c[o]=t,c[a]=e)},writable:!0}),i));return c[d]=null,n(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=c[a];return null!==e&&(c[d]=null,c[o]=null,c[a]=null,e(t)),void(c[s]=t)}var i=c[o];null!==i&&(c[d]=null,c[o]=null,c[a]=null,i(p(void 0,!0))),c[l]=!0})),t.on("readable",function(t){e.nextTick(f,t)}.bind(null,c)),c}}).call(this)}).call(this,D)})),c=t((function(t,e){var i=Ii.codes.ERR_STREAM_PREMATURE_CLOSE;function r(){}t.exports=function t(e,n,o){if("function"==typeof n)return t(e,null,n);n||(n={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];t.apply(this,r)}}}(o||r);var a=n.readable||!1!==n.readable&&e.readable,s=n.writable||!1!==n.writable&&e.writable,l=function(){e.writable||c()},d=e._writableState&&e._writableState.finished,c=function(){s=!1,d=!0,a||o.call(e)},h=e._readableState&&e._readableState.endEmitted,u=function(){a=!1,h=!0,s||o.call(e)},p=function(t){o.call(e,t)},f=function(){var t;return a&&!h?(e._readableState&&e._readableState.ended||(t=new i),o.call(e,t)):s&&!d?(e._writableState&&e._writableState.ended||(t=new i),o.call(e,t)):void 0},m=function(){e.req.on("finish",c)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",c),e.on("abort",f),e.req?m():e.on("request",m)):s&&!e._writableState&&(e.on("end",l),e.on("close",l)),e.on("end",u),e.on("finish",c),!1!==n.error&&e.on("error",p),e.on("close",f),function(){e.removeListener("complete",c),e.removeListener("abort",f),e.removeListener("request",m),e.req&&e.req.removeListener("finish",c),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("end",u),e.removeListener("error",p),e.removeListener("close",f)}}})),h=t((function(t,e){(function(e){(function(){var i=Object.keys||function(t){var e=[];for(var i in t)e.push(i);return e};t.exports=d;var r=s({}),n=u({});J(d,r);for(var o=i(n.prototype),a=0;a<o.length;a++){var l=o[a];d.prototype[l]||(d.prototype[l]=n.prototype[l])}function d(t){if(!(this instanceof d))return new d(t);r.call(this,t),n.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||e.nextTick(h,this)}function h(t){t.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(d.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(d.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this)}).call(this,D)})),u=t((function(t,e){(function(e,i){(function(){function r(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,i){var r=t.entry;for(t.entry=null;r;){var n=r.callback;e.pendingcb--,n(void 0),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}var n;t.exports=k,k.WritableState=M;var o,a={deprecate:At},s=w({}).Buffer,l=i.Uint8Array||function(){},d=$i.getHighWaterMark,c=Ii.codes,u=c.ERR_INVALID_ARG_TYPE,p=c.ERR_METHOD_NOT_IMPLEMENTED,f=c.ERR_MULTIPLE_CALLBACK,m=c.ERR_STREAM_CANNOT_PIPE,g=c.ERR_STREAM_DESTROYED,b=c.ERR_STREAM_NULL_VALUES,v=c.ERR_STREAM_WRITE_AFTER_END,y=c.ERR_UNKNOWN_ENCODING,_=Ri.errorOrDestroy;function x(){}function M(t,i,o){n=n||h({}),t=t||{},"boolean"!=typeof o&&(o=i instanceof n),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=d(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,i){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new f;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),i)!function(t,i,r,n,o){--i.pendingcb,r?(e.nextTick(o,n),e.nextTick(I,t,i),t._writableState.errorEmitted=!0,_(t,n)):(o(n),t._writableState.errorEmitted=!0,_(t,n),I(t,i))}(t,r,n,i,o);else{var a=T(r)||t.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||A(t,r),n?e.nextTick(E,t,r,a,o):E(t,r,a,o)}}(i,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function k(t){var e=this instanceof(n=n||h({}));if(!e&&!o.call(k,this))return new k(t);this._writableState=new M(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),xi.call(this)}function S(t,e,i,r,n,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new g("write")):i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function E(t,e,i,r){i||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),I(t,e)}function A(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){var n=e.bufferedRequestCount,o=new Array(n),a=e.corkedRequestsFree;a.entry=i;for(var s=0,l=!0;i;)o[s]=i,i.isBuf||(l=!1),i=i.next,s+=1;o.allBuffers=l,S(t,e,!0,e.length,o,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new r(e),e.bufferedRequestCount=0}else{for(;i;){var d=i.chunk,c=i.encoding,h=i.callback;if(S(t,e,!1,e.objectMode?1:d.length,d,c,h),i=i.next,e.bufferedRequestCount--,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}function T(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function R(t,e){t._final((function(i){e.pendingcb--,i&&_(t,i),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,i){var r=T(i);if(r&&(function(t,i){i.prefinished||i.finalCalled||("function"!=typeof t._final||i.destroyed?(i.prefinished=!0,t.emit("prefinish")):(i.pendingcb++,i.finalCalled=!0,e.nextTick(R,t,i)))}(t,i),0===i.pendingcb&&(i.finished=!0,t.emit("finish"),i.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}J(k,xi),M.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(M.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===k&&t&&t._writableState instanceof M}})):o=function(t){return t instanceof this},k.prototype.pipe=function(){_(this,new m)},k.prototype.write=function(t,i,r){var n,o=this._writableState,a=!1,d=!o.objectMode&&(n=t,s.isBuffer(n)||n instanceof l);return d&&!s.isBuffer(t)&&(t=function(t){return s.from(t)}(t)),"function"==typeof i&&(r=i,i=null),d?i="buffer":i||(i=o.defaultEncoding),"function"!=typeof r&&(r=x),o.ending?function(t,i){var r=new v;_(t,r),e.nextTick(i,r)}(this,r):(d||function(t,i,r,n){var o;return null===r?o=new b:"string"==typeof r||i.objectMode||(o=new u("chunk",["string","Buffer"],r)),!o||(_(t,o),e.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,a=function(t,e,i,r,n,o){if(!i){var a=function(t,e,i){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=s.from(e,i)),e}(e,r,n);r!==a&&(i=!0,n="buffer",r=a)}var l=e.objectMode?1:r.length;e.length+=l;var d=e.length<e.highWaterMark;if(d||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:n,isBuf:i,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else S(t,e,!1,l,r,n,o);return d}(this,o,d,t,i,r)),a},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||A(this,t))},k.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new y(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,i){i(new p("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,i,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,i=null):"function"==typeof i&&(r=i,i=null),null!=t&&this.write(t,i),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,i,r){i.ending=!0,I(t,i),r&&(i.finished?e.nextTick(r):t.once("finish",r)),i.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=Ri.destroy,k.prototype._undestroy=Ri.undestroy,k.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,D,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),p=t((function(t,e){(function(e,i){(function(){var r;t.exports=A,A.ReadableState=E,tt.EventEmitter;var n,o=function(t,e){return t.listeners(e).length},a=w({}).Buffer,s=i.Uint8Array||function(){},l=_({});n=l&&l.debuglog?l.debuglog("stream"):function(){};var d,c,h,u=Et.getHighWaterMark,p=wt.codes,g=p.ERR_INVALID_ARG_TYPE,y=p.ERR_STREAM_PUSH_AFTER_EOF,x=p.ERR_METHOD_NOT_IMPLEMENTED,M=p.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;J(A,pt);var k=_t.errorOrDestroy,S=["error","close","destroy","pause","resume"];function E(t,e,i){r=r||v({}),t=t||{},"boolean"!=typeof i&&(i=e instanceof r),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=u(this,t,"readableHighWaterMark",i),this.buffer=new yt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=b({}).StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function A(t){if(r=r||v({}),!(this instanceof A))return new A(t);var e=this instanceof r;this._readableState=new E(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),pt.call(this)}function T(t,e,i,r,o){n("readableAddChunk",e);var l,d=t._readableState;if(null===e)d.reading=!1,function(t,e){if(n("onEofChunk"),!e.ended){if(e.decoder){var i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?C(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,O(t)))}}(t,d);else if(o||(l=function(t,e){var i,r;return r=e,a.isBuffer(r)||r instanceof s||"string"==typeof e||void 0===e||t.objectMode||(i=new g("chunk",["string","Buffer","Uint8Array"],e)),i}(d,e)),l)k(t,l);else if(d.objectMode||e&&e.length>0)if("string"==typeof e||d.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),r)d.endEmitted?k(t,new M):R(t,d,e,!0);else if(d.ended)k(t,new y);else{if(d.destroyed)return!1;d.reading=!1,d.decoder&&!i?(e=d.decoder.write(e),d.objectMode||0!==e.length?R(t,d,e,!1):P(t,d)):R(t,d,e,!1)}else r||(d.reading=!1,P(t,d));return!d.ended&&(d.length<d.highWaterMark||0===d.length)}function R(t,e,i,r){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.needReadable&&C(t)),P(t,e)}function I(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function C(t){var i=t._readableState;n("emitReadable",i.needReadable,i.emittedReadable),i.needReadable=!1,i.emittedReadable||(n("emitReadable",i.flowing),i.emittedReadable=!0,e.nextTick(O,t))}function O(t){var e=t._readableState;n("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,D(t)}function P(t,i){i.readingMore||(i.readingMore=!0,e.nextTick(L,t,i))}function L(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var i=e.length;if(n("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}function $(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){n("readable nexttick read 0"),t.read(0)}function B(t,e){n("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),D(t),e.flowing&&!e.reading&&t.read(0)}function D(t){var e=t._readableState;for(n("flow",e.flowing);e.flowing&&null!==t.read(););}function j(t,e){return 0===e.length?null:(e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i);var i}function z(t){var i=t._readableState;n("endReadable",i.endEmitted),i.endEmitted||(i.ended=!0,e.nextTick(F,i,t))}function F(t,e){if(n("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var i=e._writableState;(!i||i.autoDestroy&&i.finished)&&e.destroy()}}function U(t,e){for(var i=0,r=t.length;i<r;i++)if(t[i]===e)return i;return-1}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),A.prototype.destroy=_t.destroy,A.prototype._undestroy=_t.undestroy,A.prototype._destroy=function(t,e){e(t)},A.prototype.push=function(t,e){var i,r=this._readableState;return r.objectMode?i=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=a.from(t,e),e=""),i=!0),T(this,t,e,!1,i)},A.prototype.unshift=function(t){return T(this,t,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){d||(d=b({}).StringDecoder);var e=new d(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var i=this._readableState.buffer.head,r="";null!==i;)r+=e.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this},A.prototype.read=function(t){n("read",t),t=parseInt(t,10);var e=this._readableState,i=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return n("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?z(this):C(this),null;if(0===(t=I(t,e))&&e.ended)return 0===e.length&&z(this),null;var r,o=e.needReadable;return n("need readable",o),(0===e.length||e.length-t<e.highWaterMark)&&n("length less than watermark",o=!0),e.ended||e.reading?n("reading or ended",o=!1):o&&(n("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=I(i,e))),null===(r=t>0?j(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&z(this)),null!==r&&this.emit("data",r),r},A.prototype._read=function(t){k(this,new x("_read()"))},A.prototype.pipe=function(t,i){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,i);var s=i&&!1===i.end||t===e.stdout||t===e.stderr?m:l;function l(){n("onend"),t.end()}a.endEmitted?e.nextTick(s):r.once("end",s),t.on("unpipe",(function e(i,o){n("onunpipe"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,n("cleanup"),t.removeListener("close",p),t.removeListener("finish",f),t.removeListener("drain",d),t.removeListener("error",u),t.removeListener("unpipe",e),r.removeListener("end",l),r.removeListener("end",m),r.removeListener("data",h),c=!0,!a.awaitDrain||t._writableState&&!t._writableState.needDrain||d())}));var d=function(t){return function(){var e=t._readableState;n("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,D(t))}}(r);t.on("drain",d);var c=!1;function h(e){n("ondata");var i=t.write(e);n("dest.write",i),!1===i&&((1===a.pipesCount&&a.pipes===t||a.pipesCount>1&&-1!==U(a.pipes,t))&&!c&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),r.pause())}function u(e){n("onerror",e),m(),t.removeListener("error",u),0===o(t,"error")&&k(t,e)}function p(){t.removeListener("finish",f),m()}function f(){n("onfinish"),t.removeListener("close",p),m()}function m(){n("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,i){if("function"==typeof t.prependListener)return t.prependListener("error",i);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(i):t._events.error=[i,t._events.error]:t.on("error",i)}(t,0,u),t.once("close",p),t.once("finish",f),t.emit("pipe",r),a.flowing||(n("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,i={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,i)),this;if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=U(e.pipes,t);return-1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,i)),this},A.prototype.on=function(t,i){var r=pt.prototype.on.call(this,t,i),o=this._readableState;return"data"===t?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===t&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,n("on readable",o.length,o.reading),o.length?C(this):o.reading||e.nextTick(N,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,i){var r=pt.prototype.removeListener.call(this,t,i);return"readable"===t&&e.nextTick($,this),r},A.prototype.removeAllListeners=function(t){var i=pt.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||e.nextTick($,this),i},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(n("resume"),t.flowing=!t.readableListening,function(t,i){i.resumeScheduled||(i.resumeScheduled=!0,e.nextTick(B,t,i))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,i=this._readableState,r=!1;for(var o in t.on("end",(function(){if(n("wrapped end"),i.decoder&&!i.ended){var t=i.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(o){n("wrapped data"),i.decoder&&(o=i.decoder.write(o)),i.objectMode&&null==o||(i.objectMode||o&&o.length)&&(e.push(o)||(r=!0,t.pause()))})),t)void 0===this[o]&&"function"==typeof t[o]&&(this[o]=function(e){return function(){return t[e].apply(t,arguments)}}(o));for(var a=0;a<S.length;a++)t.on(S[a],this.emit.bind(this,S[a]));return this._read=function(e){n("wrapped _read",e),r&&(r=!1,t.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===c&&(c=m({})),c(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),A._fromList=j,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,e){return void 0===h&&(h=f({})),h(A,t,e)})}).call(this)}).call(this,D,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),f=t((function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}})),m=t((function(t,e){(function(e){(function(){var i;function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var n=g({}),o=Symbol("lastResolve"),a=Symbol("lastReject"),s=Symbol("error"),l=Symbol("ended"),d=Symbol("lastPromise"),c=Symbol("handlePromise"),h=Symbol("stream");function u(t,e){return{value:t,done:e}}function p(t){var e=t[o];if(null!==e){var i=t[h].read();null!==i&&(t[d]=null,t[o]=null,t[a]=null,e(u(i,!1)))}}var f=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((r(i={get stream(){return this[h]},next:function(){var t=this,i=this[s];if(null!==i)return Promise.reject(i);if(this[l])return Promise.resolve(u(void 0,!0));if(this[h].destroyed)return new Promise((function(i,r){e.nextTick((function(){t[s]?r(t[s]):i(u(void 0,!0))}))}));var r,n=this[d];if(n)r=new Promise(function(t,e){return function(i,r){t.then((function(){e[l]?i(u(void 0,!0)):e[c](i,r)}),r)}}(n,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(u(o,!1));r=new Promise(this[c])}return this[d]=r,r}},Symbol.asyncIterator,(function(){return this})),r(i,"return",(function(){var t=this;return new Promise((function(e,i){t[h].destroy(null,(function(t){t?i(t):e(u(void 0,!0))}))}))})),i),f);t.exports=function(t){var i,f=Object.create(m,(r(i={},h,{value:t,writable:!0}),r(i,o,{value:null,writable:!0}),r(i,a,{value:null,writable:!0}),r(i,s,{value:null,writable:!0}),r(i,l,{value:t._readableState.endEmitted,writable:!0}),r(i,c,{value:function(t,e){var i=f[h].read();i?(f[d]=null,f[o]=null,f[a]=null,t(u(i,!1))):(f[o]=t,f[a]=e)},writable:!0}),i));return f[d]=null,n(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=f[a];return null!==e&&(f[d]=null,f[o]=null,f[a]=null,e(t)),void(f[s]=t)}var i=f[o];null!==i&&(f[d]=null,f[o]=null,f[a]=null,i(u(void 0,!0))),f[l]=!0})),t.on("readable",function(t){e.nextTick(p,t)}.bind(null,f)),f}}).call(this)}).call(this,D)})),g=t((function(t,e){var i=wt.codes.ERR_STREAM_PREMATURE_CLOSE;function r(){}t.exports=function t(e,n,o){if("function"==typeof n)return t(e,null,n);n||(n={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];t.apply(this,r)}}}(o||r);var a=n.readable||!1!==n.readable&&e.readable,s=n.writable||!1!==n.writable&&e.writable,l=function(){e.writable||c()},d=e._writableState&&e._writableState.finished,c=function(){s=!1,d=!0,a||o.call(e)},h=e._readableState&&e._readableState.endEmitted,u=function(){a=!1,h=!0,s||o.call(e)},p=function(t){o.call(e,t)},f=function(){var t;return a&&!h?(e._readableState&&e._readableState.ended||(t=new i),o.call(e,t)):s&&!d?(e._writableState&&e._writableState.ended||(t=new i),o.call(e,t)):void 0},m=function(){e.req.on("finish",c)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",c),e.on("abort",f),e.req?m():e.on("request",m)):s&&!e._writableState&&(e.on("end",l),e.on("close",l)),e.on("end",u),e.on("finish",c),!1!==n.error&&e.on("error",p),e.on("close",f),function(){e.removeListener("complete",c),e.removeListener("abort",f),e.removeListener("request",m),e.req&&e.req.removeListener("finish",c),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("end",u),e.removeListener("error",p),e.removeListener("close",f)}}})),b=t((function(t,e){var i=C.Buffer,r=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===r||!r(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=s,this.end=l,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=d,this.end=c,e=3;break;default:return this.write=h,void(this.end=u)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,i=function(t,e,i){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==i?i:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function s(t,e){if((t.length-e)%2==0){var i=t.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}function d(t,e){var i=(t.length-e)%3;return 0===i?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function u(t){return t&&t.length?this.write(t):""}e.StringDecoder=n,n.prototype.write=function(t){if(0===t.length)return"";var e,i;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""},n.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},n.prototype.text=function(t,e){var i=function(t,e,i){var r=e.length-1;if(r<i)return 0;var n=o(e[r]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--r<i||-2===n?0:(n=o(e[r]))>=0?(n>0&&(t.lastNeed=n-2),n):--r<i||-2===n?0:(n=o(e[r]))>=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var r=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}})),v=t((function(t,e){(function(e){(function(){var i=Object.keys||function(t){var e=[];for(var i in t)e.push(i);return e};t.exports=l;var r=p({}),n=y({});J(l,r);for(var o=i(n.prototype),a=0;a<o.length;a++){var s=o[a];l.prototype[s]||(l.prototype[s]=n.prototype[s])}function l(t){if(!(this instanceof l))return new l(t);r.call(this,t),n.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",d)))}function d(){this._writableState.ended||e.nextTick(c,this)}function c(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this)}).call(this,D)})),y=t((function(t,e){(function(e,i){(function(){function r(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,i){var r=t.entry;for(t.entry=null;r;){var n=r.callback;e.pendingcb--,n(void 0),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}var n;t.exports=k,k.WritableState=M;var o,a={deprecate:At},s=w({}).Buffer,l=i.Uint8Array||function(){},d=Et.getHighWaterMark,c=wt.codes,h=c.ERR_INVALID_ARG_TYPE,u=c.ERR_METHOD_NOT_IMPLEMENTED,p=c.ERR_MULTIPLE_CALLBACK,f=c.ERR_STREAM_CANNOT_PIPE,m=c.ERR_STREAM_DESTROYED,g=c.ERR_STREAM_NULL_VALUES,b=c.ERR_STREAM_WRITE_AFTER_END,y=c.ERR_UNKNOWN_ENCODING,_=_t.errorOrDestroy;function x(){}function M(t,i,o){n=n||v({}),t=t||{},"boolean"!=typeof o&&(o=i instanceof n),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=d(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,i){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new p;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),i)!function(t,i,r,n,o){--i.pendingcb,r?(e.nextTick(o,n),e.nextTick(I,t,i),t._writableState.errorEmitted=!0,_(t,n)):(o(n),t._writableState.errorEmitted=!0,_(t,n),I(t,i))}(t,r,n,i,o);else{var a=T(r)||t.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||A(t,r),n?e.nextTick(E,t,r,a,o):E(t,r,a,o)}}(i,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function k(t){var e=this instanceof(n=n||v({}));if(!e&&!o.call(k,this))return new k(t);this._writableState=new M(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),pt.call(this)}function S(t,e,i,r,n,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function E(t,e,i,r){i||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),I(t,e)}function A(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){var n=e.bufferedRequestCount,o=new Array(n),a=e.corkedRequestsFree;a.entry=i;for(var s=0,l=!0;i;)o[s]=i,i.isBuf||(l=!1),i=i.next,s+=1;o.allBuffers=l,S(t,e,!0,e.length,o,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new r(e),e.bufferedRequestCount=0}else{for(;i;){var d=i.chunk,c=i.encoding,h=i.callback;if(S(t,e,!1,e.objectMode?1:d.length,d,c,h),i=i.next,e.bufferedRequestCount--,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}function T(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function R(t,e){t._final((function(i){e.pendingcb--,i&&_(t,i),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,i){var r=T(i);if(r&&(function(t,i){i.prefinished||i.finalCalled||("function"!=typeof t._final||i.destroyed?(i.prefinished=!0,t.emit("prefinish")):(i.pendingcb++,i.finalCalled=!0,e.nextTick(R,t,i)))}(t,i),0===i.pendingcb&&(i.finished=!0,t.emit("finish"),i.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}J(k,pt),M.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(M.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===k&&t&&t._writableState instanceof M}})):o=function(t){return t instanceof this},k.prototype.pipe=function(){_(this,new f)},k.prototype.write=function(t,i,r){var n,o=this._writableState,a=!1,d=!o.objectMode&&(n=t,s.isBuffer(n)||n instanceof l);return d&&!s.isBuffer(t)&&(t=function(t){return s.from(t)}(t)),"function"==typeof i&&(r=i,i=null),d?i="buffer":i||(i=o.defaultEncoding),"function"!=typeof r&&(r=x),o.ending?function(t,i){var r=new b;_(t,r),e.nextTick(i,r)}(this,r):(d||function(t,i,r,n){var o;return null===r?o=new g:"string"==typeof r||i.objectMode||(o=new h("chunk",["string","Buffer"],r)),!o||(_(t,o),e.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,a=function(t,e,i,r,n,o){if(!i){var a=function(t,e,i){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=s.from(e,i)),e}(e,r,n);r!==a&&(i=!0,n="buffer",r=a)}var l=e.objectMode?1:r.length;e.length+=l;var d=e.length<e.highWaterMark;if(d||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:n,isBuf:i,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else S(t,e,!1,l,r,n,o);return d}(this,o,d,t,i,r)),a},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||A(this,t))},k.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new y(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,i){i(new u("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,i,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,i=null):"function"==typeof i&&(r=i,i=null),null!=t&&this.write(t,i),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,i,r){i.ending=!0,I(t,i),r&&(i.finished?e.nextTick(r):t.once("finish",r)),i.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=_t.destroy,k.prototype._undestroy=_t.undestroy,k.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,D,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),_=t((function(t,e){})),w=t((function(t,e){(function(t){(function(){function t(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,i){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return o(t)}return r(t,e,i)}function r(e,r,n){if("string"==typeof e)return function(e,r){if("string"==typeof r&&""!==r||(r="utf8"),!i.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var n=0|l(e,r),o=t(n),a=o.write(e,r);return a!==n&&(o=o.slice(0,a)),o}(e,r);if(ArrayBuffer.isView(e))return a(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r)).__proto__=i.prototype,n}(e,r,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var o=e.valueOf&&e.valueOf();if(null!=o&&o!==e)return i.from(o,r,n);var d=function(e){if(i.isBuffer(e)){var r=0|s(e.length),n=t(r);return 0===n.length||e.copy(n,0,0,r),n}return void 0!==e.length?"number"!=typeof e.length||B(e.length)?t(0):a(e):"Buffer"===e.type&&Array.isArray(e.data)?a(e.data):void 0}(e);if(d)return d;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),r,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function n(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function o(e){return n(e),t(e<0?0:0|s(e))}function a(e){for(var i=e.length<0?0:0|s(e.length),r=t(i),n=0;n<i;n+=1)r[n]=255&e[n];return r}function s(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function l(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(t).length;default:if(o)return n?-1:P(t).length;e=(""+e).toLowerCase(),o=!0}}function d(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function c(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),B(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:h(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):h(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function h(t,e,i,r,n){var o,a=1,s=t.length,l=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,i/=2}function d(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(n){var c=-1;for(o=i;o<s;o++)if(d(t,o)===d(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(i+l>s&&(i=s-l),o=i;o>=0;o--){for(var h=!0,u=0;u<l;u++)if(d(t,o+u)!==d(e,u)){h=!1;break}if(h)return o}return-1}function u(t,e,i,r){i=Number(i)||0;var n=t.length-i;r?(r=Number(r))>n&&(r=n):r=n;var o=e.length;r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(B(s))return a;t[i+a]=s}return a}function p(t,e,i,r){return $(P(e,t.length-i),t,i,r)}function f(t,e,i,r){return $(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,r)}function m(t,e,i,r){return f(t,e,i,r)}function g(t,e,i,r){return $(L(e),t,i,r)}function b(t,e,i,r){return $(function(t,e){for(var i,r,n,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=(i=t.charCodeAt(a))>>8,n=i%256,o.push(n),o.push(r);return o}(e,t.length-i),t,i,r)}function v(t,e,i){return 0===e&&i===t.length?x.fromByteArray(t):x.fromByteArray(t.slice(e,i))}function y(t,e,i){i=Math.min(t.length,i);for(var r=[],n=e;n<i;){var o,a,s,l,d=t[n],c=null,h=d>239?4:d>223?3:d>191?2:1;if(n+h<=i)switch(h){case 1:d<128&&(c=d);break;case 2:128==(192&(o=t[n+1]))&&(l=(31&d)<<6|63&o)>127&&(c=l);break;case 3:o=t[n+1],a=t[n+2],128==(192&o)&&128==(192&a)&&(l=(15&d)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=t[n+1],a=t[n+2],s=t[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&d)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),n+=h}return function(t){var e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);for(var i="",r=0;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=_));return i}(r)}e.Buffer=i,e.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=2147483647,i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,i){return r(t,e,i)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,i,r){return function(e,i,r){return n(e),e<=0?t(e):void 0!==i?"string"==typeof r?t(e).fill(i,r):t(e).fill(i):t(e)}(e,i,r)},i.allocUnsafe=function(t){return o(t)},i.allocUnsafeSlow=function(t){return o(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==i.prototype},i.compare=function(t,e){if(N(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),N(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,a=Math.min(r,n);o<a;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=i.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(N(a,Uint8Array)&&(a=i.from(a)),!i.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},i.byteLength=l,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)d(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},i.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?y(this,0,t):function(t,e,i){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,i);case"utf8":case"utf-8":return y(this,e,i);case"ascii":return w(this,e,i);case"latin1":case"binary":return M(this,e,i);case"base64":return v(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t="",i=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(t+=" ... "),"<Buffer "+t+">"},i.prototype.compare=function(t,e,r,n,o){if(N(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(a,s),d=this.slice(n,o),c=t.slice(e,r),h=0;h<l;++h)if(d[h]!==c[h]){a=d[h],s=c[h];break}return a<s?-1:s<a?1:0},i.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},i.prototype.indexOf=function(t,e,i){return c(this,t,e,i,!0)},i.prototype.lastIndexOf=function(t,e,i){return c(this,t,e,i,!1)},i.prototype.write=function(t,e,i,r){if(void 0===e)r="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)r=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(i)?(i>>>=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var n=this.length-e;if((void 0===i||i>n)&&(i=n),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return u(this,t,e,i);case"utf8":case"utf-8":return p(this,t,e,i);case"ascii":return f(this,t,e,i);case"latin1":case"binary":return m(this,t,e,i);case"base64":return g(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,e,i);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function w(t,e,i){var r="";i=Math.min(t.length,i);for(var n=e;n<i;++n)r+=String.fromCharCode(127&t[n]);return r}function M(t,e,i){var r="";i=Math.min(t.length,i);for(var n=e;n<i;++n)r+=String.fromCharCode(t[n]);return r}function k(t,e,i){var r,n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);for(var o="",a=e;a<i;++a)o+=(r=t[a])<16?"0"+r.toString(16):r.toString(16);return o}function S(t,e,i){for(var r=t.slice(e,i),n="",o=0;o<r.length;o+=2)n+=String.fromCharCode(r[o]+256*r[o+1]);return n}function E(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function A(t,e,r,n,o,a){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function T(t,e,i,r,n,o){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function R(t,e,i,r,n){return e=+e,i>>>=0,n||T(t,0,i,4),I.write(t,e,i,r,23,4),i+4}function C(t,e,i,r,n){return e=+e,i>>>=0,n||T(t,0,i,8),I.write(t,e,i,r,52,8),i+8}i.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=i.prototype,n},i.prototype.readUIntLE=function(t,e,i){t>>>=0,e>>>=0,i||E(t,e,this.length);for(var r=this[t],n=1,o=0;++o<e&&(n*=256);)r+=this[t+o]*n;return r},i.prototype.readUIntBE=function(t,e,i){t>>>=0,e>>>=0,i||E(t,e,this.length);for(var r=this[t+--e],n=1;e>0&&(n*=256);)r+=this[t+--e]*n;return r},i.prototype.readUInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,i){t>>>=0,e>>>=0,i||E(t,e,this.length);for(var r=this[t],n=1,o=0;++o<e&&(n*=256);)r+=this[t+o]*n;return r>=(n*=128)&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,i){t>>>=0,e>>>=0,i||E(t,e,this.length);for(var r=e,n=1,o=this[t+--r];r>0&&(n*=256);)o+=this[t+--r]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},i.prototype.readInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||E(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},i.prototype.readInt16BE=function(t,e){t>>>=0,e||E(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||E(t,4,this.length),I.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||E(t,4,this.length),I.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||E(t,8,this.length),I.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||E(t,8,this.length),I.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,i,r){t=+t,e>>>=0,i>>>=0,r||A(this,t,e,i,Math.pow(2,8*i)-1,0);var n=1,o=0;for(this[e]=255&t;++o<i&&(n*=256);)this[e+o]=t/n&255;return e+i},i.prototype.writeUIntBE=function(t,e,i,r){t=+t,e>>>=0,i>>>=0,r||A(this,t,e,i,Math.pow(2,8*i)-1,0);var n=i-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+i},i.prototype.writeUInt8=function(t,e,i){return t=+t,e>>>=0,i||A(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,i){return t=+t,e>>>=0,i||A(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,i){return t=+t,e>>>=0,i||A(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,i){return t=+t,e>>>=0,i||A(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,i){return t=+t,e>>>=0,i||A(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,i,r){if(t=+t,e>>>=0,!r){var n=Math.pow(2,8*i-1);A(this,t,e,i,n-1,-n)}var o=0,a=1,s=0;for(this[e]=255&t;++o<i&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+i},i.prototype.writeIntBE=function(t,e,i,r){if(t=+t,e>>>=0,!r){var n=Math.pow(2,8*i-1);A(this,t,e,i,n-1,-n)}var o=i-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+i},i.prototype.writeInt8=function(t,e,i){return t=+t,e>>>=0,i||A(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,i){return t=+t,e>>>=0,i||A(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,i){return t=+t,e>>>=0,i||A(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,i){return t=+t,e>>>=0,i||A(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,i){return t=+t,e>>>=0,i||A(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,i){return R(this,t,e,!0,i)},i.prototype.writeFloatBE=function(t,e,i){return R(this,t,e,!1,i)},i.prototype.writeDoubleLE=function(t,e,i){return C(this,t,e,!0,i)},i.prototype.writeDoubleBE=function(t,e,i){return C(this,t,e,!1,i)},i.prototype.copy=function(t,e,r,n){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var a=o-1;a>=0;--a)t[a+e]=this[a+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return o},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var a;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a<r;++a)this[a]=t;else{var s=i.isBuffer(t)?t:i.from(t,n),l=s.length;if(0===l)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(a=0;a<r-e;++a)this[a+e]=s[a%l]}return this};var O=/[^+/0-9A-Za-z-_]/g;function P(t,e){var i;e=e||1/0;for(var r=t.length,n=null,o=[],a=0;a<r;++a){if((i=t.charCodeAt(a))>55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function L(t){return x.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function $(t,e,i,r){for(var n=0;n<r&&!(n+i>=e.length||n>=t.length);++n)e[n+i]=t[n];return n}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function B(t){return t!=t}}).call(this)}).call(this,w({}).Buffer)})),x={toByteArray:function(t){var e,i,r=function(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}(t),n=r[0],o=r[1],a=new S(function(t,e,i){return 3*(e+i)/4-i}(0,n,o)),s=0,l=o>0?n-4:n;for(i=0;i<l;i+=4)e=k[t.charCodeAt(i)]<<18|k[t.charCodeAt(i+1)]<<12|k[t.charCodeAt(i+2)]<<6|k[t.charCodeAt(i+3)],a[s++]=e>>16&255,a[s++]=e>>8&255,a[s++]=255&e;return 2===o&&(e=k[t.charCodeAt(i)]<<2|k[t.charCodeAt(i+1)]>>4,a[s++]=255&e),1===o&&(e=k[t.charCodeAt(i)]<<10|k[t.charCodeAt(i+1)]<<4|k[t.charCodeAt(i+2)]>>2,a[s++]=e>>8&255,a[s++]=255&e),a},fromByteArray:function(t){for(var e,i=t.length,r=i%3,n=[],o=0,a=i-r;o<a;o+=16383)n.push(R(t,o,o+16383>a?a:o+16383));return 1===r?(e=t[i-1],n.push(M[e>>2]+M[e<<4&63]+"==")):2===r&&(e=(t[i-2]<<8)+t[i-1],n.push(M[e>>10]+M[e>>4&63]+M[e<<2&63]+"=")),n.join("")}},M=[],k=[],S="undefined"!=typeof Uint8Array?Uint8Array:Array,E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=0,T=E.length;A<T;++A)M[A]=E[A],k[E.charCodeAt(A)]=A;function R(t,e,i){for(var r,n,o=[],a=e;a<i;a+=3)r=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(M[(n=r)>>18&63]+M[n>>12&63]+M[n>>6&63]+M[63&n]);return o.join("")}k["-".charCodeAt(0)]=62,k["_".charCodeAt(0)]=63;var I={read:function(t,e,i,r,n){var o,a,s=8*n-r-1,l=(1<<s)-1,d=l>>1,c=-7,h=i?n-1:0,u=i?-1:1,p=t[e+h];for(h+=u,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=u,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+h],h+=u,c-=8);if(0===o)o=1-d;else{if(o===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=d}return(p?-1:1)*a*Math.pow(2,o-r)},write:function(t,e,i,r,n,o){var a,s,l,d=8*o-n-1,c=(1<<d)-1,h=c>>1,u=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?u/l:u*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*l-1)*Math.pow(2,n),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+p]=255&s,p+=f,s/=256,n-=8);for(a=a<<n|s,d+=n;d>0;t[i+p]=255&a,p+=f,a/=256,d-=8);t[i+p-f]|=128*m}},C={},O=w({}),P=O.Buffer;function L(t,e){for(var i in t)e[i]=t[i]}function $(t,e,i){return P(t,e,i)}P.from&&P.alloc&&P.allocUnsafe&&P.allocUnsafeSlow?C=O:(L(O,C),C.Buffer=$),$.prototype=Object.create(P.prototype),L(P,$),$.from=function(t,e,i){if("number"==typeof t)throw new TypeError("Argument must not be a number");return P(t,e,i)},$.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=P(t);return void 0!==e?"string"==typeof i?r.fill(e,i):r.fill(e):r.fill(0),r},$.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return P(t)},$.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return O.SlowBuffer(t)};var N,B,D={},j=D={};function z(){throw new Error("setTimeout has not been defined")}function F(){throw new Error("clearTimeout has not been defined")}function U(t){if(N===setTimeout)return setTimeout(t,0);if((N===z||!N)&&setTimeout)return N=setTimeout,setTimeout(t,0);try{return N(t,0)}catch(e){try{return N.call(null,t,0)}catch(e){return N.call(this,t,0)}}}!function(){try{N="function"==typeof setTimeout?setTimeout:z}catch(t){N=z}try{B="function"==typeof clearTimeout?clearTimeout:F}catch(t){B=F}}();var q,H=[],V=!1,W=-1;function G(){V&&q&&(V=!1,q.length?H=q.concat(H):W=-1,H.length&&K())}function K(){if(!V){var t=U(G);V=!0;for(var e=H.length;e;){for(q=H,H=[];++W<e;)q&&q[W].run();W=-1,e=H.length}q=null,V=!1,function(t){if(B===clearTimeout)return clearTimeout(t);if((B===F||!B)&&clearTimeout)return B=clearTimeout,clearTimeout(t);try{B(t)}catch(e){try{return B.call(null,t)}catch(e){return B.call(this,t)}}}(t)}}function X(t,e){this.fun=t,this.array=e}function Y(){}j.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];H.push(new X(t,e)),1!==H.length||V||U(K)},X.prototype.run=function(){this.fun.apply(null,this.array)},j.title="browser",j.browser=!0,j.env={},j.argv=[],j.version="",j.versions={},j.on=Y,j.addListener=Y,j.once=Y,j.off=Y,j.removeListener=Y,j.removeAllListeners=Y,j.emit=Y,j.prependListener=Y,j.prependOnceListener=Y,j.listeners=function(t){return[]},j.binding=function(t){throw new Error("process.binding is not supported")},j.cwd=function(){return"/"},j.chdir=function(t){throw new Error("process.chdir is not supported")},j.umask=function(){return 0};var Z={};(function(t,e){(function(){var i=C.Buffer,r=e.crypto||e.msCrypto;Z=r&&r.getRandomValues?function(e,n){if(e>4294967295)throw new RangeError("requested too many random bytes");var o=i.allocUnsafe(e);if(e>0)if(e>65536)for(var a=0;a<e;a+=65536)r.getRandomValues(o.slice(a,a+65536));else r.getRandomValues(o);return"function"==typeof n?t.nextTick((function(){n(null,o)})):o}:function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this)}).call(this,D,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var J={};J="function"==typeof Object.create?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}};var Q,tt={},et="object"==typeof Reflect?Reflect:null,it=et&&"function"==typeof et.apply?et.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};Q=et&&"function"==typeof et.ownKeys?et.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var rt=Number.isNaN||function(t){return t!=t};function nt(){nt.init.call(this)}(tt=nt).once=function(t,e){return new Promise((function(i,r){function n(){void 0!==o&&t.removeListener("error",o),i([].slice.call(arguments))}var o;"error"!==e&&(o=function(i){t.removeListener(e,n),r(i)},t.once("error",o)),t.once(e,n)}))},nt.EventEmitter=nt,nt.prototype._events=void 0,nt.prototype._eventsCount=0,nt.prototype._maxListeners=void 0;var ot=10;function at(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function st(t){return void 0===t._maxListeners?nt.defaultMaxListeners:t._maxListeners}function lt(t,e,i,r){var n,o,a,s;if(at(i),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),a=o[e]),void 0===a)a=o[e]=i,++t._eventsCount;else if("function"==typeof a?a=o[e]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),(n=st(t))>0&&a.length>n&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,s=l,console&&console.warn&&console.warn(s)}return t}function dt(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(r);return n.listener=i,r.wrapFn=n,n}function ct(t,e,i){var r=t._events;if(void 0===r)return[];var n=r[e];return void 0===n?[]:"function"==typeof n?i?[n.listener||n]:[n]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(n):ut(n,n.length)}function ht(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function ut(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}Object.defineProperty(nt,"defaultMaxListeners",{enumerable:!0,get:function(){return ot},set:function(t){if("number"!=typeof t||t<0||rt(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");ot=t}}),nt.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},nt.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||rt(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},nt.prototype.getMaxListeners=function(){return st(this)},nt.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var r="error"===t,n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=n[t];if(void 0===s)return!1;if("function"==typeof s)it(s,this,e);else{var l=s.length,d=ut(s,l);for(i=0;i<l;++i)it(d[i],this,e)}return!0},nt.prototype.addListener=function(t,e){return lt(this,t,e,!1)},nt.prototype.on=nt.prototype.addListener,nt.prototype.prependListener=function(t,e){return lt(this,t,e,!0)},nt.prototype.once=function(t,e){return at(e),this.on(t,dt(this,t,e)),this},nt.prototype.prependOnceListener=function(t,e){return at(e),this.prependListener(t,dt(this,t,e)),this},nt.prototype.removeListener=function(t,e){var i,r,n,o,a;if(at(e),void 0===(r=this._events))return this;if(void 0===(i=r[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(n=-1,o=i.length-1;o>=0;o--)if(i[o]===e||i[o].listener===e){a=i[o].listener,n=o;break}if(n<0)return this;0===n?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,n),1===i.length&&(r[t]=i[0]),void 0!==r.removeListener&&this.emit("removeListener",t,a||e)}return this},nt.prototype.off=nt.prototype.removeListener,nt.prototype.removeAllListeners=function(t){var e,i,r;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var n,o=Object.keys(i);for(r=0;r<o.length;++r)"removeListener"!==(n=o[r])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},nt.prototype.listeners=function(t){return ct(this,t,!0)},nt.prototype.rawListeners=function(t){return ct(this,t,!1)},nt.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):ht.call(t,e)},nt.prototype.listenerCount=ht,nt.prototype.eventNames=function(){return this._eventsCount>0?Q(this._events):[]};var pt=tt.EventEmitter;function ft(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function mt(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var gt=w({}).Buffer,bt=_({}).inspect,vt=bt&&bt.custom||"inspect",yt=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e;return(e=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i}},{key:"concat",value:function(t){if(0===this.length)return gt.alloc(0);for(var e,i,r,n=gt.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,i=n,r=a,gt.prototype.copy.call(e,i,r),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var i;return t<this.head.data.length?(i=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):i=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,i=1,r=e.data;for(t-=r.length;e=e.next;){var n=e.data,o=t>n.length?n.length:t;if(o===n.length?r+=n:r+=n.slice(0,t),0==(t-=o)){o===n.length?(++i,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(o));break}++i}return this.length-=i,r}},{key:"_getBuffer",value:function(t){var e=gt.allocUnsafe(t),i=this.head,r=1;for(i.data.copy(e),t-=i.data.length;i=i.next;){var n=i.data,o=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,o),0==(t-=o)){o===n.length?(++r,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=n.slice(o));break}++r}return this.length-=r,e}},{key:vt,value:function(t,e){return bt(this,function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ft(Object(i),!0).forEach((function(e){mt(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ft(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(t.prototype,e),t}(),_t={};(function(t){(function(){function e(t,e){r(t,e),i(t)}function i(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function r(t,e){t.emit("error",e)}_t={destroy:function(n,o){var a=this,s=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return s||l?(o?o(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(r,this,n)):t.nextTick(r,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,(function(r){!o&&r?a._writableState?a._writableState.errorEmitted?t.nextTick(i,a):(a._writableState.errorEmitted=!0,t.nextTick(e,a,r)):t.nextTick(e,a,r):o?(t.nextTick(i,a),o(r)):t.nextTick(i,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var i=t._readableState,r=t._writableState;i&&i.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this)}).call(this,D);var wt={},xt={};function Mt(t,e,i){i||(i=Error);var r=function(t){var i,r;function n(i,r,n){return t.call(this,function(t,i,r){return"string"==typeof e?e:e(t,i,r)}(i,r,n))||this}return r=t,(i=n).prototype=Object.create(r.prototype),i.prototype.constructor=i,i.__proto__=r,n}(i);r.prototype.name=i.name,r.prototype.code=t,xt[t]=r}function kt(t,e){if(Array.isArray(t)){var i=t.length;return t=t.map((function(t){return String(t)})),i>2?"one of ".concat(e," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}Mt("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),Mt("ERR_INVALID_ARG_TYPE",(function(t,e,i){var r,n,o,a;if("string"==typeof e&&"not "===e.substr(0,"not ".length)?(r="must not be",e=e.replace(/^not /,"")):r="must be",o=t,(void 0===a||a>o.length)&&(a=o.length)," argument"===o.substring(a-" argument".length,a))n="The ".concat(t," ").concat(r," ").concat(kt(e,"type"));else{var s=function(t,e,i){return"number"!=typeof i&&(i=0),!(i+".".length>t.length)&&-1!==t.indexOf(".",i)}(t)?"property":"argument";n='The "'.concat(t,'" ').concat(s," ").concat(r," ").concat(kt(e,"type"))}return n+". Received type ".concat(typeof i)}),TypeError),Mt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),Mt("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),Mt("ERR_STREAM_PREMATURE_CLOSE","Premature close"),Mt("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),Mt("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),Mt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),Mt("ERR_STREAM_WRITE_AFTER_END","write after end"),Mt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),Mt("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),Mt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),wt.codes=xt;var St=wt.codes.ERR_INVALID_OPT_VALUE,Et={getHighWaterMark:function(t,e,i,r){var n=function(t,e,i){return null!=t.highWaterMark?t.highWaterMark:e?t[i]:null}(e,r,i);if(null!=n){if(!isFinite(n)||Math.floor(n)!==n||n<0)throw new St(r?i:"highWaterMark",n);return Math.floor(n)}return t.objectMode?16:16384}},At={};(function(t){(function(){function e(e){try{if(!t.localStorage)return!1}catch(t){return!1}var i=t.localStorage[e];return null!=i&&"true"===String(i).toLowerCase()}At=function(t,i){if(e("noDeprecation"))return t;var r=!1;return function(){if(!r){if(e("throwDeprecation"))throw new Error(i);e("traceDeprecation")?console.trace(i):console.warn(i),r=!0}return t.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Tt=Nt,Rt=wt.codes,It=Rt.ERR_METHOD_NOT_IMPLEMENTED,Ct=Rt.ERR_MULTIPLE_CALLBACK,Ot=Rt.ERR_TRANSFORM_ALREADY_TRANSFORMING,Pt=Rt.ERR_TRANSFORM_WITH_LENGTH_0,Lt=v({});function $t(t,e){var i=this._transformState;i.transforming=!1;var r=i.writecb;if(null===r)return this.emit("error",new Ct);i.writechunk=null,i.writecb=null,null!=e&&this.push(e),r(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Nt(t){if(!(this instanceof Nt))return new Nt(t);Lt.call(this,t),this._transformState={afterTransform:$t.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",Bt)}function Bt(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?Dt(this,null,null):this._flush((function(e,i){Dt(t,e,i)}))}function Dt(t,e,i){if(e)return t.emit("error",e);if(null!=i&&t.push(i),t._writableState.length)throw new Pt;if(t._transformState.transforming)throw new Ot;return t.push(null)}J(Nt,Lt),Nt.prototype.push=function(t,e){return this._transformState.needTransform=!1,Lt.prototype.push.call(this,t,e)},Nt.prototype._transform=function(t,e,i){i(new It("_transform()"))},Nt.prototype._write=function(t,e,i){var r=this._transformState;if(r.writecb=i,r.writechunk=t,r.writeencoding=e,!r.transforming){var n=this._readableState;(r.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},Nt.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},Nt.prototype._destroy=function(t,e){Lt.prototype._destroy.call(this,t,(function(t){e(t)}))};var jt,zt=Ft;function Ft(t){if(!(this instanceof Ft))return new Ft(t);Tt.call(this,t)}J(Ft,Tt),Ft.prototype._transform=function(t,e,i){i(null,t)};var Ut=wt.codes,qt=Ut.ERR_MISSING_ARGS,Ht=Ut.ERR_STREAM_DESTROYED;function Vt(t){if(t)throw t}function Wt(t){t()}function Gt(t,e){return t.pipe(e)}var Kt={};(Kt=Kt=p({})).Stream=Kt,Kt.Readable=Kt,Kt.Writable=y({}),Kt.Duplex=v({}),Kt.Transform=Tt,Kt.PassThrough=zt,Kt.finished=g({}),Kt.pipeline=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var r,n=function(t){return t.length?"function"!=typeof t[t.length-1]?Vt:t.pop():Vt}(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new qt("streams");var o=e.map((function(t,i){var a=i<e.length-1;return function(t,e,i,r){r=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(r);var n=!1;t.on("close",(function(){n=!0})),void 0===jt&&(jt=g({})),jt(t,{readable:e,writable:i},(function(t){if(t)return r(t);n=!0,r()}));var o=!1;return function(e){if(!n&&!o)return o=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void r(e||new Ht("pipe"))}}(t,a,i>0,(function(t){r||(r=t),t&&o.forEach(Wt),a||(o.forEach(Wt),n(r))}))}));return e.reduce(Gt)};var Xt={},Yt=C.Buffer,Zt=Kt.Transform;function Jt(t){Zt.call(this),this._block=Yt.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}J(Jt,Zt),Jt.prototype._transform=function(t,e,i){var r=null;try{this.update(t,e)}catch(t){r=t}i(r)},Jt.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},Jt.prototype.update=function(t,e){if(function(t,e){if(!Yt.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");Yt.isBuffer(t)||(t=Yt.from(t,e));for(var i=this._block,r=0;this._blockOffset+t.length-r>=this._blockSize;){for(var n=this._blockOffset;n<this._blockSize;)i[n++]=t[r++];this._update(),this._blockOffset=0}for(;r<t.length;)i[this._blockOffset++]=t[r++];for(var o=0,a=8*t.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},Jt.prototype._update=function(){throw new Error("_update is not implemented")},Jt.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var i=0;i<4;++i)this._length[i]=0;return e},Jt.prototype._digest=function(){throw new Error("_digest is not implemented")},Xt=Jt;var Qt={},te=C.Buffer,ee=new Array(16);function ie(){Xt.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function re(t,e){return t<<e|t>>>32-e}function ne(t,e,i,r,n,o,a){return re(t+(e&i|~e&r)+n+o|0,a)+e|0}function oe(t,e,i,r,n,o,a){return re(t+(e&r|i&~r)+n+o|0,a)+e|0}function ae(t,e,i,r,n,o,a){return re(t+(e^i^r)+n+o|0,a)+e|0}function se(t,e,i,r,n,o,a){return re(t+(i^(e|~r))+n+o|0,a)+e|0}J(ie,Xt),ie.prototype._update=function(){for(var t=ee,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var i=this._a,r=this._b,n=this._c,o=this._d;i=ne(i,r,n,o,t[0],3614090360,7),o=ne(o,i,r,n,t[1],3905402710,12),n=ne(n,o,i,r,t[2],606105819,17),r=ne(r,n,o,i,t[3],3250441966,22),i=ne(i,r,n,o,t[4],4118548399,7),o=ne(o,i,r,n,t[5],1200080426,12),n=ne(n,o,i,r,t[6],2821735955,17),r=ne(r,n,o,i,t[7],4249261313,22),i=ne(i,r,n,o,t[8],1770035416,7),o=ne(o,i,r,n,t[9],2336552879,12),n=ne(n,o,i,r,t[10],4294925233,17),r=ne(r,n,o,i,t[11],2304563134,22),i=ne(i,r,n,o,t[12],1804603682,7),o=ne(o,i,r,n,t[13],4254626195,12),n=ne(n,o,i,r,t[14],2792965006,17),i=oe(i,r=ne(r,n,o,i,t[15],1236535329,22),n,o,t[1],4129170786,5),o=oe(o,i,r,n,t[6],3225465664,9),n=oe(n,o,i,r,t[11],643717713,14),r=oe(r,n,o,i,t[0],3921069994,20),i=oe(i,r,n,o,t[5],3593408605,5),o=oe(o,i,r,n,t[10],38016083,9),n=oe(n,o,i,r,t[15],3634488961,14),r=oe(r,n,o,i,t[4],3889429448,20),i=oe(i,r,n,o,t[9],568446438,5),o=oe(o,i,r,n,t[14],3275163606,9),n=oe(n,o,i,r,t[3],4107603335,14),r=oe(r,n,o,i,t[8],1163531501,20),i=oe(i,r,n,o,t[13],2850285829,5),o=oe(o,i,r,n,t[2],4243563512,9),n=oe(n,o,i,r,t[7],1735328473,14),i=ae(i,r=oe(r,n,o,i,t[12],2368359562,20),n,o,t[5],4294588738,4),o=ae(o,i,r,n,t[8],2272392833,11),n=ae(n,o,i,r,t[11],1839030562,16),r=ae(r,n,o,i,t[14],4259657740,23),i=ae(i,r,n,o,t[1],2763975236,4),o=ae(o,i,r,n,t[4],1272893353,11),n=ae(n,o,i,r,t[7],4139469664,16),r=ae(r,n,o,i,t[10],3200236656,23),i=ae(i,r,n,o,t[13],681279174,4),o=ae(o,i,r,n,t[0],3936430074,11),n=ae(n,o,i,r,t[3],3572445317,16),r=ae(r,n,o,i,t[6],76029189,23),i=ae(i,r,n,o,t[9],3654602809,4),o=ae(o,i,r,n,t[12],3873151461,11),n=ae(n,o,i,r,t[15],530742520,16),i=se(i,r=ae(r,n,o,i,t[2],3299628645,23),n,o,t[0],4096336452,6),o=se(o,i,r,n,t[7],1126891415,10),n=se(n,o,i,r,t[14],2878612391,15),r=se(r,n,o,i,t[5],4237533241,21),i=se(i,r,n,o,t[12],1700485571,6),o=se(o,i,r,n,t[3],2399980690,10),n=se(n,o,i,r,t[10],4293915773,15),r=se(r,n,o,i,t[1],2240044497,21),i=se(i,r,n,o,t[8],1873313359,6),o=se(o,i,r,n,t[15],4264355552,10),n=se(n,o,i,r,t[6],2734768916,15),r=se(r,n,o,i,t[13],1309151649,21),i=se(i,r,n,o,t[4],4149444226,6),o=se(o,i,r,n,t[11],3174756917,10),n=se(n,o,i,r,t[2],718787259,15),r=se(r,n,o,i,t[9],3951481745,21),this._a=this._a+i|0,this._b=this._b+r|0,this._c=this._c+n|0,this._d=this._d+o|0},ie.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=te.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},Qt=ie;var le={},de=w({}).Buffer,ce=new Array(16),he=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],ue=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],pe=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],fe=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],me=[0,1518500249,1859775393,2400959708,2840853838],ge=[1352829926,1548603684,1836072691,2053994217,0];function be(){Xt.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function ve(t,e){return t<<e|t>>>32-e}function ye(t,e,i,r,n,o,a,s){return ve(t+(e^i^r)+o+a|0,s)+n|0}function _e(t,e,i,r,n,o,a,s){return ve(t+(e&i|~e&r)+o+a|0,s)+n|0}function we(t,e,i,r,n,o,a,s){return ve(t+((e|~i)^r)+o+a|0,s)+n|0}function xe(t,e,i,r,n,o,a,s){return ve(t+(e&r|i&~r)+o+a|0,s)+n|0}function Me(t,e,i,r,n,o,a,s){return ve(t+(e^(i|~r))+o+a|0,s)+n|0}J(be,Xt),be.prototype._update=function(){for(var t=ce,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var i=0|this._a,r=0|this._b,n=0|this._c,o=0|this._d,a=0|this._e,s=0|this._a,l=0|this._b,d=0|this._c,c=0|this._d,h=0|this._e,u=0;u<80;u+=1){var p,f;u<16?(p=ye(i,r,n,o,a,t[he[u]],me[0],pe[u]),f=Me(s,l,d,c,h,t[ue[u]],ge[0],fe[u])):u<32?(p=_e(i,r,n,o,a,t[he[u]],me[1],pe[u]),f=xe(s,l,d,c,h,t[ue[u]],ge[1],fe[u])):u<48?(p=we(i,r,n,o,a,t[he[u]],me[2],pe[u]),f=we(s,l,d,c,h,t[ue[u]],ge[2],fe[u])):u<64?(p=xe(i,r,n,o,a,t[he[u]],me[3],pe[u]),f=_e(s,l,d,c,h,t[ue[u]],ge[3],fe[u])):(p=Me(i,r,n,o,a,t[he[u]],me[4],pe[u]),f=ye(s,l,d,c,h,t[ue[u]],ge[4],fe[u])),i=a,a=o,o=ve(n,10),n=r,r=p,s=h,h=c,c=ve(d,10),d=l,l=f}var m=this._b+n+c|0;this._b=this._c+o+h|0,this._c=this._d+a+s|0,this._d=this._e+i+l|0,this._e=this._a+r+d|0,this._a=m},be.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=de.alloc?de.alloc(20):new de(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},le=be;var ke={},Se=C.Buffer;function Ee(t,e){this._block=Se.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}Ee.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=Se.from(t,e));for(var i=this._block,r=this._blockSize,n=t.length,o=this._len,a=0;a<n;){for(var s=o%r,l=Math.min(n-a,r-s),d=0;d<l;d++)i[s+d]=t[a+d];a+=l,(o+=l)%r==0&&this._update(i)}return this._len+=n,this},Ee.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=8*this._len;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var r=(4294967295&i)>>>0,n=(i-r)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},Ee.prototype._update=function(){throw new Error("_update must be implemented by subclass")},ke=Ee;var Ae,Te=C.Buffer,Re=[1518500249,1859775393,-1894007588,-899497514],Ie=new Array(80);function Ce(){this.init(),this._w=Ie,ke.call(this,64,56)}function Oe(t){return t<<30|t>>>2}function Pe(t,e,i,r){return 0===t?e&i|~e&r:2===t?e&i|e&r|i&r:e^i^r}J(Ce,ke),Ce.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Ce.prototype._update=function(t){for(var e,i=this._w,r=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,l=0;l<16;++l)i[l]=t.readInt32BE(4*l);for(;l<80;++l)i[l]=i[l-3]^i[l-8]^i[l-14]^i[l-16];for(var d=0;d<80;++d){var c=~~(d/20),h=0|((e=r)<<5|e>>>27)+Pe(c,n,o,a)+s+i[d]+Re[c];s=a,a=o,o=Oe(n),n=r,r=h}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},Ce.prototype._hash=function(){var t=Te.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},Ae=Ce;var Le,$e=C.Buffer,Ne=[1518500249,1859775393,-1894007588,-899497514],Be=new Array(80);function De(){this.init(),this._w=Be,ke.call(this,64,56)}function je(t){return t<<5|t>>>27}function ze(t){return t<<30|t>>>2}function Fe(t,e,i,r){return 0===t?e&i|~e&r:2===t?e&i|e&r|i&r:e^i^r}J(De,ke),De.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},De.prototype._update=function(t){for(var e,i=this._w,r=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,l=0;l<16;++l)i[l]=t.readInt32BE(4*l);for(;l<80;++l)i[l]=(e=i[l-3]^i[l-8]^i[l-14]^i[l-16])<<1|e>>>31;for(var d=0;d<80;++d){var c=~~(d/20),h=je(r)+Fe(c,n,o,a)+s+i[d]+Ne[c]|0;s=a,a=o,o=ze(n),n=r,r=h}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},De.prototype._hash=function(){var t=$e.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},Le=De;var Ue,qe=C.Buffer,He=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Ve=new Array(64);function We(){this.init(),this._w=Ve,ke.call(this,64,56)}function Ge(t,e,i){return i^t&(e^i)}function Ke(t,e,i){return t&e|i&(t|e)}function Xe(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function Ye(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function Ze(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}J(We,ke),We.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},We.prototype._update=function(t){for(var e,i=this._w,r=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,l=0|this._f,d=0|this._g,c=0|this._h,h=0;h<16;++h)i[h]=t.readInt32BE(4*h);for(;h<64;++h)i[h]=0|(((e=i[h-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+i[h-7]+Ze(i[h-15])+i[h-16];for(var u=0;u<64;++u){var p=c+Ye(s)+Ge(s,l,d)+He[u]+i[u]|0,f=Xe(r)+Ke(r,n,o)|0;c=d,d=l,l=s,s=a+p|0,a=o,o=n,n=r,r=p+f|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0,this._f=l+this._f|0,this._g=d+this._g|0,this._h=c+this._h|0},We.prototype._hash=function(){var t=qe.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},Ue=We;var Je,Qe=C.Buffer,ti=new Array(64);function ei(){this.init(),this._w=ti,ke.call(this,64,56)}J(ei,Ue),ei.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},ei.prototype._hash=function(){var t=Qe.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},Je=ei;var ii,ri=C.Buffer,ni=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],oi=new Array(160);function ai(){this.init(),this._w=oi,ke.call(this,128,112)}function si(t,e,i){return i^t&(e^i)}function li(t,e,i){return t&e|i&(t|e)}function di(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function ci(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function hi(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function ui(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function pi(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function fi(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function mi(t,e){return t>>>0<e>>>0?1:0}J(ai,ke),ai.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},ai.prototype._update=function(t){for(var e=this._w,i=0|this._ah,r=0|this._bh,n=0|this._ch,o=0|this._dh,a=0|this._eh,s=0|this._fh,l=0|this._gh,d=0|this._hh,c=0|this._al,h=0|this._bl,u=0|this._cl,p=0|this._dl,f=0|this._el,m=0|this._fl,g=0|this._gl,b=0|this._hl,v=0;v<32;v+=2)e[v]=t.readInt32BE(4*v),e[v+1]=t.readInt32BE(4*v+4);for(;v<160;v+=2){var y=e[v-30],_=e[v-30+1],w=hi(y,_),x=ui(_,y),M=pi(y=e[v-4],_=e[v-4+1]),k=fi(_,y),S=e[v-14],E=e[v-14+1],A=e[v-32],T=e[v-32+1],R=x+E|0,I=w+S+mi(R,x)|0;I=(I=I+M+mi(R=R+k|0,k)|0)+A+mi(R=R+T|0,T)|0,e[v]=I,e[v+1]=R}for(var C=0;C<160;C+=2){I=e[C],R=e[C+1];var O=li(i,r,n),P=li(c,h,u),L=di(i,c),$=di(c,i),N=ci(a,f),B=ci(f,a),D=ni[C],j=ni[C+1],z=si(a,s,l),F=si(f,m,g),U=b+B|0,q=d+N+mi(U,b)|0;q=(q=(q=q+z+mi(U=U+F|0,F)|0)+D+mi(U=U+j|0,j)|0)+I+mi(U=U+R|0,R)|0;var H=$+P|0,V=L+O+mi(H,$)|0;d=l,b=g,l=s,g=m,s=a,m=f,a=o+q+mi(f=p+U|0,p)|0,o=n,p=u,n=r,u=h,r=i,h=c,i=q+V+mi(c=U+H|0,U)|0}this._al=this._al+c|0,this._bl=this._bl+h|0,this._cl=this._cl+u|0,this._dl=this._dl+p|0,this._el=this._el+f|0,this._fl=this._fl+m|0,this._gl=this._gl+g|0,this._hl=this._hl+b|0,this._ah=this._ah+i+mi(this._al,c)|0,this._bh=this._bh+r+mi(this._bl,h)|0,this._ch=this._ch+n+mi(this._cl,u)|0,this._dh=this._dh+o+mi(this._dl,p)|0,this._eh=this._eh+a+mi(this._el,f)|0,this._fh=this._fh+s+mi(this._fl,m)|0,this._gh=this._gh+l+mi(this._gl,g)|0,this._hh=this._hh+d+mi(this._hl,b)|0},ai.prototype._hash=function(){var t=ri.allocUnsafe(64);function e(e,i,r){t.writeInt32BE(e,r),t.writeInt32BE(i,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},ii=ai;var gi,bi,vi,yi=C.Buffer,_i=new Array(160);function wi(){this.init(),this._w=_i,ke.call(this,128,112)}J(wi,ii),wi.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},wi.prototype._hash=function(){var t=yi.allocUnsafe(48);function e(e,i,r){t.writeInt32BE(e,r),t.writeInt32BE(i,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},gi=wi,(vi=bi=function(t){t=t.toLowerCase();var e=vi[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e}).sha=Ae,vi.sha1=Le,vi.sha224=Je,vi.sha256=Ue,vi.sha384=gi,vi.sha512=ii;var xi=tt.EventEmitter;function Mi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function ki(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var Si=w({}).Buffer,Ei=_({}).inspect,Ai=Ei&&Ei.custom||"inspect",Ti=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e;return(e=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i}},{key:"concat",value:function(t){if(0===this.length)return Si.alloc(0);for(var e,i,r,n=Si.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,i=n,r=a,Si.prototype.copy.call(e,i,r),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var i;return t<this.head.data.length?(i=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):i=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,i=1,r=e.data;for(t-=r.length;e=e.next;){var n=e.data,o=t>n.length?n.length:t;if(o===n.length?r+=n:r+=n.slice(0,t),0==(t-=o)){o===n.length?(++i,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(o));break}++i}return this.length-=i,r}},{key:"_getBuffer",value:function(t){var e=Si.allocUnsafe(t),i=this.head,r=1;for(i.data.copy(e),t-=i.data.length;i=i.next;){var n=i.data,o=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,o),0==(t-=o)){o===n.length?(++r,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=n.slice(o));break}++r}return this.length-=r,e}},{key:Ai,value:function(t,e){return Ei(this,function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Mi(Object(i),!0).forEach((function(e){ki(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Mi(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(t.prototype,e),t}(),Ri={};(function(t){(function(){function e(t,e){r(t,e),i(t)}function i(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function r(t,e){t.emit("error",e)}Ri={destroy:function(n,o){var a=this,s=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return s||l?(o?o(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(r,this,n)):t.nextTick(r,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,(function(r){!o&&r?a._writableState?a._writableState.errorEmitted?t.nextTick(i,a):(a._writableState.errorEmitted=!0,t.nextTick(e,a,r)):t.nextTick(e,a,r):o?(t.nextTick(i,a),o(r)):t.nextTick(i,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var i=t._readableState,r=t._writableState;i&&i.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this)}).call(this,D);var Ii={},Ci={};function Oi(t,e,i){i||(i=Error);var r=function(t){var i,r;function n(i,r,n){return t.call(this,function(t,i,r){return"string"==typeof e?e:e(t,i,r)}(i,r,n))||this}return r=t,(i=n).prototype=Object.create(r.prototype),i.prototype.constructor=i,i.__proto__=r,n}(i);r.prototype.name=i.name,r.prototype.code=t,Ci[t]=r}function Pi(t,e){if(Array.isArray(t)){var i=t.length;return t=t.map((function(t){return String(t)})),i>2?"one of ".concat(e," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}Oi("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),Oi("ERR_INVALID_ARG_TYPE",(function(t,e,i){var r,n,o,a;if("string"==typeof e&&"not "===e.substr(0,"not ".length)?(r="must not be",e=e.replace(/^not /,"")):r="must be",o=t,(void 0===a||a>o.length)&&(a=o.length)," argument"===o.substring(a-" argument".length,a))n="The ".concat(t," ").concat(r," ").concat(Pi(e,"type"));else{var s=function(t,e,i){return"number"!=typeof i&&(i=0),!(i+".".length>t.length)&&-1!==t.indexOf(".",i)}(t)?"property":"argument";n='The "'.concat(t,'" ').concat(s," ").concat(r," ").concat(Pi(e,"type"))}return n+". Received type ".concat(typeof i)}),TypeError),Oi("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),Oi("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),Oi("ERR_STREAM_PREMATURE_CLOSE","Premature close"),Oi("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),Oi("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),Oi("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),Oi("ERR_STREAM_WRITE_AFTER_END","write after end"),Oi("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),Oi("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),Oi("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ii.codes=Ci;var Li=Ii.codes.ERR_INVALID_OPT_VALUE,$i={getHighWaterMark:function(t,e,i,r){var n=function(t,e,i){return null!=t.highWaterMark?t.highWaterMark:e?t[i]:null}(e,r,i);if(null!=n){if(!isFinite(n)||Math.floor(n)!==n||n<0)throw new Li(r?i:"highWaterMark",n);return Math.floor(n)}return t.objectMode?16:16384}},Ni=Hi,Bi=Ii.codes,Di=Bi.ERR_METHOD_NOT_IMPLEMENTED,ji=Bi.ERR_MULTIPLE_CALLBACK,zi=Bi.ERR_TRANSFORM_ALREADY_TRANSFORMING,Fi=Bi.ERR_TRANSFORM_WITH_LENGTH_0,Ui=h({});function qi(t,e){var i=this._transformState;i.transforming=!1;var r=i.writecb;if(null===r)return this.emit("error",new ji);i.writechunk=null,i.writecb=null,null!=e&&this.push(e),r(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Hi(t){if(!(this instanceof Hi))return new Hi(t);Ui.call(this,t),this._transformState={afterTransform:qi.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",Vi)}function Vi(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?Wi(this,null,null):this._flush((function(e,i){Wi(t,e,i)}))}function Wi(t,e,i){if(e)return t.emit("error",e);if(null!=i&&t.push(i),t._writableState.length)throw new Fi;if(t._transformState.transforming)throw new zi;return t.push(null)}J(Hi,Ui),Hi.prototype.push=function(t,e){return this._transformState.needTransform=!1,Ui.prototype.push.call(this,t,e)},Hi.prototype._transform=function(t,e,i){i(new Di("_transform()"))},Hi.prototype._write=function(t,e,i){var r=this._transformState;if(r.writecb=i,r.writechunk=t,r.writeencoding=e,!r.transforming){var n=this._readableState;(r.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},Hi.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},Hi.prototype._destroy=function(t,e){Ui.prototype._destroy.call(this,t,(function(t){e(t)}))};var Gi,Ki=Xi;function Xi(t){if(!(this instanceof Xi))return new Xi(t);Ni.call(this,t)}J(Xi,Ni),Xi.prototype._transform=function(t,e,i){i(null,t)};var Yi=Ii.codes,Zi=Yi.ERR_MISSING_ARGS,Ji=Yi.ERR_STREAM_DESTROYED;function Qi(t){if(t)throw t}function tr(t){t()}function er(t,e){return t.pipe(e)}var ir=nr,rr=tt.EventEmitter;function nr(){rr.call(this)}J(nr,rr),nr.Readable=s({}),nr.Writable=u({}),nr.Duplex=h({}),nr.Transform=Ni,nr.PassThrough=Ki,nr.finished=c({}),nr.pipeline=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var r,n=function(t){return t.length?"function"!=typeof t[t.length-1]?Qi:t.pop():Qi}(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Zi("streams");var o=e.map((function(t,i){var a=i<e.length-1;return function(t,e,i,r){r=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(r);var n=!1;t.on("close",(function(){n=!0})),void 0===Gi&&(Gi=c({})),Gi(t,{readable:e,writable:i},(function(t){if(t)return r(t);n=!0,r()}));var o=!1;return function(e){if(!n&&!o)return o=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void r(e||new Ji("pipe"))}}(t,a,i>0,(function(t){r||(r=t),t&&o.forEach(tr),a||(o.forEach(tr),n(r))}))}));return e.reduce(er)},nr.Stream=nr,nr.prototype.pipe=function(t,e){var i=this;function r(e){t.writable&&!1===t.write(e)&&i.pause&&i.pause()}function n(){i.readable&&i.resume&&i.resume()}i.on("data",r),t.on("drain",n),t._isStdio||e&&!1===e.end||(i.on("end",a),i.on("close",s));var o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function l(t){if(d(),0===rr.listenerCount(this,"error"))throw t}function d(){i.removeListener("data",r),t.removeListener("drain",n),i.removeListener("end",a),i.removeListener("close",s),i.removeListener("error",l),t.removeListener("error",l),i.removeListener("end",d),i.removeListener("close",d),t.removeListener("close",d)}return i.on("error",l),t.on("error",l),i.on("end",d),i.on("close",d),t.on("close",d),t.emit("pipe",i),t};var or,ar={},sr=C.Buffer,lr=ir.Transform,dr=b({}).StringDecoder;function cr(t){lr.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}function hr(t){ar.call(this,"digest"),this._hash=t}J(cr,lr),cr.prototype.update=function(t,e,i){"string"==typeof t&&(t=sr.from(t,e));var r=this._update(t);return this.hashMode?this:(i&&(r=this._toString(r,i)),r)},cr.prototype.setAutoPadding=function(){},cr.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},cr.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},cr.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},cr.prototype._transform=function(t,e,i){var r;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){r=t}finally{i(r)}},cr.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},cr.prototype._finalOrDigest=function(t){var e=this.__final()||sr.alloc(0);return t&&(e=this._toString(e,t,!0)),e},cr.prototype._toString=function(t,e,i){if(this._decoder||(this._decoder=new dr(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var r=this._decoder.write(t);return i&&(r+=this._decoder.end()),r},J(hr,ar=cr),hr.prototype._update=function(t){this._hash.update(t)},hr.prototype._final=function(){return this._hash.digest()},or=function(t){return"md5"===(t=t.toLowerCase())?new Qt:"rmd160"===t||"ripemd160"===t?new le:new hr(bi(t))};var ur={},pr=C.Buffer,fr=pr.alloc(128);function mr(t,e){ar.call(this,"digest"),"string"==typeof e&&(e=pr.from(e)),this._alg=t,this._key=e,e.length>64?e=t(e):e.length<64&&(e=pr.concat([e,fr],64));for(var i=this._ipad=pr.allocUnsafe(64),r=this._opad=pr.allocUnsafe(64),n=0;n<64;n++)i[n]=54^e[n],r[n]=92^e[n];this._hash=[i]}J(mr,ar),mr.prototype._update=function(t){this._hash.push(t)},mr.prototype._final=function(){var t=this._alg(pr.concat(this._hash));return this._alg(pr.concat([this._opad,t]))},ur=mr;var gr,br=function(t){return(new Qt).update(t).digest()},vr=C.Buffer,yr=vr.alloc(128);function _r(t,e){ar.call(this,"digest"),"string"==typeof e&&(e=vr.from(e));var i="sha512"===t||"sha384"===t?128:64;this._alg=t,this._key=e,e.length>i?e=("rmd160"===t?new le:bi(t)).update(e).digest():e.length<i&&(e=vr.concat([e,yr],i));for(var r=this._ipad=vr.allocUnsafe(i),n=this._opad=vr.allocUnsafe(i),o=0;o<i;o++)r[o]=54^e[o],n[o]=92^e[o];this._hash="rmd160"===t?new le:bi(t),this._hash.update(r)}J(_r,ar),_r.prototype._update=function(t){this._hash.update(t)},_r.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new le:bi(this._alg)).update(this._opad).update(t).digest()},gr=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new _r("rmd160",e):"md5"===t?new ur(br,e):new _r(t,e)};var wr={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}},xr=Math.pow(2,30)-1,Mr={};(function(t){(function(){var e;e=t.browser?"utf-8":t.version?parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",Mr=e}).call(this)}).call(this,D);var kr,Sr=C.Buffer,Er=function(t,e,i){if(Sr.isBuffer(t))return t;if("string"==typeof t)return Sr.from(t,e);if(ArrayBuffer.isView(t))return Sr.from(t.buffer);throw new TypeError(i+" must be a string, a Buffer, a typed array or a DataView")},Ar=C.Buffer,Tr=Ar.alloc(128),Rr={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function Ir(t,e,i){var r=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new le).update(t).digest()}:"md5"===t?br:function(e){return bi(t).update(e).digest()}}(t),n="sha512"===t||"sha384"===t?128:64;e.length>n?e=r(e):e.length<n&&(e=Ar.concat([e,Tr],n));for(var o=Ar.allocUnsafe(n+Rr[t]),a=Ar.allocUnsafe(n+Rr[t]),s=0;s<n;s++)o[s]=54^e[s],a[s]=92^e[s];var l=Ar.allocUnsafe(n+i+4);o.copy(l,0,0,n),this.ipad1=l,this.ipad2=o,this.opad=a,this.alg=t,this.blocksize=n,this.hash=r,this.size=Rr[t]}Ir.prototype.run=function(t,e){return t.copy(e,this.blocksize),this.hash(e).copy(this.opad,this.blocksize),this.hash(this.opad)},kr=function(t,e,i,r,n){!function(t,e){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof e)throw new TypeError("Key length not a number");if(e<0||e>xr||e!=e)throw new TypeError("Bad key length")}(i,r);var o=new Ir(n=n||"sha1",t=Er(t,Mr,"Password"),(e=Er(e,Mr,"Salt")).length),a=Ar.allocUnsafe(r),s=Ar.allocUnsafe(e.length+4);e.copy(s,0,0,e.length);for(var l=0,d=Rr[n],c=Math.ceil(r/d),h=1;h<=c;h++){s.writeUInt32BE(h,e.length);for(var u=o.run(s,o.ipad1),p=u,f=1;f<i;f++){p=o.run(p,o.ipad2);for(var m=0;m<d;m++)u[m]^=p[m]}u.copy(a,l),l+=d}return a},function(t,e){(function(){C.Buffer,e.crypto&&e.crypto.subtle}).call(this)}.call(this,D,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Cr={};Cr.pbkdf2Sync=kr;var Or={readUInt32BE:function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},writeUInt32BE:function(t,e,i){t[0+i]=e>>>24,t[1+i]=e>>>16&255,t[2+i]=e>>>8&255,t[3+i]=255&e},ip:function(t,e,i,r){for(var n=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=e>>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=t>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1}i[r+0]=n>>>0,i[r+1]=o>>>0},rip:function(t,e,i,r){for(var n=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)n<<=1,n|=e>>>s+a&1,n<<=1,n|=t>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=e>>>s+a&1,o<<=1,o|=t>>>s+a&1;i[r+0]=n>>>0,i[r+1]=o>>>0},pc1:function(t,e,i,r){for(var n=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1}for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;i[r+0]=n>>>0,i[r+1]=o>>>0},r28shl:function(t,e){return t<<e&268435455|t>>>28-e}},Pr=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];Or.pc2=function(t,e,i,r){for(var n=0,o=0,a=Pr.length>>>1,s=0;s<a;s++)n<<=1,n|=t>>>Pr[s]&1;for(s=a;s<Pr.length;s++)o<<=1,o|=e>>>Pr[s]&1;i[r+0]=n>>>0,i[r+1]=o>>>0},Or.expand=function(t,e,i){var r=0,n=0;r=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)r<<=6,r|=t>>>o&63;for(o=11;o>=3;o-=4)n|=t>>>o&63,n<<=6;n|=(31&t)<<1|t>>>31,e[i+0]=r>>>0,e[i+1]=n>>>0};var Lr=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];Or.substitute=function(t,e){for(var i=0,r=0;r<4;r++)i<<=4,i|=Lr[64*r+(t>>>18-6*r&63)];for(r=0;r<4;r++)i<<=4,i|=Lr[256+64*r+(e>>>18-6*r&63)];return i>>>0};var $r,Nr=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];function Br(t,e){if(!t)throw new Error(e||"Assertion failed")}Or.permute=function(t){for(var e=0,i=0;i<Nr.length;i++)e<<=1,e|=t>>>Nr[i]&1;return e>>>0},Or.padSplit=function(t,e,i){for(var r=t.toString(2);r.length<e;)r="0"+r;for(var n=[],o=0;o<e;o+=i)n.push(r.slice(o,o+i));return n.join(" ")},$r=Br,Br.equal=function(t,e,i){if(t!=e)throw new Error(i||"Assertion failed: "+t+" != "+e)};var Dr={};function jr(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}Dr=jr,jr.prototype._init=function(){},jr.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},jr.prototype._buffer=function(t,e){for(var i=Math.min(this.buffer.length-this.bufferOff,t.length-e),r=0;r<i;r++)this.buffer[this.bufferOff+r]=t[e+r];return this.bufferOff+=i,i},jr.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},jr.prototype._updateEncrypt=function(t){var e=0,i=0,r=(this.bufferOff+t.length)/this.blockSize|0,n=new Array(r*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(i+=this._flushBuffer(n,i)));for(var o=t.length-(t.length-e)%this.blockSize;e<o;e+=this.blockSize)this._update(t,e,n,i),i+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return n},jr.prototype._updateDecrypt=function(t){for(var e=0,i=0,r=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,n=new Array(r*this.blockSize);r>0;r--)e+=this._buffer(t,e),i+=this._flushBuffer(n,i);return e+=this._buffer(t,e),n},jr.prototype.final=function(t){var e,i;return t&&(e=this.update(t)),i="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(i):i},jr.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},jr.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},jr.prototype._unpad=function(t){return t},jr.prototype._finalDecrypt=function(){var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)};var zr={};function Fr(){this.tmp=new Array(2),this.keys=null}function Ur(t){Dr.call(this,t);var e=new Fr;this._desState=e,this.deriveKeys(e,t.key)}J(Ur,Dr),zr=Ur,Ur.create=function(t){return new Ur(t)};var qr=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];Ur.prototype.deriveKeys=function(t,e){t.keys=new Array(32);var i=Or.readUInt32BE(e,0),r=Or.readUInt32BE(e,4);Or.pc1(i,r,t.tmp,0),i=t.tmp[0],r=t.tmp[1];for(var n=0;n<t.keys.length;n+=2){var o=qr[n>>>1];i=Or.r28shl(i,o),r=Or.r28shl(r,o),Or.pc2(i,r,t.keys,n)}},Ur.prototype._update=function(t,e,i,r){var n=this._desState,o=Or.readUInt32BE(t,e),a=Or.readUInt32BE(t,e+4);Or.ip(o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],"encrypt"===this.type?this._encrypt(n,o,a,n.tmp,0):this._decrypt(n,o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],Or.writeUInt32BE(i,o,r),Or.writeUInt32BE(i,a,r+4)},Ur.prototype._pad=function(t,e){for(var i=t.length-e,r=e;r<t.length;r++)t[r]=i;return!0},Ur.prototype._unpad=function(t){for(var e=t[t.length-1],i=t.length-e;i<t.length;i++);return t.slice(0,t.length-e)},Ur.prototype._encrypt=function(t,e,i,r,n){for(var o=e,a=i,s=0;s<t.keys.length;s+=2){var l=t.keys[s],d=t.keys[s+1];Or.expand(a,t.tmp,0),l^=t.tmp[0],d^=t.tmp[1];var c=Or.substitute(l,d),h=a;a=(o^Or.permute(c))>>>0,o=h}Or.rip(a,o,r,n)},Ur.prototype._decrypt=function(t,e,i,r,n){for(var o=i,a=e,s=t.keys.length-2;s>=0;s-=2){var l=t.keys[s],d=t.keys[s+1];Or.expand(o,t.tmp,0),l^=t.tmp[0],d^=t.tmp[1];var c=Or.substitute(l,d),h=o;o=(a^Or.permute(c))>>>0,a=h}Or.rip(o,a,r,n)};var Hr,Vr={},Wr={};function Gr(t){this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}function Kr(t,e){var i=e.slice(0,8),r=e.slice(8,16),n=e.slice(16,24);this.ciphers="encrypt"===t?[zr.create({type:"encrypt",key:i}),zr.create({type:"decrypt",key:r}),zr.create({type:"encrypt",key:n})]:[zr.create({type:"decrypt",key:n}),zr.create({type:"encrypt",key:r}),zr.create({type:"decrypt",key:i})]}function Xr(t){Dr.call(this,t);var e=new Kr(this.type,this.options.key);this._edeState=e}Vr.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}J(e,t);for(var i=Object.keys(Wr),r=0;r<i.length;r++){var n=i[r];e.prototype[n]=Wr[n]}return e.create=function(t){return new e(t)},e},Wr._cbcInit=function(){var t=new Gr(this.options.iv);this._cbcState=t},Wr._update=function(t,e,i,r){var n=this._cbcState,o=this.constructor.super_.prototype,a=n.iv;if("encrypt"===this.type){for(var s=0;s<this.blockSize;s++)a[s]^=t[e+s];for(o._update.call(this,a,0,i,r),s=0;s<this.blockSize;s++)a[s]=i[r+s]}else{for(o._update.call(this,t,e,i,r),s=0;s<this.blockSize;s++)i[r+s]^=a[s];for(s=0;s<this.blockSize;s++)a[s]=t[e+s]}},J(Xr,Dr),Hr=Xr,Xr.create=function(t){return new Xr(t)},Xr.prototype._update=function(t,e,i,r){var n=this._edeState;n.ciphers[0]._update(t,e,i,r),n.ciphers[1]._update(i,r,i,r),n.ciphers[2]._update(i,r,i,r)},Xr.prototype._pad=zr.prototype._pad,Xr.prototype._unpad=zr.prototype._unpad;var Yr={};Yr.DES=zr,Yr.CBC=Vr,Yr.EDE=Hr;var Zr=C.Buffer,Jr={"des-ede3-cbc":Yr.CBC.instantiate(Yr.EDE),"des-ede3":Yr.EDE,"des-ede-cbc":Yr.CBC.instantiate(Yr.EDE),"des-ede":Yr.EDE,"des-cbc":Yr.CBC.instantiate(Yr.DES),"des-ecb":Yr.DES};function Qr(t){ar.call(this);var e,i=t.mode.toLowerCase(),r=Jr[i];e=t.decrypt?"decrypt":"encrypt";var n=t.key;Zr.isBuffer(n)||(n=Zr.from(n)),"des-ede"!==i&&"des-ede-cbc"!==i||(n=Zr.concat([n,n.slice(0,8)]));var o=t.iv;Zr.isBuffer(o)||(o=Zr.from(o)),this._des=r.create({key:n,iv:o,type:e})}Jr.des=Jr["des-cbc"],Jr.des3=Jr["des-ede3-cbc"],J(Qr,ar),Qr.prototype._update=function(t){return Zr.from(this._des.update(t))},Qr.prototype._final=function(){return Zr.from(this._des.final())};var tn={};(function(t){(function(){tn=function(e,i){for(var r=Math.min(e.length,i.length),n=new t(r),o=0;o<r;++o)n[o]=e[o]^i[o];return n}}).call(this)}).call(this,w({}).Buffer);var en={encrypt:function(t,e){var i=tn(e,t._prev);return t._prev=t._cipher.encryptBlock(i),t._prev},decrypt:function(t,e){var i=t._prev;t._prev=e;var r=t._cipher.decryptBlock(e);return tn(r,i)}},rn={},nn=C.Buffer;function on(t,e,i){var r=e.length,n=tn(e,t._cache);return t._cache=t._cache.slice(r),t._prev=nn.concat([t._prev,i?e:n]),n}rn.encrypt=function(t,e,i){for(var r,n=nn.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=nn.allocUnsafe(0)),!(t._cache.length<=e.length)){n=nn.concat([n,on(t,e,i)]);break}r=t._cache.length,n=nn.concat([n,on(t,e.slice(0,r),i)]),e=e.slice(r)}return n};var an={},sn=C.Buffer;function ln(t,e,i){var r=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=sn.concat([t._prev.slice(1),sn.from([i?e:r])]),r}an.encrypt=function(t,e,i){for(var r=e.length,n=sn.allocUnsafe(r),o=-1;++o<r;)n[o]=ln(t,e[o],i);return n};var dn={},cn=C.Buffer;function hn(t,e,i){for(var r,n,o=-1,a=0;++o<8;)r=e&1<<7-o?128:0,a+=(128&(n=t._cipher.encryptBlock(t._prev)[0]^r))>>o%8,t._prev=un(t._prev,i?r:n);return a}function un(t,e){var i=t.length,r=-1,n=cn.allocUnsafe(t.length);for(t=cn.concat([t,cn.from([e])]);++r<i;)n[r]=t[r]<<1|t[r+1]>>7;return n}dn.encrypt=function(t,e,i){for(var r=e.length,n=cn.allocUnsafe(r),o=-1;++o<r;)n[o]=hn(t,e[o],i);return n};var pn={};(function(t){(function(){function e(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}pn.encrypt=function(i,r){for(;i._cache.length<r.length;)i._cache=t.concat([i._cache,e(i)]);var n=i._cache.slice(0,r.length);return i._cache=i._cache.slice(r.length),tn(r,n)}}).call(this)}).call(this,w({}).Buffer);var fn=function(t){for(var e,i=t.length;i--;){if(255!==(e=t.readUInt8(i))){e++,t.writeUInt8(e,i);break}t.writeUInt8(0,i)}},mn={},gn=C.Buffer;function bn(t){var e=t._cipher.encryptBlockRaw(t._prev);return fn(t._prev),e}mn.encrypt=function(t,e){var i=Math.ceil(e.length/16),r=t._cache.length;t._cache=gn.concat([t._cache,gn.allocUnsafe(16*i)]);for(var n=0;n<i;n++){var o=bn(t),a=r+16*n;t._cache.writeUInt32BE(o[0],a+0),t._cache.writeUInt32BE(o[1],a+4),t._cache.writeUInt32BE(o[2],a+8),t._cache.writeUInt32BE(o[3],a+12)}var s=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),tn(e,s)};var vn={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},yn={ECB:{encrypt:function(t,e){return t._cipher.encryptBlock(e)},decrypt:function(t,e){return t._cipher.decryptBlock(e)}},CBC:en,CFB:rn,CFB8:an,CFB1:dn,OFB:pn,CTR:mn,GCM:mn};for(var _n in vn)vn[_n].module=yn[vn[_n].mode];var wn={},xn=C.Buffer;function Mn(t){xn.isBuffer(t)||(t=xn.from(t));for(var e=t.length/4|0,i=new Array(e),r=0;r<e;r++)i[r]=t.readUInt32BE(4*r);return i}function kn(t){for(;0<t.length;t++)t[0]=0}function Sn(t,e,i,r,n){for(var o,a,s,l,d=i[0],c=i[1],h=i[2],u=i[3],p=t[0]^e[0],f=t[1]^e[1],m=t[2]^e[2],g=t[3]^e[3],b=4,v=1;v<n;v++)o=d[p>>>24]^c[f>>>16&255]^h[m>>>8&255]^u[255&g]^e[b++],a=d[f>>>24]^c[m>>>16&255]^h[g>>>8&255]^u[255&p]^e[b++],s=d[m>>>24]^c[g>>>16&255]^h[p>>>8&255]^u[255&f]^e[b++],l=d[g>>>24]^c[p>>>16&255]^h[f>>>8&255]^u[255&m]^e[b++],p=o,f=a,m=s,g=l;return o=(r[p>>>24]<<24|r[f>>>16&255]<<16|r[m>>>8&255]<<8|r[255&g])^e[b++],a=(r[f>>>24]<<24|r[m>>>16&255]<<16|r[g>>>8&255]<<8|r[255&p])^e[b++],s=(r[m>>>24]<<24|r[g>>>16&255]<<16|r[p>>>8&255]<<8|r[255&f])^e[b++],l=(r[g>>>24]<<24|r[p>>>16&255]<<16|r[f>>>8&255]<<8|r[255&m])^e[b++],[o>>>=0,a>>>=0,s>>>=0,l>>>=0]}var En=[0,1,2,4,8,16,32,64,128,27,54],An=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var i=[],r=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,l=0;l<256;++l){var d=s^s<<1^s<<2^s<<3^s<<4;d=d>>>8^255&d^99,i[a]=d,r[d]=a;var c=t[a],h=t[c],u=t[h],p=257*t[d]^16843008*d;n[0][a]=p<<24|p>>>8,n[1][a]=p<<16|p>>>16,n[2][a]=p<<8|p>>>24,n[3][a]=p,p=16843009*u^65537*h^257*c^16843008*a,o[0][d]=p<<24|p>>>8,o[1][d]=p<<16|p>>>16,o[2][d]=p<<8|p>>>24,o[3][d]=p,0===a?a=s=1:(a=c^t[t[t[u^c]]],s^=t[t[s]])}return{SBOX:i,INV_SBOX:r,SUB_MIX:n,INV_SUB_MIX:o}}();function Tn(t){this._key=Mn(t),this._reset()}Tn.blockSize=16,Tn.keySize=32,Tn.prototype.blockSize=Tn.blockSize,Tn.prototype.keySize=Tn.keySize,Tn.prototype._reset=function(){for(var t=this._key,e=t.length,i=e+6,r=4*(i+1),n=[],o=0;o<e;o++)n[o]=t[o];for(o=e;o<r;o++){var a=n[o-1];o%e==0?(a=a<<8|a>>>24,a=An.SBOX[a>>>24]<<24|An.SBOX[a>>>16&255]<<16|An.SBOX[a>>>8&255]<<8|An.SBOX[255&a],a^=En[o/e|0]<<24):e>6&&o%e==4&&(a=An.SBOX[a>>>24]<<24|An.SBOX[a>>>16&255]<<16|An.SBOX[a>>>8&255]<<8|An.SBOX[255&a]),n[o]=n[o-e]^a}for(var s=[],l=0;l<r;l++){var d=r-l,c=n[d-(l%4?0:4)];s[l]=l<4||d<=4?c:An.INV_SUB_MIX[0][An.SBOX[c>>>24]]^An.INV_SUB_MIX[1][An.SBOX[c>>>16&255]]^An.INV_SUB_MIX[2][An.SBOX[c>>>8&255]]^An.INV_SUB_MIX[3][An.SBOX[255&c]]}this._nRounds=i,this._keySchedule=n,this._invKeySchedule=s},Tn.prototype.encryptBlockRaw=function(t){return Sn(t=Mn(t),this._keySchedule,An.SUB_MIX,An.SBOX,this._nRounds)},Tn.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),i=xn.allocUnsafe(16);return i.writeUInt32BE(e[0],0),i.writeUInt32BE(e[1],4),i.writeUInt32BE(e[2],8),i.writeUInt32BE(e[3],12),i},Tn.prototype.decryptBlock=function(t){var e=(t=Mn(t))[1];t[1]=t[3],t[3]=e;var i=Sn(t,this._invKeySchedule,An.INV_SUB_MIX,An.INV_SBOX,this._nRounds),r=xn.allocUnsafe(16);return r.writeUInt32BE(i[0],0),r.writeUInt32BE(i[3],4),r.writeUInt32BE(i[2],8),r.writeUInt32BE(i[1],12),r},Tn.prototype.scrub=function(){kn(this._keySchedule),kn(this._invKeySchedule),kn(this._key)},wn.AES=Tn;var Rn={},In=C.Buffer,Cn=In.alloc(16,0);function On(t){var e=In.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function Pn(t){this.h=t,this.state=In.alloc(16,0),this.cache=In.allocUnsafe(0)}Pn.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},Pn.prototype._multiply=function(){for(var t,e,i,r=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],n=[0,0,0,0],o=-1;++o<128;){for(0!=(this.state[~~(o/8)]&1<<7-o%8)&&(n[0]^=r[0],n[1]^=r[1],n[2]^=r[2],n[3]^=r[3]),i=0!=(1&r[3]),e=3;e>0;e--)r[e]=r[e]>>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,i&&(r[0]=r[0]^225<<24)}this.state=On(n)},Pn.prototype.update=function(t){var e;for(this.cache=In.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},Pn.prototype.final=function(t,e){return this.cache.length&&this.ghash(In.concat([this.cache,Cn],16)),this.ghash(On([0,t,0,e])),this.state},Rn=Pn;var Ln=C.Buffer;function $n(t,e,i,r){ar.call(this);var n=Ln.alloc(4,0);this._cipher=new wn.AES(e);var o=this._cipher.encryptBlock(n);this._ghash=new Rn(o),i=function(t,e,i){if(12===e.length)return t._finID=Ln.concat([e,Ln.from([0,0,0,1])]),Ln.concat([e,Ln.from([0,0,0,2])]);var r=new Rn(i),n=e.length,o=n%16;r.update(e),o&&(o=16-o,r.update(Ln.alloc(o,0))),r.update(Ln.alloc(8,0));var a=8*n,s=Ln.alloc(8);s.writeUIntBE(a,0,8),r.update(s),t._finID=r.state;var l=Ln.from(t._finID);return fn(l),l}(this,i,o),this._prev=Ln.from(i),this._cache=Ln.allocUnsafe(0),this._secCache=Ln.allocUnsafe(0),this._decrypt=r,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}J($n,ar),$n.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=Ln.alloc(e,0),this._ghash.update(e))}this._called=!0;var i=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(i),this._len+=t.length,i},$n.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=tn(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var i=0;t.length!==e.length&&i++;for(var r=Math.min(t.length,e.length),n=0;n<r;++n)i+=t[n]^e[n];return i}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},$n.prototype.getAuthTag=function(){if(this._decrypt||!Ln.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},$n.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},$n.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length};var Nn=C.Buffer;function Bn(t,e,i,r){ar.call(this),this._cipher=new wn.AES(e),this._prev=Nn.from(i),this._cache=Nn.allocUnsafe(0),this._secCache=Nn.allocUnsafe(0),this._decrypt=r,this._mode=t}J(Bn,ar),Bn.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},Bn.prototype._final=function(){this._cipher.scrub()};var Dn=C.Buffer,jn=C.Buffer;function zn(t,e,i){ar.call(this),this._cache=new Un,this._cipher=new wn.AES(e),this._prev=jn.from(i),this._mode=t,this._autopadding=!0}J(zn,ar),zn.prototype._update=function(t){var e,i;this._cache.add(t);for(var r=[];e=this._cache.get();)i=this._mode.encrypt(this,e),r.push(i);return jn.concat(r)};var Fn=jn.alloc(16,16);function Un(){this.cache=jn.allocUnsafe(0)}zn.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(Fn))throw this._cipher.scrub(),new Error("data not multiple of block length")},zn.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},Un.prototype.add=function(t){this.cache=jn.concat([this.cache,t])},Un.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},Un.prototype.flush=function(){for(var t=16-this.cache.length,e=jn.allocUnsafe(t),i=-1;++i<t;)e.writeUInt8(t,i);return jn.concat([this.cache,e])};var qn=C.Buffer;function Hn(t,e,i){ar.call(this),this._cache=new Vn,this._last=void 0,this._cipher=new wn.AES(e),this._prev=qn.from(i),this._mode=t,this._autopadding=!0}function Vn(){this.cache=qn.allocUnsafe(0)}J(Hn,ar),Hn.prototype._update=function(t){var e,i;this._cache.add(t);for(var r=[];e=this._cache.get(this._autopadding);)i=this._mode.decrypt(this,e),r.push(i);return qn.concat(r)},Hn.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var i=-1;++i<e;)if(t[i+(16-e)]!==e)throw new Error("unable to decrypt data");if(16!==e)return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},Hn.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},Vn.prototype.add=function(t){this.cache=qn.concat([this.cache,t])},Vn.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},Vn.prototype.flush=function(){if(this.cache.length)return this.cache};var Wn={};Wn.createCipheriv={}.createCipheriv,Wn.createDecipheriv={}.createDecipheriv;var Gn={exports:{}};!function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=_({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var a=t.charCodeAt(o)-48;r<<=4,r|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function a(t,e,i,r){for(var n=0,o=Math.min(t.length,i),a=e;a<o;a++){var s=t.charCodeAt(a)-48;n*=r,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,a=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this.strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,a=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303,(a+=24)>=26&&(a-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303),this.strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,s=o%r,l=Math.min(o,o-s)+i,d=0,c=i;c<l;c+=r)d=a(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==s){var h=1;for(d=a(t,c,t.length,e),c=0;c<s;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,l=a/67108864|0;i.words[0]=s;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(a=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&a}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i.strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var a=this.words[o],c=(16777215&(a<<r|n)).toString(16);i=0!=(n=a>>>24-r&16777215)||o!==this.length-1?s[6-c.length]+c+i:c+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],u=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modn(u).toString(t);i=(p=p.idivn(u)).isZero()?f+i:s[h-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)},r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){var r=this.byteLength(),n=i||Math.max(1,r);this.strip();var o,a,s="le"===e,l=new t(n),d=this.clone();if(s){for(a=0;!d.isZero();a++)o=d.andln(255),d.iushrn(8),l[a]=o;for(;a<n;a++)l[a]=0}else{for(a=0;a<n-r;a++)l[a]=0;for(a=0;!d.isZero();a++)o=d.andln(255),d.iushrn(8),l[n-a-1]=o}return l},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|i.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<i.length;a++)o=(e=(0|i.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var h=function(t,e,i){var r,n,o,a=t.words,s=e.words,l=i.words,d=0,c=0|a[0],h=8191&c,u=c>>>13,p=0|a[1],f=8191&p,m=p>>>13,g=0|a[2],b=8191&g,v=g>>>13,y=0|a[3],_=8191&y,w=y>>>13,x=0|a[4],M=8191&x,k=x>>>13,S=0|a[5],E=8191&S,A=S>>>13,T=0|a[6],R=8191&T,I=T>>>13,C=0|a[7],O=8191&C,P=C>>>13,L=0|a[8],$=8191&L,N=L>>>13,B=0|a[9],D=8191&B,j=B>>>13,z=0|s[0],F=8191&z,U=z>>>13,q=0|s[1],H=8191&q,V=q>>>13,W=0|s[2],G=8191&W,K=W>>>13,X=0|s[3],Y=8191&X,Z=X>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],lt=8191&st,dt=st>>>13,ct=0|s[8],ht=8191&ct,ut=ct>>>13,pt=0|s[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,F))|0)+((8191&(n=(n=Math.imul(h,U))+Math.imul(u,F)|0))<<13)|0;d=((o=Math.imul(u,U))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,F),n=(n=Math.imul(f,U))+Math.imul(m,F)|0,o=Math.imul(m,U);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,F),n=(n=Math.imul(b,U))+Math.imul(v,F)|0,o=Math.imul(v,U),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,F),n=(n=Math.imul(_,U))+Math.imul(w,F)|0,o=Math.imul(w,U),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Y)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(u,Y)|0))<<13)|0;d=((o=o+Math.imul(u,Z)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,F),n=(n=Math.imul(M,U))+Math.imul(k,F)|0,o=Math.imul(k,U),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Y)|0,n=(n=n+Math.imul(f,Z)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Z)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,F),n=(n=Math.imul(E,U))+Math.imul(A,F)|0,o=Math.imul(A,U),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Z)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(R,F),n=(n=Math.imul(R,U))+Math.imul(I,F)|0,o=Math.imul(I,U),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,Z)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,at)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,at)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,F),n=(n=Math.imul(O,U))+Math.imul(P,F)|0,o=Math.imul(P,U),r=r+Math.imul(R,H)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,Z)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul($,F),n=(n=Math.imul($,U))+Math.imul(N,F)|0,o=Math.imul(N,U),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(R,G)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,K)|0,r=r+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,Z)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(D,F),n=(n=Math.imul(D,U))+Math.imul(j,F)|0,o=Math.imul(j,U),r=r+Math.imul($,H)|0,n=(n=n+Math.imul($,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,K)|0,r=r+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,Z)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(D,H),n=(n=Math.imul(D,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul($,G)|0,n=(n=n+Math.imul($,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,Z)|0,r=r+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(D,G),n=(n=Math.imul(D,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul($,Y)|0,n=(n=n+Math.imul($,Z)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Z)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(R,it)|0,n=(n=n+Math.imul(R,rt)|0)+Math.imul(I,it)|0,o=o+Math.imul(I,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(D,Y),n=(n=Math.imul(D,Z))+Math.imul(j,Y)|0,o=Math.imul(j,Z),r=r+Math.imul($,Q)|0,n=(n=n+Math.imul($,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(P,it)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(D,Q),n=(n=Math.imul(D,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul($,it)|0,n=(n=n+Math.imul($,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(R,lt)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var Rt=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(D,it),n=(n=Math.imul(D,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul($,ot)|0,n=(n=n+Math.imul($,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,dt)|0,r=r+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ut)|0;var It=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(D,ot),n=(n=Math.imul(D,at))+Math.imul(j,ot)|0,o=Math.imul(j,at),r=r+Math.imul($,lt)|0,n=(n=n+Math.imul($,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0;var Ct=(d+(r=r+Math.imul(R,ft)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(I,ft)|0))<<13)|0;d=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(D,lt),n=(n=Math.imul(D,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul($,ht)|0,n=(n=n+Math.imul($,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(P,ft)|0))<<13)|0;d=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(D,ht),n=(n=Math.imul(D,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Pt=(d+(r=r+Math.imul($,ft)|0)|0)+((8191&(n=(n=n+Math.imul($,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(d+(r=Math.imul(D,ft))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=Rt,l[14]=It,l[15]=Ct,l[16]=Ot,l[17]=Pt,l[18]=Lt,0!==d&&(l[19]=d,i.length++),i};function u(t,e,i){return(new p).mulp(t,e,i)}function p(t,e){this.x=t,this.y=e}Math.imul||(h=c),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?h(this,t,e):i<63?c(this,t,e):i<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var a=n;n=0;for(var s=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;s=67108863&(u=u+s|0),n+=(a=(a=a+(h/67108864|0)|0)+(u>>>26)|0)>>>26,a&=67108863}i.words[o]=s,r=a,a=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):u(this,t,e)},p.prototype.makeRBT=function(t){for(var e=new Array(t),i=r.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,i,t);return e},p.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},p.prototype.permute=function(t,e,i,r,n,o){for(var a=0;a<o;a++)r[a]=e[t[a]],n[a]=i[t[a]]},p.prototype.transform=function(t,e,i,r,n,o){this.permute(o,t,e,i,r,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,l=Math.cos(2*Math.PI/s),d=Math.sin(2*Math.PI/s),c=0;c<n;c+=s)for(var h=l,u=d,p=0;p<a;p++){var f=i[c+p],m=r[c+p],g=i[c+p+a],b=r[c+p+a],v=h*g-u*b;b=h*b+u*g,g=v,i[c+p]=f+g,r[c+p]=m+b,i[c+p+a]=f-g,r[c+p+a]=m-b,p!==s&&(v=l*h-d*u,u=l*u+d*h,h=v)}},p.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},p.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},p.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},p.prototype.convert13b=function(t,e,i,r){for(var n=0,o=0;o<e;o++)n+=0|t[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*e;o<r;++o)i[o]=0},p.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},p.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),o=this.stub(r),a=new Array(r),s=new Array(r),l=new Array(r),d=new Array(r),c=new Array(r),h=new Array(r),u=i.words;u.length=r,this.convert13b(t.words,t.length,a,r),this.convert13b(e.words,e.length,d,r),this.transform(a,o,s,l,r,n),this.transform(d,o,c,h,r,n);for(var p=0;p<r;p++){var f=s[p]*c[p]-l[p]*h[p];l[p]=s[p]*h[p]+l[p]*c[p],s[p]=f}return this.conjugate(s,l,r),this.transform(s,l,u,o,r,n),this.conjugate(u,o,r),this.normalize13b(u,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),u(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){for(var e=0,i=0;i<this.length;i++){var r=(0|this.words[i])*t,n=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=n>>>26,this.words[i]=67108863&n}return 0!==e&&(this.words[i]=e,this.length++),this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&n,s=(0|this.words[e])-a<<i;this.words[e]=s|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),a=67108863^67108863>>>n<<n,s=i;if(r-=o,r=Math.max(0,r),s){for(var l=0;l<o;l++)s.words[l]=this.words[l];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&a}return s&&0!==d&&(s.words[s.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var a=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+a;var s=(0|t.words[r])*e;a=((n-=67108863&s)>>26)-(s/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)a=(n=(0|this.words[r+i])+a)>>26,this.words[r+i]=67108863&n;if(0===a)return this.strip();for(a=0,r=0;r<this.length;r++)a=(n=-(0|this.words[r])+a)>>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,a=0|o.words[o.length-1];0!=(i=26-this._countBits(a))&&(o=o.ushln(i),n.iushln(i),a=0|o.words[o.length-1]);var s,l=n.length-o.length;if("mod"!==e){(s=new r(null)).length=l+1,s.words=new Array(s.length);for(var d=0;d<s.length;d++)s.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/a|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=u)}return s&&s.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:s||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modn=function(t){for(var e=(1<<26)%t,i=0,r=this.length-1;r>=0;r--)i=(e*i+(0|this.words[r]))%t;return i},r.prototype.idivn=function(t){for(var e=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*e;this.words[i]=r/t|0,e=r%t}return this.strip()},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),a=new r(0),s=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(d),s.isub(c)),a.iushrn(1),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(a),o.isub(s)):(i.isub(e),a.isub(n),s.isub(o))}return{a:a,b:s,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),a=new r(0),s=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a)):(i.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var a=0|this.words[o];n=(a+=n)>>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new w(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var f={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function y(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function x(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(g,m),g.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(b,m),i(v,m),i(y,m),y.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(f[t])return f[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new b;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new y}return f[t]=e,e},w.prototype._verify1=function(t){},w.prototype._verify2=function(t,e){},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,s).cmp(a);)l.redIAdd(a);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],a=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===n&&0===c)&&(o=this.mul(o,i[a]),s=0,a=0)):s=0}l=26}return o},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new x(t)},i(x,w),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(Gn,this),Gn=Gn.exports;var Kn,Xn,Yn={exports:{}};function Zn(t){this.rand=t}if(function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=_({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var a=t.charCodeAt(o)-48;r<<=4,r|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function a(t,e,i,r){for(var n=0,o=Math.min(t.length,i),a=e;a<o;a++){var s=t.charCodeAt(a)-48;n*=r,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,a=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this.strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,a=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303,(a+=24)>=26&&(a-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303),this.strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,s=o%r,l=Math.min(o,o-s)+i,d=0,c=i;c<l;c+=r)d=a(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==s){var h=1;for(d=a(t,c,t.length,e),c=0;c<s;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,l=a/67108864|0;i.words[0]=s;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(a=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&a}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i.strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var a=this.words[o],c=(16777215&(a<<r|n)).toString(16);i=0!=(n=a>>>24-r&16777215)||o!==this.length-1?s[6-c.length]+c+i:c+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],u=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modn(u).toString(t);i=(p=p.idivn(u)).isZero()?f+i:s[h-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)},r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){var r=this.byteLength(),n=i||Math.max(1,r);this.strip();var o,a,s="le"===e,l=new t(n),d=this.clone();if(s){for(a=0;!d.isZero();a++)o=d.andln(255),d.iushrn(8),l[a]=o;for(;a<n;a++)l[a]=0}else{for(a=0;a<n-r;a++)l[a]=0;for(a=0;!d.isZero();a++)o=d.andln(255),d.iushrn(8),l[n-a-1]=o}return l},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|i.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<i.length;a++)o=(e=(0|i.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var h=function(t,e,i){var r,n,o,a=t.words,s=e.words,l=i.words,d=0,c=0|a[0],h=8191&c,u=c>>>13,p=0|a[1],f=8191&p,m=p>>>13,g=0|a[2],b=8191&g,v=g>>>13,y=0|a[3],_=8191&y,w=y>>>13,x=0|a[4],M=8191&x,k=x>>>13,S=0|a[5],E=8191&S,A=S>>>13,T=0|a[6],R=8191&T,I=T>>>13,C=0|a[7],O=8191&C,P=C>>>13,L=0|a[8],$=8191&L,N=L>>>13,B=0|a[9],D=8191&B,j=B>>>13,z=0|s[0],F=8191&z,U=z>>>13,q=0|s[1],H=8191&q,V=q>>>13,W=0|s[2],G=8191&W,K=W>>>13,X=0|s[3],Y=8191&X,Z=X>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],lt=8191&st,dt=st>>>13,ct=0|s[8],ht=8191&ct,ut=ct>>>13,pt=0|s[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,F))|0)+((8191&(n=(n=Math.imul(h,U))+Math.imul(u,F)|0))<<13)|0;d=((o=Math.imul(u,U))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,F),n=(n=Math.imul(f,U))+Math.imul(m,F)|0,o=Math.imul(m,U);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,F),n=(n=Math.imul(b,U))+Math.imul(v,F)|0,o=Math.imul(v,U),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,F),n=(n=Math.imul(_,U))+Math.imul(w,F)|0,o=Math.imul(w,U),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Y)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(u,Y)|0))<<13)|0;d=((o=o+Math.imul(u,Z)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,F),n=(n=Math.imul(M,U))+Math.imul(k,F)|0,o=Math.imul(k,U),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Y)|0,n=(n=n+Math.imul(f,Z)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Z)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,F),n=(n=Math.imul(E,U))+Math.imul(A,F)|0,o=Math.imul(A,U),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Z)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(R,F),n=(n=Math.imul(R,U))+Math.imul(I,F)|0,o=Math.imul(I,U),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,Z)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,at)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,at)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,F),n=(n=Math.imul(O,U))+Math.imul(P,F)|0,o=Math.imul(P,U),r=r+Math.imul(R,H)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,Z)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul($,F),n=(n=Math.imul($,U))+Math.imul(N,F)|0,o=Math.imul(N,U),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(R,G)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,K)|0,r=r+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,Z)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(D,F),n=(n=Math.imul(D,U))+Math.imul(j,F)|0,o=Math.imul(j,U),r=r+Math.imul($,H)|0,n=(n=n+Math.imul($,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,K)|0,r=r+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,Z)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(D,H),n=(n=Math.imul(D,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul($,G)|0,n=(n=n+Math.imul($,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,Z)|0,r=r+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(D,G),n=(n=Math.imul(D,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul($,Y)|0,n=(n=n+Math.imul($,Z)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Z)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(R,it)|0,n=(n=n+Math.imul(R,rt)|0)+Math.imul(I,it)|0,o=o+Math.imul(I,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(D,Y),n=(n=Math.imul(D,Z))+Math.imul(j,Y)|0,o=Math.imul(j,Z),r=r+Math.imul($,Q)|0,n=(n=n+Math.imul($,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(P,it)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(D,Q),n=(n=Math.imul(D,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul($,it)|0,n=(n=n+Math.imul($,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(R,lt)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var Rt=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(D,it),n=(n=Math.imul(D,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul($,ot)|0,n=(n=n+Math.imul($,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,dt)|0,r=r+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ut)|0;var It=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(D,ot),n=(n=Math.imul(D,at))+Math.imul(j,ot)|0,o=Math.imul(j,at),r=r+Math.imul($,lt)|0,n=(n=n+Math.imul($,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0;var Ct=(d+(r=r+Math.imul(R,ft)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(I,ft)|0))<<13)|0;d=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(D,lt),n=(n=Math.imul(D,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul($,ht)|0,n=(n=n+Math.imul($,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(P,ft)|0))<<13)|0;d=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(D,ht),n=(n=Math.imul(D,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Pt=(d+(r=r+Math.imul($,ft)|0)|0)+((8191&(n=(n=n+Math.imul($,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(d+(r=Math.imul(D,ft))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=Rt,l[14]=It,l[15]=Ct,l[16]=Ot,l[17]=Pt,l[18]=Lt,0!==d&&(l[19]=d,i.length++),i};function u(t,e,i){return(new p).mulp(t,e,i)}function p(t,e){this.x=t,this.y=e}Math.imul||(h=c),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?h(this,t,e):i<63?c(this,t,e):i<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var a=n;n=0;for(var s=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;s=67108863&(u=u+s|0),n+=(a=(a=a+(h/67108864|0)|0)+(u>>>26)|0)>>>26,a&=67108863}i.words[o]=s,r=a,a=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):u(this,t,e)},p.prototype.makeRBT=function(t){for(var e=new Array(t),i=r.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,i,t);return e},p.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},p.prototype.permute=function(t,e,i,r,n,o){for(var a=0;a<o;a++)r[a]=e[t[a]],n[a]=i[t[a]]},p.prototype.transform=function(t,e,i,r,n,o){this.permute(o,t,e,i,r,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,l=Math.cos(2*Math.PI/s),d=Math.sin(2*Math.PI/s),c=0;c<n;c+=s)for(var h=l,u=d,p=0;p<a;p++){var f=i[c+p],m=r[c+p],g=i[c+p+a],b=r[c+p+a],v=h*g-u*b;b=h*b+u*g,g=v,i[c+p]=f+g,r[c+p]=m+b,i[c+p+a]=f-g,r[c+p+a]=m-b,p!==s&&(v=l*h-d*u,u=l*u+d*h,h=v)}},p.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},p.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},p.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},p.prototype.convert13b=function(t,e,i,r){for(var n=0,o=0;o<e;o++)n+=0|t[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*e;o<r;++o)i[o]=0},p.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},p.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),o=this.stub(r),a=new Array(r),s=new Array(r),l=new Array(r),d=new Array(r),c=new Array(r),h=new Array(r),u=i.words;u.length=r,this.convert13b(t.words,t.length,a,r),this.convert13b(e.words,e.length,d,r),this.transform(a,o,s,l,r,n),this.transform(d,o,c,h,r,n);for(var p=0;p<r;p++){var f=s[p]*c[p]-l[p]*h[p];l[p]=s[p]*h[p]+l[p]*c[p],s[p]=f}return this.conjugate(s,l,r),this.transform(s,l,u,o,r,n),this.conjugate(u,o,r),this.normalize13b(u,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),u(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){for(var e=0,i=0;i<this.length;i++){var r=(0|this.words[i])*t,n=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=n>>>26,this.words[i]=67108863&n}return 0!==e&&(this.words[i]=e,this.length++),this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&n,s=(0|this.words[e])-a<<i;this.words[e]=s|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),a=67108863^67108863>>>n<<n,s=i;if(r-=o,r=Math.max(0,r),s){for(var l=0;l<o;l++)s.words[l]=this.words[l];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&a}return s&&0!==d&&(s.words[s.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var a=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+a;var s=(0|t.words[r])*e;a=((n-=67108863&s)>>26)-(s/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)a=(n=(0|this.words[r+i])+a)>>26,this.words[r+i]=67108863&n;if(0===a)return this.strip();for(a=0,r=0;r<this.length;r++)a=(n=-(0|this.words[r])+a)>>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,a=0|o.words[o.length-1];0!=(i=26-this._countBits(a))&&(o=o.ushln(i),n.iushln(i),a=0|o.words[o.length-1]);var s,l=n.length-o.length;if("mod"!==e){(s=new r(null)).length=l+1,s.words=new Array(s.length);for(var d=0;d<s.length;d++)s.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/a|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=u)}return s&&s.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:s||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modn=function(t){for(var e=(1<<26)%t,i=0,r=this.length-1;r>=0;r--)i=(e*i+(0|this.words[r]))%t;return i},r.prototype.idivn=function(t){for(var e=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*e;this.words[i]=r/t|0,e=r%t}return this.strip()},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),a=new r(0),s=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(d),s.isub(c)),a.iushrn(1),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(a),o.isub(s)):(i.isub(e),a.isub(n),s.isub(o))}return{a:a,b:s,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),a=new r(0),s=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a)):(i.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var a=0|this.words[o];n=(a+=n)>>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new w(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var f={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function y(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function x(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(g,m),g.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(b,m),i(v,m),i(y,m),y.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(f[t])return f[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new b;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new y}return f[t]=e,e},w.prototype._verify1=function(t){},w.prototype._verify2=function(t,e){},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,s).cmp(a);)l.redIAdd(a);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],a=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===n&&0===c)&&(o=this.mul(o,i[a]),s=0,a=0)):s=0}l=26}return o},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new x(t)},i(x,w),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(Yn,this),Yn=Yn.exports,(Kn=function(t){return Xn||(Xn=new Zn(null)),Xn.generate(t)}).Rand=Zn,Zn.prototype.generate=function(t){return this._rand(t)},Zn.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),i=0;i<e.length;i++)e[i]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?Zn.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?Zn.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(Zn.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var Jn=_({});if("function"!=typeof Jn.randomBytes)throw new Error("Not supported");Zn.prototype._rand=function(t){return Jn.randomBytes(t)}}catch(t){}var Qn={};function to(t){this.rand=t||new Kn.Rand}Qn=to,to.create=function(t){return new to(t)},to.prototype._randbelow=function(t){var e=t.bitLength(),i=Math.ceil(e/8);do{var r=new Yn(this.rand.generate(i))}while(r.cmp(t)>=0);return r},to.prototype._randrange=function(t,e){var i=e.sub(t);return t.add(this._randbelow(i))},to.prototype.test=function(t,e,i){var r=t.bitLength(),n=Yn.mont(t),o=new Yn(1).toRed(n);e||(e=Math.max(1,r/48|0));for(var a=t.subn(1),s=0;!a.testn(s);s++);for(var l=t.shrn(s),d=a.toRed(n);e>0;e--){var c=this._randrange(new Yn(2),a);i&&i(c);var h=c.toRed(n).redPow(l);if(0!==h.cmp(o)&&0!==h.cmp(d)){for(var u=1;u<s;u++){if(0===(h=h.redSqr()).cmp(o))return!1;if(0===h.cmp(d))break}if(u===s)return!1}}return!0},to.prototype.getDivisor=function(t,e){var i=t.bitLength(),r=Yn.mont(t),n=new Yn(1).toRed(r);e||(e=Math.max(1,i/48|0));for(var o=t.subn(1),a=0;!o.testn(a);a++);for(var s=t.shrn(a),l=o.toRed(r);e>0;e--){var d=this._randrange(new Yn(2),o),c=t.gcd(d);if(0!==c.cmpn(1))return c;var h=d.toRed(r).redPow(s);if(0!==h.cmp(n)&&0!==h.cmp(l)){for(var u=1;u<a;u++){if(0===(h=h.redSqr()).cmp(n))return h.fromRed().subn(1).gcd(t);if(0===h.cmp(l))break}if(u===a)return(h=h.redSqr()).fromRed().subn(1).gcd(t)}}return!1};var eo={};eo=mo,mo.simpleSieve=po,mo.fermatTest=fo;var io=new Gn(24),ro=new Qn,no=new Gn(1),oo=new Gn(2),ao=new Gn(5),so=(new Gn(16),new Gn(8),new Gn(10)),lo=new Gn(3),co=(new Gn(7),new Gn(11)),ho=new Gn(4),uo=(new Gn(12),null);function po(t){for(var e=function(){if(null!==uo)return uo;var t=[];t[0]=2;for(var e=1,i=3;i<1048576;i+=2){for(var r=Math.ceil(Math.sqrt(i)),n=0;n<e&&t[n]<=r&&i%t[n]!=0;n++);e!==n&&t[n]<=r||(t[e++]=i)}return uo=t,t}(),i=0;i<e.length;i++)if(0===t.modn(e[i]))return 0===t.cmpn(e[i]);return!0}function fo(t){var e=Gn.mont(t);return 0===oo.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function mo(t,e){if(t<16)return new Gn(2===e||5===e?[140,123]:[140,39]);var i,r;for(e=new Gn(e);;){for(i=new Gn(Z(Math.ceil(t/8)));i.bitLength()>t;)i.ishrn(1);if(i.isEven()&&i.iadd(no),i.testn(1)||i.iadd(oo),e.cmp(oo)){if(!e.cmp(ao))for(;i.mod(so).cmp(lo);)i.iadd(ho)}else for(;i.mod(io).cmp(co);)i.iadd(ho);if(po(r=i.shrn(1))&&po(i)&&fo(r)&&fo(i)&&ro.test(r)&&ro.test(i))return i}}(function(t){(function(){var e=new Qn,i=new Gn(24),r=new Gn(11),n=new Gn(10),o=new Gn(3),a=new Gn(7);function s(e,i){return i=i||"utf8",t.isBuffer(e)||(e=new t(e,i)),this._pub=new Gn(e),this}function l(e,i){return i=i||"utf8",t.isBuffer(e)||(e=new t(e,i)),this._priv=new Gn(e),this}var d={};function c(t,e,i){this.setGenerator(e),this.__prime=new Gn(t),this._prime=Gn.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,i?(this.setPublicKey=s,this.setPrivateKey=l):this._primeCode=8}function h(e,i){var r=new t(e.toArray());return i?r.toString(i):r}Object.defineProperty(c.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,s){var l=s.toString("hex"),c=[l,t.toString(16)].join("_");if(c in d)return d[c];var h,u=0;if(t.isEven()||!eo.simpleSieve||!eo.fermatTest(t)||!e.test(t))return u+=1,u+="02"===l||"05"===l?8:4,d[c]=u,u;switch(e.test(t.shrn(1))||(u+=2),l){case"02":t.mod(i).cmp(r)&&(u+=8);break;case"05":(h=t.mod(n)).cmp(o)&&h.cmp(a)&&(u+=8);break;default:u+=4}return d[c]=u,u}(this.__prime,this.__gen)),this._primeCode}}),c.prototype.generateKeys=function(){return this._priv||(this._priv=new Gn(Z(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},c.prototype.computeSecret=function(e){var i=(e=(e=new Gn(e)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new t(i.toArray()),n=this.getPrime();if(r.length<n.length){var o=new t(n.length-r.length);o.fill(0),r=t.concat([o,r])}return r},c.prototype.getPublicKey=function(t){return h(this._pub,t)},c.prototype.getPrivateKey=function(t){return h(this._priv,t)},c.prototype.getPrime=function(t){return h(this.__prime,t)},c.prototype.getGenerator=function(t){return h(this._gen,t)},c.prototype.setGenerator=function(e,i){return i=i||"utf8",t.isBuffer(e)||(e=new t(e,i)),this.__gen=e,this._gen=new Gn(e),this}}).call(this)}).call(this,w({}).Buffer),function(t){(function(){}).call(this)}.call(this,w({}).Buffer);var go=tt.EventEmitter;function bo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function vo(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var yo=w({}).Buffer,_o=_({}).inspect,wo=_o&&_o.custom||"inspect",xo=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e;return(e=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i}},{key:"concat",value:function(t){if(0===this.length)return yo.alloc(0);for(var e,i,r,n=yo.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,i=n,r=a,yo.prototype.copy.call(e,i,r),a+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var i;return t<this.head.data.length?(i=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):i=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,i=1,r=e.data;for(t-=r.length;e=e.next;){var n=e.data,o=t>n.length?n.length:t;if(o===n.length?r+=n:r+=n.slice(0,t),0==(t-=o)){o===n.length?(++i,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(o));break}++i}return this.length-=i,r}},{key:"_getBuffer",value:function(t){var e=yo.allocUnsafe(t),i=this.head,r=1;for(i.data.copy(e),t-=i.data.length;i=i.next;){var n=i.data,o=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,o),0==(t-=o)){o===n.length?(++r,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=n.slice(o));break}++r}return this.length-=r,e}},{key:wo,value:function(t,e){return _o(this,function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?bo(Object(i),!0).forEach((function(e){vo(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):bo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(t.prototype,e),t}(),Mo={};(function(t){(function(){function e(t,e){r(t,e),i(t)}function i(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function r(t,e){t.emit("error",e)}Mo={destroy:function(n,o){var a=this,s=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return s||l?(o?o(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(r,this,n)):t.nextTick(r,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,(function(r){!o&&r?a._writableState?a._writableState.errorEmitted?t.nextTick(i,a):(a._writableState.errorEmitted=!0,t.nextTick(e,a,r)):t.nextTick(e,a,r):o?(t.nextTick(i,a),o(r)):t.nextTick(i,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var i=t._readableState,r=t._writableState;i&&i.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this)}).call(this,D);var ko={},So={};function Eo(t,e,i){i||(i=Error);var r=function(t){var i,r;function n(i,r,n){return t.call(this,function(t,i,r){return"string"==typeof e?e:e(t,i,r)}(i,r,n))||this}return r=t,(i=n).prototype=Object.create(r.prototype),i.prototype.constructor=i,i.__proto__=r,n}(i);r.prototype.name=i.name,r.prototype.code=t,So[t]=r}function Ao(t,e){if(Array.isArray(t)){var i=t.length;return t=t.map((function(t){return String(t)})),i>2?"one of ".concat(e," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}Eo("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),Eo("ERR_INVALID_ARG_TYPE",(function(t,e,i){var r,n,o,a;if("string"==typeof e&&"not "===e.substr(0,"not ".length)?(r="must not be",e=e.replace(/^not /,"")):r="must be",o=t,(void 0===a||a>o.length)&&(a=o.length)," argument"===o.substring(a-" argument".length,a))n="The ".concat(t," ").concat(r," ").concat(Ao(e,"type"));else{var s=function(t,e,i){return"number"!=typeof i&&(i=0),!(i+".".length>t.length)&&-1!==t.indexOf(".",i)}(t)?"property":"argument";n='The "'.concat(t,'" ').concat(s," ").concat(r," ").concat(Ao(e,"type"))}return n+". Received type ".concat(typeof i)}),TypeError),Eo("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),Eo("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),Eo("ERR_STREAM_PREMATURE_CLOSE","Premature close"),Eo("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),Eo("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),Eo("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),Eo("ERR_STREAM_WRITE_AFTER_END","write after end"),Eo("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),Eo("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),Eo("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),ko.codes=So;var To=ko.codes.ERR_INVALID_OPT_VALUE,Ro={getHighWaterMark:function(t,e,i,r){var n=function(t,e,i){return null!=t.highWaterMark?t.highWaterMark:e?t[i]:null}(e,r,i);if(null!=n){if(!isFinite(n)||Math.floor(n)!==n||n<0)throw new To(r?i:"highWaterMark",n);return Math.floor(n)}return t.objectMode?16:16384}},Io=Do,Co=ko.codes,Oo=Co.ERR_METHOD_NOT_IMPLEMENTED,Po=Co.ERR_MULTIPLE_CALLBACK,Lo=Co.ERR_TRANSFORM_ALREADY_TRANSFORMING,$o=Co.ERR_TRANSFORM_WITH_LENGTH_0,No=o({});function Bo(t,e){var i=this._transformState;i.transforming=!1;var r=i.writecb;if(null===r)return this.emit("error",new Po);i.writechunk=null,i.writecb=null,null!=e&&this.push(e),r(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Do(t){if(!(this instanceof Do))return new Do(t);No.call(this,t),this._transformState={afterTransform:Bo.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",jo)}function jo(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?zo(this,null,null):this._flush((function(e,i){zo(t,e,i)}))}function zo(t,e,i){if(e)return t.emit("error",e);if(null!=i&&t.push(i),t._writableState.length)throw new $o;if(t._transformState.transforming)throw new Lo;return t.push(null)}J(Do,No),Do.prototype.push=function(t,e){return this._transformState.needTransform=!1,No.prototype.push.call(this,t,e)},Do.prototype._transform=function(t,e,i){i(new Oo("_transform()"))},Do.prototype._write=function(t,e,i){var r=this._transformState;if(r.writecb=i,r.writechunk=t,r.writeencoding=e,!r.transforming){var n=this._readableState;(r.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},Do.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},Do.prototype._destroy=function(t,e){No.prototype._destroy.call(this,t,(function(t){e(t)}))};var Fo,Uo=qo;function qo(t){if(!(this instanceof qo))return new qo(t);Io.call(this,t)}J(qo,Io),qo.prototype._transform=function(t,e,i){i(null,t)};var Ho=ko.codes,Vo=Ho.ERR_MISSING_ARGS,Wo=Ho.ERR_STREAM_DESTROYED;function Go(t){if(t)throw t}function Ko(t){t()}function Xo(t,e){return t.pipe(e)}var Yo={};(Yo=Yo=e({})).Stream=Yo,Yo.Readable=Yo,Yo.Writable=a({}),Yo.Duplex=o({}),Yo.Transform=Io,Yo.PassThrough=Uo,Yo.finished=n({}),Yo.pipeline=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var r,o=function(t){return t.length?"function"!=typeof t[t.length-1]?Go:t.pop():Go}(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Vo("streams");var a=e.map((function(t,i){var s=i<e.length-1;return function(t,e,i,r){r=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(r);var o=!1;t.on("close",(function(){o=!0})),void 0===Fo&&(Fo=n({})),Fo(t,{readable:e,writable:i},(function(t){if(t)return r(t);o=!0,r()}));var a=!1;return function(e){if(!o&&!a)return a=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void r(e||new Wo("pipe"))}}(t,s,i>0,(function(t){r||(r=t),t&&a.forEach(Ko),s||(a.forEach(Ko),o(r))}))}));return e.reduce(Xo)};var Zo={exports:{}};!function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=_({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var a=t.charCodeAt(o)-48;r<<=4,r|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:a}return r}function a(t,e,i,r){for(var n=0,o=Math.min(t.length,i),a=e;a<o;a++){var s=t.charCodeAt(a)-48;n*=r,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}function s(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this._strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,a=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this._strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,a=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303,(a+=24)>=26&&(a-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303),this._strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,s=o%r,l=Math.min(o,o-s)+i,d=0,c=i;c<l;c+=r)d=a(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==s){var h=1;for(d=a(t,c,t.length,e),c=0;c<s;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype._move=function(t){s(t,this)},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{r.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){r.prototype.inspect=l}else r.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function u(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,l=a/67108864|0;i.words[0]=s;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(a=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&a}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i._strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var a=this.words[o],s=(16777215&(a<<r|n)).toString(16);i=0!=(n=a>>>24-r&16777215)||o!==this.length-1?d[6-s.length]+s+i:s+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],u=h[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modrn(u).toString(t);i=(p=p.idivn(u)).isZero()?f+i:d[l-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16,2)},n&&(r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)}),r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){this._strip();var r=this.byteLength(),n=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,i||Math.max(1,r));return this["_toArrayLike"+("le"===e?"LE":"BE")](n,r),n},r.prototype._toArrayLikeLE=function(t,e){for(var i=0,r=0,n=0,o=0;n<this.length;n++){var a=this.words[n]<<o|r;t[i++]=255&a,i<t.length&&(t[i++]=a>>8&255),i<t.length&&(t[i++]=a>>16&255),6===o?(i<t.length&&(t[i++]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(i<t.length)for(t[i++]=r;i<t.length;)t[i++]=0},r.prototype._toArrayLikeBE=function(t,e){for(var i=t.length-1,r=0,n=0,o=0;n<this.length;n++){var a=this.words[n]<<o|r;t[i--]=255&a,i>=0&&(t[i--]=a>>8&255),i>=0&&(t[i--]=a>>16&255),6===o?(i>=0&&(t[i--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(i>=0)for(t[i--]=r;i>=0;)t[i--]=0},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this._strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this._strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this._strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|i.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<i.length;a++)o=(e=(0|i.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this._strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,i){var r,n,o,a=t.words,s=e.words,l=i.words,d=0,c=0|a[0],h=8191&c,u=c>>>13,p=0|a[1],f=8191&p,m=p>>>13,g=0|a[2],b=8191&g,v=g>>>13,y=0|a[3],_=8191&y,w=y>>>13,x=0|a[4],M=8191&x,k=x>>>13,S=0|a[5],E=8191&S,A=S>>>13,T=0|a[6],R=8191&T,I=T>>>13,C=0|a[7],O=8191&C,P=C>>>13,L=0|a[8],$=8191&L,N=L>>>13,B=0|a[9],D=8191&B,j=B>>>13,z=0|s[0],F=8191&z,U=z>>>13,q=0|s[1],H=8191&q,V=q>>>13,W=0|s[2],G=8191&W,K=W>>>13,X=0|s[3],Y=8191&X,Z=X>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],lt=8191&st,dt=st>>>13,ct=0|s[8],ht=8191&ct,ut=ct>>>13,pt=0|s[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,F))|0)+((8191&(n=(n=Math.imul(h,U))+Math.imul(u,F)|0))<<13)|0;d=((o=Math.imul(u,U))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,F),n=(n=Math.imul(f,U))+Math.imul(m,F)|0,o=Math.imul(m,U);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,F),n=(n=Math.imul(b,U))+Math.imul(v,F)|0,o=Math.imul(v,U),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,F),n=(n=Math.imul(_,U))+Math.imul(w,F)|0,o=Math.imul(w,U),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Y)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(u,Y)|0))<<13)|0;d=((o=o+Math.imul(u,Z)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,F),n=(n=Math.imul(M,U))+Math.imul(k,F)|0,o=Math.imul(k,U),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Y)|0,n=(n=n+Math.imul(f,Z)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Z)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,F),n=(n=Math.imul(E,U))+Math.imul(A,F)|0,o=Math.imul(A,U),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Z)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(R,F),n=(n=Math.imul(R,U))+Math.imul(I,F)|0,o=Math.imul(I,U),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,Z)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,at)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,at)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,F),n=(n=Math.imul(O,U))+Math.imul(P,F)|0,o=Math.imul(P,U),r=r+Math.imul(R,H)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,Z)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul($,F),n=(n=Math.imul($,U))+Math.imul(N,F)|0,o=Math.imul(N,U),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(R,G)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,K)|0,r=r+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,Z)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(D,F),n=(n=Math.imul(D,U))+Math.imul(j,F)|0,o=Math.imul(j,U),r=r+Math.imul($,H)|0,n=(n=n+Math.imul($,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,K)|0,r=r+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,Z)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(D,H),n=(n=Math.imul(D,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul($,G)|0,n=(n=n+Math.imul($,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,Z)|0,r=r+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(D,G),n=(n=Math.imul(D,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul($,Y)|0,n=(n=n+Math.imul($,Z)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Z)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(R,it)|0,n=(n=n+Math.imul(R,rt)|0)+Math.imul(I,it)|0,o=o+Math.imul(I,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(D,Y),n=(n=Math.imul(D,Z))+Math.imul(j,Y)|0,o=Math.imul(j,Z),r=r+Math.imul($,Q)|0,n=(n=n+Math.imul($,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(P,it)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(D,Q),n=(n=Math.imul(D,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul($,it)|0,n=(n=n+Math.imul($,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(R,lt)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var Rt=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(D,it),n=(n=Math.imul(D,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul($,ot)|0,n=(n=n+Math.imul($,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,dt)|0,r=r+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ut)|0;var It=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(D,ot),n=(n=Math.imul(D,at))+Math.imul(j,ot)|0,o=Math.imul(j,at),r=r+Math.imul($,lt)|0,n=(n=n+Math.imul($,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0;var Ct=(d+(r=r+Math.imul(R,ft)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(I,ft)|0))<<13)|0;d=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(D,lt),n=(n=Math.imul(D,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul($,ht)|0,n=(n=n+Math.imul($,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(P,ft)|0))<<13)|0;d=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(D,ht),n=(n=Math.imul(D,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Pt=(d+(r=r+Math.imul($,ft)|0)|0)+((8191&(n=(n=n+Math.imul($,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(d+(r=Math.imul(D,ft))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=Rt,l[14]=It,l[15]=Ct,l[16]=Ot,l[17]=Pt,l[18]=Lt,0!==d&&(l[19]=d,i.length++),i};function f(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var a=n;n=0;for(var s=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;s=67108863&(u=u+s|0),n+=(a=(a=a+(h/67108864|0)|0)+(u>>>26)|0)>>>26,a&=67108863}i.words[o]=s,r=a,a=n}return 0!==r?i.words[o]=r:i.length--,i._strip()}function m(t,e,i){return f(t,e,i)}Math.imul||(p=u),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):i<63?u(this,t,e):i<1024?f(this,t,e):m(this,t,e)},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),m(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){var e=t<0;e&&(t=-t);for(var i=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&i);i>>=26,i+=n/67108864|0,i+=o>>>26,this.words[r]=67108863&o}return 0!==i&&(this.words[r]=i,this.length++),e?this.ineg():this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=t.words[r]>>>n&1}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&n,s=(0|this.words[e])-a<<i;this.words[e]=s|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this._strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),a=67108863^67108863>>>n<<n,s=i;if(r-=o,r=Math.max(0,r),s){for(var l=0;l<o;l++)s.words[l]=this.words[l];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&a}return s&&0!==d&&(s.words[s.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this._strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var a=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+a;var s=(0|t.words[r])*e;a=((n-=67108863&s)>>26)-(s/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)a=(n=(0|this.words[r+i])+a)>>26,this.words[r+i]=67108863&n;if(0===a)return this._strip();for(a=0,r=0;r<this.length;r++)a=(n=-(0|this.words[r])+a)>>26,this.words[r]=67108863&n;return this.negative=1,this._strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,a=0|o.words[o.length-1];0!=(i=26-this._countBits(a))&&(o=o.ushln(i),n.iushln(i),a=0|o.words[o.length-1]);var s,l=n.length-o.length;if("mod"!==e){(s=new r(null)).length=l+1,s.words=new Array(s.length);for(var d=0;d<s.length;d++)s.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/a|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=u)}return s&&s._strip(),n._strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:s||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modrn=function(t){var e=t<0;e&&(t=-t);for(var i=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(i*r+(0|this.words[n]))%t;return e?-r:r},r.prototype.modn=function(t){return this.modrn(t)},r.prototype.idivn=function(t){var e=t<0;e&&(t=-t);for(var i=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*i;this.words[r]=n/t|0,i=n%t}return this._strip(),e?this.ineg():this},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),a=new r(0),s=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(d),s.isub(c)),a.iushrn(1),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(a),o.isub(s)):(i.isub(e),a.isub(n),s.isub(o))}return{a:a,b:s,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),a=new r(0),s=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a)):(i.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var a=0|this.words[o];n=(a+=n)>>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new M(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(v,b),v.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(y,b),i(w,b),i(x,b),x.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new y;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new x}return g[t]=e,e},M.prototype._verify1=function(t){},M.prototype._verify2=function(t,e){},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(s(t,t.umod(this.m)._forceRed(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,s).cmp(a);)l.redIAdd(a);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],a=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===n&&0===c)&&(o=this.mul(o,i[a]),s=0,a=0)):s=0}l=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new k(t)},i(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(Zo,this),Zo=Zo.exports;var Jo={};(function(t){(function(){function e(t){var e,i=t.modulus.byteLength();do{e=new Zo(Z(i))}while(e.cmp(t.modulus)>=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function i(i,r){var n=function(t){var i=e(t);return{blinder:i.toRed(Zo.mont(t.modulus)).redPow(new Zo(t.publicExponent)).fromRed(),unblinder:i.invm(t.modulus)}}(r),o=r.modulus.byteLength(),a=new Zo(i).mul(n.blinder).umod(r.modulus),s=a.toRed(Zo.mont(r.prime1)),l=a.toRed(Zo.mont(r.prime2)),d=r.coefficient,c=r.prime1,h=r.prime2,u=s.redPow(r.exponent1).fromRed(),p=l.redPow(r.exponent2).fromRed(),f=u.isub(p).imul(d).umod(c).imul(h);return p.iadd(f).imul(n.unblinder).umod(r.modulus).toArrayLike(t,"be",o)}i.getr=e,Jo=i}).call(this)}).call(this,w({}).Buffer);var Qo={exports:{}};!function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=_({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var a=t.charCodeAt(o)-48;r<<=4,r|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function a(t,e,i,r){for(var n=0,o=Math.min(t.length,i),a=e;a<o;a++){var s=t.charCodeAt(a)-48;n*=r,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,a=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this.strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,a=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303,(a+=24)>=26&&(a-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303),this.strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,s=o%r,l=Math.min(o,o-s)+i,d=0,c=i;c<l;c+=r)d=a(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==s){var h=1;for(d=a(t,c,t.length,e),c=0;c<s;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,l=a/67108864|0;i.words[0]=s;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(a=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&a}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i.strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var a=this.words[o],c=(16777215&(a<<r|n)).toString(16);i=0!=(n=a>>>24-r&16777215)||o!==this.length-1?s[6-c.length]+c+i:c+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],u=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modn(u).toString(t);i=(p=p.idivn(u)).isZero()?f+i:s[h-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)},r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){var r=this.byteLength(),n=i||Math.max(1,r);this.strip();var o,a,s="le"===e,l=new t(n),d=this.clone();if(s){for(a=0;!d.isZero();a++)o=d.andln(255),d.iushrn(8),l[a]=o;for(;a<n;a++)l[a]=0}else{for(a=0;a<n-r;a++)l[a]=0;for(a=0;!d.isZero();a++)o=d.andln(255),d.iushrn(8),l[n-a-1]=o}return l},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|i.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<i.length;a++)o=(e=(0|i.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var h=function(t,e,i){var r,n,o,a=t.words,s=e.words,l=i.words,d=0,c=0|a[0],h=8191&c,u=c>>>13,p=0|a[1],f=8191&p,m=p>>>13,g=0|a[2],b=8191&g,v=g>>>13,y=0|a[3],_=8191&y,w=y>>>13,x=0|a[4],M=8191&x,k=x>>>13,S=0|a[5],E=8191&S,A=S>>>13,T=0|a[6],R=8191&T,I=T>>>13,C=0|a[7],O=8191&C,P=C>>>13,L=0|a[8],$=8191&L,N=L>>>13,B=0|a[9],D=8191&B,j=B>>>13,z=0|s[0],F=8191&z,U=z>>>13,q=0|s[1],H=8191&q,V=q>>>13,W=0|s[2],G=8191&W,K=W>>>13,X=0|s[3],Y=8191&X,Z=X>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],lt=8191&st,dt=st>>>13,ct=0|s[8],ht=8191&ct,ut=ct>>>13,pt=0|s[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,F))|0)+((8191&(n=(n=Math.imul(h,U))+Math.imul(u,F)|0))<<13)|0;d=((o=Math.imul(u,U))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,F),n=(n=Math.imul(f,U))+Math.imul(m,F)|0,o=Math.imul(m,U);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,F),n=(n=Math.imul(b,U))+Math.imul(v,F)|0,o=Math.imul(v,U),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,F),n=(n=Math.imul(_,U))+Math.imul(w,F)|0,o=Math.imul(w,U),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Y)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(u,Y)|0))<<13)|0;d=((o=o+Math.imul(u,Z)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,F),n=(n=Math.imul(M,U))+Math.imul(k,F)|0,o=Math.imul(k,U),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Y)|0,n=(n=n+Math.imul(f,Z)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Z)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,F),n=(n=Math.imul(E,U))+Math.imul(A,F)|0,o=Math.imul(A,U),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Z)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(R,F),n=(n=Math.imul(R,U))+Math.imul(I,F)|0,o=Math.imul(I,U),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,Z)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,at)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,at)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,F),n=(n=Math.imul(O,U))+Math.imul(P,F)|0,o=Math.imul(P,U),r=r+Math.imul(R,H)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,Z)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul($,F),n=(n=Math.imul($,U))+Math.imul(N,F)|0,o=Math.imul(N,U),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(R,G)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,K)|0,r=r+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,Z)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(D,F),n=(n=Math.imul(D,U))+Math.imul(j,F)|0,o=Math.imul(j,U),r=r+Math.imul($,H)|0,n=(n=n+Math.imul($,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,K)|0,r=r+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,Z)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(D,H),n=(n=Math.imul(D,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul($,G)|0,n=(n=n+Math.imul($,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,Z)|0,r=r+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(D,G),n=(n=Math.imul(D,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul($,Y)|0,n=(n=n+Math.imul($,Z)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Z)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(R,it)|0,n=(n=n+Math.imul(R,rt)|0)+Math.imul(I,it)|0,o=o+Math.imul(I,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(D,Y),n=(n=Math.imul(D,Z))+Math.imul(j,Y)|0,o=Math.imul(j,Z),r=r+Math.imul($,Q)|0,n=(n=n+Math.imul($,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(P,it)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(D,Q),n=(n=Math.imul(D,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul($,it)|0,n=(n=n+Math.imul($,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(R,lt)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var Rt=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(D,it),n=(n=Math.imul(D,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul($,ot)|0,n=(n=n+Math.imul($,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,dt)|0,r=r+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ut)|0;var It=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(D,ot),n=(n=Math.imul(D,at))+Math.imul(j,ot)|0,o=Math.imul(j,at),r=r+Math.imul($,lt)|0,n=(n=n+Math.imul($,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0;var Ct=(d+(r=r+Math.imul(R,ft)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(I,ft)|0))<<13)|0;d=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(D,lt),n=(n=Math.imul(D,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul($,ht)|0,n=(n=n+Math.imul($,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(P,ft)|0))<<13)|0;d=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(D,ht),n=(n=Math.imul(D,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Pt=(d+(r=r+Math.imul($,ft)|0)|0)+((8191&(n=(n=n+Math.imul($,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(d+(r=Math.imul(D,ft))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=Rt,l[14]=It,l[15]=Ct,l[16]=Ot,l[17]=Pt,l[18]=Lt,0!==d&&(l[19]=d,i.length++),i};function u(t,e,i){return(new p).mulp(t,e,i)}function p(t,e){this.x=t,this.y=e}Math.imul||(h=c),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?h(this,t,e):i<63?c(this,t,e):i<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var a=n;n=0;for(var s=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;s=67108863&(u=u+s|0),n+=(a=(a=a+(h/67108864|0)|0)+(u>>>26)|0)>>>26,a&=67108863}i.words[o]=s,r=a,a=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):u(this,t,e)},p.prototype.makeRBT=function(t){for(var e=new Array(t),i=r.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,i,t);return e},p.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},p.prototype.permute=function(t,e,i,r,n,o){for(var a=0;a<o;a++)r[a]=e[t[a]],n[a]=i[t[a]]},p.prototype.transform=function(t,e,i,r,n,o){this.permute(o,t,e,i,r,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,l=Math.cos(2*Math.PI/s),d=Math.sin(2*Math.PI/s),c=0;c<n;c+=s)for(var h=l,u=d,p=0;p<a;p++){var f=i[c+p],m=r[c+p],g=i[c+p+a],b=r[c+p+a],v=h*g-u*b;b=h*b+u*g,g=v,i[c+p]=f+g,r[c+p]=m+b,i[c+p+a]=f-g,r[c+p+a]=m-b,p!==s&&(v=l*h-d*u,u=l*u+d*h,h=v)}},p.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},p.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},p.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},p.prototype.convert13b=function(t,e,i,r){for(var n=0,o=0;o<e;o++)n+=0|t[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*e;o<r;++o)i[o]=0},p.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},p.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),o=this.stub(r),a=new Array(r),s=new Array(r),l=new Array(r),d=new Array(r),c=new Array(r),h=new Array(r),u=i.words;u.length=r,this.convert13b(t.words,t.length,a,r),this.convert13b(e.words,e.length,d,r),this.transform(a,o,s,l,r,n),this.transform(d,o,c,h,r,n);for(var p=0;p<r;p++){var f=s[p]*c[p]-l[p]*h[p];l[p]=s[p]*h[p]+l[p]*c[p],s[p]=f}return this.conjugate(s,l,r),this.transform(s,l,u,o,r,n),this.conjugate(u,o,r),this.normalize13b(u,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),u(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){for(var e=0,i=0;i<this.length;i++){var r=(0|this.words[i])*t,n=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=n>>>26,this.words[i]=67108863&n}return 0!==e&&(this.words[i]=e,this.length++),this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&n,s=(0|this.words[e])-a<<i;this.words[e]=s|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),a=67108863^67108863>>>n<<n,s=i;if(r-=o,r=Math.max(0,r),s){for(var l=0;l<o;l++)s.words[l]=this.words[l];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&a}return s&&0!==d&&(s.words[s.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var a=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+a;var s=(0|t.words[r])*e;a=((n-=67108863&s)>>26)-(s/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)a=(n=(0|this.words[r+i])+a)>>26,this.words[r+i]=67108863&n;if(0===a)return this.strip();for(a=0,r=0;r<this.length;r++)a=(n=-(0|this.words[r])+a)>>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,a=0|o.words[o.length-1];0!=(i=26-this._countBits(a))&&(o=o.ushln(i),n.iushln(i),a=0|o.words[o.length-1]);var s,l=n.length-o.length;if("mod"!==e){(s=new r(null)).length=l+1,s.words=new Array(s.length);for(var d=0;d<s.length;d++)s.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/a|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=u)}return s&&s.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:s||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modn=function(t){for(var e=(1<<26)%t,i=0,r=this.length-1;r>=0;r--)i=(e*i+(0|this.words[r]))%t;return i},r.prototype.idivn=function(t){for(var e=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*e;this.words[i]=r/t|0,e=r%t}return this.strip()},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),a=new r(0),s=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(d),s.isub(c)),a.iushrn(1),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(a),o.isub(s)):(i.isub(e),a.isub(n),s.isub(o))}return{a:a,b:s,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),a=new r(0),s=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a)):(i.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var a=0|this.words[o];n=(a+=n)>>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new w(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var f={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function y(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function x(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(g,m),g.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(b,m),i(v,m),i(y,m),y.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(f[t])return f[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new b;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new y}return f[t]=e,e},w.prototype._verify1=function(t){},w.prototype._verify2=function(t,e){},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,s).cmp(a);)l.redIAdd(a);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],a=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===n&&0===c)&&(o=this.mul(o,i[a]),s=0,a=0)):s=0}l=26}return o},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new x(t)},i(x,w),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(Qo,this),Qo=Qo.exports;var ta={},ea=ta;function ia(t){return 1===t.length?"0"+t:t}function ra(t){for(var e="",i=0;i<t.length;i++)e+=ia(t[i].toString(16));return e}ea.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var i=[];if("string"!=typeof t){for(var r=0;r<t.length;r++)i[r]=0|t[r];return i}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),r=0;r<t.length;r+=2)i.push(parseInt(t[r]+t[r+1],16));else for(r=0;r<t.length;r++){var n=t.charCodeAt(r),o=n>>8,a=255&n;o?i.push(o,a):i.push(a)}return i},ea.zero2=ia,ea.toHex=ra,ea.encode=function(t,e){return"hex"===e?ra(t):t};var na={},oa=na;oa.assert=$r,oa.toArray=ta.toArray,oa.zero2=ta.zero2,oa.toHex=ta.toHex,oa.encode=ta.encode,oa.getNAF=function(t,e,i){var r=new Array(Math.max(t.bitLength(),i)+1);r.fill(0);for(var n=1<<e+1,o=t.clone(),a=0;a<r.length;a++){var s,l=o.andln(n-1);o.isOdd()?(s=l>(n>>1)-1?(n>>1)-l:l,o.isubn(s)):s=0,r[a]=s,o.iushrn(1)}return r},oa.getJSF=function(t,e){var i=[[],[]];t=t.clone(),e=e.clone();for(var r,n=0,o=0;t.cmpn(-n)>0||e.cmpn(-o)>0;){var a,s,l=t.andln(3)+n&3,d=e.andln(3)+o&3;3===l&&(l=-1),3===d&&(d=-1),a=0==(1&l)?0:3!=(r=t.andln(7)+n&7)&&5!==r||2!==d?l:-l,i[0].push(a),s=0==(1&d)?0:3!=(r=e.andln(7)+o&7)&&5!==r||2!==l?d:-d,i[1].push(s),2*n===a+1&&(n=1-n),2*o===s+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return i},oa.cachedProperty=function(t,e,i){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=i.call(this)}},oa.parseBytes=function(t){return"string"==typeof t?oa.toArray(t,"hex"):t},oa.intFromLE=function(t){return new Qo(t,"hex","le")};var aa,sa,la,da={},ca=na.getNAF,ha=na.getJSF;function ua(t,e){this.type=t,this.p=new Qo(e.p,16),this.red=e.prime?Qo.red(e.prime):Qo.mont(this.p),this.zero=new Qo(0).toRed(this.red),this.one=new Qo(1).toRed(this.red),this.two=new Qo(2).toRed(this.red),this.n=e.n&&new Qo(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function pa(t,e){this.curve=t,this.type=e,this.precomputed=null}function fa(t){da.call(this,"short",t),this.a=new Qo(t.a,16).toRed(this.red),this.b=new Qo(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function ma(t,e,i,r){da.BasePoint.call(this,t,"affine"),null===e&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new Qo(e,16),this.y=new Qo(i,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function ga(t,e,i,r){da.BasePoint.call(this,t,"jacobian"),null===e&&null===i&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Qo(0)):(this.x=new Qo(e,16),this.y=new Qo(i,16),this.z=new Qo(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}function ba(t){da.call(this,"mont",t),this.a=new Qo(t.a,16).toRed(this.red),this.b=new Qo(t.b,16).toRed(this.red),this.i4=new Qo(4).toRed(this.red).redInvm(),this.two=new Qo(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function va(t,e,i){da.BasePoint.call(this,t,"projective"),null===e&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Qo(e,16),this.z=new Qo(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}function ya(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,da.call(this,"edwards",t),this.a=new Qo(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Qo(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Qo(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),this.oneC=1==(0|t.c)}function _a(t,e,i,r,n){da.BasePoint.call(this,t,"projective"),null===e&&null===i&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Qo(e,16),this.y=new Qo(i,16),this.z=r?new Qo(r,16):this.curve.one,this.t=n&&new Qo(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}na.assert,da=ua,ua.prototype.point=function(){throw new Error("Not implemented")},ua.prototype.validate=function(){throw new Error("Not implemented")},ua.prototype._fixedNafMul=function(t,e){var i=t._getDoubles(),r=ca(e,1,this._bitLength),n=(1<<i.step+1)-(i.step%2==0?2:1);n/=3;var o,a,s=[];for(o=0;o<r.length;o+=i.step){a=0;for(var l=o+i.step-1;l>=o;l--)a=(a<<1)+r[l];s.push(a)}for(var d=this.jpoint(null,null,null),c=this.jpoint(null,null,null),h=n;h>0;h--){for(o=0;o<s.length;o++)(a=s[o])===h?c=c.mixedAdd(i.points[o]):a===-h&&(c=c.mixedAdd(i.points[o].neg()));d=d.add(c)}return d.toP()},ua.prototype._wnafMul=function(t,e){var i=4,r=t._getNAFPoints(i);i=r.wnd;for(var n=r.points,o=ca(e,i,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var l=0;s>=0&&0===o[s];s--)l++;if(s>=0&&l++,a=a.dblp(l),s<0)break;var d=o[s];a="affine"===t.type?d>0?a.mixedAdd(n[d-1>>1]):a.mixedAdd(n[-d-1>>1].neg()):d>0?a.add(n[d-1>>1]):a.add(n[-d-1>>1].neg())}return"affine"===t.type?a.toP():a},ua.prototype._wnafMulAdd=function(t,e,i,r,n){var o,a,s,l=this._wnafT1,d=this._wnafT2,c=this._wnafT3,h=0;for(o=0;o<r;o++){var u=(s=e[o])._getNAFPoints(t);l[o]=u.wnd,d[o]=u.points}for(o=r-1;o>=1;o-=2){var p=o-1,f=o;if(1===l[p]&&1===l[f]){var m=[e[p],null,null,e[f]];0===e[p].y.cmp(e[f].y)?(m[1]=e[p].add(e[f]),m[2]=e[p].toJ().mixedAdd(e[f].neg())):0===e[p].y.cmp(e[f].y.redNeg())?(m[1]=e[p].toJ().mixedAdd(e[f]),m[2]=e[p].add(e[f].neg())):(m[1]=e[p].toJ().mixedAdd(e[f]),m[2]=e[p].toJ().mixedAdd(e[f].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],b=ha(i[p],i[f]);for(h=Math.max(b[0].length,h),c[p]=new Array(h),c[f]=new Array(h),a=0;a<h;a++){var v=0|b[0][a],y=0|b[1][a];c[p][a]=g[3*(v+1)+(y+1)],c[f][a]=0,d[p]=m}}else c[p]=ca(i[p],l[p],this._bitLength),c[f]=ca(i[f],l[f],this._bitLength),h=Math.max(c[p].length,h),h=Math.max(c[f].length,h)}var _=this.jpoint(null,null,null),w=this._wnafT4;for(o=h;o>=0;o--){for(var x=0;o>=0;){var M=!0;for(a=0;a<r;a++)w[a]=0|c[a][o],0!==w[a]&&(M=!1);if(!M)break;x++,o--}if(o>=0&&x++,_=_.dblp(x),o<0)break;for(a=0;a<r;a++){var k=w[a];0!==k&&(k>0?s=d[a][k-1>>1]:k<0&&(s=d[a][-k-1>>1].neg()),_="affine"===s.type?_.mixedAdd(s):_.add(s))}}for(o=0;o<r;o++)d[o]=null;return n?_:_.toP()},ua.BasePoint=pa,pa.prototype.eq=function(){throw new Error("Not implemented")},pa.prototype.validate=function(){return this.curve.validate(this)},ua.prototype.decodePoint=function(t,e){t=na.toArray(t,e);var i=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*i)return 6===t[0]||t[0],this.point(t.slice(1,1+i),t.slice(1+i,1+2*i));if((2===t[0]||3===t[0])&&t.length-1===i)return this.pointFromX(t.slice(1,1+i),3===t[0]);throw new Error("Unknown point format")},pa.prototype.encodeCompressed=function(t){return this.encode(t,!0)},pa.prototype._encode=function(t){var e=this.curve.p.byteLength(),i=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",e))},pa.prototype.encode=function(t,e){return na.encode(this._encode(e),t)},pa.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},pa.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},pa.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],r=this,n=0;n<e;n+=t){for(var o=0;o<t;o++)r=r.dbl();i.push(r)}return{step:t,points:i}},pa.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],i=(1<<t)-1,r=1===i?null:this.dbl(),n=1;n<i;n++)e[n]=e[n-1].add(r);return{wnd:t,points:e}},pa.prototype._getBeta=function(){return null},pa.prototype.dblp=function(t){for(var e=this,i=0;i<t;i++)e=e.dbl();return e},na.assert,J(fa,da),aa=fa,fa.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,i;if(t.beta)e=new Qo(t.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);e=(e=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(t.lambda)i=new Qo(t.lambda,16);else{var n=this._getEndoRoots(this.n);i=0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(e))?n[0]:n[1]}return{beta:e,lambda:i,basis:t.basis?t.basis.map((function(t){return{a:new Qo(t.a,16),b:new Qo(t.b,16)}})):this._getEndoBasis(i)}}},fa.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:Qo.mont(t),i=new Qo(2).toRed(e).redInvm(),r=i.redNeg(),n=new Qo(3).toRed(e).redNeg().redSqrt().redMul(i);return[r.redAdd(n).fromRed(),r.redSub(n).fromRed()]},fa.prototype._getEndoBasis=function(t){for(var e,i,r,n,o,a,s,l,d,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,u=this.n.clone(),p=new Qo(1),f=new Qo(0),m=new Qo(0),g=new Qo(1),b=0;0!==h.cmpn(0);){var v=u.div(h);l=u.sub(v.mul(h)),d=m.sub(v.mul(p));var y=g.sub(v.mul(f));if(!r&&l.cmp(c)<0)e=s.neg(),i=p,r=l.neg(),n=d;else if(r&&2==++b)break;s=l,u=h,h=l,m=p,p=d,g=f,f=y}o=l.neg(),a=d;var _=r.sqr().add(n.sqr());return o.sqr().add(a.sqr()).cmp(_)>=0&&(o=e,a=i),r.negative&&(r=r.neg(),n=n.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:r,b:n},{a:o,b:a}]},fa.prototype._endoSplit=function(t){var e=this.endo.basis,i=e[0],r=e[1],n=r.b.mul(t).divRound(this.n),o=i.b.neg().mul(t).divRound(this.n),a=n.mul(i.a),s=o.mul(r.a),l=n.mul(i.b),d=o.mul(r.b);return{k1:t.sub(a).sub(s),k2:l.add(d).neg()}},fa.prototype.pointFromX=function(t,e){(t=new Qo(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),r=i.redSqrt();if(0!==r.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var n=r.fromRed().isOdd();return(e&&!n||!e&&n)&&(r=r.redNeg()),this.point(t,r)},fa.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,i=t.y,r=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(r).redIAdd(this.b);return 0===i.redSqr().redISub(n).cmpn(0)},fa.prototype._endoWnafMulAdd=function(t,e,i){for(var r=this._endoWnafT1,n=this._endoWnafT2,o=0;o<t.length;o++){var a=this._endoSplit(e[o]),s=t[o],l=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),l=l.neg(!0)),r[2*o]=s,r[2*o+1]=l,n[2*o]=a.k1,n[2*o+1]=a.k2}for(var d=this._wnafMulAdd(1,r,n,2*o,i),c=0;c<2*o;c++)r[c]=null,n[c]=null;return d},J(ma,da.BasePoint),fa.prototype.point=function(t,e,i){return new ma(this,t,e,i)},fa.prototype.pointFromJSON=function(t,e){return ma.fromJSON(this,t,e)},ma.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var i=this.curve,r=function(t){return i.point(t.x.redMul(i.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(r)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(r)}}}return e}},ma.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},ma.fromJSON=function(t,e,i){"string"==typeof e&&(e=JSON.parse(e));var r=t.point(e[0],e[1],i);if(!e[2])return r;function n(e){return t.point(e[0],e[1],i)}var o=e[2];return r.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[r].concat(o.doubles.points.map(n))},naf:o.naf&&{wnd:o.naf.wnd,points:[r].concat(o.naf.points.map(n))}},r},ma.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},ma.prototype.isInfinity=function(){return this.inf},ma.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var i=e.redSqr().redISub(this.x).redISub(t.x),r=e.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,r)},ma.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,i=this.x.redSqr(),r=t.redInvm(),n=i.redAdd(i).redIAdd(i).redIAdd(e).redMul(r),o=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},ma.prototype.getX=function(){return this.x.fromRed()},ma.prototype.getY=function(){return this.y.fromRed()},ma.prototype.mul=function(t){return t=new Qo(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},ma.prototype.mulAdd=function(t,e,i){var r=[this,e],n=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,n):this.curve._wnafMulAdd(1,r,n,2)},ma.prototype.jmulAdd=function(t,e,i){var r=[this,e],n=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,n,!0):this.curve._wnafMulAdd(1,r,n,2,!0)},ma.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},ma.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var i=this.precomputed,r=function(t){return t.neg()};e.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(r)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(r)}}}return e},ma.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},J(ga,da.BasePoint),fa.prototype.jpoint=function(t,e,i){return new ga(this,t,e,i)},ga.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),i=this.x.redMul(e),r=this.y.redMul(e).redMul(t);return this.curve.point(i,r)},ga.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},ga.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),i=this.z.redSqr(),r=this.x.redMul(e),n=t.x.redMul(i),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(i.redMul(this.z)),s=r.redSub(n),l=o.redSub(a);if(0===s.cmpn(0))return 0!==l.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=s.redSqr(),c=d.redMul(s),h=r.redMul(d),u=l.redSqr().redIAdd(c).redISub(h).redISub(h),p=l.redMul(h.redISub(u)).redISub(o.redMul(c)),f=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(u,p,f)},ga.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),i=this.x,r=t.x.redMul(e),n=this.y,o=t.y.redMul(e).redMul(this.z),a=i.redSub(r),s=n.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),d=l.redMul(a),c=i.redMul(l),h=s.redSqr().redIAdd(d).redISub(c).redISub(c),u=s.redMul(c.redISub(h)).redISub(n.redMul(d)),p=this.z.redMul(a);return this.curve.jpoint(h,u,p)},ga.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var i=this;for(e=0;e<t;e++)i=i.dbl();return i}var r=this.curve.a,n=this.curve.tinv,o=this.x,a=this.y,s=this.z,l=s.redSqr().redSqr(),d=a.redAdd(a);for(e=0;e<t;e++){var c=o.redSqr(),h=d.redSqr(),u=h.redSqr(),p=c.redAdd(c).redIAdd(c).redIAdd(r.redMul(l)),f=o.redMul(h),m=p.redSqr().redISub(f.redAdd(f)),g=f.redISub(m),b=p.redMul(g);b=b.redIAdd(b).redISub(u);var v=d.redMul(s);e+1<t&&(l=l.redMul(u)),o=m,s=v,d=b}return this.curve.jpoint(o,d.redMul(n),s)},ga.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},ga.prototype._zeroDbl=function(){var t,e,i;if(this.zOne){var r=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),a=this.x.redAdd(n).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r),l=s.redSqr().redISub(a).redISub(a),d=o.redIAdd(o);d=(d=d.redIAdd(d)).redIAdd(d),t=l,e=s.redMul(a.redISub(l)).redISub(d),i=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),h=this.y.redSqr(),u=h.redSqr(),p=this.x.redAdd(h).redSqr().redISub(c).redISub(u);p=p.redIAdd(p);var f=c.redAdd(c).redIAdd(c),m=f.redSqr(),g=u.redIAdd(u);g=(g=g.redIAdd(g)).redIAdd(g),t=m.redISub(p).redISub(p),e=f.redMul(p.redISub(t)).redISub(g),i=(i=this.y.redMul(this.z)).redIAdd(i)}return this.curve.jpoint(t,e,i)},ga.prototype._threeDbl=function(){var t,e,i;if(this.zOne){var r=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),a=this.x.redAdd(n).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),l=s.redSqr().redISub(a).redISub(a);t=l;var d=o.redIAdd(o);d=(d=d.redIAdd(d)).redIAdd(d),e=s.redMul(a.redISub(l)).redISub(d),i=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),h=this.y.redSqr(),u=this.x.redMul(h),p=this.x.redSub(c).redMul(this.x.redAdd(c));p=p.redAdd(p).redIAdd(p);var f=u.redIAdd(u),m=(f=f.redIAdd(f)).redAdd(f);t=p.redSqr().redISub(m),i=this.y.redAdd(this.z).redSqr().redISub(h).redISub(c);var g=h.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=p.redMul(f.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,i)},ga.prototype._dbl=function(){var t=this.curve.a,e=this.x,i=this.y,r=this.z,n=r.redSqr().redSqr(),o=e.redSqr(),a=i.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(n)),l=e.redAdd(e),d=(l=l.redIAdd(l)).redMul(a),c=s.redSqr().redISub(d.redAdd(d)),h=d.redISub(c),u=a.redSqr();u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var p=s.redMul(h).redISub(u),f=i.redAdd(i).redMul(r);return this.curve.jpoint(c,p,f)},ga.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),i=this.z.redSqr(),r=e.redSqr(),n=t.redAdd(t).redIAdd(t),o=n.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(r),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),l=r.redIAdd(r);l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=n.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(l),c=e.redMul(d);c=(c=c.redIAdd(c)).redIAdd(c);var h=this.x.redMul(s).redISub(c);h=(h=h.redIAdd(h)).redIAdd(h);var u=this.y.redMul(d.redMul(l.redISub(d)).redISub(a.redMul(s)));u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var p=this.z.redAdd(a).redSqr().redISub(i).redISub(s);return this.curve.jpoint(h,u,p)},ga.prototype.mul=function(t,e){return t=new Qo(t,e),this.curve._wnafMul(this,t)},ga.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),i=t.z.redSqr();if(0!==this.x.redMul(i).redISub(t.x.redMul(e)).cmpn(0))return!1;var r=e.redMul(this.z),n=i.redMul(t.z);return 0===this.y.redMul(n).redISub(t.y.redMul(r)).cmpn(0)},ga.prototype.eqXToP=function(t){var e=this.z.redSqr(),i=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(i))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(e);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(n),0===this.x.cmp(i))return!0}},ga.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},ga.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},J(ba,da),sa=ba,ba.prototype.validate=function(t){var e=t.normalize().x,i=e.redSqr(),r=i.redMul(e).redAdd(i.redMul(this.a)).redAdd(e);return 0===r.redSqrt().redSqr().cmp(r)},J(va,da.BasePoint),ba.prototype.decodePoint=function(t,e){return this.point(na.toArray(t,e),1)},ba.prototype.point=function(t,e){return new va(this,t,e)},ba.prototype.pointFromJSON=function(t){return va.fromJSON(this,t)},va.prototype.precompute=function(){},va.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},va.fromJSON=function(t,e){return new va(t,e[0],e[1]||t.one)},va.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},va.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},va.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),i=t.redSub(e),r=t.redMul(e),n=i.redMul(e.redAdd(this.curve.a24.redMul(i)));return this.curve.point(r,n)},va.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},va.prototype.diffAdd=function(t,e){var i=this.x.redAdd(this.z),r=this.x.redSub(this.z),n=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(i),a=n.redMul(r),s=e.z.redMul(o.redAdd(a).redSqr()),l=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,l)},va.prototype.mul=function(t){for(var e=t.clone(),i=this,r=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(i=i.diffAdd(r,this),r=r.dbl()):(r=i.diffAdd(r,this),i=i.dbl());return r},va.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},va.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},va.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},va.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},va.prototype.getX=function(){return this.normalize(),this.x.fromRed()},na.assert,J(ya,da),la=ya,ya.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},ya.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},ya.prototype.jpoint=function(t,e,i,r){return this.point(t,e,i,r)},ya.prototype.pointFromX=function(t,e){(t=new Qo(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr(),r=this.c2.redSub(this.a.redMul(i)),n=this.one.redSub(this.c2.redMul(this.d).redMul(i)),o=r.redMul(n.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(e&&!s||!e&&s)&&(a=a.redNeg()),this.point(t,a)},ya.prototype.pointFromY=function(t,e){(t=new Qo(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr(),r=i.redSub(this.c2),n=i.redMul(this.d).redMul(this.c2).redSub(this.a),o=r.redMul(n.redInvm());if(0===o.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},ya.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),i=t.y.redSqr(),r=e.redMul(this.a).redAdd(i),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(i)));return 0===r.cmp(n)},J(_a,da.BasePoint),ya.prototype.pointFromJSON=function(t){return _a.fromJSON(this,t)},ya.prototype.point=function(t,e,i,r){return new _a(this,t,e,i,r)},_a.fromJSON=function(t,e){return new _a(t,e[0],e[1],e[2])},_a.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},_a.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},_a.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var r=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=r.redAdd(e),a=o.redSub(i),s=r.redSub(e),l=n.redMul(a),d=o.redMul(s),c=n.redMul(s),h=a.redMul(o);return this.curve.point(l,d,h,c)},_a.prototype._projDbl=function(){var t,e,i,r,n,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),l=this.y.redSqr();if(this.curve.twisted){var d=(r=this.curve._mulA(s)).redAdd(l);this.zOne?(t=a.redSub(s).redSub(l).redMul(d.redSub(this.curve.two)),e=d.redMul(r.redSub(l)),i=d.redSqr().redSub(d).redSub(d)):(n=this.z.redSqr(),o=d.redSub(n).redISub(n),t=a.redSub(s).redISub(l).redMul(o),e=d.redMul(r.redSub(l)),i=d.redMul(o))}else r=s.redAdd(l),n=this.curve._mulC(this.z).redSqr(),o=r.redSub(n).redSub(n),t=this.curve._mulC(a.redISub(r)).redMul(o),e=this.curve._mulC(r).redMul(s.redISub(l)),i=r.redMul(o);return this.curve.point(t,e,i)},_a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},_a.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),i=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),r=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),o=i.redSub(e),a=n.redSub(r),s=n.redAdd(r),l=i.redAdd(e),d=o.redMul(a),c=s.redMul(l),h=o.redMul(l),u=a.redMul(s);return this.curve.point(d,c,u,h)},_a.prototype._projAdd=function(t){var e,i,r=this.z.redMul(t.z),n=r.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),l=n.redSub(s),d=n.redAdd(s),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),h=r.redMul(l).redMul(c);return this.curve.twisted?(e=r.redMul(d).redMul(a.redSub(this.curve._mulA(o))),i=l.redMul(d)):(e=r.redMul(d).redMul(a.redSub(o)),i=this.curve._mulC(l).redMul(d)),this.curve.point(h,e,i)},_a.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},_a.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},_a.prototype.mulAdd=function(t,e,i){return this.curve._wnafMulAdd(1,[this,e],[t,i],2,!1)},_a.prototype.jmulAdd=function(t,e,i){return this.curve._wnafMulAdd(1,[this,e],[t,i],2,!0)},_a.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},_a.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},_a.prototype.getX=function(){return this.normalize(),this.x.fromRed()},_a.prototype.getY=function(){return this.normalize(),this.y.fromRed()},_a.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},_a.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var i=t.clone(),r=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(r),0===this.x.cmp(e))return!0}},_a.prototype.toP=_a.prototype.normalize,_a.prototype.mixedAdd=_a.prototype.add;var wa={},xa=wa;xa.base=da,xa.short=aa,xa.mont=sa,xa.edwards=la;var Ma={};function ka(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function Sa(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function Ea(t){return 1===t.length?"0"+t:t}function Aa(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}Ma.inherits=J,Ma.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var i=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)i.push(parseInt(t[n]+t[n+1],16))}else for(var r=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);o<128?i[r++]=o:o<2048?(i[r++]=o>>6|192,i[r++]=63&o|128):ka(t,n)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++n)),i[r++]=o>>18|240,i[r++]=o>>12&63|128,i[r++]=o>>6&63|128,i[r++]=63&o|128):(i[r++]=o>>12|224,i[r++]=o>>6&63|128,i[r++]=63&o|128)}else for(n=0;n<t.length;n++)i[n]=0|t[n];return i},Ma.toHex=function(t){for(var e="",i=0;i<t.length;i++)e+=Ea(t[i].toString(16));return e},Ma.htonl=Sa,Ma.toHex32=function(t,e){for(var i="",r=0;r<t.length;r++){var n=t[r];"little"===e&&(n=Sa(n)),i+=Aa(n.toString(16))}return i},Ma.zero2=Ea,Ma.zero8=Aa,Ma.join32=function(t,e,i,r){for(var n=new Array((i-e)/4),o=0,a=e;o<n.length;o++,a+=4){var s;s="big"===r?t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3]:t[a+3]<<24|t[a+2]<<16|t[a+1]<<8|t[a],n[o]=s>>>0}return n},Ma.split32=function(t,e){for(var i=new Array(4*t.length),r=0,n=0;r<t.length;r++,n+=4){var o=t[r];"big"===e?(i[n]=o>>>24,i[n+1]=o>>>16&255,i[n+2]=o>>>8&255,i[n+3]=255&o):(i[n+3]=o>>>24,i[n+2]=o>>>16&255,i[n+1]=o>>>8&255,i[n]=255&o)}return i},Ma.rotr32=function(t,e){return t>>>e|t<<32-e},Ma.rotl32=function(t,e){return t<<e|t>>>32-e},Ma.sum32=function(t,e){return t+e>>>0},Ma.sum32_3=function(t,e,i){return t+e+i>>>0},Ma.sum32_4=function(t,e,i,r){return t+e+i+r>>>0},Ma.sum32_5=function(t,e,i,r,n){return t+e+i+r+n>>>0},Ma.sum64=function(t,e,i,r){var n=t[e],o=r+t[e+1]>>>0,a=(o<r?1:0)+i+n;t[e]=a>>>0,t[e+1]=o},Ma.sum64_hi=function(t,e,i,r){return(e+r>>>0<e?1:0)+t+i>>>0},Ma.sum64_lo=function(t,e,i,r){return e+r>>>0},Ma.sum64_4_hi=function(t,e,i,r,n,o,a,s){var l=0,d=e;return l+=(d=d+r>>>0)<e?1:0,l+=(d=d+o>>>0)<o?1:0,t+i+n+a+(l+=(d=d+s>>>0)<s?1:0)>>>0},Ma.sum64_4_lo=function(t,e,i,r,n,o,a,s){return e+r+o+s>>>0},Ma.sum64_5_hi=function(t,e,i,r,n,o,a,s,l,d){var c=0,h=e;return c+=(h=h+r>>>0)<e?1:0,c+=(h=h+o>>>0)<o?1:0,c+=(h=h+s>>>0)<s?1:0,t+i+n+a+l+(c+=(h=h+d>>>0)<d?1:0)>>>0},Ma.sum64_5_lo=function(t,e,i,r,n,o,a,s,l,d){return e+r+o+s+d>>>0},Ma.rotr64_hi=function(t,e,i){return(e<<32-i|t>>>i)>>>0},Ma.rotr64_lo=function(t,e,i){return(t<<32-i|e>>>i)>>>0},Ma.shr64_hi=function(t,e,i){return t>>>i},Ma.shr64_lo=function(t,e,i){return(t<<32-i|e>>>i)>>>0};var Ta={};function Ra(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Ta.BlockHash=Ra,Ra.prototype.update=function(t,e){if(t=Ma.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var i=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-i,t.length),0===this.pending.length&&(this.pending=null),t=Ma.join32(t,0,t.length-i,this.endian);for(var r=0;r<t.length;r+=this._delta32)this._update(t,r,r+this._delta32)}return this},Ra.prototype.digest=function(t){return this.update(this._pad()),this._digest(t)},Ra.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,i=e-(t+this.padLength)%e,r=new Array(i+this.padLength);r[0]=128;for(var n=1;n<i;n++)r[n]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)r[n++]=0;r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=t>>>24&255,r[n++]=t>>>16&255,r[n++]=t>>>8&255,r[n++]=255&t}else for(r[n++]=255&t,r[n++]=t>>>8&255,r[n++]=t>>>16&255,r[n++]=t>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,o=8;o<this.padLength;o++)r[n++]=0;return r};var Ia={},Ca=Ma.rotr32;function Oa(t,e,i){return t&e^~t&i}function Pa(t,e,i){return t&e^t&i^e&i}Ia.ft_1=function(t,e,i,r){return 0===t?Oa(e,i,r):1===t||3===t?function(t,e,i){return t^e^i}(e,i,r):2===t?Pa(e,i,r):void 0},Ia.ch32=Oa,Ia.maj32=Pa,Ia.s0_256=function(t){return Ca(t,2)^Ca(t,13)^Ca(t,22)},Ia.s1_256=function(t){return Ca(t,6)^Ca(t,11)^Ca(t,25)},Ia.g0_256=function(t){return Ca(t,7)^Ca(t,18)^t>>>3},Ia.g1_256=function(t){return Ca(t,17)^Ca(t,19)^t>>>10};var La,$a=Ma.rotl32,Na=Ma.sum32,Ba=Ma.sum32_5,Da=Ia.ft_1,ja=Ta.BlockHash,za=[1518500249,1859775393,2400959708,3395469782];function Fa(){if(!(this instanceof Fa))return new Fa;ja.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ma.inherits(Fa,ja),La=Fa,Fa.blockSize=512,Fa.outSize=160,Fa.hmacStrength=80,Fa.padLength=64,Fa.prototype._update=function(t,e){for(var i=this.W,r=0;r<16;r++)i[r]=t[e+r];for(;r<i.length;r++)i[r]=$a(i[r-3]^i[r-8]^i[r-14]^i[r-16],1);var n=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],l=this.h[4];for(r=0;r<i.length;r++){var d=~~(r/20),c=Ba($a(n,5),Da(d,o,a,s),l,i[r],za[d]);l=s,s=a,a=$a(o,30),o=n,n=c}this.h[0]=Na(this.h[0],n),this.h[1]=Na(this.h[1],o),this.h[2]=Na(this.h[2],a),this.h[3]=Na(this.h[3],s),this.h[4]=Na(this.h[4],l)},Fa.prototype._digest=function(t){return"hex"===t?Ma.toHex32(this.h,"big"):Ma.split32(this.h,"big")};var Ua,qa={},Ha=Ma.sum32,Va=Ma.sum32_4,Wa=Ma.sum32_5,Ga=Ia.ch32,Ka=Ia.maj32,Xa=Ia.s0_256,Ya=Ia.s1_256,Za=Ia.g0_256,Ja=Ia.g1_256,Qa=Ta.BlockHash,ts=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function es(){if(!(this instanceof es))return new es;Qa.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=ts,this.W=new Array(64)}function is(){if(!(this instanceof is))return new is;qa.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Ma.inherits(es,Qa),qa=es,es.blockSize=512,es.outSize=256,es.hmacStrength=192,es.padLength=64,es.prototype._update=function(t,e){for(var i=this.W,r=0;r<16;r++)i[r]=t[e+r];for(;r<i.length;r++)i[r]=Va(Ja(i[r-2]),i[r-7],Za(i[r-15]),i[r-16]);var n=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],l=this.h[4],d=this.h[5],c=this.h[6],h=this.h[7];for(r=0;r<i.length;r++){var u=Wa(h,Ya(l),Ga(l,d,c),this.k[r],i[r]),p=Ha(Xa(n),Ka(n,o,a));h=c,c=d,d=l,l=Ha(s,u),s=a,a=o,o=n,n=Ha(u,p)}this.h[0]=Ha(this.h[0],n),this.h[1]=Ha(this.h[1],o),this.h[2]=Ha(this.h[2],a),this.h[3]=Ha(this.h[3],s),this.h[4]=Ha(this.h[4],l),this.h[5]=Ha(this.h[5],d),this.h[6]=Ha(this.h[6],c),this.h[7]=Ha(this.h[7],h)},es.prototype._digest=function(t){return"hex"===t?Ma.toHex32(this.h,"big"):Ma.split32(this.h,"big")},Ma.inherits(is,qa),Ua=is,is.blockSize=512,is.outSize=224,is.hmacStrength=192,is.padLength=64,is.prototype._digest=function(t){return"hex"===t?Ma.toHex32(this.h.slice(0,7),"big"):Ma.split32(this.h.slice(0,7),"big")};var rs,ns={},os=Ma.rotr64_hi,as=Ma.rotr64_lo,ss=Ma.shr64_hi,ls=Ma.shr64_lo,ds=Ma.sum64,cs=Ma.sum64_hi,hs=Ma.sum64_lo,us=Ma.sum64_4_hi,ps=Ma.sum64_4_lo,fs=Ma.sum64_5_hi,ms=Ma.sum64_5_lo,gs=Ta.BlockHash,bs=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function vs(){if(!(this instanceof vs))return new vs;gs.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=bs,this.W=new Array(160)}function ys(t,e,i,r,n){var o=t&i^~t&n;return o<0&&(o+=4294967296),o}function _s(t,e,i,r,n,o){var a=e&r^~e&o;return a<0&&(a+=4294967296),a}function ws(t,e,i,r,n){var o=t&i^t&n^i&n;return o<0&&(o+=4294967296),o}function xs(t,e,i,r,n,o){var a=e&r^e&o^r&o;return a<0&&(a+=4294967296),a}function Ms(t,e){var i=os(t,e,28)^os(e,t,2)^os(e,t,7);return i<0&&(i+=4294967296),i}function ks(t,e){var i=as(t,e,28)^as(e,t,2)^as(e,t,7);return i<0&&(i+=4294967296),i}function Ss(t,e){var i=os(t,e,14)^os(t,e,18)^os(e,t,9);return i<0&&(i+=4294967296),i}function Es(t,e){var i=as(t,e,14)^as(t,e,18)^as(e,t,9);return i<0&&(i+=4294967296),i}function As(t,e){var i=os(t,e,1)^os(t,e,8)^ss(t,e,7);return i<0&&(i+=4294967296),i}function Ts(t,e){var i=as(t,e,1)^as(t,e,8)^ls(t,e,7);return i<0&&(i+=4294967296),i}function Rs(t,e){var i=os(t,e,19)^os(e,t,29)^ss(t,e,6);return i<0&&(i+=4294967296),i}function Is(t,e){var i=as(t,e,19)^as(e,t,29)^ls(t,e,6);return i<0&&(i+=4294967296),i}function Cs(){if(!(this instanceof Cs))return new Cs;ns.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Ma.inherits(vs,gs),ns=vs,vs.blockSize=1024,vs.outSize=512,vs.hmacStrength=192,vs.padLength=128,vs.prototype._prepareBlock=function(t,e){for(var i=this.W,r=0;r<32;r++)i[r]=t[e+r];for(;r<i.length;r+=2){var n=Rs(i[r-4],i[r-3]),o=Is(i[r-4],i[r-3]),a=i[r-14],s=i[r-13],l=As(i[r-30],i[r-29]),d=Ts(i[r-30],i[r-29]),c=i[r-32],h=i[r-31];i[r]=us(n,o,a,s,l,d,c,h),i[r+1]=ps(n,o,a,s,l,d,c,h)}},vs.prototype._update=function(t,e){this._prepareBlock(t,e);for(var i=this.W,r=this.h[0],n=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],l=this.h[5],d=this.h[6],c=this.h[7],h=this.h[8],u=this.h[9],p=this.h[10],f=this.h[11],m=this.h[12],g=this.h[13],b=this.h[14],v=this.h[15],y=0;y<i.length;y+=2){var _=b,w=v,x=Ss(h,u),M=Es(h,u),k=ys(h,0,p,0,m),S=_s(0,u,0,f,0,g),E=this.k[y],A=this.k[y+1],T=i[y],R=i[y+1],I=fs(_,w,x,M,k,S,E,A,T,R),C=ms(_,w,x,M,k,S,E,A,T,R);_=Ms(r,n),w=ks(r,n),x=ws(r,0,o,0,s),M=xs(0,n,0,a,0,l);var O=cs(_,w,x,M),P=hs(_,w,x,M);b=m,v=g,m=p,g=f,p=h,f=u,h=cs(d,c,I,C),u=hs(c,c,I,C),d=s,c=l,s=o,l=a,o=r,a=n,r=cs(I,C,O,P),n=hs(I,C,O,P)}ds(this.h,0,r,n),ds(this.h,2,o,a),ds(this.h,4,s,l),ds(this.h,6,d,c),ds(this.h,8,h,u),ds(this.h,10,p,f),ds(this.h,12,m,g),ds(this.h,14,b,v)},vs.prototype._digest=function(t){return"hex"===t?Ma.toHex32(this.h,"big"):Ma.split32(this.h,"big")},Ma.inherits(Cs,ns),rs=Cs,Cs.blockSize=1024,Cs.outSize=384,Cs.hmacStrength=192,Cs.padLength=128,Cs.prototype._digest=function(t){return"hex"===t?Ma.toHex32(this.h.slice(0,12),"big"):Ma.split32(this.h.slice(0,12),"big")};var Os={};Os.sha1=La,Os.sha224=Ua,Os.sha256=qa,Os.sha384=rs,Os.sha512=ns;var Ps={},Ls=Ma.rotl32,$s=Ma.sum32,Ns=Ma.sum32_3,Bs=Ma.sum32_4,Ds=Ta.BlockHash;function js(){if(!(this instanceof js))return new js;Ds.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function zs(t,e,i,r){return t<=15?e^i^r:t<=31?e&i|~e&r:t<=47?(e|~i)^r:t<=63?e&r|i&~r:e^(i|~r)}function Fs(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Us(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}Ma.inherits(js,Ds),Ps.ripemd160=js,js.blockSize=512,js.outSize=160,js.hmacStrength=192,js.padLength=64,js.prototype._update=function(t,e){for(var i=this.h[0],r=this.h[1],n=this.h[2],o=this.h[3],a=this.h[4],s=i,l=r,d=n,c=o,h=a,u=0;u<80;u++){var p=$s(Ls(Bs(i,zs(u,r,n,o),t[Hs[u]+e],Fs(u)),Ws[u]),a);i=a,a=o,o=Ls(n,10),n=r,r=p,p=$s(Ls(Bs(s,zs(79-u,l,d,c),t[Vs[u]+e],Us(u)),Gs[u]),h),s=h,h=c,c=Ls(d,10),d=l,l=p}p=Ns(this.h[1],n,c),this.h[1]=Ns(this.h[2],o,h),this.h[2]=Ns(this.h[3],a,s),this.h[3]=Ns(this.h[4],i,l),this.h[4]=Ns(this.h[0],r,d),this.h[0]=p},js.prototype._digest=function(t){return"hex"===t?Ma.toHex32(this.h,"little"):Ma.split32(this.h,"little")};var qs,Hs=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Vs=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Ws=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Gs=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];function Ks(t,e,i){if(!(this instanceof Ks))return new Ks(t,e,i);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(Ma.toArray(e,i))}qs=Ks,Ks.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest());for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},Ks.prototype.update=function(t,e){return this.inner.update(t,e),this},Ks.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)};var Xs={},Ys=Xs;Ys.utils=Ma,Ys.common=Ta,Ys.sha=Os,Ys.ripemd=Ps,Ys.hmac=qs,Ys.sha1=Ys.sha.sha1,Ys.sha256=Ys.sha.sha256,Ys.sha224=Ys.sha.sha224,Ys.sha384=Ys.sha.sha384,Ys.sha512=Ys.sha.sha512,Ys.ripemd160=Ys.ripemd.ripemd160;var Zs,Js={},Qs=Js;function tl(t){"short"===t.type?this.curve=new wa.short(t):"edwards"===t.type?this.curve=new wa.edwards(t):this.curve=new wa.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash}function el(t,e){Object.defineProperty(Qs,t,{configurable:!0,enumerable:!0,get:function(){var i=new tl(e);return Object.defineProperty(Qs,t,{configurable:!0,enumerable:!0,value:i}),i}})}na.assert,Qs.PresetCurve=tl,el("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Xs.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),el("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Xs.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),el("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Xs.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),el("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Xs.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),el("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Xs.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),el("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Xs.sha256,gRed:!1,g:["9"]}),el("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Xs.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{Zs={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}catch(t){Zs=void 0}el("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Xs.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",Zs]});var il,rl={};function nl(t){if(!(this instanceof nl))return new nl(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=ta.toArray(t.entropy,t.entropyEnc||"hex"),i=ta.toArray(t.nonce,t.nonceEnc||"hex"),r=ta.toArray(t.pers,t.persEnc||"hex");this._init(e,i,r)}function ol(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}rl=nl,nl.prototype._init=function(t,e,i){var r=t.concat(e).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},nl.prototype._hmac=function(){return new Xs.hmac(this.hash,this.K)},nl.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},nl.prototype.reseed=function(t,e,i,r){"string"!=typeof e&&(r=i,i=e,e=null),t=ta.toArray(t,e),i=ta.toArray(i,r),this._update(t.concat(i||[])),this._reseed=1},nl.prototype.generate=function(t,e,i,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(r=i,i=e,e=null),i&&(i=ta.toArray(i,r||"hex"),this._update(i));for(var n=[];n.length<t;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var o=n.slice(0,t);return this._update(i),this._reseed++,ta.encode(o,e)},na.assert,il=ol,ol.fromPublic=function(t,e,i){return e instanceof ol?e:new ol(t,{pub:e,pubEnc:i})},ol.fromPrivate=function(t,e,i){return e instanceof ol?e:new ol(t,{priv:e,privEnc:i})},ol.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},ol.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},ol.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},ol.prototype._importPrivate=function(t,e){this.priv=new Qo(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},ol.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type||"short"===this.ec.curve.type||this.ec.curve.type,void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},ol.prototype.derive=function(t){return t.validate(),t.mul(this.priv).getX()},ol.prototype.sign=function(t,e,i){return this.ec.sign(t,this,e,i)},ol.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},ol.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var al={};function sl(t,e){if(t instanceof sl)return t;this._importDER(t,e)||(this.r=new Qo(t.r,16),this.s=new Qo(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function ll(){this.place=0}function dl(t,e){var i=t[e.place++];if(!(128&i))return i;var r=15&i;if(0===r||r>4)return!1;for(var n=0,o=0,a=e.place;o<r;o++,a++)n<<=8,n|=t[a],n>>>=0;return!(n<=127)&&(e.place=a,n)}function cl(t){for(var e=0,i=t.length-1;!t[e]&&!(128&t[e+1])&&e<i;)e++;return 0===e?t:t.slice(e)}function hl(t,e){if(e<128)t.push(e);else{var i=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|i);--i;)t.push(e>>>(i<<3)&255);t.push(e)}}na.assert,al=sl,sl.prototype._importDER=function(t,e){t=na.toArray(t,e);var i=new ll;if(48!==t[i.place++])return!1;var r=dl(t,i);if(!1===r)return!1;if(r+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;var n=dl(t,i);if(!1===n)return!1;var o=t.slice(i.place,n+i.place);if(i.place+=n,2!==t[i.place++])return!1;var a=dl(t,i);if(!1===a)return!1;if(t.length!==a+i.place)return!1;var s=t.slice(i.place,a+i.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new Qo(o),this.s=new Qo(s),this.recoveryParam=null,!0},sl.prototype.toDER=function(t){var e=this.r.toArray(),i=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&i[0]&&(i=[0].concat(i)),e=cl(e),i=cl(i);!(i[0]||128&i[1]);)i=i.slice(1);var r=[2];hl(r,e.length),(r=r.concat(e)).push(2),hl(r,i.length);var n=r.concat(i),o=[48];return hl(o,n.length),o=o.concat(n),na.encode(o,t)};var ul,pl=(na.assert,il);function fl(t){if(!(this instanceof fl))return new fl(t);"string"==typeof t&&(t=Js[t]),t instanceof Js.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}ul=fl,fl.prototype.keyPair=function(t){return new pl(this,t)},fl.prototype.keyFromPrivate=function(t,e){return pl.fromPrivate(this,t,e)},fl.prototype.keyFromPublic=function(t,e){return pl.fromPublic(this,t,e)},fl.prototype.genKeyPair=function(t){t||(t={});for(var e=new rl({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||Kn(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),r=this.n.sub(new Qo(2));;){var n=new Qo(e.generate(i));if(!(n.cmp(r)>0))return n.iaddn(1),this.keyFromPrivate(n)}},fl.prototype._truncateToN=function(t,e){var i=8*t.byteLength()-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},fl.prototype.sign=function(t,e,i,r){"object"==typeof i&&(r=i,i=null),r||(r={}),e=this.keyFromPrivate(e,i),t=this._truncateToN(new Qo(t,16));for(var n=this.n.byteLength(),o=e.getPrivate().toArray("be",n),a=t.toArray("be",n),s=new rl({hash:this.hash,entropy:o,nonce:a,pers:r.pers,persEnc:r.persEnc||"utf8"}),l=this.n.sub(new Qo(1)),d=0;;d++){var c=r.k?r.k(d):new Qo(s.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||c.cmp(l)>=0)){var h=this.g.mul(c);if(!h.isInfinity()){var u=h.getX(),p=u.umod(this.n);if(0!==p.cmpn(0)){var f=c.invm(this.n).mul(p.mul(e.getPrivate()).iadd(t));if(0!==(f=f.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==u.cmp(p)?2:0);return r.canonical&&f.cmp(this.nh)>0&&(f=this.n.sub(f),m^=1),new al({r:p,s:f,recoveryParam:m})}}}}}},fl.prototype.verify=function(t,e,i,r){t=this._truncateToN(new Qo(t,16)),i=this.keyFromPublic(i,r);var n=(e=new al(e,"hex")).r,o=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),l=s.mul(t).umod(this.n),d=s.mul(n).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(l,i.getPublic(),d)).isInfinity()&&a.eqXToP(n):!(a=this.g.mulAdd(l,i.getPublic(),d)).isInfinity()&&0===a.getX().umod(this.n).cmp(n)},fl.prototype.recoverPubKey=function(t,e,i,r){e=new al(e,r);var n=this.n,o=new Qo(t),a=e.r,s=e.s,l=1&i,d=i>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var c=e.r.invm(n),h=n.sub(o).mul(c).umod(n),u=s.mul(c).umod(n);return this.g.mulAdd(h,a,u)},fl.prototype.getKeyRecoveryParam=function(t,e,i,r){if(null!==(e=new al(e,r)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch(t){continue}if(o.eq(i))return n}throw new Error("Unable to find valid recovery factor")};var ml={},gl=(na.assert,na.parseBytes),bl=na.cachedProperty;function vl(t,e){this.eddsa=t,this._secret=gl(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=gl(e.pub)}vl.fromPublic=function(t,e){return e instanceof vl?e:new vl(t,{pub:e})},vl.fromSecret=function(t,e){return e instanceof vl?e:new vl(t,{secret:e})},vl.prototype.secret=function(){return this._secret},bl(vl,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),bl(vl,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),bl(vl,"privBytes",(function(){var t=this.eddsa,e=this.hash(),i=t.encodingLength-1,r=e.slice(0,t.encodingLength);return r[0]&=248,r[i]&=127,r[i]|=64,r})),bl(vl,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),bl(vl,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),bl(vl,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),vl.prototype.sign=function(t){return this.eddsa.sign(t,this)},vl.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},vl.prototype.getSecret=function(t){return na.encode(this.secret(),t)},vl.prototype.getPublic=function(t){return na.encode(this.pubBytes(),t)},ml=vl;var yl={},_l=(na.assert,na.cachedProperty),wl=na.parseBytes;function xl(t,e){this.eddsa=t,"object"!=typeof e&&(e=wl(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof Qo&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}_l(xl,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),_l(xl,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),_l(xl,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),_l(xl,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),xl.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},xl.prototype.toHex=function(){return na.encode(this.toBytes(),"hex").toUpperCase()},yl=xl;var Ml,kl=(na.assert,na.parseBytes);function Sl(t){if(!(this instanceof Sl))return new Sl(t);t=Js[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=Xs.sha512}Ml=Sl,Sl.prototype.sign=function(t,e){t=kl(t);var i=this.keyFromSecret(e),r=this.hashInt(i.messagePrefix(),t),n=this.g.mul(r),o=this.encodePoint(n),a=this.hashInt(o,i.pubBytes(),t).mul(i.priv()),s=r.add(a).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:o})},Sl.prototype.verify=function(t,e,i){t=kl(t),e=this.makeSignature(e);var r=this.keyFromPublic(i),n=this.hashInt(e.Rencoded(),r.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(r.pub().mul(n)).eq(o)},Sl.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return na.intFromLE(t.digest()).umod(this.curve.n)},Sl.prototype.keyFromPublic=function(t){return ml.fromPublic(this,t)},Sl.prototype.keyFromSecret=function(t){return ml.fromSecret(this,t)},Sl.prototype.makeSignature=function(t){return t instanceof yl?t:new yl(this,t)},Sl.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},Sl.prototype.decodePoint=function(t){var e=(t=na.parseBytes(t)).length-1,i=t.slice(0,e).concat(-129&t[e]),r=0!=(128&t[e]),n=na.intFromLE(i);return this.curve.pointFromY(n,r)},Sl.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},Sl.prototype.decodeInt=function(t){return na.intFromLE(t)},Sl.prototype.isPoint=function(t){return t instanceof this.pointClass};var El={},Al=El;Al.version="6.5.4",Al.utils=na,Al.rand=Kn,Al.curve=wa,Al.curves=Js,Al.ec=ul,Al.eddsa=Ml;var Tl={exports:{}};!function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=_({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var a=t.charCodeAt(o)-48;r<<=4,r|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function a(t,e,i,r){for(var n=0,o=Math.min(t.length,i),a=e;a<o;a++){var s=t.charCodeAt(a)-48;n*=r,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,a=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this.strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,a=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303,(a+=24)>=26&&(a-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303),this.strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,s=o%r,l=Math.min(o,o-s)+i,d=0,c=i;c<l;c+=r)d=a(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==s){var h=1;for(d=a(t,c,t.length,e),c=0;c<s;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,l=a/67108864|0;i.words[0]=s;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(a=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&a}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i.strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var a=this.words[o],c=(16777215&(a<<r|n)).toString(16);i=0!=(n=a>>>24-r&16777215)||o!==this.length-1?s[6-c.length]+c+i:c+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],u=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modn(u).toString(t);i=(p=p.idivn(u)).isZero()?f+i:s[h-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)},r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){var r=this.byteLength(),n=i||Math.max(1,r);this.strip();var o,a,s="le"===e,l=new t(n),d=this.clone();if(s){for(a=0;!d.isZero();a++)o=d.andln(255),d.iushrn(8),l[a]=o;for(;a<n;a++)l[a]=0}else{for(a=0;a<n-r;a++)l[a]=0;for(a=0;!d.isZero();a++)o=d.andln(255),d.iushrn(8),l[n-a-1]=o}return l},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|i.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<i.length;a++)o=(e=(0|i.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var h=function(t,e,i){var r,n,o,a=t.words,s=e.words,l=i.words,d=0,c=0|a[0],h=8191&c,u=c>>>13,p=0|a[1],f=8191&p,m=p>>>13,g=0|a[2],b=8191&g,v=g>>>13,y=0|a[3],_=8191&y,w=y>>>13,x=0|a[4],M=8191&x,k=x>>>13,S=0|a[5],E=8191&S,A=S>>>13,T=0|a[6],R=8191&T,I=T>>>13,C=0|a[7],O=8191&C,P=C>>>13,L=0|a[8],$=8191&L,N=L>>>13,B=0|a[9],D=8191&B,j=B>>>13,z=0|s[0],F=8191&z,U=z>>>13,q=0|s[1],H=8191&q,V=q>>>13,W=0|s[2],G=8191&W,K=W>>>13,X=0|s[3],Y=8191&X,Z=X>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],lt=8191&st,dt=st>>>13,ct=0|s[8],ht=8191&ct,ut=ct>>>13,pt=0|s[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,F))|0)+((8191&(n=(n=Math.imul(h,U))+Math.imul(u,F)|0))<<13)|0;d=((o=Math.imul(u,U))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,F),n=(n=Math.imul(f,U))+Math.imul(m,F)|0,o=Math.imul(m,U);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,F),n=(n=Math.imul(b,U))+Math.imul(v,F)|0,o=Math.imul(v,U),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,F),n=(n=Math.imul(_,U))+Math.imul(w,F)|0,o=Math.imul(w,U),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Y)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(u,Y)|0))<<13)|0;d=((o=o+Math.imul(u,Z)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,F),n=(n=Math.imul(M,U))+Math.imul(k,F)|0,o=Math.imul(k,U),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Y)|0,n=(n=n+Math.imul(f,Z)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Z)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,F),n=(n=Math.imul(E,U))+Math.imul(A,F)|0,o=Math.imul(A,U),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Z)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(R,F),n=(n=Math.imul(R,U))+Math.imul(I,F)|0,o=Math.imul(I,U),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,Z)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,at)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,at)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,F),n=(n=Math.imul(O,U))+Math.imul(P,F)|0,o=Math.imul(P,U),r=r+Math.imul(R,H)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,Z)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul($,F),n=(n=Math.imul($,U))+Math.imul(N,F)|0,o=Math.imul(N,U),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(R,G)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,K)|0,r=r+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,Z)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(D,F),n=(n=Math.imul(D,U))+Math.imul(j,F)|0,o=Math.imul(j,U),r=r+Math.imul($,H)|0,n=(n=n+Math.imul($,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,K)|0,r=r+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,Z)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(D,H),n=(n=Math.imul(D,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul($,G)|0,n=(n=n+Math.imul($,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,Z)|0,r=r+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(D,G),n=(n=Math.imul(D,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul($,Y)|0,n=(n=n+Math.imul($,Z)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Z)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(R,it)|0,n=(n=n+Math.imul(R,rt)|0)+Math.imul(I,it)|0,o=o+Math.imul(I,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(D,Y),n=(n=Math.imul(D,Z))+Math.imul(j,Y)|0,o=Math.imul(j,Z),r=r+Math.imul($,Q)|0,n=(n=n+Math.imul($,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(P,it)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(D,Q),n=(n=Math.imul(D,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul($,it)|0,n=(n=n+Math.imul($,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(R,lt)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var Rt=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(D,it),n=(n=Math.imul(D,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul($,ot)|0,n=(n=n+Math.imul($,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,dt)|0,r=r+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ut)|0;var It=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(D,ot),n=(n=Math.imul(D,at))+Math.imul(j,ot)|0,o=Math.imul(j,at),r=r+Math.imul($,lt)|0,n=(n=n+Math.imul($,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0;var Ct=(d+(r=r+Math.imul(R,ft)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(I,ft)|0))<<13)|0;d=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(D,lt),n=(n=Math.imul(D,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul($,ht)|0,n=(n=n+Math.imul($,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(P,ft)|0))<<13)|0;d=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(D,ht),n=(n=Math.imul(D,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Pt=(d+(r=r+Math.imul($,ft)|0)|0)+((8191&(n=(n=n+Math.imul($,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(d+(r=Math.imul(D,ft))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=Rt,l[14]=It,l[15]=Ct,l[16]=Ot,l[17]=Pt,l[18]=Lt,0!==d&&(l[19]=d,i.length++),i};function u(t,e,i){return(new p).mulp(t,e,i)}function p(t,e){this.x=t,this.y=e}Math.imul||(h=c),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?h(this,t,e):i<63?c(this,t,e):i<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var a=n;n=0;for(var s=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;s=67108863&(u=u+s|0),n+=(a=(a=a+(h/67108864|0)|0)+(u>>>26)|0)>>>26,a&=67108863}i.words[o]=s,r=a,a=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):u(this,t,e)},p.prototype.makeRBT=function(t){for(var e=new Array(t),i=r.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,i,t);return e},p.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},p.prototype.permute=function(t,e,i,r,n,o){for(var a=0;a<o;a++)r[a]=e[t[a]],n[a]=i[t[a]]},p.prototype.transform=function(t,e,i,r,n,o){this.permute(o,t,e,i,r,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,l=Math.cos(2*Math.PI/s),d=Math.sin(2*Math.PI/s),c=0;c<n;c+=s)for(var h=l,u=d,p=0;p<a;p++){var f=i[c+p],m=r[c+p],g=i[c+p+a],b=r[c+p+a],v=h*g-u*b;b=h*b+u*g,g=v,i[c+p]=f+g,r[c+p]=m+b,i[c+p+a]=f-g,r[c+p+a]=m-b,p!==s&&(v=l*h-d*u,u=l*u+d*h,h=v)}},p.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},p.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},p.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},p.prototype.convert13b=function(t,e,i,r){for(var n=0,o=0;o<e;o++)n+=0|t[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*e;o<r;++o)i[o]=0},p.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},p.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),o=this.stub(r),a=new Array(r),s=new Array(r),l=new Array(r),d=new Array(r),c=new Array(r),h=new Array(r),u=i.words;u.length=r,this.convert13b(t.words,t.length,a,r),this.convert13b(e.words,e.length,d,r),this.transform(a,o,s,l,r,n),this.transform(d,o,c,h,r,n);for(var p=0;p<r;p++){var f=s[p]*c[p]-l[p]*h[p];l[p]=s[p]*h[p]+l[p]*c[p],s[p]=f}return this.conjugate(s,l,r),this.transform(s,l,u,o,r,n),this.conjugate(u,o,r),this.normalize13b(u,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),u(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){for(var e=0,i=0;i<this.length;i++){var r=(0|this.words[i])*t,n=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=n>>>26,this.words[i]=67108863&n}return 0!==e&&(this.words[i]=e,this.length++),this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&n,s=(0|this.words[e])-a<<i;this.words[e]=s|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),a=67108863^67108863>>>n<<n,s=i;if(r-=o,r=Math.max(0,r),s){for(var l=0;l<o;l++)s.words[l]=this.words[l];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&a}return s&&0!==d&&(s.words[s.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var a=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+a;var s=(0|t.words[r])*e;a=((n-=67108863&s)>>26)-(s/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)a=(n=(0|this.words[r+i])+a)>>26,this.words[r+i]=67108863&n;if(0===a)return this.strip();for(a=0,r=0;r<this.length;r++)a=(n=-(0|this.words[r])+a)>>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,a=0|o.words[o.length-1];0!=(i=26-this._countBits(a))&&(o=o.ushln(i),n.iushln(i),a=0|o.words[o.length-1]);var s,l=n.length-o.length;if("mod"!==e){(s=new r(null)).length=l+1,s.words=new Array(s.length);for(var d=0;d<s.length;d++)s.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/a|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=u)}return s&&s.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:s||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modn=function(t){for(var e=(1<<26)%t,i=0,r=this.length-1;r>=0;r--)i=(e*i+(0|this.words[r]))%t;return i},r.prototype.idivn=function(t){for(var e=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*e;this.words[i]=r/t|0,e=r%t}return this.strip()},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),a=new r(0),s=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(d),s.isub(c)),a.iushrn(1),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(a),o.isub(s)):(i.isub(e),a.isub(n),s.isub(o))}return{a:a,b:s,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),a=new r(0),s=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a)):(i.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var a=0|this.words[o];n=(a+=n)>>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new w(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var f={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function y(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function x(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(g,m),g.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(b,m),i(v,m),i(y,m),y.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(f[t])return f[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new b;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new y}return f[t]=e,e},w.prototype._verify1=function(t){},w.prototype._verify2=function(t,e){},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,s).cmp(a);)l.redIAdd(a);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],a=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===n&&0===c)&&(o=this.mul(o,i[a]),s=0,a=0)):s=0}l=26}return o},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new x(t)},i(x,w),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(Tl,this),Tl=Tl.exports;var Rl={};(function(t){(function(){var e,i=w({}),r=i.Buffer,n={};for(e in i)i.hasOwnProperty(e)&&"SlowBuffer"!==e&&"Buffer"!==e&&(n[e]=i[e]);var o=n.Buffer={};for(e in r)r.hasOwnProperty(e)&&"allocUnsafe"!==e&&"allocUnsafeSlow"!==e&&(o[e]=r[e]);if(n.Buffer.prototype=r.prototype,o.from&&o.from!==Uint8Array.from||(o.from=function(t,e,i){if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&void 0===t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return r(t,e,i)}),o.alloc||(o.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=r(t);return e&&0!==e.length?"string"==typeof i?n.fill(e,i):n.fill(e):n.fill(0),n}),!n.kStringMaxLength)try{n.kStringMaxLength=t.binding("buffer").kStringMaxLength}catch(t){}n.constants||(n.constants={MAX_LENGTH:n.kMaxLength},n.kStringMaxLength&&(n.constants.MAX_STRING_LENGTH=n.kStringMaxLength)),Rl=n}).call(this)}).call(this,D);var Il={};function Cl(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function Ol(t,e){this.path=t,this.rethrow(e)}Il.Reporter=Cl,Cl.prototype.isError=function(t){return t instanceof Ol},Cl.prototype.save=function(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},Cl.prototype.restore=function(t){const e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},Cl.prototype.enterKey=function(t){return this._reporterState.path.push(t)},Cl.prototype.exitKey=function(t){const e=this._reporterState;e.path=e.path.slice(0,t-1)},Cl.prototype.leaveKey=function(t,e,i){const r=this._reporterState;this.exitKey(t),null!==r.obj&&(r.obj[e]=i)},Cl.prototype.path=function(){return this._reporterState.path.join("/")},Cl.prototype.enterObject=function(){const t=this._reporterState,e=t.obj;return t.obj={},e},Cl.prototype.leaveObject=function(t){const e=this._reporterState,i=e.obj;return e.obj=t,i},Cl.prototype.error=function(t){let e;const i=this._reporterState,r=t instanceof Ol;if(e=r?t:new Ol(i.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!i.options.partial)throw e;return r||i.errors.push(e),e},Cl.prototype.wrapResult=function(t){const e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},J(Ol,Error),Ol.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Ol),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this};var Pl={};const Ll=Il.Reporter,$l=Rl.Buffer;function Nl(t,e){Ll.call(this,e),$l.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function Bl(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return Bl.isEncoderBuffer(t)||(t=new Bl(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=$l.byteLength(t);else{if(!$l.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}J(Nl,Ll),Pl.DecoderBuffer=Nl,Nl.isDecoderBuffer=function(t){return t instanceof Nl||"object"==typeof t&&$l.isBuffer(t.base)&&"DecoderBuffer"===t.constructor.name&&"number"==typeof t.offset&&"number"==typeof t.length&&"function"==typeof t.save&&"function"==typeof t.restore&&"function"==typeof t.isEmpty&&"function"==typeof t.readUInt8&&"function"==typeof t.skip&&"function"==typeof t.raw},Nl.prototype.save=function(){return{offset:this.offset,reporter:Ll.prototype.save.call(this)}},Nl.prototype.restore=function(t){const e=new Nl(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,Ll.prototype.restore.call(this,t.reporter),e},Nl.prototype.isEmpty=function(){return this.offset===this.length},Nl.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},Nl.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");const i=new Nl(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+t,this.offset+=t,i},Nl.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},Pl.EncoderBuffer=Bl,Bl.isEncoderBuffer=function(t){return t instanceof Bl||"object"==typeof t&&"EncoderBuffer"===t.constructor.name&&"number"==typeof t.length&&"function"==typeof t.join},Bl.prototype.join=function(t,e){return t||(t=$l.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(i){i.join(t,e),e+=i.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):$l.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t};const Dl=Il.Reporter,jl=Pl.EncoderBuffer,zl=Pl.DecoderBuffer,Fl=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],Ul=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(Fl);function ql(t,e,i){const r={};this._baseState=r,r.name=i,r.enc=t,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}var Hl=ql;const Vl=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];ql.prototype.clone=function(){const t=this._baseState,e={};Vl.forEach((function(i){e[i]=t[i]}));const i=new this.constructor(e.parent);return i._baseState=e,i},ql.prototype._wrap=function(){const t=this._baseState;Ul.forEach((function(e){this[e]=function(){const i=new this.constructor(this);return t.children.push(i),i[e].apply(i,arguments)}}),this)},ql.prototype._init=function(t){const e=this._baseState;t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this)},ql.prototype._useArgs=function(t){const e=this._baseState,i=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==i.length&&(e.children=i,i.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;const e={};return Object.keys(t).forEach((function(i){i==(0|i)&&(i|=0);const r=t[i];e[r]=i})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){ql.prototype[t]=function(){const e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),Fl.forEach((function(t){ql.prototype[t]=function(){const e=this._baseState,i=Array.prototype.slice.call(arguments);return e.tag=t,this._useArgs(i),this}})),ql.prototype.use=function(t){return this._baseState.use=t,this},ql.prototype.optional=function(){return this._baseState.optional=!0,this},ql.prototype.def=function(t){const e=this._baseState;return e.default=t,e.optional=!0,this},ql.prototype.explicit=function(t){return this._baseState.explicit=t,this},ql.prototype.implicit=function(t){return this._baseState.implicit=t,this},ql.prototype.obj=function(){const t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},ql.prototype.key=function(t){return this._baseState.key=t,this},ql.prototype.any=function(){return this._baseState.any=!0,this},ql.prototype.choice=function(t){return this._baseState.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},ql.prototype.contains=function(t){return this._baseState.contains=t,this},ql.prototype._decode=function(t,e){const i=this._baseState;if(null===i.parent)return t.wrapResult(i.children[0]._decode(t,e));let r,n=i.default,o=!0,a=null;if(null!==i.key&&(a=t.enterKey(i.key)),i.optional){let r=null;if(null!==i.explicit?r=i.explicit:null!==i.implicit?r=i.implicit:null!==i.tag&&(r=i.tag),null!==r||i.any){if(o=this._peekTag(t,r,i.any),t.isError(o))return o}else{const r=t.save();try{null===i.choice?this._decodeGeneric(i.tag,t,e):this._decodeChoice(t,e),o=!0}catch(t){o=!1}t.restore(r)}}if(i.obj&&o&&(r=t.enterObject()),o){if(null!==i.explicit){const e=this._decodeTag(t,i.explicit);if(t.isError(e))return e;t=e}const r=t.offset;if(null===i.use&&null===i.choice){let e;i.any&&(e=t.save());const r=this._decodeTag(t,null!==i.implicit?i.implicit:i.tag,i.any);if(t.isError(r))return r;i.any?n=t.raw(e):t=r}if(e&&e.track&&null!==i.tag&&e.track(t.path(),r,t.length,"tagged"),e&&e.track&&null!==i.tag&&e.track(t.path(),t.offset,t.length,"content"),i.any||(n=null===i.choice?this._decodeGeneric(i.tag,t,e):this._decodeChoice(t,e)),t.isError(n))return n;if(i.any||null!==i.choice||null===i.children||i.children.forEach((function(i){i._decode(t,e)})),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){const r=new zl(n);n=this._getUse(i.contains,t._reporterState.obj)._decode(r,e)}}return i.obj&&o&&(n=t.leaveObject(r)),null===i.key||null===n&&!0!==o?null!==a&&t.exitKey(a):t.leaveKey(a,i.key,n),n},ql.prototype._decodeGeneric=function(t,e,i){const r=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,r.args[0],i):/str$/.test(t)?this._decodeStr(e,t,i):"objid"===t&&r.args?this._decodeObjid(e,r.args[0],r.args[1],i):"objid"===t?this._decodeObjid(e,null,null,i):"gentime"===t||"utctime"===t?this._decodeTime(e,t,i):"null_"===t?this._decodeNull(e,i):"bool"===t?this._decodeBool(e,i):"objDesc"===t?this._decodeStr(e,t,i):"int"===t||"enum"===t?this._decodeInt(e,r.args&&r.args[0],i):null!==r.use?this._getUse(r.use,e._reporterState.obj)._decode(e,i):e.error("unknown tag: "+t)},ql.prototype._getUse=function(t,e){const i=this._baseState;return i.useDecoder=this._use(t,e),i.useDecoder=i.useDecoder._baseState.children[0],i.implicit!==i.useDecoder._baseState.implicit&&(i.useDecoder=i.useDecoder.clone(),i.useDecoder._baseState.implicit=i.implicit),i.useDecoder},ql.prototype._decodeChoice=function(t,e){const i=this._baseState;let r=null,n=!1;return Object.keys(i.choice).some((function(o){const a=t.save(),s=i.choice[o];try{const i=s._decode(t,e);if(t.isError(i))return!1;r={type:o,value:i},n=!0}catch(e){return t.restore(a),!1}return!0}),this),n?r:t.error("Choice not matched")},ql.prototype._createEncoderBuffer=function(t){return new jl(t,this.reporter)},ql.prototype._encode=function(t,e,i){const r=this._baseState;if(null!==r.default&&r.default===t)return;const n=this._encodeValue(t,e,i);return void 0===n||this._skipDefault(n,e,i)?void 0:n},ql.prototype._encodeValue=function(t,e,i){const r=this._baseState;if(null===r.parent)return r.children[0]._encode(t,e||new Dl);let n=null;if(this.reporter=e,r.optional&&void 0===t){if(null===r.default)return;t=r.default}let o=null,a=!1;if(r.any)n=this._createEncoderBuffer(t);else if(r.choice)n=this._encodeChoice(t,e);else if(r.contains)o=this._getUse(r.contains,i)._encode(t,e),a=!0;else if(r.children)o=r.children.map((function(i){if("null_"===i._baseState.tag)return i._encode(null,e,t);if(null===i._baseState.key)return e.error("Child should have a key");const r=e.enterKey(i._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");const n=i._encode(t[i._baseState.key],e,t);return e.leaveKey(r),n}),this).filter((function(t){return t})),o=this._createEncoderBuffer(o);else if("seqof"===r.tag||"setof"===r.tag){if(!r.args||1!==r.args.length)return e.error("Too many args for : "+r.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");const i=this.clone();i._baseState.implicit=null,o=this._createEncoderBuffer(t.map((function(i){const r=this._baseState;return this._getUse(r.args[0],t)._encode(i,e)}),i))}else null!==r.use?n=this._getUse(r.use,i)._encode(t,e):(o=this._encodePrimitive(r.tag,t),a=!0);if(!r.any&&null===r.choice){const t=null!==r.implicit?r.implicit:r.tag,i=null===r.implicit?"universal":"context";null===t?null===r.use&&e.error("Tag could be omitted only for .use()"):null===r.use&&(n=this._encodeComposite(t,a,i,o))}return null!==r.explicit&&(n=this._encodeComposite(r.explicit,!1,"context",n)),n},ql.prototype._encodeChoice=function(t,e){return this._baseState.choice[t.type]._encode(t.value,e)},ql.prototype._encodePrimitive=function(t,e){const i=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&i.args)return this._encodeObjid(e,i.reverseArgs[0],i.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,i.args&&i.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},ql.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},ql.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)};var Wl={};function Gl(t){const e={};return Object.keys(t).forEach((function(i){(0|i)==i&&(i|=0);const r=t[i];e[r]=i})),e}Wl.tagClass={0:"universal",1:"application",2:"context",3:"private"},Wl.tagClassByName=Gl(Wl.tagClass),Wl.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},Wl.tagByName=Gl(Wl.tag);var Kl={};const Xl=Rl.Buffer;function Yl(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new Zl,this.tree._init(t.body)}function Zl(t){Hl.call(this,"der",t)}function Jl(t){return t<10?"0"+t:t}var Ql;function td(t){Kl.call(this,t),this.enc="pem"}Kl=Yl,Yl.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},J(Zl,Hl),Zl.prototype._encodeComposite=function(t,e,i,r){const n=function(t,e,i,r){let n;if("seqof"===t?t="seq":"setof"===t&&(t="set"),Wl.tagByName.hasOwnProperty(t))n=Wl.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return r.error("Unknown tag: "+t);n=t}return n>=31?r.error("Multi-octet tag encoding unsupported"):(e||(n|=32),n|Wl.tagClassByName[i||"universal"]<<6)}(t,e,i,this.reporter);if(r.length<128){const t=Xl.alloc(2);return t[0]=n,t[1]=r.length,this._createEncoderBuffer([t,r])}let o=1;for(let t=r.length;t>=256;t>>=8)o++;const a=Xl.alloc(2+o);a[0]=n,a[1]=128|o;for(let t=1+o,e=r.length;e>0;t--,e>>=8)a[t]=255&e;return this._createEncoderBuffer([a,r])},Zl.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){const e=Xl.alloc(2*t.length);for(let i=0;i<t.length;i++)e.writeUInt16BE(t.charCodeAt(i),2*i);return this._createEncoderBuffer(e)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},Zl.prototype._encodeObjid=function(t,e,i){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s.]+/g);for(let e=0;e<t.length;e++)t[e]|=0}else if(Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!i){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}let r=0;for(let e=0;e<t.length;e++){let i=t[e];for(r++;i>=128;i>>=7)r++}const n=Xl.alloc(r);let o=n.length-1;for(let e=t.length-1;e>=0;e--){let i=t[e];for(n[o--]=127&i;(i>>=7)>0;)n[o--]=128|127&i}return this._createEncoderBuffer(n)},Zl.prototype._encodeTime=function(t,e){let i;const r=new Date(t);return"gentime"===e?i=[Jl(r.getUTCFullYear()),Jl(r.getUTCMonth()+1),Jl(r.getUTCDate()),Jl(r.getUTCHours()),Jl(r.getUTCMinutes()),Jl(r.getUTCSeconds()),"Z"].join(""):"utctime"===e?i=[Jl(r.getUTCFullYear()%100),Jl(r.getUTCMonth()+1),Jl(r.getUTCDate()),Jl(r.getUTCHours()),Jl(r.getUTCMinutes()),Jl(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(i,"octstr")},Zl.prototype._encodeNull=function(){return this._createEncoderBuffer("")},Zl.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!Xl.isBuffer(t)){const e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=Xl.from(e)}if(Xl.isBuffer(t)){let e=t.length;0===t.length&&e++;const i=Xl.alloc(e);return t.copy(i),0===t.length&&(i[0]=0),this._createEncoderBuffer(i)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let i=1;for(let e=t;e>=256;e>>=8)i++;const r=new Array(i);for(let e=r.length-1;e>=0;e--)r[e]=255&t,t>>=8;return 128&r[0]&&r.unshift(0),this._createEncoderBuffer(Xl.from(r))},Zl.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},Zl.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},Zl.prototype._skipDefault=function(t,e,i){const r=this._baseState;let n;if(null===r.default)return!1;const o=t.join();if(void 0===r.defaultBuffer&&(r.defaultBuffer=this._encodeValue(r.default,e,i).join()),o.length!==r.defaultBuffer.length)return!1;for(n=0;n<o.length;n++)if(o[n]!==r.defaultBuffer[n])return!1;return!0},J(td,Kl),Ql=td,td.prototype.encode=function(t,e){const i=Kl.prototype.encode.call(this,t).toString("base64"),r=["-----BEGIN "+e.label+"-----"];for(let t=0;t<i.length;t+=64)r.push(i.slice(t,t+64));return r.push("-----END "+e.label+"-----"),r.join("\n")};var ed={};const id=ed;id.der=Kl,id.pem=Ql;var rd={};const nd=Pl.DecoderBuffer;function od(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new ad,this.tree._init(t.body)}function ad(t){Hl.call(this,"der",t)}function sd(t,e){let i=t.readUInt8(e);if(t.isError(i))return i;const r=Wl.tagClass[i>>6],n=0==(32&i);if(31==(31&i)){let r=i;for(i=0;128==(128&r);){if(r=t.readUInt8(e),t.isError(r))return r;i<<=7,i|=127&r}}else i&=31;return{cls:r,primitive:n,tag:i,tagStr:Wl.tag[i]}}function ld(t,e,i){let r=t.readUInt8(i);if(t.isError(r))return r;if(!e&&128===r)return null;if(0==(128&r))return r;const n=127&r;if(n>4)return t.error("length octect is too long");r=0;for(let e=0;e<n;e++){r<<=8;const e=t.readUInt8(i);if(t.isError(e))return e;r|=e}return r}var dd;rd=od,od.prototype.decode=function(t,e){return nd.isDecoderBuffer(t)||(t=new nd(t,e)),this.tree._decode(t,e)},J(ad,Hl),ad.prototype._peekTag=function(t,e,i){if(t.isEmpty())return!1;const r=t.save(),n=sd(t,'Failed to peek tag: "'+e+'"');return t.isError(n)?n:(t.restore(r),n.tag===e||n.tagStr===e||n.tagStr+"of"===e||i)},ad.prototype._decodeTag=function(t,e,i){const r=sd(t,'Failed to decode tag of "'+e+'"');if(t.isError(r))return r;let n=ld(t,r.primitive,'Failed to get length of "'+e+'"');if(t.isError(n))return n;if(!i&&r.tag!==e&&r.tagStr!==e&&r.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(r.primitive||null!==n)return t.skip(n,'Failed to match body of: "'+e+'"');const o=t.save(),a=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(a)?a:(n=t.offset-o.offset,t.restore(o),t.skip(n,'Failed to match body of: "'+e+'"'))},ad.prototype._skipUntilEnd=function(t,e){for(;;){const i=sd(t,e);if(t.isError(i))return i;const r=ld(t,i.primitive,e);if(t.isError(r))return r;let n;if(n=i.primitive||null!==r?t.skip(r):this._skipUntilEnd(t,e),t.isError(n))return n;if("end"===i.tagStr)break}},ad.prototype._decodeList=function(t,e,i,r){const n=[];for(;!t.isEmpty();){const e=this._peekTag(t,"end");if(t.isError(e))return e;const o=i.decode(t,"der",r);if(t.isError(o)&&e)break;n.push(o)}return n},ad.prototype._decodeStr=function(t,e){if("bitstr"===e){const e=t.readUInt8();return t.isError(e)?e:{unused:e,data:t.raw()}}if("bmpstr"===e){const e=t.raw();if(e.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");let i="";for(let t=0;t<e.length/2;t++)i+=String.fromCharCode(e.readUInt16BE(2*t));return i}if("numstr"===e){const e=t.raw().toString("ascii");return this._isNumstr(e)?e:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){const e=t.raw().toString("ascii");return this._isPrintstr(e)?e:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},ad.prototype._decodeObjid=function(t,e,i){let r;const n=[];let o=0,a=0;for(;!t.isEmpty();)o<<=7,o|=127&(a=t.readUInt8()),0==(128&a)&&(n.push(o),o=0);128&a&&n.push(o);const s=n[0]/40|0,l=n[0]%40;if(r=i?n:[s,l].concat(n.slice(1)),e){let t=e[r.join(" ")];void 0===t&&(t=e[r.join(".")]),void 0!==t&&(r=t)}return r},ad.prototype._decodeTime=function(t,e){const i=t.raw().toString();let r,n,o,a,s,l;if("gentime"===e)r=0|i.slice(0,4),n=0|i.slice(4,6),o=0|i.slice(6,8),a=0|i.slice(8,10),s=0|i.slice(10,12),l=0|i.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");r=0|i.slice(0,2),n=0|i.slice(2,4),o=0|i.slice(4,6),a=0|i.slice(6,8),s=0|i.slice(8,10),l=0|i.slice(10,12),r=r<70?2e3+r:1900+r}return Date.UTC(r,n-1,o,a,s,l,0)},ad.prototype._decodeNull=function(){return null},ad.prototype._decodeBool=function(t){const e=t.readUInt8();return t.isError(e)?e:0!==e},ad.prototype._decodeInt=function(t,e){const i=t.raw();let r=new Tl(i);return e&&(r=e[r.toString(10)]||r),r},ad.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree};const cd=Rl.Buffer;function hd(t){rd.call(this,t),this.enc="pem"}J(hd,rd),dd=hd,hd.prototype.decode=function(t,e){const i=t.toString().split(/[\r\n]+/g),r=e.label.toUpperCase(),n=/^-----(BEGIN|END) ([^-]+)-----$/;let o=-1,a=-1;for(let t=0;t<i.length;t++){const e=i[t].match(n);if(null!==e&&e[2]===r){if(-1!==o){if("END"!==e[1])break;a=t;break}if("BEGIN"!==e[1])break;o=t}}if(-1===o||-1===a)throw new Error("PEM section not found for: "+r);const s=i.slice(o+1,a).join("");s.replace(/[^a-z0-9+/=]+/gi,"");const l=cd.from(s,"base64");return rd.prototype.decode.call(this,l,e)};var ud={};const pd=ud;pd.der=rd,pd.pem=dd;var fd={};function md(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}fd.define=function(t,e){return new md(t,e)},md.prototype._createNamed=function(t){const e=this.name;function i(t){this._initNamed(t,e)}return J(i,t),i.prototype._initNamed=function(e,i){t.call(this,e,i)},new i(this)},md.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(ud[t])),this.decoders[t]},md.prototype.decode=function(t,e,i){return this._getDecoder(e).decode(t,i)},md.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(ed[t])),this.encoders[t]},md.prototype.encode=function(t,e,i){return this._getEncoder(e).encode(t,i)};var gd={};const bd=gd;bd.Reporter=Il.Reporter,bd.DecoderBuffer=Pl.DecoderBuffer,bd.EncoderBuffer=Pl.EncoderBuffer,bd.Node=Hl;var vd={};const yd=vd;yd._reverse=function(t){const e={};return Object.keys(t).forEach((function(i){(0|i)==i&&(i|=0);const r=t[i];e[r]=i})),e},yd.der=Wl;var _d={};const wd=_d;wd.bignum=Tl,wd.define=fd.define,wd.base=gd,wd.constants=vd,wd.decoders=ud,wd.encoders=ed;var xd=_d.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),Md=_d.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),kd=_d.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),Sd=_d.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(kd),this.key("subjectPublicKey").bitstr())})),Ed=_d.define("RelativeDistinguishedName",(function(){this.setof(Md)})),Ad=_d.define("RDNSequence",(function(){this.seqof(Ed)})),Td=_d.define("Name",(function(){this.choice({rdnSequence:this.use(Ad)})})),Rd=_d.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(xd),this.key("notAfter").use(xd))})),Id=_d.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),Cd=_d.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(kd),this.key("issuer").use(Td),this.key("validity").use(Rd),this.key("subject").use(Td),this.key("subjectPublicKeyInfo").use(Sd),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(Id).optional())})),Od=_d.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(Cd),this.key("signatureAlgorithm").use(kd),this.key("signatureValue").bitstr())})),Pd={};Pd.certificate=Od;var Ld=_d.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));Pd.RSAPrivateKey=Ld;var $d=_d.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));Pd.RSAPublicKey=$d;var Nd=_d.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(Bd),this.key("subjectPublicKey").bitstr())}));Pd.PublicKey=Nd;var Bd=_d.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),Dd=_d.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(Bd),this.key("subjectPrivateKey").octstr())}));Pd.PrivateKey=Dd;var jd=_d.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));Pd.EncryptedPrivateKey=jd;var zd=_d.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));Pd.DSAPrivateKey=zd,Pd.DSAparam=_d.define("DSAparam",(function(){this.int()}));var Fd=_d.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(Ud),this.key("publicKey").optional().explicit(1).bitstr())}));Pd.ECPrivateKey=Fd;var Ud=_d.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));Pd.signature=_d.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}));var qd={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"},Hd=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,Vd=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,Wd=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,Gd=C.Buffer,Kd={},Xd=C.Buffer;function Yd(t){var e;"object"!=typeof t||Xd.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=Xd.from(t));var i,r,n=function(t,e){var i,r=t.toString(),n=r.match(Hd);if(n){var o="aes"+n[1],a=Gd.from(n[2],"hex"),s=Gd.from(n[3].replace(/[\r\n]/g,""),"base64"),l=function(t,e,i,r){if(Dn.isBuffer(t)||(t=Dn.from(t,"binary")),e&&(Dn.isBuffer(e)||(e=Dn.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var n=i/8,o=Dn.alloc(n),a=Dn.alloc(r||0),s=Dn.alloc(0);n>0||r>0;){var l=new Qt;l.update(s),l.update(t),e&&l.update(e),s=l.digest();var d=0;if(n>0){var c=o.length-n;d=Math.min(n,s.length),s.copy(o,c,0,d),n-=d}if(d<s.length&&r>0){var h=a.length-r,u=Math.min(r,s.length-d);s.copy(a,h,d,d+u),r-=u}}return s.fill(0),{key:o,iv:a}}(e,a.slice(0,8),parseInt(n[1],10)).key,d=[],c=Wn.createDecipheriv(o,l,a);d.push(c.update(s)),d.push(c.final()),i=Gd.concat(d)}else{var h=r.match(Wd);i=Gd.from(h[2].replace(/[\r\n]/g,""),"base64")}return{tag:r.match(Vd)[1],data:i}}(t,e),o=n.tag,a=n.data;switch(o){case"CERTIFICATE":r=Pd.certificate.decode(a,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(r||(r=Pd.PublicKey.decode(a,"der")),i=r.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return Pd.RSAPublicKey.decode(r.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return r.subjectPrivateKey=r.subjectPublicKey,{type:"ec",data:r};case"1.2.840.10040.4.1":return r.algorithm.params.pub_key=Pd.DSAparam.decode(r.subjectPublicKey.data,"der"),{type:"dsa",data:r.algorithm.params};default:throw new Error("unknown key id "+i)}case"ENCRYPTED PRIVATE KEY":a=function(t,e){var i=t.algorithm.decrypt.kde.kdeparams.salt,r=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=qd[t.algorithm.decrypt.cipher.algo.join(".")],o=t.algorithm.decrypt.cipher.iv,a=t.subjectPrivateKey,s=parseInt(n.split("-")[1],10)/8,l=Cr.pbkdf2Sync(e,i,r,s,"sha1"),d=Wn.createDecipheriv(n,l,o),c=[];return c.push(d.update(a)),c.push(d.final()),Xd.concat(c)}(a=Pd.EncryptedPrivateKey.decode(a,"der"),e);case"PRIVATE KEY":switch(i=(r=Pd.PrivateKey.decode(a,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return Pd.RSAPrivateKey.decode(r.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:r.algorithm.curve,privateKey:Pd.ECPrivateKey.decode(r.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return r.algorithm.params.priv_key=Pd.DSAparam.decode(r.subjectPrivateKey,"der"),{type:"dsa",params:r.algorithm.params};default:throw new Error("unknown key id "+i)}case"RSA PUBLIC KEY":return Pd.RSAPublicKey.decode(a,"der");case"RSA PRIVATE KEY":return Pd.RSAPrivateKey.decode(a,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:Pd.DSAPrivateKey.decode(a,"der")};case"EC PRIVATE KEY":return{curve:(a=Pd.ECPrivateKey.decode(a,"der")).parameters.value,privateKey:a.privateKey};default:throw new Error("unknown key type "+o)}}Kd=Yd,Yd.signature=Pd.signature;var Zd,Jd={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"},Qd=C.Buffer,tc=El.ec;function ec(t,e,i,r){if((t=Qd.from(t.toArray())).length<e.byteLength()){var n=Qd.alloc(e.byteLength()-t.length);t=Qd.concat([n,t])}var o=i.length,a=function(t,e){t=(t=ic(t,e)).mod(e);var i=Qd.from(t.toArray());if(i.length<e.byteLength()){var r=Qd.alloc(e.byteLength()-i.length);i=Qd.concat([r,i])}return i}(i,e),s=Qd.alloc(o);s.fill(1);var l=Qd.alloc(o);return l=gr(r,l).update(s).update(Qd.from([0])).update(t).update(a).digest(),s=gr(r,l).update(s).digest(),{k:l=gr(r,l).update(s).update(Qd.from([1])).update(t).update(a).digest(),v:s=gr(r,l).update(s).digest()}}function ic(t,e){var i=new Zo(t),r=(t.length<<3)-e.bitLength();return r>0&&i.ishrn(r),i}function rc(t,e,i){var r,n;do{for(r=Qd.alloc(0);8*r.length<t.bitLength();)e.v=gr(i,e.k).update(e.v).digest(),r=Qd.concat([r,e.v]);n=ic(r,t),e.k=gr(i,e.k).update(e.v).update(Qd.from([0])).digest(),e.v=gr(i,e.k).update(e.v).digest()}while(-1!==n.cmp(t));return n}function nc(t,e,i,r){return t.toRed(Zo.mont(i)).redPow(e).fromRed().mod(r)}(Zd=function(t,e,i,r,n){var o=Kd(e);if(o.curve){if("ecdsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong private key type");return function(t,e){var i=Jd[e.curve.join(".")];if(!i)throw new Error("unknown curve "+e.curve.join("."));var r=new tc(i).keyFromPrivate(e.privateKey).sign(t);return Qd.from(r.toDER())}(t,o)}if("dsa"===o.type){if("dsa"!==r)throw new Error("wrong private key type");return function(t,e,i){for(var r,n=e.params.priv_key,o=e.params.p,a=e.params.q,s=e.params.g,l=new Zo(0),d=ic(t,a).mod(a),c=!1,h=ec(n,a,t,i);!1===c;)l=nc(s,r=rc(a,h,i),o,a),0===(c=r.invm(a).imul(d.add(n.mul(l))).mod(a)).cmpn(0)&&(c=!1,l=new Zo(0));return function(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t)),128&e[0]&&(e=[0].concat(e));var i=[48,t.length+e.length+4,2,t.length];return i=i.concat(t,[2,e.length],e),Qd.from(i)}(l,c)}(t,o,i)}if("rsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong private key type");t=Qd.concat([n,t]);for(var a=o.modulus.byteLength(),s=[0,1];t.length+s.length+1<a;)s.push(255);s.push(0);for(var l=-1;++l<t.length;)s.push(t[l]);return Jo(s,o)}).getKey=ec,Zd.makeKey=rc;var oc=C.Buffer,ac=El.ec;function sc(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}var lc=C.Buffer;function dc(t){Yo.Writable.call(this);var e=wr[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=or(e.hash),this._tag=e.id,this._signType=e.sign}function cc(t){Yo.Writable.call(this);var e=wr[t];if(!e)throw new Error("Unknown message digest");this._hash=or(e.hash),this._tag=e.id,this._signType=e.sign}Object.keys(wr).forEach((function(t){wr[t].id=lc.from(wr[t].id,"hex"),wr[t.toLowerCase()]=wr[t]})),J(dc,Yo.Writable),dc.prototype._write=function(t,e,i){this._hash.update(t),i()},dc.prototype.update=function(t,e){return"string"==typeof t&&(t=lc.from(t,e)),this._hash.update(t),this},dc.prototype.sign=function(t,e){this.end();var i=this._hash.digest(),r=Zd(i,t,this._hashType,this._signType,this._tag);return e?r.toString(e):r},J(cc,Yo.Writable),cc.prototype._write=function(t,e,i){this._hash.update(t),i()},cc.prototype.update=function(t,e){return"string"==typeof t&&(t=lc.from(t,e)),this._hash.update(t),this},cc.prototype.verify=function(t,e,i){return"string"==typeof e&&(e=lc.from(e,i)),this.end(),function(t,e,i,r,n){var o=Kd(i);if("ec"===o.type){if("ecdsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong public key type");return function(t,e,i){var r=Jd[i.data.algorithm.curve.join(".")];if(!r)throw new Error("unknown curve "+i.data.algorithm.curve.join("."));var n=new ac(r),o=i.data.subjectPrivateKey.data;return n.verify(e,t,o)}(t,e,o)}if("dsa"===o.type){if("dsa"!==r)throw new Error("wrong public key type");return function(t,e,i){var r=i.data.p,n=i.data.q,o=i.data.g,a=i.data.pub_key,s=Kd.signature.decode(t,"der"),l=s.s,d=s.r;sc(l,n),sc(d,n);var c=Zo.mont(r),h=l.invm(n);return 0===o.toRed(c).redPow(new Zo(e).mul(h).mod(n)).fromRed().mul(a.toRed(c).redPow(d.mul(h).mod(n)).fromRed()).mod(r).mod(n).cmp(d)}(t,e,o)}if("rsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong public key type");e=oc.concat([n,e]);for(var a=o.modulus.byteLength(),s=[1],l=0;e.length+s.length+2<a;)s.push(255),l++;s.push(0);for(var d=-1;++d<e.length;)s.push(e[d]);s=oc.from(s);var c=Zo.mont(o.modulus);t=(t=new Zo(t).toRed(c)).redPow(new Zo(o.publicExponent)),t=oc.from(t.fromRed().toArray());var h=l<8?1:0;for(a=Math.min(t.length,s.length),t.length!==s.length&&(h=1),d=-1;++d<a;)h|=t[d]^s[d];return 0===h}(e,this._hash.digest(),t,this._signType,this._tag)};var hc={exports:{}};!function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=_({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var a=t.charCodeAt(o)-48;r<<=4,r|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function a(t,e,i,r){for(var n=0,o=Math.min(t.length,i),a=e;a<o;a++){var s=t.charCodeAt(a)-48;n*=r,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,a=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this.strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,a=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303,(a+=24)>=26&&(a-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303),this.strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,s=o%r,l=Math.min(o,o-s)+i,d=0,c=i;c<l;c+=r)d=a(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==s){var h=1;for(d=a(t,c,t.length,e),c=0;c<s;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,l=a/67108864|0;i.words[0]=s;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(a=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&a}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i.strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var a=this.words[o],c=(16777215&(a<<r|n)).toString(16);i=0!=(n=a>>>24-r&16777215)||o!==this.length-1?s[6-c.length]+c+i:c+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],u=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modn(u).toString(t);i=(p=p.idivn(u)).isZero()?f+i:s[h-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)},r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){var r=this.byteLength(),n=i||Math.max(1,r);this.strip();var o,a,s="le"===e,l=new t(n),d=this.clone();if(s){for(a=0;!d.isZero();a++)o=d.andln(255),d.iushrn(8),l[a]=o;for(;a<n;a++)l[a]=0}else{for(a=0;a<n-r;a++)l[a]=0;for(a=0;!d.isZero();a++)o=d.andln(255),d.iushrn(8),l[n-a-1]=o}return l},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|i.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<i.length;a++)o=(e=(0|i.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var h=function(t,e,i){var r,n,o,a=t.words,s=e.words,l=i.words,d=0,c=0|a[0],h=8191&c,u=c>>>13,p=0|a[1],f=8191&p,m=p>>>13,g=0|a[2],b=8191&g,v=g>>>13,y=0|a[3],_=8191&y,w=y>>>13,x=0|a[4],M=8191&x,k=x>>>13,S=0|a[5],E=8191&S,A=S>>>13,T=0|a[6],R=8191&T,I=T>>>13,C=0|a[7],O=8191&C,P=C>>>13,L=0|a[8],$=8191&L,N=L>>>13,B=0|a[9],D=8191&B,j=B>>>13,z=0|s[0],F=8191&z,U=z>>>13,q=0|s[1],H=8191&q,V=q>>>13,W=0|s[2],G=8191&W,K=W>>>13,X=0|s[3],Y=8191&X,Z=X>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],lt=8191&st,dt=st>>>13,ct=0|s[8],ht=8191&ct,ut=ct>>>13,pt=0|s[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,F))|0)+((8191&(n=(n=Math.imul(h,U))+Math.imul(u,F)|0))<<13)|0;d=((o=Math.imul(u,U))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,F),n=(n=Math.imul(f,U))+Math.imul(m,F)|0,o=Math.imul(m,U);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,F),n=(n=Math.imul(b,U))+Math.imul(v,F)|0,o=Math.imul(v,U),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,F),n=(n=Math.imul(_,U))+Math.imul(w,F)|0,o=Math.imul(w,U),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Y)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(u,Y)|0))<<13)|0;d=((o=o+Math.imul(u,Z)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,F),n=(n=Math.imul(M,U))+Math.imul(k,F)|0,o=Math.imul(k,U),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Y)|0,n=(n=n+Math.imul(f,Z)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Z)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,F),n=(n=Math.imul(E,U))+Math.imul(A,F)|0,o=Math.imul(A,U),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Z)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(R,F),n=(n=Math.imul(R,U))+Math.imul(I,F)|0,o=Math.imul(I,U),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,Z)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,at)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,at)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,F),n=(n=Math.imul(O,U))+Math.imul(P,F)|0,o=Math.imul(P,U),r=r+Math.imul(R,H)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,Z)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul($,F),n=(n=Math.imul($,U))+Math.imul(N,F)|0,o=Math.imul(N,U),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(R,G)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,K)|0,r=r+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,Z)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(D,F),n=(n=Math.imul(D,U))+Math.imul(j,F)|0,o=Math.imul(j,U),r=r+Math.imul($,H)|0,n=(n=n+Math.imul($,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,K)|0,r=r+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,Z)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(D,H),n=(n=Math.imul(D,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul($,G)|0,n=(n=n+Math.imul($,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,Z)|0,r=r+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(D,G),n=(n=Math.imul(D,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul($,Y)|0,n=(n=n+Math.imul($,Z)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Z)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(R,it)|0,n=(n=n+Math.imul(R,rt)|0)+Math.imul(I,it)|0,o=o+Math.imul(I,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(D,Y),n=(n=Math.imul(D,Z))+Math.imul(j,Y)|0,o=Math.imul(j,Z),r=r+Math.imul($,Q)|0,n=(n=n+Math.imul($,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(P,it)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(D,Q),n=(n=Math.imul(D,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul($,it)|0,n=(n=n+Math.imul($,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(R,lt)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var Rt=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(D,it),n=(n=Math.imul(D,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul($,ot)|0,n=(n=n+Math.imul($,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,dt)|0,r=r+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ut)|0;var It=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(D,ot),n=(n=Math.imul(D,at))+Math.imul(j,ot)|0,o=Math.imul(j,at),r=r+Math.imul($,lt)|0,n=(n=n+Math.imul($,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0;var Ct=(d+(r=r+Math.imul(R,ft)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(I,ft)|0))<<13)|0;d=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(D,lt),n=(n=Math.imul(D,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul($,ht)|0,n=(n=n+Math.imul($,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(P,ft)|0))<<13)|0;d=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(D,ht),n=(n=Math.imul(D,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Pt=(d+(r=r+Math.imul($,ft)|0)|0)+((8191&(n=(n=n+Math.imul($,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(d+(r=Math.imul(D,ft))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=Rt,l[14]=It,l[15]=Ct,l[16]=Ot,l[17]=Pt,l[18]=Lt,0!==d&&(l[19]=d,i.length++),i};function u(t,e,i){return(new p).mulp(t,e,i)}function p(t,e){this.x=t,this.y=e}Math.imul||(h=c),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?h(this,t,e):i<63?c(this,t,e):i<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var a=n;n=0;for(var s=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;s=67108863&(u=u+s|0),n+=(a=(a=a+(h/67108864|0)|0)+(u>>>26)|0)>>>26,a&=67108863}i.words[o]=s,r=a,a=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):u(this,t,e)},p.prototype.makeRBT=function(t){for(var e=new Array(t),i=r.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,i,t);return e},p.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},p.prototype.permute=function(t,e,i,r,n,o){for(var a=0;a<o;a++)r[a]=e[t[a]],n[a]=i[t[a]]},p.prototype.transform=function(t,e,i,r,n,o){this.permute(o,t,e,i,r,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,l=Math.cos(2*Math.PI/s),d=Math.sin(2*Math.PI/s),c=0;c<n;c+=s)for(var h=l,u=d,p=0;p<a;p++){var f=i[c+p],m=r[c+p],g=i[c+p+a],b=r[c+p+a],v=h*g-u*b;b=h*b+u*g,g=v,i[c+p]=f+g,r[c+p]=m+b,i[c+p+a]=f-g,r[c+p+a]=m-b,p!==s&&(v=l*h-d*u,u=l*u+d*h,h=v)}},p.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},p.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},p.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},p.prototype.convert13b=function(t,e,i,r){for(var n=0,o=0;o<e;o++)n+=0|t[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*e;o<r;++o)i[o]=0},p.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},p.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),o=this.stub(r),a=new Array(r),s=new Array(r),l=new Array(r),d=new Array(r),c=new Array(r),h=new Array(r),u=i.words;u.length=r,this.convert13b(t.words,t.length,a,r),this.convert13b(e.words,e.length,d,r),this.transform(a,o,s,l,r,n),this.transform(d,o,c,h,r,n);for(var p=0;p<r;p++){var f=s[p]*c[p]-l[p]*h[p];l[p]=s[p]*h[p]+l[p]*c[p],s[p]=f}return this.conjugate(s,l,r),this.transform(s,l,u,o,r,n),this.conjugate(u,o,r),this.normalize13b(u,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),u(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){for(var e=0,i=0;i<this.length;i++){var r=(0|this.words[i])*t,n=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=n>>>26,this.words[i]=67108863&n}return 0!==e&&(this.words[i]=e,this.length++),this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&n,s=(0|this.words[e])-a<<i;this.words[e]=s|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),a=67108863^67108863>>>n<<n,s=i;if(r-=o,r=Math.max(0,r),s){for(var l=0;l<o;l++)s.words[l]=this.words[l];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&a}return s&&0!==d&&(s.words[s.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var a=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+a;var s=(0|t.words[r])*e;a=((n-=67108863&s)>>26)-(s/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)a=(n=(0|this.words[r+i])+a)>>26,this.words[r+i]=67108863&n;if(0===a)return this.strip();for(a=0,r=0;r<this.length;r++)a=(n=-(0|this.words[r])+a)>>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,a=0|o.words[o.length-1];0!=(i=26-this._countBits(a))&&(o=o.ushln(i),n.iushln(i),a=0|o.words[o.length-1]);var s,l=n.length-o.length;if("mod"!==e){(s=new r(null)).length=l+1,s.words=new Array(s.length);for(var d=0;d<s.length;d++)s.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/a|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=u)}return s&&s.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:s||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modn=function(t){for(var e=(1<<26)%t,i=0,r=this.length-1;r>=0;r--)i=(e*i+(0|this.words[r]))%t;return i},r.prototype.idivn=function(t){for(var e=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*e;this.words[i]=r/t|0,e=r%t}return this.strip()},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),a=new r(0),s=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(d),s.isub(c)),a.iushrn(1),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(a),o.isub(s)):(i.isub(e),a.isub(n),s.isub(o))}return{a:a,b:s,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),a=new r(0),s=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a)):(i.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var a=0|this.words[o];n=(a+=n)>>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new w(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var f={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function y(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function x(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(g,m),g.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(b,m),i(v,m),i(y,m),y.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(f[t])return f[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new b;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new y}return f[t]=e,e},w.prototype._verify1=function(t){},w.prototype._verify2=function(t,e){},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,s).cmp(a);)l.redIAdd(a);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],a=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===n&&0===c)&&(o=this.mul(o,i[a]),s=0,a=0)):s=0}l=26}return o},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new x(t)},i(x,w),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(hc,this),hc=hc.exports,function(t){(function(){}).call(this)}.call(this,w({}).Buffer),C.Buffer;var uc={exports:{}};!function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=_({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var a=t.charCodeAt(o)-48;r<<=4,r|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function a(t,e,i,r){for(var n=0,o=Math.min(t.length,i),a=e;a<o;a++){var s=t.charCodeAt(a)-48;n*=r,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,a=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this.strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,a=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303,(a+=24)>=26&&(a-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<a&67108863,this.words[r+1]|=n>>>26-a&4194303),this.strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,s=o%r,l=Math.min(o,o-s)+i,d=0,c=i;c<l;c+=r)d=a(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==s){var h=1;for(d=a(t,c,t.length,e),c=0;c<s;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,l=a/67108864|0;i.words[0]=s;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(a=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&a}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i.strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var a=this.words[o],c=(16777215&(a<<r|n)).toString(16);i=0!=(n=a>>>24-r&16777215)||o!==this.length-1?s[6-c.length]+c+i:c+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],u=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modn(u).toString(t);i=(p=p.idivn(u)).isZero()?f+i:s[h-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)},r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){var r=this.byteLength(),n=i||Math.max(1,r);this.strip();var o,a,s="le"===e,l=new t(n),d=this.clone();if(s){for(a=0;!d.isZero();a++)o=d.andln(255),d.iushrn(8),l[a]=o;for(;a<n;a++)l[a]=0}else{for(a=0;a<n-r;a++)l[a]=0;for(a=0;!d.isZero();a++)o=d.andln(255),d.iushrn(8),l[n-a-1]=o}return l},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,a=0;a<r.length;a++)o=(e=(0|i.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<i.length;a++)o=(e=(0|i.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<i.length&&i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this.length=Math.max(this.length,a),i!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var h=function(t,e,i){var r,n,o,a=t.words,s=e.words,l=i.words,d=0,c=0|a[0],h=8191&c,u=c>>>13,p=0|a[1],f=8191&p,m=p>>>13,g=0|a[2],b=8191&g,v=g>>>13,y=0|a[3],_=8191&y,w=y>>>13,x=0|a[4],M=8191&x,k=x>>>13,S=0|a[5],E=8191&S,A=S>>>13,T=0|a[6],R=8191&T,I=T>>>13,C=0|a[7],O=8191&C,P=C>>>13,L=0|a[8],$=8191&L,N=L>>>13,B=0|a[9],D=8191&B,j=B>>>13,z=0|s[0],F=8191&z,U=z>>>13,q=0|s[1],H=8191&q,V=q>>>13,W=0|s[2],G=8191&W,K=W>>>13,X=0|s[3],Y=8191&X,Z=X>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],lt=8191&st,dt=st>>>13,ct=0|s[8],ht=8191&ct,ut=ct>>>13,pt=0|s[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,F))|0)+((8191&(n=(n=Math.imul(h,U))+Math.imul(u,F)|0))<<13)|0;d=((o=Math.imul(u,U))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,F),n=(n=Math.imul(f,U))+Math.imul(m,F)|0,o=Math.imul(m,U);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,F),n=(n=Math.imul(b,U))+Math.imul(v,F)|0,o=Math.imul(v,U),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,F),n=(n=Math.imul(_,U))+Math.imul(w,F)|0,o=Math.imul(w,U),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Y)|0)|0)+((8191&(n=(n=n+Math.imul(h,Z)|0)+Math.imul(u,Y)|0))<<13)|0;d=((o=o+Math.imul(u,Z)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,F),n=(n=Math.imul(M,U))+Math.imul(k,F)|0,o=Math.imul(k,U),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Y)|0,n=(n=n+Math.imul(f,Z)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Z)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,F),n=(n=Math.imul(E,U))+Math.imul(A,F)|0,o=Math.imul(A,U),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Z)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(R,F),n=(n=Math.imul(R,U))+Math.imul(I,F)|0,o=Math.imul(I,U),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,Z)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,at)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,at)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,F),n=(n=Math.imul(O,U))+Math.imul(P,F)|0,o=Math.imul(P,U),r=r+Math.imul(R,H)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,Z)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul($,F),n=(n=Math.imul($,U))+Math.imul(N,F)|0,o=Math.imul(N,U),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(R,G)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,K)|0,r=r+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,Z)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(D,F),n=(n=Math.imul(D,U))+Math.imul(j,F)|0,o=Math.imul(j,U),r=r+Math.imul($,H)|0,n=(n=n+Math.imul($,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,K)|0,r=r+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,Z)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(D,H),n=(n=Math.imul(D,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul($,G)|0,n=(n=n+Math.imul($,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,Z)|0,r=r+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(D,G),n=(n=Math.imul(D,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul($,Y)|0,n=(n=n+Math.imul($,Z)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Z)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(R,it)|0,n=(n=n+Math.imul(R,rt)|0)+Math.imul(I,it)|0,o=o+Math.imul(I,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(D,Y),n=(n=Math.imul(D,Z))+Math.imul(j,Y)|0,o=Math.imul(j,Z),r=r+Math.imul($,Q)|0,n=(n=n+Math.imul($,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(P,it)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(D,Q),n=(n=Math.imul(D,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul($,it)|0,n=(n=n+Math.imul($,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(R,lt)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var Rt=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(D,it),n=(n=Math.imul(D,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul($,ot)|0,n=(n=n+Math.imul($,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,dt)|0,r=r+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ut)|0;var It=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(D,ot),n=(n=Math.imul(D,at))+Math.imul(j,ot)|0,o=Math.imul(j,at),r=r+Math.imul($,lt)|0,n=(n=n+Math.imul($,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,ut)|0;var Ct=(d+(r=r+Math.imul(R,ft)|0)|0)+((8191&(n=(n=n+Math.imul(R,mt)|0)+Math.imul(I,ft)|0))<<13)|0;d=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(D,lt),n=(n=Math.imul(D,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul($,ht)|0,n=(n=n+Math.imul($,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(P,ft)|0))<<13)|0;d=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(D,ht),n=(n=Math.imul(D,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Pt=(d+(r=r+Math.imul($,ft)|0)|0)+((8191&(n=(n=n+Math.imul($,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(d+(r=Math.imul(D,ft))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=Rt,l[14]=It,l[15]=Ct,l[16]=Ot,l[17]=Pt,l[18]=Lt,0!==d&&(l[19]=d,i.length++),i};function u(t,e,i){return(new p).mulp(t,e,i)}function p(t,e){this.x=t,this.y=e}Math.imul||(h=c),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?h(this,t,e):i<63?c(this,t,e):i<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var a=n;n=0;for(var s=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;s=67108863&(u=u+s|0),n+=(a=(a=a+(h/67108864|0)|0)+(u>>>26)|0)>>>26,a&=67108863}i.words[o]=s,r=a,a=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):u(this,t,e)},p.prototype.makeRBT=function(t){for(var e=new Array(t),i=r.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,i,t);return e},p.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},p.prototype.permute=function(t,e,i,r,n,o){for(var a=0;a<o;a++)r[a]=e[t[a]],n[a]=i[t[a]]},p.prototype.transform=function(t,e,i,r,n,o){this.permute(o,t,e,i,r,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,l=Math.cos(2*Math.PI/s),d=Math.sin(2*Math.PI/s),c=0;c<n;c+=s)for(var h=l,u=d,p=0;p<a;p++){var f=i[c+p],m=r[c+p],g=i[c+p+a],b=r[c+p+a],v=h*g-u*b;b=h*b+u*g,g=v,i[c+p]=f+g,r[c+p]=m+b,i[c+p+a]=f-g,r[c+p+a]=m-b,p!==s&&(v=l*h-d*u,u=l*u+d*h,h=v)}},p.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},p.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},p.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},p.prototype.convert13b=function(t,e,i,r){for(var n=0,o=0;o<e;o++)n+=0|t[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*e;o<r;++o)i[o]=0},p.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},p.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),o=this.stub(r),a=new Array(r),s=new Array(r),l=new Array(r),d=new Array(r),c=new Array(r),h=new Array(r),u=i.words;u.length=r,this.convert13b(t.words,t.length,a,r),this.convert13b(e.words,e.length,d,r),this.transform(a,o,s,l,r,n),this.transform(d,o,c,h,r,n);for(var p=0;p<r;p++){var f=s[p]*c[p]-l[p]*h[p];l[p]=s[p]*h[p]+l[p]*c[p],s[p]=f}return this.conjugate(s,l,r),this.transform(s,l,u,o,r,n),this.conjugate(u,o,r),this.normalize13b(u,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),u(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){for(var e=0,i=0;i<this.length;i++){var r=(0|this.words[i])*t,n=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=n>>>26,this.words[i]=67108863&n}return 0!==e&&(this.words[i]=e,this.length++),this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&n,s=(0|this.words[e])-a<<i;this.words[e]=s|o,o=a>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),a=67108863^67108863>>>n<<n,s=i;if(r-=o,r=Math.max(0,r),s){for(var l=0;l<o;l++)s.words[l]=this.words[l];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&a}return s&&0!==d&&(s.words[s.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var a=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+a;var s=(0|t.words[r])*e;a=((n-=67108863&s)>>26)-(s/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)a=(n=(0|this.words[r+i])+a)>>26,this.words[r+i]=67108863&n;if(0===a)return this.strip();for(a=0,r=0;r<this.length;r++)a=(n=-(0|this.words[r])+a)>>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,a=0|o.words[o.length-1];0!=(i=26-this._countBits(a))&&(o=o.ushln(i),n.iushln(i),a=0|o.words[o.length-1]);var s,l=n.length-o.length;if("mod"!==e){(s=new r(null)).length=l+1,s.words=new Array(s.length);for(var d=0;d<s.length;d++)s.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/a|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=u)}return s&&s.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:s||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modn=function(t){for(var e=(1<<26)%t,i=0,r=this.length-1;r>=0;r--)i=(e*i+(0|this.words[r]))%t;return i},r.prototype.idivn=function(t){for(var e=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*e;this.words[i]=r/t|0,e=r%t}return this.strip()},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),a=new r(0),s=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(d),s.isub(c)),a.iushrn(1),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(a),o.isub(s)):(i.isub(e),a.isub(n),s.isub(o))}return{a:a,b:s,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),a=new r(0),s=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(a)):(i.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var a=0|this.words[o];n=(a+=n)>>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new w(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var f={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function y(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function x(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(g,m),g.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(b,m),i(v,m),i(y,m),y.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(f[t])return f[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new b;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new y}return f[t]=e,e},w.prototype._verify1=function(t){},w.prototype._verify2=function(t,e){},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,s).cmp(a);)l.redIAdd(a);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],a=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===n&&0===c)&&(o=this.mul(o,i[a]),s=0,a=0)):s=0}l=26}return o},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new x(t)},i(x,w),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(uc,this),uc=uc.exports,C.Buffer,C.Buffer,C.Buffer,function(t,e){(function(){C.Buffer,C.kMaxLength;var i=e.crypto||e.msCrypto;i&&i.getRandomValues||t.browser}).call(this)}.call(this,D,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var pc={};pc.createHash=or,pc.createHmac=gr,Cr.pbkdf2,Cr.pbkdf2Sync;var fc=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},mc=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function gc(t,e){if(t.map)return t.map(e);for(var i=[],r=0;r<t.length;r++)i.push(e(t[r],r));return i}var bc=Object.keys||function(t){var e=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.push(i);return e},vc=function(t,e,i,r){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?gc(bc(t),(function(r){var n=encodeURIComponent(fc(r))+i;return mc(t[r])?gc(t[r],(function(t){return n+encodeURIComponent(fc(t))})).join(e):n+encodeURIComponent(fc(t[r]))})).join(e):r?encodeURIComponent(fc(r))+i+encodeURIComponent(fc(t)):""},yc={};return function(t,e){(function(){class i{constructor(t,e,i,r="API"){if(this._apiVersionMajor="4",this._apiVersion="v4.20190615",this._hashType="sha256",null==i&&(i="https://api.backend.ai"),this._endpoint=i,this._endpointHost=i.replace(/^[^:]+:\/\//,""),"API"===r){if(null==t)throw"You must set accessKey! (either as argument or environment variable)";if(null==e)throw"You must set secretKey! (either as argument or environment variable)";this._accessKey=t,this._secretKey=e,this._userId="",this._password=""}else{if(null==t)throw"You must set user id! (either as argument or environment variable)";if(null==e)throw"You must set password! (either as argument or environment variable)";this._accessKey="",this._secretKey="",this._userId=t,this._password=e}this._proxyURL=null,this._proxyToken=null,this._connectionMode=r}get accessKey(){return this._accessKey}get secretKey(){return this._secretKey}get userId(){return this._userId}get password(){return this._password}get endpoint(){return this._endpoint}get proxyURL(){return this._proxyURL}get proxyToken(){return this._proxyToken}get endpointHost(){return this._endpointHost}get apiVersion(){return this._apiVersion}get apiVersionMajor(){return this._apiVersionMajor}get hashType(){return this._hashType}get connectionMode(){return this._connectionMode}static createFromEnv(){return new this(t.env.BACKEND_ACCESS_KEY,t.env.BACKEND_SECRET_KEY,t.env.BACKEND_ENDPOINT)}}class r{constructor(t,e){this.ready=!1,this.code=null,this.sessionId=null,this.kernelType=null,this.clientVersion="20.11.0",this.agentSignature=e,this._config=void 0===t?i.createFromEnv():t,this._managerVersion=null,this._apiVersion=null,this._apiVersionMajor=null,this.is_admin=!1,this.is_superadmin=!1,this.kernelPrefix="/kernel",this.resourcePreset=new n(this),this.vfolder=new o(this),this.agent=new a(this),this.keypair=new l(this),this.image=new c(this),this.utils=new E(this),this.computeSession=new h(this),this.sessionTemplate=new u(this),this.resourcePolicy=new d(this),this.user=new b(this),this.group=new f(this),this.domain=new m(this),this.resources=new p(this),this.storageproxy=new s(this),this.maintenance=new g(this),this.scalingGroup=new v(this),this.registry=new y(this),this.setting=new _(this),this.userConfig=new x(this),this.service=new w(this),this.domain=new m(this),this.enterprise=new M(this),this.cloud=new k(this),this.eduApp=new S(this),this._features={},this.abortController=new AbortController,this.abortSignal=this.abortController.signal,this.requestTimeout=5e3}get managerVersion(){return this._managerVersion}get apiVersion(){return this._apiVersion}async _wrapWithPromise(t,e=!1,i=null,n=0,o=0,a={}){let s,l,d,c,h=r.ERR_REQUEST,u="",p="";try{if("GET"==t.method&&(t.body=void 0),"SESSION"===this._config.connectionMode&&(t.credentials="include",t.mode="cors"),null!==i)t.signal=i;else{let e=new AbortController;t.signal=e.signal,c=setTimeout((()=>{h=r.ERR_TIMEOUT,e.abort()}),0===n?this.requestTimeout:n)}l=await fetch(t.uri,t),void 0!==c&&clearTimeout(c),h=r.ERR_RESPONSE;let o=l.headers.get("Content-Type");if(!1===e&&null===o?d=void 0===l.blob?await l.buffer():await l.blob():!1===e&&(o.startsWith("application/json")||o.startsWith("application/problem+json"))?(d=await l.json(),h=d.type,u=d.title):d=!1===e&&o.startsWith("text/")?await l.text():void 0===l.blob?await l.buffer():await l.blob(),h=r.ERR_SERVER,!l.ok)throw d}catch(c){if(o>0)return await new Promise((t=>setTimeout(t,2e3))),this._wrapWithPromise(t,e,i,n,o-1,a);let f;switch(f="object"==typeof c&&c.constructor===Object&&"title"in c?c.title:c,void 0===l&&(l={}),h){case r.ERR_REQUEST:h="https://api.backend.ai/probs/client-request-error",navigator.onLine?(u=f,s="sending request has failed: "+f,p=f):(u="Network disconnected.",s="sending request has failed: Network disconnected",p="Network disconnected");break;case r.ERR_RESPONSE:h="https://api.backend.ai/probs/client-response-error",u=f,s="reading response has failed: "+f,p=f;break;case r.ERR_SERVER:h="https://api.backend.ai/probs/server-error",u=`${l.status} ${l.statusText} - ${d.title}`,s="server responded failure: ",d.msg?(s+=`${l.status} ${l.statusText} - ${d.msg}`,p=d.msg):(s+=`${l.status} ${l.statusText} - ${d.title}`,p=d.title);break;case r.ERR_ABORT:h="https://api.backend.ai/probs/request-abort-error",u="Request aborted",p=s="Request aborted by user",l.status=408,l.statusText="Request aborted by user";break;case r.ERR_TIMEOUT:h="https://api.backend.ai/probs/request-timeout-error",u="Request timeout",p=s="No response returned within timeout",l.status=408,l.statusText="Timeout exceeded";break;default:void 0===l.status&&(l.status=500,l.statusText="Server error"),""===h&&(h=r.ERR_UNKNOWN),""===u&&(u=d.title),s=`server responded failure: ${l.status} ${l.statusText} - ${d.title}`,""!==d.title&&(p=d.title)}throw{isError:!0,timestamp:(new Date).toUTCString(),type:h,requestUrl:t.uri,requestMethod:t.method,requestParameters:t.body,statusCode:l.status,statusText:l.statusText,title:u,message:s,description:p}}let f=JSON.parse(localStorage.getItem("backendaiwebui.logs"));f&&f.length>3e3&&(f=f.slice(1,3e3));let m=Array();void 0===l&&(l={status:"No status",statusText:"No response given."});let g={isError:!1,timestamp:(new Date).toUTCString(),type:"",requestUrl:t.uri,requestMethod:t.method,requestParameters:t.body,statusCode:l.status,statusText:l.statusText,title:d.title,message:""};"log"in a&&(g.requestParameters=a.log),m.push(g),f&&(m=m.concat(f));try{localStorage.setItem("backendaiwebui.logs",JSON.stringify(m))}catch(t){console.warn("Local storage is full. Clearing part of the logs.");let e=JSON.parse(localStorage.getItem("backendaiwebui.logs")||"[]");e=e.slice(0,Math.round(2*e.length/3)),localStorage.setItem("backendaiwebui.logs",JSON.stringify(e)),Object.entries(localStorage).map((t=>t[0])).filter((t=>t.startsWith("backendaiconsole"))).map((t=>localStorage.removeItem(t)))}return d}getServerVersion(t=null){let e=this.newPublicRequest("GET","/",null,"");return this._wrapWithPromise(e,!1,t)}get APIMajorVersion(){return this._apiVersionMajor}set APIMajorVersion(t){this._apiVersionMajor=t,this._config._apiVersionMajor=this._apiVersionMajor}async get_manager_version(t=null){if(null===this._managerVersion){let e=await this.getServerVersion(t);this._managerVersion=e.manager,this._apiVersion=e.version,this._config._apiVersion=this._apiVersion,this._apiVersionMajor=e.version.substr(1,2),this._config._apiVersionMajor=this._apiVersionMajor,this._apiVersionMajor>4&&(this.kernelPrefix="/session")}return this._managerVersion}supports(t){return 0===Object.keys(this._features).length&&this._updateSupportList(),t in this._features&&this._features[t]}_updateFieldCompatibilityByAPIVersion(t){const e={session_name:"sess_id"};return this._apiVersionMajor<5&&Object.keys(e).forEach((i=>{let r=t.indexOf(i);-1!==r&&(t[r]=e[i])})),t}_updateSupportList(){this.isAPIVersionCompatibleWith("v4.20190601")&&(this._features["scaling-group"]=!0,this._features.group=!0,this._features["group-folder"]=!0,this._features["system-images"]=!0,this._features["detailed-session-states"]=!0,this._features["change-user-name"]=!0),this.isAPIVersionCompatibleWith("v6.20200815")&&(this._features["multi-container"]=!0,this._features["multi-node"]=!0,this._features["storage-proxy"]=!0,this._features["hardware-metadata"]=!0),this.isManagerVersionCompatibleWith("20.09.16")&&(this._features["avoid-hol-blocking"]=!0,this._features["session-detail-status"]=!0),this.isManagerVersionCompatibleWith("21.09")&&(this._features.schedulable=!0,this._features["wsproxy-addr"]=!0),this.isManagerVersionCompatibleWith("22.03")&&(this._features["scheduler-opts"]=!0,this._features["session-lifetime"]=!0)}isManagerVersionCompatibleWith(t){let e=this._managerVersion;return e=e.split(".").map((t=>t.padStart(10))).join("."),(t=t.split(".").map((t=>t.padStart(10))).join("."))<=e}isAPIVersionCompatibleWith(t){let e=this._apiVersion;return null!==e&&null!==t&&(e=e.split(".").map((t=>t.padStart(10))).join("."),t=t.split(".").map((t=>t.padStart(10))).join(".")),t<=e}async check_login(){let t,e=this.newSignedRequest("POST","/server/login-check",null);try{!0===(t=await this._wrapWithPromise(e)).authenticated&&(this._config._accessKey=t.data.access_key,this._config._session_id=t.session_id)}catch(t){return console.log(t),Promise.resolve(!1)}return t.authenticated}async login(){let t,e={username:this._config.userId,password:this._config.password},i=this.newSignedRequest("POST","/server/login",e);try{if(!0===(t=await this._wrapWithPromise(i,!1,null,0,0,{log:JSON.stringify({username:this._config.userId,password:"********"})})).authenticated)return"monitor"===t.data.role?(this.logout(),Promise.resolve({fail_reason:"Monitor user does not allow to login."})):(await this.get_manager_version(),this.check_login());if(!1===t.authenticated)return t.data&&t.data.details?Promise.resolve({fail_reason:t.data.details}):Promise.resolve(!1)}catch(t){throw"statusCode"in t&&429===t.statusCode?{title:t.description,message:"Too many failed login attempts."}:{title:"No manager found at API Endpoint.",message:"Authentication failed. Check information and manager status."}}}logout(){let t=this.newSignedRequest("POST","/server/logout",{});return localStorage.getItem("backendaiwebui.logs")&&localStorage.removeItem("backendaiwebui.logs"),this._wrapWithPromise(t)}async token_login(){const t=this.newSignedRequest("POST","/server/token-login",{});try{const e=await this._wrapWithPromise(t);if(!0===e.authenticated)return await this.get_manager_version(),this.check_login();if(!1===e.authenticated)return e.data&&e.data.details?Promise.resolve({fail_reason:e.data.details}):Promise.resolve(!1)}catch(t){throw"statusCode"in t&&429===t.statusCode?{title:t.description,message:"Too many failed login attempts."}:{title:"No manager found at API Endpoint.",message:"Authentication failed. Check information and manager status."}}}async signout(t,e){let i={username:t,password:e},r=this.newSignedRequest("POST","/auth/signout",i);return this._wrapWithPromise(r)}async update_full_name(t,e){let i={email:t,full_name:e},r=this.newSignedRequest("POST","/auth/update-full-name",i);return this._wrapWithPromise(r)}async update_password(t,e,i){let r={old_password:t,new_password:e,new_password2:i},n=this.newSignedRequest("POST","/auth/update-password",r);return this._wrapWithPromise(n)}async get_resource_slots(){let t;return t=this.isAPIVersionCompatibleWith("v4.20190601")?this.newPublicRequest("GET","/config/resource-slots",null,""):this.newPublicRequest("GET","/etcd/resource-slots",null,""),this._wrapWithPromise(t)}async createIfNotExists(t,e,i={},r=0,n){null==e&&(e=this.generateSessionId());let o,a={lang:t,clientSessionToken:e,architecture:n};if(i!={}){let t={};i.cpu&&(t.cpu=i.cpu),i.mem&&(t.mem=i.mem),i.gpu&&(t["cuda.device"]=parseInt(i.gpu)),i["cuda.device"]&&(t["cuda.device"]=parseInt(i["cuda.device"])),i.vgpu?t["cuda.shares"]=parseFloat(i.vgpu).toFixed(2):i.fgpu&&(t["cuda.shares"]=parseFloat(i.fgpu).toFixed(2)),i["cuda.shares"]&&(t["cuda.shares"]=parseFloat(i["cuda.shares"]).toFixed(2)),i.rocm&&(t["rocm.device"]=i.rocm),i.tpu&&(t["tpu.device"]=i.tpu),i.cluster_size&&(a.cluster_size=i.cluster_size),i.cluster_mode&&(a.cluster_mode=i.cluster_mode),i.group_name&&(a.group_name=i.group_name),i.domain&&(a.domain=i.domain),i.type&&(a.type=i.type),i.startsAt&&(a.starts_at=i.startsAt),i.enqueueOnly&&(a.enqueueOnly=i.enqueueOnly),i.maxWaitSeconds&&(a.maxWaitSeconds=i.maxWaitSeconds),i.reuseIfExists&&(a.reuseIfExists=i.reuseIfExists),i.startupCommand&&(a.startupCommand=i.startupCommand),i.bootstrapScript&&(a.bootstrapScript=i.bootstrapScript),i.bootstrap_script&&(a.bootstrap_script=i.bootstrap_script),i.owner_access_key&&(a.owner_access_key=i.owner_access_key),a.config={resources:t},i.mounts&&(a.config.mounts=i.mounts),i.mount_map&&(a.config.mount_map=i.mount_map),i.scaling_group&&(a.config.scaling_group=i.scaling_group),i.shmem&&(a.config.resource_opts={},a.config.resource_opts.shmem=i.shmem),i.env&&(a.config.environ=i.env)}return o=this._apiVersionMajor<5?this.newSignedRequest("POST",this.kernelPrefix+"/create",a):this.newSignedRequest("POST",""+this.kernelPrefix,a),this._wrapWithPromise(o,!1,null,r)}async createSessionFromTemplate(t,e=null,i=null,r={},n=0){null==i&&(i=this.generateSessionId());const o={template_id:t};if(e&&(o.image=e),i&&(o.name=i),r&&Object.keys(r).length>0){let t={};r.cpu&&(t.cpu=r.cpu),r.mem&&(t.mem=r.mem),r["cuda.device"]&&(t["cuda.device"]=parseInt(r["cuda.device"])),r.fgpu&&(t["cuda.shares"]=parseFloat(r.fgpu).toFixed(2)),r["cuda.shares"]&&(t["cuda.shares"]=parseFloat(r["cuda.shares"]).toFixed(2)),r.rocm&&(t["rocm.device"]=r.rocm),r.tpu&&(t["tpu.device"]=r.tpu),r.cluster_size&&(o.cluster_size=r.cluster_size),r.cluster_mode&&(o.cluster_mode=r.cluster_mode),r.group_name&&(o.group_name=r.group_name),r.domain&&(o.domain=r.domain),r.type&&(o.type=r.type),r.starts_at&&(o.starts_at=r.startsAt),r.enqueueOnly&&(o.enqueueOnly=r.enqueueOnly),r.maxWaitSeconds&&(o.maxWaitSeconds=r.maxWaitSeconds),r.reuseIfExists&&(o.reuseIfExists=r.reuseIfExists),r.startupCommand&&(o.startupCommand=r.startupCommand),r.bootstrap_script&&(o.bootstrap_script=r.bootstrap_script),r.owner_access_key&&(o.owner_access_key=r.owner_access_key),o.config={resources:t},r.mounts&&(o.config.mounts=r.mounts),r.scaling_group&&(o.config.scaling_group=r.scaling_group),r.shmem&&(o.config.resource_opts={},o.config.resource_opts.shmem=r.shmem),r.env&&(o.config.environ=r.env)}const a=this.newSignedRequest("POST",this.kernelPrefix+"/_/create-from-template",o);return this._wrapWithPromise(a,!1,null,n)}async get_info(t,e=null){let i=`${this.kernelPrefix}/${t}`;null!=e&&(i=`${i}?owner_access_key=${e}`);let r=this.newSignedRequest("GET",i,null);return this._wrapWithPromise(r)}async get_logs(t,e=null,i=0){let r=`${this.kernelPrefix}/${t}/logs`;null!=e&&(r=`${r}?owner_access_key=${e}`);let n=this.newSignedRequest("GET",r,null);return this._wrapWithPromise(n,!1,null,i)}getTaskLogs(t){const e=`${this.kernelPrefix}/_/logs?session_name=${t}`;let i=this.newSignedRequest("GET",e,null);return this._wrapWithPromise(i)}async destroy(t,e=null,i=!1){let r=`${this.kernelPrefix}/${t}`;r=null!==e?`${r}?owner_access_key=${e}${i?"&forced=true":""}`:`${r}${i?"?forced=true":""}`;let n=this.newSignedRequest("DELETE",r,null);return this._wrapWithPromise(n,!1,null,15e3,2)}async restart(t,e=null){let i=`${this.kernelPrefix}/${t}`;null!=e&&(i=`${i}?owner_access_key=${e}`);let r=this.newSignedRequest("PATCH",i,null);return this._wrapWithPromise(r)}async execute(t,e,i,r,n,o=0){let a={mode:i,code:r,runId:e,options:n},s=this.newSignedRequest("POST",`${this.kernelPrefix}/${t}`,a);return this._wrapWithPromise(s,!1,null,o)}createKernel(t,e,i={},r=0){return this.createIfNotExists(t,e,i,r,"x86_64")}destroyKernel(t,e=null){return this.destroy(t,e)}refreshKernel(t,e=null){return this.restart(t,e)}runCode(t,e,i,r){return this.execute(e,i,r,t,{})}async rename(t,e){let i={name:e},r=this.newSignedRequest("POST",`${this.kernelPrefix}/${t}/rename`,i);return this._wrapWithPromise(r)}async shutdown_service(t,e){const i=vc({service_name:e});let r=this.newSignedRequest("POST",`${this.kernelPrefix}/${t}/shutdown-service?${i}`,null);return this._wrapWithPromise(r,!0)}async upload(t,e,i){const r=new FormData;r.append("src",i,e);let n=this.newSignedRequest("POST",`${this.kernelPrefix}/${t}/upload`,r);return this._wrapWithPromise(n)}async download(t,e){const i=vc({files:e});let r=this.newSignedRequest("GET",`${this.kernelPrefix}/${t}/download?${i}`,null);return this._wrapWithPromise(r,!0)}async download_single(t,e){const i=vc({file:e});let r=this.newSignedRequest("GET",`${this.kernelPrefix}/${t}/download_single?${i}`,null);return this._wrapWithPromise(r,!0)}mangleUserAgentSignature(){return this.clientVersion+(this.agentSignature?"; "+this.agentSignature:"")}async query(t,e,i=null,r=0,n=0){let o={query:t,variables:e},a=this.newSignedRequest("POST","/admin/graphql",o);return this._wrapWithPromise(a,!1,i,r,n)}newSignedRequest(t,i,r){let n,o,a,s,l,d="application/json",c=new Date;if(null==r?o=n="":"function"==typeof r.getBoundary||r instanceof FormData?(n=r,o="",d="multipart/form-data"):o=n=JSON.stringify(r),l="","SESSION"===this._config.connectionMode)s=new Headers({"User-Agent":"Backend.AI Client for Javascript "+this.mangleUserAgentSignature(),"X-BackendAI-Version":this._config.apiVersion,"X-BackendAI-Date":c.toISOString()}),l=!0===i.startsWith("/server")?this._config.endpoint+i:this._config.endpoint+"/func"+i;else{a=this._config._apiVersion[1]<4?this.getAuthenticationString(t,i,c.toISOString(),o,d):this.getAuthenticationString(t,i,c.toISOString(),"",d);let e=this.getSignKey(this._config.secretKey,c),r=this.sign(e,"binary",a,"hex");s=new Headers({"User-Agent":"Backend.AI Client for Javascript "+this.mangleUserAgentSignature(),"X-BackendAI-Version":this._config.apiVersion,"X-BackendAI-Date":c.toISOString(),Authorization:`BackendAI signMethod=HMAC-SHA256, credential=${this._config.accessKey}:${r}`}),l=this._config.endpoint+i}return null!=r?("function"==typeof r.getBoundary&&s.set("Content-Type",r.getHeaders()["content-type"]),r instanceof FormData||(s.set("Content-Type",d),s.set("Content-Length",e.byteLength(o)))):s.set("Content-Type",d),{method:t,headers:s,cache:"default",body:n,uri:l}}newUnsignedRequest(t,e,i){return this.newPublicRequest(t,e,i,this._config.apiVersionMajor)}newPublicRequest(t,e,i,r){let n=new Date,o={method:t,headers:new Headers({"Content-Type":"application/json","User-Agent":"Backend.AI Client for Javascript "+this.mangleUserAgentSignature(),"X-BackendAI-Version":this._config.apiVersion,"X-BackendAI-Date":n.toISOString(),credentials:"include",mode:"cors"}),mode:"cors",cache:"default",uri:""};return"SESSION"===this._config.connectionMode&&!0===e.startsWith("/server")?o.uri=this._config.endpoint+e:"SESSION"===this._config.connectionMode&&!1===e.startsWith("/server")?o.uri=this._config.endpoint+"/func"+e:o.uri=this._config.endpoint+e,o}getAuthenticationString(t,e,i,r,n="application/json"){let o=pc.createHash(this._config.hashType).update(r).digest("hex");return t+"\n"+e+"\n"+i+"\nhost:"+this._config.endpointHost+"\ncontent-type:"+n+"\nx-backendai-version:"+this._config.apiVersion+"\n"+o}getCurrentDate(t){return("0000"+t.getUTCFullYear()).slice(-4)+("0"+(t.getUTCMonth()+1)).slice(-2)+("0"+t.getUTCDate()).slice(-2)}sign(t,i,r,n){let o=new e(t,i),a=pc.createHmac(this._config.hashType,o);return a.update(r,"utf8"),a.digest(n)}getSignKey(t,e){let i=this.sign(t,"utf8",this.getCurrentDate(e),"binary");return this.sign(i,"binary",this._config.endpointHost,"binary")}generateSessionId(t=8,e=!1){for(var i="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<t;n++)i+=r.charAt(Math.floor(Math.random()*r.length));return e?i:i+"-jsSDK"}slugify(t){const e="àáäâèéëêìíïîòóöôùúüûñçßÿœæŕśńṕẃǵǹḿǘẍźḧ·/_,:;",i=new RegExp(e.split("").join("|"),"g");return t.toString().toLowerCase().replace(/\s+/g,"-").replace(i,(t=>"aaaaeeeeiiiioooouuuuncsyoarsnpwgnmuxzh------".charAt(e.indexOf(t)))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}async fetchSSHKeypair(){let t=this.newSignedRequest("GET","/auth/ssh-keypair",null);return this._wrapWithPromise(t,!1)}async refreshSSHKeypair(){let t=this.newSignedRequest("PATCH","/auth/ssh-keypair",null);return this._wrapWithPromise(t,!1)}}class n{constructor(t){this.client=t,this.urlPrefix="/resource"}async list(t=null){let e=this.client.newSignedRequest("GET",this.urlPrefix+"/presets",t);return this.client._wrapWithPromise(e)}async check(t=null){let e=this.client.newSignedRequest("POST",this.urlPrefix+"/check-presets",t);return this.client._wrapWithPromise(e)}async add(t=null,e){if(!0===this.client.is_admin&&null!==t){let i="mutation($name: String!, $input: CreateResourcePresetInput!) {  create_resource_preset(name: $name, props: $input) {    ok msg   }}",r={name:t,input:e};return this.client.query(i,r)}return Promise.resolve(!1)}async mutate(t=null,e){if(!0===this.client.is_admin&&null!==t){let i="mutation($name: String!, $input: ModifyResourcePresetInput!) {  modify_resource_preset(name: $name, props: $input) {    ok msg   }}",r={name:t,input:e};return this.client.query(i,r)}return Promise.resolve(!1)}async delete(t=null){if(!0===this.client.is_admin&&null!==t){let e="mutation($name: String!) {  delete_resource_preset(name: $name) {    ok msg   }}",i={name:t};return this.client.query(e,i)}return Promise.resolve(!1)}}class o{constructor(t,e=null){this.client=t,this.name=e,this.urlPrefix="/folders"}async list_allowed_types(){let t=this.client.newSignedRequest("GET",this.urlPrefix+"/_/allowed_types",null);return this.client._wrapWithPromise(t)}async create(t,e="",i="",r="general",n="rw",o=!1){let a;""!==e&&(a={name:t,host:e}),this.client.supports("group-folder")&&""!==i&&(a={name:t,host:e,group:i}),this.client.isAPIVersionCompatibleWith("v4.20191215")&&(r&&(a.usage_mode=r),n&&(a.permission=n)),this.client.supports("storage-proxy")&&(a.cloneable=o);let s=this.client.newSignedRequest("POST",""+this.urlPrefix,a);return this.client._wrapWithPromise(s)}async clone(t,e=null){let i=this.client.newSignedRequest("POST",`${this.urlPrefix}/${e}/clone`,t);return this.client._wrapWithPromise(i)}async update_folder(t,e=null){let i=this.client.newSignedRequest("POST",`${this.urlPrefix}/${e}/update-options`,t);return this.client._wrapWithPromise(i)}async list(t=null,e=null){let i=this.urlPrefix,r={};t&&(r.group_id=t),e&&(r.owner_user_email=e),i+="?"+vc(r);let n=this.client.newSignedRequest("GET",i,null);return this.client._wrapWithPromise(n)}async list_hosts(t=null){let e=this.urlPrefix+"/_/hosts",i={};this.client.isManagerVersionCompatibleWith("22.03.0")&&t&&(i.group_id=t),e+="?"+vc(i);let r=this.client.newSignedRequest("GET",e,null);return this.client._wrapWithPromise(r)}async info(t=null){null==t&&(t=this.name);let e=this.client.newSignedRequest("GET",`${this.urlPrefix}/${t}`,null);return this.client._wrapWithPromise(e)}async rename(t=null){const e={new_name:t};let i=this.client.newSignedRequest("POST",`${this.urlPrefix}/${this.name}/rename`,e);return this.client._wrapWithPromise(i)}async delete(t=null){null==t&&(t=this.name);let e=this.client.newSignedRequest("DELETE",`${this.urlPrefix}/${t}`,null);return this.client._wrapWithPromise(e)}async leave_invited(t=null){null==t&&(t=this.name);let e=this.client.newSignedRequest("POST",`${this.urlPrefix}/${t}/leave`,null);return this.client._wrapWithPromise(e)}async upload(t,e,i=null){null==i&&(i=this.name);let r=new FormData;r.append("src",e,t);let n=this.client.newSignedRequest("POST",`${this.urlPrefix}/${i}/upload`,r);return this.client._wrapWithPromise(n)}async uploadFormData(t,e=null){let i=this.client.newSignedRequest("POST",`${this.urlPrefix}/${e}/upload`,t);return this.client._wrapWithPromise(i)}async create_upload_session(t,e,i=null){null==i&&(i=this.name);let r,n={path:t,size:e.size};r=this.client._apiVersionMajor<6?`${this.urlPrefix}/${i}/create_upload_session`:`${this.urlPrefix}/${i}/request-upload`;const o=this.client.newSignedRequest("POST",r,n),a=await this.client._wrapWithPromise(o),s=a.token;let l;return this.client._apiVersionMajor<6?(l=this.client._config.endpoint,"SESSION"===this.client._config.connectionMode&&(l+="/func"),l+=`${this.urlPrefix}/_/tus/upload/${s}`):l=`${a.url}?token=${s}`,Promise.resolve(l)}async mkdir(t,e=null,i=null,r=null){null==e&&(e=this.name);const n={path:t};i&&(n.parents=i),r&&(n.exist_ok=r);const o=this.client.newSignedRequest("POST",`${this.urlPrefix}/${e}/mkdir`,n);return this.client._wrapWithPromise(o)}async rename_file(t,e,i=null,r=!1){let n;null==i&&(i=this.name),n=this.client.isAPIVersionCompatibleWith("v6.20200815")?{target_path:t,new_name:e,is_dir:r}:{target_path:t,new_name:e};let o=this.client.newSignedRequest("POST",`${this.urlPrefix}/${i}/rename_file`,n);return this.client._wrapWithPromise(o)}async delete_files(t,e=!1,i=null){null==i&&(i=this.name),null==e&&(e=!1);let r={files:t,recursive:e},n=this.client.newSignedRequest("DELETE",`${this.urlPrefix}/${i}/delete_files`,r);return this.client._wrapWithPromise(n)}async download(t,e=!1,i=!1,r=!1){const n=vc({file:t,archive:i});if(this.client._apiVersionMajor<6){const t=this.client.newSignedRequest("GET",`${this.urlPrefix}/${e}/download_single?${n}`,null);return this.client._wrapWithPromise(t,!0)}{const n=await this.request_download_token(t,e),o=`${n.url}?token=${n.token}&archive=${i}&no_cache=${r}`;return fetch(o)}}async request_download_token(t,e=!1,i=!1){let r,n={file:t,archive:i};r=this.client._apiVersionMajor<6?`${this.urlPrefix}/${e}/request_download`:`${this.urlPrefix}/${e}/request-download`;const o=this.client.newSignedRequest("POST",r,n);return this.client._wrapWithPromise(o)}async download_with_token(t=""){let e=vc({token:t}),i=this.client.newSignedRequest("GET",`${this.urlPrefix}/_/download_with_token?${e}`,null);return this.client._wrapWithPromise(i,!0)}get_download_url_with_token(t=""){let e=vc({token:t});return"SESSION"===this.client._config.connectionMode?`${this.client._config.endpoint}/func${this.urlPrefix}/_/download_with_token?${e}`:`${this.client._config.endpoint}${this.urlPrefix}/_/download_with_token?${e}`}async list_files(t,e=null){null==e&&(e=this.name);let i=vc({path:t}),r=this.client.newSignedRequest("GET",`${this.urlPrefix}/${e}/files?${i}`,null);return this.client._wrapWithPromise(r)}async invite(t,e,i=null){null==i&&(i=this.name);let r={perm:t,user_ids:e},n=this.client.newSignedRequest("POST",`${this.urlPrefix}/${i}/invite`,r);return this.client._wrapWithPromise(n)}async invitations(){let t=this.client.newSignedRequest("GET",this.urlPrefix+"/invitations/list",null);return this.client._wrapWithPromise(t)}async accept_invitation(t){let e={inv_id:t},i=this.client.newSignedRequest("POST",this.urlPrefix+"/invitations/accept",e);return this.client._wrapWithPromise(i)}async delete_invitation(t){let e={inv_id:t},i=this.client.newSignedRequest("DELETE",this.urlPrefix+"/invitations/delete",e);return this.client._wrapWithPromise(i)}async list_invitees(t=null){let e="/folders/_/shared";null!==t&&(e=`${e}?vfolder_id=${t}`);let i=this.client.newSignedRequest("GET",e,null);return this.client._wrapWithPromise(i)}async modify_invitee_permission(t){let e=this.client.newSignedRequest("POST","/folders/_/shared",t);return this.client._wrapWithPromise(e)}async share(t,e,i=null){i||(i=this.name);const r={permission:t,emails:e},n=this.client.newSignedRequest("POST",`${this.urlPrefix}/${i}/share`,r);return this.client._wrapWithPromise(n)}async unshare(t,e=null){e||(e=this.name);const i={emails:t},r=this.client.newSignedRequest("DELETE",`${this.urlPrefix}/${e}/unshare`,i);return this.client._wrapWithPromise(r)}async get_quota(t,e){let i=vc({folder_host:t,id:e});const r=this.client.newSignedRequest("GET",`${this.urlPrefix}/_/quota?${i}`,null);return this.client._wrapWithPromise(r)}async set_quota(t,e,i){const r={folder_host:t,id:e,input:{size_bytes:i}},n=this.client.newSignedRequest("POST",this.urlPrefix+"/_/quota",r);return this.client._wrapWithPromise(n)}}class a{constructor(t){this.client=t}async list(t="ALIVE",e=["id","status","region","first_contact","cpu_cur_pct","mem_cur_bytes","available_slots","occupied_slots"],i=0){if(!1===["ALIVE","TERMINATED"].includes(t))return Promise.resolve(!1);let r="query($status: String) {  agents(status: $status) {     "+e.join(" ")+"  }}",n={status:t};return this.client.query(r,n,null,i)}async update(t=null,e){if(!0===this.client.is_superadmin&&null!==t){let i="mutation($id: String!, $input: ModifyAgentInput!) {  modify_agent(id: $id, props: $input) {    ok msg   }}",r={id:t,input:e};return this.client.query(i,r)}return Promise.resolve(!1)}}class s{constructor(t){this.client=t}async list(t=["id","backend","capabilities"],e=20,i=0){let r=`query($offset:Int!, $limit:Int!) {  storage_volume_list(limit:$limit, offset:$offset) {     items { ${t.join(" ")} }     total_count  }}`,n={limit:e,offset:i};return this.client.query(r,n)}async detail(t="",e=["id","backend","path","fsprefix","capabilities"]){let i="query($vfolder_host: String!) {  storage_volume(id: $vfolder_host) {     "+e.join(" ")+"  }}",r={vfolder_host:t};return this.client.query(i,r)}}class l{constructor(t,e=null){this.client=t,this.name=e}async info(t,e=["access_key","secret_key","is_active","is_admin","user_id","created_at","last_used","concurrency_limit","concurrency_used","rate_limit","num_queries","resource_policy"]){let i,r;return this.client.is_admin?(i="query($access_key: String!) {  keypair(access_key: $access_key) {    "+e.join(" ")+"  }}",r={access_key:t}):(i="query {  keypair {    "+e.join(" ")+"  }}",r={}),this.client.query(i,r)}async list(t=null,e=["access_key","is_active","is_admin","user_id","created_at","last_used","concurrency_used","rate_limit","num_queries","resource_policy"],i=!0){let r,n;if(this.client._apiVersionMajor<5)return r=this.client.is_admin&&null==t?`\n        query($is_active: Boolean) {\n          keypairs(is_active: $is_active) {\n            ${e.join(" ")}\n          }\n        }\n      `:`\n        query($email: String!, $is_active: Boolean) {\n          keypairs(email: $email, is_active: $is_active) {\n            ${e.join(" ")}\n          }\n        }\n      `,n={email:t||this.client.email,is_active:i},this.client.query(r,n);{const o=100,a=[];r=this.client.is_admin&&null==t?`\n        query($offset:Int!, $limit:Int!, $is_active: Boolean) {\n          keypair_list(offset:$offset, limit:$limit, is_active: $is_active) {\n            items { ${e.join(" ")} }\n            total_count\n          }\n        }\n      `:`\n        query($offset:Int!, $limit:Int!, $email: String!, $is_active: Boolean) {\n          keypair_list(offset:$offset, limit:$limit, email: $email, is_active: $is_active) {\n            items { ${e.join(" ")} }\n            total_count\n          }\n        }\n      `;for(let e=0;e<10*o;e+=o){n={offset:e,limit:o,email:t||this.client.email,is_active:i};const s=await this.client.query(r,n);if(a.push(...s.keypair_list.items),e>=s.keypair_list.total_count)break}const s={keypairs:a};return Promise.resolve(s)}}async add(t=null,e=!0,i=!1,r="default",n=1e3){let o=`mutation($user_id: String!, $input: KeyPairInput!) {  create_keypair(user_id: $user_id, props: $input) {    ok msg keypair { ${["is_active","is_admin","resource_policy","concurrency_limit","rate_limit"].join(" ")} }  }}`,a={user_id:t,input:{is_active:e,is_admin:i,resource_policy:r,rate_limit:n}};return this.client.query(o,a)}async mutate(t,e){let i={access_key:t,input:e};return this.client.query("mutation($access_key: String!, $input: ModifyKeyPairInput!) {  modify_keypair(access_key: $access_key, props: $input) {    ok msg  }}",i)}async delete(t){let e={access_key:t};return this.client.query("mutation($access_key: String!) {  delete_keypair(access_key: $access_key) {    ok msg  }}",e)}}class d{constructor(t){this.client=t}async get(t=null,e=["name","created_at","default_for_unspecified","total_resource_slots","max_concurrent_sessions","max_containers_per_session","max_vfolder_count","max_vfolder_size","allowed_vfolder_hosts","idle_timeout"]){let i,r;return this.client.supports("session-lifetime")&&e.push("max_session_lifetime"),null===t?(i=`query {  keypair_resource_policies { ${e.join(" ")} }}`,r={n:t}):(i=`query($n:String!) {  keypair_resource_policy(name: $n) { ${e.join(" ")} }}`,r={n:t}),this.client.query(i,r)}async add(t=null,e){let i=["name","created_at","default_for_unspecified","total_resource_slots","max_concurrent_sessions","max_containers_per_session","max_vfolder_count","max_vfolder_size","allowed_vfolder_hosts","idle_timeout"];if(this.client.supports("session-lifetime")&&i.push("max_session_lifetime"),!0===this.client.is_admin&&null!==t){let r=`mutation($name: String!, $input: CreateKeyPairResourcePolicyInput!) {  create_keypair_resource_policy(name: $name, props: $input) {    ok msg resource_policy { ${i.join(" ")} }  }}`,n={name:t,input:e};return this.client.query(r,n)}return Promise.resolve(!1)}async mutate(t=null,e){if(!0===this.client.is_admin&&null!==t){let i="mutation($name: String!, $input: ModifyKeyPairResourcePolicyInput!) {  modify_keypair_resource_policy(name: $name, props: $input) {    ok msg   }}",r={name:t,input:e};return this.client.query(i,r)}return Promise.resolve(!1)}async delete(t=null){if(!0===this.client.is_superadmin&&null!==t){let e="mutation($name: String!) { delete_keypair_resource_policy(name: $name) {   ok msg  }}",i={name:t};return this.client.query(e,i)}return Promise.resolve(!1)}}class c{constructor(t){this.client=t}async list(t=["name","tag","registry","digest","installed","labels { key value }","resource_limits { key min max }"],e=!1,i=!1){let r,n;return this.client.supports("system-images")?!0===e?(r=`query($installed:Boolean) {  images(is_installed:$installed) { ${t.join(" ")} }}`,n={installed:e,is_operation:i}):(r=`query {  images { ${t.join(" ")} }}`,n={is_operation:i}):(r=`query {  images { ${t.join(" ")} }}`,n={}),this.client.query(r,n)}async modifyResource(t,e,i,r){let n=[];return t=t.replace(":","%3A"),e=e.replace("/","%2F"),Object.keys(r).forEach((o=>{Object.keys(r[o]).forEach((a=>{const s=this.client.newSignedRequest("POST","/config/set",{key:`images/${t}/${e}/${i}/resource/${o}/${a}`,value:r[o][a]});n.push(this.client._wrapWithPromise(s))}))})),Promise.all(n)}async modifyLabel(t,e,i,r,n){t=t.replace(":","%3A"),e=e.replace("/","%2F"),i=i.replace("/","%2F");const o=this.client.newSignedRequest("POST","/config/set",{key:`images/${t}/${e}/${i}/labels/${r}`,value:n});return this.client._wrapWithPromise(o)}async install(t,e,i={},r="index.docker.io"){"index.docker.io"!=r?r+="/":r="",r=r.replace(":","%3A");let n=this.client.generateSessionId();return 0===Object.keys(i).length&&(i={cpu:"1",mem:"512m"}),this.client.createIfNotExists(r+t,n,i,6e5,e).then((t=>this.client.destroy(n))).catch((t=>{throw t}))}async uninstall(t,e="index.docker.io"){return Promise.resolve(!1)}async get(t,e,i){t=t.replace(":","%3A");const r=this.client.newSignedRequest("POST","/config/get",{key:`images/${t}/${e}/${i}/resource/`,prefix:!0});return this.client._wrapWithPromise(r)}}class h{constructor(t){this.client=t}async total_count(t="RUNNING",e="",i=1,r=0,n=""){let o;return o={limit:i,offset:r,status:t},""!=e&&(o.ak=e),""!=n&&(o.group_id=n),this.client.query("query($limit:Int!, $offset:Int!, $ak:String, $group_id:String, $status:String) {\n      compute_session_list(limit:$limit, offset:$offset, access_key:$ak, group_id:$group_id, status:$status) {\n        total_count\n      }\n    }",o)}async list(t=["id","name","image","created_at","terminated_at","status","status_info","occupied_slots","containers {live_stat last_stat}","starts_at"],e="RUNNING",i="",r=30,n=0,o="",a=0){let s,l;return s=`query($limit:Int!, $offset:Int!, $ak:String, $group_id:String, $status:String) {\n      compute_session_list(limit:$limit, offset:$offset, access_key:$ak, group_id:$group_id, status:$status) {\n        items { ${(t=this.client._updateFieldCompatibilityByAPIVersion(t)).join(" ")}}\n        total_count\n      }\n    }`,l={limit:r,offset:n,status:e},""!=i&&(l.ak=i),""!=o&&(l.group_id=o),this.client.query(s,l,null,a)}async listAll(t=["id","name","image","created_at","terminated_at","status","status_info","occupied_slots","containers {live_stat last_stat}"],e="RUNNING,RESTARTING,TERMINATING,PENDING,SCHEDULED,PREPARING,PULLING,TERMINATED,CANCELLED,ERROR",i="",r=100,n=0,o="",a=0){let s,l;t=this.client._updateFieldCompatibilityByAPIVersion(t),this.client.supports("avoid-hol-blocking")||(e.replace("SCHEDULED,",""),e.replace("SCHEDULED",""));const d=[];s=`query($limit:Int!, $offset:Int!, $ak:String, $group_id:String, $status:String) {\n      compute_session_list(limit:$limit, offset:$offset, access_key:$ak, group_id:$group_id, status:$status) {\n        items { ${t.join(" ")}}\n        total_count\n      }\n    }`;for(let t=0;t<10*r;t+=r){l={limit:r,offset:t,status:e},""!=i&&(l.access_key=i),""!=o&&(l.group_id=o);const n=await this.client.query(s,l,null,a);if(console.log(n.compute_session_list.total_count),d.push(...n.compute_session_list.items),t>=n.compute_session_list.total_count)break}return Promise.resolve(d)}async get(t=["id","session_name","lang","created_at","terminated_at","status","status_info","occupied_slots","cpu_used","io_read_bytes","io_write_bytes","scaling_group"],e=""){let i,r;return i=`query($session_uuid: UUID!) {\n      compute_session(id:$session_uuid) {\n        ${(t=this.client._updateFieldCompatibilityByAPIVersion(t)).join(" ")}\n      }\n    }`,r={session_uuid:e},this.client.query(i,r)}async startService(t,e,i=null,r=null,n=null){let o=this.client.newSignedRequest("POST",`/session/${t}/start-service`,{app:e,port:i||void 0,envs:r||void 0,arguments:JSON.stringify(n)||void 0});return this.client._wrapWithPromise(o)}}class u{constructor(t){this.client=t,this.urlPrefix="/template/session"}async list(t=!1,e=null){let i=this.urlPrefix;if(t){i+="?"+vc({all:t})}if(e){i+="?"+vc({group_id:e})}let r=this.client.newSignedRequest("GET",i,null);return this.client._wrapWithPromise(r)}}class p{constructor(t){this.client=t,this.resources={},this._init_resource_values()}_init_resource_values(){this.resources.cpu={},this.resources.cpu.total=0,this.resources.cpu.used=0,this.resources.cpu.percent=0,this.resources.mem={},this.resources.mem.total=0,this.resources.mem.allocated=0,this.resources.mem.used=0,this.resources.gpu={},this.resources.gpu.total=0,this.resources.gpu.used=0,this.resources["cuda.device"]={},this.resources["cuda.device"].total=0,this.resources["cuda.device"].used=0,this.resources.fgpu={},this.resources.fgpu.total=0,this.resources.fgpu.used=0,this.resources["cuda.shares"]={},this.resources["cuda.shares"].total=0,this.resources["cuda.shares"].used=0,this.resources["rocm.device"]={},this.resources["rocm.device"].total=0,this.resources["rocm.device"].used=0,this.resources["tpu.device"]={},this.resources["tpu.device"].total=0,this.resources["tpu.device"].used=0,this.resources.agents={},this.resources.agents.total=0,this.resources.agents.using=0,this.agents=[]}async totalResourceInformation(t="ALIVE"){if(this.client.is_admin){let e=["id","addr","status","first_contact","cpu_cur_pct","mem_cur_bytes","occupied_slots","available_slots"];return this.client.agent.list(t,e).then((t=>(this._init_resource_values(),this.agents=t.agents,Object.keys(this.agents).map(((t,e)=>{let i=this.agents[t],r=JSON.parse(i.occupied_slots),n=JSON.parse(i.available_slots);"cpu"in n&&(this.resources.cpu.total=this.resources.cpu.total+Math.floor(Number(n.cpu))),"cpu"in r&&(this.resources.cpu.used=this.resources.cpu.used+Math.floor(Number(r.cpu))),this.resources.cpu.percent=this.resources.cpu.percent+parseFloat(i.cpu_cur_pct),void 0===r.mem&&(r.mem=0),this.resources.mem.total=parseFloat(this.resources.mem.total)+parseInt(this.client.utils.changeBinaryUnit(n.mem,"b")),this.resources.mem.allocated=parseInt(this.resources.mem.allocated)+parseInt(this.client.utils.changeBinaryUnit(r.mem,"b")),this.resources.mem.used=parseInt(this.resources.mem.used)+parseInt(this.client.utils.changeBinaryUnit(i.mem_cur_bytes,"b")),"cuda.device"in n&&(this.resources["cuda.device"].total=parseInt(this.resources["cuda.device"].total)+Math.floor(Number(n["cuda.device"]))),"cuda.device"in r&&(this.resources["cuda.device"].used=parseInt(this.resources["cuda.device"].used)+Math.floor(Number(r["cuda.device"]))),"cuda.shares"in n&&(this.resources["cuda.shares"].total=parseFloat(this.resources["cuda.shares"].total)+parseFloat(n["cuda.shares"])),"cuda.shares"in r&&(this.resources["cuda.shares"].used=parseFloat(this.resources["cuda.shares"].used)+parseFloat(r["cuda.shares"])),"rocm.device"in n&&(this.resources["rocm.device"].total=parseInt(this.resources["rocm.device"].total)+Math.floor(Number(n["rocm.device"]))),"rocm.device"in r&&(this.resources["rocm.device"].used=parseInt(this.resources["rocm.device"].used)+Math.floor(Number(r["rocm.device"]))),"tpu.device"in n&&(this.resources["tpu.device"].total=parseInt(this.resources["tpu.device"].total)+Math.floor(Number(n["tpu.device"]))),"tpu.device"in r&&(this.resources["tpu.device"].used=parseInt(this.resources["tpu.device"].used)+Math.floor(Number(r["tpu.device"]))),isNaN(this.resources.cpu.used)&&(this.resources.cpu.used=0),isNaN(this.resources.mem.used)&&(this.resources.mem.used=0),isNaN(this.resources.gpu.used)&&(this.resources.gpu.used=0),isNaN(this.resources.fgpu.used)&&(this.resources.fgpu.used=0)})),this.resources.gpu.total=this.resources["cuda.device"].total,this.resources.gpu.used=this.resources["cuda.device"].used,this.resources.fgpu.used=this.resources["cuda.shares"].used.toFixed(2),this.resources.fgpu.total=this.resources["cuda.shares"].total.toFixed(2),this.resources.agents.total=Object.keys(this.agents).length,this.resources.agents.using=Object.keys(this.agents).length,Promise.resolve(this.resources)))).catch((t=>{throw t}))}return Promise.resolve(!1)}async user_stats(){const t=this.client.newSignedRequest("GET","/resource/stats/user/month",null);return this.client._wrapWithPromise(t)}}class f{constructor(t){this.client=t}async list(t=!0,e=!1,i=["id","name","description","is_active","created_at","modified_at","domain_name"]){let r,n;return!0===this.client.is_admin?(r=`query($is_active:Boolean) {  groups(is_active:$is_active) { ${i.join(" ")} }}`,n={is_active:t},!1!==e&&(r=`query($domain_name: String, $is_active:Boolean) {  groups(domain_name: $domain_name, is_active:$is_active) { ${i.join(" ")} }}`,n={is_active:t,domain_name:e})):(r=`query($is_active:Boolean) {  groups(is_active:$is_active) { ${i.join(" ")} }}`,n={is_active:t}),this.client.query(r,n)}}class m{constructor(t){this.client=t}async get(t=!1,e=["name","description","is_active","created_at","modified_at","total_resource_slots","allowed_vfolder_hosts","allowed_docker_registries","integration_id","scaling_groups"]){let i,r;if(!1!==t)return i=`query($name: String) {  domain(name: $name) { ${e.join(" ")} }}`,r={name:t},this.client.query(i,r)}async list(t=["name","description","is_active","created_at","total_resource_slots","allowed_vfolder_hosts","allowed_docker_registries","integration_id"]){let e=`query { domains { ${t.join(" ")} }}`;return this.client.query(e,{})}async update(t=!1,e){if(!0===this.client.is_superadmin){let i="mutation($name: String!, $input: ModifyDomainInput!) {  modify_domain(name: $name, props: $input) {    ok msg  }}",r={name:t,input:e};return this.client.query(i,r)}return Promise.resolve(!1)}}class g{constructor(t){this.client=t,this.urlPrefix="/resource"}attach_background_task(t){var e="/events/background-task?task_id="+t;let i=this.client.newSignedRequest("GET",e,null);return new EventSource(i.uri,{withCredentials:!0})}async rescan_images(t=""){if(!0===this.client.is_admin){let e,i;return""!==t?(t=decodeURIComponent(t),e="mutation($registry: String) {  rescan_images(registry: $registry) {    ok msg task_id   }}",i={registry:t}):(e="mutation {  rescan_images {    ok msg task_id   }}",i={}),this.client.query(e,i,null,6e5)}return Promise.resolve(!1)}async recalculate_usage(){if(!0===this.client.is_superadmin){let t=this.client.newSignedRequest("POST",this.urlPrefix+"/recalculate-usage",null);return this.client._wrapWithPromise(t,null,null,6e4)}}}class b{constructor(t){this.client=t}async list(t=!0,e=["username","password","need_password_change","full_name","description","is_active","domain_name","role","groups {id name}","status"]){let i,r;if(this.client._apiVersionMajor<5)return i=this.client.is_admin?`\n        query($is_active:Boolean) {\n          users(is_active:$is_active) { ${e.join(" ")} }\n        }\n      `:`\n        query {\n          users { ${e.join(" ")} }\n        }\n      `,r=this.client.is_admin?{is_active:t}:{},this.client.query(i,r);{const n=100,o=[];i=this.client.is_admin?`\n        query($offset:Int!, $limit:Int!, $is_active:Boolean) {\n          user_list(offset:$offset, limit:$limit, is_active:$is_active) {\n            items { ${e.join(" ")} }\n            total_count\n          }\n        }\n      `:`\n        query($offset:Int!, $limit:Int!) {\n          user_list(offset:$offset, limit:$limit) {\n            items { ${e.join(" ")} }\n            total_count\n          }\n        }\n      `;for(let e=0;e<10*n;e+=n){r=this.client.is_admin?{offset:e,limit:n,is_active:t}:{offset:e,limit:n};const a=await this.client.query(i,r);if(o.push(...a.user_list.items),e>=a.user_list.total_count)break}const a={users:o};return Promise.resolve(a)}}async get(t,e=["email","username","password","need_password_change","full_name","description","is_active","domain_name","role","groups {id name}"]){let i,r;return!0===this.client.is_admin?(i=`query($email:String) {  user (email:$email) { ${e.join(" ")} }}`,r={email:t}):(i=`query {  user { ${e.join(" ")} }}`,r={}),this.client.query(i,r)}async create(t=null,e){if(!0===this.client.is_admin){let i="mutation($email: String!, $input: UserInput!) {  create_user(email: $email, props: $input) {    ok msg  }}",r={email:t,input:e};return this.client.query(i,r)}return Promise.resolve(!1)}async update(t=null,e){if(!0===this.client.is_superadmin){let i="mutation($email: String!, $input: ModifyUserInput!) {  modify_user(email: $email, props: $input) {    ok msg  }}",r={email:t,input:e};return this.client.query(i,r)}return Promise.resolve(!1)}async delete(t){if(!0===this.client.is_superadmin){let e="mutation($email: String!) {  delete_user(email: $email) {    ok msg  }}",i={email:t};return this.client.query(e,i)}return Promise.resolve(!1)}}class v{constructor(t){this.client=t}async list_available(){if(!0===this.client.is_superadmin){const t=["name","description","is_active","created_at","driver","driver_opts","scheduler","scheduler_opts"];this.client.isManagerVersionCompatibleWith("21.09.0")&&t.push("wsproxy_addr");const e=`query {  scaling_groups { ${t.join(" ")} }}`,i={};return this.client.query(e,i)}return Promise.resolve(!1)}async list(t="default"){const e="/scaling-groups?group="+t,i=this.client.newSignedRequest("GET",e,null);return this.client._wrapWithPromise(i)}async getWsproxyVersion(t,e){if(!this.client.isManagerVersionCompatibleWith("21.09.0"))return Promise.resolve({wsproxy_version:"v1"});const i=`/scaling-groups/${t}/wsproxy-version?group=${e}`,r=this.client.newSignedRequest("GET",i,null);return this.client._wrapWithPromise(r)}async create(t,e){let i={name:t,input:e};return this.client.query("mutation($name: String!, $input: CreateScalingGroupInput!) {  create_scaling_group(name: $name, props: $input) {    ok msg  }}",i)}async associate_domain(t,e){let i={domain:t,scaling_group:e};return this.client.query("mutation($domain: String!, $scaling_group: String!) {  associate_scaling_group_with_domain(domain: $domain, scaling_group: $scaling_group) {    ok msg  }}",i)}async update(t,e){if(!this.client.isManagerVersionCompatibleWith("21.09.0")&&(delete e.wsproxy_addr,Object.keys(e).length<1))return Promise.resolve({modify_scaling_group:{ok:!0}});let i={name:t,input:e};return this.client.query("mutation($name: String!, $input: ModifyScalingGroupInput!) {  modify_scaling_group(name: $name, props: $input) {    ok msg  }}",i)}async delete(t){let e={name:t};return this.client.query("mutation($name: String!) {  delete_scaling_group(name: $name) {    ok msg  }}",e)}}class y{constructor(t){this.client=t}async list(){const t=this.client.newSignedRequest("POST","/config/get",{key:"config/docker/registry",prefix:!0});return this.client._wrapWithPromise(t)}async set(t,e){let i="config/docker/registry/"+(t=encodeURIComponent(t));const r=this.client.newSignedRequest("POST","/config/set",{key:i,value:e});return this.client._wrapWithPromise(r)}async delete(t){t=encodeURIComponent(t);const e=this.client.newSignedRequest("POST","/config/delete",{key:"config/docker/registry/"+t,prefix:!0});return this.client._wrapWithPromise(e)}}class _{constructor(t){this.client=t,this.config=null}async list(t=""){t="config/"+t;const e=this.client.newSignedRequest("POST","/config/get",{key:t,prefix:!0});return this.client._wrapWithPromise(e)}async get(t){t="config/"+t;const e=this.client.newSignedRequest("POST","/config/get",{key:t,prefix:!1});return this.client._wrapWithPromise(e)}async set(t,e){t="config/"+t;const i=this.client.newSignedRequest("POST","/config/set",{key:t,value:e});return this.client._wrapWithPromise(i)}async delete(t,e=!1){t="config/"+t;const i=this.client.newSignedRequest("POST","/config/delete",{key:""+t,prefix:e});return this.client._wrapWithPromise(i)}}class w{constructor(t){this.client=t,this.config=null}async get_announcement(){const t=this.client.newSignedRequest("GET","/manager/announcement",null);return this.client._wrapWithPromise(t)}async update_announcement(t=!0,e){const i=this.client.newSignedRequest("POST","/manager/announcement",{enabled:t,message:e});return this.client._wrapWithPromise(i)}}class x{constructor(t){this.client=t,this.config=null}async get_bootstrap_script(){if(!this.client._config.accessKey)throw"Your access key is not set";const t=this.client.newSignedRequest("GET","/user-config/bootstrap-script");return this.client._wrapWithPromise(t)}async update_bootstrap_script(t){const e=this.client.newSignedRequest("POST","/user-config/bootstrap-script",{script:t});return this.client._wrapWithPromise(e)}async create(t="",e){if(!this.client._config.accessKey)throw"Your access key is not set";let i={path:e,data:t,permission:"644"};const r=this.client.newSignedRequest("POST","/user-config/dotfiles",i);return this.client._wrapWithPromise(r)}async get(){if(!this.client._config.accessKey)throw"Your access key is not set";const t=this.client.newSignedRequest("GET","/user-config/dotfiles");return this.client._wrapWithPromise(t)}async update(t,e){let i={data:t,path:e,permission:"644"};const r=this.client.newSignedRequest("PATCH","/user-config/dotfiles",i);return this.client._wrapWithPromise(r)}async delete(t){let e={path:t};const i=this.client.newSignedRequest("DELETE","/user-config/dotfiles",e);return this.client._wrapWithPromise(i)}}class M{constructor(t){this.client=t,this.config=null}async getLicense(){if(!0!==this.client.is_superadmin)return Promise.resolve(!1);if(void 0===this.certificate){const t=this.client.newSignedRequest("GET","/license");let e=await this.client._wrapWithPromise(t);return this.certificate=e.certificate,"valid"===e.status?this.certificate.valid=!0:this.certificate.valid=!1,Promise.resolve(this.certificate)}}}class k{constructor(t){this.client=t,this.config=null}async ping(){const t=this.client.newSignedRequest("GET","/cloud/ping");return this.client._wrapWithPromise(t)}async verify_email(t){const e={verification_code:t},i=this.client.newSignedRequest("POST","/cloud/verify-email",e);return this.client._wrapWithPromise(i)}async send_verification_email(t){const e={email:t},i=this.client.newSignedRequest("POST","/cloud/send-verification-email",e);return this.client._wrapWithPromise(i)}async send_password_change_email(t){const e={email:t},i=this.client.newSignedRequest("POST","/cloud/send-password-change-email",e);return this.client._wrapWithPromise(i)}async change_password(t,e,i){const r={email:t,password:e,token:i},n=this.client.newSignedRequest("POST","/cloud/change-password",r);return this.client._wrapWithPromise(n)}}class S{constructor(t){this.client=t,this.config=null}async ping(){const t=this.client.newSignedRequest("GET","/eduapp/ping");return this.client._wrapWithPromise(t)}async get_mount_folders(){const t=this.client.newSignedRequest("GET","/eduapp/mounts");return this.client._wrapWithPromise(t)}}class E{constructor(t){this.client=t}changeBinaryUnit(t,e="g",i="b"){if(null==t)return t;let r;const n=["b","k","m","g","t","p","auto"],o=["B","KiB","MiB","GiB","TiB","PiB"];if(!n.includes(e))return!1;if((t=t.toString()).indexOf(" ")>=0){let e=t.split(/(\s+)/);t=o.includes(e[2])?e[0]+n[o.indexOf(e[2])]:e[0]}return n.includes(t.substr(-1))?(r=t.substr(-1),t=t.slice(0,-1)):r=i,t*Math.pow(1024,Math.floor(n.indexOf(r)-n.indexOf(e)))}elapsedTime(t,e){var i=new Date(t);if(null===e)var r=new Date;else r=new Date(e);var n=Math.floor((r.getTime()-i.getTime())/1e3),o=Math.floor(n/86400);n-=86400*o;var a=Math.floor(n/3600);n-=3600*a;var s=Math.floor(n/60),l=n-=60*s,d="";return void 0!==o&&o>0&&(d=d+String(o)+" Day "),void 0!==a&&(d=d+this._padding_zeros(a,2)+":"),void 0!==s&&(d=d+this._padding_zeros(s,2)+":"),d+this._padding_zeros(l,2)+""}_padding_zeros(t,e){return(t+="").length>=e?t:new Array(e-t.length+1).join("0")+t}clamp(t,e,i){return Math.max(e,Math.min(t,i))}gqlToObject(t,e){let i={};return t.forEach((function(t){i[t[e]]=t})),i}gqlToList(t,e){let i=[];return t.forEach((function(t){i.push(t[e])})),i}}Object.defineProperty(r,"ERR_SERVER",{value:0,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(r,"ERR_RESPONSE",{value:1,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(r,"ERR_REQUEST",{value:2,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(r,"ERR_ABORT",{value:3,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(r,"ERR_TIMEOUT",{value:4,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(r,"ERR_UNKNOWN",{value:99,writable:!1,enumerable:!0,configurable:!1});const A={Client:r,ClientConfig:i};yc.backend=A,yc.Client=r,yc.ClientConfig=i,yc.BackendAIClient=r,yc.BackendAIClientConfig=i}).call(this)}.call(this,D,w({}).Buffer),yc}));let ol=class extends js{constructor(){super(),this.company_name="",this.company_id="",this.user_name="",this.user_email="",this.errorMsg="",this.endpoint="",this.notification=Object(),this.signupPanel=Object(),this.blockPanel=Object(),this.TOSlanguage="en",this.TOSdialog=Object()}static get styles(){return[Je,Ls,$s,Ns,Bs,at`
          fieldset input {
              width: 100%;
              border: 0;
              border-bottom: 1px solid #aaa;
              margin: 15px 0;
            font: inherit;
            font-size: 16px;
            outline: none;
          }

          fieldset input:focus {
            border-bottom: 1.5px solid #0d47a1;
          }

          #signup-panel {
            --dialog-width: 400px;
            --dialog-elevation: 0px 0px 5px 5px rgba(0, 0, 0, 0.1);
          }

          mwc-textfield {
            width: 100%;
            --mdc-text-field-fill-color: transparent;
            --mdc-theme-primary: var(--general-textfield-selected-color);
            --mdc-typography-font-family: var(--general-font-family);
          }

          mwc-textfield#id_user_name {
            margin-bottom: 18px;
          }

          mwc-button.full {
            width: 70%;
          }

          mwc-button {
            background-image: none;
            --mdc-theme-primary: var(--general-button-background-color);
            --mdc-on-theme-primary: var(--general-button-background-color);
          }

          mwc-button[unelevated] {
            background-image: none;
            --mdc-theme-primary: var(--general-button-background-color);
          }

          mwc-button[outlined] {
            background-image: none;
            --mdc-button-outline-width: 2px;
            --mdc-button-disabled-outline-color: var(--general-button-background-color);
            --mdc-button-disabled-ink-color: var(--general-button-background-color);
            --mdc-theme-primary: var(--general-button-background-color);
            --mdc-on-theme-primary: var(--general-button-background-color);
          }

          mwc-checkbox {
            --mdc-theme-secondary: var(--general-checkbox-color);
          }
      `]}firstUpdated(){this.signupPanel=this.shadowRoot.querySelector("#signup-panel"),this.blockPanel=this.shadowRoot.querySelector("#block-panel"),this.notification=globalThis.lablupNotification,this.TOSdialog=this.shadowRoot.querySelector("#terms-of-service");const t=this.shadowRoot.querySelectorAll("mwc-textfield");for(const e of t)this._addInputValidator(e)}async _viewStateChanged(t){await this.updateComplete,!1!==t&&(void 0!==globalThis.backendaiclient&&null!==globalThis.backendaiclient&&!1!==globalThis.backendaiclient.ready||document.addEventListener("backend-ai-connected",(()=>!0),!0))}receiveTOSAgreement(){!1===this.TOSdialog.show&&(this.TOSdialog.tosContent="",this.TOSdialog.tosLanguage=globalThis.backendaioptions.get("language"),this.TOSdialog.title=ie("webui.menu.TermsOfService"),this.TOSdialog.tosEntry="terms-of-service",this.TOSdialog.open())}receivePPAgreement(){!1===this.TOSdialog.show&&(this.TOSdialog.tosContent="",this.TOSdialog.tosLanguage=globalThis.backendaioptions.get("language"),this.TOSdialog.title=ie("webui.menu.PrivacyPolicy"),this.TOSdialog.tosEntry="privacy-policy",this.TOSdialog.open())}open(){!0!==this.signupPanel.open&&(this._clearUserInput(),this.signupPanel.show())}close(){!0===this.signupPanel.open&&this.signupPanel.hide()}init_client(){if(void 0===this.client&&""!==this.endpoint&&this.client!=={}){const t={connectionMode:"SESSION",apiVersionMajor:"v4",apiVersion:"v4.20190615",_apiVersion:"v4.20190615",endpoint:this.endpoint};this.client=new ai.backend.Client(t,"Backend.AI Console.")}}block(t=""){this.errorMsg=t,this.blockPanel.show()}_validate_data(t){return null!=t&&null!=t&&""!=t}_clear_info(){this.company_name="",this.user_name=""}_clearUserInput(){this._toggleInputField(!0);let t=["#id_user_email","#id_token","#id_password1","#id_password2"];this.allowSignupWithoutConfirmation&&(t=t.filter((t=>"#id_token"!==t))),t.forEach((t=>{this.shadowRoot.querySelector(t).value=""})),this.shadowRoot.querySelector("#signup-button-message").innerHTML=Dt("signup.Signup")}_toggleInputField(t){let e=["#id_user_name","#id_token","#signup-button"];this.allowSignupWithoutConfirmation&&(e=e.filter((t=>"#id_token"!==t))),e.forEach((e=>{t?this.shadowRoot.querySelector(e).removeAttribute("disabled"):this.shadowRoot.querySelector(e).removeAttribute("disabled","true")}))}_signup(){var t;let e=["#id_user_email","#id_token","#id_password1","#id_password2"];this.allowSignupWithoutConfirmation&&(e=e.filter((t=>"#id_token"!==t)));const i=e.map((t=>(this.shadowRoot.querySelector(t).reportValidity(),this.shadowRoot.querySelector(t).checkValidity())));if(!1===this.shadowRoot.querySelector("#approve-terms-of-service").checked)return this.notification.text=Dt("signup.RequestAgreementTermsOfService"),void this.notification.show();if(i.includes(!1))return;const r=null===(t=this.shadowRoot.querySelector("#id_token"))||void 0===t?void 0:t.value,n=this.shadowRoot.querySelector("#id_user_email").value,o=this.shadowRoot.querySelector("#id_user_name").value,a=this.shadowRoot.querySelector("#id_password1").value;this.notification.text=Dt("signup.Processing"),this.notification.show();const s={email:n,user_name:o,password:a,token:r};this.allowSignupWithoutConfirmation&&delete s[r],this.init_client();const l=this.client.newSignedRequest("POST","/auth/signup",s);this.client._wrapWithPromise(l).then((t=>{this._toggleInputField(!1),this.shadowRoot.querySelector("#signup-button-message").innerHTML=Dt("signup.SignupSucceeded"),this.notification.text=Dt("signup.SignupSucceeded"),this.notification.show(),setTimeout((()=>{this.signupPanel.hide(),this._clearUserInput(),this.allowSignupWithoutConfirmation||this.shadowRoot.querySelector("#email-sent-dialog").show()}),1e3)})).catch((t=>{t.message&&(this.notification.text=rl.relieve(t.message),this.notification.show(!0,t)),console.log(t)}))}_politeErrorMessage(t){const e={"Cannot read property 'map' of null":"User has no group. Please contact administrator to fix it.","Cannot read property 'split' of undefined":"Wrong API server address."};return console.log(t),t in e?e[t]:t}_togglePasswordVisibility(t){const e=t.__on,i=t.closest("div").querySelector("mwc-textfield");e?i.setAttribute("type","text"):i.setAttribute("type","password")}_validateEmail(){const t=this.shadowRoot.querySelector("#id_user_email");t.validityTransform=(e,i)=>{if(i.valid){const e=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.exec(t.value);return e||(t.validationMessage=Dt("signup.InvalidEmail")),{valid:e,customError:!e}}return i.valueMissing?(t.validationMessage=Dt("signup.EmailInputRequired"),{valid:i.valid,customError:!i.valid}):(t.validationMessage=Dt("signup.InvalidEmail"),{valid:i.valid,customError:!i.valid})}}_validatePassword1(){const t=this.shadowRoot.querySelector("#id_password1");this.shadowRoot.querySelector("#id_password2").reportValidity(),t.validityTransform=(e,i)=>i.valid?{valid:i.valid,customError:!i.valid}:i.valueMissing?(t.validationMessage=Dt("signup.PasswordInputRequired"),{valid:i.valid,customError:!i.valid}):(t.validationMessage=Dt("signup.PasswordInvalid"),{valid:i.valid,customError:!i.valid})}_validatePassword2(){const t=this.shadowRoot.querySelector("#id_password2");t.validityTransform=(e,i)=>{if(i.valid){const e=this.shadowRoot.querySelector("#id_password1").value===t.value;return e||(t.validationMessage=Dt("signup.PasswordNotMatched")),{valid:e,customError:!e}}return i.valueMissing?(t.validationMessage=Dt("signup.PasswordInputRequired"),{valid:i.valid,customError:!i.valid}):(t.validationMessage=Dt("signup.PasswordInvalid"),{valid:i.valid,customError:!i.valid})}}_validatePassword(){this._validatePassword1(),this._validatePassword2()}render(){return D`
      <backend-ai-dialog id="signup-panel" fixed blockscrolling persistent disablefocustrap>
        <span slot="title">${this.allowSignupWithoutConfirmation?D`
          ${ie("signup.Signup")}`:D`${ie("signup.SignupBETA")}
          `}
        </span>
        <div slot="content" class="vertical flex layout">
          <mwc-textfield type="email" name="user_email" id="id_user_email" autofocus
                       maxlength="64" placeholder="${Dt("maxLength.64chars")}"
                       label="${ie("signup.E-mail")}" validateOnInitialRender
                       @change="${this._validateEmail}"
                       validationMessage="${ie("signup.EmailInputRequired")}"
                       value="${this.user_email}" required></mwc-textfield>
          <mwc-textfield type="text" name="user_name" id="id_user_name"
                       maxlength="64" placeholder="${Dt("maxLength.64chars")}"
                       label="${ie("signup.UserName")}" value="${this.user_name}"></mwc-textfield>
          ${this.allowSignupWithoutConfirmation?D``:D`
            <mwc-textfield type="text" name="token" id="id_token"
                        maxlength="50"
                        label="${ie("signup.InvitationToken")}"
                        validationMessage="${ie("signup.TokenInputRequired")}" required></mwc-textfield>
          `}
          <div class="horizontal flex layout">
            <mwc-textfield type="password" name="password1" id="id_password1"
                        label="${ie("signup.Password")}" maxLength="64"
                        pattern="^(?=.*[A-Za-z])(?=.*\\d)(?=.*[@$!%*#?&])[A-Za-z\\d@$!%*#?&]{8,}$"
                        validationMessage="${ie("signup.PasswordInputRequired")}"
                        @change="${this._validatePassword}"
                        value="" required></mwc-textfield>
            <mwc-icon-button-toggle off onIcon="visibility" offIcon="visibility_off"
                                    @click="${t=>this._togglePasswordVisibility(t.target)}">
            </mwc-icon-button-toggle>
          </div>
          <div class="horizontal flex layout">
            <mwc-textfield type="password" name="password2" id="id_password2"
                        label="${ie("signup.PasswordAgain")}" maxLength="64"
                        pattern="^(?=.*[A-Za-z])(?=.*\\d)(?=.*[@$!%*#?&])[A-Za-z\\d@$!%*#?&]{8,}$"
                        validationMessage="${ie("signup.PasswordInputRequired")}"
                        @change="${this._validatePassword}"
                        value="" required></mwc-textfield>
            <mwc-icon-button-toggle off onIcon="visibility" offIcon="visibility_off"
                                    @click="${t=>this._togglePasswordVisibility(t.target)}">
            </mwc-icon-button-toggle>
          </div>
          <div style="margin-top:10px;" class="horizontal layout center center-justified">
            <mwc-checkbox id="approve-terms-of-service"></mwc-checkbox>
            <p style="font-size:12px;">
              ${Dt("signup.PolicyAgreement_1")}
              <a style="color:forestgreen;" @click="${()=>this.receiveTOSAgreement()}">
                ${ie("signup.TermsOfService")}
              </a>
              ${Dt("signup.PolicyAgreement_2")}
              <a style="color:forestgreen;" @click="${()=>this.receivePPAgreement()}">
                ${ie("signup.PrivacyPolicy")}
              </a>
              ${Dt("signup.PolicyAgreement_3")}
            </p>
          </div>
        </div>
        <div slot="footer" class="horizontal center-justified flex layout">
          <mwc-button
              id="signup-button"
              raised
              class="full"
              icon="check"
              @click="${()=>this._signup()}">
                <span id="signup-button-message">${Dt("signup.Signup")}</span>
          </mwc-button>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="block-panel" fixed type="error" backdrop blockscrolling persistent>
        <span slot="title">${ie("dialog.error.Error")}</span>
        <div slot="content" style="text-align:center;">
          ${this.errorMsg}
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="email-sent-dialog" noclosebutton fixed backdrop blockscrolling persistent>
        <span slot="title">${ie("signup.ThankYou")}</span>
        <div slot="content">
          <p style="max-width:350px">${ie("signup.VerificationMessage")}</p>
        </div>
        <div slot="footer" class="horizontal end-justified flex layout">
          <mwc-button
              unelevated
              label="${ie("button.Okay")}"
              @click="${t=>t.target.closest("backend-ai-dialog").hide()}"></mwc-button>
        </div>
      </backend-ai-dialog>
      <lablup-terms-of-service id="terms-of-service"></lablup-terms-of-service>
    `}};r([xt({type:String})],ol.prototype,"company_name",void 0),r([xt({type:String})],ol.prototype,"company_id",void 0),r([xt({type:String})],ol.prototype,"user_name",void 0),r([xt({type:String})],ol.prototype,"user_email",void 0),r([xt({type:String})],ol.prototype,"errorMsg",void 0),r([xt({type:String})],ol.prototype,"endpoint",void 0),r([xt({type:Object})],ol.prototype,"notification",void 0),r([xt({type:Object})],ol.prototype,"signupPanel",void 0),r([xt({type:Object})],ol.prototype,"blockPanel",void 0),r([xt({type:Object})],ol.prototype,"client",void 0),r([xt({type:String})],ol.prototype,"TOSlanguage",void 0),r([xt({type:Object})],ol.prototype,"TOSdialog",void 0),r([xt({type:Boolean})],ol.prototype,"allowSignupWithoutConfirmation",void 0),ol=r([_t("backend-ai-signup")],ol);
/**
 @license
 Copyright (c) 2015-2022 Lablup Inc. All rights reserved.
 */
let al=class extends js{constructor(){super(),this.api_key="",this.secret_key="",this.user_id="",this.password="",this.proxy_url="http://127.0.0.1:5050/",this.api_endpoint="",this.domain_name="",this.default_session_environment="",this.default_import_environment="",this.blockType="",this.blockMessage="",this.connection_mode="SESSION",this.login_attempt_limit=500,this.login_block_time=180,this.config=Object(),this.is_connected=!1,this.signup_support=!1,this.allowAnonymousChangePassword=!1,this.change_signin_support=!1,this.allow_signout=!1,this.allow_project_resource_monitor=!1,this.allow_manual_image_name_for_session=!1,this.allowSignupWithoutConfirmation=!1,this.openPortToPublic=!1,this.maxCPUCoresPerContainer=64,this.maxMemoryPerContainer=16,this.maxCUDADevicesPerContainer=16,this.maxCUDASharesPerContainer=16,this.maxShmPerContainer=2,this.maxFileUploadSize=-1,this.maskUserInfo=!1,globalThis.backendaiwebui={},this.endpoints=[]}static get styles(){return[Je,Ls,$s,Ns,Bs,at`
        .warning {
          color: red;
        }

        backend-ai-dialog {
          --component-width: 400px;
          --component-padding: 0;
        }

        fieldset input {
          width: 100%;
          border: 0;
          margin: 15px 0 0 0;
          font: inherit;
          font-size: 16px;
          outline: none;
        }

        mwc-textfield {
          font-family: var(--general-font-family);
          --mdc-theme-primary: black;
          --mdc-text-field-fill-color: rgb(250, 250, 250);
          width: 100%;
        }

        .endpoint-text {
          --mdc-text-field-disabled-line-color: rgba(0, 0, 0, 0.0);
        }

        mwc-icon-button {
          /*color: rgba(0, 0, 0, 0.54); Matched color with above icons*/
          color: var(--paper-blue-600);
          --mdc-icon-size: 24px;
        }

        mwc-icon-button.endpoint-control-button {
          --mdc-icon-size: 16px;
          --mdc-icon-button-size: 24px;
          color: red;
        }

        mwc-menu {
          font-family: var(--general-font-family);
          --mdc-menu-min-width: 400px;
          --mdc-menu-max-width: 400px;
        }

        mwc-list-item[disabled] {
          --mdc-menu-item-height: 30px;
          border-bottom: 1px solid #ccc;
        }

        mwc-button {
          background-image: none;
          --mdc-theme-primary: var(--general-button-background-color);
          --mdc-on-theme-primary: var(--general-button-background-color);
        }

        mwc-button[unelevated] {
          background-image: none;
          --mdc-theme-primary: var(--general-button-background-color);
        }

        mwc-button[outlined] {
          background-image: none;
          --mdc-button-outline-width: 2px;
          --mdc-button-disabled-outline-color: var(--general-button-background-color);
          --mdc-button-disabled-ink-color: var(--general-button-background-color);
          --mdc-theme-primary: var(--general-button-background-color);
          --mdc-on-theme-primary: var(--general-button-background-color);
        }

        h3 small {
          --button-font-size: 12px;
        }

        wl-icon {
          --icon-size: 16px;
          padding: 0;
        }

        .login-input {
          background-color: #FAFAFA;
          border-bottom: 1px solid #ccc;
          height: 50px;
        }

        .login-input mwc-icon {
          margin: 5px 15px 5px 15px;
          color: #737373;
        }

        .login-input input {
          width: 100%;
          background-color: #FAFAFA;
          margin-bottom: 5px;
          font-size: 18px;
          margin-top: 5px;
        }

        #login-title-area {
          height: var(--login-banner-height, 0);
          width: var(--login-banner-width, 0);
          background: var(--login-banner-background, none);
        }

        .login-form {
          position: relative;
        }

        .waiting-animation {
          top: 20%;
          left: 40%;
          position: absolute;
          z-index: 2;
        }

        .sk-folding-cube {
          margin: 20px auto;
          width: 15px;
          height: 15px;
          position: relative;
          margin: auto;
          -webkit-transform: rotateZ(45deg);
          transform: rotateZ(45deg);
        }

        .sk-folding-cube .sk-cube {
          float: left;
          width: 50%;
          height: 50%;
          position: relative;
          -webkit-transform: scale(1.1);
          -ms-transform: scale(1.1);
          transform: scale(1.1);
        }

        .sk-folding-cube .sk-cube:before {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          background-color: #3e872d;
          -webkit-animation: sk-foldCubeAngle 2.4s infinite linear both;
          animation: sk-foldCubeAngle 2.4s infinite linear both;
          -webkit-transform-origin: 100% 100%;
          -ms-transform-origin: 100% 100%;
          transform-origin: 100% 100%;
        }

        .sk-folding-cube .sk-cube2 {
          -webkit-transform: scale(1.1) rotateZ(90deg);
          transform: scale(1.1) rotateZ(90deg);
        }

        .sk-folding-cube .sk-cube3 {
          -webkit-transform: scale(1.1) rotateZ(180deg);
          transform: scale(1.1) rotateZ(180deg);
        }

        .sk-folding-cube .sk-cube4 {
          -webkit-transform: scale(1.1) rotateZ(270deg);
          transform: scale(1.1) rotateZ(270deg);
        }

        .sk-folding-cube .sk-cube2:before {
          -webkit-animation-delay: 0.3s;
          animation-delay: 0.3s;
        }

        .sk-folding-cube .sk-cube3:before {
          -webkit-animation-delay: 0.6s;
          animation-delay: 0.6s;
        }

        .sk-folding-cube .sk-cube4:before {
          -webkit-animation-delay: 0.9s;
          animation-delay: 0.9s;
        }

        @-webkit-keyframes sk-foldCubeAngle {
          0%,
          10% {
            -webkit-transform: perspective(140px) rotateX(-180deg);
            transform: perspective(140px) rotateX(-180deg);
            opacity: 0;
          }
          25%,
          75% {
            -webkit-transform: perspective(140px) rotateX(0deg);
            transform: perspective(140px) rotateX(0deg);
            opacity: 1;
          }
          90%,
          100% {
            -webkit-transform: perspective(140px) rotateY(180deg);
            transform: perspective(140px) rotateY(180deg);
            opacity: 0;
          }
        }

        @keyframes sk-foldCubeAngle {
          0%,
          10% {
            -webkit-transform: perspective(140px) rotateX(-180deg);
            transform: perspective(140px) rotateX(-180deg);
            opacity: 0;
          }
          25%,
          75% {
            -webkit-transform: perspective(140px) rotateX(0deg);
            transform: perspective(140px) rotateX(0deg);
            opacity: 1;
          }
          90%,
          100% {
            -webkit-transform: perspective(140px) rotateY(180deg);
            transform: perspective(140px) rotateY(180deg);
            opacity: 0;
          }
        }

        #loading-message {
          margin-left: 10px;
        }

      `]}firstUpdated(){this.loginPanel=this.shadowRoot.querySelector("#login-panel"),this.signoutPanel=this.shadowRoot.querySelector("#signout-panel"),this.blockPanel=this.shadowRoot.querySelector("#block-panel"),this.notification=globalThis.lablupNotification,this.endpoints=globalThis.backendaioptions.get("endpoints",[])}_changeSigninMode(){!0===this.change_signin_support&&("SESSION"==this.connection_mode?(this.connection_mode="API",localStorage.setItem("backendaiwebui.connection_mode","API")):(this.connection_mode="SESSION",localStorage.setItem("backendaiwebui.connection_mode","SESSION")),this.requestUpdate())}refreshWithConfig(t){void 0===t.plugin||void 0===t.plugin.login||""===t.plugin.login?this._enableUserInput():import("../plugins/"+t.plugin.login).then((()=>{console.log("Plugin loaded.")})).catch((t=>{!0!==this.loginPanel.open?(void 0!==t.message?(this.notification.text=rl.relieve(t.title),this.notification.detail=t.message):this.notification.text=rl.relieve("Plugin loading failed."),this.notification.show(!1,t),this.open()):(this.notification.text=rl.relieve("Login failed. Check login information."),this.notification.show(!1,t))})),void 0===t.general||void 0===t.general.debug||""===t.general.debug?globalThis.backendaiwebui.debug=!1:!0===t.general.debug&&(globalThis.backendaiwebui.debug=!0,console.log("Debug flag is set to true")),void 0===t.general||void 0===t.general.signupSupport||""===t.general.signupSupport||0==t.general.signupSupport?this.signup_support=!1:(this.signup_support=!0,this.shadowRoot.querySelector("#signup-dialog").active=!0),void 0===t.general||void 0===t.general.allowAnonymousChangePassword||""===t.general.allowAnonymousChangePassword||0==t.general.allowAnonymousChangePassword?this.allowAnonymousChangePassword=!1:this.allowAnonymousChangePassword=!0,void 0===t.general||void 0===t.general.allowChangeSigninMode||""===t.general.allowChangeSigninMode||0==t.general.allowChangeSigninMode?this.change_signin_support=!1:this.change_signin_support=!0,void 0===t.general||void 0===t.general.allowProjectResourceMonitor||""===t.general.allowProjectResourceMonitor||0==t.general.allowProjectResourceMonitor?this.allow_project_resource_monitor=!1:this.allow_project_resource_monitor=!0,void 0===t.general||void 0===t.general.allowManualImageNameForSession||""===t.general.allowManualImageNameForSession||0==t.general.allowManualImageNameForSession?this.allow_manual_image_name_for_session=!1:this.allow_manual_image_name_for_session=!0,void 0===t.resources||void 0===t.resources.openPortToPublic||""===t.resources.openPortToPublic||0==t.resources.openPortToPublic?this.openPortToPublic=!1:this.openPortToPublic=!0,void 0===t.resources||void 0===t.resources.maxCPUCoresPerContainer||isNaN(parseInt(t.resources.maxCPUCoresPerContainer))?this.maxCPUCoresPerContainer=64:this.maxCPUCoresPerContainer=parseInt(t.resources.maxCPUCoresPerContainer),void 0===t.resources||void 0===t.resources.maxMemoryPerContainer||isNaN(parseInt(t.resources.maxMemoryPerContainer))?this.maxMemoryPerContainer=16:this.maxMemoryPerContainer=parseInt(t.resources.maxMemoryPerContainer),void 0===t.resources||void 0===t.resources.maxCUDADevicesPerContainer||isNaN(parseInt(t.resources.maxCUDADevicesPerContainer))?this.maxCUDADevicesPerContainer=16:this.maxCUDADevicesPerContainer=parseInt(t.resources.maxCUDADevicesPerContainer),void 0===t.resources||void 0===t.resources.maxCUDASharesPerContainer||isNaN(parseInt(t.resources.maxCUDASharesPerContainer))?this.maxCUDASharesPerContainer=16:this.maxCUDASharesPerContainer=parseInt(t.resources.maxCUDASharesPerContainer),void 0===t.resources||void 0===t.resources.maxShmPerContainer||isNaN(parseFloat(t.resources.maxShmPerContainer))?this.maxShmPerContainer=2:this.maxShmPerContainer=parseFloat(t.resources.maxShmPerContainer),void 0===t.resources||void 0===t.resources.maxFileUploadSize||""===t.resources.maxFileUploadSize?this.maxFileUploadSize=-1:this.maxFileUploadSize=parseInt(t.resources.maxFileUploadSize),void 0===t.general||void 0===t.general.allowSignout||""===t.general.allowSignout||0==t.general.allowSignout?this.allow_signout=!1:this.allow_signout=!0,void 0===t.general||void 0===t.general.loginAttemptLimit||""===t.general.loginAttemptLimit||(this.login_attempt_limit=parseInt(t.general.loginAttemptLimit)),void 0===t.general||void 0===t.general.loginBlockTime||""===t.general.loginBlockTime||(this.login_block_time=parseInt(t.general.loginBlockTime)),void 0===t.wsproxy||void 0===t.wsproxy.proxyURL||""===t.wsproxy.proxyURL?this.proxy_url="http://127.0.0.1:5050/":this.proxy_url=t.wsproxy.proxyURL,void 0===t.general||void 0===t.general.apiEndpoint||""===t.general.apiEndpoint?(this.shadowRoot.querySelector("#id_api_endpoint_container").style.display="flex",this.shadowRoot.querySelector("#id_api_endpoint_humanized").style.display="none"):(this.api_endpoint=t.general.apiEndpoint,void 0===t.general||void 0===t.general.apiEndpointText||""===t.general.apiEndpointText?(this.shadowRoot.querySelector("#id_api_endpoint_container").style.display="flex",this.shadowRoot.querySelector("#id_api_endpoint_humanized").style.display="none",this.shadowRoot.querySelector("#endpoint-button").disabled="true"):(this.shadowRoot.querySelector("#id_api_endpoint_container").style.display="none",this.shadowRoot.querySelector("#id_api_endpoint_humanized").style.display="block",this.shadowRoot.querySelector("#id_api_endpoint_humanized").value=t.general.apiEndpointText),this.shadowRoot.querySelector("#id_api_endpoint").disabled=!0,this.shadowRoot.querySelector("#id_api_endpoint_humanized").disabled=!0),void 0===t.general||void 0===t.general.allowSignupWithoutConfirmation||""===t.general.allowSignupWithoutConfirmation||0==t.general.allowSignupWithoutConfirmation?this.allowSignupWithoutConfirmation=!1:this.allowSignupWithoutConfirmation=!0,void 0===t.general||void 0===t.general.defaultSessionEnvironment||""===t.general.defaultSessionEnvironment?this.default_session_environment="":this.default_session_environment=t.general.defaultSessionEnvironment,void 0===t.general||void 0===t.general.defaultImportEnvironment||""===t.general.defaultImportEnvironment?this.default_import_environment="index.docker.io/lablup/python:3.8-ubuntu18.04":this.default_import_environment=t.general.defaultImportEnvironment,void 0===t.environments||void 0===t.environments.allowlist||""===t.environments.allowlist?this.allow_image_list=[]:this.allow_image_list=t.environments.allowlist.split(","),void 0===t.general||void 0===t.general.maskUserInfo||""===t.general.maskUserInfo?this.maskUserInfo=!1:this.maskUserInfo=t.general.maskUserInfo;const e=localStorage.getItem("backendaiwebui.connection_mode");globalThis.isElectron&&null!==e&&""!=e&&'""'!=e?this.connection_mode="SESSION"===e?"SESSION":"API":void 0===t.general||void 0===t.general.connectionMode||""===t.general.connectionMode||"SESSION"===t.general.connectionMode.toUpperCase()?this.connection_mode="SESSION":this.connection_mode="API"}open(){!0!==this.loginPanel.open&&this.loginPanel.show(),!0===this.blockPanel.open&&this.blockPanel.hide()}close(){!0===this.loginPanel.open&&this.loginPanel.hide(),!0===this.blockPanel.open&&this.blockPanel.hide()}block(t="",e=""){this.blockMessage=t,this.blockType=e,setTimeout((()=>{!1===this.blockPanel.open&&!1===this.is_connected&&!1===this.loginPanel.open&&this.blockPanel.show()}),2e3)}free(){this.blockPanel.hide()}_trimChar(t,e){return t.replace(/^\|+|\|+$/g,"")}_loadConfigFromWebServer(){if(!window.location.href.startsWith(this.api_endpoint)){const t=document.querySelector("backend-ai-webui");if(t){const e=["general.apiEndpoint","general.apiEndpointText","general.siteDescription","wsproxy"],i=new URL("./config.toml",this.api_endpoint).href;t._parseConfig(i,!0).then((i=>{e.forEach((t=>{globalThis.backendaiutils.deleteNestedKeyFromObject(i,t)}));const r=globalThis.backendaiutils.mergeNestedObjects(t.config,i);t.config=r,this.refreshWithConfig(r)}))}}}login(t=!0){if(""===this.api_endpoint){const t=localStorage.getItem("backendaiwebui.api_endpoint");null!=t&&(this.api_endpoint=t.replace(/^"+|"+$/g,""))}this.api_endpoint=this.api_endpoint.trim(),"SESSION"===this.connection_mode?(globalThis.isElectron&&this._loadConfigFromWebServer(),this._connectUsingSession(t)):"API"===this.connection_mode?this._connectUsingAPI(t):this.open()}async check_login(t=!0){if(""===this.api_endpoint){const t=localStorage.getItem("backendaiwebui.api_endpoint");null!=t&&(this.api_endpoint=t.replace(/^"+|"+$/g,""))}return this.api_endpoint=this.api_endpoint.trim(),"SESSION"===this.connection_mode?(globalThis.isElectron&&this._loadConfigFromWebServer(),this._checkLoginUsingSession()):(this.connection_mode,Promise.resolve(!1))}async _checkLoginUsingSession(t=!0){return""===this.api_endpoint?Promise.resolve(!1):(this.clientConfig=new ai.backend.ClientConfig(this.user_id,this.password,this.api_endpoint,"SESSION"),this.client=new ai.backend.Client(this.clientConfig,"Backend.AI Console."),this.client.get_manager_version().then((async()=>{const t=await this.client.check_login();return Promise.resolve(t)})))}async _logoutSession(t=!0){return this.client.logout()}signout(){this.signoutPanel.show()}_showSignupDialog(){if(this.api_endpoint=this.api_endpoint.trim(),""===this.api_endpoint)return this.notification.text=Dt("error.APIEndpointIsEmpty"),void this.notification.show();const t=this.shadowRoot.querySelector("#signup-dialog");t.endpoint=this.api_endpoint,t.allowSignupWithoutConfirmation=this.allowSignupWithoutConfirmation,t.open()}_showChangePasswordEmailDialog(){this.shadowRoot.querySelector("#change-password-confirm-dialog").show()}async _sendChangePasswordEmail(){const t=this.shadowRoot.querySelector("#password-change-email");if(t.value&&t.validity.valid)try{const e=new ai.backend.ClientConfig("","",this.api_endpoint,"SESSION"),i=new ai.backend.Client(e,"Backend.AI Console.");await i.cloud.send_password_change_email(t.value),this.shadowRoot.querySelector("#change-password-confirm-dialog").hide(),this.notification.text=Dt("signup.EmailSent"),this.notification.show()}catch(t){console.error(t),this.notification.text=t.message||Dt("signup.SendError"),this.notification.show()}}_cancelLogin(t){this._hideDialog(t),this.open()}_validate_data(t){return null!=t&&null!=t&&""!=t}_submitIfEnter(t){13==t.keyCode&&this._login()}_signoutIfEnter(t){13==t.keyCode&&this._signout()}_signout(){const t=this.shadowRoot.querySelector("#id_signout_user_id").value,e=this.shadowRoot.querySelector("#id_signout_password").value;this.client.signout(t,e).then((t=>{this.notification.text=Dt("login.SignoutFinished"),this.notification.show();const e=new CustomEvent("backend-ai-logout",{detail:""});document.dispatchEvent(e)})).catch((t=>{this.free(),!0!==this.signoutPanel.open?(console.log(t),void 0!==t.message?(this.notification.text=rl.relieve(t.title),this.notification.detail=t.message):this.notification.text=rl.relieve("Login information mismatch. Check your information and try again."),this.notification.show()):(this.notification.text=rl.relieve("Signout failed. Check ID/password information."),this.notification.show())}))}_login(){const t=globalThis.backendaioptions.get("login_attempt",0,"general"),e=globalThis.backendaioptions.get("last_login",Math.floor(Date.now()/1e3),"general"),i=Math.floor(Date.now()/1e3);if(t>=this.login_attempt_limit&&i-e>this.login_block_time)globalThis.backendaioptions.set("last_login",i,"general"),globalThis.backendaioptions.set("login_attempt",0,"general");else{if(t>=this.login_attempt_limit)return globalThis.backendaioptions.set("last_login",i,"general"),globalThis.backendaioptions.set("login_attempt",t+1,"general"),this.notification.text=Dt("login.TooManyAttempt"),void this.notification.show();globalThis.backendaioptions.set("login_attempt",t+1,"general")}if(this.api_endpoint=this.shadowRoot.querySelector("#id_api_endpoint").value,this.api_endpoint=this.api_endpoint.replace(/\/+$/,""),""===this.api_endpoint)return this.notification.text=Dt("login.APIEndpointEmpty"),void this.notification.show();"SESSION"===this.connection_mode?(this._disableUserInput(),this.user_id=this.shadowRoot.querySelector("#id_user_id").value,this.password=this.shadowRoot.querySelector("#id_password").value,""===this.user_id||"undefined"===this.user_id||""===this.password||"undefined"===this.password?(this.notification.text=Dt("login.PleaseInputLoginInfo"),this.notification.show(),this._enableUserInput()):this._connectUsingSession(!0)):(this._disableUserInput(),this.api_key=this.shadowRoot.querySelector("#id_api_key").value,this.secret_key=this.shadowRoot.querySelector("#id_secret_key").value,this._connectUsingAPI(!0))}async _connectUsingSession(t=!0){return""===this.api_endpoint?(this.free(),this.open(),Promise.resolve(!1)):(this.clientConfig=new ai.backend.ClientConfig(this.user_id,this.password,this.api_endpoint,"SESSION"),this.client=new ai.backend.Client(this.clientConfig,"Backend.AI Console."),this.client.get_manager_version().then((async()=>{if(!1!==await this.client.check_login())return this.is_connected=!0,this._connectGQL();this.block(Dt("login.PleaseWait"),Dt("login.ConnectingToCluster")),this.client.login().then((t=>{if(!1===t)this.open(),""!=this.user_id&&""!=this.password&&(this.notification.text=rl.relieve("Login information mismatch. Please check your login information."),this.notification.show());else{if(!t.fail_reason)return this.is_connected=!0,this._connectGQL();this.open(),""!=this.user_id&&""!=this.password&&(this.notification.text=rl.relieve(t.fail_reason),this.notification.show())}})).catch((e=>{this.free(),console.log(e),t&&(!0!==this.loginPanel.open?void 0!==e.message?(this.notification.text=rl.relieve(e.title),this.notification.detail=e.message):this.notification.text=rl.relieve("Login information mismatch. If the information is correct, logout and login again."):(void 0!==e.message?(this.notification.text=rl.relieve(e.title),this.notification.detail=e.message):this.notification.text=rl.relieve("Login failed. Check login information."),console.log(e)),this.notification.show())})),this.open(),this._enableUserInput()})).catch((e=>(this.free(),this.open(),this._enableUserInput(),t&&(this.notification.text=rl.relieve("Endpoint is unreachable. Please check the connection or endpoint"),this.notification.show()),Promise.resolve(!1)))))}_connectUsingAPI(t=!0){this.clientConfig=new ai.backend.ClientConfig(this.api_key,this.secret_key,this.api_endpoint),this.client=new ai.backend.Client(this.clientConfig,"Backend.AI Console."),this.client.ready=!1,this.client.get_manager_version().then((e=>this._connectGQL(t)))}_connectGQL(t=!0){!0!==this.loginPanel.open&&this.block(),new Promise((()=>{const t=Math.floor(Date.now()/1e3);globalThis.backendaioptions.set("last_login",t,"general"),globalThis.backendaioptions.set("login_attempt",0,"general"),this._connectViaGQL()})).catch((e=>{this.free(),t&&(!0!==this.loginPanel.open?(void 0!==e.message?408===e.status?(this.notification.text=Dt("error.LoginSucceededManagerNotResponding"),this.notification.detail=e.message):(this.notification.text=rl.relieve(e.title),this.notification.detail=e.message):this.notification.text=rl.relieve("Login information mismatch. If the information is correct, logout and login again."),this.notification.show(!1,e),this.open()):(this.notification.text=rl.relieve("Login failed. Check login information."),this.notification.show())),this.open(),this._enableUserInput()}))}_connectViaGQL(){const t=`query { keypair { ${["user_id","resource_policy","user"].join(" ")} } }`;return this.client.query(t,{}).then((t=>{this.is_connected=!0,globalThis.backendaiclient=this.client;const e=t.keypair.resource_policy;globalThis.backendaiclient.resource_policy=e,this.user=t.keypair.user;const i=`query { user{ ${["username","email","full_name","is_active","role","domain_name","groups {name, id}","need_password_change"].join(" ")} } }`,r={uuid:this.user};return globalThis.backendaiclient.query(i,r)})).then((t=>{const e=t.user.email;this.email!==e&&(this.email=e),this.user_groups=t.user.groups;const i=t.user.role;return this.domain_name=t.user.domain_name,globalThis.backendaiclient.email=this.email,globalThis.backendaiclient.full_name=t.user.full_name,globalThis.backendaiclient.is_admin=!1,globalThis.backendaiclient.is_superadmin=!1,globalThis.backendaiclient.need_password_change=t.user.need_password_change,["superadmin","admin"].includes(i)&&(globalThis.backendaiclient.is_admin=!0),["superadmin"].includes(i)&&(globalThis.backendaiclient.is_superadmin=!0),globalThis.backendaiclient.group.list(!0,!1,["id","name","description","is_active"])})).then((t=>{const e=t.groups,i=this.user_groups.map((({id:t})=>t));if(null!==e){globalThis.backendaiclient.groups=e.filter((t=>{if(i.includes(t.id))return t})).map((t=>t.name));const t=Object();e.forEach((function(e){t[e.name]=e.id})),globalThis.backendaiclient.groupIds=t}else globalThis.backendaiclient.groups=["default"];const r=globalThis.backendaiutils._readRecentProjectGroup();globalThis.backendaiclient.current_group=r||globalThis.backendaiclient.groups[0],globalThis.backendaiclient.current_group_id=()=>globalThis.backendaiclient.groupIds[globalThis.backendaiclient.current_group],globalThis.backendaiclient._config._proxyURL=this.proxy_url,globalThis.backendaiclient._config._proxyToken="",globalThis.backendaiclient._config.domainName=this.domain_name,globalThis.backendaiclient._config.default_session_environment=this.default_session_environment,globalThis.backendaiclient._config.default_import_environment=this.default_import_environment,globalThis.backendaiclient._config.allow_project_resource_monitor=this.allow_project_resource_monitor,globalThis.backendaiclient._config.allow_manual_image_name_for_session=this.allow_manual_image_name_for_session,globalThis.backendaiclient._config.openPortToPublic=this.openPortToPublic,globalThis.backendaiclient._config.maxCPUCoresPerContainer=this.maxCPUCoresPerContainer,globalThis.backendaiclient._config.maxMemoryPerContainer=this.maxMemoryPerContainer,globalThis.backendaiclient._config.maxCUDADevicesPerContainer=this.maxCUDADevicesPerContainer,globalThis.backendaiclient._config.maxCUDASharesPerContainer=this.maxCUDASharesPerContainer,globalThis.backendaiclient._config.maxShmPerContainer=this.maxShmPerContainer,globalThis.backendaiclient._config.maxFileUploadSize=this.maxFileUploadSize,globalThis.backendaiclient._config.allow_image_list=this.allow_image_list,globalThis.backendaiclient._config.maskUserInfo=this.maskUserInfo,globalThis.backendaiclient.ready=!0,-1===this.endpoints.indexOf(globalThis.backendaiclient._config.endpoint)&&(this.endpoints.push(globalThis.backendaiclient._config.endpoint),this.endpoints.length>5&&(this.endpoints=this.endpoints.slice(1,6)),globalThis.backendaioptions.set("endpoints",this.endpoints));const n=new CustomEvent("backend-ai-connected",{detail:this.client});document.dispatchEvent(n),this.close(),this._saveLoginInfo(),localStorage.setItem("backendaiwebui.api_endpoint",this.api_endpoint)})).catch((t=>{!0!==this.loginPanel.open?(void 0!==t.message?void 0!==t.title?(this.notification.text=rl.relieve(t.title),this.notification.detail=t.message):(this.notification.text=rl.relieve(t),this.notification.detail=t):this.notification.text=rl.relieve("Login information mismatch. If the information is correct, logout and login again."),this.notification.show(!1,t),this.open()):(this.notification.text=rl.relieve("Login failed. Check login information."),this.notification.show(!0)),401===t.statusCode&&(console.log("automatic logout ..."),this.client.logout()),this._enableUserInput()}))}async _saveLoginInfo(){localStorage.removeItem("backendaiwebui.login.api_key"),localStorage.removeItem("backendaiwebui.login.secret_key"),localStorage.removeItem("backendaiwebui.login.user_id"),localStorage.removeItem("backendaiwebui.login.password")}_toggleEndpoint(){const t=this.shadowRoot.querySelector("#endpoint-list"),e=this.shadowRoot.querySelector("#endpoint-button");t.anchor=e,t.open=!t.open}_updateEndpoint(){const t=this.shadowRoot.querySelector("#endpoint-list");this.api_endpoint=t.selected.value}_deleteEndpoint(t){const e=this.endpoints.indexOf(t);e>-1&&this.endpoints.splice(e,1),globalThis.backendaioptions.set("endpoints",this.endpoints),this.requestUpdate()}_disableUserInput(){this.connection_mode,this.shadowRoot.querySelector("#id_user_id").disabled=!0,this.shadowRoot.querySelector("#id_password").disabled=!0,this.shadowRoot.querySelector(".waiting-animation").style.display="flex"}_enableUserInput(){this.shadowRoot.querySelector("#id_user_id").disabled=!1,this.shadowRoot.querySelector("#id_password").disabled=!1,this.shadowRoot.querySelector("#id_user_id").disabled=!1,this.shadowRoot.querySelector("#id_password").disabled=!1,this.shadowRoot.querySelector(".waiting-animation").style.display="none"}render(){return D`
      <link rel="stylesheet" href="resources/custom.css">
      <backend-ai-dialog id="login-panel" noclosebutton fixed blockscrolling persistent disablefocustrap escapeKeyAction>
        <div slot="title">
          <div id="login-title-area"></div>
          <div class="horizontal center layout">
            <img src="manifest/backend.ai-text.svg" style="height:35px;padding:15px 0 15px 5px;" />
            <div class="flex"></div>
          </div>
        </div>
        <div slot="content" class="login-panel intro centered" style="margin: 0;">
          <h3 class="horizontal center layout" style="margin: 0 25px;font-weight:700;min-height:40px;">
            <div>${"SESSION"==this.connection_mode?ie("login.LoginWithE-mail"):ie("login.LoginWithIAM")}</div>
            <div class="flex"></div>
            ${this.change_signin_support?D`
                <div class="vertical center-justified layout">
                  <div style="font-size:12px;margin:5px 10px;text-align:center;font-weight:400;">${ie("login.LoginAnotherway")}</div>
                  <mwc-button
                      class="change-login-mode-button"
                      outlined
                      label="${"SESSION"==this.connection_mode?ie("login.ClickToUseIAM"):ie("login.ClickToUseID")}"
                      @click="${()=>this._changeSigninMode()}">
                  </mwc-button>
                </div>
            `:D``}
          </h3>
          <div class="login-form">
            <div class="waiting-animation horizontal layout wrap">
              <div class="sk-folding-cube">
                <div class="sk-cube1 sk-cube"></div>
                <div class="sk-cube2 sk-cube"></div>
                <div class="sk-cube4 sk-cube"></div>
                <div class="sk-cube3 sk-cube"></div>
              </div>
              <div id="loading-message">Waiting...</div>
            </div>
            <form id="session-login-form" style="${"SESSION"==this.connection_mode?"display:block;":"display:none;"}">
              <fieldset>
                <div class="horizontal layout start-justified center login-input">
                  <mwc-icon>email</mwc-icon>
                  <input type="email" id="id_user_id" maxlength="64" autocomplete="username"
                              label="${ie("login.E-mail")}" placeholder="${ie("login.E-mail")}" icon="email" value="${this.user_id}" @keyup="${this._submitIfEnter}"></input>
                </div>
                <div class="horizontal layout start-justified center login-input">
                  <mwc-icon>vpn_key</mwc-icon>
                  <input type="password" id="id_password" autocomplete="current-password"
                              label="${ie("login.Password")}" placeholder="${ie("login.Password")}" icon="vpn_key" value="${this.password}" @keyup="${this._submitIfEnter}"></input>
                </div>
              </fieldset>
            </form>
            <form id="api-login-form" style="${"SESSION"==this.connection_mode?"display:none;":"display:block;"}">
              <fieldset>
                <mwc-textfield type="text" id="id_api_key" maxLength="20"
                            label="${ie("login.APIKey")}" icon="lock" value="${this.api_key}" @keyup="${this._submitIfEnter}"></mwc-textfield>
                <mwc-textfield type="password" id="id_secret_key" maxLength="40"
                            label="${ie("login.SecretKey")}" icon="vpn_key" value="${this.secret_key}" @keyup="${this._submitIfEnter}" ></mwc-textfield>
              </fieldset>
            </form>
            <form>
              <fieldset>
                <div class="horizontal layout" id="id_api_endpoint_container" style="display:none;">
                  <mwc-icon-button id="endpoint-button" icon="cloud_queue" style="padding-left: 3px; background-color: rgb(250, 250, 250);" @click="${()=>this._toggleEndpoint()}"></mwc-icon-button>
                  <mwc-menu id="endpoint-list" @selected="${()=>this._updateEndpoint()}">
                    <mwc-list-item disabled>${ie("login.EndpointHistory")}</mwc-list-item>
                    ${0===this.endpoints.length?D`
                    <mwc-list-item value="">${ie("login.NoEndpointSaved")}</mwc-list-item>
                    `:D``}

                    ${this.endpoints.map((t=>D`<mwc-list-item value="${t}">
                      <div class="horizontal justified center flex layout" style="width:365px;">
                        <span>${t}</span><span class="flex"></span>
                        <mwc-icon-button icon="delete" @click="${()=>this._deleteEndpoint(t)}" class="endpoint-control-button"></mwc-icon-button>
                      </div>
                    </mwc-list-item>`))}
                  </mwc-menu>
                  <mwc-textfield class="endpoint-text" type="text" id="id_api_endpoint" maxLength="2048"
                              style="--mdc-text-field-idle-line-color:rgba(255,255,255,0);--mdc-text-field-hover-line-color:rgba(255,255,255,0);"
                              label="${ie("login.Endpoint")}" value="${this.api_endpoint}" @keyup="${this._submitIfEnter}"></mwc-textfield>
                </div>
                <mwc-textfield class="endpoint-text" type="text" id="id_api_endpoint_humanized" maxLength="2048"
                            style="display:none;--mdc-text-field-idle-line-color:rgba(255,255,255,0);--mdc-text-field-hover-line-color:rgba(255,255,255,0);"
                            label="${ie("login.Endpoint")}" icon="cloud" value=""></mwc-textfield>
                <mwc-button
                      unelevated
                      id="login-button"
                      icon="check"
                      fullwidth
                      label="${ie("login.Login")}"
                      @click="${()=>this._login()}"></mwc-button>
                <div class="layout horizontal" style="margin-top:2em;">
                  ${this.signup_support?D`
                    <div class="vertical center-justified layout" style="width:100%;">
                      <div style="font-size:12px; margin:0 10px; text-align:center;">${ie("login.NotAUser")}</div>
                      <mwc-button
                          outlined
                          label="${ie("login.SignUp")}"
                          @click="${()=>this._showSignupDialog()}"></mwc-button>
                    </div>
                  `:D``}
                  ${this.signup_support&&this.allowAnonymousChangePassword?D`
                    <span class="flex" style="min-width:1em;"></span>
                  `:D``}
                  ${this.allowAnonymousChangePassword?D`
                    <div class="vertical center-justified layout" style="width:100%;">
                      <div style="font-size:12px; margin:0 10px; text-align:center;">${ie("login.ForgotPassword")}</div>
                      <mwc-button
                          outlined
                          label="${ie("login.ChangePassword")}"
                          @click="${()=>this._showChangePasswordEmailDialog()}"></mwc-button>
                    </div>
                  `:D``}
                </div>
              </fieldset>
            </form>
          </div>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="signout-panel" fixed backdrop blockscrolling persistent disablefocustrap>
        <span slot="title">${ie("login.LeaveService")}</span>
        <div slot="content">
          <section>
            <div class="warning">${ie("login.DescConfirmLeave")}</div>
          </section>
          <mwc-textfield type="email" name="signout_user_id" id="id_signout_user_id" maxLength="64"
              label="E-mail" value="" @keyup="${this._signoutIfEnter}"></mwc-textfield>
          <mwc-textfield type="password" name="signout_password" id="id_signout_password" maxLength="64"
              label="Password" value="" @keyup="${this._signoutIfEnter}"></mwc-textfield>
        </div>
        <div slot="footer" class="horizontal center-justified flex layout">
          <mwc-button
              outlined
              fullwidth
              id="signout-button"
              icon="check"
              label="${ie("login.LeaveService")}"
              @click="${()=>this._signout()}"></mwc-button>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="change-password-confirm-dialog" fixed backdrop blockscrolling persistent disablefocustrap>
        <span slot="title">${ie("login.SendChangePasswordEmail")}</span>
        <div slot="content">
          <section>
            <div style="padding:1em">${ie("login.DescChangePasswordEmail")}</div>
          </section>
          <mwc-textfield type="email" id="password-change-email" maxLength="64"
              label="E-mail" value="" autofocus auto-validate
              validationMessage="${ie("signup.InvalidEmail")}"
              pattern="^[A-Z0-9a-z#-_]+@.+\\..+$"></mwc-textfield>
        </div>
        <div slot="footer" class="horizontal center-justified flex layout">
          <mwc-button
              outlined
              fullwidth
              icon="check"
              label="${ie("login.EmailSendButton")}"
              @click="${()=>this._sendChangePasswordEmail()}"></mwc-button>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="block-panel" fixed blockscrolling persistent escapeKeyAction>
        ${""!=this.blockMessage?D`
          ${""!==this.blockType?D`
            <span slot="title" id="work-title">${this.blockType}</span>
          `:D``}
          <div slot="content" style="text-align:center;padding-top:15px;">
          ${this.blockMessage}
          </div>
          <div slot="footer" class="horizontal center-justified flex layout">
          <mwc-button
              outlined
              fullwidth
              label="${ie("login.CancelLogin")}"
              @click="${t=>this._cancelLogin(t)}"></mwc-button>
          </div>
        `:D``}
      </backend-ai-dialog>
      <backend-ai-signup id="signup-dialog"></backend-ai-signup>
    `}};r([xt({type:String})],al.prototype,"api_key",void 0),r([xt({type:String})],al.prototype,"secret_key",void 0),r([xt({type:String})],al.prototype,"user_id",void 0),r([xt({type:String})],al.prototype,"password",void 0),r([xt({type:String})],al.prototype,"proxy_url",void 0),r([xt({type:String})],al.prototype,"api_endpoint",void 0),r([xt({type:String})],al.prototype,"domain_name",void 0),r([xt({type:String})],al.prototype,"default_session_environment",void 0),r([xt({type:String})],al.prototype,"default_import_environment",void 0),r([xt({type:String})],al.prototype,"blockType",void 0),r([xt({type:String})],al.prototype,"blockMessage",void 0),r([xt({type:String})],al.prototype,"connection_mode",void 0),r([xt({type:Number})],al.prototype,"login_attempt_limit",void 0),r([xt({type:Number})],al.prototype,"login_block_time",void 0),r([xt({type:String})],al.prototype,"user",void 0),r([xt({type:String})],al.prototype,"email",void 0),r([xt({type:Object})],al.prototype,"config",void 0),r([xt({type:Object})],al.prototype,"loginPanel",void 0),r([xt({type:Object})],al.prototype,"signoutPanel",void 0),r([xt({type:Object})],al.prototype,"blockPanel",void 0),r([xt({type:Boolean})],al.prototype,"is_connected",void 0),r([xt({type:Object})],al.prototype,"clientConfig",void 0),r([xt({type:Object})],al.prototype,"client",void 0),r([xt({type:Object})],al.prototype,"notification",void 0),r([xt({type:Object})],al.prototype,"user_groups",void 0),r([xt({type:Boolean})],al.prototype,"signup_support",void 0),r([xt({type:Boolean})],al.prototype,"allowAnonymousChangePassword",void 0),r([xt({type:Boolean})],al.prototype,"change_signin_support",void 0),r([xt({type:Boolean})],al.prototype,"allow_signout",void 0),r([xt({type:Boolean})],al.prototype,"allow_project_resource_monitor",void 0),r([xt({type:Boolean})],al.prototype,"allow_manual_image_name_for_session",void 0),r([xt({type:Boolean})],al.prototype,"allowSignupWithoutConfirmation",void 0),r([xt({type:Boolean})],al.prototype,"openPortToPublic",void 0),r([xt({type:Boolean})],al.prototype,"maxCPUCoresPerContainer",void 0),r([xt({type:Boolean})],al.prototype,"maxMemoryPerContainer",void 0),r([xt({type:Number})],al.prototype,"maxCUDADevicesPerContainer",void 0),r([xt({type:Number})],al.prototype,"maxCUDASharesPerContainer",void 0),r([xt({type:Boolean})],al.prototype,"maxShmPerContainer",void 0),r([xt({type:Boolean})],al.prototype,"maxFileUploadSize",void 0),r([xt({type:Boolean})],al.prototype,"maskUserInfo",void 0),r([xt({type:Array})],al.prototype,"allow_image_list",void 0),r([xt({type:Array})],al.prototype,"endpoints",void 0),r([xt({type:Object})],al.prototype,"logoutTimerBeforeOneMin",void 0),r([xt({type:Object})],al.prototype,"logoutTimer",void 0),al=r([_t("backend-ai-login")],al);let sl=class extends vt{static get styles(){return[at`
        :host {
          display: block;
          position: fixed;
          top: 100%;
          left: 0;
          right: 0;
          padding: 12px;
          background-color: #246;
          color: white;
          box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
          text-align: center;
          will-change: transform;
          transform: translate3d(0, 0, 0);
          transition-property: visibility, transform;
          transition-duration: 0.2s;
          visibility: hidden;
        }

        :host([active]) {
          visibility: visible;
          transform: translate3d(0, -100%, 0);
        }

        @media (min-width: 460px) {
          :host {
            width: 320px;
            margin: auto;
          }
        }
      `]}render(){return D`
      <slot></slot>
    `}};sl=r([_t("backend-ai-offline-indicator")],sl);let ll=class extends js{constructor(){super(),this.supports=Object(),this.supportImages=Object(),this.imageRequirements=Object(),this.imageArchitectures=Object(),this.aliases=Object(),this.tags=Object(),this.imageInfo=Object(),this.imageNames=Object(),this.resourceLimits=Object(),this.userResourceLimit=Object(),this.icons=Object(),this.kernel="",this.gpu_modes=[],this.gpu_step=.1,this.cpu_metric={min:"1",max:"1"},this.mem_metric={min:"1",max:"1"},this.shmem_metric={min:.0625,max:1,preferred:.0625},this.cuda_device_metric={min:0,max:0},this.rocm_device_metric={min:"0",max:"0"},this.tpu_device_metric={min:"1",max:"1"},this.lastQueryTime=0,this.lastResourcePolicyQueryTime=0,this.lastVFolderQueryTime=0,this.aggregate_updating=!1,this._default_language_updated=!1,this._default_version_updated=!1,this._GPUmodeUpdated=!1,this.allow_project_resource_monitor=!1,this.max_cpu_core_per_session=64,this.active=!1,this.init_resource()}static get is(){return"backend-ai-resource-broker"}static get styles(){return[]}init_resource(){this.languages=[],this.total_slot={},this.total_resource_group_slot={},this.total_project_slot={},this.used_slot={},this.used_resource_group_slot={},this.used_project_slot={},this.available_slot={},this.used_slot_percent={},this.used_resource_group_slot_percent={},this.used_project_slot_percent={},this.resource_templates=[],this.resource_templates_filtered=[],this.vfolders=[],this.default_language="",this.concurrency_used=0,this.concurrency_max=0,this.concurrency_limit=0,this.scaling_groups=[{name:""}],this.scaling_group="",this.current_user_group="",this.sessions_list=[],this.metric_updating=!1,this.metadata_updating=!1,this.image_updating=!0,this.disableLaunch=[]}firstUpdated(){fetch("resources/image_metadata.json").then((t=>t.json())).then((t=>{this.imageInfo=t.imageInfo;for(const t in this.imageInfo)({}).hasOwnProperty.call(this.imageInfo,t)&&(this.tags[t]=[],"name"in this.imageInfo[t]&&(this.aliases[t]=this.imageInfo[t].name,this.imageNames[t]=this.imageInfo[t].name),"icon"in this.imageInfo[t]?this.icons[t]=this.imageInfo[t].icon:this.icons[t]="default.png","label"in this.imageInfo[t]&&this.imageInfo[t].label.forEach((e=>{"category"in e||this.tags[t].push(e)})));void 0===globalThis.backendaiclient||null===globalThis.backendaiclient||!1===globalThis.backendaiclient.ready?document.addEventListener("backend-ai-connected",(()=>{this._refreshImageList()}),{once:!0}):this._refreshImageList()})),document.addEventListener("backend-ai-resource-refreshed",(()=>{this.active&&!1===this.metadata_updating&&(this.metadata_updating=!0,this.aggregateResource("resource-refreshed"),this.metadata_updating=!1)})),document.addEventListener("backend-ai-group-changed",(t=>{this._updatePageVariables(!0)})),document.addEventListener("backend-ai-calculate-current-resource",(t=>{this.aggregateResource("resource-refreshed"),globalThis.backendaioptions.set("current-resource",this.available_slot)}))}_initAliases(){for(const t in this.aliases)({}).hasOwnProperty.call(this.aliases,t)&&(this.aliases[this.aliases[t]]=t)}async updateScalingGroup(t=!1,e){""!=this.scaling_group&&""!==e&&e!==this.scaling_group&&(this.scaling_group=e,this.active&&(this.lastQueryTime=0,!0===t&&await this._refreshResourcePolicy()))}async _viewStateChanged(t){await this.updateComplete,this.active&&(void 0===globalThis.backendaiclient||null===globalThis.backendaiclient||!1===globalThis.backendaiclient.ready?document.addEventListener("backend-ai-connected",(()=>{this.allow_project_resource_monitor=globalThis.backendaiclient._config.allow_project_resource_monitor,this._updatePageVariables(!0)}),{once:!0}):(this.allow_project_resource_monitor=globalThis.backendaiclient._config.allow_project_resource_monitor,await this._updatePageVariables(!0)))}async _updatePageVariables(t){if(!1===this.metadata_updating){if(this.metadata_updating=!0,t&&(this.lastQueryTime=0),""===this.scaling_group||t){""===this.current_user_group&&(this.current_user_group=globalThis.backendaiclient.current_group);const t=await globalThis.backendaiclient.scalingGroup.list(this.current_user_group);this.scaling_groups=t.scaling_groups.length>0?t.scaling_groups:[{name:""}],this.scaling_group=this.scaling_groups[0].name}const e=["name"];await globalThis.backendaiclient.computeSession.list(e,"RUNNING",null,1e3).then((t=>{!t.compute_session_list&&t.legacy_compute_session_list&&(t.compute_session_list=t.legacy_compute_session_list),this.sessions_list=t.compute_session_list.items.map((t=>t.name))})),this._initAliases(),await this._refreshResourcePolicy(),this.aggregateResource("update-page-variable"),this.metadata_updating=!1;const i=new CustomEvent("backend-ai-resource-broker-updated",{detail:""});return document.dispatchEvent(i),Promise.resolve(!0)}return Promise.resolve(!1)}_refreshConcurrency(){return globalThis.backendaiclient.keypair.info(globalThis.backendaiclient._config.accessKey,["concurrency_used"]).then((t=>{this.concurrency_used=t.keypair.concurrency_used}))}async _refreshResourcePolicy(){return Date.now()-this.lastResourcePolicyQueryTime<2e3?Promise.resolve(!1):(this.lastResourcePolicyQueryTime=Date.now(),globalThis.backendaiclient.keypair.info(globalThis.backendaiclient._config.accessKey,["resource_policy","concurrency_used"]).then((t=>{const e=t.keypair.resource_policy;return this.concurrency_used=t.keypair.concurrency_used,globalThis.backendaiclient.resourcePolicy.get(e,["default_for_unspecified","total_resource_slots","max_concurrent_sessions","max_containers_per_session"])})).then((t=>{const e=t.keypair_resource_policy;return this.userResourceLimit=JSON.parse(t.keypair_resource_policy.total_resource_slots),this.concurrency_max=e.max_concurrent_sessions,this.max_containers_per_session=e.max_containers_per_session,this._updateGPUMode()})).catch((t=>{throw this.metadata_updating=!1,t})))}_updateGPUMode(){return this._GPUmodeUpdated?Promise.resolve(!0):(this._GPUmodeUpdated=!0,globalThis.backendaiclient.get_resource_slots().then((t=>{const e=t;["cuda.device","cuda.shares","rocm.device","tpu.device"].forEach((t=>{t in e&&!this.gpu_modes.includes(t)&&(this.gpu_mode=t,this.gpu_modes.push(t),this.gpu_step="cuda.shares"===t?.1:1)})),void 0===this.gpu_mode&&(this.gpu_mode="none")})))}generateSessionId(){let t="";const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let i=0;i<8;i++)t+=e.charAt(Math.floor(Math.random()*e.length));return t+"-session"}async updateVirtualFolderList(t=null){if(Date.now()-this.lastVFolderQueryTime<2e3)return Promise.resolve(!1);const e=(await globalThis.backendaiclient.vfolder.list_hosts(globalThis.backendaiclient.current_group_id())).allowed;return globalThis.backendaiclient.vfolder.list(globalThis.backendaiclient.current_group_id(),t).then((t=>{this.lastVFolderQueryTime=Date.now();const i=[],r=[];t.forEach((t=>{e.includes(t.host)&&(t.name.startsWith(".")?(t.disabled=!0,t.name=t.name+" (Automount folder)",r.push(t)):i.push(t))})),this.vfolders=i.concat(r)}))}async _aggregateCurrentResource(t=""){if(this.aggregate_updating)return Promise.resolve(!1);if(Date.now()-this.lastQueryTime<1e3)return Promise.resolve(!1);this.aggregate_updating=!0;const e={},i={},r={};return globalThis.backendaiclient.keypair.info(globalThis.backendaiclient._config.accessKey,["concurrency_used"]).then((async t=>{this.concurrency_used=t.keypair.concurrency_used,""===this.current_user_group&&(this.current_user_group=globalThis.backendaiclient.current_group);const e={group:globalThis.backendaiclient.current_group};if(this.current_user_group!==globalThis.backendaiclient.current_group||0==this.scaling_groups.length||1===this.scaling_groups.length&&""===this.scaling_groups[0].name){this.current_user_group=globalThis.backendaiclient.current_group;const t=await globalThis.backendaiclient.scalingGroup.list(this.current_user_group);this.scaling_groups=t.scaling_groups.length>0?t.scaling_groups:[{name:""}]}if(this.scaling_groups.length>0){const t=[];this.scaling_groups.map((e=>{t.push(e.name)})),""!==this.scaling_group&&t.includes(this.scaling_group)||(this.scaling_group=this.scaling_groups[0].name),e.scaling_group=this.scaling_group}return globalThis.backendaiclient.resourcePreset.check(e)})).then((t=>{if(t.presets){const e=t.presets,i=[];e.forEach((t=>{!0===t.allocatable&&("cuda.shares"in t.resource_slots?t.cuda_shares=t.resource_slots["cuda.shares"]:"cuda.device"in t.resource_slots&&(t.cuda_device=t.resource_slots["cuda.device"]),"rocm.device"in t.resource_slots&&(t.rocm_device=t.resource_slots["rocm.device"]),"tpu.device"in t.resource_slots&&(t.tpu_device=t.resource_slots["tpu.device"]),t.cpu=t.resource_slots.cpu,t.mem=globalThis.backendaiclient.utils.changeBinaryUnit(t.resource_slots.mem,"g"),t.shared_memory?t.shmem=globalThis.backendaiclient.utils.changeBinaryUnit(t.shared_memory,"g"):t.shmem=null,i.push(t))})),i.sort(((t,e)=>t.name>e.name?1:-1)),this.resource_templates=i,0===this.resource_templates_filtered.length&&(this.resource_templates_filtered=this.resource_templates)}const n=t.keypair_remaining,o=t.keypair_using,a=t.group_limits,s=t.group_using,l={"cuda.device":"cuda_device","cuda.shares":"cuda_shares","rocm.device":"rocm_device","tpu.device":"tpu_device"};if(""===this.scaling_group&&this.scaling_groups.length>0)t.scaling_groups[""]={using:{cpu:0,mem:0},remaining:{cpu:0,mem:0}};else if(0===this.scaling_groups.length)return this.aggregate_updating=!1,Promise.resolve(!1);const d=t.scaling_groups[this.scaling_group].using,c=t.scaling_groups[this.scaling_group].remaining,h=t.keypair_limits;"cpu"in h&&(i.cpu=Number(c.cpu)+Number(d.cpu),r.cpu=Number(a.cpu),"Infinity"===h.cpu?e.cpu=i.cpu:e.cpu=h.cpu),"mem"in h&&(i.mem=parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(c.mem,"g"))+parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(d.mem,"g")),r.mem=parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(a.mem,"g")),"Infinity"===h.mem?e.mem=i.mem:e.mem=parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(h.mem,"g"))),e.mem=e.mem.toFixed(2),i.mem=i.mem.toFixed(2);for(const[t,n]of Object.entries(l))t in h&&(i[n]=Number(c[t])+Number(d[t]),r[n]=Number(a[t]),"Infinity"===h[t]?e[n]=i[n]:e[n]=h[t]);const u=Object(),p=Object(),f=Object(),m=Object(),g=Object();"cpu"in n&&(p.cpu="cpu"in o?o.cpu:0,"Infinity"===n.cpu?u.cpu=e.cpu-p.cpu:u.cpu=n.cpu),"cpu"in c&&(m.cpu="cpu"in d?d.cpu:0,f.cpu=c.cpu),g.cpu="cpu"in s?s.cpu:0,"mem"in n&&(p.mem="mem"in o?parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(o.mem,"g")):0,"Infinity"===n.mem?u.mem=e.mem-p.mem:u.mem=parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(n.mem,"g"))),p.mem=p.mem.toFixed(2),"mem"in c&&(m.mem="mem"in d?parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(d.mem,"g")):0,f.mem=parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(c.mem,"g"))),m.mem=m.mem.toFixed(2),g.mem="mem"in s?parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(s.mem,"g")):0,g.mem=g.mem.toFixed(2);for(const[t,e]of Object.entries(l))t in n&&(u[e]=n[t],p[e]=t in o?o[t]:0),t in c&&(f[e]=c[t],m[e]=t in d?d[t]:0),g[e]=t in s?s[t]:0;"cuda_shares"in p&&(e.cuda_shares=parseFloat(e.cuda_shares).toFixed(2)),"cuda_shares"in m&&(i.cuda_shares=parseFloat(i.cuda_shares).toFixed(2)),"cuda_shares"in g&&(r.cuda_shares=parseFloat(r.cuda_shares).toFixed(2)),this.total_slot=e,this.total_resource_group_slot=i,this.total_project_slot=r,this.used_slot=p,this.used_resource_group_slot=m,this.used_project_slot=g;const b={},v={},y={};return["cpu","mem","cuda_device","cuda_shares","rocm_device","tpu_device"].forEach((t=>{t in p&&(Number(e[t])<Number(p[t])&&(e[t]=p[t]),0!=e[t]?b[t]=p[t]/e[t]*100:b[t]=0,0!=i[t]?v[t]=m[t]/i[t]*100:v[t]=0,0!=r[t]?y[t]=g[t]/r[t]*100:y[t]=0),t in u&&"Infinity"===u[t]&&(u[t]=f[t])})),this.used_project_slot_percent=y,0===this.concurrency_max?(b.concurrency=0,u.concurrency=this.concurrency_max):(b.concurrency=this.concurrency_used/this.concurrency_max*100,u.concurrency=this.concurrency_max-this.concurrency_used),this.concurrency_limit=Math.min(u.concurrency,3),this.available_slot=f,this.used_slot_percent=b,this.used_resource_group_slot_percent=v,this.lastQueryTime=Date.now(),this.aggregate_updating=!1,Promise.resolve(!0)})).catch((t=>{throw this.lastQueryTime=Date.now(),this.aggregate_updating=!1,t}))}aggregateResource(t=""){void 0===globalThis.backendaiclient||null===globalThis.backendaiclient||!1===globalThis.backendaiclient.ready?document.addEventListener("backend-ai-connected",(()=>{this._aggregateCurrentResource(t)}),!0):this._aggregateCurrentResource(t)}async _refreshImageList(){return globalThis.backendaiclient.image.list(["name","humanized_name","tag","registry","architecture","digest","installed","resource_limits { key min max }","labels { key value }"],!0,!1).then((t=>{if(0===t.images.length)return;this.images=t.images,this.supports={},this.supportImages={},this.imageRequirements={},this.imageArchitectures={};const e={};Object.keys(this.images).map(((t,i)=>{const r=this.images[t],n=`${r.registry}/${r.name}`;let o;n in this.supports||(this.supports[n]=[]),-1===this.supports[n].indexOf(r.tag)&&this.supports[n].push(r.tag);const a=r.name.split("/");o=1===a.length?a[0]:a[1],this.supportImages[n]=this.imageInfo[o]||{name:"Custom Environments",description:"Custom-built images.",group:"Custom Environments",tags:[],label:[{category:"Custom",tag:"Custom",color:"black"}]},"group"in this.supportImages[n]||(this.supportImages[n].group="Custom Environments"),this.resourceLimits[`${n}:${r.tag}`]=r.resource_limits,this.imageRequirements[`${n}:${r.tag}`]={},this.imageArchitectures[`${n}:${r.tag}`]||(this.imageArchitectures[`${n}:${r.tag}`]=[]),this.imageArchitectures[`${n}:${r.tag}`].push(r.architecture),r.labels.forEach((t=>{"com.nvidia.tensorflow.version"===t.key&&(this.imageRequirements[`${n}:${r.tag}`].framework="TensorFlow "+t.value),"com.nvidia.pytorch.version"===t.key&&(this.imageRequirements[`${n}:${r.tag}`].framework="PyTorch "+t.value),"ai.backend.features"===t.key&&t.value.includes("private")&&(n in e||(e[n]=[]),e[n].push(r.tag))}))})),Object.keys(e).forEach((t=>{const i=this.supports[t];this.supports[t]=i.filter((i=>!e[t].includes(i))),this.supports[t].length<1&&delete this.supports[t]})),this._updateEnvironment()})).catch((t=>{throw this.metadata_updating=!1,t}))}_guessHumanizedNames(t){const e=this.imageNames;let i="",r=null,n="abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()";return Object.keys(e).forEach(((o,a)=>{const s=t.split("/");i=2==s.length?s[1]:s[2],(i===o||""===i&&t.endsWith(o)&&o.length<n.length)&&(r=e[o],n=o)})),r}_cap(t){return t=t.replace(/^./,t[0].toUpperCase())}_updateEnvironment(){const t=Object.keys(this.supports);if(void 0===t)return;t.sort(((t,e)=>this.supportImages[t].group>this.supportImages[e].group?1:-1));let e="";this.languages=[],t.forEach(((t,i)=>{if(!Object.keys(this.aliases).includes(t)){const e=this._guessHumanizedNames(t);this.aliases[t]=null!==e?e:t}const r=t.split("/"),n=r[0];let o,a;2==r.length?(o="",a=r[1]):(o=r[1],a=r[2]);let s,l=this.aliases[t];s=void 0!==l?l.split(" (")[0]:a,l=l.split("/").slice(-1)[0],s=s.split("/").slice(-1)[0];let d=[];a in this.tags&&(d=d.concat(this.tags[a])),""==o||["lablup","cloud","stable"].includes(o)||d.push({tag:this._cap(o),color:"purple"});let c="default.png";a in this.icons&&(c=this.icons[a]),void 0!==globalThis.backendaiclient._config.allow_image_list&&globalThis.backendaiclient._config.allow_image_list.length>0&&!globalThis.backendaiclient._config.allow_image_list.includes(t)||(e!==this.supportImages[t].group&&(this.languages.push({name:"",registry:"",prefix:"",kernelname:"",alias:"",icon:"",basename:this.supportImages[t].group,tags:[],clickable:!1}),e=this.supportImages[t].group),this.languages.push({name:t,registry:n,prefix:o,kernelname:a,alias:l,basename:s,tags:d,icon:c}))})),this.image_updating=!1}async initDefaultLanguage(){if(!this._default_language_updated)return void 0!==globalThis.backendaiclient._config.default_session_environment&&"default_session_environment"in globalThis.backendaiclient._config&&""!==globalThis.backendaiclient._config.default_session_environment?this.default_language=globalThis.backendaiclient._config.default_session_environment:this.languages.length>1?this.default_language=this.languages[1].name:0!==this.languages.length?this.default_language=this.languages[0].name:this.default_language="index.docker.io/lablup/ngc-tensorflow",this._default_language_updated=!0,this.default_language}render(){return D``}};r([xt({type:Object})],ll.prototype,"supports",void 0),r([xt({type:Object})],ll.prototype,"images",void 0),r([xt({type:Object})],ll.prototype,"supportImages",void 0),r([xt({type:Object})],ll.prototype,"imageRequirements",void 0),r([xt({type:Object})],ll.prototype,"imageArchitectures",void 0),r([xt({type:Object})],ll.prototype,"aliases",void 0),r([xt({type:Object})],ll.prototype,"tags",void 0),r([xt({type:Object})],ll.prototype,"imageInfo",void 0),r([xt({type:Object})],ll.prototype,"imageNames",void 0),r([xt({type:Object})],ll.prototype,"resourceLimits",void 0),r([xt({type:Object})],ll.prototype,"userResourceLimit",void 0),r([xt({type:Object})],ll.prototype,"icons",void 0),r([xt({type:String})],ll.prototype,"kernel",void 0),r([xt({type:Array})],ll.prototype,"versions",void 0),r([xt({type:Array})],ll.prototype,"languages",void 0),r([xt({type:String})],ll.prototype,"gpu_mode",void 0),r([xt({type:Array})],ll.prototype,"gpu_modes",void 0),r([xt({type:Number})],ll.prototype,"gpu_step",void 0),r([xt({type:Object})],ll.prototype,"total_slot",void 0),r([xt({type:Object})],ll.prototype,"total_resource_group_slot",void 0),r([xt({type:Object})],ll.prototype,"total_project_slot",void 0),r([xt({type:Object})],ll.prototype,"used_slot",void 0),r([xt({type:Object})],ll.prototype,"used_resource_group_slot",void 0),r([xt({type:Object})],ll.prototype,"used_project_slot",void 0),r([xt({type:Object})],ll.prototype,"available_slot",void 0),r([xt({type:Number})],ll.prototype,"concurrency_used",void 0),r([xt({type:Number})],ll.prototype,"concurrency_max",void 0),r([xt({type:Number})],ll.prototype,"concurrency_limit",void 0),r([xt({type:Number})],ll.prototype,"max_containers_per_session",void 0),r([xt({type:Array})],ll.prototype,"vfolders",void 0),r([xt({type:Object})],ll.prototype,"used_slot_percent",void 0),r([xt({type:Object})],ll.prototype,"used_resource_group_slot_percent",void 0),r([xt({type:Object})],ll.prototype,"used_project_slot_percent",void 0),r([xt({type:Array})],ll.prototype,"resource_templates",void 0),r([xt({type:Array})],ll.prototype,"resource_templates_filtered",void 0),r([xt({type:String})],ll.prototype,"default_language",void 0),r([xt({type:Object})],ll.prototype,"cpu_metric",void 0),r([xt({type:Object})],ll.prototype,"mem_metric",void 0),r([xt({type:Object})],ll.prototype,"shmem_metric",void 0),r([xt({type:Object})],ll.prototype,"cuda_device_metric",void 0),r([xt({type:Object})],ll.prototype,"cuda_shares_metric",void 0),r([xt({type:Object})],ll.prototype,"rocm_device_metric",void 0),r([xt({type:Object})],ll.prototype,"tpu_device_metric",void 0),r([xt({type:Number})],ll.prototype,"lastQueryTime",void 0),r([xt({type:Number})],ll.prototype,"lastResourcePolicyQueryTime",void 0),r([xt({type:Number})],ll.prototype,"lastVFolderQueryTime",void 0),r([xt({type:String})],ll.prototype,"scaling_group",void 0),r([xt({type:String})],ll.prototype,"current_user_group",void 0),r([xt({type:Array})],ll.prototype,"scaling_groups",void 0),r([xt({type:Array})],ll.prototype,"sessions_list",void 0),r([xt({type:Boolean})],ll.prototype,"metric_updating",void 0),r([xt({type:Boolean})],ll.prototype,"metadata_updating",void 0),r([xt({type:Boolean})],ll.prototype,"aggregate_updating",void 0),r([xt({type:Boolean})],ll.prototype,"image_updating",void 0),r([xt({type:Boolean})],ll.prototype,"_default_language_updated",void 0),r([xt({type:Boolean})],ll.prototype,"_default_version_updated",void 0),r([xt({type:Boolean})],ll.prototype,"_GPUmodeUpdated",void 0),r([xt({type:Boolean})],ll.prototype,"allow_project_resource_monitor",void 0),r([xt({type:Array})],ll.prototype,"disableLaunch",void 0),r([xt({type:Number})],ll.prototype,"max_cpu_core_per_session",void 0),ll=r([_t("backend-ai-resource-broker")],ll);let dl=class extends js{constructor(){super(),this.options=Object(),this.options={"user.desktop_notification":!0,"user.compact_sidebar":!1,"user.preserve_login":!1,"user.language":"default","user.automatic_update_check":!0,"user.custom_ssh_port":"","user.beta_feature":!1},this.readSettings()}readSettings(){this._readSettings()}_readSettings(){for(let t=0,e=localStorage.length;t<e;++t)if(localStorage.key(t).startsWith("backendaiwebui.settings")){const e=localStorage.key(t).replace("backendaiwebui.settings.","");this._readSetting(e)}}exists(t,e="user"){return e+"."+t in this.options}get(t,e=null,i="user"){return i+"."+t in this.options?this.options[i+"."+t]:e}set(t,e,i="user"){return this._writeUserSetting(t,e,i)}delete(t,e="user"){return this._deleteUserSetting(t,e)}_readSetting(t,e=!0,i="user"){const r=localStorage.getItem("backendaiwebui.settings."+t);null!==r&&""!=r&&'""'!=r?"false"===r?this.options[t]=!1:"true"===r?this.options[t]=!0:this.isJson(r)?this.options[t]=JSON.parse(r):this.options[t]=r:this.options[t]=e}_writeUserSetting(t,e,i){!1===e?localStorage.setItem("backendaiwebui.settings."+i+"."+t,"false"):!0===e?localStorage.setItem("backendaiwebui.settings."+i+"."+t,"true"):"object"==typeof e?localStorage.setItem("backendaiwebui.settings."+i+"."+t,JSON.stringify(e)):localStorage.setItem("backendaiwebui.settings."+i+"."+t,e),this.options[i+"."+t]=e}_deleteUserSetting(t,e){return localStorage.removeItem("backendaiwebui.settings."+e+"."+t),delete this.options[e+"."+t],!0}isJson(t){try{JSON.parse(t)}catch(t){return!1}return!0}render(){return D`
    `}};r([xt({type:Object})],dl.prototype,"options",void 0),dl=r([_t("backend-ai-settings-store")],dl);var cl=dl;const hl=[Je,at`
    .loading-background {
      transition: all 0.3s linear;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-image: url('/resources/images/loading-background-large.jpg');
      background-repeat: no-repeat;
      background-attachment: fixed;
      background-position: top left;
      -webkit-user-select: none !important;
      -webkit-app-region: drag !important;
    }

    .loading-background[inactive] {
      display: none;
    }

    .hidden {
      display: none;
    }

    .visuallyhidden {
      opacity: 0;
    }

    mwc-top-app-bar-fixed {
      --mdc-typography-headline6-font-family: var(--general-font-family);
      --mdc-typography-font-family: var(--general-font-family);
    }

    .site-name {
      text-align: center;
      margin-left: 0;
      margin-right: auto;
      line-height: 16px;
      font-size: 16px;
      font-weight: 100;
      color: var(--general-sidebar-topbar-color, #efefef);
      font-family: var(--general-font-family);
    }

    .site-name > .bold {
      font-weight: 400;
    }

    .mini-ui .site-name {
      display: none;
    }

    .vertical-line {
      width: 1px; /* Line width */
      background-color: #dbdbdb; /* Line color */
      height: 100%;
      float: left;
      margin-top: 10px;
    }

    .drawer-menu {
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      overflow: -moz-scrollbars-none;
      -ms-overflow-style: none;
      will-change: transform;
      background-color: var(--general-sidebar-background-color, #fafafa);
      scrollbar-width: none;
    }

    .drawer-menu .portrait-bar {
      padding-left: 0 !important;
      background-color: transparent;
      color: var(--general-sidebar-topbar-color);
      height: 80px;
      max-width: 250px; /* prevent sidebar from expanding over its width limit */
    }

    .drawer-menu h3 {
      height: 12px;
      font-size: 12px;
      font-weight: 400;
      line-height: 20px;
      padding: 5px 15px 10px 0;
      margin: 20px 25px 20px 25px;
      display: block;
      color: var(--general-sidebar-h3-color);
      border-bottom: var(--general-sidebar-h3-border-color);
    }

    #sidebar-menu {
      height:calc(100vh - 280px);
    }

    .mini-ui #sidebar-menu {
      height:calc(100vh - 226px)!important;
    }

    mwc-list.sidebar {
      cursor: pointer;
      color: var(--general-sidebar-color, #949494);
      --mdc-list-side-padding: 32px;
    }

    mwc-list.sidebar mwc-list-item {
      --mdc-theme-primary: var(--general-sidebar-selected-color, #949494);
      --mdc-theme-text-primary-on-background: var(--general-sidebar-color, #949494);
      --mdc-list-item-graphic-margin: 15px;
      height: 36px;
      margin-top: 10px;
      margin-bottom: 10px;
      font-size: 14px;
    }

    mwc-list.sidebar > mwc-list-item > i {
      color: #949494;
      font-size: 17px;
      padding-top: 5px;
    }

    mwc-list.sidebar mwc-list-item[selected] {
      color: var(--general-sidebar-selected-color, #949494);
      background: var(--general-sidebar-selected-background-color, #23252b);
      border-left: var(--general-sidebar-selected-border-left);
      padding-left: 29px; /* 32px - 3px */
      border-right: 0;
      padding-right: 11px;
      font-weight: 900;
    }

    mwc-list.sidebar mwc-list-item[selected] > i {
      color: inherit;
    }

    mwc-list.sidebar mwc-list-item[disabled],
    mwc-list.sidebar mwc-list-item[disabled] mwc-icon {
      --mdc-theme-on-surface: #888888;
      color: #888888 !important;
    }

    .mini-ui mwc-list.sidebar mwc-list-item {
      --mdc-list-item-graphic-margin: 0;
    }

    #app-body {
      --mdc-drawer-background-color: var(--sidebar-background-color, var(--general-sidebar-background-color, #fafafa));
      --mdc-drawer-border-left: 0;
      --mdc-drawer-border-right: 0;
    }

    app-drawer-layout:not([narrow]) [drawer-toggle] {
      display: none;
    }

    .drawer-menu footer,
    footer#short-height {
      bottom: 0;
      color: var(--general-sidebar-footer-color, #aaaaaa);
      background-color: var(--general-sidebar-background-color);
      margin: 0;
      padding-bottom: 5px;
      line-height: 1;
      font-size: 10px;
    }

    .drawer-menu footer a,
    footer#short-height a {
      color: var(--general-sidebar-footer-color, #aaaaaa) !important;
    }

    .user-name {
      max-width: 10vw;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    #project {
      font-size: 12px;
      color: #8c8484;
      padding-right: 8px;
    }

    mwc-menu#dropdown-menu {
      position: relative;
      left: 170px;
      top: 20px;
    }

    .dropdown-menu-name {
      position: absolute;
      margin-top: 3px;
    }

    mwc-button {
      margin: auto 10px;
      background-image: none;
      --mdc-theme-primary: var(--general-button-background-color);
      --mdc-on-theme-primary: var(--general-button-background-color);
    }

    mwc-button[unelevate--mdc-theme-primary] {
      --mdc-theme-primary: var(--general-button-background-color);
      --mdc-on-theme-primary: var(--general-button-background-color);
    }

    .page {
      display: none;
    }

    .page[active] {
      display: block;
    }

    .sidepanel {
      display: none;
    }

    .sidepanel[active] {
      display: block;
    }

    #content-body {
      background-color: var(--general-background-color, #ffffff);
      color: var(--general-sidepanel-color, #fafafa);
      --mdc-drawer-background-color: var(--sidepanel-background-color, var(--general-sidepanel-background-color, #fafafa));
    }

    .sidepanel-drawer {
      border-right: 1px solid #cccccc;
      height: 100vh;
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      overflow: -moz-scrollbars-none;
      -ms-overflow-style: none;
      will-change: transform;
    }

    wl-progress-spinner {
      --progress-spinner-size: 48px;
      --progress-spinner-stroke-width: 12px;
      width: 48px;
      height: 48px;
      position: fixed;
      top: calc(50vh - 24px);
    }

    mwc-circular-progress {
      width: 48px;
      height: 48px;
      position: fixed;
      --mdc-theme-primary: #e91e63;
      top: calc(50vh - 24px);
    }

    @media screen and (max-width: 899px) {
      wl-progress-spinner {
        left: calc(50% - 24px);
      }

      mwc-circular-progress {
        left: calc(50% - 24px);
      }
    }

    @media screen and (min-width: 900px) {
      wl-progress-spinner {
        left: calc(50% + 71px);
      }

      .mini-ui wl-progress-spinner {
        left: calc(50% + 29px);
      }

      mwc-circular-progress {
        left: calc(50% + 71px);
      }

      .mini-ui mwc-circular-progress {
        left: calc(50% + 29px);
      }
    }

    .draggable {
      -webkit-user-select: none !important;
      -webkit-app-region: drag !important;
    }

    .drawer-menu footer,
    footer#short-height {
      width: 250px;
    }

    mwc-tab {
      color: #ffffff;
    }

    mwc-menu {
      font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-family: var(--general-font-family);
    }

    span.full_name, mwc-select {
      font-weight: bold;
    }

    mwc-select#group-select {
      font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-size: 14px;
      --mdc-typography-subtitle1-font-color: black;
      --mdc-typography-subtitle1-font-weight: 400;
      --mdc-typography-subtitle1-line-height: 16px;
      --mdc-theme-primary: transparent;
      --mdc-select-idle-line-color: transparent;
      --mdc-select-hover-line-color: transparent;
      --mdc-select-outlined-idle-border-color: rgba(255, 255, 255, 0.42);
      --mdc-select-outlined-hover-border-color: rgba(255, 255, 255, 0.87);
      --mdc-select-outlined-disabled-border-color: rgba(255, 255, 255, 0.87);
      --mdc-select-fill-color: transparent;
      --mdc-select-disabled-fill-color: transparent;
      --mdc-select-ink-color: black;
      --mdc-select-label-ink-color: black;
      --mdc-select-focused-label-color: rgba(24, 24, 24, 1.0);
      --mdc-select-disabled-ink-color: rgba(255, 255, 255, 1.0);
      --mdc-select-dropdown-icon-color: #747474;
      --mdc-select-focused-dropdown-icon-color: rgba(255, 255, 255, 0.42);
      --mdc-select-disabled-dropdown-icon-color: #747474;
    }

    mwc-select.fixed-position > mwc-list-item {
      width: 255px;
    }

    mwc-multi-select {
      width: 135px;
      min-width: 135px;
      font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-size: 14px;
      --mdc-typography-subtitle1-font-color: white;
      --mdc-typography-subtitle1-font-weight: 400;
      --mdc-typography-subtitle1-line-height: 16px;
      --mdc-theme-primary: rgba(255, 255, 255, 1.0);
      --mdc-select-idle-line-color: transparent;
      --mdc-select-hover-line-color: transparent;
      --mdc-select-outlined-idle-border-color: rgba(255, 255, 255, 0.42);
      --mdc-select-outlined-hover-border-color: rgba(255, 255, 255, 0.87);
      --mdc-select-outlined-disabled-border-color: rgba(255, 255, 255, 0.87);
      --mdc-select-fill-color: transparent;
      --mdc-select-disabled-fill-color: transparent;
      --mdc-select-ink-color: rgba(255, 255, 255, 1.0);
      --mdc-select-label-ink-color: rgba(255, 255, 255, 1.0);
      --mdc-select-focused-label-color: rgba(24, 24, 24, 1.0);
      --mdc-select-disabled-ink-color: rgba(255, 255, 255, 1.0);
      --mdc-select-dropdown-icon-color: rgba(255, 255, 255, 1.0);
      --mdc-select-focused-dropdown-icon-color: rgba(255, 255, 255, 0.42);
      --mdc-select-disabled-dropdown-icon-color: rgba(255, 255, 255, 0.87);
      --mdc-theme-surface: white;
      --mdc-list-vertical-padding: 5px;
      --mdc-list-side-padding: 10px;
      --mdc-menu-item-height: 28px;
      --mdc-list-item__primary-text: {
        height: 20px;
        color: #222222;
      };
      --mdc-select-min-width: 100px;
    }

    mwc-list-item[activated] {
      color: black;
      background-color: #e1e1e1;
    }

    mwc-list-item > mwc-icon {
      font-size: 20px;
      margin: 5px;
    }

    mwc-icon.dropdown-menu {
      color: #242424;
      padding-right: 10px;
    }

    mwc-textfield {
      width: 100%;
    }

    #user-preference-dialog mwc-textfield#secretkey {
      --mdc-typography-subtitle1-font-size: 0.7rem;
    }

    mwc-textarea {
      width: 100%;
    }

    wl-popover-card {
      padding: 5px;
    }

    backend-ai-dialog wl-textfield,
    wl-dialog wl-textfield {
      --input-font-family: var(--general-font-family);
      --input-color-disabled: #222222;
      --input-label-color-disabled: #222222;
      --input-label-font-size: 12px;
      --input-border-style-disabled: 1px solid #cccccc;
    }

    mwc-list-item {
      font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-family: var(--general-font-family);
      --mdc-typography-body2-font-family: var(--general-font-family);
      font-weight: 400;
    }

    a.email:hover {
      color: #29b6f6;
    }

    mwc-menu.user-menu {
      --mdc-theme-surface: #f1f1f1;
      --mdc-menu-item-height: 28px;
      --mdc-menu-min-width: 200px;
      box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    }

    mwc-menu.user-menu mwc-list-item {
      font-size: 14px;
    }


    mwc-icon-button.side-menu {
      --mdc-icon-button-size: 44px;
      --mdc-theme-text-disabled-on-light: var(--paper-grey-800);
    }

    #sidebar-navbar-footer mwc-icon-button {
      --mdc-theme-text-disabled-on-light: var(--paper-grey-800);
    }

    .mini-ui .full-menu {
      display: none;
      margin: 0 !important;
    }

    .mini-menu {
      display: none;
    }

    .mini-ui .mini-menu {
      display: block;
    }

    .sidebar-footer {
      text-align: center;
      margin-left: auto;
      margin-right: auto;
      line-height: 16px;
      font-size: 12px;
      font-weight: 100;
      font-family: var(--general-font-family);
    }

    .portrait-canvas {
      margin-left: 18px;
      border-radius: 8px;
      min-width: 48px; /* only apply this style feature if it's Backend.AI logo */
      width: 48px;
      height: 48px;
      background-color: #ffffff;
      background-image: url('/manifest/backend.ai-brand-simple.svg');
      background-repeat: no-repeat;
      background-size: 36px 36px;
      background-position: center center;
    }

    .mini-ui .portrait-canvas {
      margin-left: 18px;
      padding-right: 0;
    }

    .drawer-menu::-webkit-scrollbar {
      display: none !important;
      -webkit-appearance: none;
      width: 0 !important;
      height: 0;
    }

    .terms-of-use {
      margin-bottom: 10px;
    }

    footer#short-height {
      display: none;
    }

    #portrait-bar {
      height: 64px;
      padding-top: 15px;
    }

    #content-body {
      height: 100vh;
    }

    #main-toolbar {
      background-color: var(--general-menu-background-color);
      color: var(--general-menu-color);
      z-index: 1;
      overflow: visible;
      --mdc-theme-on-primary: black;
      --mdc-theme-primary: rgba(247, 246, 246, 1);
      border-bottom: 1px solid #dbdbdb;
    }

    #main-toolbar > p {
      padding: 10px;
      margin: auto;
      font-size: 14px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: normal;
      letter-spacing: normal;
      color: #090909;
    }

    #content {
      padding-top: 0;
    }

    #sidebar-navbar-footer {
      right: 0;
      left: 0;
      bottom: 0 !important; /* Workaround to prevent miscalculated height */
      text-align: center;
      height: 100px;
      background-color: var(--general-navbar-footer-background-color);
      color: var(--general-sidebar-navbar-footer-color);
    }

    #password-change-request {
      background-color: var(--paper-orange-400);
      color: white;
      font-size: 14px;
      height: 28px;
      position: absolute;
      right: 0;
      width: 100vw;
    }

    #password-change-request > mwc-icon-button > i {
      font-size: 14px;
    }

    @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
      #main-toolbar {
        /*-webkit-backdrop-filter: saturate(180%) blur(20px);
        backdrop-filter: saturate(180%) blur(20px);*/
      }

      #sidebar-navbar-footer {
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        backdrop-filter: saturate(180%) blur(20px);
        border: 0;
      }
    }

    @media screen and (max-width: 449px) {
      #sidebar-navbar-footer {
        background-color: var(--general-navbar-footer-background-color);
        color: var(--general-sidebar-navbar-footer-color);
      }
      div#center-area, span.email, span.full_name, span.log_out {
        display: none;
      }
      mwc-menu#dropdown-menu {
        position: relative;
        left: 12vw;
      }
      mwc-top-app-bar-fixed {
        --mdc-top-app-bar-width: 410px !important;
      }
    }

    @media screen and (max-width: 1030px) {
      span.email, p#project {
        display: none;
      }

      div#welcome-message {
        display: none;
      }
    }

    @media screen and (min-width: 450px) {
      #sidebar-navbar-footer {
        background-color: var(--general-sidebar-background-color);
        color: var(--general-sidebar-color);
      }
    }

    @media screen and (max-height: 953px) {
      footer#short-height {
        display: block;
      }

      footer {
        display: none;
      }
    }

    .temporarily-hide {
      display: none !important;
    }
  `];let ul=class extends js{constructor(){super(),this.active=!0,this.notifications=[]}static get styles(){return[hl,Ls,$s,Ns,Bs,at`
        h3 {
          font-size: 16px;
          color: #242424;
          display: block;
          width: 100%;
          height: 25px;
          padding: 5px 15px;
          border-bottom: 1px solid #cccccc;
        }

        mwc-list {
          padding: 0;
          margin: 0;
        }
      `]}async _viewStateChanged(t){await this.updateComplete}render(){return D`
      <div id="container">
        <h3>${ie("sidepanel.Notification")}</h3>
        <mwc-list>
        ${this.notifications.map((t=>D`
          <mwc-list-item twoline>
            <span>${t.outerText}</span>
            <span slot="secondary">${t.getAttribute("created")}</span>
          </mwc-list-item>
          <li divider role="separator"></li>`))}
          ${0===this.notifications.length?D`
            <div style="padding:15px 0;width:100%;text-align:center;">
              ${ie("sidepanel.NoNotification")}
            </div>
        `:D``}
        </mwc-list>
      </div>
    `}shouldUpdate(){return this.active}firstUpdated(){this.notifications=globalThis.lablupNotification.notifications,document.addEventListener("backend-ai-notification-changed",(()=>this.refresh()))}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}async refresh(){this.notifications=globalThis.lablupNotification.notifications,await this.requestUpdate()}};r([xt({type:Boolean})],ul.prototype,"active",void 0),r([xt({type:Array})],ul.prototype,"notifications",void 0),ul=r([_t("backend-ai-sidepanel-notification")],ul);let pl=class extends js{constructor(){super(),this.active=!0,this.tasks=[]}static get styles(){return[hl,Ls,$s,Ns,Bs,at`
        h3 {
          font-size: 16px;
          color: #242424;
          display: block;
          width: 100%;
          height: 25px;
          padding: 5px 15px;
          border-bottom: 1px solid #cccccc;
        }

        mwc-list {
          padding: 0;
          margin: 0;
        }
      `]}async _viewStateChanged(t){await this.updateComplete}_taskIcon(t){switch(t){case"session":return"subject";case"database":return"dns";case"image":return"extension";case"general":default:return"widget"}}render(){return D`
      <div id="container">
        <h3>${ie("sidepanel.BackgroundTasks")}</h3>
        <mwc-list>
        ${this.tasks.map((t=>D`
          <mwc-list-item graphic="icon" twoline>
            <mwc-icon id="summary-menu-icon" slot="graphic" id="activities-icon" class="fg black">${this._taskIcon(t.tasktype)}</mwc-icon>
            <span>${t.tasktitle}</span>
            <span slot="secondary">${ie("sidepanel.Running")}</span>
          </mwc-list-item>
          <li divider role="separator"></li>`))}
          ${0===this.tasks.length?D`
            <div style="padding:15px 0;width:100%;text-align:center;">
              ${ie("sidepanel.NoBackgroundTask")}
            </div>
        `:D``}
        </mwc-list>
      </div>
    `}shouldUpdate(){return this.active}firstUpdated(){this.tasks=[],document.addEventListener("backend-ai-task-changed",(()=>this.refresh()))}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}async refresh(){this.tasks=globalThis.tasker.taskstore,await this.requestUpdate()}};r([xt({type:Boolean})],pl.prototype,"active",void 0),r([xt({type:Array})],pl.prototype,"tasks",void 0),pl=r([_t("backend-ai-sidepanel-task")],pl);
/**
 @license
 Copyright (c) 2015-2022 Lablup Inc. All rights reserved.
 */
class fl{constructor(t,e,i,r){this.tasktitle=t,this.taskid=i,this.taskobj=e,this.tasktype=r,this.created_at=Date.now(),this.finished_at=0,this.status="active"}remove(){delete this.taskobj}}let ml=class extends vt{constructor(){super(),this.active=!0,this.isGCworking=!1,this.taskstore=[],this.finished=[],this.indicator=globalThis.lablupIndicator,this.pooler=setInterval((()=>{this.gc()}),1e4)}static get styles(){return[at``]}render(){return D`
    `}shouldUpdate(){return this.active}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}add(t,e,i="",r="general"){""===i&&(i=this.generate_UUID());const n=new fl(t,e,i,r);return null!=e&&"function"==typeof e.then&&(e.then().catch((t=>{})).finally((()=>{this.finished.push(i),this.gc()})),this.taskstore.push(n),this.signal(),n)}remove(t=""){const e=this.taskstore.filter((e=>e.taskid===t));if(e.length>0){let i=this.taskstore.indexOf(e[0]);i>-1&&(e[0].remove(),this.taskstore.splice(i,1)),delete e[0],i=this.finished.indexOf(t),i>-1&&this.finished.splice(i,1),this.signal()}}list(){return this.taskstore}generate_UUID(){let t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?i:3&i|8).toString(16)}))}async gc(){this.isGCworking||(this.isGCworking=!0,this.finished.length>0&&this.finished.forEach((t=>{this.remove(t)})),this.isGCworking=!1)}signal(){const t=new CustomEvent("backend-ai-task-changed",{detail:{tasks:this.taskstore}});document.dispatchEvent(t)}};r([xt({type:Object})],ml.prototype,"indicator",void 0),r([xt({type:Array})],ml.prototype,"taskstore",void 0),r([xt({type:Array})],ml.prototype,"finished",void 0),r([xt({type:Object})],ml.prototype,"pooler",void 0),r([xt({type:Boolean})],ml.prototype,"active",void 0),r([xt({type:Boolean})],ml.prototype,"isGCworking",void 0),ml=r([_t("backend-ai-tasker")],ml);var gl=ml;let bl=class extends vt{constructor(){super(),this.dialog=Object(),this.edition="Open Source",this.license="Subscription",this.validUntil="",this.version="",this.managerVersion=""}static get styles(){return[at`
        :host > *, html {
          font-family: var(--general-font-family);
        }

        a,
        a:visited {
          color: #222222;
        }

        a:hover {
          color: #3e872d;
        }

        #splash-panel {
          --dialog-width: 345px;
          --dialog-height: 345px;
          --dialog-border-radius: 10px;
        }

        .splash-header {
          height: 120px;
          background-size: contain;
          background-repeat: no-repeat;
          background-position: left top;
          background-color: RGB(246, 253, 247);
          font-size: 28px;
          font-weight: 400;
          line-height: 60px;
        }

        ul {
          list-style-type: none;
        }

        .splash-information .detail {
          font-weight: 400;
          font-size: 13px;
        }

        .copyright {
          font-size: 12px;
        }

        .release-note {
          font-size: 12px;
        }

      `]}firstUpdated(){this.dialog=this.shadowRoot.querySelector("wl-dialog")}connectedCallback(){super.connectedCallback()}show(){this.edition=globalThis.packageEdition,this.validUntil=globalThis.packageValidUntil,this.version=globalThis.packageVersion,this.managerVersion=globalThis.backendaiclient.managerVersion,"Open Source"!==this.edition?"2099-12-31"===globalThis.packageValidUntil||'""'===this.validUntil||""==this.validUntil?this.license=Dt("license.Perpetual"):this.license=Dt("license.Subscription"):this.license=Dt("license.OpenSource"),this.dialog.show()}hide(){this.dialog.hide()}render(){return D`
      <wl-dialog id="splash-panel" fixed backdrop blockscrolling persistent>
        <div class="splash-header">
          <img src="manifest/backend.ai-text.svg" style="height:50px;padding:35px 20px;" />
          <wl-button style="position:absolute;top:0;right:0;" fab flat inverted @click="${()=>this.hide()}">
            <wl-icon>close</wl-icon>
          </wl-button>
        </div>
        <div class="splash-information">
          <ul>
            <li>Backend.AI Web UI <span id="version-detail" class="detail">${globalThis.packageVersion}</span></li>
            <li><span id="license-detail">${this.edition} Edition</span></li>
            <li><span id="valid-until" class="detail">
              ${"Subscription"===this.license?D`Subscription is active until ${this.validUntil}`:D``}
              ${"Perpetual"===this.license?D`Perpetual License`:D``}
              </span></li>
            <li style="margin-top:15px;"><span id="mode-detail" class="detail">Backend.AI Cluster</span> <span id="manager-build-detail" class="detail">${this.managerVersion}</span></li>
            <li><span id="mode-detail" class="detail">${globalThis.isElectron?"App":"WebServer"}</span> <span id="build-detail" class="detail">Build ${globalThis.buildVersion}</span></li>
          </ul>
          <ul>
            <li>Powered by <a target="_blank" href="https://github.com/lablup/backend.ai/blob/master/LICENSE">open-source software</a></li>
            <li class="copyright">Copyright &copy; 2015-2022 Lablup Inc.</li>
            <li class="release-note">
              <a target="_blank" href="https://github.com/lablup/backend.ai-webui/releases/tag/v${this.version}">Release Note</a>
              <a target="_blank" href="https://github.com/lablup/backend.ai-webui/blob/main/LICENSE">License</a>
            </li>
            </ul>
          </ul>
        </div>
      </wl-dialog>
    `}};r([xt({type:Object})],bl.prototype,"dialog",void 0),r([xt({type:String})],bl.prototype,"edition",void 0),r([xt({type:String})],bl.prototype,"license",void 0),r([xt({type:String})],bl.prototype,"validUntil",void 0),r([xt({type:String})],bl.prototype,"version",void 0),r([xt({type:String})],bl.prototype,"managerVersion",void 0),bl=r([_t("backend-ai-splash")],bl);let vl=class extends za{constructor(){super(...arguments),this.role="banner",this.hideDelay=5e3,this.autoHideTimeout=null}get $focusTrap(){return this.$snackbar}animateIn(){let t=!1;const e=()=>{t||(t=!0,this.didShow())},i=this.$snackbar.animate([{transform:"translateY(100%)",opacity:"0"},{transform:"translateY(0)",opacity:"1"}],this.animationConfig),r=this.$backdrop.animate([{opacity:"0"},{opacity:"1"}],this.animationConfig);r.onfinish=e,i.onfinish=e,this.activeInAnimations.push(i,r)}animateOut(t){null!=this.autoHideTimeout&&window.clearTimeout(this.autoHideTimeout);let e=!1;const i=()=>{e||(e=!0,this.resolve(t),this.didHide(t))},r=this.$snackbar.animate([{transform:"translateY(0)",opacity:"1"},{transform:"translateY(100%)",opacity:"0"}],this.animationConfig),n=this.$backdrop.animate([{opacity:"1"},{opacity:"0"}],this.animationConfig);n.onfinish=i,r.onfinish=i,this.activeOutAnimations.push(r,n)}didShow(){super.didShow(),this.autoHideTimeout=window.setTimeout((()=>{this.persistent||this.hide()}),this.hideDelay)}render(){return Co` <wl-backdrop id="backdrop" @click="${this.clickAway}"></wl-backdrop> <focus-trap id="snackbar" ?inactive="${!this.open||this.disableFocusTrap}"> <div id="content"> <slot name="icon"></slot> <slot></slot> </div> <div id="actions"> <slot name="action"></slot> </div> </focus-trap> `}};vl.styles=[...za.styles,ea(":host{display:none;pointer-events:none;outline:none}:host([open]){display:block}:host([fixed]){padding:var(--snackbar-fixed-padding,.75rem);z-index:var(--snackbar-z-index,12345678);position:fixed;left:0;bottom:0;top:0;right:0}:host([fixed][open]){display:flex;align-items:flex-end}#snackbar{padding:var(--snackbar-padding,.375rem);color:var(--snackbar-color,hsl(var(--background,var(--background-hue,0),var(--background-saturation,0%),var(--background-lightness,100%))));background:var(--snackbar-bg,hsl(var(--foreground,var(--foreground-hue,230),var(--foreground-saturation,70%),var(--foreground-lightness,5%))));border-radius:var(--snackbar-border-radius,.5rem);box-shadow:var(--snackbar-elevation,var(--elevation-1,0 .3125rem .625rem -.125rem hsla(var(--shadow,var(--shadow-hue,230),var(--shadow-saturation,70%),var(--shadow-lightness,5%)),.15)));flex-wrap:wrap;justify-content:flex-end;text-align:left;position:relative;pointer-events:all}#actions,#content,#snackbar{display:flex;align-items:center;flex-wrap:wrap}::slotted([slot=icon]){margin:var(--snackbar-icon-margin,0 .75rem 0 0);color:var(--snackbar-icon-color,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))))}#content{padding:var(--snackbar-content-padding,.375rem .75rem);flex-grow:1}")],r([Vo({type:String,reflect:!0}),n("design:type",String)],vl.prototype,"role",void 0),r([Vo({type:Number}),n("design:type",Object)],vl.prototype,"hideDelay",void 0),r([Wo("#backdrop"),n("design:type",ka)],vl.prototype,"$backdrop",void 0),r([Wo("#snackbar"),n("design:type",Ma)],vl.prototype,"$snackbar",void 0),vl=r([qo("wl-snackbar")],vl);
/**
 @license
 Copyright (c) 2015-2022 Lablup Inc. All rights reserved.
 */
let yl=class extends vt{constructor(){super(),this.text="",this.detail="",this.url="",this.message="",this.requestUrl="",this.status="",this.timestamp="",this.active=!0,this.supportDesktopNotification=!1,this.step=0,this.newDesktopNotification=Object(),this.options=Object(),this.options={desktop_notification:!0},this.notifications=[],this.notificationstore=[]}static get is(){return"lablup-notification"}static get styles(){return[at`
        wl-snackbar {
          position: fixed;
          right: 20px;
          font-size: 16px;
          font-weight: 400;
          font-family: 'Ubuntu', Roboto, sans-serif;
          z-index: 12345678;
        }

        wl-button {
          --button-font-size: 11px;
          --button-fab-size: 12px;
        }

        wl-icon {
          --icon-size: 10px;
        }
      `]}render(){return D``}shouldUpdate(){return this.active}firstUpdated(){"Notification"in window&&Promise.resolve(Notification.requestPermission()).then((t=>{["default","granted","denied"].includes(t)&&(this.supportDesktopNotification=!0)})),this._readUserSetting("desktop_notification",!0),!1===this.options.desktop_notification&&(this.supportDesktopNotification=!1)}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}_readUserSetting(t,e=!0){const i=localStorage.getItem("backendaiwebui.usersetting."+t);this.options[t]=null!==i&&""!=i&&'""'!=i?"false"!==i&&("true"===i||i):e}_hideNotification(t){t.target.closest("wl-snackbar").hide()}_moreNotification(t){this._hideNotification(t);const e=globalThis.location.toString().split(/[/]+/).pop();if(globalThis.history.pushState({},"","/usersettings"),Se.dispatch(ve(decodeURIComponent("/usersettings"),{tab:"logs"})),e&&"usersettings"===e){const t=new CustomEvent("backend-ai-usersettings-logs",{});document.dispatchEvent(t)}}_createCloseButton(t){const e=document.createElement("wl-button");e.setAttribute("slot","action"),e.setAttribute("flat",""),e.setAttribute("fab",""),e.addEventListener("click",this._hideNotification.bind(this)),e.innerHTML="<wl-icon>close</wl-icon>",t.appendChild(e)}async show(t=!1,e=Object()){const i=document.querySelector("wl-snackbar[persistent='true']");i&&(this.notifications=[],document.body.removeChild(i)),this.gc();const r=document.createElement("wl-snackbar");if(r.innerHTML='<span style="overflow-x:hidden">'+this.text+"</span>",""!=this.detail&&(r.innerHTML=r.innerHTML+'<div style="display:none;"> : '+this.detail+"</div>"),0!==Object.keys(e).length&&(console.log(e),this._saveToLocalStorage("backendaiwebui.logs",e)),""!==this.detail){const t=document.createElement("wl-button");t.style.fontSize="12px",t.setAttribute("slot","action"),t.setAttribute("flat",""),t.setAttribute("fab",""),t.style.width="80px",""!=this.url?(t.innerHTML=Dt("notification.Visit"),t.addEventListener("click",this._openURL.bind(this,this.url))):(t.innerHTML=Dt("notification.SeeDetail"),t.addEventListener("click",this._moreNotification.bind(this))),r.appendChild(t)}this.detail="",this.url="",!1===t?r.setAttribute("hideDelay","3000"):(r.setAttribute("persistent","true"),this._createCloseButton(r)),r.setAttribute("backdrop",""),r.style.bottom=20+55*this.step+"px",r.style.position="fixed",r.querySelector("span").style.overflowX="hidden",r.querySelector("span").style.maxWidth="70vw",r.style.right="20px",r.style.fontSize="16px",r.style.fontWeight="400",r.style.fontFamily="'Ubuntu', Roboto, sans-serif",r.style.zIndex="12345678";const n=new Date;r.setAttribute("created",n.toLocaleString()),document.body.appendChild(r),this.notifications.push(r),await this.updateComplete,r.show();const o=new CustomEvent("backend-ai-notification-changed",{});document.dispatchEvent(o),this._spawnDesktopNotification("Backend.AI",this.text,"")}_spawnDesktopNotification(t,e,i){if(!1===this.supportDesktopNotification)return;const r={body:e,icon:i};this.newDesktopNotification=new Notification(t,r)}_openURL(t){window.open(t,"_blank")}_saveToLocalStorage(t,e){console.log(e);const i=JSON.parse(localStorage.getItem(t)||"{}");let r=[];r.push(e),r=r.concat(i),localStorage.setItem(t,JSON.stringify(r))}gc(){if(this.notifications.length>0){const t=this.notifications.filter((t=>!0===t.open));this.notifications=t;const e=new CustomEvent("backend-ai-notification-changed",{});document.dispatchEvent(e)}let t=JSON.parse(localStorage.getItem("backendaiwebui.logs")||"{}");t.length>3e3&&(t=t.slice(0,2999)),this.step=this.notifications.length,localStorage.setItem("backendaiwebui.logs",JSON.stringify(t))}};r([xt({type:String})],yl.prototype,"text",void 0),r([xt({type:String})],yl.prototype,"detail",void 0),r([xt({type:String})],yl.prototype,"url",void 0),r([xt({type:String})],yl.prototype,"message",void 0),r([xt({type:String})],yl.prototype,"requestUrl",void 0),r([xt({type:String})],yl.prototype,"status",void 0),r([xt({type:String})],yl.prototype,"timestamp",void 0),r([xt({type:Object})],yl.prototype,"indicator",void 0),r([xt({type:Array})],yl.prototype,"notifications",void 0),r([xt({type:Array})],yl.prototype,"notificationstore",void 0),r([xt({type:Boolean})],yl.prototype,"active",void 0),r([xt({type:Boolean})],yl.prototype,"supportDesktopNotification",void 0),r([xt({type:Number})],yl.prototype,"step",void 0),r([xt({type:Object})],yl.prototype,"newDesktopNotification",void 0),r([xt({type:Object})],yl.prototype,"options",void 0),yl=r([_t("lablup-notification")],yl);var _l=function(){var t=this;this.updateInterval=1e3,this.tabId=Math.random().toString(36).substring(7),this.tabsCounter=0,this.onTabCountUpdate=[],this.updateActiveInterval=0,this.tabsCount=function(e){void 0===e&&(e=!0);var i=t.getData(),r=Object.keys(i.list),n=Date.now(),o=0;return r.forEach((function(e){i.list[e].lastActive+1.2*t.updateInterval>n&&o++})),e||t.tabsCounter===o||t.onTabCountUpdate.forEach((function(t){t(o)})),t.tabsCounter=o},this.updateActive=function(){var e=t.getData(),i=Date.now();void 0===e.list[t.tabId]&&(e.list[t.tabId]={TabOpenedTimeStamp:i}),e.list[t.tabId].url=window.location.href,e.list[t.tabId].lastActive=i,(void 0===e.lastCleaned||+e.lastCleaned+2e4<i)&&(e=t.clearList(e)),t.updateData(e),t.tabsCount(!1)},this.clearList=function(e){var i=Object.keys(e.list),r=Date.now();return i.forEach((function(i){e.list[i].lastActive+Math.max(8e3,1.5*t.updateInterval)<r&&delete e.list[i]})),e.lastCleaned=r,e},this.onTabChange=function(e,i){void 0===i&&(i=!1),"function"==typeof e&&(t.onTabCountUpdate.push(e),i&&e(t.tabsCount()))},this.updateData=function(t){localStorage.setItem("tabCountData","string"==typeof t?t:JSON.stringify(t))},this.getData=function(){var t=localStorage.getItem("tabCountData");return null==t?{list:{},lastCleaned:0}:JSON.parse(t)},this.getUrls=function(e){void 0===e&&(e=!1);var i=t.getData(),r=[];return Object.keys(i.list).forEach((function(t){e&&-1!==r.indexOf(i.list[t].url)||r.push(i.list[t].url)})),r},this.setUpdateInterval=function(e){void 0===e&&(e=t.updateInterval),null!==t.updateActiveInterval&&t.pause(),t.start(e)},this.pause=function(){clearInterval(t.updateActiveInterval),t.updateActiveInterval=0},this.start=function(e){void 0===e&&(e=t.updateInterval),t.updateActiveInterval=setInterval((function(){t.updateActive()}),t.updateInterval=e)},this.updateActive(),this.start(),window.onbeforeunload=function(e){var i=t.getData();delete i.list[t.tabId],t.updateData(i)}};let wl=class extends Ln{static get styles(){return[$n,at`
        .mdc-select__anchor {
          min-width: var(--mdc-select-min-width, 200px);
        }
        .mdc-select--filled {
          min-width: var(--mdc-select-min-width, 200px);
        }
      `]}};wl=r([_t("mwc-multi-select")],wl),$t({loader:t=>fetch(`/resources/i18n/${t}.json`).then((t=>t.json()))}),globalThis.backendaioptions=new cl,globalThis.tasker=new gl,globalThis.backendaiutils=new Us;let xl=class extends(oe(Se)(vt)){constructor(){super(),this.hasLoadedStrings=!1,this.menuTitle="LOGIN REQUIRED",this.siteDescription="",this.user_id="DISCONNECTED",this.full_name="DISCONNECTED",this.domain="CLICK TO CONNECT",this.is_connected=!1,this.is_admin=!1,this.is_superadmin=!1,this.allow_signout=!1,this.needPasswordChange=!1,this.proxy_url="",this.connection_mode="API",this.connection_server="",this.edition="Open Source",this.validUntil="",this.groups=[],this.current_group="",this.plugins=Object(),this.splash=Object(),this.loginPanel=Object(),this._page="",this._lazyPage="",this._pageParams={},this._sidepanel="",this._drawerOpened=!1,this._offlineIndicatorOpened=!1,this._offline=!1,this._dropdownMenuIcon=Object(),this.config=Object(),this.TOSdialog=Object(),this.mini_ui=!1,this.auto_logout=!1,this.lang="default",this.supportLanguageCodes=["en","ko","ru","fr","mn","id"],this.minibarWidth=88,this.sidebarWidth=250,this.sidepanelWidth=250,this.supports=Object(),this.availablePages=["summary","verify-email","change-password","job","data","pipeline","statistics","usersettings","credential","environment","agent","settings","maintenance","information","github","import","unauthorized"],this.adminOnlyPages=["experiment","credential","environment","agent","settings","maintenance","information"],this.superAdminOnlyPages=["agent","settings","maintenance","information"],this.timeoutSec=5,this.use_experiment=!1,this.loggedAccount=Object(),this.roleInfo=Object(),this.keyPairInfo=Object(),this.blockedMenuitem=[]}static get styles(){return[hl,Ls,$s,Ns,Bs]}firstUpdated(){var t,e;let i;globalThis.lablupNotification=this.shadowRoot.querySelector("#notification"),globalThis.lablupIndicator=this.shadowRoot.querySelector("#indicator"),globalThis.appLauncher=this.shadowRoot.querySelector("#app-launcher"),globalThis.resourceBroker=this.shadowRoot.querySelector("#resource-broker"),globalThis.currentPage=this._page,globalThis.currentPageParams=this._pageParams,this.notification=globalThis.lablupNotification,this.appBody=this.shadowRoot.querySelector("#app-body"),this.appPage=this.shadowRoot.querySelector("#app-page"),this.contentBody=this.shadowRoot.querySelector("#content-body"),this.contentBody.type="dismissible",this.mainToolbar=this.shadowRoot.querySelector("#main-toolbar"),this.drawerToggleButton=this.shadowRoot.querySelector("#drawer-toggle-button"),this.sidebarMenu=this.shadowRoot.getElementById("sidebar-menu"),this.splash=this.shadowRoot.querySelector("#about-backendai-panel"),this.loginPanel=this.shadowRoot.querySelector("#login-panel"),this.TOSdialog=this.shadowRoot.querySelector("#terms-of-service"),this._dropdownMenuIcon=this.shadowRoot.querySelector("#dropdown-button"),globalThis.isElectron&&navigator.platform.indexOf("Mac")>=0&&(this.shadowRoot.querySelector(".portrait-canvas").style.visibility="hidden"),t=t=>Se.dispatch(ve(decodeURIComponent(t.pathname))),document.body.addEventListener("click",(e=>{if(e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey)return;const i=e.composedPath().filter((t=>"A"===t.tagName))[0];if(!i||i.target||i.hasAttribute("download")||"external"===i.getAttribute("rel"))return;const r=i.href;if(!r||-1!==r.indexOf("mailto:"))return;const n=window.location,o=n.origin||n.protocol+"//"+n.host;0===r.indexOf(o)&&(e.preventDefault(),r!==n.href&&(window.history.pushState({},"",r),t(n,e)))})),window.addEventListener("popstate",(e=>t(window.location,e))),t(window.location,null),e=t=>Se.dispatch(xe(t)),window.addEventListener("online",(()=>e(!1))),window.addEventListener("offline",(()=>e(!0))),e(!1===navigator.onLine),globalThis.isElectron?(i="./config.toml",document.addEventListener("backend-ai-logout",(()=>this.logout(!0))),document.addEventListener("backend-ai-app-close",(()=>this.close_app_window(!0))),document.addEventListener("backend-ai-show-splash",(()=>this.splash.show()))):(i="../../config.toml",document.addEventListener("backend-ai-logout",(()=>this.logout(!1)))),globalThis.addEventListener("beforeunload",(function(t){globalThis.backendaioptions.set("last_window_close_time",(new Date).getTime()/1e3)})),this._parseConfig(i).then((()=>{if(this.loadConfig(this.config),void 0===globalThis.backendaiclient||null===globalThis.backendaiclient||!1===globalThis.backendaiclient.ready)if("verify-email"===this._page){const t=this.shadowRoot.querySelector("backend-ai-email-verification-view");window.setTimeout((()=>{t.verify(this.loginPanel.api_endpoint)}),1e3)}else if("change-password"===this._page){const t=this.shadowRoot.querySelector("backend-ai-change-forgot-password-view");window.setTimeout((()=>{t.open(this.loginPanel.api_endpoint)}),1e3)}else if("edu-applauncher"===this._page){const t=this.shadowRoot.querySelector("backend-ai-edu-applauncher");window.setTimeout((()=>{t.launch(this.loginPanel.api_endpoint)}),1e3)}else{const t=new _l,e=window.performance.navigation&&1===window.performance.navigation.type||window.performance.getEntriesByType("navigation").map((t=>t.type)).includes("reload");t.tabsCount(!0),!0!==this.auto_logout||1!==t.tabsCounter||e?this.loginPanel.login(!1):this.loginPanel.check_login().then((t=>{const e=(new Date).getTime()/1e3;!0===t&&e-globalThis.backendaioptions.get("last_window_close_time",e)>3?this.loginPanel._logoutSession().then((()=>{this.loginPanel.open()})):!0===t?this.loginPanel.login(!1):this.loginPanel.open()}))}})).catch((t=>{console.log("Initialization failed."),void 0!==globalThis.backendaiclient&&null!==globalThis.backendaiclient&&!1!==globalThis.backendaiclient.ready||this.loginPanel.block("Configuration is not loaded.","Error")})),this.mini_ui=globalThis.backendaioptions.get("compact_sidebar"),globalThis.mini_ui=this.mini_ui,this._changeDrawerLayout(document.body.clientWidth,document.body.clientHeight),globalThis.addEventListener("resize",(t=>{this._changeDrawerLayout(document.body.clientWidth,document.body.clientHeight),document.body.dispatchEvent(new Event("click"))})),document.addEventListener("current-user-info-changed",(t=>{if(globalThis.backendaiclient.supports("change-user-name")){const e=t.detail;this._updateFullname(e.full_name)}}))}async connectedCallback(){super.connectedCallback(),document.addEventListener("backend-ai-connected",(()=>this.refreshPage()));const t=globalThis.navigator.language.split("-")[0];"default"===globalThis.backendaioptions.get("language")&&this.supportLanguageCodes.includes(t)?this.lang=t:this.supportLanguageCodes.includes(globalThis.backendaioptions.get("language"))?this.lang=globalThis.backendaioptions.get("language"):this.lang="en",globalThis.backendaioptions.set("current_language",this.lang),await Bt(this.lang),this.hasLoadedStrings=!0}disconnectedCallback(){document.removeEventListener("backend-ai-connected",(()=>this.refreshPage())),super.disconnectedCallback()}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}loadConfig(t){if(void 0!==t.general&&"siteDescription"in t.general&&(this.siteDescription=t.general.siteDescription),void 0!==t.general&&"connectionMode"in t.general&&(this.connection_mode=t.general.connectionMode),void 0!==t.general&&"connectionServer"in t.general&&(this.connection_server=t.general.connectionServer),void 0!==t.general&&"autoLogout"in t.general&&null===globalThis.backendaioptions.get("auto_logout")?this.auto_logout=t.general.autoLogout:this.auto_logout=globalThis.backendaioptions.get("auto_logout",!1),void 0!==t.license&&"edition"in t.license&&(this.edition=t.license.edition),void 0!==t.menu&&"blocklist"in t.menu&&(this.blockedMenuitem=t.menu.blocklist.split(",")),void 0!==t.general&&"maskUserInfo"in t.general&&(this.isUserInfoMaskEnabled=t.general.maskUserInfo),globalThis.packageEdition=this.edition,void 0!==t.license&&"validUntil"in t.license&&(this.validUntil=t.license.validUntil),globalThis.packageValidUntil=this.validUntil,void 0===t.general||void 0===t.general.allowSignout||""===t.general.allowSignout||0==t.general.allowSignout?this.allow_signout=!1:this.allow_signout=!0,void 0!==t.plugin&&("login"in t.plugin&&(this.plugins.login=t.plugin.login),"page"in t.plugin)){this.plugins.page=[],this.plugins.menuitem=[],this.plugins["menuitem-user"]=[],this.plugins["menuitem-admin"]=[],this.plugins["menuitem-superadmin"]=[];const e=[];for(const i of t.plugin.page.split(","))e.push(import("../plugins/"+i+".js").then((t=>{const e=document.createElement(i);switch(e.classList.add("page"),e.setAttribute("name",i),this.appPage.appendChild(e),this.plugins.menuitem.push(i),this.availablePages.push(i),e.permission){case"superadmin":this.plugins["menuitem-superadmin"].push(i),this.adminOnlyPages.push(i);break;case"admin":this.plugins["menuitem-admin"].push(i),this.adminOnlyPages.push(i);break;default:this.plugins["menuitem-user"].push(i)}return this.plugins.page.push({name:i,url:i,menuitem:e.menuitem}),Promise.resolve(!0)})));Promise.all(e).then((t=>{globalThis.backendaiPages=this.plugins.page;const e=new CustomEvent("backend-ai-plugin-loaded",{detail:!0});document.dispatchEvent(e),this.requestUpdate()}))}this.loginPanel.refreshWithConfig(t)}refreshPage(){this.shadowRoot.getElementById("sign-button").icon="exit_to_app",this.loggedAccount.access_key=globalThis.backendaiclient._config.accessKey,this.isUserInfoMaskEnabled=globalThis.backendaiclient._config.maskUserInfo,this.needPasswordChange=globalThis.backendaiclient.need_password_change,globalThis.backendaiclient.proxyURL=this.proxy_url,void 0!==globalThis.backendaiclient&&null!=globalThis.backendaiclient&&void 0!==globalThis.backendaiclient.is_admin&&!0===globalThis.backendaiclient.is_admin?this.is_admin=!0:this.is_admin=!1,void 0!==globalThis.backendaiclient&&null!=globalThis.backendaiclient&&void 0!==globalThis.backendaiclient.is_superadmin&&!0===globalThis.backendaiclient.is_superadmin?this.is_superadmin=!0:this.is_superadmin=!1,this._refreshUserInfoPanel(),globalThis.backendaiutils._writeRecentProjectGroup(this.current_group),document.body.style.backgroundImage="none",this.appBody.style.visibility="visible";const t=this.shadowRoot.getElementById("loading-curtain");t.classList.add("visuallyhidden"),t.addEventListener("transitionend",(()=>{t.classList.add("hidden"),this.is_connected=!0}),{capture:!1,once:!0,passive:!1}),this.addTooltips(),this.sidebarMenu.style.minHeight=this.is_admin||this.is_superadmin?"600px":"250px",this.is_admin||this.is_superadmin||(this.adminOnlyPages.includes(this._page)||"unauthorized"===this._page)&&(this._page="unauthorized",globalThis.history.pushState({},"","/unauthorized"),Se.dispatch(ve(decodeURIComponent(this._page)))),!this.is_superadmin&&this.superAdminOnlyPages.includes(this._page)&&(this._page="unauthorized",globalThis.history.pushState({},"","/unauthorized"),Se.dispatch(ve(decodeURIComponent(this._page))))}showUpdateNotifier(){const t=this.shadowRoot.getElementById("backend-ai-indicator");t.innerHTML='New Web UI is available. Please <a onclick="globalThis.location.reload()">reload</a> to update.',t.show()}_parseConfig(t,e=!1){return fetch(t).then((t=>200==t.status?t.text():"")).then((t=>{const i=Fn(t);if(e)return i;this.config=Fn(t)})).catch((t=>{console.log("Configuration file missing.")}))}toggleSidebarUI(){!0===this.contentBody.open&&(this._sidepanel="",this.toggleSidePanelUI()),this.mini_ui?this.mini_ui=!1:this.mini_ui=!0,globalThis.mini_ui=this.mini_ui;const t=new CustomEvent("backend-ai-ui-changed",{detail:{"mini-ui":this.mini_ui}});document.dispatchEvent(t),this._changeDrawerLayout(document.body.clientWidth,document.body.clientHeight)}toggleSidePanelUI(){this.contentBody.open?(this.contentBody.open=!1,this.mini_ui?this.mainToolbar.style.setProperty("--mdc-drawer-width",this.minibarWidth+"px"):this.mainToolbar.style.setProperty("--mdc-drawer-width",this.sidebarWidth+"px")):(this.contentBody.open=!0,this.contentBody.style.setProperty("--mdc-drawer-width",this.sidepanelWidth+"px"),this.mini_ui?this.mainToolbar.style.setProperty("--mdc-drawer-width",this.minibarWidth+this.sidepanelWidth+"px"):this.mainToolbar.style.setProperty("--mdc-drawer-width",this.sidebarWidth+this.sidepanelWidth+"px"))}toggleSidePanelType(){this.contentBody.type,this.contentBody.type}_openSidePanel(t){document.body.clientWidth<750&&(this.mini_ui=!0,this._changeDrawerLayout(document.body.clientWidth,document.body.clientHeight,!0)),!0===this.contentBody.open?t!=this._sidepanel?this._sidepanel=t:(this._sidepanel="",this.toggleSidePanelUI()):(this._sidepanel=t,this.toggleSidePanelUI())}_changeDrawerLayout(t,e,i=!1){this.mainToolbar.style.setProperty("--mdc-drawer-width","0px"),t<700&&!i?(this.appBody.style.setProperty("--mdc-drawer-width",this.sidebarWidth+"px"),this.appBody.type="modal",this.appBody.open=!1,this.contentBody.style.width=t+"px",this.mainToolbar.style.setProperty("--mdc-drawer-width","0px"),this.drawerToggleButton.style.display="block",this.mini_ui&&(this.mini_ui=!1,globalThis.mini_ui=this.mini_ui),this.contentBody.open&&(this.contentBody.open=!1)):(this.mini_ui?(this.appBody.style.setProperty("--mdc-drawer-width",this.minibarWidth+"px"),this.mainToolbar.style.setProperty("--mdc-drawer-width",this.minibarWidth+"px"),this.contentBody.style.width=t-this.minibarWidth+"px",this.contentBody.open&&this.mainToolbar.style.setProperty("--mdc-drawer-width",this.minibarWidth+this.sidebarWidth+"px")):(this.appBody.style.setProperty("--mdc-drawer-width",this.sidebarWidth+"px"),this.mainToolbar.style.setProperty("--mdc-drawer-width",this.sidebarWidth+"px"),this.contentBody.style.width=t-this.sidebarWidth+"px",this.contentBody.open&&this.mainToolbar.style.setProperty("--mdc-drawer-width",this.sidebarWidth+this.sidepanelWidth+"px")),this.appBody.type="dismissible",this.appBody.open=!0,this.drawerToggleButton.style.display="none"),this.contentBody.open&&this.contentBody.style.setProperty("--mdc-drawer-width",this.sidepanelWidth+"px")}_refreshUserInfoPanel(){this.user_id=globalThis.backendaiclient.email,this.full_name=globalThis.backendaiclient.full_name,this.domain=globalThis.backendaiclient._config.domainName,this.current_group=globalThis.backendaiutils._readRecentProjectGroup(),this._showRole(),globalThis.backendaiclient.current_group=this.current_group,this.groups=globalThis.backendaiclient.groups;const t=this.shadowRoot.getElementById("group-select-box");t.hasChildNodes()&&t.removeChild(t.firstChild);const e=document.createElement("div");e.className="horizontal center center-justified layout";const i=document.createElement("mwc-select");i.id="group-select",i.value=this.current_group,i.style="width: auto;max-width: 200px;",i.addEventListener("selected",(t=>this.changeGroup(t)));let r=document.createElement("mwc-list-item");r.setAttribute("disabled","true"),r.innerHTML=Dt("webui.menu.SelectProject"),r.style.borderBottom="1px solid #ccc",i.appendChild(r),this.groups.map((t=>{r=document.createElement("mwc-list-item"),r.value=t,this.current_group===t?r.selected=!0:r.selected=!1,r.innerHTML=t,i.appendChild(r)})),e.appendChild(i),t.appendChild(e)}_loadPageElement(){"index.html"!==this._page&&""!==this._page||(this._page="summary")}async _openUserPrefDialog(){this._showKeypairInfo();this.shadowRoot.querySelector("#user-preference-dialog").show()}_hideUserPrefDialog(){this.shadowRoot.querySelector("#user-preference-dialog").hide()}_togglePasswordVisibility(t){const e=t.__on,i=t.closest("div").querySelector("mwc-textfield");e?i.setAttribute("type","text"):i.setAttribute("type","password")}_validatePassword1(){const t=this.shadowRoot.querySelector("#pref-new-password");this.shadowRoot.querySelector("#pref-new-password2").reportValidity(),t.validityTransform=(e,i)=>i.valid?{valid:i.valid,customError:!i.valid}:i.valueMissing?(t.validationMessage=Dt("signup.PasswordInputRequired"),{valid:i.valid,customError:!i.valid}):(t.validationMessage=Dt("signup.PasswordInvalid"),{valid:i.valid,customError:!i.valid})}_validatePassword2(){const t=this.shadowRoot.querySelector("#pref-new-password2");t.validityTransform=(e,i)=>{if(i.valid){const e=this.shadowRoot.querySelector("#pref-new-password").value===t.value;return e||(t.validationMessage=Dt("signup.PasswordNotMatched")),{valid:e,customError:!e}}return i.valueMissing?(t.validationMessage=Dt("signup.PasswordInputRequired"),{valid:i.valid,customError:!i.valid}):(t.validationMessage=Dt("signup.PasswordInvalid"),{valid:i.valid,customError:!i.valid})}}_validatePassword(){this._validatePassword1(),this._validatePassword2()}_updateUserInformation(){globalThis.backendaiclient.supports("change-user-name")&&this._updateFullname(),this._updateUserPassword()}async _updateFullname(t=""){if((t=""===t?this.shadowRoot.querySelector("#pref-original-name").value:t).length>64)return this.notification.text=Dt("webui.menu.FullNameInvalid"),void this.notification.show();globalThis.backendaiclient.supports("change-user-name")?t&&t!==this.full_name&&globalThis.backendaiclient.update_full_name(this.user_id,t).then((e=>{this.notification.text=Dt("webui.menu.FullnameUpdated"),this.notification.show(),this.full_name=globalThis.backendaiclient.full_name=t,this.shadowRoot.querySelector("#pref-original-name").value=this.full_name})).catch((t=>t&&t.message?(this.notification.text=t.message,this.notification.detail=t.message,void this.notification.show(!0,t)):t&&t.title?(this.notification.text=t.title,this.notification.detail=t.message,void this.notification.show(!0,t)):void 0)):(this.notification.text=Dt("error.APINotSupported"),this.notification.show())}async _updateUserPassword(){const t=this.shadowRoot.querySelector("#user-preference-dialog"),e=t.querySelector("#pref-original-password").value,i=t.querySelector("#pref-new-password"),r=t.querySelector("#pref-new-password2");if(!e&&!i.value&&!r.value)return void this._hideUserPrefDialog();if(!e)return this.notification.text=Dt("webui.menu.InputOriginalPassword"),void this.notification.show();if(!i.value||!i.validity.valid)return this.notification.text=Dt("webui.menu.InvalidPasswordMessage"),void this.notification.show();if(i.value!==r.value)return this.notification.text=Dt("webui.menu.NewPasswordMismatch"),void this.notification.show();globalThis.backendaiclient.update_password(e,i.value,r.value).then((t=>{this.notification.text=Dt("webui.menu.PasswordUpdated"),this.notification.show(),this._hideUserPrefDialog()})).catch((t=>t&&t.message?(this.notification.text=t.message,this.notification.detail=t.message,void this.notification.show(!0,t)):t&&t.title?(this.notification.text=t.title,this.notification.detail=t.message,void this.notification.show(!0,t)):void 0)).finally((()=>{this.shadowRoot.querySelector("#pref-original-password").value="",this.shadowRoot.querySelector("#pref-new-password").value="",this.shadowRoot.querySelector("#pref-new-password2").value=""}))}_menuSelected(t){}updated(t){if(t.has("_page")){let t=this._page;if(!0!==this.availablePages.includes(t)){const e=t.split(/[/]+/).pop();void 0!==e&&(t=e)}this._page=t,this._updateSidebar(t)}}_updateSidebar(t){switch(t){case"summary":case"verify-email":this.menuTitle=Dt("webui.menu.Summary");break;case"change-password":this.menuTitle=Dt("webui.menu.Summary")+this.user_id;break;case"job":this.menuTitle=Dt("webui.menu.Sessions");break;case"experiment":this.menuTitle=Dt("webui.menu.Experiments");break;case"data":this.menuTitle=Dt("webui.menu.Data&Storage");break;case"pipeline":this.menuTitle=Dt("webui.menu.Pipeline");break;case"statistics":this.menuTitle=Dt("webui.menu.Statistics");break;case"usersettings":this.menuTitle=Dt("webui.menu.Settings&Logs");break;case"credential":this.menuTitle=Dt("webui.menu.UserCredentials&Policies");break;case"environment":this.menuTitle=Dt("webui.menu.Environments&Presets");break;case"agent":this.menuTitle=Dt("webui.menu.ComputationResources");break;case"settings":this.menuTitle=Dt("webui.menu.Configurations");break;case"maintenance":this.menuTitle=Dt("webui.menu.Maintenance");break;case"information":this.menuTitle=Dt("webui.menu.Information");break;case"logs":this.menuTitle=Dt("webui.menu.Logs");break;case"github":case"import":this.menuTitle=Dt("webui.menu.Import&Run");break;default:if("menuitem"in this.plugins&&this.plugins.menuitem.includes(t)){this.menuTitle=t;break}"error"!==this._page&&(this._lazyPage=this._page),document.addEventListener("backend-ai-plugin-loaded",(()=>{if(this._page=this._lazyPage,!0!==this.availablePages.includes(this._page)&&(this._page="error"),"menuitem"in this.plugins&&this.plugins.menuitem.includes(this._page)){const t=this.shadowRoot.querySelector(this._page);t.active=!0,t.setAttribute("active",!0),t.render()}}))}}async close_app_window(t=!1){if(!1===globalThis.backendaioptions.get("preserve_login")){this.notification.text=Dt("webui.CleanUpLoginSession"),this.notification.show();const t=Object.keys(localStorage);for(let e=0;e<t.length;e++){const i=t[e];/^(BackendAIWebUI\.login\.)/.test(i)&&localStorage.removeItem(i)}sessionStorage.clear()}void 0!==globalThis.backendaiclient&&null!==globalThis.backendaiclient&&("SESSION"===globalThis.backendaiclient._config.connectionMode&&await globalThis.backendaiclient.logout(),globalThis.backendaiclient=null)}async logout(t=!1){if(console.log("also close the app:",t),globalThis.backendaiutils._deleteRecentProjectGroupInfo(),void 0!==globalThis.backendaiclient&&null!==globalThis.backendaiclient){this.notification.text=Dt("webui.CleanUpNow"),this.notification.show(),"SESSION"===globalThis.backendaiclient._config.connectionMode&&await globalThis.backendaiclient.logout(),this.is_admin=!1,this.is_superadmin=!1,globalThis.backendaiclient=null;const e=Object.keys(localStorage);for(let t=0;t<e.length;t++){const i=e[t];/^(BackendAIWebUI\.login\.)/.test(i)&&localStorage.removeItem(i)}if(sessionStorage.clear(),!0===t);else if(globalThis.isElectron){this.user_id="",this.domain="",this._page="summary",globalThis.history.pushState({},"","/summary"),Se.dispatch(ve(decodeURIComponent("/"))),document.body.style.backgroundImage='url("/resources/images/loading-background-large.jpg")',this.appBody.style.visibility="hidden";const t=this.shadowRoot.getElementById("loading-curtain");t.classList.remove("visuallyhidden"),t.addEventListener("transitionend",(()=>{t.classList.remove("hidden")}),{capture:!1,once:!0,passive:!1}),this.loginPanel.open()}else globalThis.location.reload()}}updateTitleColor(t,e){this.shadowRoot.querySelector("#main-toolbar").style.setProperty("--mdc-theme-primary",t),this.shadowRoot.querySelector("#main-toolbar").style.color=e}changeGroup(t){globalThis.backendaiclient.current_group=t.target.value,this.current_group=globalThis.backendaiclient.current_group,globalThis.backendaiutils._writeRecentProjectGroup(globalThis.backendaiclient.current_group);const e=new CustomEvent("backend-ai-group-changed",{detail:globalThis.backendaiclient.current_group});document.dispatchEvent(e)}toggleDrawer(){const t=this.shadowRoot.querySelector("mwc-drawer");!0===t.open?t.open=!1:t.open=!0}_toggleDropdown(){const t=this.shadowRoot.querySelector("#dropdown-menu"),e=this._dropdownMenuIcon;t.anchor=e,t.open=!t.open}showTOSAgreement(){this.TOSdialog.tosContent="",this.TOSdialog.tosLanguage=this.lang,this.TOSdialog.title=Dt("webui.menu.TermsOfService"),this.TOSdialog.tosEntry="terms-of-service",this.TOSdialog.open()}showPPAgreement(){this.TOSdialog.tosContent="",this.TOSdialog.tosLanguage=this.lang,this.TOSdialog.title=Dt("webui.menu.PrivacyPolicy"),this.TOSdialog.tosEntry="privacy-policy",this.TOSdialog.open()}_moveTo(t){const e=t.split("/")[1];if(!this.availablePages.includes(e)&&this.is_admin&&!this.adminOnlyPages.includes(e))return Se.dispatch(ve(decodeURIComponent("/error"))),void(this._page="error");if(globalThis.history.pushState({},"",t),Se.dispatch(ve(decodeURIComponent(t),{})),"menuitem"in this.plugins){for(const t of this.plugins.menuitem)if(t!==this._page){const e=this.shadowRoot.querySelector(t);e.active=!1,e.removeAttribute("active")}if(this.plugins.menuitem.includes(this._page)){const t=this.shadowRoot.querySelector(this._page);t.active=!0,t.setAttribute("active",!0),t.render()}}}_moveToLogPage(){const t=globalThis.location.toString().split(/[/]+/).pop();if(globalThis.history.pushState({},"","/usersettings"),Se.dispatch(ve(decodeURIComponent("/usersettings"),{tab:"logs"})),t&&"usersettings"===t){const t=new CustomEvent("backend-ai-usersettings-logs",{});document.dispatchEvent(t)}}_moveToUserSettingsPage(){const t=globalThis.location.toString().split(/[/]+/).pop();if(globalThis.history.pushState({},"","/usersettings"),Se.dispatch(ve(decodeURIComponent("/usersettings"),{tab:"general"})),t&&"usersettings"===t){const t=new CustomEvent("backend-ai-usersettings",{});document.dispatchEvent(t)}}async addTooltips(){this._createPopover("#summary-menu-icon",Dt("webui.menu.Summary")),this._createPopover("#sessions-menu-icon",Dt("webui.menu.Sessions")),this._createPopover("#data-menu-icon",Dt("webui.menu.Data&Storage")),this._createPopover("#import-menu-icon",Dt("webui.menu.Import&Run")),this._createPopover("#pipeline-menu-icon",Dt("webui.menu.Pipeline")),this._createPopover("#statistics-menu-icon",Dt("webui.menu.Statistics")),this._createPopover("#usersettings-menu-icon",Dt("webui.menu.Settings")),this._createPopover("backend-ai-help-button",Dt("webui.menu.Help")),this.is_admin&&this._createPopover("#user-menu-icon",Dt("webui.menu.Users")),this.is_superadmin&&(this._createPopover("#resources-menu-icon",Dt("webui.menu.Resources")),this._createPopover("#environments-menu-icon",Dt("webui.menu.Environments")),this._createPopover("#configurations-menu-icon",Dt("webui.menu.Configurations")),this._createPopover("#maintenance-menu-icon",Dt("webui.menu.Maintenance")),this._createPopover("#information-menu-icon",Dt("webui.menu.Information")))}_createPopover(t,e){const i=document.createElement("wl-popover");i.anchor=t,i.setAttribute("fixed",""),i.setAttribute("disablefocustrap",""),i.setAttribute("anchororiginx","right"),i.setAttribute("anchororiginy","center"),i.setAttribute("transformoriginx","left"),i.setAttribute("transformoriginy","center"),i.anchorOpenEvents=["mouseover"],i.anchorCloseEvents=["mouseout"];const r=document.createElement("wl-popover-card"),n=document.createElement("div");n.style.padding="5px",n.innerText=e,r.appendChild(n),i.appendChild(r);this.shadowRoot.querySelector("#mini-tooltips").appendChild(i)}stateChanged(t){this._page=t.app.page,this._pageParams=t.app.params,this._offline=t.app.offline,this._offlineIndicatorOpened=t.app.offlineIndicatorOpened,this._drawerOpened=t.app.drawerOpened,globalThis.currentPage=this._page,globalThis.currentPageParams=this._pageParams}_getUsername(){let t=this.full_name?this.full_name:this.user_id;if(this.isUserInfoMaskEnabled){const e=2,i=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(t)?t.split("@")[0].length-e:t.length-e;t=globalThis.backendaiutils._maskString(t,"*",e,i)}return t}_getUserId(){let t=this.user_id;if(this.isUserInfoMaskEnabled){const e=2,i=t.split("@")[0].length-e;t=globalThis.backendaiutils._maskString(t,"*",e,i)}return t}_getRole(t){return globalThis.backendaiclient.user.get(t,["role"])}async _showRole(){const t=await this._getRole(this.user_id);this.roleInfo=t.user}_getKeypairInfo(t){return globalThis.backendaiclient.keypair.list(t,["access_key","secret_key"],!0)}async _showKeypairInfo(){const t=await this._getKeypairInfo(this.user_id);this.keyPairInfo=t,this.keyPairInfo.keypairs.reverse()}async _showSecretKey(t){const e=this.shadowRoot.querySelector("#secretkey");for(let i=0;i<this.keyPairInfo.keypairs.length;i++)if(t.target.selected.value==this.keyPairInfo.keypairs[i].access_key){e.value=this.keyPairInfo.keypairs[i].secret_key;break}}_hidePasswordChangeRequest(){this.shadowRoot.querySelector("#password-change-request").style.display="none"}render(){var t;return D`
      <link rel="stylesheet" href="resources/fonts/font-awesome-all.min.css">
      <link rel="stylesheet" href="resources/custom.css">
      <div id="loading-curtain" class="loading-background"></div>
      <mwc-drawer id="app-body" class="${this.mini_ui?"mini-ui":""}" style="visibility:hidden;">
        <div class="drawer-menu" style="height:100vh;">
          <div id="portrait-bar" class="draggable">
            <div class="horizontal center layout flex bar draggable" style="cursor:pointer;" @click="${()=>this._moveTo("/summary")}">
              <div class="portrait-canvas"></div>
              <div class="vertical start-justified layout full-menu" style="margin-left:10px;margin-right:10px;">
                <div class="site-name"><span class="bold">Backend</span>.AI</div>
                ${this.siteDescription?D`
                  <div class="site-name" style="font-size:13px;text-align:left;">
                    ${this.siteDescription}
                  </div>`:D``}
              </div>
              <span class="flex"></span>
            </div>
          </div>
          <div class="horizontal center-justified center layout flex" style="max-height:40px;">
            <mwc-icon-button id="mini-ui-toggle-button" style="color:#fff;" icon="menu" slot="navigationIcon" @click="${()=>this.toggleSidebarUI()}"></mwc-icon-button>
            <mwc-icon-button disabled class="temporarily-hide full-menu side-menu fg ${this.contentBody&&!0===this.contentBody.open&&"feedback"===this._sidepanel?"yellow":"white"}" id="feedback-icon" icon="question_answer"></mwc-icon-button>
            <mwc-icon-button class="full-menu side-menu fg ${this.contentBody&&!0===this.contentBody.open&&"notification"===this._sidepanel?"yellow":"white"}" id="notification-icon" icon="notification_important" @click="${()=>this._openSidePanel("notification")}"></mwc-icon-button>
            <mwc-icon-button class="full-menu side-menu fg ${this.contentBody&&!0===this.contentBody.open&&"task"===this._sidepanel?"yellow":"white"}" id="task-icon" icon="ballot" @click="${()=>this._openSidePanel("task")}"></mwc-icon-button>
          </div>
          <mwc-list id="sidebar-menu" class="sidebar list" @selected="${t=>this._menuSelected(t)}">
            <mwc-list-item graphic="icon" ?selected="${"summary"===this._page}" @click="${()=>this._moveTo("/summary")}" ?disabled="${this.blockedMenuitem.includes("summary")}">
              <i class="fas fa-th-large" slot="graphic" id="summary-menu-icon"></i>
              <span class="full-menu">${ie("webui.menu.Summary")}</span>
            </mwc-list-item>
            <mwc-list-item graphic="icon" ?selected="${"job"===this._page}" @click="${()=>this._moveTo("/job")}" ?disabled="${this.blockedMenuitem.includes("job")}">
              <i class="fas fa-list-alt" slot="graphic" id="sessions-menu-icon"></i>
              <span class="full-menu">${ie("webui.menu.Sessions")}</span>
            </mwc-list-item>
            ${this.use_experiment?D`
            <mwc-list-item graphic="icon" ?selected="${"experiment"===this._page}" @click="${()=>this._moveTo("/experiment")}" ?disabled="${this.blockedMenuitem.includes("experiment")}">
              <i class="fas fa-flask" slot="graphic"></i>
              <span class="full-menu">${ie("webui.menu.Experiments")}</span>
            </mwc-list-item>`:D``}
            <mwc-list-item graphic="icon" ?selected="${"github"===this._page||"import"===this._page}" @click="${()=>this._moveTo("/import")}" ?disabled="${this.blockedMenuitem.includes("import")}">
              <i class="fas fa-play" slot="graphic" id="import-menu-icon"></i>
              <span class="full-menu">${ie("webui.menu.Import&Run")}</span>
            </mwc-list-item>
            <mwc-list-item graphic="icon" ?selected="${"data"===this._page}" @click="${()=>this._moveTo("/data")}" ?disabled="${this.blockedMenuitem.includes("data")}">
              <i class="fas fa-cloud-upload-alt" slot="graphic" id="data-menu-icon"></i>
              <span class="full-menu">${ie("webui.menu.Data&Storage")}</span>
            </mwc-list-item>
            <mwc-list-item graphic="icon" ?selected="${"pipeline"===this._page}" @click="${()=>this._moveTo("/pipeline")}" ?disabled="${this.blockedMenuitem.includes("pipeline")}" style="display:none">
              <i class="fas fa-stream" slot="graphic" id="pipeline-menu-icon"></i>
              <span class="full-menu">${ie("webui.menu.Pipeline")}</span>
            </mwc-list-item>
            <mwc-list-item graphic="icon" ?selected="${"statistics"===this._page}" @click="${()=>this._moveTo("/statistics")}" ?disabled="${this.blockedMenuitem.includes("statistics")}">
              <i class="fas fa-chart-bar" slot="graphic" id="statistics-menu-icon"></i>
              <span class="full-menu">${ie("webui.menu.Statistics")}</span>
            </mwc-list-item>
            ${"page"in this.plugins?this.plugins.page.filter((t=>this.plugins["menuitem-user"].includes(t.url))).map((t=>D`
            <mwc-list-item graphic="icon" ?selected="${this._page===t.url}" @click="${()=>this._moveTo("/"+t.url)}" ?disabled="${!this.is_admin}">
              <i class="fas fa-puzzle-piece" slot="graphic" id="${t}-menu-icon"></i>
              <span class="full-menu">${t.menuitem}</span>
            </mwc-list-item>
            `)):D``}
            ${this.is_admin?D`
                <h3 class="full-menu">${ie("webui.menu.Administration")}</h3>
                <mwc-list-item graphic="icon" ?selected="${"credential"===this._page}" @click="${()=>this._moveTo("/credential")}" ?disabled="${!this.is_admin}">
                  <i class="fas fa-address-card" slot="graphic" id="user-menu-icon"></i>
                  <span class="full-menu">${ie("webui.menu.Users")}</span>
                </mwc-list-item>
                <mwc-list-item graphic="icon" ?selected="${"environment"===this._page}" @click="${()=>this._moveTo("/environment")}" ?disabled="${!this.is_admin}">
                  <i class="fas fa-microchip" slot="graphic" id="environments-menu-icon"></i>
                  <span class="full-menu">${ie("webui.menu.Environments")}</span>
                </mwc-list-item>`:D``}
                ${"page"in this.plugins?this.plugins.page.filter((t=>this.plugins["menuitem-admin"].includes(t.url))).map((t=>D`
                <mwc-list-item graphic="icon" ?selected="${this._page===t.url}" @click="${()=>this._moveTo("/"+t.url)}" ?disabled="${!this.is_admin}">
                  <i class="fas fa-puzzle-piece" slot="graphic" id="${t}-menu-icon"></i>
                  <span class="full-menu">${t.menuitem}</span>
                </mwc-list-item>
                `)):D``}
            ${this.is_superadmin?D`
                <mwc-list-item graphic="icon" ?selected="${"agent"===this._page}" @click="${()=>this._moveTo("/agent")}" ?disabled="${!this.is_superadmin}">
                  <i class="fas fa-server" slot="graphic" id="resources-menu-icon"></i>
                  <span class="full-menu">${ie("webui.menu.Resources")}</span>
                </mwc-list-item>
                <mwc-list-item graphic="icon" ?selected="${"settings"===this._page}" @click="${()=>this._moveTo("/settings")}" ?disabled="${!this.is_superadmin}">
                  <i class="fas fa-cog" slot="graphic" id="configurations-menu-icon"></i>
                  <span class="full-menu">${ie("webui.menu.Configurations")}</span>
                </mwc-list-item>
                <mwc-list-item graphic="icon" ?selected="${"maintenance"===this._page}" @click="${()=>this._moveTo("/maintenance")}" ?disabled="${!this.is_superadmin}">
                  <i class="fas fa-wrench" slot="graphic" id="maintenance-menu-icon"></i>
                  <span class="full-menu">${ie("webui.menu.Maintenance")}</span>
                </mwc-list-item>
                <mwc-list-item graphic="icon" ?selected="${"information"===this._page}" @click="${()=>this._moveTo("/information")}" ?disabled="${!this.is_superadmin}">
                  <i class="fas fa-info-circle" slot="graphic" id="information-menu-icon"></i>
                  <span class="full-menu">${ie("webui.menu.Information")}</span>
                </mwc-list-item>
                ${"page"in this.plugins?this.plugins.page.filter((t=>this.plugins["menuitem-superadmin"].includes(t.url))).map((t=>D`
                <mwc-list-item graphic="icon" ?selected="${this._page===t.url}" @click="${()=>this._moveTo("/"+t.url)}" ?disabled="${!this.is_admin}">
                  <i class="fas fa-puzzle-piece" slot="graphic" id="${t}-menu-icon"></i>
                  <span class="full-menu">${t.menuitem}</span>
                </mwc-list-item>
                `)):D``}
            `:D``}
            <footer id="short-height">
              <div class="terms-of-use full-menu">
                <small style="font-size:11px;">
                  <a @click="${()=>this.showTOSAgreement()}">${ie("webui.menu.TermsOfService")}</a>
                  ·
                  <a style="color:forestgreen;" @click="${()=>this.showPPAgreement()}">${ie("webui.menu.PrivacyPolicy")}</a>
                  ·
                  <a @click="${()=>this.splash.show()}">${ie("webui.menu.AboutBackendAI")}</a>
                  ${!0===this.allow_signout?D`
                  ·
                  <a @click="${()=>this.loginPanel.signout()}">${ie("webui.menu.LeaveService")}</a>
                  `:D``}
                </small>
              </div>
              <address class="full-menu">
                <small class="sidebar-footer">Lablup Inc.</small>
                <small class="sidebar-footer" style="font-size:9px;">22.03.1.220510</small>
              </address>
              <div id="sidebar-navbar-footer" class="vertical start end-justified layout" style="margin-left:16px;">
                <backend-ai-help-button active style="margin-left:4px;"></backend-ai-help-button>
                <mwc-icon-button id="usersettings-menu-icon" icon="settings" slot="graphic" class="fg ${"usersettings"===this._page?"yellow":"white"}" style="margin-left:4px;" @click="${()=>this._moveTo("/usersettings")}"></mwc-icon-button>
              </div>
            </footer>
          </mwc-list>
          <footer>
            <div class="terms-of-use full-menu">
              <small style="font-size:11px;">
                <a @click="${()=>this.showTOSAgreement()}">${ie("webui.menu.TermsOfService")}</a>
                ·
                <a style="color:forestgreen;" @click="${()=>this.showPPAgreement()}">${ie("webui.menu.PrivacyPolicy")}</a>
                ·
                <a @click="${()=>this.splash.show()}">${ie("webui.menu.AboutBackendAI")}</a>
                ${!0===this.allow_signout?D`
                ·
                <a @click="${()=>this.loginPanel.signout()}">${ie("webui.menu.LeaveService")}</a>
                `:D``}
              </small>
            </div>
            <address class="full-menu">
              <small class="sidebar-footer">Lablup Inc.</small>
              <small class="sidebar-footer" style="font-size:9px;">22.03.1.220510</small>
            </address>
            <div id="sidebar-navbar-footer" class="vertical start end-justified layout" style="margin-left:16px;">
              <backend-ai-help-button active style="margin-left:4px;"></backend-ai-help-button>
              <mwc-icon-button id="usersettings-menu-icon" icon="settings" slot="graphic" class="fg ${"usersettings"===this._page?"yellow":"white"}" style="margin-left:4px;" @click="${()=>this._moveTo("/usersettings")}"></mwc-icon-button>
            </div>
          </footer>
        </div>
        <div id="app-content" slot="appContent">
          <mwc-drawer id="content-body">
            <div class="sidepanel-drawer">
              <backend-ai-sidepanel-notification class="sidepanel" ?active="${"notification"===this._sidepanel}"></backend-ai-sidepanel-notification>
              <backend-ai-sidepanel-task class="sidepanel" ?active="${"task"===this._sidepanel}"></backend-ai-sidepanel-task>
            </div>
            <div slot="appContent">
              <mwc-top-app-bar-fixed id="main-toolbar" class="draggable">
                <div class="horizontal layout center" id="drawer-toggle-button" slot="navigationIcon" style="margin:auto 20px;" @click="${()=>this.toggleDrawer()}">
                  <i class="fas fa-bars fa-lg" style="color:#747474;"></i>
                </div>
                <div slot="navigationIcon" class="vertical-line" style="height:35px;"></div>
                <div class="horizontal layout" slot="title" id="welcome-message" style="font-size:12px;margin-left:10px;padding-top:10px;">
                  <p>${ie("webui.menu.WelcomeMessage")}</p>
                  <p class="user-name">${this._getUsername()}</p>
                  <p>${ie("webui.menu.WelcomeMessage_2")}</p>
                </div>
                <div slot="actionItems" style="margin:0;">
                  <div class="horizontal flex center layout">
                    <div style="height:48px;">
                      <div class="horizontal center center-justified layout">
                        <p id="project">${ie("webui.menu.Project")}</p>
                        <div id="group-select-box"></div>
                      </div>
                    </div>
                    <div class="vertical-line" style="height:35px;"></div>
                    <div class="horizontal center layout">
                      <div class="vertical layout center" style="position:relative;padding-top:10px;">
                        <span class="email" style="color:#8c8484;font-size:12px;line-height:22px;text-align:left;-webkit-font-smoothing:antialiased;margin:auto 10px;">
                          ${ie("webui.menu.UserName")}
                        </span>
                        <mwc-menu id="dropdown-menu" class="user-menu">
                          ${"default"!==this.domain&&""!==this.domain?D`
                          <mwc-list-item class="horizontal layout start center" disabled style="border-bottom:1px solid #ccc;">
                              ${this.domain}
                          </mwc-list-item>
                          `:D``}
                          <mwc-list-item class="horizontal layout start center" style="border-bottom:1px solid #ccc;">
                              <mwc-icon class="dropdown-menu">perm_identity</mwc-icon>
                              <span class="dropdown-menu-name">${this._getUserId()}</span>
                          </mwc-list-item>
                          <mwc-list-item class="horizontal layout start center" disabled style="border-bottom:1px solid #ccc;">
                              <mwc-icon class="dropdown-menu">admin_panel_settings</mwc-icon>
                              <span class="dropdown-menu-name">${this.roleInfo.role}</span>
                          </mwc-list-item>
                          <mwc-list-item class="horizontal layout start center" @click="${()=>this.splash.show()}">
                              <mwc-icon class="dropdown-menu">info</mwc-icon>
                              <span class="dropdown-menu-name">${ie("webui.menu.AboutBackendAI")}</span>
                          </mwc-list-item>
                          <mwc-list-item class="horizontal layout start center" @click="${()=>this._openUserPrefDialog()}">
                              <mwc-icon class="dropdown-menu">lock</mwc-icon>
                              <span class="dropdown-menu-name">${ie("webui.menu.MyAccount")}</span>
                          </mwc-list-item>
                          <mwc-list-item class="horizontal layout start center" @click="${()=>this._moveToUserSettingsPage()}">
                              <mwc-icon class="dropdown-menu">drag_indicator</mwc-icon>
                              <span class="dropdown-menu-name">${ie("webui.menu.Preferences")}</span>
                          </mwc-list-item>
                          <mwc-list-item class="horizontal layout start center" @click="${()=>this._moveToLogPage()}">
                              <mwc-icon class="dropdown-menu">assignment</mwc-icon>
                              <span class="dropdown-menu-name">${ie("webui.menu.LogsErrors")}</span>
                          </mwc-list-item>
                          <mwc-list-item class="horizontal layout start center" id="sign-button" @click="${()=>this.logout()}">
                              <mwc-icon class="dropdown-menu">logout</mwc-icon>
                              <span class="dropdown-menu-name">${ie("webui.menu.LogOut")}</span>
                          </mwc-list-item>
                        </mwc-menu>
                      </div>
                      <span class="full_name user-name" style="font-size:14px;text-align:right;-webkit-font-smoothing:antialiased;margin:auto 0px auto 10px; padding-top:10px;">
                        ${this._getUsername()}
                      </span>
                      <mwc-icon-button id="dropdown-button" @click="${()=>this._toggleDropdown()}" style="font-size: 0.5rem;">
                        <i class="fas fa-user-alt fa-xs" style="color:#8c8484;"></i>
                      </mwc-icon-button>
                      <div class="vertical-line" style="height:35px;"></div>
                      <div class="horizontal layout center" style="margin:auto 10px;padding-top:10px;">
                        <span class="log_out" style="font-size:12px;margin:auto 0px;color:#8c8484;">
                          ${ie("webui.menu.LogOut")}
                        </span>
                        <mwc-icon-button @click="${()=>this.logout()}" style="padding-bottom:5px;">
                          <i class="fas fa-sign-out-alt fa-xs" style="color:#8c8484;"></i>
                        </mwc-icon-button>
                      </div>
                    </div>
                  </div>
                  <div id="password-change-request" class="horizontal layout center end-justified" style="display:${this.needPasswordChange?"flex":"none"};">
                    <span>${ie("webui.menu.PleaseChangeYourPassword")} (${ie("webui.menu.PasswordChangePlace")})</span>
                    <mwc-icon-button @click="${()=>this._hidePasswordChangeRequest()}">
                      <i class="fa fa-times"></i>
                    </mwc-icon-button>
                  </div>
                </div>
              </mwc-top-app-bar-fixed>

              <div class="content" style="box-sizing:border-box; padding:14px;">
                <div id="navbar-top" class="navbar-top horizontal flex layout wrap"></div>
                <section role="main" id="content" class="container layout vertical center">
                  <div id="app-page">
                    <backend-ai-summary-view class="page" name="summary" ?active="${"summary"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-summary-view>
                    <backend-ai-import-view class="page" name="import" ?active="${"github"===this._page||"import"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-import-view>
                    <backend-ai-session-view class="page" name="job" ?active="${"job"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-session-view>
                    <!--<backend-ai-experiment-view class="page" name="experiment" ?active="${"experiment"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-experiment-view>-->
                    <backend-ai-usersettings-view class="page" name="usersettings" ?active="${"usersettings"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-usersettings-view>
                    <backend-ai-credential-view class="page" name="credential" ?active="${"credential"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-credential-view>
                    <backend-ai-agent-view class="page" name="agent" ?active="${"agent"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-agent-view>
                    <backend-ai-data-view class="page" name="data" ?active="${"data"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-data-view>
                    <backend-ai-pipeline-view class="page" name="pipeline" ?active="${"pipeline"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-pipeline-view>
                    <backend-ai-environment-view class="page" name="environment" ?active="${"environment"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-environment-view>
                    <backend-ai-settings-view class="page" name="settings" ?active="${"settings"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-settings-view>
                    <backend-ai-maintenance-view class="page" name="maintenance" ?active="${"maintenance"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-maintenance-view>
                    <backend-ai-information-view class="page" name="information" ?active="${"information"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-information-view>
                    <backend-ai-statistics-view class="page" name="statistics" ?active="${"statistics"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-statistics-view>
                    <backend-ai-email-verification-view class="page" name="email-verification" ?active="${"verify-email"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-email-verification-view>
                    <backend-ai-change-forgot-password-view class="page" name="change-forgot-password" ?active="${"change-password"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-change-forgot-password-view>
                    <backend-ai-edu-applauncher class="page" name="edu-applauncher" ?active="${"edu-applauncher"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-edu-applauncher>
                    <backend-ai-error-view class="page" name="error" ?active="${"error"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-error-view>
                    <backend-ai-permission-denied-view class="page" name="unauthorized" ?active="${"unauthorized"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-permission-denied-view>
                  </div>
                </section>
              </div>
            </div>
          </mwc-drawer>
        </div>
      </mwc-drawer>
      <div id="mini-tooltips" style="display:${this.mini_ui?"block":"none"};">
        <wl-popover anchor="#mini-ui-toggle-button" .anchorOpenEvents="${["mouseover"]}" fixed disablefocustrap
           anchororiginx="right" anchororiginy="center" transformoriginx="left" transformOriginY="center">
          <wl-popover-card>
            <div style="padding:5px">
              <mwc-icon-button disabled class="temporarily-hide side-menu fg ${this.contentBody&&!0===this.contentBody.open&&"feedback"===this._sidepanel?"red":"black"}" id="feedback-icon-popover" icon="question_answer"></mwc-icon-button>
              <mwc-icon-button class="side-menu fg ${this.contentBody&&!0===this.contentBody.open&&"notification"===this._sidepanel?"red":"black"}" id="notification-icon-popover" icon="notification_important" @click="${()=>this._openSidePanel("notification")}"></mwc-icon-button>
              <mwc-icon-button class="side-menu fg ${this.contentBody&&!0===this.contentBody.open&&"task"===this._sidepanel?"red":"black"}" id="task-icon-popover" icon="ballot" @click="${()=>this._openSidePanel("task")}"></mwc-icon-button>
            </div>
          </wl-popover-card>
        </wl-popover>
      </div>
      <backend-ai-offline-indicator ?active="${this._offlineIndicatorOpened}">
        ${this._offline?ie("webui.YouAreOffline"):ie("webui.YouAreOnline")}.
      </backend-ai-offline-indicator>
      <backend-ai-login active id="login-panel"></backend-ai-login>
      <backend-ai-splash id="about-backendai-panel"></backend-ai-splash>
      <lablup-notification id="notification"></lablup-notification>
      <backend-ai-indicator-pool id="indicator"></backend-ai-indicator-pool>
      <lablup-terms-of-service id="terms-of-service" block></lablup-terms-of-service>
      <backend-ai-dialog id="user-preference-dialog" fixed backdrop>
        <span slot="title">${ie("webui.menu.MyAccountInformation")}</span>
        <div slot="content" class="layout vertical" style="width:300px;">
          <mwc-textfield id="pref-original-name" type="text"
              label="${ie("webui.menu.FullName")}" maxLength="64" autofocus
              value="${this.full_name}"
              helper="${ie("maxLength.64chars")}">
          </mwc-textfield>
        </div>
        <div slot="content" class="layout vertical" style="width:300px">
          <mwc-select id="access-key-select" class="fixed-position" fixedMenuPosition required
                      label="${ie("general.AccessKey")}"
                      @selected="${t=>this._showSecretKey(t)}">
            ${null===(t=this.keyPairInfo.keypairs)||void 0===t?void 0:t.map((t=>D`
              <mwc-list-item value="${t.access_key}" ?selected=${this.loggedAccount.access_key===t.access_key}>
                ${t.access_key}
              </mwc-list-item>`))}
          </mwc-select>
          <mwc-textfield id="secretkey" disabled type="text"
              label="${ie("general.SecretKey")}"
              style="margin-bottom:20px; margin-top:20px;" value="" readonly>
          </mwc-textfield>
        </div>
        <div slot="content" class="layout vertical" style="width:300px;">
          <mwc-textfield id="pref-original-password" type="password"
              label="${ie("webui.menu.OriginalPassword")}" maxLength="64"
              style="margin-bottom:20px;">
          </mwc-textfield>
          <div class="horizontal flex layout">
            <mwc-textfield id="pref-new-password" label="${ie("webui.menu.NewPassword")}"
                type="password" maxLength="64"
                auto-validate validationMessage="${ie("webui.menu.InvalidPasswordMessage")}"
                pattern="^(?=.*[A-Za-z])(?=.*\\d)(?=.*[@$!%*#?&])[A-Za-z\\d@$!%*#?&]{8,}$"
                @change="${this._validatePassword}">
            </mwc-textfield>
            <mwc-icon-button-toggle off onIcon="visibility" offIcon="visibility_off"
                                      @click="${t=>this._togglePasswordVisibility(t.target)}">
            </mwc-icon-button-toggle>
          </div>
          <div class="horizontal flex layout">
            <mwc-textfield id="pref-new-password2" label="${ie("webui.menu.NewPasswordAgain")}"
                type="password" maxLength="64"
                @change="${this._validatePassword}">
            </mwc-textfield>
            <mwc-icon-button-toggle off onIcon="visibility" offIcon="visibility_off"
                                      @click="${t=>this._togglePasswordVisibility(t.target)}">
              </mwc-icon-button-toggle>
          </div>
        </div>
        <div slot="footer" class="horizontal end-justified flex layout">
          <div class="flex"></div>
          <mwc-button
              label="${ie("webui.menu.Cancel")}"
              @click="${this._hideUserPrefDialog}"></mwc-button>
          <mwc-button
              unelevated
              label="${ie("webui.menu.Update")}"
              @click="${this._updateUserInformation}"></mwc-button>
        </div>
      </backend-ai-dialog>
      <backend-ai-app-launcher id="app-launcher"></backend-ai-app-launcher>
      <backend-ai-resource-broker id="resource-broker" ?active="${this.is_connected}"></backend-ai-resource-broker>
    `}};r([xt({type:Boolean})],xl.prototype,"hasLoadedStrings",void 0),r([xt({type:String})],xl.prototype,"menuTitle",void 0),r([xt({type:String})],xl.prototype,"siteDescription",void 0),r([xt({type:String})],xl.prototype,"user_id",void 0),r([xt({type:String})],xl.prototype,"full_name",void 0),r([xt({type:String})],xl.prototype,"domain",void 0),r([xt({type:Boolean})],xl.prototype,"is_connected",void 0),r([xt({type:Boolean})],xl.prototype,"is_admin",void 0),r([xt({type:Boolean})],xl.prototype,"is_superadmin",void 0),r([xt({type:Boolean})],xl.prototype,"allow_signout",void 0),r([xt({type:Boolean})],xl.prototype,"needPasswordChange",void 0),r([xt({type:String})],xl.prototype,"proxy_url",void 0),r([xt({type:String})],xl.prototype,"connection_mode",void 0),r([xt({type:String})],xl.prototype,"connection_server",void 0),r([xt({type:String})],xl.prototype,"edition",void 0),r([xt({type:String})],xl.prototype,"validUntil",void 0),r([xt({type:Array})],xl.prototype,"groups",void 0),r([xt({type:String})],xl.prototype,"current_group",void 0),r([xt({type:Object})],xl.prototype,"plugins",void 0),r([xt({type:Object})],xl.prototype,"splash",void 0),r([xt({type:Object})],xl.prototype,"loginPanel",void 0),r([xt({type:String})],xl.prototype,"_page",void 0),r([xt({type:String})],xl.prototype,"_lazyPage",void 0),r([xt({type:Object})],xl.prototype,"_pageParams",void 0),r([xt({type:String})],xl.prototype,"_sidepanel",void 0),r([xt({type:Boolean})],xl.prototype,"_drawerOpened",void 0),r([xt({type:Boolean})],xl.prototype,"_offlineIndicatorOpened",void 0),r([xt({type:Boolean})],xl.prototype,"_offline",void 0),r([xt({type:Object})],xl.prototype,"_dropdownMenuIcon",void 0),r([xt({type:Object})],xl.prototype,"config",void 0),r([xt({type:Object})],xl.prototype,"notification",void 0),r([xt({type:Object})],xl.prototype,"appBody",void 0),r([xt({type:Object})],xl.prototype,"appPage",void 0),r([xt({type:Object})],xl.prototype,"contentBody",void 0),r([xt({type:Object})],xl.prototype,"mainToolbar",void 0),r([xt({type:Object})],xl.prototype,"drawerToggleButton",void 0),r([xt({type:Object})],xl.prototype,"sidebarMenu",void 0),r([xt({type:Object})],xl.prototype,"TOSdialog",void 0),r([xt({type:Boolean})],xl.prototype,"mini_ui",void 0),r([xt({type:Boolean})],xl.prototype,"auto_logout",void 0),r([xt({type:Boolean})],xl.prototype,"isUserInfoMaskEnabled",void 0),r([xt({type:String})],xl.prototype,"lang",void 0),r([xt({type:Array})],xl.prototype,"supportLanguageCodes",void 0),r([xt({type:Array})],xl.prototype,"blockedMenuitem",void 0),r([xt({type:Number})],xl.prototype,"minibarWidth",void 0),r([xt({type:Number})],xl.prototype,"sidebarWidth",void 0),r([xt({type:Number})],xl.prototype,"sidepanelWidth",void 0),r([xt({type:Object})],xl.prototype,"supports",void 0),r([xt({type:Array})],xl.prototype,"availablePages",void 0),r([xt({type:Array})],xl.prototype,"adminOnlyPages",void 0),r([xt({type:Array})],xl.prototype,"superAdminOnlyPages",void 0),r([xt({type:Number})],xl.prototype,"timeoutSec",void 0),r([xt({type:Boolean})],xl.prototype,"use_experiment",void 0),r([xt({type:Object})],xl.prototype,"loggedAccount",void 0),r([xt({type:Object})],xl.prototype,"roleInfo",void 0),r([xt({type:Object})],xl.prototype,"keyPairInfo",void 0),xl=r([_t("backend-ai-webui")],xl);var Ml=xl;export{D as $,i as A,js as B,o as C,e as D,s as E,a as F,At as G,St as H,Ls as I,xn as J,Na as K,Bi as L,Oe as M,ta as N,ha as O,ua as P,oa as Q,Ai as R,ra as S,Ra as T,qt as U,ee as V,As as W,z as X,Ue as Y,ot as Z,r as _,$s as a,Wo as a0,fs as a1,Ia as a2,co as a3,bs as a4,ia as a5,Ca as a6,pa as a7,La as a8,Pa as a9,$a as aa,Oa as ab,tl as ac,Wn as ad,Fa as ae,He as af,Be as ag,Ve as ah,fi as ai,vs as aj,aa as ak,Aa as al,Ta as am,Bt as an,Se as ao,ns as ap,es as aq,os as ar,sa as as,ve as at,Ml as au,Je as b,Bs as c,rl as d,xt as e,ea as f,Dt as g,n as h,qo as i,Co as j,gs as k,Et as l,Ei as m,_t as n,ne as o,Vo as p,Mt as q,at as r,vt as s,ie as t,We as u,xi as v,Ti as w,Ns as x,Di as y,U as z};
