webdnn
Version:
Deep Neural Network Execution Framework for Web Browsers
14 lines • 175 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WebDNN=t():e.WebDNN=t()}(window,function(){var _StringfromCharCode=String.fromCharCode;return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var i in e)t.d(n,i,function(t){return e[t]}.bind(null,i));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(e[i]=n[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,o))},t.setTyped(n)},function(e,t,r){"use strict";function n(){var e={webgpu:b.webgpu.checkAvailability(),webgl:b.webgl.checkAvailability(),webassembly:b.webassembly.checkAvailability(),fallback:b.fallback.checkAvailability()},t=["webgpu","webgl","webassembly","fallback"].filter(function(t){return e[t]});return{status:e,defaultOrder:t}}function i(e,t){return a(this,void 0,void 0,function(){var r,n;return s(this,function(i){switch(i.label){case 0:if(!(e in b))throw new Error('Unknown backend: "'+e+'"');i.label=1;case 1:return i.trys.push([1,3,,4]),[4,(r=new b[e](t)).init()];case 2:return i.sent(),[3,4];case 3:return n=i.sent(),console.warn("Failed to initialize "+e+" backend: "+n),[2,null];case 4:return[2,r]}})})}var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){function r(e){return function(t){return n([e,t])}}function n(r){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(a=2&r[0]?o.return:r[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,r[1])).done)return a;switch(o=0,a&&(r=[2&r[0],a.value]),r[0]){case 0:case 1:a=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,o=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!a||r[1]>a[0]&&r[1]<a[3])){u.label=r[1];break}if(6===r[0]&&u.label<a[1]){u.label=a[1],a=r;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(r);break}a[2]&&u.ops.pop(),u.trys.pop();continue}r=t.call(e,u)}catch(e){r=[6,e],o=0}finally{i=a=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i,o,a,s,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s};Object.defineProperty(t,"__esModule",{value:!0});var u=r(21),c=r(36),l=r(37),f=r(39),h=r(40);t.Image=h;var d=r(43);t.Math=d;var p={};t.getConfiguration=function(e,t){return e in p?p[e]:t},t.setConfiguration=function(e,t){p[e]=t};var b={webgpu:f.default,webgl:l.default,webassembly:c.default,fallback:u.default};t.getBackendAvailability=n,t.load=function(e,t){return void 0===t&&(t={}),a(this,void 0,void 0,function(){var r,a,u,c,l,f,h,d,p,b,v,_,y,m,w,g,E,x,k,S,A;return s(this,function(s){switch(s.label){case 0:r=t.backendOrder,a=void 0===r?null:r,u=t.backendOptions,c=void 0===u?{}:u,l=t.cacheStrategy,f=void 0===l?"latest":l,h=t.saveCache,d=void 0===h||h,p=t.progressCallback,b=t.weightDirectory,v=t.transformUrlDelegate,a||(a=n().defaultOrder),"string"==typeof a&&(a=[a]),-1===(a=a.slice()).indexOf("fallback")&&a.concat(["fallback"]),_=function(t){return b&&/\.bin/.test(t)&&(t=t.replace(e,b)),v&&(t=v(t)),t},s.label=1;case 1:return 0<a.length?(y=a.shift(),(m=o({},c[y])).transformUrlDelegate=_,[4,i(y,m)]):[3,36];case 2:if(!(w=s.sent()))return[3,1];s.label=3;case 3:return s.trys.push([3,34,,35]),g=void 0,E=void 0,x=void 0,k=void 0,"latest"===(S=f)?[3,4]:"networkOnly"===S?[3,13]:"networkFirst"===S?[3,13]:"cacheOnly"===S?[3,20]:"cacheFirst"===S?[3,20]:[3,27];case 4:return[4,w.fetchDescriptor(e).catch(function(){return null})];case 5:return x=s.sent(),[4,w.restoreCachedDescriptor(e)];case 6:return(k=s.sent())&&x&&k.converted_at===x.converted_at?(g=k,[4,w.restoreCachedParameters(e,p)]):[3,8];case 7:if(E=s.sent())return[3,28];s.label=8;case 8:return x?(g=x,[4,w.fetchParameters(e,p)]):[3,10];case 9:if(E=s.sent())return[3,28];s.label=10;case 10:return k?(g=k,[4,w.restoreCachedParameters(e,p)]):[3,12];case 11:if(E=s.sent())return[3,28];s.label=12;case 12:throw Error("Network error is occurred and no cache is exist.");case 13:return[4,w.fetchDescriptor(e).catch(function(){return null})];case 14:return(x=s.sent())?(g=x,[4,w.fetchParameters(e,p)]):[3,16];case 15:if(E=s.sent())return[3,28];s.label=16;case 16:if("networkOnly"===f)throw Error('Network error is occurred in "networkOnly" cache strategy');return[4,w.restoreCachedDescriptor(e)];case 17:return(k=s.sent())?(g=k,[4,w.restoreCachedParameters(e,p)]):[3,19];case 18:if(E=s.sent())return[3,28];s.label=19;case 19:throw Error("Network error is occurred and no cache is exist.");case 20:return[4,w.restoreCachedDescriptor(e)];case 21:return(k=s.sent())?(g=k,[4,w.restoreCachedParameters(e,p)]):[3,23];case 22:if(E=s.sent())return[3,28];s.label=23;case 23:if("cacheOnly"===f)throw Error('No cache is exist in "cacheOnly" cache strategy');return[4,w.fetchDescriptor(e).catch(function(){return null})];case 24:return(x=s.sent())?(g=x,[4,w.fetchParameters(e,p)]):[3,26];case 25:if(E=s.sent())return[3,28];s.label=26;case 26:throw Error("Network error is occurred and no cache is exist.");case 27:throw Error('"'+f+'" is not valid cache strategy name: "latest", "networkFirst", "networkOnly", "cacheFirst", "cacheOnly" is available.');case 28:if(!d)return[3,32];s.label=29;case 29:return s.trys.push([29,31,,32]),[4,w.saveCache(e,g,E)];case 30:return s.sent(),[3,32];case 31:return s.sent(),[3,32];case 32:return[4,w.setDescriptorAndParameters(g,E)];case 33:return s.sent(),[3,35];case 34:return A=s.sent(),console.warn("Model loading failed for "+y+" backend. Trying next backend: "+A.message),[3,1];case 35:return[2,w];case 36:throw new Error("No backend is available")}})})}},function(e,t,r){(function(t){var r;
/*!
localForage -- Offline Storage, Improved
Version 1.7.3
https://localforage.github.io/localForage
(c) 2013-2017 Mozilla, Apache License 2.0
*/
/*!
localForage -- Offline Storage, Improved
Version 1.7.3
https://localforage.github.io/localForage
(c) 2013-2017 Mozilla, Apache License 2.0
*/
!function(t){e.exports=t()}(function(){return function e(t,n,i){function o(s,u){if(!n[s]){if(!t[s]){if(!u&&("function"==typeof r&&r))return r(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return o(r||e)},l,l.exports,e,t,n,i)}return n[s].exports}for(var a="function"==typeof r&&r,s=0;s<i.length;s++)o(i[s]);return o}({1:[function(e,r){(function(e){"use strict";function t(){c=!0;for(var e,t,r=l.length;r;){for(t=l,l=[],e=-1;++e<r;)t[e]();r=l.length}c=!1}var n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,a=new i(t),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),n=function(){s.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var r=e.document.createElement("script");r.onreadystatechange=function(){t(),r.onreadystatechange=null,r.parentNode.removeChild(r),r=null},e.document.documentElement.appendChild(r)}:function(){setTimeout(t,0)};else{var u=new e.MessageChannel;u.port1.onmessage=t,n=function(){u.port2.postMessage(0)}}var c,l=[];r.exports=function(e){1!==l.push(e)||c||n()}}).call(this,void 0===t?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:t)},{}],2:[function(e,t){"use strict";function r(){}function n(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,e!==r&&s(this,e)}function i(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function o(e,t,r){c(function(){var n;try{n=t(r)}catch(t){return l.reject(e,t)}n===e?l.reject(e,new TypeError("Cannot resolve promise with itself")):l.resolve(e,n)})}function a(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function s(e,t){function r(t){i||(i=!0,l.reject(e,t))}function n(t){i||(i=!0,l.resolve(e,t))}var i=!1,o=u(function(){t(n,r)});"error"===o.status&&r(o.value)}function u(e,t){var r={};try{r.value=e(t),r.status="success"}catch(t){r.status="error",r.value=t}return r}var c=e(1),l={},f=["REJECTED"],h=["FULFILLED"],d=["PENDING"];t.exports=n,n.prototype.catch=function(e){return this.then(null,e)},n.prototype.then=function(e,t){if("function"!=typeof e&&this.state===h||"function"!=typeof t&&this.state===f)return this;var n=new this.constructor(r);this.state!==d?o(n,this.state===h?e:t,this.outcome):this.queue.push(new i(n,e,t));return n},i.prototype.callFulfilled=function(e){l.resolve(this.promise,e)},i.prototype.otherCallFulfilled=function(e){o(this.promise,this.onFulfilled,e)},i.prototype.callRejected=function(e){l.reject(this.promise,e)},i.prototype.otherCallRejected=function(e){o(this.promise,this.onRejected,e)},l.resolve=function(e,t){var r=u(a,t);if("error"===r.status)return l.reject(e,r.value);var n=r.value;if(n)s(e,n);else{e.state=h,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},l.reject=function(e,t){e.state=f,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},n.resolve=function(e){return e instanceof this?e:l.resolve(new this(r),e)},n.reject=function(e){var t=new this(r);return l.reject(t,e)},n.all=function(e){function t(e,t){n.resolve(e).then(function(e){a[t]=e,++s!==i||o||(o=!0,l.resolve(c,a))},function(e){o||(o=!0,l.reject(c,e))})}var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var i=e.length,o=!1;if(!i)return this.resolve([]);for(var a=Array(i),s=0,u=-1,c=new this(r);++u<i;)t(e[u],u);return c},n.race=function(e){function t(e){n.resolve(e).then(function(e){o||(o=!0,l.resolve(s,e))},function(e){o||(o=!0,l.reject(s,e))})}var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var i=e.length,o=!1;if(!i)return this.resolve([]);for(var a=-1,s=new this(r);++a<i;)t(e[a]);return s}},{1:1}],3:[function(e){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0===t?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:t)},{2:2}],4:[function(e,t){"use strict";function r(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var r=new("undefined"==typeof BlobBuilder?"undefined"==typeof MSBlobBuilder?"undefined"==typeof MozBlobBuilder?WebKitBlobBuilder:MozBlobBuilder:MSBlobBuilder:BlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}function n(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function i(e,t,r){"function"==typeof t&&e.then(t),"function"==typeof r&&e.catch(r)}function o(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e+=""),e}function a(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function s(e){return"boolean"==typeof D?I.resolve(D):function(e){return new I(function(t){var n=e.transaction(P,z),i=r([""]);n.objectStore(P).put(i,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);t(r||!e||43<=parseInt(e[1],10))}}).catch(function(){return!1})}(e).then(function(e){return D=e})}function u(e){var t=B[e.name],r={};r.promise=new I(function(e,t){r.resolve=e,r.reject=t}),t.deferredOperations.push(r),t.dbReady=t.dbReady?t.dbReady.then(function(){return r.promise}):r.promise}function c(e){var t=B[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function l(e,t){var r=B[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function f(e,t){return new I(function(r,n){if(B[e.name]=B[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return r(e.db);u(e),e.db.close()}var i=[e.name];t&&i.push(e.version);var o=C.open.apply(C,i);t&&(o.onupgradeneeded=function(t){var r=o.result;try{r.createObjectStore(e.storeName),1>=t.oldVersion&&r.createObjectStore(P)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),o.onerror=function(e){e.preventDefault(),n(o.error)},o.onsuccess=function(){r(o.result),c(e)}})}function h(e){return f(e,!1)}function d(e){return f(e,!0)}function p(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.version<e.db.version,i=e.version>e.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||r){if(r){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function b(e){var t=function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i<t;i++)n[i]=e.charCodeAt(i);return r}(atob(e.data));return r([t],{type:e.type})}function v(e){return e&&e.__local_forage_encoded_blob}function _(e){var t=this,r=t._initReady().then(function(){var e=B[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return i(r,e,e),r}function y(e,t,r,n){void 0===n&&(n=1);try{var i=e.db.transaction(e.storeName,t);r(null,i)}catch(i){if(0<n&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return I.resolve().then(function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),d(e)}).then(function(){return function(e){u(e);for(var t,r=B[e.name],n=r.forages,i=0;i<n.length;i++)(t=n[i])._dbInfo.db&&(t._dbInfo.db.close(),t._dbInfo.db=null);return e.db=null,h(e).then(function(t){return e.db=t,p(e)?d(e):t}).then(function(t){e.db=r.db=t;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=t}).catch(function(t){throw l(e,t),t})}(e).then(function(){y(e,t,r,n-1)})}).catch(r);r(i)}}function m(e){var t,r,n,i,o,a=.75*e.length,s=e.length,u=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var c=new ArrayBuffer(a),l=new Uint8Array(c);for(t=0;t<s;t+=4)r=j.indexOf(e[t]),n=j.indexOf(e[t+1]),i=j.indexOf(e[t+2]),o=j.indexOf(e[t+3]),l[u++]=r<<2|n>>4,l[u++]=(15&n)<<4|i>>2,l[u++]=(3&i)<<6|63&o;return c}function w(e){var t,r=new Uint8Array(e),n="";for(t=0;t<r.length;t+=3)n+=j[r[t]>>2],n+=j[(3&r[t])<<4|r[t+1]>>4],n+=j[(15&r[t+1])<<2|r[t+2]>>6],n+=j[63&r[t+2]];return 2==r.length%3?n=n.substring(0,n.length-1)+"=":1==r.length%3&&(n=n.substring(0,n.length-2)+"=="),n}function g(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function E(e,t,r,n,i,o){e.executeSql(r,n,i,function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(e,s){s.rows.length?o(e,a):g(e,t,function(){e.executeSql(r,n,i,o)},o)},o):o(e,a)},o)}function x(e,t){var r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}function k(){return!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}()||0<localStorage.length}function S(e,t){e[t]=function(){var r=arguments;return e.ready().then(function(){return e[t].apply(e,r)})}}function A(){for(var e,t=1;t<arguments.length;t++)if(e=arguments[t])for(var r in e)e.hasOwnProperty(r)&&(arguments[0][r]=Q(e[r])?e[r].slice():e[r]);return arguments[0]}var T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){}}();"undefined"==typeof Promise&&e(3);var I=Promise,P="local-forage-detect-blob-support",D=void 0,B={},R=Object.prototype.toString,O="readonly",z="readwrite",N={_driver:"asyncStorage",_initStorage:function(e){function t(){return I.resolve()}var r=this,n={db:null};if(e)for(var i in e)n[i]=e[i];var o=B[n.name];o||(o={forages:[],db:null,dbReady:null,deferredOperations:[]},B[n.name]=o),o.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=_);for(var a,s=[],u=0;u<o.forages.length;u++)(a=o.forages[u])!==r&&s.push(a._initReady().catch(t));var c=o.forages.slice(0);return I.all(s).then(function(){return n.db=o.db,h(n)}).then(function(e){return n.db=e,p(n,r._defaultConfig.version)?d(n):e}).then(function(e){n.db=o.db=e,r._dbInfo=n;for(var t,i=0;i<c.length;i++)(t=c[i])!==r&&(t._dbInfo.db=n.db,t._dbInfo.version=n.version)})},_support:function(){try{if(!C)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(t){return!1}}(),iterate:function(e,t){var r=this,i=new I(function(t,n){r.ready().then(function(){y(r._dbInfo,O,function(i,o){if(i)return n(i);try{var a=o.objectStore(r._dbInfo.storeName).openCursor(),s=1;a.onsuccess=function(){var r=a.result;if(r){var n=r.value;v(n)&&(n=b(n));var i=e(n,r.key,s++);void 0===i?r.continue():t(i)}else t()},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)});return n(i,t),i},getItem:function(e,t){var r=this;e=o(e);var i=new I(function(t,n){r.ready().then(function(){y(r._dbInfo,O,function(i,o){if(i)return n(i);try{var a=o.objectStore(r._dbInfo.storeName).get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),v(e)&&(e=b(e)),t(e)},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)});return n(i,t),i},setItem:function(e,t,r){var i=this;e=o(e);var a=new I(function(r,n){var o;i.ready().then(function(){return o=i._dbInfo,"[object Blob]"===R.call(t)?s(o.db).then(function(e){return e?t:function(e){return new I(function(t,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:e.type})},n.readAsBinaryString(e)})}(t)}):t}).then(function(t){y(i._dbInfo,z,function(o,a){if(o)return n(o);try{var s=a.objectStore(i._dbInfo.storeName);null===t&&(t=void 0);var u=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),r(t)},a.onabort=a.onerror=function(){var e=u.error?u.error:u.transaction.error;n(e)}}catch(e){n(e)}})}).catch(n)});return n(a,r),a},removeItem:function(e,t){var r=this;e=o(e);var i=new I(function(t,n){r.ready().then(function(){y(r._dbInfo,z,function(i,o){if(i)return n(i);try{var a=o.objectStore(r._dbInfo.storeName).delete(e);o.oncomplete=function(){t()},o.onerror=function(){n(a.error)},o.onabort=function(){var e=a.error?a.error:a.transaction.error;n(e)}}catch(e){n(e)}})}).catch(n)});return n(i,t),i},clear:function(e){var t=this,r=new I(function(e,r){t.ready().then(function(){y(t._dbInfo,z,function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=o.error?o.error:o.transaction.error;r(e)}}catch(e){r(e)}})}).catch(r)});return n(r,e),r},length:function(e){var t=this,r=new I(function(e,r){t.ready().then(function(){y(t._dbInfo,O,function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).count();o.onsuccess=function(){e(o.result)},o.onerror=function(){r(o.error)}}catch(e){r(e)}})}).catch(r)});return n(r,e),r},key:function(e,t){var r=this,i=new I(function(t,n){return 0>e?void t(null):void r.ready().then(function(){y(r._dbInfo,O,function(i,o){if(i)return n(i);try{var a=o.objectStore(r._dbInfo.storeName),s=!1,u=a.openCursor();u.onsuccess=function(){var r=u.result;return r?void(0===e?t(r.key):s?t(r.key):(s=!0,r.advance(e))):void t(null)},u.onerror=function(){n(u.error)}}catch(e){n(e)}})}).catch(n)});return n(i,t),i},keys:function(e){var t=this,r=new I(function(e,r){t.ready().then(function(){y(t._dbInfo,O,function(n,i){if(n)return r(n);try{var o=i.objectStore(t._dbInfo.storeName).openCursor(),a=[];o.onsuccess=function(){var t=o.result;return t?(a.push(t.key),void t.continue()):void e(a)},o.onerror=function(){r(o.error)}}catch(e){r(e)}})}).catch(r)});return n(r,e),r},dropInstance:function(e,t){t=a.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var i;if(e.name){var o=e.name===r.name&&this._dbInfo.db?I.resolve(this._dbInfo.db):h(e).then(function(t){var r=B[e.name],n=r.forages;r.db=t;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=t;return t});i=e.storeName?o.then(function(t){if(t.objectStoreNames.contains(e.storeName)){var r=t.version+1;u(e);var n=B[e.name],i=n.forages;t.close();for(var o,a=0;a<i.length;a++)(o=i[a])._dbInfo.db=null,o._dbInfo.version=r;return new I(function(t,n){var i=C.open(e.name,r);i.onerror=function(e){i.result.close(),n(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}).then(function(e){n.db=e;for(var t,r=0;r<i.length;r++)(t=i[r])._dbInfo.db=e,c(t._dbInfo)}).catch(function(t){throw(l(e,t)||I.resolve()).catch(function(){}),t})}}):o.then(function(t){u(e);var r=B[e.name],n=r.forages;t.close();for(var i=0;i<n.length;i++)n[i]._dbInfo.db=null;return new I(function(t,r){var n=C.deleteDatabase(e.name);n.onerror=n.onblocked=function(e){var t=n.result;t&&t.close(),r(e)},n.onsuccess=function(){var e=n.result;e&&e.close(),t(e)}}).then(function(e){r.db=e;for(var t=0;t<n.length;t++)c(n[t]._dbInfo)}).catch(function(t){throw(l(e,t)||I.resolve()).catch(function(){}),t})})}else i=I.reject("Invalid arguments");return n(i,t),i}},j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",F=/^~~local_forage_type~([^~]+)~/,L="__lfsc__:",M=L.length,U="arbf",W="blob",H="si08",G=M+U.length,V=Object.prototype.toString,X={serialize:function(e,t){var r="";if(e&&(r=V.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===V.call(e.buffer))){var n,i=L;e instanceof ArrayBuffer?(n=e,i+=U):(n=e.buffer,"[object Int8Array]"===r?i+=H:"[object Uint8Array]"===r?i+="ui08":"[object Uint8ClampedArray]"===r?i+="uic8":"[object Int16Array]"===r?i+="si16":"[object Uint16Array]"===r?i+="ur16":"[object Int32Array]"===r?i+="si32":"[object Uint32Array]"===r?i+="ui32":"[object Float32Array]"===r?i+="fl32":"[object Float64Array]"===r?i+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(i+w(n))}else if("[object Blob]"===r){var o=new FileReader;o.onload=function(){var r="~~local_forage_type~"+e.type+"~"+w(this.result);t(L+W+r)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(i){console.error("Couldn't convert value into a JSON string: ",e),t(null,i)}},deserialize:function(e){if(e.substring(0,M)!==L)return JSON.parse(e);var t,n=e.substring(G),i=e.substring(M,G);if(i===W&&F.test(n)){var o=n.match(F);t=o[1],n=n.substring(o[0].length)}var a=m(n);switch(i){case U:return a;case W:return r([a],{type:t});case H:return new Int8Array(a);case"ui08":return new Uint8Array(a);case"uic8":return new Uint8ClampedArray(a);case"si16":return new Int16Array(a);case"ur16":return new Uint16Array(a);case"si32":return new Int32Array(a);case"ui32":return new Uint32Array(a);case"fl32":return new Float32Array(a);case"fl64":return new Float64Array(a);default:throw new Error("Unkown type: "+i)}},stringToBuffer:m,bufferToString:w},Y={_driver:"webSQLStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var n in e)r[n]="string"==typeof e[n]?e[n]:e[n].toString();var i=new I(function(e,n){try{r.db=openDatabase(r.name,r.version+"",r.description,r.size)}catch(e){return n(e)}r.db.transaction(function(i){g(i,r,function(){t._dbInfo=r,e()},function(e,t){n(t)})},n)});return r.serializer=X,i},_support:"function"==typeof openDatabase,iterate:function(e,t){var r=this,i=new I(function(t,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(r){E(r,i,"SELECT * FROM "+i.storeName,[],function(r,n){for(var o=n.rows,a=o.length,s=0;s<a;s++){var u=o.item(s),c=u.value;if(c&&(c=i.serializer.deserialize(c)),void 0!==(c=e(c,u.key,s+1)))return void t(c)}t()},function(e,t){n(t)})})}).catch(n)});return n(i,t),i},getItem:function(e,t){var r=this;e=o(e);var i=new I(function(t,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(r){E(r,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],function(e,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=i.serializer.deserialize(n)),t(n)},function(e,t){n(t)})})}).catch(n)});return n(i,t),i},setItem:function(e,t,r){return function e(t,r,i,a){var s=this;t=o(t);var u=new I(function(n,o){s.ready().then(function(){void 0===r&&(r=null);var u=r,c=s._dbInfo;c.serializer.serialize(r,function(r,l){l?o(l):c.db.transaction(function(e){E(e,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[t,r],function(){n(u)},function(e,t){o(t)})},function(r){if(r.code===r.QUOTA_ERR){if(0<a)return void n(e.apply(s,[t,u,i,a-1]));o(r)}})})}).catch(o)});return n(u,i),u}.apply(this,[e,t,r,1])},removeItem:function(e,t){var r=this;e=o(e);var i=new I(function(t,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(r){E(r,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],function(){t()},function(e,t){n(t)})})}).catch(n)});return n(i,t),i},clear:function(e){var t=this,r=new I(function(e,r){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(t){E(t,n,"DELETE FROM "+n.storeName,[],function(){e()},function(e,t){r(t)})})}).catch(r)});return n(r,e),r},length:function(e){var t=this,r=new I(function(e,r){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(t){E(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],function(t,r){var n=r.rows.item(0).c;e(n)},function(e,t){r(t)})})}).catch(r)});return n(r,e),r},key:function(e,t){var r=this,i=new I(function(t,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(r){E(r,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],function(e,r){var n=r.rows.length?r.rows.item(0).key:null;t(n)},function(e,t){n(t)})})}).catch(n)});return n(i,t),i},keys:function(e){var t=this,r=new I(function(e,r){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(t){E(t,n,"SELECT key FROM "+n.storeName,[],function(t,r){for(var n=[],i=0;i<r.rows.length;i++)n.push(r.rows.item(i).key);e(n)},function(e,t){r(t)})})}).catch(r)});return n(r,e),r},dropInstance:function(e,t){t=a.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var i,o=this;return i=e.name?new I(function(t){var n;n=e.name===r.name?o._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:n,storeNames:[e.storeName]}):t(function(e){return new I(function(t,r){e.transaction(function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(r,n){for(var i=[],o=0;o<n.rows.length;o++)i.push(n.rows.item(o).name);t({db:e,storeNames:i})},function(e,t){r(t)})},function(e){r(e)})})}(n))}).then(function(e){return new I(function(t,r){e.db.transaction(function(n){function i(e){return new I(function(t,r){n.executeSql("DROP TABLE IF EXISTS "+e,[],function(){t()},function(e,t){r(t)})})}for(var o=[],a=0,s=e.storeNames.length;a<s;a++)o.push(i(e.storeNames[a]));I.all(o).then(function(){t()}).catch(function(e){r(e)})},function(e){r(e)})})}):I.reject("Invalid arguments"),n(i,t),i}},Z={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var r in e)t[r]=e[r];return t.keyPrefix=x(e,this._defaultConfig),k()?(this._dbInfo=t,t.serializer=X,I.resolve()):I.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var r=this,i=r.ready().then(function(){for(var t,n=r._dbInfo,i=n.keyPrefix,o=i.length,a=localStorage.length,s=1,u=0;u<a;u++)if(0===(t=localStorage.key(u)).indexOf(i)){var c=localStorage.getItem(t);if(c&&(c=n.serializer.deserialize(c)),void 0!==(c=e(c,t.substring(o),s++)))return c}});return n(i,t),i},getItem:function(e,t){var r=this;e=o(e);var i=r.ready().then(function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n});return n(i,t),i},setItem:function(e,t,r){var i=this;e=o(e);var a=i.ready().then(function(){void 0===t&&(t=null);var r=t;return new I(function(n,o){var a=i._dbInfo;a.serializer.serialize(t,function(t,i){if(i)o(i);else try{localStorage.setItem(a.keyPrefix+e,t),n(r)}catch(t){("QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&o(t),o(t)}})})});return n(a,r),a},removeItem:function(e,t){var r=this;e=o(e);var i=r.ready().then(function(){var t=r._dbInfo;localStorage.removeItem(t.keyPrefix+e)});return n(i,t),i},clear:function(e){var t=this,r=t.ready().then(function(){for(var e,r=t._dbInfo.keyPrefix,n=localStorage.length-1;0<=n;n--)0===(e=localStorage.key(n)).indexOf(r)&&localStorage.removeItem(e)});return n(r,e),r},length:function(e){var t=this.keys().then(function(e){return e.length});return n(t,e),t},key:function(e,t){var r=this,i=r.ready().then(function(){var t,n=r._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t});return n(i,t),i},keys:function(e){var t=this,r=t.ready().then(function(){for(var e,r=t._dbInfo,n=localStorage.length,i=[],o=0;o<n;o++)0===(e=localStorage.key(o)).indexOf(r.keyPrefix)&&i.push(e.substring(r.keyPrefix.length));return i});return n(r,e),r},dropInstance:function(e,t){if(t=a.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var r=this.config();e.name=e.name||r.name,e.storeName=e.storeName||r.storeName}var i,o=this;return n(i=e.name?new I(function(t){e.storeName?t(x(e,o._defaultConfig)):t(e.name+"/")}).then(function(e){for(var t,r=localStorage.length-1;0<=r;r--)0===(t=localStorage.key(r)).indexOf(e)&&localStorage.removeItem(t)}):I.reject("Invalid arguments"),t),i}},K=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},q=function(e,t){for(var r=e.length,n=0;n<r;){if(K(e[n],t))return!0;n++}return!1},Q=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},J={},$={},ee={INDEXEDDB:N,WEBSQL:Y,LOCALSTORAGE:Z},te=[ee.INDEXEDDB._driver,ee.WEBSQL._driver,ee.LOCALSTORAGE._driver],re=["dropInstance"],ne=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(re),ie={description:"",driver:te.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},oe=new(function(){function e(t){for(var r in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ee)if(ee.hasOwnProperty(r)){var n=ee[r],i=n._driver;this[r]=i,J[i]||this.defineDriver(n)}this._defaultConfig=A({},ie),this._config=A({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":T(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"==t&&(e[t]=e[t].replace(/\W/g,"_")),"version"==t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e&&e.driver)||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,r){var o=new I(function(t,r){try{var i=e._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void r(o);for(var a=ne.concat("_initStorage"),s=0,u=a.length;s<u;s++){var c=a[s];if((!q(re,c)||e[c])&&"function"!=typeof e[c])return void r(o)}!function(){for(var t,r=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),r=I.reject(t);return n(r,arguments[arguments.length-1]),r}},i=0,o=re.length;i<o;i++)e[t=re[i]]||(e[t]=r(t))}();var l=function(r){J[i]&&console.info("Redefining LocalForage driver: "+i),J[i]=e,$[i]=r,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(l,r):l(!!e._support):l(!0)}catch(t){r(t)}});return i(o,t,r),o},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,r){var n=J[e]?I.resolve(J[e]):I.reject(new Error("Driver not found."));return i(n,t,r),n},e.prototype.getSerializer=function(e){var t=I.resolve(X);return i(t,e),t},e.prototype.ready=function(e){var t=this,r=t._driverSet.then(function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready});return i(r,e,e),r},e.prototype.setDriver=function(e,t,r){function n(){a._config.driver=a.driver()}function o(e){return a._extend(e),n(),a._ready=a._initStorage(a._config),a._ready}var a=this;Q(e)||(e=[e]);var s=this._getSupportedDrivers(e),u=null===this._driverSet?I.resolve():this._driverSet.catch(function(){return I.resolve()});return this._driverSet=u.then(function(){var e=s[0];return a._dbInfo=null,a._ready=null,a.getDriver(e).then(function(e){a._driver=e._driver,n(),a._wrapLibraryMethodsWithReady(),a._initDriver=function(e){return function(){var t=0;return function r(){for(;t<e.length;){var i=e[t];return t++,a._dbInfo=null,a._ready=null,a.getDriver(i).then(o).catch(r)}n();var s=new Error("No available storage method found.");return a._driverSet=I.reject(s),a._driverSet}()}}(s)})}).catch(function(){n();var e=new Error("No available storage method found.");return a._driverSet=I.reject(e),a._driverSet}),i(this._driverSet,t,r),this._driverSet},e.prototype.supports=function(e){return!!$[e]},e.prototype._extend=function(e){A(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t,r=[],n=0,i=e.length;n<i;n++)t=e[n],this.supports(t)&&r.push(t);return r},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=ne.length;e<t;e++)S(this,ne[e])},e.prototype.createInstance=function(t){return new e(t)},e}());t.exports=oe},{3:3}]},{},[4])(4)})}).call(this,r(22))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(23),i=r(33);t.default=function(e){switch(e){case"raw":return new i.default;case"eightbit":return new n.default;default:throw new Error("Unknown weight encoding")}}},function(e,t,r){"use strict";function n(e,t){return new Promise(function(r,n){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="blob";var o=new a.default;i.onload=function(){o.forceDispatch();var e=new Response(i.response);r(e)},i.onprogress=function(e){t&&o.request(function(){return t(e.loaded,e.total)})},i.onerror=function(e){n(e)},i.send(null)})}var i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function r(e){return function(t){return n([e,t])}}function n(r){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(a=2&r[0]?o.return:r[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,r[1])).done)return a;switch(o=0,a&&(r=[2&r[0],a.value]),r[0]){case 0:case 1:a=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,o=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!a||r[1]>a[0]&&r[1]<a[3])){u.label=r[1];break}if(6===r[0]&&u.label<a[1]){u.label=a[1],a=r;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(r);break}a[2]&&u.ops.pop(),u.trys.pop();continue}r=t.call(e,u)}catch(e){r=[6,e],o=0}finally{i=a=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i,o,a,s,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s};Object.defineProperty(t,"__esModule",{value:!0});var a=r(34);t.default=function(e,t,r){return i(this,void 0,void 0,function(){var i;return o(this,function(o){switch(o.label){case 0:return"string"==typeof(e="string"==typeof e?t(e)+(r&&r.ignoreCache?"?t="+Date.now():""):Object.assign({},e,{url:t(e.url)+(r&&r.ignoreCache?"?t="+Date.now():"")}))&&function(){if(!window.hasOwnProperty("ProgressEvent")||!window.hasOwnProperty("FormData"))return!1;var e=new XMLHttpRequest;if("string"!=typeof e.responseType)return!1;try{return e.responseType="blob","blob"===e.responseType}catch(e){return!1}}()?[4,n(e,r&&r.progressCallback)]:[3,2];case 1:return i=o.sent(),[3,4];case 2:return[4,fetch(e,r)];case 3:i=o.sent(),o.label=4;case 4:if(!i.ok)throw new Error("Fetch returns status code "+i.status+": "+i.statusText);return[2,i]}})})},t.readArrayBufferProgressively=function(e,t){if(!t||!e.body)return e.arrayBuffer();var r=e.headers.get("Content-Length");if(!r)return e.arrayBuffer();var n=parseInt(r),i=new Uint8Array(n),o=0,s=e.body.getReader(),u=new a.default;return s.read().then(function e(r){return i.set(r.value,o),o+=r.value.length,t&&u.request(function(){return t(o,n)}),o==n?(u.forceDispatch(),i.buffer):s.read().then(e)})}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PlaceholderContext=function(){function PlaceholderContext(e){this.values={},e&&this.update(e)}return Object.defineProperty(PlaceholderContext.prototype,"isResolved",{get:function(){return Object.values(this.values).every(function(e){return"number"==typeof e})},enumerable:!0,configurable:!0}),PlaceholderContext.prototype.update=function(e){this.values=Object.assign(this.values,e)},PlaceholderContext.prototype.resolve=function(placeholder){var _this=this;if("object"!=typeof placeholder)return placeholder;if(1==Object.keys(placeholder).length&&"eval"in placeholder){if(!this.isResolved)throw Error("Not all placeholders are resolved: "+this);return eval("(function(placeholders){return "+placeholder.eval+";})")(this.values)}return placeholder instanceof Array?placeholder.map(function(e){return _this.resolve(e)}):Object.entries(placeholder).reduce(function(e,t){var r=t[0],n=t[1];return e[r]=_this.resolve(n),e},{})},PlaceholderContext.prototype.toString=function(){return JSON.stringify(this.values)},PlaceholderContext}();exports.default=PlaceholderContext},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.BYTES_PER_ELEMENT=4,t}return n(t,e),t.prototype.toActual=function(){if(!this.buffer)throw new Error("Internal buffer for this variable is not set. DescriptorRunner.setPlaceholderValue() have to be called before calling this function.");return new Float32Array(this.buffer,this.byteOffset,this.length)},t.prototype.every=function(e,t){return this.toActual().every(e,t)},t.prototype.filter=function(e,t){return this.toActual().filter(e,t)},t.prototype.find=function(e,t){return this.toActual().find(e,t)},t.prototype.findIndex=function(e,t){return this.toActual().findIndex(e,t)},t.prototype.forEach=function(e,t){return this.toActual().forEach(e,t)},t.prototype.map=function(e,t){return this.toActual().map(e,t)},t.prototype.reduce=function(e,t){return this.toActual().reduce(e,t)},t.prototype.reduceRight=function(e,t){return this.toActual().reduceRight(e,t)},t.prototype.reverse=function(){return this.toActual().reverse()},t.prototype.slice=function(e,t){return this.toActual().slice(e,t)},t.prototype.some=function(e,t){return this.toActual().some(e,t)},t.prototype.subarray=function(e,t){return this.toActual().subarray(e,t)},t.prototype.includes=function(e,t){return this.toActual().includes(e,t)},t.BYTES_PER_ELEMENT=4,t}(r(35).SymbolicTypedArray);t.default=i},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){void 0===e&&(e={}),this.descriptor=null;var t=e.transformUrlDelegate,r=void 0===t?function(e){return e}:t;this.transformUrlDelegate=r}return e.checkAvailability=function(){return!1},e}();t.DescriptorRunner=r},function(e){"use strict";e.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"}},function(e){"use strict";e.exports=function(e,t,r,n){for(var i=0|65535&e,o=0|65535&e>>>16,a=0;0!==r;){r-=a=2e3<r?2e3:r;do{o=0|o+(i=0|i+t[n++])}while(--a);i%=65521,o%=65521}return i|o<<16|0}},function(e){"use strict";var t=function(){for(var e,t=[],r=0;256>r;r++){e=r;for(var n=0;8>n;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){e^=-1;for(var o=i;o<i+n;o++)e=e>>>8^t[255&(e^r[o])];return-1^e}},function(e,t,r){"use strict";function n(e,t){if(65534>t&&(e.subarray&&a||!e.subarray&&o))return _StringfromCharCode.apply(null,i.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=_StringfromCharCode(e[n]);return r}var i=r(0),o=!0,a=!0;try{_StringfromCharCode.apply(null,[0])}catch(e){o=!1}try{_StringfromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var s=new i.Buf8(256),u=0;256>u;u++)s[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;s[254]=s[254]=1,t.string2buf=function(e){var t,r,n,o,a,s=e.length,u=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&(56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++)),u+=128>r?1:2048>r?2:65536>r?3:4;for(t=new i.Buf8(u),a=0,o=0;a<u;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&(56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++)),128>r?t[a++]=r:2048>r?(t[a++]=192|r>>>6,t[a++]=128|63&r):65536>r?(t[a++]=224|r>>>12,t[a++]=128|63&r>>>6,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|63&r>>>12,t[a++]=128|63&r>>>6,t[a++]=128|63&r);return t},t.buf2binstring=function(e){return n(e,e.length)},t.binstring2buf=function(e){for(var t=new i.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},t.buf2string=function(e,t){var r,i,o,a,u=t||e.length,c=Array(2*u);for(i=0,r=0;r<u;)if(128>(o=e[r++]))c[i++]=o;else if(4<(a=s[o]))c[i++]=65533,r+=a-1;else{for(o&=2===a?31:3===a?15:7;1<a&&r<u;)o=o<<6|63&e[r++],a--;1<a?c[i++]=65533:65536>o?c[i++]=o:(o-=65536,c[i++]=55296|1023&o>>10,c[i++]=56320|1023&o)}return n(c,i)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return 0>r?t:0===r?t:r+s[e[r]]>t?r:t}},function(e){"use strict";e.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}},function(e){"use strict";e.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}},function(e,t,r){"use strict";function n(e){return"WebGL2RenderingContext"===e.constructor.name}function i(e){if(null===e)throw Error("Null is detected");return e}var o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){function r(e){return function(t){return n([e,t])}}function n(r){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(a=2&r[0]?o.return:r[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,r[1])).done)return a;switch(o=0,a&&(r=[2&r[0],a.value]),r[0]){case 0:case 1:a=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,o=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!a||r[1]>a[0]&&r[1]<a[3])){u.label=r[1];break}if(6===r[0]&&u.label<a[1]){u.label=a[1],a=r;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(r);break}a[2]&&u.ops.pop(),u.trys.pop();continue}r=t.call(e,u)}catch(e){r=[6,e],o=0}finally{i=a=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i,o,a,s,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1);t.isWebGL2=n;var u,c=function(){function e(){this.gl=i(e.initializeContext())}return e.getInstance=function(){return u||(u=new e),u},e.prototype.createTexture=function(e,t,r,n){var o=this.gl,a=i(o.createTexture());return o.activeTexture(o.TEXTURE0+9),o.bindTexture(o.TEXTURE_2D,a),o.texImage2D(o.TEXTURE_2D,0,r,e,t,0,n,o.FLOAT,null),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.NEAREST),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.NEAREST),o.bindTexture(o.TEXTURE_2D,null),a},e.prototype.createVertexShader=function(e){return this.createShader(this.gl.VERTEX_SHADER,e)},e.prototype.createFragmentShader=function(e){return this.createShader(this.gl.FRAGMENT_SHADER,e)},e.prototype.createShader=function(e,t){var r=i(this.gl.createShader(e));if(this.gl.shaderSource(r,t),this.gl.compileShader(r),!this.gl.getShaderParameter(r,this.gl.COMPILE_STATUS))throw console.error(this.gl.getShaderInfoLog(r)),Error("Shader Compile failed: "+this.gl.getShaderInfoLog(r));return r},e.prototype.createProgram=function(e,t){var r=i(this.gl.createProgram());if(this.gl.attachShader(r,t),this.gl.attachShader(r,e),this.gl.linkProgram(r),!this.gl.getProgramParameter(r,this.gl.LINK_STATUS))throw console.error(this.gl.getProgramInfoLog(r)),Error("ShaderProgram Initialization failed.");return r},e.prototype.createArrayBuffer=function(e){var t=i(this.gl.createBuffer());return this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferData(this.gl.ARRAY_BUFFER,e,this.gl.STATIC_DRAW),t},e.prototype.createFrameBuffer=function(){return i(this.gl.createFramebuffer())},e.prototype.bindArrayBuffer=function(e){this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e)},e.prototype.bindFrameBuffer=function(e,t,r){this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e),this.gl.viewport(0,0,t,r),this.gl.scissor(0,0,t,r)},e.prototype.useProgram=function(e){this.gl.useProgram(e)},e.prototype.deleteTexture=function(e){this.gl.del