/*

 Copyright 2016 Google Inc.
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 Copyright 2017 Google Inc.
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 Copyright 2015 Mozilla Foundation

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(n,f,l){n!=Array.prototype&&n!=Object.prototype&&(n[f]=l.value)};$jscomp.getGlobal=function(n){return"undefined"!=typeof window&&window===n?n:"undefined"!=typeof global&&null!=global?global:n};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(n){return $jscomp.SYMBOL_PREFIX+(n||"")+$jscomp.symbolCounter_++};
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var n=$jscomp.global.Symbol.iterator;n||(n=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[n]&&$jscomp.defineProperty(Array.prototype,n,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(n){var f=0;return $jscomp.iteratorPrototype(function(){return f<n.length?{done:!1,value:n[f++]}:{done:!0}})};
$jscomp.iteratorPrototype=function(n){$jscomp.initSymbolIterator();n={next:n};n[$jscomp.global.Symbol.iterator]=function(){return this};return n};$jscomp.makeIterator=function(n){$jscomp.initSymbolIterator();$jscomp.initSymbol();$jscomp.initSymbolIterator();var f=n[Symbol.iterator];return f?f.call(n):$jscomp.arrayIterator(n)};$jscomp.arrayFromIterator=function(n){for(var f,l=[];!(f=n.next()).done;)l.push(f.value);return l};$jscomp.arrayFromIterable=function(n){return n instanceof Array?n:$jscomp.arrayFromIterator($jscomp.makeIterator(n))};
$jscomp.owns=function(n,f){return Object.prototype.hasOwnProperty.call(n,f)};$jscomp.polyfill=function(n,f,l,h){if(f){l=$jscomp.global;n=n.split(".");for(h=0;h<n.length-1;h++){var e=n[h];e in l||(l[e]={});l=l[e]}n=n[n.length-1];h=l[n];f=f(h);f!=h&&null!=f&&$jscomp.defineProperty(l,n,{configurable:!0,writable:!0,value:f})}};
$jscomp.polyfill("WeakMap",function(n){function f(a){$jscomp.owns(a,h)||$jscomp.defineProperty(a,h,{value:{}})}function l(a){var b=Object[a];b&&(Object[a]=function(a){f(a);return b(a)})}if(function(){if(!n||!Object.seal)return!1;try{var a=Object.seal({}),b=Object.seal({}),d=new n([[a,2],[b,3]]);if(2!=d.get(a)||3!=d.get(b))return!1;d.delete(a);d.set(b,4);return!d.has(a)&&4==d.get(b)}catch(p){return!1}}())return n;var h="$jscomp_hidden_"+Math.random().toString().substring(2);l("freeze");l("preventExtensions");
l("seal");var e=0,c=function(a){this.id_=(e+=Math.random()+1).toString();if(a){$jscomp.initSymbol();$jscomp.initSymbolIterator();a=$jscomp.makeIterator(a);for(var b;!(b=a.next()).done;)b=b.value,this.set(b[0],b[1])}};c.prototype.set=function(a,b){f(a);if(!$jscomp.owns(a,h))throw Error("WeakMap key fail: "+a);a[h][this.id_]=b;return this};c.prototype.get=function(a){return $jscomp.owns(a,h)?a[h][this.id_]:void 0};c.prototype.has=function(a){return $jscomp.owns(a,h)&&$jscomp.owns(a[h],this.id_)};c.prototype.delete=
function(a){return $jscomp.owns(a,h)&&$jscomp.owns(a[h],this.id_)?delete a[h][this.id_]:!1};return c},"es6","es3");$jscomp.MapEntry=function(){};
$jscomp.polyfill("Map",function(n){if(!$jscomp.ASSUME_NO_NATIVE_MAP&&function(){if(!n||!n.prototype.entries||"function"!=typeof Object.seal)return!1;try{var a=Object.seal({x:4}),d=new n($jscomp.makeIterator([[a,"s"]]));if("s"!=d.get(a)||1!=d.size||d.get({x:4})||d.set({x:4},"t")!=d||2!=d.size)return!1;var c=d.entries(),k=c.next();if(k.done||k.value[0]!=a||"s"!=k.value[1])return!1;k=c.next();return k.done||4!=k.value[0].x||"t"!=k.value[1]||!c.next().done?!1:!0}catch(g){return!1}}())return n;$jscomp.initSymbol();
$jscomp.initSymbolIterator();var f=new WeakMap,l=function(a){this.data_={};this.head_=c();this.size=0;if(a){a=$jscomp.makeIterator(a);for(var b;!(b=a.next()).done;)b=b.value,this.set(b[0],b[1])}};l.prototype.set=function(a,d){var b=h(this,a);b.list||(b.list=this.data_[b.id]=[]);b.entry?b.entry.value=d:(b.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:a,value:d},b.list.push(b.entry),this.head_.previous.next=b.entry,this.head_.previous=b.entry,this.size++);return this};l.prototype.delete=
function(a){a=h(this,a);return a.entry&&a.list?(a.list.splice(a.index,1),a.list.length||delete this.data_[a.id],a.entry.previous.next=a.entry.next,a.entry.next.previous=a.entry.previous,a.entry.head=null,this.size--,!0):!1};l.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=c();this.size=0};l.prototype.has=function(a){return!!h(this,a).entry};l.prototype.get=function(a){return(a=h(this,a).entry)&&a.value};l.prototype.entries=function(){return e(this,function(a){return[a.key,
a.value]})};l.prototype.keys=function(){return e(this,function(a){return a.key})};l.prototype.values=function(){return e(this,function(a){return a.value})};l.prototype.forEach=function(a,d){for(var b=this.entries(),k;!(k=b.next()).done;)k=k.value,a.call(d,k[1],k[0],this)};l.prototype[Symbol.iterator]=l.prototype.entries;var h=function(b,d){var c=d&&typeof d;"object"==c||"function"==c?f.has(d)?c=f.get(d):(c=""+ ++a,f.set(d,c)):c="p_"+d;var k=b.data_[c];if(k&&$jscomp.owns(b.data_,c))for(b=0;b<k.length;b++){var g=
k[b];if(d!==d&&g.key!==g.key||d===g.key)return{id:c,list:k,index:b,entry:g}}return{id:c,list:k,index:-1,entry:void 0}},e=function(a,d){var b=a.head_;return $jscomp.iteratorPrototype(function(){if(b){for(;b.head!=a.head_;)b=b.previous;for(;b.next!=b.head;)return b=b.next,{done:!1,value:d(b)};b=null}return{done:!0,value:void 0}})},c=function(){var a={};return a.previous=a.next=a.head=a},a=0;return l},"es6","es3");
$jscomp.iteratorFromArray=function(n,f){$jscomp.initSymbolIterator();n instanceof String&&(n+="");var l=0,h={next:function(){if(l<n.length){var e=l++;return{value:f(e,n[e]),done:!1}}h.next=function(){return{done:!0,value:void 0}};return h.next()}};h[Symbol.iterator]=function(){return h};return h};$jscomp.polyfill("Array.prototype.values",function(n){return n?n:function(){return $jscomp.iteratorFromArray(this,function(f,l){return l})}},"es6","es3");
$jscomp.polyfill("Number.isNaN",function(n){return n?n:function(f){return"number"===typeof f&&isNaN(f)}},"es6","es3");$jscomp.polyfill("Number.isFinite",function(n){return n?n:function(f){return"number"!==typeof f?!1:!isNaN(f)&&Infinity!==f&&-Infinity!==f}},"es6","es3");$jscomp.polyfill("Array.prototype.keys",function(n){return n?n:function(){return $jscomp.iteratorFromArray(this,function(f){return f})}},"es6","es3");
$jscomp.polyfill("Number.isInteger",function(n){return n?n:function(f){return Number.isFinite(f)?f===Math.floor(f):!1}},"es6","es3");$jscomp.polyfill("Array.from",function(n){return n?n:function(f,l,h){$jscomp.initSymbolIterator();l=null!=l?l:function(a){return a};var e=[],c=f[Symbol.iterator];if("function"==typeof c)for(f=c.call(f);!(c=f.next()).done;)e.push(l.call(h,c.value));else{c=f.length;for(var a=0;a<c;a++)e.push(l.call(h,f[a]))}return e}},"es6","es3");
$jscomp.checkStringArgs=function(n,f,l){if(null==n)throw new TypeError("The 'this' value for String.prototype."+l+" must not be null or undefined");if(f instanceof RegExp)throw new TypeError("First argument to String.prototype."+l+" must not be a regular expression");return n+""};
$jscomp.polyfill("String.prototype.startsWith",function(n){return n?n:function(f,l){var h=$jscomp.checkStringArgs(this,f,"startsWith");f+="";var e=h.length,c=f.length;l=Math.max(0,Math.min(l|0,h.length));for(var a=0;a<c&&l<e;)if(h[l++]!=f[a++])return!1;return a>=c}},"es6","es3");$jscomp.polyfill("Math.log2",function(n){return n?n:function(f){return Math.log(f)/Math.LN2}},"es6","es3");
$jscomp.polyfill("String.prototype.repeat",function(n){return n?n:function(f){var l=$jscomp.checkStringArgs(this,null,"repeat");if(0>f||1342177279<f)throw new RangeError("Invalid count value");f|=0;for(var h="";f;)if(f&1&&(h+=l),f>>>=1)l+=l;return h}},"es6","es3");$jscomp.FORCE_POLYFILL_PROMISE=!1;
$jscomp.polyfill("Promise",function(n){function f(){this.batch_=null}function l(a){return a instanceof e?a:new e(function(b,d){b(a)})}if(n&&!$jscomp.FORCE_POLYFILL_PROMISE)return n;f.prototype.asyncExecute=function(a){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(a);return this};f.prototype.asyncExecuteBatch_=function(){var a=this;this.asyncExecuteFunction(function(){a.executeBatch_()})};var h=$jscomp.global.setTimeout;f.prototype.asyncExecuteFunction=function(a){h(a,
0)};f.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var a=this.batch_;this.batch_=[];for(var b=0;b<a.length;++b){var d=a[b];delete a[b];try{d()}catch(p){this.asyncThrow_(p)}}}this.batch_=null};f.prototype.asyncThrow_=function(a){this.asyncExecuteFunction(function(){throw a;})};var e=function(a){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var b=this.createResolveAndReject_();try{a(b.resolve,b.reject)}catch(d){b.reject(d)}};e.prototype.createResolveAndReject_=
function(){function a(a){return function(k){d||(d=!0,a.call(b,k))}}var b=this,d=!1;return{resolve:a(this.resolveTo_),reject:a(this.reject_)}};e.prototype.resolveTo_=function(a){if(a===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(a instanceof e)this.settleSameAsPromise_(a);else{a:switch(typeof a){case "object":var b=null!=a;break a;case "function":b=!0;break a;default:b=!1}b?this.resolveToNonPromiseObj_(a):this.fulfill_(a)}};e.prototype.resolveToNonPromiseObj_=function(a){var b=
void 0;try{b=a.then}catch(d){this.reject_(d);return}"function"==typeof b?this.settleSameAsThenable_(b,a):this.fulfill_(a)};e.prototype.reject_=function(a){this.settle_(2,a)};e.prototype.fulfill_=function(a){this.settle_(1,a)};e.prototype.settle_=function(a,b){if(0!=this.state_)throw Error("Cannot settle("+a+", "+b|"): Promise already settled in state"+this.state_);this.state_=a;this.result_=b;this.executeOnSettledCallbacks_()};e.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var a=
this.onSettledCallbacks_,b=0;b<a.length;++b)a[b].call(),a[b]=null;this.onSettledCallbacks_=null}};var c=new f;e.prototype.settleSameAsPromise_=function(a){var b=this.createResolveAndReject_();a.callWhenSettled_(b.resolve,b.reject)};e.prototype.settleSameAsThenable_=function(a,b){var d=this.createResolveAndReject_();try{a.call(b,d.resolve,d.reject)}catch(p){d.reject(p)}};e.prototype.then=function(a,b){function d(a,b){return"function"==typeof a?function(b){try{c(a(b))}catch(m){k(m)}}:b}var c,k,g=new e(function(a,
b){c=a;k=b});this.callWhenSettled_(d(a,c),d(b,k));return g};e.prototype.catch=function(a){return this.then(void 0,a)};e.prototype.callWhenSettled_=function(a,b){function d(){switch(p.state_){case 1:a(p.result_);break;case 2:b(p.result_);break;default:throw Error("Unexpected state: "+p.state_);}}var p=this;null==this.onSettledCallbacks_?c.asyncExecute(d):this.onSettledCallbacks_.push(function(){c.asyncExecute(d)})};e.resolve=l;e.reject=function(a){return new e(function(b,d){d(a)})};e.race=function(a){return new e(function(b,
d){for(var c=$jscomp.makeIterator(a),k=c.next();!k.done;k=c.next())l(k.value).callWhenSettled_(b,d)})};e.all=function(a){var b=$jscomp.makeIterator(a),d=b.next();return d.done?l([]):new e(function(a,k){function c(b){return function(d){q[b]=d;p--;0==p&&a(q)}}var q=[],p=0;do q.push(void 0),p++,l(d.value).callWhenSettled_(c(q.length-1),k),d=b.next();while(!d.done)})};return e},"es6","es3");
$jscomp.polyfill("Set",function(n){if(!$jscomp.ASSUME_NO_NATIVE_SET&&function(){if(!n||!n.prototype.entries||"function"!=typeof Object.seal)return!1;try{var f=Object.seal({x:4}),h=new n($jscomp.makeIterator([f]));if(!h.has(f)||1!=h.size||h.add(f)!=h||1!=h.size||h.add({x:4})!=h||2!=h.size)return!1;var e=h.entries(),c=e.next();if(c.done||c.value[0]!=f||c.value[1]!=f)return!1;c=e.next();return c.done||c.value[0]==f||4!=c.value[0].x||c.value[1]!=c.value[0]?!1:e.next().done}catch(a){return!1}}())return n;
$jscomp.initSymbol();$jscomp.initSymbolIterator();var f=function(f){this.map_=new Map;if(f){f=$jscomp.makeIterator(f);for(var h;!(h=f.next()).done;)this.add(h.value)}this.size=this.map_.size};f.prototype.add=function(f){this.map_.set(f,f);this.size=this.map_.size;return this};f.prototype.delete=function(f){f=this.map_.delete(f);this.size=this.map_.size;return f};f.prototype.clear=function(){this.map_.clear();this.size=0};f.prototype.has=function(f){return this.map_.has(f)};f.prototype.entries=function(){return this.map_.entries()};
f.prototype.values=function(){return this.map_.values()};f.prototype.keys=f.prototype.values;f.prototype[Symbol.iterator]=f.prototype.values;f.prototype.forEach=function(f,h){var e=this;this.map_.forEach(function(c){return f.call(h,c,c,e)})};return f},"es6","es3");$jscomp.polyfill("Object.assign",function(n){return n?n:function(f,l){for(var h=1;h<arguments.length;h++){var e=arguments[h];if(e)for(var c in e)$jscomp.owns(e,c)&&(f[c]=e[c])}return f}},"es6","es3");
$jscomp.polyfill("Array.prototype.entries",function(n){return n?n:function(){return $jscomp.iteratorFromArray(this,function(f,l){return[f,l]})}},"es6","es3");$jscomp.polyfill("Array.prototype.fill",function(n){return n?n:function(f,l,h){var e=this.length||0;0>l&&(l=Math.max(0,e+l));if(null==h||h>e)h=e;h=Number(h);0>h&&(h=Math.max(0,e+h));for(l=Number(l||0);l<h;l++)this[l]=f;return this}},"es6","es3");
$jscomp.polyfill("Array.prototype.copyWithin",function(n){return n?n:function(f,l,h){var e=this.length;f=Number(f);l=Number(l);h=Number(null!=h?h:e);if(f<l)for(h=Math.min(h,e);l<h;)l in this?this[f++]=this[l++]:(delete this[f++],l++);else for(h=Math.min(h,e+l-f),f+=h-l;h>l;)--h in this?this[--f]=this[h]:delete this[f];return this}},"es6","es3");
(function(n){function f(h){if(l[h])return l[h].exports;var e=l[h]={i:h,l:!1,exports:{}};n[h].call(e.exports,e,e.exports,f);e.l=!0;return e.exports}var l={};f.m=n;f.c=l;f.d=function(h,e,c){f.o(h,e)||Object.defineProperty(h,e,{configurable:!1,enumerable:!0,get:c})};f.n=function(h){var e=h&&h.__esModule?function(){return h["default"]}:function(){return h};f.d(e,"a",e);return e};f.o=function(h,e){return Object.prototype.hasOwnProperty.call(h,e)};f.p="";return f(f.s=48)})([function(n,f,l){function h(a,
b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?
Object.setPrototypeOf(a,b):a.__proto__=b)}function a(a,b){q.set(a,b)}function b(a,b,d){d=void 0===d?{}:d;null!=b&&a.initializeSharedObject(b,d.id)}f.f=a;f.e=function(b,k){a(b,function(a){var b=this,c=a.id,g=new d.b;a=k.call(this,a,g);this.set(c,{promise:a,cancellationToken:g});a.then(function(a){var d=a.value;a=a.transfers;b.delete(c);b.invoke("rpc.promise.response",{id:c,value:d},a)},function(a){b.delete(c);b.invoke("rpc.promise.response",{id:c,error:a.message,errorName:a.name})})})};l.d(f,"a",function(){return m});
l.d(f,"b",function(){return v});f.d=b;l.d(f,"c",function(){return D});f.h=function(a){return function(b){b.prototype.RPC_TYPE_ID=a}};f.g=function(a){return function(b){if(void 0!==a)b.prototype.RPC_TYPE_ID=a;else if(a=b.prototype.RPC_TYPE_ID,void 0===a)throw Error("RPC_TYPE_ID should have already been defined");t.set(a,b)}};var d=l(11);n=l(16);var p=function C(a,b,d){null===a&&(a=Function.prototype);var c=Object.getOwnPropertyDescriptor(a,b);if(void 0===c){if(a=Object.getPrototypeOf(a),null!==a)return C(a,
b,d)}else{if("value"in c)return c.value;b=c.get;return void 0===b?void 0:b.call(d)}},k=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}(),g=!("undefined"!==typeof Window&&self instanceof Window),q=new Map,r=function(a){function b(a,d){h(this,b);var c=e(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,d));
c.name=a;c.message=d;return c}c(b,a);return b}(Error);a("rpc.promise.cancel",function(a){this.get(a.id).cancellationToken.cancel()});a("rpc.promise.response",function(a){var b=a.id,c=this.get(b),k=c.resolve;c=c.reject;this.delete(b);a.hasOwnProperty("value")?k(a.value):a.errorName===d.a.name?c(d.a):c(new r(a.errorName,a.error))});var x=g?-1:0,m=function(){function a(b){var d=this;h(this,a);this.target=b;this.objects=new Map;this.nextId=x;b.onmessage=function(a){a=a.data;q.get(a.functionName).call(d,
a)}}k(a,[{key:"set",value:function(a,b){this.objects.set(a,b)}},{key:"delete",value:function(a){this.objects.delete(a)}},{key:"get",value:function(a){return this.objects.get(a)}},{key:"getRef",value:function(a){var b=this.get(a.id);b.referencedGeneration=a.gen;b.addRef();return b}},{key:"invoke",value:function(a,b,d){b.functionName=a;this.target.postMessage(b,d)}},{key:"promiseInvoke",value:function(a,b,c,k){var g=this;c=void 0===c?d.e:c;return Object(d.d)(c,function(d,c,m){var u=b.id=g.newId();g.set(u,
{resolve:d,reject:c});g.invoke(a,b,k);m.add(function(){g.invoke("rpc.promise.cancel",{id:u})})})}},{key:"newId",value:function(){return g?this.nextId--:this.nextId++}},{key:"numObjects",get:function(){return this.objects.size}}]);return a}(),v=function(a){function b(){h(this,b);var a=e(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.rpc=null;a.rpcId=null;return a}c(b,a);k(b,[{key:"initializeSharedObject",value:function(a,b){b=void 0===b?a.newId():b;this.rpc=a;this.rpcId=b;this.isOwner=
!1;a.set(b,this)}},{key:"initializeCounterpart",value:function(a,b){b=void 0===b?{}:b;this.initializeSharedObject(a);this.referencedGeneration=this.unreferencedGeneration=0;this.isOwner=!0;b.id=this.rpcId;b.type=this.RPC_TYPE_ID;a.invoke("SharedObject.new",b)}},{key:"dispose",value:function(){p(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"dispose",this).call(this)}},{key:"addCounterpartRef",value:function(){return{id:this.rpcId,gen:++this.referencedGeneration}}},{key:"refCountReachedZero",
value:function(){!0===this.isOwner?this.referencedGeneration===this.unreferencedGeneration&&this.ownerDispose():!1===this.isOwner?this.rpc.invoke("SharedObject.refCountReachedZero",{id:this.rpcId,gen:this.referencedGeneration}):p(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"refCountReachedZero",this).call(this)}},{key:"ownerDispose",value:function(){var a=this.rpc,d=this.rpcId;p(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"refCountReachedZero",this).call(this);a.delete(d);
a.invoke("SharedObject.dispose",{id:d})}},{key:"counterpartRefCountReachedZero",value:function(a){this.unreferencedGeneration=a;0===this.refCount&&a===this.referencedGeneration&&this.ownerDispose()}}]);return b}(n.a),D=function(a){function d(a,c){c=void 0===c?{}:c;h(this,d);var k=e(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));b(k,a,c);return k}c(d,a);return d}(v);a("SharedObject.dispose",function(a){a=this.get(a.id);if(0!==a.refCount)throw Error("Attempted to dispose object with non-zero reference count.");
a.disposed();this.delete(a.rpcId);a.rpcId=null;a.rpc=null});a("SharedObject.refCountReachedZero",function(a){this.get(a.id).counterpartRefCountReachedZero(a.gen)});var t=new Map;a("SharedObject.new",function(a){--(new (t.get(a.type))(this,a)).refCount})},function(n,f,l){function h(a,d){var b=Math.abs(a[d]),c=Math.abs(a[d+1]),g=Math.abs(a[d+2]),q=Math.max(b,c,g);1E-4>b/q&&(a[d]=0);1E-4>c/q&&(a[d+1]=0);1E-4>g/q&&(a[d+2]=0)}function e(b){b=b.and(a[0]);for(var d=1;d<a.length;++d)b=b.xor(b.rshift(Math.pow(2,
d))).and(a[d]);return b}f.i=function(a){return a[0]*a[1]*a[2]};f.n=function(a){return a[0]+","+a[1]+","+a[2]};f.k=function(a){h(a,0);h(a,4);h(a,8)};f.l=function(a,d,c){var b=d[0],g=d[1];d=d[2];a[0]=c[0]*b+c[4]*g+c[8]*d;a[1]=c[1]*b+c[5]*g+c[9]*d;a[2]=c[2]*b+c[6]*g+c[10]*d;return a};f.b=function(a,d){var b=d[0],c=d[1],g=d[2],q=d[4],r=d[5],x=d[6],m=d[8],v=d[9];d=d[10];a[0]=Math.sqrt(b*b+c*c+g*g);a[1]=Math.sqrt(q*q+r*r+x*x);a[2]=Math.sqrt(m*m+v*v+d*d);return a};f.a=function(a){if(a.high)throw Error("Fragment ids >= 2^32 not supported yet");
var b=e(a.rshift(0)),p=e(a.rshift(1));a=e(a.rshift(2));return c.c.clone([b.low,p.low,a.low])};var c=l(31);n=l(6);l.d(f,"h",function(){return c.a});l.d(f,"j",function(){return c.b});l.d(f,"m",function(){return c.c});l=c.a.create();f.c=l;l=[c.c.fromValues(1,0,0),c.c.fromValues(0,1,0),c.c.fromValues(0,0,1)];f.d=l;l=c.c.fromValues(0,0,0);f.g=l;l=c.c.fromValues(1,1,1);f.f=l;l=c.c.fromValues(Infinity,Infinity,Infinity);f.e=l;c.b.create();var a=[new n.a(1227133513,306783378),new n.a(3272356035,818089008),
new n.a(251719695,4027515120),new n.a(4278190335,16711680),new n.a(65535,16711680),new n.a(2097151,0)]},function(n,f,l){function h(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function e(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,
writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function a(a){var b=a.downloadCancellationToken=new k.b;a.source.download(a,b).then(function(){a.downloadCancellationToken===b&&(a.downloadCancellationToken=void 0,a.downloadSucceeded())},function(d){a.downloadCancellationToken===b&&(a.downloadCancellationToken=void 0,a.downloadFailed(d),console.log("Error retrieving chunk "+
a+": "+d))})}function b(a){return new w(new m.a(a),q.a)}function d(a,b,d,c,k,g){for(;1>b.availableItems||b.availableSize<a;){var m=k.next().value;if(void 0===m)return!1;var u=m.priorityTier;if(u<d||u===d&&m.priority>=c)return!1;g(m)}return!0}Object.defineProperty(f,"__esModule",{value:!0});l.d(f,"Chunk",function(){return C});l.d(f,"ChunkSourceBase",function(){return A});l.d(f,"ChunkSource",function(){return I});l.d(f,"ChunkQueueManager",function(){return K});l.d(f,"ChunkManager",function(){return u});
f.WithParameters=function(a,b){a=function(a){function b(a){for(var d=[],k=0;k<arguments.length;++k)d[k-0]=arguments[k];c(this,b);var g;k=h(this,(g=b.__proto__||Object.getPrototypeOf(b)).call.apply(g,[].concat([this],$jscomp.arrayFromIterable(d))));k.parameters=d[1].parameters;return k}e(b,a);return b}(a);return a=J([Object(D.h)(b.RPC_ID)],a)};f.withChunkManager=function(a){return function(a){function b(a){for(var d=[],k=0;k<arguments.length;++k)d[k-0]=arguments[k];c(this,b);var g;k=h(this,(g=b.__proto__||
Object.getPrototypeOf(b)).call.apply(g,[].concat([this],$jscomp.arrayFromIterable(d))));k.chunkManager=d[0].get(d[1].chunkManager);return k}e(b,a);return b}(a)};var p=l(12),k=l(11);n=l(16);var g=l(50),q=l(51),r=l(30),x=l(57),m=l(58),v=l(13),D=l(0),t=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}(),J=this&&
this.__decorate||function(a,b,d,c){var k=arguments.length,g=3>k?b:null===c?c=Object.getOwnPropertyDescriptor(b,d):c,m;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(a,b,d,c);else for(var u=a.length-1;0<=u;u--)if(m=a[u])g=(3>k?m(g):3<k?m(b,d,g):m(b,d))||g;return 3<k&&g&&Object.defineProperty(b,d,g),g},C=function(){function a(){c(this,a);this.key=this.source=this.prev1=this.next1=this.child1=this.prev0=this.next0=this.child0=null;this.state=p.e.NEW;this.error=
null;this.newPriority=this.priority=0;this.newPriorityTier=this.priorityTier=p.d.RECENT;this.backendOnly=!1;this.downloadCancellationToken=void 0}t(a,[{key:"initialize",value:function(a){this.key=a;this.state=p.e.NEW;this.priority=Number.NEGATIVE_INFINITY;this.priorityTier=p.d.RECENT;this.newPriority=Number.NEGATIVE_INFINITY;this.newPriorityTier=p.d.RECENT;this.error=null}},{key:"updatePriorityProperties",value:function(){this.priorityTier=this.newPriorityTier;this.priority=this.newPriority;this.newPriorityTier=
p.d.RECENT;this.newPriority=Number.NEGATIVE_INFINITY}},{key:"dispose",value:function(){this.error=this.source=null}},{key:"downloadFailed",value:function(a){this.error=a;this.queueManager.updateChunkState(this,p.e.FAILED)}},{key:"downloadSucceeded",value:function(){this.queueManager.updateChunkState(this,p.e.SYSTEM_MEMORY_WORKER)}},{key:"freeSystemMemory",value:function(){}},{key:"serialize",value:function(a,b){a.id=this.key;a.source=this.source.rpcId;a["new"]=!0}},{key:"toString",value:function(){return this.key}},
{key:"chunkManager",get:function(){return this.source.chunkManager}},{key:"queueManager",get:function(){return this.source.chunkManager.queueManager}}],[{key:"priorityLess",value:function(a,b){return a.priority<b.priority}},{key:"priorityGreater",value:function(a,b){return a.priority>b.priority}}]);return a}(),A=function(a){function b(a){c(this,b);var d=h(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));d.chunkManager=a;d.chunks=new Map;d.freeChunks=[];return d}e(b,a);t(b,[{key:"getNewChunk_",
value:function(a){var b=this.freeChunks,d=b.length;if(0<d)return a=b[d-1],b.length=d-1,a.source=this,a;b=new a;b.source=this;return b}},{key:"addChunk",value:function(a){var b=this.chunks;0===b.size&&this.addRef();b.set(a.key,a)}},{key:"removeChunk",value:function(a){var b=this.chunks,d=this.freeChunks;b.delete(a.key);a.dispose();d[d.length]=a;0===b.size&&this.dispose()}}]);return b}(D.b),I=function(a){function b(a,d){c(this,b);var k=a.get(d.chunkManager);k=h(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,
k));Object(D.d)(k,a,d);return k}e(b,a);return b}(A),w=function(){function a(b,d){c(this,a);this.heapOperations=b;this.linkedListOperations=d;this.heapRoots=[null,null];this.recentHead=new C;d.initializeHead(this.recentHead)}t(a,[{key:"add",value:function(a){var b=a.priorityTier;if(b===p.d.RECENT)this.linkedListOperations.insertAfter(this.recentHead,a);else{var d=this.heapRoots;d[b]=this.heapOperations.meld(d[b],a)}}},{key:"candidates",value:function(){function a(a,y){for(;;)switch(b){case 0:if(f.heapOperations.compare!==
C.priorityLess){b=1;break}D=f;h=D.linkedListOperations;B=D.recentHead;case 3:e=h.back(B);if(null!=e){b=5;break}b=4;break;case 5:return b=7,{value:e,done:!1};case 7:if(void 0===y){b=8;break}b=-1;throw y;case 8:case 6:b=3;break;case 4:v=f,x=v.heapRoots,r=p.d.LAST_ORDERED_TIER;case 9:if(!(r>=p.d.FIRST_ORDERED_TIER)){b=11;break}case 12:q=x[r];if(null!=q){b=14;break}b=13;break;case 14:return b=16,{value:q,done:!1};case 16:if(void 0===y){b=17;break}b=-1;throw y;case 17:case 15:b=12;break;case 13:case 10:--r;
b=9;break;case 11:b=2;break;case 1:w=f.heapRoots,u=p.d.FIRST_ORDERED_TIER;case 18:if(!(u<=p.d.LAST_ORDERED_TIER)){b=20;break}case 21:m=w[u];if(null!=m){b=23;break}b=22;break;case 23:return b=25,{value:m,done:!1};case 25:if(void 0===y){b=26;break}b=-1;throw y;case 26:case 24:b=21;break;case 22:case 19:++u;b=18;break;case 20:g=f,k=g.linkedListOperations,c=g.recentHead;case 27:d=k.front(c);if(null!=d){b=29;break}b=28;break;case 29:return b=31,{value:d,done:!1};case 31:if(void 0===y){b=32;break}b=-1;
throw y;case 32:case 30:b=27;break;case 28:case 2:b=-1;default:return{value:void 0,done:!0}}}var b=0,d,c,k,g,m,u,w,q,r,x,v,e,B,h,D,f=this,t={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();t[Symbol.iterator]=function(){return this};return t}},{key:"delete",value:function(a){var b=a.priorityTier;if(b===p.d.RECENT)this.linkedListOperations.pop(a);else{var d=this.heapRoots;d[b]=this.heapOperations.remove(d[b],
a)}}}]);return a}(),B=function(a){function b(a,d){c(this,b);var k=h(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));k.itemLimit=a;k.sizeLimit=d;k.currentSize=0;k.currentItems=0;k.capacityChanged=new v.a;k.registerDisposer(a.changed.add(k.capacityChanged.dispatch));k.registerDisposer(d.changed.add(k.capacityChanged.dispatch));return k}e(b,a);t(b,[{key:"adjust",value:function(a,b){this.currentItems-=a;this.currentSize-=b}},{key:"availableSize",get:function(){return this.sizeLimit.value-this.currentSize}},
{key:"availableItems",get:function(){return this.itemLimit.value-this.currentItems}}]);return b}(n.a),K=function(k){function m(a,d){c(this,m);var k=h(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,a,d));k.queuedPromotionQueue=b(C.priorityGreater);k.downloadEvictionQueue=b(C.priorityLess);k.systemMemoryEvictionQueue=new w(new x.a(C.priorityLess),g.a);k.gpuMemoryPromotionQueue=b(C.priorityGreater);k.gpuMemoryEvictionQueue=b(C.priorityLess);k.updatePending=null;k.numQueued=0;k.numFailed=0;var u=
function(b){b=k.registerDisposer(new B(a.get(b.itemLimit),a.get(b.sizeLimit)));b.capacityChanged.add(function(){return k.scheduleUpdate()});return b};k.gpuMemoryCapacity=u(d.gpuMemoryCapacity);k.systemMemoryCapacity=u(d.systemMemoryCapacity);k.downloadCapacity=u(d.downloadCapacity);return k}e(m,k);t(m,[{key:"scheduleUpdate",value:function(){null===this.updatePending&&(this.updatePending=setTimeout(this.process.bind(this),0))}},{key:"chunkQueuesForChunk",value:function(a){function b(b,m){for(;;)switch(d){case 0:k=
!1;c=a.state;if(!k&&c!==p.e.QUEUED){d=2;break}k=!0;d=3;return{value:g.queuedPromotionQueue,done:!1};case 3:if(void 0===m){d=4;break}d=-1;throw m;case 4:d=1;break;case 2:if(!k&&c!==p.e.DOWNLOADING){d=5;break}k=!0;d=6;return{value:g.downloadEvictionQueue,done:!1};case 6:if(void 0===m){d=7;break}d=-1;throw m;case 7:return d=8,{value:g.systemMemoryEvictionQueue,done:!1};case 8:if(void 0===m){d=9;break}d=-1;throw m;case 9:d=1;break;case 5:if(k||c===p.e.SYSTEM_MEMORY_WORKER)k=!0;if(!k&&c!==p.e.SYSTEM_MEMORY){d=
10;break}k=!0;d=11;return{value:g.systemMemoryEvictionQueue,done:!1};case 11:if(void 0===m){d=12;break}d=-1;throw m;case 12:if(a.priorityTier===p.d.RECENT||a.backendOnly){d=13;break}d=14;return{value:g.gpuMemoryPromotionQueue,done:!1};case 14:if(void 0===m){d=15;break}d=-1;throw m;case 15:case 13:d=1;break;case 10:if(!k&&c!==p.e.GPU_MEMORY){d=16;break}k=!0;d=17;return{value:g.systemMemoryEvictionQueue,done:!1};case 17:if(void 0===m){d=18;break}d=-1;throw m;case 18:return d=19,{value:g.gpuMemoryEvictionQueue,
done:!1};case 19:if(void 0===m){d=20;break}d=-1;throw m;case 20:d=1;break;case 16:case 1:d=-1;default:return{value:void 0,done:!0}}}var d=0,c,k,g=this,m={next:function(a){return b(a,void 0)},throw:function(a){return b(void 0,a)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();m[Symbol.iterator]=function(){return this};return m}},{key:"adjustCapacitiesForChunk",value:function(a,b){b=b?-1:1;switch(a.state){case p.e.FAILED:this.numFailed-=b;break;case p.e.QUEUED:this.numQueued-=
b;break;case p.e.DOWNLOADING:this.downloadCapacity.adjust(b,0);this.systemMemoryCapacity.adjust(b,0);break;case p.e.SYSTEM_MEMORY:case p.e.SYSTEM_MEMORY_WORKER:this.systemMemoryCapacity.adjust(b,b*a.systemMemoryBytes);break;case p.e.GPU_MEMORY:this.systemMemoryCapacity.adjust(b,b*a.systemMemoryBytes),this.gpuMemoryCapacity.adjust(b,b*a.gpuMemoryBytes)}}},{key:"removeChunkFromQueues_",value:function(a){for(var b=$jscomp.makeIterator(this.chunkQueuesForChunk(a)),d=b.next();!d.done;d=b.next())d.value.delete(a)}},
{key:"addChunkToQueues_",value:function(a){if(a.state===p.e.QUEUED&&a.priorityTier===p.d.RECENT)return a.source.removeChunk(a),this.adjustCapacitiesForChunk(a,!1),!1;for(var b=$jscomp.makeIterator(this.chunkQueuesForChunk(a)),d=b.next();!d.done;d=b.next())d.value.add(a);return!0}},{key:"performChunkPriorityUpdate",value:function(a){a.priorityTier===a.newPriorityTier&&a.priority===a.newPriority?(a.newPriorityTier=p.d.RECENT,a.newPriority=Number.NEGATIVE_INFINITY):(this.removeChunkFromQueues_(a),a.updatePriorityProperties(),
a.state===p.e.NEW&&(a.state=p.e.QUEUED,this.adjustCapacitiesForChunk(a,!0)),this.addChunkToQueues_(a))}},{key:"updateChunkState",value:function(a,b){b!==a.state&&(this.adjustCapacitiesForChunk(a,!1),this.removeChunkFromQueues_(a),a.state=b,this.adjustCapacitiesForChunk(a,!0),this.addChunkToQueues_(a),this.scheduleUpdate())}},{key:"processGPUPromotions_",value:function(){function a(a){b.freeChunkGPUMemory(a);a.source.chunkManager.queueManager.updateChunkState(a,p.e.SYSTEM_MEMORY)}for(var b=this,c=
this.gpuMemoryPromotionQueue.candidates(),k=this.gpuMemoryEvictionQueue.candidates(),g=this.gpuMemoryCapacity;;){var m=c.next().value;if(void 0===m)break;else{if(!d(m.gpuMemoryBytes,g,m.priorityTier,m.priority,k,a))break;this.copyChunkToGPU(m);this.updateChunkState(m,p.e.GPU_MEMORY)}}}},{key:"freeChunkGPUMemory",value:function(a){this.rpc.invoke("Chunk.update",{id:a.key,state:p.e.SYSTEM_MEMORY,source:a.source.rpcId})}},{key:"freeChunkSystemMemory",value:function(a){a.state===p.e.SYSTEM_MEMORY_WORKER?
a.freeSystemMemory():this.rpc.invoke("Chunk.update",{id:a.key,state:p.e.EXPIRED,source:a.source.rpcId})}},{key:"copyChunkToGPU",value:function(a){var b=this.rpc;if(a.state===p.e.SYSTEM_MEMORY)b.invoke("Chunk.update",{id:a.key,source:a.source.rpcId,state:p.e.GPU_MEMORY});else{var d={},c=[];a.serialize(d,c);d.state=p.e.GPU_MEMORY;b.invoke("Chunk.update",d,c)}}},{key:"processQueuePromotions_",value:function(){for(var b=this,c=this,k=function(a){switch(a.state){case p.e.DOWNLOADING:var d=a.downloadCancellationToken;
a.downloadCancellationToken=void 0;d.cancel();break;case p.e.GPU_MEMORY:c.freeChunkGPUMemory(a);case p.e.SYSTEM_MEMORY_WORKER:case p.e.SYSTEM_MEMORY:c.freeChunkSystemMemory(a)}b.updateChunkState(a,p.e.QUEUED)},g=this.queuedPromotionQueue.candidates(),m=this.downloadEvictionQueue.candidates(),u=this.systemMemoryEvictionQueue.candidates(),w=this.downloadCapacity,q=this.systemMemoryCapacity;;){var r=g.next();if(r.done)break;r=r.value;var x=r.priorityTier,v=r.priority;if(!d(0,w,x,v,m,k))break;if(!d(0,
q,x,v,u,k))break;this.updateChunkState(r,p.e.DOWNLOADING);a(r)}}},{key:"process",value:function(){this.updatePending&&(this.updatePending=null,this.processGPUPromotions_(),this.processQueuePromotions_(),this.logStatistics())}},{key:"logStatistics",value:function(){}},{key:"invalidateSourceCache",value:function(a){for(var b=$jscomp.makeIterator(a.chunks.values()),d=b.next();!d.done;d=b.next()){d=d.value;switch(d.state){case p.e.DOWNLOADING:var c=d.downloadCancellationToken;d.downloadCancellationToken=
void 0;c.cancel();break;case p.e.SYSTEM_MEMORY_WORKER:d.freeSystemMemory()}this.updateChunkState(d,p.e.QUEUED)}this.rpc.invoke("Chunk.update",{source:a.rpcId});this.scheduleUpdate()}}]);return m}(D.c);K=J([Object(D.g)(p.b)],K);var u=function(a){function b(a,d){c(this,b);var k=h(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,d));k.existingTierChunks=[];k.newTierChunks=[];k.updatePending=null;k.recomputeChunkPriorities=new v.a;k.recomputeChunkPrioritiesLate=new v.a;k.memoize=new r.a;k.queueManager=
a.get(d.chunkQueueManager).addRef();for(a=p.d.FIRST_TIER;a<=p.d.LAST_TIER;++a)a!==p.d.RECENT&&(k.existingTierChunks[a]=[]);return k}e(b,a);t(b,[{key:"scheduleUpdateChunkPriorities",value:function(){null===this.updatePending&&(this.updatePending=setTimeout(this.recomputeChunkPriorities_.bind(this),0))}},{key:"recomputeChunkPriorities_",value:function(){this.updatePending=null;this.recomputeChunkPriorities.dispatch();this.recomputeChunkPrioritiesLate.dispatch();this.updateQueueState([p.d.VISIBLE])}},
{key:"requestChunk",value:function(a,b,d){a.newPriorityTier===p.d.RECENT&&this.newTierChunks.push(a);a.newPriorityTier=b;a.newPriority=d}},{key:"updateQueueState",value:function(a){var b=this.existingTierChunks,d=this.queueManager;a=$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=a.next()){var k=b[c.value],g=$jscomp.makeIterator(k);for(c=g.next();!c.done;c=g.next())c=c.value,c.newPriorityTier===p.d.RECENT&&d.performChunkPriorityUpdate(c);k.length=0}a=this.newTierChunks;k=$jscomp.makeIterator(a);
for(c=k.next();!c.done;c=k.next())c=c.value,d.performChunkPriorityUpdate(c),b[c.priorityTier].push(c);a.length=0;this.queueManager.scheduleUpdate()}}]);return b}(D.c);u=J([Object(D.g)(p.a)],u);Object(D.f)(p.c,function(a){a=this.get(a.id);a.chunkManager.queueManager.invalidateSourceCache(a)})},function(n,f,l){l.d(f,"a",function(){return h});f.b=1E-6;var h="undefined"!==typeof Float32Array?Float32Array:Array;f.c=Math.random},function(n,f,l){function h(a){if("object"===typeof a){if(null===a)return"null";
if(Array.isArray(a)){var b="[",d=a.length,c=0;if(c<d)for(b+=h(a[c]);++c<d;)b+=",",b+=h(a[c]);return b+"]"}b="{";d=Object.keys(a).sort();c=0;var q=d.length;if(c<q){var r=d[c];b+=JSON.stringify(r);for(b=b+":"+h(a[r]);++c<q;)b+=",",r=d[c],b+=JSON.stringify(r),b+=":",b+=h(a[r])}return b+"}"}return JSON.stringify(a)}function e(d){for(var c="";0<d.length;){var k=d.match(a);if(null===k){var g=d;k=d=""}else{g=d.substr(0,k.index);d=d.substr(k.index+k[0].length);var q=k[1];if(void 0!==q){if(k=q,2<=k.length&&
"'"===k.charAt(0)&&"'"===k.charAt(k.length-1)){k=k.substr(1,k.length-2);for(q='"';0<k.length;){var r=k.match(b);if(null===r){q+=k;break}q+=r[1];q+="\\";q+='"';k=k.substr(r.index+r[0].length)}k=q+'"'}}else k=k[2]}c+=g.replace(/\(/g,"[").replace(/\)/g,"]").replace("True","true").replace("False","false").replace(/,\s*([\}\]])/g,"$1");c+=k}return c}f.b=function(a,b){var d=a.length;if(!Array.isArray(b)||b.length!==d)throw Error("Incompatible sizes");for(var c=0;c<d;++c)if(!Number.isFinite(parseFloat(b[c])))throw Error("Non-finite value.");
for(c=0;c<d;++c)a[c]=parseFloat(b[c]);return a};f.d=h;f.c=function(a){return JSON.parse(e(a))};f.a=function(a,b){if(!Array.isArray(a))throw Error("Expected array, but received: "+JSON.stringify(a)+".");return a.map(b)};f.f=function(a){if("object"!==typeof a||null==a||Array.isArray(a))throw Error("Expected JSON object, but received: "+JSON.stringify(a)+".");return a};f.h=function(a){if("string"!==typeof a)throw Error("Expected string, but received: "+JSON.stringify(a)+".");return a};f.g=function(a,
b,c){a=a.hasOwnProperty(b)?a[b]:void 0;try{return c(a)}catch(g){throw Error("Error parsing "+JSON.stringify(b)+" property: "+g.message);}};f.e=function(a){var b=c.m.create(),d=b.length;if(!Array.isArray(a)||a.length!==d)throw Error("Expected length "+d+" array, but received: "+JSON.stringify(a)+".");for(var g=0;g<d;++g){var q=b,r=g;var x=a[g];b:{var m=typeof x;if("number"===m||"string"===m)if(m=parseFloat(""+x),!Number.isNaN(m)){x=m;break b}throw Error("Expected floating-point number, but received: "+
JSON.stringify(x)+".");}if(!Number.isFinite(x))throw Error("Expected finite floating-point number, but received: "+x+".");q[r]=x}return b};f.i=function(a){if(!Array.isArray(a))throw Error("Expected array, received: "+JSON.stringify(a)+".");for(var b=$jscomp.makeIterator(a),d=b.next();!d.done;d=b.next())if(d=d.value,"string"!==typeof d)throw Error("Expected string, received: "+JSON.stringify(d)+".");return a};var c=l(1),a=new RegExp(/('(?:[^'\\]|(?:\\.))*')/.source+"|"+/("(?:[^'\\]|(?:\\.))*")/.source),
b=/^((?:[^"'\\]|(?:\\.))*)"/},function(n,f,l){n="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;f.assign=function(c){for(var a=Array.prototype.slice.call(arguments,1);a.length;){var b=a.shift();if(b){if("object"!==typeof b)throw new TypeError(b+"must be non-object");for(var d in b)Object.prototype.hasOwnProperty.call(b,d)&&(c[d]=b[d])}}return c};f.shrinkBuf=function(c,a){if(c.length===a)return c;if(c.subarray)return c.subarray(0,a);c.length=a;return c};
var h={arraySet:function(c,a,b,d,p){if(a.subarray&&c.subarray)c.set(a.subarray(b,b+d),p);else for(var k=0;k<d;k++)c[p+k]=a[b+k]},flattenChunks:function(c){var a,b;var d=b=0;for(a=c.length;d<a;d++)b+=c[d].length;var p=new Uint8Array(b);d=b=0;for(a=c.length;d<a;d++){var k=c[d];p.set(k,b);b+=k.length}return p}},e={arraySet:function(c,a,b,d,p){for(var k=0;k<d;k++)c[p+k]=a[b+k]},flattenChunks:function(c){return[].concat.apply([],c)}};f.setTyped=function(c){c?(f.Buf8=Uint8Array,f.Buf16=Uint16Array,f.Buf32=
Int32Array,f.assign(f,h)):(f.Buf8=Array,f.Buf16=Array,f.Buf32=Array,f.assign(f,e))};f.setTyped(n)},function(n,f,l){l.d(f,"a",function(){return p});var h=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}(),e=new Uint32Array(2),c=[];for(n=2;36>=n;++n){f=Math.floor(32/Math.log2(n));l=Math.pow(n,f);var a=Math.floor(f/
2),b=Math.pow(n,a);a=Math.pow(n,f-a);var d="^[0-"+String.fromCharCode(48+Math.min(9,n-1));10<n&&(d+="a-"+String.fromCharCode(97+n-11),d+="A-"+String.fromCharCode(65+n-11));d+="]{1,"+Math.ceil(64/Math.log2(n))+"}$";c[n]={lowDigits:f,lowBase:l,lowBase1:b,lowBase2:a,pattern:new RegExp(d)}}var p=function(){function a(b,d){b=void 0===b?0:b;d=void 0===d?0:d;if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");this.low=b;this.high=d}h(a,[{key:"clone",value:function(){return new a(this.low,
this.high)}},{key:"assign",value:function(a){this.low=a.low;this.high=a.high}},{key:"toString",value:function(a){a=void 0===a?10:a;var b=this.low,d=this.high;if(0===d)return b.toString(a);d*=4294967296;var k=c[a],m=k.lowBase;k=k.lowDigits;var g=d%m;d=Math.floor(d/m);b+=g;d+=Math.floor(b/m);b=(b%m).toString(a);return d.toString(a)+"0".repeat(k-b.length)+b}},{key:"tryParseString",value:function(a,b){b=void 0===b?10:b;var d=c[b],k=d.lowDigits,m=d.lowBase,g=d.lowBase1,q=d.lowBase2;if(!d.pattern.test(a))return!1;
if(a.length<=k)return this.low=parseInt(a,b),this.high=0,!0;k=a.length-k;d=parseInt(a.substr(k),b);a=parseInt(a.substr(0,k),b);m=Math.floor(a*m/4294967296);g=d+a%4294967296*g%4294967296*q%4294967296;4294967296<g&&(++m,g-=4294967296);if(g>>>0!==g||m>>>0!==m)return!1;this.low=g;this.high=m;return!0}},{key:"parseString",value:function(a,b){if(!this.tryParseString(a,void 0===b?10:b))throw Error("Failed to parse string as uint64 value: "+JSON.stringify(a)+".");return this}},{key:"valid",value:function(){var a=
this.low,b=this.high;return a>>>0===a&&b>>>0===b}},{key:"toJSON",value:function(){return this.toString()}},{key:"lshift",value:function(b){b&=63;if(0==b)return this.clone();var d=this.low,c=this.high;return 32>b?new a(d<<b,c<<b|d>>>32-b):new a(0,d<<b-32)}},{key:"rshift",value:function(b){b&=63;if(0==b)return this.clone();var d=this.low,c=this.high;return 32>b?new a(d>>>b|c<<32-b,c>>b):new a(c>>b-32,0<=c?0:-1)}},{key:"or",value:function(b){return new a(this.low|b.low,this.high|b.high)}},{key:"xor",
value:function(b){return new a(this.low^b.low,this.high^b.high)}},{key:"and",value:function(b){return new a(this.low&b.low,this.high&b.high)}}],[{key:"less",value:function(a,b){return a.high<b.high||a.high===b.high&&a.low<b.low}},{key:"compare",value:function(a,b){return a.high-b.high||a.low-b.low}},{key:"equal",value:function(a,b){return a.low===b.low&&a.high===b.high}},{key:"min",value:function(b,d){return a.less(b,d)?b:d}},{key:"random",value:function(){crypto.getRandomValues(e);return new a(e[0],
e[1])}},{key:"parseString",value:function(b,d){d=void 0===d?10:d;return(new a).parseString(b,d)}}]);return a}();p.ZERO=new p(0,0)},function(n,f,l){l.d(f,"b",function(){return h});var h;(function(e){e[e.UINT8=0]="UINT8";e[e.UINT16=1]="UINT16";e[e.UINT32=2]="UINT32";e[e.UINT64=3]="UINT64";e[e.FLOAT32=4]="FLOAT32"})(h||(h={}));n=[];f.a=n;n[h.UINT8]=1;n[h.UINT16]=2;n[h.UINT32]=4;n[h.UINT64]=8;n[h.FLOAT32]=4},function(n,f,l){function h(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}l.d(f,"a",function(){return p});f.b=function(a,c){c=void 0===c?"GET":c;var k=new XMLHttpRequest;k[d]=c;k[b]=a;k.open(c,a);return k};f.c=function(a,g,q){q=void 0===q?"GET":q;var k=new XMLHttpRequest;if(Array.isArray(a)){var p=a.length;p=1===p?0:Math.abs(Object(c.a)(g))%p;a=a[p]+g}else a+=g;k[d]=q;k[b]=a;k.open(q,a);
return k};f.e=function(a,b,d){d=void 0===d?e.e:d;a.responseType=b;return new Promise(function(b,c){var k=function(){a.abort()};d.add(k);a.onloadend=function(){var m=this.status;d.remove(k);200<=m&&300>m?b(this.response):c(p.fromXhr(a))};a.send()})};f.d=function(a,b,d,c){c=void 0===c?e.e:c;a.responseType=d;a.setRequestHeader("Content-Type","application/json");return new Promise(function(d,k){var m=function(){a.abort()};c.add(m);a.onloadend=function(){var b=this.status;c.remove(m);200<=b&&300>b?d(this.response):
k(p.fromXhr(a))};a.send(JSON.stringify(b))})};var e=l(11),c=l(69),a=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}();$jscomp.initSymbol();var b=Symbol("url");$jscomp.initSymbol();var d=Symbol("method"),p=function(c){function k(a,b,d,c){if(!(this instanceof k))throw new TypeError("Cannot call a class as a function");
var m=a+" "+JSON.stringify(b)+" resulted in HTTP error "+d;c&&(m+=": "+c);m+=".";var g=(k.__proto__||Object.getPrototypeOf(k)).call(this,m);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");g=!g||"object"!==typeof g&&"function"!==typeof g?this:g;g.name="HttpError";g.message=m;g.method=a;g.url=b;g.code=d;g.statusMessage=c;return g}h(k,c);a(k,null,[{key:"fromXhr",value:function(a){return new k(a[d],a[b],a.status,a.statusText)}}]);return k}(Error)},function(n,
f,l){l.d(f,"b",function(){return h});f.c=function(c,a,b){b=void 0===b?e:b;if(a!==b)for(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength),a=0,b=c.length;a<b;a+=2){var d=c[a];c[a]=c[a+1];c[a+1]=d}};f.d=function(c,a,b){b=void 0===b?e:b;if(a!==b)for(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength),a=0,b=c.length;a<b;a+=4){var d=c[a];c[a]=c[a+3];c[a+3]=d;d=c[a+1];c[a+1]=c[a+2];c[a+2]=d}};var h;(function(c){c[c.LITTLE=0]="LITTLE";c[c.BIG=1]="BIG"})(h||(h={}));var e=function(){var c=Uint16Array.of(4386);
return 17===(new Uint8Array(c.buffer))[0]?h.BIG:h.LITTLE}();f.a=e},function(n,f,l){function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&
b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}l.d(f,"a",function(){return g});n=l(22);var a=l(37),b=l(1),d=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}(),p=function r(a,b,d){null===a&&(a=Function.prototype);
var c=Object.getOwnPropertyDescriptor(a,b);if(void 0===c){if(a=Object.getPrototypeOf(a),null!==a)return r(a,b,d)}else{if("value"in c)return c.value;b=c.get;return void 0===b?void 0:b.call(d)}},k=function(a){function b(){h(this,b);var a=e(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));a.source=null;return a}c(b,a);d(b,[{key:"initializeVolumeChunk",value:function(a,d){p(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"initializeVolumeChunk",this).call(this,a,d);a=this.source;this.gpuMemoryBytes=
this.systemMemoryBytes=a.spec.chunkBytes;this.data=null}},{key:"serialize",value:function(a,d){p(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,d);a=a.data=this.data;d.push(a.buffer);this.data=null}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=this.gpuMemoryBytes=this.data.byteLength;p(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this)}},{key:"freeSystemMemory",value:function(){this.data=null}}]);
return b}(n.SliceViewChunk),g=function(g){function p(b,d){h(this,p);b=e(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,b,d));b.spec=a.b.fromObject(d.spec);return b}c(p,g);d(p,[{key:"getChunk",value:function(a){var d=Object(b.n)(a),c=this.chunks.get(d);void 0===c&&(c=this.getNewChunk_(k),c.initializeVolumeChunk(d,a),this.addChunk(c));return c}}]);return p}(n.SliceViewChunkSource)},function(n,f,l){function h(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}l.d(f,"b",function(){return d});l.d(f,"c",function(){return p});f.d=function(a,c){return new Promise(function(k,g){if(a===b)c(k,g,b);else{var p=new d,m=a.add(function(){p.cancel()});c(function(a){m();k(a)},function(a){m();
g(a)},p)}})};var c=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}();n=new (function(){function a(){e(this,a);this.name="CancellationError";this.message="CANCELED"}c(a,[{key:"toString",value:function(){return"CANCELED"}}]);return a}());f.a=n;var a=function(){},b={isCanceled:!1,add:function(){return a},remove:a};
f.e=b;var d=function(){function b(){e(this,b)}c(b,[{key:"cancel",value:function(){var a=this.handlers;if(null!==a&&(this.handlers=null,void 0!==a)){a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())b=b.value,b()}}},{key:"add",value:function(b){var d=this,c=this.handlers;if(null===c)return b(),a;void 0===c&&(c=this.handlers=new Set);c.add(b);return function(){d.remove(b)}}},{key:"remove",value:function(a){var b=this.handlers;null!=b&&b.delete(a)}},{key:"isCanceled",get:function(){return null===
this.handlers}}]);return b}(),p=function(a){function d(){e(this,d);var a=(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");a=!a||"object"!==typeof a&&"function"!==typeof a?this:a;a.consumers=new Set;return a}h(d,a);c(d,[{key:"addConsumer",value:function(a){var d=this;a=void 0===a?b:a;var c=this.consumers;c.has(a)||a.isCanceled||(c.add(a),a.add(function(){c.delete(a);0===c.size&&d.cancel()}))}}]);
return d}(d)},function(n,f,l){l.d(f,"e",function(){return h});l.d(f,"d",function(){return e});var h;(function(c){c[c.GPU_MEMORY=0]="GPU_MEMORY";c[c.SYSTEM_MEMORY=1]="SYSTEM_MEMORY";c[c.SYSTEM_MEMORY_WORKER=2]="SYSTEM_MEMORY_WORKER";c[c.DOWNLOADING=3]="DOWNLOADING";c[c.QUEUED=4]="QUEUED";c[c.NEW=5]="NEW";c[c.FAILED=6]="FAILED";c[c.EXPIRED=7]="EXPIRED"})(h||(h={}));var e;(function(c){c[c.FIRST_TIER=0]="FIRST_TIER";c[c.FIRST_ORDERED_TIER=0]="FIRST_ORDERED_TIER";c[c.VISIBLE=0]="VISIBLE";c[c.PREFETCH=
1]="PREFETCH";c[c.LAST_ORDERED_TIER=1]="LAST_ORDERED_TIER";c[c.RECENT=2]="RECENT";c[c.LAST_TIER=2]="LAST_TIER"})(e||(e={}));f.f=1E13;f.b="ChunkQueueManager";f.a="ChunkManager";f.c="ChunkSource.invalidate"},function(n,f,l){function h(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,
b):a.__proto__=b)}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}l.d(f,"b",function(){return a});l.d(f,"a",function(){return b});var c=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}(),a=function(){function a(){e(this,a);this.handlers=new Set;this.count=0;var b=
this;this.dispatch=function(){var a=this,d=arguments;++b.count;b.handlers.forEach(function(b){b.apply(a,d)})}}c(a,[{key:"add",value:function(a){var b=this;this.handlers.add(a);return function(){return b.remove(a)}}},{key:"remove",value:function(a){return this.handlers.delete(a)}},{key:"dispose",value:function(){this.handlers=void 0}}]);return a}(),b=function(a){function b(){e(this,b);var a=(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return!a||"object"!==typeof a&&"function"!==typeof a?this:a}h(b,a);return b}(a)},function(n,f,l){function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function e(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=
b)}function c(a,b,d){for(var c=0;3>c;++c)a[c]=Number.POSITIVE_INFINITY,b[c]=Number.NEGATIVE_INFINITY;d=$jscomp.makeIterator(d);for(c=d.next();!c.done;c=d.next()){var k=c.value.spec;c=k.lowerChunkBound;k=k.upperChunkBound;for(var m=0;3>m;++m)a[m]=Math.min(a[m],c[m]),b[m]=Math.max(b[m],k[m])}}function a(a,b,d,c){for(var k=t.FULLY_INSIDE,m=0;3>m;++m){var u=a[m];var w=b[m],g=d[m],p=c[m];u=u>=p||w<=g?t.FULLY_OUTSIDE:u>=g&&w<=p?t.FULLY_INSIDE:t.PARTIALLY_INSIDE;switch(u){case t.FULLY_OUTSIDE:return u;case t.PARTIALLY_INSIDE:k=
u}}return k}function b(a){var b=a.transform,d=a.transformedSources,c=b.changed.count;c!==a.transformedSourcesGeneration&&(a.transformedSourcesGeneration=c,d=m.h.equals(b.transform,m.c)?a.sources.map(function(a){return a.map(function(a){return{source:a,chunkLayout:a.spec.chunkLayout}})}):a.sources.map(function(a){return a.map(function(a){var d=a.spec.chunkLayout;return{chunkLayout:g.a.get(d.size,k(d.transform,b)),source:a}})}),a.transformedSources=d);return d}function d(a,b){var d=b.length,c=0;if(1<
d)for(var k=0,m=0;m<d;++m){var w=b[m].chunkLayout;var g=w.size;w=w.globalToLocalSpatialVector(D,a);for(var p=0,q=0,r=1,e=0;3>e;++e){var v=g[e];r*=v;v*=w[e];p=Math.min(p,v);q=Math.max(q,v)}g=r/(q-p);g>k&&(k=g,c=m)}return b[c]}function p(a){var b=a.voxelSize,d=void 0===a.lowerVoxelBound?m.g:a.lowerVoxelBound,c=a.upperVoxelBound,k=void 0===a.maxVoxelsPerChunkLog2?18:a.maxVoxelsPerChunkLog2;a=void 0===a.transform?m.c:a.transform;a=Object(m.b)(m.m.create(),a);b=m.m.multiply(a,a,b);a=m.m.fromValues(1,1,
1);if(void 0===c)var w=m.e;else{w=m.m.create();for(var g=0;3>g;++g)w[g]=Math.pow(2,Math.floor(Math.log2(c[g]-d[g])))}for(d=0;d<k;++d){c=Infinity;g=-1;for(var p=0;3>p;++p)if(!(a[p]>=w[p])){var q=a[p]*b[p];q<c&&(c=q,g=p)}c=g;if(-1===c)break;a[c]*=2}return a}function k(a,b){b=b.transform;return void 0===b?void 0===a?m.c:a:void 0===a?b:m.h.multiply(m.h.create(),b,a)}l.d(f,"h",function(){return C});f.l=p;f.k=k;f.j=function(a){if(void 0!==a.chunkDataSizes)return a.chunkDataSizes;var b=void 0===a.chunkLayoutPreference?
A.ISOTROPIC:a.chunkLayoutPreference;switch(b){case A.ISOTROPIC:return[p(a)];case A.FLAT:b=[];for(var d=0;3>d;++d){var c=d;var k=a.lowerVoxelBound;var g=a.upperVoxelBound,w=d,q=a.voxelSize,r=a.maxVoxelsPerChunkLog2,e=a.transform;m.m.subtract(D,void 0===g?m.e:g,void 0===k?m.g:k);D[w]=1;k=p({voxelSize:q,upperVoxelBound:D,maxVoxelsPerChunkLog2:r,transform:e});b[c]=k}b.push(p(a));return b}throw Error("Invalid chunk layout preference: "+b+".");};l.d(f,"i",function(){return I});var g=l(60),q=l(20),r=l(61),
x=l(7),m=l(1);n=l(0);l.d(f,"a",function(){return x.b});var v=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}(),D=m.m.create(),t;(function(a){a[a.FULLY_OUTSIDE=0]="FULLY_OUTSIDE";a[a.FULLY_INSIDE=1]="FULLY_INSIDE";a[a.PARTIALLY_INSIDE=2]="PARTIALLY_INSIDE"})(t||(t={}));var J=[m.m.create(),m.m.create(),m.m.create(),
m.m.create()],C=function(k){function g(){h(this,g);var a=(g.__proto__||Object.getPrototypeOf(g)).call(this);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");a=!a||"object"!==typeof a&&"function"!==typeof a?this:a;a.width=-1;a.height=-1;a.hasViewportToData=!1;a.hasValidViewport=!1;a.viewportToData=m.h.create();a.viewportAxes=[m.m.create(),m.m.create(),m.m.create()];a.previousViewportAxes=[m.m.create(),m.m.create()];a.centerDataPosition=m.m.create();a.viewportPlaneDistanceToOrigin=
0;a.visibleChunkLayouts=new Map;a.visibleLayers=new Map;a.visibleSourcesStale=!0;a.pixelSize=0;m.h.identity(a.viewportToData);return a}e(g,k);v(g,[{key:"onViewportChanged",value:function(){}},{key:"maybeSetHasValidViewport",value:function(){!this.hasValidViewport&&-1!==this.width&&-1!==this.height&&this.hasViewportToData&&(this.hasValidViewport=!0,this.onHasValidViewport());if(this.hasValidViewport)this.onViewportChanged()}},{key:"onHasValidViewport",value:function(){}},{key:"setViewportSize",value:function(a,
b){return a!==this.width||b!==this.height?(this.width=a,this.height=b,this.maybeSetHasValidViewport(),!0):!1}},{key:"setViewportToDataMatrix",value:function(a){if(this.hasViewportToData&&m.h.equals(this.viewportToData,a))return!1;this.hasViewportToData=!0;var b=this.viewportToData;m.h.copy(b,a);Object(m.k)(b);m.m.transformMat4(this.centerDataPosition,m.g,a);a=0;for(var d=this.viewportAxes,c=this.previousViewportAxes,k=0;3>k;++k){var g=d[k];Object(m.l)(g,m.d[k],b);0===k&&(a=m.m.length(g));m.m.normalize(g,
g)}this.viewportAxes=d;this.previousViewportAxes=c;if(!Object(r.a)(a,this.pixelSize)||.95>m.m.dot(d[0],c[0])||.95>m.m.dot(d[1],c[1]))m.m.copy(c[0],d[0]),m.m.copy(c[1],d[1]),this.visibleSourcesStale=!0,this.pixelSize=a;this.viewportPlaneDistanceToOrigin=m.m.dot(this.centerDataPosition,this.viewportAxes[2]);this.onViewportToDataMatrixChanged();this.maybeSetHasValidViewport();return!0}},{key:"onViewportToDataMatrixChanged",value:function(){}},{key:"updateVisibleSources",value:function(){if(this.visibleSourcesStale){this.visibleSourcesStale=
!1;var a=1.1*this.pixelSize,c=this.visibleChunkLayouts,k=this.viewportAxes[2],m=this.visibleLayers;c.clear();var g={};m=$jscomp.makeIterator(m);for(var w=m.next();!w.done;g={smallestVoxelSize:g.smallestVoxelSize,visibleSources:g.visibleSources},w=m.next()){w=$jscomp.makeIterator(w.value);var p=w.next().value;g.visibleSources=w.next().value;g.visibleSources.length=0;w=b(p);var q=w.length;p=void 0;g.smallestVoxelSize=w[0][0].source.spec.voxelSize;var r=function(b){return function(d){for(var c=0;3>c;++c){var k=
d[c];if(k>a&&k>b.smallestVoxelSize[c])return!0}return!1}}(g),e=function(a){return function(b,d){var k=b.source,m=b.chunkLayout;a.visibleSources[a.visibleSources.length++]=b;b=c.get(m);void 0===b&&(b=new Map,c.set(m,b));b.set(k,d)}}(g);for(p=q-1;;){q=d(k,w[p]);e(q,p);if(0===p||!r(q.source.spec.voxelSize))break;--p}g.visibleSources.reverse()}}}},{key:"computeVisibleChunks",value:function(b,d){var k=this;this.updateVisibleSources();for(var u=this.width,g=this.height,w=this.viewportToData,p=0;3>p;++p)J[0][p]=
-m.d[0][p]*u/2-m.d[1][p]*g/2,J[1][p]=-m.d[0][p]*u/2+m.d[1][p]*g/2,J[2][p]=m.d[0][p]*u/2-m.d[1][p]*g/2,J[3][p]=m.d[0][p]*u/2+m.d[1][p]*g/2;for(u=0;4>u;++u)m.m.transformMat4(J[u],J[u],w);var r=m.m.create(),e=m.m.create(),v=m.m.create(),x=m.m.create(),h=m.m.create(),B=m.m.create(),f=[],l=[];this.visibleChunkLayouts.forEach(function(u,g){function w(){for(var a=0,b=0,d=0;3>d;++d){var c=B[d],k=r[d],m=e[d]-k,u=h[d]*m;a+=c*(k+u);b+=c*(k+m-u)}return a<H?!1:b<=H}function p(b){function c(){A=Object(q.b)(f,0,
h,function(b){var d=b.spec;switch(a(r,e,d.lowerChunkBound,d.upperChunkBound)){case t.PARTIALLY_INSIDE:return!0;case t.FULLY_INSIDE:l.push(b);default:return!1}})}if(0!==l.length||0!==A){for(var k=1,m=0;3>m;++m)k*=Math.max(0,e[m]-r[m]);if(0!==k&&w())if(1===k)d(g,y,r,l);else{for(var u;;)if(k=r[b],m=e[b],u=m-k,1===u)b=(b+1)%3;else break;u=k+Math.floor(.5*u);var v=(b+1)%3,x=l.length;e[b]=u;var h=A;c();p(v);l.length=x;A=h;e[b]=m;r[b]=u;c();p(v);r[b]=k;l.length=x;A=h}}}var y=b(g);c(v,x,u.keys());m.m.set(r,
Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);m.m.set(e,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);g.globalToLocalSpatialVector(B,k.viewportAxes[2]);for(var G=0;3>G;++G)h[G]=0<B[G]?1:0;var H=m.m.dot(g.globalToLocalGrid(D,k.centerDataPosition),B);for(G=0;4>G;++G)for(var I=g.globalToLocalGrid(D,J[G]),K=0;3>K;++K)r[K]=Math.min(r[K],Math.floor(I[K])),e[K]=Math.max(e[K],Math.floor(I[K])+1);m.m.max(r,r,v);m.m.min(e,e,x);l.length=0;f.length=
0;u=$jscomp.makeIterator(u.keys());for(G=u.next();!G.done;G=u.next())switch(G=G.value,I=G.spec,a(r,e,I.lowerChunkBound,I.upperChunkBound)){case t.FULLY_INSIDE:l.push(G);break;case t.PARTIALLY_INSIDE:f.push(G)}var A=f.length;p(0)})}}]);return g}(n.b),A;(function(a){a[a.ISOTROPIC=0]="ISOTROPIC";a[a.FLAT=1]="FLAT"})(A||(A={}));var I=function B(a){h(this,B);var b=void 0===a.lowerVoxelBound?m.g:a.lowerVoxelBound,d=a.upperVoxelBound,c=a.chunkDataSize,k=a.voxelSize,p=a.transform,q=void 0===a.baseVoxelOffset?
m.g:a.baseVoxelOffset,r=void 0===a.lowerClipBound?m.m.multiply(m.m.create(),k,b):a.lowerClipBound,e=void 0===a.upperClipBound?m.m.multiply(m.m.create(),k,d):a.upperClipBound;this.voxelSize=k;this.chunkDataSize=c;this.chunkLayout=g.a.get(m.m.multiply(m.m.create(),a.chunkDataSize,k),p);this.lowerClipBound=r;this.upperClipBound=e;this.lowerVoxelBound=b;this.upperVoxelBound=d;this.baseVoxelOffset=q;a=this.lowerChunkBound=m.m.create();k=this.upperChunkBound=m.m.create();for(p=0;3>p;++p)a[p]=Math.floor(b[p]/
c[p]),k[p]=Math.floor((d[p]-1)/c[p]+1)};f.f="SliceView";f.d="sliceview/RenderLayer";f.b="SliceView.addVisibleLayer";f.c="SliceView.removeVisibleLayer";f.g="SliceView.updateView";f.e="SliceView.updateTransform"},function(n,f,l){f.a=function(c,a){Object(h.a)(c,Object(e.a)(new Uint8Array(a),c.chunkDataSize,c.source.spec.numChannels))};var h=l(25),e=l(81)},function(n,f,l){function h(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function c(a,b,d,c){a.addEventListener(b,d,c);return function(){return a.removeEventListener(b,d,c)}}l.d(f,"a",function(){return b});l.d(f,"b",function(){return d});var a=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=
b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}(),b=function(){function b(){e(this,b);this.refCount=1}a(b,[{key:"addRef",value:function(){++this.refCount;return this}},{key:"dispose",value:function(){0===--this.refCount&&this.refCountReachedZero()}},{key:"refCountReachedZero",value:function(){this.disposed();var a=this.disposers;if(null!=a){for(var b=a.length;0<b;--b){var d=
a[b-1];"object"===typeof d?d.dispose():d.call(this)}this.disposers=void 0}this.wasDisposed=!0}},{key:"disposed",value:function(){}},{key:"registerDisposer",value:function(a){var b=this.disposers;null==b?this.disposers=[a]:b.push(a);return a}},{key:"unregisterDisposer",value:function(a){var b=this.disposers;if(null!=b){var d=b.indexOf(a);-1!==d&&b.splice(d,1)}return a}},{key:"registerEventListener",value:function(a,b,d,p){this.registerDisposer(c(a,b,d,p))}},{key:"registerCancellable",value:function(a){this.registerDisposer(function(){a.cancel()});
return a}}]);return b}(),d=function(a){function b(a){e(this,b);var d=(b.__proto__||Object.getPrototypeOf(b)).call(this);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");d=!d||"object"!==typeof d&&"function"!==typeof d?this:d;d.value=a;return d}h(b,a);return b}(b)},function(n,f,l){function h(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function e(a,
b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}f.c=function(a){return function(a){function b(a){for(var d=[],c=0;c<arguments.length;++c)d[c-0]=arguments[c];if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");var p,e=
h(this,(p=b.__proto__||Object.getPrototypeOf(b)).call.apply(p,[].concat([this],$jscomp.arrayFromIterable(d))));e.visibility=d[0].get(d[1].visibility);e.registerDisposer(e.visibility.changed.add(function(){return e.chunkManager.scheduleUpdateChunkPriorities()}));return e}e(b,a);return b}(a)};f.b=function(a){return a===Number.POSITIVE_INFINITY?c.d.VISIBLE:c.d.PREFETCH};f.a=function(a){return a===Number.POSITIVE_INFINITY?0:a*c.f};l(62);var c=l(12)},function(n,f,l){function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");
}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function a(a,b){for(var d=
q.m.create(),c=q.m.create(),k=q.m.create(),m=new Float32Array(a.length),g=new Float32Array(a.length/3),p=b.length,w=0;w<p;w+=3)for(var e=0;3>e;++e)g[b[w+e]]+=1;for(w=0;w<p;w+=3){e=3*b[w];for(var r=3*b[w+1],v=3*b[w+2],x=0;3>x;++x)c[x]=a[r+x]-a[e+x],k[x]=a[v+x]-a[r+x];q.m.cross(d,c,k);q.m.normalize(d,d);for(e=0;3>e;++e)for(v=b[w+e],r=1/g[v],v*=3,x=0;3>x;++x)m[v+x]+=r*d[x]}a=m.length;for(b=0;b<a;b+=3)d=m.subarray(b,3),q.m.normalize(d,d);return m}function b(a,b,d,c,k,m,p,e){var u=new Float32Array(d,k,
3*m);Object(g.d)(u,c);void 0===p&&(p=k+12*m);var w;void 0!==e&&(w=e*b);d=void 0===w?new Uint32Array(d,p):new Uint32Array(d,p,w);if(0!==d.length%b)throw Error("Number of indices is not a multiple of "+b+": "+d.length+".");Object(g.d)(d,c);a.vertexPositions=u;a.indices=d}f.c=function(a,b,d){Object(r.f)(b);a.fragmentIds=Object(r.g)(b,d,r.i)};f.b=a;f.e=b;f.d=function(d,c,k,m,u,g,p){b(d,3,c,k,m,u,g,p);d.vertexNormals=a(d.vertexPositions,d.indices)};l.d(f,"a",function(){return A});var d=l(2),p=l(12);n=
l(71);f=l(35);var k=l(23),g=l(9),q=l(1),r=l(4),x=l(6),m=l(17);l=l(0);var v=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}(),D=function w(a,b,d){null===a&&(a=Function.prototype);var c=Object.getOwnPropertyDescriptor(a,b);if(void 0===c){if(a=Object.getPrototypeOf(a),null!==a)return w(a,b,d)}else{if("value"in
c)return c.value;b=c.get;return void 0===b?void 0:b.call(d)}},t=this&&this.__decorate||function(a,b,d,c){var k=arguments.length,m=3>k?b:null===c?c=Object.getOwnPropertyDescriptor(b,d):c,u;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)m=Reflect.decorate(a,b,d,c);else for(var g=a.length-1;0<=g;g--)if(u=a[g])m=(3>k?u(m):3<k?u(b,d,m):u(b,d))||m;return 3<k&&m&&Object.defineProperty(b,d,m),m},J=function(a){function b(){h(this,b);var a=e(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));
a.objectId=new x.a;return a}c(b,a);v(b,[{key:"initializeManifestChunk",value:function(a,d,c){D(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"initialize",this).call(this,a);this.objectId.assign(d);c&&(this.clipBounds=c)}},{key:"freeSystemMemory",value:function(){this.fragmentIds=null}},{key:"serialize",value:function(a,d){D(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,d);a.fragmentIds=this.fragmentIds}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=
100;D(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this);this.priorityTier<p.d.RECENT&&this.source.chunkManager.scheduleUpdateChunkPriorities()}},{key:"toString",value:function(){return this.objectId.toString()}}]);return b}(d.Chunk),C=function(a){function b(){h(this,b);var a=e(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));a.manifestChunk=null;a.fragmentId=null;a.vertexPositions=null;a.indices=null;a.vertexNormals=null;return a}c(b,a);v(b,[{key:"initializeFragmentChunk",
value:function(a,d,c){D(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"initialize",this).call(this,a);this.manifestChunk=d;this.fragmentId=c}},{key:"freeSystemMemory",value:function(){this.fragmentId=this.vertexPositions=this.indices=this.vertexNormals=this.manifestChunk=null}},{key:"serialize",value:function(a,d){D(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,d);a.objectKey=this.manifestChunk.key;var c=this.vertexPositions,k=this.indices,m=this.vertexNormals;
a.vertexPositions=c;a.indices=k;a.vertexNormals=m;a=c.buffer;d.push(a);k=k.buffer;k!==a&&d.push(k);m=m.buffer;m!==a&&m!==k&&d.push(m);this.vertexPositions=this.indices=this.vertexNormals=null}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=this.gpuMemoryBytes=this.vertexPositions.byteLength+this.indices.byteLength+this.vertexNormals.byteLength;D(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this)}}]);return b}(d.Chunk),A=function(a){function b(a,
d){h(this,b);var c=e(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,d));return(c.fragmentSource=c.registerDisposer(a.getRef(d.fragmentSource))).meshSource=c}c(b,a);v(b,[{key:"getChunk",value:function(a,b){var d=Object(k.b)(a,b),c=this.chunks.get(d);void 0===c&&(c=this.getNewChunk_(J),c.initializeManifestChunk(d,a,b),this.addChunk(c));return c}},{key:"getFragmentChunk",value:function(a,b){var d=a.key+"/"+b,c=this.fragmentSource,k=c.chunks.get(d);void 0===k&&(k=c.getNewChunk_(C),k.initializeFragmentChunk(d,
a,b),c.addChunk(k));return k}}]);return b}(d.ChunkSource);d=function(a){function b(){h(this,b);var a=e(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.meshSource=null;return a}c(b,a);v(b,[{key:"download",value:function(a,b){return this.meshSource.downloadFragment(a,b)}}]);return b}(d.ChunkSource);d=t([Object(l.g)(n.a)],d);f=function(a){function b(a,d){h(this,b);var c=e(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,d));c.source=c.registerDisposer(a.getRef(d.source));
c.registerDisposer(c.chunkManager.recomputeChunkPriorities.add(function(){c.updateChunkPriorities()}));return c}c(b,a);v(b,[{key:"updateChunkPriorities",value:function(){var a=this,b=this.visibility.value;if(b!==Number.NEGATIVE_INFINITY){var d=Object(m.b)(b),c=Object(m.a)(b),g=this.source,w=this.chunkManager;Object(k.a)(this,function(b){b=g.getChunk(b,a.clipBounds.value);w.requestChunk(b,d,c+100);var k=b.state;if(k===p.e.SYSTEM_MEMORY_WORKER||k===p.e.SYSTEM_MEMORY||k===p.e.GPU_MEMORY){k=$jscomp.makeIterator(b.fragmentIds);
for(var m=k.next();!m.done;m=k.next())m=g.getFragmentChunk(b,m.value),w.requestChunk(m,d,c+50)}})}}}]);return b}(f.a);f=t([Object(l.g)(n.b)],f)},function(n,f,l){f.a=function(b,d,p){p=void 0===p?c.a:p;var k=b.source.spec,g=k.dataType,q=Object(a.i)(b.chunkDataSize),r=e.a[g];k=q*r*k.numChannels;if(k!==d.byteLength)throw Error("Raw-format chunk is "+d.byteLength+" bytes, "+("but "+q+" * "+r+" = "+k+" bytes are expected."));switch(g){case e.b.UINT8:d=new Uint8Array(d);break;case e.b.UINT16:d=new Uint16Array(d);
Object(c.c)(d,p);break;case e.b.UINT32:case e.b.UINT64:d=new Uint32Array(d);Object(c.d)(d,p);break;case e.b.FLOAT32:d=new Float32Array(d);Object(c.d)(d,p);break;default:throw Error("Unexpected data type: "+g+".");}Object(h.a)(b,d)};var h=l(25),e=l(7),c=l(9),a=l(1)},function(n,f,l){f.b=function(h,e,c,a){for(;e<c;){var b=h[e];a(b)?++e:(--c,h[e]=h[c],h[c]=b)}return c};f.a=function(h,e){var c=h.length,a=Array(c);e=a[0]=void 0===e?1:e;for(var b=1;b<c;++b)e*=h[b-1],a[b]=e;return a};f.c=function(h,e,c){for(var a=
new h.constructor(h.length),b=0;b<e*c;b+=c)for(var d=0;d<c;d++)a[d*e+b/c]=h[b+d];return a}},function(n,f,l){function h(e,c,a,b,d,p,k){for(var g=new Map,q=Array(3),r=2,x=0;3>x;++x){var m=q[x]=Math.ceil(b[x]/c[x]);r*=m}x=q[0];m=q[1];q=q[2];var v=b[0],h=b[1];b=b[2];var f=c[0],l=c[1],C=c[2],A=e.length,I=A,w=[0,0,0];e.resize(A+r);r=p[0];for(var B=p[1],K=p[2],u=0;u<q;++u){w[2]=Math.min(C,b-u*C);for(var G=0;G<m;++G){w[1]=Math.min(l,h-G*l);for(var H=0;H<x;++H){w[0]=Math.min(f,v-H*f);var n=e.length-A,z=$jscomp.makeIterator(k(a,
d+(u*C*K+G*l*B+H*f*r),p,c,w,A,g,e)),E=z.next().value;z=z.next().value;var O=e.data;O[I++]=z|E<<24;O[I++]=n}}}}f.c=function(e,c,a,b,d,p,k,g,q){if(1===d)var r=0;else for(r=1;1<<r<d;)r*=2;var x=Math.ceil(r*b/32),m=e.length,v=x,h=!1,f=Array.prototype.join.call(p.subarray(0,d*q),",");b=a.get(f);void 0===b&&(h=!0,v+=d*q,b=m+x-c,a.set(f,b));e.resize(m+v);e=e.data;if(0<r)switch(r){case 1:for(c=a=0;a<x;++a)v=0,v|=g[k[c+0]]<<0,v|=g[k[c+1]]<<1,v|=g[k[c+2]]<<2,v|=g[k[c+3]]<<3,v|=g[k[c+4]]<<4,v|=g[k[c+5]]<<5,
v|=g[k[c+6]]<<6,v|=g[k[c+7]]<<7,v|=g[k[c+8]]<<8,v|=g[k[c+9]]<<9,v|=g[k[c+10]]<<10,v|=g[k[c+11]]<<11,v|=g[k[c+12]]<<12,v|=g[k[c+13]]<<13,v|=g[k[c+14]]<<14,v|=g[k[c+15]]<<15,v|=g[k[c+16]]<<16,v|=g[k[c+17]]<<17,v|=g[k[c+18]]<<18,v|=g[k[c+19]]<<19,v|=g[k[c+20]]<<20,v|=g[k[c+21]]<<21,v|=g[k[c+22]]<<22,v|=g[k[c+23]]<<23,v|=g[k[c+24]]<<24,v|=g[k[c+25]]<<25,v|=g[k[c+26]]<<26,v|=g[k[c+27]]<<27,v|=g[k[c+28]]<<28,v|=g[k[c+29]]<<29,v|=g[k[c+30]]<<30,v|=g[k[c+31]]<<31,e[m+a]=v,c+=32;break;case 2:for(c=a=0;a<x;++a)v=
0,v|=g[k[c+0]]<<0,v|=g[k[c+1]]<<2,v|=g[k[c+2]]<<4,v|=g[k[c+3]]<<6,v|=g[k[c+4]]<<8,v|=g[k[c+5]]<<10,v|=g[k[c+6]]<<12,v|=g[k[c+7]]<<14,v|=g[k[c+8]]<<16,v|=g[k[c+9]]<<18,v|=g[k[c+10]]<<20,v|=g[k[c+11]]<<22,v|=g[k[c+12]]<<24,v|=g[k[c+13]]<<26,v|=g[k[c+14]]<<28,v|=g[k[c+15]]<<30,e[m+a]=v,c+=16;break;case 4:for(c=a=0;a<x;++a)v=0,v|=g[k[c+0]]<<0,v|=g[k[c+1]]<<4,v|=g[k[c+2]]<<8,v|=g[k[c+3]]<<12,v|=g[k[c+4]]<<16,v|=g[k[c+5]]<<20,v|=g[k[c+6]]<<24,v|=g[k[c+7]]<<28,e[m+a]=v,c+=8;break;case 8:for(c=a=0;a<x;++a)v=
0,v|=g[k[c+0]]<<0,v|=g[k[c+1]]<<8,v|=g[k[c+2]]<<16,v|=g[k[c+3]]<<24,e[m+a]=v,c+=4;break;case 16:for(c=a=0;a<x;++a)v=0,v|=g[k[c+0]]<<0,v|=g[k[c+1]]<<16,e[m+a]=v,c+=2;break;case 32:for(c=a=0;a<x;++a)v=0,v|=g[k[c+0]]<<0,e[m+a]=v,c+=1}if(h)for(k=m+x,g=0,d*=q;g<d;++g)e[k++]=p[g];return[r,b]};f.a=h;f.b=function(e,c,a,b,d,p,k){var g=e.length,q=b[3];e.resize(g+q);for(var r=0;r<q;++r)e.data[g+r]=e.length,h(e,c,a,b,d+p[3]*r,p,k)}},function(n,f,l){function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");
}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(f,
"__esModule",{value:!0});l.d(f,"SliceView",function(){return D});l.d(f,"SliceViewChunk",function(){return t});l.d(f,"SliceViewChunkSource",function(){return J});l.d(f,"RenderLayer",function(){return C});n=l(2);var a=l(59);f=l(14);var b=l(1),d=l(13),p=l(17);l=l(0);var k=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}(),
g=function I(a,b,d){null===a&&(a=Function.prototype);var c=Object.getOwnPropertyDescriptor(a,b);if(void 0===c){if(a=Object.getPrototypeOf(a),null!==a)return I(a,b,d)}else{if("value"in c)return c.value;b=c.get;return void 0===b?void 0:b.call(d)}},q=this&&this.__decorate||function(a,b,d,c){var k=arguments.length,m=3>k?b:null===c?c=Object.getOwnPropertyDescriptor(b,d):c,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)m=Reflect.decorate(a,b,d,c);else for(var p=a.length-1;0<=p;p--)if(g=
a[p])m=(3>k?g(m):3<k?g(b,d,m):g(b,d))||m;return 3<k&&m&&Object.defineProperty(b,d,m),m},r=b.m.create(),x=b.m.create(),m=b.m.create(),v=function(a){function b(a,d){h(this,b);var c=e(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));c.initializeSharedObject(a,d.id);return c}c(b,a);return b}(f.h),D=function(a){function d(a,b){h(this,d);var c=e(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,a,b));c.handleLayerChanged=function(){c.hasValidViewport&&c.chunkManager.scheduleUpdateChunkPriorities()};
c.invalidateVisibleSources=function(){c.visibleSourcesStale=!0;c.hasValidViewport&&c.chunkManager.scheduleUpdateChunkPriorities()};c.registerDisposer(c.chunkManager.recomputeChunkPriorities.add(function(){c.updateVisibleChunks()}));return c}c(d,a);k(d,[{key:"onViewportChanged",value:function(){this.chunkManager.scheduleUpdateChunkPriorities()}},{key:"updateVisibleChunks",value:function(){var a=this,d=this.centerDataPosition,c=this.chunkManager,k=this.visibility.value;if(k!==Number.NEGATIVE_INFINITY){var g=
Object(p.b)(k),w=Object(p.a)(k);w+=-1E12;this.computeVisibleChunks(function(b){b.globalToLocalSpatial(m,d);return a.visibleChunkLayouts.get(b)},function(a,d,k,u){b.m.multiply(r,k,a.size);a=-b.m.distance(m,r);u=$jscomp.makeIterator(u);for(var p=u.next();!p.done;p=u.next()){var e=p.value;p=d.get(e);e=e.getChunk(k);c.requestChunk(e,g,w+a+1E9*p)}})}}},{key:"removeVisibleLayer",value:function(a){this.visibleLayers.delete(a);a.layerChanged.remove(this.handleLayerChanged);a.transform.changed.remove(this.invalidateVisibleSources);
this.invalidateVisibleSources()}},{key:"addVisibleLayer",value:function(a){this.visibleLayers.set(a,[]);a.layerChanged.add(this.handleLayerChanged);a.transform.changed.add(this.invalidateVisibleSources);this.invalidateVisibleSources()}},{key:"disposed",value:function(){for(var a=$jscomp.makeIterator(this.visibleLayers.keys()),b=a.next();!b.done;b=a.next())this.removeVisibleLayer(b.value);g(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"disposed",this).call(this)}}]);return d}(Object(p.c)(Object(n.withChunkManager)(v)));
D=q([Object(l.g)(f.f)],D);Object(l.f)(f.g,function(a){var b=this.get(a.id);a.width&&b.setViewportSize(a.width,a.height);a.viewportToData&&b.setViewportToDataMatrix(a.viewportToData)});Object(l.f)(f.b,function(a){var b=this.get(a.id);a=this.get(a.layerId);b.addVisibleLayer(a)});Object(l.f)(f.c,function(a){var b=this.get(a.id);a=this.get(a.layerId);b.removeVisibleLayer(a)});var t=function(a){function d(){h(this,d);var a=e(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));a.source=null;a.chunkGridPosition=
b.m.create();return a}c(d,a);k(d,[{key:"initializeVolumeChunk",value:function(a,c){g(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"initialize",this).call(this,a);b.m.copy(this.chunkGridPosition,c);this.chunkDataSize=null}},{key:"serialize",value:function(a,b){g(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"serialize",this).call(this,a,b);b=this.chunkDataSize;b!==this.source.spec.chunkDataSize&&(a.chunkDataSize=b);a.chunkGridPosition=this.chunkGridPosition}},{key:"downloadSucceeded",
value:function(){g(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"downloadSucceeded",this).call(this)}},{key:"freeSystemMemory",value:function(){}},{key:"toString",value:function(){return this.source.toString()+":"+Object(b.n)(this.chunkGridPosition)}}]);return d}(n.Chunk),J=function(a){function d(a,b){h(this,d);return e(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,a,b))}c(d,a);k(d,[{key:"computeChunkBounds",value:function(a){var d=this.spec,c=d.upperVoxelBound;d=d.chunkDataSize;
for(var k=b.m.multiply(r,a.chunkGridPosition,d),m=!1,g=0;3>g;++g)(x[g]=Math.min(c[g],k[g]+d[g])-k[g])!==d[g]&&(m=!0);b.m.add(k,k,this.spec.baseVoxelOffset);a.chunkDataSize=m?b.m.clone(x):d;return k}}]);return d}(n.ChunkSource),C=function(k){function m(c,k){h(this,m);var g=e(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,c,k));g.layerChanged=new d.a;g.transform=new a.a;g.transformedSourcesGeneration=-1;for(var p=g.sources=[],w=$jscomp.makeIterator(k.sources),r=w.next();!r.done;r=w.next()){var q=
r.value;r=[];p.push(r);q=$jscomp.makeIterator(q);for(var v=q.next();!v.done;v=q.next())v=c.get(v.value),g.registerDisposer(v.addRef()),r.push(v)}b.h.copy(g.transform.transform,k.transform);g.transform.changed.add(g.layerChanged.dispatch);return g}c(m,k);return m}(l.c);C=q([Object(l.g)(f.d)],C);Object(l.f)(f.e,function(a){var d=this.get(a.id);a=a.value;var c=d.transform.transform;b.h.equals(a,c)||(b.h.copy(c,a),d.transform.changed.dispatch())})},function(n,f,l){f.b=function(h,e){return h.low+","+h.high+
(e?"_"+e.center.toString()+"_"+e.size.toString():"")};f.a=function(h,e){var c=h.segmentEquivalences;h=$jscomp.makeIterator(h.visibleSegments);for(var a=h.next();!a.done;a=h.next())if(a=a.value,c.disjointSets.isMinElement(a))for(var b=$jscomp.makeIterator(c.setElements(a)),d=b.next();!d.done;d=b.next())e(d.value,a)}},function(n,f,l){f.a=function(h,e){h.data=new Uint32Array(e)}},function(n,f,l){f.a=function(d,p){var k=d.source.spec;if(k.compressedSegmentationBlockSize){var g=k.dataType;a.clear();var q=
d.chunkDataSize;b[0]=q[0];b[1]=q[1];b[2]=q[2];b[3]=k.numChannels;switch(g){case h.a.UINT32:Object(e.a)(a,k.compressedSegmentationBlockSize,p,b);break;case h.a.UINT64:Object(c.a)(a,k.compressedSegmentationBlockSize,p,b);break;default:throw Error("Unsupported data type for compressed segmentation: "+h.a[g]);}d.data=new Uint32Array(a.view)}else d.data=p};var h=l(14),e=l(78),c=l(79),a=new (l(80).a)(2E4),b=Array(4)},function(n,f,l){f=l(5).assign;var h=l(85),e=l(88);l=l(44);var c={};f(c,h,e,l);n.exports=
c},function(n,f,l){n.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(n,f,l){function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==
typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}l.d(f,"a",function(){return r});n=l(2);var a=l(12),b=l(11),d=l(8),p=l(104),k=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);
Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}(),g=function m(a,b,d){null===a&&(a=Function.prototype);var c=Object.getOwnPropertyDescriptor(a,b);if(void 0===c){if(a=Object.getPrototypeOf(a),null!==a)return m(a,b,d)}else{if("value"in c)return c.value;b=c.get;return void 0===b?void 0:b.call(d)}},q=function(a){function b(){h(this,b);var a=e(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.backendOnly=!0;return a}c(b,a);k(b,[{key:"initialize",
value:function(a){g(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"initialize",this).call(this,a);this.requesters=new Set}},{key:"downloadSucceeded",value:function(){g(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this);var a=this.requesters,d=this.data;this.requesters=void 0;a=$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=a.next())c.value.resolve(d)}},{key:"downloadFailed",value:function(a){g(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),
"downloadFailed",this).call(this,a);var d=this.requesters;this.requesters=void 0;d=$jscomp.makeIterator(d);for(var c=d.next();!c.done;c=d.next())c.value.reject(a)}},{key:"freeSystemMemory",value:function(){this.data=void 0}}]);return b}(n.Chunk),r=function(m){function g(a,b){h(this,g);var d=e(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,a));d.decodeFile=b;d.registerDisposer(a);d.registerDisposer(d.chunkManager.recomputeChunkPrioritiesLate.add(function(){d.updateChunkPriorities()}));return d}
c(g,m);k(g,[{key:"updateChunkPriorities",value:function(){for(var a=this.chunkManager,b=$jscomp.makeIterator(this.chunks.values()),d=b.next();!d.done;d=b.next()){d=d.value;var c=d.requesters;if(void 0!==c){c=$jscomp.makeIterator(c);for(var k=c.next();!k.done;k=c.next())k=k.value.getPriority(),a.requestChunk(d,k.priorityTier,k.priority)}}}},{key:"download",value:function(a,b){var c=this;return Object(d.e)(Object(d.b)(a.key),"arraybuffer",b).then(function(b){a.data=c.decodeFile(b)})}},{key:"getData",
value:function(d,c,k){var m=this,g=this.chunks.get(d);void 0===g&&(g=this.getNewChunk_(q),g.initialize(d),this.addChunk(g));return Object(b.d)(k,function(d,k,p){switch(g.state){case a.e.FAILED:k(g.error);return;case a.e.SYSTEM_MEMORY_WORKER:d(g.data);return}var e={resolve:d,reject:k,getPriority:c};g.requesters.add(e);p.add(function(){var a=g.requesters;void 0!==a&&(a.delete(e),m.chunkManager.scheduleUpdateChunkPriorities());k(b.a)});m.chunkManager.scheduleUpdateChunkPriorities()})}}],[{key:"get",
value:function(a,b){return a.memoize.get("getFileSource:"+Object(p.a)(b),function(){return new g(a,b)})}},{key:"getData",value:function(a,b,d,c,k){a=g.get(a,b);d=a.getData(d,c,k);a.dispose();return d}}]);return g}(n.ChunkSourceBase)},function(n,f,l){var h=h||{};h.Utils=h.Utils||{};h.Utils.crcTable=null;h.Utils.GUNZIP_MAGIC_COOKIE1=31;h.Utils.GUNZIP_MAGIC_COOKIE2=139;h.Utils.getStringAt=function(e,c,a){for(var b="",d;c<a;c+=1)d=e.getUint8(c),0!==d&&(b+=String.fromCharCode(d));return b};h.Utils.getByteAt=
function(e,c){return e.getInt8(c)};h.Utils.getShortAt=function(e,c,a){return e.getInt16(c,a)};h.Utils.getIntAt=function(e,c,a){return e.getInt32(c,a)};h.Utils.getFloatAt=function(e,c,a){return e.getFloat32(c,a)};h.Utils.getDoubleAt=function(e,c,a){return e.getFloat64(c,a)};h.Utils.getLongAt=function(e,c,a){var b,d=[],p=0;for(b=0;8>b;b+=1)d[b]=h.Utils.getByteAt(e,c+b,a);for(b=d.length-1;0<=b;b--)p=256*p+d[b];return p};h.Utils.toArrayBuffer=function(e){var c;var a=new ArrayBuffer(e.length);var b=new Uint8Array(a);
for(c=0;c<e.length;c+=1)b[c]=e[c];return a};h.Utils.isString=function(e){return"string"===typeof e||e instanceof String};h.Utils.formatNumber=function(e,c){e=h.Utils.isString(e)?Number(e):e;e=c?e.toPrecision(5):e.toPrecision(7);return parseFloat(e)};h.Utils.makeCRCTable=function(){for(var e,c=[],a=0;256>a;a++){e=a;for(var b=0;8>b;b++)e=e&1?3988292384^e>>>1:e>>>1;c[a]=e}return c};h.Utils.crc32=function(e){for(var c=h.Utils.crcTable||(h.Utils.crcTable=h.Utils.makeCRCTable()),a=-1,b=0;b<e.byteLength;b++)a=
a>>>8^c[(a^e.getUint8(b))&255];return(a^-1)>>>0};"undefined"!==typeof n&&n.exports&&(n.exports=h.Utils)},function(n,f,l){function h(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");
}l.d(f,"a",function(){return p});var c=l(16),a=l(4),b=function g(a,b,d){null===a&&(a=Function.prototype);var c=Object.getOwnPropertyDescriptor(a,b);if(void 0===c){if(a=Object.getPrototypeOf(a),null!==a)return g(a,b,d)}else{if("value"in c)return c.value;b=c.get;return void 0===b?void 0:b.call(d)}},d=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&
a(b.prototype,d);c&&a(b,c);return b}}(),p=function(g){function p(){e(this,p);var a=(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!==typeof a&&"function"!==typeof a?this:a}h(p,g);d(p,[{key:"get",value:function(d,c){"string"!==typeof d&&(d=Object(a.d)(d));return b(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"get",this).call(this,d,c)}},{key:"getUncounted",value:function(a,
b){return this.get(a,function(){return new c.b(b())}).value}}]);return p}(function(){function a(){e(this,a);this.map=new Map}d(a,[{key:"get",value:function(a,b){var d=this.map,c=d.get(a);void 0===c?(c=b(),c.registerDisposer(function(){d.delete(a)}),d.set(a,c)):c.addRef();return c}}]);return a}())},function(n,f,l){l(3);l(52);l(53);l(32);var h=l(54),e=l(55);l(56);var c=l(33);l(34);l.d(f,"a",function(){return h});l.d(f,"b",function(){return e});l.d(f,"c",function(){return c})},function(n,f,l){f.a=function(){var e=
new h.a(9);e[0]=1;e[1]=0;e[2]=0;e[3]=0;e[4]=1;e[5]=0;e[6]=0;e[7]=0;e[8]=1;return e};var h=l(3)},function(n,f,l){function h(){var a=new x.a(3);a[0]=0;a[1]=0;a[2]=0;return a}function e(a){var b=a[0],d=a[1];a=a[2];return Math.sqrt(b*b+d*d+a*a)}function c(a,b,d){var c=new x.a(3);c[0]=a;c[1]=b;c[2]=d;return c}function a(a,b,d){a[0]=b[0]-d[0];a[1]=b[1]-d[1];a[2]=b[2]-d[2];return a}function b(a,b,d){a[0]=b[0]*d[0];a[1]=b[1]*d[1];a[2]=b[2]*d[2];return a}function d(a,b,d){a[0]=b[0]/d[0];a[1]=b[1]/d[1];a[2]=
b[2]/d[2];return a}function p(a,b){var d=b[0]-a[0],c=b[1]-a[1];a=b[2]-a[2];return Math.sqrt(d*d+c*c+a*a)}function k(a,b){var d=b[0]-a[0],c=b[1]-a[1];a=b[2]-a[2];return d*d+c*c+a*a}function g(a){var b=a[0],d=a[1];a=a[2];return b*b+d*d+a*a}function q(a,b){var d=b[0],c=b[1],k=b[2];d=d*d+c*c+k*k;0<d&&(d=1/Math.sqrt(d),a[0]=b[0]*d,a[1]=b[1]*d,a[2]=b[2]*d);return a}function r(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}Object.defineProperty(f,"__esModule",{value:!0});f.create=h;f.clone=function(a){var b=
new x.a(3);b[0]=a[0];b[1]=a[1];b[2]=a[2];return b};f.length=e;f.fromValues=c;f.copy=function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];return a};f.set=function(a,b,d,c){a[0]=b;a[1]=d;a[2]=c;return a};f.add=function(a,b,d){a[0]=b[0]+d[0];a[1]=b[1]+d[1];a[2]=b[2]+d[2];return a};f.subtract=a;f.multiply=b;f.divide=d;f.ceil=function(a,b){a[0]=Math.ceil(b[0]);a[1]=Math.ceil(b[1]);a[2]=Math.ceil(b[2]);return a};f.floor=function(a,b){a[0]=Math.floor(b[0]);a[1]=Math.floor(b[1]);a[2]=Math.floor(b[2]);return a};f.min=
function(a,b,d){a[0]=Math.min(b[0],d[0]);a[1]=Math.min(b[1],d[1]);a[2]=Math.min(b[2],d[2]);return a};f.max=function(a,b,d){a[0]=Math.max(b[0],d[0]);a[1]=Math.max(b[1],d[1]);a[2]=Math.max(b[2],d[2]);return a};f.round=function(a,b){a[0]=Math.round(b[0]);a[1]=Math.round(b[1]);a[2]=Math.round(b[2]);return a};f.scale=function(a,b,d){a[0]=b[0]*d;a[1]=b[1]*d;a[2]=b[2]*d;return a};f.scaleAndAdd=function(a,b,d,c){a[0]=b[0]+d[0]*c;a[1]=b[1]+d[1]*c;a[2]=b[2]+d[2]*c;return a};f.distance=p;f.squaredDistance=k;
f.squaredLength=g;f.negate=function(a,b){a[0]=-b[0];a[1]=-b[1];a[2]=-b[2];return a};f.inverse=function(a,b){a[0]=1/b[0];a[1]=1/b[1];a[2]=1/b[2];return a};f.normalize=q;f.dot=r;f.cross=function(a,b,d){var c=b[0],k=b[1];b=b[2];var g=d[0],m=d[1];d=d[2];a[0]=k*d-b*m;a[1]=b*g-c*d;a[2]=c*m-k*g;return a};f.lerp=function(a,b,d,c){var k=b[0],g=b[1];b=b[2];a[0]=k+c*(d[0]-k);a[1]=g+c*(d[1]-g);a[2]=b+c*(d[2]-b);return a};f.hermite=function(a,b,d,c,k,g){var m=g*g,p=m*(2*g-3)+1,e=m*(g-2)+g,r=m*(g-1);g=m*(3-2*g);
a[0]=b[0]*p+d[0]*e+c[0]*r+k[0]*g;a[1]=b[1]*p+d[1]*e+c[1]*r+k[1]*g;a[2]=b[2]*p+d[2]*e+c[2]*r+k[2]*g;return a};f.bezier=function(a,b,d,c,k,g){var m=1-g,p=m*m,e=g*g,r=p*m;p*=3*g;m*=3*e;g*=e;a[0]=b[0]*r+d[0]*p+c[0]*m+k[0]*g;a[1]=b[1]*r+d[1]*p+c[1]*m+k[1]*g;a[2]=b[2]*r+d[2]*p+c[2]*m+k[2]*g;return a};f.random=function(a,b){b=b||1;var d=2*x.c()*Math.PI,c=2*x.c()-1,k=Math.sqrt(1-c*c)*b;a[0]=Math.cos(d)*k;a[1]=Math.sin(d)*k;a[2]=c*b;return a};f.transformMat4=function(a,b,d){var c=b[0],k=b[1];b=b[2];var g=
d[3]*c+d[7]*k+d[11]*b+d[15];g=g||1;a[0]=(d[0]*c+d[4]*k+d[8]*b+d[12])/g;a[1]=(d[1]*c+d[5]*k+d[9]*b+d[13])/g;a[2]=(d[2]*c+d[6]*k+d[10]*b+d[14])/g;return a};f.transformMat3=function(a,b,d){var c=b[0],k=b[1];b=b[2];a[0]=c*d[0]+k*d[3]+b*d[6];a[1]=c*d[1]+k*d[4]+b*d[7];a[2]=c*d[2]+k*d[5]+b*d[8];return a};f.transformQuat=function(a,b,d){var c=b[0],k=b[1],g=b[2];b=d[0];var p=d[1],m=d[2];d=d[3];var e=d*c+p*g-m*k,r=d*k+m*c-b*g,q=d*g+b*k-p*c;c=-b*c-p*k-m*g;a[0]=e*d+c*-b+r*-m-q*-p;a[1]=r*d+c*-p+q*-b-e*-m;a[2]=
q*d+c*-m+e*-p-r*-b;return a};f.rotateX=function(a,b,d,c){var k=[],g=[];k[0]=b[0]-d[0];k[1]=b[1]-d[1];k[2]=b[2]-d[2];g[0]=k[0];g[1]=k[1]*Math.cos(c)-k[2]*Math.sin(c);g[2]=k[1]*Math.sin(c)+k[2]*Math.cos(c);a[0]=g[0]+d[0];a[1]=g[1]+d[1];a[2]=g[2]+d[2];return a};f.rotateY=function(a,b,d,c){var k=[],g=[];k[0]=b[0]-d[0];k[1]=b[1]-d[1];k[2]=b[2]-d[2];g[0]=k[2]*Math.sin(c)+k[0]*Math.cos(c);g[1]=k[1];g[2]=k[2]*Math.cos(c)-k[0]*Math.sin(c);a[0]=g[0]+d[0];a[1]=g[1]+d[1];a[2]=g[2]+d[2];return a};f.rotateZ=function(a,
b,d,c){var k=[],g=[];k[0]=b[0]-d[0];k[1]=b[1]-d[1];k[2]=b[2]-d[2];g[0]=k[0]*Math.cos(c)-k[1]*Math.sin(c);g[1]=k[0]*Math.sin(c)+k[1]*Math.cos(c);g[2]=k[2];a[0]=g[0]+d[0];a[1]=g[1]+d[1];a[2]=g[2]+d[2];return a};f.angle=function(a,b){a=c(a[0],a[1],a[2]);b=c(b[0],b[1],b[2]);q(a,a);q(b,b);b=r(a,b);return 1<b?0:-1>b?Math.PI:Math.acos(b)};f.str=function(a){return"vec3("+a[0]+", "+a[1]+", "+a[2]+")"};f.exactEquals=function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]};f.equals=function(a,b){var d=a[0],
c=a[1];a=a[2];var k=b[0],g=b[1];b=b[2];return Math.abs(d-k)<=x.b*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(c-g)<=x.b*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(a-b)<=x.b*Math.max(1,Math.abs(a),Math.abs(b))};var x=l(3);f.sub=a;f.mul=b;f.div=d;f.dist=p;f.sqrDist=k;f.len=e;f.sqrLen=g;n=function(){var a=h();return function(b,d,c,k,g,p){d||(d=3);c||(c=0);for(k=k?Math.min(k*d+c,b.length):b.length;c<k;c+=d)a[0]=b[c],a[1]=b[c+1],a[2]=b[c+2],g(a,a,p),b[c]=a[0],b[c+1]=a[1],b[c+2]=a[2];return b}}();f.forEach=
n},function(n,f,l){function h(){var c=new e.a(4);c[0]=0;c[1]=0;c[2]=0;c[3]=0;return c}f.b=function(c){var a=new e.a(4);a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[3];return a};f.g=function(c,a,b,d){var p=new e.a(4);p[0]=c;p[1]=a;p[2]=b;p[3]=d;return p};f.c=function(c,a){c[0]=a[0];c[1]=a[1];c[2]=a[2];c[3]=a[3];return c};f.l=function(c,a,b,d,p){c[0]=a;c[1]=b;c[2]=d;c[3]=p;return c};f.a=function(c,a,b){c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c};f.k=function(c,a,b){c[0]=a[0]*b;c[1]=
a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c};f.h=function(c){var a=c[0],b=c[1],d=c[2];c=c[3];return Math.sqrt(a*a+b*b+d*d+c*c)};f.m=function(c){var a=c[0],b=c[1],d=c[2];c=c[3];return a*a+b*b+d*d+c*c};f.j=function(c,a){var b=a[0],d=a[1],p=a[2];a=a[3];var k=b*b+d*d+p*p+a*a;0<k&&(k=1/Math.sqrt(k),c[0]=b*k,c[1]=d*k,c[2]=p*k,c[3]=a*k);return c};f.d=function(c,a){return c[0]*a[0]+c[1]*a[1]+c[2]*a[2]+c[3]*a[3]};f.i=function(c,a,b,d){var p=a[0],k=a[1],g=a[2];a=a[3];c[0]=p+d*(b[0]-p);c[1]=k+d*(b[1]-k);c[2]=g+
d*(b[2]-g);c[3]=a+d*(b[3]-a);return c};f.f=function(c,a){return c[0]===a[0]&&c[1]===a[1]&&c[2]===a[2]&&c[3]===a[3]};f.e=function(c,a){var b=c[0],d=c[1],p=c[2];c=c[3];var k=a[0],g=a[1],q=a[2];a=a[3];return Math.abs(b-k)<=e.b*Math.max(1,Math.abs(b),Math.abs(k))&&Math.abs(d-g)<=e.b*Math.max(1,Math.abs(d),Math.abs(g))&&Math.abs(p-q)<=e.b*Math.max(1,Math.abs(p),Math.abs(q))&&Math.abs(c-a)<=e.b*Math.max(1,Math.abs(c),Math.abs(a))};var e=l(3);(function(){var c=h();return function(a,b,d,p,k,g){b||(b=4);d||
(d=0);for(p=p?Math.min(p*b+d,a.length):a.length;d<p;d+=b)c[0]=a[d],c[1]=a[d+1],c[2]=a[d+2],c[3]=a[d+3],k(c,c,g),a[d]=c[0],a[d+1]=c[1],a[d+2]=c[2],a[d+3]=c[3];return a}})()},function(n,f,l){function h(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function e(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=
Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}l.d(f,"a",function(){return c});l(72);l(74);n=l(2);f=l(17);l=l(0);var c=function(a){function b(a,c){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");var d=h(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,c));d.visibleSegments=a.get(c.visibleSegments);d.clipBounds=a.get(c.clipBounds);d.segmentEquivalences=
a.get(c.segmentEquivalences);a=function(){d.chunkManager.scheduleUpdateChunkPriorities()};d.registerDisposer(d.visibleSegments.changed.add(a));d.registerDisposer(d.segmentEquivalences.changed.add(a));d.registerDisposer(d.clipBounds.changed.add(a));return d}e(b,a);return b}(Object(f.c)(Object(n.withChunkManager)(l.c)))},function(n,f,l){function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}l.d(f,"a",function(){return m});f.b=function(b,d,c,k,g,p,m){Object(a.e)(b,2,d,c,k,g,p,m)};f=l(2);var a=l(18),b=l(35),d=l(23);n=l(77);
var p=l(6),k=l(17);l=l(0);var g=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}(),q=function D(a,b,d){null===a&&(a=Function.prototype);var c=Object.getOwnPropertyDescriptor(a,b);if(void 0===c){if(a=Object.getPrototypeOf(a),null!==a)return D(a,b,d)}else{if("value"in c)return c.value;b=c.get;return void 0===b?
void 0:b.call(d)}},r=this&&this.__decorate||function(a,b,d,c){var k=arguments.length,g=3>k?b:null===c?c=Object.getOwnPropertyDescriptor(b,d):c,p;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(a,b,d,c);else for(var m=a.length-1;0<=m;m--)if(p=a[m])g=(3>k?p(g):3<k?p(b,d,g):p(b,d))||g;return 3<k&&g&&Object.defineProperty(b,d,g),g},x=function(a){function b(){h(this,b);var a=e(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));a.objectId=new p.a;a.vertexPositions=
null;a.vertexAttributes=null;a.indices=null;return a}c(b,a);g(b,[{key:"initializeSkeletonChunk",value:function(a,d){q(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"initialize",this).call(this,a);this.objectId.assign(d)}},{key:"freeSystemMemory",value:function(){this.vertexPositions=this.indices=null}},{key:"getVertexAttributeBytes",value:function(){var a=this.vertexPositions.byteLength,b=this.vertexAttributes;null!=b&&b.forEach(function(b){a+=b.byteLength});return a}},{key:"serialize",
value:function(a,d){q(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,d);var c=this.vertexPositions,k=this.indices;a.indices=k;d.push(k.buffer);k=this.vertexAttributes;if(null!=k&&0<k.length){var g=new Uint8Array(this.getVertexAttributeBytes());g.set(new Uint8Array(c.buffer,c.byteOffset,c.byteLength));var p=a.vertexAttributeOffsets=new Uint32Array(k.length+1);p[0]=0;var m=c.byteLength;k.forEach(function(a,b){p[b+1]=m;g.set(new Uint8Array(a.buffer,a.byteOffset,
a.byteLength),m);m+=a.byteLength});d.push(g.buffer);a.vertexAttributes=g}else a.vertexAttributes=new Uint8Array(c.buffer,c.byteOffset,c.byteLength),a.vertexAttributeOffsets=Uint32Array.of(0),c.buffer!==d[0]&&d.push(c.buffer);this.vertexPositions=this.indices=this.vertexAttributes=null}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=this.gpuMemoryBytes=this.indices.byteLength+this.getVertexAttributeBytes();q(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",
this).call(this)}}]);return b}(f.Chunk),m=function(a){function b(){h(this,b);return e(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);g(b,[{key:"getChunk",value:function(a){var b=Object(d.b)(a),c=this.chunks.get(b);void 0===c&&(c=this.getNewChunk_(x),c.initializeSkeletonChunk(b,a),this.addChunk(c));return c}}]);return b}(f.ChunkSource);f=function(a){function b(a,d){h(this,b);var c=e(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,d));c.source=c.registerDisposer(a.getRef(d.source));
c.registerDisposer(c.chunkManager.recomputeChunkPriorities.add(function(){c.updateChunkPriorities()}));return c}c(b,a);g(b,[{key:"updateChunkPriorities",value:function(){var a=this.visibility.value;if(a!==Number.NEGATIVE_INFINITY){var b=Object(k.b)(a),c=Object(k.a)(a),g=this.source,p=this.chunkManager;Object(d.a)(this,function(a){a=g.getChunk(a);p.requestChunk(a,b,c+60)})}}}]);return b}(b.a);f=r([Object(l.g)(n.a)],f)},function(n,f,l){function h(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}l.d(f,"c",function(){return d});l.d(f,"b",function(){return p});var e=l(14),c=l(7),a=l(1);l.d(f,"a",function(){return c.b});var b=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,
d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}(),d;(function(a){a[a.UNKNOWN=0]="UNKNOWN";a[a.IMAGE=1]="IMAGE";a[a.SEGMENTATION=2]="SEGMENTATION"})(d||(d={}));var p=function(k){function g(b){if(!(this instanceof g))throw new TypeError("Cannot call a class as a function");var d=(g.__proto__||Object.getPrototypeOf(g)).call(this,b);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");d=!d||"object"!==typeof d&&"function"!==typeof d?this:d;var k=d.dataType=b.dataType,
p=d.numChannels=b.numChannels;d.chunkBytes=Object(a.i)(b.chunkDataSize)*c.a[k]*p;d.compressedSegmentationBlockSize=b.compressedSegmentationBlockSize;return d}h(g,k);b(g,[{key:"toObject",value:function(){return{transform:this.chunkLayout.transform,numChannels:this.numChannels,chunkDataSize:this.chunkDataSize,voxelSize:this.voxelSize,dataType:this.dataType,lowerVoxelBound:this.lowerVoxelBound,upperVoxelBound:this.upperVoxelBound,lowerClipBound:this.lowerClipBound,upperClipBound:this.upperClipBound,
baseVoxelOffset:this.baseVoxelOffset,compressedSegmentationBlockSize:this.compressedSegmentationBlockSize}}}],[{key:"make",value:function(a){return new g(Object.assign({},a,{transform:Object(e.k)(a.transform,a.volumeSourceOptions)}))}},{key:"fromObject",value:function(a){return new g(a)}},{key:"withDefaultCompression",value:function(a){var b=a.compressedSegmentationBlockSize,k=a.dataType,p=a.voxelSize,q=a.transform,h=a.lowerVoxelBound,f=a.upperVoxelBound;q=Object(e.k)(q,a.volumeSourceOptions);void 0!==
b||a.volumeType!==d.SEGMENTATION||k!==c.b.UINT32&&k!==c.b.UINT64||(b=Object(e.l)({voxelSize:p,transform:q,lowerVoxelBound:h,upperVoxelBound:f,maxVoxelsPerChunkLog2:9}));return new g(Object.assign({},a,{compressedSegmentationBlockSize:b,transform:q}))}},{key:"getDefaults",value:function(a){var b=Object.assign({},a,{transform:Object(e.k)(a.transform,a.volumeSourceOptions)});return(void 0===a.chunkDataSizes?Object(e.j)(b):a.chunkDataSizes).map(function(b){return g.withDefaultCompression(Object.assign({},
a,{chunkDataSize:b}))})}}]);return g}(e.i)},function(n,f,l){function h(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(f,"__esModule",{value:!0});l.d(f,"NDStoreVolumeChunkSource",function(){return q});n=l(2);f=l(83);var e=
l(15),c=l(39),a=l(19),b=l(10),d=l(8);l=l(0);var p=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,d);c&&a(b,c);return b}}(),k=this&&this.__decorate||function(a,b,d,c){var k=arguments.length,g=3>k?b:null===c?c=Object.getOwnPropertyDescriptor(b,d):c,p;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(a,
b,d,c);else for(var m=a.length-1;0<=m;m--)if(p=a[m])g=(3>k?p(g):3<k?p(b,d,g):p(b,d))||g;return 3<k&&g&&Object.defineProperty(b,d,g),g},g=new Map;g.set("npz",c.a);g.set("jpeg",e.a);g.set("raw",a.a);var q=function(a){function b(){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");var a=(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");a=!a||"object"!==typeof a&&"function"!==
typeof a?this:a;a.chunkDecoder=g.get(a.parameters.encoding);return a}h(b,a);p(b,[{key:"download",value:function(a,b){for(var c=this,k=this.parameters,g=k.urlPrefix+"/"+k.key+"/"+k.channel+"/"+(k.encoding+"/"+k.resolution),p=this.computeChunkBounds(a),m=a.chunkDataSize,e=0;3>e;++e)g+="/"+p[e]+","+(p[e]+m[e]);k.neariso&&(g+="/neariso/");return Object(d.e)(Object(d.c)(k.baseUrls,g),"arraybuffer",b).then(function(b){return c.chunkDecoder(a,b)})}}]);return b}(Object(n.WithParameters)(b.a,f.a));q=k([Object(l.g)()],
q)},function(n,f,l){f.a=function(d,p){p=Object(a.a)(Object(b.inflate)(new Uint8Array(p)));var k=d.chunkDataSize,g=d.source,q=g.spec.numChannels,r=p.shape;if(4!==r.length||r[0]!==q||r[1]!==k[2]||r[2]!==k[1]||r[3]!==k[0])throw Error("Shape "+JSON.stringify(r)+" does not match chunkDataSize "+Object(c.n)(k));k=p.dataType.dataType;g=g.spec;if(k!==g.dataType)throw Error("Data type "+e.a[k]+" does not match "+("expected data type "+e.a[g.dataType]));Object(h.a)(d,p.data)};var h=l(25),e=l(14),c=l(1),a=l(84),
b=l(26);l.n(b)},function(n,f,l){n.exports=function(h,e,c,a){var b=h&65535|0;h=h>>>16&65535|0;for(var d;0!==c;){d=2E3<c?2E3:c;c-=d;do b=b+e[a++]|0,h=h+b|0;while(--d);b%=65521;h%=65521}return b|h<<16|0}},function(n,f,l){var h=function(){for(var e,c=[],a=0;256>a;a++){e=a;for(var b=0;8>b;b++)e=e&1?3988292384^e>>>1:e>>>1;c[a]=e}return c}();n.exports=function(e,c,a,b){a=b+a;for(e^=-1;b<a;b++)e=e>>>8^h[(e^c[b])&255];return e^-1}},function(n,f,l){function h(b,p){if(65537>p&&(b.subarray&&a||!b.subarray&&c))return String.fromCharCode.apply(null,
e.shrinkBuf(b,p));for(var d="",g=0;g<p;g++)d+=String.fromCharCode(b[g]);return d}var e=l(5),c=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(d){c=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(d){a=!1}var b=new e.Buf8(256);for(n=0;256>n;n++)b[n]=252<=n?6:248<=n?5:240<=n?4:224<=n?3:192<=n?2:1;b[254]=b[254]=1;f.string2buf=function(a){var b,d,c=a.length,q=0;for(b=0;b<c;b++){var r=a.charCodeAt(b);if(55296===(r&64512)&&b+1<c){var h=a.charCodeAt(b+1);56320===(h&64512)&&(r=65536+(r-
55296<<10)+(h-56320),b++)}q+=128>r?1:2048>r?2:65536>r?3:4}var m=new e.Buf8(q);for(b=d=0;d<q;b++)r=a.charCodeAt(b),55296===(r&64512)&&b+1<c&&(h=a.charCodeAt(b+1),56320===(h&64512)&&(r=65536+(r-55296<<10)+(h-56320),b++)),128>r?m[d++]=r:(2048>r?m[d++]=192|r>>>6:(65536>r?m[d++]=224|r>>>12:(m[d++]=240|r>>>18,m[d++]=128|r>>>12&63),m[d++]=128|r>>>6&63),m[d++]=128|r&63);return m};f.buf2binstring=function(a){return h(a,a.length)};f.binstring2buf=function(a){for(var b=new e.Buf8(a.length),d=0,c=b.length;d<
c;d++)b[d]=a.charCodeAt(d);return b};f.buf2string=function(a,c){var d,g=c||a.length,p=Array(2*g);for(c=d=0;c<g;){var e=a[c++];if(128>e)p[d++]=e;else{var f=b[e];if(4<f)p[d++]=65533,c+=f-1;else{for(e&=2===f?31:3===f?15:7;1<f&&c<g;)e=e<<6|a[c++]&63,f--;1<f?p[d++]=65533:65536>e?p[d++]=e:(e-=65536,p[d++]=55296|e>>10&1023,p[d++]=56320|e&1023)}}}return h(p,d)};f.utf8border=function(a,c){var d;c=c||a.length;c>a.length&&(c=a.length);for(d=c-1;0<=d&&128===(a[d]&192);)d--;return 0>d||0===d?c:d+b[a[d]]>c?d:c}},
function(n,f,l){n.exports=function(){this.input=null;this.total_in=this.avail_in=this.next_in=0;this.output=null;this.total_out=this.avail_out=this.next_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}},function(n,f,l){n.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(n,f,l){var h=h||{};h.Utils=h.Utils||l(29);h.NIFTI1=h.NIFTI1||function(){this.littleEndian=!1;this.dim_info=0;this.dims=[];this.slice_code=this.slice_end=this.slice_start=this.numBitsPerVoxel=this.datatypeCode=this.intent_code=this.intent_p3=this.intent_p2=this.intent_p1=0;this.pixDims=[];this.vox_offset=0;this.scl_slope=1;this.toffset=this.slice_duration=this.cal_min=this.cal_max=
this.xyzt_units=this.scl_inter=0;this.intent_name=this.aux_file=this.description="";this.qoffset_z=this.qoffset_y=this.qoffset_x=this.quatern_d=this.quatern_c=this.quatern_b=this.sform_code=this.qform_code=0;this.affine=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];this.magic=0;this.isHDR=!1;this.extensionFlag=[0,0,0,0];this.extensionCode=this.extensionSize=0};h.NIFTI1.TYPE_NONE=0;h.NIFTI1.TYPE_BINARY=1;h.NIFTI1.TYPE_UINT8=2;h.NIFTI1.TYPE_INT16=4;h.NIFTI1.TYPE_INT32=8;h.NIFTI1.TYPE_FLOAT32=16;h.NIFTI1.TYPE_COMPLEX64=
32;h.NIFTI1.TYPE_FLOAT64=64;h.NIFTI1.TYPE_RGB24=128;h.NIFTI1.TYPE_INT8=256;h.NIFTI1.TYPE_UINT16=512;h.NIFTI1.TYPE_UINT32=768;h.NIFTI1.TYPE_INT64=1024;h.NIFTI1.TYPE_UINT64=1280;h.NIFTI1.TYPE_FLOAT128=1536;h.NIFTI1.TYPE_COMPLEX128=1792;h.NIFTI1.TYPE_COMPLEX256=2048;h.NIFTI1.XFORM_UNKNOWN=0;h.NIFTI1.XFORM_SCANNER_ANAT=1;h.NIFTI1.XFORM_ALIGNED_ANAT=2;h.NIFTI1.XFORM_TALAIRACH=3;h.NIFTI1.XFORM_MNI_152=4;h.NIFTI1.SPATIAL_UNITS_MASK=7;h.NIFTI1.TEMPORAL_UNITS_MASK=56;h.NIFTI1.UNITS_UNKNOWN=0;h.NIFTI1.UNITS_METER=
1;h.NIFTI1.UNITS_MM=2;h.NIFTI1.UNITS_MICRON=3;h.NIFTI1.UNITS_SEC=8;h.NIFTI1.UNITS_MSEC=16;h.NIFTI1.UNITS_USEC=24;h.NIFTI1.UNITS_HZ=32;h.NIFTI1.UNITS_PPM=40;h.NIFTI1.UNITS_RADS=48;h.NIFTI1.MAGIC_COOKIE=348;h.NIFTI1.STANDARD_HEADER_SIZE=348;h.NIFTI1.MAGIC_NUMBER_LOCATION=344;h.NIFTI1.MAGIC_NUMBER=[110,43,49];h.NIFTI1.MAGIC_NUMBER2=[110,105,49];h.NIFTI1.EXTENSION_HEADER_SIZE=8;h.NIFTI1.prototype.readHeader=function(e){e=new DataView(e);var c=h.Utils.getIntAt(e,0,this.littleEndian),a,b;c!==h.NIFTI1.MAGIC_COOKIE&&
(this.littleEndian=!0,c=h.Utils.getIntAt(e,0,this.littleEndian));if(c!==h.NIFTI1.MAGIC_COOKIE)throw Error("This does not appear to be a NIFTI file!");this.dim_info=h.Utils.getByteAt(e,39);for(a=0;8>a;a+=1)c=40+2*a,this.dims[a]=h.Utils.getShortAt(e,c,this.littleEndian);this.intent_p1=h.Utils.getFloatAt(e,56,this.littleEndian);this.intent_p2=h.Utils.getFloatAt(e,60,this.littleEndian);this.intent_p3=h.Utils.getFloatAt(e,64,this.littleEndian);this.intent_code=h.Utils.getShortAt(e,68,this.littleEndian);
this.datatypeCode=h.Utils.getShortAt(e,70,this.littleEndian);this.numBitsPerVoxel=h.Utils.getShortAt(e,72,this.littleEndian);this.slice_start=h.Utils.getShortAt(e,74,this.littleEndian);for(a=0;8>a;a+=1)c=76+4*a,this.pixDims[a]=h.Utils.getFloatAt(e,c,this.littleEndian);this.vox_offset=h.Utils.getFloatAt(e,108,this.littleEndian);this.scl_slope=h.Utils.getFloatAt(e,112,this.littleEndian);this.scl_inter=h.Utils.getFloatAt(e,116,this.littleEndian);this.slice_end=h.Utils.getShortAt(e,120,this.littleEndian);
this.slice_code=h.Utils.getByteAt(e,122);this.xyzt_units=h.Utils.getByteAt(e,123);this.cal_max=h.Utils.getFloatAt(e,124,this.littleEndian);this.cal_min=h.Utils.getFloatAt(e,128,this.littleEndian);this.slice_duration=h.Utils.getFloatAt(e,132,this.littleEndian);this.toffset=h.Utils.getFloatAt(e,136,this.littleEndian);this.description=h.Utils.getStringAt(e,148,228);this.aux_file=h.Utils.getStringAt(e,228,252);this.qform_code=h.Utils.getShortAt(e,252,this.littleEndian);this.sform_code=h.Utils.getShortAt(e,
254,this.littleEndian);this.quatern_b=h.Utils.getFloatAt(e,256,this.littleEndian);this.quatern_c=h.Utils.getFloatAt(e,260,this.littleEndian);this.quatern_d=h.Utils.getFloatAt(e,264,this.littleEndian);this.qoffset_x=h.Utils.getFloatAt(e,268,this.littleEndian);this.qoffset_y=h.Utils.getFloatAt(e,272,this.littleEndian);this.qoffset_z=h.Utils.getFloatAt(e,276,this.littleEndian);for(a=0;3>a;a+=1)for(b=0;4>b;b+=1)c=280+4*(4*a+b),this.affine[a][b]=h.Utils.getFloatAt(e,c,this.littleEndian);this.affine[3][0]=
0;this.affine[3][1]=0;this.affine[3][2]=0;this.affine[3][3]=1;this.intent_name=h.Utils.getStringAt(e,328,344);this.magic=h.Utils.getStringAt(e,344,348);this.isHDR=this.magic===h.NIFTI1.MAGIC_NUMBER2;e.byteLength>h.NIFTI1.MAGIC_COOKIE&&(this.extensionFlag[0]=h.Utils.getByteAt(e,348),this.extensionFlag[1]=h.Utils.getByteAt(e,349),this.extensionFlag[2]=h.Utils.getByteAt(e,350),this.extensionFlag[3]=h.Utils.getByteAt(e,351),this.extensionFlag[0]&&(this.extensionSize=this.getExtensionSize(e),this.extensionCode=
this.getExtensionCode(e)))};h.NIFTI1.prototype.toFormattedString=function(){var e=h.Utils.formatNumber;var c=""+("Dim Info = "+this.dim_info+"\n");c+="Image Dimensions (1-8): "+this.dims[0]+", "+this.dims[1]+", "+this.dims[2]+", "+this.dims[3]+", "+this.dims[4]+", "+this.dims[5]+", "+this.dims[6]+", "+this.dims[7]+"\n";c+="Intent Parameters (1-3): "+this.intent_p1+", "+this.intent_p2+", "+this.intent_p3+"\n";c+="Intent Code = "+this.intent_code+"\n";c+="Datatype = "+this.datatypeCode+" ("+this.getDatatypeCodeString(this.datatypeCode)+
")\n";c+="Bits Per Voxel = "+this.numBitsPerVoxel+"\n";c+="Slice Start = "+this.slice_start+"\n";c+="Voxel Dimensions (1-8): "+e(this.pixDims[0])+", "+e(this.pixDims[1])+", "+e(this.pixDims[2])+", "+e(this.pixDims[3])+", "+e(this.pixDims[4])+", "+e(this.pixDims[5])+", "+e(this.pixDims[6])+", "+e(this.pixDims[7])+"\n";c+="Image Offset = "+this.vox_offset+"\n";c+="Data Scale:  Slope = "+e(this.scl_slope)+"  Intercept = "+e(this.scl_inter)+"\n";c+="Slice End = "+this.slice_end+"\n";c+="Slice Code = "+
this.slice_code+"\n";c+="Units Code = "+this.xyzt_units+" ("+this.getUnitsCodeString(h.NIFTI1.SPATIAL_UNITS_MASK&this.xyzt_units)+", "+this.getUnitsCodeString(h.NIFTI1.TEMPORAL_UNITS_MASK&this.xyzt_units)+")\n";c+="Display Range:  Max = "+e(this.cal_max)+"  Min = "+e(this.cal_min)+"\n";c+="Slice Duration = "+this.slice_duration+"\n";c+="Time Axis Shift = "+this.toffset+"\n";c+='Description: "'+this.description+'"\n';c+='Auxiliary File: "'+this.aux_file+'"\n';c+="Q-Form Code = "+this.qform_code+" ("+
this.getTransformCodeString(this.qform_code)+")\n";c+="S-Form Code = "+this.sform_code+" ("+this.getTransformCodeString(this.sform_code)+")\n";c+="Quaternion Parameters:  b = "+e(this.quatern_b)+"  c = "+e(this.quatern_c)+"  d = "+e(this.quatern_d)+"\n";c+="Quaternion Offsets:  x = "+this.qoffset_x+"  y = "+this.qoffset_y+"  z = "+this.qoffset_z+"\n";c+="S-Form Parameters X: "+e(this.affine[0][0])+", "+e(this.affine[0][1])+", "+e(this.affine[0][2])+", "+e(this.affine[0][3])+"\n";c+="S-Form Parameters Y: "+
e(this.affine[1][0])+", "+e(this.affine[1][1])+", "+e(this.affine[1][2])+", "+e(this.affine[1][3])+"\n";c+="S-Form Parameters Z: "+e(this.affine[2][0])+", "+e(this.affine[2][1])+", "+e(this.affine[2][2])+", "+e(this.affine[2][3])+"\n";c+='Intent Name: "'+this.intent_name+'"\n';this.extensionFlag[0]&&(c+="Extension: Size = "+this.extensionSize+"  Code = "+this.extensionCode+"\n");return c};h.NIFTI1.prototype.getDatatypeCodeString=function(e){return e===h.NIFTI1.TYPE_UINT8?"1-Byte Unsigned Integer":
e===h.NIFTI1.TYPE_INT16?"2-Byte Signed Integer":e===h.NIFTI1.TYPE_INT32?"4-Byte Signed Integer":e===h.NIFTI1.TYPE_FLOAT32?"4-Byte Float":e===h.NIFTI1.TYPE_FLOAT64?"8-Byte Float":e===h.NIFTI1.TYPE_RGB24?"RGB":e===h.NIFTI1.TYPE_INT8?"1-Byte Signed Integer":e===h.NIFTI1.TYPE_UINT16?"2-Byte Unsigned Integer":e===h.NIFTI1.TYPE_UINT32?"4-Byte Unsigned Integer":e===h.NIFTI1.TYPE_INT64?"8-Byte Signed Integer":e===h.NIFTI1.TYPE_UINT64?"8-Byte Unsigned Integer":"Unknown"};h.NIFTI1.prototype.getTransformCodeString=
function(e){return e===h.NIFTI1.XFORM_SCANNER_ANAT?"Scanner":e===h.NIFTI1.XFORM_ALIGNED_ANAT?"Aligned":e===h.NIFTI1.XFORM_TALAIRACH?"Talairach":e===h.NIFTI1.XFORM_MNI_152?"MNI":"Unknown"};h.NIFTI1.prototype.getUnitsCodeString=function(e){return e===h.NIFTI1.UNITS_METER?"Meters":e===h.NIFTI1.UNITS_MM?"Millimeters":e===h.NIFTI1.UNITS_MICRON?"Microns":e===h.NIFTI1.UNITS_SEC?"Seconds":e===h.NIFTI1.UNITS_MSEC?"Milliseconds":e===h.NIFTI1.UNITS_USEC?"Microseconds":e===h.NIFTI1.UNITS_HZ?"Hz":e===h.NIFTI1.UNITS_PPM?
"PPM":e===h.NIFTI1.UNITS_RADS?"Rads":"Unknown"};h.NIFTI1.prototype.getQformMat=function(){return this.convertNiftiQFormToNiftiSForm(this.quatern_b,this.quatern_c,this.quatern_d,this.qoffset_x,this.qoffset_y,this.qoffset_z,this.pixDims[1],this.pixDims[2],this.pixDims[3],this.pixDims[0])};h.NIFTI1.prototype.convertNiftiQFormToNiftiSForm=function(e,c,a,b,d,p,k,g,h,r){var q=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],m=a;q[3][0]=q[3][1]=q[3][2]=0;q[3][3]=1;a=1-(e*e+c*c+m*m);1E-7>a?(a=1/Math.sqrt(e*e+c*
c+m*m),e*=a,c*=a,m*=a,a=0):a=Math.sqrt(a);k=0<k?k:1;g=0<g?g:1;h=0<h?h:1;0>r&&(h=-h);q[0][0]=(a*a+e*e-c*c-m*m)*k;q[0][1]=2*(e*c-a*m)*g;q[0][2]=2*(e*m+a*c)*h;q[1][0]=2*(e*c+a*m)*k;q[1][1]=(a*a+c*c-e*e-m*m)*g;q[1][2]=2*(c*m-a*e)*h;q[2][0]=2*(e*m-a*c)*k;q[2][1]=2*(c*m+a*e)*g;q[2][2]=(a*a+m*m-c*c-e*e)*h;q[0][3]=b;q[1][3]=d;q[2][3]=p;return q};h.NIFTI1.prototype.convertNiftiSFormToNEMA=function(e){var c,a,b,d;var p=[[0,0,0],[0,0,0],[0,0,0]];var k=[[0,0,0],[0,0,0],[0,0,0]];var g=e[0][0];var h=e[0][1];var r=
e[0][2];var f=e[1][0];var m=e[1][1];var l=e[1][2];var D=e[2][0];var t=e[2][1];var n=e[2][2];e=Math.sqrt(g*g+f*f+D*D);if(0===e)return null;g/=e;f/=e;D/=e;e=Math.sqrt(h*h+m*m+t*t);if(0===e)return null;h/=e;m/=e;t/=e;e=g*h+f*m+D*t;if(1E-4<Math.abs(e)){h-=e*g;m-=e*f;t-=e*D;e=Math.sqrt(h*h+m*m+t*t);if(0===e)return null;h/=e;m/=e;t/=e}e=Math.sqrt(r*r+l*l+n*n);0===e?(r=f*t-D*m,l=D*h-t*g,n=g*m-f*h):(r/=e,l/=e,n/=e);e=g*r+f*l+D*n;if(1E-4<Math.abs(e)){r-=e*g;l-=e*f;n-=e*D;e=Math.sqrt(r*r+l*l+n*n);if(0===e)return null;
r/=e;l/=e;n/=e}e=h*r+m*l+t*n;if(1E-4<Math.abs(e)){r-=e*h;l-=e*m;n-=e*t;e=Math.sqrt(r*r+l*l+n*n);if(0===e)return null;r/=e;l/=e;n/=e}p[0][0]=g;p[0][1]=h;p[0][2]=r;p[1][0]=f;p[1][1]=m;p[1][2]=l;p[2][0]=D;p[2][1]=t;p[2][2]=n;D=this.nifti_mat33_determ(p);if(0===D)return null;var C=-666;g=f=m=l=1;h=2;r=3;for(t=1;3>=t;t+=1)for(n=1;3>=n;n+=1)if(t!==n)for(c=1;3>=c;c+=1)if(t!==c&&n!==c)for(k[0][0]=k[0][1]=k[0][2]=k[1][0]=k[1][1]=k[1][2]=k[2][0]=k[2][1]=k[2][2]=0,a=-1;1>=a;a+=2)for(b=-1;1>=b;b+=2)for(d=-1;1>=
d;d+=2)k[0][t-1]=a,k[1][n-1]=b,k[2][c-1]=d,e=this.nifti_mat33_determ(k),0<e*D&&(e=this.nifti_mat33_mul(k,p),e=e[0][0]+e[1][1]+e[2][2],e>C&&(C=e,g=t,h=n,r=c,f=a,m=b,l=d));p=k=e=D=t=n=0;switch(g*f){case 1:p="X";D="+";break;case -1:p="X";D="-";break;case 2:p="Y";D="+";break;case -2:p="Y";D="-";break;case 3:p="Z";D="+";break;case -3:p="Z",D="-"}switch(h*m){case 1:k="X";t="+";break;case -1:k="X";t="-";break;case 2:k="Y";t="+";break;case -2:k="Y";t="-";break;case 3:k="Z";t="+";break;case -3:k="Z",t="-"}switch(r*
l){case 1:e="X";n="+";break;case -1:e="X";n="-";break;case 2:e="Y";n="+";break;case -2:e="Y";n="-";break;case 3:e="Z";n="+";break;case -3:e="Z",n="-"}return p+k+e+D+t+n};h.NIFTI1.prototype.nifti_mat33_mul=function(e,c){var a=[[0,0,0],[0,0,0],[0,0,0]],b,d;for(b=0;3>b;b+=1)for(d=0;3>d;d+=1)a[b][d]=e[b][0]*c[0][d]+e[b][1]*c[1][d]+e[b][2]*c[2][d];return a};h.NIFTI1.prototype.nifti_mat33_determ=function(e){var c=e[0][0];var a=e[0][1];var b=e[0][2];var d=e[1][0];var p=e[1][1];var k=e[1][2];var g=e[2][0];
var h=e[2][1];e=e[2][2];return c*p*e-c*h*k-d*a*e+d*h*b+g*a*k-g*p*b};h.NIFTI1.prototype.getExtensionLocation=function(){return h.NIFTI1.MAGIC_COOKIE+4};h.NIFTI1.prototype.getExtensionSize=function(e){return h.Utils.getIntAt(e,this.getExtensionLocation(),this.littleEndian)};h.NIFTI1.prototype.getExtensionCode=function(e){return h.Utils.getIntAt(e,this.getExtensionLocation()+4,this.littleEndian)};"undefined"!==typeof n&&n.exports&&(n.exports=h.NIFTI1)},function(n,f,l){function h(a,b){if(!(a instanceof
b))throw new TypeError("Cannot call a class as a function");}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,
b):a.__proto__=b)}function a(a,b){b=b.match(A);if(null===b||void 0===b[1])throw Error('Data source URL must have the form "<protocol>://<path>".');var d=b[1];a=a.get(d);if(void 0===a)throw Error("Unsupported data source: "+JSON.stringify(d)+".");return[a,b[2],d]}function b(b,d,c,k){var g=$jscomp.makeIterator(a(J,d));d=g.next().value;g=g.next().value;return d.getMesh(b,g,c,k)}function d(b,d,c,k){var g=$jscomp.makeIterator(a(C,d));d=g.next().value;g=g.next().value;return d.getMeshVertexAttributes(b,
g,c,k)}function p(a){var b=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY;a=$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=a.next())c=c.value,b=Math.min(b,c),d=Math.max(d,c);return[b,d]}function k(a,c,k,g){for(var u=[b(a,c.meshSourceUrl,k,g)],m=$jscomp.makeIterator(c.attributeSourceUrls),e=m.next();!e.done;e=m.next())u.push(d(a,e.value,k,g));return Promise.all(u).then(function(a){function b(a,b,d){for(var c=a.length,g=0;g<c;++g){var u=a[g],m=b[g],e=d,h=$jscomp.makeIterator(p(m)),w=h.next().value;
h=h.next().value;k.info.vertexAttributes.push({name:u.name,source:e,numComponents:u.numComponents,dataType:u.dataType,min:w,max:h});k.vertexAttributes.push(m)}}var d=a[0],k={info:{numVertices:d.info.numVertices,numTriangles:d.info.numTriangles,vertexAttributes:[]},vertexPositions:d.vertexPositions,indices:d.indices,vertexNormals:d.vertexNormals,vertexAttributes:[]};b(d.info.vertexAttributes,d.vertexAttributes);c.attributeSourceUrls.forEach(function(c,k){k=a[k+1];if(k.numVertices!==d.info.numVertices)throw Error("Vertex attribute source "+
JSON.stringify(c)+" specifies attributes for "+(k.numVertices+" vertices, but mesh has "+d.info.numVertices+" vertices."));b(k.attributeInfo,k.attributes,c)});return k})}f.a=function(a,b){J.set(a,b)};f.b=function(a,b){C.set(a,b)};n=l(2);var g=l(12),q=l(18),r=l(110),x=l(4),m=l(17);l=l(0);var v=function(){function a(a,b){for(var d=0;d<b.length;d++){var c=b[d];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(b,d,c){d&&a(b.prototype,
d);c&&a(b,c);return b}}(),D=function B(a,b,d){null===a&&(a=Function.prototype);var c=Object.getOwnPropertyDescriptor(a,b);if(void 0===c){if(a=Object.getPrototypeOf(a),null!==a)return B(a,b,d)}else{if("value"in c)return c.value;b=c.get;return void 0===b?void 0:b.call(d)}};f=this&&this.__decorate||function(a,b,d,c){var k=arguments.length,g=3>k?b:null===c?c=Object.getOwnPropertyDescriptor(b,d):c,p;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(a,b,d,c);else for(var u=
a.length-1;0<=u;u--)if(p=a[u])g=(3>k?p(g):3<k?p(b,d,g):p(b,d))||g;return 3<k&&g&&Object.defineProperty(b,d,g),g};var t=function(a){function b(){h(this,b);var a=e(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));a.data=null;return a}c(b,a);v(b,[{key:"freeSystemMemory",value:function(){this.data=null}},{key:"serialize",value:function(a,d){D(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"serialize",this).call(this,a,d);var c=this.data,k=c.vertexPositions,g=c.indices,p=c.vertexNormals;
c=c.vertexAttributes;a.vertexPositions=k;a.indices=g;a.vertexNormals=p;a.vertexAttributes=c;a=new Set;a.add(k.buffer);a.add(g.buffer);a.add(p.buffer);k=$jscomp.makeIterator(c);for(g=k.next();!g.done;g=k.next())a.add(g.value.buffer);d.push.apply(d,[].concat($jscomp.arrayFromIterable(a)));this.data=null}},{key:"downloadSucceeded",value:function(){var a=this.data,d=a.vertexAttributes;a=this.gpuMemoryBytes=a.vertexPositions.byteLength+a.indices.byteLength+a.vertexNormals.byteLength;d=$jscomp.makeIterator(d);
for(var c=d.next();!c.done;c=d.next())a+=c.value.byteLength;this.systemMemoryBytes=this.gpuMemoryBytes=a;D(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this)}}]);return b}(n.Chunk),J=new Map,C=new Map,A=/^(?:([a-zA-Z-+_]+):\/\/)?(.*)$/,I=function(a){function b(){h(this,b);return e(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);v(b,[{key:"getChunk",value:function(){var a=r.b,b=this.chunks.get(a);void 0===b&&(b=this.getNewChunk_(t),
b.initialize(a),this.addChunk(b));return b}},{key:"download",value:function(a,b){var d=this;return k(this.chunkManager,this.parameters,function(){return{priorityTier:a.priorityTier,priority:a.priority}},b).then(function(b){if(Object(x.d)(b.info)!==Object(x.d)(d.parameters.info))throw Error("Mesh info has changed.");void 0===b.vertexNormals&&(b.vertexNormals=Object(q.b)(b.vertexPositions,b.indices));a.data=b})}}]);return b}(Object(n.WithParameters)(n.ChunkSource,r.d));I=f([Object(l.g)()],I);n=function(a){function b(a,
d){h(this,b);var c=e(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,d));c.source=c.registerDisposer(a.getRef(d.source));c.registerDisposer(c.chunkManager.recomputeChunkPriorities.add(function(){c.updateChunkPriorities()}));return c}c(b,a);v(b,[{key:"updateChunkPriorities",value:function(){var a=this.visibility.value;if(a!==Number.NEGATIVE_INFINITY){var b=Object(m.b)(a);a=Object(m.a)(a);var d=this.chunkManager,c=this.source.getChunk();d.requestChunk(c,b,a+50)}}}]);return b}(Object(m.c)(Object(n.withChunkManager)(l.c)));
n=f([Object(l.g)(r.c)],n);Object(l.e)(r.a,function(a,b){var d=this.getRef(a.chunkManager);try{return k(d,a.parameters,function(){return{priorityTier:g.d.VISIBLE,priority:1E3}},b).then(function(a){return{value:a.info}})}finally{d.dispose()}})},function(n,f,l){f.a=function(e){e=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);var c=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return 2<c.length&&31===c[0]&&139===c[1]?Object(h.inflate)(e):e};var h=l(26);
l.n(h)},function(n,f,l){l(49);l(2);l(22);l(64);l(38);l(93);l(95);l(100);l(101);l(103);l(108);l(111);n.exports=l(112)},function(n,f,l){Object.defineProperty(f,"__esModule",{value:!0});l.d(f,"rpc",function(){return h});var h=new (l(0).a)(self)},function(n,f,l){var h=function(){function e(c,a){for(var b=0;b<a.length;b++){var d=a[b];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(c,d.key,d)}}return function(c,a,b){a&&e(c.prototype,a);b&&e(c,b);return c}}();
n=function(){function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");}h(e,null,[{key:"insertAfter",value:function(c,a){var b=c.next0;a.next0=b;a.prev0=c;c.next0=a;b.prev0=a}},{key:"insertBefore",value:function(c,a){var b=c.prev0;a.prev0=b;a.next0=c;c.prev0=a;b.next0=a}},{key:"front",value:function(c){var a=c.next0;return a===c?null:a}},{key:"back",value:function(c){var a=c.prev0;return a===c?null:a}},{key:"pop",value:function(c){var a=c.next0,b=c.prev0;a.prev0=
b;b.next0=a;c.next0=null;c.prev0=null;return c}},{key:"iterator",value:function(c){function a(a,g){for(;;)switch(b){case 0:d=c.next0;case 1:if(d===c){b=3;break}b=4;return{value:d,done:!1};case 4:if(void 0===g){b=5;break}b=-1;throw g;case 5:case 2:d=d.next0;b=1;break;case 3:b=-1;default:return{value:void 0,done:!0}}}var b=0,d,p={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();p[Symbol.iterator]=
function(){return this};return p}},{key:"reverseIterator",value:function(c){function a(a,g){for(;;)switch(b){case 0:d=c.prev0;case 1:if(d===c){b=3;break}b=4;return{value:d,done:!1};case 4:if(void 0===g){b=5;break}b=-1;throw g;case 5:case 2:d=d.prev0;b=1;break;case 3:b=-1;default:return{value:void 0,done:!0}}}var b=0,d,p={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();p[Symbol.iterator]=
function(){return this};return p}},{key:"initializeHead",value:function(c){c.next0=c.prev0=c}}]);return e}();f.a=n},function(n,f,l){var h=function(){function e(c,a){for(var b=0;b<a.length;b++){var d=a[b];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(c,d.key,d)}}return function(c,a,b){a&&e(c.prototype,a);b&&e(c,b);return c}}();n=function(){function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");}h(e,null,[{key:"insertAfter",
value:function(c,a){var b=c.next1;a.next1=b;a.prev1=c;c.next1=a;b.prev1=a}},{key:"insertBefore",value:function(c,a){var b=c.prev1;a.prev1=b;a.next1=c;c.prev1=a;b.next1=a}},{key:"front",value:function(c){var a=c.next1;return a===c?null:a}},{key:"back",value:function(c){var a=c.prev1;return a===c?null:a}},{key:"pop",value:function(c){var a=c.next1,b=c.prev1;a.prev1=b;b.next1=a;c.next1=null;c.prev1=null;return c}},{key:"iterator",value:function(c){function a(a,g){for(;;)switch(b){case 0:d=c.next1;case 1:if(d===
c){b=3;break}b=4;return{value:d,done:!1};case 4:if(void 0===g){b=5;break}b=-1;throw g;case 5:case 2:d=d.next1;b=1;break;case 3:b=-1;default:return{value:void 0,done:!0}}}var b=0,d,p={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();p[Symbol.iterator]=function(){return this};return p}},{key:"reverseIterator",value:function(c){function a(a,g){for(;;)switch(b){case 0:d=c.prev1;case 1:if(d===
c){b=3;break}b=4;return{value:d,done:!1};case 4:if(void 0===g){b=5;break}b=-1;throw g;case 5:case 2:d=d.prev1;b=1;break;case 3:b=-1;default:return{value:void 0,done:!0}}}var b=0,d,p={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();p[Symbol.iterator]=function(){return this};return p}},{key:"initializeHead",value:function(c){c.next1=c.prev1=c}}]);return e}();f.a=n},function(n,f,l){l(3)},
function(n,f,l){l(3)},function(n,f,l){function h(a,b,d){var c=b[0],k=b[1],g=b[2],e=b[3],h=b[4],f=b[5],m=b[6],l=b[7],D=b[8],t=b[9],n=b[10],C=b[11],A=b[12],I=b[13],w=b[14];b=b[15];var B=d[0],K=d[1],u=d[2],G=d[3];a[0]=B*c+K*h+u*D+G*A;a[1]=B*k+K*f+u*t+G*I;a[2]=B*g+K*m+u*n+G*w;a[3]=B*e+K*l+u*C+G*b;B=d[4];K=d[5];u=d[6];G=d[7];a[4]=B*c+K*h+u*D+G*A;a[5]=B*k+K*f+u*t+G*I;a[6]=B*g+K*m+u*n+G*w;a[7]=B*e+K*l+u*C+G*b;B=d[8];K=d[9];u=d[10];G=d[11];a[8]=B*c+K*h+u*D+G*A;a[9]=B*k+K*f+u*t+G*I;a[10]=B*g+K*m+u*n+G*w;a[11]=
B*e+K*l+u*C+G*b;B=d[12];K=d[13];u=d[14];G=d[15];a[12]=B*c+K*h+u*D+G*A;a[13]=B*k+K*f+u*t+G*I;a[14]=B*g+K*m+u*n+G*w;a[15]=B*e+K*l+u*C+G*b;return a}function e(a,b,d){a[0]=b[0]-d[0];a[1]=b[1]-d[1];a[2]=b[2]-d[2];a[3]=b[3]-d[3];a[4]=b[4]-d[4];a[5]=b[5]-d[5];a[6]=b[6]-d[6];a[7]=b[7]-d[7];a[8]=b[8]-d[8];a[9]=b[9]-d[9];a[10]=b[10]-d[10];a[11]=b[11]-d[11];a[12]=b[12]-d[12];a[13]=b[13]-d[13];a[14]=b[14]-d[14];a[15]=b[15]-d[15];return a}Object.defineProperty(f,"__esModule",{value:!0});f.create=function(){var a=
new c.a(16);a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};f.clone=function(a){var b=new c.a(16);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b};f.copy=function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];a[9]=b[9];a[10]=b[10];a[11]=b[11];
a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return a};f.fromValues=function(a,b,d,p,k,g,e,h,f,m,l,n,t,J,C,A){var r=new c.a(16);r[0]=a;r[1]=b;r[2]=d;r[3]=p;r[4]=k;r[5]=g;r[6]=e;r[7]=h;r[8]=f;r[9]=m;r[10]=l;r[11]=n;r[12]=t;r[13]=J;r[14]=C;r[15]=A;return r};f.set=function(a,b,d,c,k,g,e,h,f,m,l,n,t,J,C,A,I){a[0]=b;a[1]=d;a[2]=c;a[3]=k;a[4]=g;a[5]=e;a[6]=h;a[7]=f;a[8]=m;a[9]=l;a[10]=n;a[11]=t;a[12]=J;a[13]=C;a[14]=A;a[15]=I;return a};f.identity=function(a){a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;
a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};f.transpose=function(a,b){if(a===b){var d=b[1],c=b[2],k=b[3],g=b[6],e=b[7],h=b[11];a[1]=b[4];a[2]=b[8];a[3]=b[12];a[4]=d;a[6]=b[9];a[7]=b[13];a[8]=c;a[9]=g;a[11]=b[14];a[12]=k;a[13]=e;a[14]=h}else a[0]=b[0],a[1]=b[4],a[2]=b[8],a[3]=b[12],a[4]=b[1],a[5]=b[5],a[6]=b[9],a[7]=b[13],a[8]=b[2],a[9]=b[6],a[10]=b[10],a[11]=b[14],a[12]=b[3],a[13]=b[7],a[14]=b[11],a[15]=b[15];return a};f.invert=function(a,b){var d=b[0],c=
b[1],k=b[2],g=b[3],e=b[4],h=b[5],f=b[6],m=b[7],l=b[8],n=b[9],t=b[10],J=b[11],C=b[12],A=b[13],I=b[14];b=b[15];var w=d*h-c*e,B=d*f-k*e,K=d*m-g*e,u=c*f-k*h,G=c*m-g*h,H=k*m-g*f,F=l*A-n*C,z=l*I-t*C,E=l*b-J*C,O=n*I-t*A,N=n*b-J*A,Q=t*b-J*I,L=w*Q-B*N+K*O+u*E-G*z+H*F;if(!L)return null;L=1/L;a[0]=(h*Q-f*N+m*O)*L;a[1]=(k*N-c*Q-g*O)*L;a[2]=(A*H-I*G+b*u)*L;a[3]=(t*G-n*H-J*u)*L;a[4]=(f*E-e*Q-m*z)*L;a[5]=(d*Q-k*E+g*z)*L;a[6]=(I*K-C*H-b*B)*L;a[7]=(l*H-t*K+J*B)*L;a[8]=(e*N-h*E+m*F)*L;a[9]=(c*E-d*N-g*F)*L;a[10]=(C*
G-A*K+b*w)*L;a[11]=(n*K-l*G-J*w)*L;a[12]=(h*z-e*O-f*F)*L;a[13]=(d*O-c*z+k*F)*L;a[14]=(A*B-C*u-I*w)*L;a[15]=(l*u-n*B+t*w)*L;return a};f.adjoint=function(a,b){var d=b[0],c=b[1],k=b[2],g=b[3],e=b[4],h=b[5],f=b[6],m=b[7],l=b[8],n=b[9],t=b[10],J=b[11],C=b[12],A=b[13],I=b[14];b=b[15];a[0]=h*(t*b-J*I)-n*(f*b-m*I)+A*(f*J-m*t);a[1]=-(c*(t*b-J*I)-n*(k*b-g*I)+A*(k*J-g*t));a[2]=c*(f*b-m*I)-h*(k*b-g*I)+A*(k*m-g*f);a[3]=-(c*(f*J-m*t)-h*(k*J-g*t)+n*(k*m-g*f));a[4]=-(e*(t*b-J*I)-l*(f*b-m*I)+C*(f*J-m*t));a[5]=d*(t*
b-J*I)-l*(k*b-g*I)+C*(k*J-g*t);a[6]=-(d*(f*b-m*I)-e*(k*b-g*I)+C*(k*m-g*f));a[7]=d*(f*J-m*t)-e*(k*J-g*t)+l*(k*m-g*f);a[8]=e*(n*b-J*A)-l*(h*b-m*A)+C*(h*J-m*n);a[9]=-(d*(n*b-J*A)-l*(c*b-g*A)+C*(c*J-g*n));a[10]=d*(h*b-m*A)-e*(c*b-g*A)+C*(c*m-g*h);a[11]=-(d*(h*J-m*n)-e*(c*J-g*n)+l*(c*m-g*h));a[12]=-(e*(n*I-t*A)-l*(h*I-f*A)+C*(h*t-f*n));a[13]=d*(n*I-t*A)-l*(c*I-k*A)+C*(c*t-k*n);a[14]=-(d*(h*I-f*A)-e*(c*I-k*A)+C*(c*f-k*h));a[15]=d*(h*t-f*n)-e*(c*t-k*n)+l*(c*f-k*h);return a};f.determinant=function(a){var b=
a[0],d=a[1],c=a[2],k=a[3],g=a[4],e=a[5],h=a[6],f=a[7],m=a[8],l=a[9],n=a[10],t=a[11],J=a[12],C=a[13],A=a[14];a=a[15];return(b*e-d*g)*(n*a-t*A)-(b*h-c*g)*(l*a-t*C)+(b*f-k*g)*(l*A-n*C)+(d*h-c*e)*(m*a-t*J)-(d*f-k*e)*(m*A-n*J)+(c*f-k*h)*(m*C-l*J)};f.multiply=h;f.translate=function(a,b,d){var c=d[0],k=d[1];d=d[2];if(b===a)a[12]=b[0]*c+b[4]*k+b[8]*d+b[12],a[13]=b[1]*c+b[5]*k+b[9]*d+b[13],a[14]=b[2]*c+b[6]*k+b[10]*d+b[14],a[15]=b[3]*c+b[7]*k+b[11]*d+b[15];else{var g=b[0];var e=b[1];var h=b[2];var f=b[3];
var m=b[4];var l=b[5];var n=b[6];var t=b[7];var J=b[8];var C=b[9];var A=b[10];var I=b[11];a[0]=g;a[1]=e;a[2]=h;a[3]=f;a[4]=m;a[5]=l;a[6]=n;a[7]=t;a[8]=J;a[9]=C;a[10]=A;a[11]=I;a[12]=g*c+m*k+J*d+b[12];a[13]=e*c+l*k+C*d+b[13];a[14]=h*c+n*k+A*d+b[14];a[15]=f*c+t*k+I*d+b[15]}return a};f.scale=function(a,b,d){var c=d[0],k=d[1];d=d[2];a[0]=b[0]*c;a[1]=b[1]*c;a[2]=b[2]*c;a[3]=b[3]*c;a[4]=b[4]*k;a[5]=b[5]*k;a[6]=b[6]*k;a[7]=b[7]*k;a[8]=b[8]*d;a[9]=b[9]*d;a[10]=b[10]*d;a[11]=b[11]*d;a[12]=b[12];a[13]=b[13];
a[14]=b[14];a[15]=b[15];return a};f.rotate=function(a,b,d,p){var k=p[0],g=p[1];p=p[2];var e=Math.sqrt(k*k+g*g+p*p);if(Math.abs(e)<c.b)return null;e=1/e;k*=e;g*=e;p*=e;var h=Math.sin(d);var f=Math.cos(d);var m=1-f;d=b[0];e=b[1];var l=b[2];var n=b[3];var t=b[4];var J=b[5];var C=b[6];var A=b[7];var I=b[8];var w=b[9];var B=b[10];var K=b[11];var u=k*k*m+f;var G=g*k*m+p*h;var H=p*k*m-g*h;var F=k*g*m-p*h;var z=g*g*m+f;var E=p*g*m+k*h;var O=k*p*m+g*h;k=g*p*m-k*h;g=p*p*m+f;a[0]=d*u+t*G+I*H;a[1]=e*u+J*G+w*
H;a[2]=l*u+C*G+B*H;a[3]=n*u+A*G+K*H;a[4]=d*F+t*z+I*E;a[5]=e*F+J*z+w*E;a[6]=l*F+C*z+B*E;a[7]=n*F+A*z+K*E;a[8]=d*O+t*k+I*g;a[9]=e*O+J*k+w*g;a[10]=l*O+C*k+B*g;a[11]=n*O+A*k+K*g;b!==a&&(a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]);return a};f.rotateX=function(a,b,d){var c=Math.sin(d);d=Math.cos(d);var k=b[4],g=b[5],e=b[6],h=b[7],f=b[8],m=b[9],l=b[10],n=b[11];b!==a&&(a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]);a[4]=k*d+f*c;a[5]=g*d+m*c;a[6]=e*d+l*c;a[7]=
h*d+n*c;a[8]=f*d-k*c;a[9]=m*d-g*c;a[10]=l*d-e*c;a[11]=n*d-h*c;return a};f.rotateY=function(a,b,d){var c=Math.sin(d);d=Math.cos(d);var k=b[0],g=b[1],e=b[2],h=b[3],f=b[8],m=b[9],l=b[10],n=b[11];b!==a&&(a[4]=b[4],a[5]=b[5],a[6]=b[6],a[7]=b[7],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]);a[0]=k*d-f*c;a[1]=g*d-m*c;a[2]=e*d-l*c;a[3]=h*d-n*c;a[8]=k*c+f*d;a[9]=g*c+m*d;a[10]=e*c+l*d;a[11]=h*c+n*d;return a};f.rotateZ=function(a,b,c){var d=Math.sin(c);c=Math.cos(c);var k=b[0],g=b[1],e=b[2],h=b[3],f=b[4],
m=b[5],l=b[6],n=b[7];b!==a&&(a[8]=b[8],a[9]=b[9],a[10]=b[10],a[11]=b[11],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]);a[0]=k*c+f*d;a[1]=g*c+m*d;a[2]=e*c+l*d;a[3]=h*c+n*d;a[4]=f*c-k*d;a[5]=m*c-g*d;a[6]=l*c-e*d;a[7]=n*c-h*d;return a};f.fromTranslation=function(a,b){a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=b[0];a[13]=b[1];a[14]=b[2];a[15]=1;return a};f.fromScaling=function(a,b){a[0]=b[0];a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=b[1];a[6]=0;a[7]=0;a[8]=0;
a[9]=0;a[10]=b[2];a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};f.fromRotation=function(a,b,d){var e=d[0],k=d[1];d=d[2];var g=Math.sqrt(e*e+k*k+d*d);if(Math.abs(g)<c.b)return null;g=1/g;e*=g;k*=g;d*=g;g=Math.sin(b);b=Math.cos(b);var h=1-b;a[0]=e*e*h+b;a[1]=k*e*h+d*g;a[2]=d*e*h-k*g;a[3]=0;a[4]=e*k*h-d*g;a[5]=k*k*h+b;a[6]=d*k*h+e*g;a[7]=0;a[8]=e*d*h+k*g;a[9]=k*d*h-e*g;a[10]=d*d*h+b;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};f.fromXRotation=function(a,b){var c=Math.sin(b);b=Math.cos(b);a[0]=
1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=b;a[6]=c;a[7]=0;a[8]=0;a[9]=-c;a[10]=b;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};f.fromYRotation=function(a,b){var c=Math.sin(b);b=Math.cos(b);a[0]=b;a[1]=0;a[2]=-c;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=c;a[9]=0;a[10]=b;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};f.fromZRotation=function(a,b){var c=Math.sin(b);b=Math.cos(b);a[0]=b;a[1]=c;a[2]=0;a[3]=0;a[4]=-c;a[5]=b;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};
f.fromRotationTranslation=function(a,b,c){var d=b[0],k=b[1],g=b[2],e=b[3],h=d+d,f=k+k,m=g+g;b=d*h;var l=d*f;d*=m;var n=k*f;k*=m;g*=m;h*=e;f*=e;e*=m;a[0]=1-(n+g);a[1]=l+e;a[2]=d-f;a[3]=0;a[4]=l-e;a[5]=1-(b+g);a[6]=k+h;a[7]=0;a[8]=d+f;a[9]=k-h;a[10]=1-(b+n);a[11]=0;a[12]=c[0];a[13]=c[1];a[14]=c[2];a[15]=1;return a};f.getTranslation=function(a,b){a[0]=b[12];a[1]=b[13];a[2]=b[14];return a};f.getScaling=function(a,b){var c=b[0],e=b[1],k=b[2],g=b[4],h=b[5],f=b[6],l=b[8],m=b[9];b=b[10];a[0]=Math.sqrt(c*
c+e*e+k*k);a[1]=Math.sqrt(g*g+h*h+f*f);a[2]=Math.sqrt(l*l+m*m+b*b);return a};f.getRotation=function(a,b){var c=b[0]+b[5]+b[10];0<c?(c=2*Math.sqrt(c+1),a[3]=.25*c,a[0]=(b[6]-b[9])/c,a[1]=(b[8]-b[2])/c,a[2]=(b[1]-b[4])/c):b[0]>b[5]&b[0]>b[10]?(c=2*Math.sqrt(1+b[0]-b[5]-b[10]),a[3]=(b[6]-b[9])/c,a[0]=.25*c,a[1]=(b[1]+b[4])/c,a[2]=(b[8]+b[2])/c):b[5]>b[10]?(c=2*Math.sqrt(1+b[5]-b[0]-b[10]),a[3]=(b[8]-b[2])/c,a[0]=(b[1]+b[4])/c,a[1]=.25*c,a[2]=(b[6]+b[9])/c):(c=2*Math.sqrt(1+b[10]-b[0]-b[5]),a[3]=(b[1]-
b[4])/c,a[0]=(b[8]+b[2])/c,a[1]=(b[6]+b[9])/c,a[2]=.25*c);return a};f.fromRotationTranslationScale=function(a,b,c,e){var d=b[0],g=b[1],h=b[2],p=b[3],f=d+d,m=g+g,l=h+h;b=d*f;var n=d*m;d*=l;var t=g*m;g*=l;h*=l;f*=p;m*=p;p*=l;l=e[0];var J=e[1];e=e[2];a[0]=(1-(t+h))*l;a[1]=(n+p)*l;a[2]=(d-m)*l;a[3]=0;a[4]=(n-p)*J;a[5]=(1-(b+h))*J;a[6]=(g+f)*J;a[7]=0;a[8]=(d+m)*e;a[9]=(g-f)*e;a[10]=(1-(b+t))*e;a[11]=0;a[12]=c[0];a[13]=c[1];a[14]=c[2];a[15]=1;return a};f.fromRotationTranslationScaleOrigin=function(a,b,
c,e,k){var d=b[0],h=b[1],p=b[2],f=b[3],m=d+d,l=h+h,n=p+p;b=d*m;var t=d*l;d*=n;var J=h*l;h*=n;p*=n;m*=f;l*=f;f*=n;n=e[0];var C=e[1];e=e[2];var A=k[0],I=k[1];k=k[2];a[0]=(1-(J+p))*n;a[1]=(t+f)*n;a[2]=(d-l)*n;a[3]=0;a[4]=(t-f)*C;a[5]=(1-(b+p))*C;a[6]=(h+m)*C;a[7]=0;a[8]=(d+l)*e;a[9]=(h-m)*e;a[10]=(1-(b+J))*e;a[11]=0;a[12]=c[0]+A-(a[0]*A+a[4]*I+a[8]*k);a[13]=c[1]+I-(a[1]*A+a[5]*I+a[9]*k);a[14]=c[2]+k-(a[2]*A+a[6]*I+a[10]*k);a[15]=1;return a};f.fromQuat=function(a,b){var c=b[0],e=b[1],k=b[2];b=b[3];var g=
c+c,h=e+e,f=k+k;c*=g;var l=e*g;e*=h;var m=k*g,n=k*h;k*=f;g*=b;h*=b;b*=f;a[0]=1-e-k;a[1]=l+b;a[2]=m-h;a[3]=0;a[4]=l-b;a[5]=1-c-k;a[6]=n+g;a[7]=0;a[8]=m+h;a[9]=n-g;a[10]=1-c-e;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a};f.frustum=function(a,b,c,e,k,g,h){var d=1/(c-b),p=1/(k-e),m=1/(g-h);a[0]=2*g*d;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=2*g*p;a[6]=0;a[7]=0;a[8]=(c+b)*d;a[9]=(k+e)*p;a[10]=(h+g)*m;a[11]=-1;a[12]=0;a[13]=0;a[14]=h*g*2*m;a[15]=0;return a};f.perspective=function(a,b,c,e,k){b=1/Math.tan(b/
2);var d=1/(e-k);a[0]=b/c;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=b;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=(k+e)*d;a[11]=-1;a[12]=0;a[13]=0;a[14]=2*k*e*d;a[15]=0;return a};f.perspectiveFromFieldOfView=function(a,b,c,e){var d=Math.tan(b.upDegrees*Math.PI/180),g=Math.tan(b.downDegrees*Math.PI/180),h=Math.tan(b.leftDegrees*Math.PI/180);b=Math.tan(b.rightDegrees*Math.PI/180);var p=2/(h+b),f=2/(d+g);a[0]=p;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=f;a[6]=0;a[7]=0;a[8]=-((h-b)*p*.5);a[9]=(d-g)*f*.5;a[10]=e/(c-e);a[11]=-1;a[12]=
0;a[13]=0;a[14]=e*c/(c-e);a[15]=0;return a};f.ortho=function(a,b,c,e,k,g,h){var d=1/(b-c),p=1/(e-k),m=1/(g-h);a[0]=-2*d;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=-2*p;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=2*m;a[11]=0;a[12]=(b+c)*d;a[13]=(k+e)*p;a[14]=(h+g)*m;a[15]=1;return a};f.lookAt=function(a,b,d,e){var k=b[0],g=b[1];b=b[2];var h=e[0];var p=e[1];var f=e[2];var m=d[0];e=d[1];var l=d[2];if(Math.abs(k-m)<c.b&&Math.abs(g-e)<c.b&&Math.abs(b-l)<c.b)return mat4.identity(a);d=k-m;e=g-e;m=b-l;var n=1/Math.sqrt(d*d+
e*e+m*m);d*=n;e*=n;m*=n;l=p*m-f*e;f=f*d-h*m;h=h*e-p*d;(n=Math.sqrt(l*l+f*f+h*h))?(n=1/n,l*=n,f*=n,h*=n):h=f=l=0;p=e*h-m*f;var t=m*l-d*h;var J=d*f-e*l;(n=Math.sqrt(p*p+t*t+J*J))?(n=1/n,p*=n,t*=n,J*=n):J=t=p=0;a[0]=l;a[1]=p;a[2]=d;a[3]=0;a[4]=f;a[5]=t;a[6]=e;a[7]=0;a[8]=h;a[9]=J;a[10]=m;a[11]=0;a[12]=-(l*k+f*g+h*b);a[13]=-(p*k+t*g+J*b);a[14]=-(d*k+e*g+m*b);a[15]=1;return a};f.targetTo=function(a,b,c,e){var d=b[0],g=b[1];b=b[2];var h=e[0],f=e[1],p=e[2];e=d-c[0];var m=g-c[1];c=b-c[2];var l=e*e+m*m+c*
c;0<l&&(l=1/Math.sqrt(l),e*=l,m*=l,c*=l);l=f*c-p*m;p=p*e-h*c;h=h*m-f*e;a[0]=l;a[1]=p;a[2]=h;a[3]=0;a[4]=m*h-c*p;a[5]=c*l-e*h;a[6]=e*p-m*l;a[7]=0;a[8]=e;a[9]=m;a[10]=c;a[11]=0;a[12]=d;a[13]=g;a[14]=b;a[15]=1;return a};f.str=function(a){return"mat4("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+")"};f.frob=function(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)+Math.pow(a[2],2)+
Math.pow(a[3],2)+Math.pow(a[4],2)+Math.pow(a[5],2)+Math.pow(a[6],2)+Math.pow(a[7],2)+Math.pow(a[8],2)+Math.pow(a[9],2)+Math.pow(a[10],2)+Math.pow(a[11],2)+Math.pow(a[12],2)+Math.pow(a[13],2)+Math.pow(a[14],2)+Math.pow(a[15],2))};f.add=function(a,b,c){a[0]=b[0]+c[0];a[1]=b[1]+c[1];a[2]=b[2]+c[2];a[3]=b[3]+c[3];a[4]=b[4]+c[4];a[5]=b[5]+c[5];a[6]=b[6]+c[6];a[7]=b[7]+c[7];a[8]=b[8]+c[8];a[9]=b[9]+c[9];a[10]=b[10]+c[10];a[11]=b[11]+c[11];a[12]=b[12]+c[12];a[13]=b[13]+c[13];a[14]=b[14]+c[14];a[15]=b[15]+
c[15];return a};f.subtract=e;f.multiplyScalar=function(a,b,c){a[0]=b[0]*c;a[1]=b[1]*c;a[2]=b[2]*c;a[3]=b[3]*c;a[4]=b[4]*c;a[5]=b[5]*c;a[6]=b[6]*c;a[7]=b[7]*c;a[8]=b[8]*c;a[9]=b[9]*c;a[10]=b[10]*c;a[11]=b[11]*c;a[12]=b[12]*c;a[13]=b[13]*c;a[14]=b[14]*c;a[15]=b[15]*c;return a};f.multiplyScalarAndAdd=function(a,b,c,e){a[0]=b[0]+c[0]*e;a[1]=b[1]+c[1]*e;a[2]=b[2]+c[2]*e;a[3]=b[3]+c[3]*e;a[4]=b[4]+c[4]*e;a[5]=b[5]+c[5]*e;a[6]=b[6]+c[6]*e;a[7]=b[7]+c[7]*e;a[8]=b[8]+c[8]*e;a[9]=b[9]+c[9]*e;a[10]=b[10]+c[10]*
e;a[11]=b[11]+c[11]*e;a[12]=b[12]+c[12]*e;a[13]=b[13]+c[13]*e;a[14]=b[14]+c[14]*e;a[15]=b[15]+c[15]*e;return a};f.exactEquals=function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]&&a[4]===b[4]&&a[5]===b[5]&&a[6]===b[6]&&a[7]===b[7]&&a[8]===b[8]&&a[9]===b[9]&&a[10]===b[10]&&a[11]===b[11]&&a[12]===b[12]&&a[13]===b[13]&&a[14]===b[14]&&a[15]===b[15]};f.equals=function(a,b){var d=a[0],e=a[1],k=a[2],g=a[3],h=a[4],f=a[5],l=a[6],m=a[7],n=a[8],D=a[9],t=a[10],J=a[11],C=a[12],A=a[13],I=a[14];
a=a[15];var w=b[0],B=b[1],K=b[2],u=b[3],G=b[4],H=b[5],F=b[6],z=b[7],E=b[8],O=b[9],N=b[10],Q=b[11],L=b[12],y=b[13],M=b[14];b=b[15];return Math.abs(d-w)<=c.b*Math.max(1,Math.abs(d),Math.abs(w))&&Math.abs(e-B)<=c.b*Math.max(1,Math.abs(e),Math.abs(B))&&Math.abs(k-K)<=c.b*Math.max(1,Math.abs(k),Math.abs(K))&&Math.abs(g-u)<=c.b*Math.max(1,Math.abs(g),Math.abs(u))&&Math.abs(h-G)<=c.b*Math.max(1,Math.abs(h),Math.abs(G))&&Math.abs(f-H)<=c.b*Math.max(1,Math.abs(f),Math.abs(H))&&Math.abs(l-F)<=c.b*Math.max(1,
Math.abs(l),Math.abs(F))&&Math.abs(m-z)<=c.b*Math.max(1,Math.abs(m),Math.abs(z))&&Math.abs(n-E)<=c.b*Math.max(1,Math.abs(n),Math.abs(E))&&Math.abs(D-O)<=c.b*Math.max(1,Math.abs(D),Math.abs(O))&&Math.abs(t-N)<=c.b*Math.max(1,Math.abs(t),Math.abs(N))&&Math.abs(J-Q)<=c.b*Math.max(1,Math.abs(J),Math.abs(Q))&&Math.abs(C-L)<=c.b*Math.max(1,Math.abs(C),Math.abs(L))&&Math.abs(A-y)<=c.b*Math.max(1,Math.abs(A),Math.abs(y))&&Math.abs(I-M)<=c.b*Math.max(1,Math.abs(I),Math.abs(M))&&Math.abs(a-b)<=c.b*Math.max(1,
Math.abs(a),Math.abs(b))};var c=l(3);f.mul=h;f.sub=e},function(n,f,l){function h(){var a=new d.a(4);a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}function e(a,b,c){c*=.5;var d=Math.sin(c);a[0]=d*b[0];a[1]=d*b[1];a[2]=d*b[2];a[3]=Math.cos(c);return a}function c(a,b,c){var d=b[0],k=b[1],g=b[2];b=b[3];var e=c[0],h=c[1],f=c[2];c=c[3];a[0]=d*c+b*e+k*f-g*h;a[1]=k*c+b*h+g*e-d*f;a[2]=g*c+b*f+d*h-k*e;a[3]=b*c-d*e-k*h-g*f;return a}function a(a,b,c,d){var k=b[0],g=b[1],e=b[2];b=b[3];var h=c[0],m=c[1],f=c[2];c=c[3];var p=
k*h+g*m+e*f+b*c;0>p&&(p=-p,h=-h,m=-m,f=-f,c=-c);if(1E-6<1-p){var w=Math.acos(p);var l=Math.sin(w);p=Math.sin((1-d)*w)/l;d=Math.sin(d*w)/l}else p=1-d;a[0]=p*k+d*h;a[1]=p*g+d*m;a[2]=p*e+d*f;a[3]=p*b+d*c;return a}function b(a,b){var c=b[0]+b[4]+b[8];if(0<c)c=Math.sqrt(c+1),a[3]=.5*c,c=.5/c,a[0]=(b[5]-b[7])*c,a[1]=(b[6]-b[2])*c,a[2]=(b[1]-b[3])*c;else{var d=0;b[4]>b[0]&&(d=1);b[8]>b[3*d+d]&&(d=2);var k=(d+1)%3,g=(d+2)%3;c=Math.sqrt(b[3*d+d]-b[3*k+k]-b[3*g+g]+1);a[d]=.5*c;c=.5/c;a[3]=(b[3*k+g]-b[3*g+k])*
c;a[k]=(b[3*k+d]+b[3*d+k])*c;a[g]=(b[3*g+d]+b[3*d+g])*c}return a}Object.defineProperty(f,"__esModule",{value:!0});f.create=h;f.identity=function(a){a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};f.setAxisAngle=e;f.getAxisAngle=function(a,b){var c=2*Math.acos(b[3]),d=Math.sin(c/2);0!=d?(a[0]=b[0]/d,a[1]=b[1]/d,a[2]=b[2]/d):(a[0]=1,a[1]=0,a[2]=0);return c};f.multiply=c;f.rotateX=function(a,b,c){c*=.5;var d=b[0],k=b[1],g=b[2];b=b[3];var e=Math.sin(c);c=Math.cos(c);a[0]=d*c+b*e;a[1]=k*c+g*e;a[2]=g*c-k*e;a[3]=
b*c-d*e;return a};f.rotateY=function(a,b,c){c*=.5;var d=b[0],k=b[1],g=b[2];b=b[3];var e=Math.sin(c);c=Math.cos(c);a[0]=d*c-g*e;a[1]=k*c+b*e;a[2]=g*c+d*e;a[3]=b*c-k*e;return a};f.rotateZ=function(a,b,c){c*=.5;var d=b[0],k=b[1],g=b[2];b=b[3];var e=Math.sin(c);c=Math.cos(c);a[0]=d*c+k*e;a[1]=k*c-d*e;a[2]=g*c+b*e;a[3]=b*c-g*e;return a};f.calculateW=function(a,b){var c=b[0],d=b[1];b=b[2];a[0]=c;a[1]=d;a[2]=b;a[3]=Math.sqrt(Math.abs(1-c*c-d*d-b*b));return a};f.slerp=a;f.invert=function(a,b){var c=b[0],
d=b[1],k=b[2];b=b[3];var g=c*c+d*d+k*k+b*b;g=g?1/g:0;a[0]=-c*g;a[1]=-d*g;a[2]=-k*g;a[3]=b*g;return a};f.conjugate=function(a,b){a[0]=-b[0];a[1]=-b[1];a[2]=-b[2];a[3]=b[3];return a};f.fromMat3=b;f.fromEuler=function(a,b,c,d){var k=.5*Math.PI/180;b*=k;c*=k;d*=k;k=Math.sin(b);b=Math.cos(b);var g=Math.sin(c);c=Math.cos(c);var e=Math.sin(d);d=Math.cos(d);a[0]=k*c*d-b*g*e;a[1]=b*g*d+k*c*e;a[2]=b*c*e-k*g*d;a[3]=b*c*d+k*g*e;return a};f.str=function(a){return"quat("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"};
var d=l(3),p=l(32),k=l(33);n=l(34);f.clone=n.b;f.fromValues=n.g;f.copy=n.c;f.set=n.l;f.add=n.a;f.mul=c;f.scale=n.k;f.dot=n.d;f.lerp=n.i;l=n.h;f.length=l;f.len=l;l=n.m;f.squaredLength=l;f.sqrLen=l;var g=n.j;f.normalize=g;f.exactEquals=n.f;f.equals=n.e;n=function(){var a=k.create(),b=k.fromValues(1,0,0),c=k.fromValues(0,1,0);return function(d,h,f){var m=k.dot(h,f);if(-.999999>m)return k.cross(a,b,h),1E-6>k.len(a)&&k.cross(a,c,h),k.normalize(a,a),e(d,a,Math.PI),d;if(.999999<m)return d[0]=0,d[1]=0,d[2]=
0,d[3]=1,d;k.cross(a,h,f);d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=1+m;return g(d,d)}}();f.rotationTo=n;n=function(){var b=h(),c=h();return function(d,k,g,e,h,f){a(b,k,h,f);a(c,g,e,f);a(d,b,c,2*f*(1-f));return d}}();f.sqlerp=n;n=function(){var a=p.a();return function(c,d,k,e){a[0]=k[0];a[3]=k[1];a[6]=k[2];a[1]=e[0];a[4]=e[1];a[7]=e[2];a[2]=-d[0];a[5]=-d[1];a[8]=-d[2];return g(c,b(c,a))}}();f.setAxes=n},function(n,f,l){function h(){var c=new e.a(2);c[0]=0;c[1]=0;return c}var e=l(3);(function(){var c=h();
return function(a,b,d,e,k,g){b||(b=2);d||(d=0);for(e=e?Math.min(e*b+d,a.length):a.length;d<e;d+=b)c[0]=a[d],c[1]=a[d+1],k(c,c,g),a[d]=c[0],a[d+1]=c[1];return a}})()},function(n,f,l){var h=function(){function e(c,a){for(var b=0;b<a.length;b++){var d=a[b];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(c,d.key,d)}}return function(c,a,b){a&&e(c.prototype,a);b&&e(c,b);return c}}();n=function(){function e(c){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");
this.compare=c}h(e,[{key:"meld",value:function(c,a){if(null===a)return c;if(null===c)return a;var b=this.compare;b(a,c)&&(b=c,c=a,a=b);b=c.child0;a.next0=b;a.prev0=c;null!==b&&(b.prev0=a);c.child0=a;return c}},{key:"combineChildren",value:function(c){var a=c.child0;if(null===a)return null;for(c=null;;){var b=a.next0;if(null===b)var d=null;else d=b.next0,a=this.meld(a,b);a.next0=c;c=a;if(null===d)break;a=d}d=c;for(c=c.next0;null!==c;)a=c.next0,d=this.meld(d,c),c=a;d.prev0=null;d.next0=null;return d}},
{key:"removeMin",value:function(c){var a=this.combineChildren(c);c.next0=null;c.prev0=null;c.child0=null;return a}},{key:"remove",value:function(c,a){if(c===a)return this.removeMin(c);var b=a.prev0,d=a.next0;b.child0===a?b.child0=d:b.next0=d;null!==d&&(d.prev0=b);c=this.meld(c,this.combineChildren(a));a.next0=null;a.prev0=null;a.child0=null;return c}},{key:"entries",value:function(c){function a(a,f){for(;;)switch(b){case 0:if(null===c){b=1;break}g=c.child0;b=2;return{value:c,done:!1};case 2:if(void 0===
f){b=3;break}b=-1;throw f;case 3:case 4:if(null===g){b=5;break}k=g.next0;e=$jscomp.makeIterator(h.entries(g));case 6:if((d=e.next(a)).done){b=7;break}b=8;return{value:d.value,done:!1};case 8:if(void 0===f){b=9;break}b=-1;throw f;case 9:b=6;break;case 7:g=k;b=4;break;case 5:case 1:b=-1;default:return{value:void 0,done:!0}}}var b=0,d,e,k,g,h=this,f={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();
f[Symbol.iterator]=function(){return this};return f}},{key:"removedEntries",value:function(c){function a(a,f){for(;;)switch(b){case 0:if(null===c){b=1;break}g=c.child0;c.child0=null;c.next0=null;c.prev0=null;b=2;return{value:c,done:!1};case 2:if(void 0===f){b=3;break}b=-1;throw f;case 3:case 4:if(null===g){b=5;break}k=g.next0;g.child0=null;g.next0=null;g.prev0=null;e=$jscomp.makeIterator(h.entries(g));case 6:if((d=e.next(a)).done){b=7;break}b=8;return{value:d.value,done:!1};case 8:if(void 0===f){b=
9;break}b=-1;throw f;case 9:b=6;break;case 7:g=k;b=4;break;case 5:case 1:b=-1;default:return{value:void 0,done:!0}}}var b=0,d,e,k,g,h=this,f={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();f[Symbol.iterator]=function(){return this};return f}}]);return e}();f.a=n},function(n,f,l){var h=function(){function e(c,a){for(var b=0;b<a.length;b++){var d=a[b];d.enumerable=d.enumerable||!1;d.configurable=
!0;"value"in d&&(d.writable=!0);Object.defineProperty(c,d.key,d)}}return function(c,a,b){a&&e(c.prototype,a);b&&e(c,b);return c}}();n=function(){function e(c){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.compare=c}h(e,[{key:"meld",value:function(c,a){if(null===a)return c;if(null===c)return a;var b=this.compare;b(a,c)&&(b=c,c=a,a=b);b=c.child1;a.next1=b;a.prev1=c;null!==b&&(b.prev1=a);c.child1=a;return c}},{key:"combineChildren",value:function(c){var a=c.child1;
if(null===a)return null;for(c=null;;){var b=a.next1;if(null===b)var d=null;else d=b.next1,a=this.meld(a,b);a.next1=c;c=a;if(null===d)break;a=d}d=c;for(c=c.next1;null!==c;)a=c.next1,d=this.meld(d,c),c=a;d.prev1=null;d.next1=null;return d}},{key:"removeMin",value:function(c){var a=this.combineChildren(c);c.next1=null;c.prev1=null;c.child1=null;return a}},{key:"remove",value:function(c,a){if(c===a)return this.removeMin(c);var b=a.prev1,d=a.next1;b.child1===a?b.child1=d:b.next1=d;null!==d&&(d.prev1=b);
c=this.meld(c,this.combineChildren(a));a.next1=null;a.prev1=null;a.child1=null;return c}},{key:"entries",value:function(c){function a(a,f){for(;;)switch(b){case 0:if(null===c){b=1;break}g=c.child1;b=2;return{value:c,done:!1};case 2:if(void 0===f){b=3;break}b=-1;throw f;case 3:case 4:if(null===g){b=5;break}k=g.next1;e=$jscomp.makeIterator(h.entries(g));case 6:if((d=e.next(a)).done){b=7;break}b=8;return{value:d.value,done:!1};case 8:if(void 0===f){b=9;break}b=-1;throw f;case 9:b=6;break;case 7:g=k;
b=4;break;case 5:case 1:b=-1;default:return{value:void 0,done:!0}}}var b=0,d,e,k,g,h=this,f={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();f[Symbol.iterator]=function(){return this};return f}},{key:"removedEntries",value:function(c){function a(a,f){for(;;)switch(b){case 0:if(null===c){b=1;break}g=c.child1;c.child1=null;c.next1=null;c.prev1=null;b=2;return{value:c,done:!1};case 2:if(void 0===
f){b=3;break}b=-1;throw f;case 3:case 4:if(null===g){b=5;break}k=g.next1;g.child1=null;g.next1=null;g.prev1=null;e=$jscomp.makeIterator(h.entries(g));case 6:if((d=e.next(a)).done){b=7;break}b=8;return{value:d.value,done:!1};case 8:if(void 0===f){b=9;break}b=-1;throw f;case 9:b=6;break;case 7:g=k;b=4;break;case 5:case 1:b=-1;default:return{value:void 0,done:!0}}}var b=0,d,e,k,g,h=this,f={next:function(b){return a(b,void 0)},throw:function(b){return a(void 0,b)},return:function(a){throw Error("Not yet implemented");
}};$jscomp.initSymbolIterator();f[Symbol.iterator]=function(){return this};return f}}]);return e}();f.a=n},function(n,f,l){l.d(f,"a",function(){return b});var h=l(1),e=l(4),c=l(13),a=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),b=function(){function b(a){a=void 0===a?h.h.create():a;if(!(this instanceof
b))throw new TypeError("Cannot call a class as a function");this.transform=a;this.changed=new c.a}a(b,[{key:"reset",value:function(){h.h.copy(this.transform,h.c);this.changed.dispatch()}},{key:"toJSON",value:function(){if(!h.h.equals(h.c,this.transform)){var a=this.transform;return[[a[0],a[4],a[8],a[12]],[a[1],a[5],a[9],a[13]],[a[2],a[6],a[10],a[14]],[a[3],a[7],a[11],a[15]]]}}},{key:"restoreState",value:function(a){if(null==a)this.reset();else if(Array.isArray(a))if(4===a.length)try{for(var b=0;4>
b;++b)Object(e.b)(this.transform.subarray(4*b,4*(b+1)),a[b]);h.h.transpose(this.transform,this.transform)}catch(r){this.reset()}else if(16===a.length)try{Object(e.b)(this.transform,a),h.h.transpose(this.transform,this.transform)}catch(r){this.reset()}else this.reset();else if("object"===typeof a){b=h.j.create();var c=h.m.create(),d=h.m.fromValues(1,1,1);try{Object(e.b)(b,a.rotation),h.j.normalize(b,b)}catch(r){h.j.identity(b)}try{Object(e.b)(c,a.translation)}catch(r){h.m.copy(c,h.g)}try{Object(e.b)(d,
a.scale)}catch(r){h.m.copy(d,h.f)}h.h.fromRotationTranslationScale(this.transform,b,c,d);this.changed.dispatch()}else this.reset()}},{key:"clone",value:function(){return new b(h.h.clone(this.transform))}}]);return b}()},function(n,f,l){l.d(f,"a",function(){return c});var h=l(1),e=function(){function a(a,c){for(var b=0;b<c.length;b++){var d=c[b];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,e){c&&a(b.prototype,c);
e&&a(b,e);return b}}(),c=function(){function a(b,c){c=void 0===c?h.c:c;if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");this.size=h.m.clone(b);this.transform=h.h.clone(c);this.invTransform=h.h.invert(h.h.create(),c)}e(a,[{key:"toObject",value:function(a){a.size=this.size;a.transform=this.transform}},{key:"localSpatialToGlobal",value:function(a,c){return h.m.transformMat4(a,c,this.transform)}},{key:"globalToLocalSpatial",value:function(a,c){return h.m.transformMat4(a,
c,this.invTransform)}},{key:"globalToLocalGrid",value:function(a,c){this.globalToLocalSpatial(a,c);h.m.divide(a,a,this.size);return a}},{key:"localSpatialVectorToGlobal",value:function(a,c){return Object(h.l)(a,c,this.transform)}},{key:"globalToLocalSpatialVector",value:function(a,c){return Object(h.l)(a,c,this.invTransform)}},{key:"assignLocalSpatialToGlobalMat4",value:function(a){return h.h.copy(a,this.transform)}}],[{key:"get",value:function(b,c){c=void 0===c?h.c:c;var d=a.cache,k=JSON.stringify([Array.from(b),
Array.from(c)]),g=d.get(k);void 0===g&&(g=new a(b,c),d.set(k,g));return g}},{key:"fromObject",value:function(b){return a.get(b.size,b.transform)}}]);return a}();c.cache=new Map},function(n,f,l){f.a=function(h,e){return h===e?!0:1E-6>Math.abs(h-e)/Math.min(Math.abs(h),Math.abs(e))}},function(n,f,l){function h(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,
enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var e=l(63);n=l(0);var c=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),a=function p(a,b,c){null===a&&(a=Function.prototype);var k=Object.getOwnPropertyDescriptor(a,b);if(void 0===k){if(a=Object.getPrototypeOf(a),
null!==a)return p(a,b,c)}else{if("value"in k)return k.value;b=k.get;return void 0===b?void 0:b.call(c)}};f=this&&this.__decorate||function(a,b,c,e){var k=arguments.length,g=3>k?b:null===e?e=Object.getOwnPropertyDescriptor(b,c):e,h;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(a,b,c,e);else for(var f=a.length-1;0<=f;f--)if(h=a[f])g=(3>k?h(g):3<k?h(b,c,g):h(b,c))||g;return 3<k&&g&&Object.defineProperty(b,c,g),g};l=b=function(f){function k(a,b){b=void 0===b?{}:
b;if(!(this instanceof k))throw new TypeError("Cannot call a class as a function");var c=(k.__proto__||Object.getPrototypeOf(k)).call(this,a,b);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");c=!c||"object"!==typeof c&&"function"!==typeof c?this:c;c.updatingValue_=!1;void 0!==a&&(c.base=new e.a(b.value),c.setupChangedHandler());return c}h(k,f);c(k,[{key:"initializeCounterpart",value:function(b,c){c=void 0===c?{}:c;c.value=this.value;a(k.prototype.__proto__||
Object.getPrototypeOf(k.prototype),"initializeCounterpart",this).call(this,b,c)}},{key:"setupChangedHandler",value:function(){var a=this;this.registerDisposer(this.base.changed.add(function(){if(a.updatingValue_)a.updatingValue_=!1;else{var b=a.rpc;null!==b&&b.invoke("SharedWatchableValue.changed",{id:a.rpcId,value:a.value})}}))}},{key:"value",get:function(){return this.base.value},set:function(a){this.base.value=a}},{key:"changed",get:function(){return this.base.changed}}],[{key:"makeFromExisting",
value:function(a,c){var k=new b;k.base=c;k.setupChangedHandler();k.initializeCounterpart(a);return k}},{key:"make",value:function(a,c){return b.makeFromExisting(a,new e.a(c))}}]);return k}(n.c);l=b=f([Object(n.g)("SharedWatchableValue")],l);Object(n.f)("SharedWatchableValue.changed",function(a){var b=this.get(a.id);b.updatingValue_=!0;b.base.value=a.value;b.updatingValue_=!1});var b},function(n,f,l){function h(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function e(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}l.d(f,"a",function(){return d});n=
l(16);var a=l(13),b=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),d=function(){function d(b){c(this,d);this.value_=b;this.changed=new a.a}b(d,[{key:"value",get:function(){return this.value_},set:function(a){a!==this.value_&&(this.value_=a,this.changed.dispatch())}}]);return d}();(function(a){function d(a,
b,k){k=void 0===k?a:k;c(this,d);a=h(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,a));a.validator=b;a.defaultValue=k;return a}e(d,a);b(d,[{key:"toJSON",value:function(){if(this.value_!==this.defaultValue)return this.value_}},{key:"reset",value:function(){this.value=this.defaultValue}},{key:"restoreState",value:function(a){if(void 0!==a){var b=this.validator;try{this.value=b(a);return}catch(r){}}this.value=this.defaultValue}}]);return d})(d);(function(d){function k(b,d){c(this,k);var e=h(this,
(k.__proto__||Object.getPrototypeOf(k)).call(this));e.changed=new a.a;e.f=b;e.ws=d;b=$jscomp.makeIterator(d);for(d=b.next();!d.done;d=b.next())e.registerDisposer(d.value.changed.add(e.changed.dispatch));return e}e(k,d);b(k,[{key:"value",get:function(){return this.f.apply(this,[].concat($jscomp.arrayFromIterable(this.ws.map(function(a){return a.value}))))}}]);return k})(n.a)},function(n,f,l){function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function e(a,
b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function a(a,b){a&&(b.change_spec=
{change_stack_id:a.changeStackId},a.timeStamp&&(b.change_spec.time_stamp=a.timeStamp),a.skipEquivalences&&(b.change_spec.skip_equivalences=a.skipEquivalences))}function b(a,b){return Object(q.WithParameters)(Object(r.a)()(a),b)}function d(a,b){Object(v.c)(a,b,"fragmentKey");a.clipBounds&&(a.fragmentIds=p(a.fragmentIds,a.clipBounds));return a}function p(a,b){b;if(!a)return a;var c=[];a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=A.m.clone([500,500,500]),g=d;var h=
e;var f=new w.a;if(!f.tryParseString(g,16))throw Error("Couldn't parse fragmentId "+g+" as hex-encoded Uint64");if(f.high)throw Error("Fragment ids > 2^32 not supported yet");g=Object(A.a)(f);f=A.m.create();h=A.m.mul(f,g,h);g=A.m.create();A.m.scale(g,e,.5);f=A.m.create();A.m.add(f,h,g);k({center:f,size:e},b)&&c.push(d)}return c}function k(a,b){function c(a,b,c){return[].concat($jscomp.arrayFromIterable(a.map(function(a,d){return a+c*b[d]/2}).values()))}function d(a){return{min:A.m.clone(c(a.center,
a.size,-1)),max:A.m.clone(c(a.center,a.size,1))}}a=d(a);b=d(b);return a.min[0]<=b.max[0]&&a.max[0]>=b.min[0]&&a.min[1]<=b.max[1]&&a.max[1]>=b.min[1]&&a.min[2]<=b.max[2]&&a.max[2]>=b.min[2]}function g(a,b){Object(I.f)(b);var c=Object(I.g)(b,"fragmentKey",I.i);b=Object(I.g)(b,"supervoxelId",I.i);if(c.length!==b.length)throw Error("Expected fragmentKey and supervoxelId arrays to have the same length.");a.fragmentIds=b.map(function(a,b){return a+"\x00"+c[b]});a.clipBounds&&(a.fragmentIds=p(a.fragmentIds,
a.clipBounds))}Object.defineProperty(f,"__esModule",{value:!0});l.d(f,"BrainmapsVolumeChunkSource",function(){return G});l.d(f,"BrainmapsMeshSource",function(){return H});l.d(f,"BrainmapsSkeletonSource",function(){return F});var q=l(2),r=l(65),x=l(68),m=l(70),v=l(18),D=l(36);n=l(24);f=l(15);var t=l(19),J=l(10),C=l(9),A=l(1),I=l(4),w=l(6);l=l(0);var B=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,
d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),K=this&&this.__decorate||function(a,b,c,d){var k=arguments.length,e=3>k?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)e=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)if(g=a[h])e=(3>k?g(e):3<k?g(b,c,e):g(b,c))||e;return 3<k&&e&&Object.defineProperty(b,c,e),e},u=new Map([[m.c.RAW,t.a],[m.c.JPEG,f.a],[m.c.COMPRESSED_SEGMENTATION,n.a]]),
G=function(b){function d(){h(this,d);var a=e(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments));a.chunkDecoder=u.get(a.parameters.encoding);return a}c(d,b);B(d,[{key:"applyEncodingParams",value:function(a){var b=this.parameters.encoding;switch(b){case m.c.RAW:a.subvolume_format="RAW";break;case m.c.JPEG:a.subvolume_format="SINGLE_IMAGE";a.image_format_options={image_format:"JPEG",jpeg_quality:70};break;case m.c.COMPRESSED_SEGMENTATION:a.subvolume_format="RAW";a.image_format_options=
{compressed_segmentation_block_size:Object(A.n)(this.spec.compressedSegmentationBlockSize)};break;default:throw Error("Invalid encoding: "+b);}}},{key:"download",value:function(b,c){var d=this,k=this.parameters,e=this.computeChunkBounds(b),g=b.chunkDataSize;var h="/v1/volumes/"+k.volumeId+"/subvolume:binary";e={geometry:{corner:Object(A.n)(e),size:Object(A.n)(g),scale:k.scaleIndex}};this.applyEncodingParams(e);a(k.changeSpec,e);h={method:"POST",payload:JSON.stringify(e),path:h,responseType:"arraybuffer"};
return Object(x.a)(k.instance,this.credentialsProvider,h,c).then(function(a){return d.chunkDecoder(b,a)})}}]);return d}(b(J.a,m.d));G=K([Object(l.g)()],G);var H=function(b){function k(){h(this,k);var a=e(this,(k.__proto__||Object.getPrototypeOf(k)).apply(this,arguments));a.manifestDecoder=void 0!==a.parameters.changeSpec?g:d;var b=a.parameters.changeSpec;b=void 0!==b?"&header.changeStackId="+b.changeStackId+"&return_supervoxel_ids=true":"";a.listFragmentsParams=b;return a}c(k,b);B(k,[{key:"download",
value:function(a,b){var c=this,d=this.parameters;return Object(x.a)(d.instance,this.credentialsProvider,{method:"GET",path:"/v1/objects/"+d.volumeId+"/meshes/"+(d.meshName+":listfragments?object_id="+a.objectId)+this.listFragmentsParams,responseType:"json"},b).then(function(b){return c.manifestDecoder(a,b)})}},{key:"downloadFragment",value:function(b,c){var d=this.parameters,k=b.fragmentId;if(void 0!==d.changeSpec){var e=k.indexOf("\x00");var g=k.substring(0,e);k=k.substring(e+1)}else g=b.manifestChunk.objectId.toString();
e="/v1/objects/"+d.volumeId+("/meshes/"+d.meshName)+"/fragment:binary";g={fragment_key:k,object_id:g};a(d.changeSpec,g);g={method:"POST",path:e,payload:JSON.stringify(g),responseType:"arraybuffer"};return Object(x.a)(d.instance,this.credentialsProvider,g,c).then(function(a){var c=new DataView(a),d=c.getUint32(0,!0);if(0!==c.getUint32(4,!0))throw Error("The number of vertices should not exceed 2^32-1.");Object(v.d)(b,a,C.b.LITTLE,8,d)})}}]);return k}(b(v.a,m.a));H=K([Object(l.g)()],H);var F=function(b){function d(){h(this,
d);return e(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}c(d,b);B(d,[{key:"download",value:function(b,c){var d=this.parameters,k={object_id:""+b.objectId},e="/v1/objects/"+d.volumeId+("/meshes/"+d.meshName)+"/skeleton:binary";a(d.changeSpec,k);k={method:"POST",path:e,payload:JSON.stringify(k),responseType:"arraybuffer"};return Object(x.a)(d.instance,this.credentialsProvider,k,c).then(function(a){var c=new DataView(a),d=c.getUint32(0,!0);if(0!==c.getUint32(4,!0))throw Error("The number of vertices should not exceed 2^32-1.");
var k=c.getUint32(8,!0);if(0!==c.getUint32(12,!0))throw Error("The number of edges should not exceed 2^32-1.");Object(D.b)(b,a,C.b.LITTLE,16,d,void 0,k)})}}]);return d}(b(D.a,m.b));F=K([Object(l.g)()],F)},function(n,f,l){function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==
typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}f.a=function(){return function(a){return function(a){function b(a){for(var c=[],d=0;d<arguments.length;++d)c[d-0]=arguments[d];h(this,b);var k;d=e(this,(k=b.__proto__||Object.getPrototypeOf(b)).call.apply(k,[].concat([this],
$jscomp.arrayFromIterable(c))));d.credentialsProvider=d.rpc.getRef(c[1].credentialsProvider);return d}c(b,a);return b}(a)}};var a=l(66),b=l(67);n=l(0);f=this&&this.__decorate||function(a,b,c,e){var d=arguments.length,k=3>d?b:null===e?e=Object.getOwnPropertyDescriptor(b,c):e,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)k=Reflect.decorate(a,b,c,e);else for(var h=a.length-1;0<=h;h--)if(g=a[h])k=(3>d?g(k):3<d?g(b,c,k):g(b,c))||k;return 3<d&&k&&Object.defineProperty(b,c,k),k};l=
function(d){function f(){h(this,f);var c=e(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments));c.get=Object(a.a)(function(a,d){return c.rpc.promiseInvoke(b.a,{providerId:c.rpcId,invalidCredentials:a},d)});return c}c(f,d);return f}(n.c);l=f([Object(n.g)(b.b)],l)},function(n,f,l){function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||
"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}f.a=function(b){var c,d,k;return function(e,g){if(void 0!==d&&(void 0===c||void 0===e||c.generation!==e.generation))return void 0===c&&k.addConsumer(g),
d;c=void 0;k=new a.c;return d=b(e,k).then(function(a){c=a;k=void 0;return a},function(a){k.isCanceled&&(d=k=void 0);throw a;})}};var a=l(11);n=l(16);var b=l(30),d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}();(function(a){function b(){h(this,b);return e(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,
arguments))}c(b,a);return b})(n.a);var p=function(){function a(){h(this,a);this.providers=new Map}d(a,[{key:"register",value:function(a,b){this.providers.set(a,b)}},{key:"getCredentialsProvider",value:function(a,b){var c=this.providers.get(a);if(void 0===c)throw Error("No registered credentials provider: "+JSON.stringify(a));return c(b)}}]);return a}();(function(a){function b(){h(this,b);return e(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,new p))}c(b,a);d(b,[{key:"register",value:function(a,
b){this.base.register(a,b)}}]);return b})(function(a){function k(a){h(this,k);var c=e(this,(k.__proto__||Object.getPrototypeOf(k)).call(this));c.base=a;c.memoize=new b.a;return c}c(k,a);d(k,[{key:"getCredentialsProvider",value:function(a,b){var c=this;return this.memoize.get({key:a,parameters:b},function(){return c.registerDisposer(c.base.getCredentialsProvider(a,b).addRef())})}}]);return k}(n.a))},function(n,f,l){f.b="CredentialsProvider";f.a="CredentialsProvider.get"},function(n,f,l){f.a=function(c,
a,b,d){d=void 0===d?h.e:d;var f=void 0;return new Promise(function(k,g){function l(h){null!==f&&(f=Object(e.c)(c.serverUrls,b.path,b.method),f.responseType=b.responseType,f.setRequestHeader("Authorization",h.credentials.tokenType+" "+h.credentials.accessToken),f.onloadend=function(){if(null!==f){var b=this.status;200<=b&&300>b?(d.remove(p),k(this.response)):401===b?a.get(h,d).then(l):504===b||503===b?a.get(void 0,d).then(l):(d.remove(p),g(e.a.fromXhr(this)))}},f.send(b.payload))}var p=function(){var a=
f;f=null;null!=a&&a.abort();g(h.a)};d.add(p);a.get(void 0,d).then(l)})};var h=l(11),e=l(8)},function(n,f,l){f.a=function(h){for(var e=0,c=h.length,a=0;a<c;++a)e=31*e+h.charCodeAt(a)|0;return e}},function(n,f,l){function h(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,
b):a.__proto__=b)}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}l.d(f,"c",function(){return c});l.d(f,"d",function(){return a});l.d(f,"a",function(){return b});l.d(f,"b",function(){return d});var c;(function(a){a[a.RAW=0]="RAW";a[a.JPEG=1]="JPEG";a[a.COMPRESSED_SEGMENTATION=2]="COMPRESSED_SEGMENTATION"})(c||(c={}));var a=function k(){e(this,k)};a.RPC_ID="brainmaps/VolumeChunkSource";var b=function g(){e(this,g)};b.RPC_ID="brainmaps/MeshSource";var d=
function(a){function b(){e(this,b);var a=(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!==typeof a&&"function"!==typeof a?this:a}h(b,a);return b}(b);d.RPC_ID="brainmaps/SkeletonSource"},function(n,f,l){f.b="mesh/MeshLayer";f.a="mesh/FragmentSource"},function(n,f,l){function h(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var e=l(73),c=l(4),a=l(13),b=l(6);n=l(0);var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),p=function r(a,b,c){null===
a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){if(a=Object.getPrototypeOf(a),null!==a)return r(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}};f=this&&this.__decorate||function(a,b,c,d){var k=arguments.length,e=3>k?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)e=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)if(g=a[h])e=(3>k?g(e):3<k?
g(b,c,e):g(b,c))||e;return 3<k&&e&&Object.defineProperty(b,c,e),e};l=function(k){function g(){if(!(this instanceof g))throw new TypeError("Cannot call a class as a function");var b=(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");b=!b||"object"!==typeof b&&"function"!==typeof b?this:b;b.disjointSets=new e.a;b.changed=new a.a;return b}h(g,k);d(g,[{key:"disposed",value:function(){this.changed=
this.disjointSets=void 0;p(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"disposed",this).call(this)}},{key:"link",value:function(a,b){if(this.disjointSets.link(a,b)){var c=this.rpc;c&&c.invoke("DisjointUint64Sets.add",{id:this.rpcId,al:a.low,ah:a.high,bl:b.low,bh:b.high});this.changed.dispatch()}}},{key:"get",value:function(a){return this.disjointSets.get(a)}},{key:"clear",value:function(){if(this.disjointSets.clear()){var a=this.rpc;a&&a.invoke("DisjointUint64Sets.clear",{id:this.rpcId});
this.changed.dispatch()}}},{key:"setElements",value:function(a){return this.disjointSets.setElements(a)}},{key:"toJSON",value:function(){return this.disjointSets.toJSON()}},{key:"restoreState",value:function(a){var d=this;this.clear();if(void 0!==a){var k=[new b.a,new b.a];Object(c.a)(a,function(a){Object(c.a)(a,function(a,b){k[b%2].parseString(String(a),10);0!==b&&d.link(k[0],k[1])})})}}},{key:"size",get:function(){return this.disjointSets.size}}],[{key:"makeWithCounterpart",value:function(a){var b=
new this;b.initializeCounterpart(a);return b}}]);return g}(n.c);l=f([Object(n.g)("DisjointUint64Sets")],l);var k=new b.a,g=new b.a;Object(n.f)("DisjointUint64Sets.add",function(a){var b=this.get(a.id);k.low=a.al;k.high=a.ah;g.low=a.bl;g.high=a.bh;b.disjointSets.link(k,g)&&b.changed.dispatch()});Object(n.f)("DisjointUint64Sets.clear",function(a){a=this.get(a.id);a.disjointSets.clear()&&a.changed.dispatch()})},function(n,f,l){function h(a){for(var b=a,c=a[d];c!==a;)a=c,c=a[d];for(a=b[d];c!==a;)b[d]=
c,b=a,a=b[d];return c}function e(a){function b(b,e){for(;;)switch(c){case 0:k=!0,d=a;case 1:if(!k&&d===a){c=3;break}c=4;return{value:d,done:!1};case 4:if(void 0===e){c=5;break}c=-1;throw e;case 5:d=d[p];case 2:k=!1;c=1;break;case 3:c=-1;default:return{value:void 0,done:!0}}}var c=0,d,k,e={next:function(a){return b(a,void 0)},throw:function(a){return b(void 0,a)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();e[Symbol.iterator]=function(){return this};return e}
l.d(f,"a",function(){return q});var c=l(6),a=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}();$jscomp.initSymbol();var b=Symbol("disjoint_sets:rank");$jscomp.initSymbol();var d=Symbol("disjoint_sets:parent");$jscomp.initSymbol();var p=Symbol("disjoint_sets:next");$jscomp.initSymbol();var k=Symbol("disjoint_sets:prev");
$jscomp.initSymbol();var g=Symbol("disjoint_sets:min"),q=function(){function f(){if(!(this instanceof f))throw new TypeError("Cannot call a class as a function");this.map=new Map;this.generation=0}$jscomp.initSymbol();$jscomp.initSymbolIterator();a(f,[{key:"get",value:function(a){var b=this.map.get(a.toString());return void 0===b?a:h(b)[g]}},{key:"isMinElement",value:function(a){var b=this.get(a);return b===a||c.a.equal(b,a)}},{key:"makeSet",value:function(a){var c=a.toString(),e=this.map,f=e.get(c);
return void 0===f?(a=f=a.clone(),a[d]=a,a[b]=0,a[p]=a[k]=a,f[g]=f,e.set(c,f),f):h(f)}},{key:"link",value:function(a,e){a=this.makeSet(a);e=this.makeSet(e);if(a===e)return!1;this.generation++;var h=a;var f=e,l=h[b],m=f[b];l>m?f[d]=h:(h[d]=f,l===m&&(f[b]=m+1),h=f);f=a;l=e;m=f[k];var n=l[k];l[k]=m;m[p]=l;f[k]=n;n[p]=f;a=a[g];e=e[g];h[g]=c.a.less(a,e)?a:e;return!0}},{key:"setElements",value:function(a){function b(b,l){for(;;)switch(c){case 0:h=a.toString();g=f.map.get(h);if(void 0!==g){c=1;break}c=3;
return{value:a,done:!1};case 3:if(void 0===l){c=4;break}c=-1;throw l;case 4:c=2;break;case 1:k=$jscomp.makeIterator(e(g));case 5:if((d=k.next(b)).done){c=6;break}c=7;return{value:d.value,done:!1};case 7:if(void 0===l){c=8;break}c=-1;throw l;case 8:c=5;break;case 6:case 2:c=-1;default:return{value:void 0,done:!0}}}var c=0,d,k,g,h,f=this,l={next:function(a){return b(a,void 0)},throw:function(a){return b(void 0,a)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();
l[Symbol.iterator]=function(){return this};return l}},{key:"clear",value:function(){var a=this.map;if(0===a.size)return!1;++this.generation;a.clear();return!0}},{key:"mappings",value:function(a){function b(b,l){for(;;)switch(c){case 0:a=void 0===a?Array(2):a,e=$jscomp.makeIterator(f.map.values()),k=e.next();case 1:if(k.done){c=3;break}d=k.value;a[0]=d;a[1]=h(d)[g];c=4;return{value:a,done:!1};case 4:if(void 0===l){c=5;break}c=-1;throw l;case 5:case 2:k=e.next();c=1;break;case 3:c=-1;default:return{value:void 0,
done:!0}}}var c=0,d,k,e,f=this,l={next:function(a){return b(a,void 0)},throw:function(a){return b(void 0,a)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();l[Symbol.iterator]=function(){return this};return l}},{key:Symbol.iterator,value:function(){return this.mappings()}},{key:"toJSON",value:function(){for(var a=[],b=$jscomp.makeIterator(this.map.values()),k=b.next();!k.done;k=b.next()){var g=k.value;if(g[d]===g){k=[];g=$jscomp.makeIterator(e(g));for(var h=g.next();!h.done;h=
g.next())k.push(h.value);k.sort(c.a.compare);a.push(k)}}a.sort(function(a,b){return c.a.compare(a[0],b[0])});return a.map(function(a){return a.map(function(a){return a.toString()})})}},{key:"size",get:function(){return this.map.size}}]);return f}()},function(n,f,l){function h(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});
b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var e=l(75),c=l(13);n=l(0);var a=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),b=function k(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){if(a=Object.getPrototypeOf(a),null!==a)return k(a,
b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}};f=this&&this.__decorate||function(a,b,c,d){var k=arguments.length,e=3>k?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)e=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)if(g=a[h])e=(3>k?g(e):3<k?g(b,c,e):g(b,c))||e;return 3<k&&e&&Object.defineProperty(b,c,e),e};l=d=function(k){function g(){if(!(this instanceof g))throw new TypeError("Cannot call a class as a function");
var a=(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");a=!a||"object"!==typeof a&&"function"!==typeof a?this:a;a.hashTable=new e.a;a.changed=new c.b;return a}h(g,k);$jscomp.initSymbol();$jscomp.initSymbolIterator();a(g,[{key:"disposed",value:function(){b(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"disposed",this).call(this);this.changed=this.hashTable=void 0}},{key:"add_",value:function(a){return this.hashTable.add(a)}},
{key:"add",value:function(a){if(this.add_(a)){var b=this.rpc;b&&b.invoke("Uint64Set.add",{id:this.rpcId,value:a});this.changed.dispatch(a,!0)}}},{key:"has",value:function(a){return this.hashTable.has(a)}},{key:Symbol.iterator,value:function(){return this.hashTable.keys()}},{key:"delete_",value:function(a){return this.hashTable.delete(a)}},{key:"delete",value:function(a){if(this.delete_(a)){var b=this.rpc;b&&b.invoke("Uint64Set.delete",{id:this.rpcId,value:a});this.changed.dispatch(a,!1)}}},{key:"clear",
value:function(){if(this.hashTable.clear()){var a=this.rpc;a&&a.invoke("Uint64Set.clear",{id:this.rpcId});this.changed.dispatch(null,!1)}}},{key:"toJSON",value:function(){for(var a=[],b=$jscomp.makeIterator(this),c=b.next();!c.done;c=b.next())a.push(c.value.toString());a.sort();return a}},{key:"size",get:function(){return this.hashTable.size}}],[{key:"makeWithCounterpart",value:function(a){var b=new d;b.initializeCounterpart(a);return b}}]);return g}(n.c);l=d=f([Object(n.g)("Uint64Set")],l);Object(n.f)("Uint64Set.add",
function(a){var b=this.get(a.id);b.add_(a.value)&&b.changed.dispatch()});Object(n.f)("Uint64Set.delete",function(a){var b=this.get(a.id);b.delete_(a.value)&&b.changed.dispatch()});Object(n.f)("Uint64Set.clear",function(a){a=this.get(a.id);a.hashTable.clear()&&a.changed.dispatch()});var d},function(n,f,l){function h(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function e(a,b){if("function"!==
typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}l.d(f,"a",function(){return x});var a=l(76),b=l(6),d=function C(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,
b);if(void 0===d){if(a=Object.getPrototypeOf(a),null!==a)return C(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}},p=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),k=0,g=0,q=0,r=0;n=function(){function d(a){a=void 0===a?d.generateHashFunctions(3):a;c(this,d);this.loadFactor=
.9;this.size=0;this.growFactor=1.2;this.maxHeight=8192;this.emptyHigh=this.emptyLow=4294967295;this.maxAttempts=this.maxRehashAttempts=5;this.maxWidth=4096/this.entryStride;this.generation=0;this.mungedEmptyKey=-1;this.hashFunctions=a;this.allocate(4,1)}p(d,[{key:"updateHashFunctions",value:function(a){this.hashFunctions=d.generateHashFunctions(a);this.mungedEmptyKey=-1}},{key:"tableWithMungedEmptyKey",value:function(a){for(var b=this.hashFunctions.length,c=Array(b),d=0;d<b;++d)c[d]=this.getHash(d,
this.emptyLow,this.emptyHigh);d=this.mungedEmptyKey;if(-1===d)a:for(;;){d=16777216*Math.random()>>>0;for(var e=0;e<b;++e)for(var k=this.getHash(e,d,d),g=0;g<b;++g)if(c[g]===k)continue a;this.mungedEmptyKey=d;break}e=this.table;k=this.emptyLow;g=this.emptyHigh;for(var h=0;h<b;++h){var f=c[h];e[f]===k&&e[f+1]===g&&(e[f]=d,e[f+1]=d)}try{a(e)}finally{for(a=0;a<b;++a)h=c[a],e[h]===d&&e[h+1]===d&&(e[h]=k,e[h+1]=g)}}},{key:"getHash",value:function(a,b,c){a=this.hashFunctions[a];var d=this.width,e=this.height;
d=a[0].compute(b,c)%d;b=a[1].compute(b,c)%e;return this.entryStride*(b*this.width+d)}},{key:"keys",value:function(a){function c(c,u){for(;;)switch(d){case 0:a=void 0===a?new b.a:a,t=r,n=t.emptyLow,p=t.emptyHigh,m=t.entryStride,l=r,f=l.table,h=0,g=f.length;case 1:if(!(h<g)){d=3;break}k=f[h];e=f[h+1];if(k===n&&e===p){d=4;break}a.low=k;a.high=e;d=5;return{value:a,done:!1};case 5:if(void 0===u){d=6;break}d=-1;throw u;case 6:case 4:case 2:h+=m;d=1;break;case 3:d=-1;default:return{value:void 0,done:!0}}}
var d=0,e,k,g,h,f,l,m,p,n,t,r=this,A={next:function(a){return c(a,void 0)},throw:function(a){return c(void 0,a)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();A[Symbol.iterator]=function(){return this};return A}},{key:"indexOfPair",value:function(a,b){var c=this.table,d=this.emptyHigh;if(a===this.emptyLow&&b===d)return-1;d=0;for(var e=this.hashFunctions.length;d<e;++d){var k=this.getHash(d,a,b);if(c[k]===a&&c[k+1]===b)return k}return-1}},{key:"indexOf",value:function(a){return this.indexOfPair(a.low,
a.high)}},{key:"chooseAnotherEmptyKey",value:function(){for(var a=this.emptyLow,b=this.emptyHigh,c=this.table,d=this.entryStride,e,k;e=4294967296*Math.random()>>>0,k=4294967296*Math.random()>>>0,e===a&&k===b||this.hasPair(e,k););this.emptyLow=e;this.emptyHigh=k;for(var g=0,h=c.length;g<h;g+=d)c[g]===a&&c[g+1]===b&&(c[g]=e,c[g+1]=k)}},{key:"has",value:function(a){return-1!==this.indexOf(a)}},{key:"hasPair",value:function(a,b){return-1!==this.indexOfPair(a,b)}},{key:"delete",value:function(a){a=this.indexOf(a);
if(-1!==a){var b=this.table;b[a]=this.emptyLow;b[a+1]=this.emptyHigh;++this.generation;this.size--;return!0}return!1}},{key:"clearTable",value:function(){for(var a=this.table,b=this.entryStride,c=this.emptyLow,d=this.emptyHigh,e=a.length,k=0;k<e;k+=b)a[k]=c,a[k+1]=d}},{key:"clear",value:function(){if(0===this.size)return!1;this.size=0;++this.generation;this.clearTable();return!0}},{key:"swapPending",value:function(a,b){var c=k,d=g;this.storePending(a,b);a[b]=c;a[b+1]=d}},{key:"storePending",value:function(a,
b){k=a[b];g=a[b+1]}},{key:"backupPending",value:function(){q=k;r=g}},{key:"restorePending",value:function(){k=q;g=r}},{key:"tryToInsert",value:function(){for(var a=0,b=this.emptyLow,c=this.emptyHigh,d=this.maxAttempts,e=this.table,h=this.hashFunctions.length,f=Math.floor(Math.random()*h);;){var l=this.getHash(f,k,g);this.swapPending(e,l);if(k===b&&g===c)return!0;if(++a===d)break;f=(f+Math.floor(Math.random()*(h-1))+1)%h}return!1}},{key:"allocate",value:function(a,b){var c=a*b;this.width=a;this.height=
b;this.table=new Uint32Array(c*this.entryStride);this.maxAttempts=c;this.clearTable();this.capacity=c*this.loadFactor;this.mungedEmptyKey=-1}},{key:"rehash",value:function(a,b,c){this.allocate(b,c);this.updateHashFunctions(this.hashFunctions.length);b=this.emptyLow;c=this.emptyHigh;for(var d=this.entryStride,e=0,k=a.length;e<k;e+=d){var g=a[e+1];if(a[e]!==b||g!==c)if(this.storePending(a,e),!this.tryToInsert())return!1}return!0}},{key:"grow",value:function(a){for(var b=this.table,c=this.width,d=this.height,
e=this.maxWidth,k=this.maxHeight;;){var g=c*d;c=Math.min(e,Math.ceil(a/this.height));c*d<a&&(d=Math.min(k,Math.ceil(a/c)));var h=c*d;if(h<a&&h===g)throw Error("Maximum table size exceeded");for(g=0;g<this.maxRehashAttempts;++g)if(this.rehash(b,c,d))return;a=Math.ceil(this.growFactor*a)}}},{key:"insertInternal",value:function(){++this.generation;k===this.emptyLow&&g===this.emptyHigh&&this.chooseAnotherEmptyKey();++this.size>this.capacity&&(this.backupPending(),this.grow(Math.ceil(this.growFactor*this.width*
this.height)),this.restorePending());for(;!this.tryToInsert();)this.backupPending(),this.grow(this.width*this.height),this.restorePending()}}],[{key:"generateHashFunctions",value:function(b){b=void 0===b?3:b;for(var c=[],d=0;d<b;++d){var e=[a.a.generate(),a.a.generate()];c.push(e)}return c}}]);return d}();var x=function(a){function b(){c(this,b);return h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}e(b,a);$jscomp.initSymbol();$jscomp.initSymbolIterator();p(b,[{key:"add",value:function(a){var b=
a.low;a=a.high;if(this.hasPair(b,a))return!1;k=b;g=a;this.insertInternal();return!0}},{key:Symbol.iterator,value:function(){return this.keys()}}]);return b}(n);x.prototype.entryStride=2;var m=0,v=0,D=0,t=0;(function(a){function f(){c(this,f);return h(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}e(f,a);$jscomp.initSymbol();$jscomp.initSymbolIterator();p(f,[{key:"set",value:function(a,b){var c=a.low;a=a.high;if(this.hasPair(c,a))return!1;k=c;g=a;m=b.low;v=b.high;this.insertInternal();
return!0}},{key:"get",value:function(a,b){a=this.indexOf(a);if(-1===a)return!1;var c=this.table;b.low=c[a+2];b.high=c[a+3];return!0}},{key:"swapPending",value:function(a,b){var c=m,e=v;d(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"swapPending",this).call(this,a,b);a[b+2]=c;a[b+3]=e}},{key:"storePending",value:function(a,b){d(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"storePending",this).call(this,a,b);m=a[b+2];v=a[b+3]}},{key:"backupPending",value:function(){d(f.prototype.__proto__||
Object.getPrototypeOf(f.prototype),"backupPending",this).call(this);D=m;t=v}},{key:"restorePending",value:function(){d(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"restorePending",this).call(this);m=D;v=t}},{key:Symbol.iterator,value:function(){return this.entries()}},{key:"entries",value:function(a){function c(c,u){for(;;)switch(d){case 0:a=void 0===a?[new b.a,new b.a]:a,M=q,y=M.emptyLow,r=M.emptyHigh,t=M.entryStride,n=q,p=n.table,m=$jscomp.makeIterator(a),l=m.next().value,f=m.next().value,
h=0,g=p.length;case 1:if(!(h<g)){d=3;break}k=p[h];e=p[h+1];if(k===y&&e===r){d=4;break}l.low=k;l.high=e;f.low=p[h+2];f.high=p[h+3];d=5;return{value:a,done:!1};case 5:if(void 0===u){d=6;break}d=-1;throw u;case 6:case 4:case 2:h+=t;d=1;break;case 3:d=-1;default:return{value:void 0,done:!0}}}var d=0,e,k,g,h,f,l,m,p,n,t,r,y,M,q=this,W={next:function(a){return c(a,void 0)},throw:function(a){return c(void 0,a)},return:function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();W[Symbol.iterator]=
function(){return this};return W}}]);return f})(n).prototype.entryStride=4},function(n,f,l){l.d(f,"a",function(){return e});var h=function(){function c(a,b){for(var c=0;c<b.length;c++){var e=b[c];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(a,e.key,e)}}return function(a,b,d){b&&c(a.prototype,b);d&&c(a,d);return a}}(),e=function(){function c(a,b,d,e){if(!(this instanceof c))throw new TypeError("Cannot call a class as a function");this.a0=a;this.a1=
b;this.b=d;this.c=e}h(c,[{key:"computeDotProduct",value:function(a,b){var c=this.a0,e=this.a1;return c[0]*(a&255)+c[1]*(a>>8&255)+c[2]*(a>>16&255)+c[3]*(a>>24&255)+(e[0]*(b&255)+e[1]*(b>>8&255)+e[2]*(b>>16&255)+e[3]*(b>>24&255))}},{key:"compute",value:function(a,b){var c=this.b,e=this.c;a=this.computeDotProduct(a,b);return(a+a*a%4093*e+c)%4093}},{key:"toString",value:function(){return"new HashFunction(Float32Array.of("+this.a0+"), "+("Float32Array.of("+this.a1+"), "+this.b+", "+this.c+")")}}],[{key:"generate",
value:function(){function a(){return Math.floor(4093*Math.random())}return new c(Float32Array.of(a(),a(),a(),a()),Float32Array.of(a(),a(),a(),a()),a(),a())}}]);return c}()},function(n,f,l){f.a="skeleton/SkeletonLayer"},function(n,f,l){function h(c,h,f,l,m,n,D,t){var g=m[0],r=m[1],q=m[2];m=l[0];var v=l[1];l=l[2];var w=f[0],B=f[1],x=f[2];x-=B*r;B-=w*g;if(0===g*r*q)return[0,0];f=m*v*l+31;if(void 0===a||a.length<f)a=new Uint32Array(f),b=new Uint32Array(1*f),d=new Uint32Array(1*f),p=new Uint32Array(f),
k=new Uint32Array(f);f=a.subarray(0,f);f.fill(0);for(var u=b,G=d,H=p,F=k,z=0,E=c[h]+1>>>0,O=0,N=m-g,Q=m*v-m*r,L=0;L<q;++L,h+=x,O+=Q)for(var y=0;y<r;++y,h+=B,O+=N)for(var M=0;M<g;++M,h+=w){var R=c[h];R!==E&&(E=u[1*z]=R,H[z]=z++);f[O++]=z}H.subarray(0,z).sort(function(a,b){return u[a]-u[b]});c=-1;g=u[1*H[0]]+1>>>0;for(r=0;r<z;++r)q=H[r],w=u[1*q],w!==g&&(++c,g=G[1*c]=w),F[q+1]=c;++c;return Object(e.c)(t,n,D,m*v*l,c,G,f,F,1)}f.a=function(a,b,d,k,f,l){f=void 0===f?0:f;l=void 0===l?Object(c.a)(k,1):l;return Object(e.b)(a,
b,d,k,f,l,h)};var e=l(21),c=l(20),a,b,d,p,k},function(n,f,l){function h(c,h,f,l,m,n,D,t){var g=m[0],r=m[1],q=m[2];m=l[0];var v=l[1];l=l[2];var w=f[0],B=f[1],x=f[2];x-=B*r;B-=w*g;if(0===g*r*q)return[0,0];f=m*v*l+31;if(void 0===a||a.length<f)a=new Uint32Array(f),b=new Uint32Array(2*f),d=new Uint32Array(2*f),p=new Uint32Array(f),k=new Uint32Array(f);f=a.subarray(0,f);f.fill(0);for(var u=b,G=d,H=p,F=k,z=0,E=c[h]+1>>>0,O=0,N=0,Q=m-g,L=m*v-m*r,y=0;y<q;++y,h+=x,N+=L)for(var M=0;M<r;++M,h+=B,N+=Q)for(var R=
0;R<g;++R,h+=w){var W=c[h],ma=c[h+1];if(W!==E||ma!==O)E=u[2*z]=W,O=u[2*z+1]=ma,H[z]=z++;f[N++]=z}H.subarray(0,z).sort(function(a,b){var c=u[2*a],d=u[2*b];return u[2*a+1]-u[2*b+1]||c-d});c=-1;g=u[2*H[0]]+1>>>0;for(r=B=0;r<z;++r){q=H[r];x=2*q;w=u[x];x=u[x+1];if(w!==g||x!==B)++c,B=2*c,g=G[B]=w,B=G[B+1]=x;F[q+1]=c}++c;return Object(e.c)(t,n,D,m*v*l,c,G,f,F,2)}f.a=function(a,b,d,k,f,l){f=void 0===f?0:f;l=void 0===l?Object(c.a)(k,2):l;return Object(e.b)(a,b,d,k,f,l,h)};var e=l(21),c=l(20),a,b,d,p,k},function(n,
f,l){l.d(f,"a",function(){return e});var h=function(){function c(a,b){for(var c=0;c<b.length;c++){var e=b[c];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(a,e.key,e)}}return function(a,b,d){b&&c(a.prototype,b);d&&c(a,d);return a}}(),e=function(){function c(a){a=void 0===a?16:a;if(!(this instanceof c))throw new TypeError("Cannot call a class as a function");this.length=0;this.data=new Uint32Array(a)}h(c,[{key:"resize",value:function(a){var b=this.data;
if(a>b.length){var c=new Uint32Array(Math.max(a,2*b.length));c.set(b.subarray(0,this.length));this.data=c}this.length=a}},{key:"shrinkToFit",value:function(){this.data=new Uint32Array(this.view)}},{key:"clear",value:function(){this.length=0}},{key:"appendArray",value:function(a){var b=this.length;this.resize(b+a.length);this.data.set(a,b)}},{key:"eraseRange",value:function(a,b){this.data.copyWithin(a,b,this.length);this.length-=b-a}},{key:"view",get:function(){var a=this.data;return new Uint32Array(a.buffer,
a.byteOffset,this.length)}}]);return c}()},function(n,f,l){f.a=function(a,b,d){var f=new h.JpegDecoder;f.parse(a);if(f.width*f.height!==b[0]*b[1]*b[2])throw Error("JPEG data does not have the expected dimensions: "+("width="+f.width+", height="+f.height+", ")+("chunkDataSize="+c.m.str(b)));if(f.numComponents!==d)throw Error("JPEG data does not have the expected number of components: "+("components="+f.numComponents+", expected="+d));if(1===f.numComponents)return f.getData(f.width,f.height,!1);if(3===
f.numComponents)return a=f.getData(f.width,f.height,!1),Object(e.c)(a,f.width*f.height,3);throw Error("JPEG data has an unsupported number of components: components="+f.numComponents);};var h=l(82);l.n(h);var e=l(20),c=l(1)},function(n,f,l){function h(c,a){if(0===c.indexOf("data:")){var b=c.indexOf("base64,")+7;c=atob(c.substring(b));b=new Uint8Array(c.length);for(var d=c.length-1;0<=d;d--)b[d]=c.charCodeAt(d);a(b.buffer)}else{var e=new XMLHttpRequest;e.open("GET",c,!0);e.responseType="arraybuffer";
e.onload=function(){a(e.response)};e.send(null)}}f=function(){function c(){this._src=null;this._parser=new e.JpegImage;this.onload=null}c.prototype={get src(){return this._src},set src(a){this.load(a)},get width(){return this._parser.width},get height(){return this._parser.height},load:function(a){this._src=a;h(a,function(a){this.parse(new Uint8Array(a));if(this.onload)this.onload()}.bind(this))},parse:function(a){this._parser.parse(a)},getData:function(a,b){return this._parser.getData(a,b,!1)},copyToImageData:function(a){if(2===
this._parser.numComponents||4<this._parser.numComponents)throw Error("Unsupported amount of components");var b=a.width,c=a.height,e=b*c*4;a=a.data;if(1===this._parser.numComponents){var k=this._parser.getData(b,c,!1);for(c=b=0;b<e;){var g=k[c++];a[b++]=g;a[b++]=g;a[b++]=g;a[b++]=255}}else for(k=this._parser.getData(b,c,!0),c=b=0;b<e;)a[b++]=k[c++],a[b++]=k[c++],a[b++]=k[c++],a[b++]=255}};return c}();var e;(function(c){function a(a){for(var b=1,c=0;a>b;)b<<=1,c++;return c}function b(a,b){return a[b]<<
8|a[b+1]}function d(a,b){return(a[b]<<24|a[b+1]<<16|a[b+2]<<8|a[b+3])>>>0}function e(a,b,c){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!1});return c}var k=function(){function a(){}function b(a,b){for(var c=0,d=[],e,k,g=16;0<g&&!a[g-1];)g--;d.push({children:[],index:0});var f=d[0],h;for(e=0;e<g;e++){for(k=0;k<a[e];k++){f=d.pop();for(f.children[f.index]=b[c];0<f.index;)f=d.pop();f.index++;for(d.push(f);d.length<=e;)d.push(h={children:[],index:0}),f.children[f.index]=h.children,
f=h;c++}e+1<g&&(d.push(h={children:[],index:0}),f.children[f.index]=h.children,f=h)}return d[0].children}function c(a,b,c,d,e,g,f,h,l){function u(){if(0<F)return F--,q>>F&1;q=a[b++];if(255===q){var c=a[b++];if(c)throw"unexpected marker: "+(q<<8|c).toString(16);}F=7;return q>>>7}function m(a){for(;;){a=a[u()];if("number"===typeof a)return a;if("object"!==typeof a)throw"invalid huffman sequence";}}function w(a){for(var b=0;0<a;)b=b<<1|u(),a--;return b}function p(a){if(1===a)return 1===u()?1:-1;var b=
w(a);return b>=1<<a-1?b:b+(-1<<a)+1}function y(a,b){var c=m(a.huffmanTableDC);c=0===c?0:p(c);a.blockData[b]=a.pred+=c;for(c=1;64>c;){var d=m(a.huffmanTableAC),e=d&15;d>>=4;if(0===e){if(15>d)break;c+=16}else c+=d,a.blockData[b+k[c]]=p(e),c++}}function n(a,b){var c=m(a.huffmanTableDC);c=0===c?0:p(c)<<l;a.blockData[b]=a.pred+=c}function H(a,b){a.blockData[b]|=u()<<l}function G(a,b){if(0<z)z--;else for(var c=g;c<=f;){var d=m(a.huffmanTableAC),e=d&15;d>>=4;if(0===e){if(15>d){z=w(d)+(1<<d)-1;break}c+=16}else c+=
d,a.blockData[b+k[c]]=p(e)*(1<<l),c++}}function t(a,b){for(var c=g,d=0,e;c<=f;){e=k[c];switch(v){case 0:d=m(a.huffmanTableAC);e=d&15;d>>=4;if(0===e)15>d?(z=w(d)+(1<<d),v=4):(d=16,v=1);else{if(1!==e)throw"invalid ACn encoding";A=p(e);v=d?2:3}continue;case 1:case 2:a.blockData[b+e]?a.blockData[b+e]+=u()<<l:(d--,0===d&&(v=2===v?3:0));break;case 3:a.blockData[b+e]?a.blockData[b+e]+=u()<<l:(a.blockData[b+e]=A<<l,v=0);break;case 4:a.blockData[b+e]&&(a.blockData[b+e]+=u()<<l)}c++}4===v&&(z--,0===z&&(v=0))}
var B=c.mcusPerLine,r=b,q=0,F=0,z=0,v=0,A,x=d.length,I,D,K,E;h=c.progressive?0===g?0===h?n:H:0===h?G:t:y;var J=0;c=1===x?d[0].blocksPerLine*d[0].blocksPerColumn:B*c.mcusPerColumn;e||(e=c);for(var C,Ib;J<c;){for(I=0;I<x;I++)d[I].pred=0;z=0;if(1===x){var Z=d[0];for(E=0;E<e;E++)h(Z,64*((Z.blocksPerLine+1)*(J/Z.blocksPerLine|0)+J%Z.blocksPerLine)),J++}else for(E=0;E<e;E++){for(I=0;I<x;I++)for(Z=d[I],C=Z.h,Ib=Z.v,D=0;D<Ib;D++)for(K=0;K<C;K++)h(Z,64*((Z.blocksPerLine+1)*((J/B|0)*Z.v+D)+(J%B*Z.h+K)));J++}F=
0;Z=a[b]<<8|a[b+1];if(65280>=Z)throw"marker was not found";if(65488<=Z&&65495>=Z)b+=2;else break}return b-r}function d(a,b){a=b.blocksPerLine;for(var c=b.blocksPerColumn,d=new Int16Array(64),e=0;e<c;e++)for(var k=0;k<a;k++){for(var g,f,h,l,m,w,p,y,n,t,B,r,q=64*((b.blocksPerLine+1)*e+k),T=d,v=b.quantizationTable,A=b.blockData,x=0;64>x;x+=8)g=A[q+x],y=A[q+x+1],p=A[q+x+2],w=A[q+x+3],m=A[q+x+4],l=A[q+x+5],h=A[q+x+6],f=A[q+x+7],g*=v[x],0===(y|p|w|m|l|h|f)?(g=5793*g+512>>10,T[x]=g,T[x+1]=g,T[x+2]=g,T[x+
3]=g,T[x+4]=g,T[x+5]=g,T[x+6]=g,T[x+7]=g):(y*=v[x+1],p*=v[x+2],w*=v[x+3],m*=v[x+4],l*=v[x+5],h*=v[x+6],f*=v[x+7],r=5793*g+128>>8,B=5793*m+128>>8,t=p,n=h,m=2896*(y-f)+128>>8,f=2896*(y+f)+128>>8,w<<=4,l<<=4,r=r+B+1>>1,B=r-B,g=3784*t+1567*n+128>>8,t=1567*t-3784*n+128>>8,n=g,m=m+l+1>>1,l=m-l,f=f+w+1>>1,w=f-w,r=r+n+1>>1,n=r-n,B=B+t+1>>1,t=B-t,g=2276*m+3406*f+2048>>12,m=3406*m-2276*f+2048>>12,f=g,g=799*w+4017*l+2048>>12,w=4017*w-799*l+2048>>12,l=g,T[x]=r+f,T[x+7]=r-f,T[x+1]=B+l,T[x+6]=B-l,T[x+2]=t+w,T[x+
5]=t-w,T[x+3]=n+m,T[x+4]=n-m);for(v=0;8>v;++v)g=T[v],y=T[v+8],p=T[v+16],w=T[v+24],m=T[v+32],l=T[v+40],h=T[v+48],f=T[v+56],0===(y|p|w|m|l|h|f)?(g=5793*g+8192>>14,g=-2040>g?0:2024<=g?255:g+2056>>4,A[q+v]=g,A[q+v+8]=g,A[q+v+16]=g,A[q+v+24]=g,A[q+v+32]=g,A[q+v+40]=g,A[q+v+48]=g,A[q+v+56]=g):(r=5793*g+2048>>12,B=5793*m+2048>>12,t=p,n=h,m=2896*(y-f)+2048>>12,f=2896*(y+f)+2048>>12,r=(r+B+1>>1)+4112,B=r-B,g=3784*t+1567*n+2048>>12,t=1567*t-3784*n+2048>>12,n=g,m=m+l+1>>1,l=m-l,f=f+w+1>>1,w=f-w,r=r+n+1>>1,n=
r-n,B=B+t+1>>1,t=B-t,g=2276*m+3406*f+2048>>12,m=3406*m-2276*f+2048>>12,f=g,g=799*w+4017*l+2048>>12,w=4017*w-799*l+2048>>12,l=g,g=r+f,f=r-f,y=B+l,h=B-l,p=t+w,l=t-w,w=n+m,m=n-m,g=16>g?0:4080<=g?255:g>>4,y=16>y?0:4080<=y?255:y>>4,p=16>p?0:4080<=p?255:p>>4,w=16>w?0:4080<=w?255:w>>4,m=16>m?0:4080<=m?255:m>>4,l=16>l?0:4080<=l?255:l>>4,h=16>h?0:4080<=h?255:h>>4,f=16>f?0:4080<=f?255:f>>4,A[q+v]=g,A[q+v+8]=y,A[q+v+16]=p,A[q+v+24]=w,A[q+v+32]=m,A[q+v+40]=l,A[q+v+48]=h,A[q+v+56]=f)}return b.blockData}function e(a){return 0>=
a?0:255<=a?255:a}var k=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);a.prototype={parse:function(a){function e(){var b=a[h]<<8|a[h+1];h+=2;return b}function g(){var b=e();b=a.subarray(h,h+b-2);h+=b.length;return b}function f(a){for(var b=Math.ceil(a.samplesPerLine/8/a.maxH),c=Math.ceil(a.scanLines/8/a.maxV),d=0;d<a.components.length;d++){A=a.components[d];
var e=Math.ceil(Math.ceil(a.samplesPerLine/8)*A.h/a.maxH),k=Math.ceil(Math.ceil(a.scanLines/8)*A.v/a.maxV);A.blockData=new Int16Array(64*c*A.v*(b*A.h+1));A.blocksPerLine=e;A.blocksPerColumn=k}a.mcusPerLine=b;a.mcusPerColumn=c}var h=0,l=null,m=null,w=[],p=[],n=[];var t=e();if(65496!==t)throw"SOI not found";for(t=e();65497!==t;){switch(t){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var r=
g();65504===t&&74===r[0]&&70===r[1]&&73===r[2]&&70===r[3]&&0===r[4]&&(l={version:{major:r[5],minor:r[6]},densityUnits:r[7],xDensity:r[8]<<8|r[9],yDensity:r[10]<<8|r[11],thumbWidth:r[12],thumbHeight:r[13],thumbData:r.subarray(14,14+3*r[12]*r[13])});65518===t&&65===r[0]&&100===r[1]&&111===r[2]&&98===r[3]&&101===r[4]&&0===r[5]&&(m={version:r[6],flags0:r[7]<<8|r[8],flags1:r[9]<<8|r[10],transformCode:r[11]});break;case 65499:t=e()+h-2;for(var q;h<t;){var y=a[h++],M=new Uint16Array(64);if(0===y>>4)for(r=
0;64>r;r++)q=k[r],M[q]=a[h++];else if(1===y>>4)for(r=0;64>r;r++)q=k[r],M[q]=e();else throw"DQT: invalid table spec";w[y&15]=M}break;case 65472:case 65473:case 65474:if(v)throw"Only single frame JPEGs supported";e();var v={};v.extended=65473===t;v.progressive=65474===t;v.precision=a[h++];v.scanLines=e();v.samplesPerLine=e();v.components=[];v.componentIds={};r=a[h++];for(t=M=y=0;t<r;t++){q=a[h];var W=a[h+1]>>4;var ma=a[h+1]&15;y<W&&(y=W);M<ma&&(M=ma);W=v.components.push({h:W,v:ma,quantizationTable:w[a[h+
2]]});v.componentIds[q]=W-1;h+=3}v.maxH=y;v.maxV=M;f(v);break;case 65476:q=e();for(t=2;t<q;){y=a[h++];M=new Uint8Array(16);for(r=W=0;16>r;r++,h++)W+=M[r]=a[h];ma=new Uint8Array(W);for(r=0;r<W;r++,h++)ma[r]=a[h];t+=17+W;(0===y>>4?n:p)[y&15]=b(M,ma)}break;case 65501:e();var x=e();break;case 65498:e();q=a[h++];r=[];for(t=0;t<q;t++){y=v.componentIds[a[h++]];var A=v.components[y];y=a[h++];A.huffmanTableDC=n[y>>4];A.huffmanTableAC=p[y&15];r.push(A)}t=a[h++];q=a[h++];y=a[h++];t=c(a,h,v,r,x,t,q,y>>4,y&15);
h+=t;break;case 65535:255!==a[h]&&h--;break;default:if(255===a[h-3]&&192<=a[h-2]&&254>=a[h-2])h-=3;else throw"unknown JPEG marker "+t.toString(16);}t=e()}this.width=v.samplesPerLine;this.height=v.scanLines;this.jfif=l;this.adobe=m;this.components=[];for(t=0;t<v.components.length;t++)A=v.components[t],this.components.push({output:d(v,A),scaleX:A.h/v.maxH,scaleY:A.v/v.maxV,blocksPerLine:A.blocksPerLine,blocksPerColumn:A.blocksPerColumn});this.numComponents=this.components.length},_getLinearizedBlockData:function(a,
b){var c=this.width/a,d=this.height/b,e,k,g=this.components.length,h=a*b*g,f=new Uint8Array(h),l=new Uint32Array(a);for(k=0;k<g;k++){var m=this.components[k];var w=m.scaleX*c;var p=m.scaleY*d;var y=k;var n=m.output;var t=m.blocksPerLine+1<<3;for(e=0;e<a;e++)m=0|e*w,l[e]=(m&4294967288)<<3|m&7;for(w=0;w<b;w++)for(m=0|w*p,m=t*(m&4294967288)|(m&7)<<3,e=0;e<a;e++)f[y]=n[m+l[e]],y+=g}if(b=this.decodeTransform)for(k=0;k<h;)for(a=m=0;m<g;m++,k++,a+=2)f[k]=(f[k]*b[a]>>8)+b[a+1];return f},_isColorConversionNeeded:function(){return this.adobe&&
this.adobe.transformCode?!0:3===this.numComponents?!0:!1},_convertYccToRgb:function(a){for(var b,c,d,k=0,g=a.length;k<g;k+=3)b=a[k],c=a[k+1],d=a[k+2],a[k]=e(b-179.456+1.402*d),a[k+1]=e(b+135.459-.344*c-.714*d),a[k+2]=e(b-226.816+1.772*c);return a},_convertYcckToRgb:function(a){for(var b,c,d,k,g=0,h=0,f=a.length;h<f;h+=4){b=a[h];c=a[h+1];d=a[h+2];k=a[h+3];var l=-122.67195406894+c*(-6.60635669420364E-5*c+4.37130475926232E-4*d-5.4080610064599E-5*b+4.8449797120281E-4*k-.154362151871126)+d*(-9.57964378445773E-4*
d+8.17076911346625E-4*b-.00477271405408747*k+1.53380253221734)+b*(9.61250184130688E-4*b-.00266257332283933*k+.48357088451265)+k*(-3.36197177618394E-4*k+.484791561490776),m=107.268039397724+c*(2.19927104525741E-5*c-6.40992018297945E-4*d+6.59397001245577E-4*b+4.26105652938837E-4*k-.176491792462875)+d*(-7.78269941513683E-4*d+.00130872261408275*b+7.70482631801132E-4*k-.151051492775562)+b*(.00126935368114843*b-.00265090189010898*k+.25802910206845)+k*(-3.18913117588328E-4*k-.213742400323665);b=-20.810012546947+
c*(-5.70115196973677E-4*c-2.63409051004589E-5*d+.0020741088115012*b-.00288260236853442*k+.814272968359295)+d*(-1.53496057440975E-5*d-1.32689043961446E-4*b+5.60833691242812E-4*k-.195152027534049)+b*(.00174418132927582*b-.00255243321439347*k+.116935020465145)+k*(-3.43531996510555E-4*k+.24165260232407);a[g++]=e(l);a[g++]=e(m);a[g++]=e(b)}return a},_convertYcckToCmyk:function(a){for(var b,c,d,k=0,g=a.length;k<g;k+=4)b=a[k],c=a[k+1],d=a[k+2],a[k]=e(434.456-b-1.402*d),a[k+1]=e(119.541-b+.344*c+.714*d),
a[k+2]=e(481.816-b-1.772*c);return a},_convertCmykToRgb:function(a){for(var b,c,d,e,k=0,g=1/255/255,h=0,f=a.length;h<f;h+=4){b=a[h];c=a[h+1];d=a[h+2];e=a[h+3];var l=b*(-4.387332384609988*b+54.48615194189176*c+18.82290502165302*d+212.25662451639585*e-72734.4411664936)+c*(1.7149763477362134*c-5.6096736904047315*d-17.873870861415444*e-1401.7366389350734)+d*(-2.5217340131683033*d-21.248923337353073*e+4465.541406466231)-e*(21.86122147463605*e+48317.86113160301),m=b*(8.841041422036149*b+60.118027045597366*
c+6.871425592049007*d+31.159100130055922*e-20220.756542821975)+c*(-15.310361306967817*c+17.575251261109482*d+131.35250912493976*e-48691.05921601825)+d*(4.444339102852739*d+9.8632861493405*e-6341.191035517494)-e*(20.737325471181034*e+47890.15695978492);b=b*(.8842522430003296*b+8.078677503112928*c+30.89978309703729*d-.23883238689178934*e-3616.812083916688)+c*(10.49593273432072*c+63.02378494754052*d+50.606957656360734*e-28620.90484698408)+d*(.03296041114873217*d+115.60384449646641*e-49363.43385999684)-
e*(22.33816807309886*e+45932.16563550634);a[k++]=0<=l?255:-16581375>=l?0:255+l*g|0;a[k++]=0<=m?255:-16581375>=m?0:255+m*g|0;a[k++]=0<=b?255:-16581375>=b?0:255+b*g|0}return a},getData:function(a,b,c){if(4<this.numComponents)throw"Unsupported color mode";a=this._getLinearizedBlockData(a,b);if(3===this.numComponents)return this._convertYccToRgb(a);if(4===this.numComponents){if(this._isColorConversionNeeded())return c?this._convertYcckToRgb(a):this._convertYcckToCmyk(a);if(c)return this._convertCmykToRgb(a)}return a}};
return a}();"use strict";var g=function(){function a(a,b,c){this.data=a;this.bp=b;this.dataEnd=c;this.chigh=a[b];this.clow=0;this.byteIn();this.chigh=this.chigh<<7&65535|this.clow>>9&127;this.clow=this.clow<<7&65535;this.ct-=7;this.a=32768}var b=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},
{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,
switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,
nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},
{qe:22017,nmps:46,nlps:46,switchFlag:0}];a.prototype={byteIn:function(){var a=this.data,b=this.bp;255===a[b]?143<a[b+1]?(this.clow+=65280,this.ct=8):(b++,this.clow+=a[b]<<9,this.ct=7,this.bp=b):(b++,this.clow+=b<this.dataEnd?a[b]<<8:65280,this.ct=8,this.bp=b);65535<this.clow&&(this.chigh+=this.clow>>16,this.clow&=65535)},readBit:function(a,c){var d=a[c]>>1,e=a[c]&1;d=b[d];var k=d.qe,g=this.a-k;if(this.chigh<k)g<k?(g=k,k=e,d=d.nmps):(g=k,k=1^e,1===d.switchFlag&&(e=k),d=d.nlps);else{this.chigh-=k;if(0!==
(g&32768))return this.a=g,e;g<k?(k=1^e,1===d.switchFlag&&(e=k),d=d.nlps):(k=e,d=d.nmps)}do 0===this.ct&&this.byteIn(),g<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--;while(0===(g&32768));this.a=g;a[c]=d<<1|e;return k}};return a}();"use strict";var f=function(){function c(){this.failOnCorruptedImage=!1}function e(a,b,c){a=c.xcb_;c=c.ycb_;var d=1<<a,e=1<<c,k=b.tbx0>>a,g=b.tby0>>c,h=b.tbx1+d-1>>a,f=b.tby1+e-1>>c,l=b.resolution.precinctParameters,u=[],m=[],
y,p;for(p=g;p<f;p++)for(y=k;y<h;y++){var w={cbx:y,cby:p,tbx0:d*y,tby0:e*p,tbx1:d*(y+1),tby1:e*(p+1)};w.tbx0_=Math.max(b.tbx0,w.tbx0);w.tby0_=Math.max(b.tby0,w.tby0);w.tbx1_=Math.min(b.tbx1,w.tbx1);w.tby1_=Math.min(b.tby1,w.tby1);var n=Math.floor((w.tbx0_-b.tbx0)/l.precinctWidthInSubband)+Math.floor((w.tby0_-b.tby0)/l.precinctHeightInSubband)*l.numprecinctswide;w.precinctNumber=n;w.subbandType=b.type;w.Lblock=3;if(!(w.tbx1_<=w.tbx0_||w.tby1_<=w.tby0_)){u.push(w);var t=m[n];void 0!==t?(y<t.cbxMin?t.cbxMin=
y:y>t.cbxMax&&(t.cbxMax=y),p<t.cbyMin?t.cbxMin=p:p>t.cbyMax&&(t.cbyMax=p)):m[n]=t={cbxMin:y,cbyMin:p,cbxMax:y,cbyMax:p};w.precinct=t}}b.codeblockParameters={codeblockWidth:a,codeblockHeight:c,numcodeblockwide:h-k+1,numcodeblockhigh:f-g+1};b.codeblocks=u;b.precincts=m}function k(a,b,c){var d=[];a=a.subbands;for(var e=0,k=a.length;e<k;e++)for(var g=a[e].codeblocks,h=0,f=g.length;h<f;h++){var l=g[h];l.precinctNumber===b&&d.push(l)}return{layerNumber:c,codeblocks:d}}function h(a){var b=a.tiles[a.currentTile.index],
c=b.codingStyleDefaultParameters.layersCount,d=a.SIZ.Csiz,e=0;for(a=0;a<d;a++)e=Math.max(e,b.components[a].codingStyleParameters.decompositionLevelsCount);var g=0,h=0,f=0,l=0;this.nextPacket=function(){for(;g<c;g++){for(;h<=e;h++){for(;f<d;f++){var a=b.components[f];if(!(h>a.codingStyleParameters.decompositionLevelsCount)){a=a.resolutions[h];for(var u=a.precinctParameters.numprecincts;l<u;)return a=k(a,l,g),l++,a;l=0}}f=0}h=0}throw Error("JPX Error: Out of packets");}}function f(a){var b=a.tiles[a.currentTile.index],
c=b.codingStyleDefaultParameters.layersCount,d=a.SIZ.Csiz,e=0;for(a=0;a<d;a++)e=Math.max(e,b.components[a].codingStyleParameters.decompositionLevelsCount);var g=0,h=0,f=0,l=0;this.nextPacket=function(){for(;g<=e;g++){for(;h<c;h++){for(;f<d;f++){var a=b.components[f];if(!(g>a.codingStyleParameters.decompositionLevelsCount)){a=a.resolutions[g];for(var u=a.precinctParameters.numprecincts;l<u;)return a=k(a,l,h),l++,a;l=0}}f=0}h=0}throw Error("JPX Error: Out of packets");}}function l(a){var b=a.tiles[a.currentTile.index],
c=b.codingStyleDefaultParameters.layersCount,d=a.SIZ.Csiz,e,g,h,f=0;for(h=0;h<d;h++)f=Math.max(f,b.components[h].codingStyleParameters.decompositionLevelsCount);var l=new Int32Array(f+1);for(g=0;g<=f;++g){for(h=a=0;h<d;++h){var u=b.components[h].resolutions;g<u.length&&(a=Math.max(a,u[g].precinctParameters.numprecincts))}l[g]=a}var m=h=g=e=0;this.nextPacket=function(){for(;g<=f;g++){for(;m<l[g];m++){for(;h<d;h++){var a=b.components[h];if(!(g>a.codingStyleParameters.decompositionLevelsCount||(a=a.resolutions[g],
m>=a.precinctParameters.numprecincts))){for(;e<c;)return a=k(a,m,e),e++,a;e=0}}h=0}m=0}throw Error("JPX Error: Out of packets");}}function p(a){var b=a.tiles[a.currentTile.index],c=b.codingStyleDefaultParameters.layersCount,d=a.SIZ.Csiz,e=u(b),g=0,h=0,f=0,l=0,m=0;this.nextPacket=function(){for(;m<e.maxNumHigh;m++){for(;l<e.maxNumWide;l++){for(;f<d;f++){for(var a=b.components[f],u=a.codingStyleParameters.decompositionLevelsCount;h<=u;h++){var y=a.resolutions[h],p=q(l,m,e.components[f].resolutions[h],
e,y);if(null!==p){for(;g<c;)return a=k(y,p,g),g++,a;g=0}}h=0}f=0}l=0}throw Error("JPX Error: Out of packets");}}function r(a){var b=a.tiles[a.currentTile.index],c=b.codingStyleDefaultParameters.layersCount,d=a.SIZ.Csiz,e=u(b),g=0,h=0,f=0,l=0,m=0;this.nextPacket=function(){for(;f<d;++f){for(var a=b.components[f],u=e.components[f],y=a.codingStyleParameters.decompositionLevelsCount;m<u.maxNumHigh;m++){for(;l<u.maxNumWide;l++){for(;h<=y;h++){var p=a.resolutions[h],w=q(l,m,u.resolutions[h],u,p);if(null!==
w){for(;g<c;)return a=k(p,w,g),g++,a;g=0}}h=0}l=0}m=0}throw Error("JPX Error: Out of packets");}}function q(a,b,c,d,e){a*=d.minWidth;b*=d.minHeight;return 0!==a%c.width||0!==b%c.height?null:a/c.height+b/c.width*e.precinctParameters.numprecinctswide}function u(a){for(var b=a.components.length,c=Number.MAX_VALUE,d=Number.MAX_VALUE,e=0,k=0,g=Array(b),h=0;h<b;h++){for(var f=a.components[h],l=f.codingStyleParameters.decompositionLevelsCount,u=Array(l+1),m=Number.MAX_VALUE,p=Number.MAX_VALUE,w=0,n=0,t=
1;0<=l;--l){var r=f.resolutions[l],H=t*r.precinctParameters.precinctWidth,q=t*r.precinctParameters.precinctHeight;m=Math.min(m,H);p=Math.min(p,q);w=Math.max(w,r.precinctParameters.numprecinctswide);n=Math.max(n,r.precinctParameters.numprecinctshigh);u[l]={width:H,height:q};t<<=1}c=Math.min(c,m);d=Math.min(d,p);e=Math.max(e,w);k=Math.max(k,n);g[h]={resolutions:u,minWidth:m,minHeight:p,maxNumWide:w,maxNumHigh:n}}return{components:g,minWidth:c,minHeight:d,maxNumWide:e,maxNumHigh:k}}function v(b,c,d,
e){function k(a){for(;u<a;){var b=c[d+f];f++;m?(l=l<<7|b,u+=7,m=!1):(l=l<<8|b,u+=8);255===b&&(m=!0)}u-=a;return l>>>u&(1<<a)-1}function g(a){return 255===c[d+f-1]&&c[d+f]===a?(f+=1,!0):255===c[d+f]&&c[d+f+1]===a?(f+=2,!0):!1}function h(){if(0===k(1))return 1;if(0===k(1))return 2;var a=k(2);if(3>a)return a+3;a=k(5);if(31>a)return a+6;a=k(7);return a+37}var f=0,l,u=0,m=!1,p=b.COD.sopMarkerUsed,y=b.COD.ephMarkerUsed;for(b=b.tiles[b.currentTile.index].packetsIterator;f<e;){u=0;m&&(f++,m=!1);p&&g(145)&&
(f+=4);var w=b.nextPacket();if(k(1)){for(var n=w.layerNumber,t=[],r,H=0,q=w.codeblocks.length;H<q;H++){r=w.codeblocks[H];var v=r.precinct,M=r.cbx-v.cbxMin,B=r.cby-v.cbyMin,G=!1,A=!1;if(void 0!==r.included)G=!!k(1);else{v=r.precinct;if(void 0!==v.inclusionTree)var F=v.inclusionTree;else{var R=v.cbxMax-v.cbxMin+1;var L=v.cbyMax-v.cbyMin+1;F=new z(R,L,n);R=new x(R,L);v.inclusionTree=F;v.zeroBitPlanesTree=R}if(F.reset(M,B,n))for(;;)if(k(1)){if(L=!F.nextLevel()){G=A=r.included=!0;break}}else{F.incrementValue(n);
break}}if(G){if(A){R=v.zeroBitPlanesTree;for(R.reset(M,B);;)if(k(1)){if(L=!R.nextLevel())break}else R.incrementValue();r.zeroBitPlanes=R.value}for(v=h();k(1);)r.Lblock++;M=a(v);M=k((v<1<<M?M-1:M)+r.Lblock);t.push({codeblock:r,codingpasses:v,dataLength:M})}}u=0;m&&(f++,m=!1);for(y&&g(146);0<t.length;)w=t.shift(),r=w.codeblock,void 0===r.data&&(r.data=[]),r.data.push({data:c,start:d+f,end:d+f+w.dataLength,codingpasses:w.codingpasses}),f+=w.dataLength}}return f}var H={LL:0,LH:1,HL:1,HH:2};c.prototype=
{parse:function(a){if(65359===b(a,0))this.parseCodestream(a,0,a.length);else for(var c=0,e=a.length;c<e;){var k=8,g=d(a,c),h=d(a,c+4);c+=k;1===g&&(g=4294967296*d(a,c)+d(a,c+4),c+=8,k+=8);0===g&&(g=e-c+k);if(g<k)throw Error("JPX Error: Invalid box field size");k=g-k;g=!0;switch(h){case 1785737832:g=!1;break;case 1668246642:h=a[c];if(1===h)switch(h=d(a,c+3),h){case 16:case 17:case 18:break;default:m("Unknown colorspace "+h)}else 2===h&&n("ICC profile not supported");break;case 1785737827:this.parseCodestream(a,
c,c+k);break;case 1783636E3:218793738!==d(a,c)&&m("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var f=String.fromCharCode(h>>24&255,h>>16&255,h>>8&255,h&255);m("Unsupported header type "+h+" ("+f+")")}g&&(c+=k)}},parseImageProperties:function(a){for(var b=a.getByte();0<=b;){var c=b;b=a.getByte();if(65361===(c<<8|b)){a.skip(4);b=a.getInt32()>>>0;c=a.getInt32()>>>0;var d=a.getInt32()>>>0,e=a.getInt32()>>>0;a.skip(16);a=a.getUint16();
this.width=b-d;this.height=c-e;this.componentsCount=a;this.bitsPerComponent=8;return}}throw Error("JPX Error: No size marker found in JPX stream");},parseCodestream:function(a,c,k){var u={};try{var w=!1;for(var y=c;y+1<k;){var n=b(a,y);y+=2;var t=0,q;switch(n){case 65359:u.mainHeader=!0;break;case 65497:break;case 65361:t=b(a,y);var M={};M.Xsiz=d(a,y+4);M.Ysiz=d(a,y+8);M.XOsiz=d(a,y+12);M.YOsiz=d(a,y+16);M.XTsiz=d(a,y+20);M.YTsiz=d(a,y+24);M.XTOsiz=d(a,y+28);M.YTOsiz=d(a,y+32);var B=b(a,y+36);M.Csiz=
B;var G=[];var x=y+38;for(var A=0;A<B;A++){var z={precision:(a[x]&127)+1,isSigned:!!(a[x]&128),XRsiz:a[x+1],YRsiz:a[x+1]},F=z,I=M;F.x0=Math.ceil(I.XOsiz/F.XRsiz);F.x1=Math.ceil(I.Xsiz/F.XRsiz);F.y0=Math.ceil(I.YOsiz/F.YRsiz);F.y1=Math.ceil(I.Ysiz/F.YRsiz);F.width=F.x1-F.x0;F.height=F.y1-F.y0;G.push(z)}u.SIZ=M;u.components=G;for(var D=void 0,J=u,K=G,C=J.SIZ,L=[],O=Math.ceil((C.Xsiz-C.XTOsiz)/C.XTsiz),mc=Math.ceil((C.Ysiz-C.YTOsiz)/C.YTsiz),Xa=0;Xa<mc;Xa++)for(var Ya=0;Ya<O;Ya++)D={},D.tx0=Math.max(C.XTOsiz+
Ya*C.XTsiz,C.XOsiz),D.ty0=Math.max(C.YTOsiz+Xa*C.YTsiz,C.YOsiz),D.tx1=Math.min(C.XTOsiz+(Ya+1)*C.XTsiz,C.Xsiz),D.ty1=Math.min(C.YTOsiz+(Xa+1)*C.YTsiz,C.Ysiz),D.width=D.tx1-D.tx0,D.height=D.ty1-D.ty0,D.components=[],L.push(D);J.tiles=L;for(var Za=0,nc=C.Csiz;Za<nc;Za++)for(var $a=K[Za],hb=0,oc=L.length;hb<oc;hb++){var ha={};D=L[hb];ha.tcx0=Math.ceil(D.tx0/$a.XRsiz);ha.tcy0=Math.ceil(D.ty0/$a.YRsiz);ha.tcx1=Math.ceil(D.tx1/$a.XRsiz);ha.tcy1=Math.ceil(D.ty1/$a.YRsiz);ha.width=ha.tcx1-ha.tcx0;ha.height=
ha.tcy1-ha.tcy0;D.components[Za]=ha}u.QCC=[];u.COC=[];break;case 65372:t=b(a,y);var Ja={};x=y+2;var va=a[x++];switch(va&31){case 0:var na=8;var wa=!0;break;case 1:na=16;wa=!1;break;case 2:na=16;wa=!0;break;default:throw Error("JPX Error: Invalid SQcd value "+va);}Ja.noQuantization=8===na;Ja.scalarExpounded=wa;Ja.guardBits=va>>5;for(q=[];x<t+y;){var ia={};8===na?(ia.epsilon=a[x++]>>3,ia.mu=0):(ia.epsilon=a[x]>>3,ia.mu=(a[x]&7)<<8|a[x+1],x+=2);q.push(ia)}Ja.SPqcds=q;u.mainHeader?u.QCD=Ja:(u.currentTile.QCD=
Ja,u.currentTile.QCC=[]);break;case 65373:t=b(a,y);var Ka={};x=y+2;if(257>u.SIZ.Csiz)var ib=a[x++];else ib=b(a,x),x+=2;va=a[x++];switch(va&31){case 0:na=8;wa=!0;break;case 1:na=16;wa=!1;break;case 2:na=16;wa=!0;break;default:throw Error("JPX Error: Invalid SQcd value "+va);}Ka.noQuantization=8===na;Ka.scalarExpounded=wa;Ka.guardBits=va>>5;for(q=[];x<t+y;)ia={},8===na?(ia.epsilon=a[x++]>>3,ia.mu=0):(ia.epsilon=a[x]>>3,ia.mu=(a[x]&7)<<8|a[x+1],x+=2),q.push(ia);Ka.SPqcds=q;u.mainHeader?u.QCC[ib]=Ka:
u.currentTile.QCC[ib]=Ka;break;case 65362:t=b(a,y);var S={};x=y+2;var jb=a[x++];S.entropyCoderWithCustomPrecincts=!!(jb&1);S.sopMarkerUsed=!!(jb&2);S.ephMarkerUsed=!!(jb&4);S.progressionOrder=a[x++];S.layersCount=b(a,x);x+=2;S.multipleComponentTransform=a[x++];S.decompositionLevelsCount=a[x++];S.xcb=(a[x++]&15)+2;S.ycb=(a[x++]&15)+2;var La=a[x++];S.selectiveArithmeticCodingBypass=!!(La&1);S.resetContextProbabilities=!!(La&2);S.terminationOnEachCodingPass=!!(La&4);S.verticalyStripe=!!(La&8);S.predictableTermination=
!!(La&16);S.segmentationSymbolUsed=!!(La&32);S.reversibleTransformation=a[x++];if(S.entropyCoderWithCustomPrecincts){for(var Jb=[];x<t+y;){var Kb=a[x++];Jb.push({PPx:Kb&15,PPy:Kb>>4})}S.precinctsSizes=Jb}var xa=[];S.selectiveArithmeticCodingBypass&&xa.push("selectiveArithmeticCodingBypass");S.resetContextProbabilities&&xa.push("resetContextProbabilities");S.terminationOnEachCodingPass&&xa.push("terminationOnEachCodingPass");S.verticalyStripe&&xa.push("verticalyStripe");S.predictableTermination&&xa.push("predictableTermination");
if(0<xa.length)throw w=!0,Error("JPX Error: Unsupported COD options ("+xa.join(", ")+")");u.mainHeader?u.COD=S:(u.currentTile.COD=S,u.currentTile.COC=[]);break;case 65424:t=b(a,y);var Y={};Y.index=b(a,y+2);Y.length=d(a,y+4);Y.dataEnd=Y.length+y-2;Y.partIndex=a[y+8];Y.partsCount=a[y+9];u.mainHeader=!1;0===Y.partIndex&&(Y.COD=u.COD,Y.COC=u.COC.slice(0),Y.QCD=u.QCD,Y.QCC=u.QCC.slice(0));u.currentTile=Y;break;case 65427:Y=u.currentTile;if(0===Y.partIndex){for(var oa=u,pc=oa.SIZ.Csiz,Lb=oa.tiles[Y.index],
ya=0;ya<pc;ya++){var Mb=Lb.components[ya];Mb.quantizationParameters=void 0!==oa.currentTile.QCC[ya]?oa.currentTile.QCC[ya]:oa.currentTile.QCD;Mb.codingStyleParameters=void 0!==oa.currentTile.COC[ya]?oa.currentTile.COC[ya]:oa.currentTile.COD}Lb.codingStyleDefaultParameters=oa.currentTile.COD;for(var da=u,za=da.tiles[da.currentTile.index],qc=da.SIZ.Csiz,kb=0;kb<qc;kb++){for(var U=za.components[kb],lb=U.codingStyleParameters.decompositionLevelsCount,Nb=[],Oa=[],Aa=0;Aa<=lb;Aa++){var ab=Aa,Ba=U.codingStyleParameters,
ja={};Ba.entropyCoderWithCustomPrecincts?(ja.PPx=Ba.precinctsSizes[ab].PPx,ja.PPy=Ba.precinctsSizes[ab].PPy):(ja.PPx=15,ja.PPy=15);ja.xcb_=0<ab?Math.min(Ba.xcb,ja.PPx-1):Math.min(Ba.xcb,ja.PPx);ja.ycb_=0<ab?Math.min(Ba.ycb,ja.PPy-1):Math.min(Ba.ycb,ja.PPy);var ra=ja;var V={},sa=1<<lb-Aa;V.trx0=Math.ceil(U.tcx0/sa);V.try0=Math.ceil(U.tcy0/sa);V.trx1=Math.ceil(U.tcx1/sa);V.try1=Math.ceil(U.tcy1/sa);V.resLevel=Aa;var mb=1<<ra.PPx,nb=1<<ra.PPy,Ob=0===V.resLevel,Pb=V.trx1>V.trx0?Math.ceil(V.trx1/mb)-Math.floor(V.trx0/
mb):0,Qb=V.try1>V.try0?Math.ceil(V.try1/nb)-Math.floor(V.try0/nb):0;V.precinctParameters={precinctWidth:mb,precinctHeight:nb,numprecinctswide:Pb,numprecinctshigh:Qb,numprecincts:Pb*Qb,precinctWidthInSubband:1<<ra.PPx+(Ob?0:-1),precinctHeightInSubband:1<<ra.PPy+(Ob?0:-1)};Nb.push(V);if(0===Aa){var P={type:"LL"};P.tbx0=Math.ceil(U.tcx0/sa);P.tby0=Math.ceil(U.tcy0/sa);P.tbx1=Math.ceil(U.tcx1/sa);P.tby1=Math.ceil(U.tcy1/sa);P.resolution=V;e(da,P,ra);Oa.push(P);V.subbands=[P]}else{var ea=1<<lb-Aa+1,bb=
[];P={type:"HL"};P.tbx0=Math.ceil(U.tcx0/ea-.5);P.tby0=Math.ceil(U.tcy0/ea);P.tbx1=Math.ceil(U.tcx1/ea-.5);P.tby1=Math.ceil(U.tcy1/ea);P.resolution=V;e(da,P,ra);Oa.push(P);bb.push(P);P={type:"LH"};P.tbx0=Math.ceil(U.tcx0/ea);P.tby0=Math.ceil(U.tcy0/ea-.5);P.tbx1=Math.ceil(U.tcx1/ea);P.tby1=Math.ceil(U.tcy1/ea-.5);P.resolution=V;e(da,P,ra);Oa.push(P);bb.push(P);P={type:"HH"};P.tbx0=Math.ceil(U.tcx0/ea-.5);P.tby0=Math.ceil(U.tcy0/ea-.5);P.tbx1=Math.ceil(U.tcx1/ea-.5);P.tby1=Math.ceil(U.tcy1/ea-.5);
P.resolution=V;e(da,P,ra);Oa.push(P);bb.push(P);V.subbands=bb}}U.resolutions=Nb;U.subbands=Oa}var Rb=za.codingStyleDefaultParameters.progressionOrder;switch(Rb){case 0:za.packetsIterator=new h(da);break;case 1:za.packetsIterator=new f(da);break;case 2:za.packetsIterator=new l(da);break;case 3:za.packetsIterator=new p(da);break;case 4:za.packetsIterator=new r(da);break;default:throw Error("JPX Error: Unsupported progression order "+Rb);}}t=Y.dataEnd-y;v(u,a,y,t);break;case 65365:case 65367:case 65368:case 65380:t=
b(a,y);break;case 65363:throw Error("JPX Error: Codestream code 0xFF53 (COC) is not implemented");default:throw Error("JPX Error: Unknown codestream code: "+n.toString(16));}y+=t}}catch(Sb){if(w||this.failOnCorruptedImage)throw Sb;m("Trying to recover from "+Sb.message)}for(var Tb=u.components,Ma=u.SIZ.Csiz,Ub=[],ob=0,rc=u.tiles.length;ob<rc;ob++){var pb=u.tiles[ob],Ca=[],fa;for(fa=0;fa<Ma;fa++){for(var sc=Ca,tc=fa,Da=pb.components[fa],qb=Da.codingStyleParameters,rb=Da.quantizationParameters,uc=qb.decompositionLevelsCount,
cb=rb.SPqcds,vc=rb.scalarExpounded,wc=rb.guardBits,xc=qb.segmentationSymbolUsed,yc=u.components[fa].precision,sb=qb.reversibleTransformation,zc=sb?new Q:new N,Vb=[],tb=0,Pa=0;Pa<=uc;Pa++){for(var Na=Da.resolutions[Pa],ub=Na.trx1-Na.trx0,Wb=Na.try1-Na.try0,Xb=new Float32Array(ub*Wb),vb=0,Ac=Na.subbands.length;vb<Ac;vb++){if(vc){var Yb=cb[tb].mu;var wb=cb[tb].epsilon;tb++}else Yb=cb[0].mu,wb=cb[0].epsilon+(0<Pa?1-Pa:0);for(var Zb=Na.subbands[vb],Bc=H[Zb.type],Cc=Xb,$b=ub,ta=Zb,Dc=sb?1:Math.pow(2,yc+
Bc-wb)*(1+Yb/2048),xb=wc+wb-1,ac=sb,Ec=xc,Fc=ta.tbx0,Gc=ta.tby0,db=ta.tbx1-ta.tbx0,bc=ta.codeblocks,Hc="H"===ta.type.charAt(0)?1:0,Ic="H"===ta.type.charAt(1)?$b:0,yb=0,Jc=bc.length;yb<Jc;++yb){var ka=bc[yb],eb=ka.tbx1_-ka.tbx0_,zb=ka.tby1_-ka.tby0_;if(0!==eb&&0!==zb&&void 0!==ka.data){var ua=new E(eb,zb,ka.subbandType,ka.zeroBitPlanes,xb);var Ab=2;var fb=ka.data,Bb=0,cc=0,gb;var ba=0;for(gb=fb.length;ba<gb;ba++){var Ea=fb[ba];Bb+=Ea.end-Ea.start;cc+=Ea.codingpasses}var dc=new Uint8Array(Bb),Fa=0;
ba=0;for(gb=fb.length;ba<gb;ba++){Ea=fb[ba];var ec=Ea.data.subarray(Ea.start,Ea.end);dc.set(ec,Fa);Fa+=ec.length}var Kc=new g(dc,0,Bb);ua.setDecoder(Kc);for(ba=0;ba<cc;ba++){switch(Ab){case 0:ua.runSignificancePropogationPass();break;case 1:ua.runMagnitudeRefinementPass();break;case 2:ua.runCleanupPass(),Ec&&ua.checkSegmentationSymbol()}Ab=(Ab+1)%3}var Qa=ka.tbx0_-Fc+(ka.tby0_-Gc)*db,Lc=ua.coefficentsSign,Mc=ua.coefficentsMagnitude,Nc=ua.bitsDecoded,Oc=ac?0:.5,Cb;Fa=0;var Pc="LL"!==ta.type;for(ba=
0;ba<zb;ba++){var Qc=2*(Qa/db|0)*($b-db)+Hc+Ic;for(Cb=0;Cb<eb;Cb++){var Ga=Mc[Fa];if(0!==Ga){Ga=(Ga+Oc)*Dc;0!==Lc[Fa]&&(Ga=-Ga);var fc=Nc[Fa];Cc[Pc?Qc+(Qa<<1):Qa]=ac&&fc>=xb?Ga:Ga*(1<<xb-fc)}Qa++;Fa++}Qa+=db-eb}}}}Vb.push({width:ub,height:Wb,items:Xb})}var Db=zc.calculate(Vb,Da.tcx0,Da.tcy0);sc[tc]={left:Da.tcx0,top:Da.tcy0,width:Db.width,height:Db.height,items:Db.items}}var Ra=Ca[0],pa=new Uint8Array(Ra.items.length*Ma),Rc={left:Ra.left,top:Ra.top,width:Ra.width,height:Ra.height,items:pa},aa=0,X;
if(pb.codingStyleDefaultParameters.multipleComponentTransform){var gc=4===Ma,Eb=Ca[0].items,hc=Ca[1].items,ic=Ca[2].items,Sc=gc?Ca[3].items:null;var ca=Tb[0].precision-8;var Sa=(128<<ca)+.5;var la=255*(1<<ca);var jc=.5*la;var Fb=-jc;var Tc=pb.components[0],kc=Ma-3;var Ta=Eb.length;if(Tc.codingStyleParameters.reversibleTransformation)for(X=0;X<Ta;X++,aa+=kc){var Ua=Eb[X]+Sa;var Va=hc[X];var Wa=ic[X];var qa=Ua-(Wa+Va>>2);var Ha=qa+Wa;var Ia=qa+Va;pa[aa++]=0>=Ha?0:Ha>=la?255:Ha>>ca;pa[aa++]=0>=qa?0:
qa>=la?255:qa>>ca;pa[aa++]=0>=Ia?0:Ia>=la?255:Ia>>ca}else for(X=0;X<Ta;X++,aa+=kc)Ua=Eb[X]+Sa,Va=hc[X],Wa=ic[X],Ha=Ua+1.402*Wa,qa=Ua-.34413*Va-.71414*Wa,Ia=Ua+1.772*Va,pa[aa++]=0>=Ha?0:Ha>=la?255:Ha>>ca,pa[aa++]=0>=qa?0:qa>=la?255:qa>>ca,pa[aa++]=0>=Ia?0:Ia>=la?255:Ia>>ca;if(gc)for(X=0,aa=3;X<Ta;X++,aa+=4){var Gb=Sc[X];pa[aa]=Gb<=Fb?0:Gb>=jc?255:Gb+Sa>>ca}}else for(fa=0;fa<Ma;fa++){var lc=Ca[fa].items;ca=Tb[fa].precision-8;Sa=(128<<ca)+.5;la=127.5*(1<<ca);Fb=-la;aa=fa;X=0;for(Ta=lc.length;X<Ta;X++){var Hb=
lc[X];pa[aa]=Hb<=Fb?0:Hb>=la?255:Hb+Sa>>ca;aa+=Ma}}Ub.push(Rc)}this.tiles=Ub;this.width=u.SIZ.Xsiz-u.SIZ.XOsiz;this.height=u.SIZ.Ysiz-u.SIZ.YOsiz;this.componentsCount=u.SIZ.Csiz}};var x=function(){function b(b,c){var d=a(Math.max(b,c))+1;this.levels=[];for(var e=0;e<d;e++)this.levels.push({width:b,height:c,items:[]}),b=Math.ceil(b/2),c=Math.ceil(c/2)}b.prototype={reset:function(a,b){for(var c=0,d=0,e;c<this.levels.length;){e=this.levels[c];var k=a+b*e.width;if(void 0!==e.items[k]){d=e.items[k];break}e.index=
k;a>>=1;b>>=1;c++}c--;e=this.levels[c];e.items[e.index]=d;this.currentLevel=c;delete this.value},incrementValue:function(){var a=this.levels[this.currentLevel];a.items[a.index]++},nextLevel:function(){var a=this.currentLevel,b=this.levels[a],c=b.items[b.index];a--;if(0>a)return this.value=c,!1;this.currentLevel=a;b=this.levels[a];b.items[b.index]=c;return!0}};return b}(),z=function(){function b(b,c,d){var e=a(Math.max(b,c))+1;this.levels=[];for(var k=0;k<e;k++){for(var g=new Uint8Array(b*c),h=0,f=
g.length;h<f;h++)g[h]=d;this.levels.push({width:b,height:c,items:g});b=Math.ceil(b/2);c=Math.ceil(c/2)}}b.prototype={reset:function(a,b,c){for(var d=0;d<this.levels.length;){var e=this.levels[d],k=a+b*e.width;e.index=k;e=e.items[k];if(255===e)break;if(e>c)return this.currentLevel=d,this.propagateValues(),!1;a>>=1;b>>=1;d++}this.currentLevel=d-1;return!0},incrementValue:function(a){var b=this.levels[this.currentLevel];b.items[b.index]=a+1;this.propagateValues()},propagateValues:function(){for(var a=
this.currentLevel,b=this.levels[a],c=b.items[b.index];0<=--a;)b=this.levels[a],b.items[b.index]=c},nextLevel:function(){var a=this.currentLevel,b=this.levels[a],c=b.items[b.index];b.items[b.index]=255;a--;if(0>a)return!1;this.currentLevel=a;b=this.levels[a];b.items[b.index]=c;return!0}};return b}(),E=function(){function a(a,e,k,g,h){this.width=a;this.height=e;this.contextLabelTable="HH"===k?d:"HL"===k?c:b;a*=e;this.neighborsSignificance=new Uint8Array(a);this.coefficentsSign=new Uint8Array(a);this.coefficentsMagnitude=
14<h?new Uint32Array(a):6<h?new Uint16Array(a):new Uint8Array(a);this.processingFlags=new Uint8Array(a);h=new Uint8Array(a);if(0!==g)for(e=0;e<a;e++)h[e]=g;this.bitsDecoded=h;this.reset()}var b=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),c=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,
0,0,0,2,3,4,0,6,7,7,0,8,8,8]),d=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);a.prototype={setDecoder:function(a){this.decoder=a},reset:function(){this.contexts=new Int8Array(19);this.contexts[0]=8;this.contexts[17]=92;this.contexts[18]=6},setNeighborsSignificance:function(a,b,c){var d=this.neighborsSignificance,e=this.width,k=this.height,g=0<b;b=b+1<e;if(0<a){var h=c-e;g&&(d[h-
1]+=16);b&&(d[h+1]+=16);d[h]+=4}a+1<k&&(h=c+e,g&&(d[h-1]+=16),b&&(d[h+1]+=16),d[h]+=4);g&&(d[c-1]+=1);b&&(d[c+1]+=1);d[c]|=128},runSignificancePropogationPass:function(){for(var a=this.decoder,b=this.width,c=this.height,d=this.coefficentsMagnitude,e=this.coefficentsSign,k=this.neighborsSignificance,g=this.processingFlags,h=this.contexts,f=this.contextLabelTable,l=this.bitsDecoded,u=0;u<c;u+=4)for(var m=0;m<b;m++)for(var p=u*b+m,w=0;4>w;w++,p+=b){var y=u+w;if(y>=c)break;g[p]&=-2;if(!d[p]&&k[p]){if(a.readBit(h,
f[k[p]])){var n=this.decodeSignBit(y,m,p);e[p]=n;d[p]=1;this.setNeighborsSignificance(y,m,p);g[p]|=2}l[p]++;g[p]|=1}}},decodeSignBit:function(a,b,c){var d=this.width,e=this.height,k=this.coefficentsMagnitude,g=this.coefficentsSign;var h=0<b&&0!==k[c-1];b+1<d&&0!==k[c+1]?(b=g[c+1],h?(h=g[c-1],b=1-b-h):b=1-b-b):h?(h=g[c-1],b=1-h-h):b=0;var f=3*b;h=0<a&&0!==k[c-d];a+1<e&&0!==k[c+d]?(b=g[c+d],h?(h=g[c-d],b=1-b-h+f):b=1-b-b+f):h?(h=g[c-d],b=1-h-h+f):b=f;return 0<=b?this.decoder.readBit(this.contexts,9+
b):this.decoder.readBit(this.contexts,9-b)^1},runMagnitudeRefinementPass:function(){for(var a=this.decoder,b=this.width,c=this.coefficentsMagnitude,d=this.neighborsSignificance,e=this.contexts,k=this.bitsDecoded,g=this.processingFlags,h=b*this.height,f=4*b,l=0,u;l<h;l=u){u=Math.min(h,l+f);for(var m=0;m<b;m++)for(var p=l+m;p<u;p+=b)if(c[p]&&0===(g[p]&1)){var w=16;0!==(g[p]&2)&&(g[p]^=2,w=0===(d[p]&127)?15:14);w=a.readBit(e,w);c[p]=c[p]<<1|w;k[p]++;g[p]|=1}}},runCleanupPass:function(){for(var a=this.decoder,
b=this.width,c=this.height,d=this.neighborsSignificance,e=this.coefficentsMagnitude,k=this.coefficentsSign,g=this.contexts,h=this.contextLabelTable,f=this.bitsDecoded,l=this.processingFlags,u=2*b,m=3*b,p,w=0;w<c;w=p){p=Math.min(w+4,c);for(var y=w*b,n=w+3<c,t=0;t<b;t++){var r=y+t,H=0,q=r,v=w;if(n&&0===l[r]&&0===l[r+b]&&0===l[r+u]&&0===l[r+m]&&0===d[r]&&0===d[r+b]&&0===d[r+u]&&0===d[r+m]){if(!a.readBit(g,18)){f[r]++;f[r+b]++;f[r+u]++;f[r+m]++;continue}H=a.readBit(g,17)<<1|a.readBit(g,17);0!==H&&(v=
w+H,q+=H*b);var B=this.decodeSignBit(v,t,q);k[q]=B;e[q]=1;this.setNeighborsSignificance(v,t,q);l[q]|=2;q=r;for(r=w;r<=v;r++,q+=b)f[q]++;H++}for(v=w+H;v<p;v++,q+=b)e[q]||0!==(l[q]&1)||(1===a.readBit(g,h[d[q]])&&(B=this.decodeSignBit(v,t,q),k[q]=B,e[q]=1,this.setNeighborsSignificance(v,t,q),l[q]|=2),f[q]++)}}},checkSegmentationSymbol:function(){var a=this.decoder,b=this.contexts;if(10!==(a.readBit(b,17)<<3|a.readBit(b,17)<<2|a.readBit(b,17)<<1|a.readBit(b,17)))throw Error("JPX Error: Invalid segmentation symbol");
}};return a}(),O=function(){function a(){}a.prototype.calculate=function(a,b,c){for(var d=a[0],e=1,k=a.length;e<k;e++)d=this.iterate(d,a[e],b,c);return d};a.prototype.extend=function(a,b,c){var d=b-1,e=b+1,k=b+c-2;b+=c;a[d--]=a[e++];a[b++]=a[k--];a[d--]=a[e++];a[b++]=a[k--];a[d--]=a[e++];a[b++]=a[k--];a[d]=a[e];a[b]=a[k]};a.prototype.iterate=function(a,b,c,d){var e=a.width,k=a.height,g=a.items,h=b.width,f=b.height;b=b.items;var l,u,m;for(l=m=0;l<k;l++){var p=2*l*h;for(u=0;u<e;u++,m++,p+=2)b[p]=g[m]}a.items=
null;a=new Float32Array(h+8);if(1===h){if(0!==(c&1))for(m=p=0;p<f;p++,m+=h)b[m]*=.5}else for(m=p=0;p<f;p++,m+=h)a.set(b.subarray(m,m+h),4),this.extend(a,4,h),this.filter(a,4,h),b.set(a.subarray(4,4+h),m);c=16;e=[];for(l=0;l<c;l++)e.push(new Float32Array(f+8));l=0;a=4+f;if(1===f){if(0!==(d&1))for(d=0;d<h;d++)b[d]*=.5}else for(d=0;d<h;d++){if(0===l){c=Math.min(h-d,c);m=d;for(p=4;p<a;m+=h,p++)for(k=0;k<c;k++)e[k][p]=b[m+k];l=c}l--;m=e[l];this.extend(m,4,f);this.filter(m,4,f);if(0===l)for(m=d-c+1,p=4;p<
a;m+=h,p++)for(k=0;k<c;k++)b[m+k]=e[k][p]}return{width:h,height:f,items:b}};return a}(),N=function(){function a(){O.call(this)}a.prototype=Object.create(O.prototype);a.prototype.filter=function(a,b,c){c>>=1;b|=0;var d;var e=b-3;for(d=c+4;d--;e+=2)a[e]*=.8128930661159609;e=b-2;var k=.443506852043971*a[e-1];for(d=c+3;d--;e+=2){var g=.443506852043971*a[e+1];a[e]=1.230174104914001*a[e]-k-g;if(d--)e+=2,k=.443506852043971*a[e+1],a[e]=1.230174104914001*a[e]-k-g;else break}e=b-1;k=.882911075530934*a[e-1];
for(d=c+2;d--;e+=2)if(g=.882911075530934*a[e+1],a[e]-=k+g,d--)e+=2,k=.882911075530934*a[e+1],a[e]-=k+g;else break;e=b;k=-.052980118572961*a[e-1];for(d=c+1;d--;e+=2)if(g=-.052980118572961*a[e+1],a[e]-=k+g,d--)e+=2,k=-.052980118572961*a[e+1],a[e]-=k+g;else break;if(0!==c)for(e=b+1,k=-1.586134342059924*a[e-1],d=c;d--;e+=2)if(g=-1.586134342059924*a[e+1],a[e]-=k+g,d--)e+=2,k=-1.586134342059924*a[e+1],a[e]-=k+g;else break};return a}(),Q=function(){function a(){O.call(this)}a.prototype=Object.create(O.prototype);
a.prototype.filter=function(a,b,c){c>>=1;b|=0;var d;var e=b;for(d=c+1;d--;e+=2)a[e]-=a[e-1]+a[e+1]+2>>2;e=b+1;for(d=c;d--;e+=2)a[e]+=a[e-1]+a[e+1]>>1};return a}();return c}();"use strict";var h=function(){function c(){}function k(a,b,c){this.data=a;this.start=b;this.end=c}function h(a,b,c){function d(a){for(var b=0,d=0;d<a;d++){var h=c.readBit(e,k);k=256>k?k<<1|h:(k<<1|h)&511|256;b=b<<1|h}return b>>>0}var e=a.getContexts(b),k=1;a=d(1);b=d(1)?d(1)?d(1)?d(1)?d(1)?d(32)+4436:d(12)+340:d(8)+84:d(6)+20:
d(4)+4:d(2);return 0===a?b:0<b?-b:null}function f(a,b,c){a=a.getContexts("IAID");for(var d=1,e=0;e<c;e++){var k=b.readBit(a,d);d=d<<1|k}return 31>c?d&(1<<c)-1:d&2147483647}function m(a,b,c){var d=c.decoder;c=c.contextCache.getContexts("GB");var e,k,h,g=[];for(e=0;e<b;e++){var f=g[e]=new Uint8Array(a);var l=1>e?f:g[e-1];var u=2>e?f:g[e-2];var m=u[0]<<13|u[1]<<12|u[2]<<11|l[0]<<7|l[1]<<6|l[2]<<5|l[3]<<4;for(k=0;k<a;k++)f[k]=h=d.readBit(c,m),m=(m&31735)<<1|(k+3<a?u[k+3]<<11:0)|(k+4<a?l[k+4]<<4:0)|h}return g}
function p(a,b,c,d,e,k,h,g){a&&l("JBIG2 error: MMR encoding is not supported");if(0===d&&!k&&!e&&4===h.length&&3===h[0].x&&-1===h[0].y&&-3===h[1].x&&-1===h[1].y&&2===h[2].x&&-2===h[2].y&&-2===h[3].x&&-2===h[3].y)return m(b,c,g);a=!!k;var f=v[d].concat(h);f.sort(function(a,b){return a.y-b.y||a.x-b.x});h=f.length;var u=new Int8Array(h),p=new Int8Array(h),w=[],n=0,y=0,r=0,t=0,H,q;for(q=0;q<h;q++)u[q]=f[q].x,p[q]=f[q].y,y=Math.min(y,f[q].x),r=Math.max(r,f[q].x),t=Math.min(t,f[q].y),q<h-1&&f[q].y===f[q+
1].y&&f[q].x===f[q+1].x-1?n|=1<<h-1-q:w.push(q);var x=w.length,B=new Int8Array(x),G=new Int8Array(x),A=new Uint16Array(x);for(H=0;H<x;H++)q=w[H],B[H]=f[q].x,G[H]=f[q].y,A[H]=1<<h-1-q;f=-y;t=-t;r=b-r;d=E[d];w=new Uint8Array(b);y=[];H=g.decoder;g=g.contextCache.getContexts("GB");for(var F=0,z,M,D,I=0,N,C=0;C<c;C++){if(e&&(q=H.readBit(g,d),F^=q)){y.push(w);continue}w=new Uint8Array(w);y.push(w);for(z=0;z<b;z++)if(a&&k[C][z])w[z]=0;else{if(z>=f&&z<r&&C>=t)for(I=I<<1&n,q=0;q<x;q++){if(M=C+G[q],D=z+B[q],
M=y[M][D])M=A[q],I|=M}else for(I=0,N=h-1,q=0;q<h;q++,N--)D=z+u[q],0<=D&&D<b&&(M=C+p[q],0<=M&&(M=y[M][D])&&(I|=M<<N));q=H.readBit(g,I);w[z]=q}}return y}function w(a,b,c,d,e,k,h,g,f){var u=x[c].coding;0===c&&(u=u.concat([g[0]]));var m=u.length,p=new Int32Array(m),w=new Int32Array(m),n;for(n=0;n<m;n++)p[n]=u[n].x,w[n]=u[n].y;var y=x[c].reference;0===c&&(y=y.concat([g[1]]));g=y.length;u=new Int32Array(g);var r=new Int32Array(g);for(n=0;n<g;n++)u[n]=y[n].x,r[n]=y[n].y;y=d[0].length;var t=d.length;c=O[c];
var q=[],H=f.decoder;f=f.contextCache.getContexts("GR");for(var v=0,B=0;B<b;B++){h&&(n=H.readBit(f,c),(v^=n)&&l("JBIG2 error: prediction is not supported"));var G=new Uint8Array(a);q.push(G);for(var A=0;A<a;A++){var z=0;for(n=0;n<m;n++){var F=B+w[n];var M=A+p[n];z=0>F||0>M||M>=a?z<<1:z<<1|q[F][M]}for(n=0;n<g;n++)F=B+r[n]+k,M=A+u[n]+e,z=0>F||F>=t||0>M||M>=y?z<<1:z<<1|d[F][M];n=H.readBit(f,z);G[A]=n}}return q}function n(a,b,c,d,e,k,g,u,m,p,n,r,t,q,H,v,B){a&&l("JBIG2 error: huffman is not supported");
a=[];for(q=0;q<d;q++){var y=new Uint8Array(c);if(e)for(var x=0;x<c;x++)y[x]=e;a.push(y)}d=B.decoder;e=B.contextCache;x=-h(e,"IADT",d);var G=0;for(q=0;q<k;){var A=h(e,"IADT",d);x+=A;A=h(e,"IAFS",d);A=G+=A;do{var z=1===g?0:h(e,"IAIT",d);y=g*x+z;z=f(e,d,m);var F=b&&h(e,"IARI",d);z=u[z];var D=z[0].length,M=z.length;if(F){F=h(e,"IARDW",d);var I=h(e,"IARDH",d),C=h(e,"IARDX",d),N=h(e,"IARDY",d);D+=F;M+=I;z=w(D,M,H,z,(F>>1)+C,(I>>1)+N,!1,v,B)}F=y-(r&1?0:M);I=A-(r&2?D:0);if(p){for(C=0;C<M;C++)if(y=a[I+C]){var E=
z[C];var J=Math.min(c-F,D);switch(t){case 0:for(N=0;N<J;N++)y[F+N]|=E[N];break;case 2:for(N=0;N<J;N++)y[F+N]^=E[N];break;default:l("JBIG2 error: operator "+t+" is not supported")}}A+=M-1}else{for(N=0;N<M;N++)if(y=a[F+N])switch(E=z[N],t){case 0:for(C=0;C<D;C++)y[I+C]|=E[C];break;case 2:for(C=0;C<D;C++)y[I+C]^=E[C];break;default:l("JBIG2 error: operator "+t+" is not supported")}A+=D-1}q++;z=h(e,"IADS",d);if(null===z)break;A+=z+n}while(1)}return a}function r(a,b){return{width:d(a,b),height:d(a,b+4),
x:d(a,b+8),y:d(a,b+12),combinationOperator:a[b+16]&7}}function u(){}function q(){}c.prototype={getContexts:function(a){return a in this?this[a]:this[a]=new Int8Array(65536)}};k.prototype={get decoder(){var a=new g(this.data,this.start,this.end);return e(this,"decoder",a)},get contextCache(){var a=new c;return e(this,"contextCache",a)}};var H=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,
"patternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,
null,null,null,null,null,null,null,"Extension"],v=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,
y:0},{x:-2,y:0},{x:-1,y:0}]],x=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],E=[39717,1941,229,405],O=[32,8];u.prototype={onPageInformation:function(a){this.currentPageInfo=a;var b=new Uint8Array((a.width+7>>3)*a.height);if(a.defaultPixelValue){a=0;for(var c=b.length;a<c;a++)b[a]=
255}this.buffer=b},drawBitmap:function(a,b){var c=this.currentPageInfo,d=a.width,e=a.height,k=c.width+7>>3,h=c.combinationOperatorOverride?a.combinationOperator:c.combinationOperator;c=this.buffer;var g=128>>(a.x&7);a=a.y*k+(a.x>>3);var f;switch(h){case 0:for(h=0;h<e;h++){var u=g;var m=a;for(f=0;f<d;f++)b[h][f]&&(c[m]|=u),u>>=1,u||(u=128,m++);a+=k}break;case 2:for(h=0;h<e;h++){u=g;m=a;for(f=0;f<d;f++)b[h][f]&&(c[m]^=u),u>>=1,u||(u=128,m++);a+=k}break;default:l("JBIG2 error: operator "+h+" is not supported")}},
onImmediateGenericRegion:function(a,b,c,d){var e=a.info;b=new k(b,c,d);a=p(a.mmr,e.width,e.height,a.template,a.prediction,null,a.at,b);this.drawBitmap(e,a)},onImmediateLosslessGenericRegion:function(){this.onImmediateGenericRegion.apply(this,arguments)},onSymbolDictionary:function(b,c,d,e,g,u){b.huffman&&l("JBIG2 error: huffman is not supported");var m=this.symbols;m||(this.symbols=m={});for(var y=[],r=0,t=d.length;r<t;r++)y=y.concat(m[d[r]]);u=new k(e,g,u);r=b.huffman;t=b.refinement;d=y;y=b.numberOfNewSymbols;
var q=b.template,H=b.at,v=b.refinementTemplate,x=b.refinementAt;r&&l("JBIG2 error: huffman is not supported");b=[];var B=0,G=a(d.length+y);e=u.decoder;for(g=u.contextCache;b.length<y;){var A=h(g,"IADH",e);B+=A;for(A=0;;){var z=h(g,"IADW",e);if(null===z)break;A+=z;if(t)if(z=h(g,"IAAI",e),1<z)z=n(r,t,A,B,0,z,1,d.concat(b),G,0,0,1,0,void 0,v,x,u);else{z=f(g,e,G);var F=h(g,"IARDX",e),D=h(g,"IARDY",e);z=w(A,B,v,z<d.length?d[z]:b[z-d.length],F,D,!1,x,u)}else z=p(!1,A,B,q,!1,null,H,u);b.push(z)}}u=[];r=
[];t=!1;for(q=d.length+y;r.length<q;){for(H=h(g,"IAEX",e);H--;)r.push(t);t=!t}e=0;for(g=d.length;e<g;e++)r[e]&&u.push(d[e]);for(d=0;d<y;e++,d++)r[e]&&u.push(b[d]);m[c]=u},onImmediateTextRegion:function(b,c,d,e,h){for(var g=b.info,f=this.symbols,l=[],u=0,m=c.length;u<m;u++)l=l.concat(f[c[u]]);c=a(l.length);d=new k(d,e,h);b=n(b.huffman,b.refinement,g.width,g.height,b.defaultPixelValue,b.numberOfSymbolInstances,b.stripSize,l,c,b.transposed,b.dsOffset,b.referenceCorner,b.combinationOperator,void 0,b.refinementTemplate,
b.refinementAt,d);this.drawBitmap(g,b)},onImmediateLosslessTextRegion:function(){this.onImmediateTextRegion.apply(this,arguments)}};q.prototype={parseChunks:function(a){for(var c=new u,e=0,k=a.length;e<k;e++){for(var h=a[e],g={},f=h.data,m=h.end,p=[],w=h.start;w<m;){h=f;var n=w;w={};w.number=d(h,n);var t=h[n+4];var q=t&63;H[q]||l("JBIG2 error: invalid segment type: "+q);w.type=q;w.typeName=H[q];w.deferredNonRetain=!!(t&128);t=!!(t&64);var v=h[n+5],x=v>>5&7;var B=[v&31];n+=6;if(7===v)for(x=d(h,n-1)&
536870911,n+=3,v=x+7>>3,B[0]=h[n++];0<--v;)B.push(h[n++]);else 5!==v&&6!==v||l("JBIG2 error: invalid referred-to flags");w.retainBits=B;v=256>=w.number?1:65536>=w.number?2:4;var G=[];for(B=0;B<x;B++){var A=1===v?h[n]:2===v?b(h,n):d(h,n);G.push(A);n+=v}w.referredTo=G;t?(w.pageAssociation=d(h,n),n+=4):w.pageAssociation=h[n++];w.length=d(h,n);n+=4;if(4294967295===w.length)if(38===q){t=r(h,n);x=!!(h[n+17]&1);q=new Uint8Array(6);x||(q[0]=255,q[1]=172);q[2]=t.height>>>24&255;q[3]=t.height>>16&255;q[4]=
t.height>>8&255;q[5]=t.height&255;B=n;for(t=h.length;B<t;B++){for(x=0;6>x&&q[x]===h[B+x];)x++;if(6===x){w.length=B+6;break}}4294967295===w.length&&l("JBIG2 error: segment end was not found")}else l("JBIG2 error: invalid unknown segment length");w.headerEnd=n;h=w;w=h.headerEnd;n={header:h,data:f};g.randomAccess||(n.start=w,w+=h.length,n.end=w);p.push(n);if(51===h.type)break}if(g.randomAccess)for(g=0,f=p.length;g<f;g++)p[g].start=w,w+=p[g].header.length,p[g].end=w;g=c;f=0;for(m=p.length;f<m;f++){x=
void 0;t=p[f];h=g;w=t.header;n=t.data;q=t.start;t=t.end;switch(w.type){case 0:G={};x=b(n,q);G.huffman=!!(x&1);G.refinement=!!(x&2);G.huffmanDHSelector=x>>2&3;G.huffmanDWSelector=x>>4&3;G.bitmapSizeSelector=x>>6&1;G.aggregationInstancesSelector=x>>7&1;G.bitmapCodingContextUsed=!!(x&256);G.bitmapCodingContextRetained=!!(x&512);G.template=x>>10&3;G.refinementTemplate=x>>12&1;q+=2;if(!G.huffman){v=0===G.template?4:1;B=[];for(x=0;x<v;x++)B.push({x:n[q]<<24>>24,y:n[q+1]<<24>>24}),q+=2;G.at=B}if(G.refinement&&
!G.refinementTemplate){B=[];for(x=0;2>x;x++)B.push({x:n[q]<<24>>24,y:n[q+1]<<24>>24}),q+=2;G.refinementAt=B}G.numberOfExportedSymbols=d(n,q);q+=4;G.numberOfNewSymbols=d(n,q);x=[G,w.number,w.referredTo,n,q+4,t];break;case 6:case 7:v={};v.info=r(n,q);q+=17;x=b(n,q);q+=2;v.huffman=!!(x&1);v.refinement=!!(x&2);v.stripSize=1<<(x>>2&3);v.referenceCorner=x>>4&3;v.transposed=!!(x&64);v.combinationOperator=x>>7&3;v.defaultPixelValue=x>>9&1;v.dsOffset=x<<17>>27;v.refinementTemplate=x>>15&1;v.huffman&&(x=b(n,
q),q+=2,v.huffmanFS=x&3,v.huffmanDS=x>>2&3,v.huffmanDT=x>>4&3,v.huffmanRefinementDW=x>>6&3,v.huffmanRefinementDH=x>>8&3,v.huffmanRefinementDX=x>>10&3,v.huffmanRefinementDY=x>>12&3,v.huffmanRefinementSizeSelector=!!(x&14));if(v.refinement&&!v.refinementTemplate){B=[];for(x=0;2>x;x++)B.push({x:n[q]<<24>>24,y:n[q+1]<<24>>24}),q+=2;v.refinementAt=B}v.numberOfSymbolInstances=d(n,q);q+=4;v.huffman&&l("JBIG2 error: huffman is not supported");x=[v,w.referredTo,n,q,t];break;case 38:case 39:G={};G.info=r(n,
q);q+=17;x=n[q++];G.mmr=!!(x&1);G.template=x>>1&3;G.prediction=!!(x&8);if(!G.mmr){v=0===G.template?4:1;B=[];for(x=0;x<v;x++)B.push({x:n[q]<<24>>24,y:n[q+1]<<24>>24}),q+=2;G.at=B}x=[G,n,q,t];break;case 48:t={width:d(n,q),height:d(n,q+4),resolutionX:d(n,q+8),resolutionY:d(n,q+12)};4294967295===t.height&&delete t.height;x=n[q+16];b(n,q+17);t.lossless=!!(x&1);t.refinement=!!(x&2);t.defaultPixelValue=x>>2&1;t.combinationOperator=x>>3&3;t.requiresBuffer=!!(x&32);t.combinationOperatorOverride=!!(x&64);x=
[t];break;case 49:break;case 50:break;case 51:break;case 62:break;default:l("JBIG2 error: segment type "+w.typeName+"("+w.type+") is not implemented")}w="on"+w.typeName;w in h&&h[w].apply(h,x)}}return c}};return q}(),l=function(){console.error.apply(console,arguments);throw Error("PDFJS error: "+arguments[0]);},m=function(){console.warn.apply(console,arguments)},n=function(){console.info.apply(console,arguments)};h.prototype.parse=function(a){var b=0,c=a.length;151===a[b]&&74===a[b+1]&&66===a[b+2]&&
50===a[b+3]&&13===a[b+4]&&10===a[b+5]&&26===a[b+6]&&10===a[b+7]||l("JBIG2 error: invalid header");b+=8;a[b++]&2||(d(a,b),b+=4);a=this.parseChunks([{data:a,start:b,end:c}]);b=a.currentPageInfo.width;c=a.currentPageInfo.height;var e=a.buffer;a=new Uint8Array(b*c);for(var k=0,h=0,g=0;g<c;g++)for(var f=0,m,u=0;u<b;u++)f||(f=128,m=e[h++]),a[k++]=m&f?0:255,f>>=1;this.width=b;this.height=c;this.data=a};c.JpegImage=k;c.JpxImage=f;c.Jbig2Image=h})(e||(e={}));n.exports={JpegImage:f,JpegDecoder:e.JpegImage,
JpxDecoder:e.JpxImage,Jbig2Decoder:e.Jbig2Image}},function(n,f,l){l.d(f,"a",function(){return h});var h=function c(){if(!(this instanceof c))throw new TypeError("Cannot call a class as a function");};h.RPC_ID="ndstore/VolumeChunkSource"},function(n,f,l){f.a=function(a){if(147!==a[0]||78!==a[1]||85!==a[2]||77!==a[3]||80!==a[4]||89!==a[5])throw Error("Data does not match npy format.");var b=a[6],d=a[7];if(1!==b||0!==d)throw Error("Unsupported npy version "+b+"."+d);b=(new DataView(a.buffer,a.byteOffset,
a.byteLength)).getUint16(8,!0);d=(new TextDecoder("utf-8")).decode(a.subarray(10,b+10));b+=10;try{var k=Object(e.c)(d)}catch(t){throw Error("Failed to parse npy header: "+t);}var h=k.descr;d=k.shape;var f=1;if(!Array.isArray(d))throw Error("Invalid shape ${JSON.stringify(shape)}");for(var l=$jscomp.makeIterator(d),n=l.next();!n.done;n=l.next()){n=n.value;if("number"!==typeof n)throw Error("Invalid shape ${JSON.stringify(shape)}");f*=n}l=c.get(h);if(void 0===l)throw Error("Unsupported numpy data type "+
JSON.stringify(h));h=l.arrayConstructor;f*=l.javascriptElementsPerArrayElement;if(h.BYTES_PER_ELEMENT*f+b!==a.byteLength)throw Error("Expected length does not match length of data");a=new h(a.buffer,a.byteOffset+b,f);l.fixEndianness(a);return new p(a,d,l,!0===k.fortran_order)};n=l(7);var h=l(9),e=l(4),c=new Map;c.set("|u1",{arrayConstructor:Uint8Array,fixEndianness:function(){},javascriptElementsPerArrayElement:1,elementBytes:1,dataType:n.b.UINT8});c.set("|i1",{arrayConstructor:Uint8Array,fixEndianness:function(){},
javascriptElementsPerArrayElement:1,elementBytes:1,dataType:n.b.UINT8});l={};f=$jscomp.makeIterator([["<",h.b.LITTLE],[">",h.b.BIG]]);for(var a=f.next();!a.done;l={endianness:l.endianness},a=f.next()){var b=$jscomp.makeIterator(a.value);a=b.next().value;l.endianness=b.next().value;b=$jscomp.makeIterator(["u","i"]);for(var d=b.next();!d.done;d=b.next())d=d.value,c.set(""+a+d+"2",{arrayConstructor:Uint16Array,elementBytes:2,fixEndianness:function(a){return function(b){Object(h.c)(b,a.endianness)}}(l),
javascriptElementsPerArrayElement:1,dataType:n.b.UINT16}),c.set(""+a+d+"4",{arrayConstructor:Uint32Array,elementBytes:4,fixEndianness:function(a){return function(b){Object(h.d)(b,a.endianness)}}(l),javascriptElementsPerArrayElement:1,dataType:n.b.UINT32}),c.set(""+a+d+"8",{arrayConstructor:Uint32Array,elementBytes:8,fixEndianness:function(a){return function(b){Object(h.d)(b,a.endianness)}}(l),javascriptElementsPerArrayElement:2,dataType:n.b.UINT64});c.set(a+"f4",{arrayConstructor:Float32Array,elementBytes:4,
fixEndianness:function(a){return function(b){Object(h.d)(b,a.endianness)}}(l),javascriptElementsPerArrayElement:1,dataType:n.b.FLOAT32})}var p=function g(a,b,c,d){if(!(this instanceof g))throw new TypeError("Cannot call a class as a function");this.data=a;this.shape=b;this.dataType=c;this.fortranOrder=d}},function(n,f,l){function h(e){if(!(this instanceof h))return new h(e);e=this.options=a.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});e.raw&&0<e.windowBits?
e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&16>e.windowBits&&(e.windowBits+=16);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new p;this.strm.avail_out=0;var g=c.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==g)throw Error(d[g]);e.header&&c.deflateSetHeader(this.strm,e.header);if(e.dictionary){e="string"===typeof e.dictionary?b.string2buf(e.dictionary):"[object ArrayBuffer]"===k.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary;
g=c.deflateSetDictionary(this.strm,e);if(0!==g)throw Error(d[g]);this._dict_set=!0}}function e(a,b){b=new h(b);b.push(a,!0);if(b.err)throw b.msg||d[b.err];return b.result}var c=l(86),a=l(5),b=l(42),d=l(27),p=l(43),k=Object.prototype.toString;h.prototype.push=function(d,e){var h=this.strm,g=this.options.chunkSize;if(this.ended)return!1;e=e===~~e?e:!0===e?4:0;"string"===typeof d?h.input=b.string2buf(d):"[object ArrayBuffer]"===k.call(d)?h.input=new Uint8Array(d):h.input=d;h.next_in=0;h.avail_in=h.input.length;
do{0===h.avail_out&&(h.output=new a.Buf8(g),h.next_out=0,h.avail_out=g);d=c.deflate(h,e);if(1!==d&&0!==d)return this.onEnd(d),this.ended=!0,!1;if(0===h.avail_out||0===h.avail_in&&(4===e||2===e))if("string"===this.options.to)this.onData(b.buf2binstring(a.shrinkBuf(h.output,h.next_out)));else this.onData(a.shrinkBuf(h.output,h.next_out))}while((0<h.avail_in||0===h.avail_out)&&1!==d);if(4===e)return d=c.deflateEnd(this.strm),this.onEnd(d),this.ended=!0,0===d;2===e&&(this.onEnd(0),h.avail_out=0);return!0};
h.prototype.onData=function(a){this.chunks.push(a)};h.prototype.onEnd=function(b){0===b&&(this.result="string"===this.options.to?this.chunks.join(""):a.flattenChunks(this.chunks));this.chunks=[];this.err=b;this.msg=this.strm.msg};f.Deflate=h;f.deflate=e;f.deflateRaw=function(a,b){b=b||{};b.raw=!0;return e(a,b)};f.gzip=function(a,b){b=b||{};b.gzip=!0;return e(a,b)}},function(n,f,l){function h(a,b){a.msg=B[b];return b}function e(a){for(var b=a.length;0<=--b;)a[b]=0}function c(a){var b=a.state,c=b.pending;
c>a.avail_out&&(c=a.avail_out);0!==c&&(C.arraySet(a.output,b.pending_buf,b.pending_out,c,a.next_out),a.next_out+=c,b.pending_out+=c,a.total_out+=c,a.avail_out-=c,b.pending-=c,0===b.pending&&(b.pending_out=0))}function a(a,b){A._tr_flush_block(a,0<=a.block_start?a.block_start:-1,a.strstart-a.block_start,b);a.block_start=a.strstart;c(a.strm)}function b(a,b){a.pending_buf[a.pending++]=b}function d(a,b){a.pending_buf[a.pending++]=b>>>8&255;a.pending_buf[a.pending++]=b&255}function p(a,b){var c=a.max_chain_length,
d=a.strstart,e=a.prev_length,k=a.nice_match,h=a.strstart>a.w_size-262?a.strstart-(a.w_size-262):0,g=a.window,f=a.w_mask,l=a.prev,u=a.strstart+258,m=g[d+e-1],p=g[d+e];a.prev_length>=a.good_match&&(c>>=2);k>a.lookahead&&(k=a.lookahead);do{var w=b;if(g[w+e]===p&&g[w+e-1]===m&&g[w]===g[d]&&g[++w]===g[d+1]){d+=2;for(w++;g[++d]===g[++w]&&g[++d]===g[++w]&&g[++d]===g[++w]&&g[++d]===g[++w]&&g[++d]===g[++w]&&g[++d]===g[++w]&&g[++d]===g[++w]&&g[++d]===g[++w]&&d<u;);w=258-(u-d);d=u-258;if(w>e){a.match_start=
b;e=w;if(w>=k)break;m=g[d+e-1];p=g[d+e]}}}while((b=l[b&f])>h&&0!==--c);return e<=a.lookahead?e:a.lookahead}function k(a){var b=a.w_size,c;do{var d=a.window_size-a.lookahead-a.strstart;if(a.strstart>=b+(b-262)){C.arraySet(a.window,a.window,b,b,0);a.match_start-=b;a.strstart-=b;a.block_start-=b;var e=c=a.hash_size;do{var k=a.head[--e];a.head[e]=k>=b?k-b:0}while(--c);e=c=b;do k=a.prev[--e],a.prev[e]=k>=b?k-b:0;while(--c);d+=b}if(0===a.strm.avail_in)break;e=a.strm;c=a.window;k=a.strstart+a.lookahead;
var h=e.avail_in;h>d&&(h=d);0===h?c=0:(e.avail_in-=h,C.arraySet(c,e.input,e.next_in,h,k),1===e.state.wrap?e.adler=I(e.adler,c,h,k):2===e.state.wrap&&(e.adler=w(e.adler,c,h,k)),e.next_in+=h,e.total_in+=h,c=h);a.lookahead+=c;if(3<=a.lookahead+a.insert)for(d=a.strstart-a.insert,a.ins_h=a.window[d],a.ins_h=(a.ins_h<<a.hash_shift^a.window[d+1])&a.hash_mask;a.insert&&!(a.ins_h=(a.ins_h<<a.hash_shift^a.window[d+3-1])&a.hash_mask,a.prev[d&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=d,d++,a.insert--,3>a.lookahead+
a.insert););}while(262>a.lookahead&&0!==a.strm.avail_in)}function g(b,c){for(var d;;){if(262>b.lookahead){k(b);if(262>b.lookahead&&0===c)return 1;if(0===b.lookahead)break}d=0;3<=b.lookahead&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+3-1])&b.hash_mask,d=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart);0!==d&&b.strstart-d<=b.w_size-262&&(b.match_length=p(b,d));if(3<=b.match_length)if(d=A._tr_tally(b,b.strstart-b.match_start,b.match_length-3),b.lookahead-=b.match_length,
b.match_length<=b.max_lazy_match&&3<=b.lookahead){b.match_length--;do b.strstart++,b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+3-1])&b.hash_mask,b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart;while(0!==--b.match_length);b.strstart++}else b.strstart+=b.match_length,b.match_length=0,b.ins_h=b.window[b.strstart],b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+1])&b.hash_mask;else d=A._tr_tally(b,0,b.window[b.strstart]),b.lookahead--,b.strstart++;if(d&&(a(b,!1),0===b.strm.avail_out))return 1}b.insert=
2>b.strstart?b.strstart:2;return 4===c?(a(b,!0),0===b.strm.avail_out?3:4):b.last_lit&&(a(b,!1),0===b.strm.avail_out)?1:2}function q(b,c){for(var d,e;;){if(262>b.lookahead){k(b);if(262>b.lookahead&&0===c)return 1;if(0===b.lookahead)break}d=0;3<=b.lookahead&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+3-1])&b.hash_mask,d=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart);b.prev_length=b.match_length;b.prev_match=b.match_start;b.match_length=2;0!==d&&b.prev_length<b.max_lazy_match&&
b.strstart-d<=b.w_size-262&&(b.match_length=p(b,d),5>=b.match_length&&(1===b.strategy||3===b.match_length&&4096<b.strstart-b.match_start)&&(b.match_length=2));if(3<=b.prev_length&&b.match_length<=b.prev_length){e=b.strstart+b.lookahead-3;d=A._tr_tally(b,b.strstart-1-b.prev_match,b.prev_length-3);b.lookahead-=b.prev_length-1;b.prev_length-=2;do++b.strstart<=e&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+3-1])&b.hash_mask,b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart);
while(0!==--b.prev_length);b.match_available=0;b.match_length=2;b.strstart++;if(d&&(a(b,!1),0===b.strm.avail_out))return 1}else if(b.match_available){if((d=A._tr_tally(b,0,b.window[b.strstart-1]))&&a(b,!1),b.strstart++,b.lookahead--,0===b.strm.avail_out)return 1}else b.match_available=1,b.strstart++,b.lookahead--}b.match_available&&(A._tr_tally(b,0,b.window[b.strstart-1]),b.match_available=0);b.insert=2>b.strstart?b.strstart:2;return 4===c?(a(b,!0),0===b.strm.avail_out?3:4):b.last_lit&&(a(b,!1),0===
b.strm.avail_out)?1:2}function r(b,c){for(var d,e,h,g=b.window;;){if(258>=b.lookahead){k(b);if(258>=b.lookahead&&0===c)return 1;if(0===b.lookahead)break}b.match_length=0;if(3<=b.lookahead&&0<b.strstart&&(e=b.strstart-1,d=g[e],d===g[++e]&&d===g[++e]&&d===g[++e])){for(h=b.strstart+258;d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&e<h;);b.match_length=258-(h-e);b.match_length>b.lookahead&&(b.match_length=b.lookahead)}3<=b.match_length?(d=A._tr_tally(b,
1,b.match_length-3),b.lookahead-=b.match_length,b.strstart+=b.match_length,b.match_length=0):(d=A._tr_tally(b,0,b.window[b.strstart]),b.lookahead--,b.strstart++);if(d&&(a(b,!1),0===b.strm.avail_out))return 1}b.insert=0;return 4===c?(a(b,!0),0===b.strm.avail_out?3:4):b.last_lit&&(a(b,!1),0===b.strm.avail_out)?1:2}function x(b,c){for(var d;;){if(0===b.lookahead&&(k(b),0===b.lookahead)){if(0===c)return 1;break}b.match_length=0;d=A._tr_tally(b,0,b.window[b.strstart]);b.lookahead--;b.strstart++;if(d&&
(a(b,!1),0===b.strm.avail_out))return 1}b.insert=0;return 4===c?(a(b,!0),0===b.strm.avail_out?3:4):b.last_lit&&(a(b,!1),0===b.strm.avail_out)?1:2}function m(a,b,c,d,e){this.good_length=a;this.max_lazy=b;this.nice_length=c;this.max_chain=d;this.func=e}function v(){this.strm=null;this.status=0;this.pending_buf=null;this.wrap=this.pending=this.pending_out=this.pending_buf_size=0;this.gzhead=null;this.gzindex=0;this.method=8;this.last_flush=-1;this.w_mask=this.w_bits=this.w_size=0;this.window=null;this.window_size=
0;this.head=this.prev=null;this.nice_match=this.good_match=this.strategy=this.level=this.max_lazy_match=this.max_chain_length=this.prev_length=this.lookahead=this.match_start=this.strstart=this.match_available=this.prev_match=this.match_length=this.block_start=this.hash_shift=this.hash_mask=this.hash_bits=this.hash_size=this.ins_h=0;this.dyn_ltree=new C.Buf16(1146);this.dyn_dtree=new C.Buf16(122);this.bl_tree=new C.Buf16(78);e(this.dyn_ltree);e(this.dyn_dtree);e(this.bl_tree);this.bl_desc=this.d_desc=
this.l_desc=null;this.bl_count=new C.Buf16(16);this.heap=new C.Buf16(573);e(this.heap);this.heap_max=this.heap_len=0;this.depth=new C.Buf16(573);e(this.depth);this.bi_valid=this.bi_buf=this.insert=this.matches=this.static_len=this.opt_len=this.d_buf=this.last_lit=this.lit_bufsize=this.l_buf=0}function D(a){if(!a||!a.state)return h(a,-2);a.total_in=a.total_out=0;a.data_type=2;var b=a.state;b.pending=0;b.pending_out=0;0>b.wrap&&(b.wrap=-b.wrap);b.status=b.wrap?42:113;a.adler=2===b.wrap?0:1;b.last_flush=
0;A._tr_init(b);return 0}function t(a){var b=D(a);0===b&&(a=a.state,a.window_size=2*a.w_size,e(a.head),a.max_lazy_match=K[a.level].max_lazy,a.good_match=K[a.level].good_length,a.nice_match=K[a.level].nice_length,a.max_chain_length=K[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0);return b}function J(a,b,c,d,e,k){if(!a)return-2;var g=1;-1===b&&(b=6);0>d?(g=0,d=-d):15<d&&(g=2,d-=16);if(1>e||9<e||8!==c||8>d||15<d||
0>b||9<b||0>k||4<k)return h(a,-2);8===d&&(d=9);var f=new v;a.state=f;f.strm=a;f.wrap=g;f.gzhead=null;f.w_bits=d;f.w_size=1<<f.w_bits;f.w_mask=f.w_size-1;f.hash_bits=e+7;f.hash_size=1<<f.hash_bits;f.hash_mask=f.hash_size-1;f.hash_shift=~~((f.hash_bits+3-1)/3);f.window=new C.Buf8(2*f.w_size);f.head=new C.Buf16(f.hash_size);f.prev=new C.Buf16(f.w_size);f.lit_bufsize=1<<e+6;f.pending_buf_size=4*f.lit_bufsize;f.pending_buf=new C.Buf8(f.pending_buf_size);f.d_buf=1*f.lit_bufsize;f.l_buf=3*f.lit_bufsize;
f.level=b;f.strategy=k;f.method=c;return t(a)}var C=l(5),A=l(87),I=l(40),w=l(41),B=l(27);var K=[new m(0,0,0,0,function(b,c){var d=65535;for(d>b.pending_buf_size-5&&(d=b.pending_buf_size-5);;){if(1>=b.lookahead){k(b);if(0===b.lookahead&&0===c)return 1;if(0===b.lookahead)break}b.strstart+=b.lookahead;b.lookahead=0;var e=b.block_start+d;if(0===b.strstart||b.strstart>=e)if(b.lookahead=b.strstart-e,b.strstart=e,a(b,!1),0===b.strm.avail_out)return 1;if(b.strstart-b.block_start>=b.w_size-262&&(a(b,!1),0===
b.strm.avail_out))return 1}b.insert=0;if(4===c)return a(b,!0),0===b.strm.avail_out?3:4;b.strstart>b.block_start&&a(b,!1);return 1}),new m(4,4,8,4,g),new m(4,5,16,8,g),new m(4,6,32,32,g),new m(4,4,16,16,q),new m(8,16,32,32,q),new m(8,16,128,128,q),new m(8,32,128,256,q),new m(32,128,258,1024,q),new m(32,258,258,4096,q)];f.deflateInit=function(a,b){return J(a,b,8,15,8,0)};f.deflateInit2=J;f.deflateReset=t;f.deflateResetKeep=D;f.deflateSetHeader=function(a,b){if(!a||!a.state||2!==a.state.wrap)return-2;
a.state.gzhead=b;return 0};f.deflate=function(a,k){if(!a||!a.state||5<k||0>k)return a?h(a,-2):-2;var g=a.state;if(!a.output||!a.input&&0!==a.avail_in||666===g.status&&4!==k)return h(a,0===a.avail_out?-5:-2);g.strm=a;var f=g.last_flush;g.last_flush=k;if(42===g.status)if(2===g.wrap)a.adler=0,b(g,31),b(g,139),b(g,8),g.gzhead?(b(g,(g.gzhead.text?1:0)+(g.gzhead.hcrc?2:0)+(g.gzhead.extra?4:0)+(g.gzhead.name?8:0)+(g.gzhead.comment?16:0)),b(g,g.gzhead.time&255),b(g,g.gzhead.time>>8&255),b(g,g.gzhead.time>>
16&255),b(g,g.gzhead.time>>24&255),b(g,9===g.level?2:2<=g.strategy||2>g.level?4:0),b(g,g.gzhead.os&255),g.gzhead.extra&&g.gzhead.extra.length&&(b(g,g.gzhead.extra.length&255),b(g,g.gzhead.extra.length>>8&255)),g.gzhead.hcrc&&(a.adler=w(a.adler,g.pending_buf,g.pending,0)),g.gzindex=0,g.status=69):(b(g,0),b(g,0),b(g,0),b(g,0),b(g,0),b(g,9===g.level?2:2<=g.strategy||2>g.level?4:0),b(g,3),g.status=113);else{var l=8+(g.w_bits-8<<4)<<8;l|=(2<=g.strategy||2>g.level?0:6>g.level?1:6===g.level?2:3)<<6;0!==
g.strstart&&(l|=32);g.status=113;d(g,l+(31-l%31));0!==g.strstart&&(d(g,a.adler>>>16),d(g,a.adler&65535));a.adler=1}if(69===g.status)if(g.gzhead.extra){for(l=g.pending;g.gzindex<(g.gzhead.extra.length&65535)&&(g.pending!==g.pending_buf_size||(g.gzhead.hcrc&&g.pending>l&&(a.adler=w(a.adler,g.pending_buf,g.pending-l,l)),c(a),l=g.pending,g.pending!==g.pending_buf_size));)b(g,g.gzhead.extra[g.gzindex]&255),g.gzindex++;g.gzhead.hcrc&&g.pending>l&&(a.adler=w(a.adler,g.pending_buf,g.pending-l,l));g.gzindex===
g.gzhead.extra.length&&(g.gzindex=0,g.status=73)}else g.status=73;if(73===g.status)if(g.gzhead.name){l=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>l&&(a.adler=w(a.adler,g.pending_buf,g.pending-l,l)),c(a),l=g.pending,g.pending===g.pending_buf_size)){var m=1;break}m=g.gzindex<g.gzhead.name.length?g.gzhead.name.charCodeAt(g.gzindex++)&255:0;b(g,m)}while(0!==m);g.gzhead.hcrc&&g.pending>l&&(a.adler=w(a.adler,g.pending_buf,g.pending-l,l));0===m&&(g.gzindex=0,g.status=91)}else g.status=
91;if(91===g.status)if(g.gzhead.comment){l=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>l&&(a.adler=w(a.adler,g.pending_buf,g.pending-l,l)),c(a),l=g.pending,g.pending===g.pending_buf_size)){m=1;break}m=g.gzindex<g.gzhead.comment.length?g.gzhead.comment.charCodeAt(g.gzindex++)&255:0;b(g,m)}while(0!==m);g.gzhead.hcrc&&g.pending>l&&(a.adler=w(a.adler,g.pending_buf,g.pending-l,l));0===m&&(g.status=103)}else g.status=103;103===g.status&&(g.gzhead.hcrc?(g.pending+2>g.pending_buf_size&&
c(a),g.pending+2<=g.pending_buf_size&&(b(g,a.adler&255),b(g,a.adler>>8&255),a.adler=0,g.status=113)):g.status=113);if(0!==g.pending){if(c(a),0===a.avail_out)return g.last_flush=-1,0}else if(0===a.avail_in&&(k<<1)-(4<k?9:0)<=(f<<1)-(4<f?9:0)&&4!==k)return h(a,-5);if(666===g.status&&0!==a.avail_in)return h(a,-5);if(0!==a.avail_in||0!==g.lookahead||0!==k&&666!==g.status){f=2===g.strategy?x(g,k):3===g.strategy?r(g,k):K[g.level].func(g,k);if(3===f||4===f)g.status=666;if(1===f||3===f)return 0===a.avail_out&&
(g.last_flush=-1),0;if(2===f&&(1===k?A._tr_align(g):5!==k&&(A._tr_stored_block(g,0,0,!1),3===k&&(e(g.head),0===g.lookahead&&(g.strstart=0,g.block_start=0,g.insert=0))),c(a),0===a.avail_out))return g.last_flush=-1,0}if(4!==k)return 0;if(0>=g.wrap)return 1;2===g.wrap?(b(g,a.adler&255),b(g,a.adler>>8&255),b(g,a.adler>>16&255),b(g,a.adler>>24&255),b(g,a.total_in&255),b(g,a.total_in>>8&255),b(g,a.total_in>>16&255),b(g,a.total_in>>24&255)):(d(g,a.adler>>>16),d(g,a.adler&65535));c(a);0<g.wrap&&(g.wrap=-g.wrap);
return 0!==g.pending?0:1};f.deflateEnd=function(a){if(!a||!a.state)return-2;var b=a.state.status;if(42!==b&&69!==b&&73!==b&&91!==b&&103!==b&&113!==b&&666!==b)return h(a,-2);a.state=null;return 113===b?h(a,-3):0};f.deflateSetDictionary=function(a,b){var c=b.length;if(!a||!a.state)return-2;var d=a.state;var g=d.wrap;if(2===g||1===g&&42!==d.status||d.lookahead)return-2;1===g&&(a.adler=I(a.adler,b,c,0));d.wrap=0;if(c>=d.w_size){0===g&&(e(d.head),d.strstart=0,d.block_start=0,d.insert=0);var h=new C.Buf8(d.w_size);
C.arraySet(h,b,c-d.w_size,d.w_size,0);b=h;c=d.w_size}h=a.avail_in;var f=a.next_in;var l=a.input;a.avail_in=c;a.next_in=0;a.input=b;for(k(d);3<=d.lookahead;){b=d.strstart;c=d.lookahead-2;do d.ins_h=(d.ins_h<<d.hash_shift^d.window[b+3-1])&d.hash_mask,d.prev[b&d.w_mask]=d.head[d.ins_h],d.head[d.ins_h]=b,b++;while(--c);d.strstart=b;d.lookahead=2;k(d)}d.strstart+=d.lookahead;d.block_start=d.strstart;d.insert=d.lookahead;d.lookahead=0;d.match_length=d.prev_length=2;d.match_available=0;a.next_in=f;a.input=
l;a.avail_in=h;d.wrap=g;return 0};f.deflateInfo="pako deflate (from Nodeca project)"},function(n,f,l){function h(a){for(var b=a.length;0<=--b;)a[b]=0}function e(a,b,c,d,e){this.static_tree=a;this.extra_bits=b;this.extra_base=c;this.elems=d;this.max_length=e;this.has_stree=a&&a.length}function c(a,b){this.dyn_tree=a;this.max_code=0;this.stat_desc=b}function a(a,b){a.pending_buf[a.pending++]=b&255;a.pending_buf[a.pending++]=b>>>8&255}function b(b,c,d){b.bi_valid>16-d?(b.bi_buf|=c<<b.bi_valid&65535,
a(b,b.bi_buf),b.bi_buf=c>>16-b.bi_valid,b.bi_valid+=d-16):(b.bi_buf|=c<<b.bi_valid&65535,b.bi_valid+=d)}function d(a,c,d){b(a,d[2*c],d[2*c+1])}function p(a,b){var c=0;do c|=a&1,a>>>=1,c<<=1;while(0<--b);return c>>>1}function k(a,b,c){var d=Array(16),e=0,g;for(g=1;15>=g;g++)d[g]=e=e+c[g-1]<<1;for(c=0;c<=b;c++)e=a[2*c+1],0!==e&&(a[2*c]=p(d[e]++,e))}function g(a){var b;for(b=0;286>b;b++)a.dyn_ltree[2*b]=0;for(b=0;30>b;b++)a.dyn_dtree[2*b]=0;for(b=0;19>b;b++)a.bl_tree[2*b]=0;a.dyn_ltree[512]=1;a.opt_len=
a.static_len=0;a.last_lit=a.matches=0}function q(b){8<b.bi_valid?a(b,b.bi_buf):0<b.bi_valid&&(b.pending_buf[b.pending++]=b.bi_buf);b.bi_buf=0;b.bi_valid=0}function r(a,b,c,d){var e=2*b,g=2*c;return a[e]<a[g]||a[e]===a[g]&&d[b]<=d[c]}function x(a,b,c){for(var d=a.heap[c],e=c<<1;e<=a.heap_len;){e<a.heap_len&&r(b,a.heap[e+1],a.heap[e],a.depth)&&e++;if(r(b,d,a.heap[e],a.depth))break;a.heap[c]=a.heap[e];c=e;e<<=1}a.heap[c]=d}function m(a,c,e){var g=0;if(0!==a.last_lit){do{var k=a.pending_buf[a.d_buf+2*
g]<<8|a.pending_buf[a.d_buf+2*g+1];var h=a.pending_buf[a.l_buf+g];g++;if(0===k)d(a,h,c);else{var f=F[h];d(a,f+256+1,c);var l=I[f];0!==l&&(h-=z[f],b(a,h,l));k--;f=256>k?H[k]:H[256+(k>>>7)];d(a,f,e);l=w[f];0!==l&&(k-=E[f],b(a,k,l))}}while(g<a.last_lit)}d(a,256,c)}function v(a,b){var c=b.dyn_tree,d=b.stat_desc.static_tree,e=b.stat_desc.has_stree,g=b.stat_desc.elems,h,f=-1;a.heap_len=0;a.heap_max=573;for(h=0;h<g;h++)0!==c[2*h]?(a.heap[++a.heap_len]=f=h,a.depth[h]=0):c[2*h+1]=0;for(;2>a.heap_len;){var l=
a.heap[++a.heap_len]=2>f?++f:0;c[2*l]=1;a.depth[l]=0;a.opt_len--;e&&(a.static_len-=d[2*l+1])}b.max_code=f;for(h=a.heap_len>>1;1<=h;h--)x(a,c,h);l=g;do h=a.heap[1],a.heap[1]=a.heap[a.heap_len--],x(a,c,1),d=a.heap[1],a.heap[--a.heap_max]=h,a.heap[--a.heap_max]=d,c[2*l]=c[2*h]+c[2*d],a.depth[l]=(a.depth[h]>=a.depth[d]?a.depth[h]:a.depth[d])+1,c[2*h+1]=c[2*d+1]=l,a.heap[1]=l++,x(a,c,1);while(2<=a.heap_len);a.heap[--a.heap_max]=a.heap[1];h=b.dyn_tree;l=b.max_code;d=b.stat_desc.static_tree;e=b.stat_desc.has_stree;
g=b.stat_desc.extra_bits;var m=b.stat_desc.extra_base,w=b.stat_desc.max_length,p,n=0;for(p=0;15>=p;p++)a.bl_count[p]=0;h[2*a.heap[a.heap_max]+1]=0;for(b=a.heap_max+1;573>b;b++){var t=a.heap[b];p=h[2*h[2*t+1]+1]+1;p>w&&(p=w,n++);h[2*t+1]=p;if(!(t>l)){a.bl_count[p]++;var r=0;t>=m&&(r=g[t-m]);var q=h[2*t];a.opt_len+=q*(p+r);e&&(a.static_len+=q*(d[2*t+1]+r))}}if(0!==n){do{for(p=w-1;0===a.bl_count[p];)p--;a.bl_count[p]--;a.bl_count[p+1]+=2;a.bl_count[w]--;n-=2}while(0<n);for(p=w;0!==p;p--)for(t=a.bl_count[p];0!==
t;)d=a.heap[--b],d>l||(h[2*d+1]!==p&&(a.opt_len+=(p-h[2*d+1])*h[2*d],h[2*d+1]=p),t--)}k(c,f,a.bl_count)}function D(a,b,c){var d,e=-1,g=b[1],k=0,h=7,f=4;0===g&&(h=138,f=3);b[2*(c+1)+1]=65535;for(d=0;d<=c;d++){var l=g;g=b[2*(d+1)+1];++k<h&&l===g||(k<f?a.bl_tree[2*l]+=k:0!==l?(l!==e&&a.bl_tree[2*l]++,a.bl_tree[32]++):10>=k?a.bl_tree[34]++:a.bl_tree[36]++,k=0,e=l,0===g?(h=138,f=3):l===g?(h=6,f=3):(h=7,f=4))}}function t(a,c,e){var g,k=-1,h=c[1],f=0,l=7,m=4;0===h&&(l=138,m=3);for(g=0;g<=e;g++){var p=h;
h=c[2*(g+1)+1];if(!(++f<l&&p===h)){if(f<m){do d(a,p,a.bl_tree);while(0!==--f)}else 0!==p?(p!==k&&(d(a,p,a.bl_tree),f--),d(a,16,a.bl_tree),b(a,f-3,2)):10>=f?(d(a,17,a.bl_tree),b(a,f-3,3)):(d(a,18,a.bl_tree),b(a,f-11,7));f=0;k=p;0===h?(l=138,m=3):p===h?(l=6,m=3):(l=7,m=4)}}}function J(a){var b=4093624447,c;for(c=0;31>=c;c++,b>>>=1)if(b&1&&0!==a.dyn_ltree[2*c])return 0;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return 1;for(c=32;256>c;c++)if(0!==a.dyn_ltree[2*c])return 1;return 0}
function C(c,d,e,g){b(c,0+(g?1:0),3);q(c);a(c,e);a(c,~e);A.arraySet(c.pending_buf,c.window,d,e,c.pending);c.pending+=e}var A=l(5),I=[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],w=[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],B=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],K=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=Array(576);h(u);var G=Array(60);h(G);var H=Array(512);h(H);var F=Array(256);h(F);var z=Array(29);h(z);var E=Array(30);h(E);var O,N,Q,L=!1;f._tr_init=
function(a){if(!L){var b,d,h,f=Array(16);for(h=d=0;28>h;h++)for(z[h]=d,b=0;b<1<<I[h];b++)F[d++]=h;F[d-1]=h;for(h=d=0;16>h;h++)for(E[h]=d,b=0;b<1<<w[h];b++)H[d++]=h;for(d>>=7;30>h;h++)for(E[h]=d<<7,b=0;b<1<<w[h]-7;b++)H[256+d++]=h;for(b=0;15>=b;b++)f[b]=0;for(b=0;143>=b;)u[2*b+1]=8,b++,f[8]++;for(;255>=b;)u[2*b+1]=9,b++,f[9]++;for(;279>=b;)u[2*b+1]=7,b++,f[7]++;for(;287>=b;)u[2*b+1]=8,b++,f[8]++;k(u,287,f);for(b=0;30>b;b++)G[2*b+1]=5,G[2*b]=p(b,5);O=new e(u,I,257,286,15);N=new e(G,w,0,30,15);Q=new e([],
B,0,19,7);L=!0}a.l_desc=new c(a.dyn_ltree,O);a.d_desc=new c(a.dyn_dtree,N);a.bl_desc=new c(a.bl_tree,Q);a.bi_buf=0;a.bi_valid=0;g(a)};f._tr_stored_block=C;f._tr_flush_block=function(a,c,d,e){var k=0;if(0<a.level){2===a.strm.data_type&&(a.strm.data_type=J(a));v(a,a.l_desc);v(a,a.d_desc);D(a,a.dyn_ltree,a.l_desc.max_code);D(a,a.dyn_dtree,a.d_desc.max_code);v(a,a.bl_desc);for(k=18;3<=k&&0===a.bl_tree[2*K[k]+1];k--);a.opt_len+=3*(k+1)+14;var h=a.opt_len+3+7>>>3;var f=a.static_len+3+7>>>3;f<=h&&(h=f)}else h=
f=d+5;if(d+4<=h&&-1!==c)C(a,c,d,e);else if(4===a.strategy||f===h)b(a,2+(e?1:0),3),m(a,u,G);else{b(a,4+(e?1:0),3);c=a.l_desc.max_code+1;d=a.d_desc.max_code+1;k+=1;b(a,c-257,5);b(a,d-1,5);b(a,k-4,4);for(h=0;h<k;h++)b(a,a.bl_tree[2*K[h]+1],3);t(a,a.dyn_ltree,c-1);t(a,a.dyn_dtree,d-1);m(a,a.dyn_ltree,a.dyn_dtree)}g(a);e&&q(a)};f._tr_tally=function(a,b,c){a.pending_buf[a.d_buf+2*a.last_lit]=b>>>8&255;a.pending_buf[a.d_buf+2*a.last_lit+1]=b&255;a.pending_buf[a.l_buf+a.last_lit]=c&255;a.last_lit++;0===b?
a.dyn_ltree[2*c]++:(a.matches++,b--,a.dyn_ltree[2*(F[c]+256+1)]++,a.dyn_dtree[2*(256>b?H[b]:H[256+(b>>>7)])]++);return a.last_lit===a.lit_bufsize-1};f._tr_align=function(c){b(c,2,3);d(c,256,u);16===c.bi_valid?(a(c,c.bi_buf),c.bi_buf=0,c.bi_valid=0):8<=c.bi_valid&&(c.pending_buf[c.pending++]=c.bi_buf&255,c.bi_buf>>=8,c.bi_valid-=8)}},function(n,f,l){function h(b){if(!(this instanceof h))return new h(b);var e=this.options=a.assign({chunkSize:16384,windowBits:0,to:""},b||{});e.raw&&0<=e.windowBits&&
16>e.windowBits&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15));!(0<=e.windowBits&&16>e.windowBits)||b&&b.windowBits||(e.windowBits+=32);15<e.windowBits&&48>e.windowBits&&0===(e.windowBits&15)&&(e.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new k;this.strm.avail_out=0;b=c.inflateInit2(this.strm,e.windowBits);if(b!==d.Z_OK)throw Error(p[b]);this.header=new g;c.inflateGetHeader(this.strm,this.header)}function e(a,b){b=new h(b);b.push(a,!0);if(b.err)throw b.msg||
p[b.err];return b.result}var c=l(89),a=l(5),b=l(42),d=l(44),p=l(27),k=l(43),g=l(92),q=Object.prototype.toString;h.prototype.push=function(e,g){var k=this.strm,h=this.options.chunkSize,f=this.options.dictionary,l=!1;if(this.ended)return!1;g=g===~~g?g:!0===g?d.Z_FINISH:d.Z_NO_FLUSH;"string"===typeof e?k.input=b.binstring2buf(e):"[object ArrayBuffer]"===q.call(e)?k.input=new Uint8Array(e):k.input=e;k.next_in=0;k.avail_in=k.input.length;do{0===k.avail_out&&(k.output=new a.Buf8(h),k.next_out=0,k.avail_out=
h);e=c.inflate(k,d.Z_NO_FLUSH);e===d.Z_NEED_DICT&&f&&(e="string"===typeof f?b.string2buf(f):"[object ArrayBuffer]"===q.call(f)?new Uint8Array(f):f,e=c.inflateSetDictionary(this.strm,e));e===d.Z_BUF_ERROR&&!0===l&&(e=d.Z_OK,l=!1);if(e!==d.Z_STREAM_END&&e!==d.Z_OK)return this.onEnd(e),this.ended=!0,!1;if(k.next_out&&(0===k.avail_out||e===d.Z_STREAM_END||0===k.avail_in&&(g===d.Z_FINISH||g===d.Z_SYNC_FLUSH)))if("string"===this.options.to){var p=b.utf8border(k.output,k.next_out);var n=k.next_out-p;var r=
b.buf2string(k.output,p);k.next_out=n;k.avail_out=h-n;n&&a.arraySet(k.output,k.output,p,n,0);this.onData(r)}else this.onData(a.shrinkBuf(k.output,k.next_out));0===k.avail_in&&0===k.avail_out&&(l=!0)}while((0<k.avail_in||0===k.avail_out)&&e!==d.Z_STREAM_END);e===d.Z_STREAM_END&&(g=d.Z_FINISH);if(g===d.Z_FINISH)return e=c.inflateEnd(this.strm),this.onEnd(e),this.ended=!0,e===d.Z_OK;g===d.Z_SYNC_FLUSH&&(this.onEnd(d.Z_OK),k.avail_out=0);return!0};h.prototype.onData=function(a){this.chunks.push(a)};h.prototype.onEnd=
function(b){b===d.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):a.flattenChunks(this.chunks));this.chunks=[];this.err=b;this.msg=this.strm.msg};f.Inflate=h;f.inflate=e;f.inflateRaw=function(a,b){b=b||{};b.raw=!0;return e(a,b)};f.ungzip=e},function(n,f,l){function h(a){return(a>>>24&255)+(a>>>8&65280)+((a&65280)<<8)+((a&255)<<24)}function e(){this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext=this.whave=
this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new k.Buf16(320);this.work=new k.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function c(a){if(!a||!a.state)return-2;var b=a.state;a.total_in=a.total_out=b.total=0;a.msg="";b.wrap&&(a.adler=b.wrap&1);b.mode=1;b.last=0;b.havedict=0;b.dmax=32768;b.head=
null;b.hold=0;b.bits=0;b.lencode=b.lendyn=new k.Buf32(852);b.distcode=b.distdyn=new k.Buf32(592);b.sane=1;b.back=-1;return 0}function a(a){if(!a||!a.state)return-2;var b=a.state;b.wsize=0;b.whave=0;b.wnext=0;return c(a)}function b(b,c){if(!b||!b.state)return-2;var d=b.state;if(0>c){var e=0;c=-c}else e=(c>>4)+1,48>c&&(c&=15);if(c&&(8>c||15<c))return-2;null!==d.window&&d.wbits!==c&&(d.window=null);d.wrap=e;d.wbits=c;return a(b)}function d(a,c){if(!a)return-2;var d=new e;a.state=d;d.window=null;c=b(a,
c);0!==c&&(a.state=null);return c}function p(a,b,c,d){var e=a.state;null===e.window&&(e.wsize=1<<e.wbits,e.wnext=0,e.whave=0,e.window=new k.Buf8(e.wsize));d>=e.wsize?(k.arraySet(e.window,b,c-e.wsize,e.wsize,0),e.wnext=0,e.whave=e.wsize):(a=e.wsize-e.wnext,a>d&&(a=d),k.arraySet(e.window,b,c-d,a,e.wnext),(d-=a)?(k.arraySet(e.window,b,c-d,d,0),e.wnext=d,e.whave=e.wsize):(e.wnext+=a,e.wnext===e.wsize&&(e.wnext=0),e.whave<e.wsize&&(e.whave+=a)));return 0}var k=l(5),g=l(40),q=l(41),r=l(90),x=l(91),m=!0,
v,D;f.inflateReset=a;f.inflateReset2=b;f.inflateResetKeep=c;f.inflateInit=function(a){return d(a,15)};f.inflateInit2=d;f.inflate=function(a,b){var c,d=new k.Buf8(4),e=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!a||!a.state||!a.output||!a.input&&0!==a.avail_in)return-2;var f=a.state;12===f.mode&&(f.mode=13);var l=a.next_out;var n=a.output;var u=a.avail_out;var t=a.next_in;var H=a.input;var F=a.avail_in;var z=f.hold;var E=f.bits;var J=F;var N=u;var Q=0;a:for(;;)switch(f.mode){case 1:if(0===
f.wrap){f.mode=13;break}for(;16>E;){if(0===F)break a;F--;z+=H[t++]<<E;E+=8}if(f.wrap&2&&35615===z){f.check=0;d[0]=z&255;d[1]=z>>>8&255;f.check=q(f.check,d,2,0);E=z=0;f.mode=2;break}f.flags=0;f.head&&(f.head.done=!1);if(!(f.wrap&1)||(((z&255)<<8)+(z>>8))%31){a.msg="incorrect header check";f.mode=30;break}if(8!==(z&15)){a.msg="unknown compression method";f.mode=30;break}z>>>=4;E-=4;var L=(z&15)+8;if(0===f.wbits)f.wbits=L;else if(L>f.wbits){a.msg="invalid window size";f.mode=30;break}f.dmax=1<<L;a.adler=
f.check=1;f.mode=z&512?10:12;E=z=0;break;case 2:for(;16>E;){if(0===F)break a;F--;z+=H[t++]<<E;E+=8}f.flags=z;if(8!==(f.flags&255)){a.msg="unknown compression method";f.mode=30;break}if(f.flags&57344){a.msg="unknown header flags set";f.mode=30;break}f.head&&(f.head.text=z>>8&1);f.flags&512&&(d[0]=z&255,d[1]=z>>>8&255,f.check=q(f.check,d,2,0));E=z=0;f.mode=3;case 3:for(;32>E;){if(0===F)break a;F--;z+=H[t++]<<E;E+=8}f.head&&(f.head.time=z);f.flags&512&&(d[0]=z&255,d[1]=z>>>8&255,d[2]=z>>>16&255,d[3]=
z>>>24&255,f.check=q(f.check,d,4,0));E=z=0;f.mode=4;case 4:for(;16>E;){if(0===F)break a;F--;z+=H[t++]<<E;E+=8}f.head&&(f.head.xflags=z&255,f.head.os=z>>8);f.flags&512&&(d[0]=z&255,d[1]=z>>>8&255,f.check=q(f.check,d,2,0));E=z=0;f.mode=5;case 5:if(f.flags&1024){for(;16>E;){if(0===F)break a;F--;z+=H[t++]<<E;E+=8}f.length=z;f.head&&(f.head.extra_len=z);f.flags&512&&(d[0]=z&255,d[1]=z>>>8&255,f.check=q(f.check,d,2,0));E=z=0}else f.head&&(f.head.extra=null);f.mode=6;case 6:if(f.flags&1024){var y=f.length;
y>F&&(y=F);y&&(f.head&&(L=f.head.extra_len-f.length,f.head.extra||(f.head.extra=Array(f.head.extra_len)),k.arraySet(f.head.extra,H,t,y,L)),f.flags&512&&(f.check=q(f.check,H,y,t)),F-=y,t+=y,f.length-=y);if(f.length)break a}f.length=0;f.mode=7;case 7:if(f.flags&2048){if(0===F)break a;y=0;do L=H[t+y++],f.head&&L&&65536>f.length&&(f.head.name+=String.fromCharCode(L));while(L&&y<F);f.flags&512&&(f.check=q(f.check,H,y,t));F-=y;t+=y;if(L)break a}else f.head&&(f.head.name=null);f.length=0;f.mode=8;case 8:if(f.flags&
4096){if(0===F)break a;y=0;do L=H[t+y++],f.head&&L&&65536>f.length&&(f.head.comment+=String.fromCharCode(L));while(L&&y<F);f.flags&512&&(f.check=q(f.check,H,y,t));F-=y;t+=y;if(L)break a}else f.head&&(f.head.comment=null);f.mode=9;case 9:if(f.flags&512){for(;16>E;){if(0===F)break a;F--;z+=H[t++]<<E;E+=8}if(z!==(f.check&65535)){a.msg="header crc mismatch";f.mode=30;break}E=z=0}f.head&&(f.head.hcrc=f.flags>>9&1,f.head.done=!0);a.adler=f.check=0;f.mode=12;break;case 10:for(;32>E;){if(0===F)break a;F--;
z+=H[t++]<<E;E+=8}a.adler=f.check=h(z);E=z=0;f.mode=11;case 11:if(0===f.havedict)return a.next_out=l,a.avail_out=u,a.next_in=t,a.avail_in=F,f.hold=z,f.bits=E,2;a.adler=f.check=1;f.mode=12;case 12:if(5===b||6===b)break a;case 13:if(f.last){z>>>=E&7;E-=E&7;f.mode=27;break}for(;3>E;){if(0===F)break a;F--;z+=H[t++]<<E;E+=8}f.last=z&1;z>>>=1;--E;switch(z&3){case 0:f.mode=14;break;case 1:L=f;if(m){v=new k.Buf32(512);D=new k.Buf32(32);for(y=0;144>y;)L.lens[y++]=8;for(;256>y;)L.lens[y++]=9;for(;280>y;)L.lens[y++]=
7;for(;288>y;)L.lens[y++]=8;x(1,L.lens,0,288,v,0,L.work,{bits:9});for(y=0;32>y;)L.lens[y++]=5;x(2,L.lens,0,32,D,0,L.work,{bits:5});m=!1}L.lencode=v;L.lenbits=9;L.distcode=D;L.distbits=5;f.mode=20;if(6===b){z>>>=2;E-=2;break a}break;case 2:f.mode=17;break;case 3:a.msg="invalid block type",f.mode=30}z>>>=2;E-=2;break;case 14:z>>>=E&7;for(E-=E&7;32>E;){if(0===F)break a;F--;z+=H[t++]<<E;E+=8}if((z&65535)!==(z>>>16^65535)){a.msg="invalid stored block lengths";f.mode=30;break}f.length=z&65535;E=z=0;f.mode=
15;if(6===b)break a;case 15:f.mode=16;case 16:if(y=f.length){y>F&&(y=F);y>u&&(y=u);if(0===y)break a;k.arraySet(n,H,t,y,l);F-=y;t+=y;u-=y;l+=y;f.length-=y;break}f.mode=12;break;case 17:for(;14>E;){if(0===F)break a;F--;z+=H[t++]<<E;E+=8}f.nlen=(z&31)+257;z>>>=5;E-=5;f.ndist=(z&31)+1;z>>>=5;E-=5;f.ncode=(z&15)+4;z>>>=4;E-=4;if(286<f.nlen||30<f.ndist){a.msg="too many length or distance symbols";f.mode=30;break}f.have=0;f.mode=18;case 18:for(;f.have<f.ncode;){for(;3>E;){if(0===F)break a;F--;z+=H[t++]<<
E;E+=8}f.lens[e[f.have++]]=z&7;z>>>=3;E-=3}for(;19>f.have;)f.lens[e[f.have++]]=0;f.lencode=f.lendyn;f.lenbits=7;y={bits:f.lenbits};Q=x(0,f.lens,0,19,f.lencode,0,f.work,y);f.lenbits=y.bits;if(Q){a.msg="invalid code lengths set";f.mode=30;break}f.have=0;f.mode=19;case 19:for(;f.have<f.nlen+f.ndist;){for(;;){var M=f.lencode[z&(1<<f.lenbits)-1];y=M>>>24;M&=65535;if(y<=E)break;if(0===F)break a;F--;z+=H[t++]<<E;E+=8}if(16>M)z>>>=y,E-=y,f.lens[f.have++]=M;else{if(16===M){for(L=y+2;E<L;){if(0===F)break a;
F--;z+=H[t++]<<E;E+=8}z>>>=y;E-=y;if(0===f.have){a.msg="invalid bit length repeat";f.mode=30;break}L=f.lens[f.have-1];y=3+(z&3);z>>>=2;E-=2}else if(17===M){for(L=y+3;E<L;){if(0===F)break a;F--;z+=H[t++]<<E;E+=8}z>>>=y;E-=y;L=0;y=3+(z&7);z>>>=3;E-=3}else{for(L=y+7;E<L;){if(0===F)break a;F--;z+=H[t++]<<E;E+=8}z>>>=y;E-=y;L=0;y=11+(z&127);z>>>=7;E-=7}if(f.have+y>f.nlen+f.ndist){a.msg="invalid bit length repeat";f.mode=30;break}for(;y--;)f.lens[f.have++]=L}}if(30===f.mode)break;if(0===f.lens[256]){a.msg=
"invalid code -- missing end-of-block";f.mode=30;break}f.lenbits=9;y={bits:f.lenbits};Q=x(1,f.lens,0,f.nlen,f.lencode,0,f.work,y);f.lenbits=y.bits;if(Q){a.msg="invalid literal/lengths set";f.mode=30;break}f.distbits=6;f.distcode=f.distdyn;y={bits:f.distbits};Q=x(2,f.lens,f.nlen,f.ndist,f.distcode,0,f.work,y);f.distbits=y.bits;if(Q){a.msg="invalid distances set";f.mode=30;break}f.mode=20;if(6===b)break a;case 20:f.mode=21;case 21:if(6<=F&&258<=u){a.next_out=l;a.avail_out=u;a.next_in=t;a.avail_in=F;
f.hold=z;f.bits=E;r(a,N);l=a.next_out;n=a.output;u=a.avail_out;t=a.next_in;H=a.input;F=a.avail_in;z=f.hold;E=f.bits;12===f.mode&&(f.back=-1);break}for(f.back=0;;){M=f.lencode[z&(1<<f.lenbits)-1];y=M>>>24;L=M>>>16&255;M&=65535;if(y<=E)break;if(0===F)break a;F--;z+=H[t++]<<E;E+=8}if(L&&0===(L&240)){var R=y;var W=L;for(c=M;;){M=f.lencode[c+((z&(1<<R+W)-1)>>R)];y=M>>>24;L=M>>>16&255;M&=65535;if(R+y<=E)break;if(0===F)break a;F--;z+=H[t++]<<E;E+=8}z>>>=R;E-=R;f.back+=R}z>>>=y;E-=y;f.back+=y;f.length=M;
if(0===L){f.mode=26;break}if(L&32){f.back=-1;f.mode=12;break}if(L&64){a.msg="invalid literal/length code";f.mode=30;break}f.extra=L&15;f.mode=22;case 22:if(f.extra){for(L=f.extra;E<L;){if(0===F)break a;F--;z+=H[t++]<<E;E+=8}f.length+=z&(1<<f.extra)-1;z>>>=f.extra;E-=f.extra;f.back+=f.extra}f.was=f.length;f.mode=23;case 23:for(;;){M=f.distcode[z&(1<<f.distbits)-1];y=M>>>24;L=M>>>16&255;M&=65535;if(y<=E)break;if(0===F)break a;F--;z+=H[t++]<<E;E+=8}if(0===(L&240)){R=y;W=L;for(c=M;;){M=f.distcode[c+((z&
(1<<R+W)-1)>>R)];y=M>>>24;L=M>>>16&255;M&=65535;if(R+y<=E)break;if(0===F)break a;F--;z+=H[t++]<<E;E+=8}z>>>=R;E-=R;f.back+=R}z>>>=y;E-=y;f.back+=y;if(L&64){a.msg="invalid distance code";f.mode=30;break}f.offset=M;f.extra=L&15;f.mode=24;case 24:if(f.extra){for(L=f.extra;E<L;){if(0===F)break a;F--;z+=H[t++]<<E;E+=8}f.offset+=z&(1<<f.extra)-1;z>>>=f.extra;E-=f.extra;f.back+=f.extra}if(f.offset>f.dmax){a.msg="invalid distance too far back";f.mode=30;break}f.mode=25;case 25:if(0===u)break a;y=N-u;if(f.offset>
y){y=f.offset-y;if(y>f.whave&&f.sane){a.msg="invalid distance too far back";f.mode=30;break}y>f.wnext?(y-=f.wnext,L=f.wsize-y):L=f.wnext-y;y>f.length&&(y=f.length);R=f.window}else R=n,L=l-f.offset,y=f.length;y>u&&(y=u);u-=y;f.length-=y;do n[l++]=R[L++];while(--y);0===f.length&&(f.mode=21);break;case 26:if(0===u)break a;n[l++]=f.length;u--;f.mode=21;break;case 27:if(f.wrap){for(;32>E;){if(0===F)break a;F--;z|=H[t++]<<E;E+=8}N-=u;a.total_out+=N;f.total+=N;N&&(a.adler=f.check=f.flags?q(f.check,n,N,l-
N):g(f.check,n,N,l-N));N=u;if((f.flags?z:h(z))!==f.check){a.msg="incorrect data check";f.mode=30;break}E=z=0}f.mode=28;case 28:if(f.wrap&&f.flags){for(;32>E;){if(0===F)break a;F--;z+=H[t++]<<E;E+=8}if(z!==(f.total&4294967295)){a.msg="incorrect length check";f.mode=30;break}E=z=0}f.mode=29;case 29:Q=1;break a;case 30:Q=-3;break a;case 31:return-4;default:return-2}a.next_out=l;a.avail_out=u;a.next_in=t;a.avail_in=F;f.hold=z;f.bits=E;if((f.wsize||N!==a.avail_out&&30>f.mode&&(27>f.mode||4!==b))&&p(a,
a.output,a.next_out,N-a.avail_out))return f.mode=31,-4;J-=a.avail_in;N-=a.avail_out;a.total_in+=J;a.total_out+=N;f.total+=N;f.wrap&&N&&(a.adler=f.check=f.flags?q(f.check,n,N,a.next_out-N):g(f.check,n,N,a.next_out-N));a.data_type=f.bits+(f.last?64:0)+(12===f.mode?128:0)+(20===f.mode||15===f.mode?256:0);(0===J&&0===N||4===b)&&0===Q&&(Q=-5);return Q};f.inflateEnd=function(a){if(!a||!a.state)return-2;var b=a.state;b.window&&(b.window=null);a.state=null;return 0};f.inflateGetHeader=function(a,b){if(!a||
!a.state)return-2;a=a.state;if(0===(a.wrap&2))return-2;a.head=b;b.done=!1;return 0};f.inflateSetDictionary=function(a,b){var c=b.length;if(!a||!a.state)return-2;var d=a.state;if(0!==d.wrap&&11!==d.mode)return-2;if(11===d.mode){var e=g(1,b,c,0);if(e!==d.check)return-3}if(p(a,b,c,c))return d.mode=31,-4;d.havedict=1;return 0};f.inflateInfo="pako inflate (from Nodeca project)"},function(n,f,l){n.exports=function(f,e){var c=f.state;var a=f.next_in;var b=f.input;var d=a+(f.avail_in-5);var h=f.next_out;
var k=f.output;e=h-(e-f.avail_out);var g=h+(f.avail_out-257);var l=c.dmax;var n=c.wsize;var x=c.whave;var m=c.wnext;var v=c.window;var D=c.hold;var t=c.bits;var J=c.lencode;var C=c.distcode;var A=(1<<c.lenbits)-1;var I=(1<<c.distbits)-1;a:do{15>t&&(D+=b[a++]<<t,t+=8,D+=b[a++]<<t,t+=8);var w=J[D&A];b:for(;;){var B=w>>>24;D>>>=B;t-=B;B=w>>>16&255;if(0===B)k[h++]=w&65535;else if(B&16){var K=w&65535;if(B&=15)t<B&&(D+=b[a++]<<t,t+=8),K+=D&(1<<B)-1,D>>>=B,t-=B;15>t&&(D+=b[a++]<<t,t+=8,D+=b[a++]<<t,t+=8);
w=C[D&I];c:for(;;){B=w>>>24;D>>>=B;t-=B;B=w>>>16&255;if(B&16){w&=65535;B&=15;t<B&&(D+=b[a++]<<t,t+=8,t<B&&(D+=b[a++]<<t,t+=8));w+=D&(1<<B)-1;if(w>l){f.msg="invalid distance too far back";c.mode=30;break a}D>>>=B;t-=B;B=h-e;if(w>B){B=w-B;if(B>x&&c.sane){f.msg="invalid distance too far back";c.mode=30;break a}var u=0;var G=v;if(0===m){if(u+=n-B,B<K){K-=B;do k[h++]=v[u++];while(--B);u=h-w;G=k}}else if(m<B){if(u+=n+m-B,B-=m,B<K){K-=B;do k[h++]=v[u++];while(--B);u=0;if(m<K){B=m;K-=B;do k[h++]=v[u++];while(--B);
u=h-w;G=k}}}else if(u+=m-B,B<K){K-=B;do k[h++]=v[u++];while(--B);u=h-w;G=k}for(;2<K;)k[h++]=G[u++],k[h++]=G[u++],k[h++]=G[u++],K-=3;K&&(k[h++]=G[u++],1<K&&(k[h++]=G[u++]))}else{u=h-w;do k[h++]=k[u++],k[h++]=k[u++],k[h++]=k[u++],K-=3;while(2<K);K&&(k[h++]=k[u++],1<K&&(k[h++]=k[u++]))}}else if(0===(B&64)){w=C[(w&65535)+(D&(1<<B)-1)];continue c}else{f.msg="invalid distance code";c.mode=30;break a}break}}else if(0===(B&64)){w=J[(w&65535)+(D&(1<<B)-1)];continue b}else{B&32?c.mode=12:(f.msg="invalid literal/length code",
c.mode=30);break a}break}}while(a<d&&h<g);K=t>>3;a-=K;t-=K<<3;f.next_in=a;f.next_out=h;f.avail_in=a<d?5+(d-a):5-(a-d);f.avail_out=h<g?257+(g-h):257-(h-g);c.hold=D&(1<<t)-1;c.bits=t}},function(n,f,l){var h=l(5),e=[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],c=[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],a=[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],b=[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];n.exports=function(d,f,k,g,l,n,x,m){var p=m.bits,q,r,J,C,A,I,w=0,B=new h.Buf16(16);var K=new h.Buf16(16);var u,G=0;for(q=0;15>=q;q++)B[q]=0;for(r=0;r<g;r++)B[f[k+r]]++;var H=p;for(J=15;1<=J&&0===B[J];J--);H>J&&(H=J);if(0===J)return l[n++]=20971520,l[n++]=20971520,m.bits=1,0;for(p=1;p<J&&0===B[p];p++);H<p&&(H=p);for(q=C=1;15>=q;q++)if(C<<=1,C-=B[q],0>C)return-1;if(0<C&&(0===d||1!==J))return-1;
K[1]=0;for(q=1;15>q;q++)K[q+1]=K[q]+B[q];for(r=0;r<g;r++)0!==f[k+r]&&(x[K[f[k+r]]++]=r);if(0===d){var F=u=x;var z=19}else 1===d?(F=e,w-=257,u=c,G-=257,z=256):(F=a,u=b,z=-1);r=A=0;q=p;var E=n;g=H;K=0;var O=-1;var N=1<<H;var Q=N-1;if(1===d&&852<N||2===d&&592<N)return 1;for(;;){var L=q-K;if(x[r]<z){var y=0;var M=x[r]}else x[r]>z?(y=u[G+x[r]],M=F[w+x[r]]):(y=96,M=0);C=1<<q-K;p=I=1<<g;do I-=C,l[E+(A>>K)+I]=L<<24|y<<16|M|0;while(0!==I);for(C=1<<q-1;A&C;)C>>=1;0!==C?(A&=C-1,A+=C):A=0;r++;if(0===--B[q]){if(q===
J)break;q=f[k+x[r]]}if(q>H&&(A&Q)!==O){0===K&&(K=H);E+=p;g=q-K;for(C=1<<g;g+K<J;){C-=B[g+K];if(0>=C)break;g++;C<<=1}N+=1<<g;if(1===d&&852<N||2===d&&592<N)return 1;O=A&Q;l[O]=H<<24|g<<16|E-n|0}}0!==A&&(l[E+A]=q-K<<24|4194304);m.bits=H;return 0}},function(n,f,l){n.exports=function(){this.os=this.xflags=this.time=this.text=0;this.extra=null;this.extra_len=0;this.comment=this.name="";this.hcrc=0;this.done=!1}},function(n,f,l){function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");
}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(f,
"__esModule",{value:!0});l.d(f,"DVIDVolumeChunkSource",function(){return r});l.d(f,"TileChunkSource",function(){return x});n=l(2);var a=l(94),b=l(24),d=l(15);f=l(10);var p=l(8);l=l(0);var k=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),g=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,f=
3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var k=a.length-1;0<=k;k--)if(g=a[k])f=(3>e?g(f):3<e?g(b,c,f):g(b,c))||f;return 3<e&&f&&Object.defineProperty(b,c,f),f},q=new Map([[a.b.JPEG,d.a]]),r=function(f){function g(){h(this,g);return e(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}c(g,f);k(g,[{key:"download",value:function(a,b){var c=this.parameters;var d=this.computeChunkBounds(a);
d=this.getPath(d,a.chunkDataSize);var e=this.getDecoder(c);return Object(p.e)(Object(p.c)(c.baseUrls,d),"arraybuffer",b).then(function(b){return e(a,b)})}},{key:"getPath",value:function(b,c){var d=this.parameters;return d.encoding===a.c.JPEG?"/api/node/"+d.nodeKey+"/"+d.dataInstanceKey+"/raw/0_1_2/"+(c[0]+"_"+c[1]+"_"+c[2]+"/")+(b[0]+"_"+b[1]+"_"+b[2]+"/jpeg"):"/api/node/"+d.nodeKey+"/"+d.dataInstanceKey+"/raw/0_1_2/"+(c[0]+"_"+c[1]+"_"+c[2]+"/")+(b[0]+"_"+b[1]+"_"+b[2]+"?compression=googlegzip")}},
{key:"getDecoder",value:function(c){return c.encoding===a.c.JPEG?d.a:b.a}}]);return g}(Object(n.WithParameters)(f.a,a.d));r=g([Object(l.g)()],r);var x=function(a){function b(){h(this,b);var a=e(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.chunkDecoder=q.get(a.parameters.encoding);return a}c(b,a);k(b,[{key:"download",value:function(a,b){var c=this,d=this.parameters,e=a.chunkGridPosition;a.chunkDataSize=this.spec.chunkDataSize;return Object(p.e)(Object(p.c)(d.baseUrls,"/api/node/"+
d.nodeKey+"/"+d.dataInstanceKey+"/tile/"+(d.dims+"/"+d.level+"/")+(e[0]+"_"+e[1]+"_"+e[2])),"arraybuffer",b).then(function(b){return c.chunkDecoder(a,b)})}}]);return b}(Object(n.WithParameters)(f.a,a.a));x=g([Object(l.g)()],x)},function(n,f,l){function h(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function e(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}l.d(f,"c",function(){return a});l.d(f,"d",function(){return b});l.d(f,"b",function(){return d});l.d(f,"a",function(){return p});var a;(function(a){a[a.JPEG=0]="JPEG";a[a.COMPRESSED_SEGMENTATION=1]="COMPRESSED_SEGMENTATION"})(a||
(a={}));n=function g(){c(this,g)};var b=function(a){function b(){c(this,b);return h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}e(b,a);return b}(n);b.RPC_ID="dvid/VolumeChunkSource";var d;(function(a){a[a.JPEG=0]="JPEG"})(d||(d={}));var p=function(a){function b(){c(this,b);return h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}e(b,a);return b}(n);p.RPC_ID="dvid/TileChunkSource"},function(n,f,l){function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");
}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function a(a){var b=
[];Object(D.a)(a,function(a){Object(D.f)(a);b.push(Object(D.h)(a.sectionId))});return b}function b(a,b,c){return Object(v.d)(Object(v.c)(b.baseUrls,"/render-ws/v1/owner/"+b.owner+"/project/"+b.project+"/"+("stack/"+b.stack+"/local-to-world-coordinates"),"PUT"),a,"json",c)}function d(a,c,d,e){var f=[];Object(D.a)(c,function(a){var b=Object(D.h)(a.pId),c=Object(D.h)(a.qId),d=Object(D.f)(a.matches);a=d.p;d=d.q;for(var e=0;e<a[0].length;e++)f.push({tileId:b,local:[a[0][e],a[1][e]]}),f.push({tileId:c,
local:[d[0][e],d[1][e]]})});return b(f,d,e).then(function(b){for(var c=new x.a,d=0;d<b.length;d++){var e=Object(D.f)(b[d]);e=Object(D.e)(e.world);c.appendArray(e)}a.vertexPositions=c.view})}function p(a,b,c,e){if(1===b.length)b="/render-ws/v1/owner/"+c.owner+"/matchCollection/"+(c.matchCollection+"/group/"+b[0]+"/matchesWith/"+b[0]);else if(2===b.length)b="/render-ws/v1/owner/"+c.owner+"/matchCollection/"+(c.matchCollection+"/group/"+b[0]+"/matchesWith/"+b[1]);else throw Error("Invalid section Id vector of length: "+
JSON.stringify(b.length));return Object(v.e)(Object(v.c)(c.baseUrls,b),"json",e).then(function(b){return d(a,b,c,e)})}function k(b,c,d,e){return Object(v.e)(Object(v.c)(d.baseUrls,c),"json",e).then(function(c){return p(b,a(c),d,e)})}Object.defineProperty(f,"__esModule",{value:!0});l.d(f,"TileChunkSource",function(){return A});l.d(f,"PointMatchSource",function(){return I});n=l(2);f=l(96);var g=l(15),q=l(97),r=l(10),x=l(99),m=l(1),v=l(8),D=l(4);l=l(0);var t=function(){function a(a,b){for(var c=0;c<
b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),J=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,f=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var k=a.length-1;0<=k;k--)if(g=a[k])f=(3>e?g(f):3<e?g(b,c,f):g(b,c))||
f;return 3<e&&f&&Object.defineProperty(b,c,f),f},C=new Map;C.set("jpg",g.a);var A=function(a){function b(){h(this,b);var a=e(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.chunkDecoder=C.get(a.parameters.encoding);var c=a.parameters;var d=[];void 0!==c.channel&&d.push("channels="+c.channel);void 0!==c.minIntensity&&d.push("minIntensity="+JSON.stringify(c.minIntensity));void 0!==c.maxIntensity&&d.push("maxIntensity="+JSON.stringify(c.maxIntensity));void 0!==c.maxTileSpecsToRender&&
d.push("maxTileSpecsToRender="+JSON.stringify(c.maxTileSpecsToRender));void 0!==c.filter&&d.push("filter="+JSON.stringify(c.filter));c=d.join("&");a.queryString=c;return a}c(b,a);t(b,[{key:"download",value:function(a,b){var c=this,d=this.parameters,e=a.chunkGridPosition,f=1/Math.pow(2,d.level);a.chunkDataSize=this.spec.chunkDataSize;var g=a.chunkDataSize[0]*Math.pow(2,d.level),k=a.chunkDataSize[1]*Math.pow(2,d.level),h=m.m.create();h[0]=e[0]*g;h[1]=e[1]*k;h[2]=e[2];return Object(v.e)(Object(v.c)(d.baseUrls,
"/render-ws/v1/owner/"+d.owner+"/project/"+d.project+"/stack/"+d.stack+"/z/"+h[2]+"/box/"+h[0]+","+h[1]+","+g+","+k+","+f+"/jpeg-image?"+this.queryString),"arraybuffer",b).then(function(b){return c.chunkDecoder(a,b)})}}]);return b}(Object(n.WithParameters)(r.a,f.b));A=J([Object(l.g)()],A);var I=function(a){function b(){h(this,b);return e(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);t(b,[{key:"download",value:function(a,b){var c=this.parameters,d=a.chunkGridPosition,e=
m.m.create();e[2]=d[2];return k(a,"/render-ws/v1/owner/"+c.owner+"/project/"+c.project+"/"+("stack/"+c.stack+"/sectionData?minZ="+e[2]+"&")+("maxZ="+(e[2]+c.zoffset)),c,b)}}]);return b}(Object(n.WithParameters)(q.a,f.a));I=J([Object(l.g)()],I)},function(n,f,l){function h(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function e(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}l.d(f,"b",function(){return a});l.d(f,"a",function(){return b});n=function(a){function b(){c(this,b);return h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}e(b,a);return b}(function p(){c(this,p)});
var a=function(a){function b(){c(this,b);return h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}e(b,a);return b}(n);a.RPC_ID="render/TileChunkSource";var b=function(a){function b(){c(this,b);return h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}e(b,a);return b}(n);b.RPC_ID="render/PointMatchSource"},function(n,f,l){function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}l.d(f,"a",function(){return g});n=l(22);var a=l(98),b=l(1),d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=
d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),p=function r(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){if(a=Object.getPrototypeOf(a),null!==a)return r(a,b,c)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(c)}},k=function(a){function b(){h(this,b);var a=e(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));
a.source=null;a.vertexPositions=null;a.vertexNormals=null;return a}c(b,a);d(b,[{key:"initializeVolumeChunk",value:function(a,c){p(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"initializeVolumeChunk",this).call(this,a,c);a=0;this.vertexPositions&&(a+=this.vertexPositions.buffer.byteLength);this.vertexNormals&&(a+=this.vertexNormals.buffer.byteLength);this.gpuMemoryBytes=this.systemMemoryBytes=a;this.vertexPositions=null}},{key:"serialize",value:function(a,c){p(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),
"serialize",this).call(this,a,c);var d=this.vertexPositions,e=this.vertexNormals;a.vertexPositions=d;c.push(d.buffer);e&&(a.vertexNormals=e,c.push(e.buffer));this.vertexNormals=this.vertexPositions=null}},{key:"downloadSucceeded",value:function(){this.systemMemoryBytes=this.gpuMemoryBytes=this.vertexPositions.byteLength;p(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"downloadSucceeded",this).call(this)}},{key:"freeSystemMemory",value:function(){this.vertexNormals=this.vertexPositions=
null}}]);return b}(n.SliceViewChunk),g=function(f){function g(b,c){h(this,g);b=e(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,b,c));b.spec=a.a.fromObject(c.spec);return b}c(g,f);d(g,[{key:"getChunk",value:function(a){var c=Object(b.n)(a),d=this.chunks.get(c);void 0===d&&(d=this.getNewChunk_(k),d.initializeVolumeChunk(c,a),this.addChunk(d));return d}}]);return g}(n.SliceViewChunkSource)},function(n,f,l){function h(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+
typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}l.d(f,"a",function(){return d});var e=l(14),c=l(1),a=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),b;(function(a){a[a.LINE=
0]="LINE";a[a.POINT=1]="POINT"})(b||(b={}));var d=function(b){function d(a){if(!(this instanceof d))throw new TypeError("Cannot call a class as a function");a=(d.__proto__||Object.getPrototypeOf(d)).call(this,a);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!==typeof a&&"function"!==typeof a?this:a}h(d,b);a(d,[{key:"toObject",value:function(){return{transform:this.chunkLayout.transform,chunkDataSize:this.chunkDataSize,voxelSize:this.voxelSize,
lowerVoxelBound:this.lowerVoxelBound,upperVoxelBound:this.upperVoxelBound,lowerClipBound:this.lowerClipBound,upperClipBound:this.upperClipBound,baseVoxelOffset:this.baseVoxelOffset}}}],[{key:"make",value:function(a){return new d(Object.assign({},a,{transform:Object(e.k)(a.transform,a.vectorGraphicsSourceOptions)}))}},{key:"fromObject",value:function(a){return new d(a)}},{key:"withDefaults",value:function(a){var b=a.transform,f=a.lowerVoxelBound,g=a.upperVoxelBound,h=a.chunkDataSize;b=Object(e.k)(b,
a.vectorGraphicsSourceOptions);if(void 0===h&&(h=c.m.clone(g),void 0!==f))for(g=0;3>g;g++)h[g]+=Math.abs(f[g]);console.log(h);console.log(a);return new d(Object.assign({},a,{transform:b,chunkDataSize:h}))}}]);return d}(e.i)},function(n,f,l){l.d(f,"a",function(){return e});var h=function(){function c(a,b){for(var c=0;c<b.length;c++){var e=b[c];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(a,e.key,e)}}return function(a,b,d){b&&c(a.prototype,b);d&&
c(a,d);return a}}(),e=function(){function c(a){a=void 0===a?16:a;if(!(this instanceof c))throw new TypeError("Cannot call a class as a function");this.length=0;this.data=new Float32Array(a)}h(c,[{key:"resize",value:function(a){var b=this.data;if(a>b.length){var c=new Float32Array(Math.max(a,2*b.length));c.set(b.subarray(0,this.length));this.data=c}this.length=a}},{key:"shrinkToFit",value:function(){this.data=new Float32Array(this.view)}},{key:"clear",value:function(){this.length=0}},{key:"appendArray",
value:function(a){var b=this.length;this.resize(b+a.length);this.data.set(a,b)}},{key:"eraseRange",value:function(a,b){this.data.copyWithin(a,b,this.length);this.length-=b-a}},{key:"view",get:function(){var a=this.data;return new Float32Array(a.buffer,a.byteOffset,this.length)}}]);return c}()},function(n,f,l){Object.defineProperty(f,"__esModule",{value:!0});l(38)},function(n,f,l){function h(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function a(a,b){return Object(d.c)(a,b,"fragments")}function b(a,b){var c=(new DataView(b)).getUint32(0,!0);Object(d.d)(a,b,r.b.LITTLE,
4,c)}Object.defineProperty(f,"__esModule",{value:!0});l.d(f,"PrecomputedVolumeChunkSource",function(){return t});f.decodeManifestChunk=a;f.decodeFragmentChunk=b;l.d(f,"PrecomputedMeshSource",function(){return J});n=l(2);f=l(102);var d=l(18),p=l(24),k=l(15),g=l(19),q=l(10),r=l(9),x=l(8);l=l(0);var m=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&
a(b.prototype,c);d&&a(b,d);return b}}(),v=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,f=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)if(g=a[h])f=(3>e?g(f):3<e?g(b,c,f):g(b,c))||f;return 3<e&&f&&Object.defineProperty(b,c,f),f},D=new Map;D.set(f.b.RAW,g.a);D.set(f.b.JPEG,k.a);D.set(f.b.COMPRESSED_SEGMENTATION,p.a);var t=function(a){function b(){h(this,
b);var a=e(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments));a.chunkDecoder=D.get(a.parameters.encoding);return a}c(b,a);m(b,[{key:"download",value:function(a,b){var c=this,d=this.parameters,e=this.computeChunkBounds(a),f=a.chunkDataSize;return Object(x.e)(Object(x.c)(d.baseUrls,d.path+"/"+e[0]+"-"+(e[0]+f[0])+"_"+(e[1]+"-"+(e[1]+f[1])+"_")+(e[2]+"-"+(e[2]+f[2]))),"arraybuffer",b).then(function(b){return c.chunkDecoder(a,b)})}}]);return b}(Object(n.WithParameters)(q.a,f.c));t=v([Object(l.g)()],
t);var J=function(d){function f(){h(this,f);return e(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}c(f,d);m(f,[{key:"download",value:function(b,c){var d=this.parameters;return Object(x.e)(Object(x.c)(d.baseUrls,d.path+"/"+b.objectId+":"+d.lod),"json",c).then(function(c){return a(b,c)})}},{key:"downloadFragment",value:function(a,c){var d=this.parameters;return Object(x.e)(Object(x.c)(d.baseUrls,d.path+"/"+a.fragmentId),"arraybuffer",c).then(function(c){return b(a,c)})}}]);return f}(Object(n.WithParameters)(d.a,
f.a));J=v([Object(l.g)()],J)},function(n,f,l){function h(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}l.d(f,"b",function(){return e});l.d(f,"c",function(){return c});l.d(f,"a",function(){return a});var e;(function(a){a[a.RAW=0]="RAW";a[a.JPEG=1]="JPEG";a[a.COMPRESSED_SEGMENTATION=2]="COMPRESSED_SEGMENTATION"})(e||(e={}));var c=function d(){h(this,d)};c.RPC_ID="precomputed/VolumeChunkSource";var a=function p(){h(this,p)};a.RPC_ID="precomputed/MeshSource"},function(n,
f,l){function h(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function c(a){Object(v.isCompressed)(a)&&(a=Object(v.decompress)(a));var b=new t;b.uncompressedData=
a;a=Object(v.readHeader)(a);if(null===a)throw Error("Failed to parse NIFTI header.");b.header=a;return b}function a(a,b,d,e){return p.a.getData(a,c,b,d,e)}function b(b,c,e){return a(b,c,function(){return{priorityTier:d.d.VISIBLE,priority:1E3}},e).then(function(a){return a.header})}Object.defineProperty(f,"__esModule",{value:!0});l.d(f,"NiftiFileData",function(){return t});l.d(f,"NiftiVolumeChunkSource",function(){return C});n=l(2);var d=l(12),p=l(28),k=l(105),g=l(19);f=l(10);var q=l(37),r=l(9),x=
l(1),m=l(0),v=l(106);l.n(v);var D=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}();l=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,f=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=
a.length-1;0<=h;h--)if(g=a[h])f=(3>e?g(f):3<e?g(b,c,f):g(b,c))||f;return 3<e&&f&&Object.defineProperty(b,c,f),f};var t=function I(){e(this,I)},J=new Map([[k.b.INT8,{dataType:q.a.UINT8,volumeType:q.c.IMAGE}],[k.b.UINT8,{dataType:q.a.UINT8,volumeType:q.c.IMAGE}],[k.b.INT16,{dataType:q.a.UINT16,volumeType:q.c.IMAGE}],[k.b.UINT16,{dataType:q.a.UINT16,volumeType:q.c.IMAGE}],[k.b.INT32,{dataType:q.a.UINT32,volumeType:q.c.SEGMENTATION}],[k.b.UINT32,{dataType:q.a.UINT32,volumeType:q.c.SEGMENTATION}],[k.b.INT64,
{dataType:q.a.UINT64,volumeType:q.c.SEGMENTATION}],[k.b.UINT64,{dataType:q.a.UINT64,volumeType:q.c.SEGMENTATION}],[k.b.FLOAT32,{dataType:q.a.FLOAT32,volumeType:q.c.IMAGE}]]);Object(m.e)(k.a,function(a,c){return b(this.getRef(a.chunkManager),a.url,c).then(function(a){var b=J.get(a.datatypeCode);if(void 0===b)throw Error("Unsupported data type: "+((k.b[a.datatypeCode]||a.datatypeCode)+"."));if(1!==a.dims[4])throw Error("Time series data not supported.");var c=1;switch(a.xyzt_units&v.NIFTI1.SPATIAL_UNITS_MASK){case v.NIFTI1.UNITS_METER:c=
1E9;break;case v.NIFTI1.UNITS_MM:c=1E6;break;case v.NIFTI1.UNITS_MICRON:c=1E3}var d=a.quatern_b,e=a.quatern_c,f=a.quatern_d,g=Math.sqrt(1-d*d-e*e-f*f),h=-1===a.pixDims[0]?-1:1,l=a.description;var m=a.affine;m=x.h.fromValues(m[0][0],m[1][0],m[2][0],m[3][0],m[0][1],m[1][1],m[2][1],m[3][1],m[0][2],m[1][2],m[2][2],m[3][2],m[0][3],m[1][3],m[2][3],m[3][3]);return{value:{description:l,affine:m,dataType:b.dataType,numChannels:a.dims[5],volumeType:b.volumeType,voxelSize:x.m.fromValues(c*a.pixDims[1],c*a.pixDims[2],
c*a.pixDims[3]),volumeSize:x.m.fromValues(a.dims[1],a.dims[2],a.dims[3]),qoffset:x.m.fromValues(c*a.qoffset_x,c*a.qoffset_y,c*a.qoffset_z),qform_code:a.qform_code,sform_code:a.sform_code,qfac:h,quatern:x.j.fromValues(d,e,f,g)}}})});var C=function(b){function c(){e(this,c);var a=(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!==typeof a&&"function"!==typeof a?this:a}h(c,b);
D(c,[{key:"download",value:function(b,c){b.chunkDataSize=this.spec.chunkDataSize;return a(this.chunkManager.addRef(),this.parameters.url,function(){return{priorityTier:b.priorityTier,priority:b.priority}},c).then(function(a){var c=Object(v.readImage)(a.header,a.uncompressedData);Object(g.a)(b,c,a.header.littleEndian?r.b.LITTLE:r.b.BIG)})}}]);return c}(Object(n.WithParameters)(f.a,k.c));C=l([Object(m.g)()],C)},function(n,f,l){f.a=function(c){if(c instanceof Object){var a=c[h];void 0===a&&(a=c[h]=e++);
return"o"+a}return""+JSON.stringify(c)};$jscomp.initSymbol();var h=Symbol("objectId"),e=0},function(n,f,l){l.d(f,"b",function(){return h});l.d(f,"c",function(){return e});f.a="nifti/getNiftiVolumeInfo";var h;(function(c){c[c.NONE=0]="NONE";c[c.BINARY=1]="BINARY";c[c.UINT8=2]="UINT8";c[c.INT16=4]="INT16";c[c.INT32=8]="INT32";c[c.FLOAT32=16]="FLOAT32";c[c.COMPLEX64=32]="COMPLEX64";c[c.FLOAT64=64]="FLOAT64";c[c.RGB24=128]="RGB24";c[c.INT8=256]="INT8";c[c.UINT16=512]="UINT16";c[c.UINT32=768]="UINT32";
c[c.INT64=1024]="INT64";c[c.UINT64=1280]="UINT64";c[c.FLOAT128=1536]="FLOAT128";c[c.COMPLEX128=1792]="COMPLEX128";c[c.COMPLEX256=2048]="COMPLEX256"})(h||(h={}));var e=function a(){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");};e.RPC_ID="nifti/VolumeChunkSource"},function(n,f,l){var h=h||{};h.NIFTI1=h.NIFTI1||l(45);h.NIFTI2=h.NIFTI2||l(107);h.Utils=h.Utils||l(29);var e=e||l(26);h.isNIFTI1=function(c){if(c.byteLength<h.NIFTI1.STANDARD_HEADER_SIZE)return!1;var a=new DataView(c);
c=a.getUint8(h.NIFTI1.MAGIC_NUMBER_LOCATION);var b=a.getUint8(h.NIFTI1.MAGIC_NUMBER_LOCATION+1);a=a.getUint8(h.NIFTI1.MAGIC_NUMBER_LOCATION+2);return!(c!==h.NIFTI1.MAGIC_NUMBER[0]||b!==h.NIFTI1.MAGIC_NUMBER[1]||a!==h.NIFTI1.MAGIC_NUMBER[2])};h.isNIFTI2=function(c){if(c.byteLength<h.NIFTI1.STANDARD_HEADER_SIZE)return!1;var a=new DataView(c);c=a.getUint8(h.NIFTI2.MAGIC_NUMBER_LOCATION);var b=a.getUint8(h.NIFTI2.MAGIC_NUMBER_LOCATION+1);a=a.getUint8(h.NIFTI2.MAGIC_NUMBER_LOCATION+2);return!(c!==h.NIFTI2.MAGIC_NUMBER[0]||
b!==h.NIFTI2.MAGIC_NUMBER[1]||a!==h.NIFTI2.MAGIC_NUMBER[2])};h.isNIFTI=function(c){return h.isNIFTI1(c)||h.isNIFTI2(c)};h.isCompressed=function(c){if(c){var a=new DataView(c);c=a.getUint8(0);a=a.getUint8(1);if(c===h.Utils.GUNZIP_MAGIC_COOKIE1||a===h.Utils.GUNZIP_MAGIC_COOKIE2)return!0}return!1};h.decompress=function(c){return e.inflate(c).buffer};h.readHeader=function(c){var a=null;h.isCompressed(c)&&(c=h.decompress(c));h.isNIFTI1(c)?a=new h.NIFTI1:h.isNIFTI2(c)&&(a=new h.NIFTI2);a?a.readHeader(c):
console.error("That file does not appear to be NIFTI!");return a};h.hasExtension=function(c){return 0!=c.extensionFlag[0]};h.readImage=function(c,a){var b=c.vox_offset,d=1,e=1;c.dims[4]&&(d=c.dims[4]);c.dims[5]&&(e=c.dims[5]);return a.slice(b,b+c.numBitsPerVoxel/8*c.dims[2]*c.dims[3]*d*e*c.dims[1])};h.readExtension=function(c,a){var b=c.getExtensionLocation();return a.slice(b,b+c.extensionSize)};h.readExtensionData=function(c,a){var b=c.getExtensionLocation();return a.slice(b+8,b+c.extensionSize-
8)};"undefined"!==typeof n&&n.exports&&(n.exports=h)},function(n,f,l){var h=h||{};h.Utils=h.Utils||l(29);h.NIFTI1=h.NIFTI1||l(45);h.NIFTI2=h.NIFTI2||function(){this.littleEndian=!1;this.dim_info=0;this.dims=[];this.slice_code=this.slice_end=this.slice_start=this.numBitsPerVoxel=this.datatypeCode=this.intent_code=this.intent_p3=this.intent_p2=this.intent_p1=0;this.pixDims=[];this.vox_offset=0;this.scl_slope=1;this.toffset=this.slice_duration=this.cal_min=this.cal_max=this.xyzt_units=this.scl_inter=
0;this.intent_name=this.aux_file=this.description="";this.qoffset_z=this.qoffset_y=this.qoffset_x=this.quatern_d=this.quatern_c=this.quatern_b=this.sform_code=this.qform_code=0;this.affine=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];this.magic=0;this.extensionFlag=[0,0,0,0]};h.NIFTI2.MAGIC_COOKIE=540;h.NIFTI2.MAGIC_NUMBER_LOCATION=4;h.NIFTI2.MAGIC_NUMBER=[110,43,50,0,13,10,26,10];h.NIFTI2.prototype.readHeader=function(e){e=new DataView(e);var c=h.Utils.getIntAt(e,0,this.littleEndian),a,b;c!==h.NIFTI2.MAGIC_COOKIE&&
(this.littleEndian=!0,c=h.Utils.getIntAt(e,0,this.littleEndian));if(c!==h.NIFTI2.MAGIC_COOKIE)throw Error("This does not appear to be a NIFTI file!");this.datatypeCode=h.Utils.getShortAt(e,12,this.littleEndian);this.numBitsPerVoxel=h.Utils.getShortAt(e,14,this.littleEndian);for(a=0;8>a;a+=1)c=16+8*a,this.dims[a]=h.Utils.getLongAt(e,c,this.littleEndian);this.intent_p1=h.Utils.getDoubleAt(e,80,this.littleEndian);this.intent_p2=h.Utils.getDoubleAt(e,88,this.littleEndian);this.intent_p3=h.Utils.getDoubleAt(e,
96,this.littleEndian);for(a=0;8>a;a+=1)c=104+8*a,this.pixDims[a]=h.Utils.getDoubleAt(e,c,this.littleEndian);this.vox_offset=h.Utils.getLongAt(e,168,this.littleEndian);this.scl_slope=h.Utils.getDoubleAt(e,176,this.littleEndian);this.scl_inter=h.Utils.getDoubleAt(e,184,this.littleEndian);this.cal_max=h.Utils.getDoubleAt(e,192,this.littleEndian);this.cal_min=h.Utils.getDoubleAt(e,200,this.littleEndian);this.slice_duration=h.Utils.getDoubleAt(e,208,this.littleEndian);this.toffset=h.Utils.getDoubleAt(e,
216,this.littleEndian);this.slice_start=h.Utils.getLongAt(e,224,this.littleEndian);this.slice_end=h.Utils.getLongAt(e,232,this.littleEndian);this.description=h.Utils.getStringAt(e,240,320);this.aux_file=h.Utils.getStringAt(e,320,344);this.qform_code=h.Utils.getIntAt(e,344,this.littleEndian);this.sform_code=h.Utils.getIntAt(e,348,this.littleEndian);this.quatern_b=h.Utils.getDoubleAt(e,352,this.littleEndian);this.quatern_c=h.Utils.getDoubleAt(e,360,this.littleEndian);this.quatern_d=h.Utils.getDoubleAt(e,
368,this.littleEndian);this.qoffset_x=h.Utils.getDoubleAt(e,376,this.littleEndian);this.qoffset_y=h.Utils.getDoubleAt(e,384,this.littleEndian);this.qoffset_z=h.Utils.getDoubleAt(e,392,this.littleEndian);for(a=0;3>a;a+=1)for(b=0;4>b;b+=1)c=400+8*(4*a+b),this.affine[a][b]=h.Utils.getDoubleAt(e,c,this.littleEndian);this.affine[3][0]=0;this.affine[3][1]=0;this.affine[3][2]=0;this.affine[3][3]=1;this.slice_code=h.Utils.getIntAt(e,496,this.littleEndian);this.xyzt_units=h.Utils.getIntAt(e,500,this.littleEndian);
this.intent_code=h.Utils.getIntAt(e,504,this.littleEndian);this.intent_name=h.Utils.getStringAt(e,508,524);this.dim_info=h.Utils.getByteAt(e,524);e.byteLength>h.NIFTI2.MAGIC_COOKIE&&(this.extensionFlag[0]=h.Utils.getByteAt(e,540),this.extensionFlag[1]=h.Utils.getByteAt(e,541),this.extensionFlag[2]=h.Utils.getByteAt(e,542),this.extensionFlag[3]=h.Utils.getByteAt(e,543),this.extensionFlag[0]&&(this.extensionSize=this.getExtensionSize(e),this.extensionCode=this.getExtensionCode(e)))};h.NIFTI2.prototype.toFormattedString=
function(){var e=h.Utils.formatNumber;var c=""+("Datatype = "+ +this.datatypeCode+" ("+this.getDatatypeCodeString(this.datatypeCode)+")\n");c+="Bits Per Voxel =  = "+this.numBitsPerVoxel+"\n";c+="Image Dimensions (1-8): "+this.dims[0]+", "+this.dims[1]+", "+this.dims[2]+", "+this.dims[3]+", "+this.dims[4]+", "+this.dims[5]+", "+this.dims[6]+", "+this.dims[7]+"\n";c+="Intent Parameters (1-3): "+this.intent_p1+", "+this.intent_p2+", "+this.intent_p3+"\n";c+="Voxel Dimensions (1-8): "+e(this.pixDims[0])+
", "+e(this.pixDims[1])+", "+e(this.pixDims[2])+", "+e(this.pixDims[3])+", "+e(this.pixDims[4])+", "+e(this.pixDims[5])+", "+e(this.pixDims[6])+", "+e(this.pixDims[7])+"\n";c+="Image Offset = "+this.vox_offset+"\n";c+="Data Scale:  Slope = "+e(this.scl_slope)+"  Intercept = "+e(this.scl_inter)+"\n";c+="Display Range:  Max = "+e(this.cal_max)+"  Min = "+e(this.cal_min)+"\n";c+="Slice Duration = "+this.slice_duration+"\n";c+="Time Axis Shift = "+this.toffset+"\n";c+="Slice Start = "+this.slice_start+
"\n";c+="Slice End = "+this.slice_end+"\n";c+='Description: "'+this.description+'"\n';c+='Auxiliary File: "'+this.aux_file+'"\n';c+="Q-Form Code = "+this.qform_code+" ("+this.getTransformCodeString(this.qform_code)+")\n";c+="S-Form Code = "+this.sform_code+" ("+this.getTransformCodeString(this.sform_code)+")\n";c+="Quaternion Parameters:  b = "+e(this.quatern_b)+"  c = "+e(this.quatern_c)+"  d = "+e(this.quatern_d)+"\n";c+="Quaternion Offsets:  x = "+this.qoffset_x+"  y = "+this.qoffset_y+"  z = "+
this.qoffset_z+"\n";c+="S-Form Parameters X: "+e(this.affine[0][0])+", "+e(this.affine[0][1])+", "+e(this.affine[0][2])+", "+e(this.affine[0][3])+"\n";c+="S-Form Parameters Y: "+e(this.affine[1][0])+", "+e(this.affine[1][1])+", "+e(this.affine[1][2])+", "+e(this.affine[1][3])+"\n";c+="S-Form Parameters Z: "+e(this.affine[2][0])+", "+e(this.affine[2][1])+", "+e(this.affine[2][2])+", "+e(this.affine[2][3])+"\n";c+="Slice Code = "+this.slice_code+"\n";c+="Units Code = "+this.xyzt_units+" ("+this.getUnitsCodeString(h.NIFTI1.SPATIAL_UNITS_MASK&
this.xyzt_units)+", "+this.getUnitsCodeString(h.NIFTI1.TEMPORAL_UNITS_MASK&this.xyzt_units)+")\n";c+="Intent Code = "+this.intent_code+"\n";c+='Intent Name: "'+this.intent_name+'"\n';return c+="Dim Info = "+this.dim_info+"\n"};h.NIFTI2.prototype.getExtensionLocation=function(){return h.NIFTI2.MAGIC_COOKIE+4};h.NIFTI2.prototype.getExtensionSize=h.NIFTI1.prototype.getExtensionSize;h.NIFTI2.prototype.getExtensionCode=h.NIFTI1.prototype.getExtensionCode;h.NIFTI2.prototype.getDatatypeCodeString=h.NIFTI1.prototype.getDatatypeCodeString;
h.NIFTI2.prototype.getTransformCodeString=h.NIFTI1.prototype.getTransformCodeString;h.NIFTI2.prototype.getUnitsCodeString=h.NIFTI1.prototype.getUnitsCodeString;h.NIFTI2.prototype.getQformMat=h.NIFTI1.prototype.getQformMat;h.NIFTI2.prototype.convertNiftiQFormToNiftiSForm=h.NIFTI1.prototype.convertNiftiQFormToNiftiSForm;h.NIFTI2.prototype.convertNiftiSFormToNEMA=h.NIFTI1.prototype.convertNiftiSFormToNEMA;h.NIFTI2.prototype.nifti_mat33_mul=h.NIFTI1.prototype.nifti_mat33_mul;h.NIFTI2.prototype.nifti_mat33_determ=
h.NIFTI1.prototype.nifti_mat33_determ;"undefined"!==typeof n&&n.exports&&(n.exports=h.NIFTI2)},function(n,f,l){function h(a){return Object(c.a)(Object(b.a)(a))}Object.defineProperty(f,"__esModule",{value:!0});var e=l(28),c=l(109);n=l(46);var a=l(7),b=l(47);Object(n.a)("vtk",{description:"VTK",getMesh:function(b,c,f,g){return e.a.getData(b.addRef(),h,c,f,g).then(function(b){var c={info:{numTriangles:b.numTriangles,numVertices:b.numVertices,vertexAttributes:[]},indices:b.indices,vertexPositions:b.vertexPositions,
vertexAttributes:[]};b=$jscomp.makeIterator(b.vertexAttributes);for(var d=b.next();!d.done;d=b.next())d=d.value,c.info.vertexAttributes.push({name:d.name,dataType:a.b.FLOAT32,numComponents:d.numComponents}),c.vertexAttributes.push(d.data);return c})}})},function(n,f,l){f.a=function(a){var b=(new TextDecoder).decode(new Uint8Array(a.buffer,a.byteOffset,Math.min(a.byteLength,1E3))).match(h);if(null===b)throw Error("Failed to parse VTK file header.");var c=b[0].length,d=b[4],e=b[3];b={version:b[1],comment:b[2],
datasetType:d,dataFormat:e};a=new Uint8Array(a.buffer,a.byteOffset+c,a.byteLength-c);if("ASCII"===e){e=q.get(d);if(void 0===e)throw Error("VTK dataset type "+JSON.stringify(d)+" is not supported.");return e(b,a)}throw Error("VTK data format "+JSON.stringify(e)+" is not supported.");};var h=/^[ \t]*#[ \t]+vtk[ \t]+DataFile[ \t]+Version[ \t]+([^\s]+)[ \t]*\n(.*)\n[ \t]*(ASCII|BINARY)[ \t]*\n[ \t]*DATASET[ \t]+([^ ]+)[ \t]*\n/,e=/^[ \t]*POINT_DATA[ \t]+([0-9]+)[ \t]*$/,c=/^[ \t]*POINTS[ \t]+([0-9]+)[ \t]+([^\s]+)[ \t]*$/,
a=/^[ \t]*SCALARS[ \t]+([^\s]+)[ \t]+([^\s]+)(?:[ \t]+([0-9]+))?[ \t]*$/,b=/^[ \t]*LOOKUP_TABLE[ \t]+([^\s]+)[ \t]*$/,d=/^[ \t]*POLYGONS[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]*$/,p=/^[ \t]*3[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]*$/,k=/^[ \t]*$/,g=function x(a,b,c,d,e,f){if(!(this instanceof x))throw new TypeError("Cannot call a class as a function");this.header=a;this.numVertices=b;this.vertexPositions=c;this.numTriangles=d;this.indices=e;this.vertexAttributes=f},q=new Map([["POLYDATA",function(f,
h){function l(a,b,c,d){d=RegExp("^[ \t]*"+"([^s]+)[ \t]+".repeat(c-1)+"([^s]+)[ \t]*$");if(A-I<b)throw Error("VTK data ended unexpectedly while parsing "+a+".");for(var e=new Float32Array(b*c),f=0,g=0;g<b;++g){var h=x[I++],k=h.match(d);if(null===k)throw Error("Failed to parse "+a+" line "+g+": "+JSON.stringify(h)+".");for(h=0;h<c;++h)e[f++]=parseFloat(k[h+1])}return e}function m(a,b){if(void 0!==u)throw Error("POINTS specified more than once.");w=a;B=l("POINTS",a,3,b)}function n(a,b){if(void 0!==
u)throw Error("VERTICES specified more than once.");if(A-I<a)throw Error("VTK data ended unexpectedly");if(b!==4*a)throw Error("Only triangular faces are supported.");K=a;u=new Uint32Array(3*a);for(var c=b=0;c<a;++c){var d=x[I++].match(p);if(null===d)throw Error("Failed to parse indices for face "+c);u[b++]=parseInt(d[1],10);u[b++]=parseInt(d[2],10);u[b++]=parseInt(d[3],10)}}function q(c){if(w!==c)throw Error("Number of vertices specified in POINT_DATA section ("+c+") "+("must match number of points ("+
w+")."));for(;I<A;)if(c=x[I],c.match(k))++I;else{var d=c.match(a);if(null!==d){var e=void 0===d[3]?1:parseInt(d[3],10);++I;c=d[1];d=d[2];if(I===A)throw Error("Expected LOOKUP_TABLE directive.");var f=x[I++],g=f.match(b);if(null===g)throw Error("Expected LOOKUP_TABLE directive in "+JSON.stringify(f)+".");f=g[1];g=l("SCALARS("+c+")",w,e,d);G.push({name:c,data:g,numComponents:e,dataType:d,tableName:f})}}}for(var x=(new TextDecoder).decode(h).split("\n"),A=x.length,I=0,w=-1,B=void 0,K=-1,u=void 0,G=[];I<
A;)if(h=x[I],h.match(k))++I;else{var H=void 0;H=h.match(c);if(null!==H)++I,m(parseInt(H[1],10),H[2]);else if(H=h.match(d),null!==H)++I,n(parseInt(H[1],10),parseInt(H[2],10));else{H=h.match(e);if(null!==H){++I;q(parseInt(H[1],10));break}throw Error("Failed to parse VTK line "+JSON.stringify(h)+".");}}if(void 0===B)throw Error("Vertex positions not specified.");if(void 0===u)throw Error("Indices not specified.");return new g(f,w,B,K,u,G)}]])},function(n,f,l){function h(a,b){if("function"!==typeof b&&
null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}l.d(f,"d",function(){return c});f.c="single_mesh/SingleMeshLayer";f.a="single_mesh/getSingleMeshInfo";f.b="";var c=function(a){function b(){e(this,
b);var a=(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!==typeof a&&"function"!==typeof a?this:a}h(b,a);return b}(function b(){e(this,b)});c.RPC_ID="single_mesh/SingleMeshSource"},function(n,f,l){function h(b){b=(new TextDecoder).decode(Object(a.a)(b)).trim().split(/\n+/);if(!b)throw Error("CSV file is empty.");var d=b[0].split(","),e=d.map(function(a){return{name:a.trim(),
dataType:c.b.FLOAT32,numComponents:1}}),f=b.length-1,g=d.length;d=d.map(function(){return new Float32Array(f)});for(var h=0;h<f;++h)for(var l=b[h+1].split(","),n=0;n<g;++n)d[n][h]=parseFloat(l[n]);return{numVertices:f,attributeInfo:e,attributes:d}}Object.defineProperty(f,"__esModule",{value:!0});var e=l(28);n=l(46);var c=l(7),a=l(47);Object(n.b)("csv",{description:"Comma separated value text file",getMeshVertexAttributes:function(a,c,f,k){return e.a.getData(a.addRef(),h,c,f,k)}})},function(n,f,l){function h(a,
b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function c(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?
Object.setPrototypeOf(a,b):a.__proto__=b)}function a(a,b){var c=(new DataView(b)).getUint32(0,!0);Object(d.d)(a,b,x.b.LITTLE,4,c)}Object.defineProperty(f,"__esModule",{value:!0});l.d(f,"PythonVolumeChunkSource",function(){return J});f.decodeFragmentChunk=a;l.d(f,"PythonMeshSource",function(){return C});l.d(f,"PythonSkeletonSource",function(){return A});n=l(2);var b=l(113),d=l(18),p=l(36);f=l(15);var k=l(39),g=l(19),q=l(10),r=l(7),x=l(9),m=l(8);l=l(0);var v=function(){function a(a,b){for(var c=0;c<
b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),D=this&&this.__decorate||function(a,b,c,d){var e=arguments.length,f=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)if(g=a[h])f=(3>e?g(f):3<e?g(b,c,f):g(b,c))||
f;return 3<e&&f&&Object.defineProperty(b,c,f),f},t=new Map;t.set(b.c.NPZ,k.a);t.set(b.c.JPEG,f.a);t.set(b.c.RAW,g.a);var J=function(a){function d(){h(this,d);var a=e(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments));a.chunkDecoder=t.get(a.parameters.encoding);a.encoding=b.c[a.parameters.encoding].toLowerCase();return a}c(d,a);v(d,[{key:"download",value:function(a,b){var c=this,d=this.parameters;d="/neuroglancer/"+this.encoding+"/"+d.key+"/"+d.scaleKey;for(var e=this.computeChunkBounds(a),
f=a.chunkDataSize,g=0;3>g;++g)d+="/"+e[g]+","+(e[g]+f[g]);return Object(m.e)(Object(m.b)(d),"arraybuffer",b).then(function(b){return c.chunkDecoder(a,b)})}}]);return d}(Object(n.WithParameters)(q.a,b.d));J=D([Object(l.g)()],J);var C=function(b){function d(){h(this,d);return e(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}c(d,b);v(d,[{key:"download",value:function(a){a.fragmentIds=[""];return Promise.resolve(void 0)}},{key:"downloadFragment",value:function(b,c){return Object(m.e)(Object(m.b)("/neuroglancer/mesh/"+
this.parameters.key+"/"+b.manifestChunk.objectId),"arraybuffer",c).then(function(c){return a(b,c)})}}]);return d}(Object(n.WithParameters)(d.a,b.a));C=D([Object(l.g)()],C);var A=function(a){function b(){h(this,b);return e(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}c(b,a);v(b,[{key:"download",value:function(a,b){var c=this.parameters;return Object(m.e)(Object(m.b)("/neuroglancer/skeleton/"+c.key+"/"+a.objectId),"arraybuffer",b).then(function(b){var d=c.vertexAttributes,e=new DataView(b),
f=e.getUint32(0,!0);e=e.getUint32(4,!0);var g=8+12*f,h=[];d=$jscomp.makeIterator(d.values());for(var k=d.next();!k.done;k=d.next()){k=k.value;k=r.a[k.dataType]*k.numComponents;var l=k*f,m=new Uint8Array(b,g,l);switch(k){case 2:Object(x.c)(m,x.b.LITTLE);break;case 4:case 8:Object(x.d)(m,x.b.LITTLE)}h.push(m);g+=l}a.vertexAttributes=h;Object(p.b)(a,b,x.b.LITTLE,8,f,g,e)})}}]);return b}(Object(n.WithParameters)(p.a,b.b));A=D([Object(l.g)()],A)},function(n,f,l){function h(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return!b||"object"!==typeof b&&"function"!==typeof b?a:b}function e(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}l.d(f,"c",function(){return a});l.d(f,
"d",function(){return b});l.d(f,"a",function(){return d});l.d(f,"b",function(){return p});var a;(function(a){a[a.JPEG=0]="JPEG";a[a.NPZ=1]="NPZ";a[a.RAW=2]="RAW"})(a||(a={}));n=function g(){c(this,g)};var b=function(a){function b(){c(this,b);return h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}e(b,a);return b}(n);b.RPC_ID="python/VolumeChunkSource";var d=function(a){function b(){c(this,b);return h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}e(b,a);return b}(n);
d.RPC_ID="python/MeshSource";var p=function(a){function b(){c(this,b);return h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}e(b,a);return b}(n);p.RPC_ID="python/SkeletonSource"}]);
