easyproctor 2.5.4 → 2.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  "use strict";(()=>{var wy=Object.create;var hl=Object.defineProperty;var Sy=Object.getOwnPropertyDescriptor;var ky=Object.getOwnPropertyNames;var Ey=Object.getPrototypeOf,Cy=Object.prototype.hasOwnProperty;var dr=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var _e=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xy=(e,t)=>{for(var r in t)hl(e,r,{get:t[r],enumerable:!0})},Ay=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ky(t))!Cy.call(e,i)&&i!==r&&hl(e,i,{get:()=>t[i],enumerable:!(n=Sy(t,i))||n.enumerable});return e};var dl=(e,t,r)=>(r=e!=null?wy(Ey(e)):{},Ay(t||!e||!e.__esModule?hl(r,"default",{value:e,enumerable:!0}):r,e));var n0=_e((r0,wd)=>{(function(e){typeof r0=="object"&&typeof wd<"u"?wd.exports=e():typeof define=="function"&&define.amd?define([],e):(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).JSZip=e()})(function(){return(function e(t,r,n){function i(a,c){if(!r[a]){if(!t[a]){var l=typeof dr=="function"&&dr;if(!c&&l)return l(a,!0);if(o)return o(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var d=r[a]={exports:{}};t[a][0].call(d.exports,function(m){var p=t[a][1][m];return i(p||m)},d,d.exports,e,t,r,n)}return r[a].exports}for(var o=typeof dr=="function"&&dr,s=0;s<n.length;s++)i(n[s]);return i})({1:[function(e,t,r){"use strict";var n=e("./utils"),i=e("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(s){for(var a,c,l,h,d,m,p,g=[],f=0,b=s.length,v=b,k=n.getTypeOf(s)!=="string";f<s.length;)v=b-f,l=k?(a=s[f++],c=f<b?s[f++]:0,f<b?s[f++]:0):(a=s.charCodeAt(f++),c=f<b?s.charCodeAt(f++):0,f<b?s.charCodeAt(f++):0),h=a>>2,d=(3&a)<<4|c>>4,m=1<v?(15&c)<<2|l>>6:64,p=2<v?63&l:64,g.push(o.charAt(h)+o.charAt(d)+o.charAt(m)+o.charAt(p));return g.join("")},r.decode=function(s){var a,c,l,h,d,m,p=0,g=0,f="data:";if(s.substr(0,f.length)===f)throw new Error("Invalid base64 input, it looks like a data url.");var b,v=3*(s=s.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(s.charAt(s.length-1)===o.charAt(64)&&v--,s.charAt(s.length-2)===o.charAt(64)&&v--,v%1!=0)throw new Error("Invalid base64 input, bad content length.");for(b=i.uint8array?new Uint8Array(0|v):new Array(0|v);p<s.length;)a=o.indexOf(s.charAt(p++))<<2|(h=o.indexOf(s.charAt(p++)))>>4,c=(15&h)<<4|(d=o.indexOf(s.charAt(p++)))>>2,l=(3&d)<<6|(m=o.indexOf(s.charAt(p++))),b[g++]=a,d!==64&&(b[g++]=c),m!==64&&(b[g++]=l);return b}},{"./support":30,"./utils":32}],2:[function(e,t,r){"use strict";var n=e("./external"),i=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),s=e("./stream/DataLengthProbe");function a(c,l,h,d,m){this.compressedSize=c,this.uncompressedSize=l,this.crc32=h,this.compression=d,this.compressedContent=m}a.prototype={getContentWorker:function(){var c=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),l=this;return c.on("end",function(){if(this.streamInfo.data_length!==l.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),c},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(c,l,h){return c.pipe(new o).pipe(new s("uncompressedSize")).pipe(l.compressWorker(h)).pipe(new s("compressedSize")).withStreamInfo("compression",l)},t.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){"use strict";var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){"use strict";var n=e("./utils"),i=(function(){for(var o,s=[],a=0;a<256;a++){o=a;for(var c=0;c<8;c++)o=1&o?3988292384^o>>>1:o>>>1;s[a]=o}return s})();t.exports=function(o,s){return o!==void 0&&o.length?n.getTypeOf(o)!=="string"?(function(a,c,l,h){var d=i,m=h+l;a^=-1;for(var p=h;p<m;p++)a=a>>>8^d[255&(a^c[p])];return-1^a})(0|s,o,o.length,0):(function(a,c,l,h){var d=i,m=h+l;a^=-1;for(var p=h;p<m;p++)a=a>>>8^d[255&(a^c.charCodeAt(p))];return-1^a})(0|s,o,o.length,0):0}},{"./utils":32}],5:[function(e,t,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){"use strict";var n=null;n=typeof Promise<"u"?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){"use strict";var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=e("pako"),o=e("./utils"),s=e("./stream/GenericWorker"),a=n?"uint8array":"array";function c(l,h){s.call(this,"FlateWorker/"+l),this._pako=null,this._pakoAction=l,this._pakoOptions=h,this.meta={}}r.magic="\b\0",o.inherits(c,s),c.prototype.processChunk=function(l){this.meta=l.meta,this._pako===null&&this._createPako(),this._pako.push(o.transformTo(a,l.data),!1)},c.prototype.flush=function(){s.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var l=this;this._pako.onData=function(h){l.push({data:h,meta:l.meta})}},r.compressWorker=function(l){return new c("Deflate",l)},r.uncompressWorker=function(){return new c("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){"use strict";function n(d,m){var p,g="";for(p=0;p<m;p++)g+=String.fromCharCode(255&d),d>>>=8;return g}function i(d,m,p,g,f,b){var v,k,S=d.file,I=d.compression,x=b!==a.utf8encode,O=o.transformTo("string",b(S.name)),P=o.transformTo("string",a.utf8encode(S.name)),z=S.comment,Z=o.transformTo("string",b(z)),E=o.transformTo("string",a.utf8encode(z)),F=P.length!==S.name.length,y=E.length!==z.length,U="",ae="",V="",le=S.dir,H=S.date,oe={crc32:0,compressedSize:0,uncompressedSize:0};m&&!p||(oe.crc32=d.crc32,oe.compressedSize=d.compressedSize,oe.uncompressedSize=d.uncompressedSize);var D=0;m&&(D|=8),x||!F&&!y||(D|=2048);var R=0,te=0;le&&(R|=16),f==="UNIX"?(te=798,R|=(function(G,Ce){var Ke=G;return G||(Ke=Ce?16893:33204),(65535&Ke)<<16})(S.unixPermissions,le)):(te=20,R|=(function(G){return 63&(G||0)})(S.dosPermissions)),v=H.getUTCHours(),v<<=6,v|=H.getUTCMinutes(),v<<=5,v|=H.getUTCSeconds()/2,k=H.getUTCFullYear()-1980,k<<=4,k|=H.getUTCMonth()+1,k<<=5,k|=H.getUTCDate(),F&&(ae=n(1,1)+n(c(O),4)+P,U+="up"+n(ae.length,2)+ae),y&&(V=n(1,1)+n(c(Z),4)+E,U+="uc"+n(V.length,2)+V);var q="";return q+=`
2
- \0`,q+=n(D,2),q+=I.magic,q+=n(v,2),q+=n(k,2),q+=n(oe.crc32,4),q+=n(oe.compressedSize,4),q+=n(oe.uncompressedSize,4),q+=n(O.length,2),q+=n(U.length,2),{fileRecord:l.LOCAL_FILE_HEADER+q+O+U,dirRecord:l.CENTRAL_FILE_HEADER+n(te,2)+q+n(Z.length,2)+"\0\0\0\0"+n(R,4)+n(g,4)+O+U+Z}}var o=e("../utils"),s=e("../stream/GenericWorker"),a=e("../utf8"),c=e("../crc32"),l=e("../signature");function h(d,m,p,g){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=m,this.zipPlatform=p,this.encodeFileName=g,this.streamFiles=d,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(h,s),h.prototype.push=function(d){var m=d.meta.percent||0,p=this.entriesCount,g=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,s.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:p?(m+100*(p-g-1))/p:100}}))},h.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var m=this.streamFiles&&!d.file.dir;if(m){var p=i(d,m,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:p.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(d){this.accumulate=!1;var m=this.streamFiles&&!d.file.dir,p=i(d,m,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(p.dirRecord),m)this.push({data:(function(g){return l.DATA_DESCRIPTOR+n(g.crc32,4)+n(g.compressedSize,4)+n(g.uncompressedSize,4)})(d),meta:{percent:100}});else for(this.push({data:p.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var d=this.bytesWritten,m=0;m<this.dirRecords.length;m++)this.push({data:this.dirRecords[m],meta:{percent:100}});var p=this.bytesWritten-d,g=(function(f,b,v,k,S){var I=o.transformTo("string",S(k));return l.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(f,2)+n(f,2)+n(b,4)+n(v,4)+n(I.length,2)+I})(this.dirRecords.length,p,d,this.zipComment,this.encodeFileName);this.push({data:g,meta:{percent:100}})},h.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},h.prototype.registerPrevious=function(d){this._sources.push(d);var m=this;return d.on("data",function(p){m.processChunk(p)}),d.on("end",function(){m.closedSource(m.previous.streamInfo),m._sources.length?m.prepareNextSource():m.end()}),d.on("error",function(p){m.error(p)}),this},h.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},h.prototype.error=function(d){var m=this._sources;if(!s.prototype.error.call(this,d))return!1;for(var p=0;p<m.length;p++)try{m[p].error(d)}catch{}return!0},h.prototype.lock=function(){s.prototype.lock.call(this);for(var d=this._sources,m=0;m<d.length;m++)d[m].lock()},t.exports=h},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,r){"use strict";var n=e("../compressions"),i=e("./ZipFileWorker");r.generateWorker=function(o,s,a){var c=new i(s.streamFiles,a,s.platform,s.encodeFileName),l=0;try{o.forEach(function(h,d){l++;var m=(function(b,v){var k=b||v,S=n[k];if(!S)throw new Error(k+" is not a valid compression method !");return S})(d.options.compression,s.compression),p=d.options.compressionOptions||s.compressionOptions||{},g=d.dir,f=d.date;d._compressWorker(m,p).withStreamInfo("file",{name:h,dir:g,date:f,comment:d.comment||"",unixPermissions:d.unixPermissions,dosPermissions:d.dosPermissions}).pipe(c)}),c.entriesCount=l}catch(h){c.error(h)}return c}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var i=new n;for(var o in this)typeof this[o]!="function"&&(i[o]=this[o]);return i}}(n.prototype=e("./object")).loadAsync=e("./load"),n.support=e("./support"),n.defaults=e("./defaults"),n.version="3.10.1",n.loadAsync=function(i,o){return new n().loadAsync(i,o)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,r){"use strict";var n=e("./utils"),i=e("./external"),o=e("./utf8"),s=e("./zipEntries"),a=e("./stream/Crc32Probe"),c=e("./nodejsUtils");function l(h){return new i.Promise(function(d,m){var p=h.decompressed.getContentWorker().pipe(new a);p.on("error",function(g){m(g)}).on("end",function(){p.streamInfo.crc32!==h.decompressed.crc32?m(new Error("Corrupted zip : CRC32 mismatch")):d()}).resume()})}t.exports=function(h,d){var m=this;return d=n.extend(d||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),c.isNode&&c.isStream(h)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",h,!0,d.optimizedBinaryString,d.base64).then(function(p){var g=new s(d);return g.load(p),g}).then(function(p){var g=[i.Promise.resolve(p)],f=p.files;if(d.checkCRC32)for(var b=0;b<f.length;b++)g.push(l(f[b]));return i.Promise.all(g)}).then(function(p){for(var g=p.shift(),f=g.files,b=0;b<f.length;b++){var v=f[b],k=v.fileNameStr,S=n.resolve(v.fileNameStr);m.file(S,v.decompressed,{binary:!0,optimizedBinaryString:!0,date:v.date,dir:v.dir,comment:v.fileCommentStr.length?v.fileCommentStr:null,unixPermissions:v.unixPermissions,dosPermissions:v.dosPermissions,createFolders:d.createFolders}),v.dir||(m.file(S).unsafeOriginalName=k)}return g.zipComment.length&&(m.comment=g.zipComment),m})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../stream/GenericWorker");function o(s,a){i.call(this,"Nodejs stream input adapter for "+s),this._upstreamEnded=!1,this._bindStream(a)}n.inherits(o,i),o.prototype._bindStream=function(s){var a=this;(this._stream=s).pause(),s.on("data",function(c){a.push({data:c,meta:{percent:0}})}).on("error",function(c){a.isPaused?this.generatedError=c:a.error(c)}).on("end",function(){a.isPaused?a._upstreamEnded=!0:a.end()})},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,r){"use strict";var n=e("readable-stream").Readable;function i(o,s,a){n.call(this,s),this._helper=o;var c=this;o.on("data",function(l,h){c.push(l)||c._helper.pause(),a&&a(h)}).on("error",function(l){c.emit("error",l)}).on("end",function(){c.push(null)})}e("../utils").inherits(i,n),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,t,r){"use strict";t.exports={isNode:typeof Buffer<"u",newBufferFrom:function(n,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(n,i);if(typeof n=="number")throw new Error('The "data" argument must not be a number');return new Buffer(n,i)},allocBuffer:function(n){if(Buffer.alloc)return Buffer.alloc(n);var i=new Buffer(n);return i.fill(0),i},isBuffer:function(n){return Buffer.isBuffer(n)},isStream:function(n){return n&&typeof n.on=="function"&&typeof n.pause=="function"&&typeof n.resume=="function"}}},{}],15:[function(e,t,r){"use strict";function n(S,I,x){var O,P=o.getTypeOf(I),z=o.extend(x||{},c);z.date=z.date||new Date,z.compression!==null&&(z.compression=z.compression.toUpperCase()),typeof z.unixPermissions=="string"&&(z.unixPermissions=parseInt(z.unixPermissions,8)),z.unixPermissions&&16384&z.unixPermissions&&(z.dir=!0),z.dosPermissions&&16&z.dosPermissions&&(z.dir=!0),z.dir&&(S=f(S)),z.createFolders&&(O=g(S))&&b.call(this,O,!0);var Z=P==="string"&&z.binary===!1&&z.base64===!1;x&&x.binary!==void 0||(z.binary=!Z),(I instanceof l&&I.uncompressedSize===0||z.dir||!I||I.length===0)&&(z.base64=!1,z.binary=!0,I="",z.compression="STORE",P="string");var E=null;E=I instanceof l||I instanceof s?I:m.isNode&&m.isStream(I)?new p(S,I):o.prepareContent(S,I,z.binary,z.optimizedBinaryString,z.base64);var F=new h(S,E,z);this.files[S]=F}var i=e("./utf8"),o=e("./utils"),s=e("./stream/GenericWorker"),a=e("./stream/StreamHelper"),c=e("./defaults"),l=e("./compressedObject"),h=e("./zipObject"),d=e("./generate"),m=e("./nodejsUtils"),p=e("./nodejs/NodejsStreamInputAdapter"),g=function(S){S.slice(-1)==="/"&&(S=S.substring(0,S.length-1));var I=S.lastIndexOf("/");return 0<I?S.substring(0,I):""},f=function(S){return S.slice(-1)!=="/"&&(S+="/"),S},b=function(S,I){return I=I!==void 0?I:c.createFolders,S=f(S),this.files[S]||n.call(this,S,null,{dir:!0,createFolders:I}),this.files[S]};function v(S){return Object.prototype.toString.call(S)==="[object RegExp]"}var k={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(S){var I,x,O;for(I in this.files)O=this.files[I],(x=I.slice(this.root.length,I.length))&&I.slice(0,this.root.length)===this.root&&S(x,O)},filter:function(S){var I=[];return this.forEach(function(x,O){S(x,O)&&I.push(O)}),I},file:function(S,I,x){if(arguments.length!==1)return S=this.root+S,n.call(this,S,I,x),this;if(v(S)){var O=S;return this.filter(function(z,Z){return!Z.dir&&O.test(z)})}var P=this.files[this.root+S];return P&&!P.dir?P:null},folder:function(S){if(!S)return this;if(v(S))return this.filter(function(P,z){return z.dir&&S.test(P)});var I=this.root+S,x=b.call(this,I),O=this.clone();return O.root=x.name,O},remove:function(S){S=this.root+S;var I=this.files[S];if(I||(S.slice(-1)!=="/"&&(S+="/"),I=this.files[S]),I&&!I.dir)delete this.files[S];else for(var x=this.filter(function(P,z){return z.name.slice(0,S.length)===S}),O=0;O<x.length;O++)delete this.files[x[O].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(S){var I,x={};try{if((x=o.extend(S||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=x.type.toLowerCase(),x.compression=x.compression.toUpperCase(),x.type==="binarystring"&&(x.type="string"),!x.type)throw new Error("No output type specified.");o.checkSupport(x.type),x.platform!=="darwin"&&x.platform!=="freebsd"&&x.platform!=="linux"&&x.platform!=="sunos"||(x.platform="UNIX"),x.platform==="win32"&&(x.platform="DOS");var O=x.comment||this.comment||"";I=d.generateWorker(this,x,O)}catch(P){(I=new s("error")).error(P)}return new a(I,x.type||"string",x.mimeType)},generateAsync:function(S,I){return this.generateInternalStream(S).accumulate(I)},generateNodeStream:function(S,I){return(S=S||{}).type||(S.type="nodebuffer"),this.generateInternalStream(S).toNodejsStream(I)}};t.exports=k},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,r){"use strict";t.exports=e("stream")},{stream:void 0}],17:[function(e,t,r){"use strict";var n=e("./DataReader");function i(o){n.call(this,o);for(var s=0;s<this.data.length;s++)o[s]=255&o[s]}e("../utils").inherits(i,n),i.prototype.byteAt=function(o){return this.data[this.zero+o]},i.prototype.lastIndexOfSignature=function(o){for(var s=o.charCodeAt(0),a=o.charCodeAt(1),c=o.charCodeAt(2),l=o.charCodeAt(3),h=this.length-4;0<=h;--h)if(this.data[h]===s&&this.data[h+1]===a&&this.data[h+2]===c&&this.data[h+3]===l)return h-this.zero;return-1},i.prototype.readAndCheckSignature=function(o){var s=o.charCodeAt(0),a=o.charCodeAt(1),c=o.charCodeAt(2),l=o.charCodeAt(3),h=this.readData(4);return s===h[0]&&a===h[1]&&c===h[2]&&l===h[3]},i.prototype.readData=function(o){if(this.checkOffset(o),o===0)return[];var s=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,s},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,r){"use strict";var n=e("../utils");function i(o){this.data=o,this.length=o.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(o){this.checkIndex(this.index+o)},checkIndex:function(o){if(this.length<this.zero+o||o<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+o+"). Corrupted zip ?")},setIndex:function(o){this.checkIndex(o),this.index=o},skip:function(o){this.setIndex(this.index+o)},byteAt:function(){},readInt:function(o){var s,a=0;for(this.checkOffset(o),s=this.index+o-1;s>=this.index;s--)a=(a<<8)+this.byteAt(s);return this.index+=o,a},readString:function(o){return n.transformTo("string",this.readData(o))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var o=this.readInt(4);return new Date(Date.UTC(1980+(o>>25&127),(o>>21&15)-1,o>>16&31,o>>11&31,o>>5&63,(31&o)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,r){"use strict";var n=e("./Uint8ArrayReader");function i(o){n.call(this,o)}e("../utils").inherits(i,n),i.prototype.readData=function(o){this.checkOffset(o);var s=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,s},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){"use strict";var n=e("./DataReader");function i(o){n.call(this,o)}e("../utils").inherits(i,n),i.prototype.byteAt=function(o){return this.data.charCodeAt(this.zero+o)},i.prototype.lastIndexOfSignature=function(o){return this.data.lastIndexOf(o)-this.zero},i.prototype.readAndCheckSignature=function(o){return o===this.readData(4)},i.prototype.readData=function(o){this.checkOffset(o);var s=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,s},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){"use strict";var n=e("./ArrayReader");function i(o){n.call(this,o)}e("../utils").inherits(i,n),i.prototype.readData=function(o){if(this.checkOffset(o),o===0)return new Uint8Array(0);var s=this.data.subarray(this.zero+this.index,this.zero+this.index+o);return this.index+=o,s},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../support"),o=e("./ArrayReader"),s=e("./StringReader"),a=e("./NodeBufferReader"),c=e("./Uint8ArrayReader");t.exports=function(l){var h=n.getTypeOf(l);return n.checkSupport(h),h!=="string"||i.uint8array?h==="nodebuffer"?new a(l):i.uint8array?new c(n.transformTo("uint8array",l)):new o(n.transformTo("array",l)):new s(l)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../utils");function o(s){n.call(this,"ConvertWorker to "+s),this.destType=s}i.inherits(o,n),o.prototype.processChunk=function(s){this.push({data:i.transformTo(this.destType,s.data),meta:s.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,n),o.prototype.processChunk=function(s){this.streamInfo.crc32=i(s.data,this.streamInfo.crc32||0),this.push(s)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function o(s){i.call(this,"DataLengthProbe for "+s),this.propName=s,this.withStreamInfo(s,0)}n.inherits(o,i),o.prototype.processChunk=function(s){if(s){var a=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=a+s.data.length}i.prototype.processChunk.call(this,s)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function o(s){i.call(this,"DataWorker");var a=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,s.then(function(c){a.dataIsReady=!0,a.data=c,a.max=c&&c.length||0,a.type=n.getTypeOf(c),a.isPaused||a._tickAndRepeat()},function(c){a.error(c)})}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var s=null,a=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":s=this.data.substring(this.index,a);break;case"uint8array":s=this.data.subarray(this.index,a);break;case"array":case"nodebuffer":s=this.data.slice(this.index,a)}return this.index=a,this.push({data:s,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){"use strict";function n(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,o){return this._listeners[i].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,o){if(this._listeners[i])for(var s=0;s<this._listeners[i].length;s++)this._listeners[i][s].call(this,o)},pipe:function(i){return i.registerPrevious(this)},registerPrevious:function(i){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=i.streamInfo,this.mergeStreamInfo(),this.previous=i;var o=this;return i.on("data",function(s){o.processChunk(s)}),i.on("end",function(){o.end()}),i.on("error",function(s){o.error(s)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var i=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),i=!0),this.previous&&this.previous.resume(),!i},flush:function(){},processChunk:function(i){this.push(i)},withStreamInfo:function(i,o){return this.extraStreamInfo[i]=o,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var i in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,i)&&(this.streamInfo[i]=this.extraStreamInfo[i])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var i="Worker "+this.name;return this.previous?this.previous+" -> "+i:i}},t.exports=n},{}],29:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./ConvertWorker"),o=e("./GenericWorker"),s=e("../base64"),a=e("../support"),c=e("../external"),l=null;if(a.nodestream)try{l=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function h(m,p){return new c.Promise(function(g,f){var b=[],v=m._internalType,k=m._outputType,S=m._mimeType;m.on("data",function(I,x){b.push(I),p&&p(x)}).on("error",function(I){b=[],f(I)}).on("end",function(){try{var I=(function(x,O,P){switch(x){case"blob":return n.newBlob(n.transformTo("arraybuffer",O),P);case"base64":return s.encode(O);default:return n.transformTo(x,O)}})(k,(function(x,O){var P,z=0,Z=null,E=0;for(P=0;P<O.length;P++)E+=O[P].length;switch(x){case"string":return O.join("");case"array":return Array.prototype.concat.apply([],O);case"uint8array":for(Z=new Uint8Array(E),P=0;P<O.length;P++)Z.set(O[P],z),z+=O[P].length;return Z;case"nodebuffer":return Buffer.concat(O);default:throw new Error("concat : unsupported type '"+x+"'")}})(v,b),S);g(I)}catch(x){f(x)}b=[]}).resume()})}function d(m,p,g){var f=p;switch(p){case"blob":case"arraybuffer":f="uint8array";break;case"base64":f="string"}try{this._internalType=f,this._outputType=p,this._mimeType=g,n.checkSupport(f),this._worker=m.pipe(new i(f)),m.lock()}catch(b){this._worker=new o("error"),this._worker.error(b)}}d.prototype={accumulate:function(m){return h(this,m)},on:function(m,p){var g=this;return m==="data"?this._worker.on(m,function(f){p.call(g,f.data,f.meta)}):this._worker.on(m,function(){n.delay(p,arguments,g)}),this},resume:function(){return n.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(m){if(n.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new l(this,{objectMode:this._outputType!=="nodebuffer"},m)}},t.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,r){"use strict";if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",r.nodebuffer=typeof Buffer<"u",r.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")r.blob=!1;else{var n=new ArrayBuffer(0);try{r.blob=new Blob([n],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(n),r.blob=i.getBlob("application/zip").size===0}catch{r.blob=!1}}}try{r.nodestream=!!e("readable-stream").Readable}catch{r.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,r){"use strict";for(var n=e("./utils"),i=e("./support"),o=e("./nodejsUtils"),s=e("./stream/GenericWorker"),a=new Array(256),c=0;c<256;c++)a[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;a[254]=a[254]=1;function l(){s.call(this,"utf-8 decode"),this.leftOver=null}function h(){s.call(this,"utf-8 encode")}r.utf8encode=function(d){return i.nodebuffer?o.newBufferFrom(d,"utf-8"):(function(m){var p,g,f,b,v,k=m.length,S=0;for(b=0;b<k;b++)(64512&(g=m.charCodeAt(b)))==55296&&b+1<k&&(64512&(f=m.charCodeAt(b+1)))==56320&&(g=65536+(g-55296<<10)+(f-56320),b++),S+=g<128?1:g<2048?2:g<65536?3:4;for(p=i.uint8array?new Uint8Array(S):new Array(S),b=v=0;v<S;b++)(64512&(g=m.charCodeAt(b)))==55296&&b+1<k&&(64512&(f=m.charCodeAt(b+1)))==56320&&(g=65536+(g-55296<<10)+(f-56320),b++),g<128?p[v++]=g:(g<2048?p[v++]=192|g>>>6:(g<65536?p[v++]=224|g>>>12:(p[v++]=240|g>>>18,p[v++]=128|g>>>12&63),p[v++]=128|g>>>6&63),p[v++]=128|63&g);return p})(d)},r.utf8decode=function(d){return i.nodebuffer?n.transformTo("nodebuffer",d).toString("utf-8"):(function(m){var p,g,f,b,v=m.length,k=new Array(2*v);for(p=g=0;p<v;)if((f=m[p++])<128)k[g++]=f;else if(4<(b=a[f]))k[g++]=65533,p+=b-1;else{for(f&=b===2?31:b===3?15:7;1<b&&p<v;)f=f<<6|63&m[p++],b--;1<b?k[g++]=65533:f<65536?k[g++]=f:(f-=65536,k[g++]=55296|f>>10&1023,k[g++]=56320|1023&f)}return k.length!==g&&(k.subarray?k=k.subarray(0,g):k.length=g),n.applyFromCharCode(k)})(d=n.transformTo(i.uint8array?"uint8array":"array",d))},n.inherits(l,s),l.prototype.processChunk=function(d){var m=n.transformTo(i.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var p=m;(m=new Uint8Array(p.length+this.leftOver.length)).set(this.leftOver,0),m.set(p,this.leftOver.length)}else m=this.leftOver.concat(m);this.leftOver=null}var g=(function(b,v){var k;for((v=v||b.length)>b.length&&(v=b.length),k=v-1;0<=k&&(192&b[k])==128;)k--;return k<0||k===0?v:k+a[b[k]]>v?k:v})(m),f=m;g!==m.length&&(i.uint8array?(f=m.subarray(0,g),this.leftOver=m.subarray(g,m.length)):(f=m.slice(0,g),this.leftOver=m.slice(g,m.length))),this.push({data:r.utf8decode(f),meta:d.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=l,n.inherits(h,s),h.prototype.processChunk=function(d){this.push({data:r.utf8encode(d.data),meta:d.meta})},r.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,r){"use strict";var n=e("./support"),i=e("./base64"),o=e("./nodejsUtils"),s=e("./external");function a(p){return p}function c(p,g){for(var f=0;f<p.length;++f)g[f]=255&p.charCodeAt(f);return g}e("setimmediate"),r.newBlob=function(p,g){r.checkSupport("blob");try{return new Blob([p],{type:g})}catch{try{var f=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return f.append(p),f.getBlob(g)}catch{throw new Error("Bug : can't construct the Blob.")}}};var l={stringifyByChunk:function(p,g,f){var b=[],v=0,k=p.length;if(k<=f)return String.fromCharCode.apply(null,p);for(;v<k;)g==="array"||g==="nodebuffer"?b.push(String.fromCharCode.apply(null,p.slice(v,Math.min(v+f,k)))):b.push(String.fromCharCode.apply(null,p.subarray(v,Math.min(v+f,k)))),v+=f;return b.join("")},stringifyByChar:function(p){for(var g="",f=0;f<p.length;f++)g+=String.fromCharCode(p[f]);return g},applyCanBeUsed:{uint8array:(function(){try{return n.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return n.nodebuffer&&String.fromCharCode.apply(null,o.allocBuffer(1)).length===1}catch{return!1}})()}};function h(p){var g=65536,f=r.getTypeOf(p),b=!0;if(f==="uint8array"?b=l.applyCanBeUsed.uint8array:f==="nodebuffer"&&(b=l.applyCanBeUsed.nodebuffer),b)for(;1<g;)try{return l.stringifyByChunk(p,f,g)}catch{g=Math.floor(g/2)}return l.stringifyByChar(p)}function d(p,g){for(var f=0;f<p.length;f++)g[f]=p[f];return g}r.applyFromCharCode=h;var m={};m.string={string:a,array:function(p){return c(p,new Array(p.length))},arraybuffer:function(p){return m.string.uint8array(p).buffer},uint8array:function(p){return c(p,new Uint8Array(p.length))},nodebuffer:function(p){return c(p,o.allocBuffer(p.length))}},m.array={string:h,array:a,arraybuffer:function(p){return new Uint8Array(p).buffer},uint8array:function(p){return new Uint8Array(p)},nodebuffer:function(p){return o.newBufferFrom(p)}},m.arraybuffer={string:function(p){return h(new Uint8Array(p))},array:function(p){return d(new Uint8Array(p),new Array(p.byteLength))},arraybuffer:a,uint8array:function(p){return new Uint8Array(p)},nodebuffer:function(p){return o.newBufferFrom(new Uint8Array(p))}},m.uint8array={string:h,array:function(p){return d(p,new Array(p.length))},arraybuffer:function(p){return p.buffer},uint8array:a,nodebuffer:function(p){return o.newBufferFrom(p)}},m.nodebuffer={string:h,array:function(p){return d(p,new Array(p.length))},arraybuffer:function(p){return m.nodebuffer.uint8array(p).buffer},uint8array:function(p){return d(p,new Uint8Array(p.length))},nodebuffer:a},r.transformTo=function(p,g){if(g=g||"",!p)return g;r.checkSupport(p);var f=r.getTypeOf(g);return m[f][p](g)},r.resolve=function(p){for(var g=p.split("/"),f=[],b=0;b<g.length;b++){var v=g[b];v==="."||v===""&&b!==0&&b!==g.length-1||(v===".."?f.pop():f.push(v))}return f.join("/")},r.getTypeOf=function(p){return typeof p=="string"?"string":Object.prototype.toString.call(p)==="[object Array]"?"array":n.nodebuffer&&o.isBuffer(p)?"nodebuffer":n.uint8array&&p instanceof Uint8Array?"uint8array":n.arraybuffer&&p instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(p){if(!n[p.toLowerCase()])throw new Error(p+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(p){var g,f,b="";for(f=0;f<(p||"").length;f++)b+="\\x"+((g=p.charCodeAt(f))<16?"0":"")+g.toString(16).toUpperCase();return b},r.delay=function(p,g,f){setImmediate(function(){p.apply(f||null,g||[])})},r.inherits=function(p,g){function f(){}f.prototype=g.prototype,p.prototype=new f},r.extend=function(){var p,g,f={};for(p=0;p<arguments.length;p++)for(g in arguments[p])Object.prototype.hasOwnProperty.call(arguments[p],g)&&f[g]===void 0&&(f[g]=arguments[p][g]);return f},r.prepareContent=function(p,g,f,b,v){return s.Promise.resolve(g).then(function(k){return n.blob&&(k instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(k))!==-1)&&typeof FileReader<"u"?new s.Promise(function(S,I){var x=new FileReader;x.onload=function(O){S(O.target.result)},x.onerror=function(O){I(O.target.error)},x.readAsArrayBuffer(k)}):k}).then(function(k){var S=r.getTypeOf(k);return S?(S==="arraybuffer"?k=r.transformTo("uint8array",k):S==="string"&&(v?k=i.decode(k):f&&b!==!0&&(k=(function(I){return c(I,n.uint8array?new Uint8Array(I.length):new Array(I.length))})(k))),k):s.Promise.reject(new Error("Can't read the data of '"+p+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,r){"use strict";var n=e("./reader/readerFor"),i=e("./utils"),o=e("./signature"),s=e("./zipEntry"),a=e("./support");function c(l){this.files=[],this.loadOptions=l}c.prototype={checkSignature:function(l){if(!this.reader.readAndCheckSignature(l)){this.reader.index-=4;var h=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(h)+", expected "+i.pretty(l)+")")}},isSignature:function(l,h){var d=this.reader.index;this.reader.setIndex(l);var m=this.reader.readString(4)===h;return this.reader.setIndex(d),m},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var l=this.reader.readData(this.zipCommentLength),h=a.uint8array?"uint8array":"array",d=i.transformTo(h,l);this.zipComment=this.loadOptions.decodeFileName(d)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var l,h,d,m=this.zip64EndOfCentralSize-44;0<m;)l=this.reader.readInt(2),h=this.reader.readInt(4),d=this.reader.readData(h),this.zip64ExtensibleData[l]={id:l,length:h,value:d}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var l,h;for(l=0;l<this.files.length;l++)h=this.files[l],this.reader.setIndex(h.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),h.readLocalPart(this.reader),h.handleUTF8(),h.processAttributes()},readCentralDir:function(){var l;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(l=new s({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(l);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var l=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(l<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(l);var h=l;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(l=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(l),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var d=this.centralDirOffset+this.centralDirSize;this.zip64&&(d+=20,d+=12+this.zip64EndOfCentralSize);var m=h-d;if(0<m)this.isSignature(h,o.CENTRAL_FILE_HEADER)||(this.reader.zero=m);else if(m<0)throw new Error("Corrupted zip: missing "+Math.abs(m)+" bytes.")},prepareReader:function(l){this.reader=n(l)},load:function(l){this.prepareReader(l),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=c},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,r){"use strict";var n=e("./reader/readerFor"),i=e("./utils"),o=e("./compressedObject"),s=e("./crc32"),a=e("./utf8"),c=e("./compressions"),l=e("./support");function h(d,m){this.options=d,this.loadOptions=m}h.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(d){var m,p;if(d.skip(22),this.fileNameLength=d.readInt(2),p=d.readInt(2),this.fileName=d.readData(this.fileNameLength),d.skip(p),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((m=(function(g){for(var f in c)if(Object.prototype.hasOwnProperty.call(c,f)&&c[f].magic===g)return c[f];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,m,d.readData(this.compressedSize))},readCentralPart:function(d){this.versionMadeBy=d.readInt(2),d.skip(2),this.bitFlag=d.readInt(2),this.compressionMethod=d.readString(2),this.date=d.readDate(),this.crc32=d.readInt(4),this.compressedSize=d.readInt(4),this.uncompressedSize=d.readInt(4);var m=d.readInt(2);if(this.extraFieldsLength=d.readInt(2),this.fileCommentLength=d.readInt(2),this.diskNumberStart=d.readInt(2),this.internalFileAttributes=d.readInt(2),this.externalFileAttributes=d.readInt(4),this.localHeaderOffset=d.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");d.skip(m),this.readExtraFields(d),this.parseZIP64ExtraField(d),this.fileComment=d.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var d=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),d==0&&(this.dosPermissions=63&this.externalFileAttributes),d==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var d=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=d.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=d.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=d.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=d.readInt(4))}},readExtraFields:function(d){var m,p,g,f=d.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});d.index+4<f;)m=d.readInt(2),p=d.readInt(2),g=d.readData(p),this.extraFields[m]={id:m,length:p,value:g};d.setIndex(f)},handleUTF8:function(){var d=l.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var m=this.findExtraFieldUnicodePath();if(m!==null)this.fileNameStr=m;else{var p=i.transformTo(d,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(p)}var g=this.findExtraFieldUnicodeComment();if(g!==null)this.fileCommentStr=g;else{var f=i.transformTo(d,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(f)}}},findExtraFieldUnicodePath:function(){var d=this.extraFields[28789];if(d){var m=n(d.value);return m.readInt(1)!==1||s(this.fileName)!==m.readInt(4)?null:a.utf8decode(m.readData(d.length-5))}return null},findExtraFieldUnicodeComment:function(){var d=this.extraFields[25461];if(d){var m=n(d.value);return m.readInt(1)!==1||s(this.fileComment)!==m.readInt(4)?null:a.utf8decode(m.readData(d.length-5))}return null}},t.exports=h},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,r){"use strict";function n(m,p,g){this.name=m,this.dir=g.dir,this.date=g.date,this.comment=g.comment,this.unixPermissions=g.unixPermissions,this.dosPermissions=g.dosPermissions,this._data=p,this._dataBinary=g.binary,this.options={compression:g.compression,compressionOptions:g.compressionOptions}}var i=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),s=e("./utf8"),a=e("./compressedObject"),c=e("./stream/GenericWorker");n.prototype={internalStream:function(m){var p=null,g="string";try{if(!m)throw new Error("No output type specified.");var f=(g=m.toLowerCase())==="string"||g==="text";g!=="binarystring"&&g!=="text"||(g="string"),p=this._decompressWorker();var b=!this._dataBinary;b&&!f&&(p=p.pipe(new s.Utf8EncodeWorker)),!b&&f&&(p=p.pipe(new s.Utf8DecodeWorker))}catch(v){(p=new c("error")).error(v)}return new i(p,g,"")},async:function(m,p){return this.internalStream(m).accumulate(p)},nodeStream:function(m,p){return this.internalStream(m||"nodebuffer").toNodejsStream(p)},_compressWorker:function(m,p){if(this._data instanceof a&&this._data.compression.magic===m.magic)return this._data.getCompressedWorker();var g=this._decompressWorker();return this._dataBinary||(g=g.pipe(new s.Utf8EncodeWorker)),a.createWorkerFrom(g,m,p)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof c?this._data:new o(this._data)}};for(var l=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],h=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},d=0;d<l.length;d++)n.prototype[l[d]]=h;t.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,r){(function(n){"use strict";var i,o,s=n.MutationObserver||n.WebKitMutationObserver;if(s){var a=0,c=new s(m),l=n.document.createTextNode("");c.observe(l,{characterData:!0}),i=function(){l.data=a=++a%2}}else if(n.setImmediate||n.MessageChannel===void 0)i="document"in n&&"onreadystatechange"in n.document.createElement("script")?function(){var p=n.document.createElement("script");p.onreadystatechange=function(){m(),p.onreadystatechange=null,p.parentNode.removeChild(p),p=null},n.document.documentElement.appendChild(p)}:function(){setTimeout(m,0)};else{var h=new n.MessageChannel;h.port1.onmessage=m,i=function(){h.port2.postMessage(0)}}var d=[];function m(){var p,g;o=!0;for(var f=d.length;f;){for(g=d,d=[],p=-1;++p<f;)g[p]();f=d.length}o=!1}t.exports=function(p){d.push(p)!==1||o||i()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(e,t,r){"use strict";var n=e("immediate");function i(){}var o={},s=["REJECTED"],a=["FULFILLED"],c=["PENDING"];function l(f){if(typeof f!="function")throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,f!==i&&p(this,f)}function h(f,b,v){this.promise=f,typeof b=="function"&&(this.onFulfilled=b,this.callFulfilled=this.otherCallFulfilled),typeof v=="function"&&(this.onRejected=v,this.callRejected=this.otherCallRejected)}function d(f,b,v){n(function(){var k;try{k=b(v)}catch(S){return o.reject(f,S)}k===f?o.reject(f,new TypeError("Cannot resolve promise with itself")):o.resolve(f,k)})}function m(f){var b=f&&f.then;if(f&&(typeof f=="object"||typeof f=="function")&&typeof b=="function")return function(){b.apply(f,arguments)}}function p(f,b){var v=!1;function k(x){v||(v=!0,o.reject(f,x))}function S(x){v||(v=!0,o.resolve(f,x))}var I=g(function(){b(S,k)});I.status==="error"&&k(I.value)}function g(f,b){var v={};try{v.value=f(b),v.status="success"}catch(k){v.status="error",v.value=k}return v}(t.exports=l).prototype.finally=function(f){if(typeof f!="function")return this;var b=this.constructor;return this.then(function(v){return b.resolve(f()).then(function(){return v})},function(v){return b.resolve(f()).then(function(){throw v})})},l.prototype.catch=function(f){return this.then(null,f)},l.prototype.then=function(f,b){if(typeof f!="function"&&this.state===a||typeof b!="function"&&this.state===s)return this;var v=new this.constructor(i);return this.state!==c?d(v,this.state===a?f:b,this.outcome):this.queue.push(new h(v,f,b)),v},h.prototype.callFulfilled=function(f){o.resolve(this.promise,f)},h.prototype.otherCallFulfilled=function(f){d(this.promise,this.onFulfilled,f)},h.prototype.callRejected=function(f){o.reject(this.promise,f)},h.prototype.otherCallRejected=function(f){d(this.promise,this.onRejected,f)},o.resolve=function(f,b){var v=g(m,b);if(v.status==="error")return o.reject(f,v.value);var k=v.value;if(k)p(f,k);else{f.state=a,f.outcome=b;for(var S=-1,I=f.queue.length;++S<I;)f.queue[S].callFulfilled(b)}return f},o.reject=function(f,b){f.state=s,f.outcome=b;for(var v=-1,k=f.queue.length;++v<k;)f.queue[v].callRejected(b);return f},l.resolve=function(f){return f instanceof this?f:o.resolve(new this(i),f)},l.reject=function(f){var b=new this(i);return o.reject(b,f)},l.all=function(f){var b=this;if(Object.prototype.toString.call(f)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=f.length,k=!1;if(!v)return this.resolve([]);for(var S=new Array(v),I=0,x=-1,O=new this(i);++x<v;)P(f[x],x);return O;function P(z,Z){b.resolve(z).then(function(E){S[Z]=E,++I!==v||k||(k=!0,o.resolve(O,S))},function(E){k||(k=!0,o.reject(O,E))})}},l.race=function(f){var b=this;if(Object.prototype.toString.call(f)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=f.length,k=!1;if(!v)return this.resolve([]);for(var S=-1,I=new this(i);++S<v;)x=f[S],b.resolve(x).then(function(O){k||(k=!0,o.resolve(I,O))},function(O){k||(k=!0,o.reject(I,O))});var x;return I}},{immediate:36}],38:[function(e,t,r){"use strict";var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,r){"use strict";var n=e("./zlib/deflate"),i=e("./utils/common"),o=e("./utils/strings"),s=e("./zlib/messages"),a=e("./zlib/zstream"),c=Object.prototype.toString,l=0,h=-1,d=0,m=8;function p(f){if(!(this instanceof p))return new p(f);this.options=i.assign({level:h,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:""},f||{});var b=this.options;b.raw&&0<b.windowBits?b.windowBits=-b.windowBits:b.gzip&&0<b.windowBits&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var v=n.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(v!==l)throw new Error(s[v]);if(b.header&&n.deflateSetHeader(this.strm,b.header),b.dictionary){var k;if(k=typeof b.dictionary=="string"?o.string2buf(b.dictionary):c.call(b.dictionary)==="[object ArrayBuffer]"?new Uint8Array(b.dictionary):b.dictionary,(v=n.deflateSetDictionary(this.strm,k))!==l)throw new Error(s[v]);this._dict_set=!0}}function g(f,b){var v=new p(b);if(v.push(f,!0),v.err)throw v.msg||s[v.err];return v.result}p.prototype.push=function(f,b){var v,k,S=this.strm,I=this.options.chunkSize;if(this.ended)return!1;k=b===~~b?b:b===!0?4:0,typeof f=="string"?S.input=o.string2buf(f):c.call(f)==="[object ArrayBuffer]"?S.input=new Uint8Array(f):S.input=f,S.next_in=0,S.avail_in=S.input.length;do{if(S.avail_out===0&&(S.output=new i.Buf8(I),S.next_out=0,S.avail_out=I),(v=n.deflate(S,k))!==1&&v!==l)return this.onEnd(v),!(this.ended=!0);S.avail_out!==0&&(S.avail_in!==0||k!==4&&k!==2)||(this.options.to==="string"?this.onData(o.buf2binstring(i.shrinkBuf(S.output,S.next_out))):this.onData(i.shrinkBuf(S.output,S.next_out)))}while((0<S.avail_in||S.avail_out===0)&&v!==1);return k===4?(v=n.deflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===l):k!==2||(this.onEnd(l),!(S.avail_out=0))},p.prototype.onData=function(f){this.chunks.push(f)},p.prototype.onEnd=function(f){f===l&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=f,this.msg=this.strm.msg},r.Deflate=p,r.deflate=g,r.deflateRaw=function(f,b){return(b=b||{}).raw=!0,g(f,b)},r.gzip=function(f,b){return(b=b||{}).gzip=!0,g(f,b)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,r){"use strict";var n=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),s=e("./zlib/constants"),a=e("./zlib/messages"),c=e("./zlib/zstream"),l=e("./zlib/gzheader"),h=Object.prototype.toString;function d(p){if(!(this instanceof d))return new d(p);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},p||{});var g=this.options;g.raw&&0<=g.windowBits&&g.windowBits<16&&(g.windowBits=-g.windowBits,g.windowBits===0&&(g.windowBits=-15)),!(0<=g.windowBits&&g.windowBits<16)||p&&p.windowBits||(g.windowBits+=32),15<g.windowBits&&g.windowBits<48&&(15&g.windowBits)==0&&(g.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var f=n.inflateInit2(this.strm,g.windowBits);if(f!==s.Z_OK)throw new Error(a[f]);this.header=new l,n.inflateGetHeader(this.strm,this.header)}function m(p,g){var f=new d(g);if(f.push(p,!0),f.err)throw f.msg||a[f.err];return f.result}d.prototype.push=function(p,g){var f,b,v,k,S,I,x=this.strm,O=this.options.chunkSize,P=this.options.dictionary,z=!1;if(this.ended)return!1;b=g===~~g?g:g===!0?s.Z_FINISH:s.Z_NO_FLUSH,typeof p=="string"?x.input=o.binstring2buf(p):h.call(p)==="[object ArrayBuffer]"?x.input=new Uint8Array(p):x.input=p,x.next_in=0,x.avail_in=x.input.length;do{if(x.avail_out===0&&(x.output=new i.Buf8(O),x.next_out=0,x.avail_out=O),(f=n.inflate(x,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&P&&(I=typeof P=="string"?o.string2buf(P):h.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,f=n.inflateSetDictionary(this.strm,I)),f===s.Z_BUF_ERROR&&z===!0&&(f=s.Z_OK,z=!1),f!==s.Z_STREAM_END&&f!==s.Z_OK)return this.onEnd(f),!(this.ended=!0);x.next_out&&(x.avail_out!==0&&f!==s.Z_STREAM_END&&(x.avail_in!==0||b!==s.Z_FINISH&&b!==s.Z_SYNC_FLUSH)||(this.options.to==="string"?(v=o.utf8border(x.output,x.next_out),k=x.next_out-v,S=o.buf2string(x.output,v),x.next_out=k,x.avail_out=O-k,k&&i.arraySet(x.output,x.output,v,k,0),this.onData(S)):this.onData(i.shrinkBuf(x.output,x.next_out)))),x.avail_in===0&&x.avail_out===0&&(z=!0)}while((0<x.avail_in||x.avail_out===0)&&f!==s.Z_STREAM_END);return f===s.Z_STREAM_END&&(b=s.Z_FINISH),b===s.Z_FINISH?(f=n.inflateEnd(this.strm),this.onEnd(f),this.ended=!0,f===s.Z_OK):b!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),!(x.avail_out=0))},d.prototype.onData=function(p){this.chunks.push(p)},d.prototype.onEnd=function(p){p===s.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=p,this.msg=this.strm.msg},r.Inflate=d,r.inflate=m,r.inflateRaw=function(p,g){return(g=g||{}).raw=!0,m(p,g)},r.ungzip=m},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,r){"use strict";var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";r.assign=function(s){for(var a=Array.prototype.slice.call(arguments,1);a.length;){var c=a.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(var l in c)c.hasOwnProperty(l)&&(s[l]=c[l])}}return s},r.shrinkBuf=function(s,a){return s.length===a?s:s.subarray?s.subarray(0,a):(s.length=a,s)};var i={arraySet:function(s,a,c,l,h){if(a.subarray&&s.subarray)s.set(a.subarray(c,c+l),h);else for(var d=0;d<l;d++)s[h+d]=a[c+d]},flattenChunks:function(s){var a,c,l,h,d,m;for(a=l=0,c=s.length;a<c;a++)l+=s[a].length;for(m=new Uint8Array(l),a=h=0,c=s.length;a<c;a++)d=s[a],m.set(d,h),h+=d.length;return m}},o={arraySet:function(s,a,c,l,h){for(var d=0;d<l;d++)s[h+d]=a[c+d]},flattenChunks:function(s){return[].concat.apply([],s)}};r.setTyped=function(s){s?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(n)},{}],42:[function(e,t,r){"use strict";var n=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{o=!1}for(var s=new n.Buf8(256),a=0;a<256;a++)s[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;function c(l,h){if(h<65537&&(l.subarray&&o||!l.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(l,h));for(var d="",m=0;m<h;m++)d+=String.fromCharCode(l[m]);return d}s[254]=s[254]=1,r.string2buf=function(l){var h,d,m,p,g,f=l.length,b=0;for(p=0;p<f;p++)(64512&(d=l.charCodeAt(p)))==55296&&p+1<f&&(64512&(m=l.charCodeAt(p+1)))==56320&&(d=65536+(d-55296<<10)+(m-56320),p++),b+=d<128?1:d<2048?2:d<65536?3:4;for(h=new n.Buf8(b),p=g=0;g<b;p++)(64512&(d=l.charCodeAt(p)))==55296&&p+1<f&&(64512&(m=l.charCodeAt(p+1)))==56320&&(d=65536+(d-55296<<10)+(m-56320),p++),d<128?h[g++]=d:(d<2048?h[g++]=192|d>>>6:(d<65536?h[g++]=224|d>>>12:(h[g++]=240|d>>>18,h[g++]=128|d>>>12&63),h[g++]=128|d>>>6&63),h[g++]=128|63&d);return h},r.buf2binstring=function(l){return c(l,l.length)},r.binstring2buf=function(l){for(var h=new n.Buf8(l.length),d=0,m=h.length;d<m;d++)h[d]=l.charCodeAt(d);return h},r.buf2string=function(l,h){var d,m,p,g,f=h||l.length,b=new Array(2*f);for(d=m=0;d<f;)if((p=l[d++])<128)b[m++]=p;else if(4<(g=s[p]))b[m++]=65533,d+=g-1;else{for(p&=g===2?31:g===3?15:7;1<g&&d<f;)p=p<<6|63&l[d++],g--;1<g?b[m++]=65533:p<65536?b[m++]=p:(p-=65536,b[m++]=55296|p>>10&1023,b[m++]=56320|1023&p)}return c(b,m)},r.utf8border=function(l,h){var d;for((h=h||l.length)>l.length&&(h=l.length),d=h-1;0<=d&&(192&l[d])==128;)d--;return d<0||d===0?h:d+s[l[d]]>h?d:h}},{"./common":41}],43:[function(e,t,r){"use strict";t.exports=function(n,i,o,s){for(var a=65535&n|0,c=n>>>16&65535|0,l=0;o!==0;){for(o-=l=2e3<o?2e3:o;c=c+(a=a+i[s++]|0)|0,--l;);a%=65521,c%=65521}return a|c<<16|0}},{}],44:[function(e,t,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,r){"use strict";var n=(function(){for(var i,o=[],s=0;s<256;s++){i=s;for(var a=0;a<8;a++)i=1&i?3988292384^i>>>1:i>>>1;o[s]=i}return o})();t.exports=function(i,o,s,a){var c=n,l=a+s;i^=-1;for(var h=a;h<l;h++)i=i>>>8^c[255&(i^o[h])];return-1^i}},{}],46:[function(e,t,r){"use strict";var n,i=e("../utils/common"),o=e("./trees"),s=e("./adler32"),a=e("./crc32"),c=e("./messages"),l=0,h=4,d=0,m=-2,p=-1,g=4,f=2,b=8,v=9,k=286,S=30,I=19,x=2*k+1,O=15,P=3,z=258,Z=z+P+1,E=42,F=113,y=1,U=2,ae=3,V=4;function le(u,M){return u.msg=c[M],M}function H(u){return(u<<1)-(4<u?9:0)}function oe(u){for(var M=u.length;0<=--M;)u[M]=0}function D(u){var M=u.state,B=M.pending;B>u.avail_out&&(B=u.avail_out),B!==0&&(i.arraySet(u.output,M.pending_buf,M.pending_out,B,u.next_out),u.next_out+=B,M.pending_out+=B,u.total_out+=B,u.avail_out-=B,M.pending-=B,M.pending===0&&(M.pending_out=0))}function R(u,M){o._tr_flush_block(u,0<=u.block_start?u.block_start:-1,u.strstart-u.block_start,M),u.block_start=u.strstart,D(u.strm)}function te(u,M){u.pending_buf[u.pending++]=M}function q(u,M){u.pending_buf[u.pending++]=M>>>8&255,u.pending_buf[u.pending++]=255&M}function G(u,M){var B,w,_=u.max_chain_length,C=u.strstart,N=u.prev_length,j=u.nice_match,A=u.strstart>u.w_size-Z?u.strstart-(u.w_size-Z):0,$=u.window,K=u.w_mask,W=u.prev,re=u.strstart+z,ke=$[C+N-1],ue=$[C+N];u.prev_length>=u.good_match&&(_>>=2),j>u.lookahead&&(j=u.lookahead);do if($[(B=M)+N]===ue&&$[B+N-1]===ke&&$[B]===$[C]&&$[++B]===$[C+1]){C+=2,B++;do;while($[++C]===$[++B]&&$[++C]===$[++B]&&$[++C]===$[++B]&&$[++C]===$[++B]&&$[++C]===$[++B]&&$[++C]===$[++B]&&$[++C]===$[++B]&&$[++C]===$[++B]&&C<re);if(w=z-(re-C),C=re-z,N<w){if(u.match_start=M,j<=(N=w))break;ke=$[C+N-1],ue=$[C+N]}}while((M=W[M&K])>A&&--_!=0);return N<=u.lookahead?N:u.lookahead}function Ce(u){var M,B,w,_,C,N,j,A,$,K,W=u.w_size;do{if(_=u.window_size-u.lookahead-u.strstart,u.strstart>=W+(W-Z)){for(i.arraySet(u.window,u.window,W,W,0),u.match_start-=W,u.strstart-=W,u.block_start-=W,M=B=u.hash_size;w=u.head[--M],u.head[M]=W<=w?w-W:0,--B;);for(M=B=W;w=u.prev[--M],u.prev[M]=W<=w?w-W:0,--B;);_+=W}if(u.strm.avail_in===0)break;if(N=u.strm,j=u.window,A=u.strstart+u.lookahead,$=_,K=void 0,K=N.avail_in,$<K&&(K=$),B=K===0?0:(N.avail_in-=K,i.arraySet(j,N.input,N.next_in,K,A),N.state.wrap===1?N.adler=s(N.adler,j,K,A):N.state.wrap===2&&(N.adler=a(N.adler,j,K,A)),N.next_in+=K,N.total_in+=K,K),u.lookahead+=B,u.lookahead+u.insert>=P)for(C=u.strstart-u.insert,u.ins_h=u.window[C],u.ins_h=(u.ins_h<<u.hash_shift^u.window[C+1])&u.hash_mask;u.insert&&(u.ins_h=(u.ins_h<<u.hash_shift^u.window[C+P-1])&u.hash_mask,u.prev[C&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=C,C++,u.insert--,!(u.lookahead+u.insert<P)););}while(u.lookahead<Z&&u.strm.avail_in!==0)}function Ke(u,M){for(var B,w;;){if(u.lookahead<Z){if(Ce(u),u.lookahead<Z&&M===l)return y;if(u.lookahead===0)break}if(B=0,u.lookahead>=P&&(u.ins_h=(u.ins_h<<u.hash_shift^u.window[u.strstart+P-1])&u.hash_mask,B=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart),B!==0&&u.strstart-B<=u.w_size-Z&&(u.match_length=G(u,B)),u.match_length>=P)if(w=o._tr_tally(u,u.strstart-u.match_start,u.match_length-P),u.lookahead-=u.match_length,u.match_length<=u.max_lazy_match&&u.lookahead>=P){for(u.match_length--;u.strstart++,u.ins_h=(u.ins_h<<u.hash_shift^u.window[u.strstart+P-1])&u.hash_mask,B=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart,--u.match_length!=0;);u.strstart++}else u.strstart+=u.match_length,u.match_length=0,u.ins_h=u.window[u.strstart],u.ins_h=(u.ins_h<<u.hash_shift^u.window[u.strstart+1])&u.hash_mask;else w=o._tr_tally(u,0,u.window[u.strstart]),u.lookahead--,u.strstart++;if(w&&(R(u,!1),u.strm.avail_out===0))return y}return u.insert=u.strstart<P-1?u.strstart:P-1,M===h?(R(u,!0),u.strm.avail_out===0?ae:V):u.last_lit&&(R(u,!1),u.strm.avail_out===0)?y:U}function de(u,M){for(var B,w,_;;){if(u.lookahead<Z){if(Ce(u),u.lookahead<Z&&M===l)return y;if(u.lookahead===0)break}if(B=0,u.lookahead>=P&&(u.ins_h=(u.ins_h<<u.hash_shift^u.window[u.strstart+P-1])&u.hash_mask,B=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart),u.prev_length=u.match_length,u.prev_match=u.match_start,u.match_length=P-1,B!==0&&u.prev_length<u.max_lazy_match&&u.strstart-B<=u.w_size-Z&&(u.match_length=G(u,B),u.match_length<=5&&(u.strategy===1||u.match_length===P&&4096<u.strstart-u.match_start)&&(u.match_length=P-1)),u.prev_length>=P&&u.match_length<=u.prev_length){for(_=u.strstart+u.lookahead-P,w=o._tr_tally(u,u.strstart-1-u.prev_match,u.prev_length-P),u.lookahead-=u.prev_length-1,u.prev_length-=2;++u.strstart<=_&&(u.ins_h=(u.ins_h<<u.hash_shift^u.window[u.strstart+P-1])&u.hash_mask,B=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart),--u.prev_length!=0;);if(u.match_available=0,u.match_length=P-1,u.strstart++,w&&(R(u,!1),u.strm.avail_out===0))return y}else if(u.match_available){if((w=o._tr_tally(u,0,u.window[u.strstart-1]))&&R(u,!1),u.strstart++,u.lookahead--,u.strm.avail_out===0)return y}else u.match_available=1,u.strstart++,u.lookahead--}return u.match_available&&(w=o._tr_tally(u,0,u.window[u.strstart-1]),u.match_available=0),u.insert=u.strstart<P-1?u.strstart:P-1,M===h?(R(u,!0),u.strm.avail_out===0?ae:V):u.last_lit&&(R(u,!1),u.strm.avail_out===0)?y:U}function ge(u,M,B,w,_){this.good_length=u,this.max_lazy=M,this.nice_length=B,this.max_chain=w,this.func=_}function Xe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=b,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*x),this.dyn_dtree=new i.Buf16(2*(2*S+1)),this.bl_tree=new i.Buf16(2*(2*I+1)),oe(this.dyn_ltree),oe(this.dyn_dtree),oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(O+1),this.heap=new i.Buf16(2*k+1),oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*k+1),oe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ve(u){var M;return u&&u.state?(u.total_in=u.total_out=0,u.data_type=f,(M=u.state).pending=0,M.pending_out=0,M.wrap<0&&(M.wrap=-M.wrap),M.status=M.wrap?E:F,u.adler=M.wrap===2?0:1,M.last_flush=l,o._tr_init(M),d):le(u,m)}function it(u){var M=ve(u);return M===d&&(function(B){B.window_size=2*B.w_size,oe(B.head),B.max_lazy_match=n[B.level].max_lazy,B.good_match=n[B.level].good_length,B.nice_match=n[B.level].nice_length,B.max_chain_length=n[B.level].max_chain,B.strstart=0,B.block_start=0,B.lookahead=0,B.insert=0,B.match_length=B.prev_length=P-1,B.match_available=0,B.ins_h=0})(u.state),M}function ut(u,M,B,w,_,C){if(!u)return m;var N=1;if(M===p&&(M=6),w<0?(N=0,w=-w):15<w&&(N=2,w-=16),_<1||v<_||B!==b||w<8||15<w||M<0||9<M||C<0||g<C)return le(u,m);w===8&&(w=9);var j=new Xe;return(u.state=j).strm=u,j.wrap=N,j.gzhead=null,j.w_bits=w,j.w_size=1<<j.w_bits,j.w_mask=j.w_size-1,j.hash_bits=_+7,j.hash_size=1<<j.hash_bits,j.hash_mask=j.hash_size-1,j.hash_shift=~~((j.hash_bits+P-1)/P),j.window=new i.Buf8(2*j.w_size),j.head=new i.Buf16(j.hash_size),j.prev=new i.Buf16(j.w_size),j.lit_bufsize=1<<_+6,j.pending_buf_size=4*j.lit_bufsize,j.pending_buf=new i.Buf8(j.pending_buf_size),j.d_buf=1*j.lit_bufsize,j.l_buf=3*j.lit_bufsize,j.level=M,j.strategy=C,j.method=B,it(u)}n=[new ge(0,0,0,0,function(u,M){var B=65535;for(B>u.pending_buf_size-5&&(B=u.pending_buf_size-5);;){if(u.lookahead<=1){if(Ce(u),u.lookahead===0&&M===l)return y;if(u.lookahead===0)break}u.strstart+=u.lookahead,u.lookahead=0;var w=u.block_start+B;if((u.strstart===0||u.strstart>=w)&&(u.lookahead=u.strstart-w,u.strstart=w,R(u,!1),u.strm.avail_out===0)||u.strstart-u.block_start>=u.w_size-Z&&(R(u,!1),u.strm.avail_out===0))return y}return u.insert=0,M===h?(R(u,!0),u.strm.avail_out===0?ae:V):(u.strstart>u.block_start&&(R(u,!1),u.strm.avail_out),y)}),new ge(4,4,8,4,Ke),new ge(4,5,16,8,Ke),new ge(4,6,32,32,Ke),new ge(4,4,16,16,de),new ge(8,16,32,32,de),new ge(8,16,128,128,de),new ge(8,32,128,256,de),new ge(32,128,258,1024,de),new ge(32,258,258,4096,de)],r.deflateInit=function(u,M){return ut(u,M,b,15,8,0)},r.deflateInit2=ut,r.deflateReset=it,r.deflateResetKeep=ve,r.deflateSetHeader=function(u,M){return u&&u.state?u.state.wrap!==2?m:(u.state.gzhead=M,d):m},r.deflate=function(u,M){var B,w,_,C;if(!u||!u.state||5<M||M<0)return u?le(u,m):m;if(w=u.state,!u.output||!u.input&&u.avail_in!==0||w.status===666&&M!==h)return le(u,u.avail_out===0?-5:m);if(w.strm=u,B=w.last_flush,w.last_flush=M,w.status===E)if(w.wrap===2)u.adler=0,te(w,31),te(w,139),te(w,8),w.gzhead?(te(w,(w.gzhead.text?1:0)+(w.gzhead.hcrc?2:0)+(w.gzhead.extra?4:0)+(w.gzhead.name?8:0)+(w.gzhead.comment?16:0)),te(w,255&w.gzhead.time),te(w,w.gzhead.time>>8&255),te(w,w.gzhead.time>>16&255),te(w,w.gzhead.time>>24&255),te(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),te(w,255&w.gzhead.os),w.gzhead.extra&&w.gzhead.extra.length&&(te(w,255&w.gzhead.extra.length),te(w,w.gzhead.extra.length>>8&255)),w.gzhead.hcrc&&(u.adler=a(u.adler,w.pending_buf,w.pending,0)),w.gzindex=0,w.status=69):(te(w,0),te(w,0),te(w,0),te(w,0),te(w,0),te(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),te(w,3),w.status=F);else{var N=b+(w.w_bits-8<<4)<<8;N|=(2<=w.strategy||w.level<2?0:w.level<6?1:w.level===6?2:3)<<6,w.strstart!==0&&(N|=32),N+=31-N%31,w.status=F,q(w,N),w.strstart!==0&&(q(w,u.adler>>>16),q(w,65535&u.adler)),u.adler=1}if(w.status===69)if(w.gzhead.extra){for(_=w.pending;w.gzindex<(65535&w.gzhead.extra.length)&&(w.pending!==w.pending_buf_size||(w.gzhead.hcrc&&w.pending>_&&(u.adler=a(u.adler,w.pending_buf,w.pending-_,_)),D(u),_=w.pending,w.pending!==w.pending_buf_size));)te(w,255&w.gzhead.extra[w.gzindex]),w.gzindex++;w.gzhead.hcrc&&w.pending>_&&(u.adler=a(u.adler,w.pending_buf,w.pending-_,_)),w.gzindex===w.gzhead.extra.length&&(w.gzindex=0,w.status=73)}else w.status=73;if(w.status===73)if(w.gzhead.name){_=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>_&&(u.adler=a(u.adler,w.pending_buf,w.pending-_,_)),D(u),_=w.pending,w.pending===w.pending_buf_size)){C=1;break}C=w.gzindex<w.gzhead.name.length?255&w.gzhead.name.charCodeAt(w.gzindex++):0,te(w,C)}while(C!==0);w.gzhead.hcrc&&w.pending>_&&(u.adler=a(u.adler,w.pending_buf,w.pending-_,_)),C===0&&(w.gzindex=0,w.status=91)}else w.status=91;if(w.status===91)if(w.gzhead.comment){_=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>_&&(u.adler=a(u.adler,w.pending_buf,w.pending-_,_)),D(u),_=w.pending,w.pending===w.pending_buf_size)){C=1;break}C=w.gzindex<w.gzhead.comment.length?255&w.gzhead.comment.charCodeAt(w.gzindex++):0,te(w,C)}while(C!==0);w.gzhead.hcrc&&w.pending>_&&(u.adler=a(u.adler,w.pending_buf,w.pending-_,_)),C===0&&(w.status=103)}else w.status=103;if(w.status===103&&(w.gzhead.hcrc?(w.pending+2>w.pending_buf_size&&D(u),w.pending+2<=w.pending_buf_size&&(te(w,255&u.adler),te(w,u.adler>>8&255),u.adler=0,w.status=F)):w.status=F),w.pending!==0){if(D(u),u.avail_out===0)return w.last_flush=-1,d}else if(u.avail_in===0&&H(M)<=H(B)&&M!==h)return le(u,-5);if(w.status===666&&u.avail_in!==0)return le(u,-5);if(u.avail_in!==0||w.lookahead!==0||M!==l&&w.status!==666){var j=w.strategy===2?(function(A,$){for(var K;;){if(A.lookahead===0&&(Ce(A),A.lookahead===0)){if($===l)return y;break}if(A.match_length=0,K=o._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++,K&&(R(A,!1),A.strm.avail_out===0))return y}return A.insert=0,$===h?(R(A,!0),A.strm.avail_out===0?ae:V):A.last_lit&&(R(A,!1),A.strm.avail_out===0)?y:U})(w,M):w.strategy===3?(function(A,$){for(var K,W,re,ke,ue=A.window;;){if(A.lookahead<=z){if(Ce(A),A.lookahead<=z&&$===l)return y;if(A.lookahead===0)break}if(A.match_length=0,A.lookahead>=P&&0<A.strstart&&(W=ue[re=A.strstart-1])===ue[++re]&&W===ue[++re]&&W===ue[++re]){ke=A.strstart+z;do;while(W===ue[++re]&&W===ue[++re]&&W===ue[++re]&&W===ue[++re]&&W===ue[++re]&&W===ue[++re]&&W===ue[++re]&&W===ue[++re]&&re<ke);A.match_length=z-(ke-re),A.match_length>A.lookahead&&(A.match_length=A.lookahead)}if(A.match_length>=P?(K=o._tr_tally(A,1,A.match_length-P),A.lookahead-=A.match_length,A.strstart+=A.match_length,A.match_length=0):(K=o._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++),K&&(R(A,!1),A.strm.avail_out===0))return y}return A.insert=0,$===h?(R(A,!0),A.strm.avail_out===0?ae:V):A.last_lit&&(R(A,!1),A.strm.avail_out===0)?y:U})(w,M):n[w.level].func(w,M);if(j!==ae&&j!==V||(w.status=666),j===y||j===ae)return u.avail_out===0&&(w.last_flush=-1),d;if(j===U&&(M===1?o._tr_align(w):M!==5&&(o._tr_stored_block(w,0,0,!1),M===3&&(oe(w.head),w.lookahead===0&&(w.strstart=0,w.block_start=0,w.insert=0))),D(u),u.avail_out===0))return w.last_flush=-1,d}return M!==h?d:w.wrap<=0?1:(w.wrap===2?(te(w,255&u.adler),te(w,u.adler>>8&255),te(w,u.adler>>16&255),te(w,u.adler>>24&255),te(w,255&u.total_in),te(w,u.total_in>>8&255),te(w,u.total_in>>16&255),te(w,u.total_in>>24&255)):(q(w,u.adler>>>16),q(w,65535&u.adler)),D(u),0<w.wrap&&(w.wrap=-w.wrap),w.pending!==0?d:1)},r.deflateEnd=function(u){var M;return u&&u.state?(M=u.state.status)!==E&&M!==69&&M!==73&&M!==91&&M!==103&&M!==F&&M!==666?le(u,m):(u.state=null,M===F?le(u,-3):d):m},r.deflateSetDictionary=function(u,M){var B,w,_,C,N,j,A,$,K=M.length;if(!u||!u.state||(C=(B=u.state).wrap)===2||C===1&&B.status!==E||B.lookahead)return m;for(C===1&&(u.adler=s(u.adler,M,K,0)),B.wrap=0,K>=B.w_size&&(C===0&&(oe(B.head),B.strstart=0,B.block_start=0,B.insert=0),$=new i.Buf8(B.w_size),i.arraySet($,M,K-B.w_size,B.w_size,0),M=$,K=B.w_size),N=u.avail_in,j=u.next_in,A=u.input,u.avail_in=K,u.next_in=0,u.input=M,Ce(B);B.lookahead>=P;){for(w=B.strstart,_=B.lookahead-(P-1);B.ins_h=(B.ins_h<<B.hash_shift^B.window[w+P-1])&B.hash_mask,B.prev[w&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=w,w++,--_;);B.strstart=w,B.lookahead=P-1,Ce(B)}return B.strstart+=B.lookahead,B.block_start=B.strstart,B.insert=B.lookahead,B.lookahead=0,B.match_length=B.prev_length=P-1,B.match_available=0,u.next_in=j,u.input=A,u.avail_in=N,B.wrap=C,d},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,r){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,r){"use strict";t.exports=function(n,i){var o,s,a,c,l,h,d,m,p,g,f,b,v,k,S,I,x,O,P,z,Z,E,F,y,U;o=n.state,s=n.next_in,y=n.input,a=s+(n.avail_in-5),c=n.next_out,U=n.output,l=c-(i-n.avail_out),h=c+(n.avail_out-257),d=o.dmax,m=o.wsize,p=o.whave,g=o.wnext,f=o.window,b=o.hold,v=o.bits,k=o.lencode,S=o.distcode,I=(1<<o.lenbits)-1,x=(1<<o.distbits)-1;e:do{v<15&&(b+=y[s++]<<v,v+=8,b+=y[s++]<<v,v+=8),O=k[b&I];t:for(;;){if(b>>>=P=O>>>24,v-=P,(P=O>>>16&255)===0)U[c++]=65535&O;else{if(!(16&P)){if((64&P)==0){O=k[(65535&O)+(b&(1<<P)-1)];continue t}if(32&P){o.mode=12;break e}n.msg="invalid literal/length code",o.mode=30;break e}z=65535&O,(P&=15)&&(v<P&&(b+=y[s++]<<v,v+=8),z+=b&(1<<P)-1,b>>>=P,v-=P),v<15&&(b+=y[s++]<<v,v+=8,b+=y[s++]<<v,v+=8),O=S[b&x];r:for(;;){if(b>>>=P=O>>>24,v-=P,!(16&(P=O>>>16&255))){if((64&P)==0){O=S[(65535&O)+(b&(1<<P)-1)];continue r}n.msg="invalid distance code",o.mode=30;break e}if(Z=65535&O,v<(P&=15)&&(b+=y[s++]<<v,(v+=8)<P&&(b+=y[s++]<<v,v+=8)),d<(Z+=b&(1<<P)-1)){n.msg="invalid distance too far back",o.mode=30;break e}if(b>>>=P,v-=P,(P=c-l)<Z){if(p<(P=Z-P)&&o.sane){n.msg="invalid distance too far back",o.mode=30;break e}if(F=f,(E=0)===g){if(E+=m-P,P<z){for(z-=P;U[c++]=f[E++],--P;);E=c-Z,F=U}}else if(g<P){if(E+=m+g-P,(P-=g)<z){for(z-=P;U[c++]=f[E++],--P;);if(E=0,g<z){for(z-=P=g;U[c++]=f[E++],--P;);E=c-Z,F=U}}}else if(E+=g-P,P<z){for(z-=P;U[c++]=f[E++],--P;);E=c-Z,F=U}for(;2<z;)U[c++]=F[E++],U[c++]=F[E++],U[c++]=F[E++],z-=3;z&&(U[c++]=F[E++],1<z&&(U[c++]=F[E++]))}else{for(E=c-Z;U[c++]=U[E++],U[c++]=U[E++],U[c++]=U[E++],2<(z-=3););z&&(U[c++]=U[E++],1<z&&(U[c++]=U[E++]))}break}}break}}while(s<a&&c<h);s-=z=v>>3,b&=(1<<(v-=z<<3))-1,n.next_in=s,n.next_out=c,n.avail_in=s<a?a-s+5:5-(s-a),n.avail_out=c<h?h-c+257:257-(c-h),o.hold=b,o.bits=v}},{}],49:[function(e,t,r){"use strict";var n=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),s=e("./inffast"),a=e("./inftrees"),c=1,l=2,h=0,d=-2,m=1,p=852,g=592;function f(E){return(E>>>24&255)+(E>>>8&65280)+((65280&E)<<8)+((255&E)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(E){var F;return E&&E.state?(F=E.state,E.total_in=E.total_out=F.total=0,E.msg="",F.wrap&&(E.adler=1&F.wrap),F.mode=m,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new n.Buf32(p),F.distcode=F.distdyn=new n.Buf32(g),F.sane=1,F.back=-1,h):d}function k(E){var F;return E&&E.state?((F=E.state).wsize=0,F.whave=0,F.wnext=0,v(E)):d}function S(E,F){var y,U;return E&&E.state?(U=E.state,F<0?(y=0,F=-F):(y=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15<F)?d:(U.window!==null&&U.wbits!==F&&(U.window=null),U.wrap=y,U.wbits=F,k(E))):d}function I(E,F){var y,U;return E?(U=new b,(E.state=U).window=null,(y=S(E,F))!==h&&(E.state=null),y):d}var x,O,P=!0;function z(E){if(P){var F;for(x=new n.Buf32(512),O=new n.Buf32(32),F=0;F<144;)E.lens[F++]=8;for(;F<256;)E.lens[F++]=9;for(;F<280;)E.lens[F++]=7;for(;F<288;)E.lens[F++]=8;for(a(c,E.lens,0,288,x,0,E.work,{bits:9}),F=0;F<32;)E.lens[F++]=5;a(l,E.lens,0,32,O,0,E.work,{bits:5}),P=!1}E.lencode=x,E.lenbits=9,E.distcode=O,E.distbits=5}function Z(E,F,y,U){var ae,V=E.state;return V.window===null&&(V.wsize=1<<V.wbits,V.wnext=0,V.whave=0,V.window=new n.Buf8(V.wsize)),U>=V.wsize?(n.arraySet(V.window,F,y-V.wsize,V.wsize,0),V.wnext=0,V.whave=V.wsize):(U<(ae=V.wsize-V.wnext)&&(ae=U),n.arraySet(V.window,F,y-U,ae,V.wnext),(U-=ae)?(n.arraySet(V.window,F,y-U,U,0),V.wnext=U,V.whave=V.wsize):(V.wnext+=ae,V.wnext===V.wsize&&(V.wnext=0),V.whave<V.wsize&&(V.whave+=ae))),0}r.inflateReset=k,r.inflateReset2=S,r.inflateResetKeep=v,r.inflateInit=function(E){return I(E,15)},r.inflateInit2=I,r.inflate=function(E,F){var y,U,ae,V,le,H,oe,D,R,te,q,G,Ce,Ke,de,ge,Xe,ve,it,ut,u,M,B,w,_=0,C=new n.Buf8(4),N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!E||!E.state||!E.output||!E.input&&E.avail_in!==0)return d;(y=E.state).mode===12&&(y.mode=13),le=E.next_out,ae=E.output,oe=E.avail_out,V=E.next_in,U=E.input,H=E.avail_in,D=y.hold,R=y.bits,te=H,q=oe,M=h;e:for(;;)switch(y.mode){case m:if(y.wrap===0){y.mode=13;break}for(;R<16;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(2&y.wrap&&D===35615){C[y.check=0]=255&D,C[1]=D>>>8&255,y.check=o(y.check,C,2,0),R=D=0,y.mode=2;break}if(y.flags=0,y.head&&(y.head.done=!1),!(1&y.wrap)||(((255&D)<<8)+(D>>8))%31){E.msg="incorrect header check",y.mode=30;break}if((15&D)!=8){E.msg="unknown compression method",y.mode=30;break}if(R-=4,u=8+(15&(D>>>=4)),y.wbits===0)y.wbits=u;else if(u>y.wbits){E.msg="invalid window size",y.mode=30;break}y.dmax=1<<u,E.adler=y.check=1,y.mode=512&D?10:12,R=D=0;break;case 2:for(;R<16;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(y.flags=D,(255&y.flags)!=8){E.msg="unknown compression method",y.mode=30;break}if(57344&y.flags){E.msg="unknown header flags set",y.mode=30;break}y.head&&(y.head.text=D>>8&1),512&y.flags&&(C[0]=255&D,C[1]=D>>>8&255,y.check=o(y.check,C,2,0)),R=D=0,y.mode=3;case 3:for(;R<32;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}y.head&&(y.head.time=D),512&y.flags&&(C[0]=255&D,C[1]=D>>>8&255,C[2]=D>>>16&255,C[3]=D>>>24&255,y.check=o(y.check,C,4,0)),R=D=0,y.mode=4;case 4:for(;R<16;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}y.head&&(y.head.xflags=255&D,y.head.os=D>>8),512&y.flags&&(C[0]=255&D,C[1]=D>>>8&255,y.check=o(y.check,C,2,0)),R=D=0,y.mode=5;case 5:if(1024&y.flags){for(;R<16;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}y.length=D,y.head&&(y.head.extra_len=D),512&y.flags&&(C[0]=255&D,C[1]=D>>>8&255,y.check=o(y.check,C,2,0)),R=D=0}else y.head&&(y.head.extra=null);y.mode=6;case 6:if(1024&y.flags&&(H<(G=y.length)&&(G=H),G&&(y.head&&(u=y.head.extra_len-y.length,y.head.extra||(y.head.extra=new Array(y.head.extra_len)),n.arraySet(y.head.extra,U,V,G,u)),512&y.flags&&(y.check=o(y.check,U,G,V)),H-=G,V+=G,y.length-=G),y.length))break e;y.length=0,y.mode=7;case 7:if(2048&y.flags){if(H===0)break e;for(G=0;u=U[V+G++],y.head&&u&&y.length<65536&&(y.head.name+=String.fromCharCode(u)),u&&G<H;);if(512&y.flags&&(y.check=o(y.check,U,G,V)),H-=G,V+=G,u)break e}else y.head&&(y.head.name=null);y.length=0,y.mode=8;case 8:if(4096&y.flags){if(H===0)break e;for(G=0;u=U[V+G++],y.head&&u&&y.length<65536&&(y.head.comment+=String.fromCharCode(u)),u&&G<H;);if(512&y.flags&&(y.check=o(y.check,U,G,V)),H-=G,V+=G,u)break e}else y.head&&(y.head.comment=null);y.mode=9;case 9:if(512&y.flags){for(;R<16;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(D!==(65535&y.check)){E.msg="header crc mismatch",y.mode=30;break}R=D=0}y.head&&(y.head.hcrc=y.flags>>9&1,y.head.done=!0),E.adler=y.check=0,y.mode=12;break;case 10:for(;R<32;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}E.adler=y.check=f(D),R=D=0,y.mode=11;case 11:if(y.havedict===0)return E.next_out=le,E.avail_out=oe,E.next_in=V,E.avail_in=H,y.hold=D,y.bits=R,2;E.adler=y.check=1,y.mode=12;case 12:if(F===5||F===6)break e;case 13:if(y.last){D>>>=7&R,R-=7&R,y.mode=27;break}for(;R<3;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}switch(y.last=1&D,R-=1,3&(D>>>=1)){case 0:y.mode=14;break;case 1:if(z(y),y.mode=20,F!==6)break;D>>>=2,R-=2;break e;case 2:y.mode=17;break;case 3:E.msg="invalid block type",y.mode=30}D>>>=2,R-=2;break;case 14:for(D>>>=7&R,R-=7&R;R<32;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if((65535&D)!=(D>>>16^65535)){E.msg="invalid stored block lengths",y.mode=30;break}if(y.length=65535&D,R=D=0,y.mode=15,F===6)break e;case 15:y.mode=16;case 16:if(G=y.length){if(H<G&&(G=H),oe<G&&(G=oe),G===0)break e;n.arraySet(ae,U,V,G,le),H-=G,V+=G,oe-=G,le+=G,y.length-=G;break}y.mode=12;break;case 17:for(;R<14;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(y.nlen=257+(31&D),D>>>=5,R-=5,y.ndist=1+(31&D),D>>>=5,R-=5,y.ncode=4+(15&D),D>>>=4,R-=4,286<y.nlen||30<y.ndist){E.msg="too many length or distance symbols",y.mode=30;break}y.have=0,y.mode=18;case 18:for(;y.have<y.ncode;){for(;R<3;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}y.lens[N[y.have++]]=7&D,D>>>=3,R-=3}for(;y.have<19;)y.lens[N[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,B={bits:y.lenbits},M=a(0,y.lens,0,19,y.lencode,0,y.work,B),y.lenbits=B.bits,M){E.msg="invalid code lengths set",y.mode=30;break}y.have=0,y.mode=19;case 19:for(;y.have<y.nlen+y.ndist;){for(;ge=(_=y.lencode[D&(1<<y.lenbits)-1])>>>16&255,Xe=65535&_,!((de=_>>>24)<=R);){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(Xe<16)D>>>=de,R-=de,y.lens[y.have++]=Xe;else{if(Xe===16){for(w=de+2;R<w;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(D>>>=de,R-=de,y.have===0){E.msg="invalid bit length repeat",y.mode=30;break}u=y.lens[y.have-1],G=3+(3&D),D>>>=2,R-=2}else if(Xe===17){for(w=de+3;R<w;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}R-=de,u=0,G=3+(7&(D>>>=de)),D>>>=3,R-=3}else{for(w=de+7;R<w;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}R-=de,u=0,G=11+(127&(D>>>=de)),D>>>=7,R-=7}if(y.have+G>y.nlen+y.ndist){E.msg="invalid bit length repeat",y.mode=30;break}for(;G--;)y.lens[y.have++]=u}}if(y.mode===30)break;if(y.lens[256]===0){E.msg="invalid code -- missing end-of-block",y.mode=30;break}if(y.lenbits=9,B={bits:y.lenbits},M=a(c,y.lens,0,y.nlen,y.lencode,0,y.work,B),y.lenbits=B.bits,M){E.msg="invalid literal/lengths set",y.mode=30;break}if(y.distbits=6,y.distcode=y.distdyn,B={bits:y.distbits},M=a(l,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,B),y.distbits=B.bits,M){E.msg="invalid distances set",y.mode=30;break}if(y.mode=20,F===6)break e;case 20:y.mode=21;case 21:if(6<=H&&258<=oe){E.next_out=le,E.avail_out=oe,E.next_in=V,E.avail_in=H,y.hold=D,y.bits=R,s(E,q),le=E.next_out,ae=E.output,oe=E.avail_out,V=E.next_in,U=E.input,H=E.avail_in,D=y.hold,R=y.bits,y.mode===12&&(y.back=-1);break}for(y.back=0;ge=(_=y.lencode[D&(1<<y.lenbits)-1])>>>16&255,Xe=65535&_,!((de=_>>>24)<=R);){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(ge&&(240&ge)==0){for(ve=de,it=ge,ut=Xe;ge=(_=y.lencode[ut+((D&(1<<ve+it)-1)>>ve)])>>>16&255,Xe=65535&_,!(ve+(de=_>>>24)<=R);){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}D>>>=ve,R-=ve,y.back+=ve}if(D>>>=de,R-=de,y.back+=de,y.length=Xe,ge===0){y.mode=26;break}if(32&ge){y.back=-1,y.mode=12;break}if(64&ge){E.msg="invalid literal/length code",y.mode=30;break}y.extra=15&ge,y.mode=22;case 22:if(y.extra){for(w=y.extra;R<w;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}y.length+=D&(1<<y.extra)-1,D>>>=y.extra,R-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=23;case 23:for(;ge=(_=y.distcode[D&(1<<y.distbits)-1])>>>16&255,Xe=65535&_,!((de=_>>>24)<=R);){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if((240&ge)==0){for(ve=de,it=ge,ut=Xe;ge=(_=y.distcode[ut+((D&(1<<ve+it)-1)>>ve)])>>>16&255,Xe=65535&_,!(ve+(de=_>>>24)<=R);){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}D>>>=ve,R-=ve,y.back+=ve}if(D>>>=de,R-=de,y.back+=de,64&ge){E.msg="invalid distance code",y.mode=30;break}y.offset=Xe,y.extra=15&ge,y.mode=24;case 24:if(y.extra){for(w=y.extra;R<w;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}y.offset+=D&(1<<y.extra)-1,D>>>=y.extra,R-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){E.msg="invalid distance too far back",y.mode=30;break}y.mode=25;case 25:if(oe===0)break e;if(G=q-oe,y.offset>G){if((G=y.offset-G)>y.whave&&y.sane){E.msg="invalid distance too far back",y.mode=30;break}Ce=G>y.wnext?(G-=y.wnext,y.wsize-G):y.wnext-G,G>y.length&&(G=y.length),Ke=y.window}else Ke=ae,Ce=le-y.offset,G=y.length;for(oe<G&&(G=oe),oe-=G,y.length-=G;ae[le++]=Ke[Ce++],--G;);y.length===0&&(y.mode=21);break;case 26:if(oe===0)break e;ae[le++]=y.length,oe--,y.mode=21;break;case 27:if(y.wrap){for(;R<32;){if(H===0)break e;H--,D|=U[V++]<<R,R+=8}if(q-=oe,E.total_out+=q,y.total+=q,q&&(E.adler=y.check=y.flags?o(y.check,ae,q,le-q):i(y.check,ae,q,le-q)),q=oe,(y.flags?D:f(D))!==y.check){E.msg="incorrect data check",y.mode=30;break}R=D=0}y.mode=28;case 28:if(y.wrap&&y.flags){for(;R<32;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(D!==(4294967295&y.total)){E.msg="incorrect length check",y.mode=30;break}R=D=0}y.mode=29;case 29:M=1;break e;case 30:M=-3;break e;case 31:return-4;case 32:default:return d}return E.next_out=le,E.avail_out=oe,E.next_in=V,E.avail_in=H,y.hold=D,y.bits=R,(y.wsize||q!==E.avail_out&&y.mode<30&&(y.mode<27||F!==4))&&Z(E,E.output,E.next_out,q-E.avail_out)?(y.mode=31,-4):(te-=E.avail_in,q-=E.avail_out,E.total_in+=te,E.total_out+=q,y.total+=q,y.wrap&&q&&(E.adler=y.check=y.flags?o(y.check,ae,q,E.next_out-q):i(y.check,ae,q,E.next_out-q)),E.data_type=y.bits+(y.last?64:0)+(y.mode===12?128:0)+(y.mode===20||y.mode===15?256:0),(te==0&&q===0||F===4)&&M===h&&(M=-5),M)},r.inflateEnd=function(E){if(!E||!E.state)return d;var F=E.state;return F.window&&(F.window=null),E.state=null,h},r.inflateGetHeader=function(E,F){var y;return E&&E.state?(2&(y=E.state).wrap)==0?d:((y.head=F).done=!1,h):d},r.inflateSetDictionary=function(E,F){var y,U=F.length;return E&&E.state?(y=E.state).wrap!==0&&y.mode!==11?d:y.mode===11&&i(1,F,U,0)!==y.check?-3:Z(E,F,U,U)?(y.mode=31,-4):(y.havedict=1,h):d},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,r){"use strict";var n=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(c,l,h,d,m,p,g,f){var b,v,k,S,I,x,O,P,z,Z=f.bits,E=0,F=0,y=0,U=0,ae=0,V=0,le=0,H=0,oe=0,D=0,R=null,te=0,q=new n.Buf16(16),G=new n.Buf16(16),Ce=null,Ke=0;for(E=0;E<=15;E++)q[E]=0;for(F=0;F<d;F++)q[l[h+F]]++;for(ae=Z,U=15;1<=U&&q[U]===0;U--);if(U<ae&&(ae=U),U===0)return m[p++]=20971520,m[p++]=20971520,f.bits=1,0;for(y=1;y<U&&q[y]===0;y++);for(ae<y&&(ae=y),E=H=1;E<=15;E++)if(H<<=1,(H-=q[E])<0)return-1;if(0<H&&(c===0||U!==1))return-1;for(G[1]=0,E=1;E<15;E++)G[E+1]=G[E]+q[E];for(F=0;F<d;F++)l[h+F]!==0&&(g[G[l[h+F]]++]=F);if(x=c===0?(R=Ce=g,19):c===1?(R=i,te-=257,Ce=o,Ke-=257,256):(R=s,Ce=a,-1),E=y,I=p,le=F=D=0,k=-1,S=(oe=1<<(V=ae))-1,c===1&&852<oe||c===2&&592<oe)return 1;for(;;){for(O=E-le,z=g[F]<x?(P=0,g[F]):g[F]>x?(P=Ce[Ke+g[F]],R[te+g[F]]):(P=96,0),b=1<<E-le,y=v=1<<V;m[I+(D>>le)+(v-=b)]=O<<24|P<<16|z|0,v!==0;);for(b=1<<E-1;D&b;)b>>=1;if(b!==0?(D&=b-1,D+=b):D=0,F++,--q[E]==0){if(E===U)break;E=l[h+g[F]]}if(ae<E&&(D&S)!==k){for(le===0&&(le=ae),I+=y,H=1<<(V=E-le);V+le<U&&!((H-=q[V+le])<=0);)V++,H<<=1;if(oe+=1<<V,c===1&&852<oe||c===2&&592<oe)return 1;m[k=D&S]=ae<<24|V<<16|I-p|0}}return D!==0&&(m[I+D]=E-le<<24|64<<16|0),f.bits=ae,0}},{"../utils/common":41}],51:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,r){"use strict";var n=e("../utils/common"),i=0,o=1;function s(_){for(var C=_.length;0<=--C;)_[C]=0}var a=0,c=29,l=256,h=l+1+c,d=30,m=19,p=2*h+1,g=15,f=16,b=7,v=256,k=16,S=17,I=18,x=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],O=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Z=new Array(2*(h+2));s(Z);var E=new Array(2*d);s(E);var F=new Array(512);s(F);var y=new Array(256);s(y);var U=new Array(c);s(U);var ae,V,le,H=new Array(d);function oe(_,C,N,j,A){this.static_tree=_,this.extra_bits=C,this.extra_base=N,this.elems=j,this.max_length=A,this.has_stree=_&&_.length}function D(_,C){this.dyn_tree=_,this.max_code=0,this.stat_desc=C}function R(_){return _<256?F[_]:F[256+(_>>>7)]}function te(_,C){_.pending_buf[_.pending++]=255&C,_.pending_buf[_.pending++]=C>>>8&255}function q(_,C,N){_.bi_valid>f-N?(_.bi_buf|=C<<_.bi_valid&65535,te(_,_.bi_buf),_.bi_buf=C>>f-_.bi_valid,_.bi_valid+=N-f):(_.bi_buf|=C<<_.bi_valid&65535,_.bi_valid+=N)}function G(_,C,N){q(_,N[2*C],N[2*C+1])}function Ce(_,C){for(var N=0;N|=1&_,_>>>=1,N<<=1,0<--C;);return N>>>1}function Ke(_,C,N){var j,A,$=new Array(g+1),K=0;for(j=1;j<=g;j++)$[j]=K=K+N[j-1]<<1;for(A=0;A<=C;A++){var W=_[2*A+1];W!==0&&(_[2*A]=Ce($[W]++,W))}}function de(_){var C;for(C=0;C<h;C++)_.dyn_ltree[2*C]=0;for(C=0;C<d;C++)_.dyn_dtree[2*C]=0;for(C=0;C<m;C++)_.bl_tree[2*C]=0;_.dyn_ltree[2*v]=1,_.opt_len=_.static_len=0,_.last_lit=_.matches=0}function ge(_){8<_.bi_valid?te(_,_.bi_buf):0<_.bi_valid&&(_.pending_buf[_.pending++]=_.bi_buf),_.bi_buf=0,_.bi_valid=0}function Xe(_,C,N,j){var A=2*C,$=2*N;return _[A]<_[$]||_[A]===_[$]&&j[C]<=j[N]}function ve(_,C,N){for(var j=_.heap[N],A=N<<1;A<=_.heap_len&&(A<_.heap_len&&Xe(C,_.heap[A+1],_.heap[A],_.depth)&&A++,!Xe(C,j,_.heap[A],_.depth));)_.heap[N]=_.heap[A],N=A,A<<=1;_.heap[N]=j}function it(_,C,N){var j,A,$,K,W=0;if(_.last_lit!==0)for(;j=_.pending_buf[_.d_buf+2*W]<<8|_.pending_buf[_.d_buf+2*W+1],A=_.pending_buf[_.l_buf+W],W++,j===0?G(_,A,C):(G(_,($=y[A])+l+1,C),(K=x[$])!==0&&q(_,A-=U[$],K),G(_,$=R(--j),N),(K=O[$])!==0&&q(_,j-=H[$],K)),W<_.last_lit;);G(_,v,C)}function ut(_,C){var N,j,A,$=C.dyn_tree,K=C.stat_desc.static_tree,W=C.stat_desc.has_stree,re=C.stat_desc.elems,ke=-1;for(_.heap_len=0,_.heap_max=p,N=0;N<re;N++)$[2*N]!==0?(_.heap[++_.heap_len]=ke=N,_.depth[N]=0):$[2*N+1]=0;for(;_.heap_len<2;)$[2*(A=_.heap[++_.heap_len]=ke<2?++ke:0)]=1,_.depth[A]=0,_.opt_len--,W&&(_.static_len-=K[2*A+1]);for(C.max_code=ke,N=_.heap_len>>1;1<=N;N--)ve(_,$,N);for(A=re;N=_.heap[1],_.heap[1]=_.heap[_.heap_len--],ve(_,$,1),j=_.heap[1],_.heap[--_.heap_max]=N,_.heap[--_.heap_max]=j,$[2*A]=$[2*N]+$[2*j],_.depth[A]=(_.depth[N]>=_.depth[j]?_.depth[N]:_.depth[j])+1,$[2*N+1]=$[2*j+1]=A,_.heap[1]=A++,ve(_,$,1),2<=_.heap_len;);_.heap[--_.heap_max]=_.heap[1],(function(ue,kt){var qt,Kt,Ar,Ie,Pn,oi,gt=kt.dyn_tree,ys=kt.max_code,Dn=kt.stat_desc.static_tree,ll=kt.stat_desc.has_stree,On=kt.stat_desc.extra_bits,bs=kt.stat_desc.extra_base,zr=kt.stat_desc.max_length,si=0;for(Ie=0;Ie<=g;Ie++)ue.bl_count[Ie]=0;for(gt[2*ue.heap[ue.heap_max]+1]=0,qt=ue.heap_max+1;qt<p;qt++)zr<(Ie=gt[2*gt[2*(Kt=ue.heap[qt])+1]+1]+1)&&(Ie=zr,si++),gt[2*Kt+1]=Ie,ys<Kt||(ue.bl_count[Ie]++,Pn=0,bs<=Kt&&(Pn=On[Kt-bs]),oi=gt[2*Kt],ue.opt_len+=oi*(Ie+Pn),ll&&(ue.static_len+=oi*(Dn[2*Kt+1]+Pn)));if(si!==0){do{for(Ie=zr-1;ue.bl_count[Ie]===0;)Ie--;ue.bl_count[Ie]--,ue.bl_count[Ie+1]+=2,ue.bl_count[zr]--,si-=2}while(0<si);for(Ie=zr;Ie!==0;Ie--)for(Kt=ue.bl_count[Ie];Kt!==0;)ys<(Ar=ue.heap[--qt])||(gt[2*Ar+1]!==Ie&&(ue.opt_len+=(Ie-gt[2*Ar+1])*gt[2*Ar],gt[2*Ar+1]=Ie),Kt--)}})(_,C),Ke($,ke,_.bl_count)}function u(_,C,N){var j,A,$=-1,K=C[1],W=0,re=7,ke=4;for(K===0&&(re=138,ke=3),C[2*(N+1)+1]=65535,j=0;j<=N;j++)A=K,K=C[2*(j+1)+1],++W<re&&A===K||(W<ke?_.bl_tree[2*A]+=W:A!==0?(A!==$&&_.bl_tree[2*A]++,_.bl_tree[2*k]++):W<=10?_.bl_tree[2*S]++:_.bl_tree[2*I]++,$=A,ke=(W=0)===K?(re=138,3):A===K?(re=6,3):(re=7,4))}function M(_,C,N){var j,A,$=-1,K=C[1],W=0,re=7,ke=4;for(K===0&&(re=138,ke=3),j=0;j<=N;j++)if(A=K,K=C[2*(j+1)+1],!(++W<re&&A===K)){if(W<ke)for(;G(_,A,_.bl_tree),--W!=0;);else A!==0?(A!==$&&(G(_,A,_.bl_tree),W--),G(_,k,_.bl_tree),q(_,W-3,2)):W<=10?(G(_,S,_.bl_tree),q(_,W-3,3)):(G(_,I,_.bl_tree),q(_,W-11,7));$=A,ke=(W=0)===K?(re=138,3):A===K?(re=6,3):(re=7,4)}}s(H);var B=!1;function w(_,C,N,j){q(_,(a<<1)+(j?1:0),3),(function(A,$,K,W){ge(A),W&&(te(A,K),te(A,~K)),n.arraySet(A.pending_buf,A.window,$,K,A.pending),A.pending+=K})(_,C,N,!0)}r._tr_init=function(_){B||((function(){var C,N,j,A,$,K=new Array(g+1);for(A=j=0;A<c-1;A++)for(U[A]=j,C=0;C<1<<x[A];C++)y[j++]=A;for(y[j-1]=A,A=$=0;A<16;A++)for(H[A]=$,C=0;C<1<<O[A];C++)F[$++]=A;for($>>=7;A<d;A++)for(H[A]=$<<7,C=0;C<1<<O[A]-7;C++)F[256+$++]=A;for(N=0;N<=g;N++)K[N]=0;for(C=0;C<=143;)Z[2*C+1]=8,C++,K[8]++;for(;C<=255;)Z[2*C+1]=9,C++,K[9]++;for(;C<=279;)Z[2*C+1]=7,C++,K[7]++;for(;C<=287;)Z[2*C+1]=8,C++,K[8]++;for(Ke(Z,h+1,K),C=0;C<d;C++)E[2*C+1]=5,E[2*C]=Ce(C,5);ae=new oe(Z,x,l+1,h,g),V=new oe(E,O,0,d,g),le=new oe(new Array(0),P,0,m,b)})(),B=!0),_.l_desc=new D(_.dyn_ltree,ae),_.d_desc=new D(_.dyn_dtree,V),_.bl_desc=new D(_.bl_tree,le),_.bi_buf=0,_.bi_valid=0,de(_)},r._tr_stored_block=w,r._tr_flush_block=function(_,C,N,j){var A,$,K=0;0<_.level?(_.strm.data_type===2&&(_.strm.data_type=(function(W){var re,ke=4093624447;for(re=0;re<=31;re++,ke>>>=1)if(1&ke&&W.dyn_ltree[2*re]!==0)return i;if(W.dyn_ltree[18]!==0||W.dyn_ltree[20]!==0||W.dyn_ltree[26]!==0)return o;for(re=32;re<l;re++)if(W.dyn_ltree[2*re]!==0)return o;return i})(_)),ut(_,_.l_desc),ut(_,_.d_desc),K=(function(W){var re;for(u(W,W.dyn_ltree,W.l_desc.max_code),u(W,W.dyn_dtree,W.d_desc.max_code),ut(W,W.bl_desc),re=m-1;3<=re&&W.bl_tree[2*z[re]+1]===0;re--);return W.opt_len+=3*(re+1)+5+5+4,re})(_),A=_.opt_len+3+7>>>3,($=_.static_len+3+7>>>3)<=A&&(A=$)):A=$=N+5,N+4<=A&&C!==-1?w(_,C,N,j):_.strategy===4||$===A?(q(_,2+(j?1:0),3),it(_,Z,E)):(q(_,4+(j?1:0),3),(function(W,re,ke,ue){var kt;for(q(W,re-257,5),q(W,ke-1,5),q(W,ue-4,4),kt=0;kt<ue;kt++)q(W,W.bl_tree[2*z[kt]+1],3);M(W,W.dyn_ltree,re-1),M(W,W.dyn_dtree,ke-1)})(_,_.l_desc.max_code+1,_.d_desc.max_code+1,K+1),it(_,_.dyn_ltree,_.dyn_dtree)),de(_),j&&ge(_)},r._tr_tally=function(_,C,N){return _.pending_buf[_.d_buf+2*_.last_lit]=C>>>8&255,_.pending_buf[_.d_buf+2*_.last_lit+1]=255&C,_.pending_buf[_.l_buf+_.last_lit]=255&N,_.last_lit++,C===0?_.dyn_ltree[2*N]++:(_.matches++,C--,_.dyn_ltree[2*(y[N]+l+1)]++,_.dyn_dtree[2*R(C)]++),_.last_lit===_.lit_bufsize-1},r._tr_align=function(_){q(_,2,3),G(_,v,Z),(function(C){C.bi_valid===16?(te(C,C.bi_buf),C.bi_buf=0,C.bi_valid=0):8<=C.bi_valid&&(C.pending_buf[C.pending++]=255&C.bi_buf,C.bi_buf>>=8,C.bi_valid-=8)})(_)}},{"../utils/common":41}],53:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){(function(n){(function(i,o){"use strict";if(!i.setImmediate){var s,a,c,l,h=1,d={},m=!1,p=i.document,g=Object.getPrototypeOf&&Object.getPrototypeOf(i);g=g&&g.setTimeout?g:i,s={}.toString.call(i.process)==="[object process]"?function(k){process.nextTick(function(){b(k)})}:(function(){if(i.postMessage&&!i.importScripts){var k=!0,S=i.onmessage;return i.onmessage=function(){k=!1},i.postMessage("","*"),i.onmessage=S,k}})()?(l="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",v,!1):i.attachEvent("onmessage",v),function(k){i.postMessage(l+k,"*")}):i.MessageChannel?((c=new MessageChannel).port1.onmessage=function(k){b(k.data)},function(k){c.port2.postMessage(k)}):p&&"onreadystatechange"in p.createElement("script")?(a=p.documentElement,function(k){var S=p.createElement("script");S.onreadystatechange=function(){b(k),S.onreadystatechange=null,a.removeChild(S),S=null},a.appendChild(S)}):function(k){setTimeout(b,0,k)},g.setImmediate=function(k){typeof k!="function"&&(k=new Function(""+k));for(var S=new Array(arguments.length-1),I=0;I<S.length;I++)S[I]=arguments[I+1];var x={callback:k,args:S};return d[h]=x,s(h),h++},g.clearImmediate=f}function f(k){delete d[k]}function b(k){if(m)setTimeout(b,0,k);else{var S=d[k];if(S){m=!0;try{(function(I){var x=I.callback,O=I.args;switch(O.length){case 0:x();break;case 1:x(O[0]);break;case 2:x(O[0],O[1]);break;case 3:x(O[0],O[1],O[2]);break;default:x.apply(o,O)}})(S)}finally{f(k),m=!1}}}}function v(k){k.source===i&&typeof k.data=="string"&&k.data.indexOf(l)===0&&b(+k.data.slice(l.length))}})(typeof self>"u"?n===void 0?this:n:self)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})});var s0=_e((Sd,kd)=>{(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof Sd<"u"?t():(t(),e.FileSaver={})})(Sd,function(){"use strict";function e(a,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function t(a,c,l){var h=new XMLHttpRequest;h.open("GET",a),h.responseType="blob",h.onload=function(){s(h.response,c,l)},h.onerror=function(){console.error("could not download file")},h.send()}function r(a){var c=new XMLHttpRequest;c.open("HEAD",a,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function n(a){try{a.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(c)}}var i=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,o=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=i.saveAs||(typeof window!="object"||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(a,c,l){var h=i.URL||i.webkitURL,d=document.createElement("a");c=c||a.name||"download",d.download=c,d.rel="noopener",typeof a=="string"?(d.href=a,d.origin===location.origin?n(d):r(d.href)?t(a,c,l):n(d,d.target="_blank")):(d.href=h.createObjectURL(a),setTimeout(function(){h.revokeObjectURL(d.href)},4e4),setTimeout(function(){n(d)},0))}:"msSaveOrOpenBlob"in navigator?function(a,c,l){if(c=c||a.name||"download",typeof a!="string")navigator.msSaveOrOpenBlob(e(a,l),c);else if(r(a))t(a,c,l);else{var h=document.createElement("a");h.href=a,h.target="_blank",setTimeout(function(){n(h)})}}:function(a,c,l,h){if(h=h||open("","_blank"),h&&(h.document.title=h.document.body.innerText="downloading..."),typeof a=="string")return t(a,c,l);var d=a.type==="application/octet-stream",m=/constructor/i.test(i.HTMLElement)||i.safari,p=/CriOS\/[\d]+/.test(navigator.userAgent);if((p||d&&m||o)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var v=g.result;v=p?v:v.replace(/^data:[^;]*;/,"data:attachment/file;"),h?h.location.href=v:location=v,h=null},g.readAsDataURL(a)}else{var f=i.URL||i.webkitURL,b=f.createObjectURL(a);h?h.location=b:location.href=b,h=null,setTimeout(function(){f.revokeObjectURL(b)},4e4)}});i.saveAs=s.saveAs=s,typeof kd<"u"&&(kd.exports=s)})});var v2=_e((r8,b2)=>{b2.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var An=_e(ti=>{var Au,I3=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];ti.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};ti.getSymbolTotalCodewords=function(t){return I3[t]};ti.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};ti.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');Au=t};ti.isKanjiModeEnabled=function(){return typeof Au<"u"};ti.toSJIS=function(t){return Au(t)}});var Xc=_e(hr=>{hr.L={bit:1};hr.M={bit:0};hr.Q={bit:3};hr.H={bit:2};function R3(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return hr.L;case"m":case"medium":return hr.M;case"q":case"quartile":return hr.Q;case"h":case"high":return hr.H;default:throw new Error("Unknown EC Level: "+e)}}hr.isValid=function(t){return t&&typeof t.bit<"u"&&t.bit>=0&&t.bit<4};hr.from=function(t,r){if(hr.isValid(t))return t;try{return R3(t)}catch{return r}}});var S2=_e((o8,w2)=>{function _2(){this.buffer=[],this.length=0}_2.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let r=0;r<t;r++)this.putBit((e>>>t-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};w2.exports=_2});var E2=_e((s8,k2)=>{function cs(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}cs.prototype.set=function(e,t,r,n){let i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)};cs.prototype.get=function(e,t){return this.data[e*this.size+t]};cs.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r};cs.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};k2.exports=cs});var C2=_e(Jc=>{var P3=An().getSymbolSize;Jc.getRowColCoords=function(t){if(t===1)return[];let r=Math.floor(t/7)+2,n=P3(t),i=n===145?26:Math.ceil((n-13)/(2*r-2))*2,o=[n-7];for(let s=1;s<r-1;s++)o[s]=o[s-1]-i;return o.push(6),o.reverse()};Jc.getPositions=function(t){let r=[],n=Jc.getRowColCoords(t),i=n.length;for(let o=0;o<i;o++)for(let s=0;s<i;s++)o===0&&s===0||o===0&&s===i-1||o===i-1&&s===0||r.push([n[o],n[s]]);return r}});var T2=_e(A2=>{var D3=An().getSymbolSize,x2=7;A2.getPositions=function(t){let r=D3(t);return[[0,0],[r-x2,0],[0,r-x2]]}});var I2=_e(Oe=>{Oe.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var ri={N1:3,N2:3,N3:40,N4:10};Oe.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7};Oe.from=function(t){return Oe.isValid(t)?parseInt(t,10):void 0};Oe.getPenaltyN1=function(t){let r=t.size,n=0,i=0,o=0,s=null,a=null;for(let c=0;c<r;c++){i=o=0,s=a=null;for(let l=0;l<r;l++){let h=t.get(c,l);h===s?i++:(i>=5&&(n+=ri.N1+(i-5)),s=h,i=1),h=t.get(l,c),h===a?o++:(o>=5&&(n+=ri.N1+(o-5)),a=h,o=1)}i>=5&&(n+=ri.N1+(i-5)),o>=5&&(n+=ri.N1+(o-5))}return n};Oe.getPenaltyN2=function(t){let r=t.size,n=0;for(let i=0;i<r-1;i++)for(let o=0;o<r-1;o++){let s=t.get(i,o)+t.get(i,o+1)+t.get(i+1,o)+t.get(i+1,o+1);(s===4||s===0)&&n++}return n*ri.N2};Oe.getPenaltyN3=function(t){let r=t.size,n=0,i=0,o=0;for(let s=0;s<r;s++){i=o=0;for(let a=0;a<r;a++)i=i<<1&2047|t.get(s,a),a>=10&&(i===1488||i===93)&&n++,o=o<<1&2047|t.get(a,s),a>=10&&(o===1488||o===93)&&n++}return n*ri.N3};Oe.getPenaltyN4=function(t){let r=0,n=t.data.length;for(let o=0;o<n;o++)r+=t.data[o];return Math.abs(Math.ceil(r*100/n/5)-10)*ri.N4};function O3(e,t,r){switch(e){case Oe.Patterns.PATTERN000:return(t+r)%2===0;case Oe.Patterns.PATTERN001:return t%2===0;case Oe.Patterns.PATTERN010:return r%3===0;case Oe.Patterns.PATTERN011:return(t+r)%3===0;case Oe.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2===0;case Oe.Patterns.PATTERN101:return t*r%2+t*r%3===0;case Oe.Patterns.PATTERN110:return(t*r%2+t*r%3)%2===0;case Oe.Patterns.PATTERN111:return(t*r%3+(t+r)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}Oe.applyMask=function(t,r){let n=r.size;for(let i=0;i<n;i++)for(let o=0;o<n;o++)r.isReserved(o,i)||r.xor(o,i,O3(t,o,i))};Oe.getBestMask=function(t,r){let n=Object.keys(Oe.Patterns).length,i=0,o=1/0;for(let s=0;s<n;s++){r(s),Oe.applyMask(s,t);let a=Oe.getPenaltyN1(t)+Oe.getPenaltyN2(t)+Oe.getPenaltyN3(t)+Oe.getPenaltyN4(t);Oe.applyMask(s,t),a<o&&(o=a,i=s)}return i}});var Iu=_e(Tu=>{var Tn=Xc(),Yc=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Zc=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Tu.getBlocksCount=function(t,r){switch(r){case Tn.L:return Yc[(t-1)*4+0];case Tn.M:return Yc[(t-1)*4+1];case Tn.Q:return Yc[(t-1)*4+2];case Tn.H:return Yc[(t-1)*4+3];default:return}};Tu.getTotalCodewordsCount=function(t,r){switch(r){case Tn.L:return Zc[(t-1)*4+0];case Tn.M:return Zc[(t-1)*4+1];case Tn.Q:return Zc[(t-1)*4+2];case Tn.H:return Zc[(t-1)*4+3];default:return}}});var R2=_e(el=>{var ls=new Uint8Array(512),Qc=new Uint8Array(256);(function(){let t=1;for(let r=0;r<255;r++)ls[r]=t,Qc[t]=r,t<<=1,t&256&&(t^=285);for(let r=255;r<512;r++)ls[r]=ls[r-255]})();el.log=function(t){if(t<1)throw new Error("log("+t+")");return Qc[t]};el.exp=function(t){return ls[t]};el.mul=function(t,r){return t===0||r===0?0:ls[Qc[t]+Qc[r]]}});var P2=_e(hs=>{var Ru=R2();hs.mul=function(t,r){let n=new Uint8Array(t.length+r.length-1);for(let i=0;i<t.length;i++)for(let o=0;o<r.length;o++)n[i+o]^=Ru.mul(t[i],r[o]);return n};hs.mod=function(t,r){let n=new Uint8Array(t);for(;n.length-r.length>=0;){let i=n[0];for(let s=0;s<r.length;s++)n[s]^=Ru.mul(r[s],i);let o=0;for(;o<n.length&&n[o]===0;)o++;n=n.slice(o)}return n};hs.generateECPolynomial=function(t){let r=new Uint8Array([1]);for(let n=0;n<t;n++)r=hs.mul(r,new Uint8Array([1,Ru.exp(n)]));return r}});var B2=_e((f8,O2)=>{var D2=P2();function Pu(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}Pu.prototype.initialize=function(t){this.degree=t,this.genPoly=D2.generateECPolynomial(this.degree)};Pu.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");let r=new Uint8Array(t.length+this.degree);r.set(t);let n=D2.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){let o=new Uint8Array(this.degree);return o.set(n,i),o}return n};O2.exports=Pu});var Du=_e(L2=>{L2.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}});var Ou=_e(en=>{var F2="[0-9]+",B3="[A-Z $%*+\\-./:]+",ds="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ds=ds.replace(/u/g,"\\u");var L3="(?:(?![A-Z0-9 $%*+\\-./:]|"+ds+`)(?:.|[\r
3
- ]))+`;en.KANJI=new RegExp(ds,"g");en.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");en.BYTE=new RegExp(L3,"g");en.NUMERIC=new RegExp(F2,"g");en.ALPHANUMERIC=new RegExp(B3,"g");var F3=new RegExp("^"+ds+"$"),M3=new RegExp("^"+F2+"$"),U3=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");en.testKanji=function(t){return F3.test(t)};en.testNumeric=function(t){return M3.test(t)};en.testAlphanumeric=function(t){return U3.test(t)}});var In=_e(nt=>{var N3=Du(),Bu=Ou();nt.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};nt.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};nt.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};nt.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};nt.MIXED={bit:-1};nt.getCharCountIndicator=function(t,r){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!N3.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?t.ccBits[0]:r<27?t.ccBits[1]:t.ccBits[2]};nt.getBestModeForData=function(t){return Bu.testNumeric(t)?nt.NUMERIC:Bu.testAlphanumeric(t)?nt.ALPHANUMERIC:Bu.testKanji(t)?nt.KANJI:nt.BYTE};nt.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")};nt.isValid=function(t){return t&&t.bit&&t.ccBits};function z3(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return nt.NUMERIC;case"alphanumeric":return nt.ALPHANUMERIC;case"kanji":return nt.KANJI;case"byte":return nt.BYTE;default:throw new Error("Unknown mode: "+e)}}nt.from=function(t,r){if(nt.isValid(t))return t;try{return z3(t)}catch{return r}}});var j2=_e(ni=>{var tl=An(),j3=Iu(),M2=Xc(),Rn=In(),Lu=Du(),N2=7973,U2=tl.getBCHDigit(N2);function V3(e,t,r){for(let n=1;n<=40;n++)if(t<=ni.getCapacity(n,r,e))return n}function z2(e,t){return Rn.getCharCountIndicator(e,t)+4}function H3(e,t){let r=0;return e.forEach(function(n){let i=z2(n.mode,t);r+=i+n.getBitsLength()}),r}function W3(e,t){for(let r=1;r<=40;r++)if(H3(e,r)<=ni.getCapacity(r,t,Rn.MIXED))return r}ni.from=function(t,r){return Lu.isValid(t)?parseInt(t,10):r};ni.getCapacity=function(t,r,n){if(!Lu.isValid(t))throw new Error("Invalid QR Code version");typeof n>"u"&&(n=Rn.BYTE);let i=tl.getSymbolTotalCodewords(t),o=j3.getTotalCodewordsCount(t,r),s=(i-o)*8;if(n===Rn.MIXED)return s;let a=s-z2(n,t);switch(n){case Rn.NUMERIC:return Math.floor(a/10*3);case Rn.ALPHANUMERIC:return Math.floor(a/11*2);case Rn.KANJI:return Math.floor(a/13);case Rn.BYTE:default:return Math.floor(a/8)}};ni.getBestVersionForData=function(t,r){let n,i=M2.from(r,M2.M);if(Array.isArray(t)){if(t.length>1)return W3(t,i);if(t.length===0)return 1;n=t[0]}else n=t;return V3(n.mode,n.getLength(),i)};ni.getEncodedBits=function(t){if(!Lu.isValid(t)||t<7)throw new Error("Invalid QR Code version");let r=t<<12;for(;tl.getBCHDigit(r)-U2>=0;)r^=N2<<tl.getBCHDigit(r)-U2;return t<<12|r}});var $2=_e(W2=>{var Fu=An(),H2=1335,$3=21522,V2=Fu.getBCHDigit(H2);W2.getEncodedBits=function(t,r){let n=t.bit<<3|r,i=n<<10;for(;Fu.getBCHDigit(i)-V2>=0;)i^=H2<<Fu.getBCHDigit(i)-V2;return(n<<10|i)^$3}});var q2=_e((v8,G2)=>{var G3=In();function oo(e){this.mode=G3.NUMERIC,this.data=e.toString()}oo.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};oo.prototype.getLength=function(){return this.data.length};oo.prototype.getBitsLength=function(){return oo.getBitsLength(this.data.length)};oo.prototype.write=function(t){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),t.put(i,10);let o=this.data.length-r;o>0&&(n=this.data.substr(r),i=parseInt(n,10),t.put(i,o*3+1))};G2.exports=oo});var X2=_e((_8,K2)=>{var q3=In(),Mu=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function so(e){this.mode=q3.ALPHANUMERIC,this.data=e}so.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};so.prototype.getLength=function(){return this.data.length};so.prototype.getBitsLength=function(){return so.getBitsLength(this.data.length)};so.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let n=Mu.indexOf(this.data[r])*45;n+=Mu.indexOf(this.data[r+1]),t.put(n,11)}this.data.length%2&&t.put(Mu.indexOf(this.data[r]),6)};K2.exports=so});var Y2=_e((w8,J2)=>{var K3=In();function ao(e){this.mode=K3.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}ao.getBitsLength=function(t){return t*8};ao.prototype.getLength=function(){return this.data.length};ao.prototype.getBitsLength=function(){return ao.getBitsLength(this.data.length)};ao.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)};J2.exports=ao});var Q2=_e((S8,Z2)=>{var X3=In(),J3=An();function co(e){this.mode=X3.KANJI,this.data=e}co.getBitsLength=function(t){return t*13};co.prototype.getLength=function(){return this.data.length};co.prototype.getBitsLength=function(){return co.getBitsLength(this.data.length)};co.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=J3.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
2
+ \0`,q+=n(D,2),q+=I.magic,q+=n(v,2),q+=n(k,2),q+=n(oe.crc32,4),q+=n(oe.compressedSize,4),q+=n(oe.uncompressedSize,4),q+=n(O.length,2),q+=n(U.length,2),{fileRecord:l.LOCAL_FILE_HEADER+q+O+U,dirRecord:l.CENTRAL_FILE_HEADER+n(te,2)+q+n(Z.length,2)+"\0\0\0\0"+n(R,4)+n(g,4)+O+U+Z}}var o=e("../utils"),s=e("../stream/GenericWorker"),a=e("../utf8"),c=e("../crc32"),l=e("../signature");function h(d,m,p,g){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=m,this.zipPlatform=p,this.encodeFileName=g,this.streamFiles=d,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(h,s),h.prototype.push=function(d){var m=d.meta.percent||0,p=this.entriesCount,g=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,s.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:p?(m+100*(p-g-1))/p:100}}))},h.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var m=this.streamFiles&&!d.file.dir;if(m){var p=i(d,m,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:p.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(d){this.accumulate=!1;var m=this.streamFiles&&!d.file.dir,p=i(d,m,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(p.dirRecord),m)this.push({data:(function(g){return l.DATA_DESCRIPTOR+n(g.crc32,4)+n(g.compressedSize,4)+n(g.uncompressedSize,4)})(d),meta:{percent:100}});else for(this.push({data:p.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var d=this.bytesWritten,m=0;m<this.dirRecords.length;m++)this.push({data:this.dirRecords[m],meta:{percent:100}});var p=this.bytesWritten-d,g=(function(f,b,v,k,S){var I=o.transformTo("string",S(k));return l.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(f,2)+n(f,2)+n(b,4)+n(v,4)+n(I.length,2)+I})(this.dirRecords.length,p,d,this.zipComment,this.encodeFileName);this.push({data:g,meta:{percent:100}})},h.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},h.prototype.registerPrevious=function(d){this._sources.push(d);var m=this;return d.on("data",function(p){m.processChunk(p)}),d.on("end",function(){m.closedSource(m.previous.streamInfo),m._sources.length?m.prepareNextSource():m.end()}),d.on("error",function(p){m.error(p)}),this},h.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},h.prototype.error=function(d){var m=this._sources;if(!s.prototype.error.call(this,d))return!1;for(var p=0;p<m.length;p++)try{m[p].error(d)}catch{}return!0},h.prototype.lock=function(){s.prototype.lock.call(this);for(var d=this._sources,m=0;m<d.length;m++)d[m].lock()},t.exports=h},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,r){"use strict";var n=e("../compressions"),i=e("./ZipFileWorker");r.generateWorker=function(o,s,a){var c=new i(s.streamFiles,a,s.platform,s.encodeFileName),l=0;try{o.forEach(function(h,d){l++;var m=(function(b,v){var k=b||v,S=n[k];if(!S)throw new Error(k+" is not a valid compression method !");return S})(d.options.compression,s.compression),p=d.options.compressionOptions||s.compressionOptions||{},g=d.dir,f=d.date;d._compressWorker(m,p).withStreamInfo("file",{name:h,dir:g,date:f,comment:d.comment||"",unixPermissions:d.unixPermissions,dosPermissions:d.dosPermissions}).pipe(c)}),c.entriesCount=l}catch(h){c.error(h)}return c}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var i=new n;for(var o in this)typeof this[o]!="function"&&(i[o]=this[o]);return i}}(n.prototype=e("./object")).loadAsync=e("./load"),n.support=e("./support"),n.defaults=e("./defaults"),n.version="3.10.1",n.loadAsync=function(i,o){return new n().loadAsync(i,o)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,r){"use strict";var n=e("./utils"),i=e("./external"),o=e("./utf8"),s=e("./zipEntries"),a=e("./stream/Crc32Probe"),c=e("./nodejsUtils");function l(h){return new i.Promise(function(d,m){var p=h.decompressed.getContentWorker().pipe(new a);p.on("error",function(g){m(g)}).on("end",function(){p.streamInfo.crc32!==h.decompressed.crc32?m(new Error("Corrupted zip : CRC32 mismatch")):d()}).resume()})}t.exports=function(h,d){var m=this;return d=n.extend(d||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),c.isNode&&c.isStream(h)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",h,!0,d.optimizedBinaryString,d.base64).then(function(p){var g=new s(d);return g.load(p),g}).then(function(p){var g=[i.Promise.resolve(p)],f=p.files;if(d.checkCRC32)for(var b=0;b<f.length;b++)g.push(l(f[b]));return i.Promise.all(g)}).then(function(p){for(var g=p.shift(),f=g.files,b=0;b<f.length;b++){var v=f[b],k=v.fileNameStr,S=n.resolve(v.fileNameStr);m.file(S,v.decompressed,{binary:!0,optimizedBinaryString:!0,date:v.date,dir:v.dir,comment:v.fileCommentStr.length?v.fileCommentStr:null,unixPermissions:v.unixPermissions,dosPermissions:v.dosPermissions,createFolders:d.createFolders}),v.dir||(m.file(S).unsafeOriginalName=k)}return g.zipComment.length&&(m.comment=g.zipComment),m})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../stream/GenericWorker");function o(s,a){i.call(this,"Nodejs stream input adapter for "+s),this._upstreamEnded=!1,this._bindStream(a)}n.inherits(o,i),o.prototype._bindStream=function(s){var a=this;(this._stream=s).pause(),s.on("data",function(c){a.push({data:c,meta:{percent:0}})}).on("error",function(c){a.isPaused?this.generatedError=c:a.error(c)}).on("end",function(){a.isPaused?a._upstreamEnded=!0:a.end()})},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,r){"use strict";var n=e("readable-stream").Readable;function i(o,s,a){n.call(this,s),this._helper=o;var c=this;o.on("data",function(l,h){c.push(l)||c._helper.pause(),a&&a(h)}).on("error",function(l){c.emit("error",l)}).on("end",function(){c.push(null)})}e("../utils").inherits(i,n),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,t,r){"use strict";t.exports={isNode:typeof Buffer<"u",newBufferFrom:function(n,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(n,i);if(typeof n=="number")throw new Error('The "data" argument must not be a number');return new Buffer(n,i)},allocBuffer:function(n){if(Buffer.alloc)return Buffer.alloc(n);var i=new Buffer(n);return i.fill(0),i},isBuffer:function(n){return Buffer.isBuffer(n)},isStream:function(n){return n&&typeof n.on=="function"&&typeof n.pause=="function"&&typeof n.resume=="function"}}},{}],15:[function(e,t,r){"use strict";function n(S,I,x){var O,P=o.getTypeOf(I),z=o.extend(x||{},c);z.date=z.date||new Date,z.compression!==null&&(z.compression=z.compression.toUpperCase()),typeof z.unixPermissions=="string"&&(z.unixPermissions=parseInt(z.unixPermissions,8)),z.unixPermissions&&16384&z.unixPermissions&&(z.dir=!0),z.dosPermissions&&16&z.dosPermissions&&(z.dir=!0),z.dir&&(S=f(S)),z.createFolders&&(O=g(S))&&b.call(this,O,!0);var Z=P==="string"&&z.binary===!1&&z.base64===!1;x&&x.binary!==void 0||(z.binary=!Z),(I instanceof l&&I.uncompressedSize===0||z.dir||!I||I.length===0)&&(z.base64=!1,z.binary=!0,I="",z.compression="STORE",P="string");var E=null;E=I instanceof l||I instanceof s?I:m.isNode&&m.isStream(I)?new p(S,I):o.prepareContent(S,I,z.binary,z.optimizedBinaryString,z.base64);var F=new h(S,E,z);this.files[S]=F}var i=e("./utf8"),o=e("./utils"),s=e("./stream/GenericWorker"),a=e("./stream/StreamHelper"),c=e("./defaults"),l=e("./compressedObject"),h=e("./zipObject"),d=e("./generate"),m=e("./nodejsUtils"),p=e("./nodejs/NodejsStreamInputAdapter"),g=function(S){S.slice(-1)==="/"&&(S=S.substring(0,S.length-1));var I=S.lastIndexOf("/");return 0<I?S.substring(0,I):""},f=function(S){return S.slice(-1)!=="/"&&(S+="/"),S},b=function(S,I){return I=I!==void 0?I:c.createFolders,S=f(S),this.files[S]||n.call(this,S,null,{dir:!0,createFolders:I}),this.files[S]};function v(S){return Object.prototype.toString.call(S)==="[object RegExp]"}var k={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(S){var I,x,O;for(I in this.files)O=this.files[I],(x=I.slice(this.root.length,I.length))&&I.slice(0,this.root.length)===this.root&&S(x,O)},filter:function(S){var I=[];return this.forEach(function(x,O){S(x,O)&&I.push(O)}),I},file:function(S,I,x){if(arguments.length!==1)return S=this.root+S,n.call(this,S,I,x),this;if(v(S)){var O=S;return this.filter(function(z,Z){return!Z.dir&&O.test(z)})}var P=this.files[this.root+S];return P&&!P.dir?P:null},folder:function(S){if(!S)return this;if(v(S))return this.filter(function(P,z){return z.dir&&S.test(P)});var I=this.root+S,x=b.call(this,I),O=this.clone();return O.root=x.name,O},remove:function(S){S=this.root+S;var I=this.files[S];if(I||(S.slice(-1)!=="/"&&(S+="/"),I=this.files[S]),I&&!I.dir)delete this.files[S];else for(var x=this.filter(function(P,z){return z.name.slice(0,S.length)===S}),O=0;O<x.length;O++)delete this.files[x[O].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(S){var I,x={};try{if((x=o.extend(S||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=x.type.toLowerCase(),x.compression=x.compression.toUpperCase(),x.type==="binarystring"&&(x.type="string"),!x.type)throw new Error("No output type specified.");o.checkSupport(x.type),x.platform!=="darwin"&&x.platform!=="freebsd"&&x.platform!=="linux"&&x.platform!=="sunos"||(x.platform="UNIX"),x.platform==="win32"&&(x.platform="DOS");var O=x.comment||this.comment||"";I=d.generateWorker(this,x,O)}catch(P){(I=new s("error")).error(P)}return new a(I,x.type||"string",x.mimeType)},generateAsync:function(S,I){return this.generateInternalStream(S).accumulate(I)},generateNodeStream:function(S,I){return(S=S||{}).type||(S.type="nodebuffer"),this.generateInternalStream(S).toNodejsStream(I)}};t.exports=k},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,r){"use strict";t.exports=e("stream")},{stream:void 0}],17:[function(e,t,r){"use strict";var n=e("./DataReader");function i(o){n.call(this,o);for(var s=0;s<this.data.length;s++)o[s]=255&o[s]}e("../utils").inherits(i,n),i.prototype.byteAt=function(o){return this.data[this.zero+o]},i.prototype.lastIndexOfSignature=function(o){for(var s=o.charCodeAt(0),a=o.charCodeAt(1),c=o.charCodeAt(2),l=o.charCodeAt(3),h=this.length-4;0<=h;--h)if(this.data[h]===s&&this.data[h+1]===a&&this.data[h+2]===c&&this.data[h+3]===l)return h-this.zero;return-1},i.prototype.readAndCheckSignature=function(o){var s=o.charCodeAt(0),a=o.charCodeAt(1),c=o.charCodeAt(2),l=o.charCodeAt(3),h=this.readData(4);return s===h[0]&&a===h[1]&&c===h[2]&&l===h[3]},i.prototype.readData=function(o){if(this.checkOffset(o),o===0)return[];var s=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,s},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,r){"use strict";var n=e("../utils");function i(o){this.data=o,this.length=o.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(o){this.checkIndex(this.index+o)},checkIndex:function(o){if(this.length<this.zero+o||o<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+o+"). Corrupted zip ?")},setIndex:function(o){this.checkIndex(o),this.index=o},skip:function(o){this.setIndex(this.index+o)},byteAt:function(){},readInt:function(o){var s,a=0;for(this.checkOffset(o),s=this.index+o-1;s>=this.index;s--)a=(a<<8)+this.byteAt(s);return this.index+=o,a},readString:function(o){return n.transformTo("string",this.readData(o))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var o=this.readInt(4);return new Date(Date.UTC(1980+(o>>25&127),(o>>21&15)-1,o>>16&31,o>>11&31,o>>5&63,(31&o)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,r){"use strict";var n=e("./Uint8ArrayReader");function i(o){n.call(this,o)}e("../utils").inherits(i,n),i.prototype.readData=function(o){this.checkOffset(o);var s=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,s},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){"use strict";var n=e("./DataReader");function i(o){n.call(this,o)}e("../utils").inherits(i,n),i.prototype.byteAt=function(o){return this.data.charCodeAt(this.zero+o)},i.prototype.lastIndexOfSignature=function(o){return this.data.lastIndexOf(o)-this.zero},i.prototype.readAndCheckSignature=function(o){return o===this.readData(4)},i.prototype.readData=function(o){this.checkOffset(o);var s=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,s},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){"use strict";var n=e("./ArrayReader");function i(o){n.call(this,o)}e("../utils").inherits(i,n),i.prototype.readData=function(o){if(this.checkOffset(o),o===0)return new Uint8Array(0);var s=this.data.subarray(this.zero+this.index,this.zero+this.index+o);return this.index+=o,s},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../support"),o=e("./ArrayReader"),s=e("./StringReader"),a=e("./NodeBufferReader"),c=e("./Uint8ArrayReader");t.exports=function(l){var h=n.getTypeOf(l);return n.checkSupport(h),h!=="string"||i.uint8array?h==="nodebuffer"?new a(l):i.uint8array?new c(n.transformTo("uint8array",l)):new o(n.transformTo("array",l)):new s(l)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../utils");function o(s){n.call(this,"ConvertWorker to "+s),this.destType=s}i.inherits(o,n),o.prototype.processChunk=function(s){this.push({data:i.transformTo(this.destType,s.data),meta:s.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,n),o.prototype.processChunk=function(s){this.streamInfo.crc32=i(s.data,this.streamInfo.crc32||0),this.push(s)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function o(s){i.call(this,"DataLengthProbe for "+s),this.propName=s,this.withStreamInfo(s,0)}n.inherits(o,i),o.prototype.processChunk=function(s){if(s){var a=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=a+s.data.length}i.prototype.processChunk.call(this,s)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function o(s){i.call(this,"DataWorker");var a=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,s.then(function(c){a.dataIsReady=!0,a.data=c,a.max=c&&c.length||0,a.type=n.getTypeOf(c),a.isPaused||a._tickAndRepeat()},function(c){a.error(c)})}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var s=null,a=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":s=this.data.substring(this.index,a);break;case"uint8array":s=this.data.subarray(this.index,a);break;case"array":case"nodebuffer":s=this.data.slice(this.index,a)}return this.index=a,this.push({data:s,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){"use strict";function n(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,o){return this._listeners[i].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,o){if(this._listeners[i])for(var s=0;s<this._listeners[i].length;s++)this._listeners[i][s].call(this,o)},pipe:function(i){return i.registerPrevious(this)},registerPrevious:function(i){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=i.streamInfo,this.mergeStreamInfo(),this.previous=i;var o=this;return i.on("data",function(s){o.processChunk(s)}),i.on("end",function(){o.end()}),i.on("error",function(s){o.error(s)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var i=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),i=!0),this.previous&&this.previous.resume(),!i},flush:function(){},processChunk:function(i){this.push(i)},withStreamInfo:function(i,o){return this.extraStreamInfo[i]=o,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var i in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,i)&&(this.streamInfo[i]=this.extraStreamInfo[i])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var i="Worker "+this.name;return this.previous?this.previous+" -> "+i:i}},t.exports=n},{}],29:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./ConvertWorker"),o=e("./GenericWorker"),s=e("../base64"),a=e("../support"),c=e("../external"),l=null;if(a.nodestream)try{l=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function h(m,p){return new c.Promise(function(g,f){var b=[],v=m._internalType,k=m._outputType,S=m._mimeType;m.on("data",function(I,x){b.push(I),p&&p(x)}).on("error",function(I){b=[],f(I)}).on("end",function(){try{var I=(function(x,O,P){switch(x){case"blob":return n.newBlob(n.transformTo("arraybuffer",O),P);case"base64":return s.encode(O);default:return n.transformTo(x,O)}})(k,(function(x,O){var P,z=0,Z=null,E=0;for(P=0;P<O.length;P++)E+=O[P].length;switch(x){case"string":return O.join("");case"array":return Array.prototype.concat.apply([],O);case"uint8array":for(Z=new Uint8Array(E),P=0;P<O.length;P++)Z.set(O[P],z),z+=O[P].length;return Z;case"nodebuffer":return Buffer.concat(O);default:throw new Error("concat : unsupported type '"+x+"'")}})(v,b),S);g(I)}catch(x){f(x)}b=[]}).resume()})}function d(m,p,g){var f=p;switch(p){case"blob":case"arraybuffer":f="uint8array";break;case"base64":f="string"}try{this._internalType=f,this._outputType=p,this._mimeType=g,n.checkSupport(f),this._worker=m.pipe(new i(f)),m.lock()}catch(b){this._worker=new o("error"),this._worker.error(b)}}d.prototype={accumulate:function(m){return h(this,m)},on:function(m,p){var g=this;return m==="data"?this._worker.on(m,function(f){p.call(g,f.data,f.meta)}):this._worker.on(m,function(){n.delay(p,arguments,g)}),this},resume:function(){return n.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(m){if(n.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new l(this,{objectMode:this._outputType!=="nodebuffer"},m)}},t.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,r){"use strict";if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",r.nodebuffer=typeof Buffer<"u",r.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")r.blob=!1;else{var n=new ArrayBuffer(0);try{r.blob=new Blob([n],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(n),r.blob=i.getBlob("application/zip").size===0}catch{r.blob=!1}}}try{r.nodestream=!!e("readable-stream").Readable}catch{r.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,r){"use strict";for(var n=e("./utils"),i=e("./support"),o=e("./nodejsUtils"),s=e("./stream/GenericWorker"),a=new Array(256),c=0;c<256;c++)a[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;a[254]=a[254]=1;function l(){s.call(this,"utf-8 decode"),this.leftOver=null}function h(){s.call(this,"utf-8 encode")}r.utf8encode=function(d){return i.nodebuffer?o.newBufferFrom(d,"utf-8"):(function(m){var p,g,f,b,v,k=m.length,S=0;for(b=0;b<k;b++)(64512&(g=m.charCodeAt(b)))==55296&&b+1<k&&(64512&(f=m.charCodeAt(b+1)))==56320&&(g=65536+(g-55296<<10)+(f-56320),b++),S+=g<128?1:g<2048?2:g<65536?3:4;for(p=i.uint8array?new Uint8Array(S):new Array(S),b=v=0;v<S;b++)(64512&(g=m.charCodeAt(b)))==55296&&b+1<k&&(64512&(f=m.charCodeAt(b+1)))==56320&&(g=65536+(g-55296<<10)+(f-56320),b++),g<128?p[v++]=g:(g<2048?p[v++]=192|g>>>6:(g<65536?p[v++]=224|g>>>12:(p[v++]=240|g>>>18,p[v++]=128|g>>>12&63),p[v++]=128|g>>>6&63),p[v++]=128|63&g);return p})(d)},r.utf8decode=function(d){return i.nodebuffer?n.transformTo("nodebuffer",d).toString("utf-8"):(function(m){var p,g,f,b,v=m.length,k=new Array(2*v);for(p=g=0;p<v;)if((f=m[p++])<128)k[g++]=f;else if(4<(b=a[f]))k[g++]=65533,p+=b-1;else{for(f&=b===2?31:b===3?15:7;1<b&&p<v;)f=f<<6|63&m[p++],b--;1<b?k[g++]=65533:f<65536?k[g++]=f:(f-=65536,k[g++]=55296|f>>10&1023,k[g++]=56320|1023&f)}return k.length!==g&&(k.subarray?k=k.subarray(0,g):k.length=g),n.applyFromCharCode(k)})(d=n.transformTo(i.uint8array?"uint8array":"array",d))},n.inherits(l,s),l.prototype.processChunk=function(d){var m=n.transformTo(i.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var p=m;(m=new Uint8Array(p.length+this.leftOver.length)).set(this.leftOver,0),m.set(p,this.leftOver.length)}else m=this.leftOver.concat(m);this.leftOver=null}var g=(function(b,v){var k;for((v=v||b.length)>b.length&&(v=b.length),k=v-1;0<=k&&(192&b[k])==128;)k--;return k<0||k===0?v:k+a[b[k]]>v?k:v})(m),f=m;g!==m.length&&(i.uint8array?(f=m.subarray(0,g),this.leftOver=m.subarray(g,m.length)):(f=m.slice(0,g),this.leftOver=m.slice(g,m.length))),this.push({data:r.utf8decode(f),meta:d.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=l,n.inherits(h,s),h.prototype.processChunk=function(d){this.push({data:r.utf8encode(d.data),meta:d.meta})},r.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,r){"use strict";var n=e("./support"),i=e("./base64"),o=e("./nodejsUtils"),s=e("./external");function a(p){return p}function c(p,g){for(var f=0;f<p.length;++f)g[f]=255&p.charCodeAt(f);return g}e("setimmediate"),r.newBlob=function(p,g){r.checkSupport("blob");try{return new Blob([p],{type:g})}catch{try{var f=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return f.append(p),f.getBlob(g)}catch{throw new Error("Bug : can't construct the Blob.")}}};var l={stringifyByChunk:function(p,g,f){var b=[],v=0,k=p.length;if(k<=f)return String.fromCharCode.apply(null,p);for(;v<k;)g==="array"||g==="nodebuffer"?b.push(String.fromCharCode.apply(null,p.slice(v,Math.min(v+f,k)))):b.push(String.fromCharCode.apply(null,p.subarray(v,Math.min(v+f,k)))),v+=f;return b.join("")},stringifyByChar:function(p){for(var g="",f=0;f<p.length;f++)g+=String.fromCharCode(p[f]);return g},applyCanBeUsed:{uint8array:(function(){try{return n.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return n.nodebuffer&&String.fromCharCode.apply(null,o.allocBuffer(1)).length===1}catch{return!1}})()}};function h(p){var g=65536,f=r.getTypeOf(p),b=!0;if(f==="uint8array"?b=l.applyCanBeUsed.uint8array:f==="nodebuffer"&&(b=l.applyCanBeUsed.nodebuffer),b)for(;1<g;)try{return l.stringifyByChunk(p,f,g)}catch{g=Math.floor(g/2)}return l.stringifyByChar(p)}function d(p,g){for(var f=0;f<p.length;f++)g[f]=p[f];return g}r.applyFromCharCode=h;var m={};m.string={string:a,array:function(p){return c(p,new Array(p.length))},arraybuffer:function(p){return m.string.uint8array(p).buffer},uint8array:function(p){return c(p,new Uint8Array(p.length))},nodebuffer:function(p){return c(p,o.allocBuffer(p.length))}},m.array={string:h,array:a,arraybuffer:function(p){return new Uint8Array(p).buffer},uint8array:function(p){return new Uint8Array(p)},nodebuffer:function(p){return o.newBufferFrom(p)}},m.arraybuffer={string:function(p){return h(new Uint8Array(p))},array:function(p){return d(new Uint8Array(p),new Array(p.byteLength))},arraybuffer:a,uint8array:function(p){return new Uint8Array(p)},nodebuffer:function(p){return o.newBufferFrom(new Uint8Array(p))}},m.uint8array={string:h,array:function(p){return d(p,new Array(p.length))},arraybuffer:function(p){return p.buffer},uint8array:a,nodebuffer:function(p){return o.newBufferFrom(p)}},m.nodebuffer={string:h,array:function(p){return d(p,new Array(p.length))},arraybuffer:function(p){return m.nodebuffer.uint8array(p).buffer},uint8array:function(p){return d(p,new Uint8Array(p.length))},nodebuffer:a},r.transformTo=function(p,g){if(g=g||"",!p)return g;r.checkSupport(p);var f=r.getTypeOf(g);return m[f][p](g)},r.resolve=function(p){for(var g=p.split("/"),f=[],b=0;b<g.length;b++){var v=g[b];v==="."||v===""&&b!==0&&b!==g.length-1||(v===".."?f.pop():f.push(v))}return f.join("/")},r.getTypeOf=function(p){return typeof p=="string"?"string":Object.prototype.toString.call(p)==="[object Array]"?"array":n.nodebuffer&&o.isBuffer(p)?"nodebuffer":n.uint8array&&p instanceof Uint8Array?"uint8array":n.arraybuffer&&p instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(p){if(!n[p.toLowerCase()])throw new Error(p+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(p){var g,f,b="";for(f=0;f<(p||"").length;f++)b+="\\x"+((g=p.charCodeAt(f))<16?"0":"")+g.toString(16).toUpperCase();return b},r.delay=function(p,g,f){setImmediate(function(){p.apply(f||null,g||[])})},r.inherits=function(p,g){function f(){}f.prototype=g.prototype,p.prototype=new f},r.extend=function(){var p,g,f={};for(p=0;p<arguments.length;p++)for(g in arguments[p])Object.prototype.hasOwnProperty.call(arguments[p],g)&&f[g]===void 0&&(f[g]=arguments[p][g]);return f},r.prepareContent=function(p,g,f,b,v){return s.Promise.resolve(g).then(function(k){return n.blob&&(k instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(k))!==-1)&&typeof FileReader<"u"?new s.Promise(function(S,I){var x=new FileReader;x.onload=function(O){S(O.target.result)},x.onerror=function(O){I(O.target.error)},x.readAsArrayBuffer(k)}):k}).then(function(k){var S=r.getTypeOf(k);return S?(S==="arraybuffer"?k=r.transformTo("uint8array",k):S==="string"&&(v?k=i.decode(k):f&&b!==!0&&(k=(function(I){return c(I,n.uint8array?new Uint8Array(I.length):new Array(I.length))})(k))),k):s.Promise.reject(new Error("Can't read the data of '"+p+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,r){"use strict";var n=e("./reader/readerFor"),i=e("./utils"),o=e("./signature"),s=e("./zipEntry"),a=e("./support");function c(l){this.files=[],this.loadOptions=l}c.prototype={checkSignature:function(l){if(!this.reader.readAndCheckSignature(l)){this.reader.index-=4;var h=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(h)+", expected "+i.pretty(l)+")")}},isSignature:function(l,h){var d=this.reader.index;this.reader.setIndex(l);var m=this.reader.readString(4)===h;return this.reader.setIndex(d),m},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var l=this.reader.readData(this.zipCommentLength),h=a.uint8array?"uint8array":"array",d=i.transformTo(h,l);this.zipComment=this.loadOptions.decodeFileName(d)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var l,h,d,m=this.zip64EndOfCentralSize-44;0<m;)l=this.reader.readInt(2),h=this.reader.readInt(4),d=this.reader.readData(h),this.zip64ExtensibleData[l]={id:l,length:h,value:d}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var l,h;for(l=0;l<this.files.length;l++)h=this.files[l],this.reader.setIndex(h.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),h.readLocalPart(this.reader),h.handleUTF8(),h.processAttributes()},readCentralDir:function(){var l;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(l=new s({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(l);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var l=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(l<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(l);var h=l;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(l=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(l),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var d=this.centralDirOffset+this.centralDirSize;this.zip64&&(d+=20,d+=12+this.zip64EndOfCentralSize);var m=h-d;if(0<m)this.isSignature(h,o.CENTRAL_FILE_HEADER)||(this.reader.zero=m);else if(m<0)throw new Error("Corrupted zip: missing "+Math.abs(m)+" bytes.")},prepareReader:function(l){this.reader=n(l)},load:function(l){this.prepareReader(l),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=c},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,r){"use strict";var n=e("./reader/readerFor"),i=e("./utils"),o=e("./compressedObject"),s=e("./crc32"),a=e("./utf8"),c=e("./compressions"),l=e("./support");function h(d,m){this.options=d,this.loadOptions=m}h.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(d){var m,p;if(d.skip(22),this.fileNameLength=d.readInt(2),p=d.readInt(2),this.fileName=d.readData(this.fileNameLength),d.skip(p),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((m=(function(g){for(var f in c)if(Object.prototype.hasOwnProperty.call(c,f)&&c[f].magic===g)return c[f];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,m,d.readData(this.compressedSize))},readCentralPart:function(d){this.versionMadeBy=d.readInt(2),d.skip(2),this.bitFlag=d.readInt(2),this.compressionMethod=d.readString(2),this.date=d.readDate(),this.crc32=d.readInt(4),this.compressedSize=d.readInt(4),this.uncompressedSize=d.readInt(4);var m=d.readInt(2);if(this.extraFieldsLength=d.readInt(2),this.fileCommentLength=d.readInt(2),this.diskNumberStart=d.readInt(2),this.internalFileAttributes=d.readInt(2),this.externalFileAttributes=d.readInt(4),this.localHeaderOffset=d.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");d.skip(m),this.readExtraFields(d),this.parseZIP64ExtraField(d),this.fileComment=d.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var d=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),d==0&&(this.dosPermissions=63&this.externalFileAttributes),d==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var d=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=d.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=d.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=d.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=d.readInt(4))}},readExtraFields:function(d){var m,p,g,f=d.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});d.index+4<f;)m=d.readInt(2),p=d.readInt(2),g=d.readData(p),this.extraFields[m]={id:m,length:p,value:g};d.setIndex(f)},handleUTF8:function(){var d=l.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var m=this.findExtraFieldUnicodePath();if(m!==null)this.fileNameStr=m;else{var p=i.transformTo(d,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(p)}var g=this.findExtraFieldUnicodeComment();if(g!==null)this.fileCommentStr=g;else{var f=i.transformTo(d,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(f)}}},findExtraFieldUnicodePath:function(){var d=this.extraFields[28789];if(d){var m=n(d.value);return m.readInt(1)!==1||s(this.fileName)!==m.readInt(4)?null:a.utf8decode(m.readData(d.length-5))}return null},findExtraFieldUnicodeComment:function(){var d=this.extraFields[25461];if(d){var m=n(d.value);return m.readInt(1)!==1||s(this.fileComment)!==m.readInt(4)?null:a.utf8decode(m.readData(d.length-5))}return null}},t.exports=h},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,r){"use strict";function n(m,p,g){this.name=m,this.dir=g.dir,this.date=g.date,this.comment=g.comment,this.unixPermissions=g.unixPermissions,this.dosPermissions=g.dosPermissions,this._data=p,this._dataBinary=g.binary,this.options={compression:g.compression,compressionOptions:g.compressionOptions}}var i=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),s=e("./utf8"),a=e("./compressedObject"),c=e("./stream/GenericWorker");n.prototype={internalStream:function(m){var p=null,g="string";try{if(!m)throw new Error("No output type specified.");var f=(g=m.toLowerCase())==="string"||g==="text";g!=="binarystring"&&g!=="text"||(g="string"),p=this._decompressWorker();var b=!this._dataBinary;b&&!f&&(p=p.pipe(new s.Utf8EncodeWorker)),!b&&f&&(p=p.pipe(new s.Utf8DecodeWorker))}catch(v){(p=new c("error")).error(v)}return new i(p,g,"")},async:function(m,p){return this.internalStream(m).accumulate(p)},nodeStream:function(m,p){return this.internalStream(m||"nodebuffer").toNodejsStream(p)},_compressWorker:function(m,p){if(this._data instanceof a&&this._data.compression.magic===m.magic)return this._data.getCompressedWorker();var g=this._decompressWorker();return this._dataBinary||(g=g.pipe(new s.Utf8EncodeWorker)),a.createWorkerFrom(g,m,p)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof c?this._data:new o(this._data)}};for(var l=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],h=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},d=0;d<l.length;d++)n.prototype[l[d]]=h;t.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,r){(function(n){"use strict";var i,o,s=n.MutationObserver||n.WebKitMutationObserver;if(s){var a=0,c=new s(m),l=n.document.createTextNode("");c.observe(l,{characterData:!0}),i=function(){l.data=a=++a%2}}else if(n.setImmediate||n.MessageChannel===void 0)i="document"in n&&"onreadystatechange"in n.document.createElement("script")?function(){var p=n.document.createElement("script");p.onreadystatechange=function(){m(),p.onreadystatechange=null,p.parentNode.removeChild(p),p=null},n.document.documentElement.appendChild(p)}:function(){setTimeout(m,0)};else{var h=new n.MessageChannel;h.port1.onmessage=m,i=function(){h.port2.postMessage(0)}}var d=[];function m(){var p,g;o=!0;for(var f=d.length;f;){for(g=d,d=[],p=-1;++p<f;)g[p]();f=d.length}o=!1}t.exports=function(p){d.push(p)!==1||o||i()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(e,t,r){"use strict";var n=e("immediate");function i(){}var o={},s=["REJECTED"],a=["FULFILLED"],c=["PENDING"];function l(f){if(typeof f!="function")throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,f!==i&&p(this,f)}function h(f,b,v){this.promise=f,typeof b=="function"&&(this.onFulfilled=b,this.callFulfilled=this.otherCallFulfilled),typeof v=="function"&&(this.onRejected=v,this.callRejected=this.otherCallRejected)}function d(f,b,v){n(function(){var k;try{k=b(v)}catch(S){return o.reject(f,S)}k===f?o.reject(f,new TypeError("Cannot resolve promise with itself")):o.resolve(f,k)})}function m(f){var b=f&&f.then;if(f&&(typeof f=="object"||typeof f=="function")&&typeof b=="function")return function(){b.apply(f,arguments)}}function p(f,b){var v=!1;function k(x){v||(v=!0,o.reject(f,x))}function S(x){v||(v=!0,o.resolve(f,x))}var I=g(function(){b(S,k)});I.status==="error"&&k(I.value)}function g(f,b){var v={};try{v.value=f(b),v.status="success"}catch(k){v.status="error",v.value=k}return v}(t.exports=l).prototype.finally=function(f){if(typeof f!="function")return this;var b=this.constructor;return this.then(function(v){return b.resolve(f()).then(function(){return v})},function(v){return b.resolve(f()).then(function(){throw v})})},l.prototype.catch=function(f){return this.then(null,f)},l.prototype.then=function(f,b){if(typeof f!="function"&&this.state===a||typeof b!="function"&&this.state===s)return this;var v=new this.constructor(i);return this.state!==c?d(v,this.state===a?f:b,this.outcome):this.queue.push(new h(v,f,b)),v},h.prototype.callFulfilled=function(f){o.resolve(this.promise,f)},h.prototype.otherCallFulfilled=function(f){d(this.promise,this.onFulfilled,f)},h.prototype.callRejected=function(f){o.reject(this.promise,f)},h.prototype.otherCallRejected=function(f){d(this.promise,this.onRejected,f)},o.resolve=function(f,b){var v=g(m,b);if(v.status==="error")return o.reject(f,v.value);var k=v.value;if(k)p(f,k);else{f.state=a,f.outcome=b;for(var S=-1,I=f.queue.length;++S<I;)f.queue[S].callFulfilled(b)}return f},o.reject=function(f,b){f.state=s,f.outcome=b;for(var v=-1,k=f.queue.length;++v<k;)f.queue[v].callRejected(b);return f},l.resolve=function(f){return f instanceof this?f:o.resolve(new this(i),f)},l.reject=function(f){var b=new this(i);return o.reject(b,f)},l.all=function(f){var b=this;if(Object.prototype.toString.call(f)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=f.length,k=!1;if(!v)return this.resolve([]);for(var S=new Array(v),I=0,x=-1,O=new this(i);++x<v;)P(f[x],x);return O;function P(z,Z){b.resolve(z).then(function(E){S[Z]=E,++I!==v||k||(k=!0,o.resolve(O,S))},function(E){k||(k=!0,o.reject(O,E))})}},l.race=function(f){var b=this;if(Object.prototype.toString.call(f)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=f.length,k=!1;if(!v)return this.resolve([]);for(var S=-1,I=new this(i);++S<v;)x=f[S],b.resolve(x).then(function(O){k||(k=!0,o.resolve(I,O))},function(O){k||(k=!0,o.reject(I,O))});var x;return I}},{immediate:36}],38:[function(e,t,r){"use strict";var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,r){"use strict";var n=e("./zlib/deflate"),i=e("./utils/common"),o=e("./utils/strings"),s=e("./zlib/messages"),a=e("./zlib/zstream"),c=Object.prototype.toString,l=0,h=-1,d=0,m=8;function p(f){if(!(this instanceof p))return new p(f);this.options=i.assign({level:h,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:""},f||{});var b=this.options;b.raw&&0<b.windowBits?b.windowBits=-b.windowBits:b.gzip&&0<b.windowBits&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var v=n.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(v!==l)throw new Error(s[v]);if(b.header&&n.deflateSetHeader(this.strm,b.header),b.dictionary){var k;if(k=typeof b.dictionary=="string"?o.string2buf(b.dictionary):c.call(b.dictionary)==="[object ArrayBuffer]"?new Uint8Array(b.dictionary):b.dictionary,(v=n.deflateSetDictionary(this.strm,k))!==l)throw new Error(s[v]);this._dict_set=!0}}function g(f,b){var v=new p(b);if(v.push(f,!0),v.err)throw v.msg||s[v.err];return v.result}p.prototype.push=function(f,b){var v,k,S=this.strm,I=this.options.chunkSize;if(this.ended)return!1;k=b===~~b?b:b===!0?4:0,typeof f=="string"?S.input=o.string2buf(f):c.call(f)==="[object ArrayBuffer]"?S.input=new Uint8Array(f):S.input=f,S.next_in=0,S.avail_in=S.input.length;do{if(S.avail_out===0&&(S.output=new i.Buf8(I),S.next_out=0,S.avail_out=I),(v=n.deflate(S,k))!==1&&v!==l)return this.onEnd(v),!(this.ended=!0);S.avail_out!==0&&(S.avail_in!==0||k!==4&&k!==2)||(this.options.to==="string"?this.onData(o.buf2binstring(i.shrinkBuf(S.output,S.next_out))):this.onData(i.shrinkBuf(S.output,S.next_out)))}while((0<S.avail_in||S.avail_out===0)&&v!==1);return k===4?(v=n.deflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===l):k!==2||(this.onEnd(l),!(S.avail_out=0))},p.prototype.onData=function(f){this.chunks.push(f)},p.prototype.onEnd=function(f){f===l&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=f,this.msg=this.strm.msg},r.Deflate=p,r.deflate=g,r.deflateRaw=function(f,b){return(b=b||{}).raw=!0,g(f,b)},r.gzip=function(f,b){return(b=b||{}).gzip=!0,g(f,b)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,r){"use strict";var n=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),s=e("./zlib/constants"),a=e("./zlib/messages"),c=e("./zlib/zstream"),l=e("./zlib/gzheader"),h=Object.prototype.toString;function d(p){if(!(this instanceof d))return new d(p);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},p||{});var g=this.options;g.raw&&0<=g.windowBits&&g.windowBits<16&&(g.windowBits=-g.windowBits,g.windowBits===0&&(g.windowBits=-15)),!(0<=g.windowBits&&g.windowBits<16)||p&&p.windowBits||(g.windowBits+=32),15<g.windowBits&&g.windowBits<48&&(15&g.windowBits)==0&&(g.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var f=n.inflateInit2(this.strm,g.windowBits);if(f!==s.Z_OK)throw new Error(a[f]);this.header=new l,n.inflateGetHeader(this.strm,this.header)}function m(p,g){var f=new d(g);if(f.push(p,!0),f.err)throw f.msg||a[f.err];return f.result}d.prototype.push=function(p,g){var f,b,v,k,S,I,x=this.strm,O=this.options.chunkSize,P=this.options.dictionary,z=!1;if(this.ended)return!1;b=g===~~g?g:g===!0?s.Z_FINISH:s.Z_NO_FLUSH,typeof p=="string"?x.input=o.binstring2buf(p):h.call(p)==="[object ArrayBuffer]"?x.input=new Uint8Array(p):x.input=p,x.next_in=0,x.avail_in=x.input.length;do{if(x.avail_out===0&&(x.output=new i.Buf8(O),x.next_out=0,x.avail_out=O),(f=n.inflate(x,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&P&&(I=typeof P=="string"?o.string2buf(P):h.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,f=n.inflateSetDictionary(this.strm,I)),f===s.Z_BUF_ERROR&&z===!0&&(f=s.Z_OK,z=!1),f!==s.Z_STREAM_END&&f!==s.Z_OK)return this.onEnd(f),!(this.ended=!0);x.next_out&&(x.avail_out!==0&&f!==s.Z_STREAM_END&&(x.avail_in!==0||b!==s.Z_FINISH&&b!==s.Z_SYNC_FLUSH)||(this.options.to==="string"?(v=o.utf8border(x.output,x.next_out),k=x.next_out-v,S=o.buf2string(x.output,v),x.next_out=k,x.avail_out=O-k,k&&i.arraySet(x.output,x.output,v,k,0),this.onData(S)):this.onData(i.shrinkBuf(x.output,x.next_out)))),x.avail_in===0&&x.avail_out===0&&(z=!0)}while((0<x.avail_in||x.avail_out===0)&&f!==s.Z_STREAM_END);return f===s.Z_STREAM_END&&(b=s.Z_FINISH),b===s.Z_FINISH?(f=n.inflateEnd(this.strm),this.onEnd(f),this.ended=!0,f===s.Z_OK):b!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),!(x.avail_out=0))},d.prototype.onData=function(p){this.chunks.push(p)},d.prototype.onEnd=function(p){p===s.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=p,this.msg=this.strm.msg},r.Inflate=d,r.inflate=m,r.inflateRaw=function(p,g){return(g=g||{}).raw=!0,m(p,g)},r.ungzip=m},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,r){"use strict";var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";r.assign=function(s){for(var a=Array.prototype.slice.call(arguments,1);a.length;){var c=a.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(var l in c)c.hasOwnProperty(l)&&(s[l]=c[l])}}return s},r.shrinkBuf=function(s,a){return s.length===a?s:s.subarray?s.subarray(0,a):(s.length=a,s)};var i={arraySet:function(s,a,c,l,h){if(a.subarray&&s.subarray)s.set(a.subarray(c,c+l),h);else for(var d=0;d<l;d++)s[h+d]=a[c+d]},flattenChunks:function(s){var a,c,l,h,d,m;for(a=l=0,c=s.length;a<c;a++)l+=s[a].length;for(m=new Uint8Array(l),a=h=0,c=s.length;a<c;a++)d=s[a],m.set(d,h),h+=d.length;return m}},o={arraySet:function(s,a,c,l,h){for(var d=0;d<l;d++)s[h+d]=a[c+d]},flattenChunks:function(s){return[].concat.apply([],s)}};r.setTyped=function(s){s?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(n)},{}],42:[function(e,t,r){"use strict";var n=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{o=!1}for(var s=new n.Buf8(256),a=0;a<256;a++)s[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;function c(l,h){if(h<65537&&(l.subarray&&o||!l.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(l,h));for(var d="",m=0;m<h;m++)d+=String.fromCharCode(l[m]);return d}s[254]=s[254]=1,r.string2buf=function(l){var h,d,m,p,g,f=l.length,b=0;for(p=0;p<f;p++)(64512&(d=l.charCodeAt(p)))==55296&&p+1<f&&(64512&(m=l.charCodeAt(p+1)))==56320&&(d=65536+(d-55296<<10)+(m-56320),p++),b+=d<128?1:d<2048?2:d<65536?3:4;for(h=new n.Buf8(b),p=g=0;g<b;p++)(64512&(d=l.charCodeAt(p)))==55296&&p+1<f&&(64512&(m=l.charCodeAt(p+1)))==56320&&(d=65536+(d-55296<<10)+(m-56320),p++),d<128?h[g++]=d:(d<2048?h[g++]=192|d>>>6:(d<65536?h[g++]=224|d>>>12:(h[g++]=240|d>>>18,h[g++]=128|d>>>12&63),h[g++]=128|d>>>6&63),h[g++]=128|63&d);return h},r.buf2binstring=function(l){return c(l,l.length)},r.binstring2buf=function(l){for(var h=new n.Buf8(l.length),d=0,m=h.length;d<m;d++)h[d]=l.charCodeAt(d);return h},r.buf2string=function(l,h){var d,m,p,g,f=h||l.length,b=new Array(2*f);for(d=m=0;d<f;)if((p=l[d++])<128)b[m++]=p;else if(4<(g=s[p]))b[m++]=65533,d+=g-1;else{for(p&=g===2?31:g===3?15:7;1<g&&d<f;)p=p<<6|63&l[d++],g--;1<g?b[m++]=65533:p<65536?b[m++]=p:(p-=65536,b[m++]=55296|p>>10&1023,b[m++]=56320|1023&p)}return c(b,m)},r.utf8border=function(l,h){var d;for((h=h||l.length)>l.length&&(h=l.length),d=h-1;0<=d&&(192&l[d])==128;)d--;return d<0||d===0?h:d+s[l[d]]>h?d:h}},{"./common":41}],43:[function(e,t,r){"use strict";t.exports=function(n,i,o,s){for(var a=65535&n|0,c=n>>>16&65535|0,l=0;o!==0;){for(o-=l=2e3<o?2e3:o;c=c+(a=a+i[s++]|0)|0,--l;);a%=65521,c%=65521}return a|c<<16|0}},{}],44:[function(e,t,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,r){"use strict";var n=(function(){for(var i,o=[],s=0;s<256;s++){i=s;for(var a=0;a<8;a++)i=1&i?3988292384^i>>>1:i>>>1;o[s]=i}return o})();t.exports=function(i,o,s,a){var c=n,l=a+s;i^=-1;for(var h=a;h<l;h++)i=i>>>8^c[255&(i^o[h])];return-1^i}},{}],46:[function(e,t,r){"use strict";var n,i=e("../utils/common"),o=e("./trees"),s=e("./adler32"),a=e("./crc32"),c=e("./messages"),l=0,h=4,d=0,m=-2,p=-1,g=4,f=2,b=8,v=9,k=286,S=30,I=19,x=2*k+1,O=15,P=3,z=258,Z=z+P+1,E=42,F=113,y=1,U=2,ae=3,V=4;function le(u,M){return u.msg=c[M],M}function H(u){return(u<<1)-(4<u?9:0)}function oe(u){for(var M=u.length;0<=--M;)u[M]=0}function D(u){var M=u.state,B=M.pending;B>u.avail_out&&(B=u.avail_out),B!==0&&(i.arraySet(u.output,M.pending_buf,M.pending_out,B,u.next_out),u.next_out+=B,M.pending_out+=B,u.total_out+=B,u.avail_out-=B,M.pending-=B,M.pending===0&&(M.pending_out=0))}function R(u,M){o._tr_flush_block(u,0<=u.block_start?u.block_start:-1,u.strstart-u.block_start,M),u.block_start=u.strstart,D(u.strm)}function te(u,M){u.pending_buf[u.pending++]=M}function q(u,M){u.pending_buf[u.pending++]=M>>>8&255,u.pending_buf[u.pending++]=255&M}function G(u,M){var B,w,_=u.max_chain_length,C=u.strstart,N=u.prev_length,j=u.nice_match,A=u.strstart>u.w_size-Z?u.strstart-(u.w_size-Z):0,$=u.window,K=u.w_mask,W=u.prev,re=u.strstart+z,ke=$[C+N-1],ue=$[C+N];u.prev_length>=u.good_match&&(_>>=2),j>u.lookahead&&(j=u.lookahead);do if($[(B=M)+N]===ue&&$[B+N-1]===ke&&$[B]===$[C]&&$[++B]===$[C+1]){C+=2,B++;do;while($[++C]===$[++B]&&$[++C]===$[++B]&&$[++C]===$[++B]&&$[++C]===$[++B]&&$[++C]===$[++B]&&$[++C]===$[++B]&&$[++C]===$[++B]&&$[++C]===$[++B]&&C<re);if(w=z-(re-C),C=re-z,N<w){if(u.match_start=M,j<=(N=w))break;ke=$[C+N-1],ue=$[C+N]}}while((M=W[M&K])>A&&--_!=0);return N<=u.lookahead?N:u.lookahead}function Ce(u){var M,B,w,_,C,N,j,A,$,K,W=u.w_size;do{if(_=u.window_size-u.lookahead-u.strstart,u.strstart>=W+(W-Z)){for(i.arraySet(u.window,u.window,W,W,0),u.match_start-=W,u.strstart-=W,u.block_start-=W,M=B=u.hash_size;w=u.head[--M],u.head[M]=W<=w?w-W:0,--B;);for(M=B=W;w=u.prev[--M],u.prev[M]=W<=w?w-W:0,--B;);_+=W}if(u.strm.avail_in===0)break;if(N=u.strm,j=u.window,A=u.strstart+u.lookahead,$=_,K=void 0,K=N.avail_in,$<K&&(K=$),B=K===0?0:(N.avail_in-=K,i.arraySet(j,N.input,N.next_in,K,A),N.state.wrap===1?N.adler=s(N.adler,j,K,A):N.state.wrap===2&&(N.adler=a(N.adler,j,K,A)),N.next_in+=K,N.total_in+=K,K),u.lookahead+=B,u.lookahead+u.insert>=P)for(C=u.strstart-u.insert,u.ins_h=u.window[C],u.ins_h=(u.ins_h<<u.hash_shift^u.window[C+1])&u.hash_mask;u.insert&&(u.ins_h=(u.ins_h<<u.hash_shift^u.window[C+P-1])&u.hash_mask,u.prev[C&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=C,C++,u.insert--,!(u.lookahead+u.insert<P)););}while(u.lookahead<Z&&u.strm.avail_in!==0)}function Ke(u,M){for(var B,w;;){if(u.lookahead<Z){if(Ce(u),u.lookahead<Z&&M===l)return y;if(u.lookahead===0)break}if(B=0,u.lookahead>=P&&(u.ins_h=(u.ins_h<<u.hash_shift^u.window[u.strstart+P-1])&u.hash_mask,B=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart),B!==0&&u.strstart-B<=u.w_size-Z&&(u.match_length=G(u,B)),u.match_length>=P)if(w=o._tr_tally(u,u.strstart-u.match_start,u.match_length-P),u.lookahead-=u.match_length,u.match_length<=u.max_lazy_match&&u.lookahead>=P){for(u.match_length--;u.strstart++,u.ins_h=(u.ins_h<<u.hash_shift^u.window[u.strstart+P-1])&u.hash_mask,B=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart,--u.match_length!=0;);u.strstart++}else u.strstart+=u.match_length,u.match_length=0,u.ins_h=u.window[u.strstart],u.ins_h=(u.ins_h<<u.hash_shift^u.window[u.strstart+1])&u.hash_mask;else w=o._tr_tally(u,0,u.window[u.strstart]),u.lookahead--,u.strstart++;if(w&&(R(u,!1),u.strm.avail_out===0))return y}return u.insert=u.strstart<P-1?u.strstart:P-1,M===h?(R(u,!0),u.strm.avail_out===0?ae:V):u.last_lit&&(R(u,!1),u.strm.avail_out===0)?y:U}function de(u,M){for(var B,w,_;;){if(u.lookahead<Z){if(Ce(u),u.lookahead<Z&&M===l)return y;if(u.lookahead===0)break}if(B=0,u.lookahead>=P&&(u.ins_h=(u.ins_h<<u.hash_shift^u.window[u.strstart+P-1])&u.hash_mask,B=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart),u.prev_length=u.match_length,u.prev_match=u.match_start,u.match_length=P-1,B!==0&&u.prev_length<u.max_lazy_match&&u.strstart-B<=u.w_size-Z&&(u.match_length=G(u,B),u.match_length<=5&&(u.strategy===1||u.match_length===P&&4096<u.strstart-u.match_start)&&(u.match_length=P-1)),u.prev_length>=P&&u.match_length<=u.prev_length){for(_=u.strstart+u.lookahead-P,w=o._tr_tally(u,u.strstart-1-u.prev_match,u.prev_length-P),u.lookahead-=u.prev_length-1,u.prev_length-=2;++u.strstart<=_&&(u.ins_h=(u.ins_h<<u.hash_shift^u.window[u.strstart+P-1])&u.hash_mask,B=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart),--u.prev_length!=0;);if(u.match_available=0,u.match_length=P-1,u.strstart++,w&&(R(u,!1),u.strm.avail_out===0))return y}else if(u.match_available){if((w=o._tr_tally(u,0,u.window[u.strstart-1]))&&R(u,!1),u.strstart++,u.lookahead--,u.strm.avail_out===0)return y}else u.match_available=1,u.strstart++,u.lookahead--}return u.match_available&&(w=o._tr_tally(u,0,u.window[u.strstart-1]),u.match_available=0),u.insert=u.strstart<P-1?u.strstart:P-1,M===h?(R(u,!0),u.strm.avail_out===0?ae:V):u.last_lit&&(R(u,!1),u.strm.avail_out===0)?y:U}function ge(u,M,B,w,_){this.good_length=u,this.max_lazy=M,this.nice_length=B,this.max_chain=w,this.func=_}function Xe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=b,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*x),this.dyn_dtree=new i.Buf16(2*(2*S+1)),this.bl_tree=new i.Buf16(2*(2*I+1)),oe(this.dyn_ltree),oe(this.dyn_dtree),oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(O+1),this.heap=new i.Buf16(2*k+1),oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*k+1),oe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ve(u){var M;return u&&u.state?(u.total_in=u.total_out=0,u.data_type=f,(M=u.state).pending=0,M.pending_out=0,M.wrap<0&&(M.wrap=-M.wrap),M.status=M.wrap?E:F,u.adler=M.wrap===2?0:1,M.last_flush=l,o._tr_init(M),d):le(u,m)}function it(u){var M=ve(u);return M===d&&(function(B){B.window_size=2*B.w_size,oe(B.head),B.max_lazy_match=n[B.level].max_lazy,B.good_match=n[B.level].good_length,B.nice_match=n[B.level].nice_length,B.max_chain_length=n[B.level].max_chain,B.strstart=0,B.block_start=0,B.lookahead=0,B.insert=0,B.match_length=B.prev_length=P-1,B.match_available=0,B.ins_h=0})(u.state),M}function ut(u,M,B,w,_,C){if(!u)return m;var N=1;if(M===p&&(M=6),w<0?(N=0,w=-w):15<w&&(N=2,w-=16),_<1||v<_||B!==b||w<8||15<w||M<0||9<M||C<0||g<C)return le(u,m);w===8&&(w=9);var j=new Xe;return(u.state=j).strm=u,j.wrap=N,j.gzhead=null,j.w_bits=w,j.w_size=1<<j.w_bits,j.w_mask=j.w_size-1,j.hash_bits=_+7,j.hash_size=1<<j.hash_bits,j.hash_mask=j.hash_size-1,j.hash_shift=~~((j.hash_bits+P-1)/P),j.window=new i.Buf8(2*j.w_size),j.head=new i.Buf16(j.hash_size),j.prev=new i.Buf16(j.w_size),j.lit_bufsize=1<<_+6,j.pending_buf_size=4*j.lit_bufsize,j.pending_buf=new i.Buf8(j.pending_buf_size),j.d_buf=1*j.lit_bufsize,j.l_buf=3*j.lit_bufsize,j.level=M,j.strategy=C,j.method=B,it(u)}n=[new ge(0,0,0,0,function(u,M){var B=65535;for(B>u.pending_buf_size-5&&(B=u.pending_buf_size-5);;){if(u.lookahead<=1){if(Ce(u),u.lookahead===0&&M===l)return y;if(u.lookahead===0)break}u.strstart+=u.lookahead,u.lookahead=0;var w=u.block_start+B;if((u.strstart===0||u.strstart>=w)&&(u.lookahead=u.strstart-w,u.strstart=w,R(u,!1),u.strm.avail_out===0)||u.strstart-u.block_start>=u.w_size-Z&&(R(u,!1),u.strm.avail_out===0))return y}return u.insert=0,M===h?(R(u,!0),u.strm.avail_out===0?ae:V):(u.strstart>u.block_start&&(R(u,!1),u.strm.avail_out),y)}),new ge(4,4,8,4,Ke),new ge(4,5,16,8,Ke),new ge(4,6,32,32,Ke),new ge(4,4,16,16,de),new ge(8,16,32,32,de),new ge(8,16,128,128,de),new ge(8,32,128,256,de),new ge(32,128,258,1024,de),new ge(32,258,258,4096,de)],r.deflateInit=function(u,M){return ut(u,M,b,15,8,0)},r.deflateInit2=ut,r.deflateReset=it,r.deflateResetKeep=ve,r.deflateSetHeader=function(u,M){return u&&u.state?u.state.wrap!==2?m:(u.state.gzhead=M,d):m},r.deflate=function(u,M){var B,w,_,C;if(!u||!u.state||5<M||M<0)return u?le(u,m):m;if(w=u.state,!u.output||!u.input&&u.avail_in!==0||w.status===666&&M!==h)return le(u,u.avail_out===0?-5:m);if(w.strm=u,B=w.last_flush,w.last_flush=M,w.status===E)if(w.wrap===2)u.adler=0,te(w,31),te(w,139),te(w,8),w.gzhead?(te(w,(w.gzhead.text?1:0)+(w.gzhead.hcrc?2:0)+(w.gzhead.extra?4:0)+(w.gzhead.name?8:0)+(w.gzhead.comment?16:0)),te(w,255&w.gzhead.time),te(w,w.gzhead.time>>8&255),te(w,w.gzhead.time>>16&255),te(w,w.gzhead.time>>24&255),te(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),te(w,255&w.gzhead.os),w.gzhead.extra&&w.gzhead.extra.length&&(te(w,255&w.gzhead.extra.length),te(w,w.gzhead.extra.length>>8&255)),w.gzhead.hcrc&&(u.adler=a(u.adler,w.pending_buf,w.pending,0)),w.gzindex=0,w.status=69):(te(w,0),te(w,0),te(w,0),te(w,0),te(w,0),te(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),te(w,3),w.status=F);else{var N=b+(w.w_bits-8<<4)<<8;N|=(2<=w.strategy||w.level<2?0:w.level<6?1:w.level===6?2:3)<<6,w.strstart!==0&&(N|=32),N+=31-N%31,w.status=F,q(w,N),w.strstart!==0&&(q(w,u.adler>>>16),q(w,65535&u.adler)),u.adler=1}if(w.status===69)if(w.gzhead.extra){for(_=w.pending;w.gzindex<(65535&w.gzhead.extra.length)&&(w.pending!==w.pending_buf_size||(w.gzhead.hcrc&&w.pending>_&&(u.adler=a(u.adler,w.pending_buf,w.pending-_,_)),D(u),_=w.pending,w.pending!==w.pending_buf_size));)te(w,255&w.gzhead.extra[w.gzindex]),w.gzindex++;w.gzhead.hcrc&&w.pending>_&&(u.adler=a(u.adler,w.pending_buf,w.pending-_,_)),w.gzindex===w.gzhead.extra.length&&(w.gzindex=0,w.status=73)}else w.status=73;if(w.status===73)if(w.gzhead.name){_=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>_&&(u.adler=a(u.adler,w.pending_buf,w.pending-_,_)),D(u),_=w.pending,w.pending===w.pending_buf_size)){C=1;break}C=w.gzindex<w.gzhead.name.length?255&w.gzhead.name.charCodeAt(w.gzindex++):0,te(w,C)}while(C!==0);w.gzhead.hcrc&&w.pending>_&&(u.adler=a(u.adler,w.pending_buf,w.pending-_,_)),C===0&&(w.gzindex=0,w.status=91)}else w.status=91;if(w.status===91)if(w.gzhead.comment){_=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>_&&(u.adler=a(u.adler,w.pending_buf,w.pending-_,_)),D(u),_=w.pending,w.pending===w.pending_buf_size)){C=1;break}C=w.gzindex<w.gzhead.comment.length?255&w.gzhead.comment.charCodeAt(w.gzindex++):0,te(w,C)}while(C!==0);w.gzhead.hcrc&&w.pending>_&&(u.adler=a(u.adler,w.pending_buf,w.pending-_,_)),C===0&&(w.status=103)}else w.status=103;if(w.status===103&&(w.gzhead.hcrc?(w.pending+2>w.pending_buf_size&&D(u),w.pending+2<=w.pending_buf_size&&(te(w,255&u.adler),te(w,u.adler>>8&255),u.adler=0,w.status=F)):w.status=F),w.pending!==0){if(D(u),u.avail_out===0)return w.last_flush=-1,d}else if(u.avail_in===0&&H(M)<=H(B)&&M!==h)return le(u,-5);if(w.status===666&&u.avail_in!==0)return le(u,-5);if(u.avail_in!==0||w.lookahead!==0||M!==l&&w.status!==666){var j=w.strategy===2?(function(A,$){for(var K;;){if(A.lookahead===0&&(Ce(A),A.lookahead===0)){if($===l)return y;break}if(A.match_length=0,K=o._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++,K&&(R(A,!1),A.strm.avail_out===0))return y}return A.insert=0,$===h?(R(A,!0),A.strm.avail_out===0?ae:V):A.last_lit&&(R(A,!1),A.strm.avail_out===0)?y:U})(w,M):w.strategy===3?(function(A,$){for(var K,W,re,ke,ue=A.window;;){if(A.lookahead<=z){if(Ce(A),A.lookahead<=z&&$===l)return y;if(A.lookahead===0)break}if(A.match_length=0,A.lookahead>=P&&0<A.strstart&&(W=ue[re=A.strstart-1])===ue[++re]&&W===ue[++re]&&W===ue[++re]){ke=A.strstart+z;do;while(W===ue[++re]&&W===ue[++re]&&W===ue[++re]&&W===ue[++re]&&W===ue[++re]&&W===ue[++re]&&W===ue[++re]&&W===ue[++re]&&re<ke);A.match_length=z-(ke-re),A.match_length>A.lookahead&&(A.match_length=A.lookahead)}if(A.match_length>=P?(K=o._tr_tally(A,1,A.match_length-P),A.lookahead-=A.match_length,A.strstart+=A.match_length,A.match_length=0):(K=o._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++),K&&(R(A,!1),A.strm.avail_out===0))return y}return A.insert=0,$===h?(R(A,!0),A.strm.avail_out===0?ae:V):A.last_lit&&(R(A,!1),A.strm.avail_out===0)?y:U})(w,M):n[w.level].func(w,M);if(j!==ae&&j!==V||(w.status=666),j===y||j===ae)return u.avail_out===0&&(w.last_flush=-1),d;if(j===U&&(M===1?o._tr_align(w):M!==5&&(o._tr_stored_block(w,0,0,!1),M===3&&(oe(w.head),w.lookahead===0&&(w.strstart=0,w.block_start=0,w.insert=0))),D(u),u.avail_out===0))return w.last_flush=-1,d}return M!==h?d:w.wrap<=0?1:(w.wrap===2?(te(w,255&u.adler),te(w,u.adler>>8&255),te(w,u.adler>>16&255),te(w,u.adler>>24&255),te(w,255&u.total_in),te(w,u.total_in>>8&255),te(w,u.total_in>>16&255),te(w,u.total_in>>24&255)):(q(w,u.adler>>>16),q(w,65535&u.adler)),D(u),0<w.wrap&&(w.wrap=-w.wrap),w.pending!==0?d:1)},r.deflateEnd=function(u){var M;return u&&u.state?(M=u.state.status)!==E&&M!==69&&M!==73&&M!==91&&M!==103&&M!==F&&M!==666?le(u,m):(u.state=null,M===F?le(u,-3):d):m},r.deflateSetDictionary=function(u,M){var B,w,_,C,N,j,A,$,K=M.length;if(!u||!u.state||(C=(B=u.state).wrap)===2||C===1&&B.status!==E||B.lookahead)return m;for(C===1&&(u.adler=s(u.adler,M,K,0)),B.wrap=0,K>=B.w_size&&(C===0&&(oe(B.head),B.strstart=0,B.block_start=0,B.insert=0),$=new i.Buf8(B.w_size),i.arraySet($,M,K-B.w_size,B.w_size,0),M=$,K=B.w_size),N=u.avail_in,j=u.next_in,A=u.input,u.avail_in=K,u.next_in=0,u.input=M,Ce(B);B.lookahead>=P;){for(w=B.strstart,_=B.lookahead-(P-1);B.ins_h=(B.ins_h<<B.hash_shift^B.window[w+P-1])&B.hash_mask,B.prev[w&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=w,w++,--_;);B.strstart=w,B.lookahead=P-1,Ce(B)}return B.strstart+=B.lookahead,B.block_start=B.strstart,B.insert=B.lookahead,B.lookahead=0,B.match_length=B.prev_length=P-1,B.match_available=0,u.next_in=j,u.input=A,u.avail_in=N,B.wrap=C,d},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,r){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,r){"use strict";t.exports=function(n,i){var o,s,a,c,l,h,d,m,p,g,f,b,v,k,S,I,x,O,P,z,Z,E,F,y,U;o=n.state,s=n.next_in,y=n.input,a=s+(n.avail_in-5),c=n.next_out,U=n.output,l=c-(i-n.avail_out),h=c+(n.avail_out-257),d=o.dmax,m=o.wsize,p=o.whave,g=o.wnext,f=o.window,b=o.hold,v=o.bits,k=o.lencode,S=o.distcode,I=(1<<o.lenbits)-1,x=(1<<o.distbits)-1;e:do{v<15&&(b+=y[s++]<<v,v+=8,b+=y[s++]<<v,v+=8),O=k[b&I];t:for(;;){if(b>>>=P=O>>>24,v-=P,(P=O>>>16&255)===0)U[c++]=65535&O;else{if(!(16&P)){if((64&P)==0){O=k[(65535&O)+(b&(1<<P)-1)];continue t}if(32&P){o.mode=12;break e}n.msg="invalid literal/length code",o.mode=30;break e}z=65535&O,(P&=15)&&(v<P&&(b+=y[s++]<<v,v+=8),z+=b&(1<<P)-1,b>>>=P,v-=P),v<15&&(b+=y[s++]<<v,v+=8,b+=y[s++]<<v,v+=8),O=S[b&x];r:for(;;){if(b>>>=P=O>>>24,v-=P,!(16&(P=O>>>16&255))){if((64&P)==0){O=S[(65535&O)+(b&(1<<P)-1)];continue r}n.msg="invalid distance code",o.mode=30;break e}if(Z=65535&O,v<(P&=15)&&(b+=y[s++]<<v,(v+=8)<P&&(b+=y[s++]<<v,v+=8)),d<(Z+=b&(1<<P)-1)){n.msg="invalid distance too far back",o.mode=30;break e}if(b>>>=P,v-=P,(P=c-l)<Z){if(p<(P=Z-P)&&o.sane){n.msg="invalid distance too far back",o.mode=30;break e}if(F=f,(E=0)===g){if(E+=m-P,P<z){for(z-=P;U[c++]=f[E++],--P;);E=c-Z,F=U}}else if(g<P){if(E+=m+g-P,(P-=g)<z){for(z-=P;U[c++]=f[E++],--P;);if(E=0,g<z){for(z-=P=g;U[c++]=f[E++],--P;);E=c-Z,F=U}}}else if(E+=g-P,P<z){for(z-=P;U[c++]=f[E++],--P;);E=c-Z,F=U}for(;2<z;)U[c++]=F[E++],U[c++]=F[E++],U[c++]=F[E++],z-=3;z&&(U[c++]=F[E++],1<z&&(U[c++]=F[E++]))}else{for(E=c-Z;U[c++]=U[E++],U[c++]=U[E++],U[c++]=U[E++],2<(z-=3););z&&(U[c++]=U[E++],1<z&&(U[c++]=U[E++]))}break}}break}}while(s<a&&c<h);s-=z=v>>3,b&=(1<<(v-=z<<3))-1,n.next_in=s,n.next_out=c,n.avail_in=s<a?a-s+5:5-(s-a),n.avail_out=c<h?h-c+257:257-(c-h),o.hold=b,o.bits=v}},{}],49:[function(e,t,r){"use strict";var n=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),s=e("./inffast"),a=e("./inftrees"),c=1,l=2,h=0,d=-2,m=1,p=852,g=592;function f(E){return(E>>>24&255)+(E>>>8&65280)+((65280&E)<<8)+((255&E)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(E){var F;return E&&E.state?(F=E.state,E.total_in=E.total_out=F.total=0,E.msg="",F.wrap&&(E.adler=1&F.wrap),F.mode=m,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new n.Buf32(p),F.distcode=F.distdyn=new n.Buf32(g),F.sane=1,F.back=-1,h):d}function k(E){var F;return E&&E.state?((F=E.state).wsize=0,F.whave=0,F.wnext=0,v(E)):d}function S(E,F){var y,U;return E&&E.state?(U=E.state,F<0?(y=0,F=-F):(y=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15<F)?d:(U.window!==null&&U.wbits!==F&&(U.window=null),U.wrap=y,U.wbits=F,k(E))):d}function I(E,F){var y,U;return E?(U=new b,(E.state=U).window=null,(y=S(E,F))!==h&&(E.state=null),y):d}var x,O,P=!0;function z(E){if(P){var F;for(x=new n.Buf32(512),O=new n.Buf32(32),F=0;F<144;)E.lens[F++]=8;for(;F<256;)E.lens[F++]=9;for(;F<280;)E.lens[F++]=7;for(;F<288;)E.lens[F++]=8;for(a(c,E.lens,0,288,x,0,E.work,{bits:9}),F=0;F<32;)E.lens[F++]=5;a(l,E.lens,0,32,O,0,E.work,{bits:5}),P=!1}E.lencode=x,E.lenbits=9,E.distcode=O,E.distbits=5}function Z(E,F,y,U){var ae,V=E.state;return V.window===null&&(V.wsize=1<<V.wbits,V.wnext=0,V.whave=0,V.window=new n.Buf8(V.wsize)),U>=V.wsize?(n.arraySet(V.window,F,y-V.wsize,V.wsize,0),V.wnext=0,V.whave=V.wsize):(U<(ae=V.wsize-V.wnext)&&(ae=U),n.arraySet(V.window,F,y-U,ae,V.wnext),(U-=ae)?(n.arraySet(V.window,F,y-U,U,0),V.wnext=U,V.whave=V.wsize):(V.wnext+=ae,V.wnext===V.wsize&&(V.wnext=0),V.whave<V.wsize&&(V.whave+=ae))),0}r.inflateReset=k,r.inflateReset2=S,r.inflateResetKeep=v,r.inflateInit=function(E){return I(E,15)},r.inflateInit2=I,r.inflate=function(E,F){var y,U,ae,V,le,H,oe,D,R,te,q,G,Ce,Ke,de,ge,Xe,ve,it,ut,u,M,B,w,_=0,C=new n.Buf8(4),N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!E||!E.state||!E.output||!E.input&&E.avail_in!==0)return d;(y=E.state).mode===12&&(y.mode=13),le=E.next_out,ae=E.output,oe=E.avail_out,V=E.next_in,U=E.input,H=E.avail_in,D=y.hold,R=y.bits,te=H,q=oe,M=h;e:for(;;)switch(y.mode){case m:if(y.wrap===0){y.mode=13;break}for(;R<16;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(2&y.wrap&&D===35615){C[y.check=0]=255&D,C[1]=D>>>8&255,y.check=o(y.check,C,2,0),R=D=0,y.mode=2;break}if(y.flags=0,y.head&&(y.head.done=!1),!(1&y.wrap)||(((255&D)<<8)+(D>>8))%31){E.msg="incorrect header check",y.mode=30;break}if((15&D)!=8){E.msg="unknown compression method",y.mode=30;break}if(R-=4,u=8+(15&(D>>>=4)),y.wbits===0)y.wbits=u;else if(u>y.wbits){E.msg="invalid window size",y.mode=30;break}y.dmax=1<<u,E.adler=y.check=1,y.mode=512&D?10:12,R=D=0;break;case 2:for(;R<16;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(y.flags=D,(255&y.flags)!=8){E.msg="unknown compression method",y.mode=30;break}if(57344&y.flags){E.msg="unknown header flags set",y.mode=30;break}y.head&&(y.head.text=D>>8&1),512&y.flags&&(C[0]=255&D,C[1]=D>>>8&255,y.check=o(y.check,C,2,0)),R=D=0,y.mode=3;case 3:for(;R<32;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}y.head&&(y.head.time=D),512&y.flags&&(C[0]=255&D,C[1]=D>>>8&255,C[2]=D>>>16&255,C[3]=D>>>24&255,y.check=o(y.check,C,4,0)),R=D=0,y.mode=4;case 4:for(;R<16;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}y.head&&(y.head.xflags=255&D,y.head.os=D>>8),512&y.flags&&(C[0]=255&D,C[1]=D>>>8&255,y.check=o(y.check,C,2,0)),R=D=0,y.mode=5;case 5:if(1024&y.flags){for(;R<16;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}y.length=D,y.head&&(y.head.extra_len=D),512&y.flags&&(C[0]=255&D,C[1]=D>>>8&255,y.check=o(y.check,C,2,0)),R=D=0}else y.head&&(y.head.extra=null);y.mode=6;case 6:if(1024&y.flags&&(H<(G=y.length)&&(G=H),G&&(y.head&&(u=y.head.extra_len-y.length,y.head.extra||(y.head.extra=new Array(y.head.extra_len)),n.arraySet(y.head.extra,U,V,G,u)),512&y.flags&&(y.check=o(y.check,U,G,V)),H-=G,V+=G,y.length-=G),y.length))break e;y.length=0,y.mode=7;case 7:if(2048&y.flags){if(H===0)break e;for(G=0;u=U[V+G++],y.head&&u&&y.length<65536&&(y.head.name+=String.fromCharCode(u)),u&&G<H;);if(512&y.flags&&(y.check=o(y.check,U,G,V)),H-=G,V+=G,u)break e}else y.head&&(y.head.name=null);y.length=0,y.mode=8;case 8:if(4096&y.flags){if(H===0)break e;for(G=0;u=U[V+G++],y.head&&u&&y.length<65536&&(y.head.comment+=String.fromCharCode(u)),u&&G<H;);if(512&y.flags&&(y.check=o(y.check,U,G,V)),H-=G,V+=G,u)break e}else y.head&&(y.head.comment=null);y.mode=9;case 9:if(512&y.flags){for(;R<16;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(D!==(65535&y.check)){E.msg="header crc mismatch",y.mode=30;break}R=D=0}y.head&&(y.head.hcrc=y.flags>>9&1,y.head.done=!0),E.adler=y.check=0,y.mode=12;break;case 10:for(;R<32;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}E.adler=y.check=f(D),R=D=0,y.mode=11;case 11:if(y.havedict===0)return E.next_out=le,E.avail_out=oe,E.next_in=V,E.avail_in=H,y.hold=D,y.bits=R,2;E.adler=y.check=1,y.mode=12;case 12:if(F===5||F===6)break e;case 13:if(y.last){D>>>=7&R,R-=7&R,y.mode=27;break}for(;R<3;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}switch(y.last=1&D,R-=1,3&(D>>>=1)){case 0:y.mode=14;break;case 1:if(z(y),y.mode=20,F!==6)break;D>>>=2,R-=2;break e;case 2:y.mode=17;break;case 3:E.msg="invalid block type",y.mode=30}D>>>=2,R-=2;break;case 14:for(D>>>=7&R,R-=7&R;R<32;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if((65535&D)!=(D>>>16^65535)){E.msg="invalid stored block lengths",y.mode=30;break}if(y.length=65535&D,R=D=0,y.mode=15,F===6)break e;case 15:y.mode=16;case 16:if(G=y.length){if(H<G&&(G=H),oe<G&&(G=oe),G===0)break e;n.arraySet(ae,U,V,G,le),H-=G,V+=G,oe-=G,le+=G,y.length-=G;break}y.mode=12;break;case 17:for(;R<14;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(y.nlen=257+(31&D),D>>>=5,R-=5,y.ndist=1+(31&D),D>>>=5,R-=5,y.ncode=4+(15&D),D>>>=4,R-=4,286<y.nlen||30<y.ndist){E.msg="too many length or distance symbols",y.mode=30;break}y.have=0,y.mode=18;case 18:for(;y.have<y.ncode;){for(;R<3;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}y.lens[N[y.have++]]=7&D,D>>>=3,R-=3}for(;y.have<19;)y.lens[N[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,B={bits:y.lenbits},M=a(0,y.lens,0,19,y.lencode,0,y.work,B),y.lenbits=B.bits,M){E.msg="invalid code lengths set",y.mode=30;break}y.have=0,y.mode=19;case 19:for(;y.have<y.nlen+y.ndist;){for(;ge=(_=y.lencode[D&(1<<y.lenbits)-1])>>>16&255,Xe=65535&_,!((de=_>>>24)<=R);){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(Xe<16)D>>>=de,R-=de,y.lens[y.have++]=Xe;else{if(Xe===16){for(w=de+2;R<w;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(D>>>=de,R-=de,y.have===0){E.msg="invalid bit length repeat",y.mode=30;break}u=y.lens[y.have-1],G=3+(3&D),D>>>=2,R-=2}else if(Xe===17){for(w=de+3;R<w;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}R-=de,u=0,G=3+(7&(D>>>=de)),D>>>=3,R-=3}else{for(w=de+7;R<w;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}R-=de,u=0,G=11+(127&(D>>>=de)),D>>>=7,R-=7}if(y.have+G>y.nlen+y.ndist){E.msg="invalid bit length repeat",y.mode=30;break}for(;G--;)y.lens[y.have++]=u}}if(y.mode===30)break;if(y.lens[256]===0){E.msg="invalid code -- missing end-of-block",y.mode=30;break}if(y.lenbits=9,B={bits:y.lenbits},M=a(c,y.lens,0,y.nlen,y.lencode,0,y.work,B),y.lenbits=B.bits,M){E.msg="invalid literal/lengths set",y.mode=30;break}if(y.distbits=6,y.distcode=y.distdyn,B={bits:y.distbits},M=a(l,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,B),y.distbits=B.bits,M){E.msg="invalid distances set",y.mode=30;break}if(y.mode=20,F===6)break e;case 20:y.mode=21;case 21:if(6<=H&&258<=oe){E.next_out=le,E.avail_out=oe,E.next_in=V,E.avail_in=H,y.hold=D,y.bits=R,s(E,q),le=E.next_out,ae=E.output,oe=E.avail_out,V=E.next_in,U=E.input,H=E.avail_in,D=y.hold,R=y.bits,y.mode===12&&(y.back=-1);break}for(y.back=0;ge=(_=y.lencode[D&(1<<y.lenbits)-1])>>>16&255,Xe=65535&_,!((de=_>>>24)<=R);){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(ge&&(240&ge)==0){for(ve=de,it=ge,ut=Xe;ge=(_=y.lencode[ut+((D&(1<<ve+it)-1)>>ve)])>>>16&255,Xe=65535&_,!(ve+(de=_>>>24)<=R);){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}D>>>=ve,R-=ve,y.back+=ve}if(D>>>=de,R-=de,y.back+=de,y.length=Xe,ge===0){y.mode=26;break}if(32&ge){y.back=-1,y.mode=12;break}if(64&ge){E.msg="invalid literal/length code",y.mode=30;break}y.extra=15&ge,y.mode=22;case 22:if(y.extra){for(w=y.extra;R<w;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}y.length+=D&(1<<y.extra)-1,D>>>=y.extra,R-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=23;case 23:for(;ge=(_=y.distcode[D&(1<<y.distbits)-1])>>>16&255,Xe=65535&_,!((de=_>>>24)<=R);){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if((240&ge)==0){for(ve=de,it=ge,ut=Xe;ge=(_=y.distcode[ut+((D&(1<<ve+it)-1)>>ve)])>>>16&255,Xe=65535&_,!(ve+(de=_>>>24)<=R);){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}D>>>=ve,R-=ve,y.back+=ve}if(D>>>=de,R-=de,y.back+=de,64&ge){E.msg="invalid distance code",y.mode=30;break}y.offset=Xe,y.extra=15&ge,y.mode=24;case 24:if(y.extra){for(w=y.extra;R<w;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}y.offset+=D&(1<<y.extra)-1,D>>>=y.extra,R-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){E.msg="invalid distance too far back",y.mode=30;break}y.mode=25;case 25:if(oe===0)break e;if(G=q-oe,y.offset>G){if((G=y.offset-G)>y.whave&&y.sane){E.msg="invalid distance too far back",y.mode=30;break}Ce=G>y.wnext?(G-=y.wnext,y.wsize-G):y.wnext-G,G>y.length&&(G=y.length),Ke=y.window}else Ke=ae,Ce=le-y.offset,G=y.length;for(oe<G&&(G=oe),oe-=G,y.length-=G;ae[le++]=Ke[Ce++],--G;);y.length===0&&(y.mode=21);break;case 26:if(oe===0)break e;ae[le++]=y.length,oe--,y.mode=21;break;case 27:if(y.wrap){for(;R<32;){if(H===0)break e;H--,D|=U[V++]<<R,R+=8}if(q-=oe,E.total_out+=q,y.total+=q,q&&(E.adler=y.check=y.flags?o(y.check,ae,q,le-q):i(y.check,ae,q,le-q)),q=oe,(y.flags?D:f(D))!==y.check){E.msg="incorrect data check",y.mode=30;break}R=D=0}y.mode=28;case 28:if(y.wrap&&y.flags){for(;R<32;){if(H===0)break e;H--,D+=U[V++]<<R,R+=8}if(D!==(4294967295&y.total)){E.msg="incorrect length check",y.mode=30;break}R=D=0}y.mode=29;case 29:M=1;break e;case 30:M=-3;break e;case 31:return-4;case 32:default:return d}return E.next_out=le,E.avail_out=oe,E.next_in=V,E.avail_in=H,y.hold=D,y.bits=R,(y.wsize||q!==E.avail_out&&y.mode<30&&(y.mode<27||F!==4))&&Z(E,E.output,E.next_out,q-E.avail_out)?(y.mode=31,-4):(te-=E.avail_in,q-=E.avail_out,E.total_in+=te,E.total_out+=q,y.total+=q,y.wrap&&q&&(E.adler=y.check=y.flags?o(y.check,ae,q,E.next_out-q):i(y.check,ae,q,E.next_out-q)),E.data_type=y.bits+(y.last?64:0)+(y.mode===12?128:0)+(y.mode===20||y.mode===15?256:0),(te==0&&q===0||F===4)&&M===h&&(M=-5),M)},r.inflateEnd=function(E){if(!E||!E.state)return d;var F=E.state;return F.window&&(F.window=null),E.state=null,h},r.inflateGetHeader=function(E,F){var y;return E&&E.state?(2&(y=E.state).wrap)==0?d:((y.head=F).done=!1,h):d},r.inflateSetDictionary=function(E,F){var y,U=F.length;return E&&E.state?(y=E.state).wrap!==0&&y.mode!==11?d:y.mode===11&&i(1,F,U,0)!==y.check?-3:Z(E,F,U,U)?(y.mode=31,-4):(y.havedict=1,h):d},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,r){"use strict";var n=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(c,l,h,d,m,p,g,f){var b,v,k,S,I,x,O,P,z,Z=f.bits,E=0,F=0,y=0,U=0,ae=0,V=0,le=0,H=0,oe=0,D=0,R=null,te=0,q=new n.Buf16(16),G=new n.Buf16(16),Ce=null,Ke=0;for(E=0;E<=15;E++)q[E]=0;for(F=0;F<d;F++)q[l[h+F]]++;for(ae=Z,U=15;1<=U&&q[U]===0;U--);if(U<ae&&(ae=U),U===0)return m[p++]=20971520,m[p++]=20971520,f.bits=1,0;for(y=1;y<U&&q[y]===0;y++);for(ae<y&&(ae=y),E=H=1;E<=15;E++)if(H<<=1,(H-=q[E])<0)return-1;if(0<H&&(c===0||U!==1))return-1;for(G[1]=0,E=1;E<15;E++)G[E+1]=G[E]+q[E];for(F=0;F<d;F++)l[h+F]!==0&&(g[G[l[h+F]]++]=F);if(x=c===0?(R=Ce=g,19):c===1?(R=i,te-=257,Ce=o,Ke-=257,256):(R=s,Ce=a,-1),E=y,I=p,le=F=D=0,k=-1,S=(oe=1<<(V=ae))-1,c===1&&852<oe||c===2&&592<oe)return 1;for(;;){for(O=E-le,z=g[F]<x?(P=0,g[F]):g[F]>x?(P=Ce[Ke+g[F]],R[te+g[F]]):(P=96,0),b=1<<E-le,y=v=1<<V;m[I+(D>>le)+(v-=b)]=O<<24|P<<16|z|0,v!==0;);for(b=1<<E-1;D&b;)b>>=1;if(b!==0?(D&=b-1,D+=b):D=0,F++,--q[E]==0){if(E===U)break;E=l[h+g[F]]}if(ae<E&&(D&S)!==k){for(le===0&&(le=ae),I+=y,H=1<<(V=E-le);V+le<U&&!((H-=q[V+le])<=0);)V++,H<<=1;if(oe+=1<<V,c===1&&852<oe||c===2&&592<oe)return 1;m[k=D&S]=ae<<24|V<<16|I-p|0}}return D!==0&&(m[I+D]=E-le<<24|64<<16|0),f.bits=ae,0}},{"../utils/common":41}],51:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,r){"use strict";var n=e("../utils/common"),i=0,o=1;function s(_){for(var C=_.length;0<=--C;)_[C]=0}var a=0,c=29,l=256,h=l+1+c,d=30,m=19,p=2*h+1,g=15,f=16,b=7,v=256,k=16,S=17,I=18,x=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],O=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Z=new Array(2*(h+2));s(Z);var E=new Array(2*d);s(E);var F=new Array(512);s(F);var y=new Array(256);s(y);var U=new Array(c);s(U);var ae,V,le,H=new Array(d);function oe(_,C,N,j,A){this.static_tree=_,this.extra_bits=C,this.extra_base=N,this.elems=j,this.max_length=A,this.has_stree=_&&_.length}function D(_,C){this.dyn_tree=_,this.max_code=0,this.stat_desc=C}function R(_){return _<256?F[_]:F[256+(_>>>7)]}function te(_,C){_.pending_buf[_.pending++]=255&C,_.pending_buf[_.pending++]=C>>>8&255}function q(_,C,N){_.bi_valid>f-N?(_.bi_buf|=C<<_.bi_valid&65535,te(_,_.bi_buf),_.bi_buf=C>>f-_.bi_valid,_.bi_valid+=N-f):(_.bi_buf|=C<<_.bi_valid&65535,_.bi_valid+=N)}function G(_,C,N){q(_,N[2*C],N[2*C+1])}function Ce(_,C){for(var N=0;N|=1&_,_>>>=1,N<<=1,0<--C;);return N>>>1}function Ke(_,C,N){var j,A,$=new Array(g+1),K=0;for(j=1;j<=g;j++)$[j]=K=K+N[j-1]<<1;for(A=0;A<=C;A++){var W=_[2*A+1];W!==0&&(_[2*A]=Ce($[W]++,W))}}function de(_){var C;for(C=0;C<h;C++)_.dyn_ltree[2*C]=0;for(C=0;C<d;C++)_.dyn_dtree[2*C]=0;for(C=0;C<m;C++)_.bl_tree[2*C]=0;_.dyn_ltree[2*v]=1,_.opt_len=_.static_len=0,_.last_lit=_.matches=0}function ge(_){8<_.bi_valid?te(_,_.bi_buf):0<_.bi_valid&&(_.pending_buf[_.pending++]=_.bi_buf),_.bi_buf=0,_.bi_valid=0}function Xe(_,C,N,j){var A=2*C,$=2*N;return _[A]<_[$]||_[A]===_[$]&&j[C]<=j[N]}function ve(_,C,N){for(var j=_.heap[N],A=N<<1;A<=_.heap_len&&(A<_.heap_len&&Xe(C,_.heap[A+1],_.heap[A],_.depth)&&A++,!Xe(C,j,_.heap[A],_.depth));)_.heap[N]=_.heap[A],N=A,A<<=1;_.heap[N]=j}function it(_,C,N){var j,A,$,K,W=0;if(_.last_lit!==0)for(;j=_.pending_buf[_.d_buf+2*W]<<8|_.pending_buf[_.d_buf+2*W+1],A=_.pending_buf[_.l_buf+W],W++,j===0?G(_,A,C):(G(_,($=y[A])+l+1,C),(K=x[$])!==0&&q(_,A-=U[$],K),G(_,$=R(--j),N),(K=O[$])!==0&&q(_,j-=H[$],K)),W<_.last_lit;);G(_,v,C)}function ut(_,C){var N,j,A,$=C.dyn_tree,K=C.stat_desc.static_tree,W=C.stat_desc.has_stree,re=C.stat_desc.elems,ke=-1;for(_.heap_len=0,_.heap_max=p,N=0;N<re;N++)$[2*N]!==0?(_.heap[++_.heap_len]=ke=N,_.depth[N]=0):$[2*N+1]=0;for(;_.heap_len<2;)$[2*(A=_.heap[++_.heap_len]=ke<2?++ke:0)]=1,_.depth[A]=0,_.opt_len--,W&&(_.static_len-=K[2*A+1]);for(C.max_code=ke,N=_.heap_len>>1;1<=N;N--)ve(_,$,N);for(A=re;N=_.heap[1],_.heap[1]=_.heap[_.heap_len--],ve(_,$,1),j=_.heap[1],_.heap[--_.heap_max]=N,_.heap[--_.heap_max]=j,$[2*A]=$[2*N]+$[2*j],_.depth[A]=(_.depth[N]>=_.depth[j]?_.depth[N]:_.depth[j])+1,$[2*N+1]=$[2*j+1]=A,_.heap[1]=A++,ve(_,$,1),2<=_.heap_len;);_.heap[--_.heap_max]=_.heap[1],(function(ue,kt){var qt,Kt,Ar,Ie,Pn,oi,gt=kt.dyn_tree,ys=kt.max_code,Dn=kt.stat_desc.static_tree,ll=kt.stat_desc.has_stree,On=kt.stat_desc.extra_bits,bs=kt.stat_desc.extra_base,zr=kt.stat_desc.max_length,si=0;for(Ie=0;Ie<=g;Ie++)ue.bl_count[Ie]=0;for(gt[2*ue.heap[ue.heap_max]+1]=0,qt=ue.heap_max+1;qt<p;qt++)zr<(Ie=gt[2*gt[2*(Kt=ue.heap[qt])+1]+1]+1)&&(Ie=zr,si++),gt[2*Kt+1]=Ie,ys<Kt||(ue.bl_count[Ie]++,Pn=0,bs<=Kt&&(Pn=On[Kt-bs]),oi=gt[2*Kt],ue.opt_len+=oi*(Ie+Pn),ll&&(ue.static_len+=oi*(Dn[2*Kt+1]+Pn)));if(si!==0){do{for(Ie=zr-1;ue.bl_count[Ie]===0;)Ie--;ue.bl_count[Ie]--,ue.bl_count[Ie+1]+=2,ue.bl_count[zr]--,si-=2}while(0<si);for(Ie=zr;Ie!==0;Ie--)for(Kt=ue.bl_count[Ie];Kt!==0;)ys<(Ar=ue.heap[--qt])||(gt[2*Ar+1]!==Ie&&(ue.opt_len+=(Ie-gt[2*Ar+1])*gt[2*Ar],gt[2*Ar+1]=Ie),Kt--)}})(_,C),Ke($,ke,_.bl_count)}function u(_,C,N){var j,A,$=-1,K=C[1],W=0,re=7,ke=4;for(K===0&&(re=138,ke=3),C[2*(N+1)+1]=65535,j=0;j<=N;j++)A=K,K=C[2*(j+1)+1],++W<re&&A===K||(W<ke?_.bl_tree[2*A]+=W:A!==0?(A!==$&&_.bl_tree[2*A]++,_.bl_tree[2*k]++):W<=10?_.bl_tree[2*S]++:_.bl_tree[2*I]++,$=A,ke=(W=0)===K?(re=138,3):A===K?(re=6,3):(re=7,4))}function M(_,C,N){var j,A,$=-1,K=C[1],W=0,re=7,ke=4;for(K===0&&(re=138,ke=3),j=0;j<=N;j++)if(A=K,K=C[2*(j+1)+1],!(++W<re&&A===K)){if(W<ke)for(;G(_,A,_.bl_tree),--W!=0;);else A!==0?(A!==$&&(G(_,A,_.bl_tree),W--),G(_,k,_.bl_tree),q(_,W-3,2)):W<=10?(G(_,S,_.bl_tree),q(_,W-3,3)):(G(_,I,_.bl_tree),q(_,W-11,7));$=A,ke=(W=0)===K?(re=138,3):A===K?(re=6,3):(re=7,4)}}s(H);var B=!1;function w(_,C,N,j){q(_,(a<<1)+(j?1:0),3),(function(A,$,K,W){ge(A),W&&(te(A,K),te(A,~K)),n.arraySet(A.pending_buf,A.window,$,K,A.pending),A.pending+=K})(_,C,N,!0)}r._tr_init=function(_){B||((function(){var C,N,j,A,$,K=new Array(g+1);for(A=j=0;A<c-1;A++)for(U[A]=j,C=0;C<1<<x[A];C++)y[j++]=A;for(y[j-1]=A,A=$=0;A<16;A++)for(H[A]=$,C=0;C<1<<O[A];C++)F[$++]=A;for($>>=7;A<d;A++)for(H[A]=$<<7,C=0;C<1<<O[A]-7;C++)F[256+$++]=A;for(N=0;N<=g;N++)K[N]=0;for(C=0;C<=143;)Z[2*C+1]=8,C++,K[8]++;for(;C<=255;)Z[2*C+1]=9,C++,K[9]++;for(;C<=279;)Z[2*C+1]=7,C++,K[7]++;for(;C<=287;)Z[2*C+1]=8,C++,K[8]++;for(Ke(Z,h+1,K),C=0;C<d;C++)E[2*C+1]=5,E[2*C]=Ce(C,5);ae=new oe(Z,x,l+1,h,g),V=new oe(E,O,0,d,g),le=new oe(new Array(0),P,0,m,b)})(),B=!0),_.l_desc=new D(_.dyn_ltree,ae),_.d_desc=new D(_.dyn_dtree,V),_.bl_desc=new D(_.bl_tree,le),_.bi_buf=0,_.bi_valid=0,de(_)},r._tr_stored_block=w,r._tr_flush_block=function(_,C,N,j){var A,$,K=0;0<_.level?(_.strm.data_type===2&&(_.strm.data_type=(function(W){var re,ke=4093624447;for(re=0;re<=31;re++,ke>>>=1)if(1&ke&&W.dyn_ltree[2*re]!==0)return i;if(W.dyn_ltree[18]!==0||W.dyn_ltree[20]!==0||W.dyn_ltree[26]!==0)return o;for(re=32;re<l;re++)if(W.dyn_ltree[2*re]!==0)return o;return i})(_)),ut(_,_.l_desc),ut(_,_.d_desc),K=(function(W){var re;for(u(W,W.dyn_ltree,W.l_desc.max_code),u(W,W.dyn_dtree,W.d_desc.max_code),ut(W,W.bl_desc),re=m-1;3<=re&&W.bl_tree[2*z[re]+1]===0;re--);return W.opt_len+=3*(re+1)+5+5+4,re})(_),A=_.opt_len+3+7>>>3,($=_.static_len+3+7>>>3)<=A&&(A=$)):A=$=N+5,N+4<=A&&C!==-1?w(_,C,N,j):_.strategy===4||$===A?(q(_,2+(j?1:0),3),it(_,Z,E)):(q(_,4+(j?1:0),3),(function(W,re,ke,ue){var kt;for(q(W,re-257,5),q(W,ke-1,5),q(W,ue-4,4),kt=0;kt<ue;kt++)q(W,W.bl_tree[2*z[kt]+1],3);M(W,W.dyn_ltree,re-1),M(W,W.dyn_dtree,ke-1)})(_,_.l_desc.max_code+1,_.d_desc.max_code+1,K+1),it(_,_.dyn_ltree,_.dyn_dtree)),de(_),j&&ge(_)},r._tr_tally=function(_,C,N){return _.pending_buf[_.d_buf+2*_.last_lit]=C>>>8&255,_.pending_buf[_.d_buf+2*_.last_lit+1]=255&C,_.pending_buf[_.l_buf+_.last_lit]=255&N,_.last_lit++,C===0?_.dyn_ltree[2*N]++:(_.matches++,C--,_.dyn_ltree[2*(y[N]+l+1)]++,_.dyn_dtree[2*R(C)]++),_.last_lit===_.lit_bufsize-1},r._tr_align=function(_){q(_,2,3),G(_,v,Z),(function(C){C.bi_valid===16?(te(C,C.bi_buf),C.bi_buf=0,C.bi_valid=0):8<=C.bi_valid&&(C.pending_buf[C.pending++]=255&C.bi_buf,C.bi_buf>>=8,C.bi_valid-=8)})(_)}},{"../utils/common":41}],53:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){(function(n){(function(i,o){"use strict";if(!i.setImmediate){var s,a,c,l,h=1,d={},m=!1,p=i.document,g=Object.getPrototypeOf&&Object.getPrototypeOf(i);g=g&&g.setTimeout?g:i,s={}.toString.call(i.process)==="[object process]"?function(k){process.nextTick(function(){b(k)})}:(function(){if(i.postMessage&&!i.importScripts){var k=!0,S=i.onmessage;return i.onmessage=function(){k=!1},i.postMessage("","*"),i.onmessage=S,k}})()?(l="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",v,!1):i.attachEvent("onmessage",v),function(k){i.postMessage(l+k,"*")}):i.MessageChannel?((c=new MessageChannel).port1.onmessage=function(k){b(k.data)},function(k){c.port2.postMessage(k)}):p&&"onreadystatechange"in p.createElement("script")?(a=p.documentElement,function(k){var S=p.createElement("script");S.onreadystatechange=function(){b(k),S.onreadystatechange=null,a.removeChild(S),S=null},a.appendChild(S)}):function(k){setTimeout(b,0,k)},g.setImmediate=function(k){typeof k!="function"&&(k=new Function(""+k));for(var S=new Array(arguments.length-1),I=0;I<S.length;I++)S[I]=arguments[I+1];var x={callback:k,args:S};return d[h]=x,s(h),h++},g.clearImmediate=f}function f(k){delete d[k]}function b(k){if(m)setTimeout(b,0,k);else{var S=d[k];if(S){m=!0;try{(function(I){var x=I.callback,O=I.args;switch(O.length){case 0:x();break;case 1:x(O[0]);break;case 2:x(O[0],O[1]);break;case 3:x(O[0],O[1],O[2]);break;default:x.apply(o,O)}})(S)}finally{f(k),m=!1}}}}function v(k){k.source===i&&typeof k.data=="string"&&k.data.indexOf(l)===0&&b(+k.data.slice(l.length))}})(typeof self>"u"?n===void 0?this:n:self)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})});var s0=_e((Sd,kd)=>{(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof Sd<"u"?t():(t(),e.FileSaver={})})(Sd,function(){"use strict";function e(a,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function t(a,c,l){var h=new XMLHttpRequest;h.open("GET",a),h.responseType="blob",h.onload=function(){s(h.response,c,l)},h.onerror=function(){console.error("could not download file")},h.send()}function r(a){var c=new XMLHttpRequest;c.open("HEAD",a,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function n(a){try{a.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(c)}}var i=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,o=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=i.saveAs||(typeof window!="object"||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(a,c,l){var h=i.URL||i.webkitURL,d=document.createElement("a");c=c||a.name||"download",d.download=c,d.rel="noopener",typeof a=="string"?(d.href=a,d.origin===location.origin?n(d):r(d.href)?t(a,c,l):n(d,d.target="_blank")):(d.href=h.createObjectURL(a),setTimeout(function(){h.revokeObjectURL(d.href)},4e4),setTimeout(function(){n(d)},0))}:"msSaveOrOpenBlob"in navigator?function(a,c,l){if(c=c||a.name||"download",typeof a!="string")navigator.msSaveOrOpenBlob(e(a,l),c);else if(r(a))t(a,c,l);else{var h=document.createElement("a");h.href=a,h.target="_blank",setTimeout(function(){n(h)})}}:function(a,c,l,h){if(h=h||open("","_blank"),h&&(h.document.title=h.document.body.innerText="downloading..."),typeof a=="string")return t(a,c,l);var d=a.type==="application/octet-stream",m=/constructor/i.test(i.HTMLElement)||i.safari,p=/CriOS\/[\d]+/.test(navigator.userAgent);if((p||d&&m||o)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var v=g.result;v=p?v:v.replace(/^data:[^;]*;/,"data:attachment/file;"),h?h.location.href=v:location=v,h=null},g.readAsDataURL(a)}else{var f=i.URL||i.webkitURL,b=f.createObjectURL(a);h?h.location=b:location.href=b,h=null,setTimeout(function(){f.revokeObjectURL(b)},4e4)}});i.saveAs=s.saveAs=s,typeof kd<"u"&&(kd.exports=s)})});var v2=_e((r8,b2)=>{b2.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var An=_e(ti=>{var Au,I3=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];ti.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};ti.getSymbolTotalCodewords=function(t){return I3[t]};ti.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};ti.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');Au=t};ti.isKanjiModeEnabled=function(){return typeof Au<"u"};ti.toSJIS=function(t){return Au(t)}});var Xc=_e(hr=>{hr.L={bit:1};hr.M={bit:0};hr.Q={bit:3};hr.H={bit:2};function R3(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return hr.L;case"m":case"medium":return hr.M;case"q":case"quartile":return hr.Q;case"h":case"high":return hr.H;default:throw new Error("Unknown EC Level: "+e)}}hr.isValid=function(t){return t&&typeof t.bit<"u"&&t.bit>=0&&t.bit<4};hr.from=function(t,r){if(hr.isValid(t))return t;try{return R3(t)}catch{return r}}});var S2=_e((o8,w2)=>{function _2(){this.buffer=[],this.length=0}_2.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let r=0;r<t;r++)this.putBit((e>>>t-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};w2.exports=_2});var E2=_e((s8,k2)=>{function cs(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}cs.prototype.set=function(e,t,r,n){let i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)};cs.prototype.get=function(e,t){return this.data[e*this.size+t]};cs.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r};cs.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};k2.exports=cs});var C2=_e(Jc=>{var P3=An().getSymbolSize;Jc.getRowColCoords=function(t){if(t===1)return[];let r=Math.floor(t/7)+2,n=P3(t),i=n===145?26:Math.ceil((n-13)/(2*r-2))*2,o=[n-7];for(let s=1;s<r-1;s++)o[s]=o[s-1]-i;return o.push(6),o.reverse()};Jc.getPositions=function(t){let r=[],n=Jc.getRowColCoords(t),i=n.length;for(let o=0;o<i;o++)for(let s=0;s<i;s++)o===0&&s===0||o===0&&s===i-1||o===i-1&&s===0||r.push([n[o],n[s]]);return r}});var T2=_e(A2=>{var D3=An().getSymbolSize,x2=7;A2.getPositions=function(t){let r=D3(t);return[[0,0],[r-x2,0],[0,r-x2]]}});var I2=_e(Oe=>{Oe.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var ri={N1:3,N2:3,N3:40,N4:10};Oe.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7};Oe.from=function(t){return Oe.isValid(t)?parseInt(t,10):void 0};Oe.getPenaltyN1=function(t){let r=t.size,n=0,i=0,o=0,s=null,a=null;for(let c=0;c<r;c++){i=o=0,s=a=null;for(let l=0;l<r;l++){let h=t.get(c,l);h===s?i++:(i>=5&&(n+=ri.N1+(i-5)),s=h,i=1),h=t.get(l,c),h===a?o++:(o>=5&&(n+=ri.N1+(o-5)),a=h,o=1)}i>=5&&(n+=ri.N1+(i-5)),o>=5&&(n+=ri.N1+(o-5))}return n};Oe.getPenaltyN2=function(t){let r=t.size,n=0;for(let i=0;i<r-1;i++)for(let o=0;o<r-1;o++){let s=t.get(i,o)+t.get(i,o+1)+t.get(i+1,o)+t.get(i+1,o+1);(s===4||s===0)&&n++}return n*ri.N2};Oe.getPenaltyN3=function(t){let r=t.size,n=0,i=0,o=0;for(let s=0;s<r;s++){i=o=0;for(let a=0;a<r;a++)i=i<<1&2047|t.get(s,a),a>=10&&(i===1488||i===93)&&n++,o=o<<1&2047|t.get(a,s),a>=10&&(o===1488||o===93)&&n++}return n*ri.N3};Oe.getPenaltyN4=function(t){let r=0,n=t.data.length;for(let o=0;o<n;o++)r+=t.data[o];return Math.abs(Math.ceil(r*100/n/5)-10)*ri.N4};function O3(e,t,r){switch(e){case Oe.Patterns.PATTERN000:return(t+r)%2===0;case Oe.Patterns.PATTERN001:return t%2===0;case Oe.Patterns.PATTERN010:return r%3===0;case Oe.Patterns.PATTERN011:return(t+r)%3===0;case Oe.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2===0;case Oe.Patterns.PATTERN101:return t*r%2+t*r%3===0;case Oe.Patterns.PATTERN110:return(t*r%2+t*r%3)%2===0;case Oe.Patterns.PATTERN111:return(t*r%3+(t+r)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}Oe.applyMask=function(t,r){let n=r.size;for(let i=0;i<n;i++)for(let o=0;o<n;o++)r.isReserved(o,i)||r.xor(o,i,O3(t,o,i))};Oe.getBestMask=function(t,r){let n=Object.keys(Oe.Patterns).length,i=0,o=1/0;for(let s=0;s<n;s++){r(s),Oe.applyMask(s,t);let a=Oe.getPenaltyN1(t)+Oe.getPenaltyN2(t)+Oe.getPenaltyN3(t)+Oe.getPenaltyN4(t);Oe.applyMask(s,t),a<o&&(o=a,i=s)}return i}});var Iu=_e(Tu=>{var Tn=Xc(),Yc=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Zc=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Tu.getBlocksCount=function(t,r){switch(r){case Tn.L:return Yc[(t-1)*4+0];case Tn.M:return Yc[(t-1)*4+1];case Tn.Q:return Yc[(t-1)*4+2];case Tn.H:return Yc[(t-1)*4+3];default:return}};Tu.getTotalCodewordsCount=function(t,r){switch(r){case Tn.L:return Zc[(t-1)*4+0];case Tn.M:return Zc[(t-1)*4+1];case Tn.Q:return Zc[(t-1)*4+2];case Tn.H:return Zc[(t-1)*4+3];default:return}}});var R2=_e(el=>{var ls=new Uint8Array(512),Qc=new Uint8Array(256);(function(){let t=1;for(let r=0;r<255;r++)ls[r]=t,Qc[t]=r,t<<=1,t&256&&(t^=285);for(let r=255;r<512;r++)ls[r]=ls[r-255]})();el.log=function(t){if(t<1)throw new Error("log("+t+")");return Qc[t]};el.exp=function(t){return ls[t]};el.mul=function(t,r){return t===0||r===0?0:ls[Qc[t]+Qc[r]]}});var P2=_e(hs=>{var Ru=R2();hs.mul=function(t,r){let n=new Uint8Array(t.length+r.length-1);for(let i=0;i<t.length;i++)for(let o=0;o<r.length;o++)n[i+o]^=Ru.mul(t[i],r[o]);return n};hs.mod=function(t,r){let n=new Uint8Array(t);for(;n.length-r.length>=0;){let i=n[0];for(let s=0;s<r.length;s++)n[s]^=Ru.mul(r[s],i);let o=0;for(;o<n.length&&n[o]===0;)o++;n=n.slice(o)}return n};hs.generateECPolynomial=function(t){let r=new Uint8Array([1]);for(let n=0;n<t;n++)r=hs.mul(r,new Uint8Array([1,Ru.exp(n)]));return r}});var B2=_e((f8,O2)=>{var D2=P2();function Pu(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}Pu.prototype.initialize=function(t){this.degree=t,this.genPoly=D2.generateECPolynomial(this.degree)};Pu.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");let r=new Uint8Array(t.length+this.degree);r.set(t);let n=D2.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){let o=new Uint8Array(this.degree);return o.set(n,i),o}return n};O2.exports=Pu});var Du=_e(L2=>{L2.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}});var Ou=_e(tn=>{var F2="[0-9]+",B3="[A-Z $%*+\\-./:]+",ds="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ds=ds.replace(/u/g,"\\u");var L3="(?:(?![A-Z0-9 $%*+\\-./:]|"+ds+`)(?:.|[\r
3
+ ]))+`;tn.KANJI=new RegExp(ds,"g");tn.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");tn.BYTE=new RegExp(L3,"g");tn.NUMERIC=new RegExp(F2,"g");tn.ALPHANUMERIC=new RegExp(B3,"g");var F3=new RegExp("^"+ds+"$"),M3=new RegExp("^"+F2+"$"),U3=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");tn.testKanji=function(t){return F3.test(t)};tn.testNumeric=function(t){return M3.test(t)};tn.testAlphanumeric=function(t){return U3.test(t)}});var In=_e(nt=>{var N3=Du(),Bu=Ou();nt.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};nt.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};nt.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};nt.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};nt.MIXED={bit:-1};nt.getCharCountIndicator=function(t,r){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!N3.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?t.ccBits[0]:r<27?t.ccBits[1]:t.ccBits[2]};nt.getBestModeForData=function(t){return Bu.testNumeric(t)?nt.NUMERIC:Bu.testAlphanumeric(t)?nt.ALPHANUMERIC:Bu.testKanji(t)?nt.KANJI:nt.BYTE};nt.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")};nt.isValid=function(t){return t&&t.bit&&t.ccBits};function z3(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return nt.NUMERIC;case"alphanumeric":return nt.ALPHANUMERIC;case"kanji":return nt.KANJI;case"byte":return nt.BYTE;default:throw new Error("Unknown mode: "+e)}}nt.from=function(t,r){if(nt.isValid(t))return t;try{return z3(t)}catch{return r}}});var j2=_e(ni=>{var tl=An(),j3=Iu(),M2=Xc(),Rn=In(),Lu=Du(),N2=7973,U2=tl.getBCHDigit(N2);function V3(e,t,r){for(let n=1;n<=40;n++)if(t<=ni.getCapacity(n,r,e))return n}function z2(e,t){return Rn.getCharCountIndicator(e,t)+4}function H3(e,t){let r=0;return e.forEach(function(n){let i=z2(n.mode,t);r+=i+n.getBitsLength()}),r}function W3(e,t){for(let r=1;r<=40;r++)if(H3(e,r)<=ni.getCapacity(r,t,Rn.MIXED))return r}ni.from=function(t,r){return Lu.isValid(t)?parseInt(t,10):r};ni.getCapacity=function(t,r,n){if(!Lu.isValid(t))throw new Error("Invalid QR Code version");typeof n>"u"&&(n=Rn.BYTE);let i=tl.getSymbolTotalCodewords(t),o=j3.getTotalCodewordsCount(t,r),s=(i-o)*8;if(n===Rn.MIXED)return s;let a=s-z2(n,t);switch(n){case Rn.NUMERIC:return Math.floor(a/10*3);case Rn.ALPHANUMERIC:return Math.floor(a/11*2);case Rn.KANJI:return Math.floor(a/13);case Rn.BYTE:default:return Math.floor(a/8)}};ni.getBestVersionForData=function(t,r){let n,i=M2.from(r,M2.M);if(Array.isArray(t)){if(t.length>1)return W3(t,i);if(t.length===0)return 1;n=t[0]}else n=t;return V3(n.mode,n.getLength(),i)};ni.getEncodedBits=function(t){if(!Lu.isValid(t)||t<7)throw new Error("Invalid QR Code version");let r=t<<12;for(;tl.getBCHDigit(r)-U2>=0;)r^=N2<<tl.getBCHDigit(r)-U2;return t<<12|r}});var $2=_e(W2=>{var Fu=An(),H2=1335,$3=21522,V2=Fu.getBCHDigit(H2);W2.getEncodedBits=function(t,r){let n=t.bit<<3|r,i=n<<10;for(;Fu.getBCHDigit(i)-V2>=0;)i^=H2<<Fu.getBCHDigit(i)-V2;return(n<<10|i)^$3}});var q2=_e((v8,G2)=>{var G3=In();function oo(e){this.mode=G3.NUMERIC,this.data=e.toString()}oo.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};oo.prototype.getLength=function(){return this.data.length};oo.prototype.getBitsLength=function(){return oo.getBitsLength(this.data.length)};oo.prototype.write=function(t){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),t.put(i,10);let o=this.data.length-r;o>0&&(n=this.data.substr(r),i=parseInt(n,10),t.put(i,o*3+1))};G2.exports=oo});var X2=_e((_8,K2)=>{var q3=In(),Mu=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function so(e){this.mode=q3.ALPHANUMERIC,this.data=e}so.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};so.prototype.getLength=function(){return this.data.length};so.prototype.getBitsLength=function(){return so.getBitsLength(this.data.length)};so.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let n=Mu.indexOf(this.data[r])*45;n+=Mu.indexOf(this.data[r+1]),t.put(n,11)}this.data.length%2&&t.put(Mu.indexOf(this.data[r]),6)};K2.exports=so});var Y2=_e((w8,J2)=>{var K3=In();function ao(e){this.mode=K3.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}ao.getBitsLength=function(t){return t*8};ao.prototype.getLength=function(){return this.data.length};ao.prototype.getBitsLength=function(){return ao.getBitsLength(this.data.length)};ao.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)};J2.exports=ao});var Q2=_e((S8,Z2)=>{var X3=In(),J3=An();function co(e){this.mode=X3.KANJI,this.data=e}co.getBitsLength=function(t){return t*13};co.prototype.getLength=function(){return this.data.length};co.prototype.getBitsLength=function(){return co.getBitsLength(this.data.length)};co.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=J3.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
4
4
  Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),e.put(r,13)}};Z2.exports=co});var ey=_e((k8,Uu)=>{"use strict";var us={single_source_shortest_paths:function(e,t,r){var n={},i={};i[t]=0;var o=us.PriorityQueue.make();o.push(t,0);for(var s,a,c,l,h,d,m,p,g;!o.empty();){s=o.pop(),a=s.value,l=s.cost,h=e[a]||{};for(c in h)h.hasOwnProperty(c)&&(d=h[c],m=l+d,p=i[c],g=typeof i[c]>"u",(g||p>m)&&(i[c]=m,o.push(c,m),n[c]=a))}if(typeof r<"u"&&typeof i[r]>"u"){var f=["Could not find a path from ",t," to ",r,"."].join("");throw new Error(f)}return n},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t,i;n;)r.push(n),i=e[n],n=e[n];return r.reverse(),r},find_path:function(e,t,r){var n=us.single_source_shortest_paths(e,t,r);return us.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(e){var t=us.PriorityQueue,r={},n;e=e||{};for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof Uu<"u"&&(Uu.exports=us)});var cy=_e(lo=>{var Se=In(),ny=q2(),iy=X2(),oy=Y2(),sy=Q2(),fs=Ou(),rl=An(),Y3=ey();function ty(e){return unescape(encodeURIComponent(e)).length}function ps(e,t,r){let n=[],i;for(;(i=e.exec(r))!==null;)n.push({data:i[0],index:i.index,mode:t,length:i[0].length});return n}function ay(e){let t=ps(fs.NUMERIC,Se.NUMERIC,e),r=ps(fs.ALPHANUMERIC,Se.ALPHANUMERIC,e),n,i;return rl.isKanjiModeEnabled()?(n=ps(fs.BYTE,Se.BYTE,e),i=ps(fs.KANJI,Se.KANJI,e)):(n=ps(fs.BYTE_KANJI,Se.BYTE,e),i=[]),t.concat(r,n,i).sort(function(s,a){return s.index-a.index}).map(function(s){return{data:s.data,mode:s.mode,length:s.length}})}function Nu(e,t){switch(t){case Se.NUMERIC:return ny.getBitsLength(e);case Se.ALPHANUMERIC:return iy.getBitsLength(e);case Se.KANJI:return sy.getBitsLength(e);case Se.BYTE:return oy.getBitsLength(e)}}function Z3(e){return e.reduce(function(t,r){let n=t.length-1>=0?t[t.length-1]:null;return n&&n.mode===r.mode?(t[t.length-1].data+=r.data,t):(t.push(r),t)},[])}function Q3(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r];switch(n.mode){case Se.NUMERIC:t.push([n,{data:n.data,mode:Se.ALPHANUMERIC,length:n.length},{data:n.data,mode:Se.BYTE,length:n.length}]);break;case Se.ALPHANUMERIC:t.push([n,{data:n.data,mode:Se.BYTE,length:n.length}]);break;case Se.KANJI:t.push([n,{data:n.data,mode:Se.BYTE,length:ty(n.data)}]);break;case Se.BYTE:t.push([{data:n.data,mode:Se.BYTE,length:ty(n.data)}])}}return t}function ew(e,t){let r={},n={start:{}},i=["start"];for(let o=0;o<e.length;o++){let s=e[o],a=[];for(let c=0;c<s.length;c++){let l=s[c],h=""+o+c;a.push(h),r[h]={node:l,lastCount:0},n[h]={};for(let d=0;d<i.length;d++){let m=i[d];r[m]&&r[m].node.mode===l.mode?(n[m][h]=Nu(r[m].lastCount+l.length,l.mode)-Nu(r[m].lastCount,l.mode),r[m].lastCount+=l.length):(r[m]&&(r[m].lastCount=l.length),n[m][h]=Nu(l.length,l.mode)+4+Se.getCharCountIndicator(l.mode,t))}}i=a}for(let o=0;o<i.length;o++)n[i[o]].end=0;return{map:n,table:r}}function ry(e,t){let r,n=Se.getBestModeForData(e);if(r=Se.from(t,n),r!==Se.BYTE&&r.bit<n.bit)throw new Error('"'+e+'" cannot be encoded with mode '+Se.toString(r)+`.
5
5
  Suggested mode is: `+Se.toString(n));switch(r===Se.KANJI&&!rl.isKanjiModeEnabled()&&(r=Se.BYTE),r){case Se.NUMERIC:return new ny(e);case Se.ALPHANUMERIC:return new iy(e);case Se.KANJI:return new sy(e);case Se.BYTE:return new oy(e)}}lo.fromArray=function(t){return t.reduce(function(r,n){return typeof n=="string"?r.push(ry(n,null)):n.data&&r.push(ry(n.data,n.mode)),r},[])};lo.fromString=function(t,r){let n=ay(t,rl.isKanjiModeEnabled()),i=Q3(n),o=ew(i,r),s=Y3.find_path(o.map,"start","end"),a=[];for(let c=1;c<s.length-1;c++)a.push(o.table[s[c]].node);return lo.fromArray(Z3(a))};lo.rawSplit=function(t){return lo.fromArray(ay(t,rl.isKanjiModeEnabled()))}});var hy=_e(ly=>{var il=An(),zu=Xc(),tw=S2(),rw=E2(),nw=C2(),iw=T2(),Hu=I2(),Wu=Iu(),ow=B2(),nl=j2(),sw=$2(),aw=In(),ju=cy();function cw(e,t){let r=e.size,n=iw.getPositions(t);for(let i=0;i<n.length;i++){let o=n[i][0],s=n[i][1];for(let a=-1;a<=7;a++)if(!(o+a<=-1||r<=o+a))for(let c=-1;c<=7;c++)s+c<=-1||r<=s+c||(a>=0&&a<=6&&(c===0||c===6)||c>=0&&c<=6&&(a===0||a===6)||a>=2&&a<=4&&c>=2&&c<=4?e.set(o+a,s+c,!0,!0):e.set(o+a,s+c,!1,!0))}}function lw(e){let t=e.size;for(let r=8;r<t-8;r++){let n=r%2===0;e.set(r,6,n,!0),e.set(6,r,n,!0)}}function hw(e,t){let r=nw.getPositions(t);for(let n=0;n<r.length;n++){let i=r[n][0],o=r[n][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?e.set(i+s,o+a,!0,!0):e.set(i+s,o+a,!1,!0)}}function dw(e,t){let r=e.size,n=nl.getEncodedBits(t),i,o,s;for(let a=0;a<18;a++)i=Math.floor(a/3),o=a%3+r-8-3,s=(n>>a&1)===1,e.set(i,o,s,!0),e.set(o,i,s,!0)}function Vu(e,t,r){let n=e.size,i=sw.getEncodedBits(t,r),o,s;for(o=0;o<15;o++)s=(i>>o&1)===1,o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(n-15+o,8,s,!0),o<8?e.set(8,n-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(n-8,8,1,!0)}function uw(e,t){let r=e.size,n=-1,i=r-1,o=7,s=0;for(let a=r-1;a>0;a-=2)for(a===6&&a--;;){for(let c=0;c<2;c++)if(!e.isReserved(i,a-c)){let l=!1;s<t.length&&(l=(t[s]>>>o&1)===1),e.set(i,a-c,l),o--,o===-1&&(s++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function fw(e,t,r){let n=new tw;r.forEach(function(c){n.put(c.mode.bit,4),n.put(c.getLength(),aw.getCharCountIndicator(c.mode,e)),c.write(n)});let i=il.getSymbolTotalCodewords(e),o=Wu.getTotalCodewordsCount(e,t),s=(i-o)*8;for(n.getLengthInBits()+4<=s&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);let a=(s-n.getLengthInBits())/8;for(let c=0;c<a;c++)n.put(c%2?17:236,8);return pw(n,e,t)}function pw(e,t,r){let n=il.getSymbolTotalCodewords(t),i=Wu.getTotalCodewordsCount(t,r),o=n-i,s=Wu.getBlocksCount(t,r),a=n%s,c=s-a,l=Math.floor(n/s),h=Math.floor(o/s),d=h+1,m=l-h,p=new ow(m),g=0,f=new Array(s),b=new Array(s),v=0,k=new Uint8Array(e.buffer);for(let P=0;P<s;P++){let z=P<c?h:d;f[P]=k.slice(g,g+z),b[P]=p.encode(f[P]),g+=z,v=Math.max(v,z)}let S=new Uint8Array(n),I=0,x,O;for(x=0;x<v;x++)for(O=0;O<s;O++)x<f[O].length&&(S[I++]=f[O][x]);for(x=0;x<m;x++)for(O=0;O<s;O++)S[I++]=b[O][x];return S}function mw(e,t,r,n){let i;if(Array.isArray(e))i=ju.fromArray(e);else if(typeof e=="string"){let l=t;if(!l){let h=ju.rawSplit(e);l=nl.getBestVersionForData(h,r)}i=ju.fromString(e,l||40)}else throw new Error("Invalid data");let o=nl.getBestVersionForData(i,r);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=o;else if(t<o)throw new Error(`
6
6
  The chosen QR Code version cannot contain this amount of data.
7
7
  Minimum version required to store current data is: `+o+`.
8
8
  `);let s=fw(t,r,i),a=il.getSymbolSize(t),c=new rw(a);return cw(c,t),lw(c),hw(c,t),Vu(c,r,0),t>=7&&dw(c,t),uw(c,s),isNaN(n)&&(n=Hu.getBestMask(c,Vu.bind(null,c,r))),Hu.applyMask(n,c),Vu(c,r,n),{modules:c,version:t,errorCorrectionLevel:r,maskPattern:n,segments:i}}ly.create=function(t,r){if(typeof t>"u"||t==="")throw new Error("No input text");let n=zu.M,i,o;return typeof r<"u"&&(n=zu.from(r.errorCorrectionLevel,zu.M),i=nl.from(r.version),o=Hu.from(r.maskPattern),r.toSJISFunc&&il.setToSJISFunction(r.toSJISFunc)),mw(t,i,n,o)}});var $u=_e(ii=>{function dy(e){if(typeof e=="number"&&(e=e.toString()),typeof e!="string")throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||t.length===5||t.length>8)throw new Error("Invalid hex color: "+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(n){return[n,n]}))),t.length===6&&t.push("F","F");let r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+t.slice(0,6).join("")}}ii.getOptions=function(t){t||(t={}),t.color||(t.color={});let r=typeof t.margin>"u"||t.margin===null||t.margin<0?4:t.margin,n=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:n,scale:n?4:i,margin:r,color:{dark:dy(t.color.dark||"#000000ff"),light:dy(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}};ii.getScale=function(t,r){return r.width&&r.width>=t+r.margin*2?r.width/(t+r.margin*2):r.scale};ii.getImageWidth=function(t,r){let n=ii.getScale(t,r);return Math.floor((t+r.margin*2)*n)};ii.qrToImageData=function(t,r,n){let i=r.modules.size,o=r.modules.data,s=ii.getScale(i,n),a=Math.floor((i+n.margin*2)*s),c=n.margin*s,l=[n.color.light,n.color.dark];for(let h=0;h<a;h++)for(let d=0;d<a;d++){let m=(h*a+d)*4,p=n.color.light;if(h>=c&&d>=c&&h<a-c&&d<a-c){let g=Math.floor((h-c)/s),f=Math.floor((d-c)/s);p=l[o[g*i+f]?1:0]}t[m++]=p.r,t[m++]=p.g,t[m++]=p.b,t[m]=p.a}}});var uy=_e(ol=>{var Gu=$u();function gw(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}function yw(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}ol.render=function(t,r,n){let i=n,o=r;typeof i>"u"&&(!r||!r.getContext)&&(i=r,r=void 0),r||(o=yw()),i=Gu.getOptions(i);let s=Gu.getImageWidth(t.modules.size,i),a=o.getContext("2d"),c=a.createImageData(s,s);return Gu.qrToImageData(c.data,t,i),gw(a,o,s),a.putImageData(c,0,0),o};ol.renderToDataURL=function(t,r,n){let i=n;typeof i>"u"&&(!r||!r.getContext)&&(i=r,r=void 0),i||(i={});let o=ol.render(t,r,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}});var my=_e(py=>{var bw=$u();function fy(e,t){let r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function qu(e,t,r){let n=e+t;return typeof r<"u"&&(n+=" "+r),n}function vw(e,t,r){let n="",i=0,o=!1,s=0;for(let a=0;a<e.length;a++){let c=Math.floor(a%t),l=Math.floor(a/t);!c&&!o&&(o=!0),e[a]?(s++,a>0&&c>0&&e[a-1]||(n+=o?qu("M",c+r,.5+l+r):qu("m",i,0),i=0,o=!1),c+1<t&&e[a+1]||(n+=qu("h",s),s=0)):i++}return n}py.render=function(t,r,n){let i=bw.getOptions(r),o=t.modules.size,s=t.modules.data,a=o+i.margin*2,c=i.color.light.a?"<path "+fy(i.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",l="<path "+fy(i.color.dark,"stroke")+' d="'+vw(s,o,i.margin)+'"/>',h='viewBox="0 0 '+a+" "+a+'"',m='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+h+' shape-rendering="crispEdges">'+c+l+`</svg>
9
- `;return typeof n=="function"&&n(null,m),m}});var yy=_e(ms=>{var _w=v2(),Ku=hy(),gy=uy(),ww=my();function Xu(e,t,r,n,i){let o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!_w())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(i=r,r=t,t=n=void 0):s===3&&(t.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(r=t,t=n=void 0):s===2&&!t.getContext&&(n=r,r=t,t=void 0),new Promise(function(c,l){try{let h=Ku.create(r,n);c(e(h,t,n))}catch(h){l(h)}})}try{let c=Ku.create(r,n);i(null,e(c,t,n))}catch(c){i(c)}}ms.create=Ku.create;ms.toCanvas=Xu.bind(null,gy.render);ms.toDataURL=Xu.bind(null,gy.renderToDataURL);ms.toString=Xu.bind(null,function(e,t,r){return ww.render(e,r)})});async function vs(){try{let e={audio:!0,video:!0};return(await navigator.mediaDevices.getUserMedia(e)).getTracks().forEach(r=>{r.stop()}),!0}catch{return!1}}async function _s(){return new Promise((e,t)=>{let r=window.screen.isExtended;if(r)e(r);else if(navigator.userAgent.indexOf("Firefox")>-1)e(!1);else{let i=[];window.getScreenDetails().then(function(o){i=o,e(i.screens.length>=2)})}})}async function ur(){let e=["OBS","ManyCam","Snap Camera","Virtual"],r=(await navigator.mediaDevices.enumerateDevices()).filter(i=>!e.some(o=>i.deviceId.includes(o)||i.label.includes(o)));return{cameras:r.filter(i=>i.kind=="videoinput"&&i.deviceId).map(i=>({label:i.label||"Generic Device",id:i.deviceId})),microphones:r.filter(i=>i.kind=="audioinput"&&i.deviceId).map(i=>({label:i.label||"Generic Device",id:i.deviceId}))}}var Nn=typeof self<"u"?self:{};function Ln(){throw Error("Invalid UTF8")}function Qu(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}var ws,ul,Ty=typeof TextDecoder<"u",Iy,Ry=typeof TextEncoder<"u";function up(e){if(Ry)e=(Iy||=new TextEncoder).encode(e);else{let r=0,n=new Uint8Array(3*e.length);for(let i=0;i<e.length;i++){var t=e.charCodeAt(i);if(t<128)n[r++]=t;else{if(t<2048)n[r++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&i<e.length){let o=e.charCodeAt(++i);if(o>=56320&&o<=57343){t=1024*(t-55296)+o-56320+65536,n[r++]=t>>18|240,n[r++]=t>>12&63|128,n[r++]=t>>6&63|128,n[r++]=63&t|128;continue}i--}t=65533}n[r++]=t>>12|224,n[r++]=t>>6&63|128}n[r++]=63&t|128}}e=r===n.length?n:n.subarray(0,r)}return e}var $l,Bs;e:{for(fl=["CLOSURE_FLAGS"],Ss=Nn,ks=0;ks<fl.length;ks++)if((Ss=Ss[fl[ks]])==null){Bs=null;break e}Bs=Ss}var fl,Ss,ks,_o,ef=Bs&&Bs[610401301];$l=ef!=null&&ef;var tf=Nn.navigator;function Cl(e){return!!$l&&!!_o&&_o.brands.some((({brand:t})=>t&&t.indexOf(e)!=-1))}function Jt(e){var t;return(t=Nn.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function nn(){return!!$l&&!!_o&&_o.brands.length>0}function pl(){return nn()?Cl("Chromium"):(Jt("Chrome")||Jt("CriOS"))&&!(!nn()&&Jt("Edge"))||Jt("Silk")}function Gl(e){return Gl[" "](e),e}_o=tf&&tf.userAgentData||null,Gl[" "]=function(){};var Py=!nn()&&(Jt("Trident")||Jt("MSIE"));!Jt("Android")||pl(),pl(),Jt("Safari")&&(pl()||!nn()&&Jt("Coast")||!nn()&&Jt("Opera")||!nn()&&Jt("Edge")||(nn()?Cl("Microsoft Edge"):Jt("Edg/"))||nn()&&Cl("Opera"));var fp={},po=null;function Dy(e){let t=e.length,r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);let n=new Uint8Array(r),i=0;return(function(o,s){function a(l){for(;c<o.length;){let h=o.charAt(c++),d=po[h];if(d!=null)return d;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return l}pp();let c=0;for(;;){let l=a(-1),h=a(0),d=a(64),m=a(64);if(m===64&&l===-1)break;s(l<<2|h>>4),d!=64&&(s(h<<4&240|d>>2),m!=64&&s(d<<6&192|m))}})(e,(function(o){n[i++]=o})),i!==r?n.subarray(0,i):n}function pp(){if(!po){po={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=e.concat(t[r].split(""));fp[r]=n;for(let i=0;i<n.length;i++){let o=n[i];po[o]===void 0&&(po[o]=i)}}}}var mp=typeof Uint8Array<"u",gp=!Py&&typeof btoa=="function";function rf(e){if(!gp){var t;t===void 0&&(t=0),pp(),t=fp[t];var r=Array(Math.floor(e.length/3)),n=t[64]||"";let c=0,l=0;for(;c<e.length-2;c+=3){var i=e[c],o=e[c+1],s=e[c+2],a=t[i>>2];i=t[(3&i)<<4|o>>4],o=t[(15&o)<<2|s>>6],s=t[63&s],r[l++]=a+i+o+s}switch(a=0,s=n,e.length-c){case 2:s=t[(15&(a=e[c+1]))<<2]||n;case 1:e=e[c],r[l]=t[e>>2]+t[(3&e)<<4|a>>4]+s+n}return r.join("")}for(t="",r=0,n=e.length-10240;r<n;)t+=String.fromCharCode.apply(null,e.subarray(r,r+=10240));return t+=String.fromCharCode.apply(null,r?e.subarray(r):e),btoa(t)}var nf=/[-_.]/g,Oy={"-":"+",_:"/",".":"="};function By(e){return Oy[e]||""}function yp(e){if(!gp)return Dy(e);nf.test(e)&&(e=e.replace(nf,By)),e=atob(e);let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function Co(e){return mp&&e!=null&&e instanceof Uint8Array}var mi={};function zn(){return Ly||=new $r(null,mi)}function ql(e){bp(mi);var t=e.g;return(t=t==null||Co(t)?t:typeof t=="string"?yp(t):null)==null?t:e.g=t}var $r=class{h(){return new Uint8Array(ql(this)||0)}constructor(e,t){if(bp(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}},Ly,Fy;function bp(e){if(e!==mi)throw Error("illegal external caller")}function vp(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function xl(e){return vp(e=Error(e),"warning"),e}var Ws=typeof Symbol=="function"&&typeof Symbol()=="symbol",My=new Set;function xo(e,t,r=!1,n=!1){return e=typeof Symbol=="function"&&typeof Symbol()=="symbol"?n&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t,r&&My.add(e),e}var Uy=xo("jas",void 0,!0,!0),of=xo(void 0,"0di"),ml=xo(void 0,"2ex"),ho=xo(void 0,"1oa",!0),gi=xo(void 0,Symbol(),!0),ee=Ws?Uy:"Ga",_p={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},wp=Object.defineProperties;function $s(e,t){Ws||ee in e||wp(e,_p),e[ee]|=t}function Qe(e,t){Ws||ee in e||wp(e,_p),e[ee]=t}function Ci(e){return $s(e,34),e}function Ny(e,t){Qe(t,-30975&(0|e))}function Al(e,t){Qe(t,-30941&(34|e))}function Kl(){return typeof BigInt=="function"}function Tt(e){return Array.prototype.slice.call(e)}var Xl,Ao={},Sp={};function sf(e){return!(!e||typeof e!="object"||e.Ia!==Sp)}function Jl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function Yl(e,t){if(e!=null){if(typeof e=="string")e=e?new $r(e,mi):zn();else if(e.constructor!==$r)if(Co(e))e=e.length?new $r(new Uint8Array(e),mi):zn();else{if(!t)throw Error();e=void 0}}return e}function Ls(e){return!(!Array.isArray(e)||e.length)&&!!(1&(0|e[ee]))}var af=[];function dn(e){if(2&e)throw Error()}Qe(af,55),Xl=Object.freeze(af);var Fs=class e{constructor(t,r,n){this.l=0,this.g=t,this.h=r,this.m=n}next(){if(this.l<this.g.length){let t=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,t):t}}return{done:!0,value:void 0}}[Symbol.iterator](){return new e(this.g,this.h,this.m)}};function Zl(e){return gi?e[gi]:void 0}var zy=Object.freeze({});function Gs(e){return e.Qa=!0,e}var jy=Gs((e=>typeof e=="number")),cf=Gs((e=>typeof e=="string")),Vy=Gs((e=>typeof e=="boolean")),qs=typeof Nn.BigInt=="function"&&typeof Nn.BigInt(0)=="bigint",Tl=Gs((e=>qs?e>=Wy&&e<=Gy:e[0]==="-"?lf(e,Hy):lf(e,$y))),Hy=Number.MIN_SAFE_INTEGER.toString(),Wy=qs?BigInt(Number.MIN_SAFE_INTEGER):void 0,$y=Number.MAX_SAFE_INTEGER.toString(),Gy=qs?BigInt(Number.MAX_SAFE_INTEGER):void 0;function lf(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let r=0;r<e.length;r++){let n=e[r],i=t[r];if(n>i)return!1;if(n<i)return!0}}var qy=typeof Uint8Array.prototype.slice=="function",kp,Ae=0,We=0;function hf(e){let t=e>>>0;Ae=t,We=(e-t)/4294967296>>>0}function yi(e){if(e<0){hf(-e);let[t,r]=rh(Ae,We);Ae=t>>>0,We=r>>>0}else hf(e)}function Ql(e){let t=kp||=new DataView(new ArrayBuffer(8));t.setFloat32(0,+e,!0),We=0,Ae=t.getUint32(0,!0)}function eh(e,t){let r=4294967296*t+(e>>>0);return Number.isSafeInteger(r)?r:wo(e,t)}function th(e,t){let r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=eh(e,t))=="number"?r?-e:e:r?"-"+e:e}function wo(e,t){if(e>>>=0,(t>>>=0)<=2097151)var r=""+(4294967296*t+e);else Kl()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,e>=1e7&&(r+=e/1e7>>>0,e%=1e7),r>=1e7&&(t+=r/1e7>>>0,r%=1e7),r=t+df(r)+df(e));return r}function df(e){return e=String(e),"0000000".slice(e.length)+e}function Ks(e){if(e.length<16)yi(Number(e));else if(Kl())e=BigInt(e),Ae=Number(e&BigInt(4294967295))>>>0,We=Number(e>>BigInt(32)&BigInt(4294967295));else{let t=+(e[0]==="-");We=Ae=0;let r=e.length;for(let n=t,i=(r-t)%6+t;i<=r;n=i,i+=6){let o=Number(e.slice(n,i));We*=1e6,Ae=1e6*Ae+o,Ae>=4294967296&&(We+=Math.trunc(Ae/4294967296),We>>>=0,Ae>>>=0)}if(t){let[n,i]=rh(Ae,We);Ae=n,We=i}}}function rh(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}var nh=typeof BigInt=="function"?BigInt.asIntN:void 0,Ky=typeof BigInt=="function"?BigInt.asUintN:void 0,hi=Number.isSafeInteger,Xs=Number.isFinite,Ms=Math.trunc;function un(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Ep(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}var Xy=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Js(e){switch(typeof e){case"bigint":return!0;case"number":return Xs(e);case"string":return Xy.test(e);default:return!1}}function xi(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return Xs(e)?0|e:void 0}function Cp(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return Xs(e)?e>>>0:void 0}function uf(e){if(e[0]==="-")return!1;let t=e.length;return t<20||t===20&&Number(e.substring(0,6))<184467}function ih(e){return e=Ms(e),hi(e)||(yi(e),e=th(Ae,We)),e}function oh(e){var t=Ms(Number(e));if(hi(t))return String(t);if((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),t=e.length,!(e[0]==="-"?t<20||t===20&&Number(e.substring(0,7))>-922337:t<19||t===19&&Number(e.substring(0,6))<922337))if(Ks(e),e=Ae,2147483648&(t=We))if(Kl())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{let[r,n]=rh(e,t);e="-"+wo(r,n)}else e=wo(e,t);return e}function Us(e){return e==null?e:typeof e=="bigint"?(Tl(e)?e=Number(e):(e=nh(64,e),e=Tl(e)?Number(e):String(e)),e):Js(e)?typeof e=="number"?ih(e):oh(e):void 0}function Jy(e){if(e==null)return e;var t=typeof e;if(t==="bigint")return String(Ky(64,e));if(Js(e)){if(t==="string")return t=Ms(Number(e)),hi(t)&&t>=0?e=String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),uf(e)||(Ks(e),e=wo(Ae,We))),e;if(t==="number")return(e=Ms(e))>=0&&hi(e)?e:(function(r){if(r<0){yi(r);var n=wo(Ae,We);return r=Number(n),hi(r)?r:n}return uf(n=String(r))?n:(yi(r),eh(Ae,We))})(e)}}function xp(e){if(typeof e!="string")throw Error();return e}function Ai(e){if(e!=null&&typeof e!="string")throw Error();return e}function bi(e){return e==null||typeof e=="string"?e:void 0}function sh(e,t,r,n){if(e!=null&&typeof e=="object"&&e.W===Ao)return e;if(!Array.isArray(e))return r?2&n?((e=t[of])||(Ci((e=new t).u),e=t[of]=e),t=e):t=new t:t=void 0,t;let i=r=0|e[ee];return i===0&&(i|=32&n),i|=2&n,i!==r&&Qe(e,i),new t(e)}function Yy(e,t,r){if(t)e:{if(!Js(t=e))throw xl("int64");switch(typeof t){case"string":t=oh(t);break e;case"bigint":if(e=t=nh(64,t),cf(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(jy(e)&&!Number.isSafeInteger(e))throw Error(String(e));t=qs?BigInt(t):Vy(t)?t?"1":"0":cf(t)?t.trim()||"0":String(t);break e;default:t=ih(t)}}else t=Us(e);return typeof(r=(e=t)==null?r?0:void 0:e)=="string"&&hi(t=+r)?t:r}var Zy={},Qy=(function(){try{return Gl(new class extends Map{constructor(){super()}}),!1}catch{return!0}})(),go=class{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,r){return this.g.set(t,r),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,r){return this.g.forEach(t,r)}[Symbol.iterator](){return this.entries()}},eb=Qy?(Object.setPrototypeOf(go.prototype,Map.prototype),Object.defineProperties(go.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),go):class extends Map{constructor(){super()}};function ff(e){return e}function gl(e){if(2&e.L)throw Error("Cannot mutate an immutable Map")}var Zt=class extends eb{constructor(e,t,r=ff,n=ff){super();let i=0|e[ee];i|=64,Qe(e,i),this.L=i,this.S=t,this.R=r,this.Y=this.S?tb:n;for(let o=0;o<e.length;o++){let s=e[o],a=r(s[0],!1,!0),c=s[1];t?c===void 0&&(c=null):c=n(s[1],!1,!0,void 0,void 0,i),super.set(a,c)}}na(e=pf){if(this.size!==0)return this.X(e)}X(e=pf){let t=[],r=super.entries();for(var n;!(n=r.next()).done;)(n=n.value)[0]=e(n[0]),n[1]=e(n[1]),t.push(n);return t}clear(){gl(this),super.clear()}delete(e){return gl(this),super.delete(this.R(e,!0,!1))}entries(){var e=this.ma();return new Fs(e,rb,this)}keys(){return this.Ha()}values(){var e=this.ma();return new Fs(e,Zt.prototype.get,this)}forEach(e,t){super.forEach(((r,n)=>{e.call(t,this.get(n),n,this)}))}set(e,t){return gl(this),(e=this.R(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.Y(t,!0,!0,this.S,!1,this.L))}Na(e){let t=this.R(e[0],!1,!0);e=e[1],e=this.S?e===void 0?null:e:this.Y(e,!1,!0,void 0,!1,this.L),super.set(t,e)}has(e){return super.has(this.R(e,!1,!1))}get(e){e=this.R(e,!1,!1);let t=super.get(e);if(t!==void 0){var r=this.S;return r?((r=this.Y(t,!1,!0,r,this.ra,this.L))!==t&&super.set(e,r),r):t}}ma(){return Array.from(super.keys())}Ha(){return super.keys()}[Symbol.iterator](){return this.entries()}};function tb(e,t,r,n,i,o){return e=sh(e,n,r,o),i&&(e=Zs(e)),e}function pf(e){return e}function rb(e){return[e,this.get(e)]}var nb,Ap,ib;function mf(){return nb||=new Zt(Ci([]),void 0,void 0,void 0,Zy)}function ah(e,t,r,n,i){if(e!=null){if(Array.isArray(e))e=Ls(e)?void 0:i&&2&(0|e[ee])?e:ch(e,t,r,n!==void 0,i);else if(Jl(e)){let o={};for(let s in e)o[s]=ah(e[s],t,r,n,i);e=o}else e=t(e,n);return e}}function ch(e,t,r,n,i){let o=n||r?0|e[ee]:0,s=n?!!(32&o):void 0;n=Tt(e);for(let a=0;a<n.length;a++)n[a]=ah(n[a],t,r,s,i);return r&&((e=Zl(e))&&(n[gi]=Tt(e)),r(o,n)),n}function ob(e){return ah(e,Tp,void 0,void 0,!1)}function Tp(e){return e.W===Ao?e.toJSON():e instanceof Zt?e.na(ob):(function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"bigint":return Tl(t)?Number(t):String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(Ls(t))return}else{if(Co(t))return rf(t);if(t instanceof $r){let r=t.g;return r==null?"":typeof r=="string"?r:t.g=rf(r)}if(t instanceof Zt)return t.na()}}return t})(e)}function Ip(e){return ch(e,Tp,void 0,void 0,!1)}function sn(e,t,r){return e=Rp(e,t[0],t[1],r?1:2),t!==Ap&&r&&$s(e,16384),e}function Rp(e,t,r,n){if(e==null){var i=96;r?(e=[r],i|=512):e=[],t&&(i=-33521665&i|(1023&t)<<15)}else{if(!Array.isArray(e))throw Error("narr");if(2048&(i=0|e[ee]))throw Error("farr");if(64&i)return e;if(n===1||n===2||(i|=64),r&&(i|=512,r!==e[0]))throw Error("mid");e:{if(n=(r=e).length){let o=n-1;if(Jl(r[o])){if((t=o-(512&(i|=256)?0:-1))>=1024)throw Error("pvtlmt");i=-33521665&i|(1023&t)<<15;break e}}if(t){if((t=Math.max(t,n-(512&i?0:-1)))>1024)throw Error("spvt");i=-33521665&i|(1023&t)<<15}}}return Qe(e,i),e}function Il(e,t,r=Al){if(e!=null){if(mp&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var n=0|e[ee];return 2&n?e:(t&&=n===0||!!(32&n)&&!(64&n||!(16&n)),t?(Qe(e,-12293&(34|n)),e):ch(e,Il,4&n?Al:r,!0,!0))}return e.W===Ao?e=2&(n=0|(r=e.u)[ee])?e:new e.constructor(Ys(r,n,!0)):e instanceof Zt&&!(2&e.L)&&(r=Ci(e.X(Il)),e=new Zt(r,e.S,e.R,e.Y)),e}}function Ys(e,t,r){let n=r||2&t?Al:Ny,i=!!(32&t);return e=(function(o,s,a){let c=Tt(o);var l=c.length;let h=256&s?c[l-1]:void 0;for(l+=h?-1:0,s=512&s?1:0;s<l;s++)c[s]=a(c[s]);if(h){s=c[s]={};for(let d in h)s[d]=a(h[d])}return(o=Zl(o))&&(c[gi]=Tt(o)),c})(e,t,(o=>Il(o,i,n))),$s(e,32|(r?2:0)),e}function Zs(e){let t=e.u,r=0|t[ee];return 2&r?new e.constructor(Ys(t,r,!1)):e}function vi(e,t){return Xr(e=e.u,0|e[ee],t)}function Xr(e,t,r,n){if(r===-1)return null;var i=r+(512&t?0:-1);let o=e.length-1;return i>=o&&256&t?e[o][r]:n&&256&t&&(t=e[o][r])!=null?(e[i]!=null&&ml!=null&&((i=(e=Fy??={})[ml]||0)>=4||(e[ml]=i+1,vp(e=Error(),"incident"),(function(s){Nn.setTimeout((()=>{throw s}),0)})(e))),t):i<=o?e[i]:void 0}function Re(e,t,r){let n=e.u,i=0|n[ee];return dn(i),ze(n,i,t,r),e}function ze(e,t,r,n){let i=512&t?0:-1,o=r+i;var s=e.length-1;return o>=s&&256&t?(e[s][r]=n,t):o<=s?(e[o]=n,256&t&&r in(e=e[s])&&delete e[r],t):(n!==void 0&&(r>=(s=t>>15&1023||536870912)?n!=null&&(e[s+i]={[r]:n},Qe(e,t|=256)):e[o]=n),t)}function Ts(e,t){let r=0|(e=e.u)[ee],n=Xr(e,r,t),i=un(n);return i!=null&&i!==n&&ze(e,r,t,i),i}function Pp(e){let t=0|(e=e.u)[ee],r=Xr(e,t,1),n=Yl(r,!0);return n!=null&&n!==r&&ze(e,t,1,n),n}function Fn(){return zy===void 0?2:4}function Mn(e,t,r,n,i){let o=e.u,s=2&(e=0|o[ee])?1:n;i=!!i;let a=0|(n=lh(o,e,t))[ee];if(!(4&a)){4&a&&(n=Tt(n),a=Gr(a,e),e=ze(o,e,t,n));let c=0,l=0;for(;c<n.length;c++){let h=r(n[c]);h!=null&&(n[l++]=h)}l<c&&(n.length=l),a=hh(a,e),r=-4097&(20|a),a=r&=-8193,Qe(n,a),2&a&&Object.freeze(n)}return s===1||s===4&&32&a?Wr(a)||(i=a,a|=2,a!==i&&Qe(n,a),Object.freeze(n)):(s===2&&Wr(a)&&(n=Tt(n),a=Gr(a,e),a=an(a,e,i),Qe(n,a),e=ze(o,e,t,n)),Wr(a)||(t=a,a=an(a,e,i),a!==t&&Qe(n,a))),n}function lh(e,t,r,n){return e=Xr(e,t,r,n),Array.isArray(e)?e:Xl}function hh(e,t){return e===0&&(e=Gr(e,t)),1|e}function Wr(e){return!!(2&e)&&!!(4&e)||!!(2048&e)}function Dp(e){e=Tt(e);for(let t=0;t<e.length;t++){let r=e[t]=Tt(e[t]);Array.isArray(r[1])&&(r[1]=Ci(r[1]))}return e}function Rl(e,t,r,n){let i=0|(e=e.u)[ee];dn(i),ze(e,i,t,(n==="0"?Number(r)===0:r===n)?void 0:r)}function Ti(e,t,r,n,i){dn(t);var o=!(!(64&t)&&16384&t);let s=(i=lh(e,t,r,i))!==Xl;if(o||!s){let a=o=s?0|i[ee]:0;(!s||2&a||Wr(a)||4&a&&!(32&a))&&(i=Tt(i),a=Gr(a,t),t=ze(e,t,r,i)),a=-13&hh(a,t),a=an(n?-17&a:16|a,t,!0),a!==o&&Qe(i,a)}return i}function yl(e,t){var r=wm;return uh(dh(e=e.u),e,0|e[ee],r)===t?t:-1}function dh(e){if(Ws)return e[ho]??(e[ho]=new Map);if(ho in e)return e[ho];let t=new Map;return Object.defineProperty(e,ho,{value:t}),t}function Op(e,t,r,n){let i=dh(e),o=uh(i,e,t,r);return o!==n&&(o&&(t=ze(e,t,o)),i.set(r,n)),t}function uh(e,t,r,n){let i=e.get(n);if(i!=null)return i;i=0;for(let o=0;o<n.length;o++){let s=n[o];Xr(t,r,s)!=null&&(i!==0&&(r=ze(t,r,i)),i=s)}return e.set(n,i),i}function fh(e,t,r,n){let i,o=0|e[ee];if((n=Xr(e,o,r,n))!=null&&n.W===Ao)return(t=Zs(n))!==n&&ze(e,o,r,t),t.u;if(Array.isArray(n)){let s=0|n[ee];i=2&s?sn(Ys(n,s,!1),t,!0):64&s?n:sn(i,t,!0)}else i=sn(void 0,t,!0);return i!==n&&ze(e,o,r,i),i}function Bp(e,t,r,n){let i=0|(e=e.u)[ee];return(t=sh(n=Xr(e,i,r,n),t,!1,i))!==n&&t!=null&&ze(e,i,r,t),t}function ye(e,t,r,n=!1){if((t=Bp(e,t,r,n))==null)return t;if(!(2&(n=0|(e=e.u)[ee]))){let i=Zs(t);i!==t&&ze(e,n,r,t=i)}return t}function Lp(e,t,r,n,i,o,s){e=e.u;var a=!!(2&t);let c=a?1:i;o=!!o,s&&=!a;var l=0|(i=lh(e,t,n))[ee];if(!(a=!!(4&l))){var h=i,d=t;let m=!!(2&(l=hh(l,t)));m&&(d|=2);let p=!m,g=!0,f=0,b=0;for(;f<h.length;f++){let v=sh(h[f],r,!1,d);if(v instanceof r){if(!m){let k=!!(2&(0|v.u[ee]));p&&=!k,g&&=k}h[b++]=v}}b<f&&(h.length=b),l|=4,l=g?16|l:-17&l,Qe(h,l=p?8|l:-9&l),m&&Object.freeze(h)}if(s&&!(8&l||!i.length&&(c===1||c===4&&32&l))){for(Wr(l)&&(i=Tt(i),l=Gr(l,t),t=ze(e,t,n,i)),r=i,s=l,h=0;h<r.length;h++)(l=r[h])!==(d=Zs(l))&&(r[h]=d);s|=8,Qe(r,s=r.length?-17&s:16|s),l=s}return c===1||c===4&&32&l?Wr(l)||(t=l,(l|=!i.length||16&l&&(!a||32&l)?2:2048)!==t&&Qe(i,l),Object.freeze(i)):(c===2&&Wr(l)&&(Qe(i=Tt(i),l=an(l=Gr(l,t),t,o)),t=ze(e,t,n,i)),Wr(l)||(n=l,(l=an(l,t,o))!==n&&Qe(i,l))),i}function qr(e,t,r){let n=0|e.u[ee];return Lp(e,n,t,r,Fn(),!1,!(2&n))}function ne(e,t,r,n){return n==null&&(n=void 0),Re(e,r,n)}function yo(e,t,r,n){n==null&&(n=void 0);e:{let i=0|(e=e.u)[ee];if(dn(i),n==null){let o=dh(e);if(uh(o,e,i,r)!==t)break e;o.set(r,0)}else i=Op(e,i,r,t);ze(e,i,t,n)}}function Gr(e,t){return-2049&(e=32|(2&t?2|e:-3&e))}function an(e,t,r){return 32&t&&r||(e&=-33),e}function Ns(e,t,r,n){let i=0|e.u[ee];dn(i),e=Lp(e,i,r,t,2,!0),n=n??new r,e.push(n),e[ee]=2&(0|n.u[ee])?-9&e[ee]:-17&e[ee]}function Yt(e,t){return xi(vi(e,t))}function Qt(e,t){return bi(vi(e,t))}function Je(e,t){return Ts(e,t)??0}function So(e,t,r){if(r!=null&&typeof r!="boolean")throw e=typeof r,Error(`Expected boolean but got ${e!="object"?e:r?Array.isArray(r)?"array":e:"null"}: ${r}`);Re(e,t,r)}function Dr(e,t,r){if(r!=null){if(typeof r!="number"||!Xs(r))throw xl("int32");r|=0}Re(e,t,r)}function Y(e,t,r){if(r!=null&&typeof r!="number")throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);Re(e,t,r)}function zs(e,t,r){{let s=e.u,a=0|s[ee];if(dn(a),r==null)ze(s,a,t);else{var n=e=0|r[ee],i=Wr(e),o=i||Object.isFrozen(r);for(i||(e=0),o||(r=Tt(r),n=0,e=an(e=Gr(e,a),a,!0),o=!1),e|=21,i=0;i<r.length;i++){let c=r[i],l=xp(c);Object.is(c,l)||(o&&(r=Tt(r),n=0,e=an(e=Gr(e,a),a,!0),o=!1),r[i]=l)}e!==n&&(o&&(r=Tt(r),e=an(e=Gr(e,a),a,!0)),Qe(r,e)),ze(s,a,t,r)}}}function Qs(e,t,r){dn(0|e.u[ee]),Mn(e,t,bi,2,!0).push(xp(r))}function Fp(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function ph(){return Error("Failed to read varint, encoding is invalid.")}function Mp(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function mh(e){if(typeof e=="string")return{buffer:yp(e),N:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),N:!1};if(e.constructor===Uint8Array)return{buffer:e,N:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),N:!1};if(e.constructor===$r)return{buffer:ql(e)||new Uint8Array(0),N:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),N:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function gh(e,t){let r,n=0,i=0,o=0,s=e.h,a=e.g;do r=s[a++],n|=(127&r)<<o,o+=7;while(o<32&&128&r);for(o>32&&(i|=(127&r)>>4),o=3;o<32&&128&r;o+=7)r=s[a++],i|=(127&r)<<o;if(Un(e,a),r<128)return t(n>>>0,i>>>0);throw ph()}function yh(e){let t=0,r=e.g,n=r+10,i=e.h;for(;r<n;){let o=i[r++];if(t|=o,(128&o)==0)return Un(e,r),!!(127&t)}throw ph()}function cn(e){let t=e.h,r=e.g,n=t[r++],i=127&n;if(128&n&&(n=t[r++],i|=(127&n)<<7,128&n&&(n=t[r++],i|=(127&n)<<14,128&n&&(n=t[r++],i|=(127&n)<<21,128&n&&(n=t[r++],i|=n<<28,128&n&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw ph();return Un(e,r),i}function Kr(e){return cn(e)>>>0}function Pl(e){var t=e.h;let r=e.g,n=t[r],i=t[r+1],o=t[r+2];return t=t[r+3],Un(e,e.g+4),(n<<0|i<<8|o<<16|t<<24)>>>0}function Dl(e){var t=Pl(e);e=2*(t>>31)+1;let r=t>>>23&255;return t&=8388607,r==255?t?NaN:e*(1/0):r==0?1401298464324817e-60*e*t:e*Math.pow(2,r-150)*(t+8388608)}function sb(e){return cn(e)}function bl(e,t,{ba:r=!1}={}){e.ba=r,t&&(t=mh(t),e.h=t.buffer,e.m=t.N,e.j=0,e.l=e.h.length,e.g=e.j)}function Un(e,t){if(e.g=t,t>e.l)throw Mp(e.l,t)}function Up(e,t){if(t<0)throw Error(`Tried to read a negative byte length: ${t}`);let r=e.g,n=r+t;if(n>e.l)throw Mp(t,e.l-r);return e.g=n,r}function Np(e,t){if(t==0)return zn();var r=Up(e,t);return e.ba&&e.m?r=e.h.subarray(r,r+t):(e=e.h,r=r===(t=r+t)?new Uint8Array(0):qy?e.slice(r,t):new Uint8Array(e.subarray(r,t))),r.length==0?zn():new $r(r,mi)}Zt.prototype.toJSON=void 0,Zt.prototype.Ia=Sp;var gf=[];function zp(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var r=Kr(e.g);if(t=r>>>3,!((r&=7)>=0&&r<=5))throw Fp(r,e.l);if(t<1)throw Error(`Invalid field number: ${t} (at position ${e.l})`);return e.m=t,e.h=r,!0}function Is(e){switch(e.h){case 0:e.h!=0?Is(e):yh(e.g);break;case 1:Un(e=e.g,e.g+8);break;case 2:if(e.h!=2)Is(e);else{var t=Kr(e.g);Un(e=e.g,e.g+t)}break;case 5:Un(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!zp(e))throw Error("Unmatched start-group tag: stream EOF");if(e.h==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}Is(e)}break;default:throw Fp(e.h,e.l)}}function To(e,t,r){let n=e.g.l,i=Kr(e.g),o=e.g.g+i,s=o-n;if(s<=0&&(e.g.l=o,r(t,e,void 0,void 0,void 0),s=o-e.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-s} bytes, either the data ended unexpectedly or the message misreported its own length`);return e.g.g=o,e.g.l=n,t}function bh(e){var t=Kr(e.g),r=Up(e=e.g,t);if(e=e.h,Ty){var n,i=e;(n=ul)||(n=ul=new TextDecoder("utf-8",{fatal:!0})),t=r+t,i=r===0&&t===i.length?i:i.subarray(r,t);try{var o=n.decode(i)}catch(a){if(ws===void 0){try{n.decode(new Uint8Array([128]))}catch{}try{n.decode(new Uint8Array([97])),ws=!0}catch{ws=!1}}throw!ws&&(ul=void 0),a}}else{t=(o=r)+t,r=[];let a,c=null;for(;o<t;){var s=e[o++];s<128?r.push(s):s<224?o>=t?Ln():(a=e[o++],s<194||(192&a)!=128?(o--,Ln()):r.push((31&s)<<6|63&a)):s<240?o>=t-1?Ln():(a=e[o++],(192&a)!=128||s===224&&a<160||s===237&&a>=160||(192&(n=e[o++]))!=128?(o--,Ln()):r.push((15&s)<<12|(63&a)<<6|63&n)):s<=244?o>=t-2?Ln():(a=e[o++],(192&a)!=128||a-144+(s<<28)>>30!=0||(192&(n=e[o++]))!=128||(192&(i=e[o++]))!=128?(o--,Ln()):(s=(7&s)<<18|(63&a)<<12|(63&n)<<6|63&i,s-=65536,r.push(55296+(s>>10&1023),56320+(1023&s)))):Ln(),r.length>=8192&&(c=Qu(c,r),r.length=0)}o=Qu(c,r)}return o}function jp(e){let t=Kr(e.g);return Np(e.g,t)}function ea(e,t,r){var n=Kr(e.g);for(n=e.g.g+n;e.g.g<n;)r.push(t(e.g))}var Es=[];function ab(e){return e}var di;function fr(e,t,r){t.g?t.m(e,t.g,t.h,r):t.m(e,t.h,r)}var J=class{constructor(e,t){this.u=Rp(e,t)}toJSON(){let e=!di;try{return e&&(di=Ip),Vp(this)}finally{e&&(di=void 0)}}l(){var e=Vb;return e.g?e.l(this,e.g,e.h,!0):e.l(this,e.h,e.defaultValue,!0)}clone(){let e=this.u;return new this.constructor(Ys(e,0|e[ee],!1))}N(){return!!(2&(0|this.u[ee]))}};function Vp(e){var t=e.u;{t=(e=di(t))!==t;let l=e.length;if(l){var r=e[l-1],n=Jl(r);n?l--:r=void 0;var i=e;if(n){e:{var o,s=r,a=!1;if(s)for(let h in s)isNaN(+h)?(o??={})[h]=s[h]:(n=s[h],Array.isArray(n)&&(Ls(n)||sf(n)&&n.size===0)&&(n=null),n==null&&(a=!0),n!=null&&((o??={})[h]=n));if(a||(o=s),o)for(let h in o){a=o;break e}a=null}s=a==null?r!=null:a!==r}for(;l>0&&((o=i[l-1])==null||Ls(o)||sf(o)&&o.size===0);l--)var c=!0;(i!==e||s||c)&&(t?(c||s||a)&&(i.length=l):i=Array.prototype.slice.call(i,0,l),a&&i.push(a)),c=i}else c=e}return c}function yf(e){return e?/^\d+$/.test(e)?(Ks(e),new Ol(Ae,We)):null:cb||=new Ol(0,0)}J.prototype.W=Ao,J.prototype.toString=function(){try{return di=ab,Vp(this).toString()}finally{di=void 0}};var Ol=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}},cb;function bf(e){return e?/^-?\d+$/.test(e)?(Ks(e),new Bl(Ae,We)):null:lb||=new Bl(0,0)}var Bl=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}},lb;function ui(e,t,r){for(;r>0||t>127;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function Ii(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function ta(e,t){if(t>=0)Ii(e,t);else{for(let r=0;r<9;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function ko(e,t){e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function _i(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function zt(e,t,r){Ii(e.g,8*t+r)}function vh(e,t){return zt(e,t,2),t=e.g.end(),_i(e,t),t.push(e.h),t}function _h(e,t){var r=t.pop();for(r=e.h+e.g.length()-r;r>127;)t.push(127&r|128),r>>>=7,e.h++;t.push(r),e.h++}function ra(e,t,r){zt(e,t,2),Ii(e.g,r.length),_i(e,e.g.end()),_i(e,r)}function js(e,t,r,n){r!=null&&(t=vh(e,t),n(r,e),_h(e,t))}function pr(){let e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var wh=pr(),Hp=pr(),Sh=pr(),kh=pr(),Wp=pr(),$p=pr(),Eh=pr(),Gp=pr(),qp=pr(),Ri=class{constructor(e,t,r){this.g=e,this.h=t,e=wh,this.l=!!e&&r===e||!1}};function na(e,t){return new Ri(e,t,wh)}function Kp(e,t,r,n,i){js(e,r,Zp(t,n),i)}var hb=na((function(e,t,r,n,i){return e.h===2&&(To(e,fh(t,n,r),i),!0)}),Kp),db=na((function(e,t,r,n,i){return e.h===2&&(To(e,fh(t,n,r,!0),i),!0)}),Kp),ia=Symbol(),Ch=Symbol(),vf=Symbol(),_f=Symbol(),Xp,Jp;function jn(e,t,r,n){var i=n[e];if(i)return i;(i={}).Pa=n,i.V=(function(d){switch(typeof d){case"boolean":return Ap||=[0,void 0,!0];case"number":return d>0?void 0:d===0?ib||=[0,void 0]:[-d,void 0];case"string":return[0,d];case"object":return d}})(n[0]);var o=n[1];let s=1;o&&o.constructor===Object&&(i.ga=o,typeof(o=n[++s])=="function"&&(i.la=!0,Xp??=o,Jp??=n[s+1],o=n[s+=2]));let a={};for(;o&&Array.isArray(o)&&o.length&&typeof o[0]=="number"&&o[0]>0;){for(var c=0;c<o.length;c++)a[o[c]]=o;o=n[++s]}for(c=1;o!==void 0;){let d;typeof o=="number"&&(c+=o,o=n[++s]);var l=void 0;if(o instanceof Ri?d=o:(d=hb,s--),d?.l){o=n[++s],l=n;var h=s;typeof o=="function"&&(o=o(),l[h]=o),l=o}for(h=c+1,typeof(o=n[++s])=="number"&&o<0&&(h-=o,o=n[++s]);c<h;c++){let m=a[c];l?r(i,c,d,l,m):t(i,c,d,m)}}return n[e]=i}function Yp(e){return Array.isArray(e)?e[0]instanceof Ri?e:[db,e]:[e,void 0]}function Zp(e,t){return e instanceof J?e.u:Array.isArray(e)?sn(e,t,!1):void 0}function xh(e,t,r,n){let i=r.g;e[t]=n?(o,s,a)=>i(o,s,a,n):i}function Ah(e,t,r,n,i){let o=r.g,s,a;e[t]=(c,l,h)=>o(c,l,h,a||=jn(Ch,xh,Ah,n).V,s||=Th(n),i)}function Th(e){let t=e[vf];if(t!=null)return t;let r=jn(Ch,xh,Ah,e);return t=r.la?(n,i)=>Xp(n,i,r):(n,i)=>{let o=0|n[ee];for(;zp(i)&&i.h!=4;){var s=i.m,a=r[s];if(a==null){var c=r.ga;c&&(c=c[s])&&(c=ub(c))!=null&&(a=r[s]=c)}a!=null&&a(i,n,s)||(s=(a=i).l,Is(a),a.fa?a=void 0:(c=a.g.g-s,a.g.g=s,a=Np(a.g,c)),s=n,a&&((c=s[gi])?c.push(a):s[gi]=[a]))}return 16384&o&&Ci(n),!0},e[vf]=t}function ub(e){let t=(e=Yp(e))[0].g;if(e=e[1]){let r=Th(e),n=jn(Ch,xh,Ah,e).V;return(i,o,s)=>t(i,o,s,n,r)}return t}function oa(e,t,r){e[t]=r.h}function sa(e,t,r,n){let i,o,s=r.h;e[t]=(a,c,l)=>s(a,c,l,o||=jn(ia,oa,sa,n).V,i||=Qp(n))}function Qp(e){let t=e[_f];if(!t){let r=jn(ia,oa,sa,e);t=(n,i)=>em(n,i,r),e[_f]=t}return t}function em(e,t,r){for(var n=0|e[ee],i=512&n?0:-1,o=e.length,s=512&n?1:0,a=o+(256&n?-1:0);s<a;s++){let c=e[s];if(c==null)continue;let l=s-i,h=wf(r,l);h&&h(t,c,l)}if(256&n){n=e[o-1];for(let c in n)i=+c,Number.isNaN(i)||(o=n[i])!=null&&(a=wf(r,i))&&a(t,o,i)}if(e=Zl(e))for(_i(t,t.g.end()),r=0;r<e.length;r++)_i(t,ql(e[r])||new Uint8Array(0))}function wf(e,t){var r=e[t];if(r)return r;if((r=e.ga)&&(r=r[t])){var n=(r=Yp(r))[0].h;if(r=r[1]){let i=Qp(r),o=jn(ia,oa,sa,r).V;r=e.la?Jp(o,i):(s,a,c)=>n(s,a,c,o,i)}else r=n;return e[t]=r}}function Pi(e,t){if(Array.isArray(t)){var r=0|t[ee];if(4&r)return t;for(var n=0,i=0;n<t.length;n++){let o=e(t[n]);o!=null&&(t[i++]=o)}return i<n&&(t.length=i),Qe(t,-12289&(5|r)),2&r&&Object.freeze(t),t}}function vt(e,t,r){return new Ri(e,t,r)}function Di(e,t,r){return new Ri(e,t,r)}function _t(e,t,r){ze(e,0|e[ee],t,r)}var fb=na((function(e,t,r,n,i){return e.h===2&&(e=To(e,sn([void 0,void 0],n,!0),i),dn(n=0|t[ee]),(i=Xr(t,n,r))instanceof Zt?(2&i.L)!=0?((i=i.X()).push(e),ze(t,n,r,i)):i.Na(e):Array.isArray(i)?(2&(0|i[ee])&&ze(t,n,r,i=Dp(i)),i.push(e)):ze(t,n,r,[e]),!0)}),(function(e,t,r,n,i){if(t instanceof Zt)t.forEach(((o,s)=>{js(e,r,sn([s,o],n,!1),i)}));else if(Array.isArray(t))for(let o=0;o<t.length;o++){let s=t[o];Array.isArray(s)&&js(e,r,sn(s,n,!1),i)}}));function tm(e,t,r){if(t=(function(n){if(n==null)return n;let i=typeof n;if(i==="bigint")return String(nh(64,n));if(Js(n)){if(i==="string")return oh(n);if(i==="number")return ih(n)}})(t),t!=null&&(typeof t=="string"&&bf(t),t!=null))switch(zt(e,r,0),typeof t){case"number":e=e.g,yi(t),ui(e,Ae,We);break;case"bigint":r=BigInt.asUintN(64,t),r=new Bl(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),ui(e.g,r.h,r.g);break;default:r=bf(t),ui(e.g,r.h,r.g)}}function rm(e,t,r){(t=xi(t))!=null&&t!=null&&(zt(e,r,0),ta(e.g,t))}function nm(e,t,r){(t=Ep(t))!=null&&(zt(e,r,0),e.g.g.push(t?1:0))}function im(e,t,r){(t=bi(t))!=null&&ra(e,r,up(t))}function om(e,t,r,n,i){js(e,r,Zp(t,n),i)}function sm(e,t,r){(t=t==null||typeof t=="string"||Co(t)||t instanceof $r?t:void 0)!=null&&ra(e,r,mh(t).buffer)}function am(e,t,r){return(e.h===5||e.h===2)&&(t=Ti(t,0|t[ee],r,!1,!1),e.h==2?ea(e,Dl,t):t.push(Dl(e.g)),!0)}var Vr=vt((function(e,t,r){if(e.h!==1)return!1;var n=e.g;e=Pl(n);let i=Pl(n);n=2*(i>>31)+1;let o=i>>>20&2047;return e=4294967296*(1048575&i)+e,_t(t,r,o==2047?e?NaN:n*(1/0):o==0?5e-324*n*e:n*Math.pow(2,o-1075)*(e+4503599627370496)),!0}),(function(e,t,r){(t=un(t))!=null&&(zt(e,r,1),e=e.g,(r=kp||=new DataView(new ArrayBuffer(8))).setFloat64(0,+t,!0),Ae=r.getUint32(0,!0),We=r.getUint32(4,!0),ko(e,Ae),ko(e,We))}),pr()),et=vt((function(e,t,r){return e.h===5&&(_t(t,r,Dl(e.g)),!0)}),(function(e,t,r){(t=un(t))!=null&&(zt(e,r,5),e=e.g,Ql(t),ko(e,Ae))}),Eh),pb=Di(am,(function(e,t,r){if((t=Pi(un,t))!=null)for(let s=0;s<t.length;s++){var n=e,i=r,o=t[s];o!=null&&(zt(n,i,5),n=n.g,Ql(o),ko(n,Ae))}}),Eh),Ih=Di(am,(function(e,t,r){if((t=Pi(un,t))!=null&&t.length){zt(e,r,2),Ii(e.g,4*t.length);for(let n=0;n<t.length;n++)r=e.g,Ql(t[n]),ko(r,Ae)}}),Eh),ln=vt((function(e,t,r){return e.h===0&&(_t(t,r,gh(e.g,th)),!0)}),tm,$p),vl=vt((function(e,t,r){return e.h===0&&(_t(t,r,(e=gh(e.g,th))===0?void 0:e),!0)}),tm,$p),mb=vt((function(e,t,r){return e.h===0&&(_t(t,r,gh(e.g,eh)),!0)}),(function(e,t,r){if((t=Jy(t))!=null&&(typeof t=="string"&&yf(t),t!=null))switch(zt(e,r,0),typeof t){case"number":e=e.g,yi(t),ui(e,Ae,We);break;case"bigint":r=BigInt.asUintN(64,t),r=new Ol(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),ui(e.g,r.h,r.g);break;default:r=yf(t),ui(e.g,r.h,r.g)}}),pr()),$e=vt((function(e,t,r){return e.h===0&&(_t(t,r,cn(e.g)),!0)}),rm,kh),aa=Di((function(e,t,r){return(e.h===0||e.h===2)&&(t=Ti(t,0|t[ee],r,!1,!1),e.h==2?ea(e,cn,t):t.push(cn(e.g)),!0)}),(function(e,t,r){if((t=Pi(xi,t))!=null&&t.length){r=vh(e,r);for(let n=0;n<t.length;n++)ta(e.g,t[n]);_h(e,r)}}),kh),li=vt((function(e,t,r){return e.h===0&&(_t(t,r,(e=cn(e.g))===0?void 0:e),!0)}),rm,kh),Fe=vt((function(e,t,r){return e.h===0&&(_t(t,r,yh(e.g)),!0)}),nm,Hp),fi=vt((function(e,t,r){return e.h===0&&(_t(t,r,(e=yh(e.g))===!1?void 0:e),!0)}),nm,Hp),mt=Di((function(e,t,r){return e.h===2&&(e=bh(e),Ti(t,0|t[ee],r,!1).push(e),!0)}),(function(e,t,r){if((t=Pi(bi,t))!=null)for(let s=0;s<t.length;s++){var n=e,i=r,o=t[s];o!=null&&ra(n,i,up(o))}}),Sh),on=vt((function(e,t,r){return e.h===2&&(_t(t,r,(e=bh(e))===""?void 0:e),!0)}),im,Sh),we=vt((function(e,t,r){return e.h===2&&(_t(t,r,bh(e)),!0)}),im,Sh),st=(function(e,t,r=wh){return new Ri(e,t,r)})((function(e,t,r,n,i){return e.h===2&&(n=sn(void 0,n,!0),Ti(t,0|t[ee],r,!0).push(n),To(e,n,i),!0)}),(function(e,t,r,n,i){if(Array.isArray(t))for(let o=0;o<t.length;o++)om(e,t[o],r,n,i)})),Ee=na((function(e,t,r,n,i,o){return e.h===2&&(Op(t,0|t[ee],o,r),To(e,t=fh(t,n,r),i),!0)}),om),cm=vt((function(e,t,r){return e.h===2&&(_t(t,r,jp(e)),!0)}),sm,Gp),gb=Di((function(e,t,r){return(e.h===0||e.h===2)&&(t=Ti(t,0|t[ee],r,!1,!1),e.h==2?ea(e,Kr,t):t.push(Kr(e.g)),!0)}),(function(e,t,r){if((t=Pi(Cp,t))!=null)for(let s=0;s<t.length;s++){var n=e,i=r,o=t[s];o!=null&&(zt(n,i,0),Ii(n.g,o))}}),Wp),yb=vt((function(e,t,r){return e.h===0&&(_t(t,r,(e=Kr(e.g))===0?void 0:e),!0)}),(function(e,t,r){(t=Cp(t))!=null&&t!=null&&(zt(e,r,0),Ii(e.g,t))}),Wp),er=vt((function(e,t,r){return e.h===0&&(_t(t,r,cn(e.g)),!0)}),(function(e,t,r){(t=xi(t))!=null&&(t=parseInt(t,10),zt(e,r,0),ta(e.g,t))}),qp),Ll=class{constructor(t,r){this.h=t,this.g=r,this.l=ye,this.m=ne,this.defaultValue=void 0}};function mr(e,t){return new Ll(e,t)}function fn(e,t){return(r,n)=>{if(Es.length){let o=Es.pop();o.o(n),bl(o.g,r,n),r=o}else r=new class{constructor(o,s){if(gf.length){let a=gf.pop();bl(a,o,s),o=a}else o=new class{constructor(a,c){this.h=null,this.m=!1,this.g=this.l=this.j=0,bl(this,a,c)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.ba=!1}}(o,s);this.g=o,this.l=this.g.g,this.h=this.m=-1,this.o(s)}o({fa:o=!1}={}){this.fa=o}}(r,n);try{let o=new e,s=o.u;Th(t)(s,r);var i=o}finally{r.g.clear(),r.m=-1,r.h=-1,Es.length<100&&Es.push(r)}return i}}function ca(e){return function(){let t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){let s=this.g;return this.g=[],s}}}};em(this.u,t,jn(ia,oa,sa,e)),_i(t,t.g.end());let r=new Uint8Array(t.h),n=t.l,i=n.length,o=0;for(let s=0;s<i;s++){let a=n[s];r.set(a,o),o+=a.length}return t.l=[r],r}}var Sf=class extends J{constructor(e){super(e)}},kf=[0,on,vt((function(e,t,r){return e.h===2&&(_t(t,r,(e=jp(e))===zn()?void 0:e),!0)}),(function(e,t,r){if(t!=null){if(t instanceof J){let n=t.Ra;return void(n&&(t=n(t),t!=null&&ra(e,r,mh(t).buffer)))}if(Array.isArray(t))return}sm(e,t,r)}),Gp)],_l,Ef=globalThis.trustedTypes;function Cf(e){_l===void 0&&(_l=(function(){let r=null;if(!Ef)return r;try{let n=i=>i;r=Ef.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch{}return r})());var t=_l;return new class{constructor(r){this.g=r}toString(){return this.g+""}}(t?t.createScriptURL(e):e)}function bb(e,...t){if(t.length===0)return Cf(e[0]);let r=e[0];for(let n=0;n<t.length;n++)r+=encodeURIComponent(t[n])+e[n+1];return Cf(r)}var lm=[0,$e,er,Fe,-1,aa,er,-1],vb=class extends J{constructor(e){super(e)}},hm=[0,Fe,we,Fe,er,-1,Di((function(e,t,r){return(e.h===0||e.h===2)&&(t=Ti(t,0|t[ee],r,!1,!1),e.h==2?ea(e,sb,t):t.push(cn(e.g)),!0)}),(function(e,t,r){if((t=Pi(xi,t))!=null&&t.length){r=vh(e,r);for(let n=0;n<t.length;n++)ta(e.g,t[n]);_h(e,r)}}),qp),we,-1,[0,Fe,-1],er,Fe,-1],dm=[0,we,-2],xf=class extends J{constructor(e){super(e)}},um=[0],fm=[0,$e,Fe,1,Fe,-3],Nt=class extends J{constructor(e){super(e,2)}},tt={};tt[336783863]=[0,we,Fe,-1,$e,[0,[1,2,3,4,5,6,7,8],Ee,um,Ee,hm,Ee,dm,Ee,fm,Ee,lm,Ee,[0,we,-2],Ee,[0,we,er],Ee,[0,er,we]],[0,we],Fe,[0,[1,3],[2,4],Ee,[0,aa],-1,Ee,[0,mt],-1,st,[0,we,-1]],we];var Af=[0,vl,-1,fi,-3,vl,aa,on,li,vl,-1,fi,li,fi,-2,on];function jt(e,t){Rl(e,2,Ai(t),"")}function Pe(e,t){Qs(e,3,t)}function pe(e,t){Qs(e,4,t)}var bt=class extends J{constructor(e){super(e,500)}o(e){return ne(this,0,7,e)}},bo=[-1,{}],Tf=[0,we,1,bo],If=[0,we,mt,bo];function Vt(e,t){Ns(e,1,bt,t)}function Be(e,t){Qs(e,10,t)}function be(e,t){Qs(e,15,t)}var Rt=class extends J{constructor(e){super(e,500)}o(e){return ne(this,0,1001,e)}},pm=[-500,st,[-500,on,-1,mt,-3,[-2,tt,Fe],st,kf,li,-1,Tf,If,st,[0,on,fi],on,Af,li,mt,987,mt],4,st,[-500,we,-1,[-1,{}],998,we],st,[-500,we,mt,-1,[-2,{},Fe],997,mt,-1],li,st,[-500,we,mt,bo,998,mt],mt,li,Tf,If,st,[0,on,-1,bo],mt,-2,Af,on,-1,fi,[0,fi,yb],978,bo,st,kf];Rt.prototype.g=ca(pm);var _b=fn(Rt,pm),wb=class extends J{constructor(e){super(e)}},mm=class extends J{constructor(e){super(e)}g(){return qr(this,wb,1)}},gm=[0,st,[0,$e,et,we,-1]],la=fn(mm,gm),Sb=class extends J{constructor(e){super(e)}},kb=class extends J{constructor(e){super(e)}},wl=class extends J{constructor(e){super(e)}h(){return ye(this,Sb,2)}g(){return qr(this,kb,5)}},ym=fn(class extends J{constructor(e){super(e)}},[0,mt,aa,Ih,[0,er,[0,$e,-3],[0,et,-3],[0,$e,-1,[0,st,[0,$e,-2]]],st,[0,et,-1,we,et]],we,-1,ln,st,[0,$e,et],mt,ln]),bm=class extends J{constructor(e){super(e)}},pi=fn(class extends J{constructor(e){super(e)}},[0,st,[0,et,-4]]),vm=class extends J{constructor(e){super(e)}},Io=fn(class extends J{constructor(e){super(e)}},[0,st,[0,et,-4]]),Eb=class extends J{constructor(e){super(e)}},Cb=[0,$e,-1,Ih,er],_m=class extends J{constructor(e){super(e)}};_m.prototype.g=ca([0,et,-4,ln]);var xb=class extends J{constructor(e){super(e)}},Ab=fn(class extends J{constructor(e){super(e)}},[0,st,[0,1,$e,we,gm],ln]),Rf=class extends J{constructor(e){super(e)}},Tb=class extends J{constructor(e){super(e)}oa(){let e=Pp(this);return e??zn()}},Ib=class extends J{constructor(e){super(e)}},wm=[1,2],Rb=fn(class extends J{constructor(e){super(e)}},[0,st,[0,wm,Ee,[0,Ih],Ee,[0,cm],$e,we],ln]),Rh=class extends J{constructor(e){super(e)}},Sm=[0,we,$e,et,mt,-1],Pf=class extends J{constructor(e){super(e)}},Pb=[0,Fe,-1],Df=class extends J{constructor(e){super(e)}},Rs=[1,2,3,4,5],Vs=class extends J{constructor(e){super(e)}g(){return Pp(this)!=null}h(){return Qt(this,2)!=null}},Me=class extends J{constructor(e){super(e)}g(){return Ep(vi(this,2))??!1}},km=[0,cm,we,[0,$e,ln,-1],[0,mb,ln]],Ye=[0,km,Fe,[0,Rs,Ee,fm,Ee,hm,Ee,lm,Ee,um,Ee,dm],er],ha=class extends J{constructor(e){super(e)}},Ph=[0,Ye,et,-1,$e],Db=mr(502141897,ha);tt[502141897]=Ph;var Ob=fn(class extends J{constructor(e){super(e)}},[0,[0,er,-1,pb,gb],Cb]),Em=class extends J{constructor(e){super(e)}},Cm=class extends J{constructor(e){super(e)}},Dh=[0,Ye,et,[0,Ye],Fe],xm=[0,Ye,Ph,Dh,et,[0,[0,km]]],Bb=mr(508968150,Cm);tt[508968150]=xm,tt[508968149]=Dh;var Am=class extends J{constructor(e){super(e)}},Lb=mr(513916220,Am);tt[513916220]=[0,Ye,xm,$e];var ai=class extends J{constructor(e){super(e)}h(){return ye(this,Rh,2)}g(){Re(this,2)}},Tm=[0,Ye,Sm];tt[478825465]=Tm;var Fb=class extends J{constructor(e){super(e)}},Im=class extends J{constructor(e){super(e)}},Oh=class extends J{constructor(e){super(e)}},Bh=class extends J{constructor(e){super(e)}},Rm=class extends J{constructor(e){super(e)}},Of=[0,Ye,[0,Ye],Tm,-1],Pm=[0,Ye,et,$e],Lh=[0,Ye,et],Dm=[0,Ye,Pm,Lh,et],Mb=mr(479097054,Rm);tt[479097054]=[0,Ye,Dm,Of],tt[463370452]=Of,tt[464864288]=Pm;var Ub=mr(462713202,Bh);tt[462713202]=Dm,tt[474472470]=Lh;var Nb=class extends J{constructor(e){super(e)}},Om=class extends J{constructor(e){super(e)}},Bm=class extends J{constructor(e){super(e)}},Lm=class extends J{constructor(e){super(e)}},Fh=[0,Ye,et,-1,$e],Fl=[0,Ye,et,Fe];Lm.prototype.g=ca([0,Ye,Lh,[0,Ye],Ph,Dh,Fh,Fl]);var Fm=class extends J{constructor(e){super(e)}},zb=mr(456383383,Fm);tt[456383383]=[0,Ye,Sm];var Mm=class extends J{constructor(e){super(e)}},jb=mr(476348187,Mm);tt[476348187]=[0,Ye,Pb];var Um=class extends J{constructor(e){super(e)}},Bf=class extends J{constructor(e){super(e)}},Nm=[0,er,-1],Vb=mr(458105876,class extends J{constructor(e){super(e)}g(){var e=this.u;let t=0|e[ee],r=2&t;return e=(function(n,i,o){var s=Bf;let a=2&i,c=!1;if(o==null){if(a)return mf();o=[]}else if(o.constructor===Zt){if((2&o.L)==0||a)return o;o=o.X()}else Array.isArray(o)?c=!!(2&(0|o[ee])):o=[];if(a){if(!o.length)return mf();c||(c=!0,Ci(o))}else c&&(c=!1,o=Dp(o));return c||(64&(0|o[ee])?o[ee]&=-33:32&i&&$s(o,32)),ze(n,i,2,s=new Zt(o,s,Yy,void 0)),s})(e,t,Xr(e,t,2)),!r&&Bf&&(e.ra=!0),e}});tt[458105876]=[0,Nm,fb,[!0,ln,[0,we,-1,mt]]];var Mh=class extends J{constructor(e){super(e)}},zm=mr(458105758,Mh);tt[458105758]=[0,Ye,we,Nm];var jm=class extends J{constructor(e){super(e)}},Hb=mr(443442058,jm);tt[443442058]=[0,Ye,we,$e,et,mt,-1,Fe,et],tt[514774813]=Fh;var Vm=class extends J{constructor(e){super(e)}},Wb=mr(516587230,Vm);function Ml(e,t){return t=t?t.clone():new Rh,e.displayNamesLocale!==void 0?Re(t,1,Ai(e.displayNamesLocale)):e.displayNamesLocale===void 0&&Re(t,1),e.maxResults!==void 0?Dr(t,2,e.maxResults):"maxResults"in e&&Re(t,2),e.scoreThreshold!==void 0?Y(t,3,e.scoreThreshold):"scoreThreshold"in e&&Re(t,3),e.categoryAllowlist!==void 0?zs(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&Re(t,4),e.categoryDenylist!==void 0?zs(t,5,e.categoryDenylist):"categoryDenylist"in e&&Re(t,5),t}function Uh(e,t=-1,r=""){return{categories:e.map((n=>({index:Yt(n,1)??0??-1,score:Je(n,2)??0,categoryName:Qt(n,3)??""??"",displayName:Qt(n,4)??""??""}))),headIndex:t,headName:r}}function Hm(e){var t=Mn(e,3,un,Fn()),r=Mn(e,2,xi,Fn()),n=Mn(e,1,bi,Fn()),i=Mn(e,9,bi,Fn());let o={categories:[],keypoints:[]};for(let s=0;s<t.length;s++)o.categories.push({score:t[s],index:r[s]??-1,categoryName:n[s]??"",displayName:i[s]??""});if((t=ye(e,wl,4)?.h())&&(o.boundingBox={originX:Yt(t,1)??0,originY:Yt(t,2)??0,width:Yt(t,3)??0,height:Yt(t,4)??0,angle:0}),ye(e,wl,4)?.g().length)for(let s of ye(e,wl,4).g())o.keypoints.push({x:Ts(s,1)??0,y:Ts(s,2)??0,score:Ts(s,4)??0,label:Qt(s,3)??""});return o}function da(e){let t=[];for(let r of qr(e,vm,1))t.push({x:Je(r,1)??0,y:Je(r,2)??0,z:Je(r,3)??0,visibility:Je(r,4)??0});return t}function vo(e){let t=[];for(let r of qr(e,bm,1))t.push({x:Je(r,1)??0,y:Je(r,2)??0,z:Je(r,3)??0,visibility:Je(r,4)??0});return t}function Lf(e){return Array.from(e,(t=>t>127?t-256:t))}function Ff(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let r=0,n=0,i=0;for(let o=0;o<e.length;o++)r+=e[o]*t[o],n+=e[o]*e[o],i+=t[o]*t[o];if(n<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*i)}var Cs;tt[516587230]=[0,Ye,Fh,Fl,et],tt[518928384]=Fl;var $b=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Wm(){if(Cs===void 0)try{await WebAssembly.instantiate($b),Cs=!0}catch{Cs=!1}return Cs}async function uo(e,t=bb``){let r=await Wm()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var rn=class{};function $m(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!(function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")})(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function Mf(e){if(typeof importScripts!="function"){let t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise(((r,n)=>{t.addEventListener("load",(()=>{r()}),!1),t.addEventListener("error",(i=>{n(i)}),!1),document.body.appendChild(t)}))}importScripts(e.toString())}function Gm(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function Q(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Uf(e,t,r){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(r?e.i._bindTextureToStream(r):e.i._bindTextureToCanvas(),!(r=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);let[n,i]=Gm(t);return!e.l||n===e.i.canvas.width&&i===e.i.canvas.height||(e.i.canvas.width=n,e.i.canvas.height=i),[n,i]}function Nf(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");let n=new Uint32Array(t.length);for(let i=0;i<t.length;i++)n[i]=e.i.stringToNewUTF8(t[i]);t=e.i._malloc(4*n.length),e.i.HEAPU32.set(n,t>>2),r(t);for(let i of n)e.i._free(i);e.i._free(t)}function Tr(e,t,r){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=r}function tn(e,t,r){let n=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(i,o,s)=>{o?(r(n,s),n=[]):n.push(i)}}rn.forVisionTasks=function(e){return uo("vision",e)},rn.forTextTasks=function(e){return uo("text",e)},rn.forGenAiExperimentalTasks=function(e){return uo("genai_experimental",e)},rn.forGenAiTasks=function(e){return uo("genai",e)},rn.forAudioTasks=function(e){return uo("audio",e)},rn.isSimdSupported=function(){return Wm()};async function Gb(e,t,r,n){return e=await(async(i,o,s,a,c)=>{if(o&&await Mf(o),!self.ModuleFactory||s&&(await Mf(s),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&c&&((o=self.Module).locateFile=c.locateFile,c.mainScriptUrlOrBlob&&(o.mainScriptUrlOrBlob=c.mainScriptUrlOrBlob)),c=await self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new i(c,a)})(e,r.wasmLoaderPath,r.assetLoaderPath,t,{locateFile:i=>i.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&i.endsWith(".data")?r.assetBinaryPath.toString():i}),await e.o(n),e}function Sl(e,t){let r=ye(e.baseOptions,Vs,1)||new Vs;typeof t=="string"?(Re(r,2,Ai(t)),Re(r,1)):t instanceof Uint8Array&&(Re(r,1,Yl(t,!1)),Re(r,2)),ne(e.baseOptions,0,1,r)}function zf(e){try{let t=e.G.length;if(t===1)throw Error(e.G[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.G.map((r=>r.message)).join(", "))}finally{e.G=[]}}function X(e,t){e.B=Math.max(e.B,t)}function ua(e,t){e.A=new bt,jt(e.A,"PassThroughCalculator"),Pe(e.A,"free_memory"),pe(e.A,"free_memory_unused_out"),Be(t,"free_memory"),Vt(t,e.A)}function wi(e,t){Pe(e.A,t),pe(e.A,t+"_unused_out")}function fa(e){e.g.addBoolToStream(!0,"free_memory",e.B)}var Ps=class{constructor(e){this.g=e,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){if(t){let r=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(ye(this.baseOptions,Vs,1)?.g()||ye(this.baseOptions,Vs,1)?.h()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if((function(n,i){let o=ye(n.baseOptions,Df,3);if(!o){var s=o=new Df,a=new xf;yo(s,4,Rs,a)}"delegate"in i&&(i.delegate==="GPU"?(i=o,s=new vb,yo(i,2,Rs,s)):(i=o,s=new xf,yo(i,4,Rs,s))),ne(n.baseOptions,0,3,o)})(this,r),r.modelAssetPath)return fetch(r.modelAssetPath.toString()).then((n=>{if(n.ok)return n.arrayBuffer();throw Error(`Failed to fetch model: ${r.modelAssetPath} (${n.status})`)})).then((n=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(n),!0,!1,!1),Sl(this,"/model.dat"),this.m(),this.I()}));if(r.modelAssetBuffer instanceof Uint8Array)Sl(this,r.modelAssetBuffer);else if(r.modelAssetBuffer)return(async function(n){let i=[];for(var o=0;;){let{done:s,value:a}=await n.read();if(s)break;i.push(a),o+=a.length}if(i.length===0)return new Uint8Array(0);if(i.length===1)return i[0];n=new Uint8Array(o),o=0;for(let s of i)n.set(s,o),o+=s.length;return n})(r.modelAssetBuffer).then((n=>{Sl(this,n),this.m(),this.I()}))}return this.m(),this.I(),Promise.resolve()}I(){}da(){let e;if(this.g.da((t=>{e=_b(t)})),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener(((r,n)=>{this.G.push(Error(n))})),this.g.La(),this.g.setGraph(e,t),this.A=void 0,zf(this)}finishProcessing(){this.g.finishProcessing(),zf(this)}close(){this.A=void 0,this.g.closeGraph()}};function yt(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}Ps.prototype.close=Ps.prototype.close,(function(e,t){e=e.split(".");var r,n=Nn;for((e[0]in n)||n.execScript===void 0||n.execScript("var "+e[0]);e.length&&(r=e.shift());)e.length||t===void 0?n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}:n[r]=t})("TaskRunner",Ps);var Ul=class{constructor(t,r,n,i){this.g=t,this.h=r,this.m=n,this.l=i}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}};function jf(e,t,r){let n=e.g;if(r=yt(n.createShader(r),"Failed to create WebGL shader"),n.shaderSource(r,t),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(r)}`);return n.attachShader(e.h,r),r}function Vf(e,t){let r=e.g,n=yt(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(n);let i=yt(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,i),r.enableVertexAttribArray(e.O),r.vertexAttribPointer(e.O,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);let o=yt(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,o),r.enableVertexAttribArray(e.I),r.vertexAttribPointer(e.I,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new Ul(r,n,i,o)}function Nh(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function Ro(e,t,r,n){return Nh(e,t),e.h||(e.m(),e.C()),r?(e.s||(e.s=Vf(e,!0)),r=e.s):(e.v||(e.v=Vf(e,!1)),r=e.v),t.useProgram(e.h),r.bind(),e.l(),e=n(),r.g.bindVertexArray(null),e}function hn(e,t,r){return Nh(e,t),e=yt(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function pa(e,t,r){Nh(e,t),e.A||(e.A=yt(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.A),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}function zh(e){e.g?.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Oi=class{G(){return`
9
+ `;return typeof n=="function"&&n(null,m),m}});var yy=_e(ms=>{var _w=v2(),Ku=hy(),gy=uy(),ww=my();function Xu(e,t,r,n,i){let o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!_w())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(i=r,r=t,t=n=void 0):s===3&&(t.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(r=t,t=n=void 0):s===2&&!t.getContext&&(n=r,r=t,t=void 0),new Promise(function(c,l){try{let h=Ku.create(r,n);c(e(h,t,n))}catch(h){l(h)}})}try{let c=Ku.create(r,n);i(null,e(c,t,n))}catch(c){i(c)}}ms.create=Ku.create;ms.toCanvas=Xu.bind(null,gy.render);ms.toDataURL=Xu.bind(null,gy.renderToDataURL);ms.toString=Xu.bind(null,function(e,t,r){return ww.render(e,r)})});async function vs(){try{let e={audio:!0,video:!0};return(await navigator.mediaDevices.getUserMedia(e)).getTracks().forEach(r=>{r.stop()}),!0}catch{return!1}}async function _s(){return new Promise((e,t)=>{let r=window.screen.isExtended;if(r)e(r);else if(navigator.userAgent.indexOf("Firefox")>-1)e(!1);else{let i=[];window.getScreenDetails().then(function(o){i=o,e(i.screens.length>=2)})}})}async function ur(){let e=["OBS","ManyCam","Snap Camera","Virtual"],r=(await navigator.mediaDevices.enumerateDevices()).filter(i=>!e.some(o=>i.deviceId.includes(o)||i.label.includes(o)));return{cameras:r.filter(i=>i.kind=="videoinput"&&i.deviceId).map(i=>({label:i.label||"Generic Device",id:i.deviceId})),microphones:r.filter(i=>i.kind=="audioinput"&&i.deviceId).map(i=>({label:i.label||"Generic Device",id:i.deviceId}))}}var Nn=typeof self<"u"?self:{};function Ln(){throw Error("Invalid UTF8")}function Qu(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}var ws,ul,Ty=typeof TextDecoder<"u",Iy,Ry=typeof TextEncoder<"u";function up(e){if(Ry)e=(Iy||=new TextEncoder).encode(e);else{let r=0,n=new Uint8Array(3*e.length);for(let i=0;i<e.length;i++){var t=e.charCodeAt(i);if(t<128)n[r++]=t;else{if(t<2048)n[r++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&i<e.length){let o=e.charCodeAt(++i);if(o>=56320&&o<=57343){t=1024*(t-55296)+o-56320+65536,n[r++]=t>>18|240,n[r++]=t>>12&63|128,n[r++]=t>>6&63|128,n[r++]=63&t|128;continue}i--}t=65533}n[r++]=t>>12|224,n[r++]=t>>6&63|128}n[r++]=63&t|128}}e=r===n.length?n:n.subarray(0,r)}return e}var $l,Bs;e:{for(fl=["CLOSURE_FLAGS"],Ss=Nn,ks=0;ks<fl.length;ks++)if((Ss=Ss[fl[ks]])==null){Bs=null;break e}Bs=Ss}var fl,Ss,ks,_o,ef=Bs&&Bs[610401301];$l=ef!=null&&ef;var tf=Nn.navigator;function Cl(e){return!!$l&&!!_o&&_o.brands.some((({brand:t})=>t&&t.indexOf(e)!=-1))}function Jt(e){var t;return(t=Nn.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function on(){return!!$l&&!!_o&&_o.brands.length>0}function pl(){return on()?Cl("Chromium"):(Jt("Chrome")||Jt("CriOS"))&&!(!on()&&Jt("Edge"))||Jt("Silk")}function Gl(e){return Gl[" "](e),e}_o=tf&&tf.userAgentData||null,Gl[" "]=function(){};var Py=!on()&&(Jt("Trident")||Jt("MSIE"));!Jt("Android")||pl(),pl(),Jt("Safari")&&(pl()||!on()&&Jt("Coast")||!on()&&Jt("Opera")||!on()&&Jt("Edge")||(on()?Cl("Microsoft Edge"):Jt("Edg/"))||on()&&Cl("Opera"));var fp={},po=null;function Dy(e){let t=e.length,r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);let n=new Uint8Array(r),i=0;return(function(o,s){function a(l){for(;c<o.length;){let h=o.charAt(c++),d=po[h];if(d!=null)return d;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return l}pp();let c=0;for(;;){let l=a(-1),h=a(0),d=a(64),m=a(64);if(m===64&&l===-1)break;s(l<<2|h>>4),d!=64&&(s(h<<4&240|d>>2),m!=64&&s(d<<6&192|m))}})(e,(function(o){n[i++]=o})),i!==r?n.subarray(0,i):n}function pp(){if(!po){po={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=e.concat(t[r].split(""));fp[r]=n;for(let i=0;i<n.length;i++){let o=n[i];po[o]===void 0&&(po[o]=i)}}}}var mp=typeof Uint8Array<"u",gp=!Py&&typeof btoa=="function";function rf(e){if(!gp){var t;t===void 0&&(t=0),pp(),t=fp[t];var r=Array(Math.floor(e.length/3)),n=t[64]||"";let c=0,l=0;for(;c<e.length-2;c+=3){var i=e[c],o=e[c+1],s=e[c+2],a=t[i>>2];i=t[(3&i)<<4|o>>4],o=t[(15&o)<<2|s>>6],s=t[63&s],r[l++]=a+i+o+s}switch(a=0,s=n,e.length-c){case 2:s=t[(15&(a=e[c+1]))<<2]||n;case 1:e=e[c],r[l]=t[e>>2]+t[(3&e)<<4|a>>4]+s+n}return r.join("")}for(t="",r=0,n=e.length-10240;r<n;)t+=String.fromCharCode.apply(null,e.subarray(r,r+=10240));return t+=String.fromCharCode.apply(null,r?e.subarray(r):e),btoa(t)}var nf=/[-_.]/g,Oy={"-":"+",_:"/",".":"="};function By(e){return Oy[e]||""}function yp(e){if(!gp)return Dy(e);nf.test(e)&&(e=e.replace(nf,By)),e=atob(e);let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function Co(e){return mp&&e!=null&&e instanceof Uint8Array}var mi={};function zn(){return Ly||=new $r(null,mi)}function ql(e){bp(mi);var t=e.g;return(t=t==null||Co(t)?t:typeof t=="string"?yp(t):null)==null?t:e.g=t}var $r=class{h(){return new Uint8Array(ql(this)||0)}constructor(e,t){if(bp(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}},Ly,Fy;function bp(e){if(e!==mi)throw Error("illegal external caller")}function vp(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function xl(e){return vp(e=Error(e),"warning"),e}var Ws=typeof Symbol=="function"&&typeof Symbol()=="symbol",My=new Set;function xo(e,t,r=!1,n=!1){return e=typeof Symbol=="function"&&typeof Symbol()=="symbol"?n&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t,r&&My.add(e),e}var Uy=xo("jas",void 0,!0,!0),of=xo(void 0,"0di"),ml=xo(void 0,"2ex"),ho=xo(void 0,"1oa",!0),gi=xo(void 0,Symbol(),!0),ee=Ws?Uy:"Ga",_p={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},wp=Object.defineProperties;function $s(e,t){Ws||ee in e||wp(e,_p),e[ee]|=t}function Qe(e,t){Ws||ee in e||wp(e,_p),e[ee]=t}function Ci(e){return $s(e,34),e}function Ny(e,t){Qe(t,-30975&(0|e))}function Al(e,t){Qe(t,-30941&(34|e))}function Kl(){return typeof BigInt=="function"}function Tt(e){return Array.prototype.slice.call(e)}var Xl,Ao={},Sp={};function sf(e){return!(!e||typeof e!="object"||e.Ia!==Sp)}function Jl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function Yl(e,t){if(e!=null){if(typeof e=="string")e=e?new $r(e,mi):zn();else if(e.constructor!==$r)if(Co(e))e=e.length?new $r(new Uint8Array(e),mi):zn();else{if(!t)throw Error();e=void 0}}return e}function Ls(e){return!(!Array.isArray(e)||e.length)&&!!(1&(0|e[ee]))}var af=[];function un(e){if(2&e)throw Error()}Qe(af,55),Xl=Object.freeze(af);var Fs=class e{constructor(t,r,n){this.l=0,this.g=t,this.h=r,this.m=n}next(){if(this.l<this.g.length){let t=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,t):t}}return{done:!0,value:void 0}}[Symbol.iterator](){return new e(this.g,this.h,this.m)}};function Zl(e){return gi?e[gi]:void 0}var zy=Object.freeze({});function Gs(e){return e.Qa=!0,e}var jy=Gs((e=>typeof e=="number")),cf=Gs((e=>typeof e=="string")),Vy=Gs((e=>typeof e=="boolean")),qs=typeof Nn.BigInt=="function"&&typeof Nn.BigInt(0)=="bigint",Tl=Gs((e=>qs?e>=Wy&&e<=Gy:e[0]==="-"?lf(e,Hy):lf(e,$y))),Hy=Number.MIN_SAFE_INTEGER.toString(),Wy=qs?BigInt(Number.MIN_SAFE_INTEGER):void 0,$y=Number.MAX_SAFE_INTEGER.toString(),Gy=qs?BigInt(Number.MAX_SAFE_INTEGER):void 0;function lf(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let r=0;r<e.length;r++){let n=e[r],i=t[r];if(n>i)return!1;if(n<i)return!0}}var qy=typeof Uint8Array.prototype.slice=="function",kp,Ae=0,We=0;function hf(e){let t=e>>>0;Ae=t,We=(e-t)/4294967296>>>0}function yi(e){if(e<0){hf(-e);let[t,r]=rh(Ae,We);Ae=t>>>0,We=r>>>0}else hf(e)}function Ql(e){let t=kp||=new DataView(new ArrayBuffer(8));t.setFloat32(0,+e,!0),We=0,Ae=t.getUint32(0,!0)}function eh(e,t){let r=4294967296*t+(e>>>0);return Number.isSafeInteger(r)?r:wo(e,t)}function th(e,t){let r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=eh(e,t))=="number"?r?-e:e:r?"-"+e:e}function wo(e,t){if(e>>>=0,(t>>>=0)<=2097151)var r=""+(4294967296*t+e);else Kl()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,e>=1e7&&(r+=e/1e7>>>0,e%=1e7),r>=1e7&&(t+=r/1e7>>>0,r%=1e7),r=t+df(r)+df(e));return r}function df(e){return e=String(e),"0000000".slice(e.length)+e}function Ks(e){if(e.length<16)yi(Number(e));else if(Kl())e=BigInt(e),Ae=Number(e&BigInt(4294967295))>>>0,We=Number(e>>BigInt(32)&BigInt(4294967295));else{let t=+(e[0]==="-");We=Ae=0;let r=e.length;for(let n=t,i=(r-t)%6+t;i<=r;n=i,i+=6){let o=Number(e.slice(n,i));We*=1e6,Ae=1e6*Ae+o,Ae>=4294967296&&(We+=Math.trunc(Ae/4294967296),We>>>=0,Ae>>>=0)}if(t){let[n,i]=rh(Ae,We);Ae=n,We=i}}}function rh(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}var nh=typeof BigInt=="function"?BigInt.asIntN:void 0,Ky=typeof BigInt=="function"?BigInt.asUintN:void 0,hi=Number.isSafeInteger,Xs=Number.isFinite,Ms=Math.trunc;function fn(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Ep(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}var Xy=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Js(e){switch(typeof e){case"bigint":return!0;case"number":return Xs(e);case"string":return Xy.test(e);default:return!1}}function xi(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return Xs(e)?0|e:void 0}function Cp(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return Xs(e)?e>>>0:void 0}function uf(e){if(e[0]==="-")return!1;let t=e.length;return t<20||t===20&&Number(e.substring(0,6))<184467}function ih(e){return e=Ms(e),hi(e)||(yi(e),e=th(Ae,We)),e}function oh(e){var t=Ms(Number(e));if(hi(t))return String(t);if((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),t=e.length,!(e[0]==="-"?t<20||t===20&&Number(e.substring(0,7))>-922337:t<19||t===19&&Number(e.substring(0,6))<922337))if(Ks(e),e=Ae,2147483648&(t=We))if(Kl())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{let[r,n]=rh(e,t);e="-"+wo(r,n)}else e=wo(e,t);return e}function Us(e){return e==null?e:typeof e=="bigint"?(Tl(e)?e=Number(e):(e=nh(64,e),e=Tl(e)?Number(e):String(e)),e):Js(e)?typeof e=="number"?ih(e):oh(e):void 0}function Jy(e){if(e==null)return e;var t=typeof e;if(t==="bigint")return String(Ky(64,e));if(Js(e)){if(t==="string")return t=Ms(Number(e)),hi(t)&&t>=0?e=String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),uf(e)||(Ks(e),e=wo(Ae,We))),e;if(t==="number")return(e=Ms(e))>=0&&hi(e)?e:(function(r){if(r<0){yi(r);var n=wo(Ae,We);return r=Number(n),hi(r)?r:n}return uf(n=String(r))?n:(yi(r),eh(Ae,We))})(e)}}function xp(e){if(typeof e!="string")throw Error();return e}function Ai(e){if(e!=null&&typeof e!="string")throw Error();return e}function bi(e){return e==null||typeof e=="string"?e:void 0}function sh(e,t,r,n){if(e!=null&&typeof e=="object"&&e.W===Ao)return e;if(!Array.isArray(e))return r?2&n?((e=t[of])||(Ci((e=new t).u),e=t[of]=e),t=e):t=new t:t=void 0,t;let i=r=0|e[ee];return i===0&&(i|=32&n),i|=2&n,i!==r&&Qe(e,i),new t(e)}function Yy(e,t,r){if(t)e:{if(!Js(t=e))throw xl("int64");switch(typeof t){case"string":t=oh(t);break e;case"bigint":if(e=t=nh(64,t),cf(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(jy(e)&&!Number.isSafeInteger(e))throw Error(String(e));t=qs?BigInt(t):Vy(t)?t?"1":"0":cf(t)?t.trim()||"0":String(t);break e;default:t=ih(t)}}else t=Us(e);return typeof(r=(e=t)==null?r?0:void 0:e)=="string"&&hi(t=+r)?t:r}var Zy={},Qy=(function(){try{return Gl(new class extends Map{constructor(){super()}}),!1}catch{return!0}})(),go=class{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,r){return this.g.set(t,r),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,r){return this.g.forEach(t,r)}[Symbol.iterator](){return this.entries()}},eb=Qy?(Object.setPrototypeOf(go.prototype,Map.prototype),Object.defineProperties(go.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),go):class extends Map{constructor(){super()}};function ff(e){return e}function gl(e){if(2&e.L)throw Error("Cannot mutate an immutable Map")}var Zt=class extends eb{constructor(e,t,r=ff,n=ff){super();let i=0|e[ee];i|=64,Qe(e,i),this.L=i,this.S=t,this.R=r,this.Y=this.S?tb:n;for(let o=0;o<e.length;o++){let s=e[o],a=r(s[0],!1,!0),c=s[1];t?c===void 0&&(c=null):c=n(s[1],!1,!0,void 0,void 0,i),super.set(a,c)}}na(e=pf){if(this.size!==0)return this.X(e)}X(e=pf){let t=[],r=super.entries();for(var n;!(n=r.next()).done;)(n=n.value)[0]=e(n[0]),n[1]=e(n[1]),t.push(n);return t}clear(){gl(this),super.clear()}delete(e){return gl(this),super.delete(this.R(e,!0,!1))}entries(){var e=this.ma();return new Fs(e,rb,this)}keys(){return this.Ha()}values(){var e=this.ma();return new Fs(e,Zt.prototype.get,this)}forEach(e,t){super.forEach(((r,n)=>{e.call(t,this.get(n),n,this)}))}set(e,t){return gl(this),(e=this.R(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.Y(t,!0,!0,this.S,!1,this.L))}Na(e){let t=this.R(e[0],!1,!0);e=e[1],e=this.S?e===void 0?null:e:this.Y(e,!1,!0,void 0,!1,this.L),super.set(t,e)}has(e){return super.has(this.R(e,!1,!1))}get(e){e=this.R(e,!1,!1);let t=super.get(e);if(t!==void 0){var r=this.S;return r?((r=this.Y(t,!1,!0,r,this.ra,this.L))!==t&&super.set(e,r),r):t}}ma(){return Array.from(super.keys())}Ha(){return super.keys()}[Symbol.iterator](){return this.entries()}};function tb(e,t,r,n,i,o){return e=sh(e,n,r,o),i&&(e=Zs(e)),e}function pf(e){return e}function rb(e){return[e,this.get(e)]}var nb,Ap,ib;function mf(){return nb||=new Zt(Ci([]),void 0,void 0,void 0,Zy)}function ah(e,t,r,n,i){if(e!=null){if(Array.isArray(e))e=Ls(e)?void 0:i&&2&(0|e[ee])?e:ch(e,t,r,n!==void 0,i);else if(Jl(e)){let o={};for(let s in e)o[s]=ah(e[s],t,r,n,i);e=o}else e=t(e,n);return e}}function ch(e,t,r,n,i){let o=n||r?0|e[ee]:0,s=n?!!(32&o):void 0;n=Tt(e);for(let a=0;a<n.length;a++)n[a]=ah(n[a],t,r,s,i);return r&&((e=Zl(e))&&(n[gi]=Tt(e)),r(o,n)),n}function ob(e){return ah(e,Tp,void 0,void 0,!1)}function Tp(e){return e.W===Ao?e.toJSON():e instanceof Zt?e.na(ob):(function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"bigint":return Tl(t)?Number(t):String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(Ls(t))return}else{if(Co(t))return rf(t);if(t instanceof $r){let r=t.g;return r==null?"":typeof r=="string"?r:t.g=rf(r)}if(t instanceof Zt)return t.na()}}return t})(e)}function Ip(e){return ch(e,Tp,void 0,void 0,!1)}function an(e,t,r){return e=Rp(e,t[0],t[1],r?1:2),t!==Ap&&r&&$s(e,16384),e}function Rp(e,t,r,n){if(e==null){var i=96;r?(e=[r],i|=512):e=[],t&&(i=-33521665&i|(1023&t)<<15)}else{if(!Array.isArray(e))throw Error("narr");if(2048&(i=0|e[ee]))throw Error("farr");if(64&i)return e;if(n===1||n===2||(i|=64),r&&(i|=512,r!==e[0]))throw Error("mid");e:{if(n=(r=e).length){let o=n-1;if(Jl(r[o])){if((t=o-(512&(i|=256)?0:-1))>=1024)throw Error("pvtlmt");i=-33521665&i|(1023&t)<<15;break e}}if(t){if((t=Math.max(t,n-(512&i?0:-1)))>1024)throw Error("spvt");i=-33521665&i|(1023&t)<<15}}}return Qe(e,i),e}function Il(e,t,r=Al){if(e!=null){if(mp&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var n=0|e[ee];return 2&n?e:(t&&=n===0||!!(32&n)&&!(64&n||!(16&n)),t?(Qe(e,-12293&(34|n)),e):ch(e,Il,4&n?Al:r,!0,!0))}return e.W===Ao?e=2&(n=0|(r=e.u)[ee])?e:new e.constructor(Ys(r,n,!0)):e instanceof Zt&&!(2&e.L)&&(r=Ci(e.X(Il)),e=new Zt(r,e.S,e.R,e.Y)),e}}function Ys(e,t,r){let n=r||2&t?Al:Ny,i=!!(32&t);return e=(function(o,s,a){let c=Tt(o);var l=c.length;let h=256&s?c[l-1]:void 0;for(l+=h?-1:0,s=512&s?1:0;s<l;s++)c[s]=a(c[s]);if(h){s=c[s]={};for(let d in h)s[d]=a(h[d])}return(o=Zl(o))&&(c[gi]=Tt(o)),c})(e,t,(o=>Il(o,i,n))),$s(e,32|(r?2:0)),e}function Zs(e){let t=e.u,r=0|t[ee];return 2&r?new e.constructor(Ys(t,r,!1)):e}function vi(e,t){return Xr(e=e.u,0|e[ee],t)}function Xr(e,t,r,n){if(r===-1)return null;var i=r+(512&t?0:-1);let o=e.length-1;return i>=o&&256&t?e[o][r]:n&&256&t&&(t=e[o][r])!=null?(e[i]!=null&&ml!=null&&((i=(e=Fy??={})[ml]||0)>=4||(e[ml]=i+1,vp(e=Error(),"incident"),(function(s){Nn.setTimeout((()=>{throw s}),0)})(e))),t):i<=o?e[i]:void 0}function Re(e,t,r){let n=e.u,i=0|n[ee];return un(i),ze(n,i,t,r),e}function ze(e,t,r,n){let i=512&t?0:-1,o=r+i;var s=e.length-1;return o>=s&&256&t?(e[s][r]=n,t):o<=s?(e[o]=n,256&t&&r in(e=e[s])&&delete e[r],t):(n!==void 0&&(r>=(s=t>>15&1023||536870912)?n!=null&&(e[s+i]={[r]:n},Qe(e,t|=256)):e[o]=n),t)}function Ts(e,t){let r=0|(e=e.u)[ee],n=Xr(e,r,t),i=fn(n);return i!=null&&i!==n&&ze(e,r,t,i),i}function Pp(e){let t=0|(e=e.u)[ee],r=Xr(e,t,1),n=Yl(r,!0);return n!=null&&n!==r&&ze(e,t,1,n),n}function Fn(){return zy===void 0?2:4}function Mn(e,t,r,n,i){let o=e.u,s=2&(e=0|o[ee])?1:n;i=!!i;let a=0|(n=lh(o,e,t))[ee];if(!(4&a)){4&a&&(n=Tt(n),a=Gr(a,e),e=ze(o,e,t,n));let c=0,l=0;for(;c<n.length;c++){let h=r(n[c]);h!=null&&(n[l++]=h)}l<c&&(n.length=l),a=hh(a,e),r=-4097&(20|a),a=r&=-8193,Qe(n,a),2&a&&Object.freeze(n)}return s===1||s===4&&32&a?Wr(a)||(i=a,a|=2,a!==i&&Qe(n,a),Object.freeze(n)):(s===2&&Wr(a)&&(n=Tt(n),a=Gr(a,e),a=cn(a,e,i),Qe(n,a),e=ze(o,e,t,n)),Wr(a)||(t=a,a=cn(a,e,i),a!==t&&Qe(n,a))),n}function lh(e,t,r,n){return e=Xr(e,t,r,n),Array.isArray(e)?e:Xl}function hh(e,t){return e===0&&(e=Gr(e,t)),1|e}function Wr(e){return!!(2&e)&&!!(4&e)||!!(2048&e)}function Dp(e){e=Tt(e);for(let t=0;t<e.length;t++){let r=e[t]=Tt(e[t]);Array.isArray(r[1])&&(r[1]=Ci(r[1]))}return e}function Rl(e,t,r,n){let i=0|(e=e.u)[ee];un(i),ze(e,i,t,(n==="0"?Number(r)===0:r===n)?void 0:r)}function Ti(e,t,r,n,i){un(t);var o=!(!(64&t)&&16384&t);let s=(i=lh(e,t,r,i))!==Xl;if(o||!s){let a=o=s?0|i[ee]:0;(!s||2&a||Wr(a)||4&a&&!(32&a))&&(i=Tt(i),a=Gr(a,t),t=ze(e,t,r,i)),a=-13&hh(a,t),a=cn(n?-17&a:16|a,t,!0),a!==o&&Qe(i,a)}return i}function yl(e,t){var r=wm;return uh(dh(e=e.u),e,0|e[ee],r)===t?t:-1}function dh(e){if(Ws)return e[ho]??(e[ho]=new Map);if(ho in e)return e[ho];let t=new Map;return Object.defineProperty(e,ho,{value:t}),t}function Op(e,t,r,n){let i=dh(e),o=uh(i,e,t,r);return o!==n&&(o&&(t=ze(e,t,o)),i.set(r,n)),t}function uh(e,t,r,n){let i=e.get(n);if(i!=null)return i;i=0;for(let o=0;o<n.length;o++){let s=n[o];Xr(t,r,s)!=null&&(i!==0&&(r=ze(t,r,i)),i=s)}return e.set(n,i),i}function fh(e,t,r,n){let i,o=0|e[ee];if((n=Xr(e,o,r,n))!=null&&n.W===Ao)return(t=Zs(n))!==n&&ze(e,o,r,t),t.u;if(Array.isArray(n)){let s=0|n[ee];i=2&s?an(Ys(n,s,!1),t,!0):64&s?n:an(i,t,!0)}else i=an(void 0,t,!0);return i!==n&&ze(e,o,r,i),i}function Bp(e,t,r,n){let i=0|(e=e.u)[ee];return(t=sh(n=Xr(e,i,r,n),t,!1,i))!==n&&t!=null&&ze(e,i,r,t),t}function ye(e,t,r,n=!1){if((t=Bp(e,t,r,n))==null)return t;if(!(2&(n=0|(e=e.u)[ee]))){let i=Zs(t);i!==t&&ze(e,n,r,t=i)}return t}function Lp(e,t,r,n,i,o,s){e=e.u;var a=!!(2&t);let c=a?1:i;o=!!o,s&&=!a;var l=0|(i=lh(e,t,n))[ee];if(!(a=!!(4&l))){var h=i,d=t;let m=!!(2&(l=hh(l,t)));m&&(d|=2);let p=!m,g=!0,f=0,b=0;for(;f<h.length;f++){let v=sh(h[f],r,!1,d);if(v instanceof r){if(!m){let k=!!(2&(0|v.u[ee]));p&&=!k,g&&=k}h[b++]=v}}b<f&&(h.length=b),l|=4,l=g?16|l:-17&l,Qe(h,l=p?8|l:-9&l),m&&Object.freeze(h)}if(s&&!(8&l||!i.length&&(c===1||c===4&&32&l))){for(Wr(l)&&(i=Tt(i),l=Gr(l,t),t=ze(e,t,n,i)),r=i,s=l,h=0;h<r.length;h++)(l=r[h])!==(d=Zs(l))&&(r[h]=d);s|=8,Qe(r,s=r.length?-17&s:16|s),l=s}return c===1||c===4&&32&l?Wr(l)||(t=l,(l|=!i.length||16&l&&(!a||32&l)?2:2048)!==t&&Qe(i,l),Object.freeze(i)):(c===2&&Wr(l)&&(Qe(i=Tt(i),l=cn(l=Gr(l,t),t,o)),t=ze(e,t,n,i)),Wr(l)||(n=l,(l=cn(l,t,o))!==n&&Qe(i,l))),i}function qr(e,t,r){let n=0|e.u[ee];return Lp(e,n,t,r,Fn(),!1,!(2&n))}function ne(e,t,r,n){return n==null&&(n=void 0),Re(e,r,n)}function yo(e,t,r,n){n==null&&(n=void 0);e:{let i=0|(e=e.u)[ee];if(un(i),n==null){let o=dh(e);if(uh(o,e,i,r)!==t)break e;o.set(r,0)}else i=Op(e,i,r,t);ze(e,i,t,n)}}function Gr(e,t){return-2049&(e=32|(2&t?2|e:-3&e))}function cn(e,t,r){return 32&t&&r||(e&=-33),e}function Ns(e,t,r,n){let i=0|e.u[ee];un(i),e=Lp(e,i,r,t,2,!0),n=n??new r,e.push(n),e[ee]=2&(0|n.u[ee])?-9&e[ee]:-17&e[ee]}function Yt(e,t){return xi(vi(e,t))}function Qt(e,t){return bi(vi(e,t))}function Je(e,t){return Ts(e,t)??0}function So(e,t,r){if(r!=null&&typeof r!="boolean")throw e=typeof r,Error(`Expected boolean but got ${e!="object"?e:r?Array.isArray(r)?"array":e:"null"}: ${r}`);Re(e,t,r)}function Dr(e,t,r){if(r!=null){if(typeof r!="number"||!Xs(r))throw xl("int32");r|=0}Re(e,t,r)}function Y(e,t,r){if(r!=null&&typeof r!="number")throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);Re(e,t,r)}function zs(e,t,r){{let s=e.u,a=0|s[ee];if(un(a),r==null)ze(s,a,t);else{var n=e=0|r[ee],i=Wr(e),o=i||Object.isFrozen(r);for(i||(e=0),o||(r=Tt(r),n=0,e=cn(e=Gr(e,a),a,!0),o=!1),e|=21,i=0;i<r.length;i++){let c=r[i],l=xp(c);Object.is(c,l)||(o&&(r=Tt(r),n=0,e=cn(e=Gr(e,a),a,!0),o=!1),r[i]=l)}e!==n&&(o&&(r=Tt(r),e=cn(e=Gr(e,a),a,!0)),Qe(r,e)),ze(s,a,t,r)}}}function Qs(e,t,r){un(0|e.u[ee]),Mn(e,t,bi,2,!0).push(xp(r))}function Fp(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function ph(){return Error("Failed to read varint, encoding is invalid.")}function Mp(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function mh(e){if(typeof e=="string")return{buffer:yp(e),N:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),N:!1};if(e.constructor===Uint8Array)return{buffer:e,N:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),N:!1};if(e.constructor===$r)return{buffer:ql(e)||new Uint8Array(0),N:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),N:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function gh(e,t){let r,n=0,i=0,o=0,s=e.h,a=e.g;do r=s[a++],n|=(127&r)<<o,o+=7;while(o<32&&128&r);for(o>32&&(i|=(127&r)>>4),o=3;o<32&&128&r;o+=7)r=s[a++],i|=(127&r)<<o;if(Un(e,a),r<128)return t(n>>>0,i>>>0);throw ph()}function yh(e){let t=0,r=e.g,n=r+10,i=e.h;for(;r<n;){let o=i[r++];if(t|=o,(128&o)==0)return Un(e,r),!!(127&t)}throw ph()}function ln(e){let t=e.h,r=e.g,n=t[r++],i=127&n;if(128&n&&(n=t[r++],i|=(127&n)<<7,128&n&&(n=t[r++],i|=(127&n)<<14,128&n&&(n=t[r++],i|=(127&n)<<21,128&n&&(n=t[r++],i|=n<<28,128&n&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw ph();return Un(e,r),i}function Kr(e){return ln(e)>>>0}function Pl(e){var t=e.h;let r=e.g,n=t[r],i=t[r+1],o=t[r+2];return t=t[r+3],Un(e,e.g+4),(n<<0|i<<8|o<<16|t<<24)>>>0}function Dl(e){var t=Pl(e);e=2*(t>>31)+1;let r=t>>>23&255;return t&=8388607,r==255?t?NaN:e*(1/0):r==0?1401298464324817e-60*e*t:e*Math.pow(2,r-150)*(t+8388608)}function sb(e){return ln(e)}function bl(e,t,{ba:r=!1}={}){e.ba=r,t&&(t=mh(t),e.h=t.buffer,e.m=t.N,e.j=0,e.l=e.h.length,e.g=e.j)}function Un(e,t){if(e.g=t,t>e.l)throw Mp(e.l,t)}function Up(e,t){if(t<0)throw Error(`Tried to read a negative byte length: ${t}`);let r=e.g,n=r+t;if(n>e.l)throw Mp(t,e.l-r);return e.g=n,r}function Np(e,t){if(t==0)return zn();var r=Up(e,t);return e.ba&&e.m?r=e.h.subarray(r,r+t):(e=e.h,r=r===(t=r+t)?new Uint8Array(0):qy?e.slice(r,t):new Uint8Array(e.subarray(r,t))),r.length==0?zn():new $r(r,mi)}Zt.prototype.toJSON=void 0,Zt.prototype.Ia=Sp;var gf=[];function zp(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var r=Kr(e.g);if(t=r>>>3,!((r&=7)>=0&&r<=5))throw Fp(r,e.l);if(t<1)throw Error(`Invalid field number: ${t} (at position ${e.l})`);return e.m=t,e.h=r,!0}function Is(e){switch(e.h){case 0:e.h!=0?Is(e):yh(e.g);break;case 1:Un(e=e.g,e.g+8);break;case 2:if(e.h!=2)Is(e);else{var t=Kr(e.g);Un(e=e.g,e.g+t)}break;case 5:Un(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!zp(e))throw Error("Unmatched start-group tag: stream EOF");if(e.h==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}Is(e)}break;default:throw Fp(e.h,e.l)}}function To(e,t,r){let n=e.g.l,i=Kr(e.g),o=e.g.g+i,s=o-n;if(s<=0&&(e.g.l=o,r(t,e,void 0,void 0,void 0),s=o-e.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-s} bytes, either the data ended unexpectedly or the message misreported its own length`);return e.g.g=o,e.g.l=n,t}function bh(e){var t=Kr(e.g),r=Up(e=e.g,t);if(e=e.h,Ty){var n,i=e;(n=ul)||(n=ul=new TextDecoder("utf-8",{fatal:!0})),t=r+t,i=r===0&&t===i.length?i:i.subarray(r,t);try{var o=n.decode(i)}catch(a){if(ws===void 0){try{n.decode(new Uint8Array([128]))}catch{}try{n.decode(new Uint8Array([97])),ws=!0}catch{ws=!1}}throw!ws&&(ul=void 0),a}}else{t=(o=r)+t,r=[];let a,c=null;for(;o<t;){var s=e[o++];s<128?r.push(s):s<224?o>=t?Ln():(a=e[o++],s<194||(192&a)!=128?(o--,Ln()):r.push((31&s)<<6|63&a)):s<240?o>=t-1?Ln():(a=e[o++],(192&a)!=128||s===224&&a<160||s===237&&a>=160||(192&(n=e[o++]))!=128?(o--,Ln()):r.push((15&s)<<12|(63&a)<<6|63&n)):s<=244?o>=t-2?Ln():(a=e[o++],(192&a)!=128||a-144+(s<<28)>>30!=0||(192&(n=e[o++]))!=128||(192&(i=e[o++]))!=128?(o--,Ln()):(s=(7&s)<<18|(63&a)<<12|(63&n)<<6|63&i,s-=65536,r.push(55296+(s>>10&1023),56320+(1023&s)))):Ln(),r.length>=8192&&(c=Qu(c,r),r.length=0)}o=Qu(c,r)}return o}function jp(e){let t=Kr(e.g);return Np(e.g,t)}function ea(e,t,r){var n=Kr(e.g);for(n=e.g.g+n;e.g.g<n;)r.push(t(e.g))}var Es=[];function ab(e){return e}var di;function fr(e,t,r){t.g?t.m(e,t.g,t.h,r):t.m(e,t.h,r)}var J=class{constructor(e,t){this.u=Rp(e,t)}toJSON(){let e=!di;try{return e&&(di=Ip),Vp(this)}finally{e&&(di=void 0)}}l(){var e=Vb;return e.g?e.l(this,e.g,e.h,!0):e.l(this,e.h,e.defaultValue,!0)}clone(){let e=this.u;return new this.constructor(Ys(e,0|e[ee],!1))}N(){return!!(2&(0|this.u[ee]))}};function Vp(e){var t=e.u;{t=(e=di(t))!==t;let l=e.length;if(l){var r=e[l-1],n=Jl(r);n?l--:r=void 0;var i=e;if(n){e:{var o,s=r,a=!1;if(s)for(let h in s)isNaN(+h)?(o??={})[h]=s[h]:(n=s[h],Array.isArray(n)&&(Ls(n)||sf(n)&&n.size===0)&&(n=null),n==null&&(a=!0),n!=null&&((o??={})[h]=n));if(a||(o=s),o)for(let h in o){a=o;break e}a=null}s=a==null?r!=null:a!==r}for(;l>0&&((o=i[l-1])==null||Ls(o)||sf(o)&&o.size===0);l--)var c=!0;(i!==e||s||c)&&(t?(c||s||a)&&(i.length=l):i=Array.prototype.slice.call(i,0,l),a&&i.push(a)),c=i}else c=e}return c}function yf(e){return e?/^\d+$/.test(e)?(Ks(e),new Ol(Ae,We)):null:cb||=new Ol(0,0)}J.prototype.W=Ao,J.prototype.toString=function(){try{return di=ab,Vp(this).toString()}finally{di=void 0}};var Ol=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}},cb;function bf(e){return e?/^-?\d+$/.test(e)?(Ks(e),new Bl(Ae,We)):null:lb||=new Bl(0,0)}var Bl=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}},lb;function ui(e,t,r){for(;r>0||t>127;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function Ii(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function ta(e,t){if(t>=0)Ii(e,t);else{for(let r=0;r<9;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function ko(e,t){e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function _i(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function zt(e,t,r){Ii(e.g,8*t+r)}function vh(e,t){return zt(e,t,2),t=e.g.end(),_i(e,t),t.push(e.h),t}function _h(e,t){var r=t.pop();for(r=e.h+e.g.length()-r;r>127;)t.push(127&r|128),r>>>=7,e.h++;t.push(r),e.h++}function ra(e,t,r){zt(e,t,2),Ii(e.g,r.length),_i(e,e.g.end()),_i(e,r)}function js(e,t,r,n){r!=null&&(t=vh(e,t),n(r,e),_h(e,t))}function pr(){let e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var wh=pr(),Hp=pr(),Sh=pr(),kh=pr(),Wp=pr(),$p=pr(),Eh=pr(),Gp=pr(),qp=pr(),Ri=class{constructor(e,t,r){this.g=e,this.h=t,e=wh,this.l=!!e&&r===e||!1}};function na(e,t){return new Ri(e,t,wh)}function Kp(e,t,r,n,i){js(e,r,Zp(t,n),i)}var hb=na((function(e,t,r,n,i){return e.h===2&&(To(e,fh(t,n,r),i),!0)}),Kp),db=na((function(e,t,r,n,i){return e.h===2&&(To(e,fh(t,n,r,!0),i),!0)}),Kp),ia=Symbol(),Ch=Symbol(),vf=Symbol(),_f=Symbol(),Xp,Jp;function jn(e,t,r,n){var i=n[e];if(i)return i;(i={}).Pa=n,i.V=(function(d){switch(typeof d){case"boolean":return Ap||=[0,void 0,!0];case"number":return d>0?void 0:d===0?ib||=[0,void 0]:[-d,void 0];case"string":return[0,d];case"object":return d}})(n[0]);var o=n[1];let s=1;o&&o.constructor===Object&&(i.ga=o,typeof(o=n[++s])=="function"&&(i.la=!0,Xp??=o,Jp??=n[s+1],o=n[s+=2]));let a={};for(;o&&Array.isArray(o)&&o.length&&typeof o[0]=="number"&&o[0]>0;){for(var c=0;c<o.length;c++)a[o[c]]=o;o=n[++s]}for(c=1;o!==void 0;){let d;typeof o=="number"&&(c+=o,o=n[++s]);var l=void 0;if(o instanceof Ri?d=o:(d=hb,s--),d?.l){o=n[++s],l=n;var h=s;typeof o=="function"&&(o=o(),l[h]=o),l=o}for(h=c+1,typeof(o=n[++s])=="number"&&o<0&&(h-=o,o=n[++s]);c<h;c++){let m=a[c];l?r(i,c,d,l,m):t(i,c,d,m)}}return n[e]=i}function Yp(e){return Array.isArray(e)?e[0]instanceof Ri?e:[db,e]:[e,void 0]}function Zp(e,t){return e instanceof J?e.u:Array.isArray(e)?an(e,t,!1):void 0}function xh(e,t,r,n){let i=r.g;e[t]=n?(o,s,a)=>i(o,s,a,n):i}function Ah(e,t,r,n,i){let o=r.g,s,a;e[t]=(c,l,h)=>o(c,l,h,a||=jn(Ch,xh,Ah,n).V,s||=Th(n),i)}function Th(e){let t=e[vf];if(t!=null)return t;let r=jn(Ch,xh,Ah,e);return t=r.la?(n,i)=>Xp(n,i,r):(n,i)=>{let o=0|n[ee];for(;zp(i)&&i.h!=4;){var s=i.m,a=r[s];if(a==null){var c=r.ga;c&&(c=c[s])&&(c=ub(c))!=null&&(a=r[s]=c)}a!=null&&a(i,n,s)||(s=(a=i).l,Is(a),a.fa?a=void 0:(c=a.g.g-s,a.g.g=s,a=Np(a.g,c)),s=n,a&&((c=s[gi])?c.push(a):s[gi]=[a]))}return 16384&o&&Ci(n),!0},e[vf]=t}function ub(e){let t=(e=Yp(e))[0].g;if(e=e[1]){let r=Th(e),n=jn(Ch,xh,Ah,e).V;return(i,o,s)=>t(i,o,s,n,r)}return t}function oa(e,t,r){e[t]=r.h}function sa(e,t,r,n){let i,o,s=r.h;e[t]=(a,c,l)=>s(a,c,l,o||=jn(ia,oa,sa,n).V,i||=Qp(n))}function Qp(e){let t=e[_f];if(!t){let r=jn(ia,oa,sa,e);t=(n,i)=>em(n,i,r),e[_f]=t}return t}function em(e,t,r){for(var n=0|e[ee],i=512&n?0:-1,o=e.length,s=512&n?1:0,a=o+(256&n?-1:0);s<a;s++){let c=e[s];if(c==null)continue;let l=s-i,h=wf(r,l);h&&h(t,c,l)}if(256&n){n=e[o-1];for(let c in n)i=+c,Number.isNaN(i)||(o=n[i])!=null&&(a=wf(r,i))&&a(t,o,i)}if(e=Zl(e))for(_i(t,t.g.end()),r=0;r<e.length;r++)_i(t,ql(e[r])||new Uint8Array(0))}function wf(e,t){var r=e[t];if(r)return r;if((r=e.ga)&&(r=r[t])){var n=(r=Yp(r))[0].h;if(r=r[1]){let i=Qp(r),o=jn(ia,oa,sa,r).V;r=e.la?Jp(o,i):(s,a,c)=>n(s,a,c,o,i)}else r=n;return e[t]=r}}function Pi(e,t){if(Array.isArray(t)){var r=0|t[ee];if(4&r)return t;for(var n=0,i=0;n<t.length;n++){let o=e(t[n]);o!=null&&(t[i++]=o)}return i<n&&(t.length=i),Qe(t,-12289&(5|r)),2&r&&Object.freeze(t),t}}function vt(e,t,r){return new Ri(e,t,r)}function Di(e,t,r){return new Ri(e,t,r)}function _t(e,t,r){ze(e,0|e[ee],t,r)}var fb=na((function(e,t,r,n,i){return e.h===2&&(e=To(e,an([void 0,void 0],n,!0),i),un(n=0|t[ee]),(i=Xr(t,n,r))instanceof Zt?(2&i.L)!=0?((i=i.X()).push(e),ze(t,n,r,i)):i.Na(e):Array.isArray(i)?(2&(0|i[ee])&&ze(t,n,r,i=Dp(i)),i.push(e)):ze(t,n,r,[e]),!0)}),(function(e,t,r,n,i){if(t instanceof Zt)t.forEach(((o,s)=>{js(e,r,an([s,o],n,!1),i)}));else if(Array.isArray(t))for(let o=0;o<t.length;o++){let s=t[o];Array.isArray(s)&&js(e,r,an(s,n,!1),i)}}));function tm(e,t,r){if(t=(function(n){if(n==null)return n;let i=typeof n;if(i==="bigint")return String(nh(64,n));if(Js(n)){if(i==="string")return oh(n);if(i==="number")return ih(n)}})(t),t!=null&&(typeof t=="string"&&bf(t),t!=null))switch(zt(e,r,0),typeof t){case"number":e=e.g,yi(t),ui(e,Ae,We);break;case"bigint":r=BigInt.asUintN(64,t),r=new Bl(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),ui(e.g,r.h,r.g);break;default:r=bf(t),ui(e.g,r.h,r.g)}}function rm(e,t,r){(t=xi(t))!=null&&t!=null&&(zt(e,r,0),ta(e.g,t))}function nm(e,t,r){(t=Ep(t))!=null&&(zt(e,r,0),e.g.g.push(t?1:0))}function im(e,t,r){(t=bi(t))!=null&&ra(e,r,up(t))}function om(e,t,r,n,i){js(e,r,Zp(t,n),i)}function sm(e,t,r){(t=t==null||typeof t=="string"||Co(t)||t instanceof $r?t:void 0)!=null&&ra(e,r,mh(t).buffer)}function am(e,t,r){return(e.h===5||e.h===2)&&(t=Ti(t,0|t[ee],r,!1,!1),e.h==2?ea(e,Dl,t):t.push(Dl(e.g)),!0)}var Vr=vt((function(e,t,r){if(e.h!==1)return!1;var n=e.g;e=Pl(n);let i=Pl(n);n=2*(i>>31)+1;let o=i>>>20&2047;return e=4294967296*(1048575&i)+e,_t(t,r,o==2047?e?NaN:n*(1/0):o==0?5e-324*n*e:n*Math.pow(2,o-1075)*(e+4503599627370496)),!0}),(function(e,t,r){(t=fn(t))!=null&&(zt(e,r,1),e=e.g,(r=kp||=new DataView(new ArrayBuffer(8))).setFloat64(0,+t,!0),Ae=r.getUint32(0,!0),We=r.getUint32(4,!0),ko(e,Ae),ko(e,We))}),pr()),et=vt((function(e,t,r){return e.h===5&&(_t(t,r,Dl(e.g)),!0)}),(function(e,t,r){(t=fn(t))!=null&&(zt(e,r,5),e=e.g,Ql(t),ko(e,Ae))}),Eh),pb=Di(am,(function(e,t,r){if((t=Pi(fn,t))!=null)for(let s=0;s<t.length;s++){var n=e,i=r,o=t[s];o!=null&&(zt(n,i,5),n=n.g,Ql(o),ko(n,Ae))}}),Eh),Ih=Di(am,(function(e,t,r){if((t=Pi(fn,t))!=null&&t.length){zt(e,r,2),Ii(e.g,4*t.length);for(let n=0;n<t.length;n++)r=e.g,Ql(t[n]),ko(r,Ae)}}),Eh),hn=vt((function(e,t,r){return e.h===0&&(_t(t,r,gh(e.g,th)),!0)}),tm,$p),vl=vt((function(e,t,r){return e.h===0&&(_t(t,r,(e=gh(e.g,th))===0?void 0:e),!0)}),tm,$p),mb=vt((function(e,t,r){return e.h===0&&(_t(t,r,gh(e.g,eh)),!0)}),(function(e,t,r){if((t=Jy(t))!=null&&(typeof t=="string"&&yf(t),t!=null))switch(zt(e,r,0),typeof t){case"number":e=e.g,yi(t),ui(e,Ae,We);break;case"bigint":r=BigInt.asUintN(64,t),r=new Ol(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),ui(e.g,r.h,r.g);break;default:r=yf(t),ui(e.g,r.h,r.g)}}),pr()),$e=vt((function(e,t,r){return e.h===0&&(_t(t,r,ln(e.g)),!0)}),rm,kh),aa=Di((function(e,t,r){return(e.h===0||e.h===2)&&(t=Ti(t,0|t[ee],r,!1,!1),e.h==2?ea(e,ln,t):t.push(ln(e.g)),!0)}),(function(e,t,r){if((t=Pi(xi,t))!=null&&t.length){r=vh(e,r);for(let n=0;n<t.length;n++)ta(e.g,t[n]);_h(e,r)}}),kh),li=vt((function(e,t,r){return e.h===0&&(_t(t,r,(e=ln(e.g))===0?void 0:e),!0)}),rm,kh),Fe=vt((function(e,t,r){return e.h===0&&(_t(t,r,yh(e.g)),!0)}),nm,Hp),fi=vt((function(e,t,r){return e.h===0&&(_t(t,r,(e=yh(e.g))===!1?void 0:e),!0)}),nm,Hp),mt=Di((function(e,t,r){return e.h===2&&(e=bh(e),Ti(t,0|t[ee],r,!1).push(e),!0)}),(function(e,t,r){if((t=Pi(bi,t))!=null)for(let s=0;s<t.length;s++){var n=e,i=r,o=t[s];o!=null&&ra(n,i,up(o))}}),Sh),sn=vt((function(e,t,r){return e.h===2&&(_t(t,r,(e=bh(e))===""?void 0:e),!0)}),im,Sh),we=vt((function(e,t,r){return e.h===2&&(_t(t,r,bh(e)),!0)}),im,Sh),st=(function(e,t,r=wh){return new Ri(e,t,r)})((function(e,t,r,n,i){return e.h===2&&(n=an(void 0,n,!0),Ti(t,0|t[ee],r,!0).push(n),To(e,n,i),!0)}),(function(e,t,r,n,i){if(Array.isArray(t))for(let o=0;o<t.length;o++)om(e,t[o],r,n,i)})),Ee=na((function(e,t,r,n,i,o){return e.h===2&&(Op(t,0|t[ee],o,r),To(e,t=fh(t,n,r),i),!0)}),om),cm=vt((function(e,t,r){return e.h===2&&(_t(t,r,jp(e)),!0)}),sm,Gp),gb=Di((function(e,t,r){return(e.h===0||e.h===2)&&(t=Ti(t,0|t[ee],r,!1,!1),e.h==2?ea(e,Kr,t):t.push(Kr(e.g)),!0)}),(function(e,t,r){if((t=Pi(Cp,t))!=null)for(let s=0;s<t.length;s++){var n=e,i=r,o=t[s];o!=null&&(zt(n,i,0),Ii(n.g,o))}}),Wp),yb=vt((function(e,t,r){return e.h===0&&(_t(t,r,(e=Kr(e.g))===0?void 0:e),!0)}),(function(e,t,r){(t=Cp(t))!=null&&t!=null&&(zt(e,r,0),Ii(e.g,t))}),Wp),er=vt((function(e,t,r){return e.h===0&&(_t(t,r,ln(e.g)),!0)}),(function(e,t,r){(t=xi(t))!=null&&(t=parseInt(t,10),zt(e,r,0),ta(e.g,t))}),qp),Ll=class{constructor(t,r){this.h=t,this.g=r,this.l=ye,this.m=ne,this.defaultValue=void 0}};function mr(e,t){return new Ll(e,t)}function pn(e,t){return(r,n)=>{if(Es.length){let o=Es.pop();o.o(n),bl(o.g,r,n),r=o}else r=new class{constructor(o,s){if(gf.length){let a=gf.pop();bl(a,o,s),o=a}else o=new class{constructor(a,c){this.h=null,this.m=!1,this.g=this.l=this.j=0,bl(this,a,c)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.ba=!1}}(o,s);this.g=o,this.l=this.g.g,this.h=this.m=-1,this.o(s)}o({fa:o=!1}={}){this.fa=o}}(r,n);try{let o=new e,s=o.u;Th(t)(s,r);var i=o}finally{r.g.clear(),r.m=-1,r.h=-1,Es.length<100&&Es.push(r)}return i}}function ca(e){return function(){let t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){let s=this.g;return this.g=[],s}}}};em(this.u,t,jn(ia,oa,sa,e)),_i(t,t.g.end());let r=new Uint8Array(t.h),n=t.l,i=n.length,o=0;for(let s=0;s<i;s++){let a=n[s];r.set(a,o),o+=a.length}return t.l=[r],r}}var Sf=class extends J{constructor(e){super(e)}},kf=[0,sn,vt((function(e,t,r){return e.h===2&&(_t(t,r,(e=jp(e))===zn()?void 0:e),!0)}),(function(e,t,r){if(t!=null){if(t instanceof J){let n=t.Ra;return void(n&&(t=n(t),t!=null&&ra(e,r,mh(t).buffer)))}if(Array.isArray(t))return}sm(e,t,r)}),Gp)],_l,Ef=globalThis.trustedTypes;function Cf(e){_l===void 0&&(_l=(function(){let r=null;if(!Ef)return r;try{let n=i=>i;r=Ef.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch{}return r})());var t=_l;return new class{constructor(r){this.g=r}toString(){return this.g+""}}(t?t.createScriptURL(e):e)}function bb(e,...t){if(t.length===0)return Cf(e[0]);let r=e[0];for(let n=0;n<t.length;n++)r+=encodeURIComponent(t[n])+e[n+1];return Cf(r)}var lm=[0,$e,er,Fe,-1,aa,er,-1],vb=class extends J{constructor(e){super(e)}},hm=[0,Fe,we,Fe,er,-1,Di((function(e,t,r){return(e.h===0||e.h===2)&&(t=Ti(t,0|t[ee],r,!1,!1),e.h==2?ea(e,sb,t):t.push(ln(e.g)),!0)}),(function(e,t,r){if((t=Pi(xi,t))!=null&&t.length){r=vh(e,r);for(let n=0;n<t.length;n++)ta(e.g,t[n]);_h(e,r)}}),qp),we,-1,[0,Fe,-1],er,Fe,-1],dm=[0,we,-2],xf=class extends J{constructor(e){super(e)}},um=[0],fm=[0,$e,Fe,1,Fe,-3],Nt=class extends J{constructor(e){super(e,2)}},tt={};tt[336783863]=[0,we,Fe,-1,$e,[0,[1,2,3,4,5,6,7,8],Ee,um,Ee,hm,Ee,dm,Ee,fm,Ee,lm,Ee,[0,we,-2],Ee,[0,we,er],Ee,[0,er,we]],[0,we],Fe,[0,[1,3],[2,4],Ee,[0,aa],-1,Ee,[0,mt],-1,st,[0,we,-1]],we];var Af=[0,vl,-1,fi,-3,vl,aa,sn,li,vl,-1,fi,li,fi,-2,sn];function jt(e,t){Rl(e,2,Ai(t),"")}function Pe(e,t){Qs(e,3,t)}function pe(e,t){Qs(e,4,t)}var bt=class extends J{constructor(e){super(e,500)}o(e){return ne(this,0,7,e)}},bo=[-1,{}],Tf=[0,we,1,bo],If=[0,we,mt,bo];function Vt(e,t){Ns(e,1,bt,t)}function Be(e,t){Qs(e,10,t)}function be(e,t){Qs(e,15,t)}var Rt=class extends J{constructor(e){super(e,500)}o(e){return ne(this,0,1001,e)}},pm=[-500,st,[-500,sn,-1,mt,-3,[-2,tt,Fe],st,kf,li,-1,Tf,If,st,[0,sn,fi],sn,Af,li,mt,987,mt],4,st,[-500,we,-1,[-1,{}],998,we],st,[-500,we,mt,-1,[-2,{},Fe],997,mt,-1],li,st,[-500,we,mt,bo,998,mt],mt,li,Tf,If,st,[0,sn,-1,bo],mt,-2,Af,sn,-1,fi,[0,fi,yb],978,bo,st,kf];Rt.prototype.g=ca(pm);var _b=pn(Rt,pm),wb=class extends J{constructor(e){super(e)}},mm=class extends J{constructor(e){super(e)}g(){return qr(this,wb,1)}},gm=[0,st,[0,$e,et,we,-1]],la=pn(mm,gm),Sb=class extends J{constructor(e){super(e)}},kb=class extends J{constructor(e){super(e)}},wl=class extends J{constructor(e){super(e)}h(){return ye(this,Sb,2)}g(){return qr(this,kb,5)}},ym=pn(class extends J{constructor(e){super(e)}},[0,mt,aa,Ih,[0,er,[0,$e,-3],[0,et,-3],[0,$e,-1,[0,st,[0,$e,-2]]],st,[0,et,-1,we,et]],we,-1,hn,st,[0,$e,et],mt,hn]),bm=class extends J{constructor(e){super(e)}},pi=pn(class extends J{constructor(e){super(e)}},[0,st,[0,et,-4]]),vm=class extends J{constructor(e){super(e)}},Io=pn(class extends J{constructor(e){super(e)}},[0,st,[0,et,-4]]),Eb=class extends J{constructor(e){super(e)}},Cb=[0,$e,-1,Ih,er],_m=class extends J{constructor(e){super(e)}};_m.prototype.g=ca([0,et,-4,hn]);var xb=class extends J{constructor(e){super(e)}},Ab=pn(class extends J{constructor(e){super(e)}},[0,st,[0,1,$e,we,gm],hn]),Rf=class extends J{constructor(e){super(e)}},Tb=class extends J{constructor(e){super(e)}oa(){let e=Pp(this);return e??zn()}},Ib=class extends J{constructor(e){super(e)}},wm=[1,2],Rb=pn(class extends J{constructor(e){super(e)}},[0,st,[0,wm,Ee,[0,Ih],Ee,[0,cm],$e,we],hn]),Rh=class extends J{constructor(e){super(e)}},Sm=[0,we,$e,et,mt,-1],Pf=class extends J{constructor(e){super(e)}},Pb=[0,Fe,-1],Df=class extends J{constructor(e){super(e)}},Rs=[1,2,3,4,5],Vs=class extends J{constructor(e){super(e)}g(){return Pp(this)!=null}h(){return Qt(this,2)!=null}},Me=class extends J{constructor(e){super(e)}g(){return Ep(vi(this,2))??!1}},km=[0,cm,we,[0,$e,hn,-1],[0,mb,hn]],Ye=[0,km,Fe,[0,Rs,Ee,fm,Ee,hm,Ee,lm,Ee,um,Ee,dm],er],ha=class extends J{constructor(e){super(e)}},Ph=[0,Ye,et,-1,$e],Db=mr(502141897,ha);tt[502141897]=Ph;var Ob=pn(class extends J{constructor(e){super(e)}},[0,[0,er,-1,pb,gb],Cb]),Em=class extends J{constructor(e){super(e)}},Cm=class extends J{constructor(e){super(e)}},Dh=[0,Ye,et,[0,Ye],Fe],xm=[0,Ye,Ph,Dh,et,[0,[0,km]]],Bb=mr(508968150,Cm);tt[508968150]=xm,tt[508968149]=Dh;var Am=class extends J{constructor(e){super(e)}},Lb=mr(513916220,Am);tt[513916220]=[0,Ye,xm,$e];var ai=class extends J{constructor(e){super(e)}h(){return ye(this,Rh,2)}g(){Re(this,2)}},Tm=[0,Ye,Sm];tt[478825465]=Tm;var Fb=class extends J{constructor(e){super(e)}},Im=class extends J{constructor(e){super(e)}},Oh=class extends J{constructor(e){super(e)}},Bh=class extends J{constructor(e){super(e)}},Rm=class extends J{constructor(e){super(e)}},Of=[0,Ye,[0,Ye],Tm,-1],Pm=[0,Ye,et,$e],Lh=[0,Ye,et],Dm=[0,Ye,Pm,Lh,et],Mb=mr(479097054,Rm);tt[479097054]=[0,Ye,Dm,Of],tt[463370452]=Of,tt[464864288]=Pm;var Ub=mr(462713202,Bh);tt[462713202]=Dm,tt[474472470]=Lh;var Nb=class extends J{constructor(e){super(e)}},Om=class extends J{constructor(e){super(e)}},Bm=class extends J{constructor(e){super(e)}},Lm=class extends J{constructor(e){super(e)}},Fh=[0,Ye,et,-1,$e],Fl=[0,Ye,et,Fe];Lm.prototype.g=ca([0,Ye,Lh,[0,Ye],Ph,Dh,Fh,Fl]);var Fm=class extends J{constructor(e){super(e)}},zb=mr(456383383,Fm);tt[456383383]=[0,Ye,Sm];var Mm=class extends J{constructor(e){super(e)}},jb=mr(476348187,Mm);tt[476348187]=[0,Ye,Pb];var Um=class extends J{constructor(e){super(e)}},Bf=class extends J{constructor(e){super(e)}},Nm=[0,er,-1],Vb=mr(458105876,class extends J{constructor(e){super(e)}g(){var e=this.u;let t=0|e[ee],r=2&t;return e=(function(n,i,o){var s=Bf;let a=2&i,c=!1;if(o==null){if(a)return mf();o=[]}else if(o.constructor===Zt){if((2&o.L)==0||a)return o;o=o.X()}else Array.isArray(o)?c=!!(2&(0|o[ee])):o=[];if(a){if(!o.length)return mf();c||(c=!0,Ci(o))}else c&&(c=!1,o=Dp(o));return c||(64&(0|o[ee])?o[ee]&=-33:32&i&&$s(o,32)),ze(n,i,2,s=new Zt(o,s,Yy,void 0)),s})(e,t,Xr(e,t,2)),!r&&Bf&&(e.ra=!0),e}});tt[458105876]=[0,Nm,fb,[!0,hn,[0,we,-1,mt]]];var Mh=class extends J{constructor(e){super(e)}},zm=mr(458105758,Mh);tt[458105758]=[0,Ye,we,Nm];var jm=class extends J{constructor(e){super(e)}},Hb=mr(443442058,jm);tt[443442058]=[0,Ye,we,$e,et,mt,-1,Fe,et],tt[514774813]=Fh;var Vm=class extends J{constructor(e){super(e)}},Wb=mr(516587230,Vm);function Ml(e,t){return t=t?t.clone():new Rh,e.displayNamesLocale!==void 0?Re(t,1,Ai(e.displayNamesLocale)):e.displayNamesLocale===void 0&&Re(t,1),e.maxResults!==void 0?Dr(t,2,e.maxResults):"maxResults"in e&&Re(t,2),e.scoreThreshold!==void 0?Y(t,3,e.scoreThreshold):"scoreThreshold"in e&&Re(t,3),e.categoryAllowlist!==void 0?zs(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&Re(t,4),e.categoryDenylist!==void 0?zs(t,5,e.categoryDenylist):"categoryDenylist"in e&&Re(t,5),t}function Uh(e,t=-1,r=""){return{categories:e.map((n=>({index:Yt(n,1)??0??-1,score:Je(n,2)??0,categoryName:Qt(n,3)??""??"",displayName:Qt(n,4)??""??""}))),headIndex:t,headName:r}}function Hm(e){var t=Mn(e,3,fn,Fn()),r=Mn(e,2,xi,Fn()),n=Mn(e,1,bi,Fn()),i=Mn(e,9,bi,Fn());let o={categories:[],keypoints:[]};for(let s=0;s<t.length;s++)o.categories.push({score:t[s],index:r[s]??-1,categoryName:n[s]??"",displayName:i[s]??""});if((t=ye(e,wl,4)?.h())&&(o.boundingBox={originX:Yt(t,1)??0,originY:Yt(t,2)??0,width:Yt(t,3)??0,height:Yt(t,4)??0,angle:0}),ye(e,wl,4)?.g().length)for(let s of ye(e,wl,4).g())o.keypoints.push({x:Ts(s,1)??0,y:Ts(s,2)??0,score:Ts(s,4)??0,label:Qt(s,3)??""});return o}function da(e){let t=[];for(let r of qr(e,vm,1))t.push({x:Je(r,1)??0,y:Je(r,2)??0,z:Je(r,3)??0,visibility:Je(r,4)??0});return t}function vo(e){let t=[];for(let r of qr(e,bm,1))t.push({x:Je(r,1)??0,y:Je(r,2)??0,z:Je(r,3)??0,visibility:Je(r,4)??0});return t}function Lf(e){return Array.from(e,(t=>t>127?t-256:t))}function Ff(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let r=0,n=0,i=0;for(let o=0;o<e.length;o++)r+=e[o]*t[o],n+=e[o]*e[o],i+=t[o]*t[o];if(n<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*i)}var Cs;tt[516587230]=[0,Ye,Fh,Fl,et],tt[518928384]=Fl;var $b=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Wm(){if(Cs===void 0)try{await WebAssembly.instantiate($b),Cs=!0}catch{Cs=!1}return Cs}async function uo(e,t=bb``){let r=await Wm()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var nn=class{};function $m(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!(function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")})(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function Mf(e){if(typeof importScripts!="function"){let t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise(((r,n)=>{t.addEventListener("load",(()=>{r()}),!1),t.addEventListener("error",(i=>{n(i)}),!1),document.body.appendChild(t)}))}importScripts(e.toString())}function Gm(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function Q(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Uf(e,t,r){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(r?e.i._bindTextureToStream(r):e.i._bindTextureToCanvas(),!(r=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);let[n,i]=Gm(t);return!e.l||n===e.i.canvas.width&&i===e.i.canvas.height||(e.i.canvas.width=n,e.i.canvas.height=i),[n,i]}function Nf(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");let n=new Uint32Array(t.length);for(let i=0;i<t.length;i++)n[i]=e.i.stringToNewUTF8(t[i]);t=e.i._malloc(4*n.length),e.i.HEAPU32.set(n,t>>2),r(t);for(let i of n)e.i._free(i);e.i._free(t)}function Tr(e,t,r){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=r}function rn(e,t,r){let n=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(i,o,s)=>{o?(r(n,s),n=[]):n.push(i)}}nn.forVisionTasks=function(e){return uo("vision",e)},nn.forTextTasks=function(e){return uo("text",e)},nn.forGenAiExperimentalTasks=function(e){return uo("genai_experimental",e)},nn.forGenAiTasks=function(e){return uo("genai",e)},nn.forAudioTasks=function(e){return uo("audio",e)},nn.isSimdSupported=function(){return Wm()};async function Gb(e,t,r,n){return e=await(async(i,o,s,a,c)=>{if(o&&await Mf(o),!self.ModuleFactory||s&&(await Mf(s),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&c&&((o=self.Module).locateFile=c.locateFile,c.mainScriptUrlOrBlob&&(o.mainScriptUrlOrBlob=c.mainScriptUrlOrBlob)),c=await self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new i(c,a)})(e,r.wasmLoaderPath,r.assetLoaderPath,t,{locateFile:i=>i.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&i.endsWith(".data")?r.assetBinaryPath.toString():i}),await e.o(n),e}function Sl(e,t){let r=ye(e.baseOptions,Vs,1)||new Vs;typeof t=="string"?(Re(r,2,Ai(t)),Re(r,1)):t instanceof Uint8Array&&(Re(r,1,Yl(t,!1)),Re(r,2)),ne(e.baseOptions,0,1,r)}function zf(e){try{let t=e.G.length;if(t===1)throw Error(e.G[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.G.map((r=>r.message)).join(", "))}finally{e.G=[]}}function X(e,t){e.B=Math.max(e.B,t)}function ua(e,t){e.A=new bt,jt(e.A,"PassThroughCalculator"),Pe(e.A,"free_memory"),pe(e.A,"free_memory_unused_out"),Be(t,"free_memory"),Vt(t,e.A)}function wi(e,t){Pe(e.A,t),pe(e.A,t+"_unused_out")}function fa(e){e.g.addBoolToStream(!0,"free_memory",e.B)}var Ps=class{constructor(e){this.g=e,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){if(t){let r=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(ye(this.baseOptions,Vs,1)?.g()||ye(this.baseOptions,Vs,1)?.h()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if((function(n,i){let o=ye(n.baseOptions,Df,3);if(!o){var s=o=new Df,a=new xf;yo(s,4,Rs,a)}"delegate"in i&&(i.delegate==="GPU"?(i=o,s=new vb,yo(i,2,Rs,s)):(i=o,s=new xf,yo(i,4,Rs,s))),ne(n.baseOptions,0,3,o)})(this,r),r.modelAssetPath)return fetch(r.modelAssetPath.toString()).then((n=>{if(n.ok)return n.arrayBuffer();throw Error(`Failed to fetch model: ${r.modelAssetPath} (${n.status})`)})).then((n=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(n),!0,!1,!1),Sl(this,"/model.dat"),this.m(),this.I()}));if(r.modelAssetBuffer instanceof Uint8Array)Sl(this,r.modelAssetBuffer);else if(r.modelAssetBuffer)return(async function(n){let i=[];for(var o=0;;){let{done:s,value:a}=await n.read();if(s)break;i.push(a),o+=a.length}if(i.length===0)return new Uint8Array(0);if(i.length===1)return i[0];n=new Uint8Array(o),o=0;for(let s of i)n.set(s,o),o+=s.length;return n})(r.modelAssetBuffer).then((n=>{Sl(this,n),this.m(),this.I()}))}return this.m(),this.I(),Promise.resolve()}I(){}da(){let e;if(this.g.da((t=>{e=_b(t)})),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener(((r,n)=>{this.G.push(Error(n))})),this.g.La(),this.g.setGraph(e,t),this.A=void 0,zf(this)}finishProcessing(){this.g.finishProcessing(),zf(this)}close(){this.A=void 0,this.g.closeGraph()}};function yt(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}Ps.prototype.close=Ps.prototype.close,(function(e,t){e=e.split(".");var r,n=Nn;for((e[0]in n)||n.execScript===void 0||n.execScript("var "+e[0]);e.length&&(r=e.shift());)e.length||t===void 0?n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}:n[r]=t})("TaskRunner",Ps);var Ul=class{constructor(t,r,n,i){this.g=t,this.h=r,this.m=n,this.l=i}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}};function jf(e,t,r){let n=e.g;if(r=yt(n.createShader(r),"Failed to create WebGL shader"),n.shaderSource(r,t),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(r)}`);return n.attachShader(e.h,r),r}function Vf(e,t){let r=e.g,n=yt(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(n);let i=yt(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,i),r.enableVertexAttribArray(e.O),r.vertexAttribPointer(e.O,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);let o=yt(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,o),r.enableVertexAttribArray(e.I),r.vertexAttribPointer(e.I,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new Ul(r,n,i,o)}function Nh(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function Ro(e,t,r,n){return Nh(e,t),e.h||(e.m(),e.C()),r?(e.s||(e.s=Vf(e,!0)),r=e.s):(e.v||(e.v=Vf(e,!1)),r=e.v),t.useProgram(e.h),r.bind(),e.l(),e=n(),r.g.bindVertexArray(null),e}function dn(e,t,r){return Nh(e,t),e=yt(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function pa(e,t,r){Nh(e,t),e.A||(e.A=yt(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.A),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}function zh(e){e.g?.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Oi=class{G(){return`
10
10
  precision mediump float;
11
11
  varying vec2 vTex;
12
12
  uniform sampler2D inputTexture;
@@ -32,7 +32,7 @@ Minimum version required to store current data is: `+o+`.
32
32
  vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));
33
33
  gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);
34
34
  }
35
- `}C(){let e=this.g;e.activeTexture(e.TEXTURE1),this.B=hn(this,e,e.LINEAR),e.activeTexture(e.TEXTURE2),this.j=hn(this,e,e.NEAREST)}m(){super.m();let e=this.g;this.K=yt(e.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.T=yt(e.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.J=yt(e.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();let e=this.g;e.uniform1i(this.J,0),e.uniform1i(this.K,1),e.uniform1i(this.T,2)}close(){this.B&&this.g.deleteTexture(this.B),this.j&&this.g.deleteTexture(this.j),super.close()}},Kb=class extends Oi{G(){return`
35
+ `}C(){let e=this.g;e.activeTexture(e.TEXTURE1),this.B=dn(this,e,e.LINEAR),e.activeTexture(e.TEXTURE2),this.j=dn(this,e,e.NEAREST)}m(){super.m();let e=this.g;this.K=yt(e.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.T=yt(e.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.J=yt(e.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();let e=this.g;e.uniform1i(this.J,0),e.uniform1i(this.K,1),e.uniform1i(this.T,2)}close(){this.B&&this.g.deleteTexture(this.B),this.j&&this.g.deleteTexture(this.j),super.close()}},Kb=class extends Oi{G(){return`
36
36
  precision mediump float;
37
37
  uniform sampler2D maskTexture;
38
38
  uniform sampler2D defaultTexture;
@@ -46,7 +46,7 @@ Minimum version required to store current data is: `+o+`.
46
46
  overlayColor = mix(defaultColor, overlayColor, overlayColor.a);
47
47
  gl_FragColor = mix(defaultColor, overlayColor, confidence);
48
48
  }
49
- `}C(){let e=this.g;e.activeTexture(e.TEXTURE1),this.j=hn(this,e),e.activeTexture(e.TEXTURE2),this.B=hn(this,e)}m(){super.m();let e=this.g;this.J=yt(e.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.K=yt(e.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.H=yt(e.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();let e=this.g;e.uniform1i(this.H,0),e.uniform1i(this.J,1),e.uniform1i(this.K,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function Hr(e,t){switch(t){case 0:return e.g.find((r=>r instanceof Uint8Array));case 1:return e.g.find((r=>r instanceof Float32Array));case 2:return e.g.find((r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture));default:throw Error(`Type is not supported: ${t}`)}}function Nl(e){var t=Hr(e,1);if(!t){if(t=Hr(e,0))t=new Float32Array(t).map((n=>n/255));else{t=new Float32Array(e.width*e.height);let n=Si(e);var r=jh(e);if(pa(r,n,qm(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){r=new Float32Array(e.width*e.height*4),n.readPixels(0,0,e.width,e.height,n.RGBA,n.FLOAT,r);for(let i=0,o=0;i<t.length;++i,o+=4)t[i]=r[o]}else n.readPixels(0,0,e.width,e.height,n.RED,n.FLOAT,t)}e.g.push(t)}return t}function qm(e){let t=Hr(e,2);if(!t){let r=Si(e);t=Xm(e);let n=Nl(e),i=Km(e);r.texImage2D(r.TEXTURE_2D,0,i,e.width,e.height,0,r.RED,r.FLOAT,n),zl(e)}return t}function Si(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=yt(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Km(e){if(e=Si(e),!xs)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))xs=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");xs=e.R16F}return xs}function jh(e){return e.l||(e.l=new Oi),e.l}function Xm(e){let t=Si(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=Hr(e,2);return r||(r=hn(jh(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(r),e.j=!0),t.bindTexture(t.TEXTURE_2D,r),r}function zl(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var xs,ot=class{constructor(e,t,r,n,i,o,s){this.g=e,this.m=t,this.j=r,this.canvas=n,this.l=i,this.width=o,this.height=s,this.j&&--Hf===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Fa(){return!!Hr(this,0)}ja(){return!!Hr(this,1)}P(){return!!Hr(this,2)}ia(){return(t=Hr(e=this,0))||(t=Nl(e),t=new Uint8Array(t.map((r=>255*r))),e.g.push(t)),t;var e,t}ha(){return Nl(this)}M(){return qm(this)}clone(){let e=[];for(let t of this.g){let r;if(t instanceof Uint8Array)r=new Uint8Array(t);else if(t instanceof Float32Array)r=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{let n=Si(this),i=jh(this);n.activeTexture(n.TEXTURE1),r=hn(i,n,this.m?n.LINEAR:n.NEAREST),n.bindTexture(n.TEXTURE_2D,r);let o=Km(this);n.texImage2D(n.TEXTURE_2D,0,o,this.width,this.height,0,n.RED,n.FLOAT,null),n.bindTexture(n.TEXTURE_2D,null),pa(i,n,r),Ro(i,n,!1,(()=>{Xm(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),zl(this)})),zh(i),zl(this)}}e.push(r)}return new ot(e,this.m,this.P(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Si(this).deleteTexture(Hr(this,2)),Hf=-1}};ot.prototype.close=ot.prototype.close,ot.prototype.clone=ot.prototype.clone,ot.prototype.getAsWebGLTexture=ot.prototype.M,ot.prototype.getAsFloat32Array=ot.prototype.ha,ot.prototype.getAsUint8Array=ot.prototype.ia,ot.prototype.hasWebGLTexture=ot.prototype.P,ot.prototype.hasFloat32Array=ot.prototype.ja,ot.prototype.hasUint8Array=ot.prototype.Fa;var Hf=250,Xb={color:"white",lineWidth:4,radius:6};function kl(e){return{...Xb,fillColor:(e=e||{}).color,...e}}function jr(e,t){return e instanceof Function?e(t):e}function Wf(e,t,r){return Math.max(Math.min(t,r),Math.min(Math.max(t,r),e))}function fo(e){if(!e.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return e.l}function Eo(e){if(!e.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return e.j}function $f(e,t,r){if(t.P())r(t.M());else{let n=t.ja()?t.ha():t.ia();e.m=e.m??new Oi;let i=Eo(e);r((e=new ot([n],t.m,!1,i.canvas,e.m,t.width,t.height)).M()),e.close()}}function Gf(e,t,r,n){let i=(function(a){return a.g||(a.g=new qb),a.g})(e),o=Eo(e),s=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;Ro(i,o,!0,(()=>{(function(c,l,h,d){let m=c.g;if(m.activeTexture(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,l),m.activeTexture(m.TEXTURE1),m.bindTexture(m.TEXTURE_2D,c.B),m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,h),c.H&&(function(p,g){if(p!==g)return!1;p=p.entries(),g=g.entries();for(let[b,v]of p){p=b;let k=v;var f=g.next();if(f.done)return!1;let[S,I]=f.value;if(f=I,p!==S||k[0]!==f[0]||k[1]!==f[1]||k[2]!==f[2]||k[3]!==f[3])return!1}return!!g.next().done})(c.H,d))m.activeTexture(m.TEXTURE2),m.bindTexture(m.TEXTURE_2D,c.j);else{c.H=d;let p=Array(1024).fill(0);d.forEach(((g,f)=>{if(g.length!==4)throw Error(`Color at index ${f} is not a four-channel value.`);p[4*f]=g[0],p[4*f+1]=g[1],p[4*f+2]=g[2],p[4*f+3]=g[3]})),m.activeTexture(m.TEXTURE2),m.bindTexture(m.TEXTURE_2D,c.j),m.texImage2D(m.TEXTURE_2D,0,m.RGBA,256,1,0,m.RGBA,m.UNSIGNED_BYTE,new Uint8Array(p))}})(i,t,s,n),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.drawArrays(o.TRIANGLE_FAN,0,4);let a=i.g;a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,null)}))}function qf(e,t,r,n){let i=Eo(e),o=(function(c){return c.h||(c.h=new Kb),c.h})(e),s=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r,a=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;Ro(o,i,!0,(()=>{var c=o.g;c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,t),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,o.j),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,s),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,o.B),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),i.bindTexture(i.TEXTURE_2D,null),(c=o.g).activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,null)}))}var Et=class{constructor(e,t){e instanceof CanvasRenderingContext2D||e instanceof OffscreenCanvasRenderingContext2D?(this.l=e,this.j=t):this.j=e}ya(e,t){if(e){var r=fo(this);t=kl(t),r.save();var n=r.canvas,i=0;for(let o of e)r.fillStyle=jr(t.fillColor,{index:i,from:o}),r.strokeStyle=jr(t.color,{index:i,from:o}),r.lineWidth=jr(t.lineWidth,{index:i,from:o}),(e=new Path2D).arc(o.x*n.width,o.y*n.height,jr(t.radius,{index:i,from:o}),0,2*Math.PI),r.fill(e),r.stroke(e),++i;r.restore()}}xa(e,t,r){if(e&&t){var n=fo(this);r=kl(r),n.save();var i=n.canvas,o=0;for(let s of t){n.beginPath(),t=e[s.start];let a=e[s.end];t&&a&&(n.strokeStyle=jr(r.color,{index:o,from:t,to:a}),n.lineWidth=jr(r.lineWidth,{index:o,from:t,to:a}),n.moveTo(t.x*i.width,t.y*i.height),n.lineTo(a.x*i.width,a.y*i.height)),++o,n.stroke()}n.restore()}}ua(e,t){let r=fo(this);t=kl(t),r.save(),r.beginPath(),r.lineWidth=jr(t.lineWidth,{}),r.strokeStyle=jr(t.color,{}),r.fillStyle=jr(t.fillColor,{}),r.moveTo(e.originX,e.originY),r.lineTo(e.originX+e.width,e.originY),r.lineTo(e.originX+e.width,e.originY+e.height),r.lineTo(e.originX,e.originY+e.height),r.lineTo(e.originX,e.originY),r.stroke(),r.fill(),r.restore()}va(e,t,r=[0,0,0,255]){this.l?(function(n,i,o,s){let a=Eo(n);$f(n,i,(c=>{Gf(n,c,o,s),(c=fo(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)}))})(this,e,r,t):Gf(this,e.M(),r,t)}wa(e,t,r){this.l?(function(n,i,o,s){let a=Eo(n);$f(n,i,(c=>{qf(n,c,o,s),(c=fo(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)}))})(this,e,t,r):qf(this,e.M(),t,r)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function Pr(e,t){switch(t){case 0:return e.g.find((r=>r instanceof ImageData));case 1:return e.g.find((r=>typeof ImageBitmap<"u"&&r instanceof ImageBitmap));case 2:return e.g.find((r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture));default:throw Error(`Type is not supported: ${t}`)}}function Jm(e){var t=Pr(e,0);if(!t){t=ki(e);let r=ma(e),n=new Uint8Array(e.width*e.height*4);pa(r,t,Ds(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,n),zh(r),t=new ImageData(new Uint8ClampedArray(n.buffer),e.width,e.height),e.g.push(t)}return t}function Ds(e){let t=Pr(e,2);if(!t){let r=ki(e);t=Os(e);let n=Pr(e,1)||Jm(e);r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),mo(e)}return t}function ki(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=yt(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function ma(e){return e.l||(e.l=new Oi),e.l}function Os(e){let t=ki(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=Pr(e,2);return r||(r=hn(ma(e),t),e.g.push(r),e.m=!0),t.bindTexture(t.TEXTURE_2D,r),r}function mo(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function Kf(e){let t=ki(e);return Ro(ma(e),t,!0,(()=>(function(r,n){let i=r.canvas;if(i.width===r.width&&i.height===r.height)return n();let o=i.width,s=i.height;return i.width=r.width,i.height=r.height,r=n(),i.width=o,i.height=s,r})(e,(()=>{if(t.bindFramebuffer(t.FRAMEBUFFER,null),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),!(e.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return e.canvas.transferToImageBitmap()}))))}Et.prototype.close=Et.prototype.close,Et.prototype.drawConfidenceMask=Et.prototype.wa,Et.prototype.drawCategoryMask=Et.prototype.va,Et.prototype.drawBoundingBox=Et.prototype.ua,Et.prototype.drawConnectors=Et.prototype.xa,Et.prototype.drawLandmarks=Et.prototype.ya,Et.lerp=function(e,t,r,n,i){return Wf(n*(1-(e-t)/(r-t))+i*(1-(r-e)/(r-t)),n,i)},Et.clamp=Wf;var ht=class{constructor(e,t,r,n,i,o,s){this.g=e,this.j=t,this.m=r,this.canvas=n,this.l=i,this.width=o,this.height=s,(this.j||this.m)&&--Xf===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ea(){return!!Pr(this,0)}ka(){return!!Pr(this,1)}P(){return!!Pr(this,2)}Ca(){return Jm(this)}Ba(){var e=Pr(this,1);return e||(Ds(this),Os(this),e=Kf(this),mo(this),this.g.push(e),this.j=!0),e}M(){return Ds(this)}clone(){let e=[];for(let t of this.g){let r;if(t instanceof ImageData)r=new ImageData(t.data,this.width,this.height);else if(t instanceof WebGLTexture){let n=ki(this),i=ma(this);n.activeTexture(n.TEXTURE1),r=hn(i,n),n.bindTexture(n.TEXTURE_2D,r),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,this.width,this.height,0,n.RGBA,n.UNSIGNED_BYTE,null),n.bindTexture(n.TEXTURE_2D,null),pa(i,n,r),Ro(i,n,!1,(()=>{Os(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),mo(this)})),zh(i),mo(this)}else{if(!(t instanceof ImageBitmap))throw Error(`Type is not supported: ${t}`);Ds(this),Os(this),r=Kf(this),mo(this)}e.push(r)}return new ht(e,this.ka(),this.P(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Pr(this,1).close(),this.m&&ki(this).deleteTexture(Pr(this,2)),Xf=-1}};ht.prototype.close=ht.prototype.close,ht.prototype.clone=ht.prototype.clone,ht.prototype.getAsWebGLTexture=ht.prototype.M,ht.prototype.getAsImageBitmap=ht.prototype.Ba,ht.prototype.getAsImageData=ht.prototype.Ca,ht.prototype.hasWebGLTexture=ht.prototype.P,ht.prototype.hasImageBitmap=ht.prototype.ka,ht.prototype.hasImageData=ht.prototype.Ea;var Xf=250;function gr(...e){return e.map((([t,r])=>({start:t,end:r})))}var Jb=(function(e){return class extends e{La(){this.i._registerModelResourcesGraphService()}}})((Jf=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:$m()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(e){let t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){let r=e.length,n=this.i._malloc(r);this.i.HEAPU8.set(e,n),t?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(e,t,r,n,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Q(this,n||"input_audio",(o=>{Q(this,i=i||"audio_header",(s=>{this.i._configureAudio(o,s,e,t??0,r)}))}))}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}da(e){Tr(this,"__graph_config__",(t=>{e(t)})),Q(this,"__graph_config__",(t=>{this.i._getGraphConfig(t,void 0)})),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,n,i){let o=4*e.length;this.h!==o&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(o),this.h=o),this.i.HEAPF32.set(e,this.g/4),Q(this,n,(s=>{this.i._addAudioToInputStream(this.g,t,r,s,i)}))}addGpuBufferToStream(e,t,r){Q(this,t,(n=>{let[i,o]=Uf(this,e,n);this.i._addBoundTextureToStream(n,i,o,r)}))}addBoolToStream(e,t,r){Q(this,t,(n=>{this.i._addBoolToInputStream(e,n,r)}))}addDoubleToStream(e,t,r){Q(this,t,(n=>{this.i._addDoubleToInputStream(e,n,r)}))}addFloatToStream(e,t,r){Q(this,t,(n=>{this.i._addFloatToInputStream(e,n,r)}))}addIntToStream(e,t,r){Q(this,t,(n=>{this.i._addIntToInputStream(e,n,r)}))}addUintToStream(e,t,r){Q(this,t,(n=>{this.i._addUintToInputStream(e,n,r)}))}addStringToStream(e,t,r){Q(this,t,(n=>{Q(this,e,(i=>{this.i._addStringToInputStream(i,n,r)}))}))}addStringRecordToStream(e,t,r){Q(this,t,(n=>{Nf(this,Object.keys(e),(i=>{Nf(this,Object.values(e),(o=>{this.i._addFlatHashMapToInputStream(i,o,Object.keys(e).length,n,r)}))}))}))}addProtoToStream(e,t,r,n){Q(this,r,(i=>{Q(this,t,(o=>{let s=this.i._malloc(e.length);this.i.HEAPU8.set(e,s),this.i._addProtoToInputStream(s,e.length,o,i,n),this.i._free(s)}))}))}addEmptyPacketToStream(e,t){Q(this,e,(r=>{this.i._addEmptyPacketToInputStream(r,t)}))}addBoolVectorToStream(e,t,r){Q(this,t,(n=>{let i=this.i._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(let o of e)this.i._addBoolVectorEntry(i,o);this.i._addBoolVectorToInputStream(i,n,r)}))}addDoubleVectorToStream(e,t,r){Q(this,t,(n=>{let i=this.i._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(let o of e)this.i._addDoubleVectorEntry(i,o);this.i._addDoubleVectorToInputStream(i,n,r)}))}addFloatVectorToStream(e,t,r){Q(this,t,(n=>{let i=this.i._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(let o of e)this.i._addFloatVectorEntry(i,o);this.i._addFloatVectorToInputStream(i,n,r)}))}addIntVectorToStream(e,t,r){Q(this,t,(n=>{let i=this.i._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(let o of e)this.i._addIntVectorEntry(i,o);this.i._addIntVectorToInputStream(i,n,r)}))}addUintVectorToStream(e,t,r){Q(this,t,(n=>{let i=this.i._allocateUintVector(e.length);if(!i)throw Error("Unable to allocate new unsigned int vector on heap.");for(let o of e)this.i._addUintVectorEntry(i,o);this.i._addUintVectorToInputStream(i,n,r)}))}addStringVectorToStream(e,t,r){Q(this,t,(n=>{let i=this.i._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(let o of e)Q(this,o,(s=>{this.i._addStringVectorEntry(i,s)}));this.i._addStringVectorToInputStream(i,n,r)}))}addBoolToInputSidePacket(e,t){Q(this,t,(r=>{this.i._addBoolToInputSidePacket(e,r)}))}addDoubleToInputSidePacket(e,t){Q(this,t,(r=>{this.i._addDoubleToInputSidePacket(e,r)}))}addFloatToInputSidePacket(e,t){Q(this,t,(r=>{this.i._addFloatToInputSidePacket(e,r)}))}addIntToInputSidePacket(e,t){Q(this,t,(r=>{this.i._addIntToInputSidePacket(e,r)}))}addUintToInputSidePacket(e,t){Q(this,t,(r=>{this.i._addUintToInputSidePacket(e,r)}))}addStringToInputSidePacket(e,t){Q(this,t,(r=>{Q(this,e,(n=>{this.i._addStringToInputSidePacket(n,r)}))}))}addProtoToInputSidePacket(e,t,r){Q(this,r,(n=>{Q(this,t,(i=>{let o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputSidePacket(o,e.length,i,n),this.i._free(o)}))}))}addBoolVectorToInputSidePacket(e,t){Q(this,t,(r=>{let n=this.i._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let i of e)this.i._addBoolVectorEntry(n,i);this.i._addBoolVectorToInputSidePacket(n,r)}))}addDoubleVectorToInputSidePacket(e,t){Q(this,t,(r=>{let n=this.i._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let i of e)this.i._addDoubleVectorEntry(n,i);this.i._addDoubleVectorToInputSidePacket(n,r)}))}addFloatVectorToInputSidePacket(e,t){Q(this,t,(r=>{let n=this.i._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let i of e)this.i._addFloatVectorEntry(n,i);this.i._addFloatVectorToInputSidePacket(n,r)}))}addIntVectorToInputSidePacket(e,t){Q(this,t,(r=>{let n=this.i._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let i of e)this.i._addIntVectorEntry(n,i);this.i._addIntVectorToInputSidePacket(n,r)}))}addUintVectorToInputSidePacket(e,t){Q(this,t,(r=>{let n=this.i._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let i of e)this.i._addUintVectorEntry(n,i);this.i._addUintVectorToInputSidePacket(n,r)}))}addStringVectorToInputSidePacket(e,t){Q(this,t,(r=>{let n=this.i._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let i of e)Q(this,i,(o=>{this.i._addStringVectorEntry(n,o)}));this.i._addStringVectorToInputSidePacket(n,r)}))}attachBoolListener(e,t){Tr(this,e,t),Q(this,e,(r=>{this.i._attachBoolListener(r)}))}attachBoolVectorListener(e,t){tn(this,e,t),Q(this,e,(r=>{this.i._attachBoolVectorListener(r)}))}attachIntListener(e,t){Tr(this,e,t),Q(this,e,(r=>{this.i._attachIntListener(r)}))}attachIntVectorListener(e,t){tn(this,e,t),Q(this,e,(r=>{this.i._attachIntVectorListener(r)}))}attachUintListener(e,t){Tr(this,e,t),Q(this,e,(r=>{this.i._attachUintListener(r)}))}attachUintVectorListener(e,t){tn(this,e,t),Q(this,e,(r=>{this.i._attachUintVectorListener(r)}))}attachDoubleListener(e,t){Tr(this,e,t),Q(this,e,(r=>{this.i._attachDoubleListener(r)}))}attachDoubleVectorListener(e,t){tn(this,e,t),Q(this,e,(r=>{this.i._attachDoubleVectorListener(r)}))}attachFloatListener(e,t){Tr(this,e,t),Q(this,e,(r=>{this.i._attachFloatListener(r)}))}attachFloatVectorListener(e,t){tn(this,e,t),Q(this,e,(r=>{this.i._attachFloatVectorListener(r)}))}attachStringListener(e,t){Tr(this,e,t),Q(this,e,(r=>{this.i._attachStringListener(r)}))}attachStringVectorListener(e,t){tn(this,e,t),Q(this,e,(r=>{this.i._attachStringVectorListener(r)}))}attachProtoListener(e,t,r){Tr(this,e,t),Q(this,e,(n=>{this.i._attachProtoListener(n,r||!1)}))}attachProtoVectorListener(e,t,r){tn(this,e,t),Q(this,e,(n=>{this.i._attachProtoVectorListener(n,r||!1)}))}attachAudioListener(e,t,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Tr(this,e,((n,i)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),t(n,i)})),Q(this,e,(n=>{this.i._attachAudioListener(n,r||!1)}))}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends Jf{get ea(){return this.i}qa(e,t,r){Q(this,t,(n=>{let[i,o]=Uf(this,e,n);this.ea._addBoundTextureAsImageToStream(n,i,o,r)}))}U(e,t){Tr(this,e,t),Q(this,e,(r=>{this.ea._attachImageListener(r)}))}ca(e,t){tn(this,e,t),Q(this,e,(r=>{this.ea._attachImageVectorListener(r)}))}})),Jf,tr=class extends Jb{};async function fe(e,t,r){return(async function(n,i,o,s){return Gb(n,i,o,s)})(e,r.canvas??($m()?void 0:document.createElement("canvas")),t,r)}function Ym(e,t,r,n){if(e.T){let o=new _m;if(r?.regionOfInterest){if(!e.pa)throw Error("This task doesn't support region-of-interest.");var i=r.regionOfInterest;if(i.left>=i.right||i.top>=i.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(i.left<0||i.top<0||i.right>1||i.bottom>1)throw Error("Expected RectF values to be in [0,1].");Y(o,1,(i.left+i.right)/2),Y(o,2,(i.top+i.bottom)/2),Y(o,4,i.right-i.left),Y(o,3,i.bottom-i.top)}else Y(o,1,.5),Y(o,2,.5),Y(o,4,1),Y(o,3,1);if(r?.rotationDegrees){if(r?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90\xB0.");if(Y(o,5,-Math.PI*r.rotationDegrees/180),r?.rotationDegrees%180!=0){let[s,a]=Gm(t);r=Je(o,3)*a/s,i=Je(o,4)*s/a,Y(o,4,r),Y(o,3,i)}}e.g.addProtoToStream(o.g(),"mediapipe.NormalizedRect",e.T,n)}e.g.qa(t,e.aa,n??performance.now()),e.finishProcessing()}function rr(e,t,r){if(e.baseOptions?.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");Ym(e,t,r,e.B+1)}function Or(e,t,r,n){if(!e.baseOptions?.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");Ym(e,t,r,n)}function Ei(e,t,r,n){var i=t.data;let o=t.width,s=o*(t=t.height);if((i instanceof Uint8Array||i instanceof Float32Array)&&i.length!==s)throw Error("Unsupported channel count: "+i.length/s);return e=new ot([i],r,!1,e.g.i.canvas,e.O,o,t),n?e.clone():e}var It=class extends Ps{constructor(e,t,r,n){super(e),this.g=e,this.aa=t,this.T=r,this.pa=n,this.O=new Oi}l(e,t=!0){if("runningMode"in e&&So(this.baseOptions,2,!!e.runningMode&&e.runningMode!=="IMAGE"),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.O.close(),super.close()}};It.prototype.close=It.prototype.close;var xt=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},ne(e=this.h=new ha,0,1,t=new Me),Y(this.h,2,.5),Y(this.h,3,.3)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&Y(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&Y(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}D(e,t){return this.j={detections:[]},rr(this,e,t),this.j}F(e,t,r){return this.j={detections:[]},Or(this,e,r,t),this.j}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect_in"),be(e,"detections");let t=new Nt;fr(t,Db,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect_in"),pe(r,"DETECTIONS:detections"),r.o(t),Vt(e,r),this.g.attachProtoVectorListener("detections",((n,i)=>{for(let o of n)n=ym(o),this.j.detections.push(Hm(n));X(this,i)})),this.g.attachEmptyPacketListener("detections",(n=>{X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};xt.prototype.detectForVideo=xt.prototype.F,xt.prototype.detect=xt.prototype.D,xt.prototype.setOptions=xt.prototype.o,xt.createFromModelPath=async function(e,t){return fe(xt,e,{baseOptions:{modelAssetPath:t}})},xt.createFromModelBuffer=function(e,t){return fe(xt,e,{baseOptions:{modelAssetBuffer:t}})},xt.createFromOptions=function(e,t){return fe(xt,e,t)};var Vh=gr([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),Hh=gr([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),Wh=gr([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),Zm=gr([474,475],[475,476],[476,477],[477,474]),$h=gr([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),Gh=gr([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),Qm=gr([469,470],[470,471],[471,472],[472,469]),qh=gr([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),eg=[...Vh,...Hh,...Wh,...$h,...Gh,...qh],tg=gr([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function Yf(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var He=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,ne(e=this.h=new Cm,0,1,t=new Me),this.v=new Em,ne(this.h,0,3,this.v),this.s=new ha,ne(this.h,0,2,this.s),Dr(this.s,4,1),Y(this.s,2,.5),Y(this.v,2,.5),Y(this.h,4,.5)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return"numFaces"in e&&Dr(this.s,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&Y(this.s,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&Y(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&Y(this.v,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}D(e,t){return Yf(this),rr(this,e,t),this.j}F(e,t,r){return Yf(this),Or(this,e,r,t),this.j}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect"),be(e,"face_landmarks");let t=new Nt;fr(t,Bb,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"NORM_LANDMARKS:face_landmarks"),r.o(t),Vt(e,r),this.g.attachProtoVectorListener("face_landmarks",((n,i)=>{for(let o of n)n=Io(o),this.j.faceLandmarks.push(da(n));X(this,i)})),this.g.attachEmptyPacketListener("face_landmarks",(n=>{X(this,n)})),this.outputFaceBlendshapes&&(be(e,"blendshapes"),pe(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",((n,i)=>{if(this.outputFaceBlendshapes)for(let o of n)n=la(o),this.j.faceBlendshapes.push(Uh(n.g()??[]));X(this,i)})),this.g.attachEmptyPacketListener("blendshapes",(n=>{X(this,n)}))),this.outputFacialTransformationMatrixes&&(be(e,"face_geometry"),pe(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",((n,i)=>{if(this.outputFacialTransformationMatrixes)for(let o of n)(n=ye(Ob(o),Eb,2))&&this.j.facialTransformationMatrixes.push({rows:Yt(n,1)??0??0,columns:Yt(n,2)??0??0,data:Mn(n,3,un,Fn()).slice()??[]});X(this,i)})),this.g.attachEmptyPacketListener("face_geometry",(n=>{X(this,n)}))),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};He.prototype.detectForVideo=He.prototype.F,He.prototype.detect=He.prototype.D,He.prototype.setOptions=He.prototype.o,He.createFromModelPath=function(e,t){return fe(He,e,{baseOptions:{modelAssetPath:t}})},He.createFromModelBuffer=function(e,t){return fe(He,e,{baseOptions:{modelAssetBuffer:t}})},He.createFromOptions=function(e,t){return fe(He,e,t)},He.FACE_LANDMARKS_LIPS=Vh,He.FACE_LANDMARKS_LEFT_EYE=Hh,He.FACE_LANDMARKS_LEFT_EYEBROW=Wh,He.FACE_LANDMARKS_LEFT_IRIS=Zm,He.FACE_LANDMARKS_RIGHT_EYE=$h,He.FACE_LANDMARKS_RIGHT_EYEBROW=Gh,He.FACE_LANDMARKS_RIGHT_IRIS=Qm,He.FACE_LANDMARKS_FACE_OVAL=qh,He.FACE_LANDMARKS_CONTOURS=eg,He.FACE_LANDMARKS_TESSELATION=tg;var Ir=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect",!0),ne(e=this.j=new Am,0,1,t=new Me)}get baseOptions(){return ye(this.j,Me,1)}set baseOptions(e){ne(this.j,0,1,e)}o(e){return super.l(e)}Oa(e,t,r){let n=typeof t!="function"?t:{};if(this.h=typeof t=="function"?t:r,rr(this,e,n??{}),!this.h)return this.s}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect"),be(e,"stylized_image");let t=new Nt;fr(t,Lb,this.j);let r=new bt;jt(r,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"STYLIZED_IMAGE:stylized_image"),r.o(t),Vt(e,r),this.g.U("stylized_image",((n,i)=>{var o=!this.h,s=n.data,a=n.width;let c=a*(n=n.height);if(s instanceof Uint8Array)if(s.length===3*c){let l=new Uint8ClampedArray(4*c);for(let h=0;h<c;++h)l[4*h]=s[3*h],l[4*h+1]=s[3*h+1],l[4*h+2]=s[3*h+2],l[4*h+3]=255;s=new ImageData(l,a,n)}else{if(s.length!==4*c)throw Error("Unsupported channel count: "+s.length/c);s=new ImageData(new Uint8ClampedArray(s.buffer,s.byteOffset,s.length),a,n)}else if(!(s instanceof WebGLTexture))throw Error(`Unsupported format: ${s.constructor.name}`);a=new ht([s],!1,!1,this.g.i.canvas,this.O,a,n),this.s=o=o?a.clone():a,this.h&&this.h(o),X(this,i)})),this.g.attachEmptyPacketListener("stylized_image",(n=>{this.s=null,this.h&&this.h(null),X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ir.prototype.stylize=Ir.prototype.Oa,Ir.prototype.setOptions=Ir.prototype.o,Ir.createFromModelPath=function(e,t){return fe(Ir,e,{baseOptions:{modelAssetPath:t}})},Ir.createFromModelBuffer=function(e,t){return fe(Ir,e,{baseOptions:{modelAssetBuffer:t}})},Ir.createFromOptions=function(e,t){return fe(Ir,e,t)};var Kh=gr([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function Zf(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function Qf(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function ep(e,t=!0){let r=[];for(let i of e){var n=la(i);e=[];for(let o of n.g())n=t&&Yt(o,1)!=null?Yt(o,1)??0:-1,e.push({score:Je(o,2)??0,index:n,categoryName:Qt(o,3)??""??"",displayName:Qt(o,4)??""??""});r.push(e)}return r}var Lt=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],ne(e=this.j=new Rm,0,1,t=new Me),this.s=new Bh,ne(this.j,0,2,this.s),this.C=new Oh,ne(this.s,0,3,this.C),this.v=new Im,ne(this.s,0,2,this.v),this.h=new Fb,ne(this.j,0,3,this.h),Y(this.v,2,.5),Y(this.s,4,.5),Y(this.C,2,.5)}get baseOptions(){return ye(this.j,Me,1)}set baseOptions(e){ne(this.j,0,1,e)}o(e){if(Dr(this.v,3,e.numHands??1),"minHandDetectionConfidence"in e&&Y(this.v,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&Y(this.s,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&Y(this.C,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new ai,r=t,n=Ml(e.cannedGesturesClassifierOptions,ye(this.h,ai,3)?.h());ne(r,0,2,n),ne(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&ye(this.h,ai,3)?.g();return e.customGesturesClassifierOptions?(ne(r=t=new ai,0,2,n=Ml(e.customGesturesClassifierOptions,ye(this.h,ai,4)?.h())),ne(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&ye(this.h,ai,4)?.g(),this.l(e)}Ja(e,t){return Zf(this),rr(this,e,t),Qf(this)}Ka(e,t,r){return Zf(this),Or(this,e,r,t),Qf(this)}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect"),be(e,"hand_gestures"),be(e,"hand_landmarks"),be(e,"world_hand_landmarks"),be(e,"handedness");let t=new Nt;fr(t,Mb,this.j);let r=new bt;jt(r,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"HAND_GESTURES:hand_gestures"),pe(r,"LANDMARKS:hand_landmarks"),pe(r,"WORLD_LANDMARKS:world_hand_landmarks"),pe(r,"HANDEDNESS:handedness"),r.o(t),Vt(e,r),this.g.attachProtoVectorListener("hand_landmarks",((n,i)=>{for(let o of n){n=Io(o);let s=[];for(let a of qr(n,vm,1))s.push({x:Je(a,1)??0,y:Je(a,2)??0,z:Je(a,3)??0,visibility:Je(a,4)??0});this.landmarks.push(s)}X(this,i)})),this.g.attachEmptyPacketListener("hand_landmarks",(n=>{X(this,n)})),this.g.attachProtoVectorListener("world_hand_landmarks",((n,i)=>{for(let o of n){n=pi(o);let s=[];for(let a of qr(n,bm,1))s.push({x:Je(a,1)??0,y:Je(a,2)??0,z:Je(a,3)??0,visibility:Je(a,4)??0});this.worldLandmarks.push(s)}X(this,i)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(n=>{X(this,n)})),this.g.attachProtoVectorListener("hand_gestures",((n,i)=>{this.gestures.push(...ep(n,!1)),X(this,i)})),this.g.attachEmptyPacketListener("hand_gestures",(n=>{X(this,n)})),this.g.attachProtoVectorListener("handedness",((n,i)=>{this.handedness.push(...ep(n)),X(this,i)})),this.g.attachEmptyPacketListener("handedness",(n=>{X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function tp(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Lt.prototype.recognizeForVideo=Lt.prototype.Ka,Lt.prototype.recognize=Lt.prototype.Ja,Lt.prototype.setOptions=Lt.prototype.o,Lt.createFromModelPath=function(e,t){return fe(Lt,e,{baseOptions:{modelAssetPath:t}})},Lt.createFromModelBuffer=function(e,t){return fe(Lt,e,{baseOptions:{modelAssetBuffer:t}})},Lt.createFromOptions=function(e,t){return fe(Lt,e,t)},Lt.HAND_CONNECTIONS=Kh;var Ft=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],ne(e=this.h=new Bh,0,1,t=new Me),this.s=new Oh,ne(this.h,0,3,this.s),this.j=new Im,ne(this.h,0,2,this.j),Dr(this.j,3,1),Y(this.j,2,.5),Y(this.s,2,.5),Y(this.h,4,.5)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return"numHands"in e&&Dr(this.j,3,e.numHands??1),"minHandDetectionConfidence"in e&&Y(this.j,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&Y(this.h,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&Y(this.s,2,e.minHandPresenceConfidence??.5),this.l(e)}D(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],rr(this,e,t),tp(this)}F(e,t,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Or(this,e,r,t),tp(this)}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect"),be(e,"hand_landmarks"),be(e,"world_hand_landmarks"),be(e,"handedness");let t=new Nt;fr(t,Ub,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"LANDMARKS:hand_landmarks"),pe(r,"WORLD_LANDMARKS:world_hand_landmarks"),pe(r,"HANDEDNESS:handedness"),r.o(t),Vt(e,r),this.g.attachProtoVectorListener("hand_landmarks",((n,i)=>{for(let o of n)n=Io(o),this.landmarks.push(da(n));X(this,i)})),this.g.attachEmptyPacketListener("hand_landmarks",(n=>{X(this,n)})),this.g.attachProtoVectorListener("world_hand_landmarks",((n,i)=>{for(let o of n)n=pi(o),this.worldLandmarks.push(vo(n));X(this,i)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(n=>{X(this,n)})),this.g.attachProtoVectorListener("handedness",((n,i)=>{var o=this.handedness,s=o.push;let a=[];for(let c of n){n=la(c);let l=[];for(let h of n.g())l.push({score:Je(h,2)??0,index:Yt(h,1)??0??-1,categoryName:Qt(h,3)??""??"",displayName:Qt(h,4)??""??""});a.push(l)}s.call(o,...a),X(this,i)})),this.g.attachEmptyPacketListener("handedness",(n=>{X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ft.prototype.detectForVideo=Ft.prototype.F,Ft.prototype.detect=Ft.prototype.D,Ft.prototype.setOptions=Ft.prototype.o,Ft.createFromModelPath=function(e,t){return fe(Ft,e,{baseOptions:{modelAssetPath:t}})},Ft.createFromModelBuffer=function(e,t){return fe(Ft,e,{baseOptions:{modelAssetBuffer:t}})},Ft.createFromOptions=function(e,t){return fe(Ft,e,t)},Ft.HAND_CONNECTIONS=Kh;var rg=gr([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function rp(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function np(e){try{if(!e.C)return e.h;e.C(e.h)}finally{fa(e)}}function As(e,t){e=Io(e),t.push(da(e))}var Le=class extends It{constructor(e,t){super(new tr(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,ne(e=this.j=new Lm,0,1,t=new Me),this.J=new Oh,ne(this.j,0,2,this.J),this.Z=new Nb,ne(this.j,0,3,this.Z),this.s=new ha,ne(this.j,0,4,this.s),this.H=new Em,ne(this.j,0,5,this.H),this.v=new Om,ne(this.j,0,6,this.v),this.K=new Bm,ne(this.j,0,7,this.K),Y(this.s,2,.5),Y(this.s,3,.3),Y(this.H,2,.5),Y(this.v,2,.5),Y(this.v,3,.3),Y(this.K,2,.5),Y(this.J,2,.5)}get baseOptions(){return ye(this.j,Me,1)}set baseOptions(e){ne(this.j,0,1,e)}o(e){return"minFaceDetectionConfidence"in e&&Y(this.s,2,e.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in e&&Y(this.s,3,e.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in e&&Y(this.H,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&Y(this.v,2,e.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in e&&Y(this.v,3,e.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in e&&Y(this.K,2,e.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&Y(this.J,2,e.minHandLandmarksConfidence??.5),this.l(e)}D(e,t,r){let n=typeof t!="function"?t:{};return this.C=typeof t=="function"?t:r,rp(this),rr(this,e,n),np(this)}F(e,t,r,n){let i=typeof r!="function"?r:{};return this.C=typeof r=="function"?r:n,rp(this),Or(this,e,i,t),np(this)}m(){var e=new Rt;Be(e,"input_frames_image"),be(e,"pose_landmarks"),be(e,"pose_world_landmarks"),be(e,"face_landmarks"),be(e,"left_hand_landmarks"),be(e,"left_hand_world_landmarks"),be(e,"right_hand_landmarks"),be(e,"right_hand_world_landmarks");let t=new Nt,r=new Sf;Rl(r,1,Ai("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),(function(i,o){if(o!=null)if(Array.isArray(o))Re(i,2,Ip(o));else{if(!(typeof o=="string"||o instanceof $r||Co(o)))throw Error("invalid value in Any.value field: "+o+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Rl(i,2,Yl(o,!1),zn())}})(r,this.j.g());let n=new bt;jt(n,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Ns(n,8,Sf,r),Pe(n,"IMAGE:input_frames_image"),pe(n,"POSE_LANDMARKS:pose_landmarks"),pe(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),pe(n,"FACE_LANDMARKS:face_landmarks"),pe(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),pe(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),pe(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),pe(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.o(t),Vt(e,n),ua(this,e),this.g.attachProtoListener("pose_landmarks",((i,o)=>{As(i,this.h.poseLandmarks),X(this,o)})),this.g.attachEmptyPacketListener("pose_landmarks",(i=>{X(this,i)})),this.g.attachProtoListener("pose_world_landmarks",((i,o)=>{var s=this.h.poseWorldLandmarks;i=pi(i),s.push(vo(i)),X(this,o)})),this.g.attachEmptyPacketListener("pose_world_landmarks",(i=>{X(this,i)})),this.outputPoseSegmentationMasks&&(pe(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),wi(this,"pose_segmentation_mask"),this.g.U("pose_segmentation_mask",((i,o)=>{this.h.poseSegmentationMasks=[Ei(this,i,!0,!this.C)],X(this,o)})),this.g.attachEmptyPacketListener("pose_segmentation_mask",(i=>{this.h.poseSegmentationMasks=[],X(this,i)}))),this.g.attachProtoListener("face_landmarks",((i,o)=>{As(i,this.h.faceLandmarks),X(this,o)})),this.g.attachEmptyPacketListener("face_landmarks",(i=>{X(this,i)})),this.outputFaceBlendshapes&&(be(e,"extra_blendshapes"),pe(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",((i,o)=>{var s=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(i=la(i),s.push(Uh(i.g()??[]))),X(this,o)})),this.g.attachEmptyPacketListener("extra_blendshapes",(i=>{X(this,i)}))),this.g.attachProtoListener("left_hand_landmarks",((i,o)=>{As(i,this.h.leftHandLandmarks),X(this,o)})),this.g.attachEmptyPacketListener("left_hand_landmarks",(i=>{X(this,i)})),this.g.attachProtoListener("left_hand_world_landmarks",((i,o)=>{var s=this.h.leftHandWorldLandmarks;i=pi(i),s.push(vo(i)),X(this,o)})),this.g.attachEmptyPacketListener("left_hand_world_landmarks",(i=>{X(this,i)})),this.g.attachProtoListener("right_hand_landmarks",((i,o)=>{As(i,this.h.rightHandLandmarks),X(this,o)})),this.g.attachEmptyPacketListener("right_hand_landmarks",(i=>{X(this,i)})),this.g.attachProtoListener("right_hand_world_landmarks",((i,o)=>{var s=this.h.rightHandWorldLandmarks;i=pi(i),s.push(vo(i)),X(this,o)})),this.g.attachEmptyPacketListener("right_hand_world_landmarks",(i=>{X(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Le.prototype.detectForVideo=Le.prototype.F,Le.prototype.detect=Le.prototype.D,Le.prototype.setOptions=Le.prototype.o,Le.createFromModelPath=function(e,t){return fe(Le,e,{baseOptions:{modelAssetPath:t}})},Le.createFromModelBuffer=function(e,t){return fe(Le,e,{baseOptions:{modelAssetBuffer:t}})},Le.createFromOptions=function(e,t){return fe(Le,e,t)},Le.HAND_CONNECTIONS=Kh,Le.POSE_CONNECTIONS=rg,Le.FACE_LANDMARKS_LIPS=Vh,Le.FACE_LANDMARKS_LEFT_EYE=Hh,Le.FACE_LANDMARKS_LEFT_EYEBROW=Wh,Le.FACE_LANDMARKS_LEFT_IRIS=Zm,Le.FACE_LANDMARKS_RIGHT_EYE=$h,Le.FACE_LANDMARKS_RIGHT_EYEBROW=Gh,Le.FACE_LANDMARKS_RIGHT_IRIS=Qm,Le.FACE_LANDMARKS_FACE_OVAL=qh,Le.FACE_LANDMARKS_CONTOURS=eg,Le.FACE_LANDMARKS_TESSELATION=tg;var Xt=class extends It{constructor(e,t){super(new tr(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},ne(e=this.h=new Fm,0,1,t=new Me)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return ne(this.h,0,2,Ml(e,ye(this.h,Rh,2))),this.l(e)}sa(e,t){return this.j={classifications:[]},rr(this,e,t),this.j}ta(e,t,r){return this.j={classifications:[]},Or(this,e,r,t),this.j}m(){var e=new Rt;Be(e,"input_image"),Be(e,"norm_rect"),be(e,"classifications");let t=new Nt;fr(t,zb,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),Pe(r,"IMAGE:input_image"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"CLASSIFICATIONS:classifications"),r.o(t),Vt(e,r),this.g.attachProtoListener("classifications",((n,i)=>{this.j=(function(o){let s={classifications:qr(o,xb,1).map((a=>Uh(ye(a,mm,4)?.g()??[],Yt(a,2)??0,Qt(a,3)??"")))};return Us(vi(o,2))!=null&&(s.timestampMs=Us(vi(o,2))??0),s})(Ab(n)),X(this,i)})),this.g.attachEmptyPacketListener("classifications",(n=>{X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Xt.prototype.classifyForVideo=Xt.prototype.ta,Xt.prototype.classify=Xt.prototype.sa,Xt.prototype.setOptions=Xt.prototype.o,Xt.createFromModelPath=function(e,t){return fe(Xt,e,{baseOptions:{modelAssetPath:t}})},Xt.createFromModelBuffer=function(e,t){return fe(Xt,e,{baseOptions:{modelAssetBuffer:t}})},Xt.createFromOptions=function(e,t){return fe(Xt,e,t)};var Mt=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect",!0),this.h=new Mm,this.embeddings={embeddings:[]},ne(e=this.h,0,1,t=new Me)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){var t=this.h,r=ye(this.h,Pf,2);return r=r?r.clone():new Pf,e.l2Normalize!==void 0?So(r,1,e.l2Normalize):"l2Normalize"in e&&Re(r,1),e.quantize!==void 0?So(r,2,e.quantize):"quantize"in e&&Re(r,2),ne(t,0,2,r),this.l(e)}za(e,t){return rr(this,e,t),this.embeddings}Aa(e,t,r){return Or(this,e,r,t),this.embeddings}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect"),be(e,"embeddings_out");let t=new Nt;fr(t,jb,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"EMBEDDINGS:embeddings_out"),r.o(t),Vt(e,r),this.g.attachProtoListener("embeddings_out",((n,i)=>{n=Rb(n),this.embeddings=(function(o){return{embeddings:qr(o,Ib,1).map((s=>{let a={headIndex:Yt(s,3)??0??-1,headName:Qt(s,4)??""??""};if(Bp(s,Rf,yl(s,1))!==void 0)s=Mn(s=ye(s,Rf,yl(s,1)),1,un,Fn()),a.floatEmbedding=s.slice();else{let c=new Uint8Array(0);a.quantizedEmbedding=ye(s,Tb,yl(s,2))?.oa()?.h()??c}return a})),timestampMs:Us(vi(o,2))??0}})(n),X(this,i)})),this.g.attachEmptyPacketListener("embeddings_out",(n=>{X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Mt.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Ff(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Ff(Lf(e.quantizedEmbedding),Lf(t.quantizedEmbedding))}return e},Mt.prototype.embedForVideo=Mt.prototype.Aa,Mt.prototype.embed=Mt.prototype.za,Mt.prototype.setOptions=Mt.prototype.o,Mt.createFromModelPath=function(e,t){return fe(Mt,e,{baseOptions:{modelAssetPath:t}})},Mt.createFromModelBuffer=function(e,t){return fe(Mt,e,{baseOptions:{modelAssetBuffer:t}})},Mt.createFromOptions=function(e,t){return fe(Mt,e,t)};var jl=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){this.confidenceMasks?.forEach((e=>{e.close()})),this.categoryMask?.close()}};function ip(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function op(e){try{let t=new jl(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{fa(e)}}jl.prototype.close=jl.prototype.close;var Ct=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Mh,this.v=new Um,ne(this.h,0,3,this.v),ne(e=this.h,0,1,t=new Me)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?Re(this.h,2,Ai(e.displayNamesLocale)):"displayNamesLocale"in e&&Re(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}I(){(function(e){let t=qr(e.da(),bt,1).filter((r=>(Qt(r,1)??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")));if(e.s=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&(ye(t[0],Nt,7)?.l()?.g()??new Map).forEach(((r,n)=>{e.s[Number(n)]=Qt(r,1)??""}))})(this)}segment(e,t,r){let n=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:r,ip(this),rr(this,e,n),op(this)}Ma(e,t,r,n){let i=typeof r!="function"?r:{};return this.j=typeof r=="function"?r:n,ip(this),Or(this,e,i,t),op(this)}Da(){return this.s}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect");let t=new Nt;fr(t,zm,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect"),r.o(t),Vt(e,r),ua(this,e),this.outputConfidenceMasks&&(be(e,"confidence_masks"),pe(r,"CONFIDENCE_MASKS:confidence_masks"),wi(this,"confidence_masks"),this.g.ca("confidence_masks",((n,i)=>{this.confidenceMasks=n.map((o=>Ei(this,o,!0,!this.j))),X(this,i)})),this.g.attachEmptyPacketListener("confidence_masks",(n=>{this.confidenceMasks=[],X(this,n)}))),this.outputCategoryMask&&(be(e,"category_mask"),pe(r,"CATEGORY_MASK:category_mask"),wi(this,"category_mask"),this.g.U("category_mask",((n,i)=>{this.categoryMask=Ei(this,n,!1,!this.j),X(this,i)})),this.g.attachEmptyPacketListener("category_mask",(n=>{this.categoryMask=void 0,X(this,n)}))),be(e,"quality_scores"),pe(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((n,i)=>{this.qualityScores=n,X(this,i)})),this.g.attachEmptyPacketListener("quality_scores",(n=>{this.categoryMask=void 0,X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ct.prototype.getLabels=Ct.prototype.Da,Ct.prototype.segmentForVideo=Ct.prototype.Ma,Ct.prototype.segment=Ct.prototype.segment,Ct.prototype.setOptions=Ct.prototype.o,Ct.createFromModelPath=function(e,t){return fe(Ct,e,{baseOptions:{modelAssetPath:t}})},Ct.createFromModelBuffer=function(e,t){return fe(Ct,e,{baseOptions:{modelAssetBuffer:t}})},Ct.createFromOptions=function(e,t){return fe(Ct,e,t)};var Vl=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){this.confidenceMasks?.forEach((e=>{e.close()})),this.categoryMask?.close()}};Vl.prototype.close=Vl.prototype.close;var Yb=class extends J{constructor(e){super(e)}},ci=[0,$e,-2],Hs=[0,Vr,-3,Fe,Vr,-1],sp=[0,Hs],ap=[0,Hs,$e,-1],El=class extends J{constructor(e){super(e)}},cp=[0,Vr,-1,Fe],Zb=class extends J{constructor(e){super(e)}},lp=class extends J{constructor(e){super(e)}},Hl=[1,2,3,4,5,6,7,8,9,10,14,15],ng=class extends J{constructor(e){super(e)}};ng.prototype.g=ca([0,st,[0,Hl,Ee,Hs,Ee,[0,Hs,ci],Ee,sp,Ee,[0,sp,ci],Ee,cp,Ee,[0,Vr,-3,Fe,er],Ee,[0,Vr,-3,Fe],Ee,[0,we,Vr,-2,Fe,$e,Fe,-1,2,Vr,ci],Ee,ap,Ee,[0,ap,ci],Vr,ci,we,Ee,[0,Vr,-3,Fe,ci,-1],Ee,[0,st,cp]],we,[0,we,$e,-1,Fe]]);var Rr=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Mh,this.s=new Um,ne(this.h,0,3,this.s),ne(e=this.h,0,1,t=new Me)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}segment(e,t,r,n){let i=typeof r!="function"?r:{};this.j=typeof r=="function"?r:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.B+1,n=new ng;let o=new lp;var s=new Yb;if(Dr(s,1,255),ne(o,0,12,s),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var a=new El;So(a,3,!0),Y(a,1,t.keypoint.x),Y(a,2,t.keypoint.y),yo(o,5,Hl,a)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(s=new Zb,t.scribble))So(t=new El,3,!0),Y(t,1,a.x),Y(t,2,a.y),Ns(s,1,El,t);yo(o,15,Hl,s)}Ns(n,1,lp,o),this.g.addProtoToStream(n.g(),"drishti.RenderData","roi_in",r),rr(this,e,i);e:{try{let l=new Vl(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=l;break e}this.j(l)}finally{fa(this)}c=void 0}return c}m(){var e=new Rt;Be(e,"image_in"),Be(e,"roi_in"),Be(e,"norm_rect_in");let t=new Nt;fr(t,zm,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"ROI:roi_in"),Pe(r,"NORM_RECT:norm_rect_in"),r.o(t),Vt(e,r),ua(this,e),this.outputConfidenceMasks&&(be(e,"confidence_masks"),pe(r,"CONFIDENCE_MASKS:confidence_masks"),wi(this,"confidence_masks"),this.g.ca("confidence_masks",((n,i)=>{this.confidenceMasks=n.map((o=>Ei(this,o,!0,!this.j))),X(this,i)})),this.g.attachEmptyPacketListener("confidence_masks",(n=>{this.confidenceMasks=[],X(this,n)}))),this.outputCategoryMask&&(be(e,"category_mask"),pe(r,"CATEGORY_MASK:category_mask"),wi(this,"category_mask"),this.g.U("category_mask",((n,i)=>{this.categoryMask=Ei(this,n,!1,!this.j),X(this,i)})),this.g.attachEmptyPacketListener("category_mask",(n=>{this.categoryMask=void 0,X(this,n)}))),be(e,"quality_scores"),pe(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((n,i)=>{this.qualityScores=n,X(this,i)})),this.g.attachEmptyPacketListener("quality_scores",(n=>{this.categoryMask=void 0,X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Rr.prototype.segment=Rr.prototype.segment,Rr.prototype.setOptions=Rr.prototype.o,Rr.createFromModelPath=function(e,t){return fe(Rr,e,{baseOptions:{modelAssetPath:t}})},Rr.createFromModelBuffer=function(e,t){return fe(Rr,e,{baseOptions:{modelAssetBuffer:t}})},Rr.createFromOptions=function(e,t){return fe(Rr,e,t)};var At=class extends It{constructor(e,t){super(new tr(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},ne(e=this.h=new jm,0,1,t=new Me)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?Re(this.h,2,Ai(e.displayNamesLocale)):"displayNamesLocale"in e&&Re(this.h,2),e.maxResults!==void 0?Dr(this.h,3,e.maxResults):"maxResults"in e&&Re(this.h,3),e.scoreThreshold!==void 0?Y(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&Re(this.h,4),e.categoryAllowlist!==void 0?zs(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&Re(this.h,5),e.categoryDenylist!==void 0?zs(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&Re(this.h,6),this.l(e)}D(e,t){return this.j={detections:[]},rr(this,e,t),this.j}F(e,t,r){return this.j={detections:[]},Or(this,e,r,t),this.j}m(){var e=new Rt;Be(e,"input_frame_gpu"),Be(e,"norm_rect"),be(e,"detections");let t=new Nt;fr(t,Hb,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.ObjectDetectorGraph"),Pe(r,"IMAGE:input_frame_gpu"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"DETECTIONS:detections"),r.o(t),Vt(e,r),this.g.attachProtoVectorListener("detections",((n,i)=>{for(let o of n)n=ym(o),this.j.detections.push(Hm(n));X(this,i)})),this.g.attachEmptyPacketListener("detections",(n=>{X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};At.prototype.detectForVideo=At.prototype.F,At.prototype.detect=At.prototype.D,At.prototype.setOptions=At.prototype.o,At.createFromModelPath=async function(e,t){return fe(At,e,{baseOptions:{modelAssetPath:t}})},At.createFromModelBuffer=function(e,t){return fe(At,e,{baseOptions:{modelAssetBuffer:t}})},At.createFromOptions=function(e,t){return fe(At,e,t)};var Wl=class{constructor(e,t,r){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=r}close(){this.segmentationMasks?.forEach((e=>{e.close()}))}};function hp(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function dp(e){try{let t=new Wl(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.s)return t;e.s(t)}finally{fa(e)}}Wl.prototype.close=Wl.prototype.close;var Ut=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,ne(e=this.h=new Vm,0,1,t=new Me),this.v=new Bm,ne(this.h,0,3,this.v),this.j=new Om,ne(this.h,0,2,this.j),Dr(this.j,4,1),Y(this.j,2,.5),Y(this.v,2,.5),Y(this.h,4,.5)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return"numPoses"in e&&Dr(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&Y(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&Y(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&Y(this.v,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}D(e,t,r){let n=typeof t!="function"?t:{};return this.s=typeof t=="function"?t:r,hp(this),rr(this,e,n),dp(this)}F(e,t,r,n){let i=typeof r!="function"?r:{};return this.s=typeof r=="function"?r:n,hp(this),Or(this,e,i,t),dp(this)}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect"),be(e,"normalized_landmarks"),be(e,"world_landmarks"),be(e,"segmentation_masks");let t=new Nt;fr(t,Wb,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"NORM_LANDMARKS:normalized_landmarks"),pe(r,"WORLD_LANDMARKS:world_landmarks"),r.o(t),Vt(e,r),ua(this,e),this.g.attachProtoVectorListener("normalized_landmarks",((n,i)=>{this.landmarks=[];for(let o of n)n=Io(o),this.landmarks.push(da(n));X(this,i)})),this.g.attachEmptyPacketListener("normalized_landmarks",(n=>{this.landmarks=[],X(this,n)})),this.g.attachProtoVectorListener("world_landmarks",((n,i)=>{this.worldLandmarks=[];for(let o of n)n=pi(o),this.worldLandmarks.push(vo(n));X(this,i)})),this.g.attachEmptyPacketListener("world_landmarks",(n=>{this.worldLandmarks=[],X(this,n)})),this.outputSegmentationMasks&&(pe(r,"SEGMENTATION_MASK:segmentation_masks"),wi(this,"segmentation_masks"),this.g.ca("segmentation_masks",((n,i)=>{this.segmentationMasks=n.map((o=>Ei(this,o,!0,!this.s))),X(this,i)})),this.g.attachEmptyPacketListener("segmentation_masks",(n=>{this.segmentationMasks=[],X(this,n)}))),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ut.prototype.detectForVideo=Ut.prototype.F,Ut.prototype.detect=Ut.prototype.D,Ut.prototype.setOptions=Ut.prototype.o,Ut.createFromModelPath=function(e,t){return fe(Ut,e,{baseOptions:{modelAssetPath:t}})},Ut.createFromModelBuffer=function(e,t){return fe(Ut,e,{baseOptions:{modelAssetBuffer:t}})},Ut.createFromOptions=function(e,t){return fe(Ut,e,t)},Ut.POSE_CONNECTIONS=rg;var Bi=class{constructor(t,r,n,i,o="videoPreviewFrameDetection",s="liveViewFrameDetection"){this.options={onRealtimeAlertsCallback:t=>{}};this.children=[];this.runningMode="VIDEO";this.detecting=!1;this.createdVideo=!1;this.lastVideoTime=-1;this.lastExecutionDate=Date.now();this.detectorType=t,this.modelAssetPath=r,this.classVideo=o,this.classDiv=s,i&&(this.paramsConfig=i),n&&(this.options=n)}async initializeDetector(){let t=await rn.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.2/wasm");this.detector=await(this.detectorType==="FaceDetector"?xt:At).createFromOptions(t,{baseOptions:{modelAssetPath:this.modelAssetPath,delegate:"CPU"},scoreThreshold:this.detectorType==="ObjectDetector"?.5:0,runningMode:this.runningMode})}stopDetection(){this.animationFrameId&&clearTimeout(this.animationFrameId),this.detecting=!1,this.liveView=document.getElementById(this.classDiv),this.liveView&&this.classDiv==="liveViewFrameDetection"&&document.body.removeChild(this.liveView),this.createdVideo&&this.video&&document.body.removeChild(this.video),this.createdVideo=!1}enableCam(t){if(!this.detector){console.log("Wait! Detector not loaded yet.");return}this.detecting=!0,this.error=document.getElementById("errorFrameDetection"),this.video=document.getElementById(this.classVideo),this.liveView=document.getElementById(this.classDiv),this.video||(this.video=document.createElement("video"),this.video.setAttribute("id",this.classVideo),this.video.setAttribute("style",`
49
+ `}C(){let e=this.g;e.activeTexture(e.TEXTURE1),this.j=dn(this,e),e.activeTexture(e.TEXTURE2),this.B=dn(this,e)}m(){super.m();let e=this.g;this.J=yt(e.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.K=yt(e.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.H=yt(e.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();let e=this.g;e.uniform1i(this.H,0),e.uniform1i(this.J,1),e.uniform1i(this.K,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function Hr(e,t){switch(t){case 0:return e.g.find((r=>r instanceof Uint8Array));case 1:return e.g.find((r=>r instanceof Float32Array));case 2:return e.g.find((r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture));default:throw Error(`Type is not supported: ${t}`)}}function Nl(e){var t=Hr(e,1);if(!t){if(t=Hr(e,0))t=new Float32Array(t).map((n=>n/255));else{t=new Float32Array(e.width*e.height);let n=Si(e);var r=jh(e);if(pa(r,n,qm(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){r=new Float32Array(e.width*e.height*4),n.readPixels(0,0,e.width,e.height,n.RGBA,n.FLOAT,r);for(let i=0,o=0;i<t.length;++i,o+=4)t[i]=r[o]}else n.readPixels(0,0,e.width,e.height,n.RED,n.FLOAT,t)}e.g.push(t)}return t}function qm(e){let t=Hr(e,2);if(!t){let r=Si(e);t=Xm(e);let n=Nl(e),i=Km(e);r.texImage2D(r.TEXTURE_2D,0,i,e.width,e.height,0,r.RED,r.FLOAT,n),zl(e)}return t}function Si(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=yt(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Km(e){if(e=Si(e),!xs)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))xs=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");xs=e.R16F}return xs}function jh(e){return e.l||(e.l=new Oi),e.l}function Xm(e){let t=Si(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=Hr(e,2);return r||(r=dn(jh(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(r),e.j=!0),t.bindTexture(t.TEXTURE_2D,r),r}function zl(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var xs,ot=class{constructor(e,t,r,n,i,o,s){this.g=e,this.m=t,this.j=r,this.canvas=n,this.l=i,this.width=o,this.height=s,this.j&&--Hf===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Fa(){return!!Hr(this,0)}ja(){return!!Hr(this,1)}P(){return!!Hr(this,2)}ia(){return(t=Hr(e=this,0))||(t=Nl(e),t=new Uint8Array(t.map((r=>255*r))),e.g.push(t)),t;var e,t}ha(){return Nl(this)}M(){return qm(this)}clone(){let e=[];for(let t of this.g){let r;if(t instanceof Uint8Array)r=new Uint8Array(t);else if(t instanceof Float32Array)r=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{let n=Si(this),i=jh(this);n.activeTexture(n.TEXTURE1),r=dn(i,n,this.m?n.LINEAR:n.NEAREST),n.bindTexture(n.TEXTURE_2D,r);let o=Km(this);n.texImage2D(n.TEXTURE_2D,0,o,this.width,this.height,0,n.RED,n.FLOAT,null),n.bindTexture(n.TEXTURE_2D,null),pa(i,n,r),Ro(i,n,!1,(()=>{Xm(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),zl(this)})),zh(i),zl(this)}}e.push(r)}return new ot(e,this.m,this.P(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Si(this).deleteTexture(Hr(this,2)),Hf=-1}};ot.prototype.close=ot.prototype.close,ot.prototype.clone=ot.prototype.clone,ot.prototype.getAsWebGLTexture=ot.prototype.M,ot.prototype.getAsFloat32Array=ot.prototype.ha,ot.prototype.getAsUint8Array=ot.prototype.ia,ot.prototype.hasWebGLTexture=ot.prototype.P,ot.prototype.hasFloat32Array=ot.prototype.ja,ot.prototype.hasUint8Array=ot.prototype.Fa;var Hf=250,Xb={color:"white",lineWidth:4,radius:6};function kl(e){return{...Xb,fillColor:(e=e||{}).color,...e}}function jr(e,t){return e instanceof Function?e(t):e}function Wf(e,t,r){return Math.max(Math.min(t,r),Math.min(Math.max(t,r),e))}function fo(e){if(!e.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return e.l}function Eo(e){if(!e.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return e.j}function $f(e,t,r){if(t.P())r(t.M());else{let n=t.ja()?t.ha():t.ia();e.m=e.m??new Oi;let i=Eo(e);r((e=new ot([n],t.m,!1,i.canvas,e.m,t.width,t.height)).M()),e.close()}}function Gf(e,t,r,n){let i=(function(a){return a.g||(a.g=new qb),a.g})(e),o=Eo(e),s=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;Ro(i,o,!0,(()=>{(function(c,l,h,d){let m=c.g;if(m.activeTexture(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,l),m.activeTexture(m.TEXTURE1),m.bindTexture(m.TEXTURE_2D,c.B),m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,h),c.H&&(function(p,g){if(p!==g)return!1;p=p.entries(),g=g.entries();for(let[b,v]of p){p=b;let k=v;var f=g.next();if(f.done)return!1;let[S,I]=f.value;if(f=I,p!==S||k[0]!==f[0]||k[1]!==f[1]||k[2]!==f[2]||k[3]!==f[3])return!1}return!!g.next().done})(c.H,d))m.activeTexture(m.TEXTURE2),m.bindTexture(m.TEXTURE_2D,c.j);else{c.H=d;let p=Array(1024).fill(0);d.forEach(((g,f)=>{if(g.length!==4)throw Error(`Color at index ${f} is not a four-channel value.`);p[4*f]=g[0],p[4*f+1]=g[1],p[4*f+2]=g[2],p[4*f+3]=g[3]})),m.activeTexture(m.TEXTURE2),m.bindTexture(m.TEXTURE_2D,c.j),m.texImage2D(m.TEXTURE_2D,0,m.RGBA,256,1,0,m.RGBA,m.UNSIGNED_BYTE,new Uint8Array(p))}})(i,t,s,n),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.drawArrays(o.TRIANGLE_FAN,0,4);let a=i.g;a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,null)}))}function qf(e,t,r,n){let i=Eo(e),o=(function(c){return c.h||(c.h=new Kb),c.h})(e),s=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r,a=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;Ro(o,i,!0,(()=>{var c=o.g;c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,t),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,o.j),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,s),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,o.B),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),i.bindTexture(i.TEXTURE_2D,null),(c=o.g).activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,null)}))}var Et=class{constructor(e,t){e instanceof CanvasRenderingContext2D||e instanceof OffscreenCanvasRenderingContext2D?(this.l=e,this.j=t):this.j=e}ya(e,t){if(e){var r=fo(this);t=kl(t),r.save();var n=r.canvas,i=0;for(let o of e)r.fillStyle=jr(t.fillColor,{index:i,from:o}),r.strokeStyle=jr(t.color,{index:i,from:o}),r.lineWidth=jr(t.lineWidth,{index:i,from:o}),(e=new Path2D).arc(o.x*n.width,o.y*n.height,jr(t.radius,{index:i,from:o}),0,2*Math.PI),r.fill(e),r.stroke(e),++i;r.restore()}}xa(e,t,r){if(e&&t){var n=fo(this);r=kl(r),n.save();var i=n.canvas,o=0;for(let s of t){n.beginPath(),t=e[s.start];let a=e[s.end];t&&a&&(n.strokeStyle=jr(r.color,{index:o,from:t,to:a}),n.lineWidth=jr(r.lineWidth,{index:o,from:t,to:a}),n.moveTo(t.x*i.width,t.y*i.height),n.lineTo(a.x*i.width,a.y*i.height)),++o,n.stroke()}n.restore()}}ua(e,t){let r=fo(this);t=kl(t),r.save(),r.beginPath(),r.lineWidth=jr(t.lineWidth,{}),r.strokeStyle=jr(t.color,{}),r.fillStyle=jr(t.fillColor,{}),r.moveTo(e.originX,e.originY),r.lineTo(e.originX+e.width,e.originY),r.lineTo(e.originX+e.width,e.originY+e.height),r.lineTo(e.originX,e.originY+e.height),r.lineTo(e.originX,e.originY),r.stroke(),r.fill(),r.restore()}va(e,t,r=[0,0,0,255]){this.l?(function(n,i,o,s){let a=Eo(n);$f(n,i,(c=>{Gf(n,c,o,s),(c=fo(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)}))})(this,e,r,t):Gf(this,e.M(),r,t)}wa(e,t,r){this.l?(function(n,i,o,s){let a=Eo(n);$f(n,i,(c=>{qf(n,c,o,s),(c=fo(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)}))})(this,e,t,r):qf(this,e.M(),t,r)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function Pr(e,t){switch(t){case 0:return e.g.find((r=>r instanceof ImageData));case 1:return e.g.find((r=>typeof ImageBitmap<"u"&&r instanceof ImageBitmap));case 2:return e.g.find((r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture));default:throw Error(`Type is not supported: ${t}`)}}function Jm(e){var t=Pr(e,0);if(!t){t=ki(e);let r=ma(e),n=new Uint8Array(e.width*e.height*4);pa(r,t,Ds(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,n),zh(r),t=new ImageData(new Uint8ClampedArray(n.buffer),e.width,e.height),e.g.push(t)}return t}function Ds(e){let t=Pr(e,2);if(!t){let r=ki(e);t=Os(e);let n=Pr(e,1)||Jm(e);r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),mo(e)}return t}function ki(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=yt(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function ma(e){return e.l||(e.l=new Oi),e.l}function Os(e){let t=ki(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=Pr(e,2);return r||(r=dn(ma(e),t),e.g.push(r),e.m=!0),t.bindTexture(t.TEXTURE_2D,r),r}function mo(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function Kf(e){let t=ki(e);return Ro(ma(e),t,!0,(()=>(function(r,n){let i=r.canvas;if(i.width===r.width&&i.height===r.height)return n();let o=i.width,s=i.height;return i.width=r.width,i.height=r.height,r=n(),i.width=o,i.height=s,r})(e,(()=>{if(t.bindFramebuffer(t.FRAMEBUFFER,null),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),!(e.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return e.canvas.transferToImageBitmap()}))))}Et.prototype.close=Et.prototype.close,Et.prototype.drawConfidenceMask=Et.prototype.wa,Et.prototype.drawCategoryMask=Et.prototype.va,Et.prototype.drawBoundingBox=Et.prototype.ua,Et.prototype.drawConnectors=Et.prototype.xa,Et.prototype.drawLandmarks=Et.prototype.ya,Et.lerp=function(e,t,r,n,i){return Wf(n*(1-(e-t)/(r-t))+i*(1-(r-e)/(r-t)),n,i)},Et.clamp=Wf;var ht=class{constructor(e,t,r,n,i,o,s){this.g=e,this.j=t,this.m=r,this.canvas=n,this.l=i,this.width=o,this.height=s,(this.j||this.m)&&--Xf===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ea(){return!!Pr(this,0)}ka(){return!!Pr(this,1)}P(){return!!Pr(this,2)}Ca(){return Jm(this)}Ba(){var e=Pr(this,1);return e||(Ds(this),Os(this),e=Kf(this),mo(this),this.g.push(e),this.j=!0),e}M(){return Ds(this)}clone(){let e=[];for(let t of this.g){let r;if(t instanceof ImageData)r=new ImageData(t.data,this.width,this.height);else if(t instanceof WebGLTexture){let n=ki(this),i=ma(this);n.activeTexture(n.TEXTURE1),r=dn(i,n),n.bindTexture(n.TEXTURE_2D,r),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,this.width,this.height,0,n.RGBA,n.UNSIGNED_BYTE,null),n.bindTexture(n.TEXTURE_2D,null),pa(i,n,r),Ro(i,n,!1,(()=>{Os(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),mo(this)})),zh(i),mo(this)}else{if(!(t instanceof ImageBitmap))throw Error(`Type is not supported: ${t}`);Ds(this),Os(this),r=Kf(this),mo(this)}e.push(r)}return new ht(e,this.ka(),this.P(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Pr(this,1).close(),this.m&&ki(this).deleteTexture(Pr(this,2)),Xf=-1}};ht.prototype.close=ht.prototype.close,ht.prototype.clone=ht.prototype.clone,ht.prototype.getAsWebGLTexture=ht.prototype.M,ht.prototype.getAsImageBitmap=ht.prototype.Ba,ht.prototype.getAsImageData=ht.prototype.Ca,ht.prototype.hasWebGLTexture=ht.prototype.P,ht.prototype.hasImageBitmap=ht.prototype.ka,ht.prototype.hasImageData=ht.prototype.Ea;var Xf=250;function gr(...e){return e.map((([t,r])=>({start:t,end:r})))}var Jb=(function(e){return class extends e{La(){this.i._registerModelResourcesGraphService()}}})((Jf=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:$m()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(e){let t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){let r=e.length,n=this.i._malloc(r);this.i.HEAPU8.set(e,n),t?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(e,t,r,n,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Q(this,n||"input_audio",(o=>{Q(this,i=i||"audio_header",(s=>{this.i._configureAudio(o,s,e,t??0,r)}))}))}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}da(e){Tr(this,"__graph_config__",(t=>{e(t)})),Q(this,"__graph_config__",(t=>{this.i._getGraphConfig(t,void 0)})),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,n,i){let o=4*e.length;this.h!==o&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(o),this.h=o),this.i.HEAPF32.set(e,this.g/4),Q(this,n,(s=>{this.i._addAudioToInputStream(this.g,t,r,s,i)}))}addGpuBufferToStream(e,t,r){Q(this,t,(n=>{let[i,o]=Uf(this,e,n);this.i._addBoundTextureToStream(n,i,o,r)}))}addBoolToStream(e,t,r){Q(this,t,(n=>{this.i._addBoolToInputStream(e,n,r)}))}addDoubleToStream(e,t,r){Q(this,t,(n=>{this.i._addDoubleToInputStream(e,n,r)}))}addFloatToStream(e,t,r){Q(this,t,(n=>{this.i._addFloatToInputStream(e,n,r)}))}addIntToStream(e,t,r){Q(this,t,(n=>{this.i._addIntToInputStream(e,n,r)}))}addUintToStream(e,t,r){Q(this,t,(n=>{this.i._addUintToInputStream(e,n,r)}))}addStringToStream(e,t,r){Q(this,t,(n=>{Q(this,e,(i=>{this.i._addStringToInputStream(i,n,r)}))}))}addStringRecordToStream(e,t,r){Q(this,t,(n=>{Nf(this,Object.keys(e),(i=>{Nf(this,Object.values(e),(o=>{this.i._addFlatHashMapToInputStream(i,o,Object.keys(e).length,n,r)}))}))}))}addProtoToStream(e,t,r,n){Q(this,r,(i=>{Q(this,t,(o=>{let s=this.i._malloc(e.length);this.i.HEAPU8.set(e,s),this.i._addProtoToInputStream(s,e.length,o,i,n),this.i._free(s)}))}))}addEmptyPacketToStream(e,t){Q(this,e,(r=>{this.i._addEmptyPacketToInputStream(r,t)}))}addBoolVectorToStream(e,t,r){Q(this,t,(n=>{let i=this.i._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(let o of e)this.i._addBoolVectorEntry(i,o);this.i._addBoolVectorToInputStream(i,n,r)}))}addDoubleVectorToStream(e,t,r){Q(this,t,(n=>{let i=this.i._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(let o of e)this.i._addDoubleVectorEntry(i,o);this.i._addDoubleVectorToInputStream(i,n,r)}))}addFloatVectorToStream(e,t,r){Q(this,t,(n=>{let i=this.i._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(let o of e)this.i._addFloatVectorEntry(i,o);this.i._addFloatVectorToInputStream(i,n,r)}))}addIntVectorToStream(e,t,r){Q(this,t,(n=>{let i=this.i._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(let o of e)this.i._addIntVectorEntry(i,o);this.i._addIntVectorToInputStream(i,n,r)}))}addUintVectorToStream(e,t,r){Q(this,t,(n=>{let i=this.i._allocateUintVector(e.length);if(!i)throw Error("Unable to allocate new unsigned int vector on heap.");for(let o of e)this.i._addUintVectorEntry(i,o);this.i._addUintVectorToInputStream(i,n,r)}))}addStringVectorToStream(e,t,r){Q(this,t,(n=>{let i=this.i._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(let o of e)Q(this,o,(s=>{this.i._addStringVectorEntry(i,s)}));this.i._addStringVectorToInputStream(i,n,r)}))}addBoolToInputSidePacket(e,t){Q(this,t,(r=>{this.i._addBoolToInputSidePacket(e,r)}))}addDoubleToInputSidePacket(e,t){Q(this,t,(r=>{this.i._addDoubleToInputSidePacket(e,r)}))}addFloatToInputSidePacket(e,t){Q(this,t,(r=>{this.i._addFloatToInputSidePacket(e,r)}))}addIntToInputSidePacket(e,t){Q(this,t,(r=>{this.i._addIntToInputSidePacket(e,r)}))}addUintToInputSidePacket(e,t){Q(this,t,(r=>{this.i._addUintToInputSidePacket(e,r)}))}addStringToInputSidePacket(e,t){Q(this,t,(r=>{Q(this,e,(n=>{this.i._addStringToInputSidePacket(n,r)}))}))}addProtoToInputSidePacket(e,t,r){Q(this,r,(n=>{Q(this,t,(i=>{let o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputSidePacket(o,e.length,i,n),this.i._free(o)}))}))}addBoolVectorToInputSidePacket(e,t){Q(this,t,(r=>{let n=this.i._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let i of e)this.i._addBoolVectorEntry(n,i);this.i._addBoolVectorToInputSidePacket(n,r)}))}addDoubleVectorToInputSidePacket(e,t){Q(this,t,(r=>{let n=this.i._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let i of e)this.i._addDoubleVectorEntry(n,i);this.i._addDoubleVectorToInputSidePacket(n,r)}))}addFloatVectorToInputSidePacket(e,t){Q(this,t,(r=>{let n=this.i._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let i of e)this.i._addFloatVectorEntry(n,i);this.i._addFloatVectorToInputSidePacket(n,r)}))}addIntVectorToInputSidePacket(e,t){Q(this,t,(r=>{let n=this.i._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let i of e)this.i._addIntVectorEntry(n,i);this.i._addIntVectorToInputSidePacket(n,r)}))}addUintVectorToInputSidePacket(e,t){Q(this,t,(r=>{let n=this.i._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let i of e)this.i._addUintVectorEntry(n,i);this.i._addUintVectorToInputSidePacket(n,r)}))}addStringVectorToInputSidePacket(e,t){Q(this,t,(r=>{let n=this.i._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let i of e)Q(this,i,(o=>{this.i._addStringVectorEntry(n,o)}));this.i._addStringVectorToInputSidePacket(n,r)}))}attachBoolListener(e,t){Tr(this,e,t),Q(this,e,(r=>{this.i._attachBoolListener(r)}))}attachBoolVectorListener(e,t){rn(this,e,t),Q(this,e,(r=>{this.i._attachBoolVectorListener(r)}))}attachIntListener(e,t){Tr(this,e,t),Q(this,e,(r=>{this.i._attachIntListener(r)}))}attachIntVectorListener(e,t){rn(this,e,t),Q(this,e,(r=>{this.i._attachIntVectorListener(r)}))}attachUintListener(e,t){Tr(this,e,t),Q(this,e,(r=>{this.i._attachUintListener(r)}))}attachUintVectorListener(e,t){rn(this,e,t),Q(this,e,(r=>{this.i._attachUintVectorListener(r)}))}attachDoubleListener(e,t){Tr(this,e,t),Q(this,e,(r=>{this.i._attachDoubleListener(r)}))}attachDoubleVectorListener(e,t){rn(this,e,t),Q(this,e,(r=>{this.i._attachDoubleVectorListener(r)}))}attachFloatListener(e,t){Tr(this,e,t),Q(this,e,(r=>{this.i._attachFloatListener(r)}))}attachFloatVectorListener(e,t){rn(this,e,t),Q(this,e,(r=>{this.i._attachFloatVectorListener(r)}))}attachStringListener(e,t){Tr(this,e,t),Q(this,e,(r=>{this.i._attachStringListener(r)}))}attachStringVectorListener(e,t){rn(this,e,t),Q(this,e,(r=>{this.i._attachStringVectorListener(r)}))}attachProtoListener(e,t,r){Tr(this,e,t),Q(this,e,(n=>{this.i._attachProtoListener(n,r||!1)}))}attachProtoVectorListener(e,t,r){rn(this,e,t),Q(this,e,(n=>{this.i._attachProtoVectorListener(n,r||!1)}))}attachAudioListener(e,t,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Tr(this,e,((n,i)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),t(n,i)})),Q(this,e,(n=>{this.i._attachAudioListener(n,r||!1)}))}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends Jf{get ea(){return this.i}qa(e,t,r){Q(this,t,(n=>{let[i,o]=Uf(this,e,n);this.ea._addBoundTextureAsImageToStream(n,i,o,r)}))}U(e,t){Tr(this,e,t),Q(this,e,(r=>{this.ea._attachImageListener(r)}))}ca(e,t){rn(this,e,t),Q(this,e,(r=>{this.ea._attachImageVectorListener(r)}))}})),Jf,tr=class extends Jb{};async function fe(e,t,r){return(async function(n,i,o,s){return Gb(n,i,o,s)})(e,r.canvas??($m()?void 0:document.createElement("canvas")),t,r)}function Ym(e,t,r,n){if(e.T){let o=new _m;if(r?.regionOfInterest){if(!e.pa)throw Error("This task doesn't support region-of-interest.");var i=r.regionOfInterest;if(i.left>=i.right||i.top>=i.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(i.left<0||i.top<0||i.right>1||i.bottom>1)throw Error("Expected RectF values to be in [0,1].");Y(o,1,(i.left+i.right)/2),Y(o,2,(i.top+i.bottom)/2),Y(o,4,i.right-i.left),Y(o,3,i.bottom-i.top)}else Y(o,1,.5),Y(o,2,.5),Y(o,4,1),Y(o,3,1);if(r?.rotationDegrees){if(r?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90\xB0.");if(Y(o,5,-Math.PI*r.rotationDegrees/180),r?.rotationDegrees%180!=0){let[s,a]=Gm(t);r=Je(o,3)*a/s,i=Je(o,4)*s/a,Y(o,4,r),Y(o,3,i)}}e.g.addProtoToStream(o.g(),"mediapipe.NormalizedRect",e.T,n)}e.g.qa(t,e.aa,n??performance.now()),e.finishProcessing()}function rr(e,t,r){if(e.baseOptions?.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");Ym(e,t,r,e.B+1)}function Or(e,t,r,n){if(!e.baseOptions?.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");Ym(e,t,r,n)}function Ei(e,t,r,n){var i=t.data;let o=t.width,s=o*(t=t.height);if((i instanceof Uint8Array||i instanceof Float32Array)&&i.length!==s)throw Error("Unsupported channel count: "+i.length/s);return e=new ot([i],r,!1,e.g.i.canvas,e.O,o,t),n?e.clone():e}var It=class extends Ps{constructor(e,t,r,n){super(e),this.g=e,this.aa=t,this.T=r,this.pa=n,this.O=new Oi}l(e,t=!0){if("runningMode"in e&&So(this.baseOptions,2,!!e.runningMode&&e.runningMode!=="IMAGE"),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.O.close(),super.close()}};It.prototype.close=It.prototype.close;var xt=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},ne(e=this.h=new ha,0,1,t=new Me),Y(this.h,2,.5),Y(this.h,3,.3)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&Y(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&Y(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}D(e,t){return this.j={detections:[]},rr(this,e,t),this.j}F(e,t,r){return this.j={detections:[]},Or(this,e,r,t),this.j}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect_in"),be(e,"detections");let t=new Nt;fr(t,Db,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect_in"),pe(r,"DETECTIONS:detections"),r.o(t),Vt(e,r),this.g.attachProtoVectorListener("detections",((n,i)=>{for(let o of n)n=ym(o),this.j.detections.push(Hm(n));X(this,i)})),this.g.attachEmptyPacketListener("detections",(n=>{X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};xt.prototype.detectForVideo=xt.prototype.F,xt.prototype.detect=xt.prototype.D,xt.prototype.setOptions=xt.prototype.o,xt.createFromModelPath=async function(e,t){return fe(xt,e,{baseOptions:{modelAssetPath:t}})},xt.createFromModelBuffer=function(e,t){return fe(xt,e,{baseOptions:{modelAssetBuffer:t}})},xt.createFromOptions=function(e,t){return fe(xt,e,t)};var Vh=gr([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),Hh=gr([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),Wh=gr([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),Zm=gr([474,475],[475,476],[476,477],[477,474]),$h=gr([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),Gh=gr([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),Qm=gr([469,470],[470,471],[471,472],[472,469]),qh=gr([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),eg=[...Vh,...Hh,...Wh,...$h,...Gh,...qh],tg=gr([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function Yf(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var He=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,ne(e=this.h=new Cm,0,1,t=new Me),this.v=new Em,ne(this.h,0,3,this.v),this.s=new ha,ne(this.h,0,2,this.s),Dr(this.s,4,1),Y(this.s,2,.5),Y(this.v,2,.5),Y(this.h,4,.5)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return"numFaces"in e&&Dr(this.s,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&Y(this.s,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&Y(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&Y(this.v,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}D(e,t){return Yf(this),rr(this,e,t),this.j}F(e,t,r){return Yf(this),Or(this,e,r,t),this.j}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect"),be(e,"face_landmarks");let t=new Nt;fr(t,Bb,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"NORM_LANDMARKS:face_landmarks"),r.o(t),Vt(e,r),this.g.attachProtoVectorListener("face_landmarks",((n,i)=>{for(let o of n)n=Io(o),this.j.faceLandmarks.push(da(n));X(this,i)})),this.g.attachEmptyPacketListener("face_landmarks",(n=>{X(this,n)})),this.outputFaceBlendshapes&&(be(e,"blendshapes"),pe(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",((n,i)=>{if(this.outputFaceBlendshapes)for(let o of n)n=la(o),this.j.faceBlendshapes.push(Uh(n.g()??[]));X(this,i)})),this.g.attachEmptyPacketListener("blendshapes",(n=>{X(this,n)}))),this.outputFacialTransformationMatrixes&&(be(e,"face_geometry"),pe(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",((n,i)=>{if(this.outputFacialTransformationMatrixes)for(let o of n)(n=ye(Ob(o),Eb,2))&&this.j.facialTransformationMatrixes.push({rows:Yt(n,1)??0??0,columns:Yt(n,2)??0??0,data:Mn(n,3,fn,Fn()).slice()??[]});X(this,i)})),this.g.attachEmptyPacketListener("face_geometry",(n=>{X(this,n)}))),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};He.prototype.detectForVideo=He.prototype.F,He.prototype.detect=He.prototype.D,He.prototype.setOptions=He.prototype.o,He.createFromModelPath=function(e,t){return fe(He,e,{baseOptions:{modelAssetPath:t}})},He.createFromModelBuffer=function(e,t){return fe(He,e,{baseOptions:{modelAssetBuffer:t}})},He.createFromOptions=function(e,t){return fe(He,e,t)},He.FACE_LANDMARKS_LIPS=Vh,He.FACE_LANDMARKS_LEFT_EYE=Hh,He.FACE_LANDMARKS_LEFT_EYEBROW=Wh,He.FACE_LANDMARKS_LEFT_IRIS=Zm,He.FACE_LANDMARKS_RIGHT_EYE=$h,He.FACE_LANDMARKS_RIGHT_EYEBROW=Gh,He.FACE_LANDMARKS_RIGHT_IRIS=Qm,He.FACE_LANDMARKS_FACE_OVAL=qh,He.FACE_LANDMARKS_CONTOURS=eg,He.FACE_LANDMARKS_TESSELATION=tg;var Ir=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect",!0),ne(e=this.j=new Am,0,1,t=new Me)}get baseOptions(){return ye(this.j,Me,1)}set baseOptions(e){ne(this.j,0,1,e)}o(e){return super.l(e)}Oa(e,t,r){let n=typeof t!="function"?t:{};if(this.h=typeof t=="function"?t:r,rr(this,e,n??{}),!this.h)return this.s}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect"),be(e,"stylized_image");let t=new Nt;fr(t,Lb,this.j);let r=new bt;jt(r,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"STYLIZED_IMAGE:stylized_image"),r.o(t),Vt(e,r),this.g.U("stylized_image",((n,i)=>{var o=!this.h,s=n.data,a=n.width;let c=a*(n=n.height);if(s instanceof Uint8Array)if(s.length===3*c){let l=new Uint8ClampedArray(4*c);for(let h=0;h<c;++h)l[4*h]=s[3*h],l[4*h+1]=s[3*h+1],l[4*h+2]=s[3*h+2],l[4*h+3]=255;s=new ImageData(l,a,n)}else{if(s.length!==4*c)throw Error("Unsupported channel count: "+s.length/c);s=new ImageData(new Uint8ClampedArray(s.buffer,s.byteOffset,s.length),a,n)}else if(!(s instanceof WebGLTexture))throw Error(`Unsupported format: ${s.constructor.name}`);a=new ht([s],!1,!1,this.g.i.canvas,this.O,a,n),this.s=o=o?a.clone():a,this.h&&this.h(o),X(this,i)})),this.g.attachEmptyPacketListener("stylized_image",(n=>{this.s=null,this.h&&this.h(null),X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ir.prototype.stylize=Ir.prototype.Oa,Ir.prototype.setOptions=Ir.prototype.o,Ir.createFromModelPath=function(e,t){return fe(Ir,e,{baseOptions:{modelAssetPath:t}})},Ir.createFromModelBuffer=function(e,t){return fe(Ir,e,{baseOptions:{modelAssetBuffer:t}})},Ir.createFromOptions=function(e,t){return fe(Ir,e,t)};var Kh=gr([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function Zf(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function Qf(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function ep(e,t=!0){let r=[];for(let i of e){var n=la(i);e=[];for(let o of n.g())n=t&&Yt(o,1)!=null?Yt(o,1)??0:-1,e.push({score:Je(o,2)??0,index:n,categoryName:Qt(o,3)??""??"",displayName:Qt(o,4)??""??""});r.push(e)}return r}var Lt=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],ne(e=this.j=new Rm,0,1,t=new Me),this.s=new Bh,ne(this.j,0,2,this.s),this.C=new Oh,ne(this.s,0,3,this.C),this.v=new Im,ne(this.s,0,2,this.v),this.h=new Fb,ne(this.j,0,3,this.h),Y(this.v,2,.5),Y(this.s,4,.5),Y(this.C,2,.5)}get baseOptions(){return ye(this.j,Me,1)}set baseOptions(e){ne(this.j,0,1,e)}o(e){if(Dr(this.v,3,e.numHands??1),"minHandDetectionConfidence"in e&&Y(this.v,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&Y(this.s,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&Y(this.C,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new ai,r=t,n=Ml(e.cannedGesturesClassifierOptions,ye(this.h,ai,3)?.h());ne(r,0,2,n),ne(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&ye(this.h,ai,3)?.g();return e.customGesturesClassifierOptions?(ne(r=t=new ai,0,2,n=Ml(e.customGesturesClassifierOptions,ye(this.h,ai,4)?.h())),ne(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&ye(this.h,ai,4)?.g(),this.l(e)}Ja(e,t){return Zf(this),rr(this,e,t),Qf(this)}Ka(e,t,r){return Zf(this),Or(this,e,r,t),Qf(this)}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect"),be(e,"hand_gestures"),be(e,"hand_landmarks"),be(e,"world_hand_landmarks"),be(e,"handedness");let t=new Nt;fr(t,Mb,this.j);let r=new bt;jt(r,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"HAND_GESTURES:hand_gestures"),pe(r,"LANDMARKS:hand_landmarks"),pe(r,"WORLD_LANDMARKS:world_hand_landmarks"),pe(r,"HANDEDNESS:handedness"),r.o(t),Vt(e,r),this.g.attachProtoVectorListener("hand_landmarks",((n,i)=>{for(let o of n){n=Io(o);let s=[];for(let a of qr(n,vm,1))s.push({x:Je(a,1)??0,y:Je(a,2)??0,z:Je(a,3)??0,visibility:Je(a,4)??0});this.landmarks.push(s)}X(this,i)})),this.g.attachEmptyPacketListener("hand_landmarks",(n=>{X(this,n)})),this.g.attachProtoVectorListener("world_hand_landmarks",((n,i)=>{for(let o of n){n=pi(o);let s=[];for(let a of qr(n,bm,1))s.push({x:Je(a,1)??0,y:Je(a,2)??0,z:Je(a,3)??0,visibility:Je(a,4)??0});this.worldLandmarks.push(s)}X(this,i)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(n=>{X(this,n)})),this.g.attachProtoVectorListener("hand_gestures",((n,i)=>{this.gestures.push(...ep(n,!1)),X(this,i)})),this.g.attachEmptyPacketListener("hand_gestures",(n=>{X(this,n)})),this.g.attachProtoVectorListener("handedness",((n,i)=>{this.handedness.push(...ep(n)),X(this,i)})),this.g.attachEmptyPacketListener("handedness",(n=>{X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function tp(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Lt.prototype.recognizeForVideo=Lt.prototype.Ka,Lt.prototype.recognize=Lt.prototype.Ja,Lt.prototype.setOptions=Lt.prototype.o,Lt.createFromModelPath=function(e,t){return fe(Lt,e,{baseOptions:{modelAssetPath:t}})},Lt.createFromModelBuffer=function(e,t){return fe(Lt,e,{baseOptions:{modelAssetBuffer:t}})},Lt.createFromOptions=function(e,t){return fe(Lt,e,t)},Lt.HAND_CONNECTIONS=Kh;var Ft=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],ne(e=this.h=new Bh,0,1,t=new Me),this.s=new Oh,ne(this.h,0,3,this.s),this.j=new Im,ne(this.h,0,2,this.j),Dr(this.j,3,1),Y(this.j,2,.5),Y(this.s,2,.5),Y(this.h,4,.5)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return"numHands"in e&&Dr(this.j,3,e.numHands??1),"minHandDetectionConfidence"in e&&Y(this.j,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&Y(this.h,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&Y(this.s,2,e.minHandPresenceConfidence??.5),this.l(e)}D(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],rr(this,e,t),tp(this)}F(e,t,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Or(this,e,r,t),tp(this)}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect"),be(e,"hand_landmarks"),be(e,"world_hand_landmarks"),be(e,"handedness");let t=new Nt;fr(t,Ub,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"LANDMARKS:hand_landmarks"),pe(r,"WORLD_LANDMARKS:world_hand_landmarks"),pe(r,"HANDEDNESS:handedness"),r.o(t),Vt(e,r),this.g.attachProtoVectorListener("hand_landmarks",((n,i)=>{for(let o of n)n=Io(o),this.landmarks.push(da(n));X(this,i)})),this.g.attachEmptyPacketListener("hand_landmarks",(n=>{X(this,n)})),this.g.attachProtoVectorListener("world_hand_landmarks",((n,i)=>{for(let o of n)n=pi(o),this.worldLandmarks.push(vo(n));X(this,i)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(n=>{X(this,n)})),this.g.attachProtoVectorListener("handedness",((n,i)=>{var o=this.handedness,s=o.push;let a=[];for(let c of n){n=la(c);let l=[];for(let h of n.g())l.push({score:Je(h,2)??0,index:Yt(h,1)??0??-1,categoryName:Qt(h,3)??""??"",displayName:Qt(h,4)??""??""});a.push(l)}s.call(o,...a),X(this,i)})),this.g.attachEmptyPacketListener("handedness",(n=>{X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ft.prototype.detectForVideo=Ft.prototype.F,Ft.prototype.detect=Ft.prototype.D,Ft.prototype.setOptions=Ft.prototype.o,Ft.createFromModelPath=function(e,t){return fe(Ft,e,{baseOptions:{modelAssetPath:t}})},Ft.createFromModelBuffer=function(e,t){return fe(Ft,e,{baseOptions:{modelAssetBuffer:t}})},Ft.createFromOptions=function(e,t){return fe(Ft,e,t)},Ft.HAND_CONNECTIONS=Kh;var rg=gr([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function rp(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function np(e){try{if(!e.C)return e.h;e.C(e.h)}finally{fa(e)}}function As(e,t){e=Io(e),t.push(da(e))}var Le=class extends It{constructor(e,t){super(new tr(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,ne(e=this.j=new Lm,0,1,t=new Me),this.J=new Oh,ne(this.j,0,2,this.J),this.Z=new Nb,ne(this.j,0,3,this.Z),this.s=new ha,ne(this.j,0,4,this.s),this.H=new Em,ne(this.j,0,5,this.H),this.v=new Om,ne(this.j,0,6,this.v),this.K=new Bm,ne(this.j,0,7,this.K),Y(this.s,2,.5),Y(this.s,3,.3),Y(this.H,2,.5),Y(this.v,2,.5),Y(this.v,3,.3),Y(this.K,2,.5),Y(this.J,2,.5)}get baseOptions(){return ye(this.j,Me,1)}set baseOptions(e){ne(this.j,0,1,e)}o(e){return"minFaceDetectionConfidence"in e&&Y(this.s,2,e.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in e&&Y(this.s,3,e.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in e&&Y(this.H,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&Y(this.v,2,e.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in e&&Y(this.v,3,e.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in e&&Y(this.K,2,e.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&Y(this.J,2,e.minHandLandmarksConfidence??.5),this.l(e)}D(e,t,r){let n=typeof t!="function"?t:{};return this.C=typeof t=="function"?t:r,rp(this),rr(this,e,n),np(this)}F(e,t,r,n){let i=typeof r!="function"?r:{};return this.C=typeof r=="function"?r:n,rp(this),Or(this,e,i,t),np(this)}m(){var e=new Rt;Be(e,"input_frames_image"),be(e,"pose_landmarks"),be(e,"pose_world_landmarks"),be(e,"face_landmarks"),be(e,"left_hand_landmarks"),be(e,"left_hand_world_landmarks"),be(e,"right_hand_landmarks"),be(e,"right_hand_world_landmarks");let t=new Nt,r=new Sf;Rl(r,1,Ai("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),(function(i,o){if(o!=null)if(Array.isArray(o))Re(i,2,Ip(o));else{if(!(typeof o=="string"||o instanceof $r||Co(o)))throw Error("invalid value in Any.value field: "+o+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Rl(i,2,Yl(o,!1),zn())}})(r,this.j.g());let n=new bt;jt(n,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Ns(n,8,Sf,r),Pe(n,"IMAGE:input_frames_image"),pe(n,"POSE_LANDMARKS:pose_landmarks"),pe(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),pe(n,"FACE_LANDMARKS:face_landmarks"),pe(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),pe(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),pe(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),pe(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.o(t),Vt(e,n),ua(this,e),this.g.attachProtoListener("pose_landmarks",((i,o)=>{As(i,this.h.poseLandmarks),X(this,o)})),this.g.attachEmptyPacketListener("pose_landmarks",(i=>{X(this,i)})),this.g.attachProtoListener("pose_world_landmarks",((i,o)=>{var s=this.h.poseWorldLandmarks;i=pi(i),s.push(vo(i)),X(this,o)})),this.g.attachEmptyPacketListener("pose_world_landmarks",(i=>{X(this,i)})),this.outputPoseSegmentationMasks&&(pe(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),wi(this,"pose_segmentation_mask"),this.g.U("pose_segmentation_mask",((i,o)=>{this.h.poseSegmentationMasks=[Ei(this,i,!0,!this.C)],X(this,o)})),this.g.attachEmptyPacketListener("pose_segmentation_mask",(i=>{this.h.poseSegmentationMasks=[],X(this,i)}))),this.g.attachProtoListener("face_landmarks",((i,o)=>{As(i,this.h.faceLandmarks),X(this,o)})),this.g.attachEmptyPacketListener("face_landmarks",(i=>{X(this,i)})),this.outputFaceBlendshapes&&(be(e,"extra_blendshapes"),pe(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",((i,o)=>{var s=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(i=la(i),s.push(Uh(i.g()??[]))),X(this,o)})),this.g.attachEmptyPacketListener("extra_blendshapes",(i=>{X(this,i)}))),this.g.attachProtoListener("left_hand_landmarks",((i,o)=>{As(i,this.h.leftHandLandmarks),X(this,o)})),this.g.attachEmptyPacketListener("left_hand_landmarks",(i=>{X(this,i)})),this.g.attachProtoListener("left_hand_world_landmarks",((i,o)=>{var s=this.h.leftHandWorldLandmarks;i=pi(i),s.push(vo(i)),X(this,o)})),this.g.attachEmptyPacketListener("left_hand_world_landmarks",(i=>{X(this,i)})),this.g.attachProtoListener("right_hand_landmarks",((i,o)=>{As(i,this.h.rightHandLandmarks),X(this,o)})),this.g.attachEmptyPacketListener("right_hand_landmarks",(i=>{X(this,i)})),this.g.attachProtoListener("right_hand_world_landmarks",((i,o)=>{var s=this.h.rightHandWorldLandmarks;i=pi(i),s.push(vo(i)),X(this,o)})),this.g.attachEmptyPacketListener("right_hand_world_landmarks",(i=>{X(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Le.prototype.detectForVideo=Le.prototype.F,Le.prototype.detect=Le.prototype.D,Le.prototype.setOptions=Le.prototype.o,Le.createFromModelPath=function(e,t){return fe(Le,e,{baseOptions:{modelAssetPath:t}})},Le.createFromModelBuffer=function(e,t){return fe(Le,e,{baseOptions:{modelAssetBuffer:t}})},Le.createFromOptions=function(e,t){return fe(Le,e,t)},Le.HAND_CONNECTIONS=Kh,Le.POSE_CONNECTIONS=rg,Le.FACE_LANDMARKS_LIPS=Vh,Le.FACE_LANDMARKS_LEFT_EYE=Hh,Le.FACE_LANDMARKS_LEFT_EYEBROW=Wh,Le.FACE_LANDMARKS_LEFT_IRIS=Zm,Le.FACE_LANDMARKS_RIGHT_EYE=$h,Le.FACE_LANDMARKS_RIGHT_EYEBROW=Gh,Le.FACE_LANDMARKS_RIGHT_IRIS=Qm,Le.FACE_LANDMARKS_FACE_OVAL=qh,Le.FACE_LANDMARKS_CONTOURS=eg,Le.FACE_LANDMARKS_TESSELATION=tg;var Xt=class extends It{constructor(e,t){super(new tr(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},ne(e=this.h=new Fm,0,1,t=new Me)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return ne(this.h,0,2,Ml(e,ye(this.h,Rh,2))),this.l(e)}sa(e,t){return this.j={classifications:[]},rr(this,e,t),this.j}ta(e,t,r){return this.j={classifications:[]},Or(this,e,r,t),this.j}m(){var e=new Rt;Be(e,"input_image"),Be(e,"norm_rect"),be(e,"classifications");let t=new Nt;fr(t,zb,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),Pe(r,"IMAGE:input_image"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"CLASSIFICATIONS:classifications"),r.o(t),Vt(e,r),this.g.attachProtoListener("classifications",((n,i)=>{this.j=(function(o){let s={classifications:qr(o,xb,1).map((a=>Uh(ye(a,mm,4)?.g()??[],Yt(a,2)??0,Qt(a,3)??"")))};return Us(vi(o,2))!=null&&(s.timestampMs=Us(vi(o,2))??0),s})(Ab(n)),X(this,i)})),this.g.attachEmptyPacketListener("classifications",(n=>{X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Xt.prototype.classifyForVideo=Xt.prototype.ta,Xt.prototype.classify=Xt.prototype.sa,Xt.prototype.setOptions=Xt.prototype.o,Xt.createFromModelPath=function(e,t){return fe(Xt,e,{baseOptions:{modelAssetPath:t}})},Xt.createFromModelBuffer=function(e,t){return fe(Xt,e,{baseOptions:{modelAssetBuffer:t}})},Xt.createFromOptions=function(e,t){return fe(Xt,e,t)};var Mt=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect",!0),this.h=new Mm,this.embeddings={embeddings:[]},ne(e=this.h,0,1,t=new Me)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){var t=this.h,r=ye(this.h,Pf,2);return r=r?r.clone():new Pf,e.l2Normalize!==void 0?So(r,1,e.l2Normalize):"l2Normalize"in e&&Re(r,1),e.quantize!==void 0?So(r,2,e.quantize):"quantize"in e&&Re(r,2),ne(t,0,2,r),this.l(e)}za(e,t){return rr(this,e,t),this.embeddings}Aa(e,t,r){return Or(this,e,r,t),this.embeddings}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect"),be(e,"embeddings_out");let t=new Nt;fr(t,jb,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"EMBEDDINGS:embeddings_out"),r.o(t),Vt(e,r),this.g.attachProtoListener("embeddings_out",((n,i)=>{n=Rb(n),this.embeddings=(function(o){return{embeddings:qr(o,Ib,1).map((s=>{let a={headIndex:Yt(s,3)??0??-1,headName:Qt(s,4)??""??""};if(Bp(s,Rf,yl(s,1))!==void 0)s=Mn(s=ye(s,Rf,yl(s,1)),1,fn,Fn()),a.floatEmbedding=s.slice();else{let c=new Uint8Array(0);a.quantizedEmbedding=ye(s,Tb,yl(s,2))?.oa()?.h()??c}return a})),timestampMs:Us(vi(o,2))??0}})(n),X(this,i)})),this.g.attachEmptyPacketListener("embeddings_out",(n=>{X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Mt.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Ff(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Ff(Lf(e.quantizedEmbedding),Lf(t.quantizedEmbedding))}return e},Mt.prototype.embedForVideo=Mt.prototype.Aa,Mt.prototype.embed=Mt.prototype.za,Mt.prototype.setOptions=Mt.prototype.o,Mt.createFromModelPath=function(e,t){return fe(Mt,e,{baseOptions:{modelAssetPath:t}})},Mt.createFromModelBuffer=function(e,t){return fe(Mt,e,{baseOptions:{modelAssetBuffer:t}})},Mt.createFromOptions=function(e,t){return fe(Mt,e,t)};var jl=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){this.confidenceMasks?.forEach((e=>{e.close()})),this.categoryMask?.close()}};function ip(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function op(e){try{let t=new jl(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{fa(e)}}jl.prototype.close=jl.prototype.close;var Ct=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Mh,this.v=new Um,ne(this.h,0,3,this.v),ne(e=this.h,0,1,t=new Me)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?Re(this.h,2,Ai(e.displayNamesLocale)):"displayNamesLocale"in e&&Re(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}I(){(function(e){let t=qr(e.da(),bt,1).filter((r=>(Qt(r,1)??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")));if(e.s=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&(ye(t[0],Nt,7)?.l()?.g()??new Map).forEach(((r,n)=>{e.s[Number(n)]=Qt(r,1)??""}))})(this)}segment(e,t,r){let n=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:r,ip(this),rr(this,e,n),op(this)}Ma(e,t,r,n){let i=typeof r!="function"?r:{};return this.j=typeof r=="function"?r:n,ip(this),Or(this,e,i,t),op(this)}Da(){return this.s}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect");let t=new Nt;fr(t,zm,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect"),r.o(t),Vt(e,r),ua(this,e),this.outputConfidenceMasks&&(be(e,"confidence_masks"),pe(r,"CONFIDENCE_MASKS:confidence_masks"),wi(this,"confidence_masks"),this.g.ca("confidence_masks",((n,i)=>{this.confidenceMasks=n.map((o=>Ei(this,o,!0,!this.j))),X(this,i)})),this.g.attachEmptyPacketListener("confidence_masks",(n=>{this.confidenceMasks=[],X(this,n)}))),this.outputCategoryMask&&(be(e,"category_mask"),pe(r,"CATEGORY_MASK:category_mask"),wi(this,"category_mask"),this.g.U("category_mask",((n,i)=>{this.categoryMask=Ei(this,n,!1,!this.j),X(this,i)})),this.g.attachEmptyPacketListener("category_mask",(n=>{this.categoryMask=void 0,X(this,n)}))),be(e,"quality_scores"),pe(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((n,i)=>{this.qualityScores=n,X(this,i)})),this.g.attachEmptyPacketListener("quality_scores",(n=>{this.categoryMask=void 0,X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ct.prototype.getLabels=Ct.prototype.Da,Ct.prototype.segmentForVideo=Ct.prototype.Ma,Ct.prototype.segment=Ct.prototype.segment,Ct.prototype.setOptions=Ct.prototype.o,Ct.createFromModelPath=function(e,t){return fe(Ct,e,{baseOptions:{modelAssetPath:t}})},Ct.createFromModelBuffer=function(e,t){return fe(Ct,e,{baseOptions:{modelAssetBuffer:t}})},Ct.createFromOptions=function(e,t){return fe(Ct,e,t)};var Vl=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){this.confidenceMasks?.forEach((e=>{e.close()})),this.categoryMask?.close()}};Vl.prototype.close=Vl.prototype.close;var Yb=class extends J{constructor(e){super(e)}},ci=[0,$e,-2],Hs=[0,Vr,-3,Fe,Vr,-1],sp=[0,Hs],ap=[0,Hs,$e,-1],El=class extends J{constructor(e){super(e)}},cp=[0,Vr,-1,Fe],Zb=class extends J{constructor(e){super(e)}},lp=class extends J{constructor(e){super(e)}},Hl=[1,2,3,4,5,6,7,8,9,10,14,15],ng=class extends J{constructor(e){super(e)}};ng.prototype.g=ca([0,st,[0,Hl,Ee,Hs,Ee,[0,Hs,ci],Ee,sp,Ee,[0,sp,ci],Ee,cp,Ee,[0,Vr,-3,Fe,er],Ee,[0,Vr,-3,Fe],Ee,[0,we,Vr,-2,Fe,$e,Fe,-1,2,Vr,ci],Ee,ap,Ee,[0,ap,ci],Vr,ci,we,Ee,[0,Vr,-3,Fe,ci,-1],Ee,[0,st,cp]],we,[0,we,$e,-1,Fe]]);var Rr=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Mh,this.s=new Um,ne(this.h,0,3,this.s),ne(e=this.h,0,1,t=new Me)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}segment(e,t,r,n){let i=typeof r!="function"?r:{};this.j=typeof r=="function"?r:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.B+1,n=new ng;let o=new lp;var s=new Yb;if(Dr(s,1,255),ne(o,0,12,s),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var a=new El;So(a,3,!0),Y(a,1,t.keypoint.x),Y(a,2,t.keypoint.y),yo(o,5,Hl,a)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(s=new Zb,t.scribble))So(t=new El,3,!0),Y(t,1,a.x),Y(t,2,a.y),Ns(s,1,El,t);yo(o,15,Hl,s)}Ns(n,1,lp,o),this.g.addProtoToStream(n.g(),"drishti.RenderData","roi_in",r),rr(this,e,i);e:{try{let l=new Vl(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=l;break e}this.j(l)}finally{fa(this)}c=void 0}return c}m(){var e=new Rt;Be(e,"image_in"),Be(e,"roi_in"),Be(e,"norm_rect_in");let t=new Nt;fr(t,zm,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"ROI:roi_in"),Pe(r,"NORM_RECT:norm_rect_in"),r.o(t),Vt(e,r),ua(this,e),this.outputConfidenceMasks&&(be(e,"confidence_masks"),pe(r,"CONFIDENCE_MASKS:confidence_masks"),wi(this,"confidence_masks"),this.g.ca("confidence_masks",((n,i)=>{this.confidenceMasks=n.map((o=>Ei(this,o,!0,!this.j))),X(this,i)})),this.g.attachEmptyPacketListener("confidence_masks",(n=>{this.confidenceMasks=[],X(this,n)}))),this.outputCategoryMask&&(be(e,"category_mask"),pe(r,"CATEGORY_MASK:category_mask"),wi(this,"category_mask"),this.g.U("category_mask",((n,i)=>{this.categoryMask=Ei(this,n,!1,!this.j),X(this,i)})),this.g.attachEmptyPacketListener("category_mask",(n=>{this.categoryMask=void 0,X(this,n)}))),be(e,"quality_scores"),pe(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((n,i)=>{this.qualityScores=n,X(this,i)})),this.g.attachEmptyPacketListener("quality_scores",(n=>{this.categoryMask=void 0,X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Rr.prototype.segment=Rr.prototype.segment,Rr.prototype.setOptions=Rr.prototype.o,Rr.createFromModelPath=function(e,t){return fe(Rr,e,{baseOptions:{modelAssetPath:t}})},Rr.createFromModelBuffer=function(e,t){return fe(Rr,e,{baseOptions:{modelAssetBuffer:t}})},Rr.createFromOptions=function(e,t){return fe(Rr,e,t)};var At=class extends It{constructor(e,t){super(new tr(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},ne(e=this.h=new jm,0,1,t=new Me)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?Re(this.h,2,Ai(e.displayNamesLocale)):"displayNamesLocale"in e&&Re(this.h,2),e.maxResults!==void 0?Dr(this.h,3,e.maxResults):"maxResults"in e&&Re(this.h,3),e.scoreThreshold!==void 0?Y(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&Re(this.h,4),e.categoryAllowlist!==void 0?zs(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&Re(this.h,5),e.categoryDenylist!==void 0?zs(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&Re(this.h,6),this.l(e)}D(e,t){return this.j={detections:[]},rr(this,e,t),this.j}F(e,t,r){return this.j={detections:[]},Or(this,e,r,t),this.j}m(){var e=new Rt;Be(e,"input_frame_gpu"),Be(e,"norm_rect"),be(e,"detections");let t=new Nt;fr(t,Hb,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.ObjectDetectorGraph"),Pe(r,"IMAGE:input_frame_gpu"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"DETECTIONS:detections"),r.o(t),Vt(e,r),this.g.attachProtoVectorListener("detections",((n,i)=>{for(let o of n)n=ym(o),this.j.detections.push(Hm(n));X(this,i)})),this.g.attachEmptyPacketListener("detections",(n=>{X(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};At.prototype.detectForVideo=At.prototype.F,At.prototype.detect=At.prototype.D,At.prototype.setOptions=At.prototype.o,At.createFromModelPath=async function(e,t){return fe(At,e,{baseOptions:{modelAssetPath:t}})},At.createFromModelBuffer=function(e,t){return fe(At,e,{baseOptions:{modelAssetBuffer:t}})},At.createFromOptions=function(e,t){return fe(At,e,t)};var Wl=class{constructor(e,t,r){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=r}close(){this.segmentationMasks?.forEach((e=>{e.close()}))}};function hp(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function dp(e){try{let t=new Wl(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.s)return t;e.s(t)}finally{fa(e)}}Wl.prototype.close=Wl.prototype.close;var Ut=class extends It{constructor(e,t){super(new tr(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,ne(e=this.h=new Vm,0,1,t=new Me),this.v=new Bm,ne(this.h,0,3,this.v),this.j=new Om,ne(this.h,0,2,this.j),Dr(this.j,4,1),Y(this.j,2,.5),Y(this.v,2,.5),Y(this.h,4,.5)}get baseOptions(){return ye(this.h,Me,1)}set baseOptions(e){ne(this.h,0,1,e)}o(e){return"numPoses"in e&&Dr(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&Y(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&Y(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&Y(this.v,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}D(e,t,r){let n=typeof t!="function"?t:{};return this.s=typeof t=="function"?t:r,hp(this),rr(this,e,n),dp(this)}F(e,t,r,n){let i=typeof r!="function"?r:{};return this.s=typeof r=="function"?r:n,hp(this),Or(this,e,i,t),dp(this)}m(){var e=new Rt;Be(e,"image_in"),Be(e,"norm_rect"),be(e,"normalized_landmarks"),be(e,"world_landmarks"),be(e,"segmentation_masks");let t=new Nt;fr(t,Wb,this.h);let r=new bt;jt(r,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),Pe(r,"IMAGE:image_in"),Pe(r,"NORM_RECT:norm_rect"),pe(r,"NORM_LANDMARKS:normalized_landmarks"),pe(r,"WORLD_LANDMARKS:world_landmarks"),r.o(t),Vt(e,r),ua(this,e),this.g.attachProtoVectorListener("normalized_landmarks",((n,i)=>{this.landmarks=[];for(let o of n)n=Io(o),this.landmarks.push(da(n));X(this,i)})),this.g.attachEmptyPacketListener("normalized_landmarks",(n=>{this.landmarks=[],X(this,n)})),this.g.attachProtoVectorListener("world_landmarks",((n,i)=>{this.worldLandmarks=[];for(let o of n)n=pi(o),this.worldLandmarks.push(vo(n));X(this,i)})),this.g.attachEmptyPacketListener("world_landmarks",(n=>{this.worldLandmarks=[],X(this,n)})),this.outputSegmentationMasks&&(pe(r,"SEGMENTATION_MASK:segmentation_masks"),wi(this,"segmentation_masks"),this.g.ca("segmentation_masks",((n,i)=>{this.segmentationMasks=n.map((o=>Ei(this,o,!0,!this.s))),X(this,i)})),this.g.attachEmptyPacketListener("segmentation_masks",(n=>{this.segmentationMasks=[],X(this,n)}))),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ut.prototype.detectForVideo=Ut.prototype.F,Ut.prototype.detect=Ut.prototype.D,Ut.prototype.setOptions=Ut.prototype.o,Ut.createFromModelPath=function(e,t){return fe(Ut,e,{baseOptions:{modelAssetPath:t}})},Ut.createFromModelBuffer=function(e,t){return fe(Ut,e,{baseOptions:{modelAssetBuffer:t}})},Ut.createFromOptions=function(e,t){return fe(Ut,e,t)},Ut.POSE_CONNECTIONS=rg;var Bi=class{constructor(t,r,n,i,o="videoPreviewFrameDetection",s="liveViewFrameDetection"){this.options={onRealtimeAlertsCallback:t=>{}};this.children=[];this.runningMode="VIDEO";this.detecting=!1;this.createdVideo=!1;this.lastVideoTime=-1;this.lastExecutionDate=Date.now();this.detectorType=t,this.modelAssetPath=r,this.classVideo=o,this.classDiv=s,i&&(this.paramsConfig=i),n&&(this.options=n)}async initializeDetector(){let t=await nn.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.2/wasm");this.detector=await(this.detectorType==="FaceDetector"?xt:At).createFromOptions(t,{baseOptions:{modelAssetPath:this.modelAssetPath,delegate:"CPU"},scoreThreshold:this.detectorType==="ObjectDetector"?.5:0,runningMode:this.runningMode})}stopDetection(){this.animationFrameId&&clearTimeout(this.animationFrameId),this.detecting=!1,this.liveView=document.getElementById(this.classDiv),this.liveView&&this.classDiv==="liveViewFrameDetection"&&document.body.removeChild(this.liveView),this.createdVideo&&this.video&&document.body.removeChild(this.video),this.createdVideo=!1}enableCam(t){if(!this.detector){console.log("Wait! Detector not loaded yet.");return}this.detecting=!0,this.error=document.getElementById("errorFrameDetection"),this.video=document.getElementById(this.classVideo),this.liveView=document.getElementById(this.classDiv),this.video||(this.video=document.createElement("video"),this.video.setAttribute("id",this.classVideo),this.video.setAttribute("style",`
50
50
  width: 20rem;
51
51
  border-radius: 10px;
52
52
  position: absolute;
@@ -63,12 +63,12 @@ Minimum version required to store current data is: `+o+`.
63
63
  border-radius: 50%;
64
64
  display: block;
65
65
  }
66
- `,document.getElementsByTagName("head")[0].appendChild(n)}async predictWebcam(){if(this.lastVideoTime===-1&&await this.detector.setOptions({runningMode:"VIDEO"}),Date.now()-this.lastExecutionDate>=1e3){let r=Date.now();if(this.lastExecutionDate=r,this.video.currentTime!==this.lastVideoTime){this.lastVideoTime=this.video.currentTime;let n=this.detector.detectForVideo(this.video,r);this.verify(n)}}this.animationFrameId=setTimeout(()=>{this.predictWebcam()},0)}handleAlert(t,r){this.options.onRealtimeAlertsCallback&&this.options.onRealtimeAlertsCallback({status:"ALERT",description:this.alertTranslate(t),type:r,category:t,begin:Date.now()-this.startTime.getTime(),end:Date.now()-this.startTime.getTime()}),this.options.onRealtimeAlertsCallback==null&&this.error&&(this.error.innerText=t)}handleOk(t,r){this.options.onRealtimeAlertsCallback&&this.options.onRealtimeAlertsCallback({status:"OK",description:this.alertTranslate(t),type:r,category:t,begin:Date.now()-this.startTime.getTime(),end:Date.now()-this.startTime.getTime()}),this.error&&(this.error.innerText="")}displayVideoDetections(t){}verify(t){}alertTranslate(t){switch(t){case"multiple_faces_detected":return"M\xFAltiplas faces detectadas";case"no_face_detected":return"Nenhuma face encontrada";case"multiple_persons_detected":return"M\xFAltiplas pessoas detectadas";case"no_person_detected":return"Nenhuma pessoa encontrada";case"cellphone_detected":return"Celular detectado";case"wrong_position_face_detected":return"Face na posi\xE7\xE3o errada";case"person_ok":return"Pessoa detectada";case"cellphone_ok":return"Nenhum celular detectadoa";case"face_ok":return"Face detectada";case"ok_position_face_detected":return"Face na posi\xE7\xE3o correta";case"wrong_face_size_detected":return"Face muito perto da c\xE2mera, afaste-se um pouco mais";case"wrong_face_position_edge_detected":return"Face muito pr\xF3xima da borda, mova-se para o centro da tela";case"wrong_face_position_move_right_detected":return"Face n\xE3o centralizada, mova-se para a direita";case"wrong_face_position_move_left_detected":return"Face n\xE3o centralizada, mova-se para a esquerda";case"wrong_face_position_move_top_detected":return"Face n\xE3o centralizada, mova-se para cima";case"wrong_face_position_move_bottom_detected":return"Face n\xE3o centralizada, mova-se para baixo";case"face_turned_left_detected":return"Face virada para a esquerda, centralize-a";case"face_turned_right_detected":return"Face virada para a direita, centralize-a";case"face_turned_up_detected":return"Face virada para cima, centralize-a";case"face_turned_down_detected":return"Face virada para baixo, centralize-a";default:return t}}};function ig(){let e=document.createElement("div");e.setAttribute("id","liveViewFrameDetection");let t=document.createElement("erro");t.setAttribute("id","errorFrameDetection");let r=document.createElement("video");r.setAttribute("id","videoPreviewFrameDetection"),r.muted=!0,e.style.width="320px",e.style.height="180px",e.style.position="fixed",e.style.bottom="30px",e.style.right="30px",e.style.display="none",r.style.width="100%",r.style.height="100%",r.style.background="#000",e.appendChild(t),e.appendChild(r),document.body.appendChild(e)}var Li=class extends Bi{constructor(r,n,i="videoPreviewFrameDetection",o="liveViewFrameDetection"){super("FaceDetector","https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/1/blaze_face_short_range.tflite",r,n,i,o);this.emmitedPositionAlert=!1;this.emmitedFaceAlert=!1}stopDetection(){super.stopDetection(),this.emmitedFaceAlert&&this.handleOk("face_ok","face_detection_on_stream")}displayVideoDetections(r){for(let s of this.children)this.liveView.removeChild(s);this.children.splice(0);let n=this.video;if(n.videoWidth===0||n.videoHeight===0)return;let i=n.offsetWidth/n.videoWidth,o=n.offsetHeight/n.videoHeight;for(let s of r.detections){let a=s.boundingBox,l=(n.videoWidth-a.originX-a.width)*i,h=a.originY*o,d=(a.width-10)*i,m=a.height*o,p=document.createElement("div");p.setAttribute("class","highlighter"),Object.assign(p.style,{right:`${l+20}px`,top:`${h}px`,width:`${d}px`,height:`${m-10}px`,zIndex:"1",position:"absolute",border:"1px dashed #fff",background:"rgba(0, 255, 0, 0.25)",transform:"scaleX(-1)"});let g=document.createElement("p"),f=s.categories[0].score?Math.round(parseFloat(s.categories[0].score)*100):0;if(g.innerText=`Confidence: ${f}%`,Object.assign(g.style,{right:`${l+20}px`,top:`${h-50}px`,width:`${d}px`,zIndex:"2",position:"absolute",margin:"0",fontSize:"12px",padding:"5px",color:"#fff",backgroundColor:"#007f8b",textAlign:"center",transform:"scaleX(-1)"}),this.liveView.appendChild(p),this.liveView.appendChild(g),this.children.push(p),this.children.push(g),s.keypoints)for(let b of s.keypoints){let v=document.createElement("span");v.className="key-point";let k=b.x<2?b.x*n.videoWidth:b.x,S=b.y<2?b.y*n.videoHeight:b.y,x=(n.videoWidth-k)*i,O=S*o;Object.assign(v.style,{right:`${x+20}px`,top:`${O-3}px`,position:"absolute",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"red",zIndex:"3"}),this.liveView.appendChild(v),this.children.push(v)}}}verify(r){if(this.paramsConfig.videoBehaviourParameters?.detectFace&&r.detections.length!==this.numFacesSent)if(this.numFacesSent=r.detections.length,r.detections.length===0){this.handleAlert("no_face_detected","face_detection_on_stream"),this.emmitedFaceAlert=!0;return}else if(r.detections.length>1){this.handleAlert("multiple_faces_detected","face_detection_on_stream"),this.emmitedFaceAlert=!0;return}else this.handleOk("face_ok","face_detection_on_stream"),this.emmitedFaceAlert=!1;if(r.detections.length===0)return;let n=!1,i=document.getElementById(this.classVideo),o=i.videoWidth,s=i.videoHeight,a=r.detections[0],c=a.boundingBox,l=a.keypoints,h=l[0],d=l[1],m=l[3],p=l[4],g=l[5],f=l[2];o>s&&(c.height/s>.7?(!this.emmitedPositionAlert&&this.handleAlert("wrong_face_size_detected","position_detection_on_stream"),n=!0,this.emmitedPositionAlert=!0):c.width/o>.7&&(!this.emmitedPositionAlert&&this.handleAlert("wrong_face_size_detected","position_detection_on_stream"),this.emmitedPositionAlert=!0,n=!0));let b=[c.originX,c.originY],v=[c.originX+c.width,c.originY+c.height];(b[0]<.1*c.width||b[1]<.2*c.height||v[0]>o-.1*c.width||v[1]>s-5)&&(!this.emmitedPositionAlert&&this.handleAlert("wrong_face_position_edge_detected","position_detection_on_stream"),this.emmitedPositionAlert=!0,n=!0);let k=b[0],S=o-v[0],I=b[1],x=s-v[1];k>2*S&&(!this.emmitedPositionAlert&&this.handleAlert("wrong_face_position_move_right_detected","position_detection_on_stream"),this.emmitedPositionAlert=!0,n=!0),I>4*x&&(!this.emmitedPositionAlert&&this.handleAlert("wrong_face_position_move_top_detected","position_detection_on_stream"),this.emmitedPositionAlert=!0,n=!0),S>2*k&&(!this.emmitedPositionAlert&&this.handleAlert("wrong_face_position_move_left_detected","position_detection_on_stream"),this.emmitedPositionAlert=!0,n=!0),x>3*I&&(!this.emmitedPositionAlert&&this.handleAlert("wrong_face_position_move_bottom_detected","position_detection_on_stream"),this.emmitedPositionAlert=!0,n=!0),n==!1&&(this.emmitedPositionAlert&&this.handleOk("ok_position_face_detected","position_detection_on_stream"),this.emmitedPositionAlert=!1)}};function Po(e,t){return function(){return e.apply(t,arguments)}}var{toString:Qb}=Object.prototype,{getPrototypeOf:Jh}=Object,ya=(e=>t=>{let r=Qb.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),yr=e=>(e=e.toLowerCase(),t=>ya(t)===e),ba=e=>t=>typeof t===e,{isArray:Fi}=Array,Do=ba("undefined");function ev(e){return e!==null&&!Do(e)&&e.constructor!==null&&!Do(e.constructor)&&Ht(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var sg=yr("ArrayBuffer");function tv(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&sg(e.buffer),t}var rv=ba("string"),Ht=ba("function"),ag=ba("number"),va=e=>e!==null&&typeof e=="object",nv=e=>e===!0||e===!1,ga=e=>{if(ya(e)!=="object")return!1;let t=Jh(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},iv=yr("Date"),ov=yr("File"),sv=yr("Blob"),av=yr("FileList"),cv=e=>va(e)&&Ht(e.pipe),lv=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ht(e.append)&&((t=ya(e))==="formdata"||t==="object"&&Ht(e.toString)&&e.toString()==="[object FormData]"))},hv=yr("URLSearchParams"),[dv,uv,fv,pv]=["ReadableStream","Request","Response","Headers"].map(yr),mv=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Oo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Fi(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{let o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length,a;for(n=0;n<s;n++)a=o[n],t.call(null,e[a],a,e)}}function cg(e,t){t=t.toLowerCase();let r=Object.keys(e),n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}var Vn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,lg=e=>!Do(e)&&e!==Vn;function Xh(){let{caseless:e}=lg(this)&&this||{},t={},r=(n,i)=>{let o=e&&cg(t,i)||i;ga(t[o])&&ga(n)?t[o]=Xh(t[o],n):ga(n)?t[o]=Xh({},n):Fi(n)?t[o]=n.slice():t[o]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&Oo(arguments[n],r);return t}var gv=(e,t,r,{allOwnKeys:n}={})=>(Oo(t,(i,o)=>{r&&Ht(i)?e[o]=Po(i,r):e[o]=i},{allOwnKeys:n}),e),yv=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),bv=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},vv=(e,t,r,n)=>{let i,o,s,a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!n||n(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=r!==!1&&Jh(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},_v=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},wv=e=>{if(!e)return null;if(Fi(e))return e;let t=e.length;if(!ag(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Sv=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Jh(Uint8Array)),kv=(e,t)=>{let n=(e&&e[Symbol.iterator]).call(e),i;for(;(i=n.next())&&!i.done;){let o=i.value;t.call(e,o[0],o[1])}},Ev=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Cv=yr("HTMLFormElement"),xv=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),og=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Av=yr("RegExp"),hg=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};Oo(r,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(n[o]=s||i)}),Object.defineProperties(e,n)},Tv=e=>{hg(e,(t,r)=>{if(Ht(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(Ht(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Iv=(e,t)=>{let r={},n=i=>{i.forEach(o=>{r[o]=!0})};return Fi(e)?n(e):n(String(e).split(t)),r},Rv=()=>{},Pv=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Dv(e){return!!(e&&Ht(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var Ov=e=>{let t=new Array(10),r=(n,i)=>{if(va(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;let o=Fi(n)?[]:{};return Oo(n,(s,a)=>{let c=r(s,i+1);!Do(c)&&(o[a]=c)}),t[i]=void 0,o}}return n};return r(e,0)},Bv=yr("AsyncFunction"),Lv=e=>e&&(va(e)||Ht(e))&&Ht(e.then)&&Ht(e.catch),dg=((e,t)=>e?setImmediate:t?((r,n)=>(Vn.addEventListener("message",({source:i,data:o})=>{i===Vn&&o===r&&n.length&&n.shift()()},!1),i=>{n.push(i),Vn.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Ht(Vn.postMessage)),Fv=typeof queueMicrotask<"u"?queueMicrotask.bind(Vn):typeof process<"u"&&process.nextTick||dg,T={isArray:Fi,isArrayBuffer:sg,isBuffer:ev,isFormData:lv,isArrayBufferView:tv,isString:rv,isNumber:ag,isBoolean:nv,isObject:va,isPlainObject:ga,isReadableStream:dv,isRequest:uv,isResponse:fv,isHeaders:pv,isUndefined:Do,isDate:iv,isFile:ov,isBlob:sv,isRegExp:Av,isFunction:Ht,isStream:cv,isURLSearchParams:hv,isTypedArray:Sv,isFileList:av,forEach:Oo,merge:Xh,extend:gv,trim:mv,stripBOM:yv,inherits:bv,toFlatObject:vv,kindOf:ya,kindOfTest:yr,endsWith:_v,toArray:wv,forEachEntry:kv,matchAll:Ev,isHTMLForm:Cv,hasOwnProperty:og,hasOwnProp:og,reduceDescriptors:hg,freezeMethods:Tv,toObjectSet:Iv,toCamelCase:xv,noop:Rv,toFiniteNumber:Pv,findKey:cg,global:Vn,isContextDefined:lg,isSpecCompliantForm:Dv,toJSONObject:Ov,isAsyncFn:Bv,isThenable:Lv,setImmediate:dg,asap:Fv};function Mi(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}T.inherits(Mi,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:T.toJSONObject(this.config),code:this.code,status:this.status}}});var ug=Mi.prototype,fg={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{fg[e]={value:e}});Object.defineProperties(Mi,fg);Object.defineProperty(ug,"isAxiosError",{value:!0});Mi.from=(e,t,r,n,i,o)=>{let s=Object.create(ug);return T.toFlatObject(e,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),Mi.call(s,e.message,t,r,n,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};var ce=Mi;var _a=null;function Yh(e){return T.isPlainObject(e)||T.isArray(e)}function mg(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function pg(e,t,r){return e?e.concat(t).map(function(i,o){return i=mg(i),!r&&o?"["+i+"]":i}).join(r?".":""):t}function Mv(e){return T.isArray(e)&&!e.some(Yh)}var Uv=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function Nv(e,t,r){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new(_a||FormData),r=T.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,b){return!T.isUndefined(b[f])});let n=r.metaTokens,i=r.visitor||h,o=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(i))throw new TypeError("visitor must be a function");function l(g){if(g===null)return"";if(T.isDate(g))return g.toISOString();if(!c&&T.isBlob(g))throw new ce("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(g)||T.isTypedArray(g)?c&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function h(g,f,b){let v=g;if(g&&!b&&typeof g=="object"){if(T.endsWith(f,"{}"))f=n?f:f.slice(0,-2),g=JSON.stringify(g);else if(T.isArray(g)&&Mv(g)||(T.isFileList(g)||T.endsWith(f,"[]"))&&(v=T.toArray(g)))return f=mg(f),v.forEach(function(S,I){!(T.isUndefined(S)||S===null)&&t.append(s===!0?pg([f],I,o):s===null?f:f+"[]",l(S))}),!1}return Yh(g)?!0:(t.append(pg(b,f,o),l(g)),!1)}let d=[],m=Object.assign(Uv,{defaultVisitor:h,convertValue:l,isVisitable:Yh});function p(g,f){if(!T.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+f.join("."));d.push(g),T.forEach(g,function(v,k){(!(T.isUndefined(v)||v===null)&&i.call(t,v,T.isString(k)?k.trim():k,f,m))===!0&&p(v,f?f.concat(k):[k])}),d.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return p(e),t}var pn=Nv;function gg(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function yg(e,t){this._pairs=[],e&&pn(e,this,t)}var bg=yg.prototype;bg.append=function(t,r){this._pairs.push([t,r])};bg.toString=function(t){let r=t?function(n){return t.call(this,n,gg)}:gg;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var wa=yg;function zv(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Bo(e,t,r){if(!t)return e;let n=r&&r.encode||zv;T.isFunction(r)&&(r={serialize:r});let i=r&&r.serialize,o;if(i?o=i(t,r):o=T.isURLSearchParams(t)?t.toString():new wa(t,r).toString(n),o){let s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}var Zh=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){T.forEach(this.handlers,function(n){n!==null&&t(n)})}},Qh=Zh;var Sa={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var vg=typeof URLSearchParams<"u"?URLSearchParams:wa;var _g=typeof FormData<"u"?FormData:null;var wg=typeof Blob<"u"?Blob:null;var Sg={isBrowser:!0,classes:{URLSearchParams:vg,FormData:_g,Blob:wg},protocols:["http","https","file","blob","url","data"]};var rd={};xy(rd,{hasBrowserEnv:()=>td,hasStandardBrowserEnv:()=>jv,hasStandardBrowserWebWorkerEnv:()=>Vv,navigator:()=>ed,origin:()=>Hv});var td=typeof window<"u"&&typeof document<"u",ed=typeof navigator=="object"&&navigator||void 0,jv=td&&(!ed||["ReactNative","NativeScript","NS"].indexOf(ed.product)<0),Vv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Hv=td&&window.location.href||"http://localhost";var je={...rd,...Sg};function nd(e,t){return pn(e,new je.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,o){return je.isNode&&T.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Wv(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function $v(e){let t={},r=Object.keys(e),n,i=r.length,o;for(n=0;n<i;n++)o=r[n],t[o]=e[o];return t}function Gv(e){function t(r,n,i,o){let s=r[o++];if(s==="__proto__")return!0;let a=Number.isFinite(+s),c=o>=r.length;return s=!s&&T.isArray(i)?i.length:s,c?(T.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!a):((!i[s]||!T.isObject(i[s]))&&(i[s]=[]),t(r,n,i[s],o)&&T.isArray(i[s])&&(i[s]=$v(i[s])),!a)}if(T.isFormData(e)&&T.isFunction(e.entries)){let r={};return T.forEachEntry(e,(n,i)=>{t(Wv(n),i,r,0)}),r}return null}var ka=Gv;function qv(e,t,r){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var id={transitional:Sa,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,o=T.isObject(t);if(o&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return i?JSON.stringify(ka(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return nd(t,this.formSerializer).toString();if((a=T.isFileList(t))||n.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return pn(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||i?(r.setContentType("application/json",!1),qv(t)):t}],transformResponse:[function(t){let r=this.transitional||id.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&T.isString(t)&&(n&&!this.responseType||i)){let s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?ce.from(a,ce.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:je.classes.FormData,Blob:je.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],e=>{id.headers[e]={}});var Ui=id;var Kv=T.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),kg=e=>{let t={},r,n,i;return e&&e.split(`
66
+ `,document.getElementsByTagName("head")[0].appendChild(n)}async predictWebcam(){if(this.lastVideoTime===-1&&await this.detector.setOptions({runningMode:"VIDEO"}),Date.now()-this.lastExecutionDate>=1e3){let r=Date.now();if(this.lastExecutionDate=r,this.video.currentTime!==this.lastVideoTime){this.lastVideoTime=this.video.currentTime;let n=this.detector.detectForVideo(this.video,r);this.verify(n)}}this.animationFrameId=setTimeout(()=>{this.predictWebcam()},0)}handleAlert(t,r){this.options.onRealtimeAlertsCallback&&this.options.onRealtimeAlertsCallback({status:"ALERT",description:this.alertTranslate(t),type:r,category:t,begin:Date.now()-this.startTime.getTime(),end:Date.now()-this.startTime.getTime()}),this.options.onRealtimeAlertsCallback==null&&this.error&&(this.error.innerText=t)}handleOk(t,r){this.options.onRealtimeAlertsCallback&&this.options.onRealtimeAlertsCallback({status:"OK",description:this.alertTranslate(t),type:r,category:t,begin:Date.now()-this.startTime.getTime(),end:Date.now()-this.startTime.getTime()}),this.error&&(this.error.innerText="")}displayVideoDetections(t){}verify(t){}alertTranslate(t){switch(t){case"multiple_faces_detected":return"M\xFAltiplas faces detectadas";case"no_face_detected":return"Nenhuma face encontrada";case"multiple_persons_detected":return"M\xFAltiplas pessoas detectadas";case"no_person_detected":return"Nenhuma pessoa encontrada";case"cellphone_detected":return"Celular detectado";case"wrong_position_face_detected":return"Face na posi\xE7\xE3o errada";case"person_ok":return"Pessoa detectada";case"cellphone_ok":return"Nenhum celular detectadoa";case"face_ok":return"Face detectada";case"ok_position_face_detected":return"Face na posi\xE7\xE3o correta";case"wrong_face_size_detected":return"Face muito perto da c\xE2mera, afaste-se um pouco mais";case"wrong_face_position_edge_detected":return"Face muito pr\xF3xima da borda, mova-se para o centro da tela";case"wrong_face_position_move_right_detected":return"Face n\xE3o centralizada, mova-se para a direita";case"wrong_face_position_move_left_detected":return"Face n\xE3o centralizada, mova-se para a esquerda";case"wrong_face_position_move_top_detected":return"Face n\xE3o centralizada, mova-se para cima";case"wrong_face_position_move_bottom_detected":return"Face n\xE3o centralizada, mova-se para baixo";case"face_turned_left_detected":return"Face virada para a esquerda, centralize-a";case"face_turned_right_detected":return"Face virada para a direita, centralize-a";case"face_turned_up_detected":return"Face virada para cima, centralize-a";case"face_turned_down_detected":return"Face virada para baixo, centralize-a";default:return t}}};function ig(){let e=document.createElement("div");e.setAttribute("id","liveViewFrameDetection");let t=document.createElement("erro");t.setAttribute("id","errorFrameDetection");let r=document.createElement("video");r.setAttribute("id","videoPreviewFrameDetection"),r.muted=!0,e.style.width="320px",e.style.height="180px",e.style.position="fixed",e.style.bottom="30px",e.style.right="30px",e.style.display="none",r.style.width="100%",r.style.height="100%",r.style.background="#000",e.appendChild(t),e.appendChild(r),document.body.appendChild(e)}var Li=class extends Bi{constructor(r,n,i="videoPreviewFrameDetection",o="liveViewFrameDetection"){super("FaceDetector","https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/1/blaze_face_short_range.tflite",r,n,i,o);this.emmitedPositionAlert=!1;this.emmitedFaceAlert=!1}stopDetection(){super.stopDetection(),this.emmitedFaceAlert&&this.handleOk("face_ok","face_detection_on_stream")}displayVideoDetections(r){for(let s of this.children)this.liveView.removeChild(s);this.children.splice(0);let n=this.video;if(n.videoWidth===0||n.videoHeight===0)return;let i=n.offsetWidth/n.videoWidth,o=n.offsetHeight/n.videoHeight;for(let s of r.detections){let a=s.boundingBox,l=(n.videoWidth-a.originX-a.width)*i,h=a.originY*o,d=(a.width-10)*i,m=a.height*o,p=document.createElement("div");p.setAttribute("class","highlighter"),Object.assign(p.style,{right:`${l+20}px`,top:`${h}px`,width:`${d}px`,height:`${m-10}px`,zIndex:"1",position:"absolute",border:"1px dashed #fff",background:"rgba(0, 255, 0, 0.25)",transform:"scaleX(-1)"});let g=document.createElement("p"),f=s.categories[0].score?Math.round(parseFloat(s.categories[0].score)*100):0;if(g.innerText=`Confidence: ${f}%`,Object.assign(g.style,{right:`${l+20}px`,top:`${h-50}px`,width:`${d}px`,zIndex:"2",position:"absolute",margin:"0",fontSize:"12px",padding:"5px",color:"#fff",backgroundColor:"#007f8b",textAlign:"center",transform:"scaleX(-1)"}),this.liveView.appendChild(p),this.liveView.appendChild(g),this.children.push(p),this.children.push(g),s.keypoints)for(let b of s.keypoints){let v=document.createElement("span");v.className="key-point";let k=b.x<2?b.x*n.videoWidth:b.x,S=b.y<2?b.y*n.videoHeight:b.y,x=(n.videoWidth-k)*i,O=S*o;Object.assign(v.style,{right:`${x+20}px`,top:`${O-3}px`,position:"absolute",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"red",zIndex:"3"}),this.liveView.appendChild(v),this.children.push(v)}}}verify(r){if(this.paramsConfig.videoBehaviourParameters?.detectFace&&r.detections.length!==this.numFacesSent)if(this.numFacesSent=r.detections.length,r.detections.length===0){this.handleAlert("no_face_detected","face_detection_on_stream"),this.emmitedFaceAlert=!0;return}else if(r.detections.length>1){this.handleAlert("multiple_faces_detected","face_detection_on_stream"),this.emmitedFaceAlert=!0;return}else this.handleOk("face_ok","face_detection_on_stream"),this.emmitedFaceAlert=!1;if(r.detections.length===0)return;let n=!1,i=document.getElementById(this.classVideo),o=i.videoWidth,s=i.videoHeight,a=r.detections[0],c=a.boundingBox,l=a.keypoints,h=l[0],d=l[1],m=l[3],p=l[4],g=l[5],f=l[2];o>s&&(c.height/s>.7?(!this.emmitedPositionAlert&&this.handleAlert("wrong_face_size_detected","position_detection_on_stream"),n=!0,this.emmitedPositionAlert=!0):c.width/o>.7&&(!this.emmitedPositionAlert&&this.handleAlert("wrong_face_size_detected","position_detection_on_stream"),this.emmitedPositionAlert=!0,n=!0));let b=[c.originX,c.originY],v=[c.originX+c.width,c.originY+c.height];(b[0]<.1*c.width||b[1]<.2*c.height||v[0]>o-.1*c.width||v[1]>s-5)&&(!this.emmitedPositionAlert&&this.handleAlert("wrong_face_position_edge_detected","position_detection_on_stream"),this.emmitedPositionAlert=!0,n=!0);let k=b[0],S=o-v[0],I=b[1],x=s-v[1];k>2*S&&(!this.emmitedPositionAlert&&this.handleAlert("wrong_face_position_move_right_detected","position_detection_on_stream"),this.emmitedPositionAlert=!0,n=!0),I>4*x&&(!this.emmitedPositionAlert&&this.handleAlert("wrong_face_position_move_top_detected","position_detection_on_stream"),this.emmitedPositionAlert=!0,n=!0),S>2*k&&(!this.emmitedPositionAlert&&this.handleAlert("wrong_face_position_move_left_detected","position_detection_on_stream"),this.emmitedPositionAlert=!0,n=!0),x>3*I&&(!this.emmitedPositionAlert&&this.handleAlert("wrong_face_position_move_bottom_detected","position_detection_on_stream"),this.emmitedPositionAlert=!0,n=!0),n==!1&&(this.emmitedPositionAlert&&this.handleOk("ok_position_face_detected","position_detection_on_stream"),this.emmitedPositionAlert=!1)}};function Po(e,t){return function(){return e.apply(t,arguments)}}var{toString:Qb}=Object.prototype,{getPrototypeOf:Jh}=Object,ya=(e=>t=>{let r=Qb.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),yr=e=>(e=e.toLowerCase(),t=>ya(t)===e),ba=e=>t=>typeof t===e,{isArray:Fi}=Array,Do=ba("undefined");function ev(e){return e!==null&&!Do(e)&&e.constructor!==null&&!Do(e.constructor)&&Ht(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var sg=yr("ArrayBuffer");function tv(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&sg(e.buffer),t}var rv=ba("string"),Ht=ba("function"),ag=ba("number"),va=e=>e!==null&&typeof e=="object",nv=e=>e===!0||e===!1,ga=e=>{if(ya(e)!=="object")return!1;let t=Jh(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},iv=yr("Date"),ov=yr("File"),sv=yr("Blob"),av=yr("FileList"),cv=e=>va(e)&&Ht(e.pipe),lv=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ht(e.append)&&((t=ya(e))==="formdata"||t==="object"&&Ht(e.toString)&&e.toString()==="[object FormData]"))},hv=yr("URLSearchParams"),[dv,uv,fv,pv]=["ReadableStream","Request","Response","Headers"].map(yr),mv=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Oo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Fi(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{let o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length,a;for(n=0;n<s;n++)a=o[n],t.call(null,e[a],a,e)}}function cg(e,t){t=t.toLowerCase();let r=Object.keys(e),n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}var Vn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,lg=e=>!Do(e)&&e!==Vn;function Xh(){let{caseless:e}=lg(this)&&this||{},t={},r=(n,i)=>{let o=e&&cg(t,i)||i;ga(t[o])&&ga(n)?t[o]=Xh(t[o],n):ga(n)?t[o]=Xh({},n):Fi(n)?t[o]=n.slice():t[o]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&Oo(arguments[n],r);return t}var gv=(e,t,r,{allOwnKeys:n}={})=>(Oo(t,(i,o)=>{r&&Ht(i)?e[o]=Po(i,r):e[o]=i},{allOwnKeys:n}),e),yv=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),bv=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},vv=(e,t,r,n)=>{let i,o,s,a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!n||n(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=r!==!1&&Jh(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},_v=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},wv=e=>{if(!e)return null;if(Fi(e))return e;let t=e.length;if(!ag(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Sv=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Jh(Uint8Array)),kv=(e,t)=>{let n=(e&&e[Symbol.iterator]).call(e),i;for(;(i=n.next())&&!i.done;){let o=i.value;t.call(e,o[0],o[1])}},Ev=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Cv=yr("HTMLFormElement"),xv=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),og=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Av=yr("RegExp"),hg=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};Oo(r,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(n[o]=s||i)}),Object.defineProperties(e,n)},Tv=e=>{hg(e,(t,r)=>{if(Ht(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(Ht(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Iv=(e,t)=>{let r={},n=i=>{i.forEach(o=>{r[o]=!0})};return Fi(e)?n(e):n(String(e).split(t)),r},Rv=()=>{},Pv=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Dv(e){return!!(e&&Ht(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var Ov=e=>{let t=new Array(10),r=(n,i)=>{if(va(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;let o=Fi(n)?[]:{};return Oo(n,(s,a)=>{let c=r(s,i+1);!Do(c)&&(o[a]=c)}),t[i]=void 0,o}}return n};return r(e,0)},Bv=yr("AsyncFunction"),Lv=e=>e&&(va(e)||Ht(e))&&Ht(e.then)&&Ht(e.catch),dg=((e,t)=>e?setImmediate:t?((r,n)=>(Vn.addEventListener("message",({source:i,data:o})=>{i===Vn&&o===r&&n.length&&n.shift()()},!1),i=>{n.push(i),Vn.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Ht(Vn.postMessage)),Fv=typeof queueMicrotask<"u"?queueMicrotask.bind(Vn):typeof process<"u"&&process.nextTick||dg,T={isArray:Fi,isArrayBuffer:sg,isBuffer:ev,isFormData:lv,isArrayBufferView:tv,isString:rv,isNumber:ag,isBoolean:nv,isObject:va,isPlainObject:ga,isReadableStream:dv,isRequest:uv,isResponse:fv,isHeaders:pv,isUndefined:Do,isDate:iv,isFile:ov,isBlob:sv,isRegExp:Av,isFunction:Ht,isStream:cv,isURLSearchParams:hv,isTypedArray:Sv,isFileList:av,forEach:Oo,merge:Xh,extend:gv,trim:mv,stripBOM:yv,inherits:bv,toFlatObject:vv,kindOf:ya,kindOfTest:yr,endsWith:_v,toArray:wv,forEachEntry:kv,matchAll:Ev,isHTMLForm:Cv,hasOwnProperty:og,hasOwnProp:og,reduceDescriptors:hg,freezeMethods:Tv,toObjectSet:Iv,toCamelCase:xv,noop:Rv,toFiniteNumber:Pv,findKey:cg,global:Vn,isContextDefined:lg,isSpecCompliantForm:Dv,toJSONObject:Ov,isAsyncFn:Bv,isThenable:Lv,setImmediate:dg,asap:Fv};function Mi(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}T.inherits(Mi,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:T.toJSONObject(this.config),code:this.code,status:this.status}}});var ug=Mi.prototype,fg={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{fg[e]={value:e}});Object.defineProperties(Mi,fg);Object.defineProperty(ug,"isAxiosError",{value:!0});Mi.from=(e,t,r,n,i,o)=>{let s=Object.create(ug);return T.toFlatObject(e,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),Mi.call(s,e.message,t,r,n,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};var ce=Mi;var _a=null;function Yh(e){return T.isPlainObject(e)||T.isArray(e)}function mg(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function pg(e,t,r){return e?e.concat(t).map(function(i,o){return i=mg(i),!r&&o?"["+i+"]":i}).join(r?".":""):t}function Mv(e){return T.isArray(e)&&!e.some(Yh)}var Uv=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function Nv(e,t,r){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new(_a||FormData),r=T.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,b){return!T.isUndefined(b[f])});let n=r.metaTokens,i=r.visitor||h,o=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(i))throw new TypeError("visitor must be a function");function l(g){if(g===null)return"";if(T.isDate(g))return g.toISOString();if(!c&&T.isBlob(g))throw new ce("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(g)||T.isTypedArray(g)?c&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function h(g,f,b){let v=g;if(g&&!b&&typeof g=="object"){if(T.endsWith(f,"{}"))f=n?f:f.slice(0,-2),g=JSON.stringify(g);else if(T.isArray(g)&&Mv(g)||(T.isFileList(g)||T.endsWith(f,"[]"))&&(v=T.toArray(g)))return f=mg(f),v.forEach(function(S,I){!(T.isUndefined(S)||S===null)&&t.append(s===!0?pg([f],I,o):s===null?f:f+"[]",l(S))}),!1}return Yh(g)?!0:(t.append(pg(b,f,o),l(g)),!1)}let d=[],m=Object.assign(Uv,{defaultVisitor:h,convertValue:l,isVisitable:Yh});function p(g,f){if(!T.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+f.join("."));d.push(g),T.forEach(g,function(v,k){(!(T.isUndefined(v)||v===null)&&i.call(t,v,T.isString(k)?k.trim():k,f,m))===!0&&p(v,f?f.concat(k):[k])}),d.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return p(e),t}var mn=Nv;function gg(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function yg(e,t){this._pairs=[],e&&mn(e,this,t)}var bg=yg.prototype;bg.append=function(t,r){this._pairs.push([t,r])};bg.toString=function(t){let r=t?function(n){return t.call(this,n,gg)}:gg;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var wa=yg;function zv(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Bo(e,t,r){if(!t)return e;let n=r&&r.encode||zv;T.isFunction(r)&&(r={serialize:r});let i=r&&r.serialize,o;if(i?o=i(t,r):o=T.isURLSearchParams(t)?t.toString():new wa(t,r).toString(n),o){let s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}var Zh=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){T.forEach(this.handlers,function(n){n!==null&&t(n)})}},Qh=Zh;var Sa={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var vg=typeof URLSearchParams<"u"?URLSearchParams:wa;var _g=typeof FormData<"u"?FormData:null;var wg=typeof Blob<"u"?Blob:null;var Sg={isBrowser:!0,classes:{URLSearchParams:vg,FormData:_g,Blob:wg},protocols:["http","https","file","blob","url","data"]};var rd={};xy(rd,{hasBrowserEnv:()=>td,hasStandardBrowserEnv:()=>jv,hasStandardBrowserWebWorkerEnv:()=>Vv,navigator:()=>ed,origin:()=>Hv});var td=typeof window<"u"&&typeof document<"u",ed=typeof navigator=="object"&&navigator||void 0,jv=td&&(!ed||["ReactNative","NativeScript","NS"].indexOf(ed.product)<0),Vv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Hv=td&&window.location.href||"http://localhost";var je={...rd,...Sg};function nd(e,t){return mn(e,new je.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,o){return je.isNode&&T.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Wv(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function $v(e){let t={},r=Object.keys(e),n,i=r.length,o;for(n=0;n<i;n++)o=r[n],t[o]=e[o];return t}function Gv(e){function t(r,n,i,o){let s=r[o++];if(s==="__proto__")return!0;let a=Number.isFinite(+s),c=o>=r.length;return s=!s&&T.isArray(i)?i.length:s,c?(T.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!a):((!i[s]||!T.isObject(i[s]))&&(i[s]=[]),t(r,n,i[s],o)&&T.isArray(i[s])&&(i[s]=$v(i[s])),!a)}if(T.isFormData(e)&&T.isFunction(e.entries)){let r={};return T.forEachEntry(e,(n,i)=>{t(Wv(n),i,r,0)}),r}return null}var ka=Gv;function qv(e,t,r){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var id={transitional:Sa,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,o=T.isObject(t);if(o&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return i?JSON.stringify(ka(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return nd(t,this.formSerializer).toString();if((a=T.isFileList(t))||n.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return mn(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||i?(r.setContentType("application/json",!1),qv(t)):t}],transformResponse:[function(t){let r=this.transitional||id.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&T.isString(t)&&(n&&!this.responseType||i)){let s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?ce.from(a,ce.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:je.classes.FormData,Blob:je.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],e=>{id.headers[e]={}});var Ui=id;var Kv=T.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),kg=e=>{let t={},r,n,i;return e&&e.split(`
67
67
  `).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!r||t[r]&&Kv[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};var Eg=Symbol("internals");function Lo(e){return e&&String(e).trim().toLowerCase()}function Ea(e){return e===!1||e==null?e:T.isArray(e)?e.map(Ea):String(e)}function Xv(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}var Jv=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function od(e,t,r,n,i){if(T.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!T.isString(t)){if(T.isString(n))return t.indexOf(n)!==-1;if(T.isRegExp(n))return n.test(t)}}function Yv(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Zv(e,t){let r=T.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,o,s){return this[n].call(this,t,i,o,s)},configurable:!0})})}var Ni=class{constructor(t){t&&this.set(t)}set(t,r,n){let i=this;function o(a,c,l){let h=Lo(c);if(!h)throw new Error("header name must be a non-empty string");let d=T.findKey(i,h);(!d||i[d]===void 0||l===!0||l===void 0&&i[d]!==!1)&&(i[d||c]=Ea(a))}let s=(a,c)=>T.forEach(a,(l,h)=>o(l,h,c));if(T.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(T.isString(t)&&(t=t.trim())&&!Jv(t))s(kg(t),r);else if(T.isHeaders(t))for(let[a,c]of t.entries())o(c,a,n);else t!=null&&o(r,t,n);return this}get(t,r){if(t=Lo(t),t){let n=T.findKey(this,t);if(n){let i=this[n];if(!r)return i;if(r===!0)return Xv(i);if(T.isFunction(r))return r.call(this,i,n);if(T.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Lo(t),t){let n=T.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||od(this,this[n],n,r)))}return!1}delete(t,r){let n=this,i=!1;function o(s){if(s=Lo(s),s){let a=T.findKey(n,s);a&&(!r||od(n,n[a],a,r))&&(delete n[a],i=!0)}}return T.isArray(t)?t.forEach(o):o(t),i}clear(t){let r=Object.keys(this),n=r.length,i=!1;for(;n--;){let o=r[n];(!t||od(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){let r=this,n={};return T.forEach(this,(i,o)=>{let s=T.findKey(n,o);if(s){r[s]=Ea(i),delete r[o];return}let a=t?Yv(o):String(o).trim();a!==o&&delete r[o],r[a]=Ea(i),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return T.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&T.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
68
68
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){let n=(this[Eg]=this[Eg]={accessors:{}}).accessors,i=this.prototype;function o(s){let a=Lo(s);n[a]||(Zv(i,s),n[a]=!0)}return T.isArray(t)?t.forEach(o):o(t),this}};Ni.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);T.reduceDescriptors(Ni.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});T.freezeMethods(Ni);var at=Ni;function Fo(e,t){let r=this||Ui,n=t||r,i=at.from(n.headers),o=n.data;return T.forEach(e,function(a){o=a.call(r,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function Mo(e){return!!(e&&e.__CANCEL__)}function Cg(e,t,r){ce.call(this,e??"canceled",ce.ERR_CANCELED,t,r),this.name="CanceledError"}T.inherits(Cg,ce,{__CANCEL__:!0});var Br=Cg;function Uo(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new ce("Request failed with status code "+r.status,[ce.ERR_BAD_REQUEST,ce.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function sd(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Qv(e,t){e=e||10;let r=new Array(e),n=new Array(e),i=0,o=0,s;return t=t!==void 0?t:1e3,function(c){let l=Date.now(),h=n[o];s||(s=l),r[i]=c,n[i]=l;let d=o,m=0;for(;d!==i;)m+=r[d++],d=d%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),l-s<t)return;let p=h&&l-h;return p?Math.round(m*1e3/p):void 0}}var xg=Qv;function e_(e,t){let r=0,n=1e3/t,i,o,s=(l,h=Date.now())=>{r=h,i=null,o&&(clearTimeout(o),o=null),e.apply(null,l)};return[(...l)=>{let h=Date.now(),d=h-r;d>=n?s(l,h):(i=l,o||(o=setTimeout(()=>{o=null,s(i)},n-d)))},()=>i&&s(i)]}var Ag=e_;var zi=(e,t,r=3)=>{let n=0,i=xg(50,250);return Ag(o=>{let s=o.loaded,a=o.lengthComputable?o.total:void 0,c=s-n,l=i(c),h=s<=a;n=s;let d={loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&h?(a-s)/l:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},r)},ad=(e,t)=>{let r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},cd=e=>(...t)=>T.asap(()=>e(...t));var Tg=je.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,je.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(je.origin),je.navigator&&/(msie|trident)/i.test(je.navigator.userAgent)):()=>!0;var Ig=je.hasStandardBrowserEnv?{write(e,t,r,n,i,o){let s=[e+"="+encodeURIComponent(t)];T.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),T.isString(n)&&s.push("path="+n),T.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){let t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ld(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function hd(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function No(e,t,r){let n=!ld(t);return e&&(n||r==!1)?hd(e,t):t}var Rg=e=>e instanceof at?{...e}:e;function br(e,t){t=t||{};let r={};function n(l,h,d,m){return T.isPlainObject(l)&&T.isPlainObject(h)?T.merge.call({caseless:m},l,h):T.isPlainObject(h)?T.merge({},h):T.isArray(h)?h.slice():h}function i(l,h,d,m){if(T.isUndefined(h)){if(!T.isUndefined(l))return n(void 0,l,d,m)}else return n(l,h,d,m)}function o(l,h){if(!T.isUndefined(h))return n(void 0,h)}function s(l,h){if(T.isUndefined(h)){if(!T.isUndefined(l))return n(void 0,l)}else return n(void 0,h)}function a(l,h,d){if(d in t)return n(l,h);if(d in e)return n(void 0,l)}let c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,h,d)=>i(Rg(l),Rg(h),d,!0)};return T.forEach(Object.keys(Object.assign({},e,t)),function(h){let d=c[h]||i,m=d(e[h],t[h],h);T.isUndefined(m)&&d!==a||(r[h]=m)}),r}var Ca=e=>{let t=br({},e),{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;t.headers=s=at.from(s),t.url=Bo(No(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(T.isFormData(r)){if(je.hasStandardBrowserEnv||je.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){let[l,...h]=c?c.split(";").map(d=>d.trim()).filter(Boolean):[];s.setContentType([l||"multipart/form-data",...h].join("; "))}}if(je.hasStandardBrowserEnv&&(n&&T.isFunction(n)&&(n=n(t)),n||n!==!1&&Tg(t.url))){let l=i&&o&&Ig.read(o);l&&s.set(i,l)}return t};var t_=typeof XMLHttpRequest<"u",Pg=t_&&function(e){return new Promise(function(r,n){let i=Ca(e),o=i.data,s=at.from(i.headers).normalize(),{responseType:a,onUploadProgress:c,onDownloadProgress:l}=i,h,d,m,p,g;function f(){p&&p(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let b=new XMLHttpRequest;b.open(i.method.toUpperCase(),i.url,!0),b.timeout=i.timeout;function v(){if(!b)return;let S=at.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),x={data:!a||a==="text"||a==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:S,config:e,request:b};Uo(function(P){r(P),f()},function(P){n(P),f()},x),b=null}"onloadend"in b?b.onloadend=v:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(v)},b.onabort=function(){b&&(n(new ce("Request aborted",ce.ECONNABORTED,e,b)),b=null)},b.onerror=function(){n(new ce("Network Error",ce.ERR_NETWORK,e,b)),b=null},b.ontimeout=function(){let I=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded",x=i.transitional||Sa;i.timeoutErrorMessage&&(I=i.timeoutErrorMessage),n(new ce(I,x.clarifyTimeoutError?ce.ETIMEDOUT:ce.ECONNABORTED,e,b)),b=null},o===void 0&&s.setContentType(null),"setRequestHeader"in b&&T.forEach(s.toJSON(),function(I,x){b.setRequestHeader(x,I)}),T.isUndefined(i.withCredentials)||(b.withCredentials=!!i.withCredentials),a&&a!=="json"&&(b.responseType=i.responseType),l&&([m,g]=zi(l,!0),b.addEventListener("progress",m)),c&&b.upload&&([d,p]=zi(c),b.upload.addEventListener("progress",d),b.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(h=S=>{b&&(n(!S||S.type?new Br(null,e,b):S),b.abort(),b=null)},i.cancelToken&&i.cancelToken.subscribe(h),i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h)));let k=sd(i.url);if(k&&je.protocols.indexOf(k)===-1){n(new ce("Unsupported protocol "+k+":",ce.ERR_BAD_REQUEST,e));return}b.send(o||null)})};var r_=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i,o=function(l){if(!i){i=!0,a();let h=l instanceof Error?l:this.reason;n.abort(h instanceof ce?h:new Br(h instanceof Error?h.message:h))}},s=t&&setTimeout(()=>{s=null,o(new ce(`timeout ${t} of ms exceeded`,ce.ETIMEDOUT))},t),a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));let{signal:c}=n;return c.unsubscribe=()=>T.asap(a),c}},Dg=r_;var n_=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},i_=async function*(e,t){for await(let r of o_(e))yield*n_(r,t)},o_=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},dd=(e,t,r,n)=>{let i=i_(e,t),o=0,s,a=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{let{done:l,value:h}=await i.next();if(l){a(),c.close();return}let d=h.byteLength;if(r){let m=o+=d;r(m)}c.enqueue(new Uint8Array(h))}catch(l){throw a(l),l}},cancel(c){return a(c),i.return()}},{highWaterMark:2})};var Aa=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Bg=Aa&&typeof ReadableStream=="function",s_=Aa&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Lg=(e,...t)=>{try{return!!e(...t)}catch{return!1}},a_=Bg&&Lg(()=>{let e=!1,t=new Request(je.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Og=64*1024,ud=Bg&&Lg(()=>T.isReadableStream(new Response("").body)),xa={stream:ud&&(e=>e.body)};Aa&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!xa[t]&&(xa[t]=T.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new ce(`Response type '${t}' is not supported`,ce.ERR_NOT_SUPPORT,n)})})})(new Response);var c_=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new Request(je.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(T.isArrayBufferView(e)||T.isArrayBuffer(e))return e.byteLength;if(T.isURLSearchParams(e)&&(e=e+""),T.isString(e))return(await s_(e)).byteLength},l_=async(e,t)=>{let r=T.toFiniteNumber(e.getContentLength());return r??c_(t)},Fg=Aa&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:h,withCredentials:d="same-origin",fetchOptions:m}=Ca(e);l=l?(l+"").toLowerCase():"text";let p=Dg([i,o&&o.toAbortSignal()],s),g,f=p&&p.unsubscribe&&(()=>{p.unsubscribe()}),b;try{if(c&&a_&&r!=="get"&&r!=="head"&&(b=await l_(h,n))!==0){let x=new Request(t,{method:"POST",body:n,duplex:"half"}),O;if(T.isFormData(n)&&(O=x.headers.get("content-type"))&&h.setContentType(O),x.body){let[P,z]=ad(b,zi(cd(c)));n=dd(x.body,Og,P,z)}}T.isString(d)||(d=d?"include":"omit");let v="credentials"in Request.prototype;g=new Request(t,{...m,signal:p,method:r.toUpperCase(),headers:h.normalize().toJSON(),body:n,duplex:"half",credentials:v?d:void 0});let k=await fetch(g),S=ud&&(l==="stream"||l==="response");if(ud&&(a||S&&f)){let x={};["status","statusText","headers"].forEach(Z=>{x[Z]=k[Z]});let O=T.toFiniteNumber(k.headers.get("content-length")),[P,z]=a&&ad(O,zi(cd(a),!0))||[];k=new Response(dd(k.body,Og,P,()=>{z&&z(),f&&f()}),x)}l=l||"text";let I=await xa[T.findKey(xa,l)||"text"](k,e);return!S&&f&&f(),await new Promise((x,O)=>{Uo(x,O,{data:I,headers:at.from(k.headers),status:k.status,statusText:k.statusText,config:e,request:g})})}catch(v){throw f&&f(),v&&v.name==="TypeError"&&/fetch/i.test(v.message)?Object.assign(new ce("Network Error",ce.ERR_NETWORK,e,g),{cause:v.cause||v}):ce.from(v,v&&v.code,e,g)}});var fd={http:_a,xhr:Pg,fetch:Fg};T.forEach(fd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var Mg=e=>`- ${e}`,h_=e=>T.isFunction(e)||e===null||e===!1,Ta={getAdapter:e=>{e=T.isArray(e)?e:[e];let{length:t}=e,r,n,i={};for(let o=0;o<t;o++){r=e[o];let s;if(n=r,!h_(r)&&(n=fd[(s=String(r)).toLowerCase()],n===void 0))throw new ce(`Unknown adapter '${s}'`);if(n)break;i[s||"#"+o]=n}if(!n){let o=Object.entries(i).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build")),s=t?o.length>1?`since :
69
69
  `+o.map(Mg).join(`
70
70
  `):" "+Mg(o[0]):"as no adapter specified";throw new ce("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:fd};function pd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Br(null,e)}function Ia(e){return pd(e),e.headers=at.from(e.headers),e.data=Fo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ta.getAdapter(e.adapter||Ui.adapter)(e).then(function(n){return pd(e),n.data=Fo.call(e,e.transformResponse,n),n.headers=at.from(n.headers),n},function(n){return Mo(n)||(pd(e),n&&n.response&&(n.response.data=Fo.call(e,e.transformResponse,n.response),n.response.headers=at.from(n.response.headers))),Promise.reject(n)})}var Ra="1.8.4";var Pa={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Pa[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var Ug={};Pa.transitional=function(t,r,n){function i(o,s){return"[Axios v"+Ra+"] Transitional option '"+o+"'"+s+(n?". "+n:"")}return(o,s,a)=>{if(t===!1)throw new ce(i(s," has been removed"+(r?" in "+r:"")),ce.ERR_DEPRECATED);return r&&!Ug[s]&&(Ug[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,s,a):!0}};Pa.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function d_(e,t,r){if(typeof e!="object")throw new ce("options must be an object",ce.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),i=n.length;for(;i-- >0;){let o=n[i],s=t[o];if(s){let a=e[o],c=a===void 0||s(a,o,e);if(c!==!0)throw new ce("option "+o+" must be "+c,ce.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ce("Unknown option "+o,ce.ERR_BAD_OPTION)}}var zo={assertOptions:d_,validators:Pa};var Lr=zo.validators,ji=class{constructor(t){this.defaults=t,this.interceptors={request:new Qh,response:new Qh}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;let o=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
71
- `+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=br(this.defaults,r);let{transitional:n,paramsSerializer:i,headers:o}=r;n!==void 0&&zo.assertOptions(n,{silentJSONParsing:Lr.transitional(Lr.boolean),forcedJSONParsing:Lr.transitional(Lr.boolean),clarifyTimeoutError:Lr.transitional(Lr.boolean)},!1),i!=null&&(T.isFunction(i)?r.paramsSerializer={serialize:i}:zo.assertOptions(i,{encode:Lr.function,serialize:Lr.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),zo.assertOptions(r,{baseUrl:Lr.spelling("baseURL"),withXsrfToken:Lr.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=o&&T.merge(o.common,o[r.method]);o&&T.forEach(["delete","get","head","post","put","patch","common"],g=>{delete o[g]}),r.headers=at.concat(s,o);let a=[],c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,a.unshift(f.fulfilled,f.rejected))});let l=[];this.interceptors.response.forEach(function(f){l.push(f.fulfilled,f.rejected)});let h,d=0,m;if(!c){let g=[Ia.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,l),m=g.length,h=Promise.resolve(r);d<m;)h=h.then(g[d++],g[d++]);return h}m=a.length;let p=r;for(d=0;d<m;){let g=a[d++],f=a[d++];try{p=g(p)}catch(b){f.call(this,b);break}}try{h=Ia.call(this,p)}catch(g){return Promise.reject(g)}for(d=0,m=l.length;d<m;)h=h.then(l[d++],l[d++]);return h}getUri(t){t=br(this.defaults,t);let r=No(t.baseURL,t.url,t.allowAbsoluteUrls);return Bo(r,t.params,t.paramsSerializer)}};T.forEach(["delete","get","head","options"],function(t){ji.prototype[t]=function(r,n){return this.request(br(n||{},{method:t,url:r,data:(n||{}).data}))}});T.forEach(["post","put","patch"],function(t){function r(n){return function(o,s,a){return this.request(br(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}ji.prototype[t]=r(),ji.prototype[t+"Form"]=r(!0)});var jo=ji;var md=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});let n=this;this.promise.then(i=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o,s=new Promise(a=>{n.subscribe(a),o=a}).then(i);return s.cancel=function(){n.unsubscribe(o)},s},t(function(o,s,a){n.reason||(n.reason=new Br(o,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new e(function(i){t=i}),cancel:t}}},Ng=md;function gd(e){return function(r){return e.apply(null,r)}}function yd(e){return T.isObject(e)&&e.isAxiosError===!0}var bd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(bd).forEach(([e,t])=>{bd[t]=e});var zg=bd;function jg(e){let t=new jo(e),r=Po(jo.prototype.request,t);return T.extend(r,jo.prototype,t,{allOwnKeys:!0}),T.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return jg(br(e,i))},r}var rt=jg(Ui);rt.Axios=jo;rt.CanceledError=Br;rt.CancelToken=Ng;rt.isCancel=Mo;rt.VERSION=Ra;rt.toFormData=pn;rt.AxiosError=ce;rt.Cancel=rt.CanceledError;rt.all=function(t){return Promise.all(t)};rt.spread=gd;rt.isAxiosError=yd;rt.mergeConfig=br;rt.AxiosHeaders=at;rt.formToJSON=e=>ka(T.isHTMLForm(e)?new FormData(e):e);rt.getAdapter=Ta.getAdapter;rt.HttpStatusCode=zg;rt.default=rt;var vr=rt;var{Axios:S5,AxiosError:k5,CanceledError:E5,isCancel:C5,CancelToken:x5,VERSION:A5,all:T5,Cancel:I5,isAxiosError:R5,spread:P5,toFormData:D5,AxiosHeaders:O5,HttpStatusCode:B5,formToJSON:L5,getAdapter:F5,mergeConfig:M5}=vr;var u_="https://proctoring-api-dev.easyproctor.tech/api",f_="https://proctoring-api-hml.easyproctor.tech/api",Vg="https://proctoring-api.easyproctor.tech/api",nr=class{constructor(t){this.options=t;this.baseUrl=this.selectBaseUrl(t.type),this.token=t.token}selectBaseUrl(t){return t==="dev"?u_:t==="homol"?f_:Vg}getSocketUrl(){return this.baseUrl.replace("/api","/hub/sockethub")}async loginAuth(t,r){return await this.makeRequest({path:"/Auth",method:"POST",body:{emailOrCpf:t,key:r}})}async externalCameraRegister(t){return await this.makeRequest({path:"/ExternalCamera/register",method:"POST",body:t,jwt:this.token})}async externalCameraCheckTransmission(t){return await this.makeRequest({path:`/ExternalCamera/send-action/${t}`,method:"POST",body:{command:"Check_Transmission"},jwt:this.token})}async externalCameraStartTransmission(t,r){return await this.makeRequest({path:`/ExternalCamera/start-transmission/${t}`,method:"POST",body:{proctoringId:r},jwt:this.token})}async externalCameraStartSession(){return await this.makeRequest({path:"/ExternalCamera/start-session",method:"POST",body:{},jwt:this.token})}async goToExternalCameraPositionStep(t){return await this.makeRequest({path:`/ExternalCamera/go-to-position-step/${t}`,method:"POST",body:{},jwt:this.token})}async externalCameraFinish(t){return await this.makeRequest({path:`/ExternalCamera/finish/${t}`,method:"POST",body:{},jwt:this.token})}async confirmStart(t,r,n,i){return await this.makeRequest({path:`/proctoring/start/${t.examId}`,method:"POST",body:{clientId:t.clientId,proctoringType:r.proctoringType,latitude:n,longitude:i,captureScreen:r.captureScreen},jwt:t.token})}async getParamsConfig(t){return(await this.makeRequestAxios({path:"/Client/params",method:"GET",jwt:t.token}).catch(n=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async getSignedUrlImage(t,r){return(await this.makeRequestAxios({path:"/upload/signed-url-batch",method:"POST",jwt:t,body:r})).data}async getSignedUrl(t,r,n){return(await this.makeRequestAxios({path:"/upload/signed-url",method:"POST",jwt:t,body:{objectName:`${n}/${r.name}`,contentType:r.type}})).data}async saveAlerts(t,r){await this.makeRequest({path:"/proctoring/save-alerts",method:"POST",jwt:t.token,body:{proctoringId:r.id,alerts:r.alerts}})}async finishAndSendUrls(t){return await this.makeRequest({path:`/proctoring/finish/${t.examId}`,method:"POST",body:{endDate:new Date().toISOString(),videoCameraUrl:"",audioCameraUrl:"",videoScreenUrl:""},jwt:t.token})}async log(t,r){let n;return r?.success!==null&&r?.success!==void 0?n=r.success?"4":"1":n="4",await this.makeRequest({path:"/Log",method:"POST",body:{entryType:n,eventName:t,message:r},jwt:this.token})}async signTerm(){return await this.makeRequest({path:"/User/sign-terms",method:"PATCH",body:{},jwt:this.token})}async signTermUrl(){return(await this.makeRequestAxios({path:"/User/sign-terms-url",method:"GET",jwt:this.token})).data}async startChallenge(t){return(await this.makeRequestAxios({path:"/Challenge/start",method:"POST",jwt:this.token,body:t})).data}async stopChallenge(t,r){return(await this.makeRequestAxios({path:`/Challenge/stop/${t}`,method:"POST",jwt:this.token,body:r})).data}async startRealtimeAlert(t){return(await this.makeRequestAxios({path:"/Realtime/start-warning",method:"POST",jwt:this.token,body:t})).data}async stopRealtimeAlert(t){return(await this.makeRequestAxios({path:"/Realtime/stop-warning",method:"POST",jwt:this.token,body:t})).data}async verifyFace(t,r,n){return(await this.makeRequestAxios({path:"/Realtime/verify-face",method:"POST",jwt:this.token,body:{proctoringId:t,base64:r,retry:n}})).data}async getServerHour(t){return await this.makeRequest({path:"/Proctoring/server-hour",method:"GET",jwt:t})}async makeRequest(t){let{path:r,method:n,body:i,jwt:o}=t,s=await fetch(this.baseUrl+r,{method:n,body:i!=null?JSON.stringify(i):void 0,headers:{Authorization:`Bearer ${o}`,"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";let a=s.headers.get("content-type");return(a?a.includes("application/json"):!1)?await s.json():null}async makeRequestAxios(t){let{path:r,method:n,body:i,jwt:o}=t,s=await vr.request({url:this.baseUrl+r,method:n,headers:{Authorization:`Bearer ${o}`,"Access-Control-Allow-Origin":"*"},data:i});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";return s}async makeRequestPUT(t){let{url:r,method:n,body:i,jwt:o}=t,s=await fetch(r,{method:n,body:i!=null?JSON.stringify(i):void 0,headers:{Accept:"*/*","Accept-Encoding":"gzip, deflate, br",Connection:"keep-alive","aeg-event-type":"Notification","Content-Type":"application/json","Cache-Control":"no-cache","x-ms-blob-type":"BlockBlob"}});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";let a=s.headers.get("content-type");return(a?a.includes("application/json"):!1)?await s.json():null}};var Da=class{constructor(){this.baseUrl="https://localhost:5080"}async isAlive(){return(await this.makeRequestAxios({path:"/api/usb-device-manager/is-alive",method:"GET",jwt:this.token}).catch(r=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async isPluggedIn(){return(await this.makeRequestAxios({path:"/api/usb-device-manager/is-plugged-in",method:"GET",jwt:this.token}).catch(r=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async ConnectAndScan(){return(await this.makeRequestAxios({path:"/api/usb-device-manager/connect-and-scan",method:"GET",jwt:this.token}).catch(r=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async Devices({deviceType:t,rssiThreshold:r,packageRateThreshold:n}){let i=[];return t&&i.push(`deviceType=${t}`),r&&i.push(`rssiThreshold=${r}`),n&&i.push(`packageRateThreshold=${n}`),(await this.makeRequestAxios({path:`/api/usb-device-manager/devices?${i.join("&")}`,method:"GET",jwt:this.token}).catch(s=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async makeRequestAxios(t){let{path:r,method:n,body:i,jwt:o}=t,s=await vr.request({url:this.baseUrl+r,method:n,headers:{Authorization:`Bearer ${o}`,"Access-Control-Allow-Origin":"*"},data:i});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";return s}};var Hn=class{constructor(){this.sessionDuration=0;this.state="Created",this.startedAt=new Date,this.alerts=[],this.recordings=[]}get hasSomethingToUpload(){for(let t of this.recordings)if(!t.upload)return!0;return!1}start(){this.state="Recording",this.startedAt=new Date(Date.now())}pause(){this.state="Paused"}resume(){this.state="Recording"}stop(){this.state="Ended",this.sessionDuration=Date.now()-this.startedAt.getTime()}setProctoringId(t){this.id=t}setEndConfirmed(){this.state="EndConfirmed"}setUploaded(){this.state="Uploaded"}setUploadConfirmed(){this.state="UploadConfirmed"}addAlert(t){this.alerts.push(t)}addRecording(t){this.recordings.push(t)}};var Vi=class{constructor(t,r){this.backendService=new Da;this.scanInterval=5;this.options={};this.options=r,this.context=t,this.backend=new nr({type:t?.type||"prod",token:t.token}),this.currentIsPlugged=!0}setProctoringId(t){this.proctoringId=t}async isPluggedIn(t=!1){try{let r=await this.backendService.isPluggedIn();if(this.proctoringId&&t)if(r)this.currentIsPlugged||this.options.onRealtimeAlertsCallback?.({type:"spycam",message:"Spycam disconnected",description:"Dispositivo de varredura conectado.",status:"OK"});else{let n=new Hn;n.setProctoringId(this.proctoringId),n.addAlert({begin:Date.now()-this.startTime.getTime(),end:0,alert:33,type:5}),await this.backend.saveAlerts(this.context,n),this.options.onRealtimeAlertsCallback?.({type:"spycam",message:"Spycam disconnected",description:"Nenhum dispositivo de varredura conectado.",status:"ALERT"})}return this.currentIsPlugged=r,this.currentIsPlugged}catch(r){throw r}}async isAlive(){try{return await this.backendService.isAlive()}catch(t){throw t}}connectAndScan(){return this.backendService.ConnectAndScan()}async devices({deviceType:t,rssiThreshold:r,packageRateThreshold:n}){let i=await this.backendService.Devices({deviceType:t,rssiThreshold:r,packageRateThreshold:n});if(i.length>0&&(this.options.onRealtimeAlertsCallback?.({type:"spycam",message:"Spycam detected",description:"Dispositivo espi\xE3o detectado.",data:i}),this.proctoringId)){let o=new Hn;o.setProctoringId(this.proctoringId),o.addAlert({begin:Date.now()-this.startTime.getTime(),end:0,alert:32,type:5}),await this.backend.saveAlerts(this.context,o)}return i}async startCheckSpyCam(t,{deviceType:r,rssiThreshold:n,packageRateThreshold:i}){this.scanInterval=t,this.startTime=new Date(Date.now()),await this.isPluggedIn(!0),this.checkSpyCam=setInterval(async()=>{await this.isPluggedIn(!0)&&await this.devices({deviceType:r,rssiThreshold:n,packageRateThreshold:i})},this.scanInterval*6e4)}stopCheckSpyCam(){clearInterval(this.checkSpyCam)}};var ir={cameraId:void 0,microphoneId:void 0,allowMultipleMonitors:!1,allowOnlyFirstMonitor:!0,captureScreen:!0,noiseLimit:40,proctoringType:"IMAGE",insights:"",onBufferSizeError:!1,useGeolocation:!1,useSpyScan:!1,useExternalCamera:!1,useChallenge:!1,screenRecorderOptions:{width:1280,height:720}};function Oa(e){return e.width&&e.height?{width:e.width,height:e.height,minWidth:e.minWidth,minHeight:e.minHeight}:{width:640,height:480}}var Hg={width:1280,height:720,minWidth:640,minHeight:480};function Wg(){let e=navigator.userAgent,t;return e.match(/chrome|chromium|crios/i)?t="chrome":e.match(/firefox|fxios/i)?t="firefox":e.match(/safari/i)?t="safari":e.match(/opr\//i)?t="opera":e.match(/edg/i)?t="edge":t="No browser detection",t}function mn(){if("userAgentData"in navigator){let e=navigator.userAgentData,t=e.mobile||!1,r=e.platform||"";return t||/Android|iOS/i.test(r)}return/Android|iPhone|iPad|iPod/i.test(navigator.userAgent)}var Ba,$g=e=>(Ba=e,Ba),Pt={DEVICES_CHECKED:"devices_checked",START:"start",FINISH:"finish",ERROR:"error",UPLOAD:"upload",UPLOAD_FILE:"upload_file",DOWNLOAD_VIDEO:"download_video",BUFFER_SIZE:"buffer_size",ANOTHER_STREAM:"another_stream",CHANGE_DEVICE:"change_device",STOP_SHARING_SCREEN:"stop_sharing_screen",ERROR_RECORDER_RTC:"error_recorder_rtc",BROWSER_NOT_SUPPORTED:"browser_not_supported",SAVE_ON_SESSION:"save_on_session"},Dt=(e,t)=>Ba&&Ba.log(e,t),me={registerDevicesChecked:(e,t,r)=>Dt(Pt.DEVICES_CHECKED,{proctoringId:e,success:t,description:r}),registerStart:(e,t,r)=>Dt(Pt.START,{proctoringId:e,success:t,description:r}),registerFinish:(e,t,r)=>Dt(Pt.FINISH,{proctoringId:e,success:t,description:r}),registerError:(e,t)=>Dt(Pt.ERROR,{proctoringId:e,description:t}),registerBrowserNotSupported:(e,t)=>Dt(Pt.BROWSER_NOT_SUPPORTED,{proctoringId:e,description:t}),registerUpload:(e,t,r,n,i)=>Dt(Pt.UPLOAD,{proctoringId:e,success:t,description:r,serviceType:n,uploadTime:i}),registerUploadFile:(e,t,r)=>Dt(Pt.UPLOAD_FILE,{proctoringId:e,description:t,fileType:r}),registerChangeDevice:(e,t,r)=>Dt(Pt.CHANGE_DEVICE,{proctoringId:e,inOrOut:t,description:r}),registerStopSharingScreen:(e,t)=>Dt(Pt.STOP_SHARING_SCREEN,{proctoringId:e,description:t}),registerErrorRecorderRTC:(e,t)=>Dt(Pt.ERROR_RECORDER_RTC,{proctoringId:e,description:t}),registerDownloadFile:(e,t)=>Dt(Pt.DOWNLOAD_VIDEO,{proctoringId:e,description:t}),registerOnBufferSizeError:(e,t)=>Dt(Pt.BUFFER_SIZE,{proctoringId:e,description:t}),registerAnotherStream:(e,t)=>Dt(Pt.ANOTHER_STREAM,{proctoringId:e,description:t}),registerSaveOnSession:(e,t)=>Dt(Pt.SAVE_ON_SESSION,{proctoringId:e,description:t})};var Vo;function La(e){Vo=e}function Wn(e,t,r=!1,n,i=!1){let o,s=!1,a,c,l;l=0;let h={mimeType:"video/webm",videoBitsPerSecond:128e3,audioBitsPerSecond:64*1e3};MediaRecorder.isTypeSupported("video/webm;codecs=vp9")?h.mimeType="video/webm;codecs=vp9":console.warn("vp9 codec not supported. Using default mimeType without vp9."),i&&(h={mimeType:"audio/webm",audioBitsPerSecond:64*1e3});let d=new MediaRecorder(e,h);d.ondataavailable=v=>{l=l+v.data.size,v.data.size>0&&t.push(v.data),s?(i&&d.state=="inactive"&&(t=[new Blob(t,{type:"audio/webm"})]),o&&o()):((c&&v.data.size===c.data.size||v.data.size===0)&&(Vo&&c&&v.data.size===c.data.size&&me.registerOnBufferSizeError(Vo,`onBufferSizeError: Recorder size freezed: ${v.data.size} Mb`),Vo&&v.data.size===0&&me.registerOnBufferSizeError(Vo,"onBufferSizeError: Recorder size equal 0 Mb"),n&&n()),c=v)};function m(){return new Promise(v=>{o=v,d.start(),l=0,s=!1,r&&(a=setInterval(async()=>{await d.requestData()},3e4))})}function p(){return new Promise(v=>{d.state=="recording"?(o=v,d.stop(),s=!0,clearInterval(a),e.getTracks().forEach(k=>{k.stop()})):v()})}function g(){return new Promise(v=>{d.state=="recording"&&d.pause(),v()})}function f(){return new Promise(v=>{d.state=="paused"&&d.resume(),v()})}function b(){return l}return{startRecording:m,stopRecording:p,pauseRecording:g,resumeRecording:f,recorderOptions:h,getBufferSize:b}}var Jr=class{constructor(t,r){this.backend=r;this.imageUrlPackage=[];this.imageBatchNum=0;this.contImages=0;this.proctoringId=t}async uploadPackage(t,r){let{file:n,onProgress:i}=t;try{let o=c=>{let l=c.loadedBytes/n.size*100;i&&i(Math.round(l))},s=await this.backend.getSignedUrl(r,n,this.proctoringId),a=await vr.request({url:s,method:"PUT",headers:{"Content-Type":n.type,"x-ms-blob-type":"BlockBlob"},data:n,onUploadProgress:c=>{o({loadedBytes:c.loaded})}}).then(()=>!0).catch(()=>!1);return{storage:"upload",url:s,uploaded:a}}catch{throw me.registerError(this.proctoringId,`Failed to upload to AWS
71
+ `+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=br(this.defaults,r);let{transitional:n,paramsSerializer:i,headers:o}=r;n!==void 0&&zo.assertOptions(n,{silentJSONParsing:Lr.transitional(Lr.boolean),forcedJSONParsing:Lr.transitional(Lr.boolean),clarifyTimeoutError:Lr.transitional(Lr.boolean)},!1),i!=null&&(T.isFunction(i)?r.paramsSerializer={serialize:i}:zo.assertOptions(i,{encode:Lr.function,serialize:Lr.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),zo.assertOptions(r,{baseUrl:Lr.spelling("baseURL"),withXsrfToken:Lr.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=o&&T.merge(o.common,o[r.method]);o&&T.forEach(["delete","get","head","post","put","patch","common"],g=>{delete o[g]}),r.headers=at.concat(s,o);let a=[],c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,a.unshift(f.fulfilled,f.rejected))});let l=[];this.interceptors.response.forEach(function(f){l.push(f.fulfilled,f.rejected)});let h,d=0,m;if(!c){let g=[Ia.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,l),m=g.length,h=Promise.resolve(r);d<m;)h=h.then(g[d++],g[d++]);return h}m=a.length;let p=r;for(d=0;d<m;){let g=a[d++],f=a[d++];try{p=g(p)}catch(b){f.call(this,b);break}}try{h=Ia.call(this,p)}catch(g){return Promise.reject(g)}for(d=0,m=l.length;d<m;)h=h.then(l[d++],l[d++]);return h}getUri(t){t=br(this.defaults,t);let r=No(t.baseURL,t.url,t.allowAbsoluteUrls);return Bo(r,t.params,t.paramsSerializer)}};T.forEach(["delete","get","head","options"],function(t){ji.prototype[t]=function(r,n){return this.request(br(n||{},{method:t,url:r,data:(n||{}).data}))}});T.forEach(["post","put","patch"],function(t){function r(n){return function(o,s,a){return this.request(br(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}ji.prototype[t]=r(),ji.prototype[t+"Form"]=r(!0)});var jo=ji;var md=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});let n=this;this.promise.then(i=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o,s=new Promise(a=>{n.subscribe(a),o=a}).then(i);return s.cancel=function(){n.unsubscribe(o)},s},t(function(o,s,a){n.reason||(n.reason=new Br(o,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new e(function(i){t=i}),cancel:t}}},Ng=md;function gd(e){return function(r){return e.apply(null,r)}}function yd(e){return T.isObject(e)&&e.isAxiosError===!0}var bd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(bd).forEach(([e,t])=>{bd[t]=e});var zg=bd;function jg(e){let t=new jo(e),r=Po(jo.prototype.request,t);return T.extend(r,jo.prototype,t,{allOwnKeys:!0}),T.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return jg(br(e,i))},r}var rt=jg(Ui);rt.Axios=jo;rt.CanceledError=Br;rt.CancelToken=Ng;rt.isCancel=Mo;rt.VERSION=Ra;rt.toFormData=mn;rt.AxiosError=ce;rt.Cancel=rt.CanceledError;rt.all=function(t){return Promise.all(t)};rt.spread=gd;rt.isAxiosError=yd;rt.mergeConfig=br;rt.AxiosHeaders=at;rt.formToJSON=e=>ka(T.isHTMLForm(e)?new FormData(e):e);rt.getAdapter=Ta.getAdapter;rt.HttpStatusCode=zg;rt.default=rt;var vr=rt;var{Axios:S5,AxiosError:k5,CanceledError:E5,isCancel:C5,CancelToken:x5,VERSION:A5,all:T5,Cancel:I5,isAxiosError:R5,spread:P5,toFormData:D5,AxiosHeaders:O5,HttpStatusCode:B5,formToJSON:L5,getAdapter:F5,mergeConfig:M5}=vr;var u_="https://proctoring-api-dev.easyproctor.tech/api",f_="https://proctoring-api-hml.easyproctor.tech/api",Vg="https://proctoring-api.easyproctor.tech/api",nr=class{constructor(t){this.options=t;this.baseUrl=this.selectBaseUrl(t.type),this.token=t.token}selectBaseUrl(t){return t==="dev"?u_:t==="homol"?f_:Vg}getSocketUrl(){return this.baseUrl.replace("/api","/hub/sockethub")}async loginAuth(t,r){return await this.makeRequest({path:"/Auth",method:"POST",body:{emailOrCpf:t,key:r}})}async externalCameraRegister(t){return await this.makeRequest({path:"/ExternalCamera/register",method:"POST",body:t,jwt:this.token})}async externalCameraCheckTransmission(t){return await this.makeRequest({path:`/ExternalCamera/send-action/${t}`,method:"POST",body:{command:"Check_Transmission"},jwt:this.token})}async externalCameraStartTransmission(t,r){return await this.makeRequest({path:`/ExternalCamera/start-transmission/${t}`,method:"POST",body:{proctoringId:r},jwt:this.token})}async externalCameraStartSession(){return await this.makeRequest({path:"/ExternalCamera/start-session",method:"POST",body:{},jwt:this.token})}async goToExternalCameraPositionStep(t){return await this.makeRequest({path:`/ExternalCamera/go-to-position-step/${t}`,method:"POST",body:{},jwt:this.token})}async externalCameraFinish(t){return await this.makeRequest({path:`/ExternalCamera/finish/${t}`,method:"POST",body:{},jwt:this.token})}async confirmStart(t,r,n,i){return await this.makeRequest({path:`/proctoring/start/${t.examId}`,method:"POST",body:{clientId:t.clientId,proctoringType:r.proctoringType,latitude:n,longitude:i,captureScreen:r.captureScreen},jwt:t.token})}async getParamsConfig(t){return(await this.makeRequestAxios({path:"/Client/params",method:"GET",jwt:t.token}).catch(n=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async getSignedUrlImage(t,r){return(await this.makeRequestAxios({path:"/upload/signed-url-batch",method:"POST",jwt:t,body:r})).data}async getSignedUrl(t,r,n){return(await this.makeRequestAxios({path:"/upload/signed-url",method:"POST",jwt:t,body:{objectName:`${n}/${r.name}`,contentType:r.type}})).data}async saveAlerts(t,r){await this.makeRequest({path:"/proctoring/save-alerts",method:"POST",jwt:t.token,body:{proctoringId:r.id,alerts:r.alerts}})}async finishAndSendUrls(t){return await this.makeRequest({path:`/proctoring/finish/${t.examId}`,method:"POST",body:{endDate:new Date().toISOString(),videoCameraUrl:"",audioCameraUrl:"",videoScreenUrl:""},jwt:t.token})}async log(t,r){let n;return r?.success!==null&&r?.success!==void 0?n=r.success?"4":"1":n="4",await this.makeRequest({path:"/Log",method:"POST",body:{entryType:n,eventName:t,message:r},jwt:this.token})}async signTerm(){return await this.makeRequest({path:"/User/sign-terms",method:"PATCH",body:{},jwt:this.token})}async signTermUrl(){return(await this.makeRequestAxios({path:"/User/sign-terms-url",method:"GET",jwt:this.token})).data}async startChallenge(t){return(await this.makeRequestAxios({path:"/Challenge/start",method:"POST",jwt:this.token,body:t})).data}async stopChallenge(t,r){return(await this.makeRequestAxios({path:`/Challenge/stop/${t}`,method:"POST",jwt:this.token,body:r})).data}async startRealtimeAlert(t){return(await this.makeRequestAxios({path:"/Realtime/start-warning",method:"POST",jwt:this.token,body:t})).data}async stopRealtimeAlert(t){return(await this.makeRequestAxios({path:"/Realtime/stop-warning",method:"POST",jwt:this.token,body:t})).data}async verifyFace(t,r,n){return(await this.makeRequestAxios({path:"/Realtime/verify-face",method:"POST",jwt:this.token,body:{proctoringId:t,base64:r,retry:n}})).data}async getServerHour(t){return await this.makeRequest({path:"/Proctoring/server-hour",method:"GET",jwt:t})}async makeRequest(t){let{path:r,method:n,body:i,jwt:o}=t,s=await fetch(this.baseUrl+r,{method:n,body:i!=null?JSON.stringify(i):void 0,headers:{Authorization:`Bearer ${o}`,"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";let a=s.headers.get("content-type");return(a?a.includes("application/json"):!1)?await s.json():null}async makeRequestAxios(t){let{path:r,method:n,body:i,jwt:o}=t,s=await vr.request({url:this.baseUrl+r,method:n,headers:{Authorization:`Bearer ${o}`,"Access-Control-Allow-Origin":"*"},data:i});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";return s}async makeRequestPUT(t){let{url:r,method:n,body:i,jwt:o}=t,s=await fetch(r,{method:n,body:i!=null?JSON.stringify(i):void 0,headers:{Accept:"*/*","Accept-Encoding":"gzip, deflate, br",Connection:"keep-alive","aeg-event-type":"Notification","Content-Type":"application/json","Cache-Control":"no-cache","x-ms-blob-type":"BlockBlob"}});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";let a=s.headers.get("content-type");return(a?a.includes("application/json"):!1)?await s.json():null}};var Da=class{constructor(){this.baseUrl="https://localhost:5080"}async isAlive(){return(await this.makeRequestAxios({path:"/api/usb-device-manager/is-alive",method:"GET",jwt:this.token}).catch(r=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async isPluggedIn(){return(await this.makeRequestAxios({path:"/api/usb-device-manager/is-plugged-in",method:"GET",jwt:this.token}).catch(r=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async ConnectAndScan(){return(await this.makeRequestAxios({path:"/api/usb-device-manager/connect-and-scan",method:"GET",jwt:this.token}).catch(r=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async Devices({deviceType:t,rssiThreshold:r,packageRateThreshold:n}){let i=[];return t&&i.push(`deviceType=${t}`),r&&i.push(`rssiThreshold=${r}`),n&&i.push(`packageRateThreshold=${n}`),(await this.makeRequestAxios({path:`/api/usb-device-manager/devices?${i.join("&")}`,method:"GET",jwt:this.token}).catch(s=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async makeRequestAxios(t){let{path:r,method:n,body:i,jwt:o}=t,s=await vr.request({url:this.baseUrl+r,method:n,headers:{Authorization:`Bearer ${o}`,"Access-Control-Allow-Origin":"*"},data:i});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";return s}};var Hn=class{constructor(){this.sessionDuration=0;this.state="Created",this.startedAt=new Date,this.alerts=[],this.recordings=[]}get hasSomethingToUpload(){for(let t of this.recordings)if(!t.upload)return!0;return!1}start(){this.state="Recording",this.startedAt=new Date(Date.now())}pause(){this.state="Paused"}resume(){this.state="Recording"}stop(){this.state="Ended",this.sessionDuration=Date.now()-this.startedAt.getTime()}setProctoringId(t){this.id=t}setEndConfirmed(){this.state="EndConfirmed"}setUploaded(){this.state="Uploaded"}setUploadConfirmed(){this.state="UploadConfirmed"}addAlert(t){this.alerts.push(t)}addRecording(t){this.recordings.push(t)}};var Vi=class{constructor(t,r){this.backendService=new Da;this.scanInterval=5;this.options={};this.options=r,this.context=t,this.backend=new nr({type:t?.type||"prod",token:t.token}),this.currentIsPlugged=!0}setProctoringId(t){this.proctoringId=t}async isPluggedIn(t=!1){try{let r=await this.backendService.isPluggedIn();if(this.proctoringId&&t)if(r)this.currentIsPlugged||this.options.onRealtimeAlertsCallback?.({type:"spycam",message:"Spycam disconnected",description:"Dispositivo de varredura conectado.",status:"OK"});else{let n=new Hn;n.setProctoringId(this.proctoringId),n.addAlert({begin:Date.now()-this.startTime.getTime(),end:0,alert:33,type:5}),await this.backend.saveAlerts(this.context,n),this.options.onRealtimeAlertsCallback?.({type:"spycam",message:"Spycam disconnected",description:"Nenhum dispositivo de varredura conectado.",status:"ALERT"})}return this.currentIsPlugged=r,this.currentIsPlugged}catch(r){throw r}}async isAlive(){try{return await this.backendService.isAlive()}catch(t){throw t}}connectAndScan(){return this.backendService.ConnectAndScan()}async devices({deviceType:t,rssiThreshold:r,packageRateThreshold:n}){let i=await this.backendService.Devices({deviceType:t,rssiThreshold:r,packageRateThreshold:n});if(i.length>0&&(this.options.onRealtimeAlertsCallback?.({type:"spycam",message:"Spycam detected",description:"Dispositivo espi\xE3o detectado.",data:i}),this.proctoringId)){let o=new Hn;o.setProctoringId(this.proctoringId),o.addAlert({begin:Date.now()-this.startTime.getTime(),end:0,alert:32,type:5}),await this.backend.saveAlerts(this.context,o)}return i}async startCheckSpyCam(t,{deviceType:r,rssiThreshold:n,packageRateThreshold:i}){this.scanInterval=t,this.startTime=new Date(Date.now()),await this.isPluggedIn(!0),this.checkSpyCam=setInterval(async()=>{await this.isPluggedIn(!0)&&await this.devices({deviceType:r,rssiThreshold:n,packageRateThreshold:i})},this.scanInterval*6e4)}stopCheckSpyCam(){clearInterval(this.checkSpyCam)}};var ir={cameraId:void 0,microphoneId:void 0,allowMultipleMonitors:!1,allowOnlyFirstMonitor:!0,captureScreen:!0,noiseLimit:40,proctoringType:"IMAGE",insights:"",onBufferSizeError:!1,useGeolocation:!1,useSpyScan:!1,useExternalCamera:!1,useChallenge:!1,screenRecorderOptions:{width:1280,height:720}};function Oa(e){return e.width&&e.height?{width:e.width,height:e.height,minWidth:e.minWidth,minHeight:e.minHeight}:{width:640,height:480}}var Hg={width:1280,height:720,minWidth:640,minHeight:480};function Wg(){let e=navigator.userAgent,t;return e.match(/chrome|chromium|crios/i)?t="chrome":e.match(/firefox|fxios/i)?t="firefox":e.match(/safari/i)?t="safari":e.match(/opr\//i)?t="opera":e.match(/edg/i)?t="edge":t="No browser detection",t}function Jr(){if("userAgentData"in navigator){let e=navigator.userAgentData,t=e.mobile||!1,r=e.platform||"";return t||/Android|iOS/i.test(r)}return/Android|iPhone|iPad|iPod/i.test(navigator.userAgent)}var Ba,$g=e=>(Ba=e,Ba),Pt={DEVICES_CHECKED:"devices_checked",START:"start",FINISH:"finish",ERROR:"error",UPLOAD:"upload",UPLOAD_FILE:"upload_file",DOWNLOAD_VIDEO:"download_video",BUFFER_SIZE:"buffer_size",ANOTHER_STREAM:"another_stream",CHANGE_DEVICE:"change_device",STOP_SHARING_SCREEN:"stop_sharing_screen",ERROR_RECORDER_RTC:"error_recorder_rtc",BROWSER_NOT_SUPPORTED:"browser_not_supported",SAVE_ON_SESSION:"save_on_session"},Dt=(e,t)=>Ba&&Ba.log(e,t),me={registerDevicesChecked:(e,t,r)=>Dt(Pt.DEVICES_CHECKED,{proctoringId:e,success:t,description:r}),registerStart:(e,t,r)=>Dt(Pt.START,{proctoringId:e,success:t,description:r}),registerFinish:(e,t,r)=>Dt(Pt.FINISH,{proctoringId:e,success:t,description:r}),registerError:(e,t)=>Dt(Pt.ERROR,{proctoringId:e,description:t}),registerBrowserNotSupported:(e,t)=>Dt(Pt.BROWSER_NOT_SUPPORTED,{proctoringId:e,description:t}),registerUpload:(e,t,r,n,i)=>Dt(Pt.UPLOAD,{proctoringId:e,success:t,description:r,serviceType:n,uploadTime:i}),registerUploadFile:(e,t,r)=>Dt(Pt.UPLOAD_FILE,{proctoringId:e,description:t,fileType:r}),registerChangeDevice:(e,t,r)=>Dt(Pt.CHANGE_DEVICE,{proctoringId:e,inOrOut:t,description:r}),registerStopSharingScreen:(e,t)=>Dt(Pt.STOP_SHARING_SCREEN,{proctoringId:e,description:t}),registerErrorRecorderRTC:(e,t)=>Dt(Pt.ERROR_RECORDER_RTC,{proctoringId:e,description:t}),registerDownloadFile:(e,t)=>Dt(Pt.DOWNLOAD_VIDEO,{proctoringId:e,description:t}),registerOnBufferSizeError:(e,t)=>Dt(Pt.BUFFER_SIZE,{proctoringId:e,description:t}),registerAnotherStream:(e,t)=>Dt(Pt.ANOTHER_STREAM,{proctoringId:e,description:t}),registerSaveOnSession:(e,t)=>Dt(Pt.SAVE_ON_SESSION,{proctoringId:e,description:t})};var Vo;function La(e){Vo=e}function Wn(e,t,r=!1,n,i=!1){let o,s=!1,a,c,l;l=0;let h={mimeType:"video/webm",videoBitsPerSecond:128e3,audioBitsPerSecond:64*1e3};MediaRecorder.isTypeSupported("video/webm;codecs=vp9")?h.mimeType="video/webm;codecs=vp9":console.warn("vp9 codec not supported. Using default mimeType without vp9."),i&&(h={mimeType:"audio/webm",audioBitsPerSecond:64*1e3});let d=new MediaRecorder(e,h);d.ondataavailable=v=>{l=l+v.data.size,v.data.size>0&&t.push(v.data),s?(i&&d.state=="inactive"&&(t=[new Blob(t,{type:"audio/webm"})]),o&&o()):((c&&v.data.size===c.data.size||v.data.size===0)&&(Vo&&c&&v.data.size===c.data.size&&me.registerOnBufferSizeError(Vo,`onBufferSizeError: Recorder size freezed: ${v.data.size} Mb`),Vo&&v.data.size===0&&me.registerOnBufferSizeError(Vo,"onBufferSizeError: Recorder size equal 0 Mb"),n&&n()),c=v)};function m(){return new Promise(v=>{o=v,d.start(),l=0,s=!1,r&&(a=setInterval(async()=>{await d.requestData()},3e4))})}function p(){return new Promise(v=>{d.state=="recording"?(o=v,d.stop(),s=!0,clearInterval(a),e.getTracks().forEach(k=>{k.stop()})):v()})}function g(){return new Promise(v=>{d.state=="recording"&&d.pause(),v()})}function f(){return new Promise(v=>{d.state=="paused"&&d.resume(),v()})}function b(){return l}return{startRecording:m,stopRecording:p,pauseRecording:g,resumeRecording:f,recorderOptions:h,getBufferSize:b}}var Yr=class{constructor(t,r){this.backend=r;this.imageUrlPackage=[];this.imageBatchNum=0;this.contImages=0;this.proctoringId=t}async uploadPackage(t,r){let{file:n,onProgress:i}=t;try{let o=c=>{let l=c.loadedBytes/n.size*100;i&&i(Math.round(l))},s=await this.backend.getSignedUrl(r,n,this.proctoringId),a=await vr.request({url:s,method:"PUT",headers:{"Content-Type":n.type,"x-ms-blob-type":"BlockBlob"},data:n,onUploadProgress:c=>{o({loadedBytes:c.loaded})}}).then(()=>!0).catch(()=>!1);return{storage:"upload",url:s,uploaded:a}}catch{throw me.registerError(this.proctoringId,`Failed to upload to AWS
72
72
  File name: ${n.name}
73
73
  File type: ${n.type}
74
74
  File size: ${n.size}`),new Error("Failed to upload to AWS")}}async uploadImages(t,r,n){let{file:i,onProgress:o}=t;try{let s=l=>{let h=l.loadedBytes/i.size*100;o&&o(Math.round(h))},a;if(this.imageBatchNum===this.contImages){let l=[];for(let d=this.imageBatchNum;d<this.imageBatchNum+60;d++){let m=`${this.proctoringId}/${this.proctoringId}_${d+1}.jpg`;(d+1)%n==0&&(m=`${this.proctoringId}/${this.proctoringId}_${d+1}_realtime.jpg`),l.push({objectName:m,contentType:"image/jpeg"})}(await this.backend.getSignedUrlImage(r,l)).map(d=>{this.imageUrlPackage.push(d)}),this.imageBatchNum+=60}let c=!1;return c=await vr.request({url:this.imageUrlPackage[this.contImages],method:"PUT",headers:{"Content-Type":i.type,"x-ms-blob-type":"BlockBlob"},data:i,onUploadProgress:l=>{s({loadedBytes:l.loaded})}}).then(l=>l.status==200||l.status==201?(this.contImages++,!0):!1).catch(()=>!1).finally(()=>{}),{storage:"upload",url:a,uploaded:c}}catch{throw me.registerError(this.proctoringId,`Failed to upload to AWS
@@ -77,14 +77,14 @@ Minimum version required to store current data is: `+o+`.
77
77
  File size: ${i.size}`),new Error("Failed to upload to AWS")}}async upload(t,r,n){let{file:i,onProgress:o}=t;try{let s=l=>{let h=l.loadedBytes/i.size*100;o&&o(Math.round(h))},a;if(n){if(this.imageBatchNum===this.contImages){let l=[];for(let d=this.imageBatchNum;d<this.imageBatchNum+20;d++)l.push({objectName:`${this.proctoringId}/${this.proctoringId}_${d+1}.jpg`,contentType:"image/jpeg"});(await this.backend.getSignedUrlImage(r,l)).map(d=>{this.imageUrlPackage.push(d)}),this.imageBatchNum+=20}}else a=await this.backend.getSignedUrl(r,i,this.proctoringId);let c=!1;return n?c=await vr.request({url:this.imageUrlPackage[this.contImages],method:"PUT",headers:{"Content-Type":i.type,"x-ms-blob-type":"BlockBlob"},data:i,onUploadProgress:l=>{s({loadedBytes:l.loaded})}}).then(()=>!0).catch(()=>!1).finally(()=>{this.contImages++}):c=await vr.request({url:a,method:"PUT",headers:{"Content-Type":i.type,"x-ms-blob-type":"BlockBlob"},data:i,onUploadProgress:l=>{s({loadedBytes:l.loaded})}}).then(()=>!0).catch(()=>!1),{storage:"upload",url:a,uploaded:c}}catch{throw me.registerError(this.proctoringId,`Failed to upload to AWS
78
78
  File name: ${i.name}
79
79
  File type: ${i.type}
80
- File size: ${i.size}`),new Error("Failed to upload to AWS")}}};var Gg="not_shared_first_screen",qg="not_shared_screen",Fa="multiple_monitors_detected",Kg="proctoring_already_started",Ma="proctoring_not_started";var Xg="another_stream_active",Jg="stream_under_minimum_permitted",Yg="browser_not_supported",Zg="token_missing",Qg="credentials_missing";var e0="spy_scan_api_not_found";var t0="external_camera_not_started";var Ua=class extends Bi{constructor(t,r,n="videoPreviewFrameDetection",i="liveViewFrameDetection"){super("ObjectDetector","https://storage.googleapis.com/mediapipe-models/object_detector/efficientdet_lite0/float16/1/efficientdet_lite0.tflite",t,r,n,i)}stopDetection(){super.stopDetection(),this.numPersonsSent>0&&this.handleOk("person_ok","person_detection_on_stream")}displayVideoDetections(t){for(let r of this.children)this.liveView.removeChild(r);this.children.splice(0);for(let r of t.detections){let n=window.innerWidth,i=window.innerHeight,o=this.video.offsetWidth,s=this.video.offsetHeight,a=o/n,c=s/i,l=o-r.boundingBox.width*a-r.boundingBox.originX*a,h=r.boundingBox.originY*c,d=(r.boundingBox.width-10)*a,m=r.boundingBox.height*c,p=document.createElement("p");p.innerText=r.categories[0].categoryName+" - with "+Math.round(parseFloat(r.categories[0].score)*100)+"% confidence.",p.style.right=l-20+"px",p.style.top=h+"px",p.style.width=d+"px";let g={zIndex:"2",position:"absolute",border:"1px dashed #fff"};Object.assign(p.style,{...g,margin:"0",fontSize:"9px",paddingBottom:"5px",paddingTop:"5px",color:"#fff",backgroundColor:"#007f8b"});let f=document.createElement("div");f.setAttribute("class","highlighter"),f.style.right=l-20+"px",f.style.top=h+"px",f.style.width=d+"px",f.style.height=m-20+"px",Object.assign(f.style,{...g,zIndex:"1",background:"rgba(0, 255, 0, 0.25)"}),this.liveView.appendChild(f),this.liveView.appendChild(p),this.children.push(f),this.children.push(p)}}verify(t){let r=t.detections.filter(i=>i.categories.some(o=>o.categoryName==="person")).length,n=t.detections.filter(i=>i.categories.some(o=>o.categoryName==="cell phone")).length;this.paramsConfig.videoBehaviourParameters?.detectPerson&&r!==this.numPersonsSent&&(r===0?(this.handleAlert("no_person_detected","person_detection_on_stream"),this.numPersonsSent=r):r>1?(this.handleAlert("multiple_persons_detected","person_detection_on_stream"),this.numPersonsSent=r):(this.handleOk("person_ok","person_detection_on_stream"),this.numPersonsSent=r)),this.paramsConfig.videoBehaviourParameters?.detectCellPhone&&n!==this.numCellphoneSent&&(n>0?(this.handleAlert("cellphone_detected","mobile_detection_on_stream"),this.numCellphoneSent=n):(this.handleOk("cellphone_ok","mobile_detection_on_stream"),this.numCellphoneSent=n))}};var gn=class{constructor(t){this.volume=null;this.animationFrameId=null;this.stream=t}async start(t={}){return new Promise((r,n)=>{try{let i=new AudioContext;this.analyser=i.createAnalyser();let o=i.createMediaStreamSource(this.stream);this.analyser.smoothingTimeConstant=.8,this.analyser.fftSize=1024,o.connect(this.analyser);let s=()=>{let a=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(a);let l=a.reduce((h,d)=>h+d,0)/a.length;this.setVolume(l),t.setVolume&&t.setVolume(l),this.animationFrameId=requestAnimationFrame(s)};this.animationFrameId=requestAnimationFrame(s),r(!0)}catch(i){this.stop(),n(`Error: ${i}`)}})}stop(){this.animationFrameId!==null&&cancelAnimationFrame(this.animationFrameId)}getVolume(){return this.volume}setVolume(t){this.volume=t}};var o0=dl(n0()),Yr=class{constructor(t,r,n,i,o){this.blobs=[];this.paramsConfig={audioBehaviourParameters:{recordingBitrate:128,noiseLimit:40},imageBehaviourParameters:{useUploadImage:!0,uploadInterval:20,saveVideo:!0},videoBehaviourParameters:{detectPerson:!1,detectFace:!1,detectCellPhone:!1}};this.options={cameraId:void 0,microphoneId:void 0,onBufferSizeError:!1,onBufferSizeErrorCallback:t=>{},proctoringType:"IMAGE",onChangeDevicesCallback:t=>{},onRealtimeAlertsCallback:t=>{}};this.videoOptions={width:640,height:480,minWidth:0,minHeight:0};this.blobsRTC=[];this.imageCount=0;this.filesToUpload=[];this.animationFrameId=null;this.isCanvasLoopActive=!1;this.hardwareStream=null;this.internalClonedStream=null;this.currentRetries=0;this.packageCount=0;this.noiseWait=20;this.options=t,this.videoOptions=r,this.backend=i,this.backendToken=o,n&&(this.paramsConfig=n)}setProctoringId(t){this.proctoringId=t,this.proctoringId&&this.backend&&(this.upload=new Jr(this.proctoringId,this.backend)),La(t)}async initializeDetectors(){ig(),(this.paramsConfig.videoBehaviourParameters?.detectPerson||this.paramsConfig.videoBehaviourParameters?.detectCellPhone)&&(this.objectDetection=new Ua({onRealtimeAlertsCallback:t=>this.options.onRealtimeAlertsCallback(t)},this.paramsConfig),await this.objectDetection.initializeDetector()),this.paramsConfig.videoBehaviourParameters?.detectFace&&(this.faceDetection=new Li({onRealtimeAlertsCallback:t=>this.options.onRealtimeAlertsCallback(t)},this.paramsConfig),await this.faceDetection.initializeDetector())}configImageCapture(){this.video=document.createElement("video"),this.canvas=document.createElement("canvas"),this.video.srcObject=this.cameraStream,this.video.play(),this.video.muted=!0,this.canvas.width=this.videoOptions.width,this.canvas.height=this.videoOptions.height}async bufferError(t){console.log("buffer error Camera Recorder params "+this.paramsConfig.videoBehaviourParameters);let r=this.paramsConfig.videoBehaviourParameters?.retryEnabled||!1,n=this.paramsConfig.videoBehaviourParameters?.maxRetries||3;r&&this.currentRetries<n?(await this.recordingStop(),await this.startRecording({retry:!0}),this.currentRetries++,this.options.onBufferSizeErrorCallback&&this.options.onBufferSizeErrorCallback(this.cameraStream)):this.options.onBufferSizeErrorCallback&&this.options.onBufferSizeErrorCallback()}async startRecording(t){(this.paramsConfig.videoBehaviourParameters?.detectPerson||this.paramsConfig.videoBehaviourParameters?.detectCellPhone||this.paramsConfig.videoBehaviourParameters?.detectFace)&&!t?.retry&&await this.initializeDetectors();let{cameraId:r,microphoneId:n,onBufferSizeErrorCallback:i}=this.options,o={audio:{deviceId:n},video:{deviceId:r,width:this.videoOptions.width,height:this.videoOptions.height,frameRate:15}};try{this.hardwareStream=await navigator.mediaDevices.getUserMedia(o)}catch(v){throw v.toString()=="NotReadableError: Could not start video source"?"N\xE3o foi poss\xEDvel conectar a camera, ela pode estar sendo utilizada por outro programa":v}this.cameraStream=this.hardwareStream;let a=this.cameraStream.getVideoTracks()[0].getSettings(),{width:c=0,height:l=0}=a,{startRecording:h,stopRecording:d,pauseRecording:m,resumeRecording:p,recorderOptions:g,getBufferSize:f}=Wn(this.cameraStream,this.blobs,this.options.onBufferSizeError,v=>this.bufferError(v),!1);if(this.recordingStart=h,this.recordingStop=d,this.recordingPause=m,this.recordingResume=p,this.recorderOptions=g,this.getBufferSize=f,this.recordingStart(),screen.orientation?.type.includes("portrait")&&mn()&&this.videoOptions.width==l&&this.videoOptions.height==c&&([c,l]=[l,c]),this.videoOptions.minWidth>c||this.videoOptions.minHeight>l)throw Jg;if(this.videoOptions.width!==c||this.videoOptions.height!==l)throw me.registerAnotherStream(this.proctoringId,`Maybe have another stream active
80
+ File size: ${i.size}`),new Error("Failed to upload to AWS")}}};var Gg="not_shared_first_screen",qg="not_shared_screen",Fa="multiple_monitors_detected",Kg="proctoring_already_started",Ma="proctoring_not_started";var Xg="another_stream_active",Jg="stream_under_minimum_permitted",Yg="browser_not_supported",Zg="token_missing",Qg="credentials_missing";var e0="spy_scan_api_not_found";var t0="external_camera_not_started";var Ua=class extends Bi{constructor(t,r,n="videoPreviewFrameDetection",i="liveViewFrameDetection"){super("ObjectDetector","https://storage.googleapis.com/mediapipe-models/object_detector/efficientdet_lite0/float16/1/efficientdet_lite0.tflite",t,r,n,i)}stopDetection(){super.stopDetection(),this.numPersonsSent>0&&this.handleOk("person_ok","person_detection_on_stream")}displayVideoDetections(t){for(let r of this.children)this.liveView.removeChild(r);this.children.splice(0);for(let r of t.detections){let n=window.innerWidth,i=window.innerHeight,o=this.video.offsetWidth,s=this.video.offsetHeight,a=o/n,c=s/i,l=o-r.boundingBox.width*a-r.boundingBox.originX*a,h=r.boundingBox.originY*c,d=(r.boundingBox.width-10)*a,m=r.boundingBox.height*c,p=document.createElement("p");p.innerText=r.categories[0].categoryName+" - with "+Math.round(parseFloat(r.categories[0].score)*100)+"% confidence.",p.style.right=l-20+"px",p.style.top=h+"px",p.style.width=d+"px";let g={zIndex:"2",position:"absolute",border:"1px dashed #fff"};Object.assign(p.style,{...g,margin:"0",fontSize:"9px",paddingBottom:"5px",paddingTop:"5px",color:"#fff",backgroundColor:"#007f8b"});let f=document.createElement("div");f.setAttribute("class","highlighter"),f.style.right=l-20+"px",f.style.top=h+"px",f.style.width=d+"px",f.style.height=m-20+"px",Object.assign(f.style,{...g,zIndex:"1",background:"rgba(0, 255, 0, 0.25)"}),this.liveView.appendChild(f),this.liveView.appendChild(p),this.children.push(f),this.children.push(p)}}verify(t){let r=t.detections.filter(i=>i.categories.some(o=>o.categoryName==="person")).length,n=t.detections.filter(i=>i.categories.some(o=>o.categoryName==="cell phone")).length;this.paramsConfig.videoBehaviourParameters?.detectPerson&&r!==this.numPersonsSent&&(r===0?(this.handleAlert("no_person_detected","person_detection_on_stream"),this.numPersonsSent=r):r>1?(this.handleAlert("multiple_persons_detected","person_detection_on_stream"),this.numPersonsSent=r):(this.handleOk("person_ok","person_detection_on_stream"),this.numPersonsSent=r)),this.paramsConfig.videoBehaviourParameters?.detectCellPhone&&n!==this.numCellphoneSent&&(n>0?(this.handleAlert("cellphone_detected","mobile_detection_on_stream"),this.numCellphoneSent=n):(this.handleOk("cellphone_ok","mobile_detection_on_stream"),this.numCellphoneSent=n))}};var gn=class{constructor(t){this.volume=null;this.animationFrameId=null;this.stream=t}async start(t={}){return new Promise((r,n)=>{try{let i=new AudioContext;this.analyser=i.createAnalyser();let o=i.createMediaStreamSource(this.stream);this.analyser.smoothingTimeConstant=.8,this.analyser.fftSize=1024,o.connect(this.analyser);let s=()=>{let a=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(a);let l=a.reduce((h,d)=>h+d,0)/a.length;this.setVolume(l),t.setVolume&&t.setVolume(l),this.animationFrameId=requestAnimationFrame(s)};this.animationFrameId=requestAnimationFrame(s),r(!0)}catch(i){this.stop(),n(`Error: ${i}`)}})}stop(){this.animationFrameId!==null&&cancelAnimationFrame(this.animationFrameId)}getVolume(){return this.volume}setVolume(t){this.volume=t}};var o0=dl(n0()),Zr=class{constructor(t,r,n,i,o){this.blobs=[];this.paramsConfig={audioBehaviourParameters:{recordingBitrate:128,noiseLimit:40},imageBehaviourParameters:{useUploadImage:!0,uploadInterval:20,saveVideo:!0},videoBehaviourParameters:{detectPerson:!1,detectFace:!1,detectCellPhone:!1}};this.options={cameraId:void 0,microphoneId:void 0,onBufferSizeError:!1,onBufferSizeErrorCallback:t=>{},proctoringType:"IMAGE",onChangeDevicesCallback:t=>{},onRealtimeAlertsCallback:t=>{}};this.videoOptions={width:640,height:480,minWidth:0,minHeight:0};this.blobsRTC=[];this.imageCount=0;this.filesToUpload=[];this.animationFrameId=null;this.isCanvasLoopActive=!1;this.hardwareStream=null;this.internalClonedStream=null;this.currentRetries=0;this.packageCount=0;this.noiseWait=20;this.options=t,this.videoOptions=r,this.backend=i,this.backendToken=o,n&&(this.paramsConfig=n)}setProctoringId(t){this.proctoringId=t,this.proctoringId&&this.backend&&(this.upload=new Yr(this.proctoringId,this.backend)),La(t)}async initializeDetectors(){ig(),(this.paramsConfig.videoBehaviourParameters?.detectPerson||this.paramsConfig.videoBehaviourParameters?.detectCellPhone)&&(this.objectDetection=new Ua({onRealtimeAlertsCallback:t=>this.options.onRealtimeAlertsCallback(t)},this.paramsConfig),await this.objectDetection.initializeDetector()),this.paramsConfig.videoBehaviourParameters?.detectFace&&(this.faceDetection=new Li({onRealtimeAlertsCallback:t=>this.options.onRealtimeAlertsCallback(t)},this.paramsConfig),await this.faceDetection.initializeDetector())}configImageCapture(){this.video=document.createElement("video"),this.canvas=document.createElement("canvas"),this.video.srcObject=this.cameraStream,this.video.play(),this.video.muted=!0,screen.orientation?.type.includes("portrait")&&Jr()?(console.log("configurando canvas em portrait"),this.canvas.width=this.videoOptions.height/2,this.canvas.height=this.videoOptions.width/2):(this.canvas.width=this.videoOptions.width/2,this.canvas.height=this.videoOptions.height/2)}async bufferError(t){console.log("buffer error Camera Recorder params "+this.paramsConfig.videoBehaviourParameters);let r=this.paramsConfig.videoBehaviourParameters?.retryEnabled||!1,n=this.paramsConfig.videoBehaviourParameters?.maxRetries||3;r&&this.currentRetries<n?(await this.recordingStop(),await this.startRecording({retry:!0}),this.currentRetries++,this.options.onBufferSizeErrorCallback&&this.options.onBufferSizeErrorCallback(this.cameraStream)):this.options.onBufferSizeErrorCallback&&this.options.onBufferSizeErrorCallback()}async startRecording(t){(this.paramsConfig.videoBehaviourParameters?.detectPerson||this.paramsConfig.videoBehaviourParameters?.detectCellPhone||this.paramsConfig.videoBehaviourParameters?.detectFace)&&!t?.retry&&await this.initializeDetectors();let{cameraId:r,microphoneId:n,onBufferSizeErrorCallback:i}=this.options,o={audio:{deviceId:n},video:{deviceId:r,width:this.videoOptions.width,height:this.videoOptions.height,frameRate:15}};try{this.hardwareStream=await navigator.mediaDevices.getUserMedia(o)}catch(v){throw v.toString()=="NotReadableError: Could not start video source"?"N\xE3o foi poss\xEDvel conectar a camera, ela pode estar sendo utilizada por outro programa":v}this.cameraStream=this.hardwareStream;let a=this.cameraStream.getVideoTracks()[0].getSettings(),{width:c=0,height:l=0}=a,{startRecording:h,stopRecording:d,pauseRecording:m,resumeRecording:p,recorderOptions:g,getBufferSize:f}=Wn(this.cameraStream,this.blobs,this.options.onBufferSizeError,v=>this.bufferError(v),!1);if(this.recordingStart=h,this.recordingStop=d,this.recordingPause=m,this.recordingResume=p,this.recorderOptions=g,this.getBufferSize=f,this.recordingStart(),screen.orientation?.type.includes("portrait")&&Jr()&&this.videoOptions.width==l&&this.videoOptions.height==c&&([c,l]=[l,c]),this.videoOptions.minWidth>c||this.videoOptions.minHeight>l)throw Jg;if(this.videoOptions.width!==c||this.videoOptions.height!==l)throw me.registerAnotherStream(this.proctoringId,`Maybe have another stream active
81
81
  Video Options: ${JSON.stringify(this.videoOptions,null,2)}
82
- Setting: ${JSON.stringify(a,null,2)}`),Xg;this.paramsConfig.imageBehaviourParameters?.useUploadImage&&this.options.proctoringType=="IMAGE"&&this.photoShotsCycle(),this.paramsConfig.videoBehaviourParameters?.detectFace&&await this.faceDetection.enableCam(this.cameraStream),(this.paramsConfig.videoBehaviourParameters?.detectPerson||this.paramsConfig.videoBehaviourParameters?.detectCellPhone)&&await this.objectDetection.enableCam(this.cameraStream),this.filesToUpload=[],this.options.proctoringType=="REALTIME"&&this.captureFrame(),this.packageCount=0}async stopRecording(){this.isCanvasLoopActive=!1,this.recordingStop&&await this.recordingStop();try{this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.cameraStream&&this.cameraStream.getTracks().forEach(t=>t.stop()),this.internalClonedStream&&(this.internalClonedStream.getTracks().forEach(t=>t.stop()),this.internalClonedStream=null),this.hardwareStream&&(this.hardwareStream.getTracks().forEach(t=>t.stop()),this.hardwareStream=null)}catch{console.error("Erro ao parar os streams de m\xEDdia.")}this.faceDetection&&this.faceDetection.detecting&&this.faceDetection.stopDetection(),this.objectDetection&&this.objectDetection.detecting&&this.objectDetection.stopDetection(),clearInterval(this.imageInterval),clearInterval(this.sendFrameInterval),this.options.proctoringType=="REALTIME"&&this.upload&&this.backendToken&&(await this.sendPackage(this.filesToUpload),await this.filesToUpload.splice(0,this.filesToUpload.length)),this.volumeMeter&&this.volumeMeter.stop(),this.intervalNoiseDetection&&clearInterval(this.intervalNoiseDetection)}async pauseRecording(){await this.recordingPause()}async resumeRecording(){await this.recordingResume()}photoShotsCycle(){let t;this.configImageCapture(),this.imageInterval=setInterval(async()=>{this.canvas.getContext("2d").drawImage(this.video,0,0,this.videoOptions.width,this.videoOptions.height);let r=this.canvas.toDataURL("image/jpeg");t=await this.getFile(r,`${this.proctoringId}_${this.imageCount+1}.jpg`,"image/jpeg"),t&&this.upload&&this.backendToken&&(this.upload.upload({file:t},this.backendToken,!0),this.imageCount++)},this.paramsConfig.imageBehaviourParameters.uploadInterval*1e3)}async getCurrentImageBase64(){return!this.video||!this.canvas?this.configImageCapture():this.video.srcObject!==this.cameraStream&&(this.video.srcObject=this.cameraStream,await this.video.play()),this.video.paused&&await this.video.play(),await new Promise(t=>{if(this.video.readyState>=2){t();return}let r=()=>{this.video.removeEventListener("loadedmetadata",r),setTimeout(()=>t(),50)};this.video.addEventListener("loadedmetadata",r),setTimeout(()=>{this.video.removeEventListener("loadedmetadata",r),t()},500)}),this.canvas.getContext("2d").drawImage(this.video,0,0,this.canvas.width,this.canvas.height),this.canvas.toDataURL("image/jpeg")}captureFrame(){let t;this.configImageCapture();let r=this.videoOptions.width/2,n=this.videoOptions.height/2;r<320&&(r=320),n<180&&(n=180),this.canvas.width=r,this.canvas.height=n;let i=this.paramsConfig.videoBehaviourParameters?.realtimePackageSize;this.imageCount=0,this.imageInterval=setInterval(async()=>{console.log("capturando frame "+this.imageCount),this.canvas.getContext("2d").drawImage(this.video,0,0,this.canvas.width,this.canvas.height);let o=this.canvas.toDataURL("image/jpeg");if(this.proctoringId==null)return;if(i==this.imageCount){this.imageCount=0;let a=[...this.filesToUpload];this.sendPackage(a),await this.filesToUpload.splice(0,this.filesToUpload.length)}let s=`${this.proctoringId}_${this.imageCount+1}.jpg`;t=await this.getFile(o,s,"image/jpeg"),t&&t.size>10&&i>0&&(this.filesToUpload.push(t),this.imageCount++)},this.paramsConfig.videoBehaviourParameters?.realtimeCaptureInterval*1e3)}async sendPackage(t){let r=!1,n=0,i=this.paramsConfig.videoBehaviourParameters?.realtimePackageSize,o=this.paramsConfig.videoBehaviourParameters?.realtimeCaptureInterval+1;if(this.upload&&this.backendToken&&!r&&this.filesToUpload.length>0){n=0,r=!0;let s=new o0.default;for(let d of t)s.file(d.name,d);let a=await s.generateAsync({type:"blob"}),c="realtime_package_"+i*o*this.packageCount+".zip",l=new File([a],c,{type:"application/zip"});(await this.upload.uploadPackage({file:l},this.backendToken)).uploaded==!0?this.packageCount++:console.log("erro no upload do pacote"),r=!1}else if(r&&(n++,n==3)){n=0;let s=this.videoOptions.width/2,a=this.videoOptions.height/2;s<320&&(s=320),a<180&&(a=180),this.canvas.width=s,this.canvas.height=a}}download(t){let r=URL.createObjectURL(t),n=document.createElement("a");document.body.appendChild(n),n.style.display="none",n.href=r,n.download=t.name,n.click(),window.URL.revokeObjectURL(r)}async saveOnSession(t){this.blobs!=null&&me.registerSaveOnSession(this.proctoringId,`Blobs Length: ${this.blobs.length} Buffer Size: ${this.getBufferSize()} `);let r=this.cameraStream.getVideoTracks()[0].getSettings(),n=this.cameraStream.getAudioTracks()[0].getSettings();(this.options.proctoringType=="VIDEO"||this.options.proctoringType=="REALTIME"||this.options.proctoringType=="IMAGE"&&this.paramsConfig.imageBehaviourParameters?.saveVideo)&&t.addRecording({device:`Audio
82
+ Setting: ${JSON.stringify(a,null,2)}`),Xg;this.paramsConfig.imageBehaviourParameters?.useUploadImage&&this.options.proctoringType=="IMAGE"&&this.photoShotsCycle(),this.paramsConfig.videoBehaviourParameters?.detectFace&&await this.faceDetection.enableCam(this.cameraStream),(this.paramsConfig.videoBehaviourParameters?.detectPerson||this.paramsConfig.videoBehaviourParameters?.detectCellPhone)&&await this.objectDetection.enableCam(this.cameraStream),this.filesToUpload=[],this.options.proctoringType=="REALTIME"&&this.captureFrame(),this.packageCount=0}async stopRecording(){this.isCanvasLoopActive=!1,this.recordingStop&&await this.recordingStop();try{this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.cameraStream&&this.cameraStream.getTracks().forEach(t=>t.stop()),this.internalClonedStream&&(this.internalClonedStream.getTracks().forEach(t=>t.stop()),this.internalClonedStream=null),this.hardwareStream&&(this.hardwareStream.getTracks().forEach(t=>t.stop()),this.hardwareStream=null)}catch{console.error("Erro ao parar os streams de m\xEDdia.")}this.faceDetection&&this.faceDetection.detecting&&this.faceDetection.stopDetection(),this.objectDetection&&this.objectDetection.detecting&&this.objectDetection.stopDetection(),clearInterval(this.imageInterval),clearInterval(this.sendFrameInterval),this.options.proctoringType=="REALTIME"&&this.upload&&this.backendToken&&(await this.sendPackage(this.filesToUpload),await this.filesToUpload.splice(0,this.filesToUpload.length)),this.volumeMeter&&this.volumeMeter.stop(),this.intervalNoiseDetection&&clearInterval(this.intervalNoiseDetection)}async pauseRecording(){await this.recordingPause()}async resumeRecording(){await this.recordingResume()}photoShotsCycle(){let t;this.configImageCapture(),this.imageInterval=setInterval(async()=>{this.canvas.getContext("2d").drawImage(this.video,0,0,this.videoOptions.width,this.videoOptions.height);let r=this.canvas.toDataURL("image/jpeg");t=await this.getFile(r,`${this.proctoringId}_${this.imageCount+1}.jpg`,"image/jpeg"),t&&this.upload&&this.backendToken&&(this.upload.upload({file:t},this.backendToken,!0),this.imageCount++)},this.paramsConfig.imageBehaviourParameters.uploadInterval*1e3)}async getCurrentImageBase64(){return!this.video||!this.canvas?this.configImageCapture():this.video.srcObject!==this.cameraStream&&(this.video.srcObject=this.cameraStream,await this.video.play()),this.video.paused&&await this.video.play(),await new Promise(t=>{if(this.video.readyState>=2){t();return}let r=()=>{this.video.removeEventListener("loadedmetadata",r),setTimeout(()=>t(),50)};this.video.addEventListener("loadedmetadata",r),setTimeout(()=>{this.video.removeEventListener("loadedmetadata",r),t()},500)}),this.canvas.getContext("2d").drawImage(this.video,0,0,this.canvas.width,this.canvas.height),this.canvas.toDataURL("image/jpeg")}captureFrame(){let t;this.configImageCapture();let r=this.paramsConfig.videoBehaviourParameters?.realtimePackageSize;this.imageCount=0,this.imageInterval=setInterval(async()=>{this.canvas.getContext("2d").drawImage(this.video,0,0,this.canvas.width,this.canvas.height);let n=this.canvas.toDataURL("image/jpeg");if(this.proctoringId==null)return;if(r==this.imageCount){this.imageCount=0;let o=[...this.filesToUpload];this.sendPackage(o),await this.filesToUpload.splice(0,this.filesToUpload.length)}let i=`${this.proctoringId}_${this.imageCount+1}.jpg`;t=await this.getFile(n,i,"image/jpeg"),t&&t.size>10&&r>0&&(this.filesToUpload.push(t),this.imageCount++)},this.paramsConfig.videoBehaviourParameters?.realtimeCaptureInterval*1e3)}async sendPackage(t){let r=!1,n=0,i=this.paramsConfig.videoBehaviourParameters?.realtimePackageSize,o=this.paramsConfig.videoBehaviourParameters?.realtimeCaptureInterval+1;if(this.upload&&this.backendToken&&!r&&this.filesToUpload.length>0){n=0,r=!0;let s=new o0.default;for(let d of t)s.file(d.name,d);let a=await s.generateAsync({type:"blob"}),c="realtime_package_"+i*o*this.packageCount+".zip",l=new File([a],c,{type:"application/zip"});(await this.upload.uploadPackage({file:l},this.backendToken)).uploaded==!0?this.packageCount++:console.log("erro no upload do pacote"),r=!1}else if(r&&(n++,n==3)){n=0;let s=this.videoOptions.width/2,a=this.videoOptions.height/2;s<320&&(s=320),a<180&&(a=180),this.canvas.width=s,this.canvas.height=a}}download(t){let r=URL.createObjectURL(t),n=document.createElement("a");document.body.appendChild(n),n.style.display="none",n.href=r,n.download=t.name,n.click(),window.URL.revokeObjectURL(r)}async saveOnSession(t){this.blobs!=null&&me.registerSaveOnSession(this.proctoringId,`Blobs Length: ${this.blobs.length} Buffer Size: ${this.getBufferSize()} `);let r=this.cameraStream.getVideoTracks()[0].getSettings(),n=this.cameraStream.getAudioTracks()[0].getSettings();(this.options.proctoringType=="VIDEO"||this.options.proctoringType=="REALTIME"||this.options.proctoringType=="IMAGE"&&this.paramsConfig.imageBehaviourParameters?.saveVideo)&&t.addRecording({device:`Audio
83
83
  Sample Rate: ${n.sampleRate}
84
84
  Sample Size: ${n.sampleSize}
85
85
 
86
86
  Video:
87
- ${JSON.stringify(this.recorderOptions)}`,file:new File(this.blobs,`EP_${t.id}_camera_0.webm`,{type:this.recorderOptions?.mimeType||"video/webm"}),origin:"Camera"})}async getFile(t,r,n){return new Promise((i,o)=>{t.length>5&&fetch(t).then(s=>s.blob()).then(s=>{let a=new File([s],r,{type:n});i(a)}).catch(s=>{o(s)})})}onNoiseDetected(){if(this.options.proctoringType==="REALTIME")return;!this.volumeMeter&&this.cameraStream&&(this.volumeMeter=new gn(this.cameraStream),this.volumeMeter.start().catch(r=>{console.log(r),this.volumeMeter=void 0})),(this.volumeMeter?.getVolume()??0)>=(this.paramsConfig.audioBehaviourParameters?.noiseLimit||40)&&(console.log("entrou"+this.noiseWait),this.noiseWait>=20&&(this.options.onRealtimeAlertsCallback({status:"ALERT",description:"Barulho detectado",type:"audio_detection_on_stream"}),this.noiseWait=0)),this.noiseWait++}createRotatedStream(t){this.internalClonedStream=t.clone();let r=document.createElement("video");r.srcObject=this.internalClonedStream,r.muted=!0,r.play();let n=document.createElement("canvas"),i=n.getContext("2d"),s=t.getVideoTracks()[0].getSettings(),a=s.width||640,c=s.height||480;n.width=c,n.height=a;let l=()=>{r.paused||r.ended||this.isCanvasLoopActive&&(i&&(i.clearRect(0,0,n.width,n.height),i.drawImage(r,0,0,n.width,n.height)),this.isCanvasLoopActive&&(this.animationFrameId=requestAnimationFrame(l)))};r.onplaying=()=>{this.isCanvasLoopActive=!0,l()};let h=n.captureStream(30);return t.getAudioTracks().forEach(d=>{h.addTrack(d)}),h}};var Na=class{constructor(t=ir,r){this.videoOptions={width:1080,height:720,minWidth:0,minHeight:0};this.options={...ir,...t,captureScreen:!1,allowMultipleMonitors:!0,allowOnlyFirstMonitor:!1},this.videoOptions={...this.videoOptions,...r}}checkDevicesInterface(){this.addStyleMask();let t=document.createElement("style");t.type="text/css",t.innerHTML=`
87
+ ${JSON.stringify(this.recorderOptions)}`,file:new File(this.blobs,`EP_${t.id}_camera_0.webm`,{type:this.recorderOptions?.mimeType||"video/webm"}),origin:"Camera"})}async getFile(t,r,n){return new Promise((i,o)=>{t.length>5&&fetch(t).then(s=>s.blob()).then(s=>{let a=new File([s],r,{type:n});i(a)}).catch(s=>{o(s)})})}onNoiseDetected(){if(this.options.proctoringType==="REALTIME")return;!this.volumeMeter&&this.cameraStream&&(this.volumeMeter=new gn(this.cameraStream),this.volumeMeter.start().catch(r=>{console.log(r),this.volumeMeter=void 0})),(this.volumeMeter?.getVolume()??0)>=(this.paramsConfig.audioBehaviourParameters?.noiseLimit||40)&&(console.log("entrou"+this.noiseWait),this.noiseWait>=20&&(this.options.onRealtimeAlertsCallback({status:"ALERT",description:"Barulho detectado",type:"audio_detection_on_stream"}),this.noiseWait=0)),this.noiseWait++}};var Na=class{constructor(t=ir,r){this.videoOptions={width:1080,height:720,minWidth:0,minHeight:0};this.options={...ir,...t,captureScreen:!1,allowMultipleMonitors:!0,allowOnlyFirstMonitor:!1},this.videoOptions={...this.videoOptions,...r}}checkDevicesInterface(){this.addStyleMask();let t=document.createElement("style");t.type="text/css",t.innerHTML=`
88
88
  .alert-div {
89
89
  display: flex;
90
90
  align-items: center;
@@ -394,7 +394,7 @@ Para iniciar um exame utilize uma outra c\xE2mera.`),o.setAttribute("class","che
394
394
  // -webkit-mask-position: center;
395
395
  // -webkit-mask-repeat: no-repeat;
396
396
  }
397
- `,r=document.createElement("style");r.innerHTML=t,document.head.appendChild(r)}applyStyles(t,r){for(let[n,i]of Object.entries(r))t.style[n]=i}};var za=class e{constructor(t){this.deviceCheckResult=null;this.videoOptions={width:1080,height:720,minWidth:0,minHeight:0};this.volumeMedia=0;this.volumeSum=0;this.volumeCounter=0;this.microphoneMinThreshold=5;this.allowedResolution=!0;this.allowedAmbient=!0;this.allowedPositionFace=!0;this.allowedMicrophone=!1;this.allowedSpyScan=null;this.noiseLimit=0;this.faceDetection=new Li({onRealtimeAlertsCallback:r=>this.realtimeAlerts(r)},{videoBehaviourParameters:{detectFace:!0}},"cameraStream","liveCheckDevices"),this.context=t,this.backend=new nr({type:t?.type||"prod",token:t.token})}static{this.isModalOpen=!1}getDeviceCheckResult(){return this.deviceCheckResult}async runCheckDevicesFlow(t,r,n,i,o){if(e.isModalOpen)return Promise.reject("Modal j\xE1 est\xE1 aberto");this.options={...ir,...t,captureScreen:!1,allowMultipleMonitors:!0,allowOnlyFirstMonitor:!1},e.isModalOpen=!0;try{await this.faceDetection.initializeDetector();let{cameraStream:s}=await this.startCheckDevices(t,r);this.checkSpyScan();let a={cameraStream:this.cameraRecorder.cameraStream};this.onUpdateCb=l=>o(l);let c=new Promise((l,h)=>{n(()=>{this.closeCheckDevices(),l({result:!0,cameraId:t.cameraId||"default",microphoneId:t.microphoneId||"default",volumeRange:this.volumeMedia,allowedResolution:this.allowedResolution,allowedPositionFace:this.allowedPositionFace,allowedAmbient:this.allowedAmbient,allowedMicrophone:this.allowedMicrophone,allowedSpyScan:this.allowedSpyScan,faceDetectionAlerts:this.faceDetectionAlerts}),e.isModalOpen=!1}),i(()=>{this.closeCheckDevices(),l({result:!1}),e.isModalOpen=!1})});return this.deviceCheckResult={...a,result:c},{...a,result:c}}catch(s){throw this.closeCheckDevices(),e.isModalOpen=!1,s}}onUpdateCallback(){typeof this.onUpdateCb=="function"&&this.onUpdateCb({allowedResolution:this.allowedResolution,allowedPositionFace:this.allowedPositionFace,allowedAmbient:this.allowedAmbient,allowedMicrophone:this.allowedMicrophone,allowedSpyScan:this.allowedSpyScan,faceDetectionAlerts:this.faceDetectionAlerts})}async checkDevices(t=ir,r=Hg){if(e.isModalOpen)return Promise.reject();e.isModalOpen=!0,this.DeviceCheckerUI=new Na(t,r);try{this.options={...ir,...t,captureScreen:!1,allowMultipleMonitors:!0,allowOnlyFirstMonitor:!1},this.videoOptions={...this.videoOptions,...r};let n=await this.backend.getParamsConfig(this.context);this.noiseLimit=n.audioBehaviourParameters?.noiseLimit||40,await this.faceDetection.initializeDetector(),this.DeviceCheckerUI.checkDevicesInterface(),this.startCheckDevices(t,r),await this.checkSpyScan();let{cameraId:i,microphoneId:o,result:s}=await this.DeviceCheckerUI.modalActions(()=>this.closeCheckDevices());return new Promise(a=>{let c={result:s,cameraId:i,microphoneId:o,volumeRange:this.volumeMedia,allowedResolution:this.allowedResolution,allowedPositionFace:this.allowedPositionFace,allowedAmbient:this.allowedAmbient,allowedMicrophone:this.allowedMicrophone,allowedSpyScan:this.allowedSpyScan,faceDetectionAlerts:this.faceDetectionAlerts};this.deviceCheckResult=c,a(c)})}catch(n){return this.closeCheckDevices(),this.DeviceCheckerUI.closeModal(),Promise.reject(n)}}isUnderResolution(){let t=this.cameraRecorder.cameraStream.getVideoTracks()[0].getSettings(),{width:r=0,height:n=0}=t;screen.orientation?.type.includes("portrait")&&mn()&&this.videoOptions.width==n&&this.videoOptions.height==r&&([r,n]=[n,r]),this.videoOptions.minWidth>r||this.videoOptions.minHeight>n?this.allowedResolution=!1:this.allowedResolution=!0,this.onUpdateCallback(),this.DeviceCheckerUI&&this.DeviceCheckerUI.isUnderResolutionUI(this.allowedResolution)}realtimeAlerts(t){this.faceDetectionAlerts=t,t.status==="OK"?(this.allowedPositionFace=!0,this.allowedAmbient=!0):(this.allowedPositionFace=!1,this.allowedAmbient=!1),this.onUpdateCallback(),this.DeviceCheckerUI&&this.DeviceCheckerUI.realtimeAlertsUI(t)}videoDeviceInterface(t){this.DeviceCheckerUI&&this.DeviceCheckerUI.videoDeviceInterfaceUI(t),this.isUnderResolution(),this.faceDetection.enableCam(t)}audioDeviceInterface(t){this.volumeMeter=new gn(this.cameraRecorder.cameraStream),this.volumeMeter.start({setVolume:r=>{this.volumeCounter++,this.volumeSum+=r,!this.allowedMicrophone&&r>this.microphoneMinThreshold?(this.allowedMicrophone=!0,this.onUpdateCallback(),this.DeviceCheckerUI&&this.DeviceCheckerUI.audioDeviceInterfaceUIMicrophoneWorks(!0)):this.allowedMicrophone||this.DeviceCheckerUI&&this.DeviceCheckerUI.audioDeviceInterfaceUIMicrophoneWorks(!1),this.DeviceCheckerUI&&this.DeviceCheckerUI.audioDeviceInterfaceUIPills(r),r>this.noiseLimit?(this.allowedAmbient=!1,this.onUpdateCallback(),this.DeviceCheckerUI&&this.DeviceCheckerUI.audioDeviceInterfaceUIAllowedAmbient(!1)):(this.allowedAmbient=!0,this.onUpdateCallback(),this.DeviceCheckerUI&&this.DeviceCheckerUI.audioDeviceInterfaceUIAllowedAmbient(!0))}}).catch(r=>{console.log(r),this.volumeMeter=void 0,this.DeviceCheckerUI&&this.DeviceCheckerUI.audioDeviceInterfaceUIErrorExec()})}async changeSelectedDevice({cameraId:t,microphoneId:r}){return this.cameraRecorder.stopRecording&&await this.cameraRecorder.stopRecording(),this.volumeMeter?.stop(),this.faceDetection.stopDetection(),this.cameraRecorder=new Yr({cameraId:t,microphoneId:r,onBufferSizeError:!1,onBufferSizeErrorCallback:()=>{}},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream),{cameraStream:this.cameraRecorder.cameraStream}}async startCheckDevices(t=ir,r){if(this.DeviceCheckerUI&&this.DeviceCheckerUI.setSelectOption(t,n=>this.changeSelectedDevice(n)),this.videoOptions=Oa(r),await vs(),this.cameraRecorder=new Yr({cameraId:t.cameraId,microphoneId:t.microphoneId,onBufferSizeError:!1,onBufferSizeErrorCallback:()=>{}},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream),this.DeviceCheckerUI){let n=document.querySelector("#confirmBtn");!this.options.useSpyScan&&(n.disabled=!1)}return{cameraStream:this.cameraRecorder.cameraStream}}async closeCheckDevices(){e.isModalOpen=!1,this.faceDetection.stopDetection(),this.volumeMeter?.stop(),this.volumeMedia=Math.ceil(this.volumeSum/this.volumeCounter),this.cameraRecorder.stopRecording&&await this.cameraRecorder.stopRecording(),this.DeviceCheckerUI=void 0,this.onUpdateCb=void 0}async checkSpyScan(){if(this.spycam=new Vi(this.context,{}),this.allowedSpyScan=null,this.options.useSpyScan){this.DeviceCheckerUI&&this.DeviceCheckerUI.waitingSpyDevices(!0);try{await this.spycam.isPluggedIn()?await this.spycam.devices({deviceType:3}).then(r=>{r?.length>0?this.allowedSpyScan=!1:this.allowedSpyScan=!0}).finally(()=>{this.DeviceCheckerUI&&this.DeviceCheckerUI.waitingSpyDevices(!1),this.DeviceCheckerUI&&this.allowedSpyScan!=null&&this.DeviceCheckerUI.isSpyDevicesUI(this.allowedSpyScan)}):(this.allowedSpyScan=!1,this.DeviceCheckerUI&&this.DeviceCheckerUI.waitingSpyDevices(!1),this.DeviceCheckerUI&&this.DeviceCheckerUI.isSpyDevicesUI(this.allowedSpyScan))}catch(t){this.allowedSpyScan=!1,this.DeviceCheckerUI&&this.DeviceCheckerUI.waitingSpyDevices(!1),this.DeviceCheckerUI&&this.DeviceCheckerUI.isSpyDevicesUI(this.allowedSpyScan),console.log(t)}}}};var Hi=class{constructor(){}async takePicture(t,r,n={width:1080,height:720}){return this.resolution=n,await this.takePictureInterface(t,r)}async startCapture(t="default"){let r=document.querySelector("#cameraStream"),n={audio:!1,video:{facingMode:"user",aspectRatio:1.777777778,width:{min:640,ideal:640,max:1920},height:{min:400,ideal:480},deviceId:t}};this.cameraRecorder=new Yr({cameraId:t,onBufferSizeErrorCallback:()=>{}},{...this.resolution}),await this.cameraRecorder.startRecording(),r.srcObject=this.cameraRecorder.cameraStream,r.play()}shot(){let t=document.querySelector("#cameraStream"),r=document.querySelector("#canvas"),n=document.querySelector("#image");r.width=t.videoWidth,r.height=t.videoHeight,r.getContext("2d").drawImage(t,0,0,t.videoWidth,t.videoHeight),n.src=r.toDataURL("image/jpg"),this.base64=r.toDataURL("image/jpg")}takePictureInterface(t,r){return new Promise((n,i)=>{let o=document.createElement("div");o.setAttribute("id","authPhoto"),o.style.backgroundColor="rgba(0,0,0,0.4)",o.style.zIndex="1000",o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.height="100vh",o.style.width="100%",o.style.display="flex",o.style.alignItems="center",o.style.justifyContent="center";let s=document.createElement("div");s.style.backgroundColor="#fff",s.style.zIndex="1001",s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.height="100vh",s.style.width="100%",s.style.borderRadius="10px",s.style.display="flex",s.style.flexDirection="column",s.style.alignItems="center",s.style.boxSizing="border-box";let a=document.createElement("h3");a.innerText=t||"Biometria Facial",a.style.color="rgba(0, 0, 0, .7)",a.style.fontWeight="bold",a.style.fontSize="20px",a.style.marginTop="0px",a.style.marginBottom="15px",a.style.padding="20px 0px 0px",a.style.width="100%",a.style.textAlign="center",a.style.position="fixed",a.style.top="0",a.style.left="0",a.style.zIndex="1010",s.appendChild(a);let c=document.createElement("p");c.innerText=r||"Encaixe seu rosto no formato e clique no bot\xE3o abaixo",c.style.color="rgba(0, 0, 0, .7)",c.style.fontWeight="normal",c.style.fontSize="16px",c.style.marginBottom="15px",c.style.padding="0px 0px 20px",c.style.width="100%",c.style.textAlign="center",c.style.position="fixed",c.style.top="55px",c.style.left="0",c.style.zIndex="1011",s.appendChild(c);let l=document.createElement("div"),h=document.createElement("h3"),d=document.createElement("select");d.setAttribute("id","cameraSelect"),l.style.padding="0 20px",l.style.width="100%",l.style.display="flex",l.style.justifyContent="space-between",l.style.marginBottom="15px",h.innerText="C\xE2mera",h.style.color="rgba(0, 0, 0, .75)",h.style.fontWeight="bold",h.style.fontSize="16px",l.appendChild(h),l.appendChild(d);let m=document.createElement("div"),p=document.createElement("video");p.setAttribute("id","cameraStream"),p.muted=!0,m.style.position="fixed",m.style.top="0",m.style.left="0",m.style.height="100vh",m.style.width="100%",m.style.display="flex",m.style.justifyContent="center",p.style.backgroundColor="#000",p.style.borderRadius="10px",p.style.width="auto",p.style.height="auto",p.style.minHeight="100%",m.appendChild(p);let g=document.createElement("canvas");g.setAttribute("id","canvas"),g.style.display="none",g.style.width="100%",g.style.height="100%";let f=document.createElement("img");f.setAttribute("id","image"),f.style.objectFit="contain",f.style.display="none",f.style.borderRadius="8px",m.appendChild(g),m.appendChild(f);let b=document.createElement("div");b.setAttribute("class","facial-biometry__mask"),b.style.width="100%",b.style.height="100%",b.style.position="absolute",b.style.top="0px",b.style.left="0px",b.style.backgroundColor="#fff",b.style.opacity="0.8";let v=document.createElement("div");v.setAttribute("class","biometry__frame"),v.style.width="100%",v.style.height="100%",v.style.position="absolute",v.style.top="0px",v.style.left="0px",v.style.zIndex="10",m.appendChild(b),m.appendChild(v),s.appendChild(m),this.addStyleMask();let k=document.createElement("button"),S=document.createElement("div");k.setAttribute("id","confirmBtn"),S.style.position="fixed",S.style.bottom="0",S.style.left="0",S.style.width="100%",S.style.display="flex",S.style.alignItems="center",S.style.justifyContent="center",k.style.background="url('https://iarisprod.blob.core.windows.net/imagens/camera.svg') no-repeat center",k.style.width="70px",k.style.height="70px",k.style.borderRadius="70px",k.style.border="none",k.style.backgroundColor="#16a34a",k.style.margin="20px";let I=document.createElement("button");I.setAttribute("id","closeModal"),I.style.background="url('https://iarisprod.blob.core.windows.net/imagens/close.svg') no-repeat center",I.style.width="70px",I.style.height="70px",I.style.borderRadius="70px",I.style.border="none",I.style.backgroundColor="#e74141",I.style.margin="20px",S.appendChild(I),S.appendChild(k),s.appendChild(S);let x=document.createElement("button");x.style.background="url('https://easyproctor-public.s3.us-east-2.amazonaws.com/images/retry.svg') no-repeat center",x.style.width="70px",x.style.height="70px",x.style.borderRadius="70px",x.style.border="none",x.style.backgroundColor="#e74141",x.style.margin="20px 20px";let O=document.createElement("button");O.style.background="url('https://iarisprod.blob.core.windows.net/imagens/check.svg') no-repeat center",O.style.width="70px",O.style.height="70px",O.style.borderRadius="70px",O.style.border="none",O.style.backgroundColor="#16a34a",O.style.margin="20px 20px",o.appendChild(s),document.body.appendChild(o),this.setSelectOption(),this.startCapture(),k.addEventListener("click",()=>{S.removeChild(k),S.removeChild(I),S.appendChild(x),S.appendChild(O),this.shot(),p.style.display="none",f.style.display="block"}),x.addEventListener("click",()=>{S.appendChild(I),S.appendChild(k),S.removeChild(x),S.removeChild(O),p.style.display="block",f.style.display="none"}),O.addEventListener("click",()=>{this.closeInterface(),n({base64:this.base64})}),I.addEventListener("click",()=>{this.closeInterface(),i(new Error("User does not captured photo"))})})}async setSelectOption(){let t=document.querySelector("#cameraSelect"),r=await ur();t&&(t.value="default");let n=(i,o)=>{let s=document.createElement("option");return s.setAttribute("value",o),s.innerHTML=i,s};r.cameras.forEach(i=>{let o=n(i.label,i.id);t?.appendChild(o)}),this.onSelectOptionChange()}async onSelectOptionChange(){let t=document.querySelector("#cameraSelect");t?.addEventListener("change",async()=>{this.startCapture(t?.value)})}async closeInterface(){await this.cameraRecorder.stopRecording(),document.querySelector("#authPhoto")?.remove()}async addStyleMask(){let t=`
397
+ `,r=document.createElement("style");r.innerHTML=t,document.head.appendChild(r)}applyStyles(t,r){for(let[n,i]of Object.entries(r))t.style[n]=i}};var za=class e{constructor(t){this.deviceCheckResult=null;this.videoOptions={width:1080,height:720,minWidth:0,minHeight:0};this.volumeMedia=0;this.volumeSum=0;this.volumeCounter=0;this.microphoneMinThreshold=5;this.allowedResolution=!0;this.allowedAmbient=!0;this.allowedPositionFace=!0;this.allowedMicrophone=!1;this.allowedSpyScan=null;this.noiseLimit=0;this.faceDetection=new Li({onRealtimeAlertsCallback:r=>this.realtimeAlerts(r)},{videoBehaviourParameters:{detectFace:!0}},"cameraStream","liveCheckDevices"),this.context=t,this.backend=new nr({type:t?.type||"prod",token:t.token})}static{this.isModalOpen=!1}getDeviceCheckResult(){return this.deviceCheckResult}async runCheckDevicesFlow(t,r,n,i,o){if(e.isModalOpen)return Promise.reject("Modal j\xE1 est\xE1 aberto");this.options={...ir,...t,captureScreen:!1,allowMultipleMonitors:!0,allowOnlyFirstMonitor:!1},e.isModalOpen=!0;try{await this.faceDetection.initializeDetector();let{cameraStream:s}=await this.startCheckDevices(t,r);this.checkSpyScan();let a={cameraStream:this.cameraRecorder.cameraStream};this.onUpdateCb=l=>o(l);let c=new Promise((l,h)=>{n(()=>{this.closeCheckDevices(),l({result:!0,cameraId:t.cameraId||"default",microphoneId:t.microphoneId||"default",volumeRange:this.volumeMedia,allowedResolution:this.allowedResolution,allowedPositionFace:this.allowedPositionFace,allowedAmbient:this.allowedAmbient,allowedMicrophone:this.allowedMicrophone,allowedSpyScan:this.allowedSpyScan,faceDetectionAlerts:this.faceDetectionAlerts}),e.isModalOpen=!1}),i(()=>{this.closeCheckDevices(),l({result:!1}),e.isModalOpen=!1})});return this.deviceCheckResult={...a,result:c},{...a,result:c}}catch(s){throw this.closeCheckDevices(),e.isModalOpen=!1,s}}onUpdateCallback(){typeof this.onUpdateCb=="function"&&this.onUpdateCb({allowedResolution:this.allowedResolution,allowedPositionFace:this.allowedPositionFace,allowedAmbient:this.allowedAmbient,allowedMicrophone:this.allowedMicrophone,allowedSpyScan:this.allowedSpyScan,faceDetectionAlerts:this.faceDetectionAlerts})}async checkDevices(t=ir,r=Hg){if(e.isModalOpen)return Promise.reject();e.isModalOpen=!0,this.DeviceCheckerUI=new Na(t,r);try{this.options={...ir,...t,captureScreen:!1,allowMultipleMonitors:!0,allowOnlyFirstMonitor:!1},this.videoOptions={...this.videoOptions,...r};let n=await this.backend.getParamsConfig(this.context);this.noiseLimit=n.audioBehaviourParameters?.noiseLimit||40,await this.faceDetection.initializeDetector(),this.DeviceCheckerUI.checkDevicesInterface(),this.startCheckDevices(t,r),await this.checkSpyScan();let{cameraId:i,microphoneId:o,result:s}=await this.DeviceCheckerUI.modalActions(()=>this.closeCheckDevices());return new Promise(a=>{let c={result:s,cameraId:i,microphoneId:o,volumeRange:this.volumeMedia,allowedResolution:this.allowedResolution,allowedPositionFace:this.allowedPositionFace,allowedAmbient:this.allowedAmbient,allowedMicrophone:this.allowedMicrophone,allowedSpyScan:this.allowedSpyScan,faceDetectionAlerts:this.faceDetectionAlerts};this.deviceCheckResult=c,a(c)})}catch(n){return this.closeCheckDevices(),this.DeviceCheckerUI.closeModal(),Promise.reject(n)}}isUnderResolution(){let t=this.cameraRecorder.cameraStream.getVideoTracks()[0].getSettings(),{width:r=0,height:n=0}=t;screen.orientation?.type.includes("portrait")&&Jr()&&this.videoOptions.width==n&&this.videoOptions.height==r&&([r,n]=[n,r]),this.videoOptions.minWidth>r||this.videoOptions.minHeight>n?this.allowedResolution=!1:this.allowedResolution=!0,this.onUpdateCallback(),this.DeviceCheckerUI&&this.DeviceCheckerUI.isUnderResolutionUI(this.allowedResolution)}realtimeAlerts(t){this.faceDetectionAlerts=t,t.status==="OK"?(this.allowedPositionFace=!0,this.allowedAmbient=!0):(this.allowedPositionFace=!1,this.allowedAmbient=!1),this.onUpdateCallback(),this.DeviceCheckerUI&&this.DeviceCheckerUI.realtimeAlertsUI(t)}videoDeviceInterface(t){this.DeviceCheckerUI&&this.DeviceCheckerUI.videoDeviceInterfaceUI(t),this.isUnderResolution(),this.faceDetection.enableCam(t)}audioDeviceInterface(t){this.volumeMeter=new gn(this.cameraRecorder.cameraStream),this.volumeMeter.start({setVolume:r=>{this.volumeCounter++,this.volumeSum+=r,!this.allowedMicrophone&&r>this.microphoneMinThreshold?(this.allowedMicrophone=!0,this.onUpdateCallback(),this.DeviceCheckerUI&&this.DeviceCheckerUI.audioDeviceInterfaceUIMicrophoneWorks(!0)):this.allowedMicrophone||this.DeviceCheckerUI&&this.DeviceCheckerUI.audioDeviceInterfaceUIMicrophoneWorks(!1),this.DeviceCheckerUI&&this.DeviceCheckerUI.audioDeviceInterfaceUIPills(r),r>this.noiseLimit?(this.allowedAmbient=!1,this.onUpdateCallback(),this.DeviceCheckerUI&&this.DeviceCheckerUI.audioDeviceInterfaceUIAllowedAmbient(!1)):(this.allowedAmbient=!0,this.onUpdateCallback(),this.DeviceCheckerUI&&this.DeviceCheckerUI.audioDeviceInterfaceUIAllowedAmbient(!0))}}).catch(r=>{console.log(r),this.volumeMeter=void 0,this.DeviceCheckerUI&&this.DeviceCheckerUI.audioDeviceInterfaceUIErrorExec()})}async changeSelectedDevice({cameraId:t,microphoneId:r}){return this.cameraRecorder.stopRecording&&await this.cameraRecorder.stopRecording(),this.volumeMeter?.stop(),this.faceDetection.stopDetection(),this.cameraRecorder=new Zr({cameraId:t,microphoneId:r,onBufferSizeError:!1,onBufferSizeErrorCallback:()=>{}},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream),{cameraStream:this.cameraRecorder.cameraStream}}async startCheckDevices(t=ir,r){if(this.DeviceCheckerUI&&this.DeviceCheckerUI.setSelectOption(t,n=>this.changeSelectedDevice(n)),this.videoOptions=Oa(r),await vs(),this.cameraRecorder=new Zr({cameraId:t.cameraId,microphoneId:t.microphoneId,onBufferSizeError:!1,onBufferSizeErrorCallback:()=>{}},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream),this.DeviceCheckerUI){let n=document.querySelector("#confirmBtn");!this.options.useSpyScan&&(n.disabled=!1)}return{cameraStream:this.cameraRecorder.cameraStream}}async closeCheckDevices(){e.isModalOpen=!1,this.faceDetection.stopDetection(),this.volumeMeter?.stop(),this.volumeMedia=Math.ceil(this.volumeSum/this.volumeCounter),this.cameraRecorder.stopRecording&&await this.cameraRecorder.stopRecording(),this.DeviceCheckerUI=void 0,this.onUpdateCb=void 0}async checkSpyScan(){if(this.spycam=new Vi(this.context,{}),this.allowedSpyScan=null,this.options.useSpyScan){this.DeviceCheckerUI&&this.DeviceCheckerUI.waitingSpyDevices(!0);try{await this.spycam.isPluggedIn()?await this.spycam.devices({deviceType:3}).then(r=>{r?.length>0?this.allowedSpyScan=!1:this.allowedSpyScan=!0}).finally(()=>{this.DeviceCheckerUI&&this.DeviceCheckerUI.waitingSpyDevices(!1),this.DeviceCheckerUI&&this.allowedSpyScan!=null&&this.DeviceCheckerUI.isSpyDevicesUI(this.allowedSpyScan)}):(this.allowedSpyScan=!1,this.DeviceCheckerUI&&this.DeviceCheckerUI.waitingSpyDevices(!1),this.DeviceCheckerUI&&this.DeviceCheckerUI.isSpyDevicesUI(this.allowedSpyScan))}catch(t){this.allowedSpyScan=!1,this.DeviceCheckerUI&&this.DeviceCheckerUI.waitingSpyDevices(!1),this.DeviceCheckerUI&&this.DeviceCheckerUI.isSpyDevicesUI(this.allowedSpyScan),console.log(t)}}}};var Hi=class{constructor(){}async takePicture(t,r,n={width:1080,height:720}){return this.resolution=n,await this.takePictureInterface(t,r)}async startCapture(t="default"){let r=document.querySelector("#cameraStream"),n={audio:!1,video:{facingMode:"user",aspectRatio:1.777777778,width:{min:640,ideal:640,max:1920},height:{min:400,ideal:480},deviceId:t}};this.cameraRecorder=new Zr({cameraId:t,onBufferSizeErrorCallback:()=>{}},{...this.resolution}),await this.cameraRecorder.startRecording(),r.srcObject=this.cameraRecorder.cameraStream,r.play()}shot(){let t=document.querySelector("#cameraStream"),r=document.querySelector("#canvas"),n=document.querySelector("#image");r.width=t.videoWidth,r.height=t.videoHeight,r.getContext("2d").drawImage(t,0,0,t.videoWidth,t.videoHeight),n.src=r.toDataURL("image/jpg"),this.base64=r.toDataURL("image/jpg")}takePictureInterface(t,r){return new Promise((n,i)=>{let o=document.createElement("div");o.setAttribute("id","authPhoto"),o.style.backgroundColor="rgba(0,0,0,0.4)",o.style.zIndex="1000",o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.height="100vh",o.style.width="100%",o.style.display="flex",o.style.alignItems="center",o.style.justifyContent="center";let s=document.createElement("div");s.style.backgroundColor="#fff",s.style.zIndex="1001",s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.height="100vh",s.style.width="100%",s.style.borderRadius="10px",s.style.display="flex",s.style.flexDirection="column",s.style.alignItems="center",s.style.boxSizing="border-box";let a=document.createElement("h3");a.innerText=t||"Biometria Facial",a.style.color="rgba(0, 0, 0, .7)",a.style.fontWeight="bold",a.style.fontSize="20px",a.style.marginTop="0px",a.style.marginBottom="15px",a.style.padding="20px 0px 0px",a.style.width="100%",a.style.textAlign="center",a.style.position="fixed",a.style.top="0",a.style.left="0",a.style.zIndex="1010",s.appendChild(a);let c=document.createElement("p");c.innerText=r||"Encaixe seu rosto no formato e clique no bot\xE3o abaixo",c.style.color="rgba(0, 0, 0, .7)",c.style.fontWeight="normal",c.style.fontSize="16px",c.style.marginBottom="15px",c.style.padding="0px 0px 20px",c.style.width="100%",c.style.textAlign="center",c.style.position="fixed",c.style.top="55px",c.style.left="0",c.style.zIndex="1011",s.appendChild(c);let l=document.createElement("div"),h=document.createElement("h3"),d=document.createElement("select");d.setAttribute("id","cameraSelect"),l.style.padding="0 20px",l.style.width="100%",l.style.display="flex",l.style.justifyContent="space-between",l.style.marginBottom="15px",h.innerText="C\xE2mera",h.style.color="rgba(0, 0, 0, .75)",h.style.fontWeight="bold",h.style.fontSize="16px",l.appendChild(h),l.appendChild(d);let m=document.createElement("div"),p=document.createElement("video");p.setAttribute("id","cameraStream"),p.muted=!0,m.style.position="fixed",m.style.top="0",m.style.left="0",m.style.height="100vh",m.style.width="100%",m.style.display="flex",m.style.justifyContent="center",p.style.backgroundColor="#000",p.style.borderRadius="10px",p.style.width="auto",p.style.height="auto",p.style.minHeight="100%",m.appendChild(p);let g=document.createElement("canvas");g.setAttribute("id","canvas"),g.style.display="none",g.style.width="100%",g.style.height="100%";let f=document.createElement("img");f.setAttribute("id","image"),f.style.objectFit="contain",f.style.display="none",f.style.borderRadius="8px",m.appendChild(g),m.appendChild(f);let b=document.createElement("div");b.setAttribute("class","facial-biometry__mask"),b.style.width="100%",b.style.height="100%",b.style.position="absolute",b.style.top="0px",b.style.left="0px",b.style.backgroundColor="#fff",b.style.opacity="0.8";let v=document.createElement("div");v.setAttribute("class","biometry__frame"),v.style.width="100%",v.style.height="100%",v.style.position="absolute",v.style.top="0px",v.style.left="0px",v.style.zIndex="10",m.appendChild(b),m.appendChild(v),s.appendChild(m),this.addStyleMask();let k=document.createElement("button"),S=document.createElement("div");k.setAttribute("id","confirmBtn"),S.style.position="fixed",S.style.bottom="0",S.style.left="0",S.style.width="100%",S.style.display="flex",S.style.alignItems="center",S.style.justifyContent="center",k.style.background="url('https://iarisprod.blob.core.windows.net/imagens/camera.svg') no-repeat center",k.style.width="70px",k.style.height="70px",k.style.borderRadius="70px",k.style.border="none",k.style.backgroundColor="#16a34a",k.style.margin="20px";let I=document.createElement("button");I.setAttribute("id","closeModal"),I.style.background="url('https://iarisprod.blob.core.windows.net/imagens/close.svg') no-repeat center",I.style.width="70px",I.style.height="70px",I.style.borderRadius="70px",I.style.border="none",I.style.backgroundColor="#e74141",I.style.margin="20px",S.appendChild(I),S.appendChild(k),s.appendChild(S);let x=document.createElement("button");x.style.background="url('https://easyproctor-public.s3.us-east-2.amazonaws.com/images/retry.svg') no-repeat center",x.style.width="70px",x.style.height="70px",x.style.borderRadius="70px",x.style.border="none",x.style.backgroundColor="#e74141",x.style.margin="20px 20px";let O=document.createElement("button");O.style.background="url('https://iarisprod.blob.core.windows.net/imagens/check.svg') no-repeat center",O.style.width="70px",O.style.height="70px",O.style.borderRadius="70px",O.style.border="none",O.style.backgroundColor="#16a34a",O.style.margin="20px 20px",o.appendChild(s),document.body.appendChild(o),this.setSelectOption(),this.startCapture(),k.addEventListener("click",()=>{S.removeChild(k),S.removeChild(I),S.appendChild(x),S.appendChild(O),this.shot(),p.style.display="none",f.style.display="block"}),x.addEventListener("click",()=>{S.appendChild(I),S.appendChild(k),S.removeChild(x),S.removeChild(O),p.style.display="block",f.style.display="none"}),O.addEventListener("click",()=>{this.closeInterface(),n({base64:this.base64})}),I.addEventListener("click",()=>{this.closeInterface(),i(new Error("User does not captured photo"))})})}async setSelectOption(){let t=document.querySelector("#cameraSelect"),r=await ur();t&&(t.value="default");let n=(i,o)=>{let s=document.createElement("option");return s.setAttribute("value",o),s.innerHTML=i,s};r.cameras.forEach(i=>{let o=n(i.label,i.id);t?.appendChild(o)}),this.onSelectOptionChange()}async onSelectOptionChange(){let t=document.querySelector("#cameraSelect");t?.addEventListener("change",async()=>{this.startCapture(t?.value)})}async closeInterface(){await this.cameraRecorder.stopRecording(),document.querySelector("#authPhoto")?.remove()}async addStyleMask(){let t=`
398
398
  .facial-biometry__mask {
399
399
  mask-image: url('https://iarisprod.blob.core.windows.net/imagens/square.svg'), url('https://iarisprod.blob.core.windows.net/imagens/face-mask.svg');
400
400
  mask-size: cover, auto 65%;
@@ -432,7 +432,7 @@ Para iniciar um exame utilize uma outra c\xE2mera.`),o.setAttribute("class","che
432
432
  File size: ${n.size}`),new Error("Error on machine download")}}};var Ha=class{constructor(t,r){this.session=t;this.recorders=r}async startAll(){this.session.start();for(let t of this.recorders)await t.startRecording({retry:!1})}async pauseAll(){this.session.pause();for(let t of this.recorders)await t.pauseRecording()}async resumeAll(){this.session.resume();for(let t of this.recorders)await t.resumeRecording()}async stopAll(){for(let t of this.recorders)await t.stopRecording();this.session.stop()}async saveAllOnSession(){for(let t of this.recorders)await t.saveOnSession(this.session)}};var $i=class{constructor(t,r,n){this.session=t;this.proctoringId=r;this.uploadServices=n}async upload(t,r){await this.uploadRecordings(t,r)}async uploadRecordings(t,r){await this.uploadAllFiles(t,r),this.session.hasSomethingToUpload||this.session.setUploaded()}async uploadAllFiles(t,r){for(let n=0;n<this.session.recordings.length;n++){let i=this.session.recordings[n];if(i.upload)continue;let o=a=>{let c=(n*100+a)/this.session.recordings.length;r&&r(c)},s=await this.uploadFile(i,t,o).catch(()=>{});s&&(i.upload||(i.upload={storage:"upload",awsUrl:"",azureUrl:""}),s.uploaded&&(i.upload.storage=s.storage),s.storage==="upload"?s.url&&(i.upload.azureUrl=s.url):s.url&&(i.upload.awsUrl=s.url))}r&&r(100)}async uploadFile(t,r,n){for await(let i of this.uploadServices){let o=await i.upload({file:t.file,onProgress:s=>{n&&n(s)}},r);if(o){let s="";return t.file.name.search("camera")!==-1?s="Camera":t.file.name.search("screen")!==-1?s="Screen":t.file.name.search("audio")!==-1&&(s="Audio"),me.registerUploadFile(this.proctoringId,`Upload File
433
433
  Name: ${t.file.name}
434
434
  Type: ${t.file.type}
435
- Size: ${t.file.size}`,s),o}}throw new Error("Could not upload")}};var Wa=class{constructor(t,r){this.alerts=[];this.lastActivityTime=Date.now();this.IDLE_THRESHOLD_MS=3e4;this.handleVisibilityChange=()=>{document.visibilityState==="visible"?this.handleReturnFocus():this.handleLostFocus()};this.handleLostFocus=()=>{if(this.getRelativeTime()>1e4){let t={begin:this.getRelativeTime(),end:0,alert:25,type:3};this.onLostFocusCallback(t),this.alerts.push(t)}};this.handleReturnFocus=()=>{let t=this.alerts[this.alerts.length-1];t&&(this.onFocusCallback({begin:t.begin,end:this.getRelativeTime(),alert:25,type:3}),t.end=this.getRelativeTime())};this.handleResize=()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{let t=window.screen.availWidth,r=window.outerWidth;if(r<t*.85){let n=`Split Screen Detectado: Janela ocupa ${(r/t*100).toFixed(0)}% da tela`;this.createAlert(43,3,n),this.onRealtimeAlertCallback&&this.onRealtimeAlertCallback({status:"ALERT",description:n,type:"split_screen"})}},1e3)};this.handleUserActivity=t=>{this.lastActivityTime=Date.now(),console.log("\u{1F449} handleUserActivity",t)};this.handleCopy=t=>{t.preventDefault();let r="Tentativa de Copiar (Clipboard)";this.createAlert(42,3,r),this.onRealtimeAlertCallback&&this.onRealtimeAlertCallback({status:"ALERT",description:r,type:"clipboard_copy"})};this.handleCut=t=>{t.preventDefault();let r="Tentativa de Recortar (Clipboard)";this.createAlert(42,3,r),this.onRealtimeAlertCallback&&this.onRealtimeAlertCallback({status:"ALERT",description:r,type:"clipboard_cut"})};this.handlePaste=t=>{t.preventDefault();let r="Tentativa de Colar (Clipboard)";this.createAlert(42,3,r),this.onRealtimeAlertCallback&&this.onRealtimeAlertCallback({status:"ALERT",description:r,type:"clipboard_paste"})};this.onLostFocusCallback=t.onLostFocusCallback,this.onFocusCallback=t.onFocusCallback,this.onRealtimeAlertCallback=t.onRealtimeAlertCallback,this.optionsProctoring=r}async startRecording(){this.startTime=new Date(Date.now()),this.alerts=[],this.attachListeners()}async pauseRecording(){this.detachListeners()}async resumeRecording(){this.attachListeners()}async stopRecording(){this.detachListeners()}async saveOnSession(t){this.alerts.forEach(r=>{t.addAlert(r)})}attachListeners(){this.optionsProctoring.captureScreen&&(window.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("resize",this.handleResize),window.document.addEventListener("copy",this.handleCopy),window.document.addEventListener("cut",this.handleCut),window.document.addEventListener("paste",this.handlePaste))}detachListeners(){window.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("resize",this.handleResize),window.document.removeEventListener("copy",this.handleCopy),window.document.removeEventListener("cut",this.handleCut),window.document.removeEventListener("paste",this.handlePaste)}addBackgroundEvent(t,r=200){this.createAlert(r,3,t),this.onRealtimeAlertCallback&&this.onRealtimeAlertCallback({status:"ALERT",description:t,type:"background_event"})}getRelativeTime(){return Date.now()-this.startTime.getTime()}createAlert(t,r,n){this.alerts.push({begin:this.getRelativeTime(),end:this.getRelativeTime(),alert:t,type:r})}addAlert({alert:t,type:r}){this.alerts.push({begin:Date.now()-this.startTime.getTime(),end:Date.now()-this.startTime.getTime(),alert:t,type:r})}};var $a=class{constructor(t,r){this.blobs=[];this.options={cameraId:void 0,microphoneId:void 0};this.audioParams={recordingBitrate:128};r&&(this.audioParams=r),t&&(this.options=t)}async startRecording(){let t={audio:{deviceId:this.options.microphoneId||"default"}};this.audioStream=await navigator.mediaDevices.getUserMedia(t);let{startRecording:r,stopRecording:n,pauseRecording:i,resumeRecording:o}=Wn(this.audioStream,this.blobs,void 0,void 0,!0);this.recordingStart=r,this.recordingStop=n,this.recordingPause=i,this.recordingResume=o,this.recordingStart()}async pauseRecording(){}async resumeRecording(){}async stopRecording(){this.recordingStop&&await this.recordingStop()}async saveOnSession(t,r,n){t.addRecording({device:"",file:new File(this.blobs,`EP_${t.id}_audio_${r&&n&&`${r}_${n}`||"0"}.webm`,{type:"audio/webm"}),origin:"Mic"})}};var Kn=typeof self<"u"?self:{};function $n(){throw Error("Invalid UTF8")}function c0(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}var Ga,Ed,g_=typeof TextDecoder<"u",y_,b_=typeof TextEncoder<"u";function $0(e){if(b_)e=(y_||=new TextEncoder).encode(e);else{let r=0,n=new Uint8Array(3*e.length);for(let i=0;i<e.length;i++){var t=e.charCodeAt(i);if(t<128)n[r++]=t;else{if(t<2048)n[r++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&i<e.length){let o=e.charCodeAt(++i);if(o>=56320&&o<=57343){t=1024*(t-55296)+o-56320+65536,n[r++]=t>>18|240,n[r++]=t>>12&63|128,n[r++]=t>>6&63|128,n[r++]=63&t|128;continue}i--}t=65533}n[r++]=t>>12|224,n[r++]=t>>6&63|128}n[r++]=63&t|128}}e=r===n.length?n:n.subarray(0,r)}return e}var Vd,Qa;e:{for(Cd=["CLOSURE_FLAGS"],qa=Kn,Ka=0;Ka<Cd.length;Ka++)if((qa=qa[Cd[Ka]])==null){Qa=null;break e}Qa=qa}var Cd,qa,Ka,Jo,l0=Qa&&Qa[610401301];Vd=l0!=null&&l0;var h0=Kn.navigator;function Bd(e){return!!Vd&&!!Jo&&Jo.brands.some((({brand:t})=>t&&t.indexOf(e)!=-1))}function cr(e){var t;return(t=Kn.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function vn(){return!!Vd&&!!Jo&&Jo.brands.length>0}function xd(){return vn()?Bd("Chromium"):(cr("Chrome")||cr("CriOS"))&&!(!vn()&&cr("Edge"))||cr("Silk")}Jo=h0&&h0.userAgentData||null;var v_=!vn()&&(cr("Trident")||cr("MSIE"));!cr("Android")||xd(),xd(),cr("Safari")&&(xd()||!vn()&&cr("Coast")||!vn()&&cr("Opera")||!vn()&&cr("Edge")||(vn()?Bd("Microsoft Edge"):cr("Edg/"))||vn()&&Bd("Opera"));var G0={},$o=null;function __(e){let t=e.length,r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);let n=new Uint8Array(r),i=0;return(function(o,s){function a(l){for(;c<o.length;){let h=o.charAt(c++),d=$o[h];if(d!=null)return d;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return l}q0();let c=0;for(;;){let l=a(-1),h=a(0),d=a(64),m=a(64);if(m===64&&l===-1)break;s(l<<2|h>>4),d!=64&&(s(h<<4&240|d>>2),m!=64&&s(d<<6&192|m))}})(e,(function(o){n[i++]=o})),i!==r?n.subarray(0,i):n}function q0(){if(!$o){$o={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=e.concat(t[r].split(""));G0[r]=n;for(let i=0;i<n.length;i++){let o=n[i];$o[o]===void 0&&($o[o]=i)}}}}var K0=typeof Uint8Array<"u",X0=!v_&&typeof btoa=="function";function d0(e){if(!X0){var t;t===void 0&&(t=0),q0(),t=G0[t];var r=Array(Math.floor(e.length/3)),n=t[64]||"";let c=0,l=0;for(;c<e.length-2;c+=3){var i=e[c],o=e[c+1],s=e[c+2],a=t[i>>2];i=t[(3&i)<<4|o>>4],o=t[(15&o)<<2|s>>6],s=t[63&s],r[l++]=a+i+o+s}switch(a=0,s=n,e.length-c){case 2:s=t[(15&(a=e[c+1]))<<2]||n;case 1:e=e[c],r[l]=t[e>>2]+t[(3&e)<<4|a>>4]+s+n}return r.join("")}for(t="",r=0,n=e.length-10240;r<n;)t+=String.fromCharCode.apply(null,e.subarray(r,r+=10240));return t+=String.fromCharCode.apply(null,r?e.subarray(r):e),btoa(t)}var u0=/[-_.]/g,w_={"-":"+",_:"/",".":"="};function S_(e){return w_[e]||""}function J0(e){if(!X0)return __(e);u0.test(e)&&(e=e.replace(u0,S_)),e=atob(e);let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function lc(e){return K0&&e!=null&&e instanceof Uint8Array}var Yi={};function Zi(){return k_||=new wn(null,Yi)}function Hd(e){Y0(Yi);var t=e.g;return(t=t==null||lc(t)?t:typeof t=="string"?J0(t):null)==null?t:e.g=t}var wn=class{i(){return new Uint8Array(Hd(this)||0)}constructor(e,t){if(Y0(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}},k_,E_;function Y0(e){if(e!==Yi)throw Error("illegal external caller")}function Z0(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function f0(){let e=Error("int32");return Z0(e,"warning"),e}var hc=typeof Symbol=="function"&&typeof Symbol()=="symbol",C_=new Set;function dc(e,t,r=!1,n=!1){return e=typeof Symbol=="function"&&typeof Symbol()=="symbol"?n&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t,r&&C_.add(e),e}var x_=dc("jas",void 0,!0,!0),Ad=dc(void 0,"2ex"),Ho=dc(void 0,"1oa",!0),Qi=dc(void 0,Symbol(),!0),se=hc?x_:"M",Q0={M:{value:0,configurable:!0,writable:!0,enumerable:!1}},e1=Object.defineProperties;function Wd(e,t){hc||se in e||e1(e,Q0),e[se]|=t}function ct(e,t){hc||se in e||e1(e,Q0),e[se]=t}function A_(e,t){ct(t,-30975&(0|e))}function Ld(e,t){ct(t,-30941&(34|e))}function $d(){return typeof BigInt=="function"}function lr(e){return Array.prototype.slice.call(e)}var Gd,Zo={},T_={};function p0(e){return!(!e||typeof e!="object"||e.g!==T_)}function qd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function t1(e,t){if(e!=null){if(typeof e=="string")e=e?new wn(e,Yi):Zi();else if(e.constructor!==wn)if(lc(e))e=e.length?new wn(new Uint8Array(e),Yi):Zi();else{if(!t)throw Error();e=void 0}}return e}function ec(e){return!(!Array.isArray(e)||e.length)&&!!(1&(0|e[se]))}var m0=[];function Yn(e){if(2&e)throw Error()}function Kd(e){return Qi?e[Qi]:void 0}ct(m0,55),Gd=Object.freeze(m0);var r1=Object.freeze({}),Xd=typeof Kn.BigInt=="function"&&typeof Kn.BigInt(0)=="bigint",Fd=e=>Xd?e>=R_&&e<=D_:e[0]==="-"?g0(e,I_):g0(e,P_),I_=Number.MIN_SAFE_INTEGER.toString(),R_=Xd?BigInt(Number.MIN_SAFE_INTEGER):void 0,P_=Number.MAX_SAFE_INTEGER.toString(),D_=Xd?BigInt(Number.MAX_SAFE_INTEGER):void 0;function g0(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let r=0;r<e.length;r++){let n=e[r],i=t[r];if(n>i)return!1;if(n<i)return!0}}var O_=typeof Uint8Array.prototype.slice=="function",n1,De=0,Ge=0;function y0(e){let t=e>>>0;De=t,Ge=(e-t)/4294967296>>>0}function eo(e){if(e<0){y0(-e);let[t,r]=Zd(De,Ge);De=t>>>0,Ge=r>>>0}else y0(e)}function i1(e){let t=n1||=new DataView(new ArrayBuffer(8));t.setFloat32(0,+e,!0),Ge=0,De=t.getUint32(0,!0)}function Jd(e,t){let r=4294967296*t+(e>>>0);return Number.isSafeInteger(r)?r:Yo(e,t)}function Yd(e,t){let r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Jd(e,t))=="number"?r?-e:e:r?"-"+e:e}function Yo(e,t){if(e>>>=0,(t>>>=0)<=2097151)var r=""+(4294967296*t+e);else $d()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,e>=1e7&&(r+=e/1e7>>>0,e%=1e7),r>=1e7&&(t+=r/1e7>>>0,r%=1e7),r=t+b0(r)+b0(e));return r}function b0(e){return e=String(e),"0000000".slice(e.length)+e}function uc(e){if(e.length<16)eo(Number(e));else if($d())e=BigInt(e),De=Number(e&BigInt(4294967295))>>>0,Ge=Number(e>>BigInt(32)&BigInt(4294967295));else{let t=+(e[0]==="-");Ge=De=0;let r=e.length;for(let n=t,i=(r-t)%6+t;i<=r;n=i,i+=6){let o=Number(e.slice(n,i));Ge*=1e6,De=1e6*De+o,De>=4294967296&&(Ge+=Math.trunc(De/4294967296),Ge>>>=0,De>>>=0)}if(t){let[n,i]=Zd(De,Ge);De=n,Ge=i}}}function Zd(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}var o1=typeof BigInt=="function"?BigInt.asIntN:void 0,B_=typeof BigInt=="function"?BigInt.asUintN:void 0,Go=Number.isSafeInteger,fc=Number.isFinite,tc=Math.trunc;function Qo(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function v0(e){if(e!=null&&typeof e!="boolean"){var t=typeof e;throw Error(`Expected boolean but got ${t!="object"?t:e?Array.isArray(e)?"array":t:"null"}: ${e}`)}return e}var L_=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Qd(e){switch(typeof e){case"bigint":return!0;case"number":return fc(e);case"string":return L_.test(e);default:return!1}}function Xn(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return fc(e)?0|e:void 0}function _0(e){if(e[0]==="-")return!1;let t=e.length;return t<20||t===20&&Number(e.substring(0,6))<184467}function s1(e){return e=tc(e),Go(e)||(eo(e),e=Yd(De,Ge)),e}function a1(e){var t=tc(Number(e));if(Go(t))return String(t);if((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),t=e.length,!(e[0]==="-"?t<20||t===20&&Number(e.substring(0,7))>-922337:t<19||t===19&&Number(e.substring(0,6))<922337))if(uc(e),e=De,2147483648&(t=Ge))if($d())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{let[r,n]=Zd(e,t);e="-"+Yo(r,n)}else e=Yo(e,t);return e}function Md(e){return e==null?e:typeof e=="bigint"?(Fd(e)?e=Number(e):(e=o1(64,e),e=Fd(e)?Number(e):String(e)),e):Qd(e)?typeof e=="number"?s1(e):a1(e):void 0}function F_(e){if(e==null)return e;var t=typeof e;if(t==="bigint")return String(B_(64,e));if(Qd(e)){if(t==="string")return t=tc(Number(e)),Go(t)&&t>=0?e=String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),_0(e)||(uc(e),e=Yo(De,Ge))),e;if(t==="number")return(e=tc(e))>=0&&Go(e)?e:(function(r){if(r<0){eo(r);var n=Yo(De,Ge);return r=Number(n),Go(r)?r:n}return _0(n=String(r))?n:(eo(r),Jd(De,Ge))})(e)}}function c1(e){if(typeof e!="string")throw Error();return e}function rc(e){if(e!=null&&typeof e!="string")throw Error();return e}function Sn(e){return e==null||typeof e=="string"?e:void 0}function l1(e,t,r){if(e!=null&&typeof e=="object"&&e.B===Zo)return e;if(Array.isArray(e)){var n=0|e[se],i=n;return i===0&&(i|=32&r),(i|=2&r)!==n&&ct(e,i),new t(e)}}function h1(e,t,r,n,i){if(e!=null){if(Array.isArray(e))e=ec(e)?void 0:i&&2&(0|e[se])?e:eu(e,t,r,n!==void 0,i);else if(qd(e)){let o={};for(let s in e)o[s]=h1(e[s],t,r,n,i);e=o}else e=t(e,n);return e}}function eu(e,t,r,n,i){let o=n||r?0|e[se]:0,s=n?!!(32&o):void 0;n=lr(e);for(let a=0;a<n.length;a++)n[a]=h1(n[a],t,r,s,i);return r&&((e=Kd(e))&&(n[Qi]=lr(e)),r(o,n)),n}function M_(e){return e.B===Zo?e.toJSON():(function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"bigint":return Fd(t)?Number(t):String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(ec(t))return}else{if(lc(t))return d0(t);if(t instanceof wn){let r=t.g;return r==null?"":typeof r=="string"?r:t.g=d0(r)}}}return t})(e)}function U_(e){return eu(e,M_,void 0,void 0,!1)}var d1,N_;function qo(e,t,r){return e=u1(e,t[0],t[1],r?1:2),t!==d1&&r&&Wd(e,16384),e}function u1(e,t,r,n){if(e==null){var i=96;r?(e=[r],i|=512):e=[],t&&(i=-33521665&i|(1023&t)<<15)}else{if(!Array.isArray(e))throw Error("narr");if(2048&(i=0|e[se]))throw Error("farr");if(64&i)return e;if(n===1||n===2||(i|=64),r&&(i|=512,r!==e[0]))throw Error("mid");e:{if(n=(r=e).length){let o=n-1;if(qd(r[o])){if((t=o-(512&(i|=256)?0:-1))>=1024)throw Error("pvtlmt");i=-33521665&i|(1023&t)<<15;break e}}if(t){if((t=Math.max(t,n-(512&i?0:-1)))>1024)throw Error("spvt");i=-33521665&i|(1023&t)<<15}}}return ct(e,i),e}function f1(e,t,r=Ld){if(e!=null){if(K0&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var n=0|e[se];return 2&n?e:(t&&=n===0||!!(32&n)&&!(64&n||!(16&n)),t?(ct(e,-12293&(34|n)),e):eu(e,f1,4&n?Ld:r,!0,!0))}return e.B===Zo&&(e=2&(n=0|(r=e.l)[se])?e:new e.constructor(pc(r,n,!0))),e}}function p1(e){let t=e.l;return new e.constructor(pc(t,0|t[se],!1))}function pc(e,t,r){let n=r||2&t?Ld:A_,i=!!(32&t);return e=(function(o,s,a){let c=lr(o);var l=c.length;let h=256&s?c[l-1]:void 0;for(l+=h?-1:0,s=512&s?1:0;s<l;s++)c[s]=a(c[s]);if(h){s=c[s]={};for(let d in h)s[d]=a(h[d])}return(o=Kd(o))&&(c[Qi]=lr(o)),c})(e,t,(o=>f1(o,i,n))),Wd(e,32|(r?2:0)),e}function tu(e){let t=e.l,r=0|t[se];return 2&r?new e.constructor(pc(t,r,!1)):e}function _r(e,t){return Zn(e=e.l,0|e[se],t)}function Zn(e,t,r,n){if(r===-1)return null;var i=r+(512&t?0:-1);let o=e.length-1;return i>=o&&256&t?e[o][r]:n&&256&t&&(t=e[o][r])!=null?(e[i]!=null&&Ad!=null&&((i=(e=E_??={})[Ad]||0)>=4||(e[Ad]=i+1,Z0(e=Error(),"incident"),(function(s){Kn.setTimeout((()=>{throw s}),0)})(e))),t):i<=o?e[i]:void 0}function pt(e,t,r){let n=e.l,i=0|n[se];return Yn(i),lt(n,i,t,r),e}function lt(e,t,r,n){let i=512&t?0:-1,o=r+i;var s=e.length-1;return o>=s&&256&t?(e[s][r]=n,t):o<=s?(e[o]=n,256&t&&r in(e=e[s])&&delete e[r],t):(n!==void 0&&(r>=(s=t>>15&1023||536870912)?n!=null&&(e[s+i]={[r]:n},ct(e,t|=256)):e[o]=n),t)}function m1(e){let t=0|(e=e.l)[se],r=Zn(e,t,1),n=t1(r,!0);return n!=null&&n!==r&&lt(e,t,1,n),n}function g1(e,t,r,n,i){let o=e.l,s=2&(e=0|o[se])?1:n;i=!!i;let a=0|(n=ru(o,e,t))[se];if(!(4&a)){4&a&&(n=lr(n),a=Qr(a,e),e=lt(o,e,t,n));let c=0,l=0;for(;c<n.length;c++){let h=r(n[c]);h!=null&&(n[l++]=h)}l<c&&(n.length=l),a=nu(a,e),r=-4097&(20|a),a=r&=-8193,ct(n,a),2&a&&Object.freeze(n)}return s===1||s===4&&32&a?Zr(a)||(i=a,a|=2,a!==i&&ct(n,a),Object.freeze(n)):(s===2&&Zr(a)&&(n=lr(n),a=Qr(a,e),a=kn(a,e,i),ct(n,a),e=lt(o,e,t,n)),Zr(a)||(t=a,a=kn(a,e,i),a!==t&&ct(n,a))),n}function ru(e,t,r,n){return e=Zn(e,t,r,n),Array.isArray(e)?e:Gd}function nu(e,t){return e===0&&(e=Qr(e,t)),1|e}function Zr(e){return!!(2&e)&&!!(4&e)||!!(2048&e)}function w0(e,t,r){let n=0|(e=e.l)[se];if(Yn(n),r==null)lt(e,n,t);else{var i=0|r[se],o=i,s=Zr(i),a=s||Object.isFrozen(r);for(s||(i=0),a||(r=lr(r),o=0,i=kn(i=Qr(i,n),n,!0),a=!1),i|=21,s=0;s<r.length;s++){let c=r[s],l=c1(c);Object.is(c,l)||(a&&(r=lr(r),o=0,i=kn(i=Qr(i,n),n,!0),a=!1),r[s]=l)}i!==o&&(a&&(r=lr(r),i=kn(i=Qr(i,n),n,!0)),ct(r,i)),lt(e,n,t,r)}}function y1(e,t){let r=0|(e=e.l)[se];Yn(r),lt(e,r,2,t===""?void 0:t)}function es(e,t,r,n,i){Yn(t);var o=!(!(64&t)&&16384&t);let s=(i=ru(e,t,r,i))!==Gd;if(o||!s){let a=o=s?0|i[se]:0;(!s||2&a||Zr(a)||4&a&&!(32&a))&&(i=lr(i),a=Qr(a,t),t=lt(e,t,r,i)),a=-13&nu(a,t),a=kn(n?-17&a:16|a,t,!0),a!==o&&ct(i,a)}return i}function Td(e,t){var r=a2;return ou(iu(e=e.l),e,0|e[se],r)===t?t:-1}function iu(e){if(hc)return e[Ho]??(e[Ho]=new Map);if(Ho in e)return e[Ho];let t=new Map;return Object.defineProperty(e,Ho,{value:t}),t}function b1(e,t,r,n){let i=iu(e),o=ou(i,e,t,r);return o!==n&&(o&&(t=lt(e,t,o)),i.set(r,n)),t}function ou(e,t,r,n){let i=e.get(n);if(i!=null)return i;i=0;for(let o=0;o<n.length;o++){let s=n[o];Zn(t,r,s)!=null&&(i!==0&&(r=lt(t,r,i)),i=s)}return e.set(n,i),i}function su(e,t,r,n){let i,o=0|e[se];if((n=Zn(e,o,r,n))!=null&&n.B===Zo)return(t=tu(n))!==n&&lt(e,o,r,t),t.l;if(Array.isArray(n)){let s=0|n[se];i=2&s?qo(pc(n,s,!1),t,!0):64&s?n:qo(i,t,!0)}else i=qo(void 0,t,!0);return i!==n&&lt(e,o,r,i),i}function v1(e,t,r,n){let i=0|(e=e.l)[se];return(t=l1(n=Zn(e,i,r,n),t,i))!==n&&t!=null&&lt(e,i,r,t),t}function wr(e,t,r){if((t=v1(e,t,r,!1))==null)return t;let n=0|(e=e.l)[se];if(!(2&n)){let i=tu(t);i!==t&&lt(e,n,r,t=i)}return t}function _1(e,t,r,n,i,o){e=e.l;var s=!!(2&t);let a=s?1:n;i=!!i,o&&=!s;var c=0|(n=ru(e,t,1))[se];if(!(s=!!(4&c))){var l=n,h=t;let d=!!(2&(c=nu(c,t)));d&&(h|=2);let m=!d,p=!0,g=0,f=0;for(;g<l.length;g++){let b=l1(l[g],r,h);if(b instanceof r){if(!d){let v=!!(2&(0|b.l[se]));m&&=!v,p&&=v}l[f++]=b}}f<g&&(l.length=f),c|=4,c=p?16|c:-17&c,ct(l,c=m?8|c:-9&c),d&&Object.freeze(l)}if(o&&!(8&c||!n.length&&(a===1||a===4&&32&c))){for(Zr(c)&&(n=lr(n),c=Qr(c,t),t=lt(e,t,1,n)),r=n,o=c,l=0;l<r.length;l++)(c=r[l])!==(h=tu(c))&&(r[l]=h);o|=8,ct(r,o=r.length?-17&o:16|o),c=o}return a===1||a===4&&32&c?Zr(c)||(t=c,(c|=!n.length||16&c&&(!s||32&c)?2:2048)!==t&&ct(n,c),Object.freeze(n)):(a===2&&Zr(c)&&(ct(n=lr(n),c=kn(c=Qr(c,t),t,i)),t=lt(e,t,1,n)),Zr(c)||(e=c,(c=kn(c,t,i))!==e&&ct(n,c))),n}function au(e,t){let r=0|e.l[se];return _1(e,r,t,r1===void 0?2:4,!1,!(2&r))}function Sr(e,t,r,n){return n==null&&(n=void 0),pt(e,r,n)}function Id(e,t,r){var n=n2;r==null&&(r=void 0);e:{let i=0|(e=e.l)[se];if(Yn(i),r==null){let o=iu(e);if(ou(o,e,i,n)!==t)break e;o.set(n,0)}else i=b1(e,i,n,t);lt(e,i,t,r)}}function Qr(e,t){return-2049&(e=32|(2&t?2|e:-3&e))}function kn(e,t,r){return 32&t&&r||(e&=-33),e}function w1(e,t){var r=ku;let n=0|e.l[se];Yn(n),e=_1(e,n,r,2,!0),t=t??new r,e.push(t),e[se]=2&(0|t.l[se])?-9&e[se]:-17&e[se]}function Ot(e,t,r){Yn(0|e.l[se]),g1(e,t,Sn,2,!0).push(c1(r))}function S1(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function cu(){return Error("Failed to read varint, encoding is invalid.")}function k1(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function lu(e){if(typeof e=="string")return{buffer:J0(e),u:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),u:!1};if(e.constructor===Uint8Array)return{buffer:e,u:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),u:!1};if(e.constructor===wn)return{buffer:Hd(e)||new Uint8Array(0),u:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),u:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function hu(e,t){let r,n=0,i=0,o=0,s=e.i,a=e.g;do r=s[a++],n|=(127&r)<<o,o+=7;while(o<32&&128&r);for(o>32&&(i|=(127&r)>>4),o=3;o<32&&128&r;o+=7)r=s[a++],i|=(127&r)<<o;if(qn(e,a),r<128)return t(n>>>0,i>>>0);throw cu()}function du(e){let t=0,r=e.g,n=r+10,i=e.i;for(;r<n;){let o=i[r++];if(t|=o,(128&o)==0)return qn(e,r),!!(127&t)}throw cu()}function Bt(e){let t=e.i,r=e.g,n=t[r++],i=127&n;if(128&n&&(n=t[r++],i|=(127&n)<<7,128&n&&(n=t[r++],i|=(127&n)<<14,128&n&&(n=t[r++],i|=(127&n)<<21,128&n&&(n=t[r++],i|=n<<28,128&n&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw cu();return qn(e,r),i}function Ud(e){var t=e.i;let r=e.g,n=t[r],i=t[r+1],o=t[r+2];return t=t[r+3],qn(e,e.g+4),(n<<0|i<<8|o<<16|t<<24)>>>0}function Nd(e){var t=Ud(e);e=2*(t>>31)+1;let r=t>>>23&255;return t&=8388607,r==255?t?NaN:e*(1/0):r==0?1401298464324817e-60*e*t:e*Math.pow(2,r-150)*(t+8388608)}function z_(e){return Bt(e)}function Rd(e,t,{C:r=!1}={}){e.C=r,t&&(t=lu(t),e.i=t.buffer,e.m=t.u,e.s=0,e.j=e.i.length,e.g=e.s)}function qn(e,t){if(e.g=t,t>e.j)throw k1(e.j,t)}function E1(e,t){if(t<0)throw Error(`Tried to read a negative byte length: ${t}`);let r=e.g,n=r+t;if(n>e.j)throw k1(t,e.j-r);return e.g=n,r}function C1(e,t){if(t==0)return Zi();var r=E1(e,t);return e.C&&e.m?r=e.i.subarray(r,r+t):(e=e.i,r=r===(t=r+t)?new Uint8Array(0):O_?e.slice(r,t):new Uint8Array(e.subarray(r,t))),r.length==0?Zi():new wn(r,Yi)}var S0=[];function x1(e){var t=e.g;if(t.g==t.j)return!1;e.j=e.g.g;var r=Bt(e.g)>>>0;if(t=r>>>3,!((r&=7)>=0&&r<=5))throw S1(r,e.j);if(t<1)throw Error(`Invalid field number: ${t} (at position ${e.j})`);return e.m=t,e.i=r,!0}function Ya(e){switch(e.i){case 0:e.i!=0?Ya(e):du(e.g);break;case 1:qn(e=e.g,e.g+8);break;case 2:if(e.i!=2)Ya(e);else{var t=Bt(e.g)>>>0;qn(e=e.g,e.g+t)}break;case 5:qn(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!x1(e))throw Error("Unmatched start-group tag: stream EOF");if(e.i==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}Ya(e)}break;default:throw S1(e.i,e.j)}}function mc(e,t,r){let n=e.g.j,i=Bt(e.g)>>>0,o=e.g.g+i,s=o-n;if(s<=0&&(e.g.j=o,r(t,e,void 0,void 0,void 0),s=o-e.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-s} bytes, either the data ended unexpectedly or the message misreported its own length`);e.g.g=o,e.g.j=n}function uu(e){var t=Bt(e.g)>>>0,r=E1(e=e.g,t);if(e=e.i,g_){var n,i=e;(n=Ed)||(n=Ed=new TextDecoder("utf-8",{fatal:!0})),t=r+t,i=r===0&&t===i.length?i:i.subarray(r,t);try{var o=n.decode(i)}catch(a){if(Ga===void 0){try{n.decode(new Uint8Array([128]))}catch{}try{n.decode(new Uint8Array([97])),Ga=!0}catch{Ga=!1}}throw!Ga&&(Ed=void 0),a}}else{t=(o=r)+t,r=[];let a,c=null;for(;o<t;){var s=e[o++];s<128?r.push(s):s<224?o>=t?$n():(a=e[o++],s<194||(192&a)!=128?(o--,$n()):r.push((31&s)<<6|63&a)):s<240?o>=t-1?$n():(a=e[o++],(192&a)!=128||s===224&&a<160||s===237&&a>=160||(192&(n=e[o++]))!=128?(o--,$n()):r.push((15&s)<<12|(63&a)<<6|63&n)):s<=244?o>=t-2?$n():(a=e[o++],(192&a)!=128||a-144+(s<<28)>>30!=0||(192&(n=e[o++]))!=128||(192&(i=e[o++]))!=128?(o--,$n()):(s=(7&s)<<18|(63&a)<<12|(63&n)<<6|63&i,s-=65536,r.push(55296+(s>>10&1023),56320+(1023&s)))):$n(),r.length>=8192&&(c=c0(c,r),r.length=0)}o=c0(c,r)}return o}function A1(e){let t=Bt(e.g)>>>0;return C1(e.g,t)}function fu(e,t,r){var n=Bt(e.g)>>>0;for(n=e.g.g+n;e.g.g<n;)r.push(t(e.g))}var Xa=[];function j_(e){return e}var Ki;function T1(e,t,r){t.g?t.j(e,t.g,t.i,r):t.j(e,t.i,r)}var Ue=class{constructor(e,t){this.l=u1(e,t)}toJSON(){let e=!Ki;try{return e&&(Ki=U_),I1(this)}finally{e&&(Ki=void 0)}}u(){return!!(2&(0|this.l[se]))}};function I1(e){var t=e.l;{t=(e=Ki(t))!==t;let l=e.length;if(l){var r=e[l-1],n=qd(r);n?l--:r=void 0;var i=e;if(n){e:{var o,s=r,a=!1;if(s)for(let h in s)isNaN(+h)?(o??={})[h]=s[h]:(n=s[h],Array.isArray(n)&&(ec(n)||p0(n)&&n.size===0)&&(n=null),n==null&&(a=!0),n!=null&&((o??={})[h]=n));if(a||(o=s),o)for(let h in o){a=o;break e}a=null}s=a==null?r!=null:a!==r}for(;l>0&&((o=i[l-1])==null||ec(o)||p0(o)&&o.size===0);l--)var c=!0;(i!==e||s||c)&&(t?(c||s||a)&&(i.length=l):i=Array.prototype.slice.call(i,0,l),a&&i.push(a)),c=i}else c=e}return c}function k0(e){return e?/^\d+$/.test(e)?(uc(e),new zd(De,Ge)):null:V_||=new zd(0,0)}Ue.prototype.B=Zo,Ue.prototype.toString=function(){try{return Ki=j_,I1(this).toString()}finally{Ki=void 0}};var zd=class{constructor(e,t){this.i=e>>>0,this.g=t>>>0}},V_;function E0(e){return e?/^-?\d+$/.test(e)?(uc(e),new jd(De,Ge)):null:H_||=new jd(0,0)}var jd=class{constructor(e,t){this.i=e>>>0,this.g=t>>>0}},H_;function Xi(e,t,r){for(;r>0||t>127;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function ts(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function gc(e,t){if(t>=0)ts(e,t);else{for(let r=0;r<9;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function nc(e,t){e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function to(e,t){t.length!==0&&(e.j.push(t),e.i+=t.length)}function kr(e,t,r){ts(e.g,8*t+r)}function yc(e,t){return kr(e,t,2),t=e.g.end(),to(e,t),t.push(e.i),t}function bc(e,t){var r=t.pop();for(r=e.i+e.g.length()-r;r>127;)t.push(127&r|128),r>>>=7,e.i++;t.push(r),e.i++}function vc(e,t,r){kr(e,t,2),ts(e.g,r.length),to(e,e.g.end()),to(e,r)}function Er(){let e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var pu=Er(),R1=Er(),mu=Er(),gu=Er(),P1=Er(),D1=Er(),O1=Er(),B1=Er(),ro=class{constructor(e,t,r){this.g=e,this.i=t,e=pu,this.j=!!e&&r===e||!1}};function yu(e,t){return new ro(e,t,pu)}function L1(e,t,r,n,i){(t=N1(t,n))!=null&&(r=yc(e,r),i(t,e),bc(e,r))}var W_=yu((function(e,t,r,n,i){return e.i===2&&(mc(e,su(t,n,r),i),!0)}),L1),$_=yu((function(e,t,r,n,i){return e.i===2&&(mc(e,su(t,n,r,!0),i),!0)}),L1),_c=Symbol(),bu=Symbol(),C0=Symbol(),x0=Symbol(),F1,M1;function Qn(e,t,r,n){var i=n[e];if(i)return i;(i={}).P=n,i.A=(function(d){switch(typeof d){case"boolean":return d1||=[0,void 0,!0];case"number":return d>0?void 0:d===0?N_||=[0,void 0]:[-d,void 0];case"string":return[0,d];case"object":return d}})(n[0]);var o=n[1];let s=1;o&&o.constructor===Object&&(i.H=o,typeof(o=n[++s])=="function"&&(i.I=!0,F1??=o,M1??=n[s+1],o=n[s+=2]));let a={};for(;o&&Array.isArray(o)&&o.length&&typeof o[0]=="number"&&o[0]>0;){for(var c=0;c<o.length;c++)a[o[c]]=o;o=n[++s]}for(c=1;o!==void 0;){let d;typeof o=="number"&&(c+=o,o=n[++s]);var l=void 0;if(o instanceof ro?d=o:(d=W_,s--),d?.j){o=n[++s],l=n;var h=s;typeof o=="function"&&(o=o(),l[h]=o),l=o}for(h=c+1,typeof(o=n[++s])=="number"&&o<0&&(h-=o,o=n[++s]);c<h;c++){let m=a[c];l?r(i,c,d,l,m):t(i,c,d,m)}}return n[e]=i}function U1(e){return Array.isArray(e)?e[0]instanceof ro?e:[$_,e]:[e,void 0]}function N1(e,t){return e instanceof Ue?e.l:Array.isArray(e)?qo(e,t,!1):void 0}function vu(e,t,r,n){let i=r.g;e[t]=n?(o,s,a)=>i(o,s,a,n):i}function _u(e,t,r,n,i){let o=r.g,s,a;e[t]=(c,l,h)=>o(c,l,h,a||=Qn(bu,vu,_u,n).A,s||=wu(n),i)}function wu(e){let t=e[C0];if(t!=null)return t;let r=Qn(bu,vu,_u,e);return t=r.I?(n,i)=>F1(n,i,r):(n,i)=>{let o=0|n[se];for(;x1(i)&&i.i!=4;){var s=i.m,a=r[s];if(a==null){var c=r.H;c&&(c=c[s])&&(c=G_(c))!=null&&(a=r[s]=c)}a!=null&&a(i,n,s)||(s=(a=i).j,Ya(a),a.G?a=void 0:(c=a.g.g-s,a.g.g=s,a=C1(a.g,c)),s=n,a&&((c=s[Qi])?c.push(a):s[Qi]=[a]))}return 16384&o&&Wd(n,34),!0},e[C0]=t}function G_(e){let t=(e=U1(e))[0].g;if(e=e[1]){let r=wu(e),n=Qn(bu,vu,_u,e).A;return(i,o,s)=>t(i,o,s,n,r)}return t}function wc(e,t,r){e[t]=r.i}function Sc(e,t,r,n){let i,o,s=r.i;e[t]=(a,c,l)=>s(a,c,l,o||=Qn(_c,wc,Sc,n).A,i||=z1(n))}function z1(e){let t=e[x0];if(!t){let r=Qn(_c,wc,Sc,e);t=(n,i)=>j1(n,i,r),e[x0]=t}return t}function j1(e,t,r){for(var n=0|e[se],i=512&n?0:-1,o=e.length,s=512&n?1:0,a=o+(256&n?-1:0);s<a;s++){let c=e[s];if(c==null)continue;let l=s-i,h=A0(r,l);h&&h(t,c,l)}if(256&n){n=e[o-1];for(let c in n)i=+c,Number.isNaN(i)||(o=n[i])!=null&&(a=A0(r,i))&&a(t,o,i)}if(e=Kd(e))for(to(t,t.g.end()),r=0;r<e.length;r++)to(t,Hd(e[r])||new Uint8Array(0))}function A0(e,t){var r=e[t];if(r)return r;if((r=e.H)&&(r=r[t])){var n=(r=U1(r))[0].i;if(r=r[1]){let i=z1(r),o=Qn(_c,wc,Sc,r).A;r=e.I?M1(o,i):(s,a,c)=>n(s,a,c,o,i)}else r=n;return e[t]=r}}function kc(e,t){if(Array.isArray(t)){var r=0|t[se];if(4&r)return t;for(var n=0,i=0;n<t.length;n++){let o=e(t[n]);o!=null&&(t[i++]=o)}return i<n&&(t.length=i),ct(t,-12289&(5|r)),2&r&&Object.freeze(t),t}}function wt(e,t,r){return new ro(e,t,r)}function Ec(e,t,r){return new ro(e,t,r)}function St(e,t,r){lt(e,0|e[se],t,r)}function V1(e,t,r){if(t=(function(n){if(n==null)return n;let i=typeof n;if(i==="bigint")return String(o1(64,n));if(Qd(n)){if(i==="string")return a1(n);if(i==="number")return s1(n)}})(t),t!=null&&(typeof t=="string"&&E0(t),t!=null))switch(kr(e,r,0),typeof t){case"number":e=e.g,eo(t),Xi(e,De,Ge);break;case"bigint":r=BigInt.asUintN(64,t),r=new jd(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),Xi(e.g,r.i,r.g);break;default:r=E0(t),Xi(e.g,r.i,r.g)}}function H1(e,t,r){(t=Xn(t))!=null&&t!=null&&(kr(e,r,0),gc(e.g,t))}function W1(e,t,r){(t=t==null||typeof t=="boolean"?t:typeof t=="number"?!!t:void 0)!=null&&(kr(e,r,0),e.g.g.push(t?1:0))}function $1(e,t,r){(t=Sn(t))!=null&&vc(e,r,$0(t))}function G1(e,t,r,n,i){(t=N1(t,n))!=null&&(r=yc(e,r),i(t,e),bc(e,r))}function q1(e,t,r){(t=t==null||typeof t=="string"||lc(t)||t instanceof wn?t:void 0)!=null&&vc(e,r,lu(t).buffer)}var q_=wt((function(e,t,r){if(e.i!==1)return!1;var n=e.g;e=Ud(n);let i=Ud(n);n=2*(i>>31)+1;let o=i>>>20&2047;return e=4294967296*(1048575&i)+e,St(t,r,o==2047?e?NaN:n*(1/0):o==0?5e-324*n*e:n*Math.pow(2,o-1075)*(e+4503599627370496)),!0}),(function(e,t,r){(t=Qo(t))!=null&&(kr(e,r,1),e=e.g,(r=n1||=new DataView(new ArrayBuffer(8))).setFloat64(0,+t,!0),De=r.getUint32(0,!0),Ge=r.getUint32(4,!0),nc(e,De),nc(e,Ge))}),Er()),K1=wt((function(e,t,r){return e.i===5&&(St(t,r,Nd(e.g)),!0)}),(function(e,t,r){(t=Qo(t))!=null&&(kr(e,r,5),e=e.g,i1(t),nc(e,De))}),D1),K_=Ec((function(e,t,r){return(e.i===5||e.i===2)&&(t=es(t,0|t[se],r,!1,!1),e.i==2?fu(e,Nd,t):t.push(Nd(e.g)),!0)}),(function(e,t,r){if((t=kc(Qo,t))!=null&&t.length){kr(e,r,2),ts(e.g,4*t.length);for(let n=0;n<t.length;n++)r=e.g,i1(t[n]),nc(r,De)}}),D1),ic=wt((function(e,t,r){return e.i===0&&(St(t,r,hu(e.g,Yd)),!0)}),V1,P1),Pd=wt((function(e,t,r){return e.i===0&&(St(t,r,(e=hu(e.g,Yd))===0?void 0:e),!0)}),V1,P1),X_=wt((function(e,t,r){return e.i===0&&(St(t,r,hu(e.g,Jd)),!0)}),(function(e,t,r){if((t=F_(t))!=null&&(typeof t=="string"&&k0(t),t!=null))switch(kr(e,r,0),typeof t){case"number":e=e.g,eo(t),Xi(e,De,Ge);break;case"bigint":r=BigInt.asUintN(64,t),r=new zd(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),Xi(e.g,r.i,r.g);break;default:r=k0(t),Xi(e.g,r.i,r.g)}}),Er()),En=wt((function(e,t,r){return e.i===0&&(St(t,r,Bt(e.g)),!0)}),H1,gu),Su=Ec((function(e,t,r){return(e.i===0||e.i===2)&&(t=es(t,0|t[se],r,!1,!1),e.i==2?fu(e,Bt,t):t.push(Bt(e.g)),!0)}),(function(e,t,r){if((t=kc(Xn,t))!=null&&t.length){r=yc(e,r);for(let n=0;n<t.length;n++)gc(e.g,t[n]);bc(e,r)}}),gu),Gi=wt((function(e,t,r){return e.i===0&&(St(t,r,(e=Bt(e.g))===0?void 0:e),!0)}),H1,gu),Wt=wt((function(e,t,r){return e.i===0&&(St(t,r,du(e.g)),!0)}),W1,R1),Ji=wt((function(e,t,r){return e.i===0&&(St(t,r,(e=du(e.g))===!1?void 0:e),!0)}),W1,R1),sr=Ec((function(e,t,r){return e.i===2&&(e=uu(e),es(t,0|t[se],r,!1).push(e),!0)}),(function(e,t,r){if((t=kc(Sn,t))!=null)for(let s=0;s<t.length;s++){var n=e,i=r,o=t[s];o!=null&&vc(n,i,$0(o))}}),mu),_n=wt((function(e,t,r){return e.i===2&&(St(t,r,(e=uu(e))===""?void 0:e),!0)}),$1,mu),Ze=wt((function(e,t,r){return e.i===2&&(St(t,r,uu(e)),!0)}),$1,mu),ar=(function(e,t,r=pu){return new ro(e,t,r)})((function(e,t,r,n,i){return e.i===2&&(n=qo(void 0,n,!0),es(t,0|t[se],r,!0).push(n),mc(e,n,i),!0)}),(function(e,t,r,n,i){if(Array.isArray(t))for(let o=0;o<t.length;o++)G1(e,t[o],r,n,i)})),ft=yu((function(e,t,r,n,i,o){return e.i===2&&(b1(t,0|t[se],o,r),mc(e,t=su(t,n,r),i),!0)}),G1),X1=wt((function(e,t,r){return e.i===2&&(St(t,r,A1(e)),!0)}),q1,O1),J_=wt((function(e,t,r){return e.i===0&&(St(t,r,(e=Bt(e.g)>>>0)===0?void 0:e),!0)}),(function(e,t,r){t=(function(n){if(n==null)return n;if(typeof n=="string"&&n)n=+n;else if(typeof n!="number")return;return fc(n)?n>>>0:void 0})(t),t!=null&&t!=null&&(kr(e,r,0),ts(e.g,t))}),Er()),Jn=wt((function(e,t,r){return e.i===0&&(St(t,r,Bt(e.g)),!0)}),(function(e,t,r){(t=Xn(t))!=null&&(t=parseInt(t,10),kr(e,r,0),gc(e.g,t))}),B1),oc=class{constructor(t,r){this.i=t,this.g=r,this.j=Sr,this.defaultValue=void 0}};function J1(e,t){return(r,n)=>{if(Xa.length){let o=Xa.pop();o.o(n),Rd(o.g,r,n),r=o}else r=new class{constructor(o,s){if(S0.length){let a=S0.pop();Rd(a,o,s),o=a}else o=new class{constructor(a,c){this.i=null,this.m=!1,this.g=this.j=this.s=0,Rd(this,a,c)}clear(){this.i=null,this.m=!1,this.g=this.j=this.s=0,this.C=!1}}(o,s);this.g=o,this.j=this.g.g,this.i=this.m=-1,this.o(s)}o({G:o=!1}={}){this.G=o}}(r,n);try{let o=new e,s=o.l;wu(t)(s,r);var i=o}finally{r.g.clear(),r.m=-1,r.i=-1,Xa.length<100&&Xa.push(r)}return i}}var T0=[0,_n,wt((function(e,t,r){return e.i===2&&(St(t,r,(e=A1(e))===Zi()?void 0:e),!0)}),(function(e,t,r){if(t!=null){if(t instanceof Ue){let n=t.R;return void(n&&(t=n(t),t!=null&&vc(e,r,lu(t).buffer)))}if(Array.isArray(t))return}q1(e,t,r)}),O1)],Dd,I0=globalThis.trustedTypes;function R0(e){Dd===void 0&&(Dd=(function(){let r=null;if(!I0)return r;try{let n=i=>i;r=I0.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch{}return r})());var t=Dd;return new class{constructor(r){this.g=r}toString(){return this.g+""}}(t?t.createScriptURL(e):e)}function Y_(e,...t){if(t.length===0)return R0(e[0]);let r=e[0];for(let n=0;n<t.length;n++)r+=encodeURIComponent(t[n])+e[n+1];return R0(r)}var Y1=[0,En,Jn,Wt,-1,Su,Jn,-1],Z_=class extends Ue{constructor(e){super(e)}},Z1=[0,Wt,Ze,Wt,Jn,-1,Ec((function(e,t,r){return(e.i===0||e.i===2)&&(t=es(t,0|t[se],r,!1,!1),e.i==2?fu(e,z_,t):t.push(Bt(e.g)),!0)}),(function(e,t,r){if((t=kc(Xn,t))!=null&&t.length){r=yc(e,r);for(let n=0;n<t.length;n++)gc(e.g,t[n]);bc(e,r)}}),B1),Ze,-1,[0,Wt,-1],Jn,Wt,-1],Q1=[0,Ze,-2],P0=class extends Ue{constructor(e){super(e)}},e2=[0],t2=[0,En,Wt,1,Wt,-3],r2=class extends Ue{constructor(e){super(e,2)}},Cc={};Cc[336783863]=[0,Ze,Wt,-1,En,[0,[1,2,3,4,5,6,7,8],ft,e2,ft,Z1,ft,Q1,ft,t2,ft,Y1,ft,[0,Ze,-2],ft,[0,Ze,Jn],ft,[0,Jn,Ze]],[0,Ze],Wt,[0,[1,3],[2,4],ft,[0,Su],-1,ft,[0,sr],-1,ar,[0,Ze,-1]],Ze];var D0,O0=[0,Pd,-1,Ji,-3,Pd,Su,_n,Gi,Pd,-1,Ji,Gi,Ji,-2,_n],ku=class extends Ue{constructor(e){super(e,500)}o(e){return Sr(this,0,7,e)}},Ko=[-1,{}],B0=[0,Ze,1,Ko],L0=[0,Ze,sr,Ko],Eu=class extends Ue{constructor(e){super(e,500)}o(e){return Sr(this,0,1001,e)}};Eu.prototype.g=(D0=[-500,ar,[-500,_n,-1,sr,-3,[-2,Cc,Wt],ar,T0,Gi,-1,B0,L0,ar,[0,_n,Ji],_n,O0,Gi,sr,987,sr],4,ar,[-500,Ze,-1,[-1,{}],998,Ze],ar,[-500,Ze,sr,-1,[-2,{},Wt],997,sr,-1],Gi,ar,[-500,Ze,sr,Ko,998,sr],sr,Gi,B0,L0,ar,[0,_n,-1,Ko],sr,-2,O0,_n,-1,Ji,[0,Ji,J_],978,Ko,ar,T0],function(){let e=new class{constructor(){this.j=[],this.i=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){let o=this.g;return this.g=[],o}}}};j1(this.l,e,Qn(_c,wc,Sc,D0)),to(e,e.g.end());let t=new Uint8Array(e.i),r=e.j,n=r.length,i=0;for(let o=0;o<n;o++){let s=r[o];t.set(s,i),i+=s.length}return e.j=[t],t});var Q_=class extends Ue{constructor(e){super(e)}},e3=class extends Ue{constructor(e){super(e)}g(){return au(this,Q_)}},t3=[0,ar,[0,En,K1,Ze,-1]],F0=class extends Ue{constructor(e){super(e)}},M0=class extends Ue{constructor(e){super(e)}},n2=[1,2,3,4,5],sc=class extends Ue{constructor(e){super(e)}g(){return m1(this)!=null}i(){return Sn(_r(this,2))!=null}},ac=class extends Ue{constructor(e){super(e)}},i2=class extends Ue{constructor(e){super(e)}},o2=[0,[0,X1,Ze,[0,En,ic,-1],[0,X_,ic]],Wt,[0,n2,ft,t2,ft,Z1,ft,Y1,ft,e2,ft,Q1],Jn],r3=new oc(451755788,i2);Cc[451755788]=[0,o2,[0,Ze,En,K1,sr,-1],q_];var U0=class extends Ue{constructor(e){super(e)}},s2=class extends Ue{constructor(e){super(e)}},n3=new oc(487277289,s2);Cc[487277289]=[0,o2,[0,Wt,-1]];var i3=class extends Ue{constructor(e){super(e)}},o3=J1(class extends Ue{constructor(e){super(e)}},[0,ar,[0,1,En,Ze,t3],ic]),N0=class extends Ue{constructor(e){super(e)}},s3=class extends Ue{constructor(e){super(e)}J(){let e=m1(this);return e??Zi()}},a3=class extends Ue{constructor(e){super(e)}},a2=[1,2],z0=J1(class extends Ue{constructor(e){super(e)}},[0,ar,[0,a2,ft,[0,K_],ft,[0,X1],En,Ze],ic]);function c3(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!(function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")})(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function j0(e){if(typeof importScripts!="function"){let t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise(((r,n)=>{t.addEventListener("load",(()=>{r()}),!1),t.addEventListener("error",(i=>{n(i)}),!1),document.body.appendChild(t)}))}importScripts(e.toString())}function ie(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.h.stringToNewUTF8(t)),e.h._free(t)}function V0(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");let n=new Uint32Array(t.length);for(let i=0;i<t.length;i++)n[i]=e.h.stringToNewUTF8(t[i]);t=e.h._malloc(4*n.length),e.h.HEAPU32.set(n,t>>2),r(t);for(let i of n)e.h._free(i);e.h._free(t)}function yn(e,t,r){e.h.simpleListeners=e.h.simpleListeners||{},e.h.simpleListeners[t]=r}function Gn(e,t,r){let n=[];e.h.simpleListeners=e.h.simpleListeners||{},e.h.simpleListeners[t]=(i,o,s)=>{o?(r(n,s),n=[]):n.push(i)}}var l3=(function(e){return class extends e{N(){this.h._registerModelResourcesGraphService()}}})(class{constructor(e,t){this.j=!0,this.h=e,this.g=null,this.i=0,this.m=typeof this.h._addIntToInputStream=="function",t!==void 0?this.h.canvas=t:c3()?this.h.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas"))}async initializeGraph(e){let t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){let r=e.length,n=this.h._malloc(r);this.h.HEAPU8.set(e,n),t?this.h._changeBinaryGraph(r,n):this.h._changeTextGraph(r,n),this.h._free(n)}configureAudio(e,t,r,n,i){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),ie(this,n||"input_audio",(o=>{ie(this,i=i||"audio_header",(s=>{this.h._configureAudio(o,s,e,t??0,r)}))}))}setAutoResizeCanvas(e){this.j=e}setAutoRenderToScreen(e){this.h._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.h.gpuOriginForWebTexturesIsBottomLeft=e}attachErrorListener(e){this.h.errorListener=e}attachEmptyPacketListener(e,t){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[e]=t}addAudioToStream(e,t,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,n,i){let o=4*e.length;this.i!==o&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(o),this.i=o),this.h.HEAPF32.set(e,this.g/4),ie(this,n,(s=>{this.h._addAudioToInputStream(this.g,t,r,s,i)}))}addGpuBufferToStream(e,t,r){ie(this,t,(n=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");n?this.h._bindTextureToStream(n):this.h._bindTextureToCanvas();let i=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!i)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.h.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),this.h.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let[o,s]=e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height];!this.j||o===this.h.canvas.width&&s===this.h.canvas.height||(this.h.canvas.width=o,this.h.canvas.height=s);let[a,c]=[o,s];this.h._addBoundTextureToStream(n,a,c,r)}))}addBoolToStream(e,t,r){ie(this,t,(n=>{this.h._addBoolToInputStream(e,n,r)}))}addDoubleToStream(e,t,r){ie(this,t,(n=>{this.h._addDoubleToInputStream(e,n,r)}))}addFloatToStream(e,t,r){ie(this,t,(n=>{this.h._addFloatToInputStream(e,n,r)}))}addIntToStream(e,t,r){ie(this,t,(n=>{this.h._addIntToInputStream(e,n,r)}))}addUintToStream(e,t,r){ie(this,t,(n=>{this.h._addUintToInputStream(e,n,r)}))}addStringToStream(e,t,r){ie(this,t,(n=>{ie(this,e,(i=>{this.h._addStringToInputStream(i,n,r)}))}))}addStringRecordToStream(e,t,r){ie(this,t,(n=>{V0(this,Object.keys(e),(i=>{V0(this,Object.values(e),(o=>{this.h._addFlatHashMapToInputStream(i,o,Object.keys(e).length,n,r)}))}))}))}addProtoToStream(e,t,r,n){ie(this,r,(i=>{ie(this,t,(o=>{let s=this.h._malloc(e.length);this.h.HEAPU8.set(e,s),this.h._addProtoToInputStream(s,e.length,o,i,n),this.h._free(s)}))}))}addEmptyPacketToStream(e,t){ie(this,e,(r=>{this.h._addEmptyPacketToInputStream(r,t)}))}addBoolVectorToStream(e,t,r){ie(this,t,(n=>{let i=this.h._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(let o of e)this.h._addBoolVectorEntry(i,o);this.h._addBoolVectorToInputStream(i,n,r)}))}addDoubleVectorToStream(e,t,r){ie(this,t,(n=>{let i=this.h._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(let o of e)this.h._addDoubleVectorEntry(i,o);this.h._addDoubleVectorToInputStream(i,n,r)}))}addFloatVectorToStream(e,t,r){ie(this,t,(n=>{let i=this.h._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(let o of e)this.h._addFloatVectorEntry(i,o);this.h._addFloatVectorToInputStream(i,n,r)}))}addIntVectorToStream(e,t,r){ie(this,t,(n=>{let i=this.h._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(let o of e)this.h._addIntVectorEntry(i,o);this.h._addIntVectorToInputStream(i,n,r)}))}addUintVectorToStream(e,t,r){ie(this,t,(n=>{let i=this.h._allocateUintVector(e.length);if(!i)throw Error("Unable to allocate new unsigned int vector on heap.");for(let o of e)this.h._addUintVectorEntry(i,o);this.h._addUintVectorToInputStream(i,n,r)}))}addStringVectorToStream(e,t,r){ie(this,t,(n=>{let i=this.h._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(let o of e)ie(this,o,(s=>{this.h._addStringVectorEntry(i,s)}));this.h._addStringVectorToInputStream(i,n,r)}))}addBoolToInputSidePacket(e,t){ie(this,t,(r=>{this.h._addBoolToInputSidePacket(e,r)}))}addDoubleToInputSidePacket(e,t){ie(this,t,(r=>{this.h._addDoubleToInputSidePacket(e,r)}))}addFloatToInputSidePacket(e,t){ie(this,t,(r=>{this.h._addFloatToInputSidePacket(e,r)}))}addIntToInputSidePacket(e,t){ie(this,t,(r=>{this.h._addIntToInputSidePacket(e,r)}))}addUintToInputSidePacket(e,t){ie(this,t,(r=>{this.h._addUintToInputSidePacket(e,r)}))}addStringToInputSidePacket(e,t){ie(this,t,(r=>{ie(this,e,(n=>{this.h._addStringToInputSidePacket(n,r)}))}))}addProtoToInputSidePacket(e,t,r){ie(this,r,(n=>{ie(this,t,(i=>{let o=this.h._malloc(e.length);this.h.HEAPU8.set(e,o),this.h._addProtoToInputSidePacket(o,e.length,i,n),this.h._free(o)}))}))}addBoolVectorToInputSidePacket(e,t){ie(this,t,(r=>{let n=this.h._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let i of e)this.h._addBoolVectorEntry(n,i);this.h._addBoolVectorToInputSidePacket(n,r)}))}addDoubleVectorToInputSidePacket(e,t){ie(this,t,(r=>{let n=this.h._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let i of e)this.h._addDoubleVectorEntry(n,i);this.h._addDoubleVectorToInputSidePacket(n,r)}))}addFloatVectorToInputSidePacket(e,t){ie(this,t,(r=>{let n=this.h._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let i of e)this.h._addFloatVectorEntry(n,i);this.h._addFloatVectorToInputSidePacket(n,r)}))}addIntVectorToInputSidePacket(e,t){ie(this,t,(r=>{let n=this.h._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let i of e)this.h._addIntVectorEntry(n,i);this.h._addIntVectorToInputSidePacket(n,r)}))}addUintVectorToInputSidePacket(e,t){ie(this,t,(r=>{let n=this.h._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let i of e)this.h._addUintVectorEntry(n,i);this.h._addUintVectorToInputSidePacket(n,r)}))}addStringVectorToInputSidePacket(e,t){ie(this,t,(r=>{let n=this.h._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let i of e)ie(this,i,(o=>{this.h._addStringVectorEntry(n,o)}));this.h._addStringVectorToInputSidePacket(n,r)}))}attachBoolListener(e,t){yn(this,e,t),ie(this,e,(r=>{this.h._attachBoolListener(r)}))}attachBoolVectorListener(e,t){Gn(this,e,t),ie(this,e,(r=>{this.h._attachBoolVectorListener(r)}))}attachIntListener(e,t){yn(this,e,t),ie(this,e,(r=>{this.h._attachIntListener(r)}))}attachIntVectorListener(e,t){Gn(this,e,t),ie(this,e,(r=>{this.h._attachIntVectorListener(r)}))}attachUintListener(e,t){yn(this,e,t),ie(this,e,(r=>{this.h._attachUintListener(r)}))}attachUintVectorListener(e,t){Gn(this,e,t),ie(this,e,(r=>{this.h._attachUintVectorListener(r)}))}attachDoubleListener(e,t){yn(this,e,t),ie(this,e,(r=>{this.h._attachDoubleListener(r)}))}attachDoubleVectorListener(e,t){Gn(this,e,t),ie(this,e,(r=>{this.h._attachDoubleVectorListener(r)}))}attachFloatListener(e,t){yn(this,e,t),ie(this,e,(r=>{this.h._attachFloatListener(r)}))}attachFloatVectorListener(e,t){Gn(this,e,t),ie(this,e,(r=>{this.h._attachFloatVectorListener(r)}))}attachStringListener(e,t){yn(this,e,t),ie(this,e,(r=>{this.h._attachStringListener(r)}))}attachStringVectorListener(e,t){Gn(this,e,t),ie(this,e,(r=>{this.h._attachStringVectorListener(r)}))}attachProtoListener(e,t,r){yn(this,e,t),ie(this,e,(n=>{this.h._attachProtoListener(n,r||!1)}))}attachProtoVectorListener(e,t,r){Gn(this,e,t),ie(this,e,(n=>{this.h._attachProtoVectorListener(n,r||!1)}))}attachAudioListener(e,t,r){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),yn(this,e,((n,i)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),t(n,i)})),ie(this,e,(n=>{this.h._attachAudioListener(n,r||!1)}))}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}}),c2=class extends l3{};async function h3(e,t,r){return e=await(async(n,i,o,s)=>{if(i&&await j0(i),!self.ModuleFactory||o&&(await j0(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&s&&((i=self.Module).locateFile=s.locateFile,s.mainScriptUrlOrBlob&&(i.mainScriptUrlOrBlob=s.mainScriptUrlOrBlob)),s=await self.ModuleFactory(self.Module||s),self.ModuleFactory=self.Module=void 0,new n(s,null)})(e,t.wasmLoaderPath,t.assetLoaderPath,{locateFile:n=>n.endsWith(".wasm")?t.wasmBinaryPath.toString():t.assetBinaryPath&&n.endsWith(".data")?t.assetBinaryPath.toString():n}),await e.o(r),e}async function l2(e,t,r){return h3(e,t,r)}function Od(e,t){let r=wr(e.baseOptions,sc,1)||new sc;typeof t=="string"?(pt(r,2,rc(t)),pt(r,1)):t instanceof Uint8Array&&(pt(r,1,t1(t,!1)),pt(r,2)),Sr(e.baseOptions,0,1,r)}function h2(e,t){let r=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(wr(e.baseOptions,sc,1)?.g()||wr(e.baseOptions,sc,1)?.i()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if((function(n,i){let o=wr(n.baseOptions,M0,3);if(!o){var s=o=new M0;Id(s,4,new P0)}"delegate"in i&&(i.delegate==="GPU"?Id(i=o,2,s=new Z_):Id(i=o,4,s=new P0)),Sr(n.baseOptions,0,3,o)})(e,r),r.modelAssetPath)return fetch(r.modelAssetPath.toString()).then((n=>{if(n.ok)return n.arrayBuffer();throw Error(`Failed to fetch model: ${r.modelAssetPath} (${n.status})`)})).then((n=>{try{e.g.h.FS_unlink("/model.dat")}catch{}e.g.h.FS_createDataFile("/","model.dat",new Uint8Array(n),!0,!1,!1),Od(e,"/model.dat"),e.v()}));if(r.modelAssetBuffer instanceof Uint8Array)Od(e,r.modelAssetBuffer);else if(r.modelAssetBuffer)return(async function(n){let i=[];for(var o=0;;){let{done:s,value:a}=await n.read();if(s)break;i.push(a),o+=a.length}if(i.length===0)return new Uint8Array(0);if(i.length===1)return i[0];n=new Uint8Array(o),o=0;for(let s of i)n.set(s,o),o+=s.length;return n})(r.modelAssetBuffer).then((n=>{Od(e,n),e.v()}));return e.v(),Promise.resolve()}function H0(e){try{let t=e.j.length;if(t===1)throw Error(e.j[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.j.map((r=>r.message)).join(", "))}finally{e.j=[]}}function qi(e,t){e.s=Math.max(e.s,t)}var Za=class{constructor(e){this.g=e,this.j=[],this.s=0,this.g.setAutoRenderToScreen(!1)}setGraph(e,t){this.g.attachErrorListener(((r,n)=>{this.j.push(Error(n))})),this.g.N(),this.g.setGraph(e,t),H0(this)}finishProcessing(){this.g.finishProcessing(),H0(this)}close(){this.g.closeGraph()}};async function Xo(e,t,r){return l2(e,t,r)}Za.prototype.close=Za.prototype.close,(function(e,t){e=e.split(".");var r,n=Kn;for((e[0]in n)||n.execScript===void 0||n.execScript("var "+e[0]);e.length&&(r=e.shift());)e.length||t===void 0?n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}:n[r]=t})("TaskRunner",Za);var cc=class extends Za{constructor(){super(...arguments),this.F=48e3}O(e){this.F=e}};function d3(e){let t={classifications:au(e,i3).map((r=>(function(n,i=-1,o=""){return{categories:n.map((s=>{var a=Xn(_r(s,1))??0??-1;let c=s.l,l=0|c[se],h=Zn(c,l,2),d=Qo(h);return d!=null&&d!==h&&lt(c,l,2,d),{index:a,score:d??0??0,categoryName:Sn(_r(s,3))??""??"",displayName:Sn(_r(s,4))??""??""}})),headIndex:i,headName:o}})(wr(r,e3,4)?.g()??[],Xn(_r(r,2))??0,Sn(_r(r,3))??"")))};return Md(_r(e,2))!=null&&(t.timestampMs=Md(_r(e,2))??0),t}cc.prototype.setDefaultSampleRate=cc.prototype.O;var or=class extends cc{constructor(e,t){super(new c2(e,t)),this.m=[],Sr(e=this.i=new i2,0,1,t=new ac)}get baseOptions(){return wr(this.i,ac,1)}set baseOptions(e){Sr(this.i,0,1,e)}o(e){var t=this.i,r=wr(this.i,F0,2);if(r=r?p1(r):new F0,e.displayNamesLocale!==void 0?pt(r,1,rc(e.displayNamesLocale)):e.displayNamesLocale===void 0&&pt(r,1),e.maxResults!==void 0){var n=e.maxResults;if(n!=null){if(typeof n!="number"||!fc(n))throw f0();n|=0}pt(r,2,n)}else"maxResults"in e&&pt(r,2);if(e.scoreThreshold!==void 0){if((n=e.scoreThreshold)!=null&&typeof n!="number")throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);pt(r,3,n)}else"scoreThreshold"in e&&pt(r,3);return e.categoryAllowlist!==void 0?w0(r,4,e.categoryAllowlist):"categoryAllowlist"in e&&pt(r,4),e.categoryDenylist!==void 0?w0(r,5,e.categoryDenylist):"categoryDenylist"in e&&pt(r,5),Sr(t,0,2,r),h2(this,e)}K(e,t){return this.D(e,t??this.F,this.s+1)}D(e,t,r){return this.g.addDoubleToStream(t,"sample_rate",r),this.g.addAudioToStreamWithShape(e,1,e.length,"audio_in",r),this.m=[],this.finishProcessing(),[...this.m]}v(){var e=new Eu;Ot(e,10,"audio_in"),Ot(e,10,"sample_rate"),Ot(e,15,"timestamped_classifications");let t=new r2;T1(t,r3,this.i);let r=new ku;y1(r,rc("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph")),Ot(r,3,"AUDIO:audio_in"),Ot(r,3,"SAMPLE_RATE:sample_rate"),Ot(r,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),r.o(t),w1(e,r),this.g.attachProtoVectorListener("timestamped_classifications",((n,i)=>{(function(o,s){s.forEach((a=>{a=o3(a),o.m.push(d3(a))}))})(this,n),qi(this,i)})),this.g.attachEmptyPacketListener("timestamped_classifications",(n=>{qi(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function W0(e){return{embeddings:au(e,a3).map((t=>{let r={headIndex:Xn(_r(t,3))??0??-1,headName:Sn(_r(t,4))??""??""};if(v1(t,N0,Td(t,1))!==void 0)r.floatEmbedding=g1(wr(t,N0,Td(t,1)),1,Qo,r1===void 0?2:4).slice();else{let n=new Uint8Array(0);r.quantizedEmbedding=wr(t,s3,Td(t,2))?.J()?.i()??n}return r})),timestampMs:Md(_r(e,2))??0}}or.prototype.classify=or.prototype.K,or.prototype.setOptions=or.prototype.o,or.createFromModelPath=function(e,t){return l2(or,e,{baseOptions:{modelAssetPath:t}})},or.createFromModelBuffer=function(e,t){return Xo(or,e,{baseOptions:{modelAssetBuffer:t}})},or.createFromOptions=function(e,t){return Xo(or,e,t)};var Fr=class extends cc{constructor(e,t){super(new c2(e,t)),this.m=[],Sr(e=this.i=new s2,0,1,t=new ac)}get baseOptions(){return wr(this.i,ac,1)}set baseOptions(e){Sr(this.i,0,1,e)}o(e){var t=this.i,r=wr(this.i,U0,2);return r=r?p1(r):new U0,e.l2Normalize!==void 0?pt(r,1,v0(e.l2Normalize)):"l2Normalize"in e&&pt(r,1),e.quantize!==void 0?pt(r,2,v0(e.quantize)):"quantize"in e&&pt(r,2),Sr(t,0,2,r),h2(this,e)}L(e,t){return this.D(e,t??this.F,this.s+1)}D(e,t,r){return this.g.addDoubleToStream(t,"sample_rate",r),this.g.addAudioToStreamWithShape(e,1,e.length,"audio_in",r),this.m=[],this.finishProcessing(),this.m}v(){var e=new Eu;Ot(e,10,"audio_in"),Ot(e,10,"sample_rate"),Ot(e,15,"embeddings_out"),Ot(e,15,"timestamped_embeddings_out");let t=new r2;T1(t,n3,this.i);let r=new ku;y1(r,rc("mediapipe.tasks.audio.audio_embedder.AudioEmbedderGraph")),Ot(r,3,"AUDIO:audio_in"),Ot(r,3,"SAMPLE_RATE:sample_rate"),Ot(r,4,"EMBEDDINGS:embeddings_out"),Ot(r,4,"TIMESTAMPED_EMBEDDINGS:timestamped_embeddings_out"),r.o(t),w1(e,r),this.g.attachProtoListener("embeddings_out",((n,i)=>{n=z0(n),this.m.push(W0(n)),qi(this,i)})),this.g.attachEmptyPacketListener("embeddings_out",(n=>{qi(this,n)})),this.g.attachProtoVectorListener("timestamped_embeddings_out",((n,i)=>{for(let o of n)n=z0(o),this.m.push(W0(n));qi(this,i)})),this.g.attachEmptyPacketListener("timestamped_embeddings_out",(n=>{qi(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}},Ja;Fr.prototype.embed=Fr.prototype.L,Fr.prototype.setOptions=Fr.prototype.o,Fr.createFromModelPath=function(e,t){return Xo(Fr,e,{baseOptions:{modelAssetPath:t}})},Fr.createFromModelBuffer=function(e,t){return Xo(Fr,e,{baseOptions:{modelAssetBuffer:t}})},Fr.createFromOptions=function(e,t){return Xo(Fr,e,t)};var u3=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function d2(){if(Ja===void 0)try{await WebAssembly.instantiate(u3),Ja=!0}catch{Ja=!1}return Ja}async function Wo(e,t=Y_``){let r=await d2()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var bn=class{};bn.forVisionTasks=function(e){return Wo("vision",e)},bn.forTextTasks=function(e){return Wo("text",e)},bn.forGenAiExperimentalTasks=function(e){return Wo("genai_experimental",e)},bn.forGenAiTasks=function(e){return Wo("genai",e)},bn.forAudioTasks=function(e){return Wo("audio",e)},bn.isSimdSupported=function(){return d2()};function f3(e,t){let r=e.reduce((a,c)=>a+c.length,0),n=new ArrayBuffer(44+r*2),i=new DataView(n),o=(a,c,l)=>{for(let h=0;h<l.length;h++)a.setUint8(c+h,l.charCodeAt(h))};o(i,0,"RIFF"),i.setUint32(4,36+r*2,!0),o(i,8,"WAVE"),o(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,t,!0),i.setUint32(28,t*2,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0),o(i,36,"data"),i.setUint32(40,r*2,!0);let s=44;for(let a of e)for(let c=0;c<a.length;c++){let l=Math.max(-1,Math.min(1,a[c]));i.setInt16(s,l<0?l*32768:l*32767,!0),s+=2}return new Blob([i],{type:"audio/wav"})}var xc=class{constructor(t,r,n,i,o,s,a){this.recordingInProgress=!1;this.recordIndex=1;this.countLoopTimes=0;this.examStartTime=0;this.recordingStartTime=0;this.recordingEndTime=0;this.isSpeech=!1;this.preRollBuffer=[];this.recordingChunks=[];this.PRE_ROLL_SECONDS=2;this.SAMPLE_RATE=16e3;this.MAX_PRE_ROLL_CHUNKS=4;this.lastNoiseTime=0;this.SILENCE_THRESHOLD=3e3;this.optionsProctoring=t,this.proctoringSession=r,this.paramsConfig=n,this.cameraRecorder=i,this.onRealtimeAlertsCallback=o,this.backend=s,this.backendToken=a}setProctoringId(t){this.proctoringId=t,this.proctoringId&&this.backend&&(this.upload=new Jr(this.proctoringId,this.backend))}async startRecording(){this.examStartTime=Date.now(),await this.createAudioClassifier(),this.audioRecorder=new $a(void 0,this.paramsConfig.audioBehaviourParameters),this.intervalNoiseDetection=setInterval(()=>this.onNoiseDetectedRecord(),200),this.streamingAudioClassification()}async stopRecording(){clearInterval(this.intervalNoiseDetection),await this.stopSoundRecord(),await this.volumeMeter&&this.volumeMeter.stop(),this.audioWorkletNode&&this.audioWorkletNode.disconnect()}async pauseRecording(){}async resumeRecording(){}async saveOnSession(t){}async onNoiseDetectedRecord(){!this.volumeMeter&&this.cameraRecorder.cameraStream&&(this.volumeMeter=new gn(this.cameraRecorder.cameraStream),this.volumeMeter.start().catch(i=>{console.log(i),this.volumeMeter=void 0}));let t=this.paramsConfig.audioBehaviourParameters?.noiseLimit||40,r=this.volumeMeter?.getVolume()||0;this.isSpeech=this.isSpeech||this.hasDesiredResult(this.audioClassificationResult),!this.isSpeech&&!this.recordingInProgress&&(t=t*1.25);let n=r>=t;if(n&&(this.lastNoiseTime=Date.now()),n&&!this.recordingInProgress){this.recordingInProgress=!0,this.recordingChunks=[...this.preRollBuffer];let o=this.preRollBuffer.reduce((a,c)=>a+c.length,0)/this.SAMPLE_RATE*1e3,s=Date.now()-this.examStartTime;this.recordingStartTime=s-o,this.recordingStartTime<0&&(this.recordingStartTime=0)}else if(this.recordingInProgress){let i=Date.now()-this.lastNoiseTime,o=Date.now()-this.recordingStartTime;i>=this.SILENCE_THRESHOLD&&o>=3e3&&this.countLoopTimes>4&&(await this.stopSoundRecord(),this.paramsConfig.videoBehaviourParameters?.detectNoise&&!this.isSpeech&&this.onRealtimeAlertsCallback({status:"ALERT",description:"Barulho detectado",type:"audio_detection_on_stream"}),this.paramsConfig.videoBehaviourParameters?.detectSpeech&&this.isSpeech&&this.onRealtimeAlertsCallback({status:"ALERT",description:"Fala detectada",type:"audio_detection_on_stream"}),this.recordingInProgress=!1,this.recordIndex++,this.countLoopTimes=0,this.isSpeech=!1),this.countLoopTimes++}}async stopSoundRecord(){if(!this.recordingInProgress&&this.recordingChunks.length===0||(this.recordingEndTime=Date.now()-this.examStartTime,this.optionsProctoring.proctoringType!=="REALTIME"))return;let t=f3(this.recordingChunks,this.SAMPLE_RATE),r=new File([t],`EP_${this.proctoringSession.id}_${this.recordingStartTime}_${this.recordingEndTime}_${this.isSpeech?"speech":"noise"}.wav`,{type:"audio/wav"});this.uploadRecord(r),this.recordingChunks=[],this.recordingInProgress=!1}download(t){let r=URL.createObjectURL(t),n=document.createElement("a");document.body.appendChild(n),n.style.display="none",n.href=r,n.download=t.name,n.click(),window.URL.revokeObjectURL(r)}uploadRecord(t){t&&this.upload&&this.backendToken&&this.upload.upload({file:t},this.backendToken)}hasDesiredResult(t){if(t==null)return!1;for(let r of t){let n=r.name.toLowerCase().includes("speech");if(this.optionsProctoring.proctoringType!=="REALTIME")return n;let i=parseFloat(r.score)>.22;if(n&&i)return!0}return!1}async createAudioClassifier(){let t=await bn.forAudioTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-audio@0.10.0/wasm");this.audioClassifier=await or.createFromOptions(t,{scoreThreshold:.15,maxResults:1,baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/audio_classifier/yamnet/float32/1/yamnet.tflite"}})}async streamingAudioClassification(){this.context=new AudioContext({sampleRate:this.SAMPLE_RATE});try{await this.context.audioWorklet.addModule(URL.createObjectURL(new Blob([p3],{type:"text/javascript"})))}catch{throw new Error("\u274C Error loading audio worklet module")}let t=this.context.createMediaStreamSource(this.cameraRecorder.cameraStream);this.audioWorkletNode=new AudioWorkletNode(this.context,"audio-processor"),this.audioWorkletNode.port.onmessage=r=>{let n=r.data;this.preRollBuffer.push(n),this.preRollBuffer.length>this.MAX_PRE_ROLL_CHUNKS&&this.preRollBuffer.shift(),this.recordingInProgress&&this.recordingChunks.push(n);let o=this.audioClassifier.classify(n)[0].classifications[0].categories;o.length>0&&(this.audioClassificationResult=[{name:o[0].categoryName,score:o[0].score.toFixed(3)}])},t.connect(this.audioWorkletNode),this.audioWorkletNode.connect(this.context.destination)}},p3=`
435
+ Size: ${t.file.size}`,s),o}}throw new Error("Could not upload")}};var Wa=class{constructor(t,r){this.alerts=[];this.lastActivityTime=Date.now();this.IDLE_THRESHOLD_MS=3e4;this.handleVisibilityChange=()=>{document.visibilityState==="visible"?this.handleReturnFocus():this.handleLostFocus()};this.handleLostFocus=()=>{if(this.getRelativeTime()>1e4){let t={begin:this.getRelativeTime(),end:0,alert:25,type:3};this.onLostFocusCallback(t),this.alerts.push(t)}};this.handleReturnFocus=()=>{let t=this.alerts[this.alerts.length-1];t&&(this.onFocusCallback({begin:t.begin,end:this.getRelativeTime(),alert:25,type:3}),t.end=this.getRelativeTime())};this.handleResize=()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{let t=window.screen.availWidth,r=window.outerWidth;if(r<t*.85){let n=`Split Screen Detectado: Janela ocupa ${(r/t*100).toFixed(0)}% da tela`;this.createAlert(43,3,n),this.onRealtimeAlertCallback&&this.onRealtimeAlertCallback({status:"ALERT",description:n,type:"split_screen"})}},1e3)};this.handleUserActivity=t=>{this.lastActivityTime=Date.now(),console.log("\u{1F449} handleUserActivity",t)};this.handleCopy=t=>{t.preventDefault();let r="Tentativa de Copiar (Clipboard)";this.createAlert(42,3,r),this.onRealtimeAlertCallback&&this.onRealtimeAlertCallback({status:"ALERT",description:r,type:"clipboard_copy"})};this.handleCut=t=>{t.preventDefault();let r="Tentativa de Recortar (Clipboard)";this.createAlert(42,3,r),this.onRealtimeAlertCallback&&this.onRealtimeAlertCallback({status:"ALERT",description:r,type:"clipboard_cut"})};this.handlePaste=t=>{t.preventDefault();let r="Tentativa de Colar (Clipboard)";this.createAlert(42,3,r),this.onRealtimeAlertCallback&&this.onRealtimeAlertCallback({status:"ALERT",description:r,type:"clipboard_paste"})};this.onLostFocusCallback=t.onLostFocusCallback,this.onFocusCallback=t.onFocusCallback,this.onRealtimeAlertCallback=t.onRealtimeAlertCallback,this.optionsProctoring=r}async startRecording(){this.startTime=new Date(Date.now()),this.alerts=[],this.attachListeners()}async pauseRecording(){this.detachListeners()}async resumeRecording(){this.attachListeners()}async stopRecording(){this.detachListeners()}async saveOnSession(t){this.alerts.forEach(r=>{t.addAlert(r)})}attachListeners(){this.optionsProctoring.captureScreen&&(window.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("resize",this.handleResize),window.document.addEventListener("copy",this.handleCopy),window.document.addEventListener("cut",this.handleCut),window.document.addEventListener("paste",this.handlePaste))}detachListeners(){window.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("resize",this.handleResize),window.document.removeEventListener("copy",this.handleCopy),window.document.removeEventListener("cut",this.handleCut),window.document.removeEventListener("paste",this.handlePaste)}addBackgroundEvent(t,r=200){this.createAlert(r,3,t),this.onRealtimeAlertCallback&&this.onRealtimeAlertCallback({status:"ALERT",description:t,type:"background_event"})}getRelativeTime(){return Date.now()-this.startTime.getTime()}createAlert(t,r,n){this.alerts.push({begin:this.getRelativeTime(),end:this.getRelativeTime(),alert:t,type:r})}addAlert({alert:t,type:r}){this.alerts.push({begin:Date.now()-this.startTime.getTime(),end:Date.now()-this.startTime.getTime(),alert:t,type:r})}};var $a=class{constructor(t,r){this.blobs=[];this.options={cameraId:void 0,microphoneId:void 0};this.audioParams={recordingBitrate:128};r&&(this.audioParams=r),t&&(this.options=t)}async startRecording(){let t={audio:{deviceId:this.options.microphoneId||"default"}};this.audioStream=await navigator.mediaDevices.getUserMedia(t);let{startRecording:r,stopRecording:n,pauseRecording:i,resumeRecording:o}=Wn(this.audioStream,this.blobs,void 0,void 0,!0);this.recordingStart=r,this.recordingStop=n,this.recordingPause=i,this.recordingResume=o,this.recordingStart()}async pauseRecording(){}async resumeRecording(){}async stopRecording(){this.recordingStop&&await this.recordingStop()}async saveOnSession(t,r,n){t.addRecording({device:"",file:new File(this.blobs,`EP_${t.id}_audio_${r&&n&&`${r}_${n}`||"0"}.webm`,{type:"audio/webm"}),origin:"Mic"})}};var Kn=typeof self<"u"?self:{};function $n(){throw Error("Invalid UTF8")}function c0(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}var Ga,Ed,g_=typeof TextDecoder<"u",y_,b_=typeof TextEncoder<"u";function $0(e){if(b_)e=(y_||=new TextEncoder).encode(e);else{let r=0,n=new Uint8Array(3*e.length);for(let i=0;i<e.length;i++){var t=e.charCodeAt(i);if(t<128)n[r++]=t;else{if(t<2048)n[r++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&i<e.length){let o=e.charCodeAt(++i);if(o>=56320&&o<=57343){t=1024*(t-55296)+o-56320+65536,n[r++]=t>>18|240,n[r++]=t>>12&63|128,n[r++]=t>>6&63|128,n[r++]=63&t|128;continue}i--}t=65533}n[r++]=t>>12|224,n[r++]=t>>6&63|128}n[r++]=63&t|128}}e=r===n.length?n:n.subarray(0,r)}return e}var Vd,Qa;e:{for(Cd=["CLOSURE_FLAGS"],qa=Kn,Ka=0;Ka<Cd.length;Ka++)if((qa=qa[Cd[Ka]])==null){Qa=null;break e}Qa=qa}var Cd,qa,Ka,Jo,l0=Qa&&Qa[610401301];Vd=l0!=null&&l0;var h0=Kn.navigator;function Bd(e){return!!Vd&&!!Jo&&Jo.brands.some((({brand:t})=>t&&t.indexOf(e)!=-1))}function cr(e){var t;return(t=Kn.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function vn(){return!!Vd&&!!Jo&&Jo.brands.length>0}function xd(){return vn()?Bd("Chromium"):(cr("Chrome")||cr("CriOS"))&&!(!vn()&&cr("Edge"))||cr("Silk")}Jo=h0&&h0.userAgentData||null;var v_=!vn()&&(cr("Trident")||cr("MSIE"));!cr("Android")||xd(),xd(),cr("Safari")&&(xd()||!vn()&&cr("Coast")||!vn()&&cr("Opera")||!vn()&&cr("Edge")||(vn()?Bd("Microsoft Edge"):cr("Edg/"))||vn()&&Bd("Opera"));var G0={},$o=null;function __(e){let t=e.length,r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);let n=new Uint8Array(r),i=0;return(function(o,s){function a(l){for(;c<o.length;){let h=o.charAt(c++),d=$o[h];if(d!=null)return d;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return l}q0();let c=0;for(;;){let l=a(-1),h=a(0),d=a(64),m=a(64);if(m===64&&l===-1)break;s(l<<2|h>>4),d!=64&&(s(h<<4&240|d>>2),m!=64&&s(d<<6&192|m))}})(e,(function(o){n[i++]=o})),i!==r?n.subarray(0,i):n}function q0(){if(!$o){$o={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=e.concat(t[r].split(""));G0[r]=n;for(let i=0;i<n.length;i++){let o=n[i];$o[o]===void 0&&($o[o]=i)}}}}var K0=typeof Uint8Array<"u",X0=!v_&&typeof btoa=="function";function d0(e){if(!X0){var t;t===void 0&&(t=0),q0(),t=G0[t];var r=Array(Math.floor(e.length/3)),n=t[64]||"";let c=0,l=0;for(;c<e.length-2;c+=3){var i=e[c],o=e[c+1],s=e[c+2],a=t[i>>2];i=t[(3&i)<<4|o>>4],o=t[(15&o)<<2|s>>6],s=t[63&s],r[l++]=a+i+o+s}switch(a=0,s=n,e.length-c){case 2:s=t[(15&(a=e[c+1]))<<2]||n;case 1:e=e[c],r[l]=t[e>>2]+t[(3&e)<<4|a>>4]+s+n}return r.join("")}for(t="",r=0,n=e.length-10240;r<n;)t+=String.fromCharCode.apply(null,e.subarray(r,r+=10240));return t+=String.fromCharCode.apply(null,r?e.subarray(r):e),btoa(t)}var u0=/[-_.]/g,w_={"-":"+",_:"/",".":"="};function S_(e){return w_[e]||""}function J0(e){if(!X0)return __(e);u0.test(e)&&(e=e.replace(u0,S_)),e=atob(e);let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function lc(e){return K0&&e!=null&&e instanceof Uint8Array}var Yi={};function Zi(){return k_||=new wn(null,Yi)}function Hd(e){Y0(Yi);var t=e.g;return(t=t==null||lc(t)?t:typeof t=="string"?J0(t):null)==null?t:e.g=t}var wn=class{i(){return new Uint8Array(Hd(this)||0)}constructor(e,t){if(Y0(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}},k_,E_;function Y0(e){if(e!==Yi)throw Error("illegal external caller")}function Z0(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function f0(){let e=Error("int32");return Z0(e,"warning"),e}var hc=typeof Symbol=="function"&&typeof Symbol()=="symbol",C_=new Set;function dc(e,t,r=!1,n=!1){return e=typeof Symbol=="function"&&typeof Symbol()=="symbol"?n&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t,r&&C_.add(e),e}var x_=dc("jas",void 0,!0,!0),Ad=dc(void 0,"2ex"),Ho=dc(void 0,"1oa",!0),Qi=dc(void 0,Symbol(),!0),se=hc?x_:"M",Q0={M:{value:0,configurable:!0,writable:!0,enumerable:!1}},e1=Object.defineProperties;function Wd(e,t){hc||se in e||e1(e,Q0),e[se]|=t}function ct(e,t){hc||se in e||e1(e,Q0),e[se]=t}function A_(e,t){ct(t,-30975&(0|e))}function Ld(e,t){ct(t,-30941&(34|e))}function $d(){return typeof BigInt=="function"}function lr(e){return Array.prototype.slice.call(e)}var Gd,Zo={},T_={};function p0(e){return!(!e||typeof e!="object"||e.g!==T_)}function qd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function t1(e,t){if(e!=null){if(typeof e=="string")e=e?new wn(e,Yi):Zi();else if(e.constructor!==wn)if(lc(e))e=e.length?new wn(new Uint8Array(e),Yi):Zi();else{if(!t)throw Error();e=void 0}}return e}function ec(e){return!(!Array.isArray(e)||e.length)&&!!(1&(0|e[se]))}var m0=[];function Yn(e){if(2&e)throw Error()}function Kd(e){return Qi?e[Qi]:void 0}ct(m0,55),Gd=Object.freeze(m0);var r1=Object.freeze({}),Xd=typeof Kn.BigInt=="function"&&typeof Kn.BigInt(0)=="bigint",Fd=e=>Xd?e>=R_&&e<=D_:e[0]==="-"?g0(e,I_):g0(e,P_),I_=Number.MIN_SAFE_INTEGER.toString(),R_=Xd?BigInt(Number.MIN_SAFE_INTEGER):void 0,P_=Number.MAX_SAFE_INTEGER.toString(),D_=Xd?BigInt(Number.MAX_SAFE_INTEGER):void 0;function g0(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let r=0;r<e.length;r++){let n=e[r],i=t[r];if(n>i)return!1;if(n<i)return!0}}var O_=typeof Uint8Array.prototype.slice=="function",n1,De=0,Ge=0;function y0(e){let t=e>>>0;De=t,Ge=(e-t)/4294967296>>>0}function eo(e){if(e<0){y0(-e);let[t,r]=Zd(De,Ge);De=t>>>0,Ge=r>>>0}else y0(e)}function i1(e){let t=n1||=new DataView(new ArrayBuffer(8));t.setFloat32(0,+e,!0),Ge=0,De=t.getUint32(0,!0)}function Jd(e,t){let r=4294967296*t+(e>>>0);return Number.isSafeInteger(r)?r:Yo(e,t)}function Yd(e,t){let r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Jd(e,t))=="number"?r?-e:e:r?"-"+e:e}function Yo(e,t){if(e>>>=0,(t>>>=0)<=2097151)var r=""+(4294967296*t+e);else $d()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,e>=1e7&&(r+=e/1e7>>>0,e%=1e7),r>=1e7&&(t+=r/1e7>>>0,r%=1e7),r=t+b0(r)+b0(e));return r}function b0(e){return e=String(e),"0000000".slice(e.length)+e}function uc(e){if(e.length<16)eo(Number(e));else if($d())e=BigInt(e),De=Number(e&BigInt(4294967295))>>>0,Ge=Number(e>>BigInt(32)&BigInt(4294967295));else{let t=+(e[0]==="-");Ge=De=0;let r=e.length;for(let n=t,i=(r-t)%6+t;i<=r;n=i,i+=6){let o=Number(e.slice(n,i));Ge*=1e6,De=1e6*De+o,De>=4294967296&&(Ge+=Math.trunc(De/4294967296),Ge>>>=0,De>>>=0)}if(t){let[n,i]=Zd(De,Ge);De=n,Ge=i}}}function Zd(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}var o1=typeof BigInt=="function"?BigInt.asIntN:void 0,B_=typeof BigInt=="function"?BigInt.asUintN:void 0,Go=Number.isSafeInteger,fc=Number.isFinite,tc=Math.trunc;function Qo(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function v0(e){if(e!=null&&typeof e!="boolean"){var t=typeof e;throw Error(`Expected boolean but got ${t!="object"?t:e?Array.isArray(e)?"array":t:"null"}: ${e}`)}return e}var L_=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Qd(e){switch(typeof e){case"bigint":return!0;case"number":return fc(e);case"string":return L_.test(e);default:return!1}}function Xn(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return fc(e)?0|e:void 0}function _0(e){if(e[0]==="-")return!1;let t=e.length;return t<20||t===20&&Number(e.substring(0,6))<184467}function s1(e){return e=tc(e),Go(e)||(eo(e),e=Yd(De,Ge)),e}function a1(e){var t=tc(Number(e));if(Go(t))return String(t);if((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),t=e.length,!(e[0]==="-"?t<20||t===20&&Number(e.substring(0,7))>-922337:t<19||t===19&&Number(e.substring(0,6))<922337))if(uc(e),e=De,2147483648&(t=Ge))if($d())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{let[r,n]=Zd(e,t);e="-"+Yo(r,n)}else e=Yo(e,t);return e}function Md(e){return e==null?e:typeof e=="bigint"?(Fd(e)?e=Number(e):(e=o1(64,e),e=Fd(e)?Number(e):String(e)),e):Qd(e)?typeof e=="number"?s1(e):a1(e):void 0}function F_(e){if(e==null)return e;var t=typeof e;if(t==="bigint")return String(B_(64,e));if(Qd(e)){if(t==="string")return t=tc(Number(e)),Go(t)&&t>=0?e=String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),_0(e)||(uc(e),e=Yo(De,Ge))),e;if(t==="number")return(e=tc(e))>=0&&Go(e)?e:(function(r){if(r<0){eo(r);var n=Yo(De,Ge);return r=Number(n),Go(r)?r:n}return _0(n=String(r))?n:(eo(r),Jd(De,Ge))})(e)}}function c1(e){if(typeof e!="string")throw Error();return e}function rc(e){if(e!=null&&typeof e!="string")throw Error();return e}function Sn(e){return e==null||typeof e=="string"?e:void 0}function l1(e,t,r){if(e!=null&&typeof e=="object"&&e.B===Zo)return e;if(Array.isArray(e)){var n=0|e[se],i=n;return i===0&&(i|=32&r),(i|=2&r)!==n&&ct(e,i),new t(e)}}function h1(e,t,r,n,i){if(e!=null){if(Array.isArray(e))e=ec(e)?void 0:i&&2&(0|e[se])?e:eu(e,t,r,n!==void 0,i);else if(qd(e)){let o={};for(let s in e)o[s]=h1(e[s],t,r,n,i);e=o}else e=t(e,n);return e}}function eu(e,t,r,n,i){let o=n||r?0|e[se]:0,s=n?!!(32&o):void 0;n=lr(e);for(let a=0;a<n.length;a++)n[a]=h1(n[a],t,r,s,i);return r&&((e=Kd(e))&&(n[Qi]=lr(e)),r(o,n)),n}function M_(e){return e.B===Zo?e.toJSON():(function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"bigint":return Fd(t)?Number(t):String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(ec(t))return}else{if(lc(t))return d0(t);if(t instanceof wn){let r=t.g;return r==null?"":typeof r=="string"?r:t.g=d0(r)}}}return t})(e)}function U_(e){return eu(e,M_,void 0,void 0,!1)}var d1,N_;function qo(e,t,r){return e=u1(e,t[0],t[1],r?1:2),t!==d1&&r&&Wd(e,16384),e}function u1(e,t,r,n){if(e==null){var i=96;r?(e=[r],i|=512):e=[],t&&(i=-33521665&i|(1023&t)<<15)}else{if(!Array.isArray(e))throw Error("narr");if(2048&(i=0|e[se]))throw Error("farr");if(64&i)return e;if(n===1||n===2||(i|=64),r&&(i|=512,r!==e[0]))throw Error("mid");e:{if(n=(r=e).length){let o=n-1;if(qd(r[o])){if((t=o-(512&(i|=256)?0:-1))>=1024)throw Error("pvtlmt");i=-33521665&i|(1023&t)<<15;break e}}if(t){if((t=Math.max(t,n-(512&i?0:-1)))>1024)throw Error("spvt");i=-33521665&i|(1023&t)<<15}}}return ct(e,i),e}function f1(e,t,r=Ld){if(e!=null){if(K0&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var n=0|e[se];return 2&n?e:(t&&=n===0||!!(32&n)&&!(64&n||!(16&n)),t?(ct(e,-12293&(34|n)),e):eu(e,f1,4&n?Ld:r,!0,!0))}return e.B===Zo&&(e=2&(n=0|(r=e.l)[se])?e:new e.constructor(pc(r,n,!0))),e}}function p1(e){let t=e.l;return new e.constructor(pc(t,0|t[se],!1))}function pc(e,t,r){let n=r||2&t?Ld:A_,i=!!(32&t);return e=(function(o,s,a){let c=lr(o);var l=c.length;let h=256&s?c[l-1]:void 0;for(l+=h?-1:0,s=512&s?1:0;s<l;s++)c[s]=a(c[s]);if(h){s=c[s]={};for(let d in h)s[d]=a(h[d])}return(o=Kd(o))&&(c[Qi]=lr(o)),c})(e,t,(o=>f1(o,i,n))),Wd(e,32|(r?2:0)),e}function tu(e){let t=e.l,r=0|t[se];return 2&r?new e.constructor(pc(t,r,!1)):e}function _r(e,t){return Zn(e=e.l,0|e[se],t)}function Zn(e,t,r,n){if(r===-1)return null;var i=r+(512&t?0:-1);let o=e.length-1;return i>=o&&256&t?e[o][r]:n&&256&t&&(t=e[o][r])!=null?(e[i]!=null&&Ad!=null&&((i=(e=E_??={})[Ad]||0)>=4||(e[Ad]=i+1,Z0(e=Error(),"incident"),(function(s){Kn.setTimeout((()=>{throw s}),0)})(e))),t):i<=o?e[i]:void 0}function pt(e,t,r){let n=e.l,i=0|n[se];return Yn(i),lt(n,i,t,r),e}function lt(e,t,r,n){let i=512&t?0:-1,o=r+i;var s=e.length-1;return o>=s&&256&t?(e[s][r]=n,t):o<=s?(e[o]=n,256&t&&r in(e=e[s])&&delete e[r],t):(n!==void 0&&(r>=(s=t>>15&1023||536870912)?n!=null&&(e[s+i]={[r]:n},ct(e,t|=256)):e[o]=n),t)}function m1(e){let t=0|(e=e.l)[se],r=Zn(e,t,1),n=t1(r,!0);return n!=null&&n!==r&&lt(e,t,1,n),n}function g1(e,t,r,n,i){let o=e.l,s=2&(e=0|o[se])?1:n;i=!!i;let a=0|(n=ru(o,e,t))[se];if(!(4&a)){4&a&&(n=lr(n),a=en(a,e),e=lt(o,e,t,n));let c=0,l=0;for(;c<n.length;c++){let h=r(n[c]);h!=null&&(n[l++]=h)}l<c&&(n.length=l),a=nu(a,e),r=-4097&(20|a),a=r&=-8193,ct(n,a),2&a&&Object.freeze(n)}return s===1||s===4&&32&a?Qr(a)||(i=a,a|=2,a!==i&&ct(n,a),Object.freeze(n)):(s===2&&Qr(a)&&(n=lr(n),a=en(a,e),a=kn(a,e,i),ct(n,a),e=lt(o,e,t,n)),Qr(a)||(t=a,a=kn(a,e,i),a!==t&&ct(n,a))),n}function ru(e,t,r,n){return e=Zn(e,t,r,n),Array.isArray(e)?e:Gd}function nu(e,t){return e===0&&(e=en(e,t)),1|e}function Qr(e){return!!(2&e)&&!!(4&e)||!!(2048&e)}function w0(e,t,r){let n=0|(e=e.l)[se];if(Yn(n),r==null)lt(e,n,t);else{var i=0|r[se],o=i,s=Qr(i),a=s||Object.isFrozen(r);for(s||(i=0),a||(r=lr(r),o=0,i=kn(i=en(i,n),n,!0),a=!1),i|=21,s=0;s<r.length;s++){let c=r[s],l=c1(c);Object.is(c,l)||(a&&(r=lr(r),o=0,i=kn(i=en(i,n),n,!0),a=!1),r[s]=l)}i!==o&&(a&&(r=lr(r),i=kn(i=en(i,n),n,!0)),ct(r,i)),lt(e,n,t,r)}}function y1(e,t){let r=0|(e=e.l)[se];Yn(r),lt(e,r,2,t===""?void 0:t)}function es(e,t,r,n,i){Yn(t);var o=!(!(64&t)&&16384&t);let s=(i=ru(e,t,r,i))!==Gd;if(o||!s){let a=o=s?0|i[se]:0;(!s||2&a||Qr(a)||4&a&&!(32&a))&&(i=lr(i),a=en(a,t),t=lt(e,t,r,i)),a=-13&nu(a,t),a=kn(n?-17&a:16|a,t,!0),a!==o&&ct(i,a)}return i}function Td(e,t){var r=a2;return ou(iu(e=e.l),e,0|e[se],r)===t?t:-1}function iu(e){if(hc)return e[Ho]??(e[Ho]=new Map);if(Ho in e)return e[Ho];let t=new Map;return Object.defineProperty(e,Ho,{value:t}),t}function b1(e,t,r,n){let i=iu(e),o=ou(i,e,t,r);return o!==n&&(o&&(t=lt(e,t,o)),i.set(r,n)),t}function ou(e,t,r,n){let i=e.get(n);if(i!=null)return i;i=0;for(let o=0;o<n.length;o++){let s=n[o];Zn(t,r,s)!=null&&(i!==0&&(r=lt(t,r,i)),i=s)}return e.set(n,i),i}function su(e,t,r,n){let i,o=0|e[se];if((n=Zn(e,o,r,n))!=null&&n.B===Zo)return(t=tu(n))!==n&&lt(e,o,r,t),t.l;if(Array.isArray(n)){let s=0|n[se];i=2&s?qo(pc(n,s,!1),t,!0):64&s?n:qo(i,t,!0)}else i=qo(void 0,t,!0);return i!==n&&lt(e,o,r,i),i}function v1(e,t,r,n){let i=0|(e=e.l)[se];return(t=l1(n=Zn(e,i,r,n),t,i))!==n&&t!=null&&lt(e,i,r,t),t}function wr(e,t,r){if((t=v1(e,t,r,!1))==null)return t;let n=0|(e=e.l)[se];if(!(2&n)){let i=tu(t);i!==t&&lt(e,n,r,t=i)}return t}function _1(e,t,r,n,i,o){e=e.l;var s=!!(2&t);let a=s?1:n;i=!!i,o&&=!s;var c=0|(n=ru(e,t,1))[se];if(!(s=!!(4&c))){var l=n,h=t;let d=!!(2&(c=nu(c,t)));d&&(h|=2);let m=!d,p=!0,g=0,f=0;for(;g<l.length;g++){let b=l1(l[g],r,h);if(b instanceof r){if(!d){let v=!!(2&(0|b.l[se]));m&&=!v,p&&=v}l[f++]=b}}f<g&&(l.length=f),c|=4,c=p?16|c:-17&c,ct(l,c=m?8|c:-9&c),d&&Object.freeze(l)}if(o&&!(8&c||!n.length&&(a===1||a===4&&32&c))){for(Qr(c)&&(n=lr(n),c=en(c,t),t=lt(e,t,1,n)),r=n,o=c,l=0;l<r.length;l++)(c=r[l])!==(h=tu(c))&&(r[l]=h);o|=8,ct(r,o=r.length?-17&o:16|o),c=o}return a===1||a===4&&32&c?Qr(c)||(t=c,(c|=!n.length||16&c&&(!s||32&c)?2:2048)!==t&&ct(n,c),Object.freeze(n)):(a===2&&Qr(c)&&(ct(n=lr(n),c=kn(c=en(c,t),t,i)),t=lt(e,t,1,n)),Qr(c)||(e=c,(c=kn(c,t,i))!==e&&ct(n,c))),n}function au(e,t){let r=0|e.l[se];return _1(e,r,t,r1===void 0?2:4,!1,!(2&r))}function Sr(e,t,r,n){return n==null&&(n=void 0),pt(e,r,n)}function Id(e,t,r){var n=n2;r==null&&(r=void 0);e:{let i=0|(e=e.l)[se];if(Yn(i),r==null){let o=iu(e);if(ou(o,e,i,n)!==t)break e;o.set(n,0)}else i=b1(e,i,n,t);lt(e,i,t,r)}}function en(e,t){return-2049&(e=32|(2&t?2|e:-3&e))}function kn(e,t,r){return 32&t&&r||(e&=-33),e}function w1(e,t){var r=ku;let n=0|e.l[se];Yn(n),e=_1(e,n,r,2,!0),t=t??new r,e.push(t),e[se]=2&(0|t.l[se])?-9&e[se]:-17&e[se]}function Ot(e,t,r){Yn(0|e.l[se]),g1(e,t,Sn,2,!0).push(c1(r))}function S1(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function cu(){return Error("Failed to read varint, encoding is invalid.")}function k1(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function lu(e){if(typeof e=="string")return{buffer:J0(e),u:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),u:!1};if(e.constructor===Uint8Array)return{buffer:e,u:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),u:!1};if(e.constructor===wn)return{buffer:Hd(e)||new Uint8Array(0),u:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),u:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function hu(e,t){let r,n=0,i=0,o=0,s=e.i,a=e.g;do r=s[a++],n|=(127&r)<<o,o+=7;while(o<32&&128&r);for(o>32&&(i|=(127&r)>>4),o=3;o<32&&128&r;o+=7)r=s[a++],i|=(127&r)<<o;if(qn(e,a),r<128)return t(n>>>0,i>>>0);throw cu()}function du(e){let t=0,r=e.g,n=r+10,i=e.i;for(;r<n;){let o=i[r++];if(t|=o,(128&o)==0)return qn(e,r),!!(127&t)}throw cu()}function Bt(e){let t=e.i,r=e.g,n=t[r++],i=127&n;if(128&n&&(n=t[r++],i|=(127&n)<<7,128&n&&(n=t[r++],i|=(127&n)<<14,128&n&&(n=t[r++],i|=(127&n)<<21,128&n&&(n=t[r++],i|=n<<28,128&n&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw cu();return qn(e,r),i}function Ud(e){var t=e.i;let r=e.g,n=t[r],i=t[r+1],o=t[r+2];return t=t[r+3],qn(e,e.g+4),(n<<0|i<<8|o<<16|t<<24)>>>0}function Nd(e){var t=Ud(e);e=2*(t>>31)+1;let r=t>>>23&255;return t&=8388607,r==255?t?NaN:e*(1/0):r==0?1401298464324817e-60*e*t:e*Math.pow(2,r-150)*(t+8388608)}function z_(e){return Bt(e)}function Rd(e,t,{C:r=!1}={}){e.C=r,t&&(t=lu(t),e.i=t.buffer,e.m=t.u,e.s=0,e.j=e.i.length,e.g=e.s)}function qn(e,t){if(e.g=t,t>e.j)throw k1(e.j,t)}function E1(e,t){if(t<0)throw Error(`Tried to read a negative byte length: ${t}`);let r=e.g,n=r+t;if(n>e.j)throw k1(t,e.j-r);return e.g=n,r}function C1(e,t){if(t==0)return Zi();var r=E1(e,t);return e.C&&e.m?r=e.i.subarray(r,r+t):(e=e.i,r=r===(t=r+t)?new Uint8Array(0):O_?e.slice(r,t):new Uint8Array(e.subarray(r,t))),r.length==0?Zi():new wn(r,Yi)}var S0=[];function x1(e){var t=e.g;if(t.g==t.j)return!1;e.j=e.g.g;var r=Bt(e.g)>>>0;if(t=r>>>3,!((r&=7)>=0&&r<=5))throw S1(r,e.j);if(t<1)throw Error(`Invalid field number: ${t} (at position ${e.j})`);return e.m=t,e.i=r,!0}function Ya(e){switch(e.i){case 0:e.i!=0?Ya(e):du(e.g);break;case 1:qn(e=e.g,e.g+8);break;case 2:if(e.i!=2)Ya(e);else{var t=Bt(e.g)>>>0;qn(e=e.g,e.g+t)}break;case 5:qn(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!x1(e))throw Error("Unmatched start-group tag: stream EOF");if(e.i==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}Ya(e)}break;default:throw S1(e.i,e.j)}}function mc(e,t,r){let n=e.g.j,i=Bt(e.g)>>>0,o=e.g.g+i,s=o-n;if(s<=0&&(e.g.j=o,r(t,e,void 0,void 0,void 0),s=o-e.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-s} bytes, either the data ended unexpectedly or the message misreported its own length`);e.g.g=o,e.g.j=n}function uu(e){var t=Bt(e.g)>>>0,r=E1(e=e.g,t);if(e=e.i,g_){var n,i=e;(n=Ed)||(n=Ed=new TextDecoder("utf-8",{fatal:!0})),t=r+t,i=r===0&&t===i.length?i:i.subarray(r,t);try{var o=n.decode(i)}catch(a){if(Ga===void 0){try{n.decode(new Uint8Array([128]))}catch{}try{n.decode(new Uint8Array([97])),Ga=!0}catch{Ga=!1}}throw!Ga&&(Ed=void 0),a}}else{t=(o=r)+t,r=[];let a,c=null;for(;o<t;){var s=e[o++];s<128?r.push(s):s<224?o>=t?$n():(a=e[o++],s<194||(192&a)!=128?(o--,$n()):r.push((31&s)<<6|63&a)):s<240?o>=t-1?$n():(a=e[o++],(192&a)!=128||s===224&&a<160||s===237&&a>=160||(192&(n=e[o++]))!=128?(o--,$n()):r.push((15&s)<<12|(63&a)<<6|63&n)):s<=244?o>=t-2?$n():(a=e[o++],(192&a)!=128||a-144+(s<<28)>>30!=0||(192&(n=e[o++]))!=128||(192&(i=e[o++]))!=128?(o--,$n()):(s=(7&s)<<18|(63&a)<<12|(63&n)<<6|63&i,s-=65536,r.push(55296+(s>>10&1023),56320+(1023&s)))):$n(),r.length>=8192&&(c=c0(c,r),r.length=0)}o=c0(c,r)}return o}function A1(e){let t=Bt(e.g)>>>0;return C1(e.g,t)}function fu(e,t,r){var n=Bt(e.g)>>>0;for(n=e.g.g+n;e.g.g<n;)r.push(t(e.g))}var Xa=[];function j_(e){return e}var Ki;function T1(e,t,r){t.g?t.j(e,t.g,t.i,r):t.j(e,t.i,r)}var Ue=class{constructor(e,t){this.l=u1(e,t)}toJSON(){let e=!Ki;try{return e&&(Ki=U_),I1(this)}finally{e&&(Ki=void 0)}}u(){return!!(2&(0|this.l[se]))}};function I1(e){var t=e.l;{t=(e=Ki(t))!==t;let l=e.length;if(l){var r=e[l-1],n=qd(r);n?l--:r=void 0;var i=e;if(n){e:{var o,s=r,a=!1;if(s)for(let h in s)isNaN(+h)?(o??={})[h]=s[h]:(n=s[h],Array.isArray(n)&&(ec(n)||p0(n)&&n.size===0)&&(n=null),n==null&&(a=!0),n!=null&&((o??={})[h]=n));if(a||(o=s),o)for(let h in o){a=o;break e}a=null}s=a==null?r!=null:a!==r}for(;l>0&&((o=i[l-1])==null||ec(o)||p0(o)&&o.size===0);l--)var c=!0;(i!==e||s||c)&&(t?(c||s||a)&&(i.length=l):i=Array.prototype.slice.call(i,0,l),a&&i.push(a)),c=i}else c=e}return c}function k0(e){return e?/^\d+$/.test(e)?(uc(e),new zd(De,Ge)):null:V_||=new zd(0,0)}Ue.prototype.B=Zo,Ue.prototype.toString=function(){try{return Ki=j_,I1(this).toString()}finally{Ki=void 0}};var zd=class{constructor(e,t){this.i=e>>>0,this.g=t>>>0}},V_;function E0(e){return e?/^-?\d+$/.test(e)?(uc(e),new jd(De,Ge)):null:H_||=new jd(0,0)}var jd=class{constructor(e,t){this.i=e>>>0,this.g=t>>>0}},H_;function Xi(e,t,r){for(;r>0||t>127;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function ts(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function gc(e,t){if(t>=0)ts(e,t);else{for(let r=0;r<9;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function nc(e,t){e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function to(e,t){t.length!==0&&(e.j.push(t),e.i+=t.length)}function kr(e,t,r){ts(e.g,8*t+r)}function yc(e,t){return kr(e,t,2),t=e.g.end(),to(e,t),t.push(e.i),t}function bc(e,t){var r=t.pop();for(r=e.i+e.g.length()-r;r>127;)t.push(127&r|128),r>>>=7,e.i++;t.push(r),e.i++}function vc(e,t,r){kr(e,t,2),ts(e.g,r.length),to(e,e.g.end()),to(e,r)}function Er(){let e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var pu=Er(),R1=Er(),mu=Er(),gu=Er(),P1=Er(),D1=Er(),O1=Er(),B1=Er(),ro=class{constructor(e,t,r){this.g=e,this.i=t,e=pu,this.j=!!e&&r===e||!1}};function yu(e,t){return new ro(e,t,pu)}function L1(e,t,r,n,i){(t=N1(t,n))!=null&&(r=yc(e,r),i(t,e),bc(e,r))}var W_=yu((function(e,t,r,n,i){return e.i===2&&(mc(e,su(t,n,r),i),!0)}),L1),$_=yu((function(e,t,r,n,i){return e.i===2&&(mc(e,su(t,n,r,!0),i),!0)}),L1),_c=Symbol(),bu=Symbol(),C0=Symbol(),x0=Symbol(),F1,M1;function Qn(e,t,r,n){var i=n[e];if(i)return i;(i={}).P=n,i.A=(function(d){switch(typeof d){case"boolean":return d1||=[0,void 0,!0];case"number":return d>0?void 0:d===0?N_||=[0,void 0]:[-d,void 0];case"string":return[0,d];case"object":return d}})(n[0]);var o=n[1];let s=1;o&&o.constructor===Object&&(i.H=o,typeof(o=n[++s])=="function"&&(i.I=!0,F1??=o,M1??=n[s+1],o=n[s+=2]));let a={};for(;o&&Array.isArray(o)&&o.length&&typeof o[0]=="number"&&o[0]>0;){for(var c=0;c<o.length;c++)a[o[c]]=o;o=n[++s]}for(c=1;o!==void 0;){let d;typeof o=="number"&&(c+=o,o=n[++s]);var l=void 0;if(o instanceof ro?d=o:(d=W_,s--),d?.j){o=n[++s],l=n;var h=s;typeof o=="function"&&(o=o(),l[h]=o),l=o}for(h=c+1,typeof(o=n[++s])=="number"&&o<0&&(h-=o,o=n[++s]);c<h;c++){let m=a[c];l?r(i,c,d,l,m):t(i,c,d,m)}}return n[e]=i}function U1(e){return Array.isArray(e)?e[0]instanceof ro?e:[$_,e]:[e,void 0]}function N1(e,t){return e instanceof Ue?e.l:Array.isArray(e)?qo(e,t,!1):void 0}function vu(e,t,r,n){let i=r.g;e[t]=n?(o,s,a)=>i(o,s,a,n):i}function _u(e,t,r,n,i){let o=r.g,s,a;e[t]=(c,l,h)=>o(c,l,h,a||=Qn(bu,vu,_u,n).A,s||=wu(n),i)}function wu(e){let t=e[C0];if(t!=null)return t;let r=Qn(bu,vu,_u,e);return t=r.I?(n,i)=>F1(n,i,r):(n,i)=>{let o=0|n[se];for(;x1(i)&&i.i!=4;){var s=i.m,a=r[s];if(a==null){var c=r.H;c&&(c=c[s])&&(c=G_(c))!=null&&(a=r[s]=c)}a!=null&&a(i,n,s)||(s=(a=i).j,Ya(a),a.G?a=void 0:(c=a.g.g-s,a.g.g=s,a=C1(a.g,c)),s=n,a&&((c=s[Qi])?c.push(a):s[Qi]=[a]))}return 16384&o&&Wd(n,34),!0},e[C0]=t}function G_(e){let t=(e=U1(e))[0].g;if(e=e[1]){let r=wu(e),n=Qn(bu,vu,_u,e).A;return(i,o,s)=>t(i,o,s,n,r)}return t}function wc(e,t,r){e[t]=r.i}function Sc(e,t,r,n){let i,o,s=r.i;e[t]=(a,c,l)=>s(a,c,l,o||=Qn(_c,wc,Sc,n).A,i||=z1(n))}function z1(e){let t=e[x0];if(!t){let r=Qn(_c,wc,Sc,e);t=(n,i)=>j1(n,i,r),e[x0]=t}return t}function j1(e,t,r){for(var n=0|e[se],i=512&n?0:-1,o=e.length,s=512&n?1:0,a=o+(256&n?-1:0);s<a;s++){let c=e[s];if(c==null)continue;let l=s-i,h=A0(r,l);h&&h(t,c,l)}if(256&n){n=e[o-1];for(let c in n)i=+c,Number.isNaN(i)||(o=n[i])!=null&&(a=A0(r,i))&&a(t,o,i)}if(e=Kd(e))for(to(t,t.g.end()),r=0;r<e.length;r++)to(t,Hd(e[r])||new Uint8Array(0))}function A0(e,t){var r=e[t];if(r)return r;if((r=e.H)&&(r=r[t])){var n=(r=U1(r))[0].i;if(r=r[1]){let i=z1(r),o=Qn(_c,wc,Sc,r).A;r=e.I?M1(o,i):(s,a,c)=>n(s,a,c,o,i)}else r=n;return e[t]=r}}function kc(e,t){if(Array.isArray(t)){var r=0|t[se];if(4&r)return t;for(var n=0,i=0;n<t.length;n++){let o=e(t[n]);o!=null&&(t[i++]=o)}return i<n&&(t.length=i),ct(t,-12289&(5|r)),2&r&&Object.freeze(t),t}}function wt(e,t,r){return new ro(e,t,r)}function Ec(e,t,r){return new ro(e,t,r)}function St(e,t,r){lt(e,0|e[se],t,r)}function V1(e,t,r){if(t=(function(n){if(n==null)return n;let i=typeof n;if(i==="bigint")return String(o1(64,n));if(Qd(n)){if(i==="string")return a1(n);if(i==="number")return s1(n)}})(t),t!=null&&(typeof t=="string"&&E0(t),t!=null))switch(kr(e,r,0),typeof t){case"number":e=e.g,eo(t),Xi(e,De,Ge);break;case"bigint":r=BigInt.asUintN(64,t),r=new jd(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),Xi(e.g,r.i,r.g);break;default:r=E0(t),Xi(e.g,r.i,r.g)}}function H1(e,t,r){(t=Xn(t))!=null&&t!=null&&(kr(e,r,0),gc(e.g,t))}function W1(e,t,r){(t=t==null||typeof t=="boolean"?t:typeof t=="number"?!!t:void 0)!=null&&(kr(e,r,0),e.g.g.push(t?1:0))}function $1(e,t,r){(t=Sn(t))!=null&&vc(e,r,$0(t))}function G1(e,t,r,n,i){(t=N1(t,n))!=null&&(r=yc(e,r),i(t,e),bc(e,r))}function q1(e,t,r){(t=t==null||typeof t=="string"||lc(t)||t instanceof wn?t:void 0)!=null&&vc(e,r,lu(t).buffer)}var q_=wt((function(e,t,r){if(e.i!==1)return!1;var n=e.g;e=Ud(n);let i=Ud(n);n=2*(i>>31)+1;let o=i>>>20&2047;return e=4294967296*(1048575&i)+e,St(t,r,o==2047?e?NaN:n*(1/0):o==0?5e-324*n*e:n*Math.pow(2,o-1075)*(e+4503599627370496)),!0}),(function(e,t,r){(t=Qo(t))!=null&&(kr(e,r,1),e=e.g,(r=n1||=new DataView(new ArrayBuffer(8))).setFloat64(0,+t,!0),De=r.getUint32(0,!0),Ge=r.getUint32(4,!0),nc(e,De),nc(e,Ge))}),Er()),K1=wt((function(e,t,r){return e.i===5&&(St(t,r,Nd(e.g)),!0)}),(function(e,t,r){(t=Qo(t))!=null&&(kr(e,r,5),e=e.g,i1(t),nc(e,De))}),D1),K_=Ec((function(e,t,r){return(e.i===5||e.i===2)&&(t=es(t,0|t[se],r,!1,!1),e.i==2?fu(e,Nd,t):t.push(Nd(e.g)),!0)}),(function(e,t,r){if((t=kc(Qo,t))!=null&&t.length){kr(e,r,2),ts(e.g,4*t.length);for(let n=0;n<t.length;n++)r=e.g,i1(t[n]),nc(r,De)}}),D1),ic=wt((function(e,t,r){return e.i===0&&(St(t,r,hu(e.g,Yd)),!0)}),V1,P1),Pd=wt((function(e,t,r){return e.i===0&&(St(t,r,(e=hu(e.g,Yd))===0?void 0:e),!0)}),V1,P1),X_=wt((function(e,t,r){return e.i===0&&(St(t,r,hu(e.g,Jd)),!0)}),(function(e,t,r){if((t=F_(t))!=null&&(typeof t=="string"&&k0(t),t!=null))switch(kr(e,r,0),typeof t){case"number":e=e.g,eo(t),Xi(e,De,Ge);break;case"bigint":r=BigInt.asUintN(64,t),r=new zd(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),Xi(e.g,r.i,r.g);break;default:r=k0(t),Xi(e.g,r.i,r.g)}}),Er()),En=wt((function(e,t,r){return e.i===0&&(St(t,r,Bt(e.g)),!0)}),H1,gu),Su=Ec((function(e,t,r){return(e.i===0||e.i===2)&&(t=es(t,0|t[se],r,!1,!1),e.i==2?fu(e,Bt,t):t.push(Bt(e.g)),!0)}),(function(e,t,r){if((t=kc(Xn,t))!=null&&t.length){r=yc(e,r);for(let n=0;n<t.length;n++)gc(e.g,t[n]);bc(e,r)}}),gu),Gi=wt((function(e,t,r){return e.i===0&&(St(t,r,(e=Bt(e.g))===0?void 0:e),!0)}),H1,gu),Wt=wt((function(e,t,r){return e.i===0&&(St(t,r,du(e.g)),!0)}),W1,R1),Ji=wt((function(e,t,r){return e.i===0&&(St(t,r,(e=du(e.g))===!1?void 0:e),!0)}),W1,R1),sr=Ec((function(e,t,r){return e.i===2&&(e=uu(e),es(t,0|t[se],r,!1).push(e),!0)}),(function(e,t,r){if((t=kc(Sn,t))!=null)for(let s=0;s<t.length;s++){var n=e,i=r,o=t[s];o!=null&&vc(n,i,$0(o))}}),mu),_n=wt((function(e,t,r){return e.i===2&&(St(t,r,(e=uu(e))===""?void 0:e),!0)}),$1,mu),Ze=wt((function(e,t,r){return e.i===2&&(St(t,r,uu(e)),!0)}),$1,mu),ar=(function(e,t,r=pu){return new ro(e,t,r)})((function(e,t,r,n,i){return e.i===2&&(n=qo(void 0,n,!0),es(t,0|t[se],r,!0).push(n),mc(e,n,i),!0)}),(function(e,t,r,n,i){if(Array.isArray(t))for(let o=0;o<t.length;o++)G1(e,t[o],r,n,i)})),ft=yu((function(e,t,r,n,i,o){return e.i===2&&(b1(t,0|t[se],o,r),mc(e,t=su(t,n,r),i),!0)}),G1),X1=wt((function(e,t,r){return e.i===2&&(St(t,r,A1(e)),!0)}),q1,O1),J_=wt((function(e,t,r){return e.i===0&&(St(t,r,(e=Bt(e.g)>>>0)===0?void 0:e),!0)}),(function(e,t,r){t=(function(n){if(n==null)return n;if(typeof n=="string"&&n)n=+n;else if(typeof n!="number")return;return fc(n)?n>>>0:void 0})(t),t!=null&&t!=null&&(kr(e,r,0),ts(e.g,t))}),Er()),Jn=wt((function(e,t,r){return e.i===0&&(St(t,r,Bt(e.g)),!0)}),(function(e,t,r){(t=Xn(t))!=null&&(t=parseInt(t,10),kr(e,r,0),gc(e.g,t))}),B1),oc=class{constructor(t,r){this.i=t,this.g=r,this.j=Sr,this.defaultValue=void 0}};function J1(e,t){return(r,n)=>{if(Xa.length){let o=Xa.pop();o.o(n),Rd(o.g,r,n),r=o}else r=new class{constructor(o,s){if(S0.length){let a=S0.pop();Rd(a,o,s),o=a}else o=new class{constructor(a,c){this.i=null,this.m=!1,this.g=this.j=this.s=0,Rd(this,a,c)}clear(){this.i=null,this.m=!1,this.g=this.j=this.s=0,this.C=!1}}(o,s);this.g=o,this.j=this.g.g,this.i=this.m=-1,this.o(s)}o({G:o=!1}={}){this.G=o}}(r,n);try{let o=new e,s=o.l;wu(t)(s,r);var i=o}finally{r.g.clear(),r.m=-1,r.i=-1,Xa.length<100&&Xa.push(r)}return i}}var T0=[0,_n,wt((function(e,t,r){return e.i===2&&(St(t,r,(e=A1(e))===Zi()?void 0:e),!0)}),(function(e,t,r){if(t!=null){if(t instanceof Ue){let n=t.R;return void(n&&(t=n(t),t!=null&&vc(e,r,lu(t).buffer)))}if(Array.isArray(t))return}q1(e,t,r)}),O1)],Dd,I0=globalThis.trustedTypes;function R0(e){Dd===void 0&&(Dd=(function(){let r=null;if(!I0)return r;try{let n=i=>i;r=I0.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch{}return r})());var t=Dd;return new class{constructor(r){this.g=r}toString(){return this.g+""}}(t?t.createScriptURL(e):e)}function Y_(e,...t){if(t.length===0)return R0(e[0]);let r=e[0];for(let n=0;n<t.length;n++)r+=encodeURIComponent(t[n])+e[n+1];return R0(r)}var Y1=[0,En,Jn,Wt,-1,Su,Jn,-1],Z_=class extends Ue{constructor(e){super(e)}},Z1=[0,Wt,Ze,Wt,Jn,-1,Ec((function(e,t,r){return(e.i===0||e.i===2)&&(t=es(t,0|t[se],r,!1,!1),e.i==2?fu(e,z_,t):t.push(Bt(e.g)),!0)}),(function(e,t,r){if((t=kc(Xn,t))!=null&&t.length){r=yc(e,r);for(let n=0;n<t.length;n++)gc(e.g,t[n]);bc(e,r)}}),B1),Ze,-1,[0,Wt,-1],Jn,Wt,-1],Q1=[0,Ze,-2],P0=class extends Ue{constructor(e){super(e)}},e2=[0],t2=[0,En,Wt,1,Wt,-3],r2=class extends Ue{constructor(e){super(e,2)}},Cc={};Cc[336783863]=[0,Ze,Wt,-1,En,[0,[1,2,3,4,5,6,7,8],ft,e2,ft,Z1,ft,Q1,ft,t2,ft,Y1,ft,[0,Ze,-2],ft,[0,Ze,Jn],ft,[0,Jn,Ze]],[0,Ze],Wt,[0,[1,3],[2,4],ft,[0,Su],-1,ft,[0,sr],-1,ar,[0,Ze,-1]],Ze];var D0,O0=[0,Pd,-1,Ji,-3,Pd,Su,_n,Gi,Pd,-1,Ji,Gi,Ji,-2,_n],ku=class extends Ue{constructor(e){super(e,500)}o(e){return Sr(this,0,7,e)}},Ko=[-1,{}],B0=[0,Ze,1,Ko],L0=[0,Ze,sr,Ko],Eu=class extends Ue{constructor(e){super(e,500)}o(e){return Sr(this,0,1001,e)}};Eu.prototype.g=(D0=[-500,ar,[-500,_n,-1,sr,-3,[-2,Cc,Wt],ar,T0,Gi,-1,B0,L0,ar,[0,_n,Ji],_n,O0,Gi,sr,987,sr],4,ar,[-500,Ze,-1,[-1,{}],998,Ze],ar,[-500,Ze,sr,-1,[-2,{},Wt],997,sr,-1],Gi,ar,[-500,Ze,sr,Ko,998,sr],sr,Gi,B0,L0,ar,[0,_n,-1,Ko],sr,-2,O0,_n,-1,Ji,[0,Ji,J_],978,Ko,ar,T0],function(){let e=new class{constructor(){this.j=[],this.i=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){let o=this.g;return this.g=[],o}}}};j1(this.l,e,Qn(_c,wc,Sc,D0)),to(e,e.g.end());let t=new Uint8Array(e.i),r=e.j,n=r.length,i=0;for(let o=0;o<n;o++){let s=r[o];t.set(s,i),i+=s.length}return e.j=[t],t});var Q_=class extends Ue{constructor(e){super(e)}},e3=class extends Ue{constructor(e){super(e)}g(){return au(this,Q_)}},t3=[0,ar,[0,En,K1,Ze,-1]],F0=class extends Ue{constructor(e){super(e)}},M0=class extends Ue{constructor(e){super(e)}},n2=[1,2,3,4,5],sc=class extends Ue{constructor(e){super(e)}g(){return m1(this)!=null}i(){return Sn(_r(this,2))!=null}},ac=class extends Ue{constructor(e){super(e)}},i2=class extends Ue{constructor(e){super(e)}},o2=[0,[0,X1,Ze,[0,En,ic,-1],[0,X_,ic]],Wt,[0,n2,ft,t2,ft,Z1,ft,Y1,ft,e2,ft,Q1],Jn],r3=new oc(451755788,i2);Cc[451755788]=[0,o2,[0,Ze,En,K1,sr,-1],q_];var U0=class extends Ue{constructor(e){super(e)}},s2=class extends Ue{constructor(e){super(e)}},n3=new oc(487277289,s2);Cc[487277289]=[0,o2,[0,Wt,-1]];var i3=class extends Ue{constructor(e){super(e)}},o3=J1(class extends Ue{constructor(e){super(e)}},[0,ar,[0,1,En,Ze,t3],ic]),N0=class extends Ue{constructor(e){super(e)}},s3=class extends Ue{constructor(e){super(e)}J(){let e=m1(this);return e??Zi()}},a3=class extends Ue{constructor(e){super(e)}},a2=[1,2],z0=J1(class extends Ue{constructor(e){super(e)}},[0,ar,[0,a2,ft,[0,K_],ft,[0,X1],En,Ze],ic]);function c3(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!(function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")})(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function j0(e){if(typeof importScripts!="function"){let t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise(((r,n)=>{t.addEventListener("load",(()=>{r()}),!1),t.addEventListener("error",(i=>{n(i)}),!1),document.body.appendChild(t)}))}importScripts(e.toString())}function ie(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.h.stringToNewUTF8(t)),e.h._free(t)}function V0(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");let n=new Uint32Array(t.length);for(let i=0;i<t.length;i++)n[i]=e.h.stringToNewUTF8(t[i]);t=e.h._malloc(4*n.length),e.h.HEAPU32.set(n,t>>2),r(t);for(let i of n)e.h._free(i);e.h._free(t)}function yn(e,t,r){e.h.simpleListeners=e.h.simpleListeners||{},e.h.simpleListeners[t]=r}function Gn(e,t,r){let n=[];e.h.simpleListeners=e.h.simpleListeners||{},e.h.simpleListeners[t]=(i,o,s)=>{o?(r(n,s),n=[]):n.push(i)}}var l3=(function(e){return class extends e{N(){this.h._registerModelResourcesGraphService()}}})(class{constructor(e,t){this.j=!0,this.h=e,this.g=null,this.i=0,this.m=typeof this.h._addIntToInputStream=="function",t!==void 0?this.h.canvas=t:c3()?this.h.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas"))}async initializeGraph(e){let t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){let r=e.length,n=this.h._malloc(r);this.h.HEAPU8.set(e,n),t?this.h._changeBinaryGraph(r,n):this.h._changeTextGraph(r,n),this.h._free(n)}configureAudio(e,t,r,n,i){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),ie(this,n||"input_audio",(o=>{ie(this,i=i||"audio_header",(s=>{this.h._configureAudio(o,s,e,t??0,r)}))}))}setAutoResizeCanvas(e){this.j=e}setAutoRenderToScreen(e){this.h._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.h.gpuOriginForWebTexturesIsBottomLeft=e}attachErrorListener(e){this.h.errorListener=e}attachEmptyPacketListener(e,t){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[e]=t}addAudioToStream(e,t,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,n,i){let o=4*e.length;this.i!==o&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(o),this.i=o),this.h.HEAPF32.set(e,this.g/4),ie(this,n,(s=>{this.h._addAudioToInputStream(this.g,t,r,s,i)}))}addGpuBufferToStream(e,t,r){ie(this,t,(n=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");n?this.h._bindTextureToStream(n):this.h._bindTextureToCanvas();let i=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!i)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.h.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),this.h.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let[o,s]=e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height];!this.j||o===this.h.canvas.width&&s===this.h.canvas.height||(this.h.canvas.width=o,this.h.canvas.height=s);let[a,c]=[o,s];this.h._addBoundTextureToStream(n,a,c,r)}))}addBoolToStream(e,t,r){ie(this,t,(n=>{this.h._addBoolToInputStream(e,n,r)}))}addDoubleToStream(e,t,r){ie(this,t,(n=>{this.h._addDoubleToInputStream(e,n,r)}))}addFloatToStream(e,t,r){ie(this,t,(n=>{this.h._addFloatToInputStream(e,n,r)}))}addIntToStream(e,t,r){ie(this,t,(n=>{this.h._addIntToInputStream(e,n,r)}))}addUintToStream(e,t,r){ie(this,t,(n=>{this.h._addUintToInputStream(e,n,r)}))}addStringToStream(e,t,r){ie(this,t,(n=>{ie(this,e,(i=>{this.h._addStringToInputStream(i,n,r)}))}))}addStringRecordToStream(e,t,r){ie(this,t,(n=>{V0(this,Object.keys(e),(i=>{V0(this,Object.values(e),(o=>{this.h._addFlatHashMapToInputStream(i,o,Object.keys(e).length,n,r)}))}))}))}addProtoToStream(e,t,r,n){ie(this,r,(i=>{ie(this,t,(o=>{let s=this.h._malloc(e.length);this.h.HEAPU8.set(e,s),this.h._addProtoToInputStream(s,e.length,o,i,n),this.h._free(s)}))}))}addEmptyPacketToStream(e,t){ie(this,e,(r=>{this.h._addEmptyPacketToInputStream(r,t)}))}addBoolVectorToStream(e,t,r){ie(this,t,(n=>{let i=this.h._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(let o of e)this.h._addBoolVectorEntry(i,o);this.h._addBoolVectorToInputStream(i,n,r)}))}addDoubleVectorToStream(e,t,r){ie(this,t,(n=>{let i=this.h._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(let o of e)this.h._addDoubleVectorEntry(i,o);this.h._addDoubleVectorToInputStream(i,n,r)}))}addFloatVectorToStream(e,t,r){ie(this,t,(n=>{let i=this.h._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(let o of e)this.h._addFloatVectorEntry(i,o);this.h._addFloatVectorToInputStream(i,n,r)}))}addIntVectorToStream(e,t,r){ie(this,t,(n=>{let i=this.h._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(let o of e)this.h._addIntVectorEntry(i,o);this.h._addIntVectorToInputStream(i,n,r)}))}addUintVectorToStream(e,t,r){ie(this,t,(n=>{let i=this.h._allocateUintVector(e.length);if(!i)throw Error("Unable to allocate new unsigned int vector on heap.");for(let o of e)this.h._addUintVectorEntry(i,o);this.h._addUintVectorToInputStream(i,n,r)}))}addStringVectorToStream(e,t,r){ie(this,t,(n=>{let i=this.h._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(let o of e)ie(this,o,(s=>{this.h._addStringVectorEntry(i,s)}));this.h._addStringVectorToInputStream(i,n,r)}))}addBoolToInputSidePacket(e,t){ie(this,t,(r=>{this.h._addBoolToInputSidePacket(e,r)}))}addDoubleToInputSidePacket(e,t){ie(this,t,(r=>{this.h._addDoubleToInputSidePacket(e,r)}))}addFloatToInputSidePacket(e,t){ie(this,t,(r=>{this.h._addFloatToInputSidePacket(e,r)}))}addIntToInputSidePacket(e,t){ie(this,t,(r=>{this.h._addIntToInputSidePacket(e,r)}))}addUintToInputSidePacket(e,t){ie(this,t,(r=>{this.h._addUintToInputSidePacket(e,r)}))}addStringToInputSidePacket(e,t){ie(this,t,(r=>{ie(this,e,(n=>{this.h._addStringToInputSidePacket(n,r)}))}))}addProtoToInputSidePacket(e,t,r){ie(this,r,(n=>{ie(this,t,(i=>{let o=this.h._malloc(e.length);this.h.HEAPU8.set(e,o),this.h._addProtoToInputSidePacket(o,e.length,i,n),this.h._free(o)}))}))}addBoolVectorToInputSidePacket(e,t){ie(this,t,(r=>{let n=this.h._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let i of e)this.h._addBoolVectorEntry(n,i);this.h._addBoolVectorToInputSidePacket(n,r)}))}addDoubleVectorToInputSidePacket(e,t){ie(this,t,(r=>{let n=this.h._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let i of e)this.h._addDoubleVectorEntry(n,i);this.h._addDoubleVectorToInputSidePacket(n,r)}))}addFloatVectorToInputSidePacket(e,t){ie(this,t,(r=>{let n=this.h._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let i of e)this.h._addFloatVectorEntry(n,i);this.h._addFloatVectorToInputSidePacket(n,r)}))}addIntVectorToInputSidePacket(e,t){ie(this,t,(r=>{let n=this.h._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let i of e)this.h._addIntVectorEntry(n,i);this.h._addIntVectorToInputSidePacket(n,r)}))}addUintVectorToInputSidePacket(e,t){ie(this,t,(r=>{let n=this.h._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let i of e)this.h._addUintVectorEntry(n,i);this.h._addUintVectorToInputSidePacket(n,r)}))}addStringVectorToInputSidePacket(e,t){ie(this,t,(r=>{let n=this.h._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let i of e)ie(this,i,(o=>{this.h._addStringVectorEntry(n,o)}));this.h._addStringVectorToInputSidePacket(n,r)}))}attachBoolListener(e,t){yn(this,e,t),ie(this,e,(r=>{this.h._attachBoolListener(r)}))}attachBoolVectorListener(e,t){Gn(this,e,t),ie(this,e,(r=>{this.h._attachBoolVectorListener(r)}))}attachIntListener(e,t){yn(this,e,t),ie(this,e,(r=>{this.h._attachIntListener(r)}))}attachIntVectorListener(e,t){Gn(this,e,t),ie(this,e,(r=>{this.h._attachIntVectorListener(r)}))}attachUintListener(e,t){yn(this,e,t),ie(this,e,(r=>{this.h._attachUintListener(r)}))}attachUintVectorListener(e,t){Gn(this,e,t),ie(this,e,(r=>{this.h._attachUintVectorListener(r)}))}attachDoubleListener(e,t){yn(this,e,t),ie(this,e,(r=>{this.h._attachDoubleListener(r)}))}attachDoubleVectorListener(e,t){Gn(this,e,t),ie(this,e,(r=>{this.h._attachDoubleVectorListener(r)}))}attachFloatListener(e,t){yn(this,e,t),ie(this,e,(r=>{this.h._attachFloatListener(r)}))}attachFloatVectorListener(e,t){Gn(this,e,t),ie(this,e,(r=>{this.h._attachFloatVectorListener(r)}))}attachStringListener(e,t){yn(this,e,t),ie(this,e,(r=>{this.h._attachStringListener(r)}))}attachStringVectorListener(e,t){Gn(this,e,t),ie(this,e,(r=>{this.h._attachStringVectorListener(r)}))}attachProtoListener(e,t,r){yn(this,e,t),ie(this,e,(n=>{this.h._attachProtoListener(n,r||!1)}))}attachProtoVectorListener(e,t,r){Gn(this,e,t),ie(this,e,(n=>{this.h._attachProtoVectorListener(n,r||!1)}))}attachAudioListener(e,t,r){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),yn(this,e,((n,i)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),t(n,i)})),ie(this,e,(n=>{this.h._attachAudioListener(n,r||!1)}))}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}}),c2=class extends l3{};async function h3(e,t,r){return e=await(async(n,i,o,s)=>{if(i&&await j0(i),!self.ModuleFactory||o&&(await j0(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&s&&((i=self.Module).locateFile=s.locateFile,s.mainScriptUrlOrBlob&&(i.mainScriptUrlOrBlob=s.mainScriptUrlOrBlob)),s=await self.ModuleFactory(self.Module||s),self.ModuleFactory=self.Module=void 0,new n(s,null)})(e,t.wasmLoaderPath,t.assetLoaderPath,{locateFile:n=>n.endsWith(".wasm")?t.wasmBinaryPath.toString():t.assetBinaryPath&&n.endsWith(".data")?t.assetBinaryPath.toString():n}),await e.o(r),e}async function l2(e,t,r){return h3(e,t,r)}function Od(e,t){let r=wr(e.baseOptions,sc,1)||new sc;typeof t=="string"?(pt(r,2,rc(t)),pt(r,1)):t instanceof Uint8Array&&(pt(r,1,t1(t,!1)),pt(r,2)),Sr(e.baseOptions,0,1,r)}function h2(e,t){let r=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(wr(e.baseOptions,sc,1)?.g()||wr(e.baseOptions,sc,1)?.i()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if((function(n,i){let o=wr(n.baseOptions,M0,3);if(!o){var s=o=new M0;Id(s,4,new P0)}"delegate"in i&&(i.delegate==="GPU"?Id(i=o,2,s=new Z_):Id(i=o,4,s=new P0)),Sr(n.baseOptions,0,3,o)})(e,r),r.modelAssetPath)return fetch(r.modelAssetPath.toString()).then((n=>{if(n.ok)return n.arrayBuffer();throw Error(`Failed to fetch model: ${r.modelAssetPath} (${n.status})`)})).then((n=>{try{e.g.h.FS_unlink("/model.dat")}catch{}e.g.h.FS_createDataFile("/","model.dat",new Uint8Array(n),!0,!1,!1),Od(e,"/model.dat"),e.v()}));if(r.modelAssetBuffer instanceof Uint8Array)Od(e,r.modelAssetBuffer);else if(r.modelAssetBuffer)return(async function(n){let i=[];for(var o=0;;){let{done:s,value:a}=await n.read();if(s)break;i.push(a),o+=a.length}if(i.length===0)return new Uint8Array(0);if(i.length===1)return i[0];n=new Uint8Array(o),o=0;for(let s of i)n.set(s,o),o+=s.length;return n})(r.modelAssetBuffer).then((n=>{Od(e,n),e.v()}));return e.v(),Promise.resolve()}function H0(e){try{let t=e.j.length;if(t===1)throw Error(e.j[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.j.map((r=>r.message)).join(", "))}finally{e.j=[]}}function qi(e,t){e.s=Math.max(e.s,t)}var Za=class{constructor(e){this.g=e,this.j=[],this.s=0,this.g.setAutoRenderToScreen(!1)}setGraph(e,t){this.g.attachErrorListener(((r,n)=>{this.j.push(Error(n))})),this.g.N(),this.g.setGraph(e,t),H0(this)}finishProcessing(){this.g.finishProcessing(),H0(this)}close(){this.g.closeGraph()}};async function Xo(e,t,r){return l2(e,t,r)}Za.prototype.close=Za.prototype.close,(function(e,t){e=e.split(".");var r,n=Kn;for((e[0]in n)||n.execScript===void 0||n.execScript("var "+e[0]);e.length&&(r=e.shift());)e.length||t===void 0?n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}:n[r]=t})("TaskRunner",Za);var cc=class extends Za{constructor(){super(...arguments),this.F=48e3}O(e){this.F=e}};function d3(e){let t={classifications:au(e,i3).map((r=>(function(n,i=-1,o=""){return{categories:n.map((s=>{var a=Xn(_r(s,1))??0??-1;let c=s.l,l=0|c[se],h=Zn(c,l,2),d=Qo(h);return d!=null&&d!==h&&lt(c,l,2,d),{index:a,score:d??0??0,categoryName:Sn(_r(s,3))??""??"",displayName:Sn(_r(s,4))??""??""}})),headIndex:i,headName:o}})(wr(r,e3,4)?.g()??[],Xn(_r(r,2))??0,Sn(_r(r,3))??"")))};return Md(_r(e,2))!=null&&(t.timestampMs=Md(_r(e,2))??0),t}cc.prototype.setDefaultSampleRate=cc.prototype.O;var or=class extends cc{constructor(e,t){super(new c2(e,t)),this.m=[],Sr(e=this.i=new i2,0,1,t=new ac)}get baseOptions(){return wr(this.i,ac,1)}set baseOptions(e){Sr(this.i,0,1,e)}o(e){var t=this.i,r=wr(this.i,F0,2);if(r=r?p1(r):new F0,e.displayNamesLocale!==void 0?pt(r,1,rc(e.displayNamesLocale)):e.displayNamesLocale===void 0&&pt(r,1),e.maxResults!==void 0){var n=e.maxResults;if(n!=null){if(typeof n!="number"||!fc(n))throw f0();n|=0}pt(r,2,n)}else"maxResults"in e&&pt(r,2);if(e.scoreThreshold!==void 0){if((n=e.scoreThreshold)!=null&&typeof n!="number")throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);pt(r,3,n)}else"scoreThreshold"in e&&pt(r,3);return e.categoryAllowlist!==void 0?w0(r,4,e.categoryAllowlist):"categoryAllowlist"in e&&pt(r,4),e.categoryDenylist!==void 0?w0(r,5,e.categoryDenylist):"categoryDenylist"in e&&pt(r,5),Sr(t,0,2,r),h2(this,e)}K(e,t){return this.D(e,t??this.F,this.s+1)}D(e,t,r){return this.g.addDoubleToStream(t,"sample_rate",r),this.g.addAudioToStreamWithShape(e,1,e.length,"audio_in",r),this.m=[],this.finishProcessing(),[...this.m]}v(){var e=new Eu;Ot(e,10,"audio_in"),Ot(e,10,"sample_rate"),Ot(e,15,"timestamped_classifications");let t=new r2;T1(t,r3,this.i);let r=new ku;y1(r,rc("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph")),Ot(r,3,"AUDIO:audio_in"),Ot(r,3,"SAMPLE_RATE:sample_rate"),Ot(r,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),r.o(t),w1(e,r),this.g.attachProtoVectorListener("timestamped_classifications",((n,i)=>{(function(o,s){s.forEach((a=>{a=o3(a),o.m.push(d3(a))}))})(this,n),qi(this,i)})),this.g.attachEmptyPacketListener("timestamped_classifications",(n=>{qi(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function W0(e){return{embeddings:au(e,a3).map((t=>{let r={headIndex:Xn(_r(t,3))??0??-1,headName:Sn(_r(t,4))??""??""};if(v1(t,N0,Td(t,1))!==void 0)r.floatEmbedding=g1(wr(t,N0,Td(t,1)),1,Qo,r1===void 0?2:4).slice();else{let n=new Uint8Array(0);r.quantizedEmbedding=wr(t,s3,Td(t,2))?.J()?.i()??n}return r})),timestampMs:Md(_r(e,2))??0}}or.prototype.classify=or.prototype.K,or.prototype.setOptions=or.prototype.o,or.createFromModelPath=function(e,t){return l2(or,e,{baseOptions:{modelAssetPath:t}})},or.createFromModelBuffer=function(e,t){return Xo(or,e,{baseOptions:{modelAssetBuffer:t}})},or.createFromOptions=function(e,t){return Xo(or,e,t)};var Fr=class extends cc{constructor(e,t){super(new c2(e,t)),this.m=[],Sr(e=this.i=new s2,0,1,t=new ac)}get baseOptions(){return wr(this.i,ac,1)}set baseOptions(e){Sr(this.i,0,1,e)}o(e){var t=this.i,r=wr(this.i,U0,2);return r=r?p1(r):new U0,e.l2Normalize!==void 0?pt(r,1,v0(e.l2Normalize)):"l2Normalize"in e&&pt(r,1),e.quantize!==void 0?pt(r,2,v0(e.quantize)):"quantize"in e&&pt(r,2),Sr(t,0,2,r),h2(this,e)}L(e,t){return this.D(e,t??this.F,this.s+1)}D(e,t,r){return this.g.addDoubleToStream(t,"sample_rate",r),this.g.addAudioToStreamWithShape(e,1,e.length,"audio_in",r),this.m=[],this.finishProcessing(),this.m}v(){var e=new Eu;Ot(e,10,"audio_in"),Ot(e,10,"sample_rate"),Ot(e,15,"embeddings_out"),Ot(e,15,"timestamped_embeddings_out");let t=new r2;T1(t,n3,this.i);let r=new ku;y1(r,rc("mediapipe.tasks.audio.audio_embedder.AudioEmbedderGraph")),Ot(r,3,"AUDIO:audio_in"),Ot(r,3,"SAMPLE_RATE:sample_rate"),Ot(r,4,"EMBEDDINGS:embeddings_out"),Ot(r,4,"TIMESTAMPED_EMBEDDINGS:timestamped_embeddings_out"),r.o(t),w1(e,r),this.g.attachProtoListener("embeddings_out",((n,i)=>{n=z0(n),this.m.push(W0(n)),qi(this,i)})),this.g.attachEmptyPacketListener("embeddings_out",(n=>{qi(this,n)})),this.g.attachProtoVectorListener("timestamped_embeddings_out",((n,i)=>{for(let o of n)n=z0(o),this.m.push(W0(n));qi(this,i)})),this.g.attachEmptyPacketListener("timestamped_embeddings_out",(n=>{qi(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}},Ja;Fr.prototype.embed=Fr.prototype.L,Fr.prototype.setOptions=Fr.prototype.o,Fr.createFromModelPath=function(e,t){return Xo(Fr,e,{baseOptions:{modelAssetPath:t}})},Fr.createFromModelBuffer=function(e,t){return Xo(Fr,e,{baseOptions:{modelAssetBuffer:t}})},Fr.createFromOptions=function(e,t){return Xo(Fr,e,t)};var u3=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function d2(){if(Ja===void 0)try{await WebAssembly.instantiate(u3),Ja=!0}catch{Ja=!1}return Ja}async function Wo(e,t=Y_``){let r=await d2()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var bn=class{};bn.forVisionTasks=function(e){return Wo("vision",e)},bn.forTextTasks=function(e){return Wo("text",e)},bn.forGenAiExperimentalTasks=function(e){return Wo("genai_experimental",e)},bn.forGenAiTasks=function(e){return Wo("genai",e)},bn.forAudioTasks=function(e){return Wo("audio",e)},bn.isSimdSupported=function(){return d2()};function f3(e,t){let r=e.reduce((a,c)=>a+c.length,0),n=new ArrayBuffer(44+r*2),i=new DataView(n),o=(a,c,l)=>{for(let h=0;h<l.length;h++)a.setUint8(c+h,l.charCodeAt(h))};o(i,0,"RIFF"),i.setUint32(4,36+r*2,!0),o(i,8,"WAVE"),o(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,t,!0),i.setUint32(28,t*2,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0),o(i,36,"data"),i.setUint32(40,r*2,!0);let s=44;for(let a of e)for(let c=0;c<a.length;c++){let l=Math.max(-1,Math.min(1,a[c]));i.setInt16(s,l<0?l*32768:l*32767,!0),s+=2}return new Blob([i],{type:"audio/wav"})}var xc=class{constructor(t,r,n,i,o,s,a){this.recordingInProgress=!1;this.recordIndex=1;this.countLoopTimes=0;this.examStartTime=0;this.recordingStartTime=0;this.recordingEndTime=0;this.isSpeech=!1;this.preRollBuffer=[];this.recordingChunks=[];this.PRE_ROLL_SECONDS=2;this.SAMPLE_RATE=16e3;this.MAX_PRE_ROLL_CHUNKS=4;this.lastNoiseTime=0;this.SILENCE_THRESHOLD=3e3;this.optionsProctoring=t,this.proctoringSession=r,this.paramsConfig=n,this.cameraRecorder=i,this.onRealtimeAlertsCallback=o,this.backend=s,this.backendToken=a}setProctoringId(t){this.proctoringId=t,this.proctoringId&&this.backend&&(this.upload=new Yr(this.proctoringId,this.backend))}async startRecording(){this.examStartTime=Date.now(),await this.createAudioClassifier(),this.audioRecorder=new $a(void 0,this.paramsConfig.audioBehaviourParameters),this.intervalNoiseDetection=setInterval(()=>this.onNoiseDetectedRecord(),200),this.streamingAudioClassification()}async stopRecording(){clearInterval(this.intervalNoiseDetection),await this.stopSoundRecord(),await this.volumeMeter&&this.volumeMeter.stop(),this.audioWorkletNode&&this.audioWorkletNode.disconnect()}async pauseRecording(){}async resumeRecording(){}async saveOnSession(t){}async onNoiseDetectedRecord(){!this.volumeMeter&&this.cameraRecorder.cameraStream&&(this.volumeMeter=new gn(this.cameraRecorder.cameraStream),this.volumeMeter.start().catch(i=>{console.log(i),this.volumeMeter=void 0}));let t=this.paramsConfig.audioBehaviourParameters?.noiseLimit||40,r=this.volumeMeter?.getVolume()||0;this.isSpeech=this.isSpeech||this.hasDesiredResult(this.audioClassificationResult),!this.isSpeech&&!this.recordingInProgress&&(t=t*1.25);let n=r>=t;if(n&&(this.lastNoiseTime=Date.now()),n&&!this.recordingInProgress){this.recordingInProgress=!0,this.recordingChunks=[...this.preRollBuffer];let o=this.preRollBuffer.reduce((a,c)=>a+c.length,0)/this.SAMPLE_RATE*1e3,s=Date.now()-this.examStartTime;this.recordingStartTime=s-o,this.recordingStartTime<0&&(this.recordingStartTime=0)}else if(this.recordingInProgress){let i=Date.now()-this.lastNoiseTime,o=Date.now()-this.recordingStartTime;i>=this.SILENCE_THRESHOLD&&o>=3e3&&this.countLoopTimes>4&&(await this.stopSoundRecord(),this.paramsConfig.videoBehaviourParameters?.detectNoise&&!this.isSpeech&&this.onRealtimeAlertsCallback({status:"ALERT",description:"Barulho detectado",type:"audio_detection_on_stream"}),this.paramsConfig.videoBehaviourParameters?.detectSpeech&&this.isSpeech&&this.onRealtimeAlertsCallback({status:"ALERT",description:"Fala detectada",type:"audio_detection_on_stream"}),this.recordingInProgress=!1,this.recordIndex++,this.countLoopTimes=0,this.isSpeech=!1),this.countLoopTimes++}}async stopSoundRecord(){if(!this.recordingInProgress&&this.recordingChunks.length===0||(this.recordingEndTime=Date.now()-this.examStartTime,this.optionsProctoring.proctoringType!=="REALTIME"))return;let t=f3(this.recordingChunks,this.SAMPLE_RATE),r=new File([t],`EP_${this.proctoringSession.id}_${this.recordingStartTime}_${this.recordingEndTime}_${this.isSpeech?"speech":"noise"}.wav`,{type:"audio/wav"});this.uploadRecord(r),this.recordingChunks=[],this.recordingInProgress=!1}download(t){let r=URL.createObjectURL(t),n=document.createElement("a");document.body.appendChild(n),n.style.display="none",n.href=r,n.download=t.name,n.click(),window.URL.revokeObjectURL(r)}uploadRecord(t){t&&this.upload&&this.backendToken&&this.upload.upload({file:t},this.backendToken)}hasDesiredResult(t){if(t==null)return!1;for(let r of t){let n=r.name.toLowerCase().includes("speech");if(this.optionsProctoring.proctoringType!=="REALTIME")return n;let i=parseFloat(r.score)>.22;if(n&&i)return!0}return!1}async createAudioClassifier(){let t=await bn.forAudioTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-audio@0.10.0/wasm");this.audioClassifier=await or.createFromOptions(t,{scoreThreshold:.15,maxResults:1,baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/audio_classifier/yamnet/float32/1/yamnet.tflite"}})}async streamingAudioClassification(){this.context=new AudioContext({sampleRate:this.SAMPLE_RATE});try{await this.context.audioWorklet.addModule(URL.createObjectURL(new Blob([p3],{type:"text/javascript"})))}catch{throw new Error("\u274C Error loading audio worklet module")}let t=this.context.createMediaStreamSource(this.cameraRecorder.cameraStream);this.audioWorkletNode=new AudioWorkletNode(this.context,"audio-processor"),this.audioWorkletNode.port.onmessage=r=>{let n=r.data;this.preRollBuffer.push(n),this.preRollBuffer.length>this.MAX_PRE_ROLL_CHUNKS&&this.preRollBuffer.shift(),this.recordingInProgress&&this.recordingChunks.push(n);let o=this.audioClassifier.classify(n)[0].classifications[0].categories;o.length>0&&(this.audioClassificationResult=[{name:o[0].categoryName,score:o[0].score.toFixed(3)}])},t.connect(this.audioWorkletNode),this.audioWorkletNode.connect(this.context.destination)}},p3=`
436
436
  class AudioProcessor extends AudioWorkletProcessor {
437
437
  bufferSize;
438
438
  inputBuffer;
@@ -469,7 +469,7 @@ Para iniciar um exame utilize uma outra c\xE2mera.`),o.setAttribute("class","che
469
469
  }
470
470
 
471
471
  registerProcessor("audio-processor", AudioProcessor);
472
- `;var Ac=class{constructor(t){this.blobs=[];this.blobsFinal=[];this.options=t}setProctoringId(t){this.proctoringId=t,La(t)}async startRecording(){if(this.startTime=new Date(Date.now()),mn())return;let{allowOnlyFirstMonitor:t,allowMultipleMonitors:r,onStopSharingScreenCallback:n,onBufferSizeErrorCallback:i}=this.options,o={video:{cursor:"always",width:this.options.screenRecorderOptions.width,height:this.options.screenRecorderOptions.height,displaySurface:"monitor"},audio:!1},s={video:{cursor:"always",width:1280,height:720,displaySurface:"monitor"},audio:!1},a;try{a=await navigator.mediaDevices.getDisplayMedia(o)}catch(f){if(f instanceof TypeError&&f.message.includes("min constraints are not supported"))console.warn("Navegador n\xE3o suporta restri\xE7\xF5es 'min/max/ideal'. Tentando com 720p fixo."),a=await navigator.mediaDevices.getDisplayMedia(s);else throw f}this.screenStream=a;let c=this.screenStream.getVideoTracks();if(c[0].onended=n,navigator.userAgent.indexOf("Firefox")>-1){let f=c.find(b=>b.label=="");if(f&&t||f&&!r)throw Fa}let h=c.find(f=>["screen:0:0","Primary Monitor"].includes(f.label))!=null,d=c.find(f=>["screen:0:0","Primary Monitor",""].includes(f.label)||["screen:"].some(b=>f.label.includes(b)))!=null,m=c.find(f=>["web-contents-media-stream","window"].some(b=>f.label.includes(b)))!=null;if(!h&&t)throw c.forEach(f=>{f.stop()}),Gg;if(!d||m)throw c.forEach(f=>{f.stop()}),qg;let{startRecording:p,stopRecording:g}=Wn(this.screenStream,this.blobs,this.options.onBufferSizeError,i);this.recordingStart=p,this.recordingStop=g,this.recordingStart()}async pauseRecording(){}async resumeRecording(){}async stopRecording(){this.recordingStop&&await this.recordingStop()}async saveOnSession(t){t.addRecording({device:"",file:new File(this.blobs,`EP_${t.id}_screen_0.webm`,{type:"video/webm"}),origin:"Screen"})}};var rs=class{constructor(t,r){this.dbName="EasyProctorDb";this.dbVersion=2;this.storeName="exams2";this.dbName=t,this.storeName=r}async save(t){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.put(t),r).then(()=>{})}async delete(t){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.delete(t),r)}async get(t){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.get(t),r).catch(()=>{})}async getDevices(t){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.get(t),r).catch(()=>{})}async list(){let{transaction:t,store:r}=await this.connectToStore("readonly");return this.processRequest(r.getAll(),t)}async clear(){let{transaction:t,store:r}=await this.connectToStore("readwrite");return this.processRequest(r.clear(),t)}async processRequest(t,r){return new Promise((n,i)=>{t.onerror=o=>{i(t.error?.message)},t.onsuccess=o=>{r.commit(),n(t.result)}})}async hasSessions(){return(await this.list()).length>0}async connectToStore(t){let i=(await this.connect()).result.transaction(this.storeName,t),o=i.objectStore(this.storeName);return{transaction:i,store:o}}async connect(){return this.connection?this.connection:new Promise((t,r)=>{let n=window.indexedDB.open(this.dbName,this.dbVersion);n.onerror=i=>{r("Can't connect to IndexedDB")},n.onupgradeneeded=i=>{let o=n.result;o.onerror=s=>{},o.createObjectStore(this.storeName,{keyPath:"id"})},n.onsuccess=i=>{this.connection=n,t(n)}})}};function u2(){return new Promise((e,t)=>{window.navigator.geolocation.getCurrentPosition(e,t)})}function ns(){let e=window.navigator.userAgent.split("SEB/");return e.length>1?e[1]:"1.0.0.0"}var Tc=class{constructor(t,r){this.cpf=t,this.backend=r,this.capturePhoto=new Hi}async login(){let t=await this.capturePhoto.takePicture("Login com biometria facial","Encaixe seu rosto no formato e clique no bot\xE3o abaixo",{width:1280,height:720});return this.loading(),new Promise((r,n)=>{this.backend.loginAuth(this.cpf,t.base64.substr(22,t.base64.length)).then(i=>{this.token=i.token,document.querySelector("#authLoader")?.remove(),this.backend.token=this.token,r(this.token)}).catch(i=>{console.log(i),document.querySelector("#authLoader")?.remove(),n(i)})})}loading(){let t=document.createElement("div");t.setAttribute("id","authLoader"),t.style.backgroundColor="rgba(0,0,0,0.4)",t.style.zIndex="1000",t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.height="100vh",t.style.width="100%",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center";let r=document.createElement("div");r.setAttribute("class","loader"),t.appendChild(r),document.body.appendChild(t);let n=`
472
+ `;var Ac=class{constructor(t){this.blobs=[];this.blobsFinal=[];this.options=t}setProctoringId(t){this.proctoringId=t,La(t)}async startRecording(){if(this.startTime=new Date(Date.now()),Jr())return;let{allowOnlyFirstMonitor:t,allowMultipleMonitors:r,onStopSharingScreenCallback:n,onBufferSizeErrorCallback:i}=this.options,o={video:{cursor:"always",width:this.options.screenRecorderOptions.width,height:this.options.screenRecorderOptions.height,displaySurface:"monitor"},audio:!1},s={video:{cursor:"always",width:1280,height:720,displaySurface:"monitor"},audio:!1},a;try{a=await navigator.mediaDevices.getDisplayMedia(o)}catch(f){if(f instanceof TypeError&&f.message.includes("min constraints are not supported"))console.warn("Navegador n\xE3o suporta restri\xE7\xF5es 'min/max/ideal'. Tentando com 720p fixo."),a=await navigator.mediaDevices.getDisplayMedia(s);else throw f}this.screenStream=a;let c=this.screenStream.getVideoTracks();if(c[0].onended=n,navigator.userAgent.indexOf("Firefox")>-1){let f=c.find(b=>b.label=="");if(f&&t||f&&!r)throw Fa}let h=c.find(f=>["screen:0:0","Primary Monitor"].includes(f.label))!=null,d=c.find(f=>["screen:0:0","Primary Monitor",""].includes(f.label)||["screen:"].some(b=>f.label.includes(b)))!=null,m=c.find(f=>["web-contents-media-stream","window"].some(b=>f.label.includes(b)))!=null;if(!h&&t)throw c.forEach(f=>{f.stop()}),Gg;if(!d||m)throw c.forEach(f=>{f.stop()}),qg;let{startRecording:p,stopRecording:g}=Wn(this.screenStream,this.blobs,this.options.onBufferSizeError,i);this.recordingStart=p,this.recordingStop=g,this.recordingStart()}async pauseRecording(){}async resumeRecording(){}async stopRecording(){this.recordingStop&&await this.recordingStop()}async saveOnSession(t){t.addRecording({device:"",file:new File(this.blobs,`EP_${t.id}_screen_0.webm`,{type:"video/webm"}),origin:"Screen"})}};var rs=class{constructor(t,r){this.dbName="EasyProctorDb";this.dbVersion=2;this.storeName="exams2";this.dbName=t,this.storeName=r}async save(t){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.put(t),r).then(()=>{})}async delete(t){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.delete(t),r)}async get(t){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.get(t),r).catch(()=>{})}async getDevices(t){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.get(t),r).catch(()=>{})}async list(){let{transaction:t,store:r}=await this.connectToStore("readonly");return this.processRequest(r.getAll(),t)}async clear(){let{transaction:t,store:r}=await this.connectToStore("readwrite");return this.processRequest(r.clear(),t)}async processRequest(t,r){return new Promise((n,i)=>{t.onerror=o=>{i(t.error?.message)},t.onsuccess=o=>{r.commit(),n(t.result)}})}async hasSessions(){return(await this.list()).length>0}async connectToStore(t){let i=(await this.connect()).result.transaction(this.storeName,t),o=i.objectStore(this.storeName);return{transaction:i,store:o}}async connect(){return this.connection?this.connection:new Promise((t,r)=>{let n=window.indexedDB.open(this.dbName,this.dbVersion);n.onerror=i=>{r("Can't connect to IndexedDB")},n.onupgradeneeded=i=>{let o=n.result;o.onerror=s=>{},o.createObjectStore(this.storeName,{keyPath:"id"})},n.onsuccess=i=>{this.connection=n,t(n)}})}};function u2(){return new Promise((e,t)=>{window.navigator.geolocation.getCurrentPosition(e,t)})}function ns(){let e=window.navigator.userAgent.split("SEB/");return e.length>1?e[1]:"1.0.0.0"}var Tc=class{constructor(t,r){this.cpf=t,this.backend=r,this.capturePhoto=new Hi}async login(){let t=await this.capturePhoto.takePicture("Login com biometria facial","Encaixe seu rosto no formato e clique no bot\xE3o abaixo",{width:1280,height:720});return this.loading(),new Promise((r,n)=>{this.backend.loginAuth(this.cpf,t.base64.substr(22,t.base64.length)).then(i=>{this.token=i.token,document.querySelector("#authLoader")?.remove(),this.backend.token=this.token,r(this.token)}).catch(i=>{console.log(i),document.querySelector("#authLoader")?.remove(),n(i)})})}loading(){let t=document.createElement("div");t.setAttribute("id","authLoader"),t.style.backgroundColor="rgba(0,0,0,0.4)",t.style.zIndex="1000",t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.height="100vh",t.style.width="100%",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center";let r=document.createElement("div");r.setAttribute("class","loader"),t.appendChild(r),document.body.appendChild(t);let n=`
473
473
  .loader {
474
474
  border: 6px solid #f3f3f3;
475
475
  border-radius: 50%;
@@ -500,19 +500,19 @@ registerProcessor("audio-processor", AudioProcessor);
500
500
  <circle cx="10" cy="10" r="9" stroke="#16A34A" stroke-width="2" fill="none"/>
501
501
  <path d="M6 10L9 13L14 7" stroke="#16A34A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
502
502
  </svg>
503
- `,this.applyStyles(v,{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",flexShrink:"0"});let k=document.createElement("span");k.innerText=f,b.appendChild(v),b.appendChild(k),c.appendChild(b)}),s.appendChild(c);let h=document.createElement("button");h.innerText="Capturar foto",h.id="position-capture-button",this.applyStyles(h,{marginTop:"10px",padding:"12px 24px",fontSize:"14px",fontWeight:"bold",color:"white",backgroundColor:"#16A34A",border:"none",borderRadius:"6px",cursor:"pointer",transition:"background-color 0.2s",alignSelf:"flex-start"}),h.onclick=()=>{if(this.connection){let f=document.getElementById("photo-message");f&&(f.innerText="N\xE3o saia da posi\xE7\xE3o atual, estamos validando o ambiente..."),n.style.display="none",this.takePicture(!0,()=>{}),h.disabled=!0,this.applyStyles(h,{backgroundColor:"#9CA3AF",cursor:"not-allowed"})}},s.appendChild(h),i.appendChild(s),t.appendChild(i);let d=document.createElement("div");this.applyStyles(d,{marginTop:"10px",fontSize:"13px",color:"#666"});let m=document.createElement("span");m.innerText="Dica: ",m.style.fontWeight="bold";let p=document.createElement("span");p.innerText="mantenha o celular est\xE1vel durante todo o processo.",d.appendChild(m),d.appendChild(p),t.appendChild(d);let g=document.getElementById("external-camera-continue");g.disabled=!0,this.applyStyles(g,{color:"#ccc",cursor:"not-allowed"})}renderImageStep(t){t.innerHTML="";let r=document.createElement("img");r.src="data:image/jpeg;base64,"+this.capturePhotoUrl,this.applyStyles(r,{maxWidth:"100%",maxHeight:"300px",borderRadius:"8px"}),t.appendChild(r);let n=document.createElement("photo-message");n.id="photo-message",n.innerText="Verifica\xE7\xE3o finalizada com sucesso.",this.applyStyles(n,{textAlign:"center",color:"#555",marginTop:"20px"}),t.appendChild(n);let i=document.getElementById("external-camera-continue");i.disabled=!1,i.innerText="Concluir",this.applyStyles(i,{width:"100%",height:"70px",backgroundColor:"#FFF",border:"none",color:"rgba(0, 0, 0, .7)",fontWeight:"bold",borderRadius:"0 0 10px 0",cursor:"pointer",borderLeft:"2px solid rgba(0, 0, 0, .1)"}),i.onclick=()=>{this.closeCheckExternalCamera(),this.resolvePromise({result:!0})}}nextState(){this.renderCurrentStep()}async initializeWebSocketConnection(){let t=this.backend.getSocketUrl();this.connection=new as().withUrl(t,{accessTokenFactory:()=>this.context.token,transport:Ve.WebSockets,withCredentials:!1,skipNegotiation:!0}).withAutomaticReconnect().configureLogging(L.Information).build(),this.connection.on("ReceiveMessage",(r,n)=>{if(console.log("sessionId: ",r),console.log("Message: ",n),r!==this.externalSessionId){console.warn("Sess\xE3o diferente!");return}try{let o=vy[n];console.log("Mensagem -> ",o),this.handleWebSocketMessage(o)}catch(i){console.error("Erro ao processar mensagem do WebSocket:",i)}}),this.connection.on("ReceiveAction",(r,n)=>{if(console.log("sessionId: ",r),console.log("Message: ",n),r!==this.externalSessionId){console.warn("Sess\xE3o diferente!");return}try{this.handleWebSocketAction(n)}catch(i){console.error("Erro ao processar mensagem do WebSocket:",i)}});try{await this.connection.start(),console.log("Conectado ao Hub SignalR com sucesso!")}catch(r){throw console.error("Falha ao conectar ou entrar no grupo do SignalR: ",r),new Error("N\xE3o foi poss\xEDvel conectar ao servi\xE7o em tempo real.")}}handleWebSocketAction(t){let r=document.getElementById("position-capture-button"),n=document.getElementById("photo-message"),i=document.getElementById("photo-error-banner");switch(t.command){case"Capture_Error":r&&(this.applyStyles(r,{marginTop:"30px",padding:"12px 20px",fontSize:"16px",fontWeight:"bold",color:"white",backgroundColor:"#16A34A",border:"none",borderRadius:"8px",cursor:"pointer",transition:"background-color 0.2s"}),r.disabled=!1),n&&(n.innerText=""+t.message),i&&(i.style.display="flex"),this.waitingPositionValidation==!0&&this.onTakePictureCallback({photo:this.capturePhotoUrl,errorMessage:t.message,success:!1});break;case"CapturePhoto":this.capturePhotoUrl=""+t.message;let o=document.getElementById("photo-icon-container");if(o&&this.capturePhotoUrl&&this.capturePhotoUrl.trim()!==""){let s=document.getElementById("img-photo");s||(o.innerHTML="",s=document.createElement("img"),s.id="img-photo",this.applyStyles(s,{width:"100%",height:"100%",objectFit:"contain",objectPosition:"center",borderRadius:"8px",display:"block"}),o.appendChild(s));let a=this.capturePhotoUrl.startsWith("data:")?this.capturePhotoUrl:"data:image/jpeg;base64,"+this.capturePhotoUrl;s.src=a,s.onload=()=>{console.log("Image loaded successfully in icon container")},s.onerror=c=>{console.error("Error loading image:",c)}}this.waitingPositionValidation==!1&&this.onTakePictureCallback({photo:this.capturePhotoUrl});break;case"Check_Transmission":t.message=="Transmission_OK"&&(this.transmissionOk=!0);break;case"Cancel":this.closeCheckExternalCamera();break;case"EnvironmentAlert":this.onRealtimeAlertsCallback({status:"ALERT",description:t.message,type:"environment_alert"});break}}handleWebSocketMessage(t){switch(this.currentStep=t,t){case 1:this.currentStep===1&&(this.nextState(),this.onQrCodeReadedCallback(!0));break;case 2:this.nextState(),this.waitingPositionValidation==!0&&this.onTakePictureCallback({photo:this.capturePhotoUrl,success:!0});break;case 3:this.closeCheckExternalCamera();break;case 9:console.error("Erro recebido do processo de c\xE2mera externa."),this.closeCheckExternalCamera(),this.resolvePromise({result:!1});break}}async disconnectWebSocket(){if(this.connection)try{await this.connection.stop(),console.log("Desconectado do SignalR.")}catch(t){console.error("Erro ao desconectar do SignalR:",t)}finally{this.connection=null}}closeCheckExternalCamera(){e.isModalOpen=!1,this.disconnectWebSocket(),document.querySelector("#externalCameraCheck")?.remove()}applyStyles(t,r){for(let n in r)t.style[n]=r[n]}};var al=class{constructor(t){this.context=t;this.deviceData=null;this.paramsConfig={audioBehaviourParameters:{recordingBitrate:128,noiseLimit:40},imageBehaviourParameters:{useUploadImage:!0,uploadInterval:20,saveVideo:!0},videoBehaviourParameters:{detectFace:!1,detectPerson:!1,detectCellPhone:!1,detectNoise:!1,detectSpeech:!1,realtimePackageSize:10,realtimeCaptureInterval:2}};this.proctoringId="";this.insights=void 0;this.state="Stop";this.serviceType="Upload";this.onStopSharingScreenCallback=()=>{};this.onLostFocusCallback=()=>{};this.onLostFocusAlertRecorderCallback=t=>{};this.onFocusCallback=()=>{};this.onFocusAlertRecorderCallback=t=>{};this.onChangeDevicesCallback=t=>{};this.onRealtimeAlertsCallback=t=>{};this.onBufferSizeErrorCallback=t=>{};this.backend=new nr({type:t.type||"prod",token:t.token}),this.repository=new rs("EasyProctorDb","exams2"),this.repositoryDevices=new rs("EasyProctorDbDevices","devices"),this.context.credentials?.cpf&&(this.auth=new Tc(this.context.credentials.cpf,this.backend)),this.appChecker=new sl(this.context,r=>this.onRealtimeAlertsCallback(r))}setOnStopSharingScreenCallback(t){this.onStopSharingScreenCallback=async()=>{me.registerStopSharingScreen(this.proctoringId,"Stop sharing screen"),this.allRecorders?.alertRecorder?.addAlert({alert:34,type:3}),this.allRecorders?.screenRecorder?.stopRecording(),t()}}setOnLostFocusAlertRecorderCallback(){this.onLostFocusAlertRecorderCallback=async t=>{this.onLostFocusCallback&&this.onLostFocusCallback(),this.sessionOptions.proctoringType==="REALTIME"&&await this.onRealtimeAlertsCallback({type:"lost_focus",category:"lost_focus",description:"Perda de foco no exame",begin:t.begin,end:t.end,alert:25,status:"ALERT"})}}setOnFocusAlertRecorderCallback(){this.onFocusAlertRecorderCallback=async t=>{this.onFocusCallback&&this.onFocusCallback(),this.sessionOptions.proctoringType==="REALTIME"&&await this.onRealtimeAlertsCallback({type:"focus",category:"focus",description:"Retorno de foco no exame",begin:t.begin,end:t.end,alert:25,status:"OK"})}}async setOnLostFocusCallback(t){this.onLostFocusCallback=async()=>await t(),this.setOnLostFocusAlertRecorderCallback()}async setOnFocusCallback(t){this.onFocusCallback=async()=>await t(),this.setOnFocusAlertRecorderCallback()}async onChangeDevices(t={}){new Va(this.repositoryDevices,this.proctoringId,this.sessionOptions,this.allRecorders).startRecording(t),this.onChangeDevicesCallback=n=>t.status&&t.status(n)}convertRealtimeCategoryToAlertCategory(t){switch(t){case"no_face_detected":return 1;case"multiple_faces_detected":return 2;case"multiple_persons_detected":return 28;case"no_person_detected":return 29;case"lost_focus":return 25;case"focus":return 25;default:return null}}convertRealtimeTypeToWarningType(t){switch(t){case"face_detection_on_stream":return 0;case"person_detection_on_stream":return 1;case"lost_focus":return 2;case"focus":return 2;default:return null}}async stopRealtimeAlert(t){let n=async i=>{if(!(i>3))try{var o=await this.backend.stopRealtimeAlert({proctoringId:this.proctoringId,begin:t.begin,end:t.end,warningCategoryEnum:this.convertRealtimeTypeToWarningType(t.type),alertImageBase64:await this.allRecorders.cameraRecorder.getCurrentImageBase64(),retry:i<2});return console.log("response stopRealtimeAlert",o),o}catch(s){return console.log("error stopRealtimeAlert",s),n(i+1)}};await n(1)}async onRealtimeAlerts(t={}){this.setOnLostFocusAlertRecorderCallback(),this.setOnFocusAlertRecorderCallback(),this.onRealtimeAlertsCallback=async r=>{t.data&&t.data(r),this.sessionOptions.proctoringType==="REALTIME"&&(r.type==="face_detection_on_stream"||r.type==="person_detection_on_stream"||r.type==="lost_focus"||r.type==="focus")&&(r.status==="ALERT"?await this.backend.startRealtimeAlert({proctoringId:this.proctoringId,begin:r.begin,end:r.end,alert:this.convertRealtimeCategoryToAlertCategory(r.category)}):r.status==="OK"&&await this.stopRealtimeAlert(r))}}setOnBufferSizeErrorCallback(t){this.onBufferSizeErrorCallback=r=>t(r)}setDeviceCheckData(t){this.deviceData=t}createRecorders(t=ir){this.onChangeDevices();let r=new Yr({cameraId:this.sessionOptions.cameraId,microphoneId:this.sessionOptions.microphoneId,onBufferSizeError:this.sessionOptions.onBufferSizeError,onBufferSizeErrorCallback:a=>this.onBufferSizeErrorCallback(a),proctoringType:this.sessionOptions.proctoringType,onChangeDevicesCallback:a=>this.onChangeDevicesCallback(a),onRealtimeAlertsCallback:a=>this.onRealtimeAlertsCallback(a)},{width:this.videoOptions.width,height:this.videoOptions.height,minWidth:this.videoOptions.minWidth,minHeight:this.videoOptions.minHeight},this.paramsConfig,this.backend,this.context.token),n=this.sessionOptions.captureScreen?new Ac({allowOnlyFirstMonitor:this.sessionOptions.allowOnlyFirstMonitor??!0,allowMultipleMonitors:this.sessionOptions.allowMultipleMonitors??!0,screenRecorderOptions:this.sessionOptions.screenRecorderOptions,onStopSharingScreenCallback:()=>this.onStopSharingScreenCallback(),onBufferSizeError:this.sessionOptions.onBufferSizeError,onBufferSizeErrorCallback:()=>this.onBufferSizeErrorCallback()}):void 0,i=new Wa({onFocusCallback:a=>this.onFocusAlertRecorderCallback(a),onLostFocusCallback:a=>this.onLostFocusAlertRecorderCallback(a),onRealtimeAlertCallback:a=>this.onRealtimeAlertsCallback(a)},t),o=new xc(t,this.proctoringSession,this.paramsConfig,r,a=>this.onRealtimeAlertsCallback(a),this.backend,this.context.token),s=[r,n,i].filter(Boolean);return s.push(o),this.recorder=new Ha(this.proctoringSession,s),{cameraRecorder:r,screenRecorder:n,alertRecorder:i,noiseRecorder:o}}async login(){if(!this.context.credentials?.cpf)throw Qg;this.context.token=await this.auth.login()}async start(t=ir,r={}){try{if(this.context.token===void 0)throw Zg;this.extension=new ja,this.extension.addEventListener();let n=this.backend.selectBaseUrl(this.context.type),i=await ur();await this.repositoryDevices.save({...i,id:"devices"}),this.sessionOptions={...ir,...t},this.videoOptions=Oa(r),await this.initConfig(t.useGeolocation),await this.verifyBrowser(),this.sessionOptions.captureScreen&&await this.verifyMultipleMonitors(this.sessionOptions);try{t?.useSpyScan&&await this.spyCam.isAlive()}catch{throw e0}if(this.state!="Stop")throw Kg;this.state="Starting",await this.repository.hasSessions()&&await this.repository.clear(),this.proctoringSession=new Hn,this.allRecorders=this.createRecorders(this.sessionOptions);let o=await this.backend.confirmStart({clientId:this.context.clientId,examId:this.context.examId,token:this.context.token},this.sessionOptions,this.geolocation?this.geolocation.coords.latitude:void 0,this.geolocation?this.geolocation.coords.longitude:void 0);this.proctoringId=o.id,me.registerDevicesChecked(this.proctoringId,!!this.deviceData,`Devices checked: ${JSON.stringify(this.deviceData)} | Devices List: ${JSON.stringify(i)}`);try{t?.useExternalCamera&&await this.appChecker.startTransmission(this.proctoringId)}catch{throw t0}this.allRecorders.cameraRecorder.setProctoringId(this.proctoringId),this.allRecorders.noiseRecorder.setProctoringId(this.proctoringId),this.proctoringSession.setProctoringId(this.proctoringId),await this.recorder.startAll(),t?.useSpyScan&&(this.spyCam.setProctoringId(this.proctoringId),this.spyCam.startCheckSpyCam(this.paramsConfig.spyScanInterval??5,{deviceType:3})),await this.repository.save(this.proctoringSession);let s={};for(let l in navigator)s[l]=navigator[l];me.registerStart(this.proctoringId,!0,`Version: ${ns()}
503
+ `,this.applyStyles(v,{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",flexShrink:"0"});let k=document.createElement("span");k.innerText=f,b.appendChild(v),b.appendChild(k),c.appendChild(b)}),s.appendChild(c);let h=document.createElement("button");h.innerText="Capturar foto",h.id="position-capture-button",this.applyStyles(h,{marginTop:"10px",padding:"12px 24px",fontSize:"14px",fontWeight:"bold",color:"white",backgroundColor:"#16A34A",border:"none",borderRadius:"6px",cursor:"pointer",transition:"background-color 0.2s",alignSelf:"flex-start"}),h.onclick=()=>{if(this.connection){let f=document.getElementById("photo-message");f&&(f.innerText="N\xE3o saia da posi\xE7\xE3o atual, estamos validando o ambiente..."),n.style.display="none",this.takePicture(!0,()=>{}),h.disabled=!0,this.applyStyles(h,{backgroundColor:"#9CA3AF",cursor:"not-allowed"})}},s.appendChild(h),i.appendChild(s),t.appendChild(i);let d=document.createElement("div");this.applyStyles(d,{marginTop:"10px",fontSize:"13px",color:"#666"});let m=document.createElement("span");m.innerText="Dica: ",m.style.fontWeight="bold";let p=document.createElement("span");p.innerText="mantenha o celular est\xE1vel durante todo o processo.",d.appendChild(m),d.appendChild(p),t.appendChild(d);let g=document.getElementById("external-camera-continue");g.disabled=!0,this.applyStyles(g,{color:"#ccc",cursor:"not-allowed"})}renderImageStep(t){t.innerHTML="";let r=document.createElement("img");r.src="data:image/jpeg;base64,"+this.capturePhotoUrl,this.applyStyles(r,{maxWidth:"100%",maxHeight:"300px",borderRadius:"8px"}),t.appendChild(r);let n=document.createElement("photo-message");n.id="photo-message",n.innerText="Verifica\xE7\xE3o finalizada com sucesso.",this.applyStyles(n,{textAlign:"center",color:"#555",marginTop:"20px"}),t.appendChild(n);let i=document.getElementById("external-camera-continue");i.disabled=!1,i.innerText="Concluir",this.applyStyles(i,{width:"100%",height:"70px",backgroundColor:"#FFF",border:"none",color:"rgba(0, 0, 0, .7)",fontWeight:"bold",borderRadius:"0 0 10px 0",cursor:"pointer",borderLeft:"2px solid rgba(0, 0, 0, .1)"}),i.onclick=()=>{this.closeCheckExternalCamera(),this.resolvePromise({result:!0})}}nextState(){this.renderCurrentStep()}async initializeWebSocketConnection(){let t=this.backend.getSocketUrl();this.connection=new as().withUrl(t,{accessTokenFactory:()=>this.context.token,transport:Ve.WebSockets,withCredentials:!1,skipNegotiation:!0}).withAutomaticReconnect().configureLogging(L.Information).build(),this.connection.on("ReceiveMessage",(r,n)=>{if(console.log("sessionId: ",r),console.log("Message: ",n),r!==this.externalSessionId){console.warn("Sess\xE3o diferente!");return}try{let o=vy[n];console.log("Mensagem -> ",o),this.handleWebSocketMessage(o)}catch(i){console.error("Erro ao processar mensagem do WebSocket:",i)}}),this.connection.on("ReceiveAction",(r,n)=>{if(console.log("sessionId: ",r),console.log("Message: ",n),r!==this.externalSessionId){console.warn("Sess\xE3o diferente!");return}try{this.handleWebSocketAction(n)}catch(i){console.error("Erro ao processar mensagem do WebSocket:",i)}});try{await this.connection.start(),console.log("Conectado ao Hub SignalR com sucesso!")}catch(r){throw console.error("Falha ao conectar ou entrar no grupo do SignalR: ",r),new Error("N\xE3o foi poss\xEDvel conectar ao servi\xE7o em tempo real.")}}handleWebSocketAction(t){let r=document.getElementById("position-capture-button"),n=document.getElementById("photo-message"),i=document.getElementById("photo-error-banner");switch(t.command){case"Capture_Error":r&&(this.applyStyles(r,{marginTop:"30px",padding:"12px 20px",fontSize:"16px",fontWeight:"bold",color:"white",backgroundColor:"#16A34A",border:"none",borderRadius:"8px",cursor:"pointer",transition:"background-color 0.2s"}),r.disabled=!1),n&&(n.innerText=""+t.message),i&&(i.style.display="flex"),this.waitingPositionValidation==!0&&this.onTakePictureCallback({photo:this.capturePhotoUrl,errorMessage:t.message,success:!1});break;case"CapturePhoto":this.capturePhotoUrl=""+t.message;let o=document.getElementById("photo-icon-container");if(o&&this.capturePhotoUrl&&this.capturePhotoUrl.trim()!==""){let s=document.getElementById("img-photo");s||(o.innerHTML="",s=document.createElement("img"),s.id="img-photo",this.applyStyles(s,{width:"100%",height:"100%",objectFit:"contain",objectPosition:"center",borderRadius:"8px",display:"block"}),o.appendChild(s));let a=this.capturePhotoUrl.startsWith("data:")?this.capturePhotoUrl:"data:image/jpeg;base64,"+this.capturePhotoUrl;s.src=a,s.onload=()=>{console.log("Image loaded successfully in icon container")},s.onerror=c=>{console.error("Error loading image:",c)}}this.waitingPositionValidation==!1&&this.onTakePictureCallback({photo:this.capturePhotoUrl});break;case"Check_Transmission":t.message=="Transmission_OK"&&(this.transmissionOk=!0);break;case"Cancel":this.closeCheckExternalCamera();break;case"EnvironmentAlert":this.onRealtimeAlertsCallback({status:"ALERT",description:t.message,type:"environment_alert"});break}}handleWebSocketMessage(t){switch(this.currentStep=t,t){case 1:this.currentStep===1&&(this.nextState(),this.onQrCodeReadedCallback(!0));break;case 2:this.nextState(),this.waitingPositionValidation==!0&&this.onTakePictureCallback({photo:this.capturePhotoUrl,success:!0});break;case 3:this.closeCheckExternalCamera();break;case 9:console.error("Erro recebido do processo de c\xE2mera externa."),this.closeCheckExternalCamera(),this.resolvePromise({result:!1});break}}async disconnectWebSocket(){if(this.connection)try{await this.connection.stop(),console.log("Desconectado do SignalR.")}catch(t){console.error("Erro ao desconectar do SignalR:",t)}finally{this.connection=null}}closeCheckExternalCamera(){e.isModalOpen=!1,this.disconnectWebSocket(),document.querySelector("#externalCameraCheck")?.remove()}applyStyles(t,r){for(let n in r)t.style[n]=r[n]}};var al=class{constructor(t){this.context=t;this.deviceData=null;this.paramsConfig={audioBehaviourParameters:{recordingBitrate:128,noiseLimit:40},imageBehaviourParameters:{useUploadImage:!0,uploadInterval:20,saveVideo:!0},videoBehaviourParameters:{detectFace:!1,detectPerson:!1,detectCellPhone:!1,detectNoise:!1,detectSpeech:!1,realtimePackageSize:10,realtimeCaptureInterval:2}};this.proctoringId="";this.insights=void 0;this.state="Stop";this.serviceType="Upload";this.onStopSharingScreenCallback=()=>{};this.onLostFocusCallback=()=>{};this.onLostFocusAlertRecorderCallback=t=>{};this.onFocusCallback=()=>{};this.onFocusAlertRecorderCallback=t=>{};this.onChangeDevicesCallback=t=>{};this.onRealtimeAlertsCallback=t=>{};this.onBufferSizeErrorCallback=t=>{};this.backend=new nr({type:t.type||"prod",token:t.token}),this.repository=new rs("EasyProctorDb","exams2"),this.repositoryDevices=new rs("EasyProctorDbDevices","devices"),this.context.credentials?.cpf&&(this.auth=new Tc(this.context.credentials.cpf,this.backend)),this.appChecker=new sl(this.context,r=>this.onRealtimeAlertsCallback(r))}setOnStopSharingScreenCallback(t){this.onStopSharingScreenCallback=async()=>{me.registerStopSharingScreen(this.proctoringId,"Stop sharing screen"),this.allRecorders?.alertRecorder?.addAlert({alert:34,type:3}),this.allRecorders?.screenRecorder?.stopRecording(),t()}}setOnLostFocusAlertRecorderCallback(){this.onLostFocusAlertRecorderCallback=async t=>{this.onLostFocusCallback&&this.onLostFocusCallback(),this.sessionOptions.proctoringType==="REALTIME"&&await this.onRealtimeAlertsCallback({type:"lost_focus",category:"lost_focus",description:"Perda de foco no exame",begin:t.begin,end:t.end,alert:25,status:"ALERT"})}}setOnFocusAlertRecorderCallback(){this.onFocusAlertRecorderCallback=async t=>{this.onFocusCallback&&this.onFocusCallback(),this.sessionOptions.proctoringType==="REALTIME"&&await this.onRealtimeAlertsCallback({type:"focus",category:"focus",description:"Retorno de foco no exame",begin:t.begin,end:t.end,alert:25,status:"OK"})}}async setOnLostFocusCallback(t){this.onLostFocusCallback=async()=>await t(),this.setOnLostFocusAlertRecorderCallback()}async setOnFocusCallback(t){this.onFocusCallback=async()=>await t(),this.setOnFocusAlertRecorderCallback()}async onChangeDevices(t={}){new Va(this.repositoryDevices,this.proctoringId,this.sessionOptions,this.allRecorders).startRecording(t),this.onChangeDevicesCallback=n=>t.status&&t.status(n)}convertRealtimeCategoryToAlertCategory(t){switch(t){case"no_face_detected":return 1;case"multiple_faces_detected":return 2;case"multiple_persons_detected":return 28;case"no_person_detected":return 29;case"lost_focus":return 25;case"focus":return 25;default:return null}}convertRealtimeTypeToWarningType(t){switch(t){case"face_detection_on_stream":return 0;case"person_detection_on_stream":return 1;case"lost_focus":return 2;case"focus":return 2;default:return null}}async stopRealtimeAlert(t){let n=async i=>{if(!(i>3))try{var o=await this.backend.stopRealtimeAlert({proctoringId:this.proctoringId,begin:t.begin,end:t.end,warningCategoryEnum:this.convertRealtimeTypeToWarningType(t.type),alertImageBase64:await this.allRecorders.cameraRecorder.getCurrentImageBase64(),retry:i<2});return console.log("response stopRealtimeAlert",o),o}catch(s){return console.log("error stopRealtimeAlert",s),n(i+1)}};await n(1)}async onRealtimeAlerts(t={}){this.setOnLostFocusAlertRecorderCallback(),this.setOnFocusAlertRecorderCallback(),this.onRealtimeAlertsCallback=async r=>{t.data&&t.data(r),this.sessionOptions.proctoringType==="REALTIME"&&(r.type==="face_detection_on_stream"||r.type==="person_detection_on_stream"||r.type==="lost_focus"||r.type==="focus")&&(r.status==="ALERT"?await this.backend.startRealtimeAlert({proctoringId:this.proctoringId,begin:r.begin,end:r.end,alert:this.convertRealtimeCategoryToAlertCategory(r.category)}):r.status==="OK"&&await this.stopRealtimeAlert(r))}}setOnBufferSizeErrorCallback(t){this.onBufferSizeErrorCallback=r=>t(r)}setDeviceCheckData(t){this.deviceData=t}createRecorders(t=ir){this.onChangeDevices();let r=new Zr({cameraId:this.sessionOptions.cameraId,microphoneId:this.sessionOptions.microphoneId,onBufferSizeError:this.sessionOptions.onBufferSizeError,onBufferSizeErrorCallback:a=>this.onBufferSizeErrorCallback(a),proctoringType:this.sessionOptions.proctoringType,onChangeDevicesCallback:a=>this.onChangeDevicesCallback(a),onRealtimeAlertsCallback:a=>this.onRealtimeAlertsCallback(a)},{width:this.videoOptions.width,height:this.videoOptions.height,minWidth:this.videoOptions.minWidth,minHeight:this.videoOptions.minHeight},this.paramsConfig,this.backend,this.context.token),n=this.sessionOptions.captureScreen?new Ac({allowOnlyFirstMonitor:this.sessionOptions.allowOnlyFirstMonitor??!0,allowMultipleMonitors:this.sessionOptions.allowMultipleMonitors??!0,screenRecorderOptions:this.sessionOptions.screenRecorderOptions,onStopSharingScreenCallback:()=>this.onStopSharingScreenCallback(),onBufferSizeError:this.sessionOptions.onBufferSizeError,onBufferSizeErrorCallback:()=>this.onBufferSizeErrorCallback()}):void 0,i=new Wa({onFocusCallback:a=>this.onFocusAlertRecorderCallback(a),onLostFocusCallback:a=>this.onLostFocusAlertRecorderCallback(a),onRealtimeAlertCallback:a=>this.onRealtimeAlertsCallback(a)},t),o=new xc(t,this.proctoringSession,this.paramsConfig,r,a=>this.onRealtimeAlertsCallback(a),this.backend,this.context.token),s=[r,n,i].filter(Boolean);return s.push(o),this.recorder=new Ha(this.proctoringSession,s),{cameraRecorder:r,screenRecorder:n,alertRecorder:i,noiseRecorder:o}}async login(){if(!this.context.credentials?.cpf)throw Qg;this.context.token=await this.auth.login()}async start(t=ir,r={}){try{if(this.context.token===void 0)throw Zg;this.extension=new ja,this.extension.addEventListener();let n=this.backend.selectBaseUrl(this.context.type),i=await ur();await this.repositoryDevices.save({...i,id:"devices"}),this.sessionOptions={...ir,...t},this.videoOptions=Oa(r),await this.initConfig(t.useGeolocation),await this.verifyBrowser(),this.sessionOptions.captureScreen&&await this.verifyMultipleMonitors(this.sessionOptions);try{t?.useSpyScan&&await this.spyCam.isAlive()}catch{throw e0}if(this.state!="Stop")throw Kg;this.state="Starting",await this.repository.hasSessions()&&await this.repository.clear(),this.proctoringSession=new Hn,this.allRecorders=this.createRecorders(this.sessionOptions);let o=await this.backend.confirmStart({clientId:this.context.clientId,examId:this.context.examId,token:this.context.token},this.sessionOptions,this.geolocation?this.geolocation.coords.latitude:void 0,this.geolocation?this.geolocation.coords.longitude:void 0);this.proctoringId=o.id,me.registerDevicesChecked(this.proctoringId,!!this.deviceData,`Devices checked: ${JSON.stringify(this.deviceData)} | Devices List: ${JSON.stringify(i)}`);try{t?.useExternalCamera&&await this.appChecker.startTransmission(this.proctoringId)}catch{throw t0}this.allRecorders.cameraRecorder.setProctoringId(this.proctoringId),this.allRecorders.noiseRecorder.setProctoringId(this.proctoringId),this.proctoringSession.setProctoringId(this.proctoringId),await this.recorder.startAll(),t?.useSpyScan&&(this.spyCam.setProctoringId(this.proctoringId),this.spyCam.startCheckSpyCam(this.paramsConfig.spyScanInterval??5,{deviceType:3})),await this.repository.save(this.proctoringSession);let s={};for(let l in navigator)s[l]=navigator[l];me.registerStart(this.proctoringId,!0,`Version: ${ns()}
504
504
  Navigator: ${JSON.stringify(s)}`),o.cameraStream=this.allRecorders.cameraRecorder.cameraStream,this.allRecorders.screenRecorder&&(o.screenStream=this.allRecorders.screenRecorder.screenStream),this.state="Recording";let a=0,c=!1;return this.verifyFirstFaceInterval=setInterval(async()=>{if(this.sessionOptions.proctoringType==="REALTIME"){if(c)return;c=!0,a++;try{var l=await this.backend.verifyFace(this.proctoringId,await this.allRecorders.cameraRecorder.getCurrentImageBase64(),!(a>5));c=!1,clearInterval(this.verifyFirstFaceInterval)}catch{c=!1;return}}},1500),o}catch(n){throw console.log(n),await this.cancel(),this.proctoringId&&me.registerStart(this.proctoringId,!1,`Token: ${this.context.token}
505
505
  Version: ${ns()}
506
506
  Navigator: ${navigator}
507
- Error: ${n}`),this.state="Stop",n}}async cancel(){(this.state==="Recording"||this.state==="Starting")&&(await this.recorder.stopAll(),this.spyCam&&await this.spyCam.stopCheckSpyCam()),this.state="Stop"}async finish(t={}){try{if(this.extension.options=t,this.state!=="Recording")throw Ma;await this.recorder.stopAll(),this.spyCam&&this.spyCam.stopCheckSpyCam(),this.appChecker&&await this.appChecker.disconnectWebSocket(),await this.recorder.saveAllOnSession(),await this.repository.save(this.proctoringSession);let r,n;ns()!=="1.0.0.0"?(r=new $i(this.proctoringSession,this.proctoringId,[new Wi(this.proctoringId)]),n="Download",this.serviceType="Download"):(r=new $i(this.proctoringSession,this.proctoringId,[new Jr(this.proctoringId,this.backend),new Wi(this.proctoringId)]),n="Upload",this.serviceType="Upload");let i=!1;if(this.extension.hasExtension&&await this.extension.start().then(o=>{i=o}).catch(o=>{i=!1}),(!i||!this.extension.hasExtension)&&(await r.upload(this.context.token,t.onProgress).catch(async o=>{me.registerUpload(this.proctoringSession.id,!1,`upload error: ${o}
507
+ Error: ${n}`),this.state="Stop",n}}async cancel(){(this.state==="Recording"||this.state==="Starting")&&(await this.recorder.stopAll(),this.spyCam&&await this.spyCam.stopCheckSpyCam()),this.state="Stop"}async finish(t={}){try{if(this.extension.options=t,this.state!=="Recording")throw Ma;await this.recorder.stopAll(),this.spyCam&&this.spyCam.stopCheckSpyCam(),this.appChecker&&await this.appChecker.disconnectWebSocket(),await this.recorder.saveAllOnSession(),await this.repository.save(this.proctoringSession);let r,n;ns()!=="1.0.0.0"?(r=new $i(this.proctoringSession,this.proctoringId,[new Wi(this.proctoringId)]),n="Download",this.serviceType="Download"):(r=new $i(this.proctoringSession,this.proctoringId,[new Yr(this.proctoringId,this.backend),new Wi(this.proctoringId)]),n="Upload",this.serviceType="Upload");let i=!1;if(this.extension.hasExtension&&await this.extension.start().then(o=>{i=o}).catch(o=>{i=!1}),(!i||!this.extension.hasExtension)&&(await r.upload(this.context.token,t.onProgress).catch(async o=>{me.registerUpload(this.proctoringSession.id,!1,`upload error: ${o}
508
508
 
509
- Upload Services: ${n}`,this.serviceType),ns()!=="1.0.0.0"&&(r=new $i(this.proctoringSession,this.proctoringId,[new Jr(this.proctoringId,this.backend),new Wi(this.proctoringId)]),n="Upload",this.serviceType="Upload",n="Download",this.serviceType="Download",await r.upload(this.context.token,t.onProgress).catch(s=>{me.registerUpload(this.proctoringSession.id,!1,`upload backup error: ${s}
509
+ Upload Services: ${n}`,this.serviceType),ns()!=="1.0.0.0"&&(r=new $i(this.proctoringSession,this.proctoringId,[new Yr(this.proctoringId,this.backend),new Wi(this.proctoringId)]),n="Upload",this.serviceType="Upload",n="Download",this.serviceType="Download",await r.upload(this.context.token,t.onProgress).catch(s=>{me.registerUpload(this.proctoringSession.id,!1,`upload backup error: ${s}
510
510
 
511
511
  Upload Services: ${n}
512
512
  Upload backup for Safe Browser`,this.serviceType)}))}),me.registerUpload(this.proctoringSession.id,!0,`upload success
513
513
 
514
514
  Upload Services: ${n}`,this.serviceType)),this.proctoringSession.alerts.length>0&&await this.backend.saveAlerts(this.context,this.proctoringSession).catch(o=>{me.registerFinish(this.proctoringSession.id,!1,"save-screen error: "+o)}),await this.backend.finishAndSendUrls(this.context).then(o=>{me.registerFinish(this.proctoringSession.id,!0,""),console.log("finishResponse: ",o),t.onResultAvailable&&t.onResultAvailable(o?.score??100,o?.scoreThreshold??70,o?.approved??!0,o?.justification??"")}).catch(o=>{me.registerFinish(this.proctoringSession.id,!1,"finish error: "+o)}),this.appChecker){let o=this.appChecker.getExternalCameraSessionId();o!="null"&&await this.backend.externalCameraFinish(o)}this.verifyFirstFaceInterval&&clearInterval(this.verifyFirstFaceInterval),this.state="Stop"}catch(r){throw await this.cancel(),me.registerFinish(this.proctoringId,!1,`Token: ${this.context.token}
515
- Error: `+r),this.state="Stop",r}}async verifyMultipleMonitors(t){if(!t.allowMultipleMonitors&&await _s())throw me.registerError(this.proctoringId,"Multiplas telas detectadas!"),Fa}async verifyBrowser(){let t=await Wg();if(t!=="chrome"&&t!=="firefox"&&!mn())throw me.registerBrowserNotSupported(this.proctoringId,`Browser n\xE3o suportado:
515
+ Error: `+r),this.state="Stop",r}}async verifyMultipleMonitors(t){if(!t.allowMultipleMonitors&&await _s())throw me.registerError(this.proctoringId,"Multiplas telas detectadas!"),Fa}async verifyBrowser(){let t=await Wg();if(t!=="chrome"&&t!=="firefox"&&!Jr())throw me.registerBrowserNotSupported(this.proctoringId,`Browser n\xE3o suportado:
516
516
  Tentativa utilizando o browser ${t}`),Yg}async initConfig(t){try{let r=await this.backend.getParamsConfig(this.context);this.paramsConfig={...this.paramsConfig,...r,audioBehaviourParameters:{...this.paramsConfig.audioBehaviourParameters,...r.audioBehaviourParameters},imageBehaviourParameters:{...this.paramsConfig.imageBehaviourParameters,...r.imageBehaviourParameters},videoBehaviourParameters:{...this.paramsConfig.videoBehaviourParameters,...r.videoBehaviourParameters}},t&&(this.geolocation=await u2().then(n=>n).catch(n=>{throw n.message})),$g(this.backend),this.sessionOptions?.useSpyScan&&(this.spyCam=new Vi(this.context,{onRealtimeAlertsCallback:n=>this.onRealtimeAlertsCallback(n)}))}catch(r){throw this.proctoringId&&me.registerError(this.proctoringId,"Erro no initConfig!"),await this.cancel(),r}}async getServerDate(){let t=await this.backend.getServerHour(this.context.token).catch(n=>{me.registerError(this.proctoringId,"N\xE3o foi poss\xEDvel requisitar a data do servidor!")});return t?new Date(t.toString()):new Date}async pause(){if(this.state!=="Recording")throw me.registerError(this.proctoringId,"Proctoring n\xE3o iniciado!"),Ma;await this.recorder.stopAll(),await this.recorder.saveAllOnSession(),await this.repository.save(this.proctoringSession),this.state="Paused"}async resume(){if(this.state!="Paused")throw Ma;return await this.verifyBrowser(),await this.verifyMultipleMonitors(this.sessionOptions),await this.recorder.startAll(),this.proctoringSession.recordings=[],await this.repository.save(this.proctoringSession),this.state="Recording",{cameraStream:this.allRecorders.cameraRecorder.cameraStream,_screenStream:this.allRecorders.screenRecorder?.screenStream}}};var cl=class e{static{this.isModalOpen=!1}constructor(t){this.backend=new nr({type:t?.type||"prod",token:t.token})}async signInTerms(){if(e.isModalOpen)return Promise.reject();e.isModalOpen=!0;try{let t=await this.openModal();return new Promise(r=>{r(t)})}catch(t){return this.closeModal(),Promise.reject(t)}}openModal(){return new Promise((t,r)=>{let n=document.createElement("div");n.setAttribute("id","signTermModal");let i={backgroundColor:"rgba(0,0,0,0.4)",zIndex:"1000",position:"fixed",top:"0",left:"0",height:"100vh",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"};this.applyStyles(n,i);let o=document.createElement("div"),s={backgroundColor:"#fff",zIndex:"1001",width:"850px",maxHeight:"95%",borderRadius:"10px",display:"flex",flexDirection:"column",alignItems:"center"};this.applyStyles(o,s);let a=document.createElement("h3");a.innerText="Termo de consentimento para coleta e uso de dados";let c={color:"rgba(0, 0, 0, .7)",fontWeight:"bold",fontSize:"20px",marginBottom:"15px",padding:"20px 0px",borderBottom:"2px solid rgba(0, 0, 0, .1)",width:"100%",textAlign:"center"};this.applyStyles(a,c),o.appendChild(a);let l=document.createElement("iframe"),h="https://docs.google.com/document/u/3/d/e/2PACX-1vRMgrLhDLyDP8BHmotfPDpwAFaDHqK-mA4eBJ0Cy1mDdvHcWLsx47H4otII_4qi4rhtSf6B0OO97e9c/pub";this.backend.signTermUrl().then(z=>{if(!z)throw new Error("N\xE3o foi poss\xEDvel obter o termo de consentimento");l.setAttribute("src",z)}).catch(()=>{l.setAttribute("src",h)});let d={width:"100%",height:"500px",border:"1px solid rgba(0, 0, 0, .1)",margin:"20px",borderRadius:"5px"};this.applyStyles(l,d),o.appendChild(l);let m=document.createElement("div"),p=document.createElement("input");p.setAttribute("type","checkbox"),p.setAttribute("id","termsCheckbox");let g=document.createElement("label");g.setAttribute("for","termsCheckbox"),g.innerText="Li e aceito os termos e condi\xE7\xF5es";let f={display:"flex",alignItems:"center",gap:"10px",margin:"20px",width:"100%",paddingLeft:"20px"};this.applyStyles(m,f),m.appendChild(p),m.appendChild(g),o.appendChild(m);let b=document.createElement("div"),v={width:"100%",display:"flex",alignItems:"center",justifyContent:"center",borderTop:"2px solid rgba(0, 0, 0, .1)"};this.applyStyles(b,v);let k=document.createElement("button");k.innerText="Cancelar";let S={width:"100%",height:"70px",backgroundColor:"#FFF",border:"none",color:"rgba(0, 0, 0, .7)",fontWeight:"bold",borderRadius:"10px",paddingTop:"5px",paddingBottom:"5px"};this.applyStyles(k,S),k.addEventListener("click",()=>{this.closeModal(),t(!1)});let I=document.createElement("span"),x={width:"3px",height:"70px",margin:"0px 2px",background:"rgba(0, 0, 0, .1)"};this.applyStyles(I,x);let O=document.createElement("button");O.innerText="Continuar",O.setAttribute("id","confirmBtn");let P={width:"100%",height:"70px",backgroundColor:"#FFF",border:"none",color:"rgba(0, 0, 0, .7)",fontWeight:"bold",borderRadius:"10px",paddingTop:"5px",paddingBottom:"5px",disabled:!0,cursor:"not-allowed"};this.applyStyles(O,P),O.disabled=!0,O.addEventListener("click",()=>{this.closeModal(),this.backend.signTerm().then(()=>{t(!0)})}),p.addEventListener("change",z=>{O.disabled=!z.target.checked,z.target.checked?(O.style.color="#007bff",O.style.cursor="pointer"):(O.style.color="rgba(0, 0, 0, .7)",O.style.cursor="not-allowed")}),b.appendChild(k),b.appendChild(I),b.appendChild(O),o.appendChild(b),n.appendChild(o),document.body.appendChild(n)})}async closeModal(){e.isModalOpen=!1,document.querySelector("#signTermModal")?.remove()}applyStyles(t,r){for(let[n,i]of Object.entries(r))t.style[n]=i}};function Ju(e,t="prod"){e.showConsole||(console.log=()=>{},console.warn=()=>{},console.error=()=>{});let r={type:t,clientId:e.clientId,examId:e.examId,token:e.token,credentials:e.credentials,showConsole:e.showConsole},n=new al(r),i=new za(r),o=new cl(r),s=new Hi,a=n.login.bind(n),c=n.start.bind(n),l=async(U,ae)=>{let V=i.getDeviceCheckResult();return V&&n.setDeviceCheckData(V),c(U,ae)},h=n.finish.bind(n),d=n.pause.bind(n),m=n.resume.bind(n),p=n.setOnFocusCallback.bind(n),g=n.setOnLostFocusCallback.bind(n),f=n.onChangeDevices.bind(n),b=n.setOnBufferSizeErrorCallback.bind(n),v=n.setOnStopSharingScreenCallback.bind(n),k=n.onRealtimeAlerts.bind(n),S=o.signInTerms.bind(o),I=i.checkDevices.bind(i),x=n.appChecker.checkExternalCamera.bind(n.appChecker),O=n.appChecker.startSession.bind(n.appChecker),P=n.appChecker.takePicture.bind(n.appChecker),z=n.appChecker.goToPositionGuide.bind(n.appChecker),Z=n.appChecker.startTransmission.bind(n.appChecker),E=i.runCheckDevicesFlow.bind(i),F=i.changeSelectedDevice.bind(i),y=s.takePicture.bind(s);return{login:a,start:l,finish:h,onFocus:p,onLostFocus:g,onChangeDevices:f,onBufferSizeError:b,onRealtimeAlerts:k,checkDevices:I,runCheckDevicesFlow:E,changeSelectedDevice:F,capturePhoto:y,enumarateDevices:ur,checkPermissions:vs,checkIfhasMultipleMonitors:_s,onStopSharingScreen:v,signInTerms:S,checkExternalCamera:x,startExternalCameraSession:O,takeExternalCameraPicture:P,goToExternalCameraPositionStep:z,startExternalCameraTransmission:Z}}typeof window<"u"&&(window.useProctoring=Ju);})();
517
517
  /*! Bundled license information:
518
518