You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RTL/frontend/polyfills.cba326bc97aa51ea.js

2 lines
2.9 MiB
JavaScript

(self.webpackChunkRTLApp=self.webpackChunkRTLApp||[]).push([["polyfills"],{7435:(HA,dA,_)=>{"use strict";_(4924),_(9591),_(5646),_(74),_(1660),_(786),_(1381);window.global=window,window.global.Buffer=window.global.Buffer||_(3195).Buffer},8996:(HA,dA)=>{"use strict";function _(nA){return Object.keys(nA).map(DA=>nA[DA])}var nA;Object.defineProperty(dA,"__esModule",{value:!0}),(nA=dA.HashAlgorithms||(dA.HashAlgorithms={})).SHA1="sha1",nA.SHA256="sha256",nA.SHA512="sha512";const tA=_(dA.HashAlgorithms);!function(nA){nA.ASCII="ascii",nA.BASE64="base64",nA.HEX="hex",nA.LATIN1="latin1",nA.UTF8="utf8"}(dA.KeyEncodings||(dA.KeyEncodings={}));const fA=_(dA.KeyEncodings);!function(nA){nA.HOTP="hotp",nA.TOTP="totp"}(dA.Strategy||(dA.Strategy={}));const y=_(dA.Strategy),p=()=>{throw new Error("Please provide an options.createDigest implementation.")};function A(nA){return/^(\d+)$/.test(nA)}function B(nA,DA,yA){return nA.length>=DA?nA:`${Array(DA+1).join(yA)}${nA}`.slice(-1*DA)}function s(nA){const DA=`otpauth://${nA.type}/{labelPrefix}:{accountName}?secret={secret}{query}`,yA=[];if(y.indexOf(nA.type)<0)throw new Error(`Expecting options.type to be one of ${y.join(", ")}. Received ${nA.type}.`);if("hotp"===nA.type){if(null==nA.counter||"number"!=typeof nA.counter)throw new Error('Expecting options.counter to be a number when options.type is "hotp".');yA.push(`&counter=${nA.counter}`)}return"totp"===nA.type&&nA.step&&yA.push(`&period=${nA.step}`),nA.digits&&yA.push(`&digits=${nA.digits}`),nA.algorithm&&yA.push(`&algorithm=${nA.algorithm.toUpperCase()}`),nA.issuer&&yA.push(`&issuer=${encodeURIComponent(nA.issuer)}`),DA.replace("{labelPrefix}",encodeURIComponent(nA.issuer||nA.accountName)).replace("{accountName}",encodeURIComponent(nA.accountName)).replace("{secret}",nA.secret).replace("{query}",yA.join(""))}class o{constructor(DA={}){this._defaultOptions=Object.freeze({...DA}),this._options=Object.freeze({})}create(DA={}){return new o(DA)}clone(DA={}){const yA=this.create({...this._defaultOptions,...DA});return yA.options=this._options,yA}get options(){return Object.freeze({...this._defaultOptions,...this._options})}set options(DA){this._options=Object.freeze({...this._options,...DA})}allOptions(){return this.options}resetOptions(){this._options=Object.freeze({})}}function c(nA){if("function"!=typeof nA.createDigest)throw new Error("Expecting options.createDigest to be a function.");if("function"!=typeof nA.createHmacKey)throw new Error("Expecting options.createHmacKey to be a function.");if("number"!=typeof nA.digits)throw new Error("Expecting options.digits to be a number.");if(!nA.algorithm||tA.indexOf(nA.algorithm)<0)throw new Error(`Expecting options.algorithm to be one of ${tA.join(", ")}. Received ${nA.algorithm}.`);if(!nA.encoding||fA.indexOf(nA.encoding)<0)throw new Error(`Expecting options.encoding to be one of ${fA.join(", ")}. Received ${nA.encoding}.`)}const g=(nA,DA,yA)=>Buffer.from(DA,yA).toString("hex");function f(){return{algorithm:dA.HashAlgorithms.SHA1,createHmacKey:g,createDigest:p,digits:6,encoding:dA.KeyEncodings.ASCII}}function E(nA){const DA={...f(),...nA};return c(DA),Object.freeze(DA)}function u(nA){return B(nA.toString(16),16,"0")}function w(nA,DA){const yA=Buffer.from(nA,"hex"),P=15&yA[yA.length-1],Z=((127&yA[P])<<24|(255&yA[P+1])<<16|(255&yA[P+2])<<8|255&yA[P+3])%Math.pow(10,DA);return B(String(Z),DA,"0")}function r(nA,DA,yA){const P=yA.digest||function Q(nA,DA,yA){const P=u(DA),H=yA.createHmacKey(yA.algorithm,nA,yA.encoding);return yA.createDigest(yA.algorithm,H,P)}(nA,DA,yA);return w(P,yA.digits)}function I(nA,DA,yA,P){if(!A(nA))return!1;return nA===r(DA,yA,P)}function v(nA,DA,yA,P,H){return s({algorithm:H.algorithm,digits:H.digits,type:dA.Strategy.HOTP,accountName:nA,counter:P,issuer:DA,secret:yA})}class m extends o{create(DA={}){return new m(DA)}allOptions(){return E(this.options)}generate(DA,yA){return r(DA,yA,this.allOptions())}check(DA,yA,P){return I(DA,yA,P,this.allOptions())}verify(DA){if("object"!=typeof DA)throw new Error("Expecting argument 0 of verify to be an object");return this.check(DA.toke
//# sourceMappingURL=polyfills.cba326bc97aa51ea.js.map