Files
mixly3/common/modules/web-modules/microbit/microbit-fs.umd.min.js
2024-12-20 18:51:04 +08:00

3 lines
73 KiB
JavaScript

(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e=e||self,t(e.microbitFs={}))})(this,function(e){'use strict';var Fe=Number.isInteger,ke=String.prototype,Oe=Math.floor,Be=Math.ceil,Le=Math.max,Re=Math.pow,De=Math.min;function t(e,t){return t={exports:{}},e(t,t.exports),t.exports}function n(e){"@babel/helpers - typeof";return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n,r=0;r<t.length;r++)n=t[r],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function s(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}function o(e,t){return l(e)||d(e,t)||c(e,t)||h()}function l(e){if(Array.isArray(e))return e}function d(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,s=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!(t&&n.length===t));r=!0);}catch(e){a=!0,s=e}finally{try{r||null==i["return"]||i["return"]()}finally{if(a)throw s}}return n}}function c(e,t){if(e){if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=c(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a,s=!0,l=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(t){l=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw a}}}}function p(e){return 255&-e.reduce(function(e,t){return e+t},0)}function y(e,t){var n=e.reduce(function(e,t){return e+t},0),r=t.reduce(function(e,t){return e+t},0);return 255&-(n+r)}function m(e){return e.toString(16).toUpperCase().padStart(2,"0")}function E(e){var t=new ms;return t.encode(e)}function S(e){var t=new ys;return t.decode(e)}function x(e){return e.replace(":::::::::::::::::::::::::::::::::::::::::::\n","")}function P(e){var t=e.length+4;t%16&&(t+=16-t%16);var n=new Uint8Array(t).fill(0);return n[0]=77,n[1]=80,n[2]=255&e.length,n[3]=255&e.length>>8,n.set(e,4),n}function b(t){var n;if("string"==typeof t){var r=x(t);n=ps.fromHex(r)}else n=t;var a=n.slicePad(e.AppendedBlock.StartAdd,2,255);return a[0]===77&&a[1]===80}function _(e){if(0!=e.length%2)throw new Error("Hex string \""+e+"\" is not divisible by 2.");var t=e.match(/.{1,2}/g);return t?new Uint8Array(t.map(function(t){var n=Number.isNaN,r=parseInt(t,16);if(n(r))throw new Error("There were some non-hex characters in \""+e+"\".");else return r})):new Uint8Array}function A(e){return e.toString(16).toUpperCase().padStart(2,"0")}function I(e){return e.reduce(function(e,t){return e+t.toString(16).toUpperCase().padStart(2,"0")},"")}function T(e){var t=e.reduce(function(e,t){return e+t.length},0),n=new Uint8Array(t);return e.reduce(function(e,t){return n.set(t,e),e+t.length},0),n}function v(e){return!!(e>=Hs.Data&&e<=Hs.StartLinearAddress||e>=Hs.BlockStart&&e<=Hs.OtherData)}function F(e){var t=e.reduce(function(e,t){return e+t},0);return 255&-t}function O(e,t,n){if(0>e||65535<e)throw new Error("Record ("+t+") address out of range: "+e);var r=n.length;if(r>32)throw new Error("Record ("+t+") data has too many bytes ("+r+").");if(!v(t))throw new Error("Record type '"+t+"' is not valid.");var a=T([new Uint8Array([r,e>>8,255&e,t]),n]),s=I(a),o=A(F(a));return":"+s+o}function B(e){if(e.length<Vs)throw new Error("Record length too small: "+e);if(e.length>Gs)throw new Error("Record length is too large: "+e);if(":"!==e[0])throw new Error("Record does not start with a \":\": "+e);return!0}function L(e){B(e);var t=Us+2+4,n=e.slice(t,t+2),r=parseInt(n,16);if(!v(r))throw new Error("Record type '"+n+"' from record '"+e+"' is not valid.");return r}function R(t){try{return _(t.slice(ws,-2))}catch(n){throw new Error("Could not parse Intel Hex record \""+t+"\": "+n.message)}}function D(t){B(t);var n;try{n=_(t.substring(1))}catch(n){throw new Error("Could not parse Intel Hex record \""+t+"\": "+n.message)}var r=n[0],a=1,s=(n[a]<<8)+n[a+1],o=a+2,i=n[o],l=o+1,d=l+r,c=n.slice(l,d),g=n[d],h=d+1;if(n.length>h)throw new Error("Parsed record \""+t+"\" is larger than indicated by the byte count."+("\n\tExpected: "+h+"; Length: "+n.length+"."));return{byteCount:r,address:s,recordType:i,data:c,checksum:g}}function M(){return":00000001FF"}function C(e){if(0>e||4294967295<e)throw new Error("Address '"+e+"' for Extended Linear Address record is out of range.");return O(0,Hs.ExtendedLinearAddress,new Uint8Array([255&e>>24,255&e>>16]))}function N(e){if(0>e||65535<e)throw new Error("Board ID out of range when creating Block Start record.");return O(0,Hs.BlockStart,new Uint8Array([255&e>>8,255&e,192,222]))}function H(e){switch(e){case 4:return":0400000BFFFFFFFFF5";case 12:return":0C00000BFFFFFFFFFFFFFFFFFFFFFFFFF5";default:var t=new Uint8Array(e).fill(255);return O(0,Hs.BlockEnd,t);}}function U(e){var t=new Uint8Array(e).fill(255);return O(0,Hs.PaddedData,t)}function z(e,t){var n=D(e),r=new Uint8Array(n.data.length+4);r[0]=n.data.length,r[1]=n.address>>8,r[2]=255&n.address,r[3]=t,r.set(n.data,4);var a=I(r),s=A(F(r));return":"+a+s}function Y(e){var t=R(e);if(2!==t.length||15&t[0]||0!==t[1])throw new Error("Invalid Extended Segment Address record "+e);var n=t[0]<<12;return C(n)}function $(e){var t=e.replace(/\r/g,"").split("\n");return t.filter(Boolean)}function w(e){for(var t=16,n=0,r=0,a=e;r<a.length;r++){var s=a[r],o=(s.length-Vs)/2;if(o>t?(t=o,n=0):o===t&&n++,12<n)break}if(t>32)throw new Error("Intel Hex record data size is too large: "+t);return t}function V(e,t){for(var n=!Ws.includes(t),r=N(t),a=C(0),s=a.length,o=r.length,i=H(0).length,l=U(0).length,d=$(e),c=w(d),g=0,h=[];g<d.length;){var u=0,p=L(d[g]);p===Hs.ExtendedLinearAddress?(a=d[g],g++):p===Hs.ExtendedSegmentAddress&&(a=Y(d[g]),g++),h.push(a),u+=s+1,h.push(r),u+=o+1,u+=i+1;for(var f=!1;d[g]&&512>=u+d[g].length+1;){var y=d[g++],m=L(y);if(n&&m===Hs.Data)y=z(y,Hs.CustomData);else if(m===Hs.ExtendedLinearAddress)a=y;else if(m===Hs.ExtendedSegmentAddress)y=Y(y),a=y;else if(m===Hs.EndOfFile){f=!0;break}h.push(y),u+=y.length+1}if(f){if(g!==d.length)throw new Error("EoF record found at record "+g+" of "+d.length+" in Board ID "+t+" hex");h.push(H(0)),h.push(M())}else{for(;512-u>2*c;){var y=U(De((512-u-(l+1))/2,c));h.push(y),u+=y.length+1}h.push(H((512-u)/2))}}return h.push(""),h.join("\n")}function G(e,t){var n=[],r=0,a=0,s=function(e){r+=e.length+1},o=function(e){n.push(e),s(e)},i=$(e);if(!i.length)return"";var l=L(i[0]);l===Hs.ExtendedLinearAddress?(o(i[0]),a++):l===Hs.ExtendedSegmentAddress?(o(Y(i[0])),a++):o(C(0)),o(N(t));for(var d=!Ws.includes(t),c=!1;a<i.length;){var g=i[a++],h=L(g);if(h===Hs.Data)o(d?z(g,Hs.CustomData):g);else if(h===Hs.ExtendedSegmentAddress)o(Y(g));else if(h===Hs.ExtendedLinearAddress)o(g);else if(h===Hs.EndOfFile){c=!0;break}}if(a!==i.length)throw new Error("EoF record found at record "+a+" of "+i.length+" in Board ID "+t+" hex ");s(H(0));for(var u=U(0).length+1,p=w(i),f=(512-r%512)%512;f>2*p;){var y=f-u>>1,g=U(De(y,p));o(g),f=(512-r%512)%512}return n.push(H(f>>1)),c&&n.push(M()),n.push(""),n.join("\n")}function W(e,t){if(void 0===t&&(t=!1),!e.length)return"";for(var n,r=t?V:G,a=M()+"\n",s=[],o=0;o<e.length-1;o++)n=r(e[o].hex,e[o].boardId),n.endsWith(a)&&(n=n.slice(0,n.length-a.length)),s.push(n);var l=r(e[e.length-1].hex,e[e.length-1].boardId);return s.push(l),l.endsWith(a)||s.push(a),s.join("")}function K(e){if(e.slice(0,":02000004".length)!==":02000004")return!1;for(var t=9;":"!==e[++t]&&t<Gs+3;);return!(":0400000A"!==e.slice(t,t+9))}function X(e){var t=$(e);if(!t.length)throw new Error("Empty Universal Hex.");if(L(t[0])!==Hs.ExtendedLinearAddress||L(t[1])!==Hs.BlockStart||L(t[t.length-1])!==Hs.EndOfFile)throw new Error("Universal Hex block format invalid.");for(var n=[Hs.Data,Hs.EndOfFile,Hs.ExtendedSegmentAddress,Hs.StartSegmentAddress],r={},a=0,s=0;s<t.length;s++){var o=t[s],l=L(o);if(n.includes(l))r[a].hex.push(o);else if(l===Hs.CustomData)r[a].hex.push(z(o,Hs.Data));else if(l===Hs.ExtendedLinearAddress){var d=t[s+1];if(L(d)===Hs.BlockStart){var c=R(d);if(4!==c.length)throw new Error("Block Start record invalid: "+d);a=(c[0]<<8)+c[1],r[a]=r[a]||{boardId:a,lastExtAdd:o,hex:[o]},s++}r[a].lastExtAdd!==o&&(r[a].lastExtAdd=o,r[a].hex.push(o))}}var g=[];return Object.keys(r).forEach(function(e){var t=r[e].hex;t[t.length-1]!==M()&&(t[t.length]=M()),g.push({boardId:r[e].boardId,hex:t.join("\n")+"\n"})}),g}function Z(e,t){var n=e.slicePad(t,8,255);return new DataView(n.buffer).getUint32(0,!0)}function q(e,t){var n=e.slicePad(t,4,255);return new DataView(n.buffer).getUint32(0,!0)}function J(e,t){var n=e.slicePad(t,2,255);return new DataView(n.buffer).getUint16(0,!0)}function Q(e,t){var n=e.slicePad(t,1,255);return n[0]}function ee(e,t){for(var n=e.slice(t).get(t),r=0;r<n.length&&0!==n[r];)r++;if(r===n.length)return"";var a=n.slice(0,r);return S(a)}function te(e,t){void 0===t&&(t=1024);for(var n=0,r=new Uint8Array(new Uint32Array([1501507838]).buffer),a=new Uint8Array(new Uint32Array([3249657757]).buffer),s=e.paginate(t,255).entries(),o=s.next();!o.done;o=s.next())if(o.value){var i=o.value[1],l=i.subarray(-Zs.magic2);if(Ss(l,a)&&Ss(i.subarray(-Zs.magic1,-(Zs.magic1-4)),r)){var d=o.value[0];n=d+t;break}}var c=J(e,n-Zs.version),g=J(e,n-Zs.tableLength),h=J(e,n-Zs.regionCount),u=J(e,n-Zs.pageSizeLog2),p=Re(2,u),f=n-Zs.magic1;return{pageSizeLog2:u,pageSize:p,regionCount:h,tableLength:g,version:c,endAddress:n,startAddress:f}}function ne(e,t){var n=Q(e,t-qs.id),r=Q(e,t-qs.hashType),a=Z(e,t-qs.hashData),s="";r===Xs.pointer&&(s=ee(e,4294967295&a));var o=J(e,t-qs.startPage),i=q(e,t-qs.lengthBytes);return{id:n,startPage:o,lengthBytes:i,hashType:r,hashData:a,hashPointerData:s}}function re(e){for(var t=te(e,4096),n={},r=0;r<t.regionCount;r++){var a=t.startAddress-r*Qs,s=ne(e,a);n[s.id]=s}if(!n.hasOwnProperty(Ks.microPython))throw new Error("Could not find a MicroPython region in the regions table.");if(!n.hasOwnProperty(Ks.fs))throw new Error("Could not find a File System region in the regions table.");var o=n[Ks.microPython].startPage*t.pageSize+n[Ks.microPython].lengthBytes;o=t.endAddress;var l=n[Ks.microPython].hashPointerData,d=n[Ks.fs].startPage*t.pageSize,c=d+n[Ks.fs].lengthBytes;return{flashPageSize:t.pageSize,flashSize:524288,flashStartAddress:0,flashEndAddress:524288,runtimeStartAddress:0,runtimeEndAddress:o,fsStartAddress:d,fsEndAddress:c,uPyVersion:l,deviceVersion:2}}function ae(e){for(var t,n=se(e),r=0,a=eo;r<a.length;r++)if(t=a[r],t.magicHeader===n)return!0;return!1}function se(e){return q(e,Js.MagicValue)}function oe(e){for(var t,n=se(e),r=0,a=eo;r<a.length;r++)if(t=a[r],t.magicHeader===n)return t.deviceVersion;throw new Error("Cannot find device version, unknown UICR Magic value")}function ie(e){for(var t,n=se(e),r=0,a=eo;r<a.length;r++)if(t=a[r],t.magicHeader===n)return t.flashSize;throw new Error("Cannot find flash size, unknown UICR Magic value")}function le(e){for(var t,n=se(e),r=0,a=eo;r<a.length;r++)if(t=a[r],t.magicHeader===n)return t.fsEnd;throw new Error("Cannot find fs end address, unknown UICR Magic value")}function de(e){var t=q(e,Js.PageSize);return Re(2,t)}function ce(e){return J(e,Js.StartPage)}function ge(e){return J(e,Js.PagesUsed)}function he(e){return q(e,Js.VersionLocation)}function ue(e){var t=e.slice(268439744);if(!ae(t))throw new Error("Could not find valid MicroPython UICR data.");var n=de(t),r=ie(t),a=ce(t),s=a*n,o=ge(t),i=o*n,l=he(t),d=ee(e,l),c=oe(t),g=le(t);return{flashPageSize:n,flashSize:r,flashStartAddress:s,flashEndAddress:s+r,runtimeStartAddress:s,runtimeEndAddress:i,fsStartAddress:i,fsEndAddress:g,uicrStartAddress:Js.MagicValue,uicrEndAddress:Js.End,uPyVersion:d,deviceVersion:c}}function pe(e){var t="";try{return ue(e)}catch(e){t+=e.message+"\n"}try{return re(e)}catch(e){throw new Error(t+e.message)}}function fe(e){var t=ps.fromHex(e),n=pe(t),r=t.slice(n.runtimeStartAddress,n.runtimeEndAddress-n.runtimeStartAddress).asHexString().replace(":00000001FF","");return{originalIntelHex:e,originalMemMap:t,uPyIntelHex:r,uPyEndAddress:n.runtimeEndAddress,fsSize:ve(t)}}function ye(e){for(var t=[],n=me(e),r=Se(e),a=n,s=1;a<r;){var o=e.slicePad(a,1,255)[0];(255===o||0===o)&&t.push(s),s++,a+=128}return t}function me(e){var t=pe(e),n=Ee(e)-32256,r=Le(t.fsStartAddress,n);if(r%t.flashPageSize)throw new Error("File system start address from UICR does not align with flash page size.");return r}function Ee(t){var n=pe(t),r=n.fsEndAddress;return 1===n.deviceVersion&&(b(t)&&(r=e.AppendedBlock.StartAdd),r-=n.flashPageSize),r}function Se(e){var t=pe(e);return Ee(e)-t.flashPageSize}function xe(e){e.set(Se(e),new Uint8Array([253]))}function Pe(e,t){return me(e)+(t-1)*128}function be(e,t){var n=new ao(e,t);return n.getFsFileSize()}function _e(e,t,n){if(!t)throw new Error("File has to have a file name.");if(!n.length)throw new Error("File "+t+" has to contain data.");var r=ye(e);if(0===r.length)throw new Error("There is no storage space left.");var a=Pe(e,r[0]),s=new ao(t,n),o=s.getFsBytes(r);e.set(a,o),xe(e)}function Ae(e,t,n){void 0===n&&(n=!1);var r="string"==typeof e?ps.fromHex(e):e.clone();var a=pe(r);return Object.keys(t).forEach(function(e){_e(r,e,t[e])}),n?r.slicePad(0,a.flashSize):r.asHexString()+"\n"}function Ie(e,t){var n=e.originalMemMap.clone();return Object.keys(t).forEach(function(e){_e(n,e,t[e])}),e.uPyIntelHex+n.slice(e.uPyEndAddress).asHexString()+"\n"}function Te(e){var t="string"==typeof e?ps.fromHex(e):e.clone();for(var n=me(t),r=Se(t),a={},s=[],o=n,i=1;o<r;){var l=t.slicePad(o,128,255),d=l[0];255!==d&&0!==d&&253!==d&&(a[i]=l,254===d&&s.push(i)),i++,o+=128}for(var c={},g=0,h=s;g<h.length;g++){var u=h[g],p=a[u],f=p[1],y=p[2],m=3+y,E=S(p.slice(3,m));if(c.hasOwnProperty(E))throw new Error("Found multiple files named: "+E+".");c[E]=new Uint8Array(0);for(var x=p,P=u,b=Object.keys(a).length+1;b--;){var _=x[127];if(255===_){c[E]=Es(c[E],x.slice(m,1+f));break}else c[E]=Es(c[E],x.slice(m,127));var A=a[_];if(!A)throw new Error("Chunk "+P+" points to unused index "+_+".");if(A[0]!==P)throw new Error("Chunk index "+_+" did not link to previous chunk index "+P+".");x=A,P=_,m=1}if(0>=b)throw new Error("Malformed file chunks did not link correctly.")}return c}function ve(e){var t=pe(e),n=me(e),r=Ee(e);return r-n-t.flashPageSize}var Me=function(e){try{return!!e()}catch(t){return!0}},Ce=!Me(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),Ne=!1,He=t(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),Ue=t(function(e){var t=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=t)}),ze=Ue.version,Ye=function(e){return"object"==typeof e?null!==e:"function"==typeof e},$e=function(e){if(!Ye(e))throw TypeError(e+" is not an object!");return e},we=He.document,je=Ye(we)&&Ye(we.createElement),Ve=function(e){return je?we.createElement(e):{}},Ge=!Ce&&!Me(function(){return 7!=Object.defineProperty(Ve("div"),"a",{get:function(){return 7}}).a}),We=function(e,t){if(!Ye(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!Ye(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!Ye(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!Ye(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},Ke=Object.defineProperty,Xe=Ce?Object.defineProperty:function(e,t,n){if($e(e),t=We(t,!0),$e(n),Ge)try{return Ke(e,t,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e},f={f:Xe},Ze=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},qe=Ce?function(e,t,n){return f.f(e,t,Ze(1,n))}:function(e,t,n){return e[t]=n,e},Je={}.hasOwnProperty,Qe=function(e,t){return Je.call(e,t)},et=0,tt=Math.random(),nt=function(e){return"Symbol(".concat(e===void 0?"":e,")_",(++et+tt).toString(36))},rt=t(function(e){var t=He["__core-js_shared__"]||(He["__core-js_shared__"]={});(e.exports=function(e,n){return t[e]||(t[e]=n===void 0?{}:n)})("versions",[]).push({version:Ue.version,mode:"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})}),st=rt("native-function-to-string",Function.toString),ot=t(function(e){var t=nt("src"),n="toString",r=(""+st).split(n);Ue.inspectSource=function(e){return st.call(e)},(e.exports=function(e,n,a,s){var o="function"==typeof a;o&&(Qe(a,"name")||qe(a,"name",n));e[n]===a||(o&&(Qe(a,t)||qe(a,t,e[n]?""+e[n]:r.join(n+""))),e===He?e[n]=a:s?e[n]?e[n]=a:qe(e,n,a):(delete e[n],qe(e,n,a)))})(Function.prototype,n,function(){return"function"==typeof this&&this[t]||st.call(this)})}),it=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},lt=function(e,t,n){return(it(e),void 0===t)?e:1===n?function(n){return e.call(t,n)}:2===n?function(n,r){return e.call(t,n,r)}:3===n?function(n,r,a){return e.call(t,n,r,a)}:function(){return e.apply(t,arguments)}},dt="prototype",ct=function(e,t,n){var r,a,s,o,i=e&ct.F,l=e&ct.G,d=e&ct.S,c=e&ct.P,g=e&ct.B,h=l?He:d?He[t]||(He[t]={}):(He[t]||{})[dt],u=l?Ue:Ue[t]||(Ue[t]={}),p=u[dt]||(u[dt]={});for(r in l&&(n=t),n)a=!i&&h&&void 0!==h[r],s=(a?h:n)[r],o=g&&a?lt(s,He):c&&"function"==typeof s?lt(Function.call,s):s,h&&ot(h,r,s,e&ct.U),u[r]!=s&&qe(u,r,o),c&&p[r]!=s&&(p[r]=s)};He.core=Ue,ct.F=1,ct.G=2,ct.S=4,ct.P=8,ct.B=16,ct.W=32,ct.U=64,ct.R=128;for(var gt,ht=ct,ut=nt("typed_array"),pt=nt("view"),ft=!!(He.ArrayBuffer&&He.DataView),yt=ft,mt=0,Et=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"];mt<9;)(gt=He[Et[mt++]])?(qe(gt.prototype,ut,!0),qe(gt.prototype,pt,!0)):yt=!1;var St={ABV:ft,CONSTR:yt,TYPED:ut,VIEW:pt},xt=function(e,t,n){for(var r in t)ot(e,r,t[r],n);return e},Pt=function(e,t,n,r){if(!(e instanceof t)||r!==void 0&&r in e)throw TypeError(n+": incorrect invocation!");return e},bt=function(e){return isNaN(e=+e)?0:(0<e?Oe:Be)(e)},_t=function(e){return 0<e?De(bt(e),9007199254740991):0},At=function(e){if(e===void 0)return 0;var t=bt(e),n=_t(t);if(t!==n)throw RangeError("Wrong length!");return n},It={}.toString,Tt=function(e){return It.call(e).slice(8,-1)},vt=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==Tt(e)?e.split(""):Object(e)},Ft=function(e){if(e==null)throw TypeError("Can't call method on "+e);return e},kt=function(e){return vt(Ft(e))},Ot=function(e,t){return e=bt(e),0>e?Le(e+t,0):De(e,t)},Bt=function(e){return function(t,n,r){var a,s=kt(t),o=_t(s.length),i=Ot(r,o);if(e&&n!=n){for(;o>i;)if(a=s[i++],a!=a)return!0;}else for(;o>i;i++)if((e||i in s)&&s[i]===n)return e||i||0;return!e&&-1}},Lt=rt("keys"),Rt=function(e){return Lt[e]||(Lt[e]=nt(e))},Dt=Bt(!1),Mt=Rt("IE_PROTO"),Ct=function(e,t){var n,r=kt(e),a=0,s=[];for(n in r)n!=Mt&&Qe(r,n)&&s.push(n);for(;t.length>a;)Qe(r,n=t[a++])&&(~Dt(s,n)||s.push(n));return s},Nt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ht=Nt.concat("length","prototype"),Ut=Object.getOwnPropertyNames||function(e){return Ct(e,Ht)},zt={f:Ut},Yt=function(e){return Object(Ft(e))},$t=function(e){for(var t=Yt(this),n=_t(t.length),r=arguments.length,a=Ot(1<r?arguments[1]:void 0,n),s=2<r?arguments[2]:void 0,o=void 0===s?n:Ot(s,n);o>a;)t[a++]=e;return t},wt=t(function(e){var t=rt("wks"),n=He.Symbol,r="function"==typeof n,a=e.exports=function(e){return t[e]||(t[e]=r&&n[e]||(r?n:nt)("Symbol."+e))};a.store=t}),jt=f.f,Vt=wt("toStringTag"),Gt=function(e,t,n){e&&!Qe(e=n?e:e.prototype,Vt)&&jt(e,Vt,{configurable:!0,value:t})},Wt=t(function(e,t){function n(t,n,r){var a,o,l,d=Array(r),g=8*r-n-1,h=(1<<g)-1,u=h>>1,p=23===n?T(2,-24)-T(2,-77):0,f=0,y=0>t||0===t&&0>1/t?1:0;for(t=I(t),t!=t||t===_?(o=t==t?0:1,a=h):(a=v(F(t)/k),1>t*(l=T(2,-a))&&(a--,l*=2),t+=1<=a+u?p/l:p*T(2,1-u),2<=t*l&&(a++,l/=2),a+u>=h?(o=0,a=h):1<=a+u?(o=(t*l-1)*T(2,n),a+=u):(o=t*T(2,u-1)*T(2,n),a=0));8<=n;d[f++]=255&o,o/=256,n-=8);for(a=a<<n|o,g+=n;0<g;d[f++]=255&a,a/=256,g-=8);return d[--f]|=128*y,d}function r(t,n,r){var a,o=8*r-n-1,l=(1<<o)-1,d=l>>1,c=o-7,g=r-1,h=t[g--],u=127&h;for(h>>=7;0<c;u=256*u+t[g],g--,c-=8);for(a=u&(1<<-c)-1,u>>=-c,c+=n;0<c;a=256*a+t[g],g--,c-=8);if(0===u)u=1-d;else{if(u===l)return a?NaN:h?-_:_;a+=T(2,n),u-=d}return(h?-1:1)*a*T(2,u-n)}function a(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function s(e){return[255&e]}function o(e){return[255&e,255&e>>8]}function i(e){return[255&e,255&e>>8,255&e>>16,255&e>>24]}function l(e){return n(e,52,8)}function d(e){return n(e,23,4)}function c(e,t,n){p(e.prototype,t,{get:function(){return this[n]}})}function g(e,t,n,r){var a=At(+n);if(a+t>e[D])throw b("Wrong index!");var s=e[R]._b,o=a+e[M],i=s.slice(o,o+t);return r?i:i.reverse()}function h(e,t,n,r,a,s){var o=At(+n);if(o+t>e[D])throw b("Wrong index!");for(var l=e[R]._b,d=o+e[M],c=r(+a),g=0;g<t;g++)l[d+g]=c[s?g:t-g-1]}var u=zt.f,p=f.f,y="ArrayBuffer",m="DataView",E="prototype",S=He[y],x=He[m],P=He.Math,b=He.RangeError,_=He.Infinity,A=S,I=P.abs,T=Re,v=Oe,F=P.log,k=P.LN2,O="buffer",B="byteLength",L="byteOffset",R=Ce?"_b":O,D=Ce?"_l":B,M=Ce?"_o":L;if(!St.ABV)S=function(e){Pt(this,S,y);var t=At(e);this._b=$t.call(Array(t),0),this[D]=t},x=function(e,t,n){Pt(this,x,m),Pt(e,S,m);var r=e[D],a=bt(t);if(0>a||a>r)throw b("Wrong offset!");if(n=void 0===n?r-a:_t(n),a+n>r)throw b("Wrong length!");this[R]=e,this[M]=a,this[D]=n},Ce&&(c(S,B,"_l"),c(x,O,"_b"),c(x,B,"_l"),c(x,L,"_o")),xt(x[E],{getInt8:function(e){return g(this,1,e)[0]<<24>>24},getUint8:function(e){return g(this,1,e)[0]},getInt16:function(e){var t=g(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=g(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return a(g(this,4,e,arguments[1]))},getUint32:function(e){return a(g(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return r(g(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return r(g(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){h(this,1,e,s,t)},setUint8:function(e,t){h(this,1,e,s,t)},setInt16:function(e,t){h(this,2,e,o,t,arguments[2])},setUint16:function(e,t){h(this,2,e,o,t,arguments[2])},setInt32:function(e,t){h(this,4,e,i,t,arguments[2])},setUint32:function(e,t){h(this,4,e,i,t,arguments[2])},setFloat32:function(e,t){h(this,4,e,d,t,arguments[2])},setFloat64:function(e,t){h(this,8,e,l,t,arguments[2])}});else{if(!Me(function(){S(1)})||!Me(function(){new S(-1)})||Me(function(){return new S,new S(1.5),new S(NaN),S.name!=y})){S=function(e){return Pt(this,S),new A(At(e))};for(var C,N=S[E]=A[E],H=u(A),U=0;H.length>U;)(C=H[U++])in S||qe(S,C,A[C]);N.constructor=S}var z=new x(new S(2)),Y=x[E].setInt8;z.setInt8(0,2147483648),z.setInt8(1,2147483649),(z.getInt8(0)||!z.getInt8(1))&&xt(x[E],{setInt8:function(e,t){Y.call(this,e,t<<24>>24)},setUint8:function(e,t){Y.call(this,e,t<<24>>24)}},!0)}Gt(S,y),Gt(x,m),qe(x[E],St.VIEW,!0),t[y]=S,t[m]=x}),Kt=wt("toStringTag"),Xt="Arguments"==Tt(function(){return arguments}()),Zt=function(e,t){try{return e[t]}catch(t){}},qt=function(e){var t,n,r;return e===void 0?"Undefined":null===e?"Null":"string"==typeof(n=Zt(t=Object(e),Kt))?n:Xt?Tt(t):"Object"==(r=Tt(t))&&"function"==typeof t.callee?"Arguments":r},Jt={},Qt=wt("iterator"),en=Array.prototype,tn=function(e){return e!==void 0&&(Jt.Array===e||en[Qt]===e)},nn=Object.keys||function(e){return Ct(e,Nt)},rn=Ce?Object.defineProperties:function(e,t){$e(e);for(var n,r=nn(t),a=r.length,s=0;a>s;)f.f(e,n=r[s++],t[n]);return e},an=He.document,sn=an&&an.documentElement,on=Rt("IE_PROTO"),ln=function(){},dn="prototype",cn=function(){var e,t=Ve("iframe"),n=Nt.length,r="<",a=">";for(t.style.display="none",sn.appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(r+"script"+a+"document.F=Object"+r+"/script"+a),e.close(),cn=e.F;n--;)delete cn[dn][Nt[n]];return cn()},gn=Object.create||function(e,t){var n;return null===e?n=cn():(ln[dn]=$e(e),n=new ln,ln[dn]=null,n[on]=e),void 0===t?n:rn(n,t)},hn=Rt("IE_PROTO"),un=Object.prototype,pn=Object.getPrototypeOf||function(e){return e=Yt(e),Qe(e,hn)?e[hn]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?un:null},fn=wt("iterator"),yn=Ue.getIteratorMethod=function(e){if(e!=null)return e[fn]||e["@@iterator"]||Jt[qt(e)]},mn=Array.isArray||function(e){return"Array"==Tt(e)},En=wt("species"),Sn=function(e){var t;return mn(e)&&(t=e.constructor,"function"==typeof t&&(t===Array||mn(t.prototype))&&(t=void 0),Ye(t)&&(t=t[En],null===t&&(t=void 0))),void 0===t?Array:t},xn=function(e,t){return new(Sn(e))(t)},Pn=function(e,t){var n=1==e,r=4==e,a=6==e,s=t||xn;return function(t,o,i){for(var l,d,c=Yt(t),g=vt(c),h=lt(o,i,3),u=_t(g.length),p=0,f=n?s(t,u):2==e?s(t,0):void 0;u>p;p++)if((5==e||a||p in g)&&(l=g[p],d=h(l,p,c),e))if(n)f[p]=d;else if(d)switch(e){case 3:return!0;case 5:return l;case 6:return p;case 2:f.push(l);}else if(r)return!1;return a?-1:3==e||r?r:f}},bn=wt("species"),_n=function(e,t){var n,r=$e(e).constructor;return r===void 0||(n=$e(r)[bn])==null?t:it(n)},An=wt("unscopables"),In=Array.prototype;In[An]==null&&qe(In,An,{});var Tn=function(e){In[An][e]=!0},vn=function(e,t){return{value:t,done:!!e}},Fn={};qe(Fn,wt("iterator"),function(){return this});var kn=function(e,t,n){e.prototype=gn(Fn,{next:Ze(1,n)}),Gt(e,t+" Iterator")},On=wt("iterator"),Bn=!([].keys&&"next"in[].keys()),Ln="keys",Rn="values",Dn=function(){return this},Mn=function(e,t,n,r,a,s,o){kn(n,t,r);var i,l,d,c=function(e){return!Bn&&e in p?p[e]:e===Ln?function(){return new n(this,e)}:e===Rn?function(){return new n(this,e)}:function(){return new n(this,e)}},g=t+" Iterator",h=a==Rn,u=!1,p=e.prototype,f=p[On]||p["@@iterator"]||a&&p[a],y=f||c(a),m=a?h?c("entries"):y:void 0,E="Array"==t?p.entries||f:f;if(E&&(d=pn(E.call(new e)),d!==Object.prototype&&d.next&&(Gt(d,g,!0),"function"!=typeof d[On]&&qe(d,On,Dn))),h&&f&&f.name!==Rn&&(u=!0,y=function(){return f.call(this)}),(Bn||u||!p[On])&&qe(p,On,y),Jt[t]=y,Jt[g]=Dn,a)if(i={values:h?y:c(Rn),keys:s?y:c(Ln),entries:m},o)for(l in i)l in p||ot(p,l,i[l]);else ht(ht.P+ht.F*(Bn||u),t,i);return i},Cn=Mn(Array,"Array",function(e,t){this._t=kt(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,vn(1)):"keys"==t?vn(0,n):"values"==t?vn(0,e[n]):vn(0,[n,e[n]])},"values");Jt.Arguments=Jt.Array,Tn("keys"),Tn("values"),Tn("entries");var Nn=wt("iterator"),Hn=!1;try{var Un=[7][Nn]();Un["return"]=function(){Hn=!0},Array.from(Un,function(){throw 2})}catch(t){}var zn=function(e,t){if(!t&&!Hn)return!1;var n=!1;try{var r=[7],a=r[Nn]();a.next=function(){return{done:n=!0}},r[Nn]=function(){return a},e(r)}catch(t){}return n},Yn=wt("species"),$n=function(e){var t=He[e];Ce&&t&&!t[Yn]&&f.f(t,Yn,{configurable:!0,get:function(){return this}})},wn=[].copyWithin||function(e,t){var n=Yt(this),r=_t(n.length),a=Ot(e,r),s=Ot(t,r),o=2<arguments.length?arguments[2]:void 0,i=De((o===void 0?r:Ot(o,r))-s,r-a),l=1;for(s<a&&a<s+i&&(l=-1,s+=i-1,a+=i-1);0<i--;)s in n?n[a]=n[s]:delete n[a],a+=l,s+=l;return n},jn={}.propertyIsEnumerable,Vn={f:jn},Gn=Object.getOwnPropertyDescriptor,Wn=Ce?Gn:function(e,t){if(e=kt(e),t=We(t,!0),Ge)try{return Gn(e,t)}catch(t){}return Qe(e,t)?Ze(!Vn.f.call(e,t),e[t]):void 0},Kn={f:Wn},Xn=t(function(e){if(Ce){var t=Ne,n=He,r=Me,a=ht,s=St,o=Wt,i=Pt,l=qe,d=xt,c=_t,g=At,h=Ot,u=We,p=Qe,y=qt,m=Ye,E=Yt,S=zt.f,x=nt,P=wt,b=Pn,_=Bt,A=_n,I=Cn,T=f,v=Kn,F=T.f,k=v.f,O=n.RangeError,B=n.TypeError,L=n.Uint8Array,R="ArrayBuffer",D="Shared"+R,M="BYTES_PER_ELEMENT",C="prototype",N=Array[C],H=o.ArrayBuffer,U=o.DataView,z=b(0),Y=b(2),$=b(3),w=b(4),j=b(5),V=b(6),G=_(!0),W=_(!1),K=I.values,X=I.keys,Z=I.entries,q=N.lastIndexOf,J=N.reduce,Q=N.reduceRight,ee=N.join,te=N.sort,ne=N.slice,re=N.toString,ae=N.toLocaleString,se=P("iterator"),oe=P("toStringTag"),ie=x("typed_constructor"),le=x("def_constructor"),de=s.CONSTR,ce=s.TYPED,ge=s.VIEW,he="Wrong length!",ue=b(1,function(e,t){return Ee(A(e,e[le]),t)}),pe=r(function(){return 1===new L(new Uint16Array([1]).buffer)[0]}),fe=!!L&&!!L[C].set&&r(function(){new L(1).set({})}),ye=function(e,t){var n=bt(e);if(0>n||n%t)throw O("Wrong offset!");return n},me=function(e){if(m(e)&&ce in e)return e;throw B(e+" is not a typed array!")},Ee=function(e,t){if(!(m(e)&&ie in e))throw B("It is not a typed array constructor!");return new e(t)},Se=function(e,t){return xe(A(e,e[le]),t)},xe=function(e,t){for(var n=0,r=t.length,a=Ee(e,r);r>n;)a[n]=t[n++];return a},Pe=function(e,t,n){F(e,t,{get:function(){return this._d[n]}})},be=function(e){var t,n,r,a,s,o,l=E(e),d=arguments.length,g=1<d?arguments[1]:void 0,h=g!==void 0,u=yn(l);if(u!=null&&!tn(u)){for(o=u.call(l),r=[],t=0;!(s=o.next()).done;t++)r.push(s.value);l=r}for(h&&2<d&&(g=lt(g,arguments[2],2)),t=0,n=c(l.length),a=Ee(this,n);n>t;t++)a[t]=h?g(l[t],t):l[t];return a},_e=function(){for(var e=0,t=arguments.length,n=Ee(this,t);t>e;)n[e]=arguments[e++];return n},Ae=!!L&&r(function(){ae.call(new L(1))}),Ie=function(){return ae.apply(Ae?ne.call(me(this)):me(this),arguments)},Te={copyWithin:function(e,t){return wn.call(me(this),e,t,2<arguments.length?arguments[2]:void 0)},every:function(e){return w(me(this),e,1<arguments.length?arguments[1]:void 0)},fill:function(){return $t.apply(me(this),arguments)},filter:function(e){return Se(this,Y(me(this),e,1<arguments.length?arguments[1]:void 0))},find:function(e){return j(me(this),e,1<arguments.length?arguments[1]:void 0)},findIndex:function(e){return V(me(this),e,1<arguments.length?arguments[1]:void 0)},forEach:function(e){z(me(this),e,1<arguments.length?arguments[1]:void 0)},indexOf:function(e){return W(me(this),e,1<arguments.length?arguments[1]:void 0)},includes:function(e){return G(me(this),e,1<arguments.length?arguments[1]:void 0)},join:function(){return ee.apply(me(this),arguments)},lastIndexOf:function(){return q.apply(me(this),arguments)},map:function(e){return ue(me(this),e,1<arguments.length?arguments[1]:void 0)},reduce:function(){return J.apply(me(this),arguments)},reduceRight:function(){return Q.apply(me(this),arguments)},reverse:function(){for(var e,t=this,n=me(t).length,r=Oe(n/2),a=0;a<r;)e=t[a],t[a++]=t[--n],t[n]=e;return t},some:function(e){return $(me(this),e,1<arguments.length?arguments[1]:void 0)},sort:function(e){return te.call(me(this),e)},subarray:function(e,t){var n=me(this),r=n.length,a=h(e,r);return new(A(n,n[le]))(n.buffer,n.byteOffset+a*n.BYTES_PER_ELEMENT,c((t===void 0?r:h(t,r))-a))}},ve=function(e,t){return Se(this,ne.call(me(this),e,t))},Fe=function(e){me(this);var t=ye(arguments[1],1),n=this.length,r=E(e),a=c(r.length),s=0;if(a+t>n)throw O(he);for(;s<a;)this[t+s]=r[s++]},ke={entries:function(){return Z.call(me(this))},keys:function(){return X.call(me(this))},values:function(){return K.call(me(this))}},Be=function(e,t){return m(e)&&e[ce]&&"symbol"!=typeof t&&t in e&&+t+""==t+""},Le=function(e,t){return Be(e,t=u(t,!0))?Ze(2,e[t]):k(e,t)},Re=function(e,t,n){return Be(e,t=u(t,!0))&&m(n)&&p(n,"value")&&!p(n,"get")&&!p(n,"set")&&!n.configurable&&(!p(n,"writable")||n.writable)&&(!p(n,"enumerable")||n.enumerable)?(e[t]=n.value,e):F(e,t,n)};de||(v.f=Le,T.f=Re),a(a.S+a.F*!de,"Object",{getOwnPropertyDescriptor:Le,defineProperty:Re}),r(function(){re.call({})})&&(re=ae=function(){return ee.call(this)});var De=d({},Te);d(De,ke),l(De,se,ke.values),d(De,{slice:ve,set:Fe,constructor:function(){},toString:re,toLocaleString:Ie}),Pe(De,"buffer","b"),Pe(De,"byteOffset","o"),Pe(De,"byteLength","l"),Pe(De,"length","e"),F(De,oe,{get:function(){return this[ce]}}),e.exports=function(e,o,d,h){h=!!h;var u=e+(h?"Clamped":"")+"Array",p=n[u],f=p||{},E=p&&pn(p),x=!p||!s.ABV,P={},b=p&&p[C],_=function(t,n){var r=t._d;return r.v["get"+e](n*o+r.o,pe)},A=function(t,n,r){var a=t._d;h&&(r=0>(r=Math.round(r))?0:255<r?255:255&r),a.v["set"+e](n*o+a.o,r,pe)},I=function(e,t){F(e,t,{get:function(){return _(this,t)},set:function(e){return A(this,t,e)},enumerable:!0})};x?(p=d(function(e,t,n,r){i(e,p,u,"_d");var a,s,d,h,f=0,E=0;if(!m(t))d=g(t),s=d*o,a=new H(s);else if(t instanceof H||(h=y(t))==R||h==D){a=t,E=ye(n,o);var S=t.byteLength;if(void 0===r){if(S%o)throw O(he);if(s=S-E,0>s)throw O(he)}else if(s=c(r)*o,s+E>S)throw O(he);d=s/o}else return ce in t?xe(p,t):be.call(p,t);for(l(e,"_d",{b:a,o:E,l:s,e:d,v:new U(a)});f<d;)I(e,f++)}),b=p[C]=gn(De),l(b,"constructor",p)):(!r(function(){p(1)})||!r(function(){new p(-1)})||!zn(function(e){new p,new p(null),new p(1.5),new p(e)},!0))&&(p=d(function(e,t,n,r){i(e,p,u);var a;return m(t)?t instanceof H||(a=y(t))==R||a==D?void 0===r?void 0===n?new f(t):new f(t,ye(n,o)):new f(t,ye(n,o),r):ce in t?xe(p,t):be.call(p,t):new f(g(t))}),z(E===Function.prototype?S(f):S(f).concat(S(E)),function(e){e in p||l(p,e,f[e])}),p[C]=b,!t&&(b.constructor=p));var T=b[se],v=!!T&&("values"==T.name||T.name==null),k=ke.values;l(p,ie,!0),l(b,ce,u),l(b,ge,!0),l(b,le,p),(h?new p(1)[oe]!=u:!(oe in b))&&F(b,oe,{get:function(){return u}}),P[u]=p,a(a.G+a.W+a.F*(p!=f),P),a(a.S,u,{BYTES_PER_ELEMENT:o}),a(a.S+a.F*r(function(){f.of.call(p,1)}),u,{from:be,of:_e}),M in b||l(b,M,o),a(a.P,u,Te),$n(u),a(a.P+a.F*fe,u,{set:Fe}),a(a.P+a.F*!v,u,ke),t||b.toString==re||(b.toString=re),a(a.P+a.F*r(function(){new p(1).slice()}),u,{slice:ve}),a(a.P+a.F*(r(function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()})||!r(function(){b.toLocaleString.call([1,2])})),u,{toLocaleString:Ie}),Jt[u]=v?T:k,t||v||l(b,se,k)}}else e.exports=function(){}});Xn("Uint8",1,function(e){return function(t,n,r){return e(this,t,n,r)}}),ht(ht.P,"Array",{fill:$t}),Tn("fill");var Zn=function(e){return function(t,n){var r,o,d=Ft(t)+"",s=bt(n),i=d.length;return 0>s||s>=i?e?"":void 0:(r=d.charCodeAt(s),55296>r||56319<r||s+1===i||56320>(o=d.charCodeAt(s+1))||57343<o?e?d.charAt(s):r:e?d.slice(s,s+2):(r-55296<<10)+(o-56320)+65536)}},qn=Zn(!0),at=function(e,t,n){return t+(n?qn(e,t).length:1)},Jn=RegExp.prototype.exec,Qn=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw new TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==qt(e))throw new TypeError("RegExp#exec called on incompatible receiver");return Jn.call(e,t)},er=function(){var e=$e(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},tr=RegExp.prototype.exec,nr=ke.replace,rr=tr,ar="lastIndex",sr=function(){var e=/a/,t=/b*/g;return tr.call(e,"a"),tr.call(t,"a"),0!==e[ar]||0!==t[ar]}(),or=/()??/.exec("")[1]!==void 0;(sr||or)&&(rr=function(e){var t,n,r,a,s=this;return or&&(n=new RegExp("^"+s.source+"$(?!\\s)",er.call(s))),sr&&(t=s[ar]),r=tr.call(s,e),sr&&r&&(s[ar]=s.global?r.index+r[0].length:t),or&&r&&1<r.length&&nr.call(r[0],n,function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)}),r});var ir=rr;ht({target:"RegExp",proto:!0,forced:ir!==/./.exec},{exec:ir});var lr=wt("species"),dr=!Me(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),cr=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}(),gr=function(e,t,n){var r=wt(e),a=!Me(function(){var t={};return t[r]=function(){return 7},7!=""[e](t)}),s=a?!Me(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[lr]=function(){return n}),n[r](""),!t}):void 0;if(!a||!s||"replace"===e&&!dr||"split"===e&&!cr){var o=/./[r],i=n(Ft,r,""[e],function(e,t,n,r,s){return t.exec===ir?a&&!s?{done:!0,value:o.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),l=i[0],d=i[1];ot(String.prototype,e,l),qe(RegExp.prototype,r,2==t?function(e,t){return d.call(e,this,t)}:function(e){return d.call(e,this)})}},hr=function(e){return e===void 0?e:e+""};gr("replace",2,function(e,t,n,r){function a(e,t,r,a,s,o){var i=r+e.length,l=a.length,d=/\$([$&`']|\d\d?)/g;return void 0!==s&&(s=Yt(s),d=/\$([$&`']|\d\d?|<[^>]*>)/g),n.call(o,d,function(o,d){var c;switch(d.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(i);case"<":c=s[d.slice(1,-1)];break;default:var g=+d;if(0==g)return o;if(g>l){var n=Oe(g/10);return 0===n?o:n<=l?void 0===a[n-1]?d.charAt(1):a[n-1]+d.charAt(1):o}c=a[g-1];}return void 0===c?"":c})}return[function(r,a){var s=e(this),o=r==null?void 0:r[t];return o===void 0?n.call(s+"",r,a):o.call(r,s,a)},function(e,t){var s=r(n,e,this,t);if(s.done)return s.value;var o=$e(e),l=this+"",d="function"==typeof t;d||(t=t+"");var c=o.global;if(c){var g=o.unicode;o.lastIndex=0}for(var h,u=[];(h=Qn(o,l),null!==h)&&!(u.push(h),!c);){var p=h[0]+"";""==p&&(o.lastIndex=at(l,_t(o.lastIndex),g))}for(var f="",y=0,m=0;m<u.length;m++){h=u[m];for(var E=h[0]+"",S=Le(De(bt(h.index),l.length),0),x=[],P=1;P<h.length;P++)x.push(hr(h[P]));var b=h.groups;if(d){var _=[E].concat(x,S,l);b!==void 0&&_.push(b);var A=t.apply(void 0,_)+""}else A=a(E,l,S,x,b,t);S>=y&&(f+=l.slice(y,S)+A,y=S+E.length)}return f+l.slice(y)}]});var ur=function(t,n,e,r){try{return r?n($e(e)[0],e[1]):n(e)}catch(n){var a=t["return"];throw void 0!==a&&$e(a.call(t)),n}},pr=t(function(e){var t={},n={},r=e.exports=function(e,r,a,s,o){var i,l,d,c,g=o?function(){return e}:yn(e),h=lt(a,s,r?2:1),u=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(tn(g)){for(i=_t(e.length);i>u;u++)if(c=r?h($e(l=e[u])[0],l[1]):h(e[u]),c===t||c===n)return c;}else for(d=g.call(e);!(l=d.next()).done;)if(c=ur(d,h,l.value,r),c===t||c===n)return c};r.BREAK=t,r.RETURN=n}),fr=t(function(e){var t=nt("meta"),n=f.f,r=0,a=Object.isExtensible||function(){return!0},s=!Me(function(){return a(Object.preventExtensions({}))}),o=function(e){n(e,t,{value:{i:"O"+ ++r,w:{}}})},i=e.exports={KEY:t,NEED:!1,fastKey:function(e,n){if(!Ye(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!Qe(e,t)){if(!a(e))return"F";if(!n)return"E";o(e)}return e[t].i},getWeak:function(e,n){if(!Qe(e,t)){if(!a(e))return!0;if(!n)return!1;o(e)}return e[t].w},onFreeze:function(e){return s&&i.NEED&&a(e)&&!Qe(e,t)&&o(e),e}}}),yr=fr.KEY,mr=fr.NEED,Er=fr.fastKey,Sr=fr.getWeak,xr=fr.onFreeze,Pr=function(e,t){if(!Ye(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e},br=f.f,_r=fr.fastKey,Ar=Ce?"_s":"size",Ir=function(e,t){var n,r=_r(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n},Tr={getConstructor:function(e,t,n,r){var a=e(function(e,s){Pt(e,a,t,"_i"),e._t=t,e._i=gn(null),e._f=void 0,e._l=void 0,e[Ar]=0,null!=s&&pr(s,n,e[r],e)});return xt(a.prototype,{clear:function(){for(var e=Pr(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[Ar]=0},delete:function(e){var n=Pr(this,t),r=Ir(n,e);if(r){var a=r.n,s=r.p;delete n._i[r.i],r.r=!0,s&&(s.n=a),a&&(a.p=s),n._f==r&&(n._f=a),n._l==r&&(n._l=s),n[Ar]--}return!!r},forEach:function(e){Pr(this,t);for(var n,r=lt(e,1<arguments.length?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!Ir(Pr(this,t),e)}}),Ce&&br(a.prototype,"size",{get:function(){return Pr(this,t)[Ar]}}),a},def:function(e,t,n){var r,a,s=Ir(e,t);return s?s.v=n:(e._l=s={i:a=_r(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},!e._f&&(e._f=s),r&&(r.n=s),e[Ar]++,"F"!==a&&(e._i[a]=s)),e},getEntry:Ir,setStrong:function(e,t,n){Mn(e,t,function(e,n){this._t=Pr(e,t),this._k=n,this._l=void 0},function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?"keys"==t?vn(0,n.k):"values"==t?vn(0,n.v):vn(0,[n.k,n.v]):(e._t=void 0,vn(1))},n?"entries":"values",!n,!0),$n(t)}},vr=function(e,t){if($e(e),!Ye(t)&&null!==t)throw TypeError(t+": can't set as prototype!")},Fr={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{n=lt(Function.call,Kn.f(Object.prototype,"__proto__").set,2),n(e,[]),t=!(e instanceof Array)}catch(n){t=!0}return function(e,r){return vr(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:vr},kr=Fr.set,Or=function(e,t,n){var r,a=t.constructor;return a!==n&&"function"==typeof a&&(r=a.prototype)!==n.prototype&&Ye(r)&&kr&&kr(e,r),e},Br=function(e,t,n,r,a,s){var o=He[e],i=o,l=a?"set":"add",d=i&&i.prototype,c={},g=function(e){var t=d[e];ot(d,e,"delete"==e?function(e){return(!s||Ye(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return(!s||Ye(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return s&&!Ye(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"!=typeof i||!(s||d.forEach&&!Me(function(){new i().entries().next()})))i=r.getConstructor(t,e,a,l),xt(i.prototype,n),fr.NEED=!0;else{var h=new i,u=h[l](s?{}:-0,1)!=h,p=Me(function(){h.has(1)}),f=zn(function(e){new i(e)}),y=!s&&Me(function(){for(var e=new i,t=5;t--;)e[l](t,t);return!e.has(-0)});f||(i=t(function(t,n){Pt(t,i,e);var r=Or(new o,t,i);return null!=n&&pr(n,a,r[l],r),r}),i.prototype=d,d.constructor=i),(p||y)&&(g("delete"),g("has"),a&&g("get")),(y||u)&&g(l),s&&d.clear&&delete d.clear}return Gt(i,e),c[e]=i,ht(ht.G+ht.W+ht.F*(i!=o),c),s||r.setStrong(i,e,a),i},Lr="Set",Rr=Br(Lr,function(e){return function(){return e(this,0<arguments.length?arguments[0]:void 0)}},{add:function(e){return Tr.def(Pr(this,Lr),e=0===e?0:e,e)}},Tr);gr("match",1,function(e,t,r,a){return[function(n){var r=e(this),a=n==null?void 0:n[t];return a===void 0?new RegExp(n)[t](r+""):a.call(n,r)},function(e){var t=a(r,e,this);if(t.done)return t.value;var s=$e(e),o=this+"";if(!s.global)return Qn(s,o);var i=s.unicode;s.lastIndex=0;for(var l,d=[],c=0;null!==(l=Qn(s,o));){var g=l[0]+"";d[c]=g,""==g&&(s.lastIndex=at(o,_t(s.lastIndex),i)),c++}return 0===c?null:d}]});var Dr=function(e,t,n){t in e?f.f(e,t,Ze(0,n)):e[t]=n};ht(ht.S+ht.F*!zn(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,r,a,s=Yt(e),o="function"==typeof this?this:Array,i=arguments.length,l=1<i?arguments[1]:void 0,d=void 0!==l,c=0,g=yn(s);if(d&&(l=lt(l,2<i?arguments[2]:void 0,2)),null!=g&&!(o==Array&&tn(g)))for(a=g.call(s),n=new o;!(r=a.next()).done;c++)Dr(n,c,d?ur(a,l,[r.value,c],!0):r.value);else for(t=_t(s.length),n=new o(t);t>c;c++)Dr(n,c,d?l(s[c],c):s[c]);return n.length=c,n}});var Mr=[].sort,Cr=[1,2,3];ht(ht.P+ht.F*(Me(function(){Cr.sort(void 0)})||!Me(function(){Cr.sort(null)})||!function(e,t){return!!e&&Me(function(){t?e.call(null,function(){},1):e.call(null)})}(Mr)),"Array",{sort:function(e){return e===void 0?Mr.call(Yt(this)):Mr.call(Yt(this),it(e))}});(function(e,t){var n=(Ue.Object||{})[e]||Object[e],r={};r[e]=t(n),ht(ht.S+ht.F*Me(function(){n(1)}),"Object",r)})("keys",function(){return function(e){return nn(Yt(e))}});var Nr={f:wt},Hr=f.f,Ur=function(e){var t=Ue.Symbol||(Ue.Symbol=He.Symbol||{});"_"==e.charAt(0)||e in t||Hr(t,e,{value:Nr.f(e)})};Ur("asyncIterator");var zr=Object.getOwnPropertySymbols,Yr={f:zr},$r=function(e){var t=nn(e),n=Yr.f;if(n)for(var r,a=n(e),s=Vn.f,o=0;a.length>o;)s.call(e,r=a[o++])&&t.push(r);return t},wr=zt.f,jr={}.toString,Vr="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Gr=function(e){try{return wr(e)}catch(t){return Vr.slice()}},Wr={f:function(e){return Vr&&"[object Window]"==jr.call(e)?Gr(e):wr(kt(e))}},Kr=fr.KEY,Xr=Kn.f,Zr=f.f,qr=Wr.f,Jr=He.Symbol,Qr=He.JSON,ea=Qr&&Qr.stringify,ta="prototype",na=wt("_hidden"),ra=wt("toPrimitive"),aa={}.propertyIsEnumerable,sa=rt("symbol-registry"),oa=rt("symbols"),ia=rt("op-symbols"),la=Object[ta],da="function"==typeof Jr&&!!Yr.f,ca=He.QObject,ga=!ca||!ca[ta]||!ca[ta].findChild,ha=Ce&&Me(function(){return 7!=gn(Zr({},"a",{get:function(){return Zr(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=Xr(la,t);r&&delete la[t],Zr(e,t,n),r&&e!==la&&Zr(la,t,r)}:Zr,ua=function(e){var t=oa[e]=gn(Jr[ta]);return t._k=e,t},pa=da&&"symbol"==typeof Jr.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof Jr},fa=function(e,t,n){return e===la&&fa(ia,t,n),$e(e),t=We(t,!0),$e(n),Qe(oa,t)?(n.enumerable?(Qe(e,na)&&e[na][t]&&(e[na][t]=!1),n=gn(n,{enumerable:Ze(0,!1)})):(!Qe(e,na)&&Zr(e,na,Ze(1,{})),e[na][t]=!0),ha(e,t,n)):Zr(e,t,n)},ya=function(e,t){$e(e);for(var n,r=$r(t=kt(t)),a=0,s=r.length;s>a;)fa(e,n=r[a++],t[n]);return e},ma=function(e){var t=aa.call(this,e=We(e,!0));return(this!==la||!Qe(oa,e)||Qe(ia,e))&&(!(t||!Qe(this,e)||!Qe(oa,e)||Qe(this,na)&&this[na][e])||t)},Ea=function(e,t){if(e=kt(e),t=We(t,!0),e!==la||!Qe(oa,t)||Qe(ia,t)){var n=Xr(e,t);return n&&Qe(oa,t)&&!(Qe(e,na)&&e[na][t])&&(n.enumerable=!0),n}},Sa=function(e){for(var t,n=qr(kt(e)),r=[],a=0;n.length>a;)Qe(oa,t=n[a++])||t==na||t==Kr||r.push(t);return r},xa=function(e){for(var t,n=e===la,r=qr(n?ia:kt(e)),a=[],s=0;r.length>s;)Qe(oa,t=r[s++])&&(!n||Qe(la,t))&&a.push(oa[t]);return a};da||(Jr=function(){if(this instanceof Jr)throw TypeError("Symbol is not a constructor!");var e=nt(0<arguments.length?arguments[0]:void 0),t=function(n){this===la&&t.call(ia,n),Qe(this,na)&&Qe(this[na],e)&&(this[na][e]=!1),ha(this,e,Ze(1,n))};return Ce&&ga&&ha(la,e,{configurable:!0,set:t}),ua(e)},ot(Jr[ta],"toString",function(){return this._k}),Kn.f=Ea,f.f=fa,zt.f=Wr.f=Sa,Vn.f=ma,Yr.f=xa,Ce&&!Ne&&ot(la,"propertyIsEnumerable",ma,!0),Nr.f=function(e){return ua(wt(e))}),ht(ht.G+ht.W+ht.F*!da,{Symbol:Jr});for(var Pa=["hasInstance","isConcatSpreadable","iterator","match","replace","search","species","split","toPrimitive","toStringTag","unscopables"],ba=0;Pa.length>ba;)wt(Pa[ba++]);for(var _a=nn(wt.store),Aa=0;_a.length>Aa;)Ur(_a[Aa++]);ht(ht.S+ht.F*!da,"Symbol",{for:function(e){return Qe(sa,e+="")?sa[e]:sa[e]=Jr(e)},keyFor:function(e){if(!pa(e))throw TypeError(e+" is not a symbol!");for(var t in sa)if(sa[t]===e)return t},useSetter:function(){ga=!0},useSimple:function(){ga=!1}}),ht(ht.S+ht.F*!da,"Object",{create:function(e,t){return t===void 0?gn(e):ya(gn(e),t)},defineProperty:fa,defineProperties:ya,getOwnPropertyDescriptor:Ea,getOwnPropertyNames:Sa,getOwnPropertySymbols:xa});var Ia=Me(function(){Yr.f(1)});ht(ht.S+ht.F*Ia,"Object",{getOwnPropertySymbols:function(e){return Yr.f(Yt(e))}}),Qr&&ht(ht.S+ht.F*(!da||Me(function(){var e=Jr();return"[null]"!=ea([e])||"{}"!=ea({a:e})||"{}"!=ea(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],a=1;arguments.length>a;)r.push(arguments[a++]);if(n=t=r[1],(Ye(t)||void 0!==e)&&!pa(e))return mn(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!pa(t))return t}),r[1]=t,ea.apply(Qr,r)}}),Jr[ta][ra]||qe(Jr[ta],ra,Jr[ta].valueOf),Gt(Jr,"Symbol"),Gt(Math,"Math",!0),Gt(He.JSON,"JSON",!0);for(var Ta=wt("iterator"),va=wt("toStringTag"),Fa=Jt.Array,ka={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},Oa=nn(ka),Ba=0;Ba<Oa.length;Ba++){var La,Ra=Oa[Ba],Da=ka[Ra],Ma=He[Ra],Ca=Ma&&Ma.prototype;if(Ca&&(Ca[Ta]||qe(Ca,Ta,Fa),Ca[va]||qe(Ca,va,Ra),Jt[Ra]=Fa,Da))for(La in Cn)Ca[La]||ot(Ca,La,Cn[La],!0)}var Na=Zn(!0);Mn(String,"String",function(e){this._t=e+"",this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=Na(t,n),this._i+=e.length,{value:e,done:!1})});var Ha=Br("Map",function(e){return function(){return e(this,0<arguments.length?arguments[0]:void 0)}},{get:function(e){var t=Tr.getEntry(Pr(this,"Map"),e);return t&&t.v},set:function(e,t){return Tr.def(Pr(this,"Map"),0===e?0:e,t)}},Tr,!0),Ua="\t\n\x0B\f\r \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF",za="["+Ua+"]",Ya="\u200B\x85",$a=RegExp("^"+za+za+"*"),wa=RegExp(za+za+"*$"),ja=function(e,t,n){var r={},a=Me(function(){return!!Ua[e]()||Ya[e]()!=Ya}),s=r[e]=a?t(Va):Ua[e];n&&(r[n]=s),ht(ht.P+ht.F*a,"String",r)},Va=ja.trim=function(e,t){return e=Ft(e)+"",1&t&&(e=e.replace($a,"")),2&t&&(e=e.replace(wa,"")),e},Ga=zt.f,Wa=Kn.f,Ka=f.f,Xa=ja.trim,Za="Number",qa=He[Za],Ja=qa,Qa=qa.prototype,es=Tt(gn(Qa))==Za,ts=("trim"in ke),ns=function(e){var t=We(e,!1);if("string"==typeof t&&2<t.length){t=ts?t.trim():Xa(t,3);var n,r,a,s=t.charCodeAt(0);if(43===s||45===s){if(n=t.charCodeAt(2),88===n||120===n)return NaN;}else if(48===s){switch(t.charCodeAt(1)){case 66:case 98:r=2,a=49;break;case 79:case 111:r=8,a=55;break;default:return+t;}for(var o,d=t.slice(2),c=0,g=d.length;c<g;c++)if(o=d.charCodeAt(c),48>o||o>a)return NaN;return parseInt(d,r)}}return+t};if(!qa(" 0o1")||!qa("0b1")||qa("+0x1")){qa=function(e){var t=1>arguments.length?0:e,n=this;return n instanceof qa&&(es?Me(function(){Qa.valueOf.call(n)}):Tt(n)!=Za)?Or(new Ja(ns(t)),n,qa):ns(t)};for(var rs,as=Ce?Ga(Ja):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),ss=0;as.length>ss;ss++)Qe(Ja,rs=as[ss])&&!Qe(qa,rs)&&Ka(qa,rs,Wa(Ja,rs));qa.prototype=Qa,Qa.constructor=qa,ot(He,Za,qa)}ht(ht.S,"Number",{isInteger:function(e){return!Ye(e)&&isFinite(e)&&Oe(e)===e}}),Ce&&"g"!=/./g.flags&&f.f(RegExp.prototype,"flags",{configurable:!0,get:er});var os=/./.toString,is=function(e){ot(RegExp.prototype,"toString",e,!0)};Me(function(){return"/a/b"!=os.call({source:"a",flags:"b"})})?is(function(){var e=$e(this);return"/".concat(e.source,"/","flags"in e?e.flags:!Ce&&e instanceof RegExp?er.call(e):void 0)}):os.name!="toString"&&is(function(){return os.call(this)});({})[wt("toStringTag")]="z",ot(Object.prototype,"toString",function(){return"[object "+qt(this)+"]"},!0);var ls=function(e){var t=Ft(this)+"",r="",a=bt(e);if(0>a||a==1/0)throw RangeError("Count can't be negative");for(;0<a;(a>>>=1)&&(t+=t))1&a&&(r+=t);return r},ds=function(e,t,n,r){var a=Ft(e)+"",s=a.length,o=void 0===n?" ":n+"",i=_t(t);if(i<=s||""==o)return a;var l=i-s,d=ls.call(o,Be(l/o.length));return d.length>l&&(d=d.slice(0,l)),r?d+a:a+d},cs=He.navigator,gs=cs&&cs.userAgent||"",hs=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(gs);ht(ht.P+ht.F*hs,"String",{padStart:function(e){return ds(this,e,1<arguments.length?arguments[1]:void 0,!0)}});var us=/:([0-9A-Fa-f]{8,})([0-9A-Fa-f]{2})(?:\r\n|\r|\n|)/g;Fe=Fe||function(e){return"number"==typeof e&&isFinite(e)&&Oe(e)===e};var ps=function(){function e(t){if(r(this,e),this._blocks=new Map,t&&"function"==typeof t[Symbol.iterator]){var a,s=u(t);try{for(s.s();!(a=s.n()).done;){var o=a.value;if(!(o instanceof Array)||2!==o.length)throw new Error("First parameter to MemoryMap constructor must be an iterable of [addr, bytes] or undefined");this.set(o[0],o[1])}}catch(e){s.e(e)}finally{s.f()}}else if("object"===n(t))for(var i,l=Object.keys(t),d=0,c=l;d<c.length;d++)i=c[d],this.set(parseInt(i),t[i]);else if(void 0!==t&&null!==t)throw new Error("First parameter to MemoryMap constructor must be an iterable of [addr, bytes] or undefined")}return s(e,[{key:"set",value:function(e,t){if(!Fe(e))throw new Error("Address passed to MemoryMap is not an integer");if(0>e)throw new Error("Address passed to MemoryMap is negative");if(!(t instanceof Uint8Array))throw new Error("Bytes passed to MemoryMap are not an Uint8Array");return this._blocks.set(e,t)}},{key:"get",value:function(e){return this._blocks.get(e)}},{key:"clear",value:function(){return this._blocks.clear()}},{key:"delete",value:function(e){return this._blocks.delete(e)}},{key:"entries",value:function(){return this._blocks.entries()}},{key:"forEach",value:function(e,t){return this._blocks.forEach(e,t)}},{key:"has",value:function(e){return this._blocks.has(e)}},{key:"keys",value:function(){return this._blocks.keys()}},{key:"values",value:function(){return this._blocks.values()}},{key:Symbol.iterator,value:function(){return this._blocks[Symbol.iterator]()}},{key:"join",value:function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1/0,n=Array.from(this.keys()).sort(function(e,t){return e-t}),r=new Map,a=-1,s=-1,o=0,d=n.length;o<d;o++){var l=n[o],c=this.get(n[o]).length;if(s===l&&s-a<t)r.set(a,r.get(a)+c),s+=c;else if(s<=l)r.set(l,c),a=l,s=l+c;else throw new Error("Overlapping data around address 0x"+l.toString(16))}for(var g,h,u=new e,p=-1,f=0,y=n.length;f<y;f++)h=n[f],r.has(h)&&(g=new Uint8Array(r.get(h)),u.set(h,g),p=h),g.set(this.get(h),h-p);return u}},{key:"paginate",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1024,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:255;if(0>=t)throw new Error("Page size must be greater than zero");for(var r,a=new e,s=Array.from(this.keys()).sort(function(e,t){return e-t}),o=0,d=s.length;o<d;o++)for(var l=s[o],c=this.get(l),g=c.length,h=l-l%t;h<l+g;h+=t){r=a.get(h),r||(r=new Uint8Array(t),r.fill(n),a.set(h,r));var u=h-l,p=void 0;0>=u?(p=c.subarray(0,De(t+u,g)),r.set(p,-u)):(p=c.subarray(u,u+De(t,g-u)),r.set(p,0))}return a}},{key:"getUint32",value:function(e,t){for(var n=Array.from(this.keys()),r=0,a=n.length;r<a;r++){var s=n[r],o=this.get(s),l=o.length;if(s<=e&&e+4<=s+l)return new DataView(o.buffer,e-s,4).getUint32(0,t)}}},{key:"asHexString",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:16,t=0,n=-65536,r=[];if(0>=e)throw new Error("Size of record must be greater than zero");else if(255<e)throw new Error("Size of record must be less than 256");for(var a=new Uint8Array(6),s=new Uint8Array(4),o=Array.from(this.keys()).sort(function(e,t){return e-t}),d=0,c=o.length;d<c;d++){var l=o[d],g=this.get(l);if(!(g instanceof Uint8Array))throw new Error("Block at offset "+l+" is not an Uint8Array");if(0>l)throw new Error("Block at offset "+l+" has a negative thus invalid address");var h=g.length;if(h){if(l>n+65535&&(n=l-l%65536,t=0,a[0]=2,a[1]=0,a[2]=0,a[3]=4,a[4]=n>>24,a[5]=n>>16,r.push(":"+Array.prototype.map.call(a,m).join("")+m(p(a)))),l<n+t)throw new Error("Block starting at 0x"+l.toString(16)+" overlaps with a previous block.");t=l%65536;var u=0,f=l+h;if(4294967295<f)throw new Error("Data cannot be over 0xFFFFFFFF");for(;n+t<f;){65535<t&&(n+=65536,t=0,a[0]=2,a[1]=0,a[2]=0,a[3]=4,a[4]=n>>24,a[5]=n>>16,r.push(":"+Array.prototype.map.call(a,m).join("")+m(p(a))));for(var E=-1;65536>t&&E;)if(E=De(e,f-n-t,65536-t),E){s[0]=E,s[1]=t>>8,s[2]=t,s[3]=0;var S=g.subarray(u,u+E);r.push(":"+Array.prototype.map.call(s,m).join("")+Array.prototype.map.call(S,m).join("")+m(y(s,S))),u+=E,t+=E}}}}return r.push(":00000001FF"),r.join("\n")}},{key:"clone",value:function(){var t,n=new e,r=u(this);try{for(r.s();!(t=r.n()).done;){var a=o(t.value,2),s=a[0],i=a[1];n.set(s,new Uint8Array(i))}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"slice",value:function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1/0;if(0>n)throw new Error("Length of the slice cannot be negative");var r,a=new e,s=u(this);try{for(s.s();!(r=s.n()).done;){var i=o(r.value,2),l=i[0],d=i[1],c=d.length;if(l+c>=t&&l<t+n){var g=Le(t,l),h=De(t+n,l+c),p=h-g,f=g-l;0<p&&a.set(g,d.subarray(f,f+p))}}}catch(e){s.e(e)}finally{s.f()}return a}},{key:"slicePad",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:255;if(0>t)throw new Error("Length of the slice cannot be negative");var r,a=new Uint8Array(t).fill(n),s=u(this);try{for(s.s();!(r=s.n()).done;){var i=o(r.value,2),l=i[0],d=i[1],c=d.length;if(l+c>=e&&l<e+t){var g=Le(e,l),h=De(e+t,l+c),p=h-g,f=g-l;0<p&&a.set(d.subarray(f,f+p),g-e)}}}catch(e){s.e(e)}finally{s.f()}return a}},{key:"contains",value:function(e){var t,n=u(e);try{for(n.s();!(t=n.n()).done;){var r=o(t.value,2),a=r[0],s=r[1],l=s.length,d=this.slice(a,l).join().get(a);if(!d||d.length!==l)return!1;for(var c in s)if(s[c]!==d[c])return!1}}catch(e){n.e(e)}finally{n.f()}return!0}},{key:"size",get:function(){return this._blocks.size}}],[{key:"fromHex",value:function(t){var n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1/0,a=new e,s=0,i=0,l=0;for(us.lastIndex=0;null!==(n=us.exec(t));){if(i++,s!==n.index)throw new Error("Malformed hex file: Could not parse between characters "+s+" and "+n.index+" (\""+t.substring(s,De(n.index,s+16)).trim()+"\")");s=us.lastIndex;var d=n,c=o(d,3),g=c[1],h=c[2],u=new Uint8Array(g.match(/[\da-f]{2}/gi).map(function(e){return parseInt(e,16)})),f=u[0];if(f+4!==u.length)throw new Error("Mismatched record length at record "+i+" ("+n[0].trim()+"), expected "+f+" data bytes but actual length is "+(u.length-4));var y=p(u);if(parseInt(h,16)!==y)throw new Error("Checksum failed at record "+i+" ("+n[0].trim()+"), should be "+y.toString(16));var E=(u[1]<<8)+u[2],S=u[3],x=u.subarray(4);if(0===S){if(a.has(l+E))throw new Error("Duplicated data at record "+i+" ("+n[0].trim()+")");if(65536<E+x.length)throw new Error("Data at record "+i+" ("+n[0].trim()+") wraps over 0xFFFF. This would trigger ambiguous behaviour. Please restructure your data so that for every record the data offset plus the data length do not exceed 0xFFFF.");a.set(l+E,x)}else{if(0!==E)throw new Error("Record "+i+" ("+n[0].trim()+") must have 0000 as data offset.");switch(S){case 1:if(s!==t.length)throw new Error("There is data after an EOF record at record "+i);return a.join(r);case 2:l=(x[0]<<8)+x[1]<<4;break;case 3:break;case 4:l=(x[0]<<8)+x[1]<<16;break;case 5:break;default:throw new Error("Invalid record type 0x"+m(S)+" at record "+i+" (should be between 0x00 and 0x05)");}}}if(i)throw new Error("No EOF record at end of file");else throw new Error("Malformed .hex file, could not parse any registers")}},{key:"overlapMemoryMaps",value:function(e){var t,n=new Set,r=u(e);try{for(r.s();!(t=r.n()).done;){var a,s=o(t.value,2),d=s[1],c=u(d);try{for(c.s();!(a=c.n()).done;){var g=o(a.value,2),h=g[0],p=g[1];n.add(h),n.add(h+p.length)}}catch(e){c.e(e)}finally{c.f()}}}catch(e){r.e(e)}finally{r.f()}for(var f=Array.from(n.values()).sort(function(e,t){return e-t}),y=new Map,m=function(t){var n,r=f[t],a=f[t+1],s=[],i=u(e);try{for(i.s();!(n=i.n()).done;){var l=o(n.value,2),d=l[0],c=l[1],g=Array.from(c.keys()).reduce(function(e,t){return t>r?e:Le(e,t)},-1);if(-1!==g){var h=c.get(g),p=r-g;p<h.length&&s.push([d,h.subarray(p,a-g)])}}}catch(e){i.e(e)}finally{i.f()}s.length&&y.set(r,s)},E=0,S=f.length-1;E<S;E++)m(E);return y}},{key:"flattenOverlaps",value:function(t){return new e(Array.from(t.entries()).map(function(e){var t=o(e,2),n=t[0],r=t[1];return[n,r[r.length-1][1]]}))}},{key:"fromPaddedUint8Array",value:function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:255,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:64;if(!(t instanceof Uint8Array))throw new Error("Bytes passed to fromPaddedUint8Array are not an Uint8Array");for(var a,s=new e,o=0,i=-1,d=0,c=!1,g=t.length,l=0;l<g;l++)a=t[l],a===n?(o++,o>=r&&(-1!==i&&s.set(d,t.subarray(d,i+1)),c=!0)):(c&&(c=!1,d=l),i=l,o=0);return c||-1===i||s.set(d,t.subarray(d,g)),s}}]),e}(),fs=t(function(e){function t(){}function n(){}(function(){var s=String.fromCharCode;function e(e,t){t=t||1/0;for(var n,r=e.length,a=null,s=[],o=0;o<r;o++){if(n=e.charCodeAt(o),!(55295<n&&57344>n))a&&(-1<(t-=3)&&s.push(239,191,189),a=null);else if(a){if(56320>n){-1<(t-=3)&&s.push(239,191,189),a=n;continue}else n=65536|(a-55296<<10|n-56320),a=null;}else if(56319<n){-1<(t-=3)&&s.push(239,191,189);continue}else if(o+1===r){-1<(t-=3)&&s.push(239,191,189);continue}else{a=n;continue}if(128>n){if(0>(t-=1))break;s.push(n)}else if(2048>n){if(0>(t-=2))break;s.push(192|n>>6,128|63&n)}else if(65536>n){if(0>(t-=3))break;s.push(224|n>>12,128|63&n>>6,128|63&n)}else if(2097152>n){if(0>(t-=4))break;s.push(240|n>>18,128|63&n>>12,128|63&n>>6,128|63&n)}else throw new Error("Invalid code point")}return s}function r(e,t,n){var r="",o="";n=De(e.length,n||1/0),t=t||0;for(var l=t;l<n;l++)127>=e[l]?(r+=a(o)+s(e[l]),o=""):o+="%"+e[l].toString(16);return r+a(o)}function a(e){try{return decodeURIComponent(e)}catch(e){return s(65533)}}t.prototype.encode=function(t){var n;return n="undefined"==typeof Uint8Array?e(t):new Uint8Array(e(t)),n},n.prototype.decode=function(e){return r(e,0,e.length)}})(),e&&(e.exports.TextDecoderLite=n,e.exports.TextEncoderLite=t)}),ys=fs.TextDecoderLite,ms=fs.TextEncoderLite,Es=function(e,t){var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n},Ss=function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0};(function(e){e[e.StartAdd=253952]="StartAdd",e[e.Length=8192]="Length",e[e.EndAdd=262144]="EndAdd"})(e.AppendedBlock||(e.AppendedBlock={}));var xs=Vn.f,Ps=function(e){return function(t){for(var n,r=kt(t),a=nn(r),s=a.length,o=0,l=[];s>o;)n=a[o++],(!Ce||xs.call(r,n))&&l.push(e?[n,r[n]]:r[n]);return l}},bs=Ps(!0);ht(ht.S,"Object",{entries:function(e){return bs(e)}});var _s=Ps(!1);ht(ht.S,"Object",{values:function(e){return _s(e)}});var As=wt("match"),Is=function(e){var t;return Ye(e)&&((t=e[As])===void 0?"RegExp"==Tt(e):!!t)},Ts=function(e,t,n){if(Is(t))throw TypeError("String#"+n+" doesn't accept regex!");return Ft(e)+""},vs=wt("match"),Fs=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[vs]=!1,!"/./"[e](t)}catch(e){}}return!0},ks="includes";ht(ht.P+ht.F*Fs(ks),"String",{includes:function(e){return!!~Ts(this,e,ks).indexOf(e,1<arguments.length?arguments[1]:void 0)}});var Os="".endsWith;ht(ht.P+ht.F*Fs("endsWith"),"String",{endsWith:function(e){var t=Ts(this,e,"endsWith"),n=1<arguments.length?arguments[1]:void 0,r=_t(t.length),a=n===void 0?r:De(_t(n),r),s=e+"";return Os.call(t,s,a)}});var Bs=Bt(!0);ht(ht.P,"Array",{includes:function(e){return Bs(this,e,1<arguments.length?arguments[1]:void 0)}}),Tn("includes");var Ls=[].push,Rs="split",Ds="length",Ms="lastIndex",Cs=4294967295,Ns=!Me(function(){RegExp(Cs,"y")});gr("split",2,function(e,t,n,r){var a;return a="c"=="abbc"[Rs](/(b)*/)[1]||4!="test"[Rs](/(?:)/,-1)[Ds]||2!="ab"[Rs](/(?:ab)*/)[Ds]||4!="."[Rs](/(.?)(.?)/)[Ds]||1<"."[Rs](/()()/)[Ds]||""[Rs](/.?/)[Ds]?function(e,t){var r=this+"";if(void 0===e&&0===t)return[];if(!Is(e))return n.call(r,e,t);for(var a,s,o,i=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,c=void 0===t?Cs:t>>>0,g=new RegExp(e.source,l+"g");(a=ir.call(g,r))&&(s=g[Ms],!(s>d&&(i.push(r.slice(d,a.index)),1<a[Ds]&&a.index<r[Ds]&&Ls.apply(i,a.slice(1)),o=a[0][Ds],d=s,i[Ds]>=c)));)g[Ms]===a.index&&g[Ms]++;return d===r[Ds]?(o||!g.test(""))&&i.push(""):i.push(r.slice(d)),i[Ds]>c?i.slice(0,c):i}:"0"[Rs](void 0,0)[Ds]?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var s=e(this),o=null==n?void 0:n[t];return void 0===o?a.call(s+"",n,r):o.call(n,s,r)},function(t,s){var o=r(a,t,this,s,a!==n);if(o.done)return o.value;var l=$e(t),d=this+"",c=_n(l,RegExp),g=l.unicode,h=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(Ns?"y":"g"),u=new c(Ns?l:"^(?:"+l.source+")",h),f=void 0===s?Cs:s>>>0;if(0===f)return[];if(0===d.length)return null===Qn(u,d)?[d]:[];for(var y=0,m=0,E=[];m<d.length;){u.lastIndex=Ns?m:0;var S,x=Qn(u,Ns?d:d.slice(m));if(null===x||(S=De(_t(u.lastIndex+(Ns?0:m)),d.length))===y)m=at(d,m,g);else{if(E.push(d.slice(y,m)),E.length===f)return E;for(var P=1;P<=x.length-1;P++)if(E.push(x[P]),E.length===f)return E;m=y=S}}return E.push(d.slice(y)),E}]}),ht(ht.S,"Number",{isNaN:function(e){return e!=e}});var Hs;(function(e){e[e.Data=0]="Data",e[e.EndOfFile=1]="EndOfFile",e[e.ExtendedSegmentAddress=2]="ExtendedSegmentAddress",e[e.StartSegmentAddress=3]="StartSegmentAddress",e[e.ExtendedLinearAddress=4]="ExtendedLinearAddress",e[e.StartLinearAddress=5]="StartLinearAddress",e[e.BlockStart=10]="BlockStart",e[e.BlockEnd=11]="BlockEnd",e[e.PaddedData=12]="PaddedData",e[e.CustomData=13]="CustomData",e[e.OtherData=14]="OtherData"})(Hs||(Hs={}));var Us=":".length,zs=2,Ys=4,$s=2,ws=0+Us+zs+Ys+$s,js=0,Vs=Us+zs+Ys+$s+js+2,Gs=Vs-js+64,Ws=[39168,39169];Xn("Uint32",4,function(e){return function(t,n,r){return e(this,t,n,r)}});var Ks;(function(e){e[e.softDevice=1]="softDevice",e[e.microPython=2]="microPython",e[e.fs=3]="fs"})(Ks||(Ks={}));var Xs;(function(e){e[e.empty=0]="empty",e[e.data=1]="data",e[e.pointer=2]="pointer"})(Xs||(Xs={}));var Zs;(function(e){e[e.magic2=4]="magic2",e[e.pageSizeLog2=e.magic2+2]="pageSizeLog2",e[e.regionCount=e.pageSizeLog2+2]="regionCount",e[e.tableLength=e.regionCount+2]="tableLength",e[e.version=e.tableLength+2]="version",e[e.magic1=e.version+4]="magic1"})(Zs||(Zs={}));var qs;(function(e){e[e.hashData=8]="hashData",e[e.lengthBytes=e.hashData+4]="lengthBytes",e[e.startPage=e.lengthBytes+2]="startPage",e[e.hashType=e.startPage+1]="hashType",e[e.id=e.hashType+1]="id"})(qs||(qs={}));var Js,Qs=qs.id,eo=[{deviceVersion:1,magicHeader:401518716,flashSize:262144,fsEnd:262144},{deviceVersion:2,magicHeader:1206825084,flashSize:524288,fsEnd:471040}];(function(e){e[e.MagicValue=268439552+128+64]="MagicValue",e[e.EndMarker=e.MagicValue+4]="EndMarker",e[e.PageSize=e.EndMarker+4]="PageSize",e[e.StartPage=e.PageSize+4]="StartPage",e[e.PagesUsed=e.StartPage+2]="PagesUsed",e[e.Delimiter=e.PagesUsed+2]="Delimiter",e[e.VersionLocation=e.Delimiter+4]="VersionLocation",e[e.RegionsTerminator=e.VersionLocation+4]="RegionsTerminator",e[e.End=e.RegionsTerminator+4]="End"})(Js||(Js={}));var to=1,no=128-to-1,ro=120,ao=function(){function e(e,t){if(this._filename=e,this._filenameBytes=E(e),this._filenameBytes.length>ro)throw new Error("File name \""+e+"\" is too long "+("(max "+ro+" characters)."));this._dataBytes=t;var n=this._generateFileHeaderBytes();this._fsDataBytes=new Uint8Array(n.length+this._dataBytes.length+1),this._fsDataBytes.set(n,0),this._fsDataBytes.set(this._dataBytes,n.length),this._fsDataBytes[this._fsDataBytes.length-1]=255}return e.prototype.getFsChunks=function(e){var t=[],n=0,r=0,a=new Uint8Array(128).fill(255);a[0]=254;for(var s=De(this._fsDataBytes.length,no),o=0;o<s;o++,r++)a[to+o]=this._fsDataBytes[r];for(t.push(a);r<this._fsDataBytes.length;){if(n++,n>=e.length)throw new Error("Not enough space for the "+this._filename+" file.");var l=t[t.length-1];l[127]=e[n],a=new Uint8Array(128).fill(255),a[0]=e[n-1],s=De(this._fsDataBytes.length-r,no);for(var o=0;o<s;o++,r++)a[to+o]=this._fsDataBytes[r];t.push(a)}return t},e.prototype.getFsBytes=function(e){for(var t=this.getFsChunks(e),n=128*t.length,r=new Uint8Array(n),a=0;a<t.length;a++)r.set(t[a],128*a);return r},e.prototype.getFsFileSize=function(){var e=Be(this._fsDataBytes.length/no);return 128*e},e.prototype._generateFileHeaderBytes=function(){var e=1+1+this._filenameBytes.length,t=(e+this._dataBytes.length)%no,n=e-this._filenameBytes.length,r=new Uint8Array(e);r[0]=t,r[1]=this._filenameBytes.length;for(var a=n;a<e;++a)r[a]=this._filenameBytes[a-n];return r},e}(),so=function(){function e(e,t){if(!e)throw new Error("File was not provided a valid filename.");if(!t)throw new Error("File "+e+" does not have valid content.");if(this.filename=e,"string"==typeof t)this._dataBytes=E(t);else if(t instanceof Uint8Array)this._dataBytes=t;else throw new Error("File data type must be a string or Uint8Array.")}return e.prototype.getText=function(){return S(this._dataBytes)},e.prototype.getBytes=function(){return this._dataBytes},e}(),oo=function(){function e(e,t){var n=this,r=(void 0===t?{}:t).maxFsSize,a=void 0===r?0:r;this._uPyFsBuilderCache=[],this._files={},this._storageSize=0;var s=Array.isArray(e)?e:[{hex:e,boardId:0}],o=1/0;s.forEach(function(e){if(!e.hex)throw new Error("Invalid MicroPython hex.");var t=fe(e.hex),r={originalIntelHex:t.originalIntelHex,originalMemMap:t.originalMemMap,uPyEndAddress:t.uPyEndAddress,uPyIntelHex:t.uPyIntelHex,fsSize:t.fsSize,boardId:e.boardId};n._uPyFsBuilderCache.push(r),o=De(o,r.fsSize)}),this.setStorageSize(a||o),this._uPyFsBuilderCache.forEach(function(e){var t=Te(e.originalMemMap);if(Object.keys(t).length)throw new Error("There are files in the MicropythonFsHex constructor hex file input.")})}return e.prototype.create=function(e,t){if(this.exists(e))throw new Error("File already exists.");this.write(e,t)},e.prototype.write=function(e,t){this._files[e]=new so(e,t)},e.prototype.append=function(e){if(!e)throw new Error("Invalid filename.");if(!this.exists(e))throw new Error("File \""+e+"\" does not exist.");throw new Error("Append operation not yet implemented.")},e.prototype.read=function(e){if(!e)throw new Error("Invalid filename.");if(!this.exists(e))throw new Error("File \""+e+"\" does not exist.");return this._files[e].getText()},e.prototype.readBytes=function(e){if(!e)throw new Error("Invalid filename.");if(!this.exists(e))throw new Error("File \""+e+"\" does not exist.");return this._files[e].getBytes()},e.prototype.remove=function(e){if(!e)throw new Error("Invalid filename.");if(!this.exists(e))throw new Error("File \""+e+"\" does not exist.");delete this._files[e]},e.prototype.exists=function(e){return this._files.hasOwnProperty(e)},e.prototype.size=function(e){if(!e)throw new Error("Invalid filename: "+e);if(!this.exists(e))throw new Error("File \""+e+"\" does not exist.");return be(this._files[e].filename,this._files[e].getBytes())},e.prototype.ls=function(){var e=[];return Object.values(this._files).forEach(function(t){return e.push(t.filename)}),e},e.prototype.setStorageSize=function(e){var t=1/0;if(this._uPyFsBuilderCache.forEach(function(e){t=De(t,e.fsSize)}),e>t)throw new Error("Storage size limit provided is larger than size available in the MicroPython hex.");this._storageSize=e},e.prototype.getStorageSize=function(){return this._storageSize},e.prototype.getStorageUsed=function(){var e=this;return Object.values(this._files).reduce(function(t,n){return t+e.size(n.filename)},0)},e.prototype.getStorageRemaining=function(){return this.getStorageSize()-this.getStorageUsed()},e.prototype.importFilesFromIntelHex=function(e,t){var n=this,r=void 0===t?{}:t,a=r.overwrite,s=r.formatFirst,o=Te(e);if(!Object.keys(o).length)throw new Error("Intel Hex does not have any files to import");void 0!==s&&s&&(this._files={});var i=[];if(Object.keys(o).forEach(function(e){!(void 0!==a&&a)&&n.exists(e)?i.push(e):n.write(e,o[e])}),i.length)throw new Error("Files \"\" from hex already exists.");return Object.keys(o)},e.prototype.importFilesFromUniversalHex=function(e,t){var n=this,r=void 0===t?{}:t,a=r.overwrite,s=r.formatFirst;if(!K(e))throw new Error("Universal Hex provided is invalid.");var o=X(e),i=[];o.forEach(function(e){var t=Te(e.hex);if(!Object.keys(t).length)throw new Error("Hex with ID "+e.boardId+" from Universal Hex does not have any files to import");i.push(t)}),i.forEach(function(e){for(var t=i.filter(function(t){return t!==e}),n=function(e,n){t.forEach(function(t){if(!t.hasOwnProperty(e)||!Ss(t[e],n))throw new Error("Mismatch in the different Hexes inside the Universal Hex")})},r=0,a=Object.entries(e);r<a.length;r++){var s=a[r],o=s[0],l=s[1];n(o,l)}});var l=i[0];void 0!==s&&s&&(this._files={});var d=[];if(Object.keys(l).forEach(function(e){!(void 0!==a&&a)&&n.exists(e)?d.push(e):n.write(e,l[e])}),d.length)throw new Error("Files \"\" from hex already exists.");return Object.keys(l)},e.prototype.importFilesFromHex=function(e,t){return void 0===t&&(t={}),K(e)?this.importFilesFromUniversalHex(e,t):this.importFilesFromIntelHex(e,t)},e.prototype.getIntelHex=function(e){if(0>this.getStorageRemaining())throw new Error("There is no storage space left.");var t={};if(Object.values(this._files).forEach(function(e){t[e.filename]=e.getBytes()}),void 0===e){if(1===this._uPyFsBuilderCache.length)return Ie(this._uPyFsBuilderCache[0],t);throw new Error("The Board ID must be specified if there are multiple MicroPythons.")}for(var n,r=0,a=this._uPyFsBuilderCache;r<a.length;r++)if(n=a[r],n.boardId===e)return Ie(n,t);throw new Error("Board ID requested not found.")},e.prototype.getIntelHexBytes=function(e){if(0>this.getStorageRemaining())throw new Error("There is no storage space left.");var t={};if(Object.values(this._files).forEach(function(e){t[e.filename]=e.getBytes()}),void 0===e){if(1===this._uPyFsBuilderCache.length)return Ae(this._uPyFsBuilderCache[0].originalMemMap,t,!0);throw new Error("The Board ID must be specified if there are multiple MicroPythons.")}for(var n,r=0,a=this._uPyFsBuilderCache;r<a.length;r++)if(n=a[r],n.boardId===e)return Ae(n.originalMemMap,t,!0);throw new Error("Board ID requested not found.")},e.prototype.getUniversalHex=function(){var e=this;if(1===this._uPyFsBuilderCache.length)throw new Error("MicropythonFsHex constructor must have more than one MicroPython Intel Hex to generate a Universal Hex.");var t=[];return this._uPyFsBuilderCache.forEach(function(n){t.push({hex:e.getIntelHex(n.boardId),boardId:n.boardId})}),W(t)},e}();e.MicropythonFsHex=oo,e.addIntelHexAppendedScript=function(t,n){var r=E(n),a=P(r);if(a.length>e.AppendedBlock.Length)throw new RangeError("Too long");var s=x(t),o=ps.fromHex(s);return o.set(e.AppendedBlock.StartAdd,a),o.asHexString()+"\n"},e.cleanseOldHexFormat=x,e.getHexMapDeviceMemInfo=pe,e.getIntelHexAppendedScript=function(t){var n="",r=ps.fromHex(t);if(r.has(e.AppendedBlock.StartAdd)){var a=r.slice(e.AppendedBlock.StartAdd,e.AppendedBlock.Length),s=a.get(e.AppendedBlock.StartAdd);s[0]===77&&s[1]===80&&(n=S(s.slice(4)),n=n.replace(/\0/g,""))}return n},e.getIntelHexDeviceMemInfo=function(e){return pe(ps.fromHex(e))},e.isAppendedScriptPresent=b,Object.defineProperty(e,"__esModule",{value:!0})});