var PAPAYA_BUILD_NUM="1406",papayaLoadableImages=[];
(function(c,a){function d(c){var a=c.length,b=r.type(c);return r.isWindow(c)?!1:1===c.nodeType&&a?!0:"array"===b||"function"!==b&&(0===a||"number"===typeof a&&0<a&&a-1 in c)}function f(c){var a=Y[c]={};r.each(c.match(ia)||[],function(c,b){a[b]=!0});return a}function b(c,b,e,d){if(r.acceptData(c)){var h=r.expando,n="string"===typeof b,g=c.nodeType,m=g?r.cache:c,f=g?c[h]:c[h]&&h;if(f&&m[f]&&(d||m[f].data)||!n||e!==a){f||(g?c[h]=f=ma.pop()||r.guid++:f=h);m[f]||(m[f]={},g||(m[f].toJSON=r.noop));if("object"===
typeof b||"function"===typeof b)d?m[f]=r.extend(m[f],b):m[f].data=r.extend(m[f].data,b);c=m[f];d||(c.data||(c.data={}),c=c.data);e!==a&&(c[r.camelCase(b)]=e);n?(e=c[b],null==e&&(e=c[r.camelCase(b)])):e=c;return e}}}function e(c,a,b){if(r.acceptData(c)){var e,d,h,n=c.nodeType,m=n?r.cache:c,f=n?c[r.expando]:r.expando;if(m[f]){if(a&&(h=b?m[f]:m[f].data)){r.isArray(a)?a=a.concat(r.map(a,r.camelCase)):a in h?a=[a]:(a=r.camelCase(a),a=a in h?[a]:a.split(" "));e=0;for(d=a.length;e<d;e++)delete h[a[e]];if(!(b?
g:r.isEmptyObject)(h))return}if(!b&&(delete m[f].data,!g(m[f])))return;n?r.cleanData([c],!0):r.support.deleteExpando||m!=m.window?delete m[f]:m[f]=null}}}function h(c,b,e){if(e===a&&1===c.nodeType)if(e="data-"+b.replace(gb,"-$1").toLowerCase(),e=c.getAttribute(e),"string"===typeof e){try{e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:Qb.test(e)?r.parseJSON(e):e}catch(d){}r.data(c,b,e)}else e=a;return e}function g(c){for(var a in c)if(("data"!==a||!r.isEmptyObject(c[a]))&&"toJSON"!==a)return!1;
return!0}function k(){return!0}function l(){return!1}function q(c,a){do c=c[a];while(c&&1!==c.nodeType);return c}function t(c,a,b){a=a||0;if(r.isFunction(a))return r.grep(c,function(c,e){return!!a.call(c,e,c)===b});if(a.nodeType)return r.grep(c,function(c){return c===a===b});if("string"===typeof a){var e=r.grep(c,function(c){return 1===c.nodeType});if(Ea.test(a))return r.filter(a,e,!b);a=r.filter(a,e)}return r.grep(c,function(c){return 0<=r.inArray(c,a)===b})}function y(c){var a=pa.split("|");c=c.createDocumentFragment();
if(c.createElement)for(;a.length;)c.createElement(a.pop());return c}function B(c,a){return c.getElementsByTagName(a)[0]||c.appendChild(c.ownerDocument.createElement(a))}function A(c){var a=c.getAttributeNode("type");c.type=(a&&a.specified)+"/"+c.type;return c}function x(c){var a=sa.exec(c.type);a?c.type=a[1]:c.removeAttribute("type");return c}function I(c,a){for(var b,e=0;null!=(b=c[e]);e++)r._data(b,"globalEval",!a||r._data(a[e],"globalEval"))}function F(c,a){if(1===a.nodeType&&r.hasData(c)){var b,
e,d;e=r._data(c);var h=r._data(a,e),n=e.events;if(n)for(b in delete h.handle,h.events={},n)for(e=0,d=n[b].length;e<d;e++)r.event.add(a,b,n[b][e]);h.data&&(h.data=r.extend({},h.data))}}function z(c,b){var e,d,h=0,n=typeof c.getElementsByTagName!==ea?c.getElementsByTagName(b||"*"):typeof c.querySelectorAll!==ea?c.querySelectorAll(b||"*"):a;if(!n)for(n=[],e=c.childNodes||c;null!=(d=e[h]);h++)!b||r.nodeName(d,b)?n.push(d):r.merge(n,z(d,b));return b===a||b&&r.nodeName(c,b)?r.merge([c],n):n}function L(c){vb.test(c.type)&&
(c.defaultChecked=c.checked)}function n(c,a){if(a in c)return a;for(var b=a.charAt(0).toUpperCase()+a.slice(1),e=a,d=mc.length;d--;)if(a=mc[d]+b,a in c)return a;return e}function G(c,a){c=a||c;return"none"===r.css(c,"display")||!r.contains(c.ownerDocument,c)}function K(c,a){for(var b,e,d,h=[],n=0,g=c.length;n<g;n++)e=c[n],e.style&&(h[n]=r._data(e,"olddisplay"),b=e.style.display,a?(h[n]||"none"!==b||(e.style.display=""),""===e.style.display&&G(e)&&(h[n]=r._data(e,"olddisplay",u(e.nodeName)))):h[n]||
(d=G(e),(b&&"none"!==b||!d)&&r._data(e,"olddisplay",d?b:r.css(e,"display"))));for(n=0;n<g;n++)e=c[n],!e.style||a&&"none"!==e.style.display&&""!==e.style.display||(e.style.display=a?h[n]||"":"none");return c}function E(c,a,b){return(c=Ac.exec(a))?Math.max(0,c[1]-(b||0))+(c[2]||"px"):a}function w(c,a,b,e,d){a=b===(e?"border":"content")?4:"width"===a?1:0;for(var h=0;4>a;a+=2)"margin"===b&&(h+=r.css(c,b+ya[a],!0,d)),e?("content"===b&&(h-=r.css(c,"padding"+ya[a],!0,d)),"margin"!==b&&(h-=r.css(c,"border"+
ya[a]+"Width",!0,d))):(h+=r.css(c,"padding"+ya[a],!0,d),"padding"!==b&&(h+=r.css(c,"border"+ya[a]+"Width",!0,d)));return h}function D(c,a,b){var e=!0,d="width"===a?c.offsetWidth:c.offsetHeight,h=ja(c),n=r.support.boxSizing&&"border-box"===r.css(c,"boxSizing",!1,h);if(0>=d||null==d){d=Oa(c,a,h);if(0>d||null==d)d=c.style[a];if(wb.test(d))return d;e=n&&(r.support.boxSizingReliable||d===c.style[a]);d=parseFloat(d)||0}return d+w(c,a,b||(n?"border":"content"),e,h)+"px"}function u(c){var a=S,b=xb[c];b||
(b=m(c,a),"none"!==b&&b||(wa=(wa||r("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(a.documentElement),a=(wa[0].contentWindow||wa[0].contentDocument).document,a.write("<!doctype html><html><body>"),a.close(),b=m(c,a),wa.detach()),xb[c]=b);return b}function m(c,a){var b=r(a.createElement(c)).appendTo(a.body),e=r.css(b[0],"display");b.remove();return e}function p(c,a,b,e){var d;if(r.isArray(a))r.each(a,function(a,d){b||Bc.test(c)?e(c,d):p(c+"["+
("object"===typeof d?a:"")+"]",d,b,e)});else if(b||"object"!==r.type(a))e(c,a);else for(d in a)p(c+"["+d+"]",a[d],b,e)}function J(c){return function(a,b){"string"!==typeof a&&(b=a,a="*");var e,d=0,h=a.toLowerCase().match(ia)||[];if(r.isFunction(b))for(;e=h[d++];)"+"===e[0]?(e=e.slice(1)||"*",(c[e]=c[e]||[]).unshift(b)):(c[e]=c[e]||[]).push(b)}}function H(c,a,b,e){function d(g){var m;h[g]=!0;r.each(c[g]||[],function(c,g){var f=g(a,b,e);if("string"===typeof f&&!n&&!h[f])return a.dataTypes.unshift(f),
d(f),!1;if(n)return!(m=f)});return m}var h={},n=c===Rb;return d(a.dataTypes[0])||!h["*"]&&d("*")}function v(c,b){var e,d,h=r.ajaxSettings.flatOptions||{};for(d in b)b[d]!==a&&((h[d]?c:e||(e={}))[d]=b[d]);e&&r.extend(!0,c,e);return c}function C(){try{return new c.XMLHttpRequest}catch(a){}}function P(){setTimeout(function(){ib=a});return ib=r.now()}function M(c,a){r.each(a,function(a,b){for(var e=(Za[a]||[]).concat(Za["*"]),d=0,h=e.length;d<h&&!e[d].call(c,a,b);d++);})}function R(c,a,b){var e,d=0,h=
yb.length,n=r.Deferred().always(function(){delete g.elem}),g=function(){if(e)return!1;for(var a=ib||P(),a=Math.max(0,m.startTime+m.duration-a),b=1-(a/m.duration||0),d=0,h=m.tweens.length;d<h;d++)m.tweens[d].run(b);n.notifyWith(c,[m,b,a]);if(1>b&&h)return a;n.resolveWith(c,[m]);return!1},m=n.promise({elem:c,props:r.extend({},a),opts:r.extend(!0,{specialEasing:{}},b),originalProperties:a,originalOptions:b,startTime:ib||P(),duration:b.duration,tweens:[],createTween:function(a,b){var e=r.Tween(c,m.opts,
a,b,m.opts.specialEasing[a]||m.opts.easing);m.tweens.push(e);return e},stop:function(a){var b=0,d=a?m.tweens.length:0;if(e)return this;for(e=!0;b<d;b++)m.tweens[b].run(1);a?n.resolveWith(c,[m,a]):n.rejectWith(c,[m,a]);return this}});b=m.props;for(T(b,m.opts.specialEasing);d<h;d++)if(a=yb[d].call(m,c,b,m.opts))return a;M(m,b);r.isFunction(m.opts.start)&&m.opts.start.call(c,m);r.fx.timer(r.extend(g,{elem:c,anim:m,queue:m.opts.queue}));return m.progress(m.opts.progress).done(m.opts.done,m.opts.complete).fail(m.opts.fail).always(m.opts.always)}
function T(c,a){var b,e,d,h,n;for(d in c)if(e=r.camelCase(d),h=a[e],b=c[d],r.isArray(b)&&(h=b[1],b=c[d]=b[0]),d!==e&&(c[e]=b,delete c[d]),(n=r.cssHooks[e])&&"expand"in n)for(d in b=n.expand(b),delete c[e],b)d in c||(c[d]=b[d],a[d]=h);else a[e]=h}function O(c,a,b,e,d){return new O.prototype.init(c,a,b,e,d)}function Q(c,a){var b,e={height:c},d=0;for(a=a?1:0;4>d;d+=2-a)b=ya[d],e["margin"+b]=e["padding"+b]=c;a&&(e.opacity=e.width=c);return e}function U(c){return r.isWindow(c)?c:9===c.nodeType?c.defaultView||
c.parentWindow:!1}var ua,N,ea=typeof a,S=c.document,W=c.location,qa=c.jQuery,za=c.$,Pa={},ma=[],Aa=ma.concat,ga=ma.push,na=ma.slice,Qa=ma.indexOf,Sb=Pa.toString,Z=Pa.hasOwnProperty,da="1.9.1".trim,r=function(c,a){return new r.fn.init(c,a,N)},zb=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ia=/\S+/g,$a=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,Ra=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,Fa=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Tb=/^[\],:{}\s]*$/,Ga=/(?:^|:|,)(?:\s*\[)+/g,Ab=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,Ub=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
ra=/^-ms-/,jb=/-([\da-z])/gi,xa=function(c,a){return a.toUpperCase()},ka=function(c){if(S.addEventListener||"load"===c.type||"complete"===S.readyState)pb(),r.ready()},pb=function(){S.addEventListener?(S.removeEventListener("DOMContentLoaded",ka,!1),c.removeEventListener("load",ka,!1)):(S.detachEvent("onreadystatechange",ka),c.detachEvent("onload",ka))};r.fn=r.prototype={jquery:"1.9.1",constructor:r,init:function(c,b,e){var d;if(!c)return this;if("string"===typeof c){d="<"===c.charAt(0)&&">"===c.charAt(c.length-
1)&&3<=c.length?[null,c,null]:Ra.exec(c);if(!d||!d[1]&&b)return!b||b.jquery?(b||e).find(c):this.constructor(b).find(c);if(d[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(d[1],b&&b.nodeType?b.ownerDocument||b:S,!0)),Fa.test(d[1])&&r.isPlainObject(b))for(d in b)if(r.isFunction(this[d]))this[d](b[d]);else this.attr(d,b[d])}else{if((b=S.getElementById(d[2]))&&b.parentNode){if(b.id!==d[2])return e.find(c);this.length=1;this[0]=b}this.context=S;this.selector=c}return this}if(c.nodeType)return this.context=
this[0]=c,this.length=1,this;if(r.isFunction(c))return e.ready(c);c.selector!==a&&(this.selector=c.selector,this.context=c.context);return r.makeArray(c,this)},selector:"",length:0,size:function(){return this.length},toArray:function(){return na.call(this)},get:function(c){return null==c?this.toArray():0>c?this[this.length+c]:this[c]},pushStack:function(c){c=r.merge(this.constructor(),c);c.prevObject=this;c.context=this.context;return c},each:function(c,a){return r.each(this,c,a)},ready:function(c){r.ready.promise().done(c);
return this},slice:function(){return this.pushStack(na.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(c){var a=this.length;c=+c+(0>c?a:0);return this.pushStack(0<=c&&c<a?[this[c]]:[])},map:function(c){return this.pushStack(r.map(this,function(a,b){return c.call(a,b,a)}))},end:function(){return this.prevObject||this.constructor(null)},push:ga,sort:[].sort,splice:[].splice};r.fn.init.prototype=r.fn;r.extend=r.fn.extend=function(){var c,b,
e,d,h,n=arguments[0]||{},g=1,m=arguments.length,f=!1;"boolean"===typeof n&&(f=n,n=arguments[1]||{},g=2);"object"===typeof n||r.isFunction(n)||(n={});m===g&&(n=this,--g);for(;g<m;g++)if(null!=(h=arguments[g]))for(d in h)c=n[d],e=h[d],n!==e&&(f&&e&&(r.isPlainObject(e)||(b=r.isArray(e)))?(b?(b=!1,c=c&&r.isArray(c)?c:[]):c=c&&r.isPlainObject(c)?c:{},n[d]=r.extend(f,c,e)):e!==a&&(n[d]=e));return n};r.extend({noConflict:function(a){c.$===r&&(c.$=za);a&&c.jQuery===r&&(c.jQuery=qa);return r},isReady:!1,readyWait:1,
holdReady:function(c){c?r.readyWait++:r.ready(!0)},ready:function(c){if(!0===c?!--r.readyWait:!r.isReady){if(!S.body)return setTimeout(r.ready);r.isReady=!0;!0!==c&&0<--r.readyWait||(ua.resolveWith(S,[r]),r.fn.trigger&&r(S).trigger("ready").off("ready"))}},isFunction:function(c){return"function"===r.type(c)},isArray:Array.isArray||function(c){return"array"===r.type(c)},isWindow:function(c){return null!=c&&c==c.window},isNumeric:function(c){return!isNaN(parseFloat(c))&&isFinite(c)},type:function(c){return null==
c?String(c):"object"===typeof c||"function"===typeof c?Pa[Sb.call(c)]||"object":typeof c},isPlainObject:function(c){if(!c||"object"!==r.type(c)||c.nodeType||r.isWindow(c))return!1;try{if(c.constructor&&!Z.call(c,"constructor")&&!Z.call(c.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}for(var e in c);return e===a||Z.call(c,e)},isEmptyObject:function(c){for(var a in c)return!1;return!0},error:function(c){throw Error(c);},parseHTML:function(c,a,b){if(!c||"string"!==typeof c)return null;
"boolean"===typeof a&&(b=a,a=!1);a=a||S;var e=Fa.exec(c);b=!b&&[];if(e)return[a.createElement(e[1])];e=r.buildFragment([c],a,b);b&&r(b).remove();return r.merge([],e.childNodes)},parseJSON:function(a){if(c.JSON&&c.JSON.parse)return c.JSON.parse(a);if(null===a)return a;if("string"===typeof a&&(a=r.trim(a))&&Tb.test(a.replace(Ab,"@").replace(Ub,"]").replace(Ga,"")))return(new Function("return "+a))();r.error("Invalid JSON: "+a)},parseXML:function(b){var e,d;if(!b||"string"!==typeof b)return null;try{c.DOMParser?
(d=new DOMParser,e=d.parseFromString(b,"text/xml")):(e=new ActiveXObject("Microsoft.XMLDOM"),e.async="false",e.loadXML(b))}catch(h){e=a}e&&e.documentElement&&!e.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b);return e},noop:function(){},globalEval:function(a){a&&r.trim(a)&&(c.execScript||function(a){c.eval.call(c,a)})(a)},camelCase:function(c){return c.replace(ra,"ms-").replace(jb,xa)},nodeName:function(c,a){return c.nodeName&&c.nodeName.toLowerCase()===a.toLowerCase()},each:function(c,
a,b){var e,h=0,n=c.length;e=d(c);if(b)if(e)for(;h<n&&(e=a.apply(c[h],b),!1!==e);h++);else for(h in c){if(e=a.apply(c[h],b),!1===e)break}else if(e)for(;h<n&&(e=a.call(c[h],h,c[h]),!1!==e);h++);else for(h in c)if(e=a.call(c[h],h,c[h]),!1===e)break;return c},trim:da&&!da.call("\ufeff\u00a0")?function(c){return null==c?"":da.call(c)}:function(c){return null==c?"":(c+"").replace($a,"")},makeArray:function(c,a){var b=a||[];null!=c&&(d(Object(c))?r.merge(b,"string"===typeof c?[c]:c):ga.call(b,c));return b},
inArray:function(c,a,b){var e;if(a){if(Qa)return Qa.call(a,c,b);e=a.length;for(b=b?0>b?Math.max(0,e+b):b:0;b<e;b++)if(b in a&&a[b]===c)return b}return-1},merge:function(c,b){var e=b.length,d=c.length,h=0;if("number"===typeof e)for(;h<e;h++)c[d++]=b[h];else for(;b[h]!==a;)c[d++]=b[h++];c.length=d;return c},grep:function(c,a,b){var e,d=[],h=0,n=c.length;for(b=!!b;h<n;h++)e=!!a(c[h],h),b!==e&&d.push(c[h]);return d},map:function(c,a,b){var e,h=0,n=c.length,g=[];if(d(c))for(;h<n;h++)e=a(c[h],h,b),null!=
e&&(g[g.length]=e);else for(h in c)e=a(c[h],h,b),null!=e&&(g[g.length]=e);return Aa.apply([],g)},guid:1,proxy:function(c,b){var e,d;"string"===typeof b&&(d=c[b],b=c,c=d);if(!r.isFunction(c))return a;e=na.call(arguments,2);d=function(){return c.apply(b||this,e.concat(na.call(arguments)))};d.guid=c.guid=c.guid||r.guid++;return d},access:function(c,b,e,d,h,n,g){var m=0,f=c.length,k=null==e;if("object"===r.type(e))for(m in h=!0,e)r.access(c,b,m,e[m],!0,n,g);else if(d!==a&&(h=!0,r.isFunction(d)||(g=!0),
k&&(g?(b.call(c,d),b=null):(k=b,b=function(c,a,b){return k.call(r(c),b)})),b))for(;m<f;m++)b(c[m],e,g?d:d.call(c[m],m,b(c[m],e)));return h?c:k?b.call(c):f?b(c[0],e):n},now:function(){return(new Date).getTime()}});r.ready.promise=function(a){if(!ua)if(ua=r.Deferred(),"complete"===S.readyState)setTimeout(r.ready);else if(S.addEventListener)S.addEventListener("DOMContentLoaded",ka,!1),c.addEventListener("load",ka,!1);else{S.attachEvent("onreadystatechange",ka);c.attachEvent("onload",ka);var b=!1;try{b=
null==c.frameElement&&S.documentElement}catch(e){}b&&b.doScroll&&function Da(){if(!r.isReady){try{b.doScroll("left")}catch(c){return setTimeout(Da,50)}pb();r.ready()}}()}return ua.promise(a)};r.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(c,a){Pa["[object "+a+"]"]=a.toLowerCase()});N=r(S);var Y={};r.Callbacks=function(c){c="string"===typeof c?Y[c]||f(c):r.extend({},c);var b,e,d,h,n,g,m=[],k=!c.once&&[],u=function(a){e=c.memory&&a;d=!0;n=g||0;g=0;h=m.length;
for(b=!0;m&&n<h;n++)if(!1===m[n].apply(a[0],a[1])&&c.stopOnFalse){e=!1;break}b=!1;m&&(k?k.length&&u(k.shift()):e?m=[]:l.disable())},l={add:function(){if(m){var a=m.length;(function Sa(a){r.each(a,function(a,b){var e=r.type(b);"function"===e?c.unique&&l.has(b)||m.push(b):b&&b.length&&"string"!==e&&Sa(b)})})(arguments);b?h=m.length:e&&(g=a,u(e))}return this},remove:function(){m&&r.each(arguments,function(c,a){for(var e;-1<(e=r.inArray(a,m,e));)m.splice(e,1),b&&(e<=h&&h--,e<=n&&n--)});return this},has:function(c){return c?
-1<r.inArray(c,m):!(!m||!m.length)},empty:function(){m=[];return this},disable:function(){m=k=e=a;return this},disabled:function(){return!m},lock:function(){k=a;e||l.disable();return this},locked:function(){return!k},fireWith:function(c,a){a=a||[];a=[c,a.slice?a.slice():a];!m||d&&!k||(b?k.push(a):u(a));return this},fire:function(){l.fireWith(this,arguments);return this},fired:function(){return!!d}};return l};r.extend({Deferred:function(c){var a=[["resolve","done",r.Callbacks("once memory"),"resolved"],
["reject","fail",r.Callbacks("once memory"),"rejected"],["notify","progress",r.Callbacks("memory")]],b="pending",e={state:function(){return b},always:function(){d.done(arguments).fail(arguments);return this},then:function(){var c=arguments;return r.Deferred(function(b){r.each(a,function(a,h){var n=h[0],g=r.isFunction(c[a])&&c[a];d[h[1]](function(){var c=g&&g.apply(this,arguments);if(c&&r.isFunction(c.promise))c.promise().done(b.resolve).fail(b.reject).progress(b.notify);else b[n+"With"](this===e?
b.promise():this,g?[c]:arguments)})});c=null}).promise()},promise:function(c){return null!=c?r.extend(c,e):e}},d={};e.pipe=e.then;r.each(a,function(c,h){var n=h[2],g=h[3];e[h[1]]=n.add;g&&n.add(function(){b=g},a[c^1][2].disable,a[2][2].lock);d[h[0]]=function(){d[h[0]+"With"](this===d?e:this,arguments);return this};d[h[0]+"With"]=n.fireWith});e.promise(d);c&&c.call(d,d);return d},when:function(c){var a=0,b=na.call(arguments),e=b.length,d=1!==e||c&&r.isFunction(c.promise)?e:0,h=1===d?c:r.Deferred(),
n=function(c,a,b){return function(e){a[c]=this;b[c]=1<arguments.length?na.call(arguments):e;b===g?h.notifyWith(a,b):--d||h.resolveWith(a,b)}},g,m,f;if(1<e)for(g=Array(e),m=Array(e),f=Array(e);a<e;a++)b[a]&&r.isFunction(b[a].promise)?b[a].promise().done(n(a,f,b)).fail(h.reject).progress(n(a,m,g)):--d;d||h.resolveWith(f,b);return h.promise()}});r.support=function(){var a,b,e,d,h,n,g,m=S.createElement("div");m.setAttribute("className","t");m.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
b=m.getElementsByTagName("*");e=m.getElementsByTagName("a")[0];if(!b||!e||!b.length)return{};d=S.createElement("select");h=d.appendChild(S.createElement("option"));b=m.getElementsByTagName("input")[0];e.style.cssText="top:1px;float:left;opacity:.5";a={getSetAttribute:"t"!==m.className,leadingWhitespace:3===m.firstChild.nodeType,tbody:!m.getElementsByTagName("tbody").length,htmlSerialize:!!m.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:"/a"===e.getAttribute("href"),
opacity:/^0.5/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:!!b.value,optSelected:h.selected,enctype:!!S.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==S.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===S.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1};b.checked=!0;a.noCloneChecked=b.cloneNode(!0).checked;d.disabled=!0;a.optDisabled=!h.disabled;try{delete m.test}catch(f){a.deleteExpando=
!1}b=S.createElement("input");b.setAttribute("value","");a.input=""===b.getAttribute("value");b.value="t";b.setAttribute("type","radio");a.radioValue="t"===b.value;b.setAttribute("checked","t");b.setAttribute("name","t");e=S.createDocumentFragment();e.appendChild(b);a.appendChecked=b.checked;a.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked;m.attachEvent&&(m.attachEvent("onclick",function(){a.noCloneEvent=!1}),m.cloneNode(!0).click());for(g in{submit:!0,change:!0,focusin:!0})m.setAttribute(e=
"on"+g,"t"),a[g+"Bubbles"]=e in c||!1===m.attributes[e].expando;m.style.backgroundClip="content-box";m.cloneNode(!0).style.backgroundClip="";a.clearCloneStyle="content-box"===m.style.backgroundClip;r(function(){var b,e,d=S.getElementsByTagName("body")[0];d&&(b=S.createElement("div"),b.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",d.appendChild(b).appendChild(m),m.innerHTML="<table><tr><td></td><td>t</td></tr></table>",e=m.getElementsByTagName("td"),
e[0].style.cssText="padding:0;margin:0;border:0;display:none",n=0===e[0].offsetHeight,e[0].style.display="",e[1].style.display="none",a.reliableHiddenOffsets=n&&0===e[0].offsetHeight,m.innerHTML="",m.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",a.boxSizing=4===m.offsetWidth,a.doesNotIncludeMarginInBodyOffset=1!==d.offsetTop,c.getComputedStyle&&(a.pixelPosition="1%"!==
(c.getComputedStyle(m,null)||{}).top,a.boxSizingReliable="4px"===(c.getComputedStyle(m,null)||{width:"4px"}).width,e=m.appendChild(S.createElement("div")),e.style.cssText=m.style.cssText="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",e.style.marginRight=e.style.width="0",m.style.width="1px",a.reliableMarginRight=!parseFloat((c.getComputedStyle(e,null)||{}).marginRight)),typeof m.style.zoom!==ea&&(m.innerHTML="",m.style.cssText=
"padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;width:1px;padding:1px;display:inline;zoom:1",a.inlineBlockNeedsLayout=3===m.offsetWidth,m.style.display="block",m.innerHTML="<div></div>",m.firstChild.style.width="5px",a.shrinkWrapBlocks=3!==m.offsetWidth,a.inlineBlockNeedsLayout&&(d.style.zoom=1)),d.removeChild(b),m=null)});b=d=e=h=e=b=null;return a}();var Qb=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,gb=/([A-Z])/g;r.extend({cache:{},
expando:"jQuery"+("1.9.1"+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(c){c=c.nodeType?r.cache[c[r.expando]]:c[r.expando];return!!c&&!g(c)},data:function(c,a,e){return b(c,a,e)},removeData:function(c,a){return e(c,a)},_data:function(c,a,e){return b(c,a,e,!0)},_removeData:function(c,a){return e(c,a,!0)},acceptData:function(c){if(c.nodeType&&1!==c.nodeType&&9!==c.nodeType)return!1;var a=c.nodeName&&r.noData[c.nodeName.toLowerCase()];
return!a||!0!==a&&c.getAttribute("classid")===a}});r.fn.extend({data:function(c,b){var e,d,n=this[0],m=0,g=null;if(c===a){if(this.length&&(g=r.data(n),1===n.nodeType&&!r._data(n,"parsedAttrs"))){for(e=n.attributes;m<e.length;m++)d=e[m].name,d.indexOf("data-")||(d=r.camelCase(d.slice(5)),h(n,d,g[d]));r._data(n,"parsedAttrs",!0)}return g}return"object"===typeof c?this.each(function(){r.data(this,c)}):r.access(this,function(b){if(b===a)return n?h(n,c,r.data(n,c)):null;this.each(function(){r.data(this,
c,b)})},null,b,1<arguments.length,null,!0)},removeData:function(c){return this.each(function(){r.removeData(this,c)})}});r.extend({queue:function(c,a,b){var e;if(c)return a=(a||"fx")+"queue",e=r._data(c,a),b&&(!e||r.isArray(b)?e=r._data(c,a,r.makeArray(b)):e.push(b)),e||[]},dequeue:function(c,a){a=a||"fx";var b=r.queue(c,a),e=b.length,d=b.shift(),h=r._queueHooks(c,a),n=function(){r.dequeue(c,a)};"inprogress"===d&&(d=b.shift(),e--);if(h.cur=d)"fx"===a&&b.unshift("inprogress"),delete h.stop,d.call(c,
n,h);!e&&h&&h.empty.fire()},_queueHooks:function(c,a){var b=a+"queueHooks";return r._data(c,b)||r._data(c,b,{empty:r.Callbacks("once memory").add(function(){r._removeData(c,a+"queue");r._removeData(c,b)})})}});r.fn.extend({queue:function(c,b){var e=2;"string"!==typeof c&&(b=c,c="fx",e--);return arguments.length<e?r.queue(this[0],c):b===a?this:this.each(function(){var a=r.queue(this,c,b);r._queueHooks(this,c);"fx"===c&&"inprogress"!==a[0]&&r.dequeue(this,c)})},dequeue:function(c){return this.each(function(){r.dequeue(this,
c)})},delay:function(c,a){c=r.fx?r.fx.speeds[c]||c:c;return this.queue(a||"fx",function(a,b){var e=setTimeout(a,c);b.stop=function(){clearTimeout(e)}})},clearQueue:function(c){return this.queue(c||"fx",[])},promise:function(c,b){var e,d=1,h=r.Deferred(),n=this,m=this.length,g=function(){--d||h.resolveWith(n,[n])};"string"!==typeof c&&(b=c,c=a);for(c=c||"fx";m--;)(e=r._data(n[m],c+"queueHooks"))&&e.empty&&(d++,e.empty.add(g));g();return h.promise(b)}});var ab,Vb,Ha=/[\t\r\n]/g,Ia=/\r/g,Cc=/^(?:input|select|textarea|button|object)$/i,
oc=/^(?:a|area)$/i,Ta=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,Cb=/^(?:checked|selected)$/i,ha=r.support.getSetAttribute,Ja=r.support.input;r.fn.extend({attr:function(c,a){return r.access(this,r.attr,c,a,1<arguments.length)},removeAttr:function(c){return this.each(function(){r.removeAttr(this,c)})},prop:function(c,a){return r.access(this,r.prop,c,a,1<arguments.length)},removeProp:function(c){c=r.propFix[c]||c;return this.each(function(){try{this[c]=
a,delete this[c]}catch(b){}})},addClass:function(c){var a,b,e,d,h,n=0,m=this.length;a="string"===typeof c&&c;if(r.isFunction(c))return this.each(function(a){r(this).addClass(c.call(this,a,this.className))});if(a)for(a=(c||"").match(ia)||[];n<m;n++)if(b=this[n],e=1===b.nodeType&&(b.className?(" "+b.className+" ").replace(Ha," "):" ")){for(h=0;d=a[h++];)0>e.indexOf(" "+d+" ")&&(e+=d+" ");b.className=r.trim(e)}return this},removeClass:function(c){var a,b,e,d,h,n=0,m=this.length;a=0===arguments.length||
"string"===typeof c&&c;if(r.isFunction(c))return this.each(function(a){r(this).removeClass(c.call(this,a,this.className))});if(a)for(a=(c||"").match(ia)||[];n<m;n++)if(b=this[n],e=1===b.nodeType&&(b.className?(" "+b.className+" ").replace(Ha," "):"")){for(h=0;d=a[h++];)for(;0<=e.indexOf(" "+d+" ");)e=e.replace(" "+d+" "," ");b.className=c?r.trim(e):""}return this},toggleClass:function(c,a){var b=typeof c,e="boolean"===typeof a;return r.isFunction(c)?this.each(function(b){r(this).toggleClass(c.call(this,
b,this.className,a),a)}):this.each(function(){if("string"===b)for(var d,h=0,n=r(this),m=a,g=c.match(ia)||[];d=g[h++];)m=e?m:!n.hasClass(d),n[m?"addClass":"removeClass"](d);else if(b===ea||"boolean"===b)this.className&&r._data(this,"__className__",this.className),this.className=this.className||!1===c?"":r._data(this,"__className__")||""})},hasClass:function(c){c=" "+c+" ";for(var a=0,b=this.length;a<b;a++)if(1===this[a].nodeType&&0<=(" "+this[a].className+" ").replace(Ha," ").indexOf(c))return!0;return!1},
val:function(c){var b,e,d,h=this[0];if(arguments.length)return d=r.isFunction(c),this.each(function(b){var h=r(this);1===this.nodeType&&(b=d?c.call(this,b,h.val()):c,null==b?b="":"number"===typeof b?b+="":r.isArray(b)&&(b=r.map(b,function(c){return null==c?"":c+""})),e=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&e.set(this,b,"value")!==a||(this.value=b))});if(h){if((e=r.valHooks[h.type]||r.valHooks[h.nodeName.toLowerCase()])&&"get"in e&&(b=e.get(h,"value"))!==a)return b;
b=h.value;return"string"===typeof b?b.replace(Ia,""):null==b?"":b}}});r.extend({valHooks:{option:{get:function(c){var a=c.attributes.value;return!a||a.specified?c.value:c.text}},select:{get:function(c){for(var a,b=c.options,e=c.selectedIndex,d=(c="select-one"===c.type||0>e)?null:[],h=c?e+1:b.length,n=0>e?h:c?e:0;n<h;n++)if(a=b[n],!(!a.selected&&n!==e||(r.support.optDisabled?a.disabled:null!==a.getAttribute("disabled"))||a.parentNode.disabled&&r.nodeName(a.parentNode,"optgroup"))){a=r(a).val();if(c)return a;
d.push(a)}return d},set:function(c,a){var b=r.makeArray(a);r(c).find("option").each(function(){this.selected=0<=r.inArray(r(this).val(),b)});b.length||(c.selectedIndex=-1);return b}}},attr:function(c,b,e){var d,h,n;h=c.nodeType;if(c&&3!==h&&8!==h&&2!==h){if(typeof c.getAttribute===ea)return r.prop(c,b,e);if(h=1!==h||!r.isXMLDoc(c))b=b.toLowerCase(),d=r.attrHooks[b]||(Ta.test(b)?Vb:ab);if(e!==a)if(null===e)r.removeAttr(c,b);else{if(d&&h&&"set"in d&&(n=d.set(c,e,b))!==a)return n;c.setAttribute(b,e+
"");return e}else{if(d&&h&&"get"in d&&null!==(n=d.get(c,b)))return n;typeof c.getAttribute!==ea&&(n=c.getAttribute(b));return null==n?a:n}}},removeAttr:function(c,a){var b,e,d=0,h=a&&a.match(ia);if(h&&1===c.nodeType)for(;b=h[d++];)e=r.propFix[b]||b,Ta.test(b)?!ha&&Cb.test(b)?c[r.camelCase("default-"+b)]=c[e]=!1:c[e]=!1:r.attr(c,b,""),c.removeAttribute(ha?b:e)},attrHooks:{type:{set:function(c,a){if(!r.support.radioValue&&"radio"===a&&r.nodeName(c,"input")){var b=c.value;c.setAttribute("type",a);b&&
(c.value=b);return a}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(c,b,e){var d,h,n;n=c.nodeType;if(c&&3!==n&&8!==n&&2!==n){if(n=1!==n||!r.isXMLDoc(c))b=r.propFix[b]||b,h=r.propHooks[b];return e!==a?h&&"set"in h&&(d=h.set(c,e,b))!==a?d:c[b]=e:h&&"get"in h&&
null!==(d=h.get(c,b))?d:c[b]}},propHooks:{tabIndex:{get:function(c){var b=c.getAttributeNode("tabindex");return b&&b.specified?parseInt(b.value,10):Cc.test(c.nodeName)||oc.test(c.nodeName)&&c.href?0:a}}}});Vb={get:function(c,b){var e=r.prop(c,b),d="boolean"===typeof e&&c.getAttribute(b);return(e="boolean"===typeof e?Ja&&ha?null!=d:Cb.test(b)?c[r.camelCase("default-"+b)]:!!d:c.getAttributeNode(b))&&!1!==e.value?b.toLowerCase():a},set:function(c,a,b){!1===a?r.removeAttr(c,b):Ja&&ha||!Cb.test(b)?c.setAttribute(!ha&&
r.propFix[b]||b,b):c[r.camelCase("default-"+b)]=c[b]=!0;return b}};Ja&&ha||(r.attrHooks.value={get:function(c,b){var e=c.getAttributeNode(b);return r.nodeName(c,"input")?c.defaultValue:e&&e.specified?e.value:a},set:function(c,a,b){if(r.nodeName(c,"input"))c.defaultValue=a;else return ab&&ab.set(c,a,b)}});ha||(ab=r.valHooks.button={get:function(c,b){var e=c.getAttributeNode(b);return e&&("id"===b||"name"===b||"coords"===b?""!==e.value:e.specified)?e.value:a},set:function(c,b,e){var d=c.getAttributeNode(e);
d||c.setAttributeNode(d=c.ownerDocument.createAttribute(e));d.value=b+="";return"value"===e||b===c.getAttribute(e)?b:a}},r.attrHooks.contenteditable={get:ab.get,set:function(c,a,b){ab.set(c,""===a?!1:a,b)}},r.each(["width","height"],function(c,a){r.attrHooks[a]=r.extend(r.attrHooks[a],{set:function(c,b){if(""===b)return c.setAttribute(a,"auto"),b}})}));r.support.hrefNormalized||(r.each(["href","src","width","height"],function(c,b){r.attrHooks[b]=r.extend(r.attrHooks[b],{get:function(c){c=c.getAttribute(b,
2);return null==c?a:c}})}),r.each(["href","src"],function(c,a){r.propHooks[a]={get:function(c){return c.getAttribute(a,4)}}}));r.support.style||(r.attrHooks.style={get:function(c){return c.style.cssText||a},set:function(c,a){return c.style.cssText=a+""}});r.support.optSelected||(r.propHooks.selected=r.extend(r.propHooks.selected,{get:function(c){if(c=c.parentNode)c.selectedIndex,c.parentNode&&c.parentNode.selectedIndex;return null}}));r.support.enctype||(r.propFix.enctype="encoding");r.support.checkOn||
r.each(["radio","checkbox"],function(){r.valHooks[this]={get:function(c){return null===c.getAttribute("value")?"on":c.value}}});r.each(["radio","checkbox"],function(){r.valHooks[this]=r.extend(r.valHooks[this],{set:function(c,a){if(r.isArray(a))return c.checked=0<=r.inArray(r(c).val(),a)}})});var Wb=/^(?:input|select|textarea)$/i,Xb=/^key/,X=/^(?:mouse|contextmenu)|click/,Db=/^(?:focusinfocus|focusoutblur)$/,Yb=/^([^.]*)(?:\.(.+)|)$/;r.event={global:{},add:function(c,b,e,d,h){var n,m,g,f,k,u,l,C,
O;if(g=r._data(c)){e.handler&&(f=e,e=f.handler,h=f.selector);e.guid||(e.guid=r.guid++);(m=g.events)||(m=g.events={});(k=g.handle)||(k=g.handle=function(c){return typeof r===ea||c&&r.event.triggered===c.type?a:r.event.dispatch.apply(k.elem,arguments)},k.elem=c);b=(b||"").match(ia)||[""];for(g=b.length;g--;)n=Yb.exec(b[g])||[],C=u=n[1],O=(n[2]||"").split(".").sort(),n=r.event.special[C]||{},C=(h?n.delegateType:n.bindType)||C,n=r.event.special[C]||{},u=r.extend({type:C,origType:u,data:d,handler:e,guid:e.guid,
selector:h,needsContext:h&&r.expr.match.needsContext.test(h),namespace:O.join(".")},f),(l=m[C])||(l=m[C]=[],l.delegateCount=0,n.setup&&!1!==n.setup.call(c,d,O,k)||(c.addEventListener?c.addEventListener(C,k,!1):c.attachEvent&&c.attachEvent("on"+C,k))),n.add&&(n.add.call(c,u),u.handler.guid||(u.handler.guid=e.guid)),h?l.splice(l.delegateCount++,0,u):l.push(u),r.event.global[C]=!0;c=null}},remove:function(c,a,b,e,d){var h,n,m,g,f,k,u,l,C,O,p,z=r.hasData(c)&&r._data(c);if(z&&(k=z.events)){a=(a||"").match(ia)||
[""];for(f=a.length;f--;)if(m=Yb.exec(a[f])||[],C=p=m[1],O=(m[2]||"").split(".").sort(),C){u=r.event.special[C]||{};C=(e?u.delegateType:u.bindType)||C;l=k[C]||[];m=m[2]&&new RegExp("(^|\\.)"+O.join("\\.(?:.*\\.|)")+"(\\.|$)");for(g=h=l.length;h--;)n=l[h],!d&&p!==n.origType||b&&b.guid!==n.guid||m&&!m.test(n.namespace)||e&&e!==n.selector&&("**"!==e||!n.selector)||(l.splice(h,1),n.selector&&l.delegateCount--,u.remove&&u.remove.call(c,n));g&&!l.length&&(u.teardown&&!1!==u.teardown.call(c,O,z.handle)||
r.removeEvent(c,C,z.handle),delete k[C])}else for(C in k)r.event.remove(c,C+a[f],b,e,!0);r.isEmptyObject(k)&&(delete z.handle,r._removeData(c,"events"))}},trigger:function(b,e,d,h){var n,m,g,f,k,u,l=[d||S],C=Z.call(b,"type")?b.type:b;k=Z.call(b,"namespace")?b.namespace.split("."):[];g=n=d=d||S;if(3!==d.nodeType&&8!==d.nodeType&&!Db.test(C+r.event.triggered)&&(0<=C.indexOf(".")&&(k=C.split("."),C=k.shift(),k.sort()),m=0>C.indexOf(":")&&"on"+C,b=b[r.expando]?b:new r.Event(C,"object"===typeof b&&b),
b.isTrigger=!0,b.namespace=k.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+k.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=a,b.target||(b.target=d),e=null==e?[b]:r.makeArray(e,[b]),k=r.event.special[C]||{},h||!k.trigger||!1!==k.trigger.apply(d,e))){if(!h&&!k.noBubble&&!r.isWindow(d)){f=k.delegateType||C;Db.test(f+C)||(g=g.parentNode);for(;g;g=g.parentNode)l.push(g),n=g;n===(d.ownerDocument||S)&&l.push(n.defaultView||n.parentWindow||c)}for(u=0;(g=l[u++])&&!b.isPropagationStopped();)b.type=
1<u?f:k.bindType||C,(n=(r._data(g,"events")||{})[b.type]&&r._data(g,"handle"))&&n.apply(g,e),(n=m&&g[m])&&r.acceptData(g)&&n.apply&&!1===n.apply(g,e)&&b.preventDefault();b.type=C;if(!(h||b.isDefaultPrevented()||k._default&&!1!==k._default.apply(d.ownerDocument,e)||"click"===C&&r.nodeName(d,"a"))&&r.acceptData(d)&&m&&d[C]&&!r.isWindow(d)){(n=d[m])&&(d[m]=null);r.event.triggered=C;try{d[C]()}catch(O){}r.event.triggered=a;n&&(d[m]=n)}return b.result}},dispatch:function(c){c=r.event.fix(c);var b,e,d,
h,n=[],m=na.call(arguments);b=(r._data(this,"events")||{})[c.type]||[];var g=r.event.special[c.type]||{};m[0]=c;c.delegateTarget=this;if(!g.preDispatch||!1!==g.preDispatch.call(this,c)){n=r.event.handlers.call(this,c,b);for(b=0;(d=n[b++])&&!c.isPropagationStopped();)for(c.currentTarget=d.elem,h=0;(e=d.handlers[h++])&&!c.isImmediatePropagationStopped();)if(!c.namespace_re||c.namespace_re.test(e.namespace))c.handleObj=e,c.data=e.data,e=((r.event.special[e.origType]||{}).handle||e.handler).apply(d.elem,
m),e!==a&&!1===(c.result=e)&&(c.preventDefault(),c.stopPropagation());g.postDispatch&&g.postDispatch.call(this,c);return c.result}},handlers:function(c,b){var e,d,h,n,m=[],g=b.delegateCount,f=c.target;if(g&&f.nodeType&&(!c.button||"click"!==c.type))for(;f!=this;f=f.parentNode||this)if(1===f.nodeType&&(!0!==f.disabled||"click"!==c.type)){h=[];for(n=0;n<g;n++)d=b[n],e=d.selector+" ",h[e]===a&&(h[e]=d.needsContext?0<=r(e,this).index(f):r.find(e,this,null,[f]).length),h[e]&&h.push(d);h.length&&m.push({elem:f,
handlers:h})}g<b.length&&m.push({elem:this,handlers:b.slice(g)});return m},fix:function(c){if(c[r.expando])return c;var a,b,e;a=c.type;var d=c,h=this.fixHooks[a];h||(this.fixHooks[a]=h=X.test(a)?this.mouseHooks:Xb.test(a)?this.keyHooks:{});e=h.props?this.props.concat(h.props):this.props;c=new r.Event(d);for(a=e.length;a--;)b=e[a],c[b]=d[b];c.target||(c.target=d.srcElement||S);3===c.target.nodeType&&(c.target=c.target.parentNode);c.metaKey=!!c.metaKey;return h.filter?h.filter(c,d):c},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks:{},keyHooks:{props:["char","charCode","key","keyCode"],filter:function(c,a){null==c.which&&(c.which=null!=a.charCode?a.charCode:a.keyCode);return c}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(c,b){var e,d,h=b.button,n=b.fromElement;null==c.pageX&&null!=b.clientX&&(e=c.target.ownerDocument||S,d=e.documentElement,e=e.body,c.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||
e&&e.clientLeft||0),c.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0));!c.relatedTarget&&n&&(c.relatedTarget=n===c.target?b.toElement:n);c.which||h===a||(c.which=h&1?1:h&2?3:h&4?2:0);return c}},special:{load:{noBubble:!0},click:{trigger:function(){if(r.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return this.click(),!1}},focus:{trigger:function(){if(this!==S.activeElement&&this.focus)try{return this.focus(),!1}catch(c){}},delegateType:"focusin"},
blur:{trigger:function(){if(this===S.activeElement&&this.blur)return this.blur(),!1},delegateType:"focusout"},beforeunload:{postDispatch:function(c){c.result!==a&&(c.originalEvent.returnValue=c.result)}}},simulate:function(c,a,b,e){c=r.extend(new r.Event,b,{type:c,isSimulated:!0,originalEvent:{}});e?r.event.trigger(c,null,a):r.event.dispatch.call(a,c);c.isDefaultPrevented()&&b.preventDefault()}};r.removeEvent=S.removeEventListener?function(c,a,b){c.removeEventListener&&c.removeEventListener(a,b,!1)}:
function(c,a,b){a="on"+a;c.detachEvent&&(typeof c[a]===ea&&(c[a]=null),c.detachEvent(a,b))};r.Event=function(c,a){if(!(this instanceof r.Event))return new r.Event(c,a);c&&c.type?(this.originalEvent=c,this.type=c.type,this.isDefaultPrevented=c.defaultPrevented||!1===c.returnValue||c.getPreventDefault&&c.getPreventDefault()?k:l):this.type=c;a&&r.extend(this,a);this.timeStamp=c&&c.timeStamp||r.now();this[r.expando]=!0};r.Event.prototype={isDefaultPrevented:l,isPropagationStopped:l,isImmediatePropagationStopped:l,
preventDefault:function(){var c=this.originalEvent;this.isDefaultPrevented=k;c&&(c.preventDefault?c.preventDefault():c.returnValue=!1)},stopPropagation:function(){var c=this.originalEvent;this.isPropagationStopped=k;c&&(c.stopPropagation&&c.stopPropagation(),c.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=k;this.stopPropagation()}};r.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(c,a){r.event.special[c]={delegateType:a,bindType:a,handle:function(c){var b,
e=c.relatedTarget,d=c.handleObj;if(!e||e!==this&&!r.contains(this,e))c.type=d.origType,b=d.handler.apply(this,arguments),c.type=a;return b}}});r.support.submitBubbles||(r.event.special.submit={setup:function(){if(r.nodeName(this,"form"))return!1;r.event.add(this,"click._submit keypress._submit",function(c){c=c.target;(c=r.nodeName(c,"input")||r.nodeName(c,"button")?c.form:a)&&!r._data(c,"submitBubbles")&&(r.event.add(c,"submit._submit",function(c){c._submit_bubble=!0}),r._data(c,"submitBubbles",!0))})},
postDispatch:function(c){c._submit_bubble&&(delete c._submit_bubble,this.parentNode&&!c.isTrigger&&r.event.simulate("submit",this.parentNode,c,!0))},teardown:function(){if(r.nodeName(this,"form"))return!1;r.event.remove(this,"._submit")}});r.support.changeBubbles||(r.event.special.change={setup:function(){if(Wb.test(this.nodeName)){if("checkbox"===this.type||"radio"===this.type)r.event.add(this,"propertychange._change",function(c){"checked"===c.originalEvent.propertyName&&(this._just_changed=!0)}),
r.event.add(this,"click._change",function(c){this._just_changed&&!c.isTrigger&&(this._just_changed=!1);r.event.simulate("change",this,c,!0)});return!1}r.event.add(this,"beforeactivate._change",function(c){c=c.target;Wb.test(c.nodeName)&&!r._data(c,"changeBubbles")&&(r.event.add(c,"change._change",function(c){!this.parentNode||c.isSimulated||c.isTrigger||r.event.simulate("change",this.parentNode,c,!0)}),r._data(c,"changeBubbles",!0))})},handle:function(c){var a=c.target;if(this!==a||c.isSimulated||
c.isTrigger||"radio"!==a.type&&"checkbox"!==a.type)return c.handleObj.handler.apply(this,arguments)},teardown:function(){r.event.remove(this,"._change");return!Wb.test(this.nodeName)}});r.support.focusinBubbles||r.each({focus:"focusin",blur:"focusout"},function(c,a){var b=0,e=function(c){r.event.simulate(a,c.target,r.event.fix(c),!0)};r.event.special[a]={setup:function(){0===b++&&S.addEventListener(c,e,!0)},teardown:function(){0===--b&&S.removeEventListener(c,e,!0)}}});r.fn.extend({on:function(c,
b,e,d,h){var n,m;if("object"===typeof c){"string"!==typeof b&&(e=e||b,b=a);for(n in c)this.on(n,b,e,c[n],h);return this}null==e&&null==d?(d=b,e=b=a):null==d&&("string"===typeof b?(d=e,e=a):(d=e,e=b,b=a));if(!1===d)d=l;else if(!d)return this;1===h&&(m=d,d=function(c){r().off(c);return m.apply(this,arguments)},d.guid=m.guid||(m.guid=r.guid++));return this.each(function(){r.event.add(this,c,d,e,b)})},one:function(c,a,b,e){return this.on(c,a,b,e,1)},off:function(c,b,e){var d;if(c&&c.preventDefault&&c.handleObj)return d=
c.handleObj,r(c.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"===typeof c){for(d in c)this.off(d,b,c[d]);return this}if(!1===b||"function"===typeof b)e=b,b=a;!1===e&&(e=l);return this.each(function(){r.event.remove(this,c,e,b)})},bind:function(c,a,b){return this.on(c,null,a,b)},unbind:function(c,a){return this.off(c,null,a)},delegate:function(c,a,b,e){return this.on(a,c,b,e)},undelegate:function(c,a,b){return 1===arguments.length?this.off(c,
"**"):this.off(a,c||"**",b)},trigger:function(c,a){return this.each(function(){r.event.trigger(c,a,this)})},triggerHandler:function(c,a){var b=this[0];if(b)return r.event.trigger(c,a,b,!0)}});(function(c,a){function b(c){return ha.test(c+"")}function e(){var c,a=[];return c=function(b,e){a.push(b+=" ")>A.cacheLength&&delete c[a.shift()];return c[b]=e}}function d(c){c[R]=!0;return c}function h(c){var a=D.createElement("div");try{return c(a)}catch(b){return!1}finally{}}function n(c,a,b,e){var d,h,m,
g,f;(a?a.ownerDocument||a:N)!==D&&I(a);a=a||D;b=b||[];if(!c||"string"!==typeof c)return b;if(1!==(g=a.nodeType)&&9!==g)return[];if(!w&&!e){if(d=Ub.exec(c))if(m=d[1])if(9===g)if((h=a.getElementById(m))&&h.parentNode){if(h.id===m)return b.push(h),b}else return b;else{if(a.ownerDocument&&(h=a.ownerDocument.getElementById(m))&&E(a,h)&&h.id===m)return b.push(h),b}else{if(d[2])return ma.apply(b,Aa.call(a.getElementsByTagName(c),0)),b;if((m=d[3])&&U.getByClassName&&a.getElementsByClassName)return ma.apply(b,
Aa.call(a.getElementsByClassName(m),0)),b}if(U.qsa&&!L.test(c)){d=!0;h=R;m=a;f=9===g&&c;if(1===g&&"object"!==a.nodeName.toLowerCase()){g=u(c);(d=a.getAttribute("id"))?h=d.replace(ka,"\\$&"):a.setAttribute("id",h);h="[id='"+h+"'] ";for(m=g.length;m--;)g[m]=h+l(g[m]);m=ca.test(c)&&a.parentNode||a;f=g.join(",")}if(f)try{return ma.apply(b,Aa.call(m.querySelectorAll(f),0)),b}catch(k){}finally{d||a.removeAttribute("id")}}}var C;a:{c=c.replace(Qa,"$1");h=u(c);if(!e&&1===h.length){d=h[0]=h[0].slice(0);if(2<
d.length&&"ID"===(C=d[0]).type&&9===a.nodeType&&!w&&A.relative[d[1].type]){a=A.find.ID(C.matches[0].replace(fa,ia),a)[0];if(!a){C=b;break a}c=c.slice(d.shift().value.length)}for(g=X.needsContext.test(c)?0:d.length;g--;){C=d[g];if(A.relative[m=C.type])break;if(m=A.find[m])if(e=m(C.matches[0].replace(fa,ia),ca.test(d[0].type)&&a.parentNode||a)){d.splice(g,1);c=e.length&&l(d);if(!c){ma.apply(b,Aa.call(e,0));C=b;break a}break}}}H(c,h)(e,a,w,b,ca.test(c));C=b}return C}function m(c,a){var b=a&&c,e=b&&(~a.sourceIndex||
-2147483648)-(~c.sourceIndex||-2147483648);if(e)return e;if(b)for(;b=b.nextSibling;)if(b===a)return-1;return c?1:-1}function g(c){return function(a){return"input"===a.nodeName.toLowerCase()&&a.type===c}}function f(c){return function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&a.type===c}}function k(c){return d(function(a){a=+a;return d(function(b,e){for(var d,h=c([],b.length,a),n=h.length;n--;)b[d=h[n]]&&(b[d]=!(e[d]=b[d]))})})}function u(c,a){var b,e,d,h,m,g,f;if(m=K[c+" "])return a?
0:m.slice(0);m=c;g=[];for(f=A.preFilter;m;){if(!b||(e=V.exec(m)))e&&(m=m.slice(e[0].length)||m),g.push(d=[]);b=!1;if(e=Sb.exec(m))b=e.shift(),d.push({value:b,type:e[0].replace(Qa," ")}),m=m.slice(b.length);for(h in A.filter)!(e=X[h].exec(m))||f[h]&&!(e=f[h](e))||(b=e.shift(),d.push({value:b,type:h,matches:e}),m=m.slice(b.length));if(!b)break}return a?m.length:m?n.error(c):K(c,g).slice(0)}function l(c){for(var a=0,b=c.length,e="";a<b;a++)e+=c[a].value;return e}function C(c,a,b){var e=a.dir,d=b&&"parentNode"===
e,h=qa++;return a.first?function(a,b,h){for(;a=a[e];)if(1===a.nodeType||d)return c(a,b,h)}:function(a,b,n){var m,g,f,k=T+" "+h;if(n)for(;a=a[e];){if((1===a.nodeType||d)&&c(a,b,n))return!0}else for(;a=a[e];)if(1===a.nodeType||d)if(f=a[R]||(a[R]={}),(g=f[e])&&g[0]===k){if(!0===(m=g[1])||m===B)return!0===m}else if(g=f[e]=[k],g[1]=c(a,b,n)||B,!0===g[1])return!0}}function O(c){return 1<c.length?function(a,b,e){for(var d=c.length;d--;)if(!c[d](a,b,e))return!1;return!0}:c[0]}function p(c,a,b,e,d){for(var h,
n=[],m=0,g=c.length,f=null!=a;m<g;m++)if(h=c[m])if(!b||b(h,e,d))n.push(h),f&&a.push(m);return n}function z(c,a,b,e,h,m){e&&!e[R]&&(e=z(e));h&&!h[R]&&(h=z(h,m));return d(function(d,m,g,f){var k,u,l=[],C=[],O=m.length,z;if(!(z=d)){z=a||"*";for(var v=g.nodeType?[g]:g,x=[],t=0,q=v.length;t<q;t++)n(z,v[t],x);z=x}z=!c||!d&&a?z:p(z,l,c,g,f);v=b?h||(d?c:O||e)?[]:m:z;b&&b(z,v,g,f);if(e)for(k=p(v,C),e(k,[],g,f),g=k.length;g--;)if(u=k[g])v[C[g]]=!(z[C[g]]=u);if(d){if(h||c){if(h){k=[];for(g=v.length;g--;)(u=
v[g])&&k.push(z[g]=u);h(null,v=[],k,f)}for(g=v.length;g--;)(u=v[g])&&-1<(k=h?ga.call(d,u):l[g])&&(d[k]=!(m[k]=u))}}else v=p(v===m?v.splice(O,v.length):v),h?h(null,m,v,f):ma.apply(m,v)})}function v(c){var a,b,e,d=c.length,h=A.relative[c[0].type];b=h||A.relative[" "];for(var n=h?1:0,m=C(function(c){return c===a},b,!0),g=C(function(c){return-1<ga.call(a,c)},b,!0),f=[function(c,b,e){return!h&&(e||b!==M)||((a=b).nodeType?m(c,b,e):g(c,b,e))}];n<d;n++)if(b=A.relative[c[n].type])f=[C(O(f),b)];else{b=A.filter[c[n].type].apply(null,
c[n].matches);if(b[R]){for(e=++n;e<d&&!A.relative[c[e].type];e++);return z(1<n&&O(f),1<n&&l(c.slice(0,n-1)).replace(Qa,"$1"),b,n<e&&v(c.slice(n,e)),e<d&&v(c=c.slice(e)),e<d&&l(c))}f.push(b)}return O(f)}function x(c,a){var b=0,e=0<a.length,h=0<c.length,m=function(d,m,g,f,k){var u,l,C=[],O=0,z="0",v=d&&[],x=null!=k,t=M,q=d||h&&A.find.TAG("*",k&&m.parentNode||m),y=T+=null==t?1:Math.random()||.1;x&&(M=m!==D&&m,B=b);for(;null!=(k=q[z]);z++){if(h&&k){for(u=0;l=c[u++];)if(l(k,m,g)){f.push(k);break}x&&(T=
y,B=++b)}e&&((k=!l&&k)&&O--,d&&v.push(k))}O+=z;if(e&&z!==O){for(u=0;l=a[u++];)l(v,C,m,g);if(d){if(0<O)for(;z--;)v[z]||C[z]||(C[z]=Pa.call(f));C=p(C)}ma.apply(f,C);x&&!d&&0<C.length&&1<O+a.length&&n.uniqueSort(f)}x&&(T=y,M=t);return v};return e?d(m):m}function t(){}var q,B,A,y,J,H,P,M,I,D,Q,w,L,G,S,E,F,R="sizzle"+-new Date,N=c.document,U={},T=0,qa=0,ua=e(),K=e(),ea=e(),W=typeof a,za=[],Pa=za.pop,ma=za.push,Aa=za.slice,ga=za.indexOf||function(c){for(var a=0,b=this.length;a<b;a++)if(this[a]===c)return a;
return-1},za="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+".replace("w","w#"),Z="\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)[\\x20\\t\\r\\n\\f]*(?:([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+za+")|)|)[\\x20\\t\\r\\n\\f]*\\]",na=":((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+Z.replace(3,8)+")*)|.*)\\)|)",Qa=/^[\x20\t\r\n\f]+|((?:^|[^\\])(?:\\.)*)[\x20\t\r\n\f]+$/g,V=/^[\x20\t\r\n\f]*,[\x20\t\r\n\f]*/,Sb=/^[\x20\t\r\n\f]*([\x20\t\r\n\f>+~])[\x20\t\r\n\f]*/,
da=new RegExp(na),Y=new RegExp("^"+za+"$"),X={ID:/^#((?:\\.|[\w-]|[^\x00-\xa0])+)/,CLASS:/^\.((?:\\.|[\w-]|[^\x00-\xa0])+)/,NAME:/^\[name=['"]?((?:\\.|[\w-]|[^\x00-\xa0])+)['"]?\]/,TAG:new RegExp("^("+"(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+".replace("w","w*")+")"),ATTR:new RegExp("^"+Z),PSEUDO:new RegExp("^"+na),CHILD:/^:(only|first|last|nth|nth-last)-(child|of-type)(?:\([\x20\t\r\n\f]*(even|odd|(([+-]|)(\d*)n|)[\x20\t\r\n\f]*(?:([+-]|)[\x20\t\r\n\f]*(\d+)|))[\x20\t\r\n\f]*\)|)/i,needsContext:/^[\x20\t\r\n\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\([\x20\t\r\n\f]*((?:-\d)?\d*)[\x20\t\r\n\f]*\)|)(?=[^-]|$)/i},
ca=/[\x20\t\r\n\f]*[+~]/,ha=/^[^{]+\{\s*\[native code/,Ub=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ja=/^(?:input|select|textarea|button)$/i,ra=/^h\d$/i,ka=/'|\\/g,la=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,fa=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,ia=function(c,a){var b="0x"+a-65536;return b!==b?a:0>b?String.fromCharCode(b+65536):String.fromCharCode(b>>10|55296,b&1023|56320)};try{Aa.call(N.documentElement.childNodes,0)[0].nodeType}catch(pa){Aa=function(c){for(var a,b=[];a=this[c++];)b.push(a);
return b}}J=n.isXML=function(c){return(c=c&&(c.ownerDocument||c).documentElement)?"HTML"!==c.nodeName:!1};I=n.setDocument=function(c){var e=c?c.ownerDocument||c:N;if(e===D||9!==e.nodeType||!e.documentElement)return D;D=e;Q=e.documentElement;w=J(e);U.tagNameNoComments=h(function(c){c.appendChild(e.createComment(""));return!c.getElementsByTagName("*").length});U.attributes=h(function(c){c.innerHTML="<select></select>";c=typeof c.lastChild.getAttribute("multiple");return"boolean"!==c&&"string"!==c});
U.getByClassName=h(function(c){c.innerHTML="<div class='hidden e'></div><div class='hidden'></div>";if(!c.getElementsByClassName||!c.getElementsByClassName("e").length)return!1;c.lastChild.className="e";return 2===c.getElementsByClassName("e").length});U.getByName=h(function(c){c.id=R+0;c.innerHTML="<a name='"+R+"'></a><div name='"+R+"'></div>";Q.insertBefore(c,Q.firstChild);var a=e.getElementsByName&&e.getElementsByName(R).length===2+e.getElementsByName(R+0).length;U.getIdNotName=!e.getElementById(R);
Q.removeChild(c);return a});A.attrHandle=h(function(c){c.innerHTML="<a href='#'></a>";return c.firstChild&&typeof c.firstChild.getAttribute!==W&&"#"===c.firstChild.getAttribute("href")})?{}:{href:function(c){return c.getAttribute("href",2)},type:function(c){return c.getAttribute("type")}};U.getIdNotName?(A.find.ID=function(c,a){if(typeof a.getElementById!==W&&!w){var b=a.getElementById(c);return b&&b.parentNode?[b]:[]}},A.filter.ID=function(c){var a=c.replace(fa,ia);return function(c){return c.getAttribute("id")===
a}}):(A.find.ID=function(c,b){if(typeof b.getElementById!==W&&!w){var e=b.getElementById(c);return e?e.id===c||typeof e.getAttributeNode!==W&&e.getAttributeNode("id").value===c?[e]:a:[]}},A.filter.ID=function(c){var a=c.replace(fa,ia);return function(c){return(c=typeof c.getAttributeNode!==W&&c.getAttributeNode("id"))&&c.value===a}});A.find.TAG=U.tagNameNoComments?function(c,a){if(typeof a.getElementsByTagName!==W)return a.getElementsByTagName(c)}:function(c,a){var b,e=[],d=0,h=a.getElementsByTagName(c);
if("*"===c){for(;b=h[d++];)1===b.nodeType&&e.push(b);return e}return h};A.find.NAME=U.getByName&&function(c,a){if(typeof a.getElementsByName!==W)return a.getElementsByName(name)};A.find.CLASS=U.getByClassName&&function(c,a){if(typeof a.getElementsByClassName!==W&&!w)return a.getElementsByClassName(c)};G=[];L=[":focus"];if(U.qsa=b(e.querySelectorAll))h(function(c){c.innerHTML="<select><option selected=''></option></select>";c.querySelectorAll("[selected]").length||L.push("\\[[\\x20\\t\\r\\n\\f]*(?:checked|disabled|ismap|multiple|readonly|selected|value)");
c.querySelectorAll(":checked").length||L.push(":checked")}),h(function(c){c.innerHTML="<input type='hidden' i=''/>";c.querySelectorAll("[i^='']").length&&L.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:\"\"|'')");c.querySelectorAll(":enabled").length||L.push(":enabled",":disabled");c.querySelectorAll("*,:x");L.push(",.*:")});(U.matchesSelector=b(S=Q.matchesSelector||Q.mozMatchesSelector||Q.webkitMatchesSelector||Q.oMatchesSelector||Q.msMatchesSelector))&&h(function(c){U.disconnectedMatch=S.call(c,"div");S.call(c,
"[s!='']:x");G.push("!=",na)});L=new RegExp(L.join("|"));G=new RegExp(G.join("|"));E=b(Q.contains)||Q.compareDocumentPosition?function(c,a){var b=9===c.nodeType?c.documentElement:c,e=a&&a.parentNode;return c===e||!!(e&&1===e.nodeType&&(b.contains?b.contains(e):c.compareDocumentPosition&&c.compareDocumentPosition(e)&16))}:function(c,a){if(a)for(;a=a.parentNode;)if(a===c)return!0;return!1};F=Q.compareDocumentPosition?function(c,a){var b;return c===a?(P=!0,0):(b=a.compareDocumentPosition&&c.compareDocumentPosition&&
c.compareDocumentPosition(a))?b&1||c.parentNode&&11===c.parentNode.nodeType?c===e||E(N,c)?-1:a===e||E(N,a)?1:0:b&4?-1:1:c.compareDocumentPosition?-1:1}:function(c,a){var b,d=0;b=c.parentNode;var h=a.parentNode,n=[c],g=[a];if(c===a)return P=!0,0;if(!b||!h)return c===e?-1:a===e?1:b?-1:h?1:0;if(b===h)return m(c,a);for(b=c;b=b.parentNode;)n.unshift(b);for(b=a;b=b.parentNode;)g.unshift(b);for(;n[d]===g[d];)d++;return d?m(n[d],g[d]):n[d]===N?-1:g[d]===N?1:0};P=!1;[0,0].sort(F);U.detectDuplicates=P;return D};
n.matches=function(c,a){return n(c,null,null,a)};n.matchesSelector=function(c,a){(c.ownerDocument||c)!==D&&I(c);a=a.replace(la,"='$1']");if(!(!U.matchesSelector||w||G&&G.test(a)||L.test(a)))try{var b=S.call(c,a);if(b||U.disconnectedMatch||c.document&&11!==c.document.nodeType)return b}catch(e){}return 0<n(a,D,null,[c]).length};n.contains=function(c,a){(c.ownerDocument||c)!==D&&I(c);return E(c,a)};n.attr=function(c,a){var b;(c.ownerDocument||c)!==D&&I(c);w||(a=a.toLowerCase());return(b=A.attrHandle[a])?
b(c):w||U.attributes?c.getAttribute(a):((b=c.getAttributeNode(a))||c.getAttribute(a))&&!0===c[a]?a:b&&b.specified?b.value:null};n.error=function(c){throw Error("Syntax error, unrecognized expression: "+c);};n.uniqueSort=function(c){var a,b=[],e=1,d=0;P=!U.detectDuplicates;c.sort(F);if(P){for(;a=c[e];e++)a===c[e-1]&&(d=b.push(e));for(;d--;)c.splice(b[d],1)}return c};y=n.getText=function(c){var a,b="",e=0;a=c.nodeType;if(!a)for(;a=c[e];e++)b+=y(a);else if(1===a||9===a||11===a){if("string"===typeof c.textContent)return c.textContent;
for(c=c.firstChild;c;c=c.nextSibling)b+=y(c)}else if(3===a||4===a)return c.nodeValue;return b};A=n.selectors={cacheLength:50,createPseudo:d,match:X,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(c){c[1]=c[1].replace(fa,ia);c[3]=(c[4]||c[5]||"").replace(fa,ia);"~="===c[2]&&(c[3]=" "+c[3]+" ");return c.slice(0,4)},CHILD:function(c){c[1]=c[1].toLowerCase();"nth"===c[1].slice(0,3)?(c[3]||
n.error(c[0]),c[4]=+(c[4]?c[5]+(c[6]||1):2*("even"===c[3]||"odd"===c[3])),c[5]=+(c[7]+c[8]||"odd"===c[3])):c[3]&&n.error(c[0]);return c},PSEUDO:function(c){var a,b=!c[5]&&c[2];if(X.CHILD.test(c[0]))return null;c[4]?c[2]=c[4]:b&&da.test(b)&&(a=u(b,!0))&&(a=b.indexOf(")",b.length-a)-b.length)&&(c[0]=c[0].slice(0,a),c[2]=b.slice(0,a));return c.slice(0,3)}},filter:{TAG:function(c){if("*"===c)return function(){return!0};c=c.replace(fa,ia).toLowerCase();return function(a){return a.nodeName&&a.nodeName.toLowerCase()===
c}},CLASS:function(c){var a=ua[c+" "];return a||(a=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+c+"([\\x20\\t\\r\\n\\f]|$)"))&&ua(c,function(c){return a.test(c.className||typeof c.getAttribute!==W&&c.getAttribute("class")||"")})},ATTR:function(c,a,b){return function(e){e=n.attr(e,c);if(null==e)return"!="===a;if(!a)return!0;e+="";return"="===a?e===b:"!="===a?e!==b:"^="===a?b&&0===e.indexOf(b):"*="===a?b&&-1<e.indexOf(b):"$="===a?b&&e.slice(-b.length)===b:"~="===a?-1<(" "+e+" ").indexOf(b):"|="===a?e===b||
e.slice(0,b.length+1)===b+"-":!1}},CHILD:function(c,a,b,e,d){var h="nth"!==c.slice(0,3),n="last"!==c.slice(-4),m="of-type"===a;return 1===e&&0===d?function(c){return!!c.parentNode}:function(a,b,g){var f,k,u,l,C;b=h!==n?"nextSibling":"previousSibling";var O=a.parentNode,z=m&&a.nodeName.toLowerCase();g=!g&&!m;if(O){if(h){for(;b;){for(k=a;k=k[b];)if(m?k.nodeName.toLowerCase()===z:1===k.nodeType)return!1;C=b="only"===c&&!C&&"nextSibling"}return!0}C=[n?O.firstChild:O.lastChild];if(n&&g)for(g=O[R]||(O[R]=
{}),f=g[c]||[],l=f[0]===T&&f[1],u=f[0]===T&&f[2],k=l&&O.childNodes[l];k=++l&&k&&k[b]||(u=l=0)||C.pop();){if(1===k.nodeType&&++u&&k===a){g[c]=[T,l,u];break}}else if(g&&(f=(a[R]||(a[R]={}))[c])&&f[0]===T)u=f[1];else for(;(k=++l&&k&&k[b]||(u=l=0)||C.pop())&&((m?k.nodeName.toLowerCase()!==z:1!==k.nodeType)||!++u||(g&&((k[R]||(k[R]={}))[c]=[T,u]),k!==a)););u-=d;return u===e||0===u%e&&0<=u/e}}},PSEUDO:function(c,a){var b,e=A.pseudos[c]||A.setFilters[c.toLowerCase()]||n.error("unsupported pseudo: "+c);return e[R]?
e(a):1<e.length?(b=[c,c,"",a],A.setFilters.hasOwnProperty(c.toLowerCase())?d(function(c,b){for(var d,h=e(c,a),n=h.length;n--;)d=ga.call(c,h[n]),c[d]=!(b[d]=h[n])}):function(c){return e(c,0,b)}):e}},pseudos:{not:d(function(c){var a=[],b=[],e=H(c.replace(Qa,"$1"));return e[R]?d(function(c,a,b,d){d=e(c,null,d,[]);for(var h=c.length;h--;)if(b=d[h])c[h]=!(a[h]=b)}):function(c,d,h){a[0]=c;e(a,null,h,b);return!b.pop()}}),has:d(function(c){return function(a){return 0<n(c,a).length}}),contains:d(function(c){return function(a){return-1<
(a.textContent||a.innerText||y(a)).indexOf(c)}}),lang:d(function(c){Y.test(c||"")||n.error("unsupported lang: "+c);c=c.replace(fa,ia).toLowerCase();return function(a){var b;do if(b=w?a.getAttribute("xml:lang")||a.getAttribute("lang"):a.lang)return b=b.toLowerCase(),b===c||0===b.indexOf(c+"-");while((a=a.parentNode)&&1===a.nodeType);return!1}}),target:function(a){var b=c.location&&c.location.hash;return b&&b.slice(1)===a.id},root:function(c){return c===Q},focus:function(c){return c===D.activeElement&&
(!D.hasFocus||D.hasFocus())&&!!(c.type||c.href||~c.tabIndex)},enabled:function(c){return!1===c.disabled},disabled:function(c){return!0===c.disabled},checked:function(c){var a=c.nodeName.toLowerCase();return"input"===a&&!!c.checked||"option"===a&&!!c.selected},selected:function(c){c.parentNode&&c.parentNode.selectedIndex;return!0===c.selected},empty:function(c){for(c=c.firstChild;c;c=c.nextSibling)if("@"<c.nodeName||3===c.nodeType||4===c.nodeType)return!1;return!0},parent:function(c){return!A.pseudos.empty(c)},
header:function(c){return ra.test(c.nodeName)},input:function(c){return ja.test(c.nodeName)},button:function(c){var a=c.nodeName.toLowerCase();return"input"===a&&"button"===c.type||"button"===a},text:function(c){var a;return"input"===c.nodeName.toLowerCase()&&"text"===c.type&&(null==(a=c.getAttribute("type"))||a.toLowerCase()===c.type)},first:k(function(){return[0]}),last:k(function(c,a){return[a-1]}),eq:k(function(c,a,b){return[0>b?b+a:b]}),even:k(function(c,a){for(var b=0;b<a;b+=2)c.push(b);return c}),
odd:k(function(c,a){for(var b=1;b<a;b+=2)c.push(b);return c}),lt:k(function(c,a,b){for(a=0>b?b+a:b;0<=--a;)c.push(a);return c}),gt:k(function(c,a,b){for(b=0>b?b+a:b;++b<a;)c.push(b);return c})}};for(q in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})A.pseudos[q]=g(q);for(q in{submit:!0,reset:!0})A.pseudos[q]=f(q);H=n.compile=function(c,a){var b,e=[],d=[],h=ea[c+" "];if(!h){a||(a=u(c));for(b=a.length;b--;)h=v(a[b]),h[R]?e.push(h):d.push(h);h=ea(c,x(d,e))}return h};A.pseudos.nth=A.pseudos.eq;A.filters=
t.prototype=A.pseudos;A.setFilters=new t;I();n.attr=r.attr;r.find=n;r.expr=n.selectors;r.expr[":"]=r.expr.pseudos;r.unique=n.uniqueSort;r.text=n.getText;r.isXMLDoc=n.isXML;r.contains=n.contains})(c);var rb=/Until$/,bb=/^(?:parents|prev(?:Until|All))/,Ea=/^.[^:#\[\.,]*$/,sb=r.expr.match.needsContext,cb={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({find:function(c){var a,b,e,d=this.length;if("string"!==typeof c)return e=this,this.pushStack(r(c).filter(function(){for(a=0;a<d;a++)if(r.contains(e[a],
this))return!0}));b=[];for(a=0;a<d;a++)r.find(c,this[a],b);b=this.pushStack(1<d?r.unique(b):b);b.selector=(this.selector?this.selector+" ":"")+c;return b},has:function(c){var a,b=r(c,this),e=b.length;return this.filter(function(){for(a=0;a<e;a++)if(r.contains(this,b[a]))return!0})},not:function(c){return this.pushStack(t(this,c,!1))},filter:function(c){return this.pushStack(t(this,c,!0))},is:function(c){return!!c&&("string"===typeof c?sb.test(c)?0<=r(c,this.context).index(this[0]):0<r.filter(c,this).length:
0<this.filter(c).length)},closest:function(c,a){for(var b,e=0,d=this.length,h=[],n=sb.test(c)||"string"!==typeof c?r(c,a||this.context):0;e<d;e++)for(b=this[e];b&&b.ownerDocument&&b!==a&&11!==b.nodeType;){if(n?-1<n.index(b):r.find.matchesSelector(b,c)){h.push(b);break}b=b.parentNode}return this.pushStack(1<h.length?r.unique(h):h)},index:function(c){return c?"string"===typeof c?r.inArray(this[0],r(c)):r.inArray(c.jquery?c[0]:c,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(c,
a){var b="string"===typeof c?r(c,a):r.makeArray(c&&c.nodeType?[c]:c),b=r.merge(this.get(),b);return this.pushStack(r.unique(b))},addBack:function(c){return this.add(null==c?this.prevObject:this.prevObject.filter(c))}});r.fn.andSelf=r.fn.addBack;r.each({parent:function(c){return(c=c.parentNode)&&11!==c.nodeType?c:null},parents:function(c){return r.dir(c,"parentNode")},parentsUntil:function(c,a,b){return r.dir(c,"parentNode",b)},next:function(c){return q(c,"nextSibling")},prev:function(c){return q(c,
"previousSibling")},nextAll:function(c){return r.dir(c,"nextSibling")},prevAll:function(c){return r.dir(c,"previousSibling")},nextUntil:function(c,a,b){return r.dir(c,"nextSibling",b)},prevUntil:function(c,a,b){return r.dir(c,"previousSibling",b)},siblings:function(c){return r.sibling((c.parentNode||{}).firstChild,c)},children:function(c){return r.sibling(c.firstChild)},contents:function(c){return r.nodeName(c,"iframe")?c.contentDocument||c.contentWindow.document:r.merge([],c.childNodes)}},function(c,
a){r.fn[c]=function(b,e){var d=r.map(this,a,b);rb.test(c)||(e=b);e&&"string"===typeof e&&(d=r.filter(e,d));d=1<this.length&&!cb[c]?r.unique(d):d;1<this.length&&bb.test(c)&&(d=d.reverse());return this.pushStack(d)}});r.extend({filter:function(c,a,b){b&&(c=":not("+c+")");return 1===a.length?r.find.matchesSelector(a[0],c)?[a[0]]:[]:r.find.matches(c,a)},dir:function(c,b,e){var d=[];for(c=c[b];c&&9!==c.nodeType&&(e===a||1!==c.nodeType||!r(c).is(e));)1===c.nodeType&&d.push(c),c=c[b];return d},sibling:function(c,
a){for(var b=[];c;c=c.nextSibling)1===c.nodeType&&c!==a&&b.push(c);return b}});var pa="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",la=/ jQuery\d+="(?:null|\d+)"/g,Ma=new RegExp("<(?:"+pa+")[\\s/>]","i"),va=/^\s+/,Jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Kb=/<([\w:]+)/,Zb=/<tbody/i,Jc=/<|&#?\w+;/,Kc=/<(?:script|style|link)/i,vb=/^(?:checkbox|radio)$/i,
rc=/checked\s*(?:[^=]|=\s*.checked.)/i,V=/^$|\/(?:java|ecma)script/i,sa=/^true\/(.*)/,Lb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,fa={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:r.support.htmlSerialize?
[0,"",""]:[1,"X<div>","</div>"]},Mb=y(S).appendChild(S.createElement("div"));fa.optgroup=fa.option;fa.tbody=fa.tfoot=fa.colgroup=fa.caption=fa.thead;fa.th=fa.td;r.fn.extend({text:function(c){return r.access(this,function(c){return c===a?r.text(this):this.empty().append((this[0]&&this[0].ownerDocument||S).createTextNode(c))},null,c,arguments.length)},wrapAll:function(c){if(r.isFunction(c))return this.each(function(a){r(this).wrapAll(c.call(this,a))});if(this[0]){var a=r(c,this[0].ownerDocument).eq(0).clone(!0);
this[0].parentNode&&a.insertBefore(this[0]);a.map(function(){for(var c=this;c.firstChild&&1===c.firstChild.nodeType;)c=c.firstChild;return c}).append(this)}return this},wrapInner:function(c){return r.isFunction(c)?this.each(function(a){r(this).wrapInner(c.call(this,a))}):this.each(function(){var a=r(this),b=a.contents();b.length?b.wrapAll(c):a.append(c)})},wrap:function(c){var a=r.isFunction(c);return this.each(function(b){r(this).wrapAll(a?c.call(this,b):c)})},unwrap:function(){return this.parent().each(function(){r.nodeName(this,
"body")||r(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(c){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||this.appendChild(c)})},prepend:function(){return this.domManip(arguments,!0,function(c){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||this.insertBefore(c,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(c){this.parentNode&&this.parentNode.insertBefore(c,this)})},after:function(){return this.domManip(arguments,
!1,function(c){this.parentNode&&this.parentNode.insertBefore(c,this.nextSibling)})},remove:function(c,a){for(var b,e=0;null!=(b=this[e]);e++)if(!c||0<r.filter(c,[b]).length)a||1!==b.nodeType||r.cleanData(z(b)),b.parentNode&&(a&&r.contains(b.ownerDocument,b)&&I(z(b,"script")),b.parentNode.removeChild(b));return this},empty:function(){for(var c,a=0;null!=(c=this[a]);a++){for(1===c.nodeType&&r.cleanData(z(c,!1));c.firstChild;)c.removeChild(c.firstChild);c.options&&r.nodeName(c,"select")&&(c.options.length=
0)}return this},clone:function(c,a){c=null==c?!1:c;a=null==a?c:a;return this.map(function(){return r.clone(this,c,a)})},html:function(c){return r.access(this,function(c){var b=this[0]||{},e=0,d=this.length;if(c===a)return 1===b.nodeType?b.innerHTML.replace(la,""):a;if(!("string"!==typeof c||Kc.test(c)||!r.support.htmlSerialize&&Ma.test(c)||!r.support.leadingWhitespace&&va.test(c)||fa[(Kb.exec(c)||["",""])[1].toLowerCase()])){c=c.replace(Jb,"<$1></$2>");try{for(;e<d;e++)b=this[e]||{},1===b.nodeType&&
(r.cleanData(z(b,!1)),b.innerHTML=c);b=0}catch(h){}}b&&this.empty().append(c)},null,c,arguments.length)},replaceWith:function(c){r.isFunction(c)||"string"===typeof c||(c=r(c).not(this).detach());return this.domManip([c],!0,function(c){var a=this.nextSibling,b=this.parentNode;b&&(r(this).remove(),b.insertBefore(c,a))})},detach:function(c){return this.remove(c,!0)},domManip:function(c,b,e){c=Aa.apply([],c);var d,h,n,m,g=0,f=this.length,k=this,u=f-1,l=c[0],C=r.isFunction(l);if(C||!(1>=f||"string"!==
typeof l||r.support.checkClone)&&rc.test(l))return this.each(function(d){var h=k.eq(d);C&&(c[0]=l.call(this,d,b?h.html():a));h.domManip(c,b,e)});if(f&&(m=r.buildFragment(c,this[0].ownerDocument,!1,this),d=m.firstChild,1===m.childNodes.length&&(m=d),d)){b=b&&r.nodeName(d,"tr");n=r.map(z(m,"script"),A);for(h=n.length;g<f;g++)d=m,g!==u&&(d=r.clone(d,!0,!0),h&&r.merge(n,z(d,"script"))),e.call(b&&r.nodeName(this[g],"table")?B(this[g],"tbody"):this[g],d,g);if(h)for(m=n[n.length-1].ownerDocument,r.map(n,
x),g=0;g<h;g++)d=n[g],V.test(d.type||"")&&!r._data(d,"globalEval")&&r.contains(m,d)&&(d.src?r.ajax({url:d.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):r.globalEval((d.text||d.textContent||d.innerHTML||"").replace(Lb,"")));m=d=null}return this}});r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(c,a){r.fn[c]=function(c){for(var b=0,e=[],d=r(c),h=d.length-1;b<=h;b++)c=b===h?this:this.clone(!0),r(d[b])[a](c),
ga.apply(e,c.get());return this.pushStack(e)}});r.extend({clone:function(c,a,b){var e,d,h,n,m,g=r.contains(c.ownerDocument,c);r.support.html5Clone||r.isXMLDoc(c)||!Ma.test("<"+c.nodeName+">")?h=c.cloneNode(!0):(Mb.innerHTML=c.outerHTML,Mb.removeChild(h=Mb.firstChild));if(!(r.support.noCloneEvent&&r.support.noCloneChecked||1!==c.nodeType&&11!==c.nodeType||r.isXMLDoc(c)))for(e=z(h),m=z(c),n=0;null!=(d=m[n]);++n)if(e[n]){var f=e[n],k=void 0,u=void 0,l=void 0;if(1===f.nodeType){k=f.nodeName.toLowerCase();
if(!r.support.noCloneEvent&&f[r.expando]){l=r._data(f);for(u in l.events)r.removeEvent(f,u,l.handle);f.removeAttribute(r.expando)}if("script"===k&&f.text!==d.text)A(f).text=d.text,x(f);else if("object"===k)f.parentNode&&(f.outerHTML=d.outerHTML),r.support.html5Clone&&d.innerHTML&&!r.trim(f.innerHTML)&&(f.innerHTML=d.innerHTML);else if("input"===k&&vb.test(d.type))f.defaultChecked=f.checked=d.checked,f.value!==d.value&&(f.value=d.value);else if("option"===k)f.defaultSelected=f.selected=d.defaultSelected;
else if("input"===k||"textarea"===k)f.defaultValue=d.defaultValue}}if(a)if(b)for(m=m||z(c),e=e||z(h),n=0;null!=(d=m[n]);n++)F(d,e[n]);else F(c,h);e=z(h,"script");0<e.length&&I(e,!g&&z(c,"script"));return h},buildFragment:function(c,a,b,e){for(var d,h,n,m,g,f,k=c.length,u=y(a),l=[],C=0;C<k;C++)if((h=c[C])||0===h)if("object"===r.type(h))r.merge(l,h.nodeType?[h]:h);else if(Jc.test(h)){n=n||u.appendChild(a.createElement("div"));m=(Kb.exec(h)||["",""])[1].toLowerCase();f=fa[m]||fa._default;n.innerHTML=
f[1]+h.replace(Jb,"<$1></$2>")+f[2];for(d=f[0];d--;)n=n.lastChild;!r.support.leadingWhitespace&&va.test(h)&&l.push(a.createTextNode(va.exec(h)[0]));if(!r.support.tbody)for(d=(h="table"!==m||Zb.test(h)?"<table>"!==f[1]||Zb.test(h)?0:n:n.firstChild)&&h.childNodes.length;d--;)r.nodeName(g=h.childNodes[d],"tbody")&&!g.childNodes.length&&h.removeChild(g);r.merge(l,n.childNodes);for(n.textContent="";n.firstChild;)n.removeChild(n.firstChild);n=u.lastChild}else l.push(a.createTextNode(h));n&&u.removeChild(n);
r.support.appendChecked||r.grep(z(l,"input"),L);for(C=0;h=l[C++];)if(!e||-1===r.inArray(h,e))if(c=r.contains(h.ownerDocument,h),n=z(u.appendChild(h),"script"),c&&I(n),b)for(d=0;h=n[d++];)V.test(h.type||"")&&b.push(h);return u},cleanData:function(c,a){for(var b,e,d,h,n=0,m=r.expando,g=r.cache,f=r.support.deleteExpando,k=r.event.special;null!=(b=c[n]);n++)if(a||r.acceptData(b))if(h=(d=b[m])&&g[d]){if(h.events)for(e in h.events)k[e]?r.event.remove(b,e):r.removeEvent(b,e,h.handle);g[d]&&(delete g[d],
f?delete b[m]:typeof b.removeAttribute!==ea?b.removeAttribute(m):b[m]=null,ma.push(d))}}});var wa,ja,Oa,tb=/alpha\([^)]*\)/i,Lc=/opacity\s*=\s*([^)]*)/,$b=/^(top|right|bottom|left)$/,Wa=/^(none|table(?!-c[ea]).+)/,ca=/^margin/,Ac=new RegExp("^("+zb+")(.*)$","i"),wb=new RegExp("^("+zb+")(?!px)[a-z%]+$","i"),db=new RegExp("^([+-])=("+zb+")","i"),xb={BODY:"block"},ac={position:"absolute",visibility:"hidden",display:"block"},sc={letterSpacing:0,fontWeight:400},ya=["Top","Right","Bottom","Left"],mc=["Webkit",
"O","Moz","ms"];r.fn.extend({css:function(c,b){return r.access(this,function(c,b,e){var d,h={},n=0;if(r.isArray(b)){d=ja(c);for(e=b.length;n<e;n++)h[b[n]]=r.css(c,b[n],!1,d);return h}return e!==a?r.style(c,b,e):r.css(c,b)},c,b,1<arguments.length)},show:function(){return K(this,!0)},hide:function(){return K(this)},toggle:function(c){var a="boolean"===typeof c;return this.each(function(){(a?c:G(this))?r(this).show():r(this).hide()})}});r.extend({cssHooks:{opacity:{get:function(c,a){if(a){var b=Oa(c,
"opacity");return""===b?"1":b}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":r.support.cssFloat?"cssFloat":"styleFloat"},style:function(c,b,e,d){if(c&&3!==c.nodeType&&8!==c.nodeType&&c.style){var h,m,g,f=r.camelCase(b),k=c.style;b=r.cssProps[f]||(r.cssProps[f]=n(k,f));g=r.cssHooks[b]||r.cssHooks[f];if(e!==a){if(m=typeof e,"string"===m&&(h=db.exec(e))&&(e=(h[1]+1)*h[2]+parseFloat(r.css(c,b)),m="number"),
!(null==e||"number"===m&&isNaN(e)||("number"!==m||r.cssNumber[f]||(e+="px"),r.support.clearCloneStyle||""!==e||0!==b.indexOf("background")||(k[b]="inherit"),g&&"set"in g&&(e=g.set(c,e,d))===a)))try{k[b]=e}catch(u){}}else return g&&"get"in g&&(h=g.get(c,!1,d))!==a?h:k[b]}},css:function(c,b,e,d){var h,m;m=r.camelCase(b);b=r.cssProps[m]||(r.cssProps[m]=n(c.style,m));(m=r.cssHooks[b]||r.cssHooks[m])&&"get"in m&&(h=m.get(c,!0,e));h===a&&(h=Oa(c,b,d));"normal"===h&&b in sc&&(h=sc[b]);return""===e||e?(c=
parseFloat(h),!0===e||r.isNumeric(c)?c||0:h):h},swap:function(c,a,b,e){var d,h={};for(d in a)h[d]=c.style[d],c.style[d]=a[d];b=b.apply(c,e||[]);for(d in a)c.style[d]=h[d];return b}});c.getComputedStyle?(ja=function(a){return c.getComputedStyle(a,null)},Oa=function(c,b,e){var d,h=(e=e||ja(c))?e.getPropertyValue(b)||e[b]:a,n=c.style;e&&(""!==h||r.contains(c.ownerDocument,c)||(h=r.style(c,b)),wb.test(h)&&ca.test(b)&&(c=n.width,b=n.minWidth,d=n.maxWidth,n.minWidth=n.maxWidth=n.width=h,h=e.width,n.width=
c,n.minWidth=b,n.maxWidth=d));return h}):S.documentElement.currentStyle&&(ja=function(c){return c.currentStyle},Oa=function(c,b,e){var d,h,n=(e=e||ja(c))?e[b]:a,m=c.style;null==n&&m&&m[b]&&(n=m[b]);if(wb.test(n)&&!$b.test(b)){e=m.left;if(h=(d=c.runtimeStyle)&&d.left)d.left=c.currentStyle.left;m.left="fontSize"===b?"1em":n;n=m.pixelLeft+"px";m.left=e;h&&(d.left=h)}return""===n?"auto":n});r.each(["height","width"],function(c,a){r.cssHooks[a]={get:function(c,b,e){if(b)return 0===c.offsetWidth&&Wa.test(r.css(c,
"display"))?r.swap(c,ac,function(){return D(c,a,e)}):D(c,a,e)},set:function(c,b,e){var d=e&&ja(c);return E(c,b,e?w(c,a,e,r.support.boxSizing&&"border-box"===r.css(c,"boxSizing",!1,d),d):0)}}});r.support.opacity||(r.cssHooks.opacity={get:function(c,a){return Lc.test((a&&c.currentStyle?c.currentStyle.filter:c.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":a?"1":""},set:function(c,a){var b=c.style,e=c.currentStyle,d=r.isNumeric(a)?"alpha(opacity="+100*a+")":"",h=e&&e.filter||b.filter||"";b.zoom=1;if((1<=
a||""===a)&&""===r.trim(h.replace(tb,""))&&b.removeAttribute&&(b.removeAttribute("filter"),""===a||e&&!e.filter))return;b.filter=tb.test(h)?h.replace(tb,d):h+" "+d}});r(function(){r.support.reliableMarginRight||(r.cssHooks.marginRight={get:function(c,a){if(a)return r.swap(c,{display:"inline-block"},Oa,[c,"marginRight"])}});!r.support.pixelPosition&&r.fn.position&&r.each(["top","left"],function(c,a){r.cssHooks[a]={get:function(c,b){if(b)return b=Oa(c,a),wb.test(b)?r(c).position()[a]+"px":b}}})});r.expr&&
r.expr.filters&&(r.expr.filters.hidden=function(c){return 0>=c.offsetWidth&&0>=c.offsetHeight||!r.support.reliableHiddenOffsets&&"none"===(c.style&&c.style.display||r.css(c,"display"))},r.expr.filters.visible=function(c){return!r.expr.filters.hidden(c)});r.each({margin:"",padding:"",border:"Width"},function(c,a){r.cssHooks[c+a]={expand:function(b){var e=0,d={};for(b="string"===typeof b?b.split(" "):[b];4>e;e++)d[c+ya[e]+a]=b[e]||b[e-2]||b[0];return d}};ca.test(c)||(r.cssHooks[c+a].set=E)});var Mc=
/%20/g,Bc=/\[\]$/,tc=/\r?\n/g,bc=/^(?:submit|button|image|reset|file)$/i,Nc=/^(?:input|select|textarea|keygen)/i;r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var c=r.prop(this,"elements");return c?r.makeArray(c):this}).filter(function(){var c=this.type;return this.name&&!r(this).is(":disabled")&&Nc.test(this.nodeName)&&!bc.test(c)&&(this.checked||!vb.test(c))}).map(function(c,a){var b=r(this).val();return null==b?null:
r.isArray(b)?r.map(b,function(c){return{name:a.name,value:c.replace(tc,"\r\n")}}):{name:a.name,value:b.replace(tc,"\r\n")}}).get()}});r.param=function(c,b){var e,d=[],h=function(c,a){a=r.isFunction(a)?a():null==a?"":a;d[d.length]=encodeURIComponent(c)+"="+encodeURIComponent(a)};b===a&&(b=r.ajaxSettings&&r.ajaxSettings.traditional);if(r.isArray(c)||c.jquery&&!r.isPlainObject(c))r.each(c,function(){h(this.name,this.value)});else for(e in c)p(e,c[e],b,h);return d.join("&").replace(Mc,"+")};r.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),
function(c,a){r.fn[a]=function(c,b){return 0<arguments.length?this.on(a,null,c,b):this.trigger(a)}});r.fn.hover=function(c,a){return this.mouseenter(c).mouseleave(a||c)};var Xa,Ba,eb=r.now(),Ya=/\?/,cc=/#.*$/,dc=/([?&])_=[^&]*/,uc=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,ec=/^(?:GET|HEAD)$/,Oc=/^\/\//,Nb=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,ub=r.fn.load,fc={},Rb={},vc="*/".concat("*");try{Ba=W.href}catch(Wc){Ba=S.createElement("a"),Ba.href="",Ba=Ba.href}Xa=Nb.exec(Ba.toLowerCase())||[];r.fn.load=
function(c,b,e){if("string"!==typeof c&&ub)return ub.apply(this,arguments);var d,h,n,m=this,g=c.indexOf(" ");0<=g&&(d=c.slice(g,c.length),c=c.slice(0,g));r.isFunction(b)?(e=b,b=a):b&&"object"===typeof b&&(n="POST");0<m.length&&r.ajax({url:c,type:n,dataType:"html",data:b}).done(function(c){h=arguments;m.html(d?r("<div>").append(r.parseHTML(c)).find(d):c)}).complete(e&&function(c,a){m.each(e,h||[c.responseText,a,c])});return this};r.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
function(c,a){r.fn[a]=function(c){return this.on(a,c)}});r.each(["get","post"],function(c,b){r[b]=function(c,e,d,h){r.isFunction(e)&&(h=h||d,d=e,e=a);return r.ajax({url:c,type:b,dataType:h,data:e,success:d})}});r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ba,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Xa[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":vc,text:"text/plain",html:"text/html",
xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":c.String,"text html":!0,"text json":r.parseJSON,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(c,a){return a?v(v(c,r.ajaxSettings),a):v(r.ajaxSettings,c)},ajaxPrefilter:J(fc),ajaxTransport:J(Rb),ajax:function(c,b){function e(c,b,d,h){var u,x,t,A,y=b;if(2!==q){q=2;g&&clearTimeout(g);
k=a;m=h||"";B.readyState=0<c?4:0;if(d){A=l;h=B;var J,P,H,I,M=A.contents,D=A.dataTypes,Q=A.responseFields;for(I in Q)I in d&&(h[Q[I]]=d[I]);for(;"*"===D[0];)D.shift(),P===a&&(P=A.mimeType||h.getResponseHeader("Content-Type"));if(P)for(I in M)if(M[I]&&M[I].test(P)){D.unshift(I);break}if(D[0]in d)H=D[0];else{for(I in d){if(!D[0]||A.converters[I+" "+D[0]]){H=I;break}J||(J=I)}H=H||J}H?(H!==D[0]&&D.unshift(H),A=d[H]):A=void 0}if(200<=c&&300>c||304===c)if(l.ifModified&&((d=B.getResponseHeader("Last-Modified"))&&
(r.lastModified[n]=d),(d=B.getResponseHeader("etag"))&&(r.etag[n]=d)),204===c)u=!0,y="nocontent";else if(304===c)u=!0,y="notmodified";else{a:{x=l;t=A;var w,L,y={};J=0;P=x.dataTypes.slice();H=P[0];x.dataFilter&&(t=x.dataFilter(t,x.dataType));if(P[1])for(L in x.converters)y[L.toLowerCase()]=x.converters[L];for(;d=P[++J];)if("*"!==d){if("*"!==H&&H!==d){L=y[H+" "+d]||y["* "+d];if(!L)for(w in y)if(u=w.split(" "),u[1]===d&&(L=y[H+" "+u[0]]||y["* "+u[0]])){!0===L?L=y[w]:!0!==y[w]&&(d=u[0],P.splice(J--,0,
d));break}if(!0!==L)if(L&&x["throws"])t=L(t);else try{t=L(t)}catch(G){u={state:"parsererror",error:L?G:"No conversion from "+H+" to "+d};break a}}H=d}u={state:"success",data:t}}y=u.state;x=u.data;t=u.error;u=!t}else if(t=y,c||!y)y="error",0>c&&(c=0);B.status=c;B.statusText=(b||y)+"";u?z.resolveWith(C,[x,y,B]):z.rejectWith(C,[B,y,t]);B.statusCode(v);v=a;f&&O.trigger(u?"ajaxSuccess":"ajaxError",[B,l,u?x:t]);p.fireWith(C,[B,y]);f&&(O.trigger("ajaxComplete",[B,l]),--r.active||r.event.trigger("ajaxStop"))}}
"object"===typeof c&&(b=c,c=a);b=b||{};var d,h,n,m,g,f,k,u,l=r.ajaxSetup({},b),C=l.context||l,O=l.context&&(C.nodeType||C.jquery)?r(C):r.event,z=r.Deferred(),p=r.Callbacks("once memory"),v=l.statusCode||{},x={},t={},q=0,A="canceled",B={readyState:0,getResponseHeader:function(c){var a;if(2===q){if(!u)for(u={};a=uc.exec(m);)u[a[1].toLowerCase()]=a[2];a=u[c.toLowerCase()]}return null==a?null:a},getAllResponseHeaders:function(){return 2===q?m:null},setRequestHeader:function(c,a){var b=c.toLowerCase();
q||(c=t[b]=t[b]||c,x[c]=a);return this},overrideMimeType:function(c){q||(l.mimeType=c);return this},statusCode:function(c){var a;if(c)if(2>q)for(a in c)v[a]=[v[a],c[a]];else B.always(c[B.status]);return this},abort:function(c){c=c||A;k&&k.abort(c);e(0,c);return this}};z.promise(B).complete=p.add;B.success=B.done;B.error=B.fail;l.url=((c||l.url||Ba)+"").replace(cc,"").replace(Oc,Xa[1]+"//");l.type=b.method||b.type||l.method||l.type;l.dataTypes=r.trim(l.dataType||"*").toLowerCase().match(ia)||[""];
null==l.crossDomain&&(d=Nb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Xa[1]&&d[2]===Xa[2]&&(d[3]||("http:"===d[1]?80:443))==(Xa[3]||("http:"===Xa[1]?80:443))));l.data&&l.processData&&"string"!==typeof l.data&&(l.data=r.param(l.data,l.traditional));H(fc,l,b,B);if(2===q)return B;(f=l.global)&&0===r.active++&&r.event.trigger("ajaxStart");l.type=l.type.toUpperCase();l.hasContent=!ec.test(l.type);n=l.url;l.hasContent||(l.data&&(n=l.url+=(Ya.test(n)?"&":"?")+l.data,delete l.data),!1===l.cache&&
(l.url=dc.test(n)?n.replace(dc,"$1_="+eb++):n+(Ya.test(n)?"&":"?")+"_="+eb++));l.ifModified&&(r.lastModified[n]&&B.setRequestHeader("If-Modified-Since",r.lastModified[n]),r.etag[n]&&B.setRequestHeader("If-None-Match",r.etag[n]));(l.data&&l.hasContent&&!1!==l.contentType||b.contentType)&&B.setRequestHeader("Content-Type",l.contentType);B.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+vc+"; q=0.01":""):l.accepts["*"]);for(h in l.headers)B.setRequestHeader(h,
l.headers[h]);if(l.beforeSend&&(!1===l.beforeSend.call(C,B,l)||2===q))return B.abort();A="abort";for(h in{success:1,error:1,complete:1})B[h](l[h]);if(k=H(Rb,l,b,B)){B.readyState=1;f&&O.trigger("ajaxSend",[B,l]);l.async&&0<l.timeout&&(g=setTimeout(function(){B.abort("timeout")},l.timeout));try{q=1,k.send(x,e)}catch(y){if(2>q)e(-1,y);else throw y;}}else e(-1,"No Transport");return B},getScript:function(c,b){return r.get(c,a,b,"script")},getJSON:function(c,a,b){return r.get(c,a,b,"json")}});r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},
contents:{script:/(?:java|ecma)script/},converters:{"text script":function(c){r.globalEval(c);return c}}});r.ajaxPrefilter("script",function(c){c.cache===a&&(c.cache=!1);c.crossDomain&&(c.type="GET",c.global=!1)});r.ajaxTransport("script",function(c){if(c.crossDomain){var b,e=S.head||r("head")[0]||S.documentElement;return{send:function(a,d){b=S.createElement("script");b.async=!0;c.scriptCharset&&(b.charset=c.scriptCharset);b.src=c.url;b.onload=b.onreadystatechange=function(c,a){if(a||!b.readyState||
/loaded|complete/.test(b.readyState))b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,a||d(200,"success")};e.insertBefore(b,e.firstChild)},abort:function(){if(b)b.onload(a,!0)}}}});var gc=[],Ca=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var c=gc.pop()||r.expando+"_"+eb++;this[c]=!0;return c}});r.ajaxPrefilter("json jsonp",function(b,e,d){var h,n,m,g=!1!==b.jsonp&&(Ca.test(b.url)?"url":"string"===typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&
Ca.test(b.data)&&"data");if(g||"jsonp"===b.dataTypes[0])return h=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,g?b[g]=b[g].replace(Ca,"$1"+h):!1!==b.jsonp&&(b.url+=(Ya.test(b.url)?"&":"?")+b.jsonp+"="+h),b.converters["script json"]=function(){m||r.error(h+" was not called");return m[0]},b.dataTypes[0]="json",n=c[h],c[h]=function(){m=arguments},d.always(function(){c[h]=n;b[h]&&(b.jsonpCallback=e.jsonpCallback,gc.push(h));m&&r.isFunction(n)&&n(m[0]);m=n=a}),"script"});
var ob,fb,wc=0,hc=c.ActiveXObject&&function(){for(var c in ob)ob[c](a,!0)};r.ajaxSettings.xhr=c.ActiveXObject?function(){var a;if(!(a=!this.isLocal&&C()))a:{try{a=new c.ActiveXObject("Microsoft.XMLHTTP");break a}catch(b){}a=void 0}return a}:C;fb=r.ajaxSettings.xhr();r.support.cors=!!fb&&"withCredentials"in fb;(fb=r.support.ajax=!!fb)&&r.ajaxTransport(function(b){if(!b.crossDomain||r.support.cors){var e;return{send:function(d,h){var n,m,g=b.xhr();b.username?g.open(b.type,b.url,b.async,b.username,b.password):
g.open(b.type,b.url,b.async);if(b.xhrFields)for(m in b.xhrFields)g[m]=b.xhrFields[m];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType);b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");try{for(m in d)g.setRequestHeader(m,d[m])}catch(f){}g.send(b.hasContent&&b.data||null);e=function(c,d){var m,f,k,u;try{if(e&&(d||4===g.readyState))if(e=a,n&&(g.onreadystatechange=r.noop,hc&&delete ob[n]),d)4!==g.readyState&&g.abort();else{u={};m=g.status;f=g.getAllResponseHeaders();
"string"===typeof g.responseText&&(u.text=g.responseText);try{k=g.statusText}catch(l){k=""}m||!b.isLocal||b.crossDomain?1223===m&&(m=204):m=u.text?200:404}}catch(C){d||h(-1,C)}u&&h(m,k,u,f)};b.async?4===g.readyState?setTimeout(e):(n=++wc,hc&&(ob||(ob={},r(c).unload(hc)),ob[n]=e),g.onreadystatechange=e):e()},abort:function(){e&&e(a,!0)}}}});var ib,Ob,Pb=/^(?:toggle|show|hide)$/,xc=new RegExp("^(?:([+-])=|)("+zb+")([a-z%]*)$","i"),Pc=/queueHooks$/,yb=[function(c,a,b){var e,d,h,n,m,g,f=this,k=c.style,
l={},C=[],O=c.nodeType&&G(c);b.queue||(m=r._queueHooks(c,"fx"),null==m.unqueued&&(m.unqueued=0,g=m.empty.fire,m.empty.fire=function(){m.unqueued||g()}),m.unqueued++,f.always(function(){f.always(function(){m.unqueued--;r.queue(c,"fx").length||m.empty.fire()})}));1===c.nodeType&&("height"in a||"width"in a)&&(b.overflow=[k.overflow,k.overflowX,k.overflowY],"inline"===r.css(c,"display")&&"none"===r.css(c,"float")&&(r.support.inlineBlockNeedsLayout&&"inline"!==u(c.nodeName)?k.zoom=1:k.display="inline-block"));
b.overflow&&(k.overflow="hidden",r.support.shrinkWrapBlocks||f.always(function(){k.overflow=b.overflow[0];k.overflowX=b.overflow[1];k.overflowY=b.overflow[2]}));for(d in a)h=a[d],Pb.exec(h)&&(delete a[d],e=e||"toggle"===h,h!==(O?"hide":"show")&&C.push(d));if(a=C.length)for(h=r._data(c,"fxshow")||r._data(c,"fxshow",{}),("hidden"in h)&&(O=h.hidden),e&&(h.hidden=!O),O?r(c).show():f.done(function(){r(c).hide()}),f.done(function(){var a;r._removeData(c,"fxshow");for(a in l)r.style(c,a,l[a])}),d=0;d<a;d++)e=
C[d],n=f.createTween(e,O?h[e]:0),l[e]=h[e]||r.style(c,e),e in h||(h[e]=n.start,O&&(n.end=n.start,n.start="width"===e||"height"===e?1:0))}],Za={"*":[function(c,a){var b,e,d=this.createTween(c,a),h=xc.exec(a),n=d.cur(),m=+n||0,g=1,f=20;if(h){b=+h[2];e=h[3]||(r.cssNumber[c]?"":"px");if("px"!==e&&m){m=r.css(d.elem,c,!0)||b||1;do g=g||".5",m/=g,r.style(d.elem,c,m+e);while(g!==(g=d.cur()/n)&&1!==g&&--f)}d.unit=e;d.start=m;d.end=h[1]?m+(h[1]+1)*b:b}return d}]};r.Animation=r.extend(R,{tweener:function(c,
a){r.isFunction(c)?(a=c,c=["*"]):c=c.split(" ");for(var b,e=0,d=c.length;e<d;e++)b=c[e],Za[b]=Za[b]||[],Za[b].unshift(a)},prefilter:function(c,a){a?yb.unshift(c):yb.push(c)}});r.Tween=O;O.prototype={constructor:O,init:function(c,a,b,e,d,h){this.elem=c;this.prop=b;this.easing=d||"swing";this.options=a;this.start=this.now=this.cur();this.end=e;this.unit=h||(r.cssNumber[b]?"":"px")},cur:function(){var c=O.propHooks[this.prop];return c&&c.get?c.get(this):O.propHooks._default.get(this)},run:function(c){var a,
b=O.propHooks[this.prop];this.pos=this.options.duration?a=r.easing[this.easing](c,this.options.duration*c,0,1,this.options.duration):a=c;this.now=(this.end-this.start)*a+this.start;this.options.step&&this.options.step.call(this.elem,this.now,this);b&&b.set?b.set(this):O.propHooks._default.set(this);return this}};O.prototype.init.prototype=O.prototype;O.propHooks={_default:{get:function(c){return null==c.elem[c.prop]||c.elem.style&&null!=c.elem.style[c.prop]?(c=r.css(c.elem,c.prop,""))&&"auto"!==c?
c:0:c.elem[c.prop]},set:function(c){if(r.fx.step[c.prop])r.fx.step[c.prop](c);else c.elem.style&&(null!=c.elem.style[r.cssProps[c.prop]]||r.cssHooks[c.prop])?r.style(c.elem,c.prop,c.now+c.unit):c.elem[c.prop]=c.now}}};O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(c){c.elem.nodeType&&c.elem.parentNode&&(c.elem[c.prop]=c.now)}};r.each(["toggle","show","hide"],function(c,a){var b=r.fn[a];r.fn[a]=function(c,e,d){return null==c||"boolean"===typeof c?b.apply(this,arguments):this.animate(Q(a,
!0),c,e,d)}});r.fn.extend({fadeTo:function(c,a,b,e){return this.filter(G).css("opacity",0).show().end().animate({opacity:a},c,b,e)},animate:function(c,a,b,e){var d=r.isEmptyObject(c),h=r.speed(a,b,e),n=function(){var a=R(this,r.extend({},c),h);n.finish=function(){a.stop(!0)};(d||r._data(this,"finish"))&&a.stop(!0)};n.finish=n;return d||!1===h.queue?this.each(n):this.queue(h.queue,n)},stop:function(c,b,e){var d=function(c){var a=c.stop;delete c.stop;a(e)};"string"!==typeof c&&(e=b,b=c,c=a);b&&!1!==
c&&this.queue(c||"fx",[]);return this.each(function(){var a=!0,b=null!=c&&c+"queueHooks",h=r.timers,n=r._data(this);if(b)n[b]&&n[b].stop&&d(n[b]);else for(b in n)n[b]&&n[b].stop&&Pc.test(b)&&d(n[b]);for(b=h.length;b--;)h[b].elem!==this||null!=c&&h[b].queue!==c||(h[b].anim.stop(e),a=!1,h.splice(b,1));!a&&e||r.dequeue(this,c)})},finish:function(c){!1!==c&&(c=c||"fx");return this.each(function(){var a,b=r._data(this),e=b[c+"queue"];a=b[c+"queueHooks"];var d=r.timers,h=e?e.length:0;b.finish=!0;r.queue(this,
c,[]);a&&a.cur&&a.cur.finish&&a.cur.finish.call(this);for(a=d.length;a--;)d[a].elem===this&&d[a].queue===c&&(d[a].anim.stop(!0),d.splice(a,1));for(a=0;a<h;a++)e[a]&&e[a].finish&&e[a].finish.call(this);delete b.finish})}});r.each({slideDown:Q("show"),slideUp:Q("hide"),slideToggle:Q("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(c,a){r.fn[c]=function(c,b,e){return this.animate(a,c,b,e)}});r.speed=function(c,a,b){var e=c&&"object"===typeof c?r.extend({},
c):{complete:b||!b&&a||r.isFunction(c)&&c,duration:c,easing:b&&a||a&&!r.isFunction(a)&&a};e.duration=r.fx.off?0:"number"===typeof e.duration?e.duration:e.duration in r.fx.speeds?r.fx.speeds[e.duration]:r.fx.speeds._default;if(null==e.queue||!0===e.queue)e.queue="fx";e.old=e.complete;e.complete=function(){r.isFunction(e.old)&&e.old.call(this);e.queue&&r.dequeue(this,e.queue)};return e};r.easing={linear:function(c){return c},swing:function(c){return.5-Math.cos(c*Math.PI)/2}};r.timers=[];r.fx=O.prototype.init;
r.fx.tick=function(){var c,b=r.timers,e=0;for(ib=r.now();e<b.length;e++)c=b[e],c()||b[e]!==c||b.splice(e--,1);b.length||r.fx.stop();ib=a};r.fx.timer=function(c){c()&&r.timers.push(c)&&r.fx.start()};r.fx.interval=13;r.fx.start=function(){Ob||(Ob=setInterval(r.fx.tick,r.fx.interval))};r.fx.stop=function(){clearInterval(Ob);Ob=null};r.fx.speeds={slow:600,fast:200,_default:400};r.fx.step={};r.expr&&r.expr.filters&&(r.expr.filters.animated=function(c){return r.grep(r.timers,function(a){return c===a.elem}).length});
r.fn.offset=function(c){if(arguments.length)return c===a?this:this.each(function(a){r.offset.setOffset(this,c,a)});var b,e,d={top:0,left:0},h=(e=this[0])&&e.ownerDocument;if(h){b=h.documentElement;if(!r.contains(b,e))return d;typeof e.getBoundingClientRect!==ea&&(d=e.getBoundingClientRect());e=U(h);return{top:d.top+(e.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(e.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}}};r.offset={setOffset:function(c,a,b){var e=r.css(c,"position");"static"===e&&
(c.style.position="relative");var d=r(c),h=d.offset(),n=r.css(c,"top"),m=r.css(c,"left"),g={},f={};("absolute"===e||"fixed"===e)&&-1<r.inArray("auto",[n,m])?(f=d.position(),e=f.top,m=f.left):(e=parseFloat(n)||0,m=parseFloat(m)||0);r.isFunction(a)&&(a=a.call(c,b,h));null!=a.top&&(g.top=a.top-h.top+e);null!=a.left&&(g.left=a.left-h.left+m);"using"in a?a.using.call(c,g):d.css(g)}};r.fn.extend({position:function(){if(this[0]){var c,a,b={top:0,left:0},e=this[0];"fixed"===r.css(e,"position")?a=e.getBoundingClientRect():
(c=this.offsetParent(),a=this.offset(),r.nodeName(c[0],"html")||(b=c.offset()),b.top+=r.css(c[0],"borderTopWidth",!0),b.left+=r.css(c[0],"borderLeftWidth",!0));return{top:a.top-b.top-r.css(e,"marginTop",!0),left:a.left-b.left-r.css(e,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var c=this.offsetParent||S.documentElement;c&&!r.nodeName(c,"html")&&"static"===r.css(c,"position");)c=c.offsetParent;return c||S.documentElement})}});r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},
function(c,b){var e=/Y/.test(b);r.fn[c]=function(d){return r.access(this,function(c,d,h){var n=U(c);if(h===a)return n?b in n?n[b]:n.document.documentElement[d]:c[d];n?n.scrollTo(e?r(n).scrollLeft():h,e?h:r(n).scrollTop()):c[d]=h},c,d,arguments.length,null)}});r.each({Height:"height",Width:"width"},function(c,b){r.each({padding:"inner"+c,content:b,"":"outer"+c},function(e,d){r.fn[d]=function(d,h){var n=arguments.length&&(e||"boolean"!==typeof d),m=e||(!0===d||!0===h?"margin":"border");return r.access(this,
function(b,e,d){return r.isWindow(b)?b.document.documentElement["client"+c]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+c],e["scroll"+c],b.body["offset"+c],e["offset"+c],e["client"+c])):d===a?r.css(b,e,m):r.style(b,e,d,m)},b,n?d:a,n,null)}})});c.jQuery=c.$=r;"function"===typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return r})})(window);
(function(c){"object"===typeof exports&&"undefined"!==typeof module?module.exports=c():"function"===typeof define&&define.amd?define([],c):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).daikon=c()})(function(){return function a(d,f,b){function e(g,l){if(!f[g]){if(!d[g]){var q="function"==typeof require&&require;if(!l&&q)return q(g,!0);if(h)return h(g,!0);q=Error("Cannot find module '"+g+"'");throw q.code="MODULE_NOT_FOUND",q;}q=f[g]={exports:{}};
d[g][0].call(q.exports,function(a){var b=d[g][1][a];return e(b?b:a)},q,q.exports,a,d,f,b)}return f[g].exports}for(var h="function"==typeof require&&require,g=0;g<b.length;g++)e(b[g]);return e}({1:[function(a,d,f){var b={Unkown:0,Grayscale:1,AdobeRGB:2,RGB:3,CYMK:4};a=function(){function a(){}function d(a,b){for(var e=0,h=[],g,f,k=16;0<k&&!a[k-1];)k--;h.push({children:[],index:0});var l=h[0],q;for(g=0;g<k;g++){for(f=0;f<a[g];f++){l=h.pop();for(l.children[l.index]=b[e];0<l.index;)l=h.pop();l.index++;
for(h.push(l);h.length<=g;)h.push(q={children:[],index:0}),l.children[l.index]=q.children,l=q;e++}g+1<k&&(h.push(q={children:[],index:0}),l.children[l.index]=q.children,l=q)}return h[0].children}function g(a,b,e,d,h,g,f,k,l){function n(){if(0<C)return C--,v>>C&1;v=a[b++];if(255==v){var e=a[b++];if(e)throw"unexpected marker: "+(v<<8|e).toString(16);}C=7;return v>>>7}function G(a){for(var b;null!==(b=n());){a=a[b];if("number"===typeof a)return a;if("object"!==typeof a)throw"invalid huffman sequence";
}return null}function K(a){for(var b=0;0<a;){var e=n();if(null===e)return;b=b<<1|e;a--}return b}function E(a){var b=K(a);return b>=1<<a-1?b:b+(-1<<a)+1}function w(a,b){var e=G(a.huffmanTableDC),e=0===e?0:E(e);a.blockData[b]=a.pred+=e;for(e=1;64>e;){var d=G(a.huffmanTableAC),h=d&15,d=d>>4;if(0===h){if(15>d)break;e+=16}else e+=d,a.blockData[b+q[e]]=E(h),e++}}function D(a,b){var e=G(a.huffmanTableDC),e=0===e?0:E(e)<<l;a.blockData[b]=a.pred+=e}function u(a,b){a.blockData[b]|=n()<<l}function m(a,b){if(0<
P)P--;else for(var e=g;e<=f;){var d=G(a.huffmanTableAC),h=d&15,d=d>>4;if(0===h){if(15>d){P=K(d)+(1<<d)-1;break}e+=16}else e+=d,a.blockData[b+q[e]]=E(h)*(1<<l),e++}}function p(a,b){for(var e=g,d=0;e<=f;){var h=q[e];switch(M){case 0:d=G(a.huffmanTableAC);h=d&15;d>>=4;if(0===h)15>d?(P=K(d)+(1<<d),M=4):(d=16,M=1);else{if(1!==h)throw"invalid ACn encoding";R=E(h);M=d?2:3}continue;case 1:case 2:a.blockData[b+h]?a.blockData[b+h]+=n()<<l:(d--,0===d&&(M=2==M?3:0));break;case 3:a.blockData[b+h]?a.blockData[b+
h]+=n()<<l:(a.blockData[b+h]=R<<l,M=0);break;case 4:a.blockData[b+h]&&(a.blockData[b+h]+=n()<<l)}e++}4===M&&(P--,0===P&&(M=0))}var J=e.mcusPerLine,H=b,v=0,C=0,P=0,M=0,R,T=d.length,O,Q,U,ua,N;k=e.progressive?0===g?0===k?D:u:0===k?m:p:w;var ea=0;e=1==T?d[0].blocksPerLine*d[0].blocksPerColumn:J*e.mcusPerColumn;h||(h=e);for(var S,W;ea<e;){for(Q=0;Q<T;Q++)d[Q].pred=0;P=0;if(1==T)for(O=d[0],N=0;N<h;N++)k(O,64*((O.blocksPerLine+1)*(ea/O.blocksPerLine|0)+ea%O.blocksPerLine)),ea++;else for(N=0;N<h;N++){for(Q=
0;Q<T;Q++)for(O=d[Q],S=O.h,W=O.v,U=0;U<W;U++)for(ua=0;ua<S;ua++)k(O,64*((O.blocksPerLine+1)*((ea/J|0)*O.v+U)+(ea%J*O.h+ua)));ea++}C=0;O=a[b]<<8|a[b+1];if(65280>=O)throw"marker was not found";if(65488<=O&&65495>=O)b+=2;else break}return b-H}function f(a,b){for(var e=b.blocksPerLine,d=b.blocksPerColumn,h=new Int32Array(64),g=0;g<d;g++)for(var k=0;k<e;k++){for(var l=b,q=64*((b.blocksPerLine+1)*g+k),n=h,G=l.quantizationTable,K=void 0,E=void 0,w=void 0,D=void 0,u=void 0,m=void 0,p=void 0,J=void 0,H=void 0,
v=void 0,v=0;64>v;v++)n[v]=l.blockData[q+v]*G[v];for(v=0;8>v;++v)G=8*v,0===n[1+G]&&0===n[2+G]&&0===n[3+G]&&0===n[4+G]&&0===n[5+G]&&0===n[6+G]&&0===n[7+G]?(H=5793*n[0+G]+512>>10,n[0+G]=H,n[1+G]=H,n[2+G]=H,n[3+G]=H,n[4+G]=H,n[5+G]=H,n[6+G]=H,n[7+G]=H):(K=5793*n[0+G]+128>>8,E=5793*n[4+G]+128>>8,w=n[2+G],D=n[6+G],u=2896*(n[1+G]-n[7+G])+128>>8,J=2896*(n[1+G]+n[7+G])+128>>8,m=n[3+G]<<4,p=n[5+G]<<4,H=K-E+1>>1,K=K+E+1>>1,E=H,H=3784*w+1567*D+128>>8,w=1567*w-3784*D+128>>8,D=H,H=u-p+1>>1,u=u+p+1>>1,p=H,H=J+
m+1>>1,m=J-m+1>>1,J=H,H=K-D+1>>1,K=K+D+1>>1,D=H,H=E-w+1>>1,E=E+w+1>>1,w=H,H=2276*u+3406*J+2048>>12,u=3406*u-2276*J+2048>>12,J=H,H=799*m+4017*p+2048>>12,m=4017*m-799*p+2048>>12,p=H,n[0+G]=K+J,n[7+G]=K-J,n[1+G]=E+p,n[6+G]=E-p,n[2+G]=w+m,n[5+G]=w-m,n[3+G]=D+u,n[4+G]=D-u);for(v=0;8>v;++v)G=v,0===n[8+G]&&0===n[16+G]&&0===n[24+G]&&0===n[32+G]&&0===n[40+G]&&0===n[48+G]&&0===n[56+G]?(H=5793*n[v+0]+8192>>14,n[0+G]=H,n[8+G]=H,n[16+G]=H,n[24+G]=H,n[32+G]=H,n[40+G]=H,n[48+G]=H,n[56+G]=H):(K=5793*n[0+G]+2048>>
12,E=5793*n[32+G]+2048>>12,w=n[16+G],D=n[48+G],u=2896*(n[8+G]-n[56+G])+2048>>12,J=2896*(n[8+G]+n[56+G])+2048>>12,m=n[24+G],p=n[40+G],H=K-E+1>>1,K=K+E+1>>1,E=H,H=3784*w+1567*D+2048>>12,w=1567*w-3784*D+2048>>12,D=H,H=u-p+1>>1,u=u+p+1>>1,p=H,H=J+m+1>>1,m=J-m+1>>1,J=H,H=K-D+1>>1,K=K+D+1>>1,D=H,H=E-w+1>>1,E=E+w+1>>1,w=H,H=2276*u+3406*J+2048>>12,u=3406*u-2276*J+2048>>12,J=H,H=799*m+4017*p+2048>>12,m=4017*m-799*p+2048>>12,p=H,n[0+G]=K+J,n[56+G]=K-J,n[8+G]=E+p,n[48+G]=E-p,n[16+G]=w+m,n[40+G]=w-m,n[24+G]=
D+u,n[32+G]=D-u);for(v=0;64>v;++v)K=q+v,E=n[v],E=E<=-2056/l.bitConversion?0:E>=2024/l.bitConversion?255/l.bitConversion:E+2056/l.bitConversion>>4,l.blockData[K]=E}return b.blockData}function l(a){return 0>=a?0:255<=a?255:a|0}var q=new Int32Array([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={load:function(a){var b=function(a){this.parse(a);if(this.onload)this.onload()}.bind(this);
if(-1<a.indexOf("data:")){var e=a.indexOf("base64,")+7;a=atob(a.substring(e));for(var e=new Uint8Array(a.length),d=a.length-1;0<=d;d--)e[d]=a.charCodeAt(d);b(a)}else{var h=new XMLHttpRequest;h.open("GET",a,!0);h.responseType="arraybuffer";h.onload=function(){var a=new Uint8Array(h.response);b(a)}.bind(this);h.send(null)}},parse:function(a){function e(){var b=a[x]<<8|a[x+1];x+=2;return b}function l(){var b=e(),b=a.subarray(x,x+b-2);x+=b.length;return b}function A(a){for(var b=Math.ceil(a.samplesPerLine/
8/a.maxH),e=Math.ceil(a.scanLines/8/a.maxV),d=0;d<a.components.length;d++){v=a.components[d];var h=Math.ceil(Math.ceil(a.samplesPerLine/8)*v.h/a.maxH),n=Math.ceil(Math.ceil(a.scanLines/8)*v.v/a.maxV);v.blockData=new Int16Array(64*e*v.v*(b*v.h+1));v.blocksPerLine=h;v.blocksPerColumn=n}a.mcusPerLine=b;a.mcusPerColumn=e}var x=0,I=null,F=null,z,L,n=[],G=[],K=[],E=e();if(65496!=E)throw"SOI not found";for(E=e();65497!=E;){var w,D;switch(E){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:w=
l();65504===E&&74===w[0]&&70===w[1]&&73===w[2]&&70===w[3]&&0===w[4]&&(I={version:{major:w[5],minor:w[6]},densityUnits:w[7],xDensity:w[8]<<8|w[9],yDensity:w[10]<<8|w[11],thumbWidth:w[12],thumbHeight:w[13],thumbData:w.subarray(14,14+3*w[12]*w[13])});65518===E&&65===w[0]&&100===w[1]&&111===w[2]&&98===w[3]&&101===w[4]&&0===w[5]&&(F={version:w[6],flags0:w[7]<<8|w[8],flags1:w[9]<<8|w[10],transformCode:w[11]});break;case 65499:for(E=e()+x-2;x<E;){var u=a[x++],m=new Int32Array(64);if(0===u>>4)for(w=0;64>
w;w++)m[q[w]]=a[x++];else if(1===u>>4)for(w=0;64>w;w++)m[q[w]]=e();else throw"DQT: invalid table spec";n[u&15]=m}break;case 65472:case 65473:case 65474:if(z)throw"Only single frame JPEGs supported";e();z={};z.extended=65473===E;z.progressive=65474===E;z.precision=a[x++];z.scanLines=e();z.samplesPerLine=e();z.components=[];z.componentIds={};w=a[x++];for(var p=m=0,E=0;E<w;E++){u=a[x];D=a[x+1]>>4;var J=a[x+1]&15;m<D&&(m=D);p<J&&(p=J);var H=a[x+2];D=z.components.push({h:D,v:J,quantizationTable:n[H],quantizationTableId:H,
bitConversion:255/((1<<z.precision)-1)});z.componentIds[u]=D-1;x+=3}z.maxH=m;z.maxV=p;A(z);break;case 65476:u=e();for(E=2;E<u;){m=a[x++];p=new Uint8Array(16);for(w=D=0;16>w;w++,x++)D+=p[w]=a[x];J=new Uint8Array(D);for(w=0;w<D;w++,x++)J[w]=a[x];E+=17+D;(0===m>>4?K:G)[m&15]=d(p,J)}break;case 65501:e();L=e();break;case 65498:e();u=a[x++];w=[];for(var v,E=0;E<u;E++)m=z.componentIds[a[x++]],v=z.components[m],m=a[x++],v.huffmanTableDC=K[m>>4],v.huffmanTableAC=G[m&15],w.push(v);E=a[x++];u=a[x++];m=a[x++];
E=g(a,x,z,w,L,E,u,m>>4,m&15);x+=E;break;default:if(255==a[x-3]&&192<=a[x-2]&&254>=a[x-2]){x-=3;break}throw"unknown JPEG marker "+E.toString(16);}E=e()}this.width=z.samplesPerLine;this.height=z.scanLines;this.jfif=I;this.adobe=F;this.components=[];switch(z.components.length){case 1:this.colorspace=b.Grayscale;break;case 3:this.colorspace=this.adobe?b.AdobeRGB:b.RGB;break;case 4:this.colorspace=b.CYMK;break;default:this.colorspace=b.Unknown}for(E=0;E<z.components.length;E++)v=z.components[E],v.quantizationTable||
null===v.quantizationTableId||(v.quantizationTable=n[v.quantizationTableId]),this.components.push({output:f(z,v),scaleX:v.h/z.maxH,scaleY:v.v/z.maxV,blocksPerLine:v.blocksPerLine,blocksPerColumn:v.blocksPerColumn,bitConversion:v.bitConversion})},getData16:function(a,b){if(1!==this.components.length)throw"Unsupported color mode";var e=this.width/a,d=this.height/b,h,g,f,k,l,n=0,q=this.components.length,K=new Uint16Array(a*b*q),E=new Uint16Array((this.components[0].blocksPerLine<<3)*this.components[0].blocksPerColumn*
8);for(l=0;l<q;l++){h=this.components[l];g=h.blocksPerLine;f=h.blocksPerColumn;for(var w=g<<3,D,u=0,m=0;m<f;m++)for(var p=m<<3,J=0;J<g;J++){var H=64*((h.blocksPerLine+1)*m+J),n=0,v=J<<3;for(k=0;8>k;k++)for(u=(p+k)*w,D=0;8>D;D++)E[u+v+D]=h.output[H+n++]}g=h.scaleX*e;h=h.scaleY*d;n=l;for(k=0;k<b;k++)for(f=0;f<a;f++)u=0|k*h,D=0|f*g,D=u*w+D,K[n]=E[D],n+=q}return K},getData:function(a,b){var e=this.width/a,d=this.height/b,h,g,f,k,q,n=0,G,K=this.components.length,E=a*b*K,w=new Uint8Array(E);G=new Uint8Array((this.components[0].blocksPerLine<<
3)*this.components[0].blocksPerColumn*8);for(q=0;q<K;q++){h=this.components[q];g=h.blocksPerLine;f=h.blocksPerColumn;for(var D=g<<3,u,m=0,p=0;p<f;p++)for(var J=p<<3,H=0;H<g;H++){var v=64*((h.blocksPerLine+1)*p+H),n=0,C=H<<3;for(k=0;8>k;k++)for(m=(J+k)*D,u=0;8>u;u++)G[m+C+u]=h.output[v+n++]*h.bitConversion}g=h.scaleX*e;h=h.scaleY*d;n=q;for(k=0;k<b;k++)for(f=0;f<a;f++)m=0|k*h,u=0|f*g,u=m*D+u,w[n]=G[u],n+=K}switch(K){case 1:case 2:break;case 3:q=!0;this.adobe&&this.adobe.transformCode?q=!0:"undefined"!==
typeof this.colorTransform&&(q=!!this.colorTransform);if(q)for(q=0;q<E;q+=K)e=w[q],d=w[q+1],G=w[q+2],n=l(e-179.456+1.402*G),G=l(e+135.459-.344*d-.714*G),e=l(e-226.816+1.772*d),w[q]=n,w[q+1]=G,w[q+2]=e;break;case 4:if(!this.adobe)throw"Unsupported color mode (4 components)";q=!1;this.adobe&&this.adobe.transformCode?q=!0:"undefined"!==typeof this.colorTransform&&(q=!!this.colorTransform);if(q)for(q=0;q<E;q+=K)e=w[q],d=w[q+1],G=w[q+2],n=l(434.456-e-1.402*G),G=l(119.541-e+.344*d+.714*G),e=l(481.816-e-
1.772*d),w[q]=n,w[q+1]=G,w[q+2]=e;break;default:throw"Unsupported color mode";}return w},copyToImageData:function(a){var b=a.width,e=a.height,d=b*e*4;a=a.data;var b=this.getData16(b,e),h=e=0,g,f,k,q,n;switch(this.components.length){case 1:for(;h<d;)k=b[e++],a[h++]=k,a[h++]=k,a[h++]=k,a[h++]=255;break;case 3:for(;h<d;)q=b[e++],n=b[e++],k=b[e++],a[h++]=q,a[h++]=n,a[h++]=k,a[h++]=255;break;case 4:for(;h<d;)q=b[e++],n=b[e++],k=b[e++],g=b[e++],g=255-g,f=g/255,q=l(g-q*f),n=l(g-n*f),k=l(g-k*f),a[h++]=q,
a[h++]=n,a[h++]=k,a[h++]=255;break;default:throw"Unsupported color mode";}}};return a}();"undefined"!==typeof d&&d.exports&&(d.exports={JpegImage:a})},{}],2:[function(a,d,f){function b(a){t.verbosity>=t.VERBOSITY_LEVELS.warnings&&console.log("Warning: "+a)}function e(a,b,e){Object.defineProperty(a,b,{value:e,enumerable:!0,configurable:!0,writable:!1});return e}function h(a){for(var b=1,e=0;a>b;)b<<=1,e++;return e}function g(a,b){return a[b]<<8|a[b+1]}function k(a,b){return(a[b]<<24|a[b+1]<<16|a[b+
2]<<8|a[b+3])>>>0}a=function(){function a(){this.failOnCorruptedImage=!1}function e(a,b,d){a=d.xcb_;d=d.ycb_;var h=1<<a,n=1<<d,m=b.tbx0>>a,g=b.tby0>>d,f=b.tbx1+h-1>>a,k=b.tby1+n-1>>d,u=b.resolution.precinctParameters,l=[],p=[],z,q,x,t;for(q=g;q<k;q++)for(z=m;z<f;z++)if(x={cbx:z,cby:q,tbx0:h*z,tby0:n*q,tbx1:h*(z+1),tby1:n*(q+1)},x.tbx0_=Math.max(b.tbx0,x.tbx0),x.tby0_=Math.max(b.tby0,x.tby0),x.tbx1_=Math.min(b.tbx1,x.tbx1),x.tby1_=Math.min(b.tby1,x.tby1),t=Math.floor((x.tbx0_-b.tbx0)/u.precinctWidthInSubband)+
Math.floor((x.tby0_-b.tby0)/u.precinctHeightInSubband)*u.numprecinctswide,x.precinctNumber=t,x.subbandType=b.type,x.Lblock=3,!(x.tbx1_<=x.tbx0_||x.tby1_<=x.tby0_)){l.push(x);var A=p[t];void 0!==A?(z<A.cbxMin?A.cbxMin=z:z>A.cbxMax&&(A.cbxMax=z),q<A.cbyMin?A.cbxMin=q:q>A.cbyMax&&(A.cbyMax=q)):p[t]=A={cbxMin:z,cbyMin:q,cbxMax:z,cbyMax:q};x.precinct=A}b.codeblockParameters={codeblockWidth:a,codeblockHeight:d,numcodeblockwide:f-m+1,numcodeblockhigh:k-g+1};b.codeblocks=l;b.precincts=p}function d(a,b,e){var h=
[];a=a.subbands;for(var n=0,m=a.length;n<m;n++)for(var g=a[n].codeblocks,f=0,k=g.length;f<k;f++){var u=g[f];u.precinctNumber===b&&h.push(u)}return{layerNumber:e,codeblocks:h}}function f(a){var b=a.tiles[a.currentTile.index],e=b.codingStyleDefaultParameters.layersCount,h=a.SIZ.Csiz,n=0;for(a=0;a<h;a++)n=Math.max(n,b.components[a].codingStyleParameters.decompositionLevelsCount);var m=0,g=0,k=0,u=0;this.nextPacket=function(){for(;m<e;m++){for(;g<=n;g++){for(;k<h;k++){var a=b.components[k];if(!(g>a.codingStyleParameters.decompositionLevelsCount)){for(var a=
a.resolutions[g],f=a.precinctParameters.numprecincts;u<f;)return a=d(a,u,m),u++,a;u=0}}k=0}g=0}}}function q(a){var b=a.tiles[a.currentTile.index],e=b.codingStyleDefaultParameters.layersCount,h=a.SIZ.Csiz,n=0;for(a=0;a<h;a++)n=Math.max(n,b.components[a].codingStyleParameters.decompositionLevelsCount);var m=0,g=0,f=0,k=0;this.nextPacket=function(){for(;m<=n;m++){for(;g<e;g++){for(;f<h;f++){var a=b.components[f];if(!(m>a.codingStyleParameters.decompositionLevelsCount)){for(var a=a.resolutions[m],u=a.precinctParameters.numprecincts;k<
u;)return a=d(a,k,g),k++,a;k=0}}f=0}g=0}}}function z(a){var b=a.tiles[a.currentTile.index],e=b.codingStyleDefaultParameters.layersCount,h=a.SIZ.Csiz,n,m,g,f,k=0;for(g=0;g<h;g++)k=Math.max(k,b.components[g].codingStyleParameters.decompositionLevelsCount);var u=new Int32Array(k+1);for(m=0;m<=k;++m){for(g=a=0;g<h;++g){var l=b.components[g].resolutions;m<l.length&&(a=Math.max(a,l[m].precinctParameters.numprecincts))}u[m]=a}f=g=m=n=0;this.nextPacket=function(){for(;m<=k;m++){for(;f<u[m];f++){for(;g<h;g++){var a=
b.components[g];if(!(m>a.codingStyleParameters.decompositionLevelsCount||(a=a.resolutions[m],f>=a.precinctParameters.numprecincts))){for(;n<e;)return a=d(a,f,n),n++,a;n=0}}g=0}f=0}}}function y(a){var b=a.tiles[a.currentTile.index],e=b.codingStyleDefaultParameters.layersCount,h=a.SIZ.Csiz,n=K(b),m=0,g=0,f=0,k=0,u=0;this.nextPacket=function(){for(;u<n.maxNumHigh;u++){for(;k<n.maxNumWide;k++){for(;f<h;f++){for(var a=b.components[f],l=a.codingStyleParameters.decompositionLevelsCount;g<=l;g++){var p=a.resolutions[g],
z=G(k,u,n.components[f].resolutions[g],n,p);if(null!==z){for(;m<e;)return a=d(p,z,m),m++,a;m=0}}g=0}f=0}k=0}}}function n(a){var b=a.tiles[a.currentTile.index],e=b.codingStyleDefaultParameters.layersCount,h=a.SIZ.Csiz,n=K(b),m=0,g=0,f=0,k=0,u=0;this.nextPacket=function(){for(;f<h;++f){for(var a=b.components[f],l=n.components[f],p=a.codingStyleParameters.decompositionLevelsCount;u<l.maxNumHigh;u++){for(;k<l.maxNumWide;k++){for(;g<=p;g++){var z=a.resolutions[g],v=G(k,u,l.resolutions[g],l,z);if(null!==
v){for(;m<e;)return a=d(z,v,m),m++,a;m=0}}g=0}k=0}u=0}}}function G(a,b,e,d,h){a*=d.minWidth;b*=d.minHeight;return 0!==a%e.width||0!==b%e.height?null:a/e.height+b/e.width*h.precinctParameters.numprecinctswide}function K(a){for(var b=a.components.length,e=Number.MAX_VALUE,d=Number.MAX_VALUE,h=0,n=0,m=Array(b),g=0;g<b;g++){for(var f=a.components[g],k=f.codingStyleParameters.decompositionLevelsCount,u=Array(k+1),l=Number.MAX_VALUE,p=Number.MAX_VALUE,z=0,q=0,x=1;0<=k;--k){var t=f.resolutions[k],A=x*t.precinctParameters.precinctWidth,
B=x*t.precinctParameters.precinctHeight,l=Math.min(l,A),p=Math.min(p,B),z=Math.max(z,t.precinctParameters.numprecinctswide),q=Math.max(q,t.precinctParameters.numprecinctshigh);u[k]={width:A,height:B};x<<=1}e=Math.min(e,l);d=Math.min(d,p);h=Math.max(h,z);n=Math.max(n,q);m[g]={resolutions:u,minWidth:l,minHeight:p,maxNumWide:z,maxNumHigh:q}}return{components:m,minWidth:e,minHeight:d,maxNumWide:h,maxNumHigh:n}}function E(a,b,e,d){function n(a){for(;l<a;){if(e+f>=b.length)throw Error("Unexpected EOF");
var d=b[e+f];f++;p?(k=k<<7|d,l+=7,p=!1):(k=k<<8|d,l+=8);255===d&&(p=!0)}l-=a;return k>>>l&(1<<a)-1}function g(a){return 255===b[e+f-1]&&b[e+f]===a?(f+=1,!0):255===b[e+f]&&b[e+f+1]===a?(f+=2,!0):!1}function m(){if(0===n(1))return 1;if(0===n(1))return 2;var a=n(2);if(3>a)return a+3;a=n(5);if(31>a)return a+6;a=n(7);return a+37}var f=0,k,l=0,p=!1,z=a.COD.sopMarkerUsed,q=a.COD.ephMarkerUsed;for(a=a.tiles[a.currentTile.index].packetsIterator;f<d;)try{l=0;p&&(f++,p=!1);z&&g(145)&&(f+=4);var x=a.nextPacket();
if(void 0===x)return;if(n(1)){for(var t=x.layerNumber,A=[],B,y=0,J=x.codeblocks.length;y<J;y++){B=x.codeblocks[y];var H=B.precinct,I=B.cbx-H.cbxMin,w=B.cby-H.cbyMin,G=!1,L=!1,E;if(void 0!==B.included)G=!!n(1);else{var H=B.precinct,r,F;if(void 0!==H.inclusionTree)r=H.inclusionTree;else{var K=H.cbxMax-H.cbxMin+1,$a=H.cbyMax-H.cbyMin+1;r=new u(K,$a);F=new D(K,$a);H.inclusionTree=r;H.zeroBitPlanesTree=F}for(r.reset(I,w,t);;){if(f>=b.length)return;if(r.isAboveThreshold())break;if(r.isKnown())r.nextLevel();
else if(n(1))if(r.setKnown(),r.isLeaf()){G=L=B.included=!0;break}else r.nextLevel();else r.incrementValue()}}if(G){if(L){F=H.zeroBitPlanesTree;for(F.reset(I,w);;){if(f>=b.length)return;if(n(1)){if(E=!F.nextLevel())break}else F.incrementValue()}B.zeroBitPlanes=F.value}for(var Ra=m();n(1);)B.Lblock++;var Fa=h(Ra),Tb=n((Ra<1<<Fa?Fa-1:Fa)+B.Lblock);A.push({codeblock:B,codingpasses:Ra,dataLength:Tb})}}l=0;p&&(f++,p=!1);for(q&&g(146);0<A.length;){var Ga=A.shift();B=Ga.codeblock;void 0===B.data&&(B.data=
[]);B.data.push({data:b,start:e+f,end:e+f+Ga.dataLength,codingpasses:Ga.codingpasses});f+=Ga.dataLength}}}catch(Ab){return}return f}var w={LL:0,LH:1,HL:1,HH:2};a.prototype={parse:function(a){if(65359===g(a,0))this.parseCodestream(a,0,a.length);else for(var e=0,d=a.length;e<d;){var h=8,n=k(a,e),m=k(a,e+4),e=e+h;1===n&&(n=4294967296*k(a,e)+k(a,e+4),e+=8,h+=8);0===n&&(n=d-e+h);if(n<h)throw Error("JPX Error: Invalid box field size");h=n-h;n=!0;switch(m){case 1785737832:n=!1;break;case 1668246642:m=a[e];
if(1===m)switch(m=k(a,e+3),m){case 16:case 17:case 18:break;default:b("Unknown colorspace "+m)}else 2===m&&t.verbosity>=t.VERBOSITY_LEVELS.infos&&console.log("Info: ICC profile not supported");break;case 1785737827:this.parseCodestream(a,e,e+h);break;case 1783636E3:218793738!==k(a,e)&&b("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var f=String.fromCharCode(m>>24&255,m>>16&255,m>>8&255,m&255);b("Unsupported header type "+
m+" ("+f+")")}n&&(e+=h)}},parseImageProperties:function(a){for(var b=a.getByte();0<=b;){var e=b,b=a.getByte();if(65361===(e<<8|b)){a.skip(4);var b=a.getInt32()>>>0,e=a.getInt32()>>>0,d=a.getInt32()>>>0,h=a.getInt32()>>>0;a.skip(16);a=a.getUint16();this.width=b-d;this.height=e-h;this.componentsCount=a;this.bitsPerComponent=8;return}}throw Error("JPX Error: No size marker found in JPX stream");},parseCodestream:function(a,d,h){var u={};try{for(var p=!1,x=d;x+1<h;){var O=g(a,x),x=x+2,t=0,B,D,G,K,S,W;
switch(O){case 65359:u.mainHeader=!0;break;case 65497:break;case 65361:var t=g(a,x),qa={};qa.Xsiz=k(a,x+4);qa.Ysiz=k(a,x+8);qa.XOsiz=k(a,x+12);qa.YOsiz=k(a,x+16);qa.XTsiz=k(a,x+20);qa.YTsiz=k(a,x+24);qa.XTOsiz=k(a,x+28);qa.YTOsiz=k(a,x+32);var za=g(a,x+36);qa.Csiz=za;var Pa=[];B=x+38;for(var ma=0;ma<za;ma++){var Aa={precision:(a[B]&127)+1,isSigned:!!(a[B]&128),XRsiz:a[B+1],YRsiz:a[B+1]},ga=Aa,na=qa;ga.x0=Math.ceil(na.XOsiz/ga.XRsiz);ga.x1=Math.ceil(na.Xsiz/ga.XRsiz);ga.y0=Math.ceil(na.YOsiz/ga.YRsiz);
ga.y1=Math.ceil(na.Ysiz/ga.YRsiz);ga.width=ga.x1-ga.x0;ga.height=ga.y1-ga.y0;Pa.push(Aa)}u.SIZ=qa;u.components=Pa;for(var Qa=u,Sb=Pa,Z=Qa.SIZ,da=void 0,r=[],zb=Math.ceil((Z.Xsiz-Z.XTOsiz)/Z.XTsiz),ia=Math.ceil((Z.Ysiz-Z.YTOsiz)/Z.YTsiz),$a=0;$a<ia;$a++)for(var Ra=0;Ra<zb;Ra++)da={},da.tx0=Math.max(Z.XTOsiz+Ra*Z.XTsiz,Z.XOsiz),da.ty0=Math.max(Z.YTOsiz+$a*Z.YTsiz,Z.YOsiz),da.tx1=Math.min(Z.XTOsiz+(Ra+1)*Z.XTsiz,Z.Xsiz),da.ty1=Math.min(Z.YTOsiz+($a+1)*Z.YTsiz,Z.Ysiz),da.width=da.tx1-da.tx0,da.height=
da.ty1-da.ty0,da.components=[],r.push(da);Qa.tiles=r;for(var Fa=0,Tb=Z.Csiz;Fa<Tb;Fa++)for(var Ga=Sb[Fa],Ab=0,Ub=r.length;Ab<Ub;Ab++){var ra={},da=r[Ab];ra.tcx0=Math.ceil(da.tx0/Ga.XRsiz);ra.tcy0=Math.ceil(da.ty0/Ga.YRsiz);ra.tcx1=Math.ceil(da.tx1/Ga.XRsiz);ra.tcy1=Math.ceil(da.ty1/Ga.YRsiz);ra.width=ra.tcx1-ra.tcx0;ra.height=ra.tcy1-ra.tcy0;da.components[Fa]=ra}u.QCC=[];u.COC=[];break;case 65372:var t=g(a,x),jb={};B=x+2;D=a[B++];switch(D&31){case 0:K=8;S=!0;break;case 1:K=16;S=!1;break;case 2:K=
16;S=!0;break;default:throw Error("JPX Error: Invalid SQcd value "+D);}jb.noQuantization=8===K;jb.scalarExpounded=S;jb.guardBits=D>>5;for(G=[];B<t+x;){var xa={};8===K?(xa.epsilon=a[B++]>>3,xa.mu=0):(xa.epsilon=a[B]>>3,xa.mu=(a[B]&7)<<8|a[B+1],B+=2);G.push(xa)}jb.SPqcds=G;u.mainHeader?u.QCD=jb:(u.currentTile.QCD=jb,u.currentTile.QCC=[]);break;case 65373:var t=g(a,x),ka={};B=x+2;var pb;257>u.SIZ.Csiz?pb=a[B++]:(pb=g(a,B),B+=2);D=a[B++];switch(D&31){case 0:K=8;S=!0;break;case 1:K=16;S=!1;break;case 2:K=
16;S=!0;break;default:throw Error("JPX Error: Invalid SQcd value "+D);}ka.noQuantization=8===K;ka.scalarExpounded=S;ka.guardBits=D>>5;for(G=[];B<t+x;)xa={},8===K?(xa.epsilon=a[B++]>>3,xa.mu=0):(xa.epsilon=a[B]>>3,xa.mu=(a[B]&7)<<8|a[B+1],B+=2),G.push(xa);ka.SPqcds=G;u.mainHeader?u.QCC[pb]=ka:u.currentTile.QCC[pb]=ka;break;case 65362:var t=g(a,x),Y={};B=x+2;var Qb=a[B++];Y.entropyCoderWithCustomPrecincts=!!(Qb&1);Y.sopMarkerUsed=!!(Qb&2);Y.ephMarkerUsed=!!(Qb&4);Y.progressionOrder=a[B++];Y.layersCount=
g(a,B);B+=2;Y.multipleComponentTransform=a[B++];Y.decompositionLevelsCount=a[B++];Y.xcb=(a[B++]&15)+2;Y.ycb=(a[B++]&15)+2;var gb=a[B++];Y.selectiveArithmeticCodingBypass=!!(gb&1);Y.resetContextProbabilities=!!(gb&2);Y.terminationOnEachCodingPass=!!(gb&4);Y.verticalyStripe=!!(gb&8);Y.predictableTermination=!!(gb&16);Y.segmentationSymbolUsed=!!(gb&32);Y.reversibleTransformation=a[B++];if(Y.entropyCoderWithCustomPrecincts){for(var ab=[];B<t+x;){var Vb=a[B++];ab.push({PPx:Vb&15,PPy:Vb>>4})}Y.precinctsSizes=
ab}var Ha=[];Y.selectiveArithmeticCodingBypass&&Ha.push("selectiveArithmeticCodingBypass");Y.resetContextProbabilities&&Ha.push("resetContextProbabilities");Y.terminationOnEachCodingPass&&Ha.push("terminationOnEachCodingPass");Y.verticalyStripe&&Ha.push("verticalyStripe");Y.predictableTermination&&Ha.push("predictableTermination");if(0<Ha.length)throw p=!0,Error("JPX Error: Unsupported COD options ("+Ha.join(", ")+")");u.mainHeader?u.COD=Y:(u.currentTile.COD=Y,u.currentTile.COC=[]);break;case 65424:t=
g(a,x);W={};W.index=g(a,x+2);W.length=k(a,x+4);W.dataEnd=W.length+x-2;W.partIndex=a[x+8];W.partsCount=a[x+9];u.mainHeader=!1;0===W.partIndex&&(W.COD=u.COD,W.COC=u.COC.slice(0),W.QCD=u.QCD,W.QCC=u.QCC.slice(0));u.currentTile=W;break;case 65427:W=u.currentTile;if(0===W.partIndex){for(var Ia=u,Cc=Ia.SIZ.Csiz,oc=Ia.tiles[W.index],Ta=0;Ta<Cc;Ta++){var Cb=oc.components[Ta];Cb.quantizationParameters=void 0!==Ia.currentTile.QCC[Ta]?Ia.currentTile.QCC[Ta]:Ia.currentTile.QCD;Cb.codingStyleParameters=void 0!==
Ia.currentTile.COC[Ta]?Ia.currentTile.COC[Ta]:Ia.currentTile.COD}oc.codingStyleDefaultParameters=Ia.currentTile.COD;for(var ha=u,Ja=ha.tiles[ha.currentTile.index],Wb=ha.SIZ.Csiz,Xb=0;Xb<Wb;Xb++){for(var X=Ja.components[Xb],Db=X.codingStyleParameters.decompositionLevelsCount,Yb=[],rb=[],bb=0;bb<=Db;bb++){var Ea,sb=bb,cb=X.codingStyleParameters,pa={};cb.entropyCoderWithCustomPrecincts?(pa.PPx=cb.precinctsSizes[sb].PPx,pa.PPy=cb.precinctsSizes[sb].PPy):(pa.PPx=15,pa.PPy=15);pa.xcb_=0<sb?Math.min(cb.xcb,
pa.PPx-1):Math.min(cb.xcb,pa.PPx);pa.ycb_=0<sb?Math.min(cb.ycb,pa.PPy-1):Math.min(cb.ycb,pa.PPy);Ea=pa;var la={},Ma=1<<Db-bb;la.trx0=Math.ceil(X.tcx0/Ma);la.try0=Math.ceil(X.tcy0/Ma);la.trx1=Math.ceil(X.tcx1/Ma);la.try1=Math.ceil(X.tcy1/Ma);la.resLevel=bb;var va=la,Jb=1<<Ea.PPx,Kb=1<<Ea.PPy,Zb=0===va.resLevel,Jc=1<<Ea.PPx+(Zb?0:-1),Kc=1<<Ea.PPy+(Zb?0:-1),vb=va.trx1>va.trx0?Math.ceil(va.trx1/Jb)-Math.floor(va.trx0/Jb):0,rc=va.try1>va.try0?Math.ceil(va.try1/Kb)-Math.floor(va.try0/Kb):0;va.precinctParameters=
{precinctWidth:Jb,precinctHeight:Kb,numprecinctswide:vb,numprecinctshigh:rc,numprecincts:vb*rc,precinctWidthInSubband:Jc,precinctHeightInSubband:Kc};Yb.push(la);var V;if(0===bb)V={type:"LL"},V.tbx0=Math.ceil(X.tcx0/Ma),V.tby0=Math.ceil(X.tcy0/Ma),V.tbx1=Math.ceil(X.tcx1/Ma),V.tby1=Math.ceil(X.tcy1/Ma),V.resolution=la,e(ha,V,Ea),rb.push(V),la.subbands=[V];else{var sa=1<<Db-bb+1,Lb=[];V={type:"HL"};V.tbx0=Math.ceil(X.tcx0/sa-.5);V.tby0=Math.ceil(X.tcy0/sa);V.tbx1=Math.ceil(X.tcx1/sa-.5);V.tby1=Math.ceil(X.tcy1/
sa);V.resolution=la;e(ha,V,Ea);rb.push(V);Lb.push(V);V={type:"LH"};V.tbx0=Math.ceil(X.tcx0/sa);V.tby0=Math.ceil(X.tcy0/sa-.5);V.tbx1=Math.ceil(X.tcx1/sa);V.tby1=Math.ceil(X.tcy1/sa-.5);V.resolution=la;e(ha,V,Ea);rb.push(V);Lb.push(V);V={type:"HH"};V.tbx0=Math.ceil(X.tcx0/sa-.5);V.tby0=Math.ceil(X.tcy0/sa-.5);V.tbx1=Math.ceil(X.tcx1/sa-.5);V.tby1=Math.ceil(X.tcy1/sa-.5);V.resolution=la;e(ha,V,Ea);rb.push(V);Lb.push(V);la.subbands=Lb}}X.resolutions=Yb;X.subbands=rb}var fa=Ja.codingStyleDefaultParameters.progressionOrder;
switch(fa){case 0:Ja.packetsIterator=new f(ha);break;case 1:Ja.packetsIterator=new q(ha);break;case 2:Ja.packetsIterator=new z(ha);break;case 3:Ja.packetsIterator=new y(ha);break;case 4:Ja.packetsIterator=new n(ha);break;default:throw Error("JPX Error: Unsupported progression order "+fa);}}t=W.dataEnd-x;E(u,a,x,t);break;case 65365:case 65367:case 65368:case 65380:t=g(a,x);break;case 65363:throw Error("JPX Error: Codestream code 0xFF53 (COC) is not implemented");default:throw Error("JPX Error: Unknown codestream code: "+
O.toString(16));}x+=t}}catch(Mb){if(p||this.failOnCorruptedImage)throw Mb;b("Trying to recover from "+Mb.message)}for(var wa=u.components,ja=u.SIZ.Csiz,Oa=[],tb=0,Lc=u.tiles.length;tb<Lc;tb++){var $b=u.tiles[tb],Wa=[],ca;for(ca=0;ca<ja;ca++){for(var Ac=Wa,wb=ca,db=$b.components[ca],xb=db.codingStyleParameters,ac=db.quantizationParameters,sc=xb.decompositionLevelsCount,ya=ac.SPqcds,mc=ac.scalarExpounded,Mc=ac.guardBits,Bc=xb.segmentationSymbolUsed,tc=u.components[ca].precision,bc=xb.reversibleTransformation,
Nc=bc?new H:new J,Xa=[],Ba=0,eb=0;eb<=sc;eb++){for(var Ya=db.resolutions[eb],cc=Ya.trx1-Ya.trx0,dc=Ya.try1-Ya.try0,uc=new Float32Array(cc*dc),ec=0,Oc=Ya.subbands.length;ec<Oc;ec++){var Nb,ub;mc?(Nb=ya[Ba].mu,ub=ya[Ba].epsilon,Ba++):(Nb=ya[0].mu,ub=ya[0].epsilon+(0<eb?1-eb:0));for(var fc=Ya.subbands[ec],Rb=w[fc.type],vc=bc?1:Math.pow(2,tc+Rb-ub)*(1+Nb/2048),Wc=uc,gc=cc,Ca=fc,ob=vc,fb=Mc+ub-1,wc=bc,hc=Bc,ib=Ca.tbx0,Ob=Ca.tby0,Pb=Ca.tbx1-Ca.tbx0,xc=Ca.codeblocks,Pc="H"===Ca.type.charAt(0)?1:0,yb="H"===
Ca.type.charAt(1)?gc:0,Za=0,Xc=xc.length;Za<Xc;++Za){var Na=xc[Za],ic=Na.tbx1_-Na.tbx0_,yc=Na.tby1_-Na.tby0_;if(0!==ic&&0!==yc&&void 0!==Na.data){var Da,jc;Da=new m(ic,yc,Na.subbandType,Na.zeroBitPlanes,fb);jc=2;var kc=Na.data,lc=0,zc=0,ta,nc,hb;ta=0;for(nc=kc.length;ta<nc;ta++)hb=kc[ta],lc+=hb.end-hb.start,zc+=hb.codingpasses;var Qc=new Int16Array(lc),Sa=0;ta=0;for(nc=kc.length;ta<nc;ta++){hb=kc[ta];var Rc=hb.data.subarray(hb.start,hb.end);Qc.set(Rc,Sa);Sa+=Rc.length}var Yc=new l(Qc,0,lc);Da.setDecoder(Yc);
for(ta=0;ta<zc;ta++){switch(jc){case 0:Da.runSignificancePropogationPass();break;case 1:Da.runMagnitudeRefinementPass();break;case 2:Da.runCleanupPass(),hc&&Da.checkSegmentationSymbol()}jc=(jc+1)%3}var Bb=Na.tbx0_-ib+(Na.tby0_-Ob)*Pb,Zc=Da.coefficentsSign,bd=Da.coefficentsMagnitude,cd=Da.bitsDecoded,dd=wc?0:.5,Gc,kb,Hc,Sa=0,ed="LL"!==Ca.type;for(ta=0;ta<yc;ta++){var $c=2*(Bb/Pb|0)*(gc-Pb)+Pc+yb;for(Gc=0;Gc<ic;Gc++)kb=bd[Sa],0!==kb&&(kb=(kb+dd)*ob,0!==Zc[Sa]&&(kb=-kb),Hc=cd[Sa],Wc[ed?$c+(Bb<<1):Bb]=
wc&&Hc>=fb?kb:kb*(1<<fb-Hc)),Bb++,Sa++;Bb+=Pb-ic}}}}Xa.push({width:cc,height:dc,items:uc})}var Ic=Nc.calculate(Xa,db.tcx0,db.tcy0);Ac[wb]={left:db.tcx0,top:db.tcy0,width:Ic.width,height:Ic.height,items:Ic.items}}var Hb=Wa[0],Dc=wa[0].isSigned,Ka=Dc?new Int16Array(Hb.items.length*ja):new Uint16Array(Hb.items.length*ja),fd={left:Hb.left,top:Hb.top,width:Hb.width,height:Hb.height,items:Ka},oa,lb,La,pc,Ec,ba=0,aa,Ua,Eb,Gb,Fb,mb,Va,nb,qc,Ib;if($b.codingStyleDefaultParameters.multipleComponentTransform){var Vc=
4===ja,Fc=Wa[0].items,Sc=Wa[1].items,Uc=Wa[2].items,gd=Vc?Wa[3].items:null;oa=wa[0].precision-8;lb=(128<<oa)+.5;La=255*(1<<oa);Ec=.5*La;pc=-Ec;var hd=$b.components[0],Tc=ja-3;Ua=Fc.length;if(hd.codingStyleParameters.reversibleTransformation)for(aa=0;aa<Ua;aa++,ba+=Tc)Eb=Fc[aa]+lb,Gb=Sc[aa],Fb=Uc[aa],Va=Eb-(Fb+Gb>>2),mb=Va+Fb,nb=Va+Gb,Ka[ba++]=0>=mb?0:mb>=La?255:mb>>oa,Ka[ba++]=0>=Va?0:Va>=La?255:Va>>oa,Ka[ba++]=0>=nb?0:nb>=La?255:nb>>oa;else for(aa=0;aa<Ua;aa++,ba+=Tc)Eb=Fc[aa]+lb,Gb=Sc[aa],Fb=Uc[aa],
mb=Eb+1.402*Fb,Va=Eb-.34413*Gb-.71414*Fb,nb=Eb+1.772*Gb,Ka[ba++]=0>=mb?0:mb>=La?255:mb>>oa,Ka[ba++]=0>=Va?0:Va>=La?255:Va>>oa,Ka[ba++]=0>=nb?0:nb>=La?255:nb>>oa;if(Vc)for(aa=0,ba=3;aa<Ua;aa++,ba+=4)qc=gd[aa],Ka[ba]=qc<=pc?0:qc>=Ec?255:qc+lb>>oa}else for(ca=0;ca<ja;ca++)if(8===wa[ca].precision){var qb=Wa[ca].items;oa=wa[ca].precision-8;lb=(128<<oa)+.5;La=127.5*(1<<oa);pc=-La;ba=ca;aa=0;for(Ua=qb.length;aa<Ua;aa++)Ib=qb[aa],Ka[ba]=Ib<=pc?0:Ib>=La?255:Ib+lb>>oa,ba+=ja}else if(Dc=wa[ca].isSigned,qb=Wa[ca].items,
Dc)for(ba=ca,aa=0,Ua=qb.length;aa<Ua;aa++)Ka[ba]=qb[aa],ba+=ja;else{oa=wa[ca].precision-8;lb=(128<<oa)+.5;var ad=Math.pow(2,wa[ca].precision)-1,ba=ca;aa=0;for(Ua=qb.length;aa<Ua;aa++)Ib=qb[aa],Ka[ba]=Math.max(Math.min(Ib+lb,ad),0),ba+=ja}Oa.push(fd)}this.tiles=Oa;this.width=u.SIZ.Xsiz-u.SIZ.XOsiz;this.height=u.SIZ.Ysiz-u.SIZ.YOsiz;this.componentsCount=u.SIZ.Csiz}};var D=function(){function a(b,e){var d=h(Math.max(b,e))+1;this.levels=[];for(var n=0;n<d;n++)this.levels.push({width:b,height:e,items:[]}),
b=Math.ceil(b/2),e=Math.ceil(e/2)}a.prototype={reset:function(a,b){for(var e=0,d=0,h;e<this.levels.length;){h=this.levels[e];var n=a+b*h.width;if(void 0!==h.items[n]){d=h.items[n];break}h.index=n;a>>=1;b>>=1;e++}e--;h=this.levels[e];h.items[h.index]=d;this.currentLevel=e;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],e=b.items[b.index];a--;if(0>a)return this.value=e,!1;this.currentLevel=
a;b=this.levels[a];b.items[b.index]=e;return!0}};return a}(),u=function(){function a(b,e){var d=h(Math.max(b,e))+1;this.levels=[];for(var n=0;n<d;n++){for(var m=new Uint8Array(b*e),g=new Uint8Array(b*e),f=0,k=m.length;f<k;f++)m[f]=0,g[f]=0;this.levels.push({width:b,height:e,items:m,status:g});b=Math.ceil(b/2);e=Math.ceil(e/2)}}a.prototype={reset:function(a,b,e){this.currentStopValue=e;for(e=0;e<this.levels.length;){var d=this.levels[e];d.index=a+b*d.width;a>>=1;b>>=1;e++}this.currentLevel=this.levels.length-
1;this.minValue=this.levels[this.currentLevel].items[0]},incrementValue:function(){var a=this.levels[this.currentLevel];a.items[a.index]+=1;a.items[a.index]>this.minValue&&(this.minValue=a.items[a.index])},nextLevel:function(){var a=this.currentLevel;a--;if(0>a)return!1;this.currentLevel=a;a=this.levels[a];a.items[a.index]<this.minValue?a.items[a.index]=this.minValue:a.items[a.index]>this.minValue&&(this.minValue=a.items[a.index]);return!0},isLeaf:function(){return 0===this.currentLevel},isAboveThreshold:function(){var a=
this.levels[this.currentLevel];return a.items[a.index]>this.currentStopValue},isKnown:function(){var a=this.levels[this.currentLevel];return 0<a.status[a.index]},setKnown:function(){var a=this.levels[this.currentLevel];a.status[a.index]=1}};return a}(),m=function(){function a(h,n,m,g,f){this.width=h;this.height=n;this.contextLabelTable="HH"===m?d:"HL"===m?e:b;h*=n;this.neighborsSignificance=new Uint8Array(h);this.coefficentsSign=new Uint8Array(h);this.coefficentsMagnitude=14<f?new Uint32Array(h):
6<f?new Uint16Array(h):new Uint8Array(h);this.processingFlags=new Uint8Array(h);f=new Uint8Array(h);if(0!==g)for(n=0;n<h;n++)f[n]=g;this.bitsDecoded=f;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]),e=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,e){var d=this.neighborsSignificance,h=this.width,n=this.height,m=0<b;b=b+1<h;var g;0<a&&(g=e-h,m&&(d[g-1]+=16),b&&(d[g+1]+=16),
d[g]+=4);a+1<n&&(g=e+h,m&&(d[g-1]+=16),b&&(d[g+1]+=16),d[g]+=4);m&&(d[e-1]+=1);b&&(d[e+1]+=1);d[e]|=128},runSignificancePropogationPass:function(){for(var a=this.decoder,b=this.width,e=this.height,d=this.coefficentsMagnitude,h=this.coefficentsSign,n=this.neighborsSignificance,m=this.processingFlags,g=this.contexts,f=this.contextLabelTable,k=this.bitsDecoded,u=0;u<e;u+=4)for(var l=0;l<b;l++)for(var p=u*b+l,z=0;4>z;z++,p+=b){var C=u+z;if(C>=e)break;m[p]&=-2;if(!d[p]&&n[p]){if(a.readBit(g,f[n[p]])){var q=
this.decodeSignBit(C,l,p);h[p]=q;d[p]=1;this.setNeighborsSignificance(C,l,p);m[p]|=2}k[p]++;m[p]|=1}}},decodeSignBit:function(a,b,e){var d=this.width,h=this.height,n=this.coefficentsMagnitude,m=this.coefficentsSign,g;g=0<b&&0!==n[e-1];b+1<d&&0!==n[e+1]?(b=m[e+1],g?(g=m[e-1],b=1-b-g):b=1-b-b):g?(g=m[e-1],b=1-g-g):b=0;var f=3*b;g=0<a&&0!==n[e-d];a+1<h&&0!==n[e+d]?(b=m[e+d],g?(g=m[e-d],b=1-b-g+f):b=1-b-b+f):g?(g=m[e-d],b=1-g-g+f):b=f;return a=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,e=this.coefficentsMagnitude,d=this.neighborsSignificance,h=this.contexts,n=this.bitsDecoded,g=this.processingFlags,m=b*this.height,f=4*b,k=0,u;k<m;k=u){u=Math.min(m,k+f);for(var l=0;l<b;l++)for(var p=k+l;p<u;p+=b)if(e[p]&&0===(g[p]&1)){var z=16;0!==(g[p]&2)&&(g[p]^=2,z=0===(d[p]&127)?15:14);z=a.readBit(h,z);e[p]=e[p]<<1|z;n[p]++;g[p]|=1}}},runCleanupPass:function(){for(var a=this.decoder,b=this.width,e=this.height,d=
this.neighborsSignificance,h=this.coefficentsMagnitude,n=this.coefficentsSign,g=this.contexts,m=this.contextLabelTable,f=this.bitsDecoded,k=this.processingFlags,u=2*b,l=3*b,p,z=0;z<e;z=p){p=Math.min(z+4,e);for(var C=z*b,q=z+3<e,x=0;x<b;x++){var v=C+x,B=0,t=v,A=z,H;if(q&&0===k[v]&&0===k[v+b]&&0===k[v+u]&&0===k[v+l]&&0===d[v]&&0===d[v+b]&&0===d[v+u]&&0===d[v+l]){if(!a.readBit(g,18)){f[v]++;f[v+b]++;f[v+u]++;f[v+l]++;continue}B=a.readBit(g,17)<<1|a.readBit(g,17);0!==B&&(A=z+B,t+=B*b);H=this.decodeSignBit(A,
x,t);n[t]=H;h[t]=1;this.setNeighborsSignificance(A,x,t);k[t]|=2;t=v;for(v=z;v<=A;v++,t+=b)f[t]++;B++}for(A=z+B;A<p;A++,t+=b)h[t]||0!==(k[t]&1)||(1===a.readBit(g,m[d[t]])&&(H=this.decodeSignBit(A,x,t),n[t]=H,h[t]=1,this.setNeighborsSignificance(A,x,t),k[t]|=2),f[t]++)}}},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}(),p=function(){function a(){}
a.prototype.calculate=function(a,b,e){for(var d=a[0],h=1,n=a.length;h<n;h++)d=this.iterate(d,a[h],b,e);return d};a.prototype.extend=function(a,b,e){var d=b-1,h=b+1,n=b+e-2;b+=e;a[d--]=a[h++];a[b++]=a[n--];a[d--]=a[h++];a[b++]=a[n--];a[d--]=a[h++];a[b++]=a[n--];a[d]=a[h];a[b]=a[n]};a.prototype.iterate=function(a,b,e,d){var h=a.width,n=a.height,g=a.items,m=b.width,f=b.height;b=b.items;var k,u,l,p;for(k=l=0;k<n;k++)for(p=2*k*m,u=0;u<h;u++,l++,p+=2)b[p]=g[l];a.items=null;a=new Float32Array(m+8);if(1===
m){if(0!==(e&1))for(l=p=0;p<f;p++,l+=m)b[l]*=.5}else for(l=p=0;p<f;p++,l+=m)a.set(b.subarray(l,l+m),4),this.extend(a,4,m),this.filter(a,4,m),b.set(a.subarray(4,4+m),l);e=16;h=[];for(k=0;k<e;k++)h.push(new Float32Array(f+8));k=0;a=4+f;if(1===f){if(0!==(d&1))for(d=0;d<m;d++)b[d]*=.5}else for(d=0;d<m;d++){if(0===k){e=Math.min(m-d,e);l=d;for(p=4;p<a;l+=m,p++)for(n=0;n<e;n++)h[n][p]=b[l+n];k=e}k--;l=h[k];this.extend(l,4,f);this.filter(l,4,f);if(0===k)for(l=d-e+1,p=4;p<a;l+=m,p++)for(n=0;n<e;n++)b[l+n]=
h[n][p]}return{width:m,height:f,items:b}};return a}(),J=function(){function a(){p.call(this)}a.prototype=Object.create(p.prototype);a.prototype.filter=function(a,b,e){e>>=1;b|=0;var d,h,n,m;d=b-3;for(h=e+4;h--;d+=2)a[d]*=.8128930661159609;d=b-2;n=.443506852043971*a[d-1];for(h=e+3;h--;d+=2)if(m=.443506852043971*a[d+1],a[d]=1.230174104914001*a[d]-n-m,h--)d+=2,n=.443506852043971*a[d+1],a[d]=1.230174104914001*a[d]-n-m;else break;d=b-1;n=.882911075530934*a[d-1];for(h=e+2;h--;d+=2)if(m=.882911075530934*
a[d+1],a[d]-=n+m,h--)d+=2,n=.882911075530934*a[d+1],a[d]-=n+m;else break;d=b;n=-.052980118572961*a[d-1];for(h=e+1;h--;d+=2)if(m=-.052980118572961*a[d+1],a[d]-=n+m,h--)d+=2,n=-.052980118572961*a[d+1],a[d]-=n+m;else break;if(0!==e)for(d=b+1,n=-1.586134342059924*a[d-1],h=e;h--;d+=2)if(m=-1.586134342059924*a[d+1],a[d]-=n+m,h--)d+=2,n=-1.586134342059924*a[d+1],a[d]-=n+m;else break};return a}(),H=function(){function a(){p.call(this)}a.prototype=Object.create(p.prototype);a.prototype.filter=function(a,b,
e){e>>=1;b|=0;var d,h;d=b;for(h=e+1;h--;d+=2)a[d]-=a[d-1]+a[d+1]+2>>2;d=b+1;for(h=e;h--;d+=2)a[d]+=a[d-1]+a[d+1]>>1};return a}();return a}();"use strict";var l=function(){function a(b,e,d){this.data=b;this.bp=e;this.dataEnd=d;this.chigh=b[e];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,e){var d=a[e]>>1,h=a[e]&
1,d=b[d],g=d.qe,n=this.a-g;if(this.chigh<g)n<g?(n=g,g=h,d=d.nmps):(n=g,g=1^h,1===d.switchFlag&&(h=g),d=d.nlps);else{this.chigh-=g;if(0!==(n&32768))return this.a=n,h;n<g?(g=1^h,1===d.switchFlag&&(h=g),d=d.nlps):(g=h,d=d.nmps)}do 0===this.ct&&this.byteIn(),n<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--;while(0===(n&32768));this.a=n;a[e]=d<<1|h;return g}};return a}();"use strict";var q="undefined"===typeof window?this:window;q.PDFJS||(q.PDFJS={});var t=t||
{};t.VERBOSITY_LEVELS={errors:0,warnings:1,infos:5};t.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,
setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,
beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,
paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};t.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"};t.UnsupportedManager=function(){var a=[];return{listen:function(b){a.push(b)},notify:function(e){b('Unsupported feature "'+e+'"');for(var d=0,h=a.length;d<h;d++)a[d](e)}}}();t.isValidUrl=function(a,b){if(!a)return!1;var e=/^[a-z][a-z0-9+\-.]*(?=:)/i.exec(a);
if(!e)return b;e=e[0].toLowerCase();switch(e){case "http":case "https":case "ftp":case "mailto":case "tel":return!0;default:return!1}};t.shadow=e;t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};f=function(){function a(b,e){this.name="PasswordException";this.message=b;this.code=e}a.prototype=Error();return a.constructor=a}();t.PasswordException=f;f=function(){function a(b,e){this.name="UnknownErrorException";this.message=b;this.details=e}a.prototype=Error();return a.constructor=a}();t.UnknownErrorException=
f;f=function(){function a(b){this.name="InvalidPDFException";this.message=b}a.prototype=Error();return a.constructor=a}();t.InvalidPDFException=f;f=function(){function a(b){this.name="MissingPDFException";this.message=b}a.prototype=Error();return a.constructor=a}();t.MissingPDFException=f;f=function(){function a(b,e){this.name="UnexpectedResponseException";this.message=b;this.status=e}a.prototype=Error();return a.constructor=a}();t.UnexpectedResponseException=f;(function(){function a(b){this.message=
b}a.prototype=Error();a.prototype.name="NotImplementedException";return a.constructor=a})();(function(){function a(b,e){this.begin=b;this.end=e;this.message="Missing data ["+b+", "+e+")"}a.prototype=Error();a.prototype.name="MissingDataException";return a.constructor=a})();(function(){function a(b){this.message=b}a.prototype=Error();a.prototype.name="XRefParseException";return a.constructor=a})();Object.defineProperty(t,"isLittleEndian",{configurable:!0,get:function(){var a=t,b=new Uint8Array(2);
b[0]=1;b=new Uint16Array(b.buffer);return e(a,"isLittleEndian",1===b[0])}});Object.defineProperty(t,"hasCanvasTypedArrays",{configurable:!0,get:function(){var a=t,b=document.createElement("canvas");b.width=b.height=1;b=b.getContext("2d").createImageData(1,1);return e(a,"hasCanvasTypedArrays","undefined"!==typeof b.data.buffer)}});(function(){function a(d,h){this.buffer=d;this.byteLength=d.length;for(var g=this.length=void 0===h?this.byteLength>>2:h;e<g;)Object.defineProperty(a.prototype,e,b(e)),e++}
function b(a){return{get:function(){var b=this.buffer,e=a<<2;return(b[e]|b[e+1]<<8|b[e+2]<<16|b[e+3]<<24)>>>0},set:function(b){var e=this.buffer,d=a<<2;e[d]=b&255;e[d+1]=b>>8&255;e[d+2]=b>>16&255;e[d+3]=b>>>24&255}}}a.prototype=Object.create(null);var e=0;return a})();var y=t.Util=function(){function a(){}var b=["rgb(",0,",",0,",",0,")"];a.makeCssRgb=function(a,e,d){b[1]=a;b[3]=e;b[5]=d;return b.join("")};a.transform=function(a,b){return[a[0]*b[0]+a[2]*b[1],a[1]*b[0]+a[3]*b[1],a[0]*b[2]+a[2]*b[3],
a[1]*b[2]+a[3]*b[3],a[0]*b[4]+a[2]*b[5]+a[4],a[1]*b[4]+a[3]*b[5]+a[5]]};a.applyTransform=function(a,b){return[a[0]*b[0]+a[1]*b[2]+b[4],a[0]*b[1]+a[1]*b[3]+b[5]]};a.applyInverseTransform=function(a,b){var e=b[0]*b[3]-b[1]*b[2];return[(a[0]*b[3]-a[1]*b[2]+b[2]*b[5]-b[4]*b[3])/e,(-a[0]*b[1]+a[1]*b[0]+b[4]*b[1]-b[5]*b[0])/e]};a.getAxialAlignedBoundingBox=function(b,e){var d=a.applyTransform(b,e),h=a.applyTransform(b.slice(2,4),e),g=a.applyTransform([b[0],b[3]],e),n=a.applyTransform([b[2],b[1]],e);return[Math.min(d[0],
h[0],g[0],n[0]),Math.min(d[1],h[1],g[1],n[1]),Math.max(d[0],h[0],g[0],n[0]),Math.max(d[1],h[1],g[1],n[1])]};a.inverseTransform=function(a){var b=a[0]*a[3]-a[1]*a[2];return[a[3]/b,-a[1]/b,-a[2]/b,a[0]/b,(a[2]*a[5]-a[4]*a[3])/b,(a[4]*a[1]-a[5]*a[0])/b]};a.apply3dTransform=function(a,b){return[a[0]*b[0]+a[1]*b[1]+a[2]*b[2],a[3]*b[0]+a[4]*b[1]+a[5]*b[2],a[6]*b[0]+a[7]*b[1]+a[8]*b[2]]};a.singularValueDecompose2dScale=function(a){var b=[a[0],a[2],a[1],a[3]],e=a[0]*b[0]+a[1]*b[2],d=a[2]*b[1]+a[3]*b[3],h=
(e+d)/2;a=Math.sqrt((e+d)*(e+d)-4*(e*d-(a[2]*b[0]+a[3]*b[2])*(a[0]*b[1]+a[1]*b[3])))/2;b=h-a||1;return[Math.sqrt(h+a||1),Math.sqrt(b)]};a.normalizeRect=function(a){var b=a.slice(0);a[0]>a[2]&&(b[0]=a[2],b[2]=a[0]);a[1]>a[3]&&(b[1]=a[3],b[3]=a[1]);return b};a.intersect=function(b,e){function d(a,b){return a-b}var h=[b[0],b[2],e[0],e[2]].sort(d),g=[b[1],b[3],e[1],e[3]].sort(d),n=[];b=a.normalizeRect(b);e=a.normalizeRect(e);if(h[0]===b[0]&&h[1]===e[0]||h[0]===e[0]&&h[1]===b[0])n[0]=h[1],n[2]=h[2];else return!1;
if(g[0]===b[1]&&g[1]===e[1]||g[0]===e[1]&&g[1]===b[1])n[1]=g[1],n[3]=g[2];else return!1;return n};a.sign=function(a){return 0>a?-1:1};a.appendToArray=function(a,b){Array.prototype.push.apply(a,b)};a.prependToArray=function(a,b){Array.prototype.unshift.apply(a,b)};a.extendObj=function(a,b){for(var e in b)a[e]=b[e]};a.getInheritableProperty=function(a,b){for(;a&&!a.has(b);)a=a.get("Parent");return a?a.get(b):null};a.inherit=function(a,b,e){a.prototype=Object.create(b.prototype);a.prototype.constructor=
a;for(var d in e)a.prototype[d]=e[d]};a.loadScript=function(a,b){var e=document.createElement("script"),d=!1;e.setAttribute("src",a);b&&(e.onload=function(){d||b();d=!0});document.getElementsByTagName("head")[0].appendChild(e)};return a}();t.PageViewport=function(){function a(b,e,d,h,g,f){this.viewBox=b;this.scale=e;this.rotation=d;this.offsetX=h;this.offsetY=g;var n=(b[2]+b[0])/2,k=(b[3]+b[1])/2,l,q,t;d%=360;switch(0>d?d+360:d){case 180:d=-1;q=l=0;t=1;break;case 90:d=0;q=l=1;t=0;break;case 270:d=
0;q=l=-1;t=0;break;default:d=1,q=l=0,t=-1}f&&(q=-q,t=-t);0===d?(h=Math.abs(k-b[1])*e+h,g=Math.abs(n-b[0])*e+g,f=Math.abs(b[3]-b[1])*e,b=Math.abs(b[2]-b[0])*e):(h=Math.abs(n-b[0])*e+h,g=Math.abs(k-b[1])*e+g,f=Math.abs(b[2]-b[0])*e,b=Math.abs(b[3]-b[1])*e);this.transform=[d*e,l*e,q*e,t*e,h-d*e*n-q*e*k,g-l*e*n-t*e*k];this.width=f;this.height=b;this.fontScale=e}a.prototype={clone:function(b){b=b||{};var e="scale"in b?b.scale:this.scale,d="rotation"in b?b.rotation:this.rotation;return new a(this.viewBox.slice(),
e,d,this.offsetX,this.offsetY,b.dontFlip)},convertToViewportPoint:function(a,b){return y.applyTransform([a,b],this.transform)},convertToViewportRectangle:function(a){var b=y.applyTransform([a[0],a[1]],this.transform);a=y.applyTransform([a[2],a[3]],this.transform);return[b[0],b[1],a[0],a[1]]},convertToPdfPoint:function(a,b){return y.applyInverseTransform([a,b],this.transform)}};return a}();t.createPromiseCapability=function(){var a={};a.promise=new Promise(function(b,e){a.resolve=b;a.reject=e});return a};
(function(){function a(b){this._status=0;this._handlers=[];try{b.call(this,this._resolve.bind(this),this._reject.bind(this))}catch(e){this._reject(e)}}if(q.Promise)"function"!==typeof q.Promise.all&&(q.Promise.all=function(a){var b=0,e=[],d,h,n=new q.Promise(function(a,b){d=a;h=b});a.forEach(function(a,n){b++;a.then(function(a){e[n]=a;b--;0===b&&d(e)},h)});0===b&&d(e);return n}),"function"!==typeof q.Promise.resolve&&(q.Promise.resolve=function(a){return new q.Promise(function(b){b(a)})}),"function"!==
typeof q.Promise.reject&&(q.Promise.reject=function(a){return new q.Promise(function(b,e){e(a)})}),"function"!==typeof q.Promise.prototype.catch2&&(q.Promise.prototype.catch2=function(a){return q.Promise.prototype.then(void 0,a)});else{var e={handlers:[],running:!1,unhandledRejections:[],pendingRejectionCheck:!1,scheduleHandlers:function(a){0!==a._status&&(this.handlers=this.handlers.concat(a._handlers),a._handlers=[],this.running||(this.running=!0,setTimeout(this.runHandlers.bind(this),0)))},runHandlers:function(){for(var a=
Date.now()+1;0<this.handlers.length;){var b=this.handlers.shift(),e=b.thisPromise._status,d=b.thisPromise._value;try{1===e?"function"===typeof b.onResolve&&(d=b.onResolve(d)):"function"===typeof b.onReject&&(d=b.onReject(d),e=1,b.thisPromise._unhandledRejection&&this.removeUnhandeledRejection(b.thisPromise))}catch(h){e=2,d=h}b.nextPromise._updateStatus(e,d);if(Date.now()>=a)break}0<this.handlers.length?setTimeout(this.runHandlers.bind(this),0):this.running=!1},addUnhandledRejection:function(a){this.unhandledRejections.push({promise:a,
time:Date.now()});this.scheduleRejectionCheck()},removeUnhandeledRejection:function(a){a._unhandledRejection=!1;for(var b=0;b<this.unhandledRejections.length;b++)this.unhandledRejections[b].promise===a&&(this.unhandledRejections.splice(b),b--)},scheduleRejectionCheck:function(){this.pendingRejectionCheck||(this.pendingRejectionCheck=!0,setTimeout(function(){this.pendingRejectionCheck=!1;for(var a=Date.now(),e=0;e<this.unhandledRejections.length;e++)if(500<a-this.unhandledRejections[e].time){var d=
this.unhandledRejections[e].promise._value,h="Unhandled rejection: "+d;d.stack&&(h+="\n"+d.stack);b(h);this.unhandledRejections.splice(e);e--}this.unhandledRejections.length&&this.scheduleRejectionCheck()}.bind(this),500))}};a.all=function(b){function e(a){2!==g._status&&(f=[],h(a))}var d,h,g=new a(function(a,b){d=a;h=b}),n=b.length,f=[];if(0===n)return d(f),g;for(var k=0,l=b.length;k<l;++k){var q=b[k],t=function(a){return function(b){2!==g._status&&(f[a]=b,n--,0===n&&d(f))}}(k);a.isPromise(q)?q.then(t,
e):t(q)}return g};a.isPromise=function(a){return a&&"function"===typeof a.then};a.resolve=function(b){return new a(function(a){a(b)})};a.reject=function(b){return new a(function(a,e){e(b)})};a.prototype={_status:null,_value:null,_handlers:null,_unhandledRejection:null,_updateStatus:function(b,d){1!==this._status&&2!==this._status&&(1===b&&a.isPromise(d)?d.then(this._updateStatus.bind(this,1),this._updateStatus.bind(this,2)):(this._status=b,this._value=d,2===b&&0===this._handlers.length&&(this._unhandledRejection=
!0,e.addUnhandledRejection(this)),e.scheduleHandlers(this)))},_resolve:function(a){this._updateStatus(1,a)},_reject:function(a){this._updateStatus(2,a)},then:function(b,d){var h=new a(function(a,b){this.resolve=a;this.reject=b});this._handlers.push({thisPromise:this,onResolve:b,onReject:d,nextPromise:h});e.scheduleHandlers(this);return h},catch2:function(a){return this.then(void 0,a)}};q.Promise=a}})();(function(){function a(){this.started={};this.times=[];this.enabled=!0}a.prototype={time:function(a){this.enabled&&
(a in this.started&&b("Timer is already running for "+a),this.started[a]=Date.now())},timeEnd:function(a){this.enabled&&(a in this.started||b("Timer has not been started for "+a),this.times.push({name:a,start:this.started[a],end:Date.now()}),delete this.started[a])},toString:function(){var a,b,e=this.times,d="",h=0;a=0;for(b=e.length;a<b;++a){var g=e[a].name;g.length>h&&(h=g.length)}a=0;for(b=e.length;a<b;++a){for(var n=e[a],g=n.end-n.start,n=n.name;n.length<h;)n+=" ";d+=n+" "+g+"ms\n"}return d}};
return a})();t.createBlob=function(a,b){if("undefined"!==typeof Blob)return new Blob([a],{type:b});var e=new MozBlobBuilder;e.append(a);return e.getBlob(b)};t.createObjectURL=function(){return function(a,b){if(!t.disableCreateObjectURL&&"undefined"!==typeof URL&&URL.createObjectURL){var e=t.createBlob(a,b);return URL.createObjectURL(e)}for(var e="data:"+b+";base64,",d=0,h=a.length;d<h;d+=3)var g=a[d]&255,f=a[d+1]&255,n=a[d+2]&255,e=e+("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="[g>>
2]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="[(g&3)<<4|f>>4]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="[d+1<h?(f&15)<<2|n>>6:64]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="[d+2<h?n&63:64]);return e}}();"undefined"!==typeof d&&d.exports&&(d.exports=a)},{}],3:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.ComponentSpec=b.lossless.ComponentSpec||function(){this.vSamp=this.quantTableSel=this.hSamp=0};"undefined"!==
typeof d&&d.exports&&(d.exports=b.lossless.ComponentSpec)},{}],4:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.DataStream=b.lossless.DataStream||function(a,b,d){this.buffer=new DataView(a,b,d);this.index=0};b.lossless.DataStream.prototype.get16=function(){var a=this.buffer.getUint16(this.index,!1);this.index+=2;return a};b.lossless.DataStream.prototype.get8=function(){var a=this.buffer.getUint8(this.index);this.index+=1;return a};"undefined"!==typeof d&&d.exports&&(d.exports=b.lossless.DataStream)},
{}],5:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.DataStream=b.lossless.DataStream||("undefined"!==typeof a?a("./data-stream.js"):null);b.lossless.HuffmanTable=b.lossless.HuffmanTable||("undefined"!==typeof a?a("./huffman-table.js"):null);b.lossless.QuantizationTable=b.lossless.QuantizationTable||("undefined"!==typeof a?a("./quantization-table.js"):null);b.lossless.ScanHeader=b.lossless.ScanHeader||("undefined"!==typeof a?a("./scan-header.js"):null);b.lossless.FrameHeader=b.lossless.FrameHeader||
("undefined"!==typeof a?a("./frame-header.js"):null);b.lossless.Utils=b.lossless.Utils||("undefined"!==typeof a?a("./utils.js"):null);b.lossless.Decoder=b.lossless.Decoder||function(a,d){this.buffer=a;this.frame=new b.lossless.FrameHeader;this.huffTable=new b.lossless.HuffmanTable;this.quantTable=new b.lossless.QuantizationTable;this.scan=new b.lossless.ScanHeader;this.DU=b.lossless.Utils.createArray(10,4,64);this.HuffTab=b.lossless.Utils.createArray(4,2,12800);this.IDCT_Source=[];this.nBlock=[];
this.acTab=b.lossless.Utils.createArray(10,1);this.dcTab=b.lossless.Utils.createArray(10,1);this.qTab=b.lossless.Utils.createArray(10,1);this.numBytes=this.yLoc=this.xLoc=this.yDim=this.xDim=this.selection=this.restartInterval=this.numComp=this.markerIndex=this.marker=0;this.outputData=null;this.restarting=!1;this.mask=0;"undefined"!==typeof d&&(this.numBytes=d)};b.lossless.Decoder.IDCT_P=[0,5,40,16,45,2,7,42,21,56,8,61,18,47,1,4,41,23,58,13,32,24,37,10,63,17,44,3,6,43,20,57,15,34,29,48,53,26,39,
9,60,19,46,22,59,12,33,31,50,55,25,36,11,62,14,35,28,49,52,27,38,30,51,54];b.lossless.Decoder.TABLE=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63];b.lossless.Decoder.MAX_HUFFMAN_SUBTREE=50;b.lossless.Decoder.MSB=2147483648;b.lossless.Decoder.RESTART_MARKER_BEGIN=65488;b.lossless.Decoder.RESTART_MARKER_END=65495;b.lossless.Decoder.prototype.decompress=function(a,
b,d){return this.decode(a,b,d).buffer};b.lossless.Decoder.prototype.decode=function(a,d,g,f){var l=0,q=[],t=[],y=[];"undefined"!==typeof a&&(this.buffer=a);"undefined"!==typeof f&&(this.numBytes=f);this.stream=new b.lossless.DataStream(this.buffer,d,g);this.buffer=null;this.yLoc=this.xLoc=0;a=this.stream.get16();if(65496!==a)throw Error("Not a JPEG file");for(a=this.stream.get16();4092!==a>>4||65476===a;){switch(a){case 65476:this.huffTable.read(this.stream,this.HuffTab);break;case 65484:throw Error("Program doesn't support arithmetic coding. (format throw new IOException)");
case 65499:this.quantTable.read(this.stream,b.lossless.Decoder.TABLE);break;case 65501:this.restartInterval=this.readNumber();break;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:this.readApp();break;case 65534:this.readComment();break;default:if(255!==a>>8)throw Error("ERROR: format throw new IOException! (decode)");}a=this.stream.get16()}if(65472>a||65479<a)throw Error("ERROR: could not handle arithmetic code!");
this.frame.read(this.stream);a=this.stream.get16();do{for(;65498!==a;){switch(a){case 65476:this.huffTable.read(this.stream,this.HuffTab);break;case 65484:throw Error("Program doesn't support arithmetic coding. (format throw new IOException)");case 65499:this.quantTable.read(this.stream,b.lossless.Decoder.TABLE);break;case 65501:this.restartInterval=this.readNumber();break;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:this.readApp();
break;case 65534:this.readComment();break;default:if(255!==a>>8)throw Error("ERROR: format throw new IOException! (Parser.decode)");}a=this.stream.get16()}this.precision=this.frame.precision;this.components=this.frame.components;this.numBytes||(this.numBytes=parseInt(Math.ceil(this.precision/8)));this.mask=1==this.numBytes?255:65535;this.scan.read(this.stream);this.numComp=this.scan.numComp;this.selection=this.scan.selection;1===this.numBytes?3===this.numComp?(this.getter=this.getValueRGB,this.setter=
this.setValueRGB,this.output=this.outputRGB):(this.getter=this.getValue8,this.setter=this.setValue8,this.output=this.outputSingle):(this.getter=this.getValue16,this.setter=this.setValue16,this.output=this.outputSingle);switch(this.selection){case 2:this.selector=this.select2;break;case 3:this.selector=this.select3;break;case 4:this.selector=this.select4;break;case 5:this.selector=this.select5;break;case 6:this.selector=this.select6;break;case 7:this.selector=this.select7;break;default:this.selector=
this.select1}this.scanComps=this.scan.components;this.quantTables=this.quantTable.quantTables;for(d=0;d<this.numComp;d+=1)g=this.scanComps[d].scanCompSel,this.qTab[d]=this.quantTables[this.components[g].quantTableSel],this.nBlock[d]=this.components[g].vSamp*this.components[g].hSamp,this.dcTab[d]=this.HuffTab[this.scanComps[d].dcTabSel][0],this.acTab[d]=this.HuffTab[this.scanComps[d].acTabSel][1];this.xDim=this.frame.dimX;this.yDim=this.frame.dimY;this.outputData=new DataView(new ArrayBuffer(this.xDim*
this.yDim*this.numBytes*this.numComp));for(l+=1;;){t[0]=0;for(d=y[0]=0;10>d;d+=1)q[d]=1<<this.precision-1;if(0===this.restartInterval){for(a=this.decodeUnit(q,t,y);0===a&&this.xLoc<this.xDim&&this.yLoc<this.yDim;)this.output(q),a=this.decodeUnit(q,t,y);break}for(d=0;d<this.restartInterval&&(this.restarting=0==d,a=this.decodeUnit(q,t,y),this.output(q),0===a);d+=1);0===a&&(0!==this.markerIndex?(a=65280|this.marker,this.markerIndex=0):a=this.stream.get16());if(!(a>=b.lossless.Decoder.RESTART_MARKER_BEGIN&&
a<=b.lossless.Decoder.RESTART_MARKER_END))break}65500===a&&1===l&&(this.readNumber(),a=this.stream.get16())}while(65497!==a&&this.xLoc<this.xDim&&this.yLoc<this.yDim&&0===l);return this.outputData};b.lossless.Decoder.prototype.decodeUnit=function(a,b,d){return 1==this.numComp?this.decodeSingle(a,b,d):3==this.numComp?this.decodeRGB(a,b,d):-1};b.lossless.Decoder.prototype.select1=function(a){return this.getPreviousX(a)};b.lossless.Decoder.prototype.select2=function(a){return this.getPreviousY(a)};b.lossless.Decoder.prototype.select3=
function(a){return this.getPreviousXY(a)};b.lossless.Decoder.prototype.select4=function(a){return this.getPreviousX(a)+this.getPreviousY(a)-this.getPreviousXY(a)};b.lossless.Decoder.prototype.select5=function(a){return this.getPreviousX(a)+(this.getPreviousY(a)-this.getPreviousXY(a)>>1)};b.lossless.Decoder.prototype.select6=function(a){return this.getPreviousY(a)+(this.getPreviousX(a)-this.getPreviousXY(a)>>1)};b.lossless.Decoder.prototype.select7=function(a){return(this.getPreviousX(a)+this.getPreviousY(a))/
2};b.lossless.Decoder.prototype.decodeRGB=function(a,d,g){var f,l,q,t,y,B,A;a[0]=this.selector(0);a[1]=this.selector(1);a[2]=this.selector(2);for(y=0;y<this.numComp;y+=1)for(t=this.qTab[y],l=this.acTab[y],q=this.dcTab[y],B=0;B<this.nBlock[y];B+=1){for(f=0;f<this.IDCT_Source.length;f+=1)this.IDCT_Source[f]=0;f=this.getHuffmanValue(q,d,g);if(65280<=f)return f;a[y]=this.IDCT_Source[0]=a[y]+this.getn(g,f,d,g);this.IDCT_Source[0]*=t[0];for(A=1;64>A;A+=1){f=this.getHuffmanValue(l,d,g);if(65280<=f)return f;
A+=f>>4;if(0===(f&15)){if(0===f>>4)break}else this.IDCT_Source[b.lossless.Decoder.IDCT_P[A]]=this.getn(g,f&15,d,g)*t[A]}}return 0};b.lossless.Decoder.prototype.decodeSingle=function(a,d,g){var f,l,q;this.restarting?(this.restarting=!1,a[0]=1<<this.frame.precision-1):a[0]=this.selector();for(l=0;l<this.nBlock[0];l+=1){f=this.getHuffmanValue(this.dcTab[0],d,g);if(65280<=f)return f;f=this.getn(a,f,d,g);q=f>>8;if(q>=b.lossless.Decoder.RESTART_MARKER_BEGIN&&q<=b.lossless.Decoder.RESTART_MARKER_END)return q;
a[0]+=f}return 0};b.lossless.Decoder.prototype.getHuffmanValue=function(a,d,g){var f,l;8>g[0]?(d[0]<<=8,l=this.stream.get8(),255===l&&(this.marker=this.stream.get8(),0!==this.marker&&(this.markerIndex=9)),d[0]|=l):g[0]-=8;f=a[d[0]>>g[0]];if(0!==(f&b.lossless.Decoder.MSB)){if(0!==this.markerIndex)return this.markerIndex=0,65280|this.marker;d[0]&=65535>>16-g[0];d[0]<<=8;l=this.stream.get8();255===l&&(this.marker=this.stream.get8(),0!==this.marker&&(this.markerIndex=9));d[0]|=l;f=a[256*(f&255)+(d[0]>>
g[0])];g[0]+=8}g[0]+=8-(f>>8);if(0>g[0])throw Error("index="+g[0]+" temp="+d[0]+" code="+f+" in HuffmanValue()");if(g[0]<this.markerIndex)return this.markerIndex=0,65280|this.marker;d[0]&=65535>>16-g[0];return f&255};b.lossless.Decoder.prototype.getn=function(a,b,d,f){if(0===b)return 0;if(16===b)return 0<=a[0]?-32768:32768;f[0]-=b;if(0<=f[0]){if(f[0]<this.markerIndex&&!this.isLastPixel())return this.markerIndex=0,(65280|this.marker)<<8}else{d[0]<<=8;a=this.stream.get8();255===a&&(this.marker=this.stream.get8(),
0!==this.marker&&(this.markerIndex=9));d[0]|=a;f[0]+=8;if(0>f[0]){if(0!==this.markerIndex)return this.markerIndex=0,(65280|this.marker)<<8;d[0]<<=8;a=this.stream.get8();255===a&&(this.marker=this.stream.get8(),0!==this.marker&&(this.markerIndex=9));d[0]|=a;f[0]+=8}if(0>f[0])throw Error("index="+f[0]+" in getn()");if(f[0]<this.markerIndex)return this.markerIndex=0,(65280|this.marker)<<8}a=d[0]>>f[0];d[0]&=65535>>16-f[0];a<1<<b-1&&(a+=(-1<<b)+1);return a};b.lossless.Decoder.prototype.getPreviousX=function(a){return 0<
this.xLoc?this.getter(this.yLoc*this.xDim+this.xLoc-1,a):0<this.yLoc?this.getPreviousY(a):1<<this.frame.precision-1};b.lossless.Decoder.prototype.getPreviousXY=function(a){return 0<this.xLoc&&0<this.yLoc?this.getter((this.yLoc-1)*this.xDim+this.xLoc-1,a):this.getPreviousY(a)};b.lossless.Decoder.prototype.getPreviousY=function(a){return 0<this.yLoc?this.getter((this.yLoc-1)*this.xDim+this.xLoc,a):this.getPreviousX(a)};b.lossless.Decoder.prototype.isLastPixel=function(){return this.xLoc===this.xDim-
1&&this.yLoc===this.yDim-1};b.lossless.Decoder.prototype.outputSingle=function(a){this.xLoc<this.xDim&&this.yLoc<this.yDim&&(this.setter(this.yLoc*this.xDim+this.xLoc,this.mask&a[0]),this.xLoc+=1,this.xLoc>=this.xDim&&(this.yLoc+=1,this.xLoc=0))};b.lossless.Decoder.prototype.outputRGB=function(a){var b=this.yLoc*this.xDim+this.xLoc;this.xLoc<this.xDim&&this.yLoc<this.yDim&&(this.setter(b,a[0],0),this.setter(b,a[1],1),this.setter(b,a[2],2),this.xLoc+=1,this.xLoc>=this.xDim&&(this.yLoc+=1,this.xLoc=
0))};b.lossless.Decoder.prototype.setValue16=function(a,b){this.outputData.setInt16(2*a,b,!0)};b.lossless.Decoder.prototype.getValue16=function(a){return this.outputData.getInt16(2*a,!0)&this.mask};b.lossless.Decoder.prototype.setValue8=function(a,b){this.outputData.setInt8(a,b)};b.lossless.Decoder.prototype.getValue8=function(a){return this.outputData.getInt8(a)&this.mask};b.lossless.Decoder.prototype.setValueRGB=function(a,b,d){this.outputData.setUint8(3*a+d,b)};b.lossless.Decoder.prototype.getValueRGB=
function(a,b){return this.outputData.getUint8(3*a+b)};b.lossless.Decoder.prototype.readApp=function(){for(var a=0,b=this.stream.get16(),a=a+2;a<b;)this.stream.get8(),a+=1;return b};b.lossless.Decoder.prototype.readComment=function(){var a="",b=0,d;d=this.stream.get16();for(b+=2;b<d;)a+=this.stream.get8(),b+=1;return a};b.lossless.Decoder.prototype.readNumber=function(){if(4!==this.stream.get16())throw Error("ERROR: Define number format throw new IOException [Ld!=4]");return this.stream.get16()};"undefined"!==
typeof d&&d.exports&&(d.exports=b.lossless.Decoder)},{"./data-stream.js":4,"./frame-header.js":6,"./huffman-table.js":7,"./quantization-table.js":9,"./scan-header.js":11,"./utils.js":12}],6:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.ComponentSpec=b.lossless.ComponentSpec||("undefined"!==typeof a?a("./component-spec.js"):null);b.lossless.DataStream=b.lossless.DataStream||("undefined"!==typeof a?a("./data-stream.js"):null);b.lossless.FrameHeader=b.lossless.FrameHeader||function(){this.components=
[];this.precision=this.numComp=this.dimY=this.dimX=0};b.lossless.FrameHeader.prototype.read=function(a){var d=0,g,f,l,q;g=a.get16();d+=2;this.precision=a.get8();d+=1;this.dimY=a.get16();d+=2;this.dimX=a.get16();d+=2;this.numComp=a.get8();d+=1;for(f=1;f<=this.numComp;f+=1){if(d>g)throw Error("ERROR: frame format error");l=a.get8();d+=1;if(d>=g)throw Error("ERROR: frame format error [c>=Lf]");q=a.get8();d+=1;this.components[l]||(this.components[l]=new b.lossless.ComponentSpec);this.components[l].hSamp=
q>>4;this.components[l].vSamp=q&15;this.components[l].quantTableSel=a.get8();d+=1}if(d!==g)throw Error("ERROR: frame format error [Lf!=count]");return 1};"undefined"!==typeof d&&d.exports&&(d.exports=b.lossless.FrameHeader)},{"./component-spec.js":3,"./data-stream.js":4}],7:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.DataStream=b.lossless.DataStream||("undefined"!==typeof a?a("./data-stream.js"):null);b.lossless.Utils=b.lossless.Utils||("undefined"!==typeof a?a("./utils.js"):
null);b.lossless.HuffmanTable=b.lossless.HuffmanTable||function(){this.l=b.lossless.Utils.createArray(4,2,16);this.th=[];this.v=b.lossless.Utils.createArray(4,2,16,200);this.tc=b.lossless.Utils.createArray(4,2);this.tc[0][0]=0;this.tc[1][0]=0;this.tc[2][0]=0;this.tc[3][0]=0;this.tc[0][1]=0;this.tc[1][1]=0;this.tc[2][1]=0;this.tc[3][1]=0;this.th[0]=0;this.th[1]=0;this.th[2]=0;this.th[3]=0};b.lossless.HuffmanTable.MSB=2147483648;b.lossless.HuffmanTable.prototype.read=function(a,b){var d=0,f,l,q,t,y;
f=a.get16();for(d+=2;d<f;){l=a.get8();d+=1;q=l&15;if(3<q)throw Error("ERROR: Huffman table ID > 3");l>>=4;if(2<l)throw Error("ERROR: Huffman table [Table class > 2 ]");this.th[q]=1;this.tc[q][l]=1;for(t=0;16>t;t+=1)this.l[q][l][t]=a.get8(),d+=1;for(t=0;16>t;t+=1)for(y=0;y<this.l[q][l][t];y+=1){if(d>f)throw Error("ERROR: Huffman table format error [count>Lh]");this.v[q][l][t][y]=a.get8();d+=1}}if(d!==f)throw Error("ERROR: Huffman table format error [count!=Lf]");for(t=0;4>t;t+=1)for(y=0;2>y;y+=1)0!==
this.tc[t][y]&&this.buildHuffTable(b[t][y],this.l[t][y],this.v[t][y]);return 1};b.lossless.HuffmanTable.prototype.buildHuffTable=function(a,d,g){var f,l,q,t,y;for(q=l=0;8>q;q+=1)for(t=0;t<d[q];t+=1)for(y=0;y<256>>q+1;y+=1)a[l]=g[q][t]|q+1<<8,l+=1;for(q=1;256>l;q+=1,l+=1)a[l]=q|b.lossless.HuffmanTable.MSB;f=1;l=0;for(q=8;16>q;q+=1)for(t=0;t<d[q];t+=1){for(y=0;y<256>>q-7;y+=1)a[256*f+l]=g[q][t]|q+1<<8,l+=1;if(256<=l){if(256<l)throw Error("ERROR: Huffman table error(1)!");l=0;f+=1}}};"undefined"!==typeof d&&
d.exports&&(d.exports=b.lossless.HuffmanTable)},{"./data-stream.js":4,"./utils.js":12}],8:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.ComponentSpec=b.lossless.ComponentSpec||("undefined"!==typeof a?a("./component-spec.js"):null);b.lossless.DataStream=b.lossless.DataStream||("undefined"!==typeof a?a("./data-stream.js"):null);b.lossless.Decoder=b.lossless.Decoder||("undefined"!==typeof a?a("./decoder.js"):null);b.lossless.FrameHeader=b.lossless.FrameHeader||("undefined"!==typeof a?
a("./frame-header.js"):null);b.lossless.HuffmanTable=b.lossless.HuffmanTable||("undefined"!==typeof a?a("./huffman-table.js"):null);b.lossless.QuantizationTable=b.lossless.QuantizationTable||("undefined"!==typeof a?a("./quantization-table.js"):null);b.lossless.ScanComponent=b.lossless.ScanComponent||("undefined"!==typeof a?a("./scan-component.js"):null);b.lossless.ScanHeader=b.lossless.ScanHeader||("undefined"!==typeof a?a("./scan-header.js"):null);b.lossless.Utils=b.lossless.Utils||("undefined"!==
typeof a?a("./utils.js"):null);"undefined"!==typeof d&&d.exports&&(d.exports=b)},{"./component-spec.js":3,"./data-stream.js":4,"./decoder.js":5,"./frame-header.js":6,"./huffman-table.js":7,"./quantization-table.js":9,"./scan-component.js":10,"./scan-header.js":11,"./utils.js":12}],9:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.DataStream=b.lossless.DataStream||("undefined"!==typeof a?a("./data-stream.js"):null);b.lossless.Utils=b.lossless.Utils||("undefined"!==typeof a?a("./utils.js"):
null);b.lossless.QuantizationTable=b.lossless.QuantizationTable||function(){this.precision=[];this.tq=[];this.quantTables=b.lossless.Utils.createArray(4,64);this.tq[0]=0;this.tq[1]=0;this.tq[2]=0;this.tq[3]=0};b.lossless.QuantizationTable.enhanceQuantizationTable=function(a,b){var d;for(d=0;8>d;d+=1)a[b[0+d]]*=90,a[b[32+d]]*=90,a[b[16+d]]*=118,a[b[48+d]]*=49,a[b[40+d]]*=71,a[b[8+d]]*=126,a[b[56+d]]*=25,a[b[24+d]]*=106;for(d=0;8>d;d+=1)a[b[0+8*d]]*=90,a[b[4+8*d]]*=90,a[b[2+8*d]]*=118,a[b[6+8*d]]*=
49,a[b[5+8*d]]*=71,a[b[1+8*d]]*=126,a[b[7+8*d]]*=25,a[b[3+8*d]]*=106;for(d=0;64>d;d+=1)a[d]>>=6};b.lossless.QuantizationTable.prototype.read=function(a,d){var g=0,f,l,q;f=a.get16();for(g+=2;g<f;){l=a.get8();g+=1;q=l&15;if(3<q)throw Error("ERROR: Quantization table ID > 3");this.precision[q]=l>>4;if(0===this.precision[q])this.precision[q]=8;else if(1===this.precision[q])this.precision[q]=16;else throw Error("ERROR: Quantization table precision error");this.tq[q]=1;if(8===this.precision[q])for(l=0;64>
l;l+=1){if(g>f)throw Error("ERROR: Quantization table format error");this.quantTables[q][l]=a.get8();g+=1}else for(l=0;64>l;l+=1){if(g>f)throw Error("ERROR: Quantization table format error");this.quantTables[q][l]=a.get16();g+=2}b.lossless.QuantizationTable.enhanceQuantizationTable(this.quantTables[q],d)}if(g!==f)throw Error("ERROR: Quantization table error [count!=Lq]");return 1};"undefined"!==typeof d&&d.exports&&(d.exports=b.lossless.QuantizationTable)},{"./data-stream.js":4,"./utils.js":12}],
10:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.ScanComponent=b.lossless.ScanComponent||function(){this.scanCompSel=this.dcTabSel=this.acTabSel=0};"undefined"!==typeof d&&d.exports&&(d.exports=b.lossless.ScanComponent)},{}],11:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.DataStream=b.lossless.DataStream||("undefined"!==typeof a?a("./data-stream.js"):null);b.lossless.ScanComponent=b.lossless.ScanComponent||("undefined"!==typeof a?a("./scan-component.js"):null);
b.lossless.ScanHeader=b.lossless.ScanHeader||function(){this.spectralEnd=this.selection=this.numComp=this.al=this.ah=0;this.components=[]};b.lossless.ScanHeader.prototype.read=function(a){var d=0,g,f,l;g=a.get16();d+=2;this.numComp=a.get8();d+=1;for(f=0;f<this.numComp;f+=1){this.components[f]=new b.lossless.ScanComponent;if(d>g)throw Error("ERROR: scan header format error");this.components[f].scanCompSel=a.get8();d+=1;l=a.get8();d+=1;this.components[f].dcTabSel=l>>4;this.components[f].acTabSel=l&
15}this.selection=a.get8();d+=1;this.spectralEnd=a.get8();d+=1;l=a.get8();this.ah=l>>4;this.al=l&15;if(d+1!==g)throw Error("ERROR: scan header format error [count!=Ns]");return 1};"undefined"!==typeof d&&d.exports&&(d.exports=b.lossless.ScanHeader)},{"./data-stream.js":4,"./scan-component.js":10}],12:[function(a,d,f){var b=b||{};b.lossless=b.lossless||{};b.lossless.Utils=b.lossless.Utils||{};b.lossless.Utils.createArray=function(a){var d=Array(a||0),g=a;if(1<arguments.length)for(var f=Array.prototype.slice.call(arguments,
1);g--;)d[a-1-g]=b.lossless.Utils.createArray.apply(this,f);return d};b.lossless.Utils.makeCRCTable=function(){for(var a,b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>>1:a>>>1;b[d]=a}return b};b.lossless.Utils.crc32=function(a){for(var d=b.lossless.Utils.crcTable||(b.lossless.Utils.crcTable=b.lossless.Utils.makeCRCTable()),g=-1,f=0;f<a.byteLength;f++)g=g>>>8^d[(g^a.getUint8(f))&255];return(g^-1)>>>0};"undefined"!==typeof d&&d.exports&&(d.exports=b.lossless.Utils)},{}],13:[function(a,
d,f){f=a("./lib/utils/common").assign;var b=a("./lib/deflate"),e=a("./lib/inflate");a=a("./lib/zlib/constants");var h={};f(h,b,e,a);d.exports=h},{"./lib/deflate":14,"./lib/inflate":15,"./lib/utils/common":16,"./lib/zlib/constants":19}],14:[function(a,d,f){function b(a,b){var d=new t(b);d.push(a,!0);if(d.err)throw d.msg;return d.result}var e=a("./zlib/deflate.js"),h=a("./utils/common"),g=a("./utils/strings"),k=a("./zlib/messages"),l=a("./zlib/zstream"),q=Object.prototype.toString,t=function(a){a=this.options=
h.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},a||{});a.raw&&0<a.windowBits?a.windowBits=-a.windowBits:a.gzip&&0<a.windowBits&&16>a.windowBits&&(a.windowBits+=16);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new l;this.strm.avail_out=0;var b=e.deflateInit2(this.strm,a.level,a.method,a.windowBits,a.memLevel,a.strategy);if(0!==b)throw Error(k[b]);a.header&&e.deflateSetHeader(this.strm,a.header)};t.prototype.push=function(a,b){var d=this.strm,
f=this.options.chunkSize,k,l;if(this.ended)return!1;l=b===~~b?b:!0===b?4:0;"string"===typeof a?d.input=g.string2buf(a):"[object ArrayBuffer]"===q.call(a)?d.input=new Uint8Array(a):d.input=a;d.next_in=0;d.avail_in=d.input.length;do{0===d.avail_out&&(d.output=new h.Buf8(f),d.next_out=0,d.avail_out=f);k=e.deflate(d,l);if(1!==k&&0!==k)return this.onEnd(k),this.ended=!0,!1;if(0===d.avail_out||0===d.avail_in&&(4===l||2===l))if("string"===this.options.to)this.onData(g.buf2binstring(h.shrinkBuf(d.output,
d.next_out)));else this.onData(h.shrinkBuf(d.output,d.next_out))}while((0<d.avail_in||0===d.avail_out)&&1!==k);if(4===l)return k=e.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,0===k;2===l&&(this.onEnd(0),d.avail_out=0);return!0};t.prototype.onData=function(a){this.chunks.push(a)};t.prototype.onEnd=function(a){0===a&&(this.result="string"===this.options.to?this.chunks.join(""):h.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};f.Deflate=t;f.deflate=b;f.deflateRaw=
function(a,d){d=d||{};d.raw=!0;return b(a,d)};f.gzip=function(a,d){d=d||{};d.gzip=!0;return b(a,d)}},{"./utils/common":16,"./utils/strings":17,"./zlib/deflate.js":21,"./zlib/messages":26,"./zlib/zstream":28}],15:[function(a,d,f){function b(a,b){var d=new B(b);d.push(a,!0);if(d.err)throw d.msg;return d.result}var e=a("./zlib/inflate.js"),h=a("./utils/common"),g=a("./utils/strings"),k=a("./zlib/constants"),l=a("./zlib/messages"),q=a("./zlib/zstream"),t=a("./zlib/gzheader"),y=Object.prototype.toString,
B=function(a){var b=this.options=h.assign({chunkSize:16384,windowBits:0,to:""},a||{});b.raw&&0<=b.windowBits&&16>b.windowBits&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowBits=-15));!(0<=b.windowBits&&16>b.windowBits)||a&&a.windowBits||(b.windowBits+=32);15<b.windowBits&&48>b.windowBits&&0===(b.windowBits&15)&&(b.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new q;this.strm.avail_out=0;a=e.inflateInit2(this.strm,b.windowBits);if(a!==k.Z_OK)throw Error(l[a]);
this.header=new t;e.inflateGetHeader(this.strm,this.header)};B.prototype.push=function(a,b){var d=this.strm,f=this.options.chunkSize,l,q,n,t,B,E=!1;if(this.ended)return!1;q=b===~~b?b:!0===b?k.Z_FINISH:k.Z_NO_FLUSH;"string"===typeof a?d.input=g.binstring2buf(a):"[object ArrayBuffer]"===y.call(a)?d.input=new Uint8Array(a):d.input=a;d.next_in=0;d.avail_in=d.input.length;do{0===d.avail_out&&(d.output=new h.Buf8(f),d.next_out=0,d.avail_out=f);l=e.inflate(d,k.Z_NO_FLUSH);l===k.Z_BUF_ERROR&&!0===E&&(l=k.Z_OK,
E=!1);if(l!==k.Z_STREAM_END&&l!==k.Z_OK)return this.onEnd(l),this.ended=!0,!1;if(d.next_out&&(0===d.avail_out||l===k.Z_STREAM_END||0===d.avail_in&&(q===k.Z_FINISH||q===k.Z_SYNC_FLUSH)))if("string"===this.options.to)n=g.utf8border(d.output,d.next_out),t=d.next_out-n,B=g.buf2string(d.output,n),d.next_out=t,d.avail_out=f-t,t&&h.arraySet(d.output,d.output,n,t,0),this.onData(B);else this.onData(h.shrinkBuf(d.output,d.next_out));0===d.avail_in&&0===d.avail_out&&(E=!0)}while((0<d.avail_in||0===d.avail_out)&&
l!==k.Z_STREAM_END);l===k.Z_STREAM_END&&(q=k.Z_FINISH);if(q===k.Z_FINISH)return l=e.inflateEnd(this.strm),this.onEnd(l),this.ended=!0,l===k.Z_OK;q===k.Z_SYNC_FLUSH&&(this.onEnd(k.Z_OK),d.avail_out=0);return!0};B.prototype.onData=function(a){this.chunks.push(a)};B.prototype.onEnd=function(a){a===k.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):h.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};f.Inflate=B;f.inflate=b;f.inflateRaw=function(a,d){d=d||
{};d.raw=!0;return b(a,d)};f.ungzip=b},{"./utils/common":16,"./utils/strings":17,"./zlib/constants":19,"./zlib/gzheader":22,"./zlib/inflate.js":24,"./zlib/messages":26,"./zlib/zstream":28}],16:[function(a,d,f){a="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;f.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var d=b.shift();if(d){if("object"!==typeof d)throw new TypeError(d+"must be non-object");for(var e in d)d.hasOwnProperty(e)&&
(a[e]=d[e])}}return a};f.shrinkBuf=function(a,b){if(a.length===b)return a;if(a.subarray)return a.subarray(0,b);a.length=b;return a};var b={arraySet:function(a,b,d,e,f){if(b.subarray&&a.subarray)a.set(b.subarray(d,d+e),f);else for(var t=0;t<e;t++)a[f+t]=b[d+t]},flattenChunks:function(a){var b,d,e,f,t;b=e=0;for(d=a.length;b<d;b++)e+=a[b].length;t=new Uint8Array(e);b=e=0;for(d=a.length;b<d;b++)f=a[b],t.set(f,e),e+=f.length;return t}},e={arraySet:function(a,b,d,e,f){for(var t=0;t<e;t++)a[f+t]=b[d+t]},
flattenChunks:function(a){return[].concat.apply([],a)}};f.setTyped=function(a){a?(f.Buf8=Uint8Array,f.Buf16=Uint16Array,f.Buf32=Int32Array,f.assign(f,b)):(f.Buf8=Array,f.Buf16=Array,f.Buf32=Array,f.assign(f,e))};f.setTyped(a)},{}],17:[function(a,d,f){function b(a,b){if(65537>b&&(a.subarray&&g||!a.subarray&&h))return String.fromCharCode.apply(null,e.shrinkBuf(a,b));for(var d="",f=0;f<b;f++)d+=String.fromCharCode(a[f]);return d}var e=a("./common"),h=!0,g=!0;try{String.fromCharCode.apply(null,[0])}catch(k){h=
!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(l){g=!1}var q=new e.Buf8(256);for(a=0;256>a;a++)q[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;q[254]=q[254]=1;f.string2buf=function(a){var b,d,h,f,g,k=a.length,l=0;for(f=0;f<k;f++)d=a.charCodeAt(f),55296===(d&64512)&&f+1<k&&(h=a.charCodeAt(f+1),56320===(h&64512)&&(d=65536+(d-55296<<10)+(h-56320),f++)),l+=128>d?1:2048>d?2:65536>d?3:4;b=new e.Buf8(l);for(f=g=0;g<l;f++)d=a.charCodeAt(f),55296===(d&64512)&&f+1<k&&(h=a.charCodeAt(f+1),
56320===(h&64512)&&(d=65536+(d-55296<<10)+(h-56320),f++)),128>d?b[g++]=d:(2048>d?b[g++]=192|d>>>6:(65536>d?b[g++]=224|d>>>12:(b[g++]=240|d>>>18,b[g++]=128|d>>>12&63),b[g++]=128|d>>>6&63),b[g++]=128|d&63);return b};f.buf2binstring=function(a){return b(a,a.length)};f.binstring2buf=function(a){for(var b=new e.Buf8(a.length),d=0,h=b.length;d<h;d++)b[d]=a.charCodeAt(d);return b};f.buf2string=function(a,d){var e,h,f,g,k=d||a.length,l=Array(2*k);for(e=h=0;e<k;)if(f=a[e++],128>f)l[h++]=f;else if(g=q[f],4<
g)l[h++]=65533,e+=g-1;else{for(f&=2===g?31:3===g?15:7;1<g&&e<k;)f=f<<6|a[e++]&63,g--;1<g?l[h++]=65533:65536>f?l[h++]=f:(f-=65536,l[h++]=55296|f>>10&1023,l[h++]=56320|f&1023)}return b(l,h)};f.utf8border=function(a,b){var d;b=b||a.length;b>a.length&&(b=a.length);for(d=b-1;0<=d&&128===(a[d]&192);)d--;return 0>d||0===d?b:d+q[a[d]]>b?d:b}},{"./common":16}],18:[function(a,d,f){d.exports=function(a,d,h,f){var k=a&65535|0;a=a>>>16&65535|0;for(var l=0;0!==h;){l=2E3<h?2E3:h;h-=l;do k=k+d[f++]|0,a=a+k|0;while(--l);
k%=65521;a%=65521}return k|a<<16|0}},{}],19:[function(a,d,f){d.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}},{}],20:[function(a,d,f){var b=function(){for(var a,
b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>>1:a>>>1;b[d]=a}return b}();d.exports=function(a,d,f,k){f=k+f;for(a^=-1;k<f;k++)a=a>>>8^b[(a^d[k])&255];return a^-1}},{}],21:[function(a,d,f){function b(a,b){a.msg=w[b];return b}function e(a){for(var b=a.length;0<=--b;)a[b]=0}function h(a){var b=a.state,d=b.pending;d>a.avail_out&&(d=a.avail_out);0!==d&&(n.arraySet(a.output,b.pending_buf,b.pending_out,d,a.next_out),a.next_out+=d,b.pending_out+=d,a.total_out+=d,a.avail_out-=d,b.pending-=
d,0===b.pending&&(b.pending_out=0))}function g(a,b){G._tr_flush_block(a,0<=a.block_start?a.block_start:-1,a.strstart-a.block_start,b);a.block_start=a.strstart;h(a.strm)}function k(a,b){a.pending_buf[a.pending++]=b}function l(a,b){a.pending_buf[a.pending++]=b>>>8&255;a.pending_buf[a.pending++]=b&255}function q(a,b){var d=a.max_chain_length,e=a.strstart,h,n=a.prev_length,f=a.nice_match,g=a.strstart>a.w_size-262?a.strstart-(a.w_size-262):0,k=a.window,l=a.w_mask,q=a.prev,O=a.strstart+258,z=k[e+n-1],t=
k[e+n];a.prev_length>=a.good_match&&(d>>=2);f>a.lookahead&&(f=a.lookahead);do if(h=b,k[h+n]===t&&k[h+n-1]===z&&k[h]===k[e]&&k[++h]===k[e+1]){e+=2;for(h++;k[++e]===k[++h]&&k[++e]===k[++h]&&k[++e]===k[++h]&&k[++e]===k[++h]&&k[++e]===k[++h]&&k[++e]===k[++h]&&k[++e]===k[++h]&&k[++e]===k[++h]&&e<O;);h=258-(O-e);e=O-258;if(h>n){a.match_start=b;n=h;if(h>=f)break;z=k[e+n-1];t=k[e+n]}}while((b=q[b&l])>g&&0!==--d);return n<=a.lookahead?n:a.lookahead}function t(a){var b=a.w_size,d,e,h,f;do{f=a.window_size-a.lookahead-
a.strstart;if(a.strstart>=b+(b-262)){n.arraySet(a.window,a.window,b,b,0);a.match_start-=b;a.strstart-=b;a.block_start-=b;d=e=a.hash_size;do h=a.head[--d],a.head[d]=h>=b?h-b:0;while(--e);d=e=b;do h=a.prev[--d],a.prev[d]=h>=b?h-b:0;while(--e);f+=b}if(0===a.strm.avail_in)break;d=a.strm;e=a.window;h=a.strstart+a.lookahead;var g=d.avail_in;g>f&&(g=f);0===g?e=0:(d.avail_in-=g,n.arraySet(e,d.input,d.next_in,g,h),1===d.state.wrap?d.adler=K(d.adler,e,g,h):2===d.state.wrap&&(d.adler=E(d.adler,e,g,h)),d.next_in+=
g,d.total_in+=g,e=g);a.lookahead+=e;if(3<=a.lookahead+a.insert)for(f=a.strstart-a.insert,a.ins_h=a.window[f],a.ins_h=(a.ins_h<<a.hash_shift^a.window[f+1])&a.hash_mask;a.insert&&!(a.ins_h=(a.ins_h<<a.hash_shift^a.window[f+3-1])&a.hash_mask,a.prev[f&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=f,f++,a.insert--,3>a.lookahead+a.insert););}while(262>a.lookahead&&0!==a.strm.avail_in)}function y(a,b){for(var d;;){if(262>a.lookahead){t(a);if(262>a.lookahead&&0===b)return 1;if(0===a.lookahead)break}d=0;3<=a.lookahead&&
(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);0!==d&&a.strstart-d<=a.w_size-262&&(a.match_length=q(a,d));if(3<=a.match_length)if(d=G._tr_tally(a,a.strstart-a.match_start,a.match_length-3),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&3<=a.lookahead){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],
a.head[a.ins_h]=a.strstart;while(0!==--a.match_length);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else d=G._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(d&&(g(a,!1),0===a.strm.avail_out))return 1}a.insert=2>a.strstart?a.strstart:2;return 4===b?(g(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(g(a,!1),0===a.strm.avail_out)?1:2}function B(a,b){for(var d,e;;){if(262>a.lookahead){t(a);
if(262>a.lookahead&&0===b)return 1;if(0===a.lookahead)break}d=0;3<=a.lookahead&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);a.prev_length=a.match_length;a.prev_match=a.match_start;a.match_length=2;0!==d&&a.prev_length<a.max_lazy_match&&a.strstart-d<=a.w_size-262&&(a.match_length=q(a,d),5>=a.match_length&&(1===a.strategy||3===a.match_length&&4096<a.strstart-a.match_start)&&(a.match_length=2));if(3<=
a.prev_length&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-3;d=G._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-3);a.lookahead-=a.prev_length-1;a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(0!==--a.prev_length);a.match_available=0;a.match_length=2;a.strstart++;if(d&&(g(a,!1),0===a.strm.avail_out))return 1}else if(a.match_available){if((d=G._tr_tally(a,
0,a.window[a.strstart-1]))&&g(a,!1),a.strstart++,a.lookahead--,0===a.strm.avail_out)return 1}else a.match_available=1,a.strstart++,a.lookahead--}a.match_available&&(G._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0);a.insert=2>a.strstart?a.strstart:2;return 4===b?(g(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(g(a,!1),0===a.strm.avail_out)?1:2}function A(a,b){for(var d,e,h,n=a.window;;){if(258>=a.lookahead){t(a);if(258>=a.lookahead&&0===b)return 1;if(0===a.lookahead)break}a.match_length=
0;if(3<=a.lookahead&&0<a.strstart&&(e=a.strstart-1,d=n[e],d===n[++e]&&d===n[++e]&&d===n[++e])){for(h=a.strstart+258;d===n[++e]&&d===n[++e]&&d===n[++e]&&d===n[++e]&&d===n[++e]&&d===n[++e]&&d===n[++e]&&d===n[++e]&&e<h;);a.match_length=258-(h-e);a.match_length>a.lookahead&&(a.match_length=a.lookahead)}3<=a.match_length?(d=G._tr_tally(a,1,a.match_length-3),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(d=G._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++);if(d&&
(g(a,!1),0===a.strm.avail_out))return 1}a.insert=0;return 4===b?(g(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(g(a,!1),0===a.strm.avail_out)?1:2}function x(a,b){for(var d;;){if(0===a.lookahead&&(t(a),0===a.lookahead)){if(0===b)return 1;break}a.match_length=0;d=G._tr_tally(a,0,a.window[a.strstart]);a.lookahead--;a.strstart++;if(d&&(g(a,!1),0===a.strm.avail_out))return 1}a.insert=0;return 4===b?(g(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(g(a,!1),0===a.strm.avail_out)?1:2}function I(){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 n.Buf16(1146);this.dyn_dtree=new n.Buf16(122);this.bl_tree=new n.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 n.Buf16(16);this.heap=new n.Buf16(573);e(this.heap);this.heap_max=this.heap_len=0;this.depth=new n.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 F(a){var d;if(!a||!a.state)return b(a,-2);a.total_in=a.total_out=0;a.data_type=2;d=a.state;d.pending=0;d.pending_out=0;0>d.wrap&&(d.wrap=-d.wrap);d.status=d.wrap?42:113;a.adler=2===d.wrap?0:1;d.last_flush=0;G._tr_init(d);return 0}function z(a){var b=F(a);0===b&&(a=a.state,a.window_size=2*a.w_size,e(a.head),a.max_lazy_match=D[a.level].max_lazy,a.good_match=D[a.level].good_length,a.nice_match=D[a.level].nice_length,a.max_chain_length=D[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 L(a,d,e,h,f,g){if(!a)return-2;var k=1;-1===d&&(d=6);0>h?(k=0,h=-h):15<h&&(k=2,h-=16);if(1>f||9<f||8!==e||8>h||15<h||0>d||9<d||0>g||4<g)return b(a,-2);8===h&&(h=9);var l=new I;a.state=l;l.strm=a;l.wrap=k;l.gzhead=null;l.w_bits=h;l.w_size=1<<l.w_bits;l.w_mask=l.w_size-1;l.hash_bits=f+7;l.hash_size=1<<l.hash_bits;l.hash_mask=l.hash_size-1;l.hash_shift=~~((l.hash_bits+3-1)/3);l.window=
new n.Buf8(2*l.w_size);l.head=new n.Buf16(l.hash_size);l.prev=new n.Buf16(l.w_size);l.lit_bufsize=1<<f+6;l.pending_buf_size=4*l.lit_bufsize;l.pending_buf=new n.Buf8(l.pending_buf_size);l.d_buf=l.lit_bufsize>>1;l.l_buf=3*l.lit_bufsize;l.level=d;l.strategy=g;l.method=e;return z(a)}var n=a("../utils/common"),G=a("./trees"),K=a("./adler32"),E=a("./crc32"),w=a("./messages");a=function(a,b,d,e,h){this.good_length=a;this.max_lazy=b;this.nice_length=d;this.max_chain=e;this.func=h};var D;D=[new a(0,0,0,0,
function(a,b){var d=65535;for(d>a.pending_buf_size-5&&(d=a.pending_buf_size-5);;){if(1>=a.lookahead){t(a);if(0===a.lookahead&&0===b)return 1;if(0===a.lookahead)break}a.strstart+=a.lookahead;a.lookahead=0;var e=a.block_start+d;if(0===a.strstart||a.strstart>=e)if(a.lookahead=a.strstart-e,a.strstart=e,g(a,!1),0===a.strm.avail_out)return 1;if(a.strstart-a.block_start>=a.w_size-262&&(g(a,!1),0===a.strm.avail_out))return 1}a.insert=0;if(4===b)return g(a,!0),0===a.strm.avail_out?3:4;a.strstart>a.block_start&&
g(a,!1);return 1}),new a(4,4,8,4,y),new a(4,5,16,8,y),new a(4,6,32,32,y),new a(4,4,16,16,B),new a(8,16,32,32,B),new a(8,16,128,128,B),new a(8,32,128,256,B),new a(32,128,258,1024,B),new a(32,258,258,4096,B)];f.deflateInit=function(a,b){return L(a,b,8,15,8,0)};f.deflateInit2=L;f.deflateReset=z;f.deflateResetKeep=F;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,d){var n,f,g,q;if(!a||!a.state||5<d||0>d)return a?b(a,-2):-2;f=
a.state;if(!a.output||!a.input&&0!==a.avail_in||666===f.status&&4!==d)return b(a,0===a.avail_out?-5:-2);f.strm=a;n=f.last_flush;f.last_flush=d;42===f.status&&(2===f.wrap?(a.adler=0,k(f,31),k(f,139),k(f,8),f.gzhead?(k(f,(f.gzhead.text?1:0)+(f.gzhead.hcrc?2:0)+(f.gzhead.extra?4:0)+(f.gzhead.name?8:0)+(f.gzhead.comment?16:0)),k(f,f.gzhead.time&255),k(f,f.gzhead.time>>8&255),k(f,f.gzhead.time>>16&255),k(f,f.gzhead.time>>24&255),k(f,9===f.level?2:2<=f.strategy||2>f.level?4:0),k(f,f.gzhead.os&255),f.gzhead.extra&&
f.gzhead.extra.length&&(k(f,f.gzhead.extra.length&255),k(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(a.adler=E(a.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=69):(k(f,0),k(f,0),k(f,0),k(f,0),k(f,0),k(f,9===f.level?2:2<=f.strategy||2>f.level?4:0),k(f,3),f.status=113)):(g=8+(f.w_bits-8<<4)<<8,q=-1,q=2<=f.strategy||2>f.level?0:6>f.level?1:6===f.level?2:3,g|=q<<6,0!==f.strstart&&(g|=32),f.status=113,l(f,g+(31-g%31)),0!==f.strstart&&(l(f,a.adler>>>16),l(f,a.adler&65535)),a.adler=1));if(69===
f.status)if(f.gzhead.extra){for(g=f.pending;f.gzindex<(f.gzhead.extra.length&65535)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>g&&(a.adler=E(a.adler,f.pending_buf,f.pending-g,g)),h(a),g=f.pending,f.pending!==f.pending_buf_size));)k(f,f.gzhead.extra[f.gzindex]&255),f.gzindex++;f.gzhead.hcrc&&f.pending>g&&(a.adler=E(a.adler,f.pending_buf,f.pending-g,g));f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=73)}else f.status=73;if(73===f.status)if(f.gzhead.name){g=f.pending;do{if(f.pending===
f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>g&&(a.adler=E(a.adler,f.pending_buf,f.pending-g,g)),h(a),g=f.pending,f.pending===f.pending_buf_size)){q=1;break}q=f.gzindex<f.gzhead.name.length?f.gzhead.name.charCodeAt(f.gzindex++)&255:0;k(f,q)}while(0!==q);f.gzhead.hcrc&&f.pending>g&&(a.adler=E(a.adler,f.pending_buf,f.pending-g,g));0===q&&(f.gzindex=0,f.status=91)}else f.status=91;if(91===f.status)if(f.gzhead.comment){g=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>g&&(a.adler=
E(a.adler,f.pending_buf,f.pending-g,g)),h(a),g=f.pending,f.pending===f.pending_buf_size)){q=1;break}q=f.gzindex<f.gzhead.comment.length?f.gzhead.comment.charCodeAt(f.gzindex++)&255:0;k(f,q)}while(0!==q);f.gzhead.hcrc&&f.pending>g&&(a.adler=E(a.adler,f.pending_buf,f.pending-g,g));0===q&&(f.status=103)}else f.status=103;103===f.status&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&h(a),f.pending+2<=f.pending_buf_size&&(k(f,a.adler&255),k(f,a.adler>>8&255),a.adler=0,f.status=113)):f.status=113);if(0!==
f.pending){if(h(a),0===a.avail_out)return f.last_flush=-1,0}else if(0===a.avail_in&&(d<<1)-(4<d?9:0)<=(n<<1)-(4<n?9:0)&&4!==d)return b(a,-5);if(666===f.status&&0!==a.avail_in)return b(a,-5);if(0!==a.avail_in||0!==f.lookahead||0!==d&&666!==f.status){n=2===f.strategy?x(f,d):3===f.strategy?A(f,d):D[f.level].func(f,d);if(3===n||4===n)f.status=666;if(1===n||3===n)return 0===a.avail_out&&(f.last_flush=-1),0;if(2===n&&(1===d?G._tr_align(f):5!==d&&(G._tr_stored_block(f,0,0,!1),3===d&&(e(f.head),0===f.lookahead&&
(f.strstart=0,f.block_start=0,f.insert=0))),h(a),0===a.avail_out))return f.last_flush=-1,0}if(4!==d)return 0;if(0>=f.wrap)return 1;2===f.wrap?(k(f,a.adler&255),k(f,a.adler>>8&255),k(f,a.adler>>16&255),k(f,a.adler>>24&255),k(f,a.total_in&255),k(f,a.total_in>>8&255),k(f,a.total_in>>16&255),k(f,a.total_in>>24&255)):(l(f,a.adler>>>16),l(f,a.adler&65535));h(a);0<f.wrap&&(f.wrap=-f.wrap);return 0!==f.pending?0:1};f.deflateEnd=function(a){var d;if(!a||!a.state)return-2;d=a.state.status;if(42!==d&&69!==d&&
73!==d&&91!==d&&103!==d&&113!==d&&666!==d)return b(a,-2);a.state=null;return 113===d?b(a,-3):0};f.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":16,"./adler32":18,"./crc32":20,"./messages":26,"./trees":27}],22:[function(a,d,f){d.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}},{}],23:[function(a,d,f){d.exports=function(a,d){var h,f,k,l,q,t,y,B,A,x,I,F,z,L,n,G,K,E,w,D,u,m,p,J;h=a.state;
f=a.next_in;p=a.input;k=f+(a.avail_in-5);l=a.next_out;J=a.output;q=l-(d-a.avail_out);t=l+(a.avail_out-257);y=h.dmax;B=h.wsize;A=h.whave;x=h.wnext;I=h.window;F=h.hold;z=h.bits;L=h.lencode;n=h.distcode;G=(1<<h.lenbits)-1;K=(1<<h.distbits)-1;a:do b:for(15>z&&(F+=p[f++]<<z,z+=8,F+=p[f++]<<z,z+=8),E=L[F&G];;){w=E>>>24;F>>>=w;z-=w;w=E>>>16&255;if(0===w)J[l++]=E&65535;else if(w&16){D=E&65535;if(w&=15)z<w&&(F+=p[f++]<<z,z+=8),D+=F&(1<<w)-1,F>>>=w,z-=w;15>z&&(F+=p[f++]<<z,z+=8,F+=p[f++]<<z,z+=8);E=n[F&K];
c:for(;;){w=E>>>24;F>>>=w;z-=w;w=E>>>16&255;if(w&16){E&=65535;w&=15;z<w&&(F+=p[f++]<<z,z+=8,z<w&&(F+=p[f++]<<z,z+=8));E+=F&(1<<w)-1;if(E>y){a.msg="invalid distance too far back";h.mode=30;break a}F>>>=w;z-=w;w=l-q;if(E>w){w=E-w;if(w>A&&h.sane){a.msg="invalid distance too far back";h.mode=30;break a}u=0;m=I;if(0===x){if(u+=B-w,w<D){D-=w;do J[l++]=I[u++];while(--w);u=l-E;m=J}}else if(x<w){if(u+=B+x-w,w-=x,w<D){D-=w;do J[l++]=I[u++];while(--w);u=0;if(x<D){w=x;D-=w;do J[l++]=I[u++];while(--w);u=l-E;m=
J}}}else if(u+=x-w,w<D){D-=w;do J[l++]=I[u++];while(--w);u=l-E;m=J}for(;2<D;)J[l++]=m[u++],J[l++]=m[u++],J[l++]=m[u++],D-=3;D&&(J[l++]=m[u++],1<D&&(J[l++]=m[u++]))}else{u=l-E;do J[l++]=J[u++],J[l++]=J[u++],J[l++]=J[u++],D-=3;while(2<D);D&&(J[l++]=J[u++],1<D&&(J[l++]=J[u++]))}}else if(0===(w&64)){E=n[(E&65535)+(F&(1<<w)-1)];continue c}else{a.msg="invalid distance code";h.mode=30;break a}break}}else if(0===(w&64)){E=L[(E&65535)+(F&(1<<w)-1)];continue b}else{w&32?h.mode=12:(a.msg="invalid literal/length code",
h.mode=30);break a}break}while(f<k&&l<t);D=z>>3;f-=D;z-=D<<3;a.next_in=f;a.next_out=l;a.avail_in=f<k?5+(k-f):5-(f-k);a.avail_out=l<t?257+(t-l):257-(l-t);h.hold=F&(1<<z)-1;h.bits=z}},{}],24:[function(a,d,f){function b(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 q.Buf16(320);this.work=new q.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function h(a){var b;if(!a||!a.state)return-2;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 q.Buf32(852);b.distcode=b.distdyn=
new q.Buf32(592);b.sane=1;b.back=-1;return 0}function g(a){var b;if(!a||!a.state)return-2;b=a.state;b.wsize=0;b.whave=0;b.wnext=0;return h(a)}function k(a,b){var d,e;if(!a||!a.state)return-2;e=a.state;0>b?(d=0,b=-b):(d=(b>>4)+1,48>b&&(b&=15));if(b&&(8>b||15<b))return-2;null!==e.window&&e.wbits!==b&&(e.window=null);e.wrap=d;e.wbits=b;return g(a)}function l(a,b){var d;if(!a)return-2;d=new e;a.state=d;d.window=null;d=k(a,b);0!==d&&(a.state=null);return d}var q=a("../utils/common"),t=a("./adler32"),y=
a("./crc32"),B=a("./inffast"),A=a("./inftrees"),x=!0,I,F;f.inflateReset=g;f.inflateReset2=k;f.inflateResetKeep=h;f.inflateInit=function(a){return l(a,15)};f.inflateInit2=l;f.inflate=function(a,d){var e,h,f,g,k,l,u,m,p,J,H,v,C,P,M=0,R,T,O,Q=new q.Buf8(4),U=[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;e=a.state;12===e.mode&&(e.mode=13);k=a.next_out;f=a.output;u=a.avail_out;g=a.next_in;h=a.input;l=a.avail_in;m=e.hold;p=e.bits;J=l;H=u;
O=0;a:for(;;)switch(e.mode){case 1:if(0===e.wrap){e.mode=13;break}for(;16>p;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}if(e.wrap&2&&35615===m){e.check=0;Q[0]=m&255;Q[1]=m>>>8&255;e.check=y(e.check,Q,2,0);p=m=0;e.mode=2;break}e.flags=0;e.head&&(e.head.done=!1);if(!(e.wrap&1)||(((m&255)<<8)+(m>>8))%31){a.msg="incorrect header check";e.mode=30;break}if(8!==(m&15)){a.msg="unknown compression method";e.mode=30;break}m>>>=4;p-=4;C=(m&15)+8;if(0===e.wbits)e.wbits=C;else if(C>e.wbits){a.msg="invalid window size";
e.mode=30;break}e.dmax=1<<C;a.adler=e.check=1;e.mode=m&512?10:12;p=m=0;break;case 2:for(;16>p;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}e.flags=m;if(8!==(e.flags&255)){a.msg="unknown compression method";e.mode=30;break}if(e.flags&57344){a.msg="unknown header flags set";e.mode=30;break}e.head&&(e.head.text=m>>8&1);e.flags&512&&(Q[0]=m&255,Q[1]=m>>>8&255,e.check=y(e.check,Q,2,0));p=m=0;e.mode=3;case 3:for(;32>p;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}e.head&&(e.head.time=m);e.flags&512&&(Q[0]=m&255,
Q[1]=m>>>8&255,Q[2]=m>>>16&255,Q[3]=m>>>24&255,e.check=y(e.check,Q,4,0));p=m=0;e.mode=4;case 4:for(;16>p;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}e.head&&(e.head.xflags=m&255,e.head.os=m>>8);e.flags&512&&(Q[0]=m&255,Q[1]=m>>>8&255,e.check=y(e.check,Q,2,0));p=m=0;e.mode=5;case 5:if(e.flags&1024){for(;16>p;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}e.length=m;e.head&&(e.head.extra_len=m);e.flags&512&&(Q[0]=m&255,Q[1]=m>>>8&255,e.check=y(e.check,Q,2,0));p=m=0}else e.head&&(e.head.extra=null);e.mode=6;
case 6:if(e.flags&1024&&(v=e.length,v>l&&(v=l),v&&(e.head&&(C=e.head.extra_len-e.length,e.head.extra||(e.head.extra=Array(e.head.extra_len)),q.arraySet(e.head.extra,h,g,v,C)),e.flags&512&&(e.check=y(e.check,h,v,g)),l-=v,g+=v,e.length-=v),e.length))break a;e.length=0;e.mode=7;case 7:if(e.flags&2048){if(0===l)break a;v=0;do C=h[g+v++],e.head&&C&&65536>e.length&&(e.head.name+=String.fromCharCode(C));while(C&&v<l);e.flags&512&&(e.check=y(e.check,h,v,g));l-=v;g+=v;if(C)break a}else e.head&&(e.head.name=
null);e.length=0;e.mode=8;case 8:if(e.flags&4096){if(0===l)break a;v=0;do C=h[g+v++],e.head&&C&&65536>e.length&&(e.head.comment+=String.fromCharCode(C));while(C&&v<l);e.flags&512&&(e.check=y(e.check,h,v,g));l-=v;g+=v;if(C)break a}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(e.flags&512){for(;16>p;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}if(m!==(e.check&65535)){a.msg="header crc mismatch";e.mode=30;break}p=m=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0);a.adler=e.check=0;e.mode=12;break;
case 10:for(;32>p;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}a.adler=e.check=b(m);p=m=0;e.mode=11;case 11:if(0===e.havedict)return a.next_out=k,a.avail_out=u,a.next_in=g,a.avail_in=l,e.hold=m,e.bits=p,2;a.adler=e.check=1;e.mode=12;case 12:if(5===d||6===d)break a;case 13:if(e.last){m>>>=p&7;p-=p&7;e.mode=27;break}for(;3>p;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}e.last=m&1;m>>>=1;--p;switch(m&3){case 0:e.mode=14;break;case 1:v=e;if(x){C=void 0;I=new q.Buf32(512);F=new q.Buf32(32);for(C=0;144>C;)v.lens[C++]=
8;for(;256>C;)v.lens[C++]=9;for(;280>C;)v.lens[C++]=7;for(;288>C;)v.lens[C++]=8;A(1,v.lens,0,288,I,0,v.work,{bits:9});for(C=0;32>C;)v.lens[C++]=5;A(2,v.lens,0,32,F,0,v.work,{bits:5});x=!1}v.lencode=I;v.lenbits=9;v.distcode=F;v.distbits=5;e.mode=20;if(6===d){m>>>=2;p-=2;break a}break;case 2:e.mode=17;break;case 3:a.msg="invalid block type",e.mode=30}m>>>=2;p-=2;break;case 14:m>>>=p&7;for(p-=p&7;32>p;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}if((m&65535)!==(m>>>16^65535)){a.msg="invalid stored block lengths";
e.mode=30;break}e.length=m&65535;p=m=0;e.mode=15;if(6===d)break a;case 15:e.mode=16;case 16:if(v=e.length){v>l&&(v=l);v>u&&(v=u);if(0===v)break a;q.arraySet(f,h,g,v,k);l-=v;g+=v;u-=v;k+=v;e.length-=v;break}e.mode=12;break;case 17:for(;14>p;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}e.nlen=(m&31)+257;m>>>=5;p-=5;e.ndist=(m&31)+1;m>>>=5;p-=5;e.ncode=(m&15)+4;m>>>=4;p-=4;if(286<e.nlen||30<e.ndist){a.msg="too many length or distance symbols";e.mode=30;break}e.have=0;e.mode=18;case 18:for(;e.have<e.ncode;){for(;3>
p;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}e.lens[U[e.have++]]=m&7;m>>>=3;p-=3}for(;19>e.have;)e.lens[U[e.have++]]=0;e.lencode=e.lendyn;e.lenbits=7;v={bits:e.lenbits};O=A(0,e.lens,0,19,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid code lengths set";e.mode=30;break}e.have=0;e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;;){M=e.lencode[m&(1<<e.lenbits)-1];v=M>>>24;M&=65535;if(v<=p)break;if(0===l)break a;l--;m+=h[g++]<<p;p+=8}if(16>M)m>>>=v,p-=v,e.lens[e.have++]=M;else{if(16===M){for(C=
v+2;p<C;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}m>>>=v;p-=v;if(0===e.have){a.msg="invalid bit length repeat";e.mode=30;break}C=e.lens[e.have-1];v=3+(m&3);m>>>=2;p-=2}else if(17===M){for(C=v+3;p<C;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}m>>>=v;p-=v;C=0;v=3+(m&7);m>>>=3;p-=3}else{for(C=v+7;p<C;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}m>>>=v;p-=v;C=0;v=11+(m&127);m>>>=7;p-=7}if(e.have+v>e.nlen+e.ndist){a.msg="invalid bit length repeat";e.mode=30;break}for(;v--;)e.lens[e.have++]=C}}if(30===e.mode)break;
if(0===e.lens[256]){a.msg="invalid code -- missing end-of-block";e.mode=30;break}e.lenbits=9;v={bits:e.lenbits};O=A(1,e.lens,0,e.nlen,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid literal/lengths set";e.mode=30;break}e.distbits=6;e.distcode=e.distdyn;v={bits:e.distbits};O=A(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,v);e.distbits=v.bits;if(O){a.msg="invalid distances set";e.mode=30;break}e.mode=20;if(6===d)break a;case 20:e.mode=21;case 21:if(6<=l&&258<=u){a.next_out=k;a.avail_out=
u;a.next_in=g;a.avail_in=l;e.hold=m;e.bits=p;B(a,H);k=a.next_out;f=a.output;u=a.avail_out;g=a.next_in;h=a.input;l=a.avail_in;m=e.hold;p=e.bits;12===e.mode&&(e.back=-1);break}for(e.back=0;;){M=e.lencode[m&(1<<e.lenbits)-1];v=M>>>24;C=M>>>16&255;M&=65535;if(v<=p)break;if(0===l)break a;l--;m+=h[g++]<<p;p+=8}if(C&&0===(C&240)){P=v;R=C;for(T=M;;){M=e.lencode[T+((m&(1<<P+R)-1)>>P)];v=M>>>24;C=M>>>16&255;M&=65535;if(P+v<=p)break;if(0===l)break a;l--;m+=h[g++]<<p;p+=8}m>>>=P;p-=P;e.back+=P}m>>>=v;p-=v;e.back+=
v;e.length=M;if(0===C){e.mode=26;break}if(C&32){e.back=-1;e.mode=12;break}if(C&64){a.msg="invalid literal/length code";e.mode=30;break}e.extra=C&15;e.mode=22;case 22:if(e.extra){for(C=e.extra;p<C;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}e.length+=m&(1<<e.extra)-1;m>>>=e.extra;p-=e.extra;e.back+=e.extra}e.was=e.length;e.mode=23;case 23:for(;;){M=e.distcode[m&(1<<e.distbits)-1];v=M>>>24;C=M>>>16&255;M&=65535;if(v<=p)break;if(0===l)break a;l--;m+=h[g++]<<p;p+=8}if(0===(C&240)){P=v;R=C;for(T=M;;){M=e.distcode[T+
((m&(1<<P+R)-1)>>P)];v=M>>>24;C=M>>>16&255;M&=65535;if(P+v<=p)break;if(0===l)break a;l--;m+=h[g++]<<p;p+=8}m>>>=P;p-=P;e.back+=P}m>>>=v;p-=v;e.back+=v;if(C&64){a.msg="invalid distance code";e.mode=30;break}e.offset=M;e.extra=C&15;e.mode=24;case 24:if(e.extra){for(C=e.extra;p<C;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}e.offset+=m&(1<<e.extra)-1;m>>>=e.extra;p-=e.extra;e.back+=e.extra}if(e.offset>e.dmax){a.msg="invalid distance too far back";e.mode=30;break}e.mode=25;case 25:if(0===u)break a;v=H-u;
if(e.offset>v){v=e.offset-v;if(v>e.whave&&e.sane){a.msg="invalid distance too far back";e.mode=30;break}v>e.wnext?(v-=e.wnext,C=e.wsize-v):C=e.wnext-v;v>e.length&&(v=e.length);P=e.window}else P=f,C=k-e.offset,v=e.length;v>u&&(v=u);u-=v;e.length-=v;do f[k++]=P[C++];while(--v);0===e.length&&(e.mode=21);break;case 26:if(0===u)break a;f[k++]=e.length;u--;e.mode=21;break;case 27:if(e.wrap){for(;32>p;){if(0===l)break a;l--;m|=h[g++]<<p;p+=8}H-=u;a.total_out+=H;e.total+=H;H&&(a.adler=e.check=e.flags?y(e.check,
f,H,k-H):t(e.check,f,H,k-H));H=u;if((e.flags?m:b(m))!==e.check){a.msg="incorrect data check";e.mode=30;break}p=m=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;32>p;){if(0===l)break a;l--;m+=h[g++]<<p;p+=8}if(m!==(e.total&4294967295)){a.msg="incorrect length check";e.mode=30;break}p=m=0}e.mode=29;case 29:O=1;break a;case 30:O=-3;break a;case 31:return-4;default:return-2}a.next_out=k;a.avail_out=u;a.next_in=g;a.avail_in=l;e.hold=m;e.bits=p;if(e.wsize||H!==a.avail_out&&30>e.mode&&(27>e.mode||4!==d))h=
a.output,g=a.next_out,k=H-a.avail_out,u=a.state,null===u.window&&(u.wsize=1<<u.wbits,u.wnext=0,u.whave=0,u.window=new q.Buf8(u.wsize)),k>=u.wsize?(q.arraySet(u.window,h,g-u.wsize,u.wsize,0),u.wnext=0,u.whave=u.wsize):(l=u.wsize-u.wnext,l>k&&(l=k),q.arraySet(u.window,h,g-k,l,u.wnext),(k-=l)?(q.arraySet(u.window,h,g-k,k,0),u.wnext=k,u.whave=u.wsize):(u.wnext+=l,u.wnext===u.wsize&&(u.wnext=0),u.whave<u.wsize&&(u.whave+=l)));J-=a.avail_in;H-=a.avail_out;a.total_in+=J;a.total_out+=H;e.total+=H;e.wrap&&
H&&(a.adler=e.check=e.flags?y(e.check,f,H,a.next_out-H):t(e.check,f,H,a.next_out-H));a.data_type=e.bits+(e.last?64:0)+(12===e.mode?128:0)+(20===e.mode||15===e.mode?256:0);(0===J&&0===H||4===d)&&0===O&&(O=-5);return O};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){var e;if(!a||!a.state)return-2;e=a.state;if(0===(e.wrap&2))return-2;e.head=b;b.done=!1;return 0};f.inflateInfo="pako inflate (from Nodeca project)"},
{"../utils/common":16,"./adler32":18,"./crc32":20,"./inffast":23,"./inftrees":25}],25:[function(a,d,f){var b=a("../utils/common"),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],h=[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],g=[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],k=[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];d.exports=function(a,d,f,y,B,A,x,I){for(var F=I.bits,z=0,L=0,n=0,G=0,K=0,E=0,w=0,D=0,u=0,m=0,p,J,H=null,v=0,C,P=new b.Buf16(16),E=new b.Buf16(16),M=null,R=0,T,O,Q,z=0;15>=z;z++)P[z]=0;for(L=0;L<y;L++)P[d[f+L]]++;K=F;for(G=15;1<=G&&0===P[G];G--);K>G&&(K=G);if(0===G)return B[A++]=20971520,B[A++]=20971520,I.bits=1,0;for(n=1;n<G&&0===P[n];n++);K<n&&(K=n);for(z=D=1;15>=z;z++)if(D<<=1,D-=P[z],0>D)return-1;if(0<D&&(0===a||1!==G))return-1;E[1]=0;for(z=1;15>z;z++)E[z+
1]=E[z]+P[z];for(L=0;L<y;L++)0!==d[f+L]&&(x[E[d[f+L]]++]=L);0===a?(H=M=x,C=19):1===a?(H=e,v-=257,M=h,R-=257,C=256):(H=g,M=k,C=-1);L=m=0;z=n;F=A;E=K;w=0;J=-1;u=1<<K;y=u-1;if(1===a&&852<u||2===a&&592<u)return 1;for(var U=0;;){U++;T=z-w;x[L]<C?(O=0,Q=x[L]):x[L]>C?(O=M[R+x[L]],Q=H[v+x[L]]):(O=96,Q=0);D=1<<z-w;n=p=1<<E;do p-=D,B[F+(m>>w)+p]=T<<24|O<<16|Q|0;while(0!==p);for(D=1<<z-1;m&D;)D>>=1;0!==D?(m&=D-1,m+=D):m=0;L++;if(0===--P[z]){if(z===G)break;z=d[f+x[L]]}if(z>K&&(m&y)!==J){0===w&&(w=K);F+=n;E=z-
w;for(D=1<<E;E+w<G;){D-=P[E+w];if(0>=D)break;E++;D<<=1}u+=1<<E;if(1===a&&852<u||2===a&&592<u)return 1;J=m&y;B[J]=K<<24|E<<16|F-A|0}}0!==m&&(B[F+m]=z-w<<24|4194304);I.bits=K;return 0}},{"../utils/common":16}],26:[function(a,d,f){d.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"}},{}],27:[function(a,d,f){function b(a){for(var b=a.length;0<=--b;)a[b]=0}function e(a,b){a.pending_buf[a.pending++]=
b&255;a.pending_buf[a.pending++]=b>>>8&255}function h(a,b,d){a.bi_valid>16-d?(a.bi_buf|=b<<a.bi_valid&65535,e(a,a.bi_buf),a.bi_buf=b>>16-a.bi_valid,a.bi_valid+=d-16):(a.bi_buf|=b<<a.bi_valid&65535,a.bi_valid+=d)}function g(a,b,e){h(a,e[2*b],e[2*b+1])}function k(a,b){var e=0;do e|=a&1,a>>>=1,e<<=1;while(0<--b);return e>>>1}function l(a,b,e){var d=Array(16),h=0,f;for(f=1;15>=f;f++)d[f]=h=h+e[f-1]<<1;for(e=0;e<=b;e++)h=a[2*e+1],0!==h&&(a[2*e]=k(d[h]++,h))}function q(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 t(a){8<a.bi_valid?e(a,a.bi_buf):0<a.bi_valid&&(a.pending_buf[a.pending++]=a.bi_buf);a.bi_buf=0;a.bi_valid=0}function y(a,b,e,d){var h=2*b,f=2*e;return a[h]<a[f]||a[h]===a[f]&&d[b]<=d[e]}function B(a,b,e){for(var d=a.heap[e],h=e<<1;h<=a.heap_len;){h<a.heap_len&&y(b,a.heap[h+1],a.heap[h],a.depth)&&h++;if(y(b,d,a.heap[h],a.depth))break;a.heap[e]=a.heap[h];
e=h;h<<=1}a.heap[e]=d}function A(a,b,e){var d,f,n=0,k,l;if(0!==a.last_lit){do d=a.pending_buf[a.d_buf+2*n]<<8|a.pending_buf[a.d_buf+2*n+1],f=a.pending_buf[a.l_buf+n],n++,0===d?g(a,f,b):(k=p[f],g(a,k+256+1,b),l=G[k],0!==l&&(f-=J[k],h(a,f,l)),d--,k=256>d?m[d]:m[256+(d>>>7)],g(a,k,e),l=K[k],0!==l&&(d-=H[k],h(a,d,l)));while(n<a.last_lit)}g(a,256,b)}function x(a,b){var e=b.dyn_tree,d=b.stat_desc.static_tree,h=b.stat_desc.has_stree,f=b.stat_desc.elems,g,n=-1,m;a.heap_len=0;a.heap_max=573;for(g=0;g<f;g++)0!==
e[2*g]?(a.heap[++a.heap_len]=n=g,a.depth[g]=0):e[2*g+1]=0;for(;2>a.heap_len;)m=a.heap[++a.heap_len]=2>n?++n:0,e[2*m]=1,a.depth[m]=0,a.opt_len--,h&&(a.static_len-=d[2*m+1]);b.max_code=n;for(g=a.heap_len>>1;1<=g;g--)B(a,e,g);m=f;do g=a.heap[1],a.heap[1]=a.heap[a.heap_len--],B(a,e,1),d=a.heap[1],a.heap[--a.heap_max]=g,a.heap[--a.heap_max]=d,e[2*m]=e[2*g]+e[2*d],a.depth[m]=(a.depth[g]>=a.depth[d]?a.depth[g]:a.depth[d])+1,e[2*g+1]=e[2*d+1]=m,a.heap[1]=m++,B(a,e,1);while(2<=a.heap_len);a.heap[--a.heap_max]=
a.heap[1];g=b.dyn_tree;m=b.max_code;for(var k=b.stat_desc.static_tree,u=b.stat_desc.has_stree,p=b.stat_desc.extra_bits,q=b.stat_desc.extra_base,C=b.stat_desc.max_length,t,z,v=0,f=0;15>=f;f++)a.bl_count[f]=0;g[2*a.heap[a.heap_max]+1]=0;for(d=a.heap_max+1;573>d;d++)h=a.heap[d],f=g[2*g[2*h+1]+1]+1,f>C&&(f=C,v++),g[2*h+1]=f,h>m||(a.bl_count[f]++,t=0,h>=q&&(t=p[h-q]),z=g[2*h],a.opt_len+=z*(f+t),u&&(a.static_len+=z*(k[2*h+1]+t)));if(0!==v){do{for(f=C-1;0===a.bl_count[f];)f--;a.bl_count[f]--;a.bl_count[f+
1]+=2;a.bl_count[C]--;v-=2}while(0<v);for(f=C;0!==f;f--)for(h=a.bl_count[f];0!==h;)k=a.heap[--d],k>m||(g[2*k+1]!==f&&(a.opt_len+=(f-g[2*k+1])*g[2*k],g[2*k+1]=f),h--)}l(e,n,a.bl_count)}function I(a,b,e){var d,h=-1,f,g=b[1],n=0,m=7,k=4;0===g&&(m=138,k=3);b[2*(e+1)+1]=65535;for(d=0;d<=e;d++)f=g,g=b[2*(d+1)+1],++n<m&&f===g||(n<k?a.bl_tree[2*f]+=n:0!==f?(f!==h&&a.bl_tree[2*f]++,a.bl_tree[32]++):10>=n?a.bl_tree[34]++:a.bl_tree[36]++,n=0,h=f,0===g?(m=138,k=3):f===g?(m=6,k=3):(m=7,k=4))}function F(a,b,e){var d,
f=-1,n,m=b[1],k=0,l=7,u=4;0===m&&(l=138,u=3);for(d=0;d<=e;d++)if(n=m,m=b[2*(d+1)+1],!(++k<l&&n===m)){if(k<u){do g(a,n,a.bl_tree);while(0!==--k)}else 0!==n?(n!==f&&(g(a,n,a.bl_tree),k--),g(a,16,a.bl_tree),h(a,k-3,2)):10>=k?(g(a,17,a.bl_tree),h(a,k-3,3)):(g(a,18,a.bl_tree),h(a,k-11,7));k=0;f=n;0===m?(l=138,u=3):n===m?(l=6,u=3):(l=7,u=4)}}function z(a){var b=4093624447,e;for(e=0;31>=e;e++,b>>>=1)if(b&1&&0!==a.dyn_ltree[2*e])return 0;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return 1;
for(e=32;256>e;e++)if(0!==a.dyn_ltree[2*e])return 1;return 0}function L(a,b,d,f){h(a,0+(f?1:0),3);t(a);e(a,d);e(a,~d);n.arraySet(a.pending_buf,a.window,b,d,a.pending);a.pending+=d}var n=a("../utils/common"),G=[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],K=[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],E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],D=Array(576);b(D);var u=Array(60);b(u);var m=Array(512);b(m);var p=
Array(256);b(p);var J=Array(29);b(J);var H=Array(30);b(H);var v=function(a,b,e,d,h){this.static_tree=a;this.extra_bits=b;this.extra_base=e;this.elems=d;this.max_length=h;this.has_stree=a&&a.length},C,P,M,R=function(a,b){this.dyn_tree=a;this.max_code=0;this.stat_desc=b},T=!1;f._tr_init=function(a){if(!T){var b,e,d,h=Array(16);for(d=e=0;28>d;d++)for(J[d]=e,b=0;b<1<<G[d];b++)p[e++]=d;p[e-1]=d;for(d=e=0;16>d;d++)for(H[d]=e,b=0;b<1<<K[d];b++)m[e++]=d;for(e>>=7;30>d;d++)for(H[d]=e<<7,b=0;b<1<<K[d]-7;b++)m[256+
e++]=d;for(b=0;15>=b;b++)h[b]=0;for(b=0;143>=b;)D[2*b+1]=8,b++,h[8]++;for(;255>=b;)D[2*b+1]=9,b++,h[9]++;for(;279>=b;)D[2*b+1]=7,b++,h[7]++;for(;287>=b;)D[2*b+1]=8,b++,h[8]++;l(D,287,h);for(b=0;30>b;b++)u[2*b+1]=5,u[2*b]=k(b,5);C=new v(D,G,257,286,15);P=new v(u,K,0,30,15);M=new v([],E,0,19,7);T=!0}a.l_desc=new R(a.dyn_ltree,C);a.d_desc=new R(a.dyn_dtree,P);a.bl_desc=new R(a.bl_tree,M);a.bi_buf=0;a.bi_valid=0;q(a)};f._tr_stored_block=L;f._tr_flush_block=function(a,b,e,d){var f,g,n=0;if(0<a.level){2===
a.strm.data_type&&(a.strm.data_type=z(a));x(a,a.l_desc);x(a,a.d_desc);I(a,a.dyn_ltree,a.l_desc.max_code);I(a,a.dyn_dtree,a.d_desc.max_code);x(a,a.bl_desc);for(n=18;3<=n&&0===a.bl_tree[2*w[n]+1];n--);a.opt_len+=3*(n+1)+14;f=a.opt_len+3+7>>>3;g=a.static_len+3+7>>>3;g<=f&&(f=g)}else f=g=e+5;if(e+4<=f&&-1!==b)L(a,b,e,d);else if(4===a.strategy||g===f)h(a,2+(d?1:0),3),A(a,D,u);else{h(a,4+(d?1:0),3);b=a.l_desc.max_code+1;e=a.d_desc.max_code+1;n+=1;h(a,b-257,5);h(a,e-1,5);h(a,n-4,4);for(f=0;f<n;f++)h(a,a.bl_tree[2*
w[f]+1],3);F(a,a.dyn_ltree,b-1);F(a,a.dyn_dtree,e-1);A(a,a.dyn_ltree,a.dyn_dtree)}q(a);d&&t(a)};f._tr_tally=function(a,b,e){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]=e&255;a.last_lit++;0===b?a.dyn_ltree[2*e]++:(a.matches++,b--,a.dyn_ltree[2*(p[e]+256+1)]++,a.dyn_dtree[2*(256>b?m[b]:m[256+(b>>>7)])]++);return a.last_lit===a.lit_bufsize-1};f._tr_align=function(a){h(a,2,3);g(a,256,D);16===a.bi_valid?(e(a,a.bi_buf),a.bi_buf=
0,a.bi_valid=0):8<=a.bi_valid&&(a.pending_buf[a.pending++]=a.bi_buf&255,a.bi_buf>>=8,a.bi_valid-=8)}},{"../utils/common":16}],28:[function(a,d,f){d.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}},{}],29:[function(a,d,f){var b=b||{};b.CompressionUtils=b.CompressionUtils||{};b.CompressionUtils.JPEG_MAGIC_NUMBER=[255,216];b.CompressionUtils.JPEG2000_MAGIC_NUMBER=
[255,79,255,81];b.CompressionUtils.isHeaderJPEG=function(a){return a?a.getUint8(0)!==b.CompressionUtils.JPEG_MAGIC_NUMBER[0]||a.getUint8(1)!==b.CompressionUtils.JPEG_MAGIC_NUMBER[1]?!1:!0:!1};b.CompressionUtils.isHeaderJPEG2000=function(a){var d;if(a){for(d=0;d<b.CompressionUtils.JPEG2000_MAGIC_NUMBER.length;d+=1)if(a.getUint8(d)!==b.CompressionUtils.JPEG2000_MAGIC_NUMBER[d])return!1;return!0}return!1};"undefined"!==typeof d&&d.exports&&(d.exports=b.CompressionUtils)},{}],30:[function(a,d,f){var b=
b||{};b.Dictionary=b.Dictionary||{};b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.Dictionary.dictPrivate={"0207":{"101F":["FE","ElscintDataScale"]}};b.Dictionary.dict={"0002":{"0001":["OB","FileMetaInformationVersion"],"0002":["UI","MediaStoredSOPClassUID"],"0003":["UI","MediaStoredSOPInstanceUID"],"0010":["UI","TransferSyntaxUID"],"0012":["UI","ImplementationClassUID"],"0013":["SH","ImplementationVersionName"],"0016":["AE","SourceApplicationEntityTitle"],"0100":["UI","PrivateInformationCreatorUID"],
"0102":["OB","PrivateInformation"]},"0004":{1130:["CS","FilesetID"],1141:["CS","FilesetDescriptorFileFileID"],1142:["CS","FilesetDescriptorFileFormat"],1200:["UL","RootDirectoryEntitysFirstDirectoryRecordOffset"],1202:["UL","RootDirectoryEntitysLastDirectoryRecordOffset"],1212:["US","File-setConsistenceFlag"],1220:["SQ","DirectoryRecordSequence"],1400:["UL","NextDirectoryRecordOffset"],1410:["US","RecordInuseFlag"],1420:["UL","ReferencedLowerlevelDirectoryEntityOffset"],1430:["CS","DirectoryRecordType"],
1432:["UI","PrivateRecordUID"],1500:["CS","ReferencedFileID"],1510:["UI","ReferencedSOPClassUIDInFile"],1511:["UI","ReferencedSOPInstanceUIDInFile"],1600:["UL","NumberOfReferences"]},"0008":{"0001":["UL","LengthToEnd"],"0005":["CS","SpecificCharacterSet"],"0006":["SQ","LanguageCodeSequence"],"0008":["CS","ImageType"],"0010":["SH","RecognitionCode"],"0012":["DA","InstanceCreationDate"],"0013":["TM","InstanceCreationTime"],"0014":["UI","InstanceCreatorUID"],"0016":["UI","SOPClassUID"],"0018":["UI",
"SOPInstanceUID"],"001A":["UI","RelatedGeneralSOPClassUID"],"001B":["UI","OriginalSpecializedSOPClassUID"],"0020":["DA","StudyDate"],"0021":["DA","SeriesDate"],"0022":["DA","AcquisitionDate"],"0023":["DA","ContentDate"],"0024":["DA","OverlayDate"],"0025":["DA","CurveDate"],"002A":["DT","AcquisitionDateTime"],"0030":["TM","StudyTime"],"0031":["TM","SeriesTime"],"0032":["TM","AcquisitionTime"],"0033":["TM","ContentTime"],"0034":["TM","OverlayTime"],"0035":["TM","CurveTime"],"0040":["US","DataSetType"],
"0041":["LO","DataSetSubtype"],"0042":["CS","NuclearMedicineSeriesType"],"0050":["SH","AccessionNumber"],"0051":["SQ","IssuerOfAccessionNumberSequence"],"0052":["CS","QueryRetrieveLevel"],"0054":["AE","RetrieveAETitle"],"0056":["CS","InstanceAvailability"],"0058":["UI","FailedSOPInstanceUIDList"],"0060":["CS","Modality"],"0061":["CS","ModalitiesInStudy"],"0062":["UI","SOPClassesInStudy"],"0064":["CS","ConversionType"],"0068":["CS","PresentationIntentType"],"0070":["LO","Manufacturer"],"0080":["LO",
"InstitutionName"],"0081":["ST","InstitutionAddress"],"0082":["SQ","InstitutionCodeSequence"],"0090":["PN","ReferringPhysicianName"],"0092":["ST","ReferringPhysicianAddress"],"0094":["SH","ReferringPhysicianTelephoneNumbers"],"0096":["SQ","ReferringPhysicianIdentificationSequence"],"0100":["SH","CodeValue"],"0102":["SH","CodingSchemeDesignator"],"0103":["SH","CodingSchemeVersion"],"0104":["LO","CodeMeaning"],"0105":["CS","MappingResource"],"0106":["DT","ContextGroupVersion"],"0107":["DT","ContextGroupLocalVersion"],
"010B":["CS","ContextGroupExtensionFlag"],"010C":["UI","CodingSchemeUID"],"010D":["UI","ContextGroupExtensionCreatorUID"],"010F":["CS","ContextIdentifier"],"0110":["SQ","CodingSchemeIdentificationSequence"],"0112":["LO","CodingSchemeRegistry"],"0114":["ST","CodingSchemeExternalID"],"0115":["ST","CodingSchemeName"],"0116":["ST","CodingSchemeResponsibleOrganization"],"0117":["UI","ContextUID"],"0201":["SH","TimezoneOffsetFromUTC"],1E3:["AE","NetworkID"],1010:["SH","StationName"],1030:["LO","StudyDescription"],
1032:["SQ","ProcedureCodeSequence"],"103E":["LO","SeriesDescription"],"103F":["SQ","SeriesDescriptionCodeSequence"],1040:["LO","InstitutionalDepartmentName"],1048:["PN","PhysiciansOfRecord"],1049:["SQ","PhysiciansOfRecordIdentificationSequence"],1050:["PN","PerformingPhysicianName"],1052:["SQ","PerformingPhysicianIdentificationSequence"],1060:["PN","NameOfPhysiciansReadingStudy"],1062:["SQ","PhysiciansReadingStudyIdentificationSequence"],1070:["PN","OperatorsName"],1072:["SQ","OperatorIdentificationSequence"],
1080:["LO","AdmittingDiagnosesDescription"],1084:["SQ","AdmittingDiagnosesCodeSequence"],1090:["LO","ManufacturerModelName"],1100:["SQ","ReferencedResultsSequence"],1110:["SQ","ReferencedStudySequence"],1111:["SQ","ReferencedPerformedProcedureStepSequence"],1115:["SQ","ReferencedSeriesSequence"],1120:["SQ","ReferencedPatientSequence"],1125:["SQ","ReferencedVisitSequence"],1130:["SQ","ReferencedOverlaySequence"],1134:["SQ","ReferencedStereometricInstanceSequence"],"113A":["SQ","ReferencedWaveformSequence"],
1140:["SQ","ReferencedImageSequence"],1145:["SQ","ReferencedCurveSequence"],"114A":["SQ","ReferencedInstanceSequence"],"114B":["SQ","ReferencedRealWorldValueMappingInstanceSequence"],1150:["UI","ReferencedSOPClassUID"],1155:["UI","ReferencedSOPInstanceUID"],"115A":["UI","SOPClassesSupported"],1160:["IS","ReferencedFrameNumber"],1161:["UL","SimpleFrameList"],1162:["UL","CalculatedFrameList"],1163:["FD","TimeRange"],1164:["SQ","FrameExtractionSequence"],1167:["UI","MultiFrameSourceSOPInstanceUID"],
1195:["UI","TransactionUID"],1197:["US","FailureReason"],1198:["SQ","FailedSOPSequence"],1199:["SQ","ReferencedSOPSequence"],1200:["SQ","StudiesContainingOtherReferencedInstancesSequence"],1250:["SQ","RelatedSeriesSequence"],2110:["CS","LossyImageCompressionRetired"],2111:["ST","DerivationDescription"],2112:["SQ","SourceImageSequence"],2120:["SH","StageName"],2122:["IS","StageNumber"],2124:["IS","NumberOfStages"],2127:["SH","ViewName"],2128:["IS","ViewNumber"],2129:["IS","NumberOfEventTimers"],"212A":["IS",
"NumberOfViewsInStage"],2130:["DS","EventElapsedTimes"],2132:["LO","EventTimerNames"],2133:["SQ","EventTimerSequence"],2134:["FD","EventTimeOffset"],2135:["SQ","EventCodeSequence"],2142:["IS","StartTrim"],2143:["IS","StopTrim"],2144:["IS","RecommendedDisplayFrameRate"],2200:["CS","TransducerPosition"],2204:["CS","TransducerOrientation"],2208:["CS","AnatomicStructure"],2218:["SQ","AnatomicRegionSequence"],2220:["SQ","AnatomicRegionModifierSequence"],2228:["SQ","PrimaryAnatomicStructureSequence"],2229:["SQ",
"AnatomicStructureSpaceOrRegionSequence"],2230:["SQ","PrimaryAnatomicStructureModifierSequence"],2240:["SQ","TransducerPositionSequence"],2242:["SQ","TransducerPositionModifierSequence"],2244:["SQ","TransducerOrientationSequence"],2246:["SQ","TransducerOrientationModifierSequence"],2251:["SQ","AnatomicStructureSpaceOrRegionCodeSequenceTrial"],2253:["SQ","AnatomicPortalOfEntranceCodeSequenceTrial"],2255:["SQ","AnatomicApproachDirectionCodeSequenceTrial"],2256:["ST","AnatomicPerspectiveDescriptionTrial"],
2257:["SQ","AnatomicPerspectiveCodeSequenceTrial"],2258:["ST","AnatomicLocationOfExaminingInstrumentDescriptionTrial"],2259:["SQ","AnatomicLocationOfExaminingInstrumentCodeSequenceTrial"],"225A":["SQ","AnatomicStructureSpaceOrRegionModifierCodeSequenceTrial"],"225C":["SQ","OnAxisBackgroundAnatomicStructureCodeSequenceTrial"],3001:["SQ","AlternateRepresentationSequence"],3010:["UI","IrradiationEventUID"],4E3:["LT","IdentifyingComments"],9007:["CS","FrameType"],9092:["SQ","ReferencedImageEvidenceSequence"],
9121:["SQ","ReferencedRawDataSequence"],9123:["UI","CreatorVersionUID"],9124:["SQ","DerivationImageSequence"],9154:["SQ","SourceImageEvidenceSequence"],9205:["CS","PixelPresentation"],9206:["CS","VolumetricProperties"],9207:["CS","VolumeBasedCalculationTechnique"],9208:["CS","ComplexImageComponent"],9209:["CS","AcquisitionContrast"],9215:["SQ","DerivationCodeSequence"],9237:["SQ","ReferencedPresentationStateSequence"],9410:["SQ","ReferencedOtherPlaneSequence"],9458:["SQ","FrameDisplaySequence"],9459:["FL",
"RecommendedDisplayFrameRateInFloat"],9460:["CS","SkipFrameRangeFlag"]},"0010":{"0010":["PN","PatientName"],"0020":["LO","PatientID"],"0021":["LO","IssuerOfPatientID"],"0022":["CS","TypeOfPatientID"],"0024":["SQ","IssuerOfPatientIDQualifiersSequence"],"0030":["DA","PatientBirthDate"],"0032":["TM","PatientBirthTime"],"0040":["CS","PatientSex"],"0050":["SQ","PatientInsurancePlanCodeSequence"],"0101":["SQ","PatientPrimaryLanguageCodeSequence"],"0102":["SQ","PatientPrimaryLanguageModifierCodeSequence"],
1E3:["LO","OtherPatientIDs"],1001:["PN","OtherPatientNames"],1002:["SQ","OtherPatientIDsSequence"],1005:["PN","PatientBirthName"],1010:["AS","PatientAge"],1020:["DS","PatientSize"],1021:["SQ","PatientSizeCodeSequence"],1030:["DS","PatientWeight"],1040:["LO","PatientAddress"],1050:["LO","InsurancePlanIdentification"],1060:["PN","PatientMotherBirthName"],1080:["LO","MilitaryRank"],1081:["LO","BranchOfService"],1090:["LO","MedicalRecordLocator"],2E3:["LO","MedicalAlerts"],2110:["LO","Allergies"],2150:["LO",
"CountryOfResidence"],2152:["LO","RegionOfResidence"],2154:["SH","PatientTelephoneNumbers"],2160:["SH","EthnicGroup"],2180:["SH","Occupation"],"21A0":["CS","SmokingStatus"],"21B0":["LT","AdditionalPatientHistory"],"21C0":["US","PregnancyStatus"],"21D0":["DA","LastMenstrualDate"],"21F0":["LO","PatientReligiousPreference"],2201:["LO","PatientSpeciesDescription"],2202:["SQ","PatientSpeciesCodeSequence"],2203:["CS","PatientSexNeutered"],2210:["CS","AnatomicalOrientationType"],2292:["LO","PatientBreedDescription"],
2293:["SQ","PatientBreedCodeSequence"],2294:["SQ","BreedRegistrationSequence"],2295:["LO","BreedRegistrationNumber"],2296:["SQ","BreedRegistryCodeSequence"],2297:["PN","ResponsiblePerson"],2298:["CS","ResponsiblePersonRole"],2299:["LO","ResponsibleOrganization"],4E3:["LT","PatientComments"],9431:["FL","ExaminedBodyThickness"]},"0012":{"0010":["LO","ClinicalTrialSponsorName"],"0020":["LO","ClinicalTrialProtocolID"],"0021":["LO","ClinicalTrialProtocolName"],"0030":["LO","ClinicalTrialSiteID"],"0031":["LO",
"ClinicalTrialSiteName"],"0040":["LO","ClinicalTrialSubjectID"],"0042":["LO","ClinicalTrialSubjectReadingID"],"0050":["LO","ClinicalTrialTimePointID"],"0051":["ST","ClinicalTrialTimePointDescription"],"0060":["LO","ClinicalTrialCoordinatingCenterName"],"0062":["CS","PatientIdentityRemoved"],"0063":["LO","DeidentificationMethod"],"0064":["SQ","DeidentificationMethodCodeSequence"],"0071":["LO","ClinicalTrialSeriesID"],"0072":["LO","ClinicalTrialSeriesDescription"],"0081":["LO","ClinicalTrialProtocolEthicsCommitteeName"],
"0082":["LO","ClinicalTrialProtocolEthicsCommitteeApprovalNumber"],"0083":["SQ","ConsentForClinicalTrialUseSequence"],"0084":["CS","DistributionType"],"0085":["CS","ConsentForDistributionFlag"]},"0014":{"0023":["ST","CADFileFormat"],"0024":["ST","ComponentReferenceSystem"],"0025":["ST","ComponentManufacturingProcedure"],"0028":["ST","ComponentManufacturer"],"0030":["DS","MaterialThickness"],"0032":["DS","MaterialPipeDiameter"],"0034":["DS","MaterialIsolationDiameter"],"0042":["ST","MaterialGrade"],
"0044":["ST","MaterialPropertiesFileID"],"0045":["ST","MaterialPropertiesFileFormat"],"0046":["LT","MaterialNotes"],"0050":["CS","ComponentShape"],"0052":["CS","CurvatureType"],"0054":["DS","OuterDiameter"],"0056":["DS","InnerDiameter"],1010:["ST","ActualEnvironmentalConditions"],1020:["DA","ExpiryDate"],1040:["ST","EnvironmentalConditions"],2002:["SQ","EvaluatorSequence"],2004:["IS","EvaluatorNumber"],2006:["PN","EvaluatorName"],2008:["IS","EvaluationAttempt"],2012:["SQ","IndicationSequence"],2014:["IS",
"IndicationNumber "],2016:["SH","IndicationLabel"],2018:["ST","IndicationDescription"],"201A":["CS","IndicationType"],"201C":["CS","IndicationDisposition"],"201E":["SQ","IndicationROISequence"],2030:["SQ","IndicationPhysicalPropertySequence"],2032:["SH","PropertyLabel"],2202:["IS","CoordinateSystemNumberOfAxes "],2204:["SQ","CoordinateSystemAxesSequence"],2206:["ST","CoordinateSystemAxisDescription"],2208:["CS","CoordinateSystemDataSetMapping"],"220A":["IS","CoordinateSystemAxisNumber"],"220C":["CS",
"CoordinateSystemAxisType"],"220E":["CS","CoordinateSystemAxisUnits"],2210:["OB","CoordinateSystemAxisValues"],2220:["SQ","CoordinateSystemTransformSequence"],2222:["ST","TransformDescription"],2224:["IS","TransformNumberOfAxes"],2226:["IS","TransformOrderOfAxes"],2228:["CS","TransformedAxisUnits"],"222A":["DS","CoordinateSystemTransformRotationAndScaleMatrix"],"222C":["DS","CoordinateSystemTransformTranslationMatrix"],3011:["DS","InternalDetectorFrameTime"],3012:["DS","NumberOfFramesIntegrated"],
3020:["SQ","DetectorTemperatureSequence"],3022:["DS","SensorName"],3024:["DS","HorizontalOffsetOfSensor"],3026:["DS","VerticalOffsetOfSensor"],3028:["DS","SensorTemperature"],3040:["SQ","DarkCurrentSequence"],3050:["OB","DarkCurrentCounts"],3060:["SQ","GainCorrectionReferenceSequence"],3070:["OB","AirCounts"],3071:["DS","KVUsedInGainCalibration"],3072:["DS","MAUsedInGainCalibration"],3073:["DS","NumberOfFramesUsedForIntegration"],3074:["LO","FilterMaterialUsedInGainCalibration"],3075:["DS","FilterThicknessUsedInGainCalibration"],
3076:["DA","DateOfGainCalibration"],3077:["TM","TimeOfGainCalibration"],3080:["OB","BadPixelImage"],3099:["LT","CalibrationNotes"],4002:["SQ","PulserEquipmentSequence"],4004:["CS","PulserType"],4006:["LT","PulserNotes"],4008:["SQ","ReceiverEquipmentSequence"],"400A":["CS","AmplifierType"],"400C":["LT","ReceiverNotes"],"400E":["SQ","PreAmplifierEquipmentSequence"],"400F":["LT","PreAmplifierNotes"],4010:["SQ","TransmitTransducerSequence"],4011:["SQ","ReceiveTransducerSequence"],4012:["US","NumberOfElements"],
4013:["CS","ElementShape"],4014:["DS","ElementDimensionA"],4015:["DS","ElementDimensionB"],4016:["DS","ElementPitch"],4017:["DS","MeasuredBeamDimensionA"],4018:["DS","MeasuredBeamDimensionB"],4019:["DS","LocationOfMeasuredBeamDiameter"],"401A":["DS","NominalFrequency"],"401B":["DS","MeasuredCenterFrequency"],"401C":["DS","MeasuredBandwidth"],4020:["SQ","PulserSettingsSequence"],4022:["DS","PulseWidth"],4024:["DS","ExcitationFrequency"],4026:["CS","ModulationType"],4028:["DS","Damping"],4030:["SQ",
"ReceiverSettingsSequence"],4031:["DS","AcquiredSoundpathLength"],4032:["CS","AcquisitionCompressionType"],4033:["IS","AcquisitionSampleSize"],4034:["DS","RectifierSmoothing"],4035:["SQ","DACSequence"],4036:["CS","DACType"],4038:["DS","DACGainPoints"],"403A":["DS","DACTimePoints"],"403C":["DS","DACAmplitude"],4040:["SQ","PreAmplifierSettingsSequence"],4050:["SQ","TransmitTransducerSettingsSequence"],4051:["SQ","ReceiveTransducerSettingsSequence"],4052:["DS","IncidentAngle"],4054:["ST","CouplingTechnique"],
4056:["ST","CouplingMedium"],4057:["DS","CouplingVelocity"],4058:["DS","CrystalCenterLocationX"],4059:["DS","CrystalCenterLocationZ"],"405A":["DS","SoundPathLength"],"405C":["ST","DelayLawIdentifier"],4060:["SQ","GateSettingsSequence"],4062:["DS","GateThreshold"],4064:["DS","VelocityOfSound"],4070:["SQ","CalibrationSettingsSequence"],4072:["ST","CalibrationProcedure"],4074:["SH","ProcedureVersion"],4076:["DA","ProcedureCreationDate"],4078:["DA","ProcedureExpirationDate"],"407A":["DA","ProcedureLastModifiedDate"],
"407C":["TM","CalibrationTime"],"407E":["DA","CalibrationDate"],5002:["IS","LINACEnergy"],5004:["IS","LINACOutput"]},"0018":{"0010":["LO","ContrastBolusAgent"],"0012":["SQ","ContrastBolusAgentSequence"],"0014":["SQ","ContrastBolusAdministrationRouteSequence"],"0015":["CS","BodyPartExamined"],"0020":["CS","ScanningSequence"],"0021":["CS","SequenceVariant"],"0022":["CS","ScanOptions"],"0023":["CS","MRAcquisitionType"],"0024":["SH","SequenceName"],"0025":["CS","AngioFlag"],"0026":["SQ","InterventionDrugInformationSequence"],
"0027":["TM","InterventionDrugStopTime"],"0028":["DS","InterventionDrugDose"],"0029":["SQ","InterventionDrugCodeSequence"],"002A":["SQ","AdditionalDrugSequence"],"0030":["LO","Radionuclide"],"0031":["LO","Radiopharmaceutical"],"0032":["DS","EnergyWindowCenterline"],"0033":["DS","EnergyWindowTotalWidth"],"0034":["LO","InterventionDrugName"],"0035":["TM","InterventionDrugStartTime"],"0036":["SQ","InterventionSequence"],"0037":["CS","TherapyType"],"0038":["CS","InterventionStatus"],"0039":["CS","TherapyDescription"],
"003A":["ST","InterventionDescription"],"0040":["IS","CineRate"],"0042":["CS","InitialCineRunState"],"0050":["DS","SliceThickness"],"0060":["DS","KVP"],"0070":["IS","CountsAccumulated"],"0071":["CS","AcquisitionTerminationCondition"],"0072":["DS","EffectiveDuration"],"0073":["CS","AcquisitionStartCondition"],"0074":["IS","AcquisitionStartConditionData"],"0075":["IS","AcquisitionTerminationConditionData"],"0080":["DS","RepetitionTime"],"0081":["DS","EchoTime"],"0082":["DS","InversionTime"],"0083":["DS",
"NumberOfAverages"],"0084":["DS","ImagingFrequency"],"0085":["SH","ImagedNucleus"],"0086":["IS","EchoNumbers"],"0087":["DS","MagneticFieldStrength"],"0088":["DS","SpacingBetweenSlices"],"0089":["IS","NumberOfPhaseEncodingSteps"],"0090":["DS","DataCollectionDiameter"],"0091":["IS","EchoTrainLength"],"0093":["DS","PercentSampling"],"0094":["DS","PercentPhaseFieldOfView"],"0095":["DS","PixelBandwidth"],1E3:["LO","DeviceSerialNumber"],1002:["UI","DeviceUID"],1003:["LO","DeviceID"],1004:["LO","PlateID"],
1005:["LO","GeneratorID"],1006:["LO","GridID"],1007:["LO","CassetteID"],1008:["LO","GantryID"],1010:["LO","SecondaryCaptureDeviceID"],1011:["LO","HardcopyCreationDeviceID"],1012:["DA","DateOfSecondaryCapture"],1014:["TM","TimeOfSecondaryCapture"],1016:["LO","SecondaryCaptureDeviceManufacturer"],1017:["LO","HardcopyDeviceManufacturer"],1018:["LO","SecondaryCaptureDeviceManufacturerModelName"],1019:["LO","SecondaryCaptureDeviceSoftwareVersions"],"101A":["LO","HardcopyDeviceSoftwareVersion"],"101B":["LO",
"HardcopyDeviceManufacturerModelName"],1020:["LO","SoftwareVersions"],1022:["SH","VideoImageFormatAcquired"],1023:["LO","DigitalImageFormatAcquired"],1030:["LO","ProtocolName"],1040:["LO","ContrastBolusRoute"],1041:["DS","ContrastBolusVolume"],1042:["TM","ContrastBolusStartTime"],1043:["TM","ContrastBolusStopTime"],1044:["DS","ContrastBolusTotalDose"],1045:["IS","SyringeCounts"],1046:["DS","ContrastFlowRate"],1047:["DS","ContrastFlowDuration"],1048:["CS","ContrastBolusIngredient"],1049:["DS","ContrastBolusIngredientConcentration"],
1050:["DS","SpatialResolution"],1060:["DS","TriggerTime"],1061:["LO","TriggerSourceOrType"],1062:["IS","NominalInterval"],1063:["DS","FrameTime"],1064:["LO","CardiacFramingType"],1065:["DS","FrameTimeVector"],1066:["DS","FrameDelay"],1067:["DS","ImageTriggerDelay"],1068:["DS","MultiplexGroupTimeOffset"],1069:["DS","TriggerTimeOffset"],"106A":["CS","SynchronizationTrigger"],"106C":["US","SynchronizationChannel"],"106E":["UL","TriggerSamplePosition"],1070:["LO","RadiopharmaceuticalRoute"],1071:["DS",
"RadiopharmaceuticalVolume"],1072:["TM","RadiopharmaceuticalStartTime"],1073:["TM","RadiopharmaceuticalStopTime"],1074:["DS","RadionuclideTotalDose"],1075:["DS","RadionuclideHalfLife"],1076:["DS","RadionuclidePositronFraction"],1077:["DS","RadiopharmaceuticalSpecificActivity"],1078:["DT","RadiopharmaceuticalStartDateTime"],1079:["DT","RadiopharmaceuticalStopDateTime"],1080:["CS","BeatRejectionFlag"],1081:["IS","LowRRValue"],1082:["IS","HighRRValue"],1083:["IS","IntervalsAcquired"],1084:["IS","IntervalsRejected"],
1085:["LO","PVCRejection"],1086:["IS","SkipBeats"],1088:["IS","HeartRate"],1090:["IS","CardiacNumberOfImages"],1094:["IS","TriggerWindow"],1100:["DS","ReconstructionDiameter"],1110:["DS","DistanceSourceToDetector"],1111:["DS","DistanceSourceToPatient"],1114:["DS","EstimatedRadiographicMagnificationFactor"],1120:["DS","GantryDetectorTilt"],1121:["DS","GantryDetectorSlew"],1130:["DS","TableHeight"],1131:["DS","TableTraverse"],1134:["CS","TableMotion"],1135:["DS","TableVerticalIncrement"],1136:["DS",
"TableLateralIncrement"],1137:["DS","TableLongitudinalIncrement"],1138:["DS","TableAngle"],"113A":["CS","TableType"],1140:["CS","RotationDirection"],1141:["DS","AngularPosition"],1142:["DS","RadialPosition"],1143:["DS","ScanArc"],1144:["DS","AngularStep"],1145:["DS","CenterOfRotationOffset"],1146:["DS","RotationOffset"],1147:["CS","FieldOfViewShape"],1149:["IS","FieldOfViewDimensions"],1150:["IS","ExposureTime"],1151:["IS","XRayTubeCurrent"],1152:["IS","Exposure"],1153:["IS","ExposureInuAs"],1154:["DS",
"AveragePulseWidth"],1155:["CS","RadiationSetting"],1156:["CS","RectificationType"],"115A":["CS","RadiationMode"],"115E":["DS","ImageAndFluoroscopyAreaDoseProduct"],1160:["SH","FilterType"],1161:["LO","TypeOfFilters"],1162:["DS","IntensifierSize"],1164:["DS","ImagerPixelSpacing"],1166:["CS","Grid"],1170:["IS","GeneratorPower"],1180:["SH","CollimatorGridName"],1181:["CS","CollimatorType"],1182:["IS","FocalDistance"],1183:["DS","XFocusCenter"],1184:["DS","YFocusCenter"],1190:["DS","FocalSpots"],1191:["CS",
"AnodeTargetMaterial"],"11A0":["DS","BodyPartThickness"],"11A2":["DS","CompressionForce"],1200:["DA","DateOfLastCalibration"],1201:["TM","TimeOfLastCalibration"],1210:["SH","ConvolutionKernel"],1240:["IS","UpperLowerPixelValues"],1242:["IS","ActualFrameDuration"],1243:["IS","CountRate"],1244:["US","PreferredPlaybackSequencing"],1250:["SH","ReceiveCoilName"],1251:["SH","TransmitCoilName"],1260:["SH","PlateType"],1261:["LO","PhosphorType"],1300:["DS","ScanVelocity"],1301:["CS","WholeBodyTechnique"],
1302:["IS","ScanLength"],1310:["US","AcquisitionMatrix"],1312:["CS","InPlanePhaseEncodingDirection"],1314:["DS","FlipAngle"],1315:["CS","VariableFlipAngleFlag"],1316:["DS","SAR"],1318:["DS","dBdt"],1400:["LO","AcquisitionDeviceProcessingDescription"],1401:["LO","AcquisitionDeviceProcessingCode"],1402:["CS","CassetteOrientation"],1403:["CS","CassetteSize"],1404:["US","ExposuresOnPlate"],1405:["IS","RelativeXRayExposure"],1411:["DS","ExposureIndex"],1412:["DS","TargetExposureIndex"],1413:["DS","DeviationIndex"],
1450:["DS","ColumnAngulation"],1460:["DS","TomoLayerHeight"],1470:["DS","TomoAngle"],1480:["DS","TomoTime"],1490:["CS","TomoType"],1491:["CS","TomoClass"],1495:["IS","NumberOfTomosynthesisSourceImages"],1500:["CS","PositionerMotion"],1508:["CS","PositionerType"],1510:["DS","PositionerPrimaryAngle"],1511:["DS","PositionerSecondaryAngle"],1520:["DS","PositionerPrimaryAngleIncrement"],1521:["DS","PositionerSecondaryAngleIncrement"],1530:["DS","DetectorPrimaryAngle"],1531:["DS","DetectorSecondaryAngle"],
1600:["CS","ShutterShape"],1602:["IS","ShutterLeftVerticalEdge"],1604:["IS","ShutterRightVerticalEdge"],1606:["IS","ShutterUpperHorizontalEdge"],1608:["IS","ShutterLowerHorizontalEdge"],1610:["IS","CenterOfCircularShutter"],1612:["IS","RadiusOfCircularShutter"],1620:["IS","VerticesOfThePolygonalShutter"],1622:["US","ShutterPresentationValue"],1623:["US","ShutterOverlayGroup"],1624:["US","ShutterPresentationColorCIELabValue"],1700:["CS","CollimatorShape"],1702:["IS","CollimatorLeftVerticalEdge"],1704:["IS",
"CollimatorRightVerticalEdge"],1706:["IS","CollimatorUpperHorizontalEdge"],1708:["IS","CollimatorLowerHorizontalEdge"],1710:["IS","CenterOfCircularCollimator"],1712:["IS","RadiusOfCircularCollimator"],1720:["IS","VerticesOfThePolygonalCollimator"],1800:["CS","AcquisitionTimeSynchronized"],1801:["SH","TimeSource"],1802:["CS","TimeDistributionProtocol"],1803:["LO","NTPSourceAddress"],2001:["IS","PageNumberVector"],2002:["SH","FrameLabelVector"],2003:["DS","FramePrimaryAngleVector"],2004:["DS","FrameSecondaryAngleVector"],
2005:["DS","SliceLocationVector"],2006:["SH","DisplayWindowLabelVector"],2010:["DS","NominalScannedPixelSpacing"],2020:["CS","DigitizingDeviceTransportDirection"],2030:["DS","RotationOfScannedFilm"],3100:["CS","IVUSAcquisition"],3101:["DS","IVUSPullbackRate"],3102:["DS","IVUSGatedRate"],3103:["IS","IVUSPullbackStartFrameNumber"],3104:["IS","IVUSPullbackStopFrameNumber"],3105:["IS","LesionNumber"],4E3:["LT","AcquisitionComments"],5E3:["SH","OutputPower"],5010:["LO","TransducerData"],5012:["DS","FocusDepth"],
5020:["LO","ProcessingFunction"],5021:["LO","PostprocessingFunction"],5022:["DS","MechanicalIndex"],5024:["DS","BoneThermalIndex"],5026:["DS","CranialThermalIndex"],5027:["DS","SoftTissueThermalIndex"],5028:["DS","SoftTissueFocusThermalIndex"],5029:["DS","SoftTissueSurfaceThermalIndex"],5030:["DS","DynamicRange"],5040:["DS","TotalGain"],5050:["IS","DepthOfScanField"],5100:["CS","PatientPosition"],5101:["CS","ViewPosition"],5104:["SQ","ProjectionEponymousNameCodeSequence"],5210:["DS","ImageTransformationMatrix"],
5212:["DS","ImageTranslationVector"],6E3:["DS","Sensitivity"],6011:["SQ","SequenceOfUltrasoundRegions"],6012:["US","RegionSpatialFormat"],6014:["US","RegionDataType"],6016:["UL","RegionFlags"],6018:["UL","RegionLocationMinX0"],"601A":["UL","RegionLocationMinY0"],"601C":["UL","RegionLocationMaxX1"],"601E":["UL","RegionLocationMaxY1"],6020:["SL","ReferencePixelX0"],6022:["SL","ReferencePixelY0"],6024:["US","PhysicalUnitsXDirection"],6026:["US","PhysicalUnitsYDirection"],6028:["FD","ReferencePixelPhysicalValueX"],
"602A":["FD","ReferencePixelPhysicalValueY"],"602C":["FD","PhysicalDeltaX"],"602E":["FD","PhysicalDeltaY"],6030:["UL","TransducerFrequency"],6031:["CS","TransducerType"],6032:["UL","PulseRepetitionFrequency"],6034:["FD","DopplerCorrectionAngle"],6036:["FD","SteeringAngle"],6038:["UL","DopplerSampleVolumeXPositionRetired"],6039:["SL","DopplerSampleVolumeXPosition"],"603A":["UL","DopplerSampleVolumeYPositionRetired"],"603B":["SL","DopplerSampleVolumeYPosition"],"603C":["UL","TMLinePositionX0Retired"],
"603D":["SL","TMLinePositionX0"],"603E":["UL","TMLinePositionY0Retired"],"603F":["SL","TMLinePositionY0"],6040:["UL","TMLinePositionX1Retired"],6041:["SL","TMLinePositionX1"],6042:["UL","TMLinePositionY1Retired"],6043:["SL","TMLinePositionY1"],6044:["US","PixelComponentOrganization"],6046:["UL","PixelComponentMask"],6048:["UL","PixelComponentRangeStart"],"604A":["UL","PixelComponentRangeStop"],"604C":["US","PixelComponentPhysicalUnits"],"604E":["US","PixelComponentDataType"],6050:["UL","NumberOfTableBreakPoints"],
6052:["UL","TableOfXBreakPoints"],6054:["FD","TableOfYBreakPoints"],6056:["UL","NumberOfTableEntries"],6058:["UL","TableOfPixelValues"],"605A":["FL","TableOfParameterValues"],6060:["FL","RWaveTimeVector"],7E3:["CS","DetectorConditionsNominalFlag"],7001:["DS","DetectorTemperature"],7004:["CS","DetectorType"],7005:["CS","DetectorConfiguration"],7006:["LT","DetectorDescription"],7008:["LT","DetectorMode"],"700A":["SH","DetectorID"],"700C":["DA","DateOfLastDetectorCalibration"],"700E":["TM","TimeOfLastDetectorCalibration"],
7010:["IS","ExposuresOnDetectorSinceLastCalibration"],7011:["IS","ExposuresOnDetectorSinceManufactured"],7012:["DS","DetectorTimeSinceLastExposure"],7014:["DS","DetectorActiveTime"],7016:["DS","DetectorActivationOffsetFromExposure"],"701A":["DS","DetectorBinning"],7020:["DS","DetectorElementPhysicalSize"],7022:["DS","DetectorElementSpacing"],7024:["CS","DetectorActiveShape"],7026:["DS","DetectorActiveDimensions"],7028:["DS","DetectorActiveOrigin"],"702A":["LO","DetectorManufacturerName"],"702B":["LO",
"DetectorManufacturerModelName"],7030:["DS","FieldOfViewOrigin"],7032:["DS","FieldOfViewRotation"],7034:["CS","FieldOfViewHorizontalFlip"],7036:["FL","PixelDataAreaOriginRelativeToFOV"],7038:["FL","PixelDataAreaRotationAngleRelativeToFOV"],7040:["LT","GridAbsorbingMaterial"],7041:["LT","GridSpacingMaterial"],7042:["DS","GridThickness"],7044:["DS","GridPitch"],7046:["IS","GridAspectRatio"],7048:["DS","GridPeriod"],"704C":["DS","GridFocalDistance"],7050:["CS","FilterMaterial"],7052:["DS","FilterThicknessMinimum"],
7054:["DS","FilterThicknessMaximum"],7056:["FL","FilterBeamPathLengthMinimum"],7058:["FL","FilterBeamPathLengthMaximum"],7060:["CS","ExposureControlMode"],7062:["LT","ExposureControlModeDescription"],7064:["CS","ExposureStatus"],7065:["DS","PhototimerSetting"],8150:["DS","ExposureTimeInuS"],8151:["DS","XRayTubeCurrentInuA"],9004:["CS","ContentQualification"],9005:["SH","PulseSequenceName"],9006:["SQ","MRImagingModifierSequence"],9008:["CS","EchoPulseSequence"],9009:["CS","InversionRecovery"],9010:["CS",
"FlowCompensation"],9011:["CS","MultipleSpinEcho"],9012:["CS","MultiPlanarExcitation"],9014:["CS","PhaseContrast"],9015:["CS","TimeOfFlightContrast"],9016:["CS","Spoiling"],9017:["CS","SteadyStatePulseSequence"],9018:["CS","EchoPlanarPulseSequence"],9019:["FD","TagAngleFirstAxis"],9020:["CS","MagnetizationTransfer"],9021:["CS","T2Preparation"],9022:["CS","BloodSignalNulling"],9024:["CS","SaturationRecovery"],9025:["CS","SpectrallySelectedSuppression"],9026:["CS","SpectrallySelectedExcitation"],9027:["CS",
"SpatialPresaturation"],9028:["CS","Tagging"],9029:["CS","OversamplingPhase"],9030:["FD","TagSpacingFirstDimension"],9032:["CS","GeometryOfKSpaceTraversal"],9033:["CS","SegmentedKSpaceTraversal"],9034:["CS","RectilinearPhaseEncodeReordering"],9035:["FD","TagThickness"],9036:["CS","PartialFourierDirection"],9037:["CS","CardiacSynchronizationTechnique"],9041:["LO","ReceiveCoilManufacturerName"],9042:["SQ","MRReceiveCoilSequence"],9043:["CS","ReceiveCoilType"],9044:["CS","QuadratureReceiveCoil"],9045:["SQ",
"MultiCoilDefinitionSequence"],9046:["LO","MultiCoilConfiguration"],9047:["SH","MultiCoilElementName"],9048:["CS","MultiCoilElementUsed"],9049:["SQ","MRTransmitCoilSequence"],9050:["LO","TransmitCoilManufacturerName"],9051:["CS","TransmitCoilType"],9052:["FD","SpectralWidth"],9053:["FD","ChemicalShiftReference"],9054:["CS","VolumeLocalizationTechnique"],9058:["US","MRAcquisitionFrequencyEncodingSteps"],9059:["CS","Decoupling"],9060:["CS","DecoupledNucleus"],9061:["FD","DecouplingFrequency"],9062:["CS",
"DecouplingMethod"],9063:["FD","DecouplingChemicalShiftReference"],9064:["CS","KSpaceFiltering"],9065:["CS","TimeDomainFiltering"],9066:["US","NumberOfZeroFills"],9067:["CS","BaselineCorrection"],9069:["FD","ParallelReductionFactorInPlane"],9070:["FD","CardiacRRIntervalSpecified"],9073:["FD","AcquisitionDuration"],9074:["DT","FrameAcquisitionDateTime"],9075:["CS","DiffusionDirectionality"],9076:["SQ","DiffusionGradientDirectionSequence"],9077:["CS","ParallelAcquisition"],9078:["CS","ParallelAcquisitionTechnique"],
9079:["FD","InversionTimes"],9080:["ST","MetaboliteMapDescription"],9081:["CS","PartialFourier"],9082:["FD","EffectiveEchoTime"],9083:["SQ","MetaboliteMapCodeSequence"],9084:["SQ","ChemicalShiftSequence"],9085:["CS","CardiacSignalSource"],9087:["FD","DiffusionBValue"],9089:["FD","DiffusionGradientOrientation"],9090:["FD","VelocityEncodingDirection"],9091:["FD","VelocityEncodingMinimumValue"],9092:["SQ","VelocityEncodingAcquisitionSequence"],9093:["US","NumberOfKSpaceTrajectories"],9094:["CS","CoverageOfKSpace"],
9095:["UL","SpectroscopyAcquisitionPhaseRows"],9096:["FD","ParallelReductionFactorInPlaneRetired"],9098:["FD","TransmitterFrequency"],9100:["CS","ResonantNucleus"],9101:["CS","FrequencyCorrection"],9103:["SQ","MRSpectroscopyFOVGeometrySequence"],9104:["FD","SlabThickness"],9105:["FD","SlabOrientation"],9106:["FD","MidSlabPosition"],9107:["SQ","MRSpatialSaturationSequence"],9112:["SQ","MRTimingAndRelatedParametersSequence"],9114:["SQ","MREchoSequence"],9115:["SQ","MRModifierSequence"],9117:["SQ","MRDiffusionSequence"],
9118:["SQ","CardiacSynchronizationSequence"],9119:["SQ","MRAveragesSequence"],9125:["SQ","MRFOVGeometrySequence"],9126:["SQ","VolumeLocalizationSequence"],9127:["UL","SpectroscopyAcquisitionDataColumns"],9147:["CS","DiffusionAnisotropyType"],9151:["DT","FrameReferenceDateTime"],9152:["SQ","MRMetaboliteMapSequence"],9155:["FD","ParallelReductionFactorOutOfPlane"],9159:["UL","SpectroscopyAcquisitionOutOfPlanePhaseSteps"],9166:["CS","BulkMotionStatus"],9168:["FD","ParallelReductionFactorSecondInPlane"],
9169:["CS","CardiacBeatRejectionTechnique"],9170:["CS","RespiratoryMotionCompensationTechnique"],9171:["CS","RespiratorySignalSource"],9172:["CS","BulkMotionCompensationTechnique"],9173:["CS","BulkMotionSignalSource"],9174:["CS","ApplicableSafetyStandardAgency"],9175:["LO","ApplicableSafetyStandardDescription"],9176:["SQ","OperatingModeSequence"],9177:["CS","OperatingModeType"],9178:["CS","OperatingMode"],9179:["CS","SpecificAbsorptionRateDefinition"],9180:["CS","GradientOutputType"],9181:["FD","SpecificAbsorptionRateValue"],
9182:["FD","GradientOutput"],9183:["CS","FlowCompensationDirection"],9184:["FD","TaggingDelay"],9185:["ST","RespiratoryMotionCompensationTechniqueDescription"],9186:["SH","RespiratorySignalSourceID"],9195:["FD","ChemicalShiftMinimumIntegrationLimitInHz"],9196:["FD","ChemicalShiftMaximumIntegrationLimitInHz"],9197:["SQ","MRVelocityEncodingSequence"],9198:["CS","FirstOrderPhaseCorrection"],9199:["CS","WaterReferencedPhaseCorrection"],9200:["CS","MRSpectroscopyAcquisitionType"],9214:["CS","RespiratoryCyclePosition"],
9217:["FD","VelocityEncodingMaximumValue"],9218:["FD","TagSpacingSecondDimension"],9219:["SS","TagAngleSecondAxis"],9220:["FD","FrameAcquisitionDuration"],9226:["SQ","MRImageFrameTypeSequence"],9227:["SQ","MRSpectroscopyFrameTypeSequence"],9231:["US","MRAcquisitionPhaseEncodingStepsInPlane"],9232:["US","MRAcquisitionPhaseEncodingStepsOutOfPlane"],9234:["UL","SpectroscopyAcquisitionPhaseColumns"],9236:["CS","CardiacCyclePosition"],9239:["SQ","SpecificAbsorptionRateSequence"],9240:["US","RFEchoTrainLength"],
9241:["US","GradientEchoTrainLength"],9250:["CS","ArterialSpinLabelingContrast"],9251:["SQ","MRArterialSpinLabelingSequence"],9252:["LO","ASLTechniqueDescription"],9253:["US","ASLSlabNumber"],9254:["FD ","ASLSlabThickness"],9255:["FD ","ASLSlabOrientation"],9256:["FD ","ASLMidSlabPosition"],9257:["CS","ASLContext"],9258:["UL","ASLPulseTrainDuration"],9259:["CS","ASLCrusherFlag"],"925A":["FD","ASLCrusherFlow"],"925B":["LO","ASLCrusherDescription"],"925C":["CS","ASLBolusCutoffFlag"],"925D":["SQ","ASLBolusCutoffTimingSequence"],
"925E":["LO","ASLBolusCutoffTechnique"],"925F":["UL","ASLBolusCutoffDelayTime"],9260:["SQ","ASLSlabSequence"],9295:["FD","ChemicalShiftMinimumIntegrationLimitInppm"],9296:["FD","ChemicalShiftMaximumIntegrationLimitInppm"],9301:["SQ","CTAcquisitionTypeSequence"],9302:["CS","AcquisitionType"],9303:["FD","TubeAngle"],9304:["SQ","CTAcquisitionDetailsSequence"],9305:["FD","RevolutionTime"],9306:["FD","SingleCollimationWidth"],9307:["FD","TotalCollimationWidth"],9308:["SQ","CTTableDynamicsSequence"],9309:["FD",
"TableSpeed"],9310:["FD","TableFeedPerRotation"],9311:["FD","SpiralPitchFactor"],9312:["SQ","CTGeometrySequence"],9313:["FD","DataCollectionCenterPatient"],9314:["SQ","CTReconstructionSequence"],9315:["CS","ReconstructionAlgorithm"],9316:["CS","ConvolutionKernelGroup"],9317:["FD","ReconstructionFieldOfView"],9318:["FD","ReconstructionTargetCenterPatient"],9319:["FD","ReconstructionAngle"],9320:["SH","ImageFilter"],9321:["SQ","CTExposureSequence"],9322:["FD","ReconstructionPixelSpacing"],9323:["CS",
"ExposureModulationType"],9324:["FD","EstimatedDoseSaving"],9325:["SQ","CTXRayDetailsSequence"],9326:["SQ","CTPositionSequence"],9327:["FD","TablePosition"],9328:["FD","ExposureTimeInms"],9329:["SQ","CTImageFrameTypeSequence"],9330:["FD","XRayTubeCurrentInmA"],9332:["FD","ExposureInmAs"],9333:["CS","ConstantVolumeFlag"],9334:["CS","FluoroscopyFlag"],9335:["FD","DistanceSourceToDataCollectionCenter"],9337:["US","ContrastBolusAgentNumber"],9338:["SQ","ContrastBolusIngredientCodeSequence"],9340:["SQ",
"ContrastAdministrationProfileSequence"],9341:["SQ","ContrastBolusUsageSequence"],9342:["CS","ContrastBolusAgentAdministered"],9343:["CS","ContrastBolusAgentDetected"],9344:["CS","ContrastBolusAgentPhase"],9345:["FD","CTDIvol"],9346:["SQ","CTDIPhantomTypeCodeSequence"],9351:["FL","CalciumScoringMassFactorPatient"],9352:["FL","CalciumScoringMassFactorDevice"],9353:["FL","EnergyWeightingFactor"],9360:["SQ","CTAdditionalXRaySourceSequence"],9401:["SQ","ProjectionPixelCalibrationSequence"],9402:["FL",
"DistanceSourceToIsocenter"],9403:["FL","DistanceObjectToTableTop"],9404:["FL","ObjectPixelSpacingInCenterOfBeam"],9405:["SQ","PositionerPositionSequence"],9406:["SQ","TablePositionSequence"],9407:["SQ","CollimatorShapeSequence"],9410:["CS","PlanesInAcquisition"],9412:["SQ","XAXRFFrameCharacteristicsSequence"],9417:["SQ","FrameAcquisitionSequence"],9420:["CS","XRayReceptorType"],9423:["LO","AcquisitionProtocolName"],9424:["LT","AcquisitionProtocolDescription"],9425:["CS","ContrastBolusIngredientOpaque"],
9426:["FL","DistanceReceptorPlaneToDetectorHousing"],9427:["CS","IntensifierActiveShape"],9428:["FL","IntensifierActiveDimensions"],9429:["FL","PhysicalDetectorSize"],9430:["FL","PositionOfIsocenterProjection"],9432:["SQ","FieldOfViewSequence"],9433:["LO","FieldOfViewDescription"],9434:["SQ","ExposureControlSensingRegionsSequence"],9435:["CS","ExposureControlSensingRegionShape"],9436:["SS","ExposureControlSensingRegionLeftVerticalEdge"],9437:["SS","ExposureControlSensingRegionRightVerticalEdge"],
9438:["SS","ExposureControlSensingRegionUpperHorizontalEdge"],9439:["SS","ExposureControlSensingRegionLowerHorizontalEdge"],9440:["SS","CenterOfCircularExposureControlSensingRegion"],9441:["US","RadiusOfCircularExposureControlSensingRegion"],9442:["SS","VerticesOfThePolygonalExposureControlSensingRegion"],9447:["FL","ColumnAngulationPatient"],9449:["FL","BeamAngle"],9451:["SQ","FrameDetectorParametersSequence"],9452:["FL","CalculatedAnatomyThickness"],9455:["SQ","CalibrationSequence"],9456:["SQ",
"ObjectThicknessSequence"],9457:["CS","PlaneIdentification"],9461:["FL","FieldOfViewDimensionsInFloat"],9462:["SQ","IsocenterReferenceSystemSequence"],9463:["FL","PositionerIsocenterPrimaryAngle"],9464:["FL","PositionerIsocenterSecondaryAngle"],9465:["FL","PositionerIsocenterDetectorRotationAngle"],9466:["FL","TableXPositionToIsocenter"],9467:["FL","TableYPositionToIsocenter"],9468:["FL","TableZPositionToIsocenter"],9469:["FL","TableHorizontalRotationAngle"],9470:["FL","TableHeadTiltAngle"],9471:["FL",
"TableCradleTiltAngle"],9472:["SQ","FrameDisplayShutterSequence"],9473:["FL","AcquiredImageAreaDoseProduct"],9474:["CS","CArmPositionerTabletopRelationship"],9476:["SQ","XRayGeometrySequence"],9477:["SQ","IrradiationEventIdentificationSequence"],9504:["SQ","XRay3DFrameTypeSequence"],9506:["SQ","ContributingSourcesSequence"],9507:["SQ","XRay3DAcquisitionSequence"],9508:["FL","PrimaryPositionerScanArc"],9509:["FL","SecondaryPositionerScanArc"],9510:["FL ","PrimaryPositionerScanStartAngle"],9511:["FL",
"SecondaryPositionerScanStartAngle"],9514:["FL","PrimaryPositionerIncrement"],9515:["FL","SecondaryPositionerIncrement"],9516:["DT","StartAcquisitionDateTime"],9517:["DT","EndAcquisitionDateTime"],9524:["LO","ApplicationName"],9525:["LO","ApplicationVersion"],9526:["LO","ApplicationManufacturer"],9527:["CS","AlgorithmType"],9528:["LO","AlgorithmDescription"],9530:["SQ","XRay3DReconstructionSequence"],9531:["LO","ReconstructionDescription"],9538:["SQ","PerProjectionAcquisitionSequence"],9601:["SQ",
"DiffusionBMatrixSequence"],9602:["FD","DiffusionBValueXX"],9603:["FD","DiffusionBValueXY"],9604:["FD","DiffusionBValueXZ"],9605:["FD","DiffusionBValueYY"],9606:["FD","DiffusionBValueYZ"],9607:["FD","DiffusionBValueZZ"],9701:["DT","DecayCorrectionDateTime"],9715:["FD","StartDensityThreshold"],9716:["FD","StartRelativeDensityDifferenceThreshold"],9717:["FD","StartCardiacTriggerCountThreshold"],9718:["FD","StartRespiratoryTriggerCountThreshold"],9719:["FD","TerminationCountsThreshold"],9720:["FD","TerminationDensityThreshold"],
9721:["FD","TerminationRelativeDensityThreshold"],9722:["FD","TerminationTimeThreshold"],9723:["FD","TerminationCardiacTriggerCountThreshold"],9724:["FD","TerminationRespiratoryTriggerCountThreshold"],9725:["CS","DetectorGeometry"],9726:["FD","TransverseDetectorSeparation"],9727:["FD","AxialDetectorDimension"],9729:["US","RadiopharmaceuticalAgentNumber"],9732:["SQ","PETFrameAcquisitionSequence"],9733:["SQ","PETDetectorMotionDetailsSequence"],9734:["SQ","PETTableDynamicsSequence"],9735:["SQ","PETPositionSequence"],
9736:["SQ","PETFrameCorrectionFactorsSequence"],9737:["SQ","RadiopharmaceuticalUsageSequence"],9738:["CS","AttenuationCorrectionSource"],9739:["US","NumberOfIterations"],9740:["US","NumberOfSubsets"],9749:["SQ","PETReconstructionSequence"],9751:["SQ","PETFrameTypeSequence"],9755:["CS","TimeOfFlightInformationUsed"],9756:["CS","ReconstructionType"],9758:["CS","DecayCorrected"],9759:["CS","AttenuationCorrected"],9760:["CS","ScatterCorrected"],9761:["CS","DeadTimeCorrected"],9762:["CS","GantryMotionCorrected"],
9763:["CS","PatientMotionCorrected"],9764:["CS","CountLossNormalizationCorrected"],9765:["CS","RandomsCorrected"],9766:["CS","NonUniformRadialSamplingCorrected"],9767:["CS","SensitivityCalibrated"],9768:["CS","DetectorNormalizationCorrection"],9769:["CS","IterativeReconstructionMethod"],9770:["CS","AttenuationCorrectionTemporalRelationship"],9771:["SQ","PatientPhysiologicalStateSequence"],9772:["SQ","PatientPhysiologicalStateCodeSequence"],9801:["FD","DepthsOfFocus"],9803:["SQ","ExcludedIntervalsSequence"],
9804:["DT","ExclusionStartDatetime"],9805:["FD","ExclusionDuration"],9806:["SQ","USImageDescriptionSequence"],9807:["SQ","ImageDataTypeSequence"],9808:["CS","DataType"],9809:["SQ","TransducerScanPatternCodeSequence"],"980B":["CS","AliasedDataType"],"980C":["CS","PositionMeasuringDeviceUsed"],"980D":["SQ","TransducerGeometryCodeSequence"],"980E":["SQ","TransducerBeamSteeringCodeSequence"],"980F":["SQ","TransducerApplicationCodeSequence"],A001:["SQ","ContributingEquipmentSequence"],A002:["DT","ContributionDateTime"],
A003:["ST","ContributionDescription"]},"0020":{"000D":["UI","StudyInstanceUID"],"000E":["UI","SeriesInstanceUID"],"0010":["SH","StudyID"],"0011":["IS","SeriesNumber"],"0012":["IS","AcquisitionNumber"],"0013":["IS","InstanceNumber"],"0014":["IS","IsotopeNumber"],"0015":["IS","PhaseNumber"],"0016":["IS","IntervalNumber"],"0017":["IS","TimeSlotNumber"],"0018":["IS","AngleNumber"],"0019":["IS","ItemNumber"],"0020":["CS","PatientOrientation"],"0022":["IS","OverlayNumber"],"0024":["IS","CurveNumber"],"0026":["IS",
"LUTNumber"],"0030":["DS","ImagePosition"],"0032":["DS","ImagePositionPatient"],"0035":["DS","ImageOrientation"],"0037":["DS","ImageOrientationPatient"],"0050":["DS","Location"],"0052":["UI","FrameOfReferenceUID"],"0060":["CS","Laterality"],"0062":["CS","ImageLaterality"],"0070":["LO","ImageGeometryType"],"0080":["CS","MaskingImage"],"00AA":["IS","ReportNumber"],"0100":["IS","TemporalPositionIdentifier"],"0105":["IS","NumberOfTemporalPositions"],"0110":["DS","TemporalResolution"],"0200":["UI","SynchronizationFrameOfReferenceUID"],
"0242":["UI","SOPInstanceUIDOfConcatenationSource"],1E3:["IS","SeriesInStudy"],1001:["IS","AcquisitionsInSeries"],1002:["IS","ImagesInAcquisition"],1003:["IS","ImagesInSeries"],1004:["IS","AcquisitionsInStudy"],1005:["IS","ImagesInStudy"],1020:["LO","Reference"],1040:["LO","PositionReferenceIndicator"],1041:["DS","SliceLocation"],1070:["IS","OtherStudyNumbers"],1200:["IS","NumberOfPatientRelatedStudies"],1202:["IS","NumberOfPatientRelatedSeries"],1204:["IS","NumberOfPatientRelatedInstances"],1206:["IS",
"NumberOfStudyRelatedSeries"],1208:["IS","NumberOfStudyRelatedInstances"],1209:["IS","NumberOfSeriesRelatedInstances"],3401:["CS","ModifyingDeviceID"],3402:["CS","ModifiedImageID"],3403:["DA","ModifiedImageDate"],3404:["LO","ModifyingDeviceManufacturer"],3405:["TM","ModifiedImageTime"],3406:["LO","ModifiedImageDescription"],4E3:["LT","ImageComments"],5E3:["AT","OriginalImageIdentification"],5002:["LO","OriginalImageIdentificationNomenclature"],9056:["SH","StackID"],9057:["UL","InStackPositionNumber"],
9071:["SQ","FrameAnatomySequence"],9072:["CS","FrameLaterality"],9111:["SQ","FrameContentSequence"],9113:["SQ","PlanePositionSequence"],9116:["SQ","PlaneOrientationSequence"],9128:["UL","TemporalPositionIndex"],9153:["FD","NominalCardiacTriggerDelayTime"],9154:["FL","NominalCardiacTriggerTimePriorToRPeak"],9155:["FL","ActualCardiacTriggerTimePriorToRPeak"],9156:["US","FrameAcquisitionNumber"],9157:["UL","DimensionIndexValues"],9158:["LT","FrameComments"],9161:["UI","ConcatenationUID"],9162:["US",
"InConcatenationNumber"],9163:["US","InConcatenationTotalNumber"],9164:["UI","DimensionOrganizationUID"],9165:["AT","DimensionIndexPointer"],9167:["AT","FunctionalGroupPointer"],9213:["LO","DimensionIndexPrivateCreator"],9221:["SQ","DimensionOrganizationSequence"],9222:["SQ","DimensionIndexSequence"],9228:["UL","ConcatenationFrameOffsetNumber"],9238:["LO","FunctionalGroupPrivateCreator"],9241:["FL","NominalPercentageOfCardiacPhase"],9245:["FL","NominalPercentageOfRespiratoryPhase"],9246:["FL","StartingRespiratoryAmplitude"],
9247:["CS","StartingRespiratoryPhase"],9248:["FL","EndingRespiratoryAmplitude"],9249:["CS","EndingRespiratoryPhase"],9250:["CS","RespiratoryTriggerType"],9251:["FD","RRIntervalTimeNominal"],9252:["FD","ActualCardiacTriggerDelayTime"],9253:["SQ","RespiratorySynchronizationSequence"],9254:["FD","RespiratoryIntervalTime"],9255:["FD","NominalRespiratoryTriggerDelayTime"],9256:["FD","RespiratoryTriggerDelayThreshold"],9257:["FD","ActualRespiratoryTriggerDelayTime"],9301:["FD","ImagePositionVolume"],9302:["FD",
"ImageOrientationVolume"],9307:["CS","UltrasoundAcquisitionGeometry"],9308:["FD","ApexPosition"],9309:["FD","VolumeToTransducerMappingMatrix"],"930A":["FD","VolumeToTableMappingMatrix"],"930C":["CS","PatientFrameOfReferenceSource"],"930D":["FD","TemporalPositionTimeOffset"],"930E":["SQ","PlanePositionVolumeSequence"],"930F":["SQ","PlaneOrientationVolumeSequence"],9310:["SQ","TemporalPositionSequence"],9311:["CS","DimensionOrganizationType"],9312:["UI","VolumeFrameOfReferenceUID"],9313:["UI","TableFrameOfReferenceUID"],
9421:["LO","DimensionDescriptionLabel"],9450:["SQ","PatientOrientationInFrameSequence"],9453:["LO","FrameLabel"],9518:["US","AcquisitionIndex"],9529:["SQ","ContributingSOPInstancesReferenceSequence"],9536:["US","ReconstructionIndex"]},"0022":{"0001":["US","LightPathFilterPassThroughWavelength"],"0002":["US","LightPathFilterPassBand"],"0003":["US","ImagePathFilterPassThroughWavelength"],"0004":["US","ImagePathFilterPassBand"],"0005":["CS","PatientEyeMovementCommanded"],"0006":["SQ","PatientEyeMovementCommandCodeSequence"],
"0007":["FL","SphericalLensPower"],"0008":["FL","CylinderLensPower"],"0009":["FL","CylinderAxis"],"000A":["FL","EmmetropicMagnification"],"000B":["FL","IntraOcularPressure"],"000C":["FL","HorizontalFieldOfView"],"000D":["CS","PupilDilated"],"000E":["FL","DegreeOfDilation"],"0010":["FL","StereoBaselineAngle"],"0011":["FL","StereoBaselineDisplacement"],"0012":["FL","StereoHorizontalPixelOffset"],"0013":["FL","StereoVerticalPixelOffset"],"0014":["FL","StereoRotation"],"0015":["SQ","AcquisitionDeviceTypeCodeSequence"],
"0016":["SQ","IlluminationTypeCodeSequence"],"0017":["SQ","LightPathFilterTypeStackCodeSequence"],"0018":["SQ","ImagePathFilterTypeStackCodeSequence"],"0019":["SQ","LensesCodeSequence"],"001A":["SQ","ChannelDescriptionCodeSequence"],"001B":["SQ","RefractiveStateSequence"],"001C":["SQ","MydriaticAgentCodeSequence"],"001D":["SQ","RelativeImagePositionCodeSequence"],"001E":["FL","CameraAngleOfView"],"0020":["SQ","StereoPairsSequence"],"0021":["SQ","LeftImageSequence"],"0022":["SQ","RightImageSequence"],
"0030":["FL","AxialLengthOfTheEye"],"0031":["SQ","OphthalmicFrameLocationSequence"],"0032":["FL","ReferenceCoordinates"],"0035":["FL","DepthSpatialResolution"],"0036":["FL","MaximumDepthDistortion"],"0037":["FL","AlongScanSpatialResolution"],"0038":["FL","MaximumAlongScanDistortion"],"0039":["CS","OphthalmicImageOrientation"],"0041":["FL","DepthOfTransverseImage"],"0042":["SQ","MydriaticAgentConcentrationUnitsSequence"],"0048":["FL","AcrossScanSpatialResolution"],"0049":["FL","MaximumAcrossScanDistortion"],
"004E":["DS","MydriaticAgentConcentration"],"0055":["FL","IlluminationWaveLength"],"0056":["FL","IlluminationPower"],"0057":["FL","IlluminationBandwidth"],"0058":["SQ","MydriaticAgentSequence"],1007:["SQ","OphthalmicAxialMeasurementsRightEyeSequence"],1008:["SQ","OphthalmicAxialMeasurementsLeftEyeSequence"],1010:["CS","OphthalmicAxialLengthMeasurementsType"],1019:["FL","OphthalmicAxialLength"],1024:["SQ","LensStatusCodeSequence"],1025:["SQ","VitreousStatusCodeSequence"],1028:["SQ","IOLFormulaCodeSequence"],
1029:["LO","IOLFormulaDetail"],1033:["FL","KeratometerIndex"],1035:["SQ","SourceOfOphthalmicAxialLengthCodeSequence"],1037:["FL","TargetRefraction"],1039:["CS","RefractiveProcedureOccurred"],1040:["SQ","RefractiveSurgeryTypeCodeSequence"],1044:["SQ","OphthalmicUltrasoundAxialMeasurementsTypeCodeSequence"],1050:["SQ","OphthalmicAxialLengthMeasurementsSequence"],1053:["FL","IOLPower"],1054:["FL","PredictedRefractiveError"],1059:["FL","OphthalmicAxialLengthVelocity"],1065:["LO","LensStatusDescription"],
1066:["LO","VitreousStatusDescription"],1090:["SQ","IOLPowerSequence"],1092:["SQ","LensConstantSequence"],1093:["LO","IOLManufacturer"],1094:["LO","LensConstantDescription"],1096:["SQ","KeratometryMeasurementTypeCodeSequence"],1100:["SQ","ReferencedOphthalmicAxialMeasurementsSequence"],1101:["SQ","OphthalmicAxialLengthMeasurementsSegmentNameCodeSequence"],1103:["SQ","RefractiveErrorBeforeRefractiveSurgeryCodeSequence"],1121:["FL","IOLPowerForExactEmmetropia"],1122:["FL","IOLPowerForExactTargetRefraction"],
1125:["SQ","AnteriorChamberDepthDefinitionCodeSequence"],1130:["FL","LensThickness"],1131:["FL","AnteriorChamberDepth"],1132:["SQ","SourceOfLensThicknessDataCodeSequence"],1133:["SQ","SourceOfAnteriorChamberDepthDataCodeSequence"],1135:["SQ","SourceOfRefractiveErrorDataCodeSequence"],1140:["CS","OphthalmicAxialLengthMeasurementModified"],1150:["SQ","OphthalmicAxialLengthDataSourceCodeSequence"],1153:["SQ","OphthalmicAxialLengthAcquisitionMethodCodeSequence"],1155:["FL","SignalToNoiseRatio"],1159:["LO",
"OphthalmicAxialLengthDataSourceDescription"],1210:["SQ","OphthalmicAxialLengthMeasurementsTotalLengthSequence"],1211:["SQ","OphthalmicAxialLengthMeasurementsSegmentalLengthSequence"],1212:["SQ","OphthalmicAxialLengthMeasurementsLengthSummationSequence"],1220:["SQ","UltrasoundOphthalmicAxialLengthMeasurementsSequence"],1225:["SQ","OpticalOphthalmicAxialLengthMeasurementsSequence"],1230:["SQ","UltrasoundSelectedOphthalmicAxialLengthSequence"],1250:["SQ","OphthalmicAxialLengthSelectionMethodCodeSequence"],
1255:["SQ","OpticalSelectedOphthalmicAxialLengthSequence"],1257:["SQ","SelectedSegmentalOphthalmicAxialLengthSequence"],1260:["SQ","SelectedTotalOphthalmicAxialLengthSequence"],1262:["SQ","OphthalmicAxialLengthQualityMetricSequence"],1273:["LO","OphthalmicAxialLengthQualityMetricTypeDescription"],1300:["SQ","IntraocularLensCalculationsRightEyeSequence"],1310:["SQ","IntraocularLensCalculationsLeftEyeSequence"],1330:["SQ","ReferencedOphthalmicAxialLengthMeasurementQCImageSequence"]},"0024":{"0010":["FL",
"VisualFieldHorizontalExtent"],"0011":["FL","VisualFieldVerticalExtent"],"0012":["CS","VisualFieldShape"],"0016":["SQ","ScreeningTestModeCodeSequence"],"0018":["FL","MaximumStimulusLuminance"],"0020":["FL","BackgroundLuminance"],"0021":["SQ","StimulusColorCodeSequence"],"0024":["SQ","BackgroundIlluminationColorCodeSequence"],"0025":["FL","StimulusArea"],"0028":["FL","StimulusPresentationTime"],"0032":["SQ","FixationSequence"],"0033":["SQ","FixationMonitoringCodeSequence"],"0034":["SQ","VisualFieldCatchTrialSequence"],
"0035":["US","FixationCheckedQuantity"],"0036":["US","PatientNotProperlyFixatedQuantity"],"0037":["CS","PresentedVisualStimuliDataFlag"],"0038":["US","NumberOfVisualStimuli"],"0039":["CS","ExcessiveFixationLossesDataFlag"],"0040":["CS","ExcessiveFixationLosses"],"0042":["US","StimuliRetestingQuantity"],"0044":["LT","CommentsOnPatientPerformanceOfVisualField"],"0045":["CS","FalseNegativesEstimateFlag"],"0046":["FL","FalseNegativesEstimate"],"0048":["US","NegativeCatchTrialsQuantity"],"0050":["US",
"FalseNegativesQuantity"],"0051":["CS","ExcessiveFalseNegativesDataFlag"],"0052":["CS","ExcessiveFalseNegatives"],"0053":["CS","FalsePositivesEstimateFlag"],"0054":["FL","FalsePositivesEstimate"],"0055":["CS","CatchTrialsDataFlag"],"0056":["US","PositiveCatchTrialsQuantity"],"0057":["CS","TestPointNormalsDataFlag"],"0058":["SQ","TestPointNormalsSequence"],"0059":["CS","GlobalDeviationProbabilityNormalsFlag"],"0060":["US","FalsePositivesQuantity"],"0061":["CS","ExcessiveFalsePositivesDataFlag"],"0062":["CS",
"ExcessiveFalsePositives"],"0063":["CS","VisualFieldTestNormalsFlag"],"0064":["SQ","ResultsNormalsSequence"],"0065":["SQ","AgeCorrectedSensitivityDeviationAlgorithmSequence"],"0066":["FL","GlobalDeviationFromNormal"],"0067":["SQ","GeneralizedDefectSensitivityDeviationAlgorithmSequence"],"0068":["FL","LocalizedDeviationfromNormal"],"0069":["LO","PatientReliabilityIndicator"],"0070":["FL","VisualFieldMeanSensitivity"],"0071":["FL","GlobalDeviationProbability"],"0072":["CS","LocalDeviationProbabilityNormalsFlag"],
"0073":["FL","LocalizedDeviationProbability"],"0074":["CS","ShortTermFluctuationCalculated"],"0075":["FL","ShortTermFluctuation"],"0076":["CS","ShortTermFluctuationProbabilityCalculated"],"0077":["FL","ShortTermFluctuationProbability"],"0078":["CS","CorrectedLocalizedDeviationFromNormalCalculated"],"0079":["FL","CorrectedLocalizedDeviationFromNormal"],"0080":["CS","CorrectedLocalizedDeviationFromNormalProbabilityCalculated"],"0081":["FL","CorrectedLocalizedDeviationFromNormalProbability"],"0083":["SQ",
"GlobalDeviationProbabilitySequence"],"0085":["SQ","LocalizedDeviationProbabilitySequence"],"0086":["CS","FovealSensitivityMeasured"],"0087":["FL","FovealSensitivity"],"0088":["FL","VisualFieldTestDuration"],"0089":["SQ","VisualFieldTestPointSequence"],"0090":["FL","VisualFieldTestPointXCoordinate"],"0091":["FL","VisualFieldTestPointYCoordinate"],"0092":["FL","AgeCorrectedSensitivityDeviationValue"],"0093":["CS","StimulusResults"],"0094":["FL","SensitivityValue"],"0095":["CS","RetestStimulusSeen"],
"0096":["FL","RetestSensitivityValue"],"0097":["SQ","VisualFieldTestPointNormalsSequence"],"0098":["FL","QuantifiedDefect"],"0100":["FL","AgeCorrectedSensitivityDeviationProbabilityValue"],"0102":["CS","GeneralizedDefectCorrectedSensitivityDeviationFlag "],"0103":["FL","GeneralizedDefectCorrectedSensitivityDeviationValue "],"0104":["FL","GeneralizedDefectCorrectedSensitivityDeviationProbabilityValue"],"0105":["FL ","MinimumSensitivityValue"],"0106":["CS","BlindSpotLocalized"],"0107":["FL","BlindSpotXCoordinate"],
"0108":["FL","BlindSpotYCoordinate "],"0110":["SQ","VisualAcuityMeasurementSequence"],"0112":["SQ","RefractiveParametersUsedOnPatientSequence"],"0113":["CS","MeasurementLaterality"],"0114":["SQ","OphthalmicPatientClinicalInformationLeftEyeSequence"],"0115":["SQ","OphthalmicPatientClinicalInformationRightEyeSequence"],"0117":["CS","FovealPointNormativeDataFlag"],"0118":["FL","FovealPointProbabilityValue"],"0120":["CS","ScreeningBaselineMeasured"],"0122":["SQ","ScreeningBaselineMeasuredSequence"],"0124":["CS",
"ScreeningBaselineType"],"0126":["FL","ScreeningBaselineValue"],"0202":["LO","AlgorithmSource"],"0306":["LO","DataSetName"],"0307":["LO","DataSetVersion"],"0308":["LO","DataSetSource"],"0309":["LO","DataSetDescription"],"0317":["SQ","VisualFieldTestReliabilityGlobalIndexSequence"],"0320":["SQ","VisualFieldGlobalResultsIndexSequence"],"0325":["SQ","DataObservationSequence"],"0338":["CS","IndexNormalsFlag"],"0341":["FL","IndexProbability"],"0344":["SQ","IndexProbabilitySequence"]},"0028":{"0002":["US",
"SamplesPerPixel"],"0003":["US","SamplesPerPixelUsed"],"0004":["CS","PhotometricInterpretation"],"0005":["US","ImageDimensions"],"0006":["US","PlanarConfiguration"],"0008":["IS","NumberOfFrames"],"0009":["AT","FrameIncrementPointer"],"000A":["AT","FrameDimensionPointer"],"0010":["US","Rows"],"0011":["US","Columns"],"0012":["US","Planes"],"0014":["US","UltrasoundColorDataPresent"],"0030":["DS","PixelSpacing"],"0031":["DS","ZoomFactor"],"0032":["DS","ZoomCenter"],"0034":["IS","PixelAspectRatio"],"0040":["CS",
"ImageFormat"],"0050":["LO","ManipulatedImage"],"0051":["CS","CorrectedImage"],"005F":["LO","CompressionRecognitionCode"],"0060":["CS","CompressionCode"],"0061":["SH","CompressionOriginator"],"0062":["LO","CompressionLabel"],"0063":["SH","CompressionDescription"],"0065":["CS","CompressionSequence"],"0066":["AT","CompressionStepPointers"],"0068":["US","RepeatInterval"],"0069":["US","BitsGrouped"],"0070":["US","PerimeterTable"],"0071":["SS","PerimeterValue"],"0080":["US","PredictorRows"],"0081":["US",
"PredictorColumns"],"0082":["US","PredictorConstants"],"0090":["CS","BlockedPixels"],"0091":["US","BlockRows"],"0092":["US","BlockColumns"],"0093":["US","RowOverlap"],"0094":["US","ColumnOverlap"],"0100":["US","BitsAllocated"],"0101":["US","BitsStored"],"0102":["US","HighBit"],"0103":["US","PixelRepresentation"],"0104":["SS","SmallestValidPixelValue"],"0105":["SS","LargestValidPixelValue"],"0106":["SS","SmallestImagePixelValue"],"0107":["SS","LargestImagePixelValue"],"0108":["SS","SmallestPixelValueInSeries"],
"0109":["SS","LargestPixelValueInSeries"],"0110":["SS","SmallestImagePixelValueInPlane"],"0111":["SS","LargestImagePixelValueInPlane"],"0120":["SS","PixelPaddingValue"],"0121":["SS","PixelPaddingRangeLimit"],"0200":["US","ImageLocation"],"0300":["CS","QualityControlImage"],"0301":["CS","BurnedInAnnotation"],"0302":["CS","RecognizableVisualFeatures"],"0303":["CS","LongitudinalTemporalInformationModified"],"0400":["LO","TransformLabel"],"0401":["LO","TransformVersionNumber"],"0402":["US","NumberOfTransformSteps"],
"0403":["LO","SequenceOfCompressedData"],"0404":["AT","DetailsOfCoefficients"],"0700":["LO","DCTLabel"],"0701":["CS","DataBlockDescription"],"0702":["AT","DataBlock"],"0710":["US","NormalizationFactorFormat"],"0720":["US","ZonalMapNumberFormat"],"0721":["AT","ZonalMapLocation"],"0722":["US","ZonalMapFormat"],"0730":["US","AdaptiveMapFormat"],"0740":["US","CodeNumberFormat"],"0A02":["CS","PixelSpacingCalibrationType"],"0A04":["LO","PixelSpacingCalibrationDescription"],1040:["CS","PixelIntensityRelationship"],
1041:["SS","PixelIntensityRelationshipSign"],1050:["DS","WindowCenter"],1051:["DS","WindowWidth"],1052:["DS","RescaleIntercept"],1053:["DS","RescaleSlope"],1054:["LO","RescaleType"],1055:["LO","WindowCenterWidthExplanation"],1056:["CS","VOILUTFunction"],1080:["CS","GrayScale"],1090:["CS","RecommendedViewingMode"],1100:["SS","GrayLookupTableDescriptor"],1101:["SS","RedPaletteColorLookupTableDescriptor"],1102:["SS","GreenPaletteColorLookupTableDescriptor"],1103:["SS","BluePaletteColorLookupTableDescriptor"],
1104:["US","AlphaPaletteColorLookupTableDescriptor"],1111:["SS","LargeRedPaletteColorLookupTableDescriptor"],1112:["SS","LargeGreenPaletteColorLookupTableDescriptor"],1113:["SS","LargeBluePaletteColorLookupTableDescriptor"],1199:["UI","PaletteColorLookupTableUID"],1200:["OW","GrayLookupTableData"],1201:["OW","RedPaletteColorLookupTableData"],1202:["OW","GreenPaletteColorLookupTableData"],1203:["OW","BluePaletteColorLookupTableData"],1204:["OW","AlphaPaletteColorLookupTableData"],1211:["OW","LargeRedPaletteColorLookupTableData"],
1212:["OW","LargeGreenPaletteColorLookupTableData"],1213:["OW","LargeBluePaletteColorLookupTableData"],1214:["UI","LargePaletteColorLookupTableUID"],1221:["OW","SegmentedRedPaletteColorLookupTableData"],1222:["OW","SegmentedGreenPaletteColorLookupTableData"],1223:["OW","SegmentedBluePaletteColorLookupTableData"],1300:["CS","BreastImplantPresent"],1350:["CS","PartialView"],1351:["ST","PartialViewDescription"],1352:["SQ","PartialViewCodeSequence"],"135A":["CS","SpatialLocationsPreserved"],1401:["SQ",
"DataFrameAssignmentSequence"],1402:["CS","DataPathAssignment"],1403:["US","BitsMappedToColorLookupTable"],1404:["SQ","BlendingLUT1Sequence"],1405:["CS","BlendingLUT1TransferFunction"],1406:["FD","BlendingWeightConstant"],1407:["US","BlendingLookupTableDescriptor"],1408:["OW","BlendingLookupTableData"],"140B":["SQ","EnhancedPaletteColorLookupTableSequence"],"140C":["SQ","BlendingLUT2Sequence"],"140D":["CS","BlendingLUT2TransferFunction"],"140E":["CS","DataPathID"],"140F":["CS","RGBLUTTransferFunction"],
1410:["CS","AlphaLUTTransferFunction"],2E3:["OB","ICCProfile"],2110:["CS","LossyImageCompression"],2112:["DS","LossyImageCompressionRatio"],2114:["CS","LossyImageCompressionMethod"],3E3:["SQ","ModalityLUTSequence"],3002:["SS","LUTDescriptor"],3003:["LO","LUTExplanation"],3004:["LO","ModalityLUTType"],3006:["OW","LUTData"],3010:["SQ","VOILUTSequence"],3110:["SQ","SoftcopyVOILUTSequence"],4E3:["LT","ImagePresentationComments"],5E3:["SQ","BiPlaneAcquisitionSequence"],6010:["US","RepresentativeFrameNumber"],
6020:["US","FrameNumbersOfInterest"],6022:["LO","FrameOfInterestDescription"],6023:["CS","FrameOfInterestType"],6030:["US","MaskPointers"],6040:["US","RWavePointer"],6100:["SQ","MaskSubtractionSequence"],6101:["CS","MaskOperation"],6102:["US","ApplicableFrameRange"],6110:["US","MaskFrameNumbers"],6112:["US","ContrastFrameAveraging"],6114:["FL","MaskSubPixelShift"],6120:["SS","TIDOffset"],6190:["ST","MaskOperationExplanation"],"7FE0":["UT","PixelDataProviderURL"],9001:["UL","DataPointRows"],9002:["UL",
"DataPointColumns"],9003:["CS","SignalDomainColumns"],9099:["US","LargestMonochromePixelValue"],9108:["CS","DataRepresentation"],9110:["SQ","PixelMeasuresSequence"],9132:["SQ","FrameVOILUTSequence"],9145:["SQ","PixelValueTransformationSequence"],9235:["CS","SignalDomainRows"],9411:["FL","DisplayFilterPercentage"],9415:["SQ","FramePixelShiftSequence"],9416:["US","SubtractionItemID"],9422:["SQ","PixelIntensityRelationshipLUTSequence"],9443:["SQ","FramePixelDataPropertiesSequence"],9444:["CS","GeometricalProperties"],
9445:["FL","GeometricMaximumDistortion"],9446:["CS","ImageProcessingApplied"],9454:["CS","MaskSelectionMode"],9474:["CS","LUTFunction"],9478:["FL","MaskVisibilityPercentage"],9501:["SQ","PixelShiftSequence"],9502:["SQ","RegionPixelShiftSequence"],9503:["SS","VerticesOfTheRegion"],9505:["SQ","MultiFramePresentationSequence"],9506:["US","PixelShiftFrameRange"],9507:["US","LUTFrameRange"],9520:["DS","ImageToEquipmentMappingMatrix"],9537:["CS","EquipmentCoordinateSystemIdentification"]},"0032":{"000A":["CS",
"StudyStatusID"],"000C":["CS","StudyPriorityID"],"0012":["LO","StudyIDIssuer"],"0032":["DA","StudyVerifiedDate"],"0033":["TM","StudyVerifiedTime"],"0034":["DA","StudyReadDate"],"0035":["TM","StudyReadTime"],1E3:["DA","ScheduledStudyStartDate"],1001:["TM","ScheduledStudyStartTime"],1010:["DA","ScheduledStudyStopDate"],1011:["TM","ScheduledStudyStopTime"],1020:["LO","ScheduledStudyLocation"],1021:["AE","ScheduledStudyLocationAETitle"],1030:["LO","ReasonForStudy"],1031:["SQ","RequestingPhysicianIdentificationSequence"],
1032:["PN","RequestingPhysician"],1033:["LO","RequestingService"],1034:["SQ","RequestingServiceCodeSequence"],1040:["DA","StudyArrivalDate"],1041:["TM","StudyArrivalTime"],1050:["DA","StudyCompletionDate"],1051:["TM","StudyCompletionTime"],1055:["CS","StudyComponentStatusID"],1060:["LO","RequestedProcedureDescription"],1064:["SQ","RequestedProcedureCodeSequence"],1070:["LO","RequestedContrastAgent"],4E3:["LT","StudyComments"]},"0038":{"0004":["SQ","ReferencedPatientAliasSequence"],"0008":["CS","VisitStatusID"],
"0010":["LO","AdmissionID"],"0011":["LO","IssuerOfAdmissionID"],"0014":["SQ","IssuerOfAdmissionIDSequence"],"0016":["LO","RouteOfAdmissions"],"001A":["DA","ScheduledAdmissionDate"],"001B":["TM","ScheduledAdmissionTime"],"001C":["DA","ScheduledDischargeDate"],"001D":["TM","ScheduledDischargeTime"],"001E":["LO","ScheduledPatientInstitutionResidence"],"0020":["DA","AdmittingDate"],"0021":["TM","AdmittingTime"],"0030":["DA","DischargeDate"],"0032":["TM","DischargeTime"],"0040":["LO","DischargeDiagnosisDescription"],
"0044":["SQ","DischargeDiagnosisCodeSequence"],"0050":["LO","SpecialNeeds"],"0060":["LO","ServiceEpisodeID"],"0061":["LO","IssuerOfServiceEpisodeID"],"0062":["LO","ServiceEpisodeDescription"],"0064":["SQ","IssuerOfServiceEpisodeIDSequence"],"0100":["SQ","PertinentDocumentsSequence"],"0300":["LO","CurrentPatientLocation"],"0400":["LO","PatientInstitutionResidence"],"0500":["LO","PatientState"],"0502":["SQ","PatientClinicalTrialParticipationSequence"],4E3:["LT","VisitComments"]},"003A":{"0004":["CS",
"WaveformOriginality"],"0005":["US","NumberOfWaveformChannels"],"0010":["UL","NumberOfWaveformSamples"],"001A":["DS","SamplingFrequency"],"0020":["SH","MultiplexGroupLabel"],"0200":["SQ","ChannelDefinitionSequence"],"0202":["IS","WaveformChannelNumber"],"0203":["SH","ChannelLabel"],"0205":["CS","ChannelStatus"],"0208":["SQ","ChannelSourceSequence"],"0209":["SQ","ChannelSourceModifiersSequence"],"020A":["SQ","SourceWaveformSequence"],"020C":["LO","ChannelDerivationDescription"],"0210":["DS","ChannelSensitivity"],
"0211":["SQ","ChannelSensitivityUnitsSequence"],"0212":["DS","ChannelSensitivityCorrectionFactor"],"0213":["DS","ChannelBaseline"],"0214":["DS","ChannelTimeSkew"],"0215":["DS","ChannelSampleSkew"],"0218":["DS","ChannelOffset"],"021A":["US","WaveformBitsStored"],"0220":["DS","FilterLowFrequency"],"0221":["DS","FilterHighFrequency"],"0222":["DS","NotchFilterFrequency"],"0223":["DS","NotchFilterBandwidth"],"0230":["FL","WaveformDataDisplayScale"],"0231":["US","WaveformDisplayBackgroundCIELabValue"],
"0240":["SQ","WaveformPresentationGroupSequence"],"0241":["US","PresentationGroupNumber"],"0242":["SQ","ChannelDisplaySequence"],"0244":["US","ChannelRecommendedDisplayCIELabValue"],"0245":["FL","ChannelPosition"],"0246":["CS","DisplayShadingFlag"],"0247":["FL","FractionalChannelDisplayScale"],"0248":["FL","AbsoluteChannelDisplayScale"],"0300":["SQ","MultiplexedAudioChannelsDescriptionCodeSequence"],"0301":["IS","ChannelIdentificationCode"],"0302":["CS","ChannelMode"]},"0040":{"0001":["AE","ScheduledStationAETitle"],
"0002":["DA","ScheduledProcedureStepStartDate"],"0003":["TM","ScheduledProcedureStepStartTime"],"0004":["DA","ScheduledProcedureStepEndDate"],"0005":["TM","ScheduledProcedureStepEndTime"],"0006":["PN","ScheduledPerformingPhysicianName"],"0007":["LO","ScheduledProcedureStepDescription"],"0008":["SQ","ScheduledProtocolCodeSequence"],"0009":["SH","ScheduledProcedureStepID"],"000A":["SQ","StageCodeSequence"],"000B":["SQ","ScheduledPerformingPhysicianIdentificationSequence"],"0010":["SH","ScheduledStationName"],
"0011":["SH","ScheduledProcedureStepLocation"],"0012":["LO","PreMedication"],"0020":["CS","ScheduledProcedureStepStatus"],"0026":["SQ","OrderPlacerIdentifierSequence"],"0027":["SQ","OrderFillerIdentifierSequence"],"0031":["UT","LocalNamespaceEntityID"],"0032":["UT","UniversalEntityID"],"0033":["CS","UniversalEntityIDType"],"0035":["CS","IdentifierTypeCode"],"0036":["SQ","AssigningFacilitySequence"],"0039":["SQ","AssigningJurisdictionCodeSequence"],"003A":["SQ","AssigningAgencyOrDepartmentCodeSequence"],
"0100":["SQ","ScheduledProcedureStepSequence"],"0220":["SQ","ReferencedNonImageCompositeSOPInstanceSequence"],"0241":["AE","PerformedStationAETitle"],"0242":["SH","PerformedStationName"],"0243":["SH","PerformedLocation"],"0244":["DA","PerformedProcedureStepStartDate"],"0245":["TM","PerformedProcedureStepStartTime"],"0250":["DA","PerformedProcedureStepEndDate"],"0251":["TM","PerformedProcedureStepEndTime"],"0252":["CS","PerformedProcedureStepStatus"],"0253":["SH","PerformedProcedureStepID"],"0254":["LO",
"PerformedProcedureStepDescription"],"0255":["LO","PerformedProcedureTypeDescription"],"0260":["SQ","PerformedProtocolCodeSequence"],"0261":["CS","PerformedProtocolType"],"0270":["SQ","ScheduledStepAttributesSequence"],"0275":["SQ","RequestAttributesSequence"],"0280":["ST","CommentsOnThePerformedProcedureStep"],"0281":["SQ","PerformedProcedureStepDiscontinuationReasonCodeSequence"],"0293":["SQ","QuantitySequence"],"0294":["DS","Quantity"],"0295":["SQ","MeasuringUnitsSequence"],"0296":["SQ","BillingItemSequence"],
"0300":["US","TotalTimeOfFluoroscopy"],"0301":["US","TotalNumberOfExposures"],"0302":["US","EntranceDose"],"0303":["US","ExposedArea"],"0306":["DS","DistanceSourceToEntrance"],"0307":["DS","DistanceSourceToSupport"],"030E":["SQ","ExposureDoseSequence"],"0310":["ST","CommentsOnRadiationDose"],"0312":["DS","XRayOutput"],"0314":["DS","HalfValueLayer"],"0316":["DS","OrganDose"],"0318":["CS","OrganExposed"],"0320":["SQ","BillingProcedureStepSequence"],"0321":["SQ","FilmConsumptionSequence"],"0324":["SQ",
"BillingSuppliesAndDevicesSequence"],"0330":["SQ","ReferencedProcedureStepSequence"],"0340":["SQ","PerformedSeriesSequence"],"0400":["LT","CommentsOnTheScheduledProcedureStep"],"0440":["SQ","ProtocolContextSequence"],"0441":["SQ","ContentItemModifierSequence"],"0500":["SQ","ScheduledSpecimenSequence"],"050A":["LO","SpecimenAccessionNumber"],"0512":["LO","ContainerIdentifier"],"0513":["SQ","IssuerOfTheContainerIdentifierSequence"],"0515":["SQ","AlternateContainerIdentifierSequence"],"0518":["SQ","ContainerTypeCodeSequence"],
"051A":["LO","ContainerDescription"],"0520":["SQ","ContainerComponentSequence"],"0550":["SQ","SpecimenSequence"],"0551":["LO","SpecimenIdentifier"],"0552":["SQ","SpecimenDescriptionSequenceTrial"],"0553":["ST","SpecimenDescriptionTrial"],"0554":["UI","SpecimenUID"],"0555":["SQ","AcquisitionContextSequence"],"0556":["ST","AcquisitionContextDescription"],"059A":["SQ","SpecimenTypeCodeSequence"],"0560":["SQ","SpecimenDescriptionSequence"],"0562":["SQ","IssuerOfTheSpecimenIdentifierSequence"],"0600":["LO",
"SpecimenShortDescription"],"0602":["UT","SpecimenDetailedDescription"],"0610":["SQ","SpecimenPreparationSequence"],"0612":["SQ","SpecimenPreparationStepContentItemSequence"],"0620":["SQ","SpecimenLocalizationContentItemSequence"],"06FA":["LO","SlideIdentifier"],"071A":["SQ","ImageCenterPointCoordinatesSequence"],"072A":["DS","XOffsetInSlideCoordinateSystem"],"073A":["DS","YOffsetInSlideCoordinateSystem"],"074A":["DS","ZOffsetInSlideCoordinateSystem"],"08D8":["SQ","PixelSpacingSequence"],"08DA":["SQ",
"CoordinateSystemAxisCodeSequence"],"08EA":["SQ","MeasurementUnitsCodeSequence"],"09F8":["SQ","VitalStainCodeSequenceTrial"],1001:["SH","RequestedProcedureID"],1002:["LO","ReasonForTheRequestedProcedure"],1003:["SH","RequestedProcedurePriority"],1004:["LO","PatientTransportArrangements"],1005:["LO","RequestedProcedureLocation"],1006:["SH","PlacerOrderNumberProcedure"],1007:["SH","FillerOrderNumberProcedure"],1008:["LO","ConfidentialityCode"],1009:["SH","ReportingPriority"],"100A":["SQ","ReasonForRequestedProcedureCodeSequence"],
1010:["PN","NamesOfIntendedRecipientsOfResults"],1011:["SQ","IntendedRecipientsOfResultsIdentificationSequence"],1012:["SQ","ReasonForPerformedProcedureCodeSequence"],1060:["LO","RequestedProcedureDescriptionTrial"],1101:["SQ","PersonIdentificationCodeSequence"],1102:["ST","PersonAddress"],1103:["LO","PersonTelephoneNumbers"],1400:["LT","RequestedProcedureComments"],2001:["LO","ReasonForTheImagingServiceRequest"],2004:["DA","IssueDateOfImagingServiceRequest"],2005:["TM","IssueTimeOfImagingServiceRequest"],
2006:["SH","PlacerOrderNumberImagingServiceRequestRetired"],2007:["SH","FillerOrderNumberImagingServiceRequestRetired"],2008:["PN","OrderEnteredBy"],2009:["SH","OrderEntererLocation"],2010:["SH","OrderCallbackPhoneNumber"],2016:["LO","PlacerOrderNumberImagingServiceRequest"],2017:["LO","FillerOrderNumberImagingServiceRequest"],2400:["LT","ImagingServiceRequestComments"],3001:["LO","ConfidentialityConstraintOnPatientDataDescription"],4001:["CS","GeneralPurposeScheduledProcedureStepStatus"],4002:["CS",
"GeneralPurposePerformedProcedureStepStatus"],4003:["CS","GeneralPurposeScheduledProcedureStepPriority"],4004:["SQ","ScheduledProcessingApplicationsCodeSequence"],4005:["DT","ScheduledProcedureStepStartDateTime"],4006:["CS","MultipleCopiesFlag"],4007:["SQ","PerformedProcessingApplicationsCodeSequence"],4009:["SQ","HumanPerformerCodeSequence"],4010:["DT","ScheduledProcedureStepModificationDateTime"],4011:["DT","ExpectedCompletionDateTime"],4015:["SQ","ResultingGeneralPurposePerformedProcedureStepsSequence"],
4016:["SQ","ReferencedGeneralPurposeScheduledProcedureStepSequence"],4018:["SQ","ScheduledWorkitemCodeSequence"],4019:["SQ","PerformedWorkitemCodeSequence"],4020:["CS","InputAvailabilityFlag"],4021:["SQ","InputInformationSequence"],4022:["SQ","RelevantInformationSequence"],4023:["UI","ReferencedGeneralPurposeScheduledProcedureStepTransactionUID"],4025:["SQ","ScheduledStationNameCodeSequence"],4026:["SQ","ScheduledStationClassCodeSequence"],4027:["SQ","ScheduledStationGeographicLocationCodeSequence"],
4028:["SQ","PerformedStationNameCodeSequence"],4029:["SQ","PerformedStationClassCodeSequence"],4030:["SQ","PerformedStationGeographicLocationCodeSequence"],4031:["SQ","RequestedSubsequentWorkitemCodeSequence"],4032:["SQ","NonDICOMOutputCodeSequence"],4033:["SQ","OutputInformationSequence"],4034:["SQ","ScheduledHumanPerformersSequence"],4035:["SQ","ActualHumanPerformersSequence"],4036:["LO","HumanPerformerOrganization"],4037:["PN","HumanPerformerName"],4040:["CS","RawDataHandling"],4041:["CS","InputReadinessState"],
4050:["DT","PerformedProcedureStepStartDateTime"],4051:["DT","PerformedProcedureStepEndDateTime"],4052:["DT","ProcedureStepCancellationDateTime"],8302:["DS","EntranceDoseInmGy"],9094:["SQ","ReferencedImageRealWorldValueMappingSequence"],9096:["SQ","RealWorldValueMappingSequence"],9098:["SQ","PixelValueMappingCodeSequence"],9210:["SH","LUTLabel"],9211:["SS","RealWorldValueLastValueMapped"],9212:["FD","RealWorldValueLUTData"],9216:["SS","RealWorldValueFirstValueMapped"],9224:["FD","RealWorldValueIntercept"],
9225:["FD","RealWorldValueSlope"],A007:["CS","FindingsFlagTrial"],A010:["CS","RelationshipType"],A020:["SQ","FindingsSequenceTrial"],A021:["UI","FindingsGroupUIDTrial"],A022:["UI","ReferencedFindingsGroupUIDTrial"],A023:["DA","FindingsGroupRecordingDateTrial"],A024:["TM","FindingsGroupRecordingTimeTrial"],A026:["SQ","FindingsSourceCategoryCodeSequenceTrial"],A027:["LO","VerifyingOrganization"],A028:["SQ","DocumentingOrganizationIdentifierCodeSequenceTrial"],A030:["DT","VerificationDateTime"],A032:["DT",
"ObservationDateTime"],A040:["CS","ValueType"],A043:["SQ","ConceptNameCodeSequence"],A047:["LO","MeasurementPrecisionDescriptionTrial"],A050:["CS","ContinuityOfContent"],A057:["CS","UrgencyOrPriorityAlertsTrial"],A060:["LO","SequencingIndicatorTrial"],A066:["SQ","DocumentIdentifierCodeSequenceTrial"],A067:["PN","DocumentAuthorTrial"],A068:["SQ","DocumentAuthorIdentifierCodeSequenceTrial"],A070:["SQ","IdentifierCodeSequenceTrial"],A073:["SQ","VerifyingObserverSequence"],A074:["OB","ObjectBinaryIdentifierTrial"],
A075:["PN","VerifyingObserverName"],A076:["SQ","DocumentingObserverIdentifierCodeSequenceTrial"],A078:["SQ","AuthorObserverSequence"],A07A:["SQ","ParticipantSequence"],A07C:["SQ","CustodialOrganizationSequence"],A080:["CS","ParticipationType"],A082:["DT","ParticipationDateTime"],A084:["CS","ObserverType"],A085:["SQ","ProcedureIdentifierCodeSequenceTrial"],A088:["SQ","VerifyingObserverIdentificationCodeSequence"],A089:["OB","ObjectDirectoryBinaryIdentifierTrial"],A090:["SQ","EquivalentCDADocumentSequence"],
A0B0:["US","ReferencedWaveformChannels"],A110:["DA","DateOfDocumentOrVerbalTransactionTrial"],A112:["TM","TimeOfDocumentCreationOrVerbalTransactionTrial"],A120:["DT","DateTime"],A121:["DA","Date"],A122:["TM","Time"],A123:["PN","PersonName"],A124:["UI","UID"],A125:["CS","ReportStatusIDTrial"],A130:["CS","TemporalRangeType"],A132:["UL","ReferencedSamplePositions"],A136:["US","ReferencedFrameNumbers"],A138:["DS","ReferencedTimeOffsets"],A13A:["DT","ReferencedDateTime"],A160:["UT","TextValue"],A167:["SQ",
"ObservationCategoryCodeSequenceTrial"],A168:["SQ","ConceptCodeSequence"],A16A:["ST","BibliographicCitationTrial"],A170:["SQ","PurposeOfReferenceCodeSequence"],A171:["UI","ObservationUIDTrial"],A172:["UI","ReferencedObservationUIDTrial"],A173:["CS","ReferencedObservationClassTrial"],A174:["CS","ReferencedObjectObservationClassTrial"],A180:["US","AnnotationGroupNumber"],A192:["DA","ObservationDateTrial"],A193:["TM","ObservationTimeTrial"],A194:["CS","MeasurementAutomationTrial"],A195:["SQ","ModifierCodeSequence"],
A224:["ST","IdentificationDescriptionTrial"],A290:["CS","CoordinatesSetGeometricTypeTrial"],A296:["SQ","AlgorithmCodeSequenceTrial"],A297:["ST","AlgorithmDescriptionTrial"],A29A:["SL","PixelCoordinatesSetTrial"],A300:["SQ","MeasuredValueSequence"],A301:["SQ","NumericValueQualifierCodeSequence"],A307:["PN","CurrentObserverTrial"],A30A:["DS","NumericValue"],A313:["SQ","ReferencedAccessionSequenceTrial"],A33A:["ST","ReportStatusCommentTrial"],A340:["SQ","ProcedureContextSequenceTrial"],A352:["PN","VerbalSourceTrial"],
A353:["ST","AddressTrial"],A354:["LO","TelephoneNumberTrial"],A358:["SQ","VerbalSourceIdentifierCodeSequenceTrial"],A360:["SQ","PredecessorDocumentsSequence"],A370:["SQ","ReferencedRequestSequence"],A372:["SQ","PerformedProcedureCodeSequence"],A375:["SQ","CurrentRequestedProcedureEvidenceSequence"],A380:["SQ","ReportDetailSequenceTrial"],A385:["SQ","PertinentOtherEvidenceSequence"],A390:["SQ","HL7StructuredDocumentReferenceSequence"],A402:["UI","ObservationSubjectUIDTrial"],A403:["CS","ObservationSubjectClassTrial"],
A404:["SQ","ObservationSubjectTypeCodeSequenceTrial"],A491:["CS","CompletionFlag"],A492:["LO","CompletionFlagDescription"],A493:["CS","VerificationFlag"],A494:["CS","ArchiveRequested"],A496:["CS","PreliminaryFlag"],A504:["SQ","ContentTemplateSequence"],A525:["SQ","IdenticalDocumentsSequence"],A600:["CS","ObservationSubjectContextFlagTrial"],A601:["CS","ObserverContextFlagTrial"],A603:["CS","ProcedureContextFlagTrial"],A730:["SQ","ContentSequence"],A731:["SQ","RelationshipSequenceTrial"],A732:["SQ",
"RelationshipTypeCodeSequenceTrial"],A744:["SQ","LanguageCodeSequenceTrial"],A992:["ST","UniformResourceLocatorTrial"],B020:["SQ","WaveformAnnotationSequence"],DB00:["CS","TemplateIdentifier"],DB06:["DT","TemplateVersion"],DB07:["DT","TemplateLocalVersion"],DB0B:["CS","TemplateExtensionFlag"],DB0C:["UI","TemplateExtensionOrganizationUID"],DB0D:["UI","TemplateExtensionCreatorUID"],DB73:["UL","ReferencedContentItemIdentifier"],E001:["ST","HL7InstanceIdentifier"],E004:["DT","HL7DocumentEffectiveTime"],
E006:["SQ","HL7DocumentTypeCodeSequence"],E008:["SQ","DocumentClassCodeSequence"],E010:["UT","RetrieveURI"],E011:["UI","RetrieveLocationUID"],E020:["CS","TypeOfInstances"],E021:["SQ","DICOMRetrievalSequence"],E022:["SQ","DICOMMediaRetrievalSequence"],E023:["SQ","WADORetrievalSequence"],E024:["SQ","XDSRetrievalSequence"],E030:["UI","RepositoryUniqueID"],E031:["UI","HomeCommunityID"]},"0042":{"0010":["ST","DocumentTitle"],"0011":["OB","EncapsulatedDocument"],"0012":["LO","MIMETypeOfEncapsulatedDocument"],
"0013":["SQ","SourceInstanceSequence"],"0014":["LO","ListOfMIMETypes"]},"0044":{"0001":["ST","ProductPackageIdentifier"],"0002":["CS","SubstanceAdministrationApproval"],"0003":["LT","ApprovalStatusFurtherDescription"],"0004":["DT","ApprovalStatusDateTime"],"0007":["SQ","ProductTypeCodeSequence"],"0008":["LO","ProductName"],"0009":["LT","ProductDescription"],"000A":["LO","ProductLotIdentifier"],"000B":["DT","ProductExpirationDateTime"],"0010":["DT","SubstanceAdministrationDateTime"],"0011":["LO","SubstanceAdministrationNotes"],
"0012":["LO","SubstanceAdministrationDeviceID"],"0013":["SQ","ProductParameterSequence"],"0019":["SQ","SubstanceAdministrationParameterSequence"]},"0046":{"0012":["LO","LensDescription"],"0014":["SQ","RightLensSequence"],"0015":["SQ","LeftLensSequence"],"0016":["SQ","UnspecifiedLateralityLensSequence"],"0018":["SQ","CylinderSequence"],"0028":["SQ","PrismSequence"],"0030":["FD","HorizontalPrismPower"],"0032":["CS","HorizontalPrismBase"],"0034":["FD","VerticalPrismPower"],"0036":["CS","VerticalPrismBase"],
"0038":["CS","LensSegmentType"],"0040":["FD","OpticalTransmittance"],"0042":["FD","ChannelWidth"],"0044":["FD","PupilSize"],"0046":["FD","CornealSize"],"0050":["SQ","AutorefractionRightEyeSequence"],"0052":["SQ","AutorefractionLeftEyeSequence"],"0060":["FD","DistancePupillaryDistance"],"0062":["FD","NearPupillaryDistance"],"0063":["FD","IntermediatePupillaryDistance"],"0064":["FD","OtherPupillaryDistance"],"0070":["SQ","KeratometryRightEyeSequence"],"0071":["SQ","KeratometryLeftEyeSequence"],"0074":["SQ",
"SteepKeratometricAxisSequence"],"0075":["FD","RadiusOfCurvature"],"0076":["FD","KeratometricPower"],"0077":["FD","KeratometricAxis"],"0080":["SQ","FlatKeratometricAxisSequence"],"0092":["CS","BackgroundColor"],"0094":["CS","Optotype"],"0095":["CS","OptotypePresentation"],"0097":["SQ","SubjectiveRefractionRightEyeSequence"],"0098":["SQ","SubjectiveRefractionLeftEyeSequence"],"0100":["SQ","AddNearSequence"],"0101":["SQ","AddIntermediateSequence"],"0102":["SQ","AddOtherSequence"],"0104":["FD","AddPower"],
"0106":["FD","ViewingDistance"],"0121":["SQ","VisualAcuityTypeCodeSequence"],"0122":["SQ","VisualAcuityRightEyeSequence"],"0123":["SQ","VisualAcuityLeftEyeSequence"],"0124":["SQ","VisualAcuityBothEyesOpenSequence"],"0125":["CS","ViewingDistanceType"],"0135":["SS","VisualAcuityModifiers"],"0137":["FD","DecimalVisualAcuity"],"0139":["LO","OptotypeDetailedDefinition"],"0145":["SQ","ReferencedRefractiveMeasurementsSequence"],"0146":["FD","SpherePower"],"0147":["FD","CylinderPower"]},"0048":{"0001":["FL",
"ImagedVolumeWidth"],"0002":["FL","ImagedVolumeHeight"],"0003":["FL","ImagedVolumeDepth"],"0006":["UL","TotalPixelMatrixColumns"],"0007":["UL","TotalPixelMatrixRows"],"0008":["SQ","TotalPixelMatrixOriginSequence"],"0010":["CS","SpecimenLabelInImage"],"0011":["CS","FocusMethod"],"0012":["CS","ExtendedDepthOfField"],"0013":["US","NumberOfFocalPlanes"],"0014":["FL","DistanceBetweenFocalPlanes"],"0015":["US","RecommendedAbsentPixelCIELabValue"],"0100":["SQ","IlluminatorTypeCodeSequence"],"0102":["DS",
"ImageOrientationSlide"],"0105":["SQ","OpticalPathSequence"],"0106":["SH","OpticalPathIdentifier"],"0107":["ST","OpticalPathDescription"],"0108":["SQ","IlluminationColorCodeSequence"],"0110":["SQ","SpecimenReferenceSequence"],"0111":["DS","CondenserLensPower"],"0112":["DS","ObjectiveLensPower"],"0113":["DS","ObjectiveLensNumericalAperture"],"0120":["SQ","PaletteColorLookupTableSequence"],"0200":["SQ","ReferencedImageNavigationSequence"],"0201":["US","TopLeftHandCornerOfLocalizerArea"],"0202":["US",
"BottomRightHandCornerOfLocalizerArea"],"0207":["SQ","OpticalPathIdentificationSequence"],"021A":["SQ","PlanePositionSlideSequence"],"021E":["SL","RowPositionInTotalImagePixelMatrix"],"021F":["SL","ColumnPositionInTotalImagePixelMatrix"],"0301":["CS","PixelOriginInterpretation"]},"0050":{"0004":["CS","CalibrationImage"],"0010":["SQ","DeviceSequence"],"0012":["SQ","ContainerComponentTypeCodeSequence"],"0013":["FD","ContainerComponentThickness"],"0014":["DS","DeviceLength"],"0015":["FD","ContainerComponentWidth"],
"0016":["DS","DeviceDiameter"],"0017":["CS","DeviceDiameterUnits"],"0018":["DS","DeviceVolume"],"0019":["DS","InterMarkerDistance"],"001A":["CS","ContainerComponentMaterial"],"001B":["LO","ContainerComponentID"],"001C":["FD","ContainerComponentLength"],"001D":["FD","ContainerComponentDiameter"],"001E":["LO","ContainerComponentDescription"],"0020":["LO","DeviceDescription"]},"0052":{"0001":["FL","ContrastBolusIngredientPercentByVolume"],"0002":["FD","OCTFocalDistance"],"0003":["FD","BeamSpotSize"],
"0004":["FD","EffectiveRefractiveIndex"],"0006":["CS","OCTAcquisitionDomain"],"0007":["FD","OCTOpticalCenterWavelength"],"0008":["FD","AxialResolution"],"0009":["FD","RangingDepth"],"0011":["FD","ALineRate"],"0012":["US","ALinesPerFrame"],"0013":["FD","CatheterRotationalRate"],"0014":["FD","ALinePixelSpacing"],"0016":["SQ","ModeOfPercutaneousAccessSequence"],"0025":["SQ","IntravascularOCTFrameTypeSequence"],"0026":["CS","OCTZOffsetApplied"],"0027":["SQ","IntravascularFrameContentSequence"],"0028":["FD",
"IntravascularLongitudinalDistance"],"0029":["SQ","IntravascularOCTFrameContentSequence"],"0030":["SS","OCTZOffsetCorrection"],"0031":["CS","CatheterDirectionOfRotation"],"0033":["FD","SeamLineLocation"],"0034":["FD","FirstALineLocation"],"0036":["US","SeamLineIndex"],"0038":["US","NumberOfPaddedAlines"],"0039":["CS","InterpolationType"],"003A":["CS","RefractiveIndexApplied"]},"0054":{"0010":["US","EnergyWindowVector"],"0011":["US","NumberOfEnergyWindows"],"0012":["SQ","EnergyWindowInformationSequence"],
"0013":["SQ","EnergyWindowRangeSequence"],"0014":["DS","EnergyWindowLowerLimit"],"0015":["DS","EnergyWindowUpperLimit"],"0016":["SQ","RadiopharmaceuticalInformationSequence"],"0017":["IS","ResidualSyringeCounts"],"0018":["SH","EnergyWindowName"],"0020":["US","DetectorVector"],"0021":["US","NumberOfDetectors"],"0022":["SQ","DetectorInformationSequence"],"0030":["US","PhaseVector"],"0031":["US","NumberOfPhases"],"0032":["SQ","PhaseInformationSequence"],"0033":["US","NumberOfFramesInPhase"],"0036":["IS",
"PhaseDelay"],"0038":["IS","PauseBetweenFrames"],"0039":["CS","PhaseDescription"],"0050":["US","RotationVector"],"0051":["US","NumberOfRotations"],"0052":["SQ","RotationInformationSequence"],"0053":["US","NumberOfFramesInRotation"],"0060":["US","RRIntervalVector"],"0061":["US","NumberOfRRIntervals"],"0062":["SQ","GatedInformationSequence"],"0063":["SQ","DataInformationSequence"],"0070":["US","TimeSlotVector"],"0071":["US","NumberOfTimeSlots"],"0072":["SQ","TimeSlotInformationSequence"],"0073":["DS",
"TimeSlotTime"],"0080":["US","SliceVector"],"0081":["US","NumberOfSlices"],"0090":["US","AngularViewVector"],"0100":["US","TimeSliceVector"],"0101":["US","NumberOfTimeSlices"],"0200":["DS","StartAngle"],"0202":["CS","TypeOfDetectorMotion"],"0210":["IS","TriggerVector"],"0211":["US","NumberOfTriggersInPhase"],"0220":["SQ","ViewCodeSequence"],"0222":["SQ","ViewModifierCodeSequence"],"0300":["SQ","RadionuclideCodeSequence"],"0302":["SQ","AdministrationRouteCodeSequence"],"0304":["SQ","RadiopharmaceuticalCodeSequence"],
"0306":["SQ","CalibrationDataSequence"],"0308":["US","EnergyWindowNumber"],"0400":["SH","ImageID"],"0410":["SQ","PatientOrientationCodeSequence"],"0412":["SQ","PatientOrientationModifierCodeSequence"],"0414":["SQ","PatientGantryRelationshipCodeSequence"],"0500":["CS","SliceProgressionDirection"],1E3:["CS","SeriesType"],1001:["CS","Units"],1002:["CS","CountsSource"],1004:["CS","ReprojectionMethod"],1006:["CS","SUVType"],1100:["CS","RandomsCorrectionMethod"],1101:["LO","AttenuationCorrectionMethod"],
1102:["CS","DecayCorrection"],1103:["LO","ReconstructionMethod"],1104:["LO","DetectorLinesOfResponseUsed"],1105:["LO","ScatterCorrectionMethod"],1200:["DS","AxialAcceptance"],1201:["IS","AxialMash"],1202:["IS","TransverseMash"],1203:["DS","DetectorElementSize"],1210:["DS","CoincidenceWindowWidth"],1220:["CS","SecondaryCountsType"],1300:["DS","FrameReferenceTime"],1310:["IS","PrimaryPromptsCountsAccumulated"],1311:["IS","SecondaryCountsAccumulated"],1320:["DS","SliceSensitivityFactor"],1321:["DS",
"DecayFactor"],1322:["DS","DoseCalibrationFactor"],1323:["DS","ScatterFractionFactor"],1324:["DS","DeadTimeFactor"],1330:["US","ImageIndex"],1400:["CS","CountsIncluded"],1401:["CS","DeadTimeCorrectionFlag"]},"0060":{3E3:["SQ","HistogramSequence"],3002:["US","HistogramNumberOfBins"],3004:["SS","HistogramFirstBinValue"],3006:["SS","HistogramLastBinValue"],3008:["US","HistogramBinWidth"],3010:["LO","HistogramExplanation"],3020:["UL","HistogramData"]},"0062":{"0001":["CS","SegmentationType"],"0002":["SQ",
"SegmentSequence"],"0003":["SQ","SegmentedPropertyCategoryCodeSequence"],"0004":["US","SegmentNumber"],"0005":["LO","SegmentLabel"],"0006":["ST","SegmentDescription"],"0008":["CS","SegmentAlgorithmType"],"0009":["LO","SegmentAlgorithmName"],"000A":["SQ","SegmentIdentificationSequence"],"000B":["US","ReferencedSegmentNumber"],"000C":["US","RecommendedDisplayGrayscaleValue"],"000D":["US","RecommendedDisplayCIELabValue"],"000E":["US","MaximumFractionalValue"],"000F":["SQ","SegmentedPropertyTypeCodeSequence"],
"0010":["CS","SegmentationFractionalType"]},"0064":{"0002":["SQ","DeformableRegistrationSequence"],"0003":["UI","SourceFrameOfReferenceUID"],"0005":["SQ","DeformableRegistrationGridSequence"],"0007":["UL","GridDimensions"],"0008":["FD","GridResolution"],"0009":["OF","VectorGridData"],"000F":["SQ","PreDeformationMatrixRegistrationSequence"],"0010":["SQ","PostDeformationMatrixRegistrationSequence"]},"0066":{"0001":["UL","NumberOfSurfaces"],"0002":["SQ","SurfaceSequence"],"0003":["UL","SurfaceNumber"],
"0004":["LT","SurfaceComments"],"0009":["CS","SurfaceProcessing"],"000A":["FL","SurfaceProcessingRatio"],"000B":["LO","SurfaceProcessingDescription"],"000C":["FL","RecommendedPresentationOpacity"],"000D":["CS","RecommendedPresentationType"],"000E":["CS","FiniteVolume"],"0010":["CS","Manifold"],"0011":["SQ","SurfacePointsSequence"],"0012":["SQ","SurfacePointsNormalsSequence"],"0013":["SQ","SurfaceMeshPrimitivesSequence"],"0015":["UL","NumberOfSurfacePoints"],"0016":["OF","PointCoordinatesData"],"0017":["FL",
"PointPositionAccuracy"],"0018":["FL","MeanPointDistance"],"0019":["FL","MaximumPointDistance"],"001A":["FL","PointsBoundingBoxCoordinates"],"001B":["FL","AxisOfRotation"],"001C":["FL","CenterOfRotation"],"001E":["UL","NumberOfVectors"],"001F":["US","VectorDimensionality"],"0020":["FL","VectorAccuracy"],"0021":["OF","VectorCoordinateData"],"0023":["OW","TrianglePointIndexList"],"0024":["OW","EdgePointIndexList"],"0025":["OW","VertexPointIndexList"],"0026":["SQ","TriangleStripSequence"],"0027":["SQ",
"TriangleFanSequence"],"0028":["SQ","LineSequence"],"0029":["OW","PrimitivePointIndexList"],"002A":["UL","SurfaceCount"],"002B":["SQ","ReferencedSurfaceSequence"],"002C":["UL","ReferencedSurfaceNumber"],"002D":["SQ","SegmentSurfaceGenerationAlgorithmIdentificationSequence"],"002E":["SQ","SegmentSurfaceSourceInstanceSequence"],"002F":["SQ","AlgorithmFamilyCodeSequence"],"0030":["SQ","AlgorithmNameCodeSequence"],"0031":["LO","AlgorithmVersion"],"0032":["LT","AlgorithmParameters"],"0034":["SQ","FacetSequence"],
"0035":["SQ","SurfaceProcessingAlgorithmIdentificationSequence"],"0036":["LO","AlgorithmName"]},"0068":{6210:["LO","ImplantSize"],6221:["LO","ImplantTemplateVersion"],6222:["SQ","ReplacedImplantTemplateSequence"],6223:["CS","ImplantType"],6224:["SQ","DerivationImplantTemplateSequence"],6225:["SQ","OriginalImplantTemplateSequence"],6226:["DT","EffectiveDateTime"],6230:["SQ","ImplantTargetAnatomySequence"],6260:["SQ","InformationFromManufacturerSequence"],6265:["SQ","NotificationFromManufacturerSequence"],
6270:["DT","InformationIssueDateTime"],6280:["ST","InformationSummary"],"62A0":["SQ","ImplantRegulatoryDisapprovalCodeSequence"],"62A5":["FD","OverallTemplateSpatialTolerance"],"62C0":["SQ","HPGLDocumentSequence"],"62D0":["US","HPGLDocumentID"],"62D5":["LO","HPGLDocumentLabel"],"62E0":["SQ","ViewOrientationCodeSequence"],"62F0":["FD","ViewOrientationModifier"],"62F2":["FD","HPGLDocumentScaling"],6300:["OB","HPGLDocument"],6310:["US","HPGLContourPenNumber"],6320:["SQ","HPGLPenSequence"],6330:["US",
"HPGLPenNumber"],6340:["LO","HPGLPenLabel"],6345:["ST","HPGLPenDescription"],6346:["FD","RecommendedRotationPoint"],6347:["FD","BoundingRectangle"],6350:["US","ImplantTemplate3DModelSurfaceNumber"],6360:["SQ","SurfaceModelDescriptionSequence"],6380:["LO","SurfaceModelLabel"],6390:["FD","SurfaceModelScalingFactor"],"63A0":["SQ","MaterialsCodeSequence"],"63A4":["SQ","CoatingMaterialsCodeSequence"],"63A8":["SQ","ImplantTypeCodeSequence"],"63AC":["SQ","FixationMethodCodeSequence"],"63B0":["SQ","MatingFeatureSetsSequence"],
"63C0":["US","MatingFeatureSetID"],"63D0":["LO","MatingFeatureSetLabel"],"63E0":["SQ","MatingFeatureSequence"],"63F0":["US","MatingFeatureID"],6400:["SQ","MatingFeatureDegreeOfFreedomSequence"],6410:["US","DegreeOfFreedomID"],6420:["CS","DegreeOfFreedomType"],6430:["SQ","TwoDMatingFeatureCoordinatesSequence"],6440:["US","ReferencedHPGLDocumentID"],6450:["FD","TwoDMatingPoint"],6460:["FD","TwoDMatingAxes"],6470:["SQ","TwoDDegreeOfFreedomSequence"],6490:["FD","ThreeDDegreeOfFreedomAxis"],"64A0":["FD",
"RangeOfFreedom"],"64C0":["FD","ThreeDMatingPoint"],"64D0":["FD","ThreeDMatingAxes"],"64F0":["FD","TwoDDegreeOfFreedomAxis"],6500:["SQ","PlanningLandmarkPointSequence"],6510:["SQ","PlanningLandmarkLineSequence"],6520:["SQ","PlanningLandmarkPlaneSequence"],6530:["US","PlanningLandmarkID"],6540:["LO","PlanningLandmarkDescription"],6545:["SQ","PlanningLandmarkIdentificationCodeSequence"],6550:["SQ","TwoDPointCoordinatesSequence"],6560:["FD","TwoDPointCoordinates"],6590:["FD","ThreeDPointCoordinates"],
"65A0":["SQ","TwoDLineCoordinatesSequence"],"65B0":["FD","TwoDLineCoordinates"],"65D0":["FD","ThreeDLineCoordinates"],"65E0":["SQ","TwoDPlaneCoordinatesSequence"],"65F0":["FD","TwoDPlaneIntersection"],6610:["FD","ThreeDPlaneOrigin"],6620:["FD","ThreeDPlaneNormal"]},"0070":{"0001":["SQ","GraphicAnnotationSequence"],"0002":["CS","GraphicLayer"],"0003":["CS","BoundingBoxAnnotationUnits"],"0004":["CS","AnchorPointAnnotationUnits"],"0005":["CS","GraphicAnnotationUnits"],"0006":["ST","UnformattedTextValue"],
"0008":["SQ","TextObjectSequence"],"0009":["SQ","GraphicObjectSequence"],"0010":["FL","BoundingBoxTopLeftHandCorner"],"0011":["FL","BoundingBoxBottomRightHandCorner"],"0012":["CS","BoundingBoxTextHorizontalJustification"],"0014":["FL","AnchorPoint"],"0015":["CS","AnchorPointVisibility"],"0020":["US","GraphicDimensions"],"0021":["US","NumberOfGraphicPoints"],"0022":["FL","GraphicData"],"0023":["CS","GraphicType"],"0024":["CS","GraphicFilled"],"0040":["IS","ImageRotationRetired"],"0041":["CS","ImageHorizontalFlip"],
"0042":["US","ImageRotation"],"0050":["US","DisplayedAreaTopLeftHandCornerTrial"],"0051":["US","DisplayedAreaBottomRightHandCornerTrial"],"0052":["SL","DisplayedAreaTopLeftHandCorner"],"0053":["SL","DisplayedAreaBottomRightHandCorner"],"005A":["SQ","DisplayedAreaSelectionSequence"],"0060":["SQ","GraphicLayerSequence"],"0062":["IS","GraphicLayerOrder"],"0066":["US","GraphicLayerRecommendedDisplayGrayscaleValue"],"0067":["US","GraphicLayerRecommendedDisplayRGBValue"],"0068":["LO","GraphicLayerDescription"],
"0080":["CS","ContentLabel"],"0081":["LO","ContentDescription"],"0082":["DA","PresentationCreationDate"],"0083":["TM","PresentationCreationTime"],"0084":["PN","ContentCreatorName"],"0086":["SQ","ContentCreatorIdentificationCodeSequence"],"0087":["SQ","AlternateContentDescriptionSequence"],"0100":["CS","PresentationSizeMode"],"0101":["DS","PresentationPixelSpacing"],"0102":["IS","PresentationPixelAspectRatio"],"0103":["FL","PresentationPixelMagnificationRatio"],"0207":["LO","GraphicGroupLabel"],"0208":["ST",
"GraphicGroupDescription"],"0209":["SQ","CompoundGraphicSequence"],"0226":["UL","CompoundGraphicInstanceID"],"0227":["LO","FontName"],"0228":["CS","FontNameType"],"0229":["LO","CSSFontName"],"0230":["FD","RotationAngle"],"0231":["SQ","TextStyleSequence"],"0232":["SQ","LineStyleSequence"],"0233":["SQ","FillStyleSequence"],"0234":["SQ","GraphicGroupSequence"],"0241":["US","TextColorCIELabValue"],"0242":["CS","HorizontalAlignment"],"0243":["CS","VerticalAlignment"],"0244":["CS","ShadowStyle"],"0245":["FL",
"ShadowOffsetX"],"0246":["FL","ShadowOffsetY"],"0247":["US","ShadowColorCIELabValue"],"0248":["CS","Underlined"],"0249":["CS","Bold"],"0250":["CS","Italic"],"0251":["US","PatternOnColorCIELabValue"],"0252":["US","PatternOffColorCIELabValue"],"0253":["FL","LineThickness"],"0254":["CS","LineDashingStyle"],"0255":["UL","LinePattern"],"0256":["OB","FillPattern"],"0257":["CS","FillMode"],"0258":["FL","ShadowOpacity"],"0261":["FL","GapLength"],"0262":["FL","DiameterOfVisibility"],"0273":["FL","RotationPoint"],
"0274":["CS","TickAlignment"],"0278":["CS","ShowTickLabel"],"0279":["CS","TickLabelAlignment"],"0282":["CS","CompoundGraphicUnits"],"0284":["FL","PatternOnOpacity"],"0285":["FL","PatternOffOpacity"],"0287":["SQ","MajorTicksSequence"],"0288":["FL","TickPosition"],"0289":["SH","TickLabel"],"0294":["CS","CompoundGraphicType"],"0295":["UL","GraphicGroupID"],"0306":["CS","ShapeType"],"0308":["SQ","RegistrationSequence"],"0309":["SQ","MatrixRegistrationSequence"],"030A":["SQ","MatrixSequence"],"030C":["CS",
"FrameOfReferenceTransformationMatrixType"],"030D":["SQ","RegistrationTypeCodeSequence"],"030F":["ST","FiducialDescription"],"0310":["SH","FiducialIdentifier"],"0311":["SQ","FiducialIdentifierCodeSequence"],"0312":["FD","ContourUncertaintyRadius"],"0314":["SQ","UsedFiducialsSequence"],"0318":["SQ","GraphicCoordinatesDataSequence"],"031A":["UI","FiducialUID"],"031C":["SQ","FiducialSetSequence"],"031E":["SQ","FiducialSequence"],"0401":["US","GraphicLayerRecommendedDisplayCIELabValue"],"0402":["SQ",
"BlendingSequence"],"0403":["FL","RelativeOpacity"],"0404":["SQ","ReferencedSpatialRegistrationSequence"],"0405":["CS","BlendingPosition"]},"0072":{"0002":["SH","HangingProtocolName"],"0004":["LO","HangingProtocolDescription"],"0006":["CS","HangingProtocolLevel"],"0008":["LO","HangingProtocolCreator"],"000A":["DT","HangingProtocolCreationDateTime"],"000C":["SQ","HangingProtocolDefinitionSequence"],"000E":["SQ","HangingProtocolUserIdentificationCodeSequence"],"0010":["LO","HangingProtocolUserGroupName"],
"0012":["SQ","SourceHangingProtocolSequence"],"0014":["US","NumberOfPriorsReferenced"],"0020":["SQ","ImageSetsSequence"],"0022":["SQ","ImageSetSelectorSequence"],"0024":["CS","ImageSetSelectorUsageFlag"],"0026":["AT","SelectorAttribute"],"0028":["US","SelectorValueNumber"],"0030":["SQ","TimeBasedImageSetsSequence"],"0032":["US","ImageSetNumber"],"0034":["CS","ImageSetSelectorCategory"],"0038":["US","RelativeTime"],"003A":["CS","RelativeTimeUnits"],"003C":["SS","AbstractPriorValue"],"003E":["SQ","AbstractPriorCodeSequence"],
"0040":["LO","ImageSetLabel"],"0050":["CS","SelectorAttributeVR"],"0052":["AT","SelectorSequencePointer"],"0054":["LO","SelectorSequencePointerPrivateCreator"],"0056":["LO","SelectorAttributePrivateCreator"],"0060":["AT","SelectorATValue"],"0062":["CS","SelectorCSValue"],"0064":["IS","SelectorISValue"],"0066":["LO","SelectorLOValue"],"0068":["LT","SelectorLTValue"],"006A":["PN","SelectorPNValue"],"006C":["SH","SelectorSHValue"],"006E":["ST","SelectorSTValue"],"0070":["UT","SelectorUTValue"],"0072":["DS",
"SelectorDSValue"],"0074":["FD","SelectorFDValue"],"0076":["FL","SelectorFLValue"],"0078":["UL","SelectorULValue"],"007A":["US","SelectorUSValue"],"007C":["SL","SelectorSLValue"],"007E":["SS","SelectorSSValue"],"0080":["SQ","SelectorCodeSequenceValue"],"0100":["US","NumberOfScreens"],"0102":["SQ","NominalScreenDefinitionSequence"],"0104":["US","NumberOfVerticalPixels"],"0106":["US","NumberOfHorizontalPixels"],"0108":["FD","DisplayEnvironmentSpatialPosition"],"010A":["US","ScreenMinimumGrayscaleBitDepth"],
"010C":["US","ScreenMinimumColorBitDepth"],"010E":["US","ApplicationMaximumRepaintTime"],"0200":["SQ","DisplaySetsSequence"],"0202":["US","DisplaySetNumber"],"0203":["LO","DisplaySetLabel"],"0204":["US","DisplaySetPresentationGroup"],"0206":["LO","DisplaySetPresentationGroupDescription"],"0208":["CS","PartialDataDisplayHandling"],"0210":["SQ","SynchronizedScrollingSequence"],"0212":["US","DisplaySetScrollingGroup"],"0214":["SQ","NavigationIndicatorSequence"],"0216":["US","NavigationDisplaySet"],"0218":["US",
"ReferenceDisplaySets"],"0300":["SQ","ImageBoxesSequence"],"0302":["US","ImageBoxNumber"],"0304":["CS","ImageBoxLayoutType"],"0306":["US","ImageBoxTileHorizontalDimension"],"0308":["US","ImageBoxTileVerticalDimension"],"0310":["CS","ImageBoxScrollDirection"],"0312":["CS","ImageBoxSmallScrollType"],"0314":["US","ImageBoxSmallScrollAmount"],"0316":["CS","ImageBoxLargeScrollType"],"0318":["US","ImageBoxLargeScrollAmount"],"0320":["US","ImageBoxOverlapPriority"],"0330":["FD","CineRelativeToRealTime"],
"0400":["SQ","FilterOperationsSequence"],"0402":["CS","FilterByCategory"],"0404":["CS","FilterByAttributePresence"],"0406":["CS","FilterByOperator"],"0420":["US","StructuredDisplayBackgroundCIELabValue"],"0421":["US","EmptyImageBoxCIELabValue"],"0422":["SQ","StructuredDisplayImageBoxSequence"],"0424":["SQ","StructuredDisplayTextBoxSequence"],"0427":["SQ","ReferencedFirstFrameSequence"],"0430":["SQ","ImageBoxSynchronizationSequence"],"0432":["US","SynchronizedImageBoxList"],"0434":["CS","TypeOfSynchronization"],
"0500":["CS","BlendingOperationType"],"0510":["CS","ReformattingOperationType"],"0512":["FD","ReformattingThickness"],"0514":["FD","ReformattingInterval"],"0516":["CS","ReformattingOperationInitialViewDirection"],"0520":["CS","ThreeDRenderingType"],"0600":["SQ","SortingOperationsSequence"],"0602":["CS","SortByCategory"],"0604":["CS","SortingDirection"],"0700":["CS","DisplaySetPatientOrientation"],"0702":["CS","VOIType"],"0704":["CS","PseudoColorType"],"0705":["SQ","PseudoColorPaletteInstanceReferenceSequence"],
"0706":["CS","ShowGrayscaleInverted"],"0710":["CS","ShowImageTrueSizeFlag"],"0712":["CS","ShowGraphicAnnotationFlag"],"0714":["CS","ShowPatientDemographicsFlag"],"0716":["CS","ShowAcquisitionTechniquesFlag"],"0717":["CS","DisplaySetHorizontalJustification"],"0718":["CS","DisplaySetVerticalJustification"]},"0074":{"0120":["FD","ContinuationStartMeterset"],"0121":["FD","ContinuationEndMeterset"],1E3:["CS","ProcedureStepState"],1002:["SQ","ProcedureStepProgressInformationSequence"],1004:["DS","ProcedureStepProgress"],
1006:["ST","ProcedureStepProgressDescription"],1008:["SQ","ProcedureStepCommunicationsURISequence"],"100A":["ST","ContactURI"],"100C":["LO","ContactDisplayName"],"100E":["SQ","ProcedureStepDiscontinuationReasonCodeSequence"],1020:["SQ","BeamTaskSequence"],1022:["CS","BeamTaskType"],1024:["IS","BeamOrderIndexTrial"],1026:["FD","TableTopVerticalAdjustedPosition"],1027:["FD","TableTopLongitudinalAdjustedPosition"],1028:["FD","TableTopLateralAdjustedPosition"],"102A":["FD","PatientSupportAdjustedAngle"],
"102B":["FD","TableTopEccentricAdjustedAngle"],"102C":["FD","TableTopPitchAdjustedAngle"],"102D":["FD","TableTopRollAdjustedAngle"],1030:["SQ","DeliveryVerificationImageSequence"],1032:["CS","VerificationImageTiming"],1034:["CS","DoubleExposureFlag"],1036:["CS","DoubleExposureOrdering"],1038:["DS","DoubleExposureMetersetTrial"],"103A":["DS","DoubleExposureFieldDeltaTrial"],1040:["SQ","RelatedReferenceRTImageSequence"],1042:["SQ","GeneralMachineVerificationSequence"],1044:["SQ","ConventionalMachineVerificationSequence"],
1046:["SQ","IonMachineVerificationSequence"],1048:["SQ","FailedAttributesSequence"],"104A":["SQ","OverriddenAttributesSequence"],"104C":["SQ","ConventionalControlPointVerificationSequence"],"104E":["SQ","IonControlPointVerificationSequence"],1050:["SQ","AttributeOccurrenceSequence"],1052:["AT","AttributeOccurrencePointer"],1054:["UL","AttributeItemSelector"],1056:["LO","AttributeOccurrencePrivateCreator"],1057:["IS","SelectorSequencePointerItems"],1200:["CS","ScheduledProcedureStepPriority"],1202:["LO",
"WorklistLabel"],1204:["LO","ProcedureStepLabel"],1210:["SQ","ScheduledProcessingParametersSequence"],1212:["SQ","PerformedProcessingParametersSequence"],1216:["SQ","UnifiedProcedureStepPerformedProcedureSequence"],1220:["SQ","RelatedProcedureStepSequence"],1222:["LO","ProcedureStepRelationshipType"],1224:["SQ","ReplacedProcedureStepSequence"],1230:["LO","DeletionLock"],1234:["AE","ReceivingAE"],1236:["AE","RequestingAE"],1238:["LT","ReasonForCancellation"],1242:["CS","SCPStatus"],1244:["CS","SubscriptionListStatus"],
1246:["CS","UnifiedProcedureStepListStatus"],1324:["UL","BeamOrderIndex"],1338:["FD","DoubleExposureMeterset"],"133A":["FD","DoubleExposureFieldDelta"]},"0076":{"0001":["LO","ImplantAssemblyTemplateName"],"0003":["LO","ImplantAssemblyTemplateIssuer"],"0006":["LO","ImplantAssemblyTemplateVersion"],"0008":["SQ","ReplacedImplantAssemblyTemplateSequence"],"000A":["CS","ImplantAssemblyTemplateType"],"000C":["SQ","OriginalImplantAssemblyTemplateSequence"],"000E":["SQ","DerivationImplantAssemblyTemplateSequence"],
"0010":["SQ","ImplantAssemblyTemplateTargetAnatomySequence"],"0020":["SQ","ProcedureTypeCodeSequence"],"0030":["LO","SurgicalTechnique"],"0032":["SQ","ComponentTypesSequence"],"0034":["CS","ComponentTypeCodeSequence"],"0036":["CS","ExclusiveComponentType"],"0038":["CS","MandatoryComponentType"],"0040":["SQ","ComponentSequence"],"0055":["US","ComponentID"],"0060":["SQ","ComponentAssemblySequence"],"0070":["US","Component1ReferencedID"],"0080":["US","Component1ReferencedMatingFeatureSetID"],"0090":["US",
"Component1ReferencedMatingFeatureID"],"00A0":["US","Component2ReferencedID"],"00B0":["US","Component2ReferencedMatingFeatureSetID"],"00C0":["US","Component2ReferencedMatingFeatureID"]},"0078":{"0001":["LO","ImplantTemplateGroupName"],"0010":["ST","ImplantTemplateGroupDescription"],"0020":["LO","ImplantTemplateGroupIssuer"],"0024":["LO","ImplantTemplateGroupVersion"],"0026":["SQ","ReplacedImplantTemplateGroupSequence"],"0028":["SQ","ImplantTemplateGroupTargetAnatomySequence"],"002A":["SQ","ImplantTemplateGroupMembersSequence"],
"002E":["US","ImplantTemplateGroupMemberID"],"0050":["FD","ThreeDImplantTemplateGroupMemberMatchingPoint"],"0060":["FD","ThreeDImplantTemplateGroupMemberMatchingAxes"],"0070":["SQ","ImplantTemplateGroupMemberMatching2DCoordinatesSequence"],"0090":["FD","TwoDImplantTemplateGroupMemberMatchingPoint"],"00A0":["FD","TwoDImplantTemplateGroupMemberMatchingAxes"],"00B0":["SQ","ImplantTemplateGroupVariationDimensionSequence"],"00B2":["LO","ImplantTemplateGroupVariationDimensionName"],"00B4":["SQ","ImplantTemplateGroupVariationDimensionRankSequence"],
"00B6":["US","ReferencedImplantTemplateGroupMemberID"],"00B8":["US","ImplantTemplateGroupVariationDimensionRank"]},"0088":{"0130":["SH","StorageMediaFileSetID"],"0140":["UI","StorageMediaFileSetUID"],"0200":["SQ","IconImageSequence"],"0904":["LO","TopicTitle"],"0906":["ST","TopicSubject"],"0910":["LO","TopicAuthor"],"0912":["LO","TopicKeywords"]},"0100":{"0410":["CS","SOPInstanceStatus"],"0420":["DT","SOPAuthorizationDateTime"],"0424":["LT","SOPAuthorizationComment"],"0426":["LO","AuthorizationEquipmentCertificationNumber"]},
"0400":{"0005":["US","MACIDNumber"],"0010":["UI","MACCalculationTransferSyntaxUID"],"0015":["CS","MACAlgorithm"],"0020":["AT","DataElementsSigned"],"0100":["UI","DigitalSignatureUID"],"0105":["DT","DigitalSignatureDateTime"],"0110":["CS","CertificateType"],"0115":["OB","CertificateOfSigner"],"0120":["OB","Signature"],"0305":["CS","CertifiedTimestampType"],"0310":["OB","CertifiedTimestamp"],"0401":["SQ","DigitalSignaturePurposeCodeSequence"],"0402":["SQ","ReferencedDigitalSignatureSequence"],"0403":["SQ",
"ReferencedSOPInstanceMACSequence"],"0404":["OB","MAC"],"0500":["SQ","EncryptedAttributesSequence"],"0510":["UI","EncryptedContentTransferSyntaxUID"],"0520":["OB","EncryptedContent"],"0550":["SQ","ModifiedAttributesSequence"],"0561":["SQ","OriginalAttributesSequence"],"0562":["DT","AttributeModificationDateTime"],"0563":["LO","ModifyingSystem"],"0564":["LO","SourceOfPreviousValues"],"0565":["CS","ReasonForTheAttributeModification"]},2E3:{"0010":["IS","NumberOfCopies"],"001E":["SQ","PrinterConfigurationSequence"],
"0020":["CS","PrintPriority"],"0030":["CS","MediumType"],"0040":["CS","FilmDestination"],"0050":["LO","FilmSessionLabel"],"0060":["IS","MemoryAllocation"],"0061":["IS","MaximumMemoryAllocation"],"0062":["CS","ColorImagePrintingFlag"],"0063":["CS","CollationFlag"],"0065":["CS","AnnotationFlag"],"0067":["CS","ImageOverlayFlag"],"0069":["CS","PresentationLUTFlag"],"006A":["CS","ImageBoxPresentationLUTFlag"],"00A0":["US","MemoryBitDepth"],"00A1":["US","PrintingBitDepth"],"00A2":["SQ","MediaInstalledSequence"],
"00A4":["SQ","OtherMediaAvailableSequence"],"00A8":["SQ","SupportedImageDisplayFormatsSequence"],"0500":["SQ","ReferencedFilmBoxSequence"],"0510":["SQ","ReferencedStoredPrintSequence"]},2010:{"0010":["ST","ImageDisplayFormat"],"0030":["CS","AnnotationDisplayFormatID"],"0040":["CS","FilmOrientation"],"0050":["CS","FilmSizeID"],"0052":["CS","PrinterResolutionID"],"0054":["CS","DefaultPrinterResolutionID"],"0060":["CS","MagnificationType"],"0080":["CS","SmoothingType"],"00A6":["CS","DefaultMagnificationType"],
"00A7":["CS","OtherMagnificationTypesAvailable"],"00A8":["CS","DefaultSmoothingType"],"00A9":["CS","OtherSmoothingTypesAvailable"],"0100":["CS","BorderDensity"],"0110":["CS","EmptyImageDensity"],"0120":["US","MinDensity"],"0130":["US","MaxDensity"],"0140":["CS","Trim"],"0150":["ST","ConfigurationInformation"],"0152":["LT","ConfigurationInformationDescription"],"0154":["IS","MaximumCollatedFilms"],"015E":["US","Illumination"],"0160":["US","ReflectedAmbientLight"],"0376":["DS","PrinterPixelSpacing"],
"0500":["SQ","ReferencedFilmSessionSequence"],"0510":["SQ","ReferencedImageBoxSequence"],"0520":["SQ","ReferencedBasicAnnotationBoxSequence"]},2020:{"0010":["US","ImageBoxPosition"],"0020":["CS","Polarity"],"0030":["DS","RequestedImageSize"],"0040":["CS","RequestedDecimateCropBehavior"],"0050":["CS","RequestedResolutionID"],"00A0":["CS","RequestedImageSizeFlag"],"00A2":["CS","DecimateCropResult"],"0110":["SQ","BasicGrayscaleImageSequence"],"0111":["SQ","BasicColorImageSequence"],"0130":["SQ","ReferencedImageOverlayBoxSequence"],
"0140":["SQ","ReferencedVOILUTBoxSequence"]},2030:{"0010":["US","AnnotationPosition"],"0020":["LO","TextString"]},2040:{"0010":["SQ","ReferencedOverlayPlaneSequence"],"0011":["US","ReferencedOverlayPlaneGroups"],"0020":["SQ","OverlayPixelDataSequence"],"0060":["CS","OverlayMagnificationType"],"0070":["CS","OverlaySmoothingType"],"0072":["CS","OverlayOrImageMagnification"],"0074":["US","MagnifyToNumberOfColumns"],"0080":["CS","OverlayForegroundDensity"],"0082":["CS","OverlayBackgroundDensity"],"0090":["CS",
"OverlayMode"],"0100":["CS","ThresholdDensity"],"0500":["SQ","ReferencedImageBoxSequenceRetired"]},2050:{"0010":["SQ","PresentationLUTSequence"],"0020":["CS","PresentationLUTShape"],"0500":["SQ","ReferencedPresentationLUTSequence"]},2100:{"0010":["SH","PrintJobID"],"0020":["CS","ExecutionStatus"],"0030":["CS","ExecutionStatusInfo"],"0040":["DA","CreationDate"],"0050":["TM","CreationTime"],"0070":["AE","Originator"],"0140":["AE","DestinationAE"],"0160":["SH","OwnerID"],"0170":["IS","NumberOfFilms"],
"0500":["SQ","ReferencedPrintJobSequencePullStoredPrint"]},2110:{"0010":["CS","PrinterStatus"],"0020":["CS","PrinterStatusInfo"],"0030":["LO","PrinterName"],"0099":["SH","PrintQueueID"]},2120:{"0010":["CS","QueueStatus"],"0050":["SQ","PrintJobDescriptionSequence"],"0070":["SQ","ReferencedPrintJobSequence"]},2130:{"0010":["SQ","PrintManagementCapabilitiesSequence"],"0015":["SQ","PrinterCharacteristicsSequence"],"0030":["SQ","FilmBoxContentSequence"],"0040":["SQ","ImageBoxContentSequence"],"0050":["SQ",
"AnnotationContentSequence"],"0060":["SQ","ImageOverlayBoxContentSequence"],"0080":["SQ","PresentationLUTContentSequence"],"00A0":["SQ","ProposedStudySequence"],"00C0":["SQ","OriginalImageSequence"]},2200:{"0001":["CS","LabelUsingInformationExtractedFromInstances"],"0002":["UT","LabelText"],"0003":["CS","LabelStyleSelection"],"0004":["LT","MediaDisposition"],"0005":["LT","BarcodeValue"],"0006":["CS","BarcodeSymbology"],"0007":["CS","AllowMediaSplitting"],"0008":["CS","IncludeNonDICOMObjects"],"0009":["CS",
"IncludeDisplayApplication"],"000A":["CS","PreserveCompositeInstancesAfterMediaCreation"],"000B":["US","TotalNumberOfPiecesOfMediaCreated"],"000C":["LO","RequestedMediaApplicationProfile"],"000D":["SQ","ReferencedStorageMediaSequence"],"000E":["AT","FailureAttributes"],"000F":["CS","AllowLossyCompression"],"0020":["CS","RequestPriority"]},3002:{"0002":["SH","RTImageLabel"],"0003":["LO","RTImageName"],"0004":["ST","RTImageDescription"],"000A":["CS","ReportedValuesOrigin"],"000C":["CS","RTImagePlane"],
"000D":["DS","XRayImageReceptorTranslation"],"000E":["DS","XRayImageReceptorAngle"],"0010":["DS","RTImageOrientation"],"0011":["DS","ImagePlanePixelSpacing"],"0012":["DS","RTImagePosition"],"0020":["SH","RadiationMachineName"],"0022":["DS","RadiationMachineSAD"],"0024":["DS","RadiationMachineSSD"],"0026":["DS","RTImageSID"],"0028":["DS","SourceToReferenceObjectDistance"],"0029":["IS","FractionNumber"],"0030":["SQ","ExposureSequence"],"0032":["DS","MetersetExposure"],"0034":["DS","DiaphragmPosition"],
"0040":["SQ","FluenceMapSequence"],"0041":["CS","FluenceDataSource"],"0042":["DS","FluenceDataScale"],"0050":["SQ","PrimaryFluenceModeSequence"],"0051":["CS","FluenceMode"],"0052":["SH","FluenceModeID"]},3004:{"0001":["CS","DVHType"],"0002":["CS","DoseUnits"],"0004":["CS","DoseType"],"0006":["LO","DoseComment"],"0008":["DS","NormalizationPoint"],"000A":["CS","DoseSummationType"],"000C":["DS","GridFrameOffsetVector"],"000E":["DS","DoseGridScaling"],"0010":["SQ","RTDoseROISequence"],"0012":["DS","DoseValue"],
"0014":["CS","TissueHeterogeneityCorrection"],"0040":["DS","DVHNormalizationPoint"],"0042":["DS","DVHNormalizationDoseValue"],"0050":["SQ","DVHSequence"],"0052":["DS","DVHDoseScaling"],"0054":["CS","DVHVolumeUnits"],"0056":["IS","DVHNumberOfBins"],"0058":["DS","DVHData"],"0060":["SQ","DVHReferencedROISequence"],"0062":["CS","DVHROIContributionType"],"0070":["DS","DVHMinimumDose"],"0072":["DS","DVHMaximumDose"],"0074":["DS","DVHMeanDose"]},3006:{"0002":["SH","StructureSetLabel"],"0004":["LO","StructureSetName"],
"0006":["ST","StructureSetDescription"],"0008":["DA","StructureSetDate"],"0009":["TM","StructureSetTime"],"0010":["SQ","ReferencedFrameOfReferenceSequence"],"0012":["SQ","RTReferencedStudySequence"],"0014":["SQ","RTReferencedSeriesSequence"],"0016":["SQ","ContourImageSequence"],"0020":["SQ","StructureSetROISequence"],"0022":["IS","ROINumber"],"0024":["UI","ReferencedFrameOfReferenceUID"],"0026":["LO","ROIName"],"0028":["ST","ROIDescription"],"002A":["IS","ROIDisplayColor"],"002C":["DS","ROIVolume"],
"0030":["SQ","RTRelatedROISequence"],"0033":["CS","RTROIRelationship"],"0036":["CS","ROIGenerationAlgorithm"],"0038":["LO","ROIGenerationDescription"],"0039":["SQ","ROIContourSequence"],"0040":["SQ","ContourSequence"],"0042":["CS","ContourGeometricType"],"0044":["DS","ContourSlabThickness"],"0045":["DS","ContourOffsetVector"],"0046":["IS","NumberOfContourPoints"],"0048":["IS","ContourNumber"],"0049":["IS","AttachedContours"],"0050":["DS","ContourData"],"0080":["SQ","RTROIObservationsSequence"],"0082":["IS",
"ObservationNumber"],"0084":["IS","ReferencedROINumber"],"0085":["SH","ROIObservationLabel"],"0086":["SQ","RTROIIdentificationCodeSequence"],"0088":["ST","ROIObservationDescription"],"00A0":["SQ","RelatedRTROIObservationsSequence"],"00A4":["CS","RTROIInterpretedType"],"00A6":["PN","ROIInterpreter"],"00B0":["SQ","ROIPhysicalPropertiesSequence"],"00B2":["CS","ROIPhysicalProperty"],"00B4":["DS","ROIPhysicalPropertyValue"],"00B6":["SQ","ROIElementalCompositionSequence"],"00B7":["US","ROIElementalCompositionAtomicNumber"],
"00B8":["FL","ROIElementalCompositionAtomicMassFraction"],"00C0":["SQ","FrameOfReferenceRelationshipSequence"],"00C2":["UI","RelatedFrameOfReferenceUID"],"00C4":["CS","FrameOfReferenceTransformationType"],"00C6":["DS","FrameOfReferenceTransformationMatrix"],"00C8":["LO","FrameOfReferenceTransformationComment"]},3008:{"0010":["SQ","MeasuredDoseReferenceSequence"],"0012":["ST","MeasuredDoseDescription"],"0014":["CS","MeasuredDoseType"],"0016":["DS","MeasuredDoseValue"],"0020":["SQ","TreatmentSessionBeamSequence"],
"0021":["SQ","TreatmentSessionIonBeamSequence"],"0022":["IS","CurrentFractionNumber"],"0024":["DA","TreatmentControlPointDate"],"0025":["TM","TreatmentControlPointTime"],"002A":["CS","TreatmentTerminationStatus"],"002B":["SH","TreatmentTerminationCode"],"002C":["CS","TreatmentVerificationStatus"],"0030":["SQ","ReferencedTreatmentRecordSequence"],"0032":["DS","SpecifiedPrimaryMeterset"],"0033":["DS","SpecifiedSecondaryMeterset"],"0036":["DS","DeliveredPrimaryMeterset"],"0037":["DS","DeliveredSecondaryMeterset"],
"003A":["DS","SpecifiedTreatmentTime"],"003B":["DS","DeliveredTreatmentTime"],"0040":["SQ","ControlPointDeliverySequence"],"0041":["SQ","IonControlPointDeliverySequence"],"0042":["DS","SpecifiedMeterset"],"0044":["DS","DeliveredMeterset"],"0045":["FL","MetersetRateSet"],"0046":["FL","MetersetRateDelivered"],"0047":["FL","ScanSpotMetersetsDelivered"],"0048":["DS","DoseRateDelivered"],"0050":["SQ","TreatmentSummaryCalculatedDoseReferenceSequence"],"0052":["DS","CumulativeDoseToDoseReference"],"0054":["DA",
"FirstTreatmentDate"],"0056":["DA","MostRecentTreatmentDate"],"005A":["IS","NumberOfFractionsDelivered"],"0060":["SQ","OverrideSequence"],"0061":["AT","ParameterSequencePointer"],"0062":["AT","OverrideParameterPointer"],"0063":["IS","ParameterItemIndex"],"0064":["IS","MeasuredDoseReferenceNumber"],"0065":["AT","ParameterPointer"],"0066":["ST","OverrideReason"],"0068":["SQ","CorrectedParameterSequence"],"006A":["FL","CorrectionValue"],"0070":["SQ","CalculatedDoseReferenceSequence"],"0072":["IS","CalculatedDoseReferenceNumber"],
"0074":["ST","CalculatedDoseReferenceDescription"],"0076":["DS","CalculatedDoseReferenceDoseValue"],"0078":["DS","StartMeterset"],"007A":["DS","EndMeterset"],"0080":["SQ","ReferencedMeasuredDoseReferenceSequence"],"0082":["IS","ReferencedMeasuredDoseReferenceNumber"],"0090":["SQ","ReferencedCalculatedDoseReferenceSequence"],"0092":["IS","ReferencedCalculatedDoseReferenceNumber"],"00A0":["SQ","BeamLimitingDeviceLeafPairsSequence"],"00B0":["SQ","RecordedWedgeSequence"],"00C0":["SQ","RecordedCompensatorSequence"],
"00D0":["SQ","RecordedBlockSequence"],"00E0":["SQ","TreatmentSummaryMeasuredDoseReferenceSequence"],"00F0":["SQ","RecordedSnoutSequence"],"00F2":["SQ","RecordedRangeShifterSequence"],"00F4":["SQ","RecordedLateralSpreadingDeviceSequence"],"00F6":["SQ","RecordedRangeModulatorSequence"],"0100":["SQ","RecordedSourceSequence"],"0105":["LO","SourceSerialNumber"],"0110":["SQ","TreatmentSessionApplicationSetupSequence"],"0116":["CS","ApplicationSetupCheck"],"0120":["SQ","RecordedBrachyAccessoryDeviceSequence"],
"0122":["IS","ReferencedBrachyAccessoryDeviceNumber"],"0130":["SQ","RecordedChannelSequence"],"0132":["DS","SpecifiedChannelTotalTime"],"0134":["DS","DeliveredChannelTotalTime"],"0136":["IS","SpecifiedNumberOfPulses"],"0138":["IS","DeliveredNumberOfPulses"],"013A":["DS","SpecifiedPulseRepetitionInterval"],"013C":["DS","DeliveredPulseRepetitionInterval"],"0140":["SQ","RecordedSourceApplicatorSequence"],"0142":["IS","ReferencedSourceApplicatorNumber"],"0150":["SQ","RecordedChannelShieldSequence"],"0152":["IS",
"ReferencedChannelShieldNumber"],"0160":["SQ","BrachyControlPointDeliveredSequence"],"0162":["DA","SafePositionExitDate"],"0164":["TM","SafePositionExitTime"],"0166":["DA","SafePositionReturnDate"],"0168":["TM","SafePositionReturnTime"],"0200":["CS","CurrentTreatmentStatus"],"0202":["ST","TreatmentStatusComment"],"0220":["SQ","FractionGroupSummarySequence"],"0223":["IS","ReferencedFractionNumber"],"0224":["CS","FractionGroupType"],"0230":["CS","BeamStopperPosition"],"0240":["SQ","FractionStatusSummarySequence"],
"0250":["DA","TreatmentDate"],"0251":["TM","TreatmentTime"]},"300A":{"0002":["SH","RTPlanLabel"],"0003":["LO","RTPlanName"],"0004":["ST","RTPlanDescription"],"0006":["DA","RTPlanDate"],"0007":["TM","RTPlanTime"],"0009":["LO","TreatmentProtocols"],"000A":["CS","PlanIntent"],"000B":["LO","TreatmentSites"],"000C":["CS","RTPlanGeometry"],"000E":["ST","PrescriptionDescription"],"0010":["SQ","DoseReferenceSequence"],"0012":["IS","DoseReferenceNumber"],"0013":["UI","DoseReferenceUID"],"0014":["CS","DoseReferenceStructureType"],
"0015":["CS","NominalBeamEnergyUnit"],"0016":["LO","DoseReferenceDescription"],"0018":["DS","DoseReferencePointCoordinates"],"001A":["DS","NominalPriorDose"],"0020":["CS","DoseReferenceType"],"0021":["DS","ConstraintWeight"],"0022":["DS","DeliveryWarningDose"],"0023":["DS","DeliveryMaximumDose"],"0025":["DS","TargetMinimumDose"],"0026":["DS","TargetPrescriptionDose"],"0027":["DS","TargetMaximumDose"],"0028":["DS","TargetUnderdoseVolumeFraction"],"002A":["DS","OrganAtRiskFullVolumeDose"],"002B":["DS",
"OrganAtRiskLimitDose"],"002C":["DS","OrganAtRiskMaximumDose"],"002D":["DS","OrganAtRiskOverdoseVolumeFraction"],"0040":["SQ","ToleranceTableSequence"],"0042":["IS","ToleranceTableNumber"],"0043":["SH","ToleranceTableLabel"],"0044":["DS","GantryAngleTolerance"],"0046":["DS","BeamLimitingDeviceAngleTolerance"],"0048":["SQ","BeamLimitingDeviceToleranceSequence"],"004A":["DS","BeamLimitingDevicePositionTolerance"],"004B":["FL","SnoutPositionTolerance"],"004C":["DS","PatientSupportAngleTolerance"],"004E":["DS",
"TableTopEccentricAngleTolerance"],"004F":["FL","TableTopPitchAngleTolerance"],"0050":["FL","TableTopRollAngleTolerance"],"0051":["DS","TableTopVerticalPositionTolerance"],"0052":["DS","TableTopLongitudinalPositionTolerance"],"0053":["DS","TableTopLateralPositionTolerance"],"0055":["CS","RTPlanRelationship"],"0070":["SQ","FractionGroupSequence"],"0071":["IS","FractionGroupNumber"],"0072":["LO","FractionGroupDescription"],"0078":["IS","NumberOfFractionsPlanned"],"0079":["IS","NumberOfFractionPatternDigitsPerDay"],
"007A":["IS","RepeatFractionCycleLength"],"007B":["LT","FractionPattern"],"0080":["IS","NumberOfBeams"],"0082":["DS","BeamDoseSpecificationPoint"],"0084":["DS","BeamDose"],"0086":["DS","BeamMeterset"],"0088":["FL","BeamDosePointDepth"],"0089":["FL","BeamDosePointEquivalentDepth"],"008A":["FL","BeamDosePointSSD"],"00A0":["IS","NumberOfBrachyApplicationSetups"],"00A2":["DS","BrachyApplicationSetupDoseSpecificationPoint"],"00A4":["DS","BrachyApplicationSetupDose"],"00B0":["SQ","BeamSequence"],"00B2":["SH",
"TreatmentMachineName"],"00B3":["CS","PrimaryDosimeterUnit"],"00B4":["DS","SourceAxisDistance"],"00B6":["SQ","BeamLimitingDeviceSequence"],"00B8":["CS","RTBeamLimitingDeviceType"],"00BA":["DS","SourceToBeamLimitingDeviceDistance"],"00BB":["FL","IsocenterToBeamLimitingDeviceDistance"],"00BC":["IS","NumberOfLeafJawPairs"],"00BE":["DS","LeafPositionBoundaries"],"00C0":["IS","BeamNumber"],"00C2":["LO","BeamName"],"00C3":["ST","BeamDescription"],"00C4":["CS","BeamType"],"00C6":["CS","RadiationType"],"00C7":["CS",
"HighDoseTechniqueType"],"00C8":["IS","ReferenceImageNumber"],"00CA":["SQ","PlannedVerificationImageSequence"],"00CC":["LO","ImagingDeviceSpecificAcquisitionParameters"],"00CE":["CS","TreatmentDeliveryType"],"00D0":["IS","NumberOfWedges"],"00D1":["SQ","WedgeSequence"],"00D2":["IS","WedgeNumber"],"00D3":["CS","WedgeType"],"00D4":["SH","WedgeID"],"00D5":["IS","WedgeAngle"],"00D6":["DS","WedgeFactor"],"00D7":["FL","TotalWedgeTrayWaterEquivalentThickness"],"00D8":["DS","WedgeOrientation"],"00D9":["FL",
"IsocenterToWedgeTrayDistance"],"00DA":["DS","SourceToWedgeTrayDistance"],"00DB":["FL","WedgeThinEdgePosition"],"00DC":["SH","BolusID"],"00DD":["ST","BolusDescription"],"00E0":["IS","NumberOfCompensators"],"00E1":["SH","MaterialID"],"00E2":["DS","TotalCompensatorTrayFactor"],"00E3":["SQ","CompensatorSequence"],"00E4":["IS","CompensatorNumber"],"00E5":["SH","CompensatorID"],"00E6":["DS","SourceToCompensatorTrayDistance"],"00E7":["IS","CompensatorRows"],"00E8":["IS","CompensatorColumns"],"00E9":["DS",
"CompensatorPixelSpacing"],"00EA":["DS","CompensatorPosition"],"00EB":["DS","CompensatorTransmissionData"],"00EC":["DS","CompensatorThicknessData"],"00ED":["IS","NumberOfBoli"],"00EE":["CS","CompensatorType"],"00F0":["IS","NumberOfBlocks"],"00F2":["DS","TotalBlockTrayFactor"],"00F3":["FL","TotalBlockTrayWaterEquivalentThickness"],"00F4":["SQ","BlockSequence"],"00F5":["SH","BlockTrayID"],"00F6":["DS","SourceToBlockTrayDistance"],"00F7":["FL","IsocenterToBlockTrayDistance"],"00F8":["CS","BlockType"],
"00F9":["LO","AccessoryCode"],"00FA":["CS","BlockDivergence"],"00FB":["CS","BlockMountingPosition"],"00FC":["IS","BlockNumber"],"00FE":["LO","BlockName"],"0100":["DS","BlockThickness"],"0102":["DS","BlockTransmission"],"0104":["IS","BlockNumberOfPoints"],"0106":["DS","BlockData"],"0107":["SQ","ApplicatorSequence"],"0108":["SH","ApplicatorID"],"0109":["CS","ApplicatorType"],"010A":["LO","ApplicatorDescription"],"010C":["DS","CumulativeDoseReferenceCoefficient"],"010E":["DS","FinalCumulativeMetersetWeight"],
"0110":["IS","NumberOfControlPoints"],"0111":["SQ","ControlPointSequence"],"0112":["IS","ControlPointIndex"],"0114":["DS","NominalBeamEnergy"],"0115":["DS","DoseRateSet"],"0116":["SQ","WedgePositionSequence"],"0118":["CS","WedgePosition"],"011A":["SQ","BeamLimitingDevicePositionSequence"],"011C":["DS","LeafJawPositions"],"011E":["DS","GantryAngle"],"011F":["CS","GantryRotationDirection"],"0120":["DS","BeamLimitingDeviceAngle"],"0121":["CS","BeamLimitingDeviceRotationDirection"],"0122":["DS","PatientSupportAngle"],
"0123":["CS","PatientSupportRotationDirection"],"0124":["DS","TableTopEccentricAxisDistance"],"0125":["DS","TableTopEccentricAngle"],"0126":["CS","TableTopEccentricRotationDirection"],"0128":["DS","TableTopVerticalPosition"],"0129":["DS","TableTopLongitudinalPosition"],"012A":["DS","TableTopLateralPosition"],"012C":["DS","IsocenterPosition"],"012E":["DS","SurfaceEntryPoint"],"0130":["DS","SourceToSurfaceDistance"],"0134":["DS","CumulativeMetersetWeight"],"0140":["FL","TableTopPitchAngle"],"0142":["CS",
"TableTopPitchRotationDirection"],"0144":["FL","TableTopRollAngle"],"0146":["CS","TableTopRollRotationDirection"],"0148":["FL","HeadFixationAngle"],"014A":["FL","GantryPitchAngle"],"014C":["CS","GantryPitchRotationDirection"],"014E":["FL","GantryPitchAngleTolerance"],"0180":["SQ","PatientSetupSequence"],"0182":["IS","PatientSetupNumber"],"0183":["LO","PatientSetupLabel"],"0184":["LO","PatientAdditionalPosition"],"0190":["SQ","FixationDeviceSequence"],"0192":["CS","FixationDeviceType"],"0194":["SH",
"FixationDeviceLabel"],"0196":["ST","FixationDeviceDescription"],"0198":["SH","FixationDevicePosition"],"0199":["FL","FixationDevicePitchAngle"],"019A":["FL","FixationDeviceRollAngle"],"01A0":["SQ","ShieldingDeviceSequence"],"01A2":["CS","ShieldingDeviceType"],"01A4":["SH","ShieldingDeviceLabel"],"01A6":["ST","ShieldingDeviceDescription"],"01A8":["SH","ShieldingDevicePosition"],"01B0":["CS","SetupTechnique"],"01B2":["ST","SetupTechniqueDescription"],"01B4":["SQ","SetupDeviceSequence"],"01B6":["CS",
"SetupDeviceType"],"01B8":["SH","SetupDeviceLabel"],"01BA":["ST","SetupDeviceDescription"],"01BC":["DS","SetupDeviceParameter"],"01D0":["ST","SetupReferenceDescription"],"01D2":["DS","TableTopVerticalSetupDisplacement"],"01D4":["DS","TableTopLongitudinalSetupDisplacement"],"01D6":["DS","TableTopLateralSetupDisplacement"],"0200":["CS","BrachyTreatmentTechnique"],"0202":["CS","BrachyTreatmentType"],"0206":["SQ","TreatmentMachineSequence"],"0210":["SQ","SourceSequence"],"0212":["IS","SourceNumber"],
"0214":["CS","SourceType"],"0216":["LO","SourceManufacturer"],"0218":["DS","ActiveSourceDiameter"],"021A":["DS","ActiveSourceLength"],"0222":["DS","SourceEncapsulationNominalThickness"],"0224":["DS","SourceEncapsulationNominalTransmission"],"0226":["LO","SourceIsotopeName"],"0228":["DS","SourceIsotopeHalfLife"],"0229":["CS","SourceStrengthUnits"],"022A":["DS","ReferenceAirKermaRate"],"022B":["DS","SourceStrength"],"022C":["DA","SourceStrengthReferenceDate"],"022E":["TM","SourceStrengthReferenceTime"],
"0230":["SQ","ApplicationSetupSequence"],"0232":["CS","ApplicationSetupType"],"0234":["IS","ApplicationSetupNumber"],"0236":["LO","ApplicationSetupName"],"0238":["LO","ApplicationSetupManufacturer"],"0240":["IS","TemplateNumber"],"0242":["SH","TemplateType"],"0244":["LO","TemplateName"],"0250":["DS","TotalReferenceAirKerma"],"0260":["SQ","BrachyAccessoryDeviceSequence"],"0262":["IS","BrachyAccessoryDeviceNumber"],"0263":["SH","BrachyAccessoryDeviceID"],"0264":["CS","BrachyAccessoryDeviceType"],"0266":["LO",
"BrachyAccessoryDeviceName"],"026A":["DS","BrachyAccessoryDeviceNominalThickness"],"026C":["DS","BrachyAccessoryDeviceNominalTransmission"],"0280":["SQ","ChannelSequence"],"0282":["IS","ChannelNumber"],"0284":["DS","ChannelLength"],"0286":["DS","ChannelTotalTime"],"0288":["CS","SourceMovementType"],"028A":["IS","NumberOfPulses"],"028C":["DS","PulseRepetitionInterval"],"0290":["IS","SourceApplicatorNumber"],"0291":["SH","SourceApplicatorID"],"0292":["CS","SourceApplicatorType"],"0294":["LO","SourceApplicatorName"],
"0296":["DS","SourceApplicatorLength"],"0298":["LO","SourceApplicatorManufacturer"],"029C":["DS","SourceApplicatorWallNominalThickness"],"029E":["DS","SourceApplicatorWallNominalTransmission"],"02A0":["DS","SourceApplicatorStepSize"],"02A2":["IS","TransferTubeNumber"],"02A4":["DS","TransferTubeLength"],"02B0":["SQ","ChannelShieldSequence"],"02B2":["IS","ChannelShieldNumber"],"02B3":["SH","ChannelShieldID"],"02B4":["LO","ChannelShieldName"],"02B8":["DS","ChannelShieldNominalThickness"],"02BA":["DS",
"ChannelShieldNominalTransmission"],"02C8":["DS","FinalCumulativeTimeWeight"],"02D0":["SQ","BrachyControlPointSequence"],"02D2":["DS","ControlPointRelativePosition"],"02D4":["DS","ControlPoint3DPosition"],"02D6":["DS","CumulativeTimeWeight"],"02E0":["CS","CompensatorDivergence"],"02E1":["CS","CompensatorMountingPosition"],"02E2":["DS","SourceToCompensatorDistance"],"02E3":["FL","TotalCompensatorTrayWaterEquivalentThickness"],"02E4":["FL","IsocenterToCompensatorTrayDistance"],"02E5":["FL","CompensatorColumnOffset"],
"02E6":["FL","IsocenterToCompensatorDistances"],"02E7":["FL","CompensatorRelativeStoppingPowerRatio"],"02E8":["FL","CompensatorMillingToolDiameter"],"02EA":["SQ","IonRangeCompensatorSequence"],"02EB":["LT","CompensatorDescription"],"0302":["IS","RadiationMassNumber"],"0304":["IS","RadiationAtomicNumber"],"0306":["SS","RadiationChargeState"],"0308":["CS","ScanMode"],"030A":["FL","VirtualSourceAxisDistances"],"030C":["SQ","SnoutSequence"],"030D":["FL","SnoutPosition"],"030F":["SH","SnoutID"],"0312":["IS",
"NumberOfRangeShifters"],"0314":["SQ","RangeShifterSequence"],"0316":["IS","RangeShifterNumber"],"0318":["SH","RangeShifterID"],"0320":["CS","RangeShifterType"],"0322":["LO","RangeShifterDescription"],"0330":["IS","NumberOfLateralSpreadingDevices"],"0332":["SQ","LateralSpreadingDeviceSequence"],"0334":["IS","LateralSpreadingDeviceNumber"],"0336":["SH","LateralSpreadingDeviceID"],"0338":["CS","LateralSpreadingDeviceType"],"033A":["LO","LateralSpreadingDeviceDescription"],"033C":["FL","LateralSpreadingDeviceWaterEquivalentThickness"],
"0340":["IS","NumberOfRangeModulators"],"0342":["SQ","RangeModulatorSequence"],"0344":["IS","RangeModulatorNumber"],"0346":["SH","RangeModulatorID"],"0348":["CS","RangeModulatorType"],"034A":["LO","RangeModulatorDescription"],"034C":["SH","BeamCurrentModulationID"],"0350":["CS","PatientSupportType"],"0352":["SH","PatientSupportID"],"0354":["LO","PatientSupportAccessoryCode"],"0356":["FL","FixationLightAzimuthalAngle"],"0358":["FL","FixationLightPolarAngle"],"035A":["FL","MetersetRate"],"0360":["SQ",
"RangeShifterSettingsSequence"],"0362":["LO","RangeShifterSetting"],"0364":["FL","IsocenterToRangeShifterDistance"],"0366":["FL","RangeShifterWaterEquivalentThickness"],"0370":["SQ","LateralSpreadingDeviceSettingsSequence"],"0372":["LO","LateralSpreadingDeviceSetting"],"0374":["FL","IsocenterToLateralSpreadingDeviceDistance"],"0380":["SQ","RangeModulatorSettingsSequence"],"0382":["FL","RangeModulatorGatingStartValue"],"0384":["FL","RangeModulatorGatingStopValue"],"0386":["FL","RangeModulatorGatingStartWaterEquivalentThickness"],
"0388":["FL","RangeModulatorGatingStopWaterEquivalentThickness"],"038A":["FL","IsocenterToRangeModulatorDistance"],"0390":["SH","ScanSpotTuneID"],"0392":["IS","NumberOfScanSpotPositions"],"0394":["FL","ScanSpotPositionMap"],"0396":["FL","ScanSpotMetersetWeights"],"0398":["FL","ScanningSpotSize"],"039A":["IS","NumberOfPaintings"],"03A0":["SQ","IonToleranceTableSequence"],"03A2":["SQ","IonBeamSequence"],"03A4":["SQ","IonBeamLimitingDeviceSequence"],"03A6":["SQ","IonBlockSequence"],"03A8":["SQ","IonControlPointSequence"],
"03AA":["SQ","IonWedgeSequence"],"03AC":["SQ","IonWedgePositionSequence"],"0401":["SQ","ReferencedSetupImageSequence"],"0402":["ST","SetupImageComment"],"0410":["SQ","MotionSynchronizationSequence"],"0412":["FL","ControlPointOrientation"],"0420":["SQ","GeneralAccessorySequence"],"0421":["SH","GeneralAccessoryID"],"0422":["ST","GeneralAccessoryDescription"],"0423":["CS","GeneralAccessoryType"],"0424":["IS","GeneralAccessoryNumber"],"0431":["SQ","ApplicatorGeometrySequence"],"0432":["CS","ApplicatorApertureShape"],
"0433":["FL","ApplicatorOpening"],"0434":["FL","ApplicatorOpeningX"],"0435":["FL","ApplicatorOpeningY"],"0436":["FL","SourceToApplicatorMountingPositionDistance"]},"300C":{"0002":["SQ","ReferencedRTPlanSequence"],"0004":["SQ","ReferencedBeamSequence"],"0006":["IS","ReferencedBeamNumber"],"0007":["IS","ReferencedReferenceImageNumber"],"0008":["DS","StartCumulativeMetersetWeight"],"0009":["DS","EndCumulativeMetersetWeight"],"000A":["SQ","ReferencedBrachyApplicationSetupSequence"],"000C":["IS","ReferencedBrachyApplicationSetupNumber"],
"000E":["IS","ReferencedSourceNumber"],"0020":["SQ","ReferencedFractionGroupSequence"],"0022":["IS","ReferencedFractionGroupNumber"],"0040":["SQ","ReferencedVerificationImageSequence"],"0042":["SQ","ReferencedReferenceImageSequence"],"0050":["SQ","ReferencedDoseReferenceSequence"],"0051":["IS","ReferencedDoseReferenceNumber"],"0055":["SQ","BrachyReferencedDoseReferenceSequence"],"0060":["SQ","ReferencedStructureSetSequence"],"006A":["IS","ReferencedPatientSetupNumber"],"0080":["SQ","ReferencedDoseSequence"],
"00A0":["IS","ReferencedToleranceTableNumber"],"00B0":["SQ","ReferencedBolusSequence"],"00C0":["IS","ReferencedWedgeNumber"],"00D0":["IS","ReferencedCompensatorNumber"],"00E0":["IS","ReferencedBlockNumber"],"00F0":["IS","ReferencedControlPointIndex"],"00F2":["SQ","ReferencedControlPointSequence"],"00F4":["IS","ReferencedStartControlPointIndex"],"00F6":["IS","ReferencedStopControlPointIndex"],"0100":["IS","ReferencedRangeShifterNumber"],"0102":["IS","ReferencedLateralSpreadingDeviceNumber"],"0104":["IS",
"ReferencedRangeModulatorNumber"]},"300E":{"0002":["CS","ApprovalStatus"],"0004":["DA","ReviewDate"],"0005":["TM","ReviewTime"],"0008":["PN","ReviewerName"]},4E3:{"0010":["LT","Arbitrary"],4E3:["LT","TextComments"]},4008:{"0040":["SH","ResultsID"],"0042":["LO","ResultsIDIssuer"],"0050":["SQ","ReferencedInterpretationSequence"],"00FF":["CS","ReportProductionStatusTrial"],"0100":["DA","InterpretationRecordedDate"],"0101":["TM","InterpretationRecordedTime"],"0102":["PN","InterpretationRecorder"],"0103":["LO",
"ReferenceToRecordedSound"],"0108":["DA","InterpretationTranscriptionDate"],"0109":["TM","InterpretationTranscriptionTime"],"010A":["PN","InterpretationTranscriber"],"010B":["ST","InterpretationText"],"010C":["PN","InterpretationAuthor"],"0111":["SQ","InterpretationApproverSequence"],"0112":["DA","InterpretationApprovalDate"],"0113":["TM","InterpretationApprovalTime"],"0114":["PN","PhysicianApprovingInterpretation"],"0115":["LT","InterpretationDiagnosisDescription"],"0117":["SQ","InterpretationDiagnosisCodeSequence"],
"0118":["SQ","ResultsDistributionListSequence"],"0119":["PN","DistributionName"],"011A":["LO","DistributionAddress"],"0200":["SH","InterpretationID"],"0202":["LO","InterpretationIDIssuer"],"0210":["CS","InterpretationTypeID"],"0212":["CS","InterpretationStatusID"],"0300":["ST","Impressions"],4E3:["ST","ResultsComments"]},4010:{"0001":["CS","LowEnergyDetectors"],"0002":["CS","HighEnergyDetectors"],"0004":["SQ","DetectorGeometrySequence"],1001:["SQ","ThreatROIVoxelSequence"],1004:["FL","ThreatROIBase"],
1005:["FL","ThreatROIExtents"],1006:["OB","ThreatROIBitmap"],1007:["SH","RouteSegmentID"],1008:["CS","GantryType"],1009:["CS","OOIOwnerType"],"100A":["SQ","RouteSegmentSequence"],1010:["US","PotentialThreatObjectID"],1011:["SQ","ThreatSequence"],1012:["CS","ThreatCategory"],1013:["LT","ThreatCategoryDescription"],1014:["CS","ATDAbilityAssessment"],1015:["CS","ATDAssessmentFlag"],1016:["FL","ATDAssessmentProbability"],1017:["FL","Mass"],1018:["FL","Density"],1019:["FL","ZEffective"],"101A":["SH","BoardingPassID"],
"101B":["FL","CenterOfMass"],"101C":["FL","CenterOfPTO"],"101D":["FL","BoundingPolygon"],"101E":["SH","RouteSegmentStartLocationID"],"101F":["SH","RouteSegmentEndLocationID"],1020:["CS","RouteSegmentLocationIDType"],1021:["CS","AbortReason"],1023:["FL","VolumeOfPTO"],1024:["CS","AbortFlag"],1025:["DT","RouteSegmentStartTime"],1026:["DT","RouteSegmentEndTime"],1027:["CS","TDRType"],1028:["CS","InternationalRouteSegment"],1029:["LO","ThreatDetectionAlgorithmandVersion"],"102A":["SH","AssignedLocation"],
"102B":["DT","AlarmDecisionTime"],1031:["CS","AlarmDecision"],1033:["US","NumberOfTotalObjects"],1034:["US","NumberOfAlarmObjects"],1037:["SQ","PTORepresentationSequence"],1038:["SQ","ATDAssessmentSequence"],1039:["CS","TIPType"],"103A":["CS","DICOSVersion"],1041:["DT","OOIOwnerCreationTime"],1042:["CS","OOIType"],1043:["FL","OOISize"],1044:["CS","AcquisitionStatus"],1045:["SQ","BasisMaterialsCodeSequence"],1046:["CS","PhantomType"],1047:["SQ","OOIOwnerSequence"],1048:["CS","ScanType"],1051:["LO",
"ItineraryID"],1052:["SH","ItineraryIDType"],1053:["LO","ItineraryIDAssigningAuthority"],1054:["SH","RouteID"],1055:["SH","RouteIDAssigningAuthority"],1056:["CS","InboundArrivalType"],1058:["SH","CarrierID"],1059:["CS","CarrierIDAssigningAuthority"],1060:["FL","SourceOrientation"],1061:["FL","SourcePosition"],1062:["FL","BeltHeight"],1064:["SQ","AlgorithmRoutingCodeSequence"],1067:["CS","TransportClassification"],1068:["LT","OOITypeDescriptor"],1069:["FL","TotalProcessingTime"],"106C":["OB","DetectorCalibrationData"]}};
b.Dictionary.getVR=function(a,d){var f,k;if(k=b.Dictionary.dict[b.Utils.dec2hex(a)])(k=k[b.Utils.dec2hex(d)])?f=k[0]:0===d&&(f="UL");f||(k=b.Dictionary.dictPrivate[b.Utils.dec2hex(a)])&&(k=k[b.Utils.dec2hex(d)])&&(f=k[0]);f||(f="OB");return f};b.Dictionary.getDescription=function(a,d){var f,k;if(k=b.Dictionary.dict[b.Utils.dec2hex(a)])(k=k[b.Utils.dec2hex(d)])?f=k[1]:0===d&&(f="Group "+b.Utils.dec2hex(a)+" Length");f||(k=b.Dictionary.dictPrivate[b.Utils.dec2hex(a)])&&(k=k[b.Utils.dec2hex(d)])&&(f=
k[1]);f||(f="PrivateData");return f};"undefined"!==typeof d&&d.exports&&(d.exports=b.Dictionary)},{"./utilities.js":40}],31:[function(a,d,f){var b=b||{};b.Tag=b.Tag||("undefined"!==typeof a?a("./tag.js"):null);b.CompressionUtils=b.CompressionUtils||("undefined"!==typeof a?a("./compression-utils.js"):null);b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.RLE=b.RLE||("undefined"!==typeof a?a("./rle.js"):null);var e="undefined"!==typeof a?a("jpeg-lossless-decoder-js"):null,h=h||("undefined"!==
typeof a?a("../lib/jpeg-baseline.js").JpegImage:null),g=g||("undefined"!==typeof a?a("../lib/jpx.js"):null);b.Image=b.Image||function(){this.tags={};this.tagsFlat={};this.littleEndian=!1;this.index=-1;this.decompressed=!1;this.privateDataAll=null;this.convertedPalette=!1};b.Image.SLICE_DIRECTION_UNKNOWN=-1;b.Image.SLICE_DIRECTION_AXIAL=2;b.Image.SLICE_DIRECTION_CORONAL=1;b.Image.SLICE_DIRECTION_SAGITTAL=0;b.Image.SLICE_DIRECTION_OBLIQUE=3;b.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE=.8;b.Image.BYTE_TYPE_UNKNOWN=
0;b.Image.BYTE_TYPE_BINARY=1;b.Image.BYTE_TYPE_INTEGER=2;b.Image.BYTE_TYPE_INTEGER_UNSIGNED=3;b.Image.BYTE_TYPE_FLOAT=4;b.Image.BYTE_TYPE_COMPLEX=5;b.Image.BYTE_TYPE_RGB=6;b.Image.getSingleValueSafely=function(a,b){return a&&a.value?a.value[b]:null};b.Image.getValueSafely=function(a){return a?a.value:null};b.Image.getMajorAxisFromPatientRelativeDirectionCosine=function(a,e,d){var h,f,g;h=0>a?"R":"L";f=0>e?"A":"P";g=0>d?"F":"H";a=Math.abs(a);e=Math.abs(e);d=Math.abs(d);return a>b.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE&&
a>e&&a>d?h:e>b.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE&&e>a&&e>d?f:d>b.Image.OBLIQUITY_THRESHOLD_COSINE_VALUE&&d>a&&d>e?g:null};b.Image.prototype.getCols=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_COLS[0],b.Tag.TAG_COLS[1]),0)};b.Image.prototype.getRows=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_ROWS[0],b.Tag.TAG_ROWS[1]),0)};b.Image.prototype.getSeriesDescription=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SERIES_DESCRIPTION[0],
b.Tag.TAG_SERIES_DESCRIPTION[1]),0)};b.Image.prototype.getSeriesInstanceUID=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SERIES_INSTANCE_UID[0],b.Tag.TAG_SERIES_INSTANCE_UID[1]),0)};b.Image.prototype.getSeriesNumber=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SERIES_NUMBER[0],b.Tag.TAG_SERIES_NUMBER[1]),0)};b.Image.prototype.getEchoNumber=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_ECHO_NUMBER[0],b.Tag.TAG_ECHO_NUMBER[1]),0)};
b.Image.prototype.getImagePosition=function(){return b.Image.getValueSafely(this.getTag(b.Tag.TAG_IMAGE_POSITION[0],b.Tag.TAG_IMAGE_POSITION[1]))};b.Image.prototype.getImageDirections=function(){return b.Image.getValueSafely(this.getTag(b.Tag.TAG_IMAGE_ORIENTATION[0],b.Tag.TAG_IMAGE_ORIENTATION[1]))};b.Image.prototype.getImagePositionSliceDir=function(a){var e=b.Image.getValueSafely(this.getTag(b.Tag.TAG_IMAGE_POSITION[0],b.Tag.TAG_IMAGE_POSITION[1]));return e&&0<=a?e[a]:0};b.Image.prototype.getSliceLocation=
function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SLICE_LOCATION[0],b.Tag.TAG_SLICE_LOCATION[1]),0)};b.Image.prototype.getSliceLocationVector=function(){return b.Image.getValueSafely(this.getTag(b.Tag.TAG_SLICE_LOCATION_VECTOR[0],b.Tag.TAG_SLICE_LOCATION_VECTOR[1]))};b.Image.prototype.getImageNumber=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_IMAGE_NUM[0],b.Tag.TAG_IMAGE_NUM[1]),0)};b.Image.prototype.getTemporalPosition=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_TEMPORAL_POSITION[0],
b.Tag.TAG_TEMPORAL_POSITION[1]),0)};b.Image.prototype.getTemporalNumber=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_NUMBER_TEMPORAL_POSITIONS[0],b.Tag.TAG_NUMBER_TEMPORAL_POSITIONS[1]),0)};b.Image.prototype.getSliceGap=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SLICE_GAP[0],b.Tag.TAG_SLICE_GAP[1]),0)};b.Image.prototype.getSliceThickness=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SLICE_THICKNESS[0],b.Tag.TAG_SLICE_THICKNESS[1]),
0)};b.Image.prototype.getImageMax=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_IMAGE_MAX[0],b.Tag.TAG_IMAGE_MAX[1]),0)};b.Image.prototype.getImageMin=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_IMAGE_MIN[0],b.Tag.TAG_IMAGE_MIN[1]),0)};b.Image.prototype.getDataScaleSlope=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_DATA_SCALE_SLOPE[0],b.Tag.TAG_DATA_SCALE_SLOPE[1]),0)};b.Image.prototype.getDataScaleIntercept=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_DATA_SCALE_INTERCEPT[0],
b.Tag.TAG_DATA_SCALE_INTERCEPT[1]),0)};b.Image.prototype.getDataScaleElscint=function(){var a=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_DATA_SCALE_ELSCINT[0],b.Tag.TAG_DATA_SCALE_ELSCINT[1]),0);a||(a=1);var e=this.getPixelBandwidth(),a=Math.sqrt(e)/(10*a);0>=a&&(a=1);return a};b.Image.prototype.getWindowWidth=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_WINDOW_WIDTH[0],b.Tag.TAG_WINDOW_WIDTH[1]),0)};b.Image.prototype.getWindowCenter=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_WINDOW_CENTER[0],
b.Tag.TAG_WINDOW_CENTER[1]),0)};b.Image.prototype.getPixelBandwidth=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_PIXEL_BANDWIDTH[0],b.Tag.TAG_PIXEL_BANDWIDTH[1]),0)};b.Image.prototype.getSeriesId=function(){var a=this.getSeriesDescription(),b=this.getSeriesInstanceUID(),e=this.getSeriesNumber(),d=this.getEchoNumber(),h=this.getOrientation(),f=this.getCols(),g=this.getRows(),x="";null!==a&&(x+=" "+a);null!==b&&(x+=" "+b);null!==e&&(x+=" "+e);null!==d&&(x+=" "+d);null!==h&&(x+=
" "+h);return x+(" ("+f+" x "+g+")")};b.Image.prototype.getPixelSpacing=function(){return b.Image.getValueSafely(this.getTag(b.Tag.TAG_PIXEL_SPACING[0],b.Tag.TAG_PIXEL_SPACING[1]))};b.Image.prototype.getImageType=function(){return b.Image.getValueSafely(this.getTag(b.Tag.TAG_IMAGE_TYPE[0],b.Tag.TAG_IMAGE_TYPE[1]))};b.Image.prototype.getBitsStored=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_BITS_STORED[0],b.Tag.TAG_BITS_STORED[1]),0)};b.Image.prototype.getBitsAllocated=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_BITS_ALLOCATED[0],
b.Tag.TAG_BITS_ALLOCATED[1]),0)};b.Image.prototype.getFrameTime=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_FRAME_TIME[0],b.Tag.TAG_FRAME_TIME[1]),0)};b.Image.prototype.getAcquisitionMatrix=function(){var a,e,d;a=[0,0];a[0]=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_ACQUISITION_MATRIX[0],b.Tag.TAG_ACQUISITION_MATRIX[1]),0);null===this.privateDataAll&&(this.privateDataAll=this.getAllInterpretedPrivateData());null!==this.privateDataAll&&0<this.privateDataAll.length&&
(e=this.privateDataAll.indexOf("AcquisitionMatrixText"),-1!==e&&(d=this.privateDataAll.indexOf("\n",e),-1!==d&&(e=this.privateDataAll.substring(e,d),e=e.match(/\d+/g),null!==e&&2===e.length?(a[0]=e[0],a[1]=e[1]):null!==e&&1===e.length&&(a[0]=e[0]))));0===a[1]&&(a[1]=a[0]);return a};b.Image.prototype.getTR=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_TR,b.Tag.TAG_TR[1]),0)};b.Image.prototype.putTag=function(a){this.tags[a.id]=a;this.putFlattenedTag(this.tagsFlat,a)};b.Image.prototype.putFlattenedTag=
function(a,b){var e;if(b.sublist)for(e=0;e<b.value.length;e+=1)this.putFlattenedTag(a,b.value[e]);else a[b.id]||(a[b.id]=b)};b.Image.prototype.getTag=function(a,e){return this.tagsFlat[b.Tag.createId(a,e)]};b.Image.prototype.getPixelData=function(){return this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],b.Tag.TAG_PIXEL_DATA[1])]};b.Image.prototype.getPixelDataBytes=function(){this.isCompressed()&&this.decompress();this.isPalette()&&this.convertPalette();return this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],
b.Tag.TAG_PIXEL_DATA[1])].value.buffer};b.Image.prototype.getRawData=function(){return this.getPixelDataBytes()};b.Image.prototype.getInterpretedData=function(a,e){var d,h,f,g,A,x,I,F,z,L,n,G,K,E,w,D;I=b.Utils.createBitMask(this.getBitsAllocated()/8,this.getBitsStored(),this.getDataType()===b.Image.BYTE_TYPE_INTEGER_UNSIGNED);d=this.getDataType();h=this.getBitsAllocated()/8;f=this.getRawData();g=new DataView(f);f=f.byteLength/h;F=this.getDataScaleSlope()||1;z=this.getDataScaleIntercept()||0;L=b.Utils.MAX_VALUE;
n=b.Utils.MIN_VALUE;E=K=-1;w=this.littleEndian;A=a?[]:new Float32Array(f);for(x=0;x<f;x+=1)d===b.Image.BYTE_TYPE_INTEGER?1===h?D=g.getInt8(x*h):2===h&&(D=g.getInt16(x*h,w)):d===b.Image.BYTE_TYPE_INTEGER_UNSIGNED&&(1===h?D=g.getUint8(x*h):2===h&&(D=g.getUint16(x*h,w))),G=(D&I)*F+z,A[x]=G,G<L&&(L=G,K=x),G>n&&(n=G,E=x);return e?{data:A,min:L,minIndex:K,max:n,maxIndex:E,numCols:this.getCols(),numRows:this.getRows()}:A};b.Image.prototype.convertPalette=function(){var a,e,d,h,f,g,A,x,I,F;a=this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],
b.Tag.TAG_PIXEL_DATA[1])].value;e=this.getPalleteValues(b.Tag.TAG_PALETTE_RED);d=this.getPalleteValues(b.Tag.TAG_PALETTE_GREEN);h=this.getPalleteValues(b.Tag.TAG_PALETTE_BLUE);if(null!==e&&0<e.length&&null!==d&&0<d.length&&null!==h&&0<h.length&&!this.convertedPalette){f=new DataView(new ArrayBuffer(this.getRows()*this.getCols()*this.getNumberOfFrames()*3));g=parseInt(Math.ceil(this.getBitsAllocated()/8));A=a.byteLength/g;if(1===g)for(g=0;g<A;g+=1)x=a.getUint8(g),I=e[x],F=d[x],x=h[x],f.setUint8(3*
g,I),f.setUint8(3*g+1,F),f.setUint8(3*g+2,x);else if(2===g)for(g=0;g<A;g+=1)x=a.getUint16(2*g),I=e[x],F=d[x],x=h[x],f.setUint8(3*g,I),f.setUint8(3*g+1,F),f.setUint8(3*g+2,x);a=f;this.convertedPalette=!0}this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],b.Tag.TAG_PIXEL_DATA[1])].value=a};b.Image.prototype.decompress=function(){var a,d,f,t,y,B,A,x,I,F;f=null;if(!this.decompressed)if(this.decompressed=!0,y=this.getRows()*this.getCols()*parseInt(Math.ceil(this.getBitsAllocated()/8)),t=this.getNumberOfFrames(),
this.isCompressedJPEGLossless()){a=this.getJpegs();for(A=0;A<a.length;A+=1)d=new e.lossless.Decoder,B=d.decode(a[A]),I=d.numComp,null===f&&(f=new DataView(new ArrayBuffer(y*t*I))),(new Uint8Array(f.buffer)).set(new Uint8Array(B.buffer),A*y*I);this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],b.Tag.TAG_PIXEL_DATA[1])].value=f}else if(this.isCompressedJPEGBaseline()){a=this.getJpegs();for(A=0;A<a.length;A+=1)d=new h,d.parse(new Uint8Array(a[A])),B=d.width,x=d.height,I=d.components.length,null===f&&(f=
new DataView(new ArrayBuffer(y*t*I))),8===this.getBitsAllocated()?F=d.getData(B,x):16===this.getBitsAllocated()&&(F=d.getData16(B,x)),b.Utils.fillBuffer(F,f,A*y*I,parseInt(Math.ceil(this.getBitsAllocated()/8))),F=null;this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],b.Tag.TAG_PIXEL_DATA[1])].value=f}else if(this.isCompressedJPEG2000()){a=this.getJpegs();for(A=0;A<a.length;A+=1)d=new g,d.parse(new Uint8Array(a[A])),F=d.tiles[0].items,I=d.componentsCount,null===f&&(f=new DataView(new ArrayBuffer(y*
t*I))),b.Utils.fillBuffer(F,f,A*y*I,parseInt(Math.ceil(this.getBitsAllocated()/8)));this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],b.Tag.TAG_PIXEL_DATA[1])].value=f}else if(this.isCompressedRLE()){a=this.getRLE();for(A=0;A<a.length;A+=1)d=new b.RLE,B=d.decode(a[A],this.littleEndian,this.getRows()*this.getCols()),I=3===d.numSegments?3:1,null===f&&(f=new DataView(new ArrayBuffer(y*t*I))),(new Uint8Array(f.buffer)).set(new Uint8Array(B.buffer),A*y*I);this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],
b.Tag.TAG_PIXEL_DATA[1])].value=f}};b.Image.prototype.hasPixelData=function(){return void 0!==this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],b.Tag.TAG_PIXEL_DATA[1])]};b.Image.prototype.clearPixelData=function(){this.tags[b.Tag.createId(b.Tag.TAG_PIXEL_DATA[0],b.Tag.TAG_PIXEL_DATA[1])].value=null};b.Image.prototype.getOrientation=function(){var a=b.Image.getValueSafely(this.getTag(b.Tag.TAG_IMAGE_ORIENTATION[0],b.Tag.TAG_IMAGE_ORIENTATION[1])),e,d,h=0,f=0,g=0,A="";if(!a||6!==a.length)return null;
e=this.getPixelSpacing();if(!e)return null;d=e[0];for(e=0;3>e;e+=1)Math.abs(a[e])>g&&(g=Math.abs(a[e]),h=e);for(g=0;6>e;e+=1)Math.abs(a[e])>g&&(g=Math.abs(a[e]),f=e);switch(h){case 0:A+="X";A=4===f?A+"YZ":A+"ZY";break;case 1:A+="Y";A=3===f?A+"XZ":A+"ZX";break;case 2:A+="Z",A=3===f?A+"XY":A+"YX"}switch(h){case 0:A=0<a[h]?A+"-":A+"+";A=4===f?0<a[f]?A+"-":A+"+":0<a[f]?A+"+":A+"-";break;case 1:A=0<a[h]?A+"-":A+"+";A=3===f?0<a[f]?A+"-":A+"+":0<a[f]?A+"+":A+"-";break;case 2:A=0<a[h]?A+"+":A+"-",A=0<a[f]?
A+"-":A+"+"}if(0===d)A+="+";else switch(A.charAt(2)){case "X":A=0<d?A+"-":A+"+";break;case "Y":case "Z":A=0<d?A+"+":A+"-"}return A};b.Image.prototype.isMosaic=function(){var a,b=!1,e;a=this.getImageType();if(null!==a)for(e=0;e<a.length;e+=1)if(-1!==a[e].toUpperCase().indexOf("MOSAIC")){b=!0;break}a=this.getAcquisitionMatrix();a=0<a[0]&&(a[0]<this.getRows()||a[1]<this.getCols());return b&&a};b.Image.prototype.isPalette=function(){var a=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_PHOTOMETRIC_INTERPRETATION[0],
b.Tag.TAG_PHOTOMETRIC_INTERPRETATION[1]),0);return null!==a&&-1!==a.toLowerCase().indexOf("palette")?!0:!1};b.Image.prototype.getMosaicCols=function(){return this.getCols()/this.getAcquisitionMatrix()[1]};b.Image.prototype.getMosaicRows=function(){return this.getRows()/this.getAcquisitionMatrix()[0]};b.Image.prototype.isElscint=function(){return void 0!==this.getTag(b.Tag.TAG_DATA_SCALE_ELSCINT[0],b.Tag.TAG_DATA_SCALE_ELSCINT[1])};b.Image.prototype.isCompressed=function(){b.Parser=b.Parser||("undefined"!==
typeof a?a("./parser.js"):null);var e=this.getTransferSyntax();return!e||-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG)&&-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_RLE)?!1:!0};b.Image.prototype.isCompressedJPEG=function(){b.Parser=b.Parser||("undefined"!==typeof a?a("./parser.js"):null);var e=this.getTransferSyntax();return e&&-1!==e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG)?!0:!1};b.Image.prototype.isCompressedJPEGLossless=function(){b.Parser=b.Parser||("undefined"!==
typeof a?a("./parser.js"):null);var e=this.getTransferSyntax();return!e||-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS)&&-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS_SEL1)?!1:!0};b.Image.prototype.isCompressedJPEGBaseline=function(){b.Parser=b.Parser||("undefined"!==typeof a?a("./parser.js"):null);var e=this.getTransferSyntax();return!e||-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_8BIT)&&-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_12BIT)?
!1:!0};b.Image.prototype.isCompressedJPEG2000=function(){b.Parser=b.Parser||("undefined"!==typeof a?a("./parser.js"):null);var e=this.getTransferSyntax();return!e||-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000)&&-1===e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000_LOSSLESS)?!1:!0};b.Image.prototype.isCompressedRLE=function(){b.Parser=b.Parser||("undefined"!==typeof a?a("./parser.js"):null);var e=this.getTransferSyntax();return e&&-1!==e.indexOf(b.Parser.TRANSFER_SYNTAX_COMPRESSION_RLE)?
!0:!1};b.Image.prototype.getNumberOfFrames=function(){var a=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_NUMBER_OF_FRAMES[0],b.Tag.TAG_NUMBER_OF_FRAMES[1]),0);return null!==a?a:1};b.Image.prototype.getNumberOfSamplesPerPixel=function(){var a=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SAMPLES_PER_PIXEL[0],b.Tag.TAG_SAMPLES_PER_PIXEL[1]),0);return null!==a?a:1};b.Image.prototype.getNumberOfImplicitFrames=function(){var a,b;if(this.isCompressed())return 1;a=this.getPixelData();a=a.offsetEnd-
a.offsetValue;b=this.getCols()*this.getRows()*parseInt(this.getBitsAllocated()/8);return parseInt(a/b)};b.Image.prototype.getPixelRepresentation=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_PIXEL_REPRESENTATION[0],b.Tag.TAG_PIXEL_REPRESENTATION[1]),0)};b.Image.prototype.getPhotometricInterpretation=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_PHOTOMETRIC_INTERPRETATION[0],b.Tag.TAG_PHOTOMETRIC_INTERPRETATION[1]),0)};b.Image.prototype.getPatientName=
function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_PATIENT_NAME[0],b.Tag.TAG_PATIENT_NAME[1]),0)};b.Image.prototype.getPatientID=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_PATIENT_ID[0],b.Tag.TAG_PATIENT_ID[1]),0)};b.Image.prototype.getStudyTime=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_STUDY_TIME[0],b.Tag.TAG_STUDY_TIME[1]),0)};b.Image.prototype.getTransferSyntax=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_TRANSFER_SYNTAX[0],
b.Tag.TAG_TRANSFER_SYNTAX[1]),0)};b.Image.prototype.getStudyDate=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_STUDY_DATE[0],b.Tag.TAG_STUDY_DATE[1]),0)};b.Image.prototype.getPlanarConfig=function(){return b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_PLANAR_CONFIG[0],b.Tag.TAG_PLANAR_CONFIG[1]),0)};b.Image.prototype.getImageDescription=function(){var a,e="";a=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_STUDY_DES[0],b.Tag.TAG_STUDY_DES[1]),0);null!==a&&(e+=" "+a);
a=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_SERIES_DESCRIPTION[0],b.Tag.TAG_SERIES_DESCRIPTION[1]),0);null!==a&&(e+=" "+a);a=b.Image.getSingleValueSafely(this.getTag(b.Tag.TAG_IMAGE_COMMENTS[0],b.Tag.TAG_IMAGE_COMMENTS[1]),0);null!==a&&(e+=" "+a);return e.trim()};b.Image.prototype.getDataType=function(){var a,e;e=this.getPixelRepresentation();if(null===e)return b.Image.BYTE_TYPE_UNKNOWN;a=this.getPhotometricInterpretation();return null===a||-1===a.trim().indexOf("RGB")&&-1===a.trim().indexOf("YBR")&&
-1===a.trim().toLowerCase().indexOf("palette")?0===e?b.Image.BYTE_TYPE_INTEGER_UNSIGNED:1===e?b.Image.BYTE_TYPE_INTEGER:b.Image.BYTE_TYPE_UNKNOWN:b.Image.BYTE_TYPE_RGB};b.Image.prototype.getAcquiredSliceDirection=function(){var a,e,d;a=b.Image.getValueSafely(this.getTag(b.Tag.TAG_IMAGE_ORIENTATION[0],b.Tag.TAG_IMAGE_ORIENTATION[1]));if(!a||6!==a.length)return b.Image.SLICE_DIRECTION_UNKNOWN;e=b.Image.getMajorAxisFromPatientRelativeDirectionCosine(a[0],a[1],a[2]);a=b.Image.getMajorAxisFromPatientRelativeDirectionCosine(a[3],
a[4],a[5]);null!==e&&null!==a?"R"!==e&&"L"!==e||"A"!==a&&"P"!==a?"R"!==a&&"L"!==a||"A"!==e&&"P"!==e?"R"!==e&&"L"!==e||"H"!==a&&"F"!==a?"R"!==a&&"L"!==a||"H"!==e&&"F"!==e?"A"!==e&&"P"!==e||"H"!==a&&"F"!==a?"A"!==a&&"P"!==a||"H"!==e&&"F"!==e||(d=b.Image.SLICE_DIRECTION_SAGITTAL):d=b.Image.SLICE_DIRECTION_SAGITTAL:d=b.Image.SLICE_DIRECTION_CORONAL:d=b.Image.SLICE_DIRECTION_CORONAL:d=b.Image.SLICE_DIRECTION_AXIAL:d=b.Image.SLICE_DIRECTION_AXIAL:d=b.Image.SLICE_DIRECTION_OBLIQUE;return d};b.Image.prototype.getEncapsulatedData=
function(){var e;b.Parser=b.Parser||("undefined"!==typeof a?a("./parser.js"):null);e=this.getPixelData().value.buffer;return(new b.Parser).parseEncapsulated(new DataView(e))};b.Image.prototype.getJpegs=function(){var a,e,d,h,f=[],g=[];if(a=this.getEncapsulatedData())for(e=a.length,d=0;d<e;d+=1)b.CompressionUtils.isHeaderJPEG(a[d].value)||b.CompressionUtils.isHeaderJPEG2000(a[d].value)?(h=[],h.push(a[d].value.buffer),f.push(h)):h&&a[d].value&&h.push(a[d].value.buffer);for(d=0;d<f.length;d+=1)g[d]=
1<f[d].length?b.Utils.concatArrayBuffers2(f[d]):f[d][0],f[d]=null;return g};b.Image.prototype.getRLE=function(){var a,b,e,d=[];if(a=this.getEncapsulatedData())for(b=a.length,e=1;e<b;e+=1)a[e].value&&d.push(a[e].value.buffer);return d};b.Image.prototype.getAllInterpretedPrivateData=function(){var a,b,e="",d=Object.keys(this.tags).sort();for(a=0;a<d.length;a+=1)b=d[a],this.tags.hasOwnProperty(b)&&(b=this.tags[b],b.hasInterpretedPrivateData()&&(e+=b.value));return e};b.Image.prototype.toString=function(){var a,
b,e="",d=Object.keys(this.tags).sort();for(a=0;a<d.length;a+=1)b=d[a],this.tags.hasOwnProperty(b)&&(b=this.tags[b],e+=b.toHTMLString()+"<br />");e=e.replace(/\n\s*\n/g,"\n");return e=e.replace(/(?:\r\n|\r|\n)/g,"<br />")};b.Image.prototype.getPalleteValues=function(a){var e,d,h,f,g;d=b.Image.getValueSafely(this.getTag(a[0],a[1]));if(null!==d){h=d.buffer.byteLength/2;a=[];e=[];for(f=0;f<h;f+=1)a[f]=d.getUint16(2*f,!1)&65535,e[f]=d.getUint16(2*f,!0)&65535;f=Math.max.apply(Math,a);g=Math.min.apply(Math,
a);d=Math.max.apply(Math,e);h=Math.min.apply(Math,e);f=Math.abs(f-g);d=Math.abs(d-h);return f<d?this.scalePalette(a):this.scalePalette(e)}return null};b.Image.prototype.scalePalette=function(a){var b,e,d;e=Math.max.apply(Math,a);b=Math.min.apply(Math,a);if(255<e||0>b)for(d=255/(e-b),e=0;e<a.length;e+=1)a[e]=parseInt(Math.round((a[e]-b)*d));return a};"undefined"!==typeof d&&d.exports&&(d.exports=b.Image)},{"../lib/jpeg-baseline.js":1,"../lib/jpx.js":2,"./compression-utils.js":29,"./parser.js":35,"./rle.js":36,
"./tag.js":39,"./utilities.js":40,"jpeg-lossless-decoder-js":8}],32:[function(a,d,f){var b=b||{};b.OrderedMapIterator=b.OrderedMapIterator||function(a){this.orderedMap=a;this.index=0};b.OrderedMapIterator.prototype.hasNext=function(){return this.index<this.orderedMap.orderedKeys.length};b.OrderedMapIterator.prototype.next=function(){var a=this.orderedMap.get(this.orderedMap.orderedKeys[this.index]);this.index+=1;return a};"undefined"!==typeof d&&d.exports&&(d.exports=b.OrderedMapIterator)},{}],33:[function(a,
d,f){var b=b||{};b.CompressionUtils=b.CompressionUtils||("undefined"!==typeof a?a("./compression-utils.js"):null);b.Dictionary=b.Dictionary||("undefined"!==typeof a?a("./dictionary.js"):null);b.Image=b.Image||("undefined"!==typeof a?a("./image.js"):null);b.OrderedMapIterator=b.OrderedMapIterator||("undefined"!==typeof a?a("./iterator.js"):null);b.OrderedMap=b.OrderedMap||("undefined"!==typeof a?a("./orderedmap.js"):null);b.Parser=b.Parser||("undefined"!==typeof a?a("./parser.js"):null);b.RLE=b.RLE||
("undefined"!==typeof a?a("./rle.js"):null);b.Series=b.Series||("undefined"!==typeof a?a("./series.js"):null);b.Tag=b.Tag||("undefined"!==typeof a?a("./tag.js"):null);b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.Siemens=b.Siemens||("undefined"!==typeof a?a("./siemens.js"):null);var e=e||{};e.lossless=e.lossless||{};e.lossless.Decoder="undefined"!==typeof a?a("jpeg-lossless-decoder-js"):null;var h=h||("undefined"!==typeof a?a("../lib/jpeg-baseline.js").JpegImage:null),g=g||
("undefined"!==typeof a?a("../lib/jpx.js"):null),k=k||("undefined"!==typeof a?a("pako"):null);"undefined"!==typeof d&&d.exports&&(d.exports=b)},{"../lib/jpeg-baseline.js":1,"../lib/jpx.js":2,"./compression-utils.js":29,"./dictionary.js":30,"./image.js":31,"./iterator.js":32,"./orderedmap.js":34,"./parser.js":35,"./rle.js":36,"./series.js":37,"./siemens.js":38,"./tag.js":39,"./utilities.js":40,"jpeg-lossless-decoder-js":8,pako:13}],34:[function(a,d,f){var b=b||{};b.OrderedMapIterator=b.OrderedMapIterator||
("undefined"!==typeof a?a("./iterator.js"):null);b.OrderedMap=b.OrderedMap||function(){this.map={};this.orderedKeys=[]};b.OrderedMap.prototype.put=function(a,b){a in this.map||(this.orderedKeys.push(a),this.orderedKeys.sort(function(a,b){return parseFloat(a)-parseFloat(b)}));this.map[a]=b};b.OrderedMap.prototype.remove=function(a){var b=this.orderedKeys.indexOf(a);if(-1===b)throw Error("key does not exist");this.orderedKeys.splice(b,1);delete this.map[a]};b.OrderedMap.prototype.get=function(a){return a in
this.map?this.map[a]:null};b.OrderedMap.prototype.iterator=function(){return new b.OrderedMapIterator(this)};b.OrderedMap.prototype.getOrderedValues=function(){for(var a=[],b=this.iterator();b.hasNext();)a.push(b.next());return a};"undefined"!==typeof d&&d.exports&&(d.exports=b.OrderedMap)},{"./iterator.js":32}],35:[function(a,d,f){var b=b||{};b.Tag=b.Tag||("undefined"!==typeof a?a("./tag.js"):null);b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.Dictionary=b.Dictionary||("undefined"!==
typeof a?a("./dictionary.js"):null);b.Image=b.Image||("undefined"!==typeof a?a("./image.js"):null);var e=e||("undefined"!==typeof a?a("pako"):null);b.Parser=b.Parser||function(){this.explicit=this.littleEndian=!0;this.metaFinished=this.metaFound=!1;this.metaFinishedOffset=-1;this.needsDeflate=!1;this.error=null};b.Parser.verbose=!1;b.Parser.MAGIC_COOKIE_OFFSET=128;b.Parser.MAGIC_COOKIE=[68,73,67,77];b.Parser.VRS="AE AS AT CS DA DS DT FL FD IS LO LT OB OD OF OW PN SH SL SS ST TM UI UL UN US UT".split(" ");
b.Parser.DATA_VRS="OB OW OF SQ UT UN".split(" ");b.Parser.RAW_DATA_VRS=["OB","OD","OF","OW","UN"];b.Parser.TRANSFER_SYNTAX_IMPLICIT_LITTLE="1.2.840.10008.1.2";b.Parser.TRANSFER_SYNTAX_EXPLICIT_LITTLE="1.2.840.10008.1.2.1";b.Parser.TRANSFER_SYNTAX_EXPLICIT_BIG="1.2.840.10008.1.2.2";b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG="1.2.840.10008.1.2.4";b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS="1.2.840.10008.1.2.4.57";b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_LOSSLESS_SEL1="1.2.840.10008.1.2.4.70";
b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_8BIT="1.2.840.10008.1.2.4.50";b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_BASELINE_12BIT="1.2.840.10008.1.2.4.51";b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000_LOSSLESS="1.2.840.10008.1.2.4.90";b.Parser.TRANSFER_SYNTAX_COMPRESSION_JPEG_2000="1.2.840.10008.1.2.4.91";b.Parser.TRANSFER_SYNTAX_COMPRESSION_RLE="1.2.840.10008.1.2.5";b.Parser.TRANSFER_SYNTAX_COMPRESSION_DEFLATE="1.2.840.10008.1.2.1.99";b.Parser.UNDEFINED_LENGTH=4294967295;b.Parser.isMagicCookieFound=
function(a){var e=b.Parser.MAGIC_COOKIE_OFFSET,d=b.Parser.MAGIC_COOKIE.length,f;for(f=0;f<d;f+=1)if(a.getUint8(e+f)!==b.Parser.MAGIC_COOKIE[f])return!1;return!0};b.Parser.prototype.parse=function(a){var d=null,f,l,q,t;try{for(d=new b.Image,f=this.findFirstTagOffset(a),l=this.getNextTag(a,f);null!==l;){b.Parser.verbose&&console.log(l.toString());d.putTag(l);if(l.isPixelData())break;this.needsDeflate&&l.offsetEnd>=this.metaFinishedOffset&&(this.needsDeflate=!1,q=a.buffer.slice(0,l.offsetEnd),t=a.buffer.slice(l.offsetEnd),
a=new DataView(b.Utils.concatArrayBuffers(q,e.inflateRaw(t))));l=this.getNextTag(a,l.offsetEnd)}}catch(y){this.error=y}null!==d&&(d.littleEndian=this.littleEndian);return d};b.Parser.prototype.parseEncapsulated=function(a){var e,d=[];try{for(e=this.getNextTag(a,0);null!==e;)e.isSublistItem()&&d.push(e),b.Parser.verbose&&console.log(e.toString()),e=this.getNextTag(a,e.offsetEnd)}catch(f){this.error=f}return d};b.Parser.prototype.testForValidTag=function(a){var b,e=null;try{b=this.findFirstTagOffset(a),
e=this.getNextTag(a,b,!0)}catch(d){this.error=d}return e};b.Parser.prototype.getNextTag=function(a,e,d){var f=0,q,t=null,y=e,B,A=0;B=!0;var x=null;if(e>=a.byteLength)return null;this.metaFinished?(B=this.littleEndian,f=a.getUint16(e,B)):(f=a.getUint16(e,!0),-1!==this.metaFinishedOffset&&e>=this.metaFinishedOffset||2!==f?(this.metaFinished=!0,B=this.littleEndian,f=a.getUint16(e,B)):B=!0);this.metaFound||2!==f||(this.metaFound=!0);e+=2;q=a.getUint16(e,B);e+=2;this.explicit||!this.metaFinished?(x=b.Utils.getStringAt(a,
e,2),!this.metaFound&&this.metaFinished&&-1===b.Parser.VRS.indexOf(x)?(x=b.Dictionary.getVR(f,q),A=a.getUint32(e,B),e+=4,this.explicit=!1):(e+=2,-1!==b.Parser.DATA_VRS.indexOf(x)?(e+=2,A=a.getUint32(e,B),e+=4):(A=a.getUint16(e,B),e+=2))):(x=b.Dictionary.getVR(f,q),A=a.getUint32(e,B),A===b.Parser.UNDEFINED_LENGTH&&(x="SQ"),e+=4);B=e;"SQ"===x?(t=this.parseSublist(a,e,A),A===b.Parser.UNDEFINED_LENGTH&&(A=t[t.length-1].offsetEnd-e)):0<A&&!d&&(A===b.Parser.UNDEFINED_LENGTH&&f===b.Tag.TAG_PIXEL_DATA[0]&&
q===b.Tag.TAG_PIXEL_DATA[1]&&(A=a.byteLength-e),t=a.buffer.slice(e,e+A));e+=A;a=new b.Tag(f,q,x,t,y,B,e,this.littleEndian);a.isTransformSyntax()?a.value[0]===b.Parser.TRANSFER_SYNTAX_IMPLICIT_LITTLE?(this.explicit=!1,this.littleEndian=!0):a.value[0]===b.Parser.TRANSFER_SYNTAX_EXPLICIT_BIG?(this.explicit=!0,this.littleEndian=!1):(a.value[0]===b.Parser.TRANSFER_SYNTAX_COMPRESSION_DEFLATE&&(this.needsDeflate=!0),this.littleEndian=this.explicit=!0):a.isMetaLength()&&(this.metaFinishedOffset=a.value[0]+
e);return a};b.Parser.prototype.parseSublist=function(a,e,d){var f=e+d,q=[];if(d===b.Parser.UNDEFINED_LENGTH){for(e=this.parseSublistItem(a,e);!e.isSequenceDelim();)q.push(e),e=e.offsetEnd,e=this.parseSublistItem(a,e);q.push(e)}else for(;e<f;)e=this.parseSublistItem(a,e),q.push(e),e=e.offsetEnd;return q};b.Parser.prototype.parseSublistItem=function(a,e){var d,f,q,t,y=e,B,A=[];d=a.getUint16(e,this.littleEndian);e+=2;f=a.getUint16(e,this.littleEndian);e+=2;q=a.getUint32(e,this.littleEndian);B=e+=4;
if(q===b.Parser.UNDEFINED_LENGTH){for(t=this.getNextTag(a,e);!t.isSublistItemDelim();)A.push(t),e=t.offsetEnd,t=this.getNextTag(a,e);A.push(t);e=t.offsetEnd}else for(q=e+q;e<q;)t=this.getNextTag(a,e),A.push(t),e=t.offsetEnd;return new b.Tag(d,f,null,A,y,B,e,this.littleEndian)};b.Parser.prototype.findFirstTagOffset=function(a){var e=0,d=b.Parser.MAGIC_COOKIE.length,f=2*b.Parser.MAGIC_COOKIE_OFFSET,q=!1,t=0,y=0,q=0;if(b.Parser.isMagicCookieFound(a))e=b.Parser.MAGIC_COOKIE_OFFSET+d;else for(t=0;t<f;t+=
1)if(q=a.getUint8(e),q===b.Parser.MAGIC_COOKIE[0]){q=!0;for(y=1;y<d;y+=1)a.getUint8(t+y)!==b.Parser.MAGIC_COOKIE[y]&&(q=!1);if(q){e=t;break}}return e};b.Parser.prototype.hasError=function(){return null!==this.error};"undefined"!==typeof d&&d.exports&&(d.exports=b.Parser)},{"./dictionary.js":30,"./image.js":31,"./tag.js":39,"./utilities.js":40,pako:13}],36:[function(a,d,f){var b=b||{};b.RLE=b.RLE||function(){this.rawData=null;this.numSegments=this.segElemPut=this.bytesPut=this.bytesRead=0;this.segmentOffsets=
[];this.littleEndian=!0;this.size=this.numElements=this.segmentIndex=0;this.output=null};b.RLE.HEADER_SIZE=64;b.RLE.prototype.decode=function(a,b,d){this.rawData=new DataView(a);this.littleEndian=b;this.numElements=d;this.readHeader();this.output=new DataView(new ArrayBuffer(this.size));for(a=0;a<this.numSegments;a+=1)this.readNextSegment();return this.processData()};b.RLE.prototype.processData=function(){var a,b,d,f;if(1===this.numSegments)return this.output;if(2===this.numSegments){f=new DataView(new ArrayBuffer(this.size));
for(a=0;a<this.numElements;a+=1)b=this.output.getInt8(a),d=this.output.getInt8(a+this.numElements),b=(b&255)<<8|d&255,f.setInt16(2*a,b,this.littleEndian);return f}if(3===this.numSegments){f=new DataView(new ArrayBuffer(this.size));b=2*this.numElements;for(a=0;a<this.numElements;a+=1)f.setInt8(3*a,this.output.getInt8(a)),f.setInt8(3*a+1,this.output.getInt8(a+this.numElements)),f.setInt8(3*a+2,this.output.getInt8(a+b));return f}throw Error("RLE data with "+this.numSegments+" segments is not supported!");
};b.RLE.prototype.readHeader=function(){var a;this.numSegments=this.getInt32();this.size=this.numElements*this.numSegments;for(a=0;a<this.numSegments;a+=1)this.segmentOffsets[a]=this.getInt32();this.bytesRead=b.RLE.HEADER_SIZE};b.RLE.prototype.hasValidInput=function(){return this.bytesRead<this.rawData.buffer.byteLength&&this.bytesPut<this.size&&this.segElemPut<this.numElements};b.RLE.prototype.readNextSegment=function(){var a;this.bytesRead=this.segmentOffsets[this.segmentIndex];for(this.segElemPut=
0;this.hasValidInput();)a=this.get(),0<=a&&128>a?this.readLiteral(a):-1>=a&&-128<a?this.readEncoded(a):-128===a&&console.warn("RLE: unsupported code!");this.segmentIndex+=1};b.RLE.prototype.readLiteral=function(a){var b=a+1;if(this.hasValidInput())for(a=0;a<b;a+=1)this.put(this.get());else console.warn("RLE: insufficient data!")};b.RLE.prototype.readEncoded=function(a){var b=1-a,d=this.get();for(a=0;a<b;a+=1)this.put(d)};b.RLE.prototype.getInt32=function(){var a=this.rawData.getInt32(this.bytesRead,
this.littleEndian);this.bytesRead+=4;return a};b.RLE.prototype.getInt16=function(){var a=this.rawData.getInt16(this.bytesRead,this.littleEndian);this.bytesRead+=2;return a};b.RLE.prototype.get=function(){var a=this.rawData.getInt8(this.bytesRead);this.bytesRead+=1;return a};b.RLE.prototype.put=function(a){this.output.setInt8(this.bytesPut,a);this.bytesPut+=1;this.segElemPut+=1};"undefined"!==typeof d&&d.exports&&(d.exports=b.RLE)},{}],37:[function(a,d,f){var b=b||{};b.Parser=b.Parser||("undefined"!==
typeof a?a("./parser.js"):null);b.Image=b.Image||("undefined"!==typeof a?a("./image.js"):null);b.OrderedMap=b.OrderedMap||("undefined"!==typeof a?a("./orderedmap.js"):null);b.OrderedMapIterator=b.OrderedMapIterator||("undefined"!==typeof a?a("./iterator.js"):null);b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.Series=b.Series||function(){this.images=[];this.imagesOriginalOrder=null;this.isCompressed=this.isElscint=this.isMosaic=!1;this.numberOfFramesInFile=this.numberOfFrames=
0;this.sliceSense=this.isImplicitTimeseries=this.isMultiFrameTimeseries=this.isMultiFrameVolume=this.isMultiFrame=!1;this.sliceDir=b.Image.SLICE_DIRECTION_UNKNOWN;this.error=null};b.Series.parserError=null;b.Series.parseImage=function(a){var d;d=new b.Parser;a=d.parse(a);return d.hasError()?(b.Series.parserError=d.error,null):a};b.Series.getMosaicOffset=function(a,b,d,f,l,q,t){b=t%a*b+l;q=(parseInt(t/a)*d+q)*f;return b+q};b.Series.orderDicoms=function(a,d,f){var k,l,q,t,y,B,A;k=null!==a[0].getImagePosition();
l=null!==a[0].getSliceLocation();q=null!==a[0].getImageNumber();a=b.Series.orderByTime(a,d,f,k,l);d=a.orderedKeys;A=[];for(t=0;t<d.length;t+=1)for(y=a.get(d[t]),B=k?b.Series.orderByImagePosition(y,f):l?b.Series.orderBySliceLocation(y):q?b.Series.orderByImageNumber(y):y,y=0;y<B.length;y+=1)A.push(B[y]);for(y=0;y<A.length;y+=1)A[y].index=y;return A};b.Series.orderByImagePosition=function(a,d){var f,k;f=new b.OrderedMap;for(k=0;k<a.length;k+=1)f.put(a[k].getImagePositionSliceDir(d),a[k]);return f.getOrderedValues()};
b.Series.orderBySliceLocation=function(a){var d,f;d=new b.OrderedMap;for(f=0;f<a.length;f+=1)d.put(a[f].getSliceLocation(),a[f]);return d.getOrderedValues()};b.Series.orderByImageNumber=function(a){var d,f;d=new b.OrderedMap;for(f=0;f<a.length;f+=1)d.put(a[f].getImageNumber(),a[f]);return d.getOrderedValues()};b.Series.hasMatchingSlice=function(a,b,d,f,l){var q=0,t,q=f?b.getImagePositionSliceDir(d):l?b.getSliceLocation():b.getImageNumber();for(b=0;b<a.length;b+=1)if(t=a[b],t=f?t.getImagePositionSliceDir(d):
l?t.getSliceLocation():t.getImageNumber(),t===q)return!0;return!1};b.Series.orderByTime=function(a,d,f,k,l){var q,t,y,B;q=new b.OrderedMap;t=1<d&&null!==a[0].getTemporalPosition();d=1<d&&null!==a[0].getTemporalNumber()&&a[0].getTemporalNumber()===d;if(t&&d)for(t=0;t<a.length;t+=1)f=a[t],k=f.getTemporalPosition(),d=q.get(k),d||(d=[],q.put(k,d)),d.push(f);else{y=new b.OrderedMap;for(t=0;t<a.length;t+=1)null!==a[t]&&(a[t].getImageNumber(),B=t,k?B=a[t].getImagePositionSliceDir(f):l&&(B=a[t].getSliceLocation()),
d=y.get(B),null===d&&(d=new b.OrderedMap,y.put(B,d)),d.put(t,a[t]));a=[];t=0;for(y=y.iterator();y.hasNext();)for(d=y.next(),d=d.iterator();d.hasNext();)a[t]=d.next(),t+=1;for(t=0;t<a.length;t+=1)if(null!==a[t]){y=null;for(B=q.iterator();B.hasNext();)if(d=B.next(),!b.Series.hasMatchingSlice(d,a[t],f,k,l)){y=d;break}null===y&&(y=[],q.put(q.orderedKeys.length,y));y.push(a[t])}}return q};b.Series.prototype.getOrder=function(){var a,b=[];for(a=0;a<this.imagesOriginalOrder.length;a+=1)b[a]=this.imagesOriginalOrder[a].index;
return b};b.Series.prototype.toString=function(){return this.images[0].getSeriesId()};b.Series.prototype.getName=function(){var a=this.images[0].getSeriesDescription(),b=this.images[0].getSeriesInstanceUID();return null!==a?a:null!==b?b:null};b.Series.prototype.addImage=function(a){this.images.push(a)};b.Series.prototype.matchesSeries=function(a){return 0===this.images.length?!0:this.images[0].getSeriesId()===a.getSeriesId()};b.Series.prototype.buildSeries=function(){var a,d,f;this.isMosaic=this.images[0].isMosaic();
this.isElscint=this.images[0].isElscint();this.isCompressed=this.images[0].isCompressed();this.numberOfFrames=this.images[0].getNumberOfFrames();this.numberOfFramesInFile=this.images[0].getNumberOfImplicitFrames();this.isMultiFrame=1<this.numberOfFrames||this.isMosaic&&1<this.images[0].length;this.isImplicitTimeseries=this.isMultiFrameTimeseries=this.isMultiFrameVolume=!1;this.isMultiFrame&&(a=0<this.images[0].getFrameTime(),this.isMosaic?this.isMultiFrameTimeseries=!0:a?this.isMultiFrameTimeseries=
!0:1<this.numberOfFramesInFile?(this.isMultiFrameTimeseries=!0,this.numberOfFrames=this.images.length):this.isMultiFrameVolume=!0);if(!this.isMosaic&&1>=this.numberOfFrames){f=this.images[0].getImagePosition()||[];d=f.toString();for(a=this.numberOfFrames=0;a<this.images.length;a+=1)f=this.images[a].getImagePosition()||[],f.toString()===d&&(this.numberOfFrames+=1);1<this.numberOfFrames&&(this.isImplicitTimeseries=!0)}this.sliceDir=this.images[0].getAcquiredSliceDirection();a=b.Series.orderDicoms(this.images,
this.numberOfFrames,this.sliceDir);d=a[0].getImagePositionSliceDir(this.sliceDir);f=a[a.length-1].getImagePositionSliceDir(this.sliceDir)-d;this.isMosaic?this.sliceSense=!0:this.isMultiFrame?(f=a[0].getSliceLocationVector(),null!==f?(d=a[0].getOrientation(),"Z"===d.charAt(2)?this.sliceSense=0>f[0]-f[f.length-1]:this.sliceSense=0<f[0]-f[f.length-1]):this.sliceSense=0>d?!1:!0):this.sliceSense=this.sliceDir===b.Image.SLICE_DIRECTION_SAGITTAL||this.sliceDir===b.Image.SLICE_DIRECTION_CORONAL?0<f?!1:!0:
0<f?!0:!1;this.imagesOriginalOrder=this.images;this.images=a};b.Series.prototype.concatenateImageData=function(a,b){var d,f,l;f=this.isMosaic?this.getMosaicData(this.images[0],this.images[0].getPixelDataBytes()):this.images[0].getPixelDataBytes();l=this.validatePixelDataLength(this.images[0]);this.images[0].clearPixelData();d=new Uint8Array(new ArrayBuffer(l*this.images.length));d.set(new Uint8Array(f,0,l),0);setTimeout(this.concatenateNextImageData(d,l,a,1,b),0)};b.Series.prototype.concatenateNextImageData=
function(a,d,f,k,l){var q,t;k>=this.images.length?(f&&f.drawProgress(1,"Reading DICOM Images"),l(a.buffer)):(f&&f.drawProgress(k/this.images.length,"Reading DICOM Images"),q=this.isMosaic?this.getMosaicData(this.images[k],this.images[k].getPixelDataBytes()):this.images[k].getPixelDataBytes(),t=this.validatePixelDataLength(this.images[k]),this.images[k].clearPixelData(),a.set(new Uint8Array(q,0,t),d*k),setTimeout(b.Utils.bind(this,function(){this.concatenateNextImageData(a,d,f,k+1,l)}),0))};b.Series.prototype.validatePixelDataLength=
function(a){var b=a.getPixelDataBytes().byteLength,d=a.getCols()*a.getRows();return 0===b%d?b:d*a.getNumberOfFrames()*a.getNumberOfSamplesPerPixel()*(a.getBitsAllocated()/8)};b.Series.prototype.getMosaicData=function(a,d){var f,k,l,q,t,y,B,A,x,I,F,z,L,n,G,K=0;t=parseInt(this.images[0].getBitsAllocated()/8);x=this.images[0].getMosaicCols()*this.images[0].getMosaicRows();I=parseInt(this.images[0].getRows()/this.images[0].getMosaicRows());F=parseInt(this.images[0].getCols()/this.images[0].getMosaicCols());
f=this.images[0].getCols();k=this.images[0].getRows();l=this.images[0].getMosaicRows();q=this.images[0].getMosaicCols();k=parseInt(k/l);l=parseInt(f/q);z=new Uint8Array(new ArrayBuffer(x*I*F*t));L=new Uint8Array(d);for(y=0;y<x;y+=1)for(B=0;B<I;B+=1)for(A=0;A<F;A+=1)for(n=b.Series.getMosaicOffset(q,l,k,f,A,B,y),G=0;G<t;G+=1)z[K]=L[n*t+G],K+=1;return z.buffer};"undefined"!==typeof d&&d.exports&&(d.exports=b.Series)},{"./image.js":31,"./iterator.js":32,"./orderedmap.js":34,"./parser.js":35,"./utilities.js":40}],
38:[function(a,d,f){var b=b||{};b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.Siemens=b.Siemens||function(a){this.output="";this.data=new DataView(a,0)};b.Siemens.CSA2_MAGIC_NUMBER=[83,86,49,48];b.Siemens.NAME_LENGTH=64;b.Siemens.ELEMENT_CSA1=4112;b.Siemens.ELEMENT_CSA2=4128;b.Siemens.GROUP_CSA=41;b.Siemens.prototype.readHeader=function(){var a,d,f;this.output+="<pre>";try{f=!0;for(d=0;d<b.Siemens.CSA2_MAGIC_NUMBER.length;d+=1)f&=this.data.getUint8(d)===b.Siemens.CSA2_MAGIC_NUMBER[d];
a=f?this.readHeaderAtOffset(b.Siemens.CSA2_MAGIC_NUMBER.length+4):this.readHeaderAtOffset(0)}catch(k){console.log(k)}this.output+="</pre>";return a};b.Siemens.prototype.readHeaderAtOffset=function(a){var d,f;this.output+="\n";d=b.Utils.swap32(this.data.getUint32(a));if(1>d||128<d)return this.output;a=a+4+4;for(f=0;f<d&&(a=this.readTag(a),-1!==a);f+=1);return this.output};b.Siemens.prototype.readTag=function(a){var d,f;d=this.readString(a,b.Siemens.NAME_LENGTH);a+=b.Siemens.NAME_LENGTH;a=a+4+4;a+=
4;f=b.Utils.swap32(this.data.getUint32(a));a+=4;a+=4;this.output+="    "+d+"=";for(d=0;d<f&&(a=this.readItem(a),-1!==a);d+=1)0!==a%4&&(a+=4-a%4);this.output+="\n";return a};b.Siemens.prototype.readString=function(a,b){var d,f,l="";for(f=0;f<b;f+=1){d=this.data.getUint8(a+f);if(0===d)break;l+=String.fromCharCode(d)}return l};b.Siemens.prototype.readItem=function(a){var d;d=b.Utils.swap32(this.data.getUint32(a));if(a+d>this.data.buffer.length)return-1;a+=16;0<d&&(this.output+=this.readString(a,d)+" ");
return a+d};b.Siemens.prototype.canRead=function(a,d){return a===b.Siemens.GROUP_CSA&&(d===b.Siemens.ELEMENT_CSA1||d===b.Siemens.ELEMENT_CSA2)};"undefined"!==typeof d&&d.exports&&(d.exports=b.Siemens)},{"./utilities.js":40}],39:[function(a,d,f){var b=b||{};b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.Dictionary=b.Dictionary||("undefined"!==typeof a?a("./dictionary.js"):null);b.Siemens=b.Siemens||("undefined"!==typeof a?a("./siemens.js"):null);b.Tag=b.Tag||function(a,d,f,k,
l,q,t,y){this.group=a;this.element=d;this.vr=f;this.offsetStart=l;this.offsetValue=q;this.offsetEnd=t;this.sublist=!1;this.id=b.Tag.createId(a,d);k instanceof Array?(this.value=k,this.sublist=!0):null!==k?(k=new DataView(k),this.value=b.Tag.convertValue(f,k,y),this.value===k&&this.isPrivateData()&&(this.value=b.Tag.convertPrivateValue(a,d,k))):this.value=null};b.Tag.PRIVATE_DATA_READERS=[b.Siemens];b.Tag.VR_AE_MAX_LENGTH=16;b.Tag.VR_AS_MAX_LENGTH=4;b.Tag.VR_AT_MAX_LENGTH=4;b.Tag.VR_CS_MAX_LENGTH=
16;b.Tag.VR_DA_MAX_LENGTH=8;b.Tag.VR_DS_MAX_LENGTH=16;b.Tag.VR_DT_MAX_LENGTH=26;b.Tag.VR_FL_MAX_LENGTH=4;b.Tag.VR_FD_MAX_LENGTH=8;b.Tag.VR_IS_MAX_LENGTH=12;b.Tag.VR_LO_MAX_LENGTH=64;b.Tag.VR_LT_MAX_LENGTH=10240;b.Tag.VR_OB_MAX_LENGTH=-1;b.Tag.VR_OD_MAX_LENGTH=-1;b.Tag.VR_OF_MAX_LENGTH=-1;b.Tag.VR_OW_MAX_LENGTH=-1;b.Tag.VR_PN_MAX_LENGTH=320;b.Tag.VR_SH_MAX_LENGTH=16;b.Tag.VR_SL_MAX_LENGTH=4;b.Tag.VR_SS_MAX_LENGTH=2;b.Tag.VR_ST_MAX_LENGTH=1024;b.Tag.VR_TM_MAX_LENGTH=16;b.Tag.VR_UI_MAX_LENGTH=64;b.Tag.VR_UL_MAX_LENGTH=
4;b.Tag.VR_UN_MAX_LENGTH=-1;b.Tag.VR_US_MAX_LENGTH=2;b.Tag.VR_UT_MAX_LENGTH=-1;b.Tag.TAG_TRANSFER_SYNTAX=[2,16];b.Tag.TAG_META_LENGTH=[2,0];b.Tag.TAG_SUBLIST_ITEM=[65534,57344];b.Tag.TAG_SUBLIST_ITEM_DELIM=[65534,57357];b.Tag.TAG_SUBLIST_SEQ_DELIM=[65534,57565];b.Tag.TAG_ROWS=[40,16];b.Tag.TAG_COLS=[40,17];b.Tag.TAG_ACQUISITION_MATRIX=[24,4880];b.Tag.TAG_NUMBER_OF_FRAMES=[40,8];b.Tag.TAG_NUMBER_TEMPORAL_POSITIONS=[32,261];b.Tag.TAG_PIXEL_SPACING=[40,48];b.Tag.TAG_SLICE_THICKNESS=[24,80];b.Tag.TAG_SLICE_GAP=
[24,136];b.Tag.TAG_TR=[24,128];b.Tag.TAG_FRAME_TIME=[24,4195];b.Tag.TAG_BITS_ALLOCATED=[40,256];b.Tag.TAG_BITS_STORED=[40,257];b.Tag.TAG_PIXEL_REPRESENTATION=[40,259];b.Tag.TAG_HIGH_BIT=[40,258];b.Tag.TAG_PHOTOMETRIC_INTERPRETATION=[40,4];b.Tag.TAG_SAMPLES_PER_PIXEL=[40,2];b.Tag.TAG_PLANAR_CONFIG=[40,6];b.Tag.TAG_PALETTE_RED=[40,4609];b.Tag.TAG_PALETTE_GREEN=[40,4610];b.Tag.TAG_PALETTE_BLUE=[40,4611];b.Tag.TAG_DATA_SCALE_SLOPE=[40,4179];b.Tag.TAG_DATA_SCALE_INTERCEPT=[40,4178];b.Tag.TAG_DATA_SCALE_ELSCINT=
[519,4127];b.Tag.TAG_PIXEL_BANDWIDTH=[24,149];b.Tag.TAG_IMAGE_MIN=[40,262];b.Tag.TAG_IMAGE_MAX=[40,263];b.Tag.TAG_WINDOW_CENTER=[40,4176];b.Tag.TAG_WINDOW_WIDTH=[40,4177];b.Tag.TAG_PATIENT_NAME=[16,16];b.Tag.TAG_PATIENT_ID=[16,32];b.Tag.TAG_STUDY_DATE=[8,32];b.Tag.TAG_STUDY_TIME=[8,48];b.Tag.TAG_STUDY_DES=[8,4144];b.Tag.TAG_IMAGE_TYPE=[8,8];b.Tag.TAG_IMAGE_COMMENTS=[32,16384];b.Tag.TAG_SEQUENCE_NAME=[24,36];b.Tag.TAG_MODALITY=[8,96];b.Tag.TAG_FRAME_OF_REF_UID=[32,82];b.Tag.TAG_STUDY_UID=[32,13];b.Tag.TAG_SERIES_DESCRIPTION=
[8,4158];b.Tag.TAG_SERIES_INSTANCE_UID=[32,14];b.Tag.TAG_SERIES_NUMBER=[32,17];b.Tag.TAG_ECHO_NUMBER=[24,134];b.Tag.TAG_TEMPORAL_POSITION=[32,256];b.Tag.TAG_IMAGE_NUM=[32,19];b.Tag.TAG_SLICE_LOCATION=[32,4161];b.Tag.TAG_IMAGE_ORIENTATION=[32,55];b.Tag.TAG_IMAGE_POSITION=[32,50];b.Tag.TAG_SLICE_LOCATION_VECTOR=[24,8197];b.Tag.TAG_PIXEL_DATA=[32736,16];b.Tag.createId=function(a,d){var f=b.Utils.dec2hex(a),k=b.Utils.dec2hex(d);return f+k};b.Tag.getUnsignedInteger16=function(a,b){var d,f,l;f=a.byteLength/
2;d=[];for(l=0;l<f;l+=1)d[l]=a.getUint16(2*l,b);return d};b.Tag.getSignedInteger16=function(a,b){var d,f,l;f=a.byteLength/2;d=[];for(l=0;l<f;l+=1)d[l]=a.getInt16(2*l,b);return d};b.Tag.getFloat32=function(a,b){var d,f,l;f=a.byteLength/4;d=[];for(l=0;l<f;l+=1)d[l]=a.getFloat32(4*l,b);return d};b.Tag.getSignedInteger32=function(a,b){var d,f,l;f=a.byteLength/4;d=[];for(l=0;l<f;l+=1)d[l]=a.getInt32(4*l,b);return d};b.Tag.getUnsignedInteger32=function(a,b){var d,f,l;f=a.byteLength/4;d=[];for(l=0;l<f;l+=
1)d[l]=a.getUint32(4*l,b);return d};b.Tag.getFloat64=function(a,b){var d,f,l;f=a.byteLength/8;d=[];for(l=0;l<f;l+=1)d[l]=a.getFloat64(8*l,b);return d};b.Tag.getDoubleElscint=function(a){var d=[],f=[],k;for(k=0;8>k;k+=1)d[k]=a.getUint8(k);f[0]=d[3];f[1]=d[2];f[2]=d[1];f[3]=d[0];f[4]=d[7];f[5]=d[6];f[6]=d[5];f[7]=d[4];return d=[b.Utils.bytesToDouble(f)]};b.Tag.getFixedLengthStringValue=function(a,d){var f,k,l;k=Math.floor(a.byteLength/d);f=[];for(l=0;l<k;l+=1)f[l]=b.Utils.getStringAt(a,l*d,d);return f};
b.Tag.getStringValue=function(a){a=b.Utils.getStringAt(a,0,a.byteLength).split("\\");var d;for(d=0;d<a.length;d+=1)a[d]=b.Utils.trim(a[d]);return a};b.Tag.getDateStringValue=function(a){var d=-1!==b.Tag.getSingleStringValue(a)[0].indexOf(".");a=b.Tag.getFixedLengthStringValue(a,d?10:b.Tag.VR_DA_MAX_LENGTH);var f=null,k=[],l;for(l=0;l<a.length;l+=1)d?(f=a[l].split("."),k[l]=3===f.length?new Date(b.Utils.safeParseInt(f[0]),b.Utils.safeParseInt(f[1])-1,b.Utils.safeParseInt(f[2])):new Date):k[l]=8===
a[l].length?new Date(b.Utils.safeParseInt(a[l].substring(0,4)),b.Utils.safeParseInt(a[l].substring(4,6))-1,b.Utils.safeParseInt(a[l].substring(6,8))):Date.parse(a[l]);return k};b.Tag.getDateTimeStringValue=function(a){a=b.Tag.getStringValue(a);var d=[],f,k=null,l=null,q=null,t=null,y=null,B=null;for(f=0;f<a.length;f+=1)4<=a[f].length?(k=parseInt(a[f].substring(0,4),10),6<=a[f].length&&(l=b.Utils.safeParseInt(a[f].substring(4,6))-1),8<=a[f].length&&(q=b.Utils.safeParseInt(a[f].substring(6,8))),10<=
a[f].length&&(t=b.Utils.safeParseInt(a[f].substring(8,10))),12<=a[f].length&&(y=b.Utils.safeParseInt(a[f].substring(10,12))),14<=a[f].length&&(B=b.Utils.safeParseInt(a[f].substring(12,14))),d[f]=new Date(k,l,q,t,y,B)):d[f]=Date.parse(a[f]);return d};b.Tag.getTimeStringValue=function(a){a=b.Tag.getStringValue(a);var d=[],f=null,k,l=0,q=0,t=0;for(k=0;k<a.length;k+=1)-1!==a[k].indexOf(":")?(f=a[k].split(":"),l=b.Utils.safeParseInt(f[0]),1<f.length&&(q=b.Utils.safeParseInt(f[1])),2<f.length&&(t=b.Utils.safeParseFloat(f[2]))):
(2<=a[k].length&&(l=b.Utils.safeParseInt(a[k].substring(0,2))),4<=a[k].length&&(q=b.Utils.safeParseInt(a[k].substring(2,4))),6<=a[k].length&&(t=b.Utils.safeParseFloat(a[k].substring(4)))),d[k]=Math.round(36E5*l+6E4*q+1E3*t);return d};b.Tag.getDoubleStringValue=function(a){a=b.Tag.getStringValue(a);var d=[],f;for(f=0;f<a.length;f+=1)d[f]=parseFloat(a[f]);return d};b.Tag.getIntegerStringValue=function(a){a=b.Tag.getStringValue(a);var d=[],f;for(f=0;f<a.length;f+=1)d[f]=parseInt(a[f],10);return d};b.Tag.getSingleStringValue=
function(a){return[b.Utils.trim(b.Utils.getStringAt(a,0,a.byteLength))]};b.Tag.getPersonNameStringValue=function(a){a=b.Tag.getStringValue(a);var d=[],f;for(f=0;f<a.length;f+=1)d[f]=a[f].replace("^"," ");return d};b.Tag.convertPrivateValue=function(a,d,f){var k,l;for(k=0;k<b.Tag.PRIVATE_DATA_READERS.length;k+=1)if(l=new b.Tag.PRIVATE_DATA_READERS[k](f.buffer),l.canRead(a,d))return l.readHeader();return f};b.Tag.convertValue=function(a,d,f){var k=null;"AE"===a?k=b.Tag.getSingleStringValue(d,b.Tag.VR_AE_MAX_LENGTH):
"AS"===a?k=b.Tag.getFixedLengthStringValue(d,b.Tag.VR_AS_MAX_LENGTH):"AT"===a?k=b.Tag.getUnsignedInteger16(d,f):"CS"===a?k=b.Tag.getStringValue(d):"DA"===a?k=b.Tag.getDateStringValue(d):"DS"===a?k=b.Tag.getDoubleStringValue(d):"DT"===a?k=b.Tag.getDateTimeStringValue(d):"FL"===a?k=b.Tag.getFloat32(d,f):"FD"===a?k=b.Tag.getFloat64(d,f):"FE"===a?k=b.Tag.getDoubleElscint(d,f):"IS"===a?k=b.Tag.getIntegerStringValue(d):"LO"===a?k=b.Tag.getStringValue(d):"LT"===a?k=b.Tag.getSingleStringValue(d):"OB"===a?
k=d:"OD"===a?k=d:"OF"===a?k=d:"OW"===a?k=d:"PN"===a?k=b.Tag.getPersonNameStringValue(d):"SH"===a?k=b.Tag.getStringValue(d):"SL"===a?k=b.Tag.getSignedInteger32(d,f):"SQ"===a?k=null:"SS"===a?k=b.Tag.getSignedInteger16(d,f):"ST"===a?k=b.Tag.getSingleStringValue(d):"TM"===a?k=b.Tag.getTimeStringValue(d):"UI"===a?k=b.Tag.getStringValue(d):"UL"===a?k=b.Tag.getUnsignedInteger32(d,f):"UN"===a?k=d:"US"===a?k=b.Tag.getUnsignedInteger16(d,f):"UT"===a&&(k=b.Tag.getSingleStringValue(d));return k};b.Tag.prototype.toString=
function(a,d){var f="",k;k=b.Utils.dec2hex(this.group);var l=b.Utils.dec2hex(this.element),l="("+k+","+l+")",q="",t;void 0===a&&(a=0);t="";for(k=0;k<a;k+=1)t=d?t+"&nbsp;&nbsp;":t+"  ";if(this.sublist)for(k=0;k<this.value.length;k+=1)f+="\n"+this.value[k].toString(a+1,d);else f="SQ"===this.vr?"":this.isPixelData()?"":this.value?"["+this.value+"]":"";this.isSublistItem()?l="Sequence Item":this.isSublistItemDelim()?l="Sequence Item Delimiter":this.isSequenceDelim()?l="Sequence Delimiter":this.isPixelData()?
l="Pixel Data":q=b.Utils.convertCamcelCaseToTitleCase(b.Dictionary.getDescription(this.group,this.element));return d?t+"<span style='color:#B5CBD3'>"+l+"</span>&nbsp;&nbsp;&nbsp;"+q+"&nbsp;&nbsp;&nbsp;"+f:t+" "+l+" "+q+" "+f};b.Tag.prototype.toHTMLString=function(a){return this.toString(a,!0)};b.Tag.prototype.isTransformSyntax=function(){return this.group===b.Tag.TAG_TRANSFER_SYNTAX[0]&&this.element===b.Tag.TAG_TRANSFER_SYNTAX[1]};b.Tag.prototype.isPixelData=function(){return this.group===b.Tag.TAG_PIXEL_DATA[0]&&
this.element===b.Tag.TAG_PIXEL_DATA[1]};b.Tag.prototype.isPrivateData=function(){return 1===(this.group&1)};b.Tag.prototype.hasInterpretedPrivateData=function(){return this.isPrivateData()&&b.Utils.isString(this.value)};b.Tag.prototype.isSublistItem=function(){return this.group===b.Tag.TAG_SUBLIST_ITEM[0]&&this.element===b.Tag.TAG_SUBLIST_ITEM[1]};b.Tag.prototype.isSublistItemDelim=function(){return this.group===b.Tag.TAG_SUBLIST_ITEM_DELIM[0]&&this.element===b.Tag.TAG_SUBLIST_ITEM_DELIM[1]};b.Tag.prototype.isSequenceDelim=
function(){return this.group===b.Tag.TAG_SUBLIST_SEQ_DELIM[0]&&this.element===b.Tag.TAG_SUBLIST_SEQ_DELIM[1]};b.Tag.prototype.isMetaLength=function(){return this.group===b.Tag.TAG_META_LENGTH[0]&&this.element===b.Tag.TAG_META_LENGTH[1]};"undefined"!==typeof d&&d.exports&&(d.exports=b.Tag)},{"./dictionary.js":30,"./siemens.js":38,"./utilities.js":40}],40:[function(a,d,f){var b=b||{};b.Utils=b.Utils||{};b.Utils.crcTable=null;b.Utils.MAX_VALUE=9007199254740991;b.Utils.MIN_VALUE=-9007199254740991;b.Utils.dec2hex=
function(a){return(a+65536).toString(16).substr(-4).toUpperCase()};b.Utils.createArray=function(a){var d=Array(a||0),f=a;if(1<arguments.length)for(var k=Array.prototype.slice.call(arguments,1);f--;)d[a-1-f]=b.Utils.createArray.apply(this,k);return d};b.Utils.getStringAt=function(a,b,d){var f="",l,q;for(l=0;l<d;l+=1)q=a.getUint8(b+l),0!==q&&(f+=String.fromCharCode(q));return f};b.Utils.trim=function(a){return a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};b.Utils.stripLeadingZeros=function(a){return a.replace(/^[0]+/g,
"")};b.Utils.safeParseInt=function(a){a=b.Utils.stripLeadingZeros(a);return 0<a.length?parseInt(a,10):0};b.Utils.convertCamcelCaseToTitleCase=function(a){a=a.replace(/([A-Z][a-z])/g," $1");return b.Utils.trim(a.charAt(0).toUpperCase()+a.slice(1))};b.Utils.safeParseFloat=function(a){a=b.Utils.stripLeadingZeros(a);return 0<a.length?parseFloat(a):0};b.Utils.bytesToDouble=function(a){var b=(a[0]&128)>>7,d=(a[0]&127)<<4|(a[1]&240)>>4;if(0==d)return 0;if(2047==d)return b?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;
d=Math.pow(2,d-1023-52);a=a[7]+a[6]*Math.pow(2,8)+a[5]*Math.pow(2,16)+a[4]*Math.pow(2,24)+a[3]*Math.pow(2,32)+a[2]*Math.pow(2,40)+(a[1]&15)*Math.pow(2,48)+Math.pow(2,52);return Math.pow(-1,b)*a*d};b.Utils.concatArrayBuffers=function(a,b){var d=new Uint8Array(a.byteLength+b.byteLength);d.set(new Uint8Array(a),0);d.set(new Uint8Array(b),a.byteLength);return d.buffer};b.Utils.concatArrayBuffers2=function(a){var b=0,d=0,f;for(f=0;f<a.length;f+=1)b+=a[f].byteLength;b=new Uint8Array(b);for(f=0;f<a.length;f+=
1)b.set(new Uint8Array(a[f]),d),d+=a[f].byteLength;return b.buffer};b.Utils.fillBuffer=function(a,b,d,f){if(1===f)for(f=0;f<a.length;f+=1)b.setUint8(d+f,a[f]);else if(2===f)for(f=0;f<a.length;f+=1)b.setUint16(d+2*f,a[f],!0)};b.Utils.fillBufferRGB=function(a,b,d){var f,l,q,t,y=parseInt(a.length/3);for(t=0;t<y;t+=1)f=a[3*t],l=a[3*t+1],q=a[3*t+2],b.setUint8(d+t,parseInt((f+q+l)/3),!0)};b.Utils.bind=function(a,b,d,f){if(2===arguments.length)return function(){return b.apply(a,arguments)};var l=Array.prototype.slice;
return function(){var q=d||arguments;!0===f?(q=l.call(arguments,0),q=q.concat(d)):"number"===typeof f&&(q=l.call(arguments,0),Ext.Array.insert(q,f,d));return b.apply(a||window,q)}};b.Utils.toArrayBuffer=function(a){var b,d,f;b=new ArrayBuffer(a.length);d=new Uint8Array(b);for(f=0;f<a.length;f+=1)d[f]=a[f];return b};b.Utils.isString=function(a){return"string"===typeof a||a instanceof String};b.Utils.swap32=function(a){return(a&255)<<24|(a&65280)<<8|a>>8&65280|a>>24&255};b.Utils.swap16=function(a){return((a&
255)<<8|a>>8&255)<<16>>16};b.Utils.makeCRCTable=function(){for(var a,b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>>1:a>>>1;b[d]=a}return b};b.Utils.crc32=function(a){for(var d=b.Utils.crcTable||(b.Utils.crcTable=b.Utils.makeCRCTable()),f=-1,k=0;k<a.byteLength;k++)f=f>>>8^d[(f^a.getUint8(k))&255];return(f^-1)>>>0};b.Utils.createBitMask=function(a,b,d){b=4294967295>>>8*(4-a)+(8*a-b);d?1==a?b&=255:2==a?b&=65535:4==a?b&=4294967295:8==a&&(b=4294967295):b=4294967295;return b};"undefined"!==
typeof d&&d.exports&&(d.exports=b.Utils)},{}]},{},[33])(33)});
var Base64Binary={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",decodeArrayBuffer:function(c){var a=this._keyStr.indexOf(c.charAt(c.length-1)),d=this._keyStr.indexOf(c.charAt(c.length-2)),f=c.length/4*3;64==a&&f--;64==d&&f--;a=new ArrayBuffer(f);this.decode(c,a,f);return a},decode:function(c,a,d){var f,b,e,h,g,k=0,l=0;a=a?new Uint8Array(a):new Uint8Array(d);c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(k=0;k<d;k+=3)f=this._keyStr.indexOf(c.charAt(l++)),b=this._keyStr.indexOf(c.charAt(l++)),
h=this._keyStr.indexOf(c.charAt(l++)),g=this._keyStr.indexOf(c.charAt(l++)),f=f<<2|b>>4,b=(b&15)<<4|h>>2,e=(h&3)<<6|g,a[k]=f,64!=h&&(a[k+1]=b),64!=g&&(a[k+2]=e);return a}};
!function(c,a){"undefined"!=typeof module&&module.exports?module.exports.browser=a():"function"==typeof define?define(a):this[c]=a()}("bowser",function(){function c(a,c,d){return(a=a.match(c))&&a.length>d&&a[d]||0}function a(a){var e=/(msie|trident)/i.test(a),f=/chrome|crios/i.test(a),g=/phantom/i.test(a),k=/iphone/i.test(a),l=/ipad/i.test(a),q=/ipod/i.test(a),t=/touchpad/i.test(a),y=/silk/i.test(a),B=/safari/i.test(a)&&!f&&!g&&!y,A=/android/i.test(a),x=/opera/i.test(a)||/opr/i.test(a),I=/firefox/i.test(a),
F=/gecko\//i.test(a),z=/seamonkey\//i.test(a),L=/webos/i.test(a),n=/windows phone/i.test(a),G=/blackberry/i.test(a),K=/version\/(\d+(\.\d+)?)/i,E=/firefox[ \/](\d+(\.\d+)?)/i,w={};q&&(k=!1);if(n)w={name:"Windows Phone",windowsphone:!0,msie:!0,mobile:!0,version:c(a,/iemobile\/(\d+(\.\d+)?)/i,1)};else if(x)d=c(a,K,1)||c(a,/opr\/(\d+(\.\d+)?)/i,1)||c(a,/opera[ \/](\d+(\.\d+)?)/i,1),w={name:"Opera",opera:!0,version:d},A&&(w.android=!0,w.mobile=!0),f&&(w.webkit=!0);else if(e)w={name:"Internet Explorer",
msie:!0,version:c(a,/(msie |rv:)(\d+(\.\d+)?)/i,2)};else if(f){w={name:"Chrome",webkit:!0,chrome:!0,version:c(a,/(?:chrome|crios)\/(\d+(\.\d+)?)/i,1)};A&&(w.android=!0);if(l||q||k)w[k?"iphone":l?"ipad":"ipod"]=!0,w.ios=!0;if(w.android||w.ios)w.mobile=!0}else g?w={name:"PhantomJS",webkit:!0,phantom:!0,version:c(a,/phantomjs\/(\d+(\.\d+)?)/i,1)}:t?w={name:"TouchPad",webkit:!0,touchpad:!0,version:c(a,/touchpad\/(\d+(\.\d+)?)/i,1)}:y?w={name:"Amazon Silk",webkit:!0,android:!0,mobile:!0,version:c(a,/silk\/(\d+(\.\d+)?)/i,
1)}:k||l||q?(w={name:k?"iPhone":l?"iPad":"iPod",webkit:!0,mobile:!0,ios:!0},w[k?"iphone":l?"ipad":"ipod"]=!0,K.test(a)&&(w.version=c(a,K,1))):G?(w={name:"BlackBerry",blackberry:!0,mobile:!0},(d=c(a,K,1))?(w.version=d,w.webkit=!0):w.version=c(a,/blackberry[\d]+\/(\d+(\.\d+)?)/i,1)):L?w={name:"WebOS",mobile:!0,webkit:!0,webos:!0,version:c(a,K,1)||c(a,/wosbrowser\/(\d+(\.\d+)?)/i,1)}:F?(w={name:"Gecko",gecko:!0,mozilla:!0,version:c(a,E,1)},z?(w.name="SeaMonkey",w.seamonkey=!0,w.version=c(a,/seamonkey\/(\d+(\.\d+)?)/i,
1)):I&&(w.name="Firefox",w.firefox=!0),A?(w.android=!0,w.mobile=!0):!A&&I&&/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(a)&&(w.firefoxos=!0,w.mobile=!0)):A?w={name:"Android",webkit:!0,android:!0,mobile:!0,version:c(a,K,1)}:B&&(w={name:"Safari",webkit:!0,safari:!0,version:c(a,K,1)});if(A){if(a=c(a,/android[ \/](\d+(\.\d+)*)/i,1))w.osversion=a}else if(k||l||q){if(a=c(a,/os (\d+([_\s]\d+)*) like mac os x/i,1))w.osversion=a.replace(/[_\s]/g,".")}else n&&(a=c(a,/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,
1))&&(w.osversion=a);w.msie&&9<=w.version||w.chrome&&20<=w.version||w.firefox&&10<=w.version||w.safari&&5<=w.version||w.opera&&10<=w.version||w.ios&&w.osversion&&6<=w.osversion.split(".")[0]?w.a=!0:w.msie&&9>w.version||w.chrome&&20>w.version||w.firefox&&10>w.version||w.safari&&5>w.version||w.opera&&10>w.version||w.ios&&w.osversion&&6>w.osversion.split(".")[0]?w.c=!0:w.x=!0;return w}var d,f=a("undefined"!==typeof navigator?navigator.userAgent:"");f._detect=a;return f});"use strict";
var numeric={inv:function(c){var a=numeric.dim(c),d=Math.abs,f=a[0],a=a[1],b=c.clone(),e,h,g=numeric.identity(f),k,l,q,t,y;for(t=0;t<a;++t){h=c=-1;for(q=t;q!==f;++q)y=d(b[q][t]),y>h&&(c=q,h=y);h=b[c];b[c]=b[t];b[t]=h;l=g[c];g[c]=g[t];g[t]=l;c=h[t];for(y=t;y!==a;++y)h[y]/=c;for(y=a-1;-1!==y;--y)l[y]/=c;for(q=f-1;-1!==q;--q)if(q!==t){e=b[q];k=g[q];c=e[t];for(y=t+1;y!==a;++y)e[y]-=h[y]*c;for(y=a-1;0<y;--y)k[y]-=l[y]*c,--y,k[y]-=l[y]*c;0===y&&(k[0]-=l[0]*c)}}return g},dim:function(c){var a,d;return"object"===
typeof c?(a=c[0],"object"===typeof a?(d=a[0],"object"===typeof d?numeric._dim(c):[c.length,a.length]):[c.length]):[]},_dim:function(c){for(var a=[];"object"===typeof c;)a.push(c.length),c=c[0];return a},identity:function(c){return numeric.diag(numeric.rep([c],1))},rep:function(c,a,d){"undefined"===typeof d&&(d=0);var f=c[d],b=Array(f);if(d===c.length-1){for(f-=2;0<=f;f-=2)b[f+1]=a,b[f]=a;-1===f&&(b[0]=a);return b}for(--f;0<=f;f--)b[f]=numeric.rep(c,a,d+1);return b},diag:function(c){var a,d,f,b=c.length,
e=Array(b),h;for(a=b-1;0<=a;a--){h=Array(b);d=a+2;for(f=b-1;f>=d;f-=2)h[f]=0,h[f-1]=0;f>a&&(h[f]=0);h[a]=c[a];for(f=a-1;1<=f;f-=2)h[f]=0,h[f-1]=0;0===f&&(h[0]=0);e[a]=h}return e}};
!function(c){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=c();else if("function"==typeof define&&define.amd)define([],c);else{var a;"undefined"!=typeof window?a=window:"undefined"!=typeof global?a=global:"undefined"!=typeof self&&(a=self);a.pako=c()}}(function(){return function a(d,f,b){function e(g,l){if(!f[g]){if(!d[g]){var q="function"==typeof require&&require;if(!l&&q)return q(g,!0);if(h)return h(g,!0);throw Error("Cannot find module '"+g+"'");}q=f[g]={exports:{}};d[g][0].call(q.exports,
function(a){var b=d[g][1][a];return e(b?b:a)},q,q.exports,a,d,f,b)}return f[g].exports}for(var h="function"==typeof require&&require,g=0;g<b.length;g++)e(b[g]);return e}({1:[function(a,d,f){function b(a,b,d,e){b=new y(b);b.onFinish=e;b.push(a,!0,d)}var e=a("./zlib/inflate.js"),h=a("./utils/common"),g=a("./utils/strings"),k=a("./zlib/constants"),l=a("./zlib/messages"),q=a("./zlib/zstream"),t=a("./zlib/gzheader"),y=function(a){var b=this.options=h.assign({chunkSize:16384,windowBits:0,to:""},a||{});
b.raw&&0<=b.windowBits&&16>b.windowBits&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowBits=-15));!(0<=b.windowBits&&16>b.windowBits)||a&&a.windowBits||(b.windowBits+=32);15<b.windowBits&&48>b.windowBits&&0===(b.windowBits&15)&&(b.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new q;this.strm.avail_out=0;a=e.inflateInit2(this.strm,b.windowBits);if(a!==k.Z_OK)throw Error(l[a]);this.header=new t;e.inflateGetHeader(this.strm,this.header)};y.prototype.push=function(a,
b,d){var e=this.strm;b=this.options.chunkSize;if(this.ended)return!1;e.input="string"===typeof a?g.binstring2buf(a):a;e.next_in=0;e.avail_in=e.input.length;a=(new DataView(a.buffer)).getUint32(a.byteLength-4,!0);this.progressMeter=d;this.progressIterations=a/b;this.progressIndex=0;this.progressNextGoal=.25;this.progressMeter&&this.progressMeter.drawProgress(.1,"Unpacking");setTimeout(this.pushProcess.bind(this),0)};y.prototype.pushProcess=function(){var a=this.strm,b=this.options.chunkSize,d,f,g;
do{0===a.avail_out&&(a.output=new h.Buf8(b),a.next_out=0,a.avail_out=b);d=e.inflate(a,k.Z_NO_FLUSH);if(d!==k.Z_STREAM_END&&d!==k.Z_OK)return this.onEnd(d),this.ended=!0,!1;if(a.next_out&&(0===a.avail_out||d===k.Z_STREAM_END||0===a.avail_in&&f===k.Z_FINISH))this.onData(h.shrinkBuf(a.output,a.next_out));this.progressIndex+=1;g=this.progressIndex/this.progressIterations;this.progressMeter&&this.progressMeter.drawProgress(g,"Unpacking")}while(g<this.progressNextGoal&&(0<a.avail_in||0===a.avail_out)&&
d!==k.Z_STREAM_END);(0<a.avail_in||0===a.avail_out)&&d!==k.Z_STREAM_END?(this.progressNextGoal+=.1,setTimeout(this.pushProcess.bind(this),0)):(d===k.Z_STREAM_END&&(f=k.Z_FINISH),f===k.Z_FINISH&&(d=e.inflateEnd(this.strm),this.onEnd(d),this.ended=!0),this.onFinish(this.result))};y.prototype.onData=function(a){this.chunks.push(a)};y.prototype.onEnd=function(a){a===k.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):h.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};
f.Inflate=y;f.inflate=b;f.inflateRaw=function(a,d){d=d||{};d.raw=!0;return b(a,d)};f.ungzip=b},{"./utils/common":2,"./utils/strings":3,"./zlib/constants":5,"./zlib/gzheader":7,"./zlib/inflate.js":9,"./zlib/messages":11,"./zlib/zstream":12}],2:[function(a,d,f){a="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;f.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var d=b.shift();if(d){if("object"!==typeof d)throw new TypeError(d+
"must be non-object");for(var e in d)d.hasOwnProperty(e)&&(a[e]=d[e])}}return a};f.shrinkBuf=function(a,b){if(a.length===b)return a;if(a.subarray)return a.subarray(0,b);a.length=b;return a};var b={arraySet:function(a,b,d,e,f){if(b.subarray&&a.subarray)a.set(b.subarray(d,d+e),f);else for(var t=0;t<e;t++)a[f+t]=b[d+t]},flattenChunks:function(a){var b,d,e,f,t;b=e=0;for(d=a.length;b<d;b++)e+=a[b].length;t=new Uint8Array(e);b=e=0;for(d=a.length;b<d;b++)f=a[b],t.set(f,e),e+=f.length;return t}},e={arraySet:function(a,
b,d,e,f){for(var t=0;t<e;t++)a[f+t]=b[d+t]},flattenChunks:function(a){return[].concat.apply([],a)}};f.setTyped=function(a){a?(f.Buf8=Uint8Array,f.Buf16=Uint16Array,f.Buf32=Int32Array,f.assign(f,b)):(f.Buf8=Array,f.Buf16=Array,f.Buf32=Array,f.assign(f,e))};f.setTyped(a)},{}],3:[function(a,d,f){function b(a,b){if(65537>b&&(a.subarray&&g||!a.subarray&&h))return String.fromCharCode.apply(null,e.shrinkBuf(a,b));for(var d="",f=0;f<b;f++)d+=String.fromCharCode(a[f]);return d}var e=a("./common"),h=!0,g=!0;
try{String.fromCharCode.apply(null,[0])}catch(k){h=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(l){g=!1}var q=new e.Buf8(256);for(a=0;256>a;a++)q[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;q[254]=q[254]=1;f.string2buf=function(a){var b,d,f,h,g,k=a.length,l=0;for(h=0;h<k;h++)d=a.charCodeAt(h),55296===(d&64512)&&h+1<k&&(f=a.charCodeAt(h+1),56320===(f&64512)&&(d=65536+(d-55296<<10)+(f-56320),h++)),l+=128>d?1:2048>d?2:65536>d?3:4;b=new e.Buf8(l);for(h=g=0;g<l;h++)d=a.charCodeAt(h),
55296===(d&64512)&&h+1<k&&(f=a.charCodeAt(h+1),56320===(f&64512)&&(d=65536+(d-55296<<10)+(f-56320),h++)),128>d?b[g++]=d:(2048>d?b[g++]=192|d>>>6:(65536>d?b[g++]=224|d>>>12:(b[g++]=240|d>>>18,b[g++]=128|d>>>12&63),b[g++]=128|d>>>6&63),b[g++]=128|d&63);return b};f.buf2binstring=function(a){return b(a,a.length)};f.binstring2buf=function(a){for(var b=new e.Buf8(a.length),d=0,f=b.length;d<f;d++)b[d]=a.charCodeAt(d);return b};f.buf2string=function(a,d){var e,f,h,g,k=d||a.length,l=Array(2*k);for(e=f=0;e<
k;)if(h=a[e++],128>h)l[f++]=h;else if(g=q[h],4<g)l[f++]=65533,e+=g-1;else{for(h&=2===g?31:3===g?15:7;1<g&&e<k;)h=h<<6|a[e++]&63,g--;1<g?l[f++]=65533:65536>h?l[f++]=h:(h-=65536,l[f++]=55296|h>>10&1023,l[f++]=56320|h&1023)}return b(l,f)};f.utf8border=function(a,b){var d;b=b||a.length;b>a.length&&(b=a.length);for(d=b-1;0<=d&&128===(a[d]&192);)d--;return 0>d||0===d?b:d+q[a[d]]>b?d:b}},{"./common":2}],4:[function(a,d,f){d.exports=function(a,d,f,g){var k=a&65535|0;a=a>>>16&65535|0;for(var l=0;0!==f;){l=
2E3<f?2E3:f;f-=l;do k=k+d[g++]|0,a=a+k|0;while(--l);k%=65521;a%=65521}return k|a<<16|0}},{}],5:[function(a,d,f){d.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}},
{}],6:[function(a,d,f){var b=function(){for(var a,b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>>1:a>>>1;b[d]=a}return b}();d.exports=function(a,d,f,k){f=k+f;for(a^=-1;k<f;k++)a=a>>>8^b[(a^d[k])&255];return a^-1}},{}],7:[function(a,d,f){d.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}},{}],8:[function(a,d,f){d.exports=function(a,d){var f,g,k,l,q,t,y,B,A,x,I,F,z,L,n,G,K,E,w,D,u,m,p,
J;f=a.state;g=a.next_in;p=a.input;k=g+(a.avail_in-5);l=a.next_out;J=a.output;q=l-(d-a.avail_out);t=l+(a.avail_out-257);y=f.dmax;B=f.wsize;A=f.whave;x=f.wnext;I=f.window;F=f.hold;z=f.bits;L=f.lencode;n=f.distcode;G=(1<<f.lenbits)-1;K=(1<<f.distbits)-1;a:do b:for(15>z&&(F+=p[g++]<<z,z+=8,F+=p[g++]<<z,z+=8),E=L[F&G];;){w=E>>>24;F>>>=w;z-=w;w=E>>>16&255;if(0===w)J[l++]=E&65535;else if(w&16){D=E&65535;if(w&=15)z<w&&(F+=p[g++]<<z,z+=8),D+=F&(1<<w)-1,F>>>=w,z-=w;15>z&&(F+=p[g++]<<z,z+=8,F+=p[g++]<<z,z+=
8);E=n[F&K];c:for(;;){w=E>>>24;F>>>=w;z-=w;w=E>>>16&255;if(w&16){E&=65535;w&=15;z<w&&(F+=p[g++]<<z,z+=8,z<w&&(F+=p[g++]<<z,z+=8));E+=F&(1<<w)-1;if(E>y){a.msg="invalid distance too far back";f.mode=30;break a}F>>>=w;z-=w;w=l-q;if(E>w){w=E-w;if(w>A&&f.sane){a.msg="invalid distance too far back";f.mode=30;break a}u=0;m=I;if(0===x){if(u+=B-w,w<D){D-=w;do J[l++]=I[u++];while(--w);u=l-E;m=J}}else if(x<w){if(u+=B+x-w,w-=x,w<D){D-=w;do J[l++]=I[u++];while(--w);u=0;if(x<D){w=x;D-=w;do J[l++]=I[u++];while(--w);
u=l-E;m=J}}}else if(u+=x-w,w<D){D-=w;do J[l++]=I[u++];while(--w);u=l-E;m=J}for(;2<D;)J[l++]=m[u++],J[l++]=m[u++],J[l++]=m[u++],D-=3;D&&(J[l++]=m[u++],1<D&&(J[l++]=m[u++]))}else{u=l-E;do J[l++]=J[u++],J[l++]=J[u++],J[l++]=J[u++],D-=3;while(2<D);D&&(J[l++]=J[u++],1<D&&(J[l++]=J[u++]))}}else if(0===(w&64)){E=n[(E&65535)+(F&(1<<w)-1)];continue c}else{a.msg="invalid distance code";f.mode=30;break a}break}}else if(0===(w&64)){E=L[(E&65535)+(F&(1<<w)-1)];continue b}else{w&32?f.mode=12:(a.msg="invalid literal/length code",
f.mode=30);break a}break}while(g<k&&l<t);D=z>>3;g-=D;z-=D<<3;a.next_in=g;a.next_out=l;a.avail_in=g<k?5+(k-g):5-(g-k);a.avail_out=l<t?257+(t-l):257-(l-t);f.hold=F&(1<<z)-1;f.bits=z}},{}],9:[function(a,d,f){function b(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 q.Buf16(320);this.work=new q.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function h(a){var b;if(!a||!a.state)return-2;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 q.Buf32(852);b.distcode=b.distdyn=
new q.Buf32(592);b.sane=1;b.back=-1;return 0}function g(a){var b;if(!a||!a.state)return-2;b=a.state;b.wsize=0;b.whave=0;b.wnext=0;return h(a)}function k(a,b){var d,e;if(!a||!a.state)return-2;e=a.state;0>b?(d=0,b=-b):(d=(b>>4)+1,48>b&&(b&=15));if(b&&(8>b||15<b))return-2;null!==e.window&&e.wbits!==b&&(e.window=null);e.wrap=d;e.wbits=b;return g(a)}function l(a,b){var d;if(!a)return-2;d=new e;a.state=d;d.window=null;d=k(a,b);0!==d&&(a.state=null);return d}var q=a("../utils/common"),t=a("./adler32"),y=
a("./crc32"),B=a("./inffast"),A=a("./inftrees"),x=!0,I,F;f.inflateReset=g;f.inflateReset2=k;f.inflateResetKeep=h;f.inflateInit=function(a){return l(a,15)};f.inflateInit2=l;f.inflate=function(a,d){var e,f,h,g,k,l,u,m,p,J,H,v,C,P,M=0,R,T,O,Q=new q.Buf8(4),U=[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;e=a.state;12===e.mode&&(e.mode=13);k=a.next_out;h=a.output;u=a.avail_out;g=a.next_in;f=a.input;l=a.avail_in;m=e.hold;p=e.bits;J=l;H=u;
O=0;a:for(;;)switch(e.mode){case 1:if(0===e.wrap){e.mode=13;break}for(;16>p;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}if(e.wrap&2&&35615===m){e.check=0;Q[0]=m&255;Q[1]=m>>>8&255;e.check=y(e.check,Q,2,0);p=m=0;e.mode=2;break}e.flags=0;e.head&&(e.head.done=!1);if(!(e.wrap&1)||(((m&255)<<8)+(m>>8))%31){a.msg="incorrect header check";e.mode=30;break}if(8!==(m&15)){a.msg="unknown compression method";e.mode=30;break}m>>>=4;p-=4;C=(m&15)+8;if(0===e.wbits)e.wbits=C;else if(C>e.wbits){a.msg="invalid window size";
e.mode=30;break}e.dmax=1<<C;a.adler=e.check=1;e.mode=m&512?10:12;p=m=0;break;case 2:for(;16>p;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}e.flags=m;if(8!==(e.flags&255)){a.msg="unknown compression method";e.mode=30;break}if(e.flags&57344){a.msg="unknown header flags set";e.mode=30;break}e.head&&(e.head.text=m>>8&1);e.flags&512&&(Q[0]=m&255,Q[1]=m>>>8&255,e.check=y(e.check,Q,2,0));p=m=0;e.mode=3;case 3:for(;32>p;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}e.head&&(e.head.time=m);e.flags&512&&(Q[0]=m&255,
Q[1]=m>>>8&255,Q[2]=m>>>16&255,Q[3]=m>>>24&255,e.check=y(e.check,Q,4,0));p=m=0;e.mode=4;case 4:for(;16>p;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}e.head&&(e.head.xflags=m&255,e.head.os=m>>8);e.flags&512&&(Q[0]=m&255,Q[1]=m>>>8&255,e.check=y(e.check,Q,2,0));p=m=0;e.mode=5;case 5:if(e.flags&1024){for(;16>p;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}e.length=m;e.head&&(e.head.extra_len=m);e.flags&512&&(Q[0]=m&255,Q[1]=m>>>8&255,e.check=y(e.check,Q,2,0));p=m=0}else e.head&&(e.head.extra=null);e.mode=6;
case 6:if(e.flags&1024&&(v=e.length,v>l&&(v=l),v&&(e.head&&(C=e.head.extra_len-e.length,e.head.extra||(e.head.extra=Array(e.head.extra_len)),q.arraySet(e.head.extra,f,g,v,C)),e.flags&512&&(e.check=y(e.check,f,v,g)),l-=v,g+=v,e.length-=v),e.length))break a;e.length=0;e.mode=7;case 7:if(e.flags&2048){if(0===l)break a;v=0;do C=f[g+v++],e.head&&C&&65536>e.length&&(e.head.name+=String.fromCharCode(C));while(C&&v<l);e.flags&512&&(e.check=y(e.check,f,v,g));l-=v;g+=v;if(C)break a}else e.head&&(e.head.name=
null);e.length=0;e.mode=8;case 8:if(e.flags&4096){if(0===l)break a;v=0;do C=f[g+v++],e.head&&C&&65536>e.length&&(e.head.comment+=String.fromCharCode(C));while(C&&v<l);e.flags&512&&(e.check=y(e.check,f,v,g));l-=v;g+=v;if(C)break a}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(e.flags&512){for(;16>p;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}if(m!==(e.check&65535)){a.msg="header crc mismatch";e.mode=30;break}p=m=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0);a.adler=e.check=0;e.mode=12;break;
case 10:for(;32>p;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}a.adler=e.check=b(m);p=m=0;e.mode=11;case 11:if(0===e.havedict)return a.next_out=k,a.avail_out=u,a.next_in=g,a.avail_in=l,e.hold=m,e.bits=p,2;a.adler=e.check=1;e.mode=12;case 12:if(5===d||6===d)break a;case 13:if(e.last){m>>>=p&7;p-=p&7;e.mode=27;break}for(;3>p;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}e.last=m&1;m>>>=1;--p;switch(m&3){case 0:e.mode=14;break;case 1:v=e;if(x){C=void 0;I=new q.Buf32(512);F=new q.Buf32(32);for(C=0;144>C;)v.lens[C++]=
8;for(;256>C;)v.lens[C++]=9;for(;280>C;)v.lens[C++]=7;for(;288>C;)v.lens[C++]=8;A(1,v.lens,0,288,I,0,v.work,{bits:9});for(C=0;32>C;)v.lens[C++]=5;A(2,v.lens,0,32,F,0,v.work,{bits:5});x=!1}v.lencode=I;v.lenbits=9;v.distcode=F;v.distbits=5;e.mode=20;if(6===d){m>>>=2;p-=2;break a}break;case 2:e.mode=17;break;case 3:a.msg="invalid block type",e.mode=30}m>>>=2;p-=2;break;case 14:m>>>=p&7;for(p-=p&7;32>p;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}if((m&65535)!==(m>>>16^65535)){a.msg="invalid stored block lengths";
e.mode=30;break}e.length=m&65535;p=m=0;e.mode=15;if(6===d)break a;case 15:e.mode=16;case 16:if(v=e.length){v>l&&(v=l);v>u&&(v=u);if(0===v)break a;q.arraySet(h,f,g,v,k);l-=v;g+=v;u-=v;k+=v;e.length-=v;break}e.mode=12;break;case 17:for(;14>p;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}e.nlen=(m&31)+257;m>>>=5;p-=5;e.ndist=(m&31)+1;m>>>=5;p-=5;e.ncode=(m&15)+4;m>>>=4;p-=4;if(286<e.nlen||30<e.ndist){a.msg="too many length or distance symbols";e.mode=30;break}e.have=0;e.mode=18;case 18:for(;e.have<e.ncode;){for(;3>
p;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}e.lens[U[e.have++]]=m&7;m>>>=3;p-=3}for(;19>e.have;)e.lens[U[e.have++]]=0;e.lencode=e.lendyn;e.lenbits=7;v={bits:e.lenbits};O=A(0,e.lens,0,19,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid code lengths set";e.mode=30;break}e.have=0;e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;;){M=e.lencode[m&(1<<e.lenbits)-1];v=M>>>24;M&=65535;if(v<=p)break;if(0===l)break a;l--;m+=f[g++]<<p;p+=8}if(16>M)m>>>=v,p-=v,e.lens[e.have++]=M;else{if(16===M){for(C=
v+2;p<C;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}m>>>=v;p-=v;if(0===e.have){a.msg="invalid bit length repeat";e.mode=30;break}C=e.lens[e.have-1];v=3+(m&3);m>>>=2;p-=2}else if(17===M){for(C=v+3;p<C;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}m>>>=v;p-=v;C=0;v=3+(m&7);m>>>=3;p-=3}else{for(C=v+7;p<C;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}m>>>=v;p-=v;C=0;v=11+(m&127);m>>>=7;p-=7}if(e.have+v>e.nlen+e.ndist){a.msg="invalid bit length repeat";e.mode=30;break}for(;v--;)e.lens[e.have++]=C}}if(30===e.mode)break;
if(0===e.lens[256]){a.msg="invalid code -- missing end-of-block";e.mode=30;break}e.lenbits=9;v={bits:e.lenbits};O=A(1,e.lens,0,e.nlen,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid literal/lengths set";e.mode=30;break}e.distbits=6;e.distcode=e.distdyn;v={bits:e.distbits};O=A(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,v);e.distbits=v.bits;if(O){a.msg="invalid distances set";e.mode=30;break}e.mode=20;if(6===d)break a;case 20:e.mode=21;case 21:if(6<=l&&258<=u){a.next_out=k;a.avail_out=
u;a.next_in=g;a.avail_in=l;e.hold=m;e.bits=p;B(a,H);k=a.next_out;h=a.output;u=a.avail_out;g=a.next_in;f=a.input;l=a.avail_in;m=e.hold;p=e.bits;12===e.mode&&(e.back=-1);break}for(e.back=0;;){M=e.lencode[m&(1<<e.lenbits)-1];v=M>>>24;C=M>>>16&255;M&=65535;if(v<=p)break;if(0===l)break a;l--;m+=f[g++]<<p;p+=8}if(C&&0===(C&240)){P=v;R=C;for(T=M;;){M=e.lencode[T+((m&(1<<P+R)-1)>>P)];v=M>>>24;C=M>>>16&255;M&=65535;if(P+v<=p)break;if(0===l)break a;l--;m+=f[g++]<<p;p+=8}m>>>=P;p-=P;e.back+=P}m>>>=v;p-=v;e.back+=
v;e.length=M;if(0===C){e.mode=26;break}if(C&32){e.back=-1;e.mode=12;break}if(C&64){a.msg="invalid literal/length code";e.mode=30;break}e.extra=C&15;e.mode=22;case 22:if(e.extra){for(C=e.extra;p<C;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}e.length+=m&(1<<e.extra)-1;m>>>=e.extra;p-=e.extra;e.back+=e.extra}e.was=e.length;e.mode=23;case 23:for(;;){M=e.distcode[m&(1<<e.distbits)-1];v=M>>>24;C=M>>>16&255;M&=65535;if(v<=p)break;if(0===l)break a;l--;m+=f[g++]<<p;p+=8}if(0===(C&240)){P=v;R=C;for(T=M;;){M=e.distcode[T+
((m&(1<<P+R)-1)>>P)];v=M>>>24;C=M>>>16&255;M&=65535;if(P+v<=p)break;if(0===l)break a;l--;m+=f[g++]<<p;p+=8}m>>>=P;p-=P;e.back+=P}m>>>=v;p-=v;e.back+=v;if(C&64){a.msg="invalid distance code";e.mode=30;break}e.offset=M;e.extra=C&15;e.mode=24;case 24:if(e.extra){for(C=e.extra;p<C;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}e.offset+=m&(1<<e.extra)-1;m>>>=e.extra;p-=e.extra;e.back+=e.extra}if(e.offset>e.dmax){a.msg="invalid distance too far back";e.mode=30;break}e.mode=25;case 25:if(0===u)break a;v=H-u;
if(e.offset>v){v=e.offset-v;if(v>e.whave&&e.sane){a.msg="invalid distance too far back";e.mode=30;break}v>e.wnext?(v-=e.wnext,C=e.wsize-v):C=e.wnext-v;v>e.length&&(v=e.length);P=e.window}else P=h,C=k-e.offset,v=e.length;v>u&&(v=u);u-=v;e.length-=v;do h[k++]=P[C++];while(--v);0===e.length&&(e.mode=21);break;case 26:if(0===u)break a;h[k++]=e.length;u--;e.mode=21;break;case 27:if(e.wrap){for(;32>p;){if(0===l)break a;l--;m|=f[g++]<<p;p+=8}H-=u;a.total_out+=H;e.total+=H;H&&(a.adler=e.check=e.flags?y(e.check,
h,H,k-H):t(e.check,h,H,k-H));H=u;if((e.flags?m:b(m))!==e.check){a.msg="incorrect data check";e.mode=30;break}p=m=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;32>p;){if(0===l)break a;l--;m+=f[g++]<<p;p+=8}if(m!==(e.total&4294967295)){a.msg="incorrect length check";e.mode=30;break}p=m=0}e.mode=29;case 29:O=1;break a;case 30:O=-3;break a;case 31:return-4;default:return-2}a.next_out=k;a.avail_out=u;a.next_in=g;a.avail_in=l;e.hold=m;e.bits=p;if(e.wsize||H!==a.avail_out&&30>e.mode&&(27>e.mode||4!==d))f=
a.output,g=a.next_out,k=H-a.avail_out,u=a.state,null===u.window&&(u.wsize=1<<u.wbits,u.wnext=0,u.whave=0,u.window=new q.Buf8(u.wsize)),k>=u.wsize?(q.arraySet(u.window,f,g-u.wsize,u.wsize,0),u.wnext=0,u.whave=u.wsize):(l=u.wsize-u.wnext,l>k&&(l=k),q.arraySet(u.window,f,g-k,l,u.wnext),(k-=l)?(q.arraySet(u.window,f,g-k,k,0),u.wnext=k,u.whave=u.wsize):(u.wnext+=l,u.wnext===u.wsize&&(u.wnext=0),u.whave<u.wsize&&(u.whave+=l)));J-=a.avail_in;H-=a.avail_out;a.total_in+=J;a.total_out+=H;e.total+=H;e.wrap&&
H&&(a.adler=e.check=e.flags?y(e.check,h,H,a.next_out-H):t(e.check,h,H,a.next_out-H));a.data_type=e.bits+(e.last?64:0)+(12===e.mode?128:0)+(20===e.mode||15===e.mode?256:0);(0===J&&0===H||4===d)&&0===O&&(O=-5);return O};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){var d;if(!a||!a.state)return-2;d=a.state;if(0===(d.wrap&2))return-2;d.head=b;b.done=!1;return 0};f.inflateInfo="pako inflate (from Nodeca project)"},
{"../utils/common":2,"./adler32":4,"./crc32":6,"./inffast":8,"./inftrees":10}],10:[function(a,d,f){var b=a("../utils/common"),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],h=[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],g=[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],k=[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];d.exports=function(a,d,f,y,B,A,x,I){for(var F=I.bits,z=0,L=0,n=0,G=0,K=0,E=0,w=0,D=0,u=0,m=0,p,J,H=null,v=0,C,P=new b.Buf16(16),E=new b.Buf16(16),M=null,R=0,T,O,Q,z=0;15>=z;z++)P[z]=0;for(L=0;L<y;L++)P[d[f+L]]++;K=F;for(G=15;1<=G&&0===P[G];G--);K>G&&(K=G);if(0===G)return B[A++]=20971520,B[A++]=20971520,I.bits=1,0;for(n=1;n<G&&0===P[n];n++);K<n&&(K=n);for(z=D=1;15>=z;z++)if(D<<=1,D-=P[z],0>D)return-1;if(0<D&&(0===a||1!==G))return-1;E[1]=0;for(z=1;15>z;z++)E[z+1]=E[z]+
P[z];for(L=0;L<y;L++)0!==d[f+L]&&(x[E[d[f+L]]++]=L);switch(a){case 0:H=M=x;C=19;break;case 1:H=e;v-=257;M=h;R-=257;C=256;break;default:H=g,M=k,C=-1}L=m=0;z=n;F=A;E=K;w=0;J=-1;u=1<<K;y=u-1;if(1===a&&852<u||2===a&&592<u)return 1;for(var U=0;;){U++;T=z-w;x[L]<C?(O=0,Q=x[L]):x[L]>C?(O=M[R+x[L]],Q=H[v+x[L]]):(O=96,Q=0);D=1<<z-w;n=p=1<<E;do p-=D,B[F+(m>>w)+p]=T<<24|O<<16|Q|0;while(0!==p);for(D=1<<z-1;m&D;)D>>=1;0!==D?(m&=D-1,m+=D):m=0;L++;if(0===--P[z]){if(z===G)break;z=d[f+x[L]]}if(z>K&&(m&y)!==J){0===
w&&(w=K);F+=n;E=z-w;for(D=1<<E;E+w<G;){D-=P[E+w];if(0>=D)break;E++;D<<=1}u+=1<<E;if(1===a&&852<u||2===a&&592<u)return 1;J=m&y;B[J]=K<<24|E<<16|F-A|0}}0!==m&&(B[F+m]=z-w<<24|4194304);I.bits=K;return 0}},{"../utils/common":2}],11:[function(a,d,f){d.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"}},{}],12:[function(a,d,f){d.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}},{}]},{},[1])(1)});
(function(c){"object"===typeof exports&&"undefined"!==typeof module?module.exports=c():"function"===typeof define&&define.amd?define([],c):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).nifti=c()})(function(){return function a(d,f,b){function e(g,l){if(!f[g]){if(!d[g]){var q="function"==typeof require&&require;if(!l&&q)return q(g,!0);if(h)return h(g,!0);q=Error("Cannot find module '"+g+"'");throw q.code="MODULE_NOT_FOUND",q;}q=f[g]={exports:{}};
d[g][0].call(q.exports,function(a){var b=d[g][1][a];return e(b?b:a)},q,q.exports,a,d,f,b)}return f[g].exports}for(var h="function"==typeof require&&require,g=0;g<b.length;g++)e(b[g]);return e}({1:[function(a,d,f){f=a("./lib/utils/common").assign;var b=a("./lib/deflate"),e=a("./lib/inflate");a=a("./lib/zlib/constants");var h={};f(h,b,e,a);d.exports=h},{"./lib/deflate":2,"./lib/inflate":3,"./lib/utils/common":4,"./lib/zlib/constants":7}],2:[function(a,d,f){function b(a,b){var d=new t(b);d.push(a,!0);
if(d.err)throw d.msg;return d.result}var e=a("./zlib/deflate.js"),h=a("./utils/common"),g=a("./utils/strings"),k=a("./zlib/messages"),l=a("./zlib/zstream"),q=Object.prototype.toString,t=function(a){a=this.options=h.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},a||{});a.raw&&0<a.windowBits?a.windowBits=-a.windowBits:a.gzip&&0<a.windowBits&&16>a.windowBits&&(a.windowBits+=16);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new l;this.strm.avail_out=
0;var b=e.deflateInit2(this.strm,a.level,a.method,a.windowBits,a.memLevel,a.strategy);if(0!==b)throw Error(k[b]);a.header&&e.deflateSetHeader(this.strm,a.header)};t.prototype.push=function(a,b){var d=this.strm,f=this.options.chunkSize,l,k;if(this.ended)return!1;k=b===~~b?b:!0===b?4:0;"string"===typeof a?d.input=g.string2buf(a):"[object ArrayBuffer]"===q.call(a)?d.input=new Uint8Array(a):d.input=a;d.next_in=0;d.avail_in=d.input.length;do{0===d.avail_out&&(d.output=new h.Buf8(f),d.next_out=0,d.avail_out=
f);l=e.deflate(d,k);if(1!==l&&0!==l)return this.onEnd(l),this.ended=!0,!1;if(0===d.avail_out||0===d.avail_in&&(4===k||2===k))if("string"===this.options.to)this.onData(g.buf2binstring(h.shrinkBuf(d.output,d.next_out)));else this.onData(h.shrinkBuf(d.output,d.next_out))}while((0<d.avail_in||0===d.avail_out)&&1!==l);if(4===k)return l=e.deflateEnd(this.strm),this.onEnd(l),this.ended=!0,0===l;2===k&&(this.onEnd(0),d.avail_out=0);return!0};t.prototype.onData=function(a){this.chunks.push(a)};t.prototype.onEnd=
function(a){0===a&&(this.result="string"===this.options.to?this.chunks.join(""):h.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};f.Deflate=t;f.deflate=b;f.deflateRaw=function(a,d){d=d||{};d.raw=!0;return b(a,d)};f.gzip=function(a,d){d=d||{};d.gzip=!0;return b(a,d)}},{"./utils/common":4,"./utils/strings":5,"./zlib/deflate.js":9,"./zlib/messages":14,"./zlib/zstream":16}],3:[function(a,d,f){function b(a,b){var d=new B(b);d.push(a,!0);if(d.err)throw d.msg;return d.result}
var e=a("./zlib/inflate.js"),h=a("./utils/common"),g=a("./utils/strings"),k=a("./zlib/constants"),l=a("./zlib/messages"),q=a("./zlib/zstream"),t=a("./zlib/gzheader"),y=Object.prototype.toString,B=function(a){var b=this.options=h.assign({chunkSize:16384,windowBits:0,to:""},a||{});b.raw&&0<=b.windowBits&&16>b.windowBits&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowBits=-15));!(0<=b.windowBits&&16>b.windowBits)||a&&a.windowBits||(b.windowBits+=32);15<b.windowBits&&48>b.windowBits&&0===(b.windowBits&
15)&&(b.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new q;this.strm.avail_out=0;a=e.inflateInit2(this.strm,b.windowBits);if(a!==k.Z_OK)throw Error(l[a]);this.header=new t;e.inflateGetHeader(this.strm,this.header)};B.prototype.push=function(a,b){var d=this.strm,f=this.options.chunkSize,l,q,n,t,B,E=!1;if(this.ended)return!1;q=b===~~b?b:!0===b?k.Z_FINISH:k.Z_NO_FLUSH;"string"===typeof a?d.input=g.binstring2buf(a):"[object ArrayBuffer]"===y.call(a)?d.input=new Uint8Array(a):
d.input=a;d.next_in=0;d.avail_in=d.input.length;do{0===d.avail_out&&(d.output=new h.Buf8(f),d.next_out=0,d.avail_out=f);l=e.inflate(d,k.Z_NO_FLUSH);l===k.Z_BUF_ERROR&&!0===E&&(l=k.Z_OK,E=!1);if(l!==k.Z_STREAM_END&&l!==k.Z_OK)return this.onEnd(l),this.ended=!0,!1;if(d.next_out&&(0===d.avail_out||l===k.Z_STREAM_END||0===d.avail_in&&(q===k.Z_FINISH||q===k.Z_SYNC_FLUSH)))if("string"===this.options.to)n=g.utf8border(d.output,d.next_out),t=d.next_out-n,B=g.buf2string(d.output,n),d.next_out=t,d.avail_out=
f-t,t&&h.arraySet(d.output,d.output,n,t,0),this.onData(B);else this.onData(h.shrinkBuf(d.output,d.next_out));0===d.avail_in&&0===d.avail_out&&(E=!0)}while((0<d.avail_in||0===d.avail_out)&&l!==k.Z_STREAM_END);l===k.Z_STREAM_END&&(q=k.Z_FINISH);if(q===k.Z_FINISH)return l=e.inflateEnd(this.strm),this.onEnd(l),this.ended=!0,l===k.Z_OK;q===k.Z_SYNC_FLUSH&&(this.onEnd(k.Z_OK),d.avail_out=0);return!0};B.prototype.onData=function(a){this.chunks.push(a)};B.prototype.onEnd=function(a){a===k.Z_OK&&(this.result=
"string"===this.options.to?this.chunks.join(""):h.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};f.Inflate=B;f.inflate=b;f.inflateRaw=function(a,d){d=d||{};d.raw=!0;return b(a,d)};f.ungzip=b},{"./utils/common":4,"./utils/strings":5,"./zlib/constants":7,"./zlib/gzheader":10,"./zlib/inflate.js":12,"./zlib/messages":14,"./zlib/zstream":16}],4:[function(a,d,f){a="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;f.assign=function(a){for(var b=
Array.prototype.slice.call(arguments,1);b.length;){var d=b.shift();if(d){if("object"!==typeof d)throw new TypeError(d+"must be non-object");for(var e in d)d.hasOwnProperty(e)&&(a[e]=d[e])}}return a};f.shrinkBuf=function(a,b){if(a.length===b)return a;if(a.subarray)return a.subarray(0,b);a.length=b;return a};var b={arraySet:function(a,b,d,e,f){if(b.subarray&&a.subarray)a.set(b.subarray(d,d+e),f);else for(var t=0;t<e;t++)a[f+t]=b[d+t]},flattenChunks:function(a){var b,d,e,f,t;b=e=0;for(d=a.length;b<d;b++)e+=
a[b].length;t=new Uint8Array(e);b=e=0;for(d=a.length;b<d;b++)f=a[b],t.set(f,e),e+=f.length;return t}},e={arraySet:function(a,b,d,e,f){for(var t=0;t<e;t++)a[f+t]=b[d+t]},flattenChunks:function(a){return[].concat.apply([],a)}};f.setTyped=function(a){a?(f.Buf8=Uint8Array,f.Buf16=Uint16Array,f.Buf32=Int32Array,f.assign(f,b)):(f.Buf8=Array,f.Buf16=Array,f.Buf32=Array,f.assign(f,e))};f.setTyped(a)},{}],5:[function(a,d,f){function b(a,b){if(65537>b&&(a.subarray&&g||!a.subarray&&h))return String.fromCharCode.apply(null,
e.shrinkBuf(a,b));for(var d="",f=0;f<b;f++)d+=String.fromCharCode(a[f]);return d}var e=a("./common"),h=!0,g=!0;try{String.fromCharCode.apply(null,[0])}catch(k){h=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(l){g=!1}var q=new e.Buf8(256);for(a=0;256>a;a++)q[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;q[254]=q[254]=1;f.string2buf=function(a){var b,d,f,h,g,l=a.length,k=0;for(h=0;h<l;h++)d=a.charCodeAt(h),55296===(d&64512)&&h+1<l&&(f=a.charCodeAt(h+1),56320===(f&64512)&&(d=65536+
(d-55296<<10)+(f-56320),h++)),k+=128>d?1:2048>d?2:65536>d?3:4;b=new e.Buf8(k);for(h=g=0;g<k;h++)d=a.charCodeAt(h),55296===(d&64512)&&h+1<l&&(f=a.charCodeAt(h+1),56320===(f&64512)&&(d=65536+(d-55296<<10)+(f-56320),h++)),128>d?b[g++]=d:(2048>d?b[g++]=192|d>>>6:(65536>d?b[g++]=224|d>>>12:(b[g++]=240|d>>>18,b[g++]=128|d>>>12&63),b[g++]=128|d>>>6&63),b[g++]=128|d&63);return b};f.buf2binstring=function(a){return b(a,a.length)};f.binstring2buf=function(a){for(var b=new e.Buf8(a.length),d=0,f=b.length;d<
f;d++)b[d]=a.charCodeAt(d);return b};f.buf2string=function(a,d){var e,f,h,g,l=d||a.length,k=Array(2*l);for(e=f=0;e<l;)if(h=a[e++],128>h)k[f++]=h;else if(g=q[h],4<g)k[f++]=65533,e+=g-1;else{for(h&=2===g?31:3===g?15:7;1<g&&e<l;)h=h<<6|a[e++]&63,g--;1<g?k[f++]=65533:65536>h?k[f++]=h:(h-=65536,k[f++]=55296|h>>10&1023,k[f++]=56320|h&1023)}return b(k,f)};f.utf8border=function(a,b){var d;b=b||a.length;b>a.length&&(b=a.length);for(d=b-1;0<=d&&128===(a[d]&192);)d--;return 0>d||0===d?b:d+q[a[d]]>b?d:b}},{"./common":4}],
6:[function(a,d,f){d.exports=function(a,d,f,g){var k=a&65535|0;a=a>>>16&65535|0;for(var l=0;0!==f;){l=2E3<f?2E3:f;f-=l;do k=k+d[g++]|0,a=a+k|0;while(--l);k%=65521;a%=65521}return k|a<<16|0}},{}],7:[function(a,d,f){d.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}},{}],8:[function(a,d,f){var b=function(){for(var a,b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>>1:a>>>1;b[d]=a}return b}();d.exports=function(a,d,f,k){f=k+f;for(a^=-1;k<f;k++)a=a>>>8^b[(a^d[k])&255];return a^-1}},{}],9:[function(a,d,f){function b(a,b){a.msg=w[b];return b}function e(a){for(var b=a.length;0<=--b;)a[b]=0}function h(a){var b=a.state,d=b.pending;d>a.avail_out&&(d=a.avail_out);
0!==d&&(n.arraySet(a.output,b.pending_buf,b.pending_out,d,a.next_out),a.next_out+=d,b.pending_out+=d,a.total_out+=d,a.avail_out-=d,b.pending-=d,0===b.pending&&(b.pending_out=0))}function g(a,b){G._tr_flush_block(a,0<=a.block_start?a.block_start:-1,a.strstart-a.block_start,b);a.block_start=a.strstart;h(a.strm)}function k(a,b){a.pending_buf[a.pending++]=b}function l(a,b){a.pending_buf[a.pending++]=b>>>8&255;a.pending_buf[a.pending++]=b&255}function q(a,b){var d=a.max_chain_length,e=a.strstart,f,h=a.prev_length,
g=a.nice_match,n=a.strstart>a.w_size-262?a.strstart-(a.w_size-262):0,l=a.window,k=a.w_mask,q=a.prev,t=a.strstart+258,z=l[e+h-1],y=l[e+h];a.prev_length>=a.good_match&&(d>>=2);g>a.lookahead&&(g=a.lookahead);do if(f=b,l[f+h]===y&&l[f+h-1]===z&&l[f]===l[e]&&l[++f]===l[e+1]){e+=2;for(f++;l[++e]===l[++f]&&l[++e]===l[++f]&&l[++e]===l[++f]&&l[++e]===l[++f]&&l[++e]===l[++f]&&l[++e]===l[++f]&&l[++e]===l[++f]&&l[++e]===l[++f]&&e<t;);f=258-(t-e);e=t-258;if(f>h){a.match_start=b;h=f;if(f>=g)break;z=l[e+h-1];y=
l[e+h]}}while((b=q[b&k])>n&&0!==--d);return h<=a.lookahead?h:a.lookahead}function t(a){var b=a.w_size,d,e,f,h;do{h=a.window_size-a.lookahead-a.strstart;if(a.strstart>=b+(b-262)){n.arraySet(a.window,a.window,b,b,0);a.match_start-=b;a.strstart-=b;a.block_start-=b;d=e=a.hash_size;do f=a.head[--d],a.head[d]=f>=b?f-b:0;while(--e);d=e=b;do f=a.prev[--d],a.prev[d]=f>=b?f-b:0;while(--e);h+=b}if(0===a.strm.avail_in)break;d=a.strm;e=a.window;f=a.strstart+a.lookahead;var g=d.avail_in;g>h&&(g=h);0===g?e=0:(d.avail_in-=
g,n.arraySet(e,d.input,d.next_in,g,f),1===d.state.wrap?d.adler=K(d.adler,e,g,f):2===d.state.wrap&&(d.adler=E(d.adler,e,g,f)),d.next_in+=g,d.total_in+=g,e=g);a.lookahead+=e;if(3<=a.lookahead+a.insert)for(h=a.strstart-a.insert,a.ins_h=a.window[h],a.ins_h=(a.ins_h<<a.hash_shift^a.window[h+1])&a.hash_mask;a.insert&&!(a.ins_h=(a.ins_h<<a.hash_shift^a.window[h+3-1])&a.hash_mask,a.prev[h&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=h,h++,a.insert--,3>a.lookahead+a.insert););}while(262>a.lookahead&&0!==a.strm.avail_in)}
function y(a,b){for(var d;;){if(262>a.lookahead){t(a);if(262>a.lookahead&&0===b)return 1;if(0===a.lookahead)break}d=0;3<=a.lookahead&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);0!==d&&a.strstart-d<=a.w_size-262&&(a.match_length=q(a,d));if(3<=a.match_length)if(d=G._tr_tally(a,a.strstart-a.match_start,a.match_length-3),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&3<=a.lookahead){a.match_length--;
do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(0!==--a.match_length);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else d=G._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(d&&(g(a,!1),0===a.strm.avail_out))return 1}a.insert=2>a.strstart?a.strstart:2;return 4===
b?(g(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(g(a,!1),0===a.strm.avail_out)?1:2}function B(a,b){for(var d,e;;){if(262>a.lookahead){t(a);if(262>a.lookahead&&0===b)return 1;if(0===a.lookahead)break}d=0;3<=a.lookahead&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);a.prev_length=a.match_length;a.prev_match=a.match_start;a.match_length=2;0!==d&&a.prev_length<a.max_lazy_match&&a.strstart-d<=a.w_size-262&&
(a.match_length=q(a,d),5>=a.match_length&&(1===a.strategy||3===a.match_length&&4096<a.strstart-a.match_start)&&(a.match_length=2));if(3<=a.prev_length&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-3;d=G._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-3);a.lookahead-=a.prev_length-1;a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(0!==--a.prev_length);
a.match_available=0;a.match_length=2;a.strstart++;if(d&&(g(a,!1),0===a.strm.avail_out))return 1}else if(a.match_available){if((d=G._tr_tally(a,0,a.window[a.strstart-1]))&&g(a,!1),a.strstart++,a.lookahead--,0===a.strm.avail_out)return 1}else a.match_available=1,a.strstart++,a.lookahead--}a.match_available&&(G._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0);a.insert=2>a.strstart?a.strstart:2;return 4===b?(g(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(g(a,!1),0===a.strm.avail_out)?1:2}function A(a,
b){for(var d,e,f,h=a.window;;){if(258>=a.lookahead){t(a);if(258>=a.lookahead&&0===b)return 1;if(0===a.lookahead)break}a.match_length=0;if(3<=a.lookahead&&0<a.strstart&&(e=a.strstart-1,d=h[e],d===h[++e]&&d===h[++e]&&d===h[++e])){for(f=a.strstart+258;d===h[++e]&&d===h[++e]&&d===h[++e]&&d===h[++e]&&d===h[++e]&&d===h[++e]&&d===h[++e]&&d===h[++e]&&e<f;);a.match_length=258-(f-e);a.match_length>a.lookahead&&(a.match_length=a.lookahead)}3<=a.match_length?(d=G._tr_tally(a,1,a.match_length-3),a.lookahead-=
a.match_length,a.strstart+=a.match_length,a.match_length=0):(d=G._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++);if(d&&(g(a,!1),0===a.strm.avail_out))return 1}a.insert=0;return 4===b?(g(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(g(a,!1),0===a.strm.avail_out)?1:2}function x(a,b){for(var d;;){if(0===a.lookahead&&(t(a),0===a.lookahead)){if(0===b)return 1;break}a.match_length=0;d=G._tr_tally(a,0,a.window[a.strstart]);a.lookahead--;a.strstart++;if(d&&(g(a,!1),0===a.strm.avail_out))return 1}a.insert=
0;return 4===b?(g(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(g(a,!1),0===a.strm.avail_out)?1:2}function I(){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 n.Buf16(1146);this.dyn_dtree=new n.Buf16(122);this.bl_tree=new n.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 n.Buf16(16);this.heap=new n.Buf16(573);e(this.heap);this.heap_max=this.heap_len=0;this.depth=new n.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 F(a){var d;if(!a||!a.state)return b(a,-2);a.total_in=a.total_out=0;a.data_type=2;d=a.state;d.pending=0;d.pending_out=0;0>d.wrap&&(d.wrap=-d.wrap);d.status=d.wrap?42:113;a.adler=2===d.wrap?0:1;d.last_flush=0;G._tr_init(d);return 0}function z(a){var b=F(a);0===b&&(a=a.state,a.window_size=2*a.w_size,e(a.head),a.max_lazy_match=D[a.level].max_lazy,
a.good_match=D[a.level].good_length,a.nice_match=D[a.level].nice_length,a.max_chain_length=D[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 L(a,d,e,f,h,g){if(!a)return-2;var l=1;-1===d&&(d=6);0>f?(l=0,f=-f):15<f&&(l=2,f-=16);if(1>h||9<h||8!==e||8>f||15<f||0>d||9<d||0>g||4<g)return b(a,-2);8===f&&(f=9);var k=new I;a.state=k;k.strm=a;k.wrap=l;k.gzhead=null;k.w_bits=f;k.w_size=1<<k.w_bits;k.w_mask=
k.w_size-1;k.hash_bits=h+7;k.hash_size=1<<k.hash_bits;k.hash_mask=k.hash_size-1;k.hash_shift=~~((k.hash_bits+3-1)/3);k.window=new n.Buf8(2*k.w_size);k.head=new n.Buf16(k.hash_size);k.prev=new n.Buf16(k.w_size);k.lit_bufsize=1<<h+6;k.pending_buf_size=4*k.lit_bufsize;k.pending_buf=new n.Buf8(k.pending_buf_size);k.d_buf=k.lit_bufsize>>1;k.l_buf=3*k.lit_bufsize;k.level=d;k.strategy=g;k.method=e;return z(a)}var n=a("../utils/common"),G=a("./trees"),K=a("./adler32"),E=a("./crc32"),w=a("./messages");a=function(a,
b,d,e,f){this.good_length=a;this.max_lazy=b;this.nice_length=d;this.max_chain=e;this.func=f};var D;D=[new a(0,0,0,0,function(a,b){var d=65535;for(d>a.pending_buf_size-5&&(d=a.pending_buf_size-5);;){if(1>=a.lookahead){t(a);if(0===a.lookahead&&0===b)return 1;if(0===a.lookahead)break}a.strstart+=a.lookahead;a.lookahead=0;var e=a.block_start+d;if(0===a.strstart||a.strstart>=e)if(a.lookahead=a.strstart-e,a.strstart=e,g(a,!1),0===a.strm.avail_out)return 1;if(a.strstart-a.block_start>=a.w_size-262&&(g(a,
!1),0===a.strm.avail_out))return 1}a.insert=0;if(4===b)return g(a,!0),0===a.strm.avail_out?3:4;a.strstart>a.block_start&&g(a,!1);return 1}),new a(4,4,8,4,y),new a(4,5,16,8,y),new a(4,6,32,32,y),new a(4,4,16,16,B),new a(8,16,32,32,B),new a(8,16,128,128,B),new a(8,32,128,256,B),new a(32,128,258,1024,B),new a(32,258,258,4096,B)];f.deflateInit=function(a,b){return L(a,b,8,15,8,0)};f.deflateInit2=L;f.deflateReset=z;f.deflateResetKeep=F;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,d){var f,g,n,q;if(!a||!a.state||5<d||0>d)return a?b(a,-2):-2;g=a.state;if(!a.output||!a.input&&0!==a.avail_in||666===g.status&&4!==d)return b(a,0===a.avail_out?-5:-2);g.strm=a;f=g.last_flush;g.last_flush=d;42===g.status&&(2===g.wrap?(a.adler=0,k(g,31),k(g,139),k(g,8),g.gzhead?(k(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)),k(g,g.gzhead.time&255),k(g,g.gzhead.time>>8&255),k(g,g.gzhead.time>>
16&255),k(g,g.gzhead.time>>24&255),k(g,9===g.level?2:2<=g.strategy||2>g.level?4:0),k(g,g.gzhead.os&255),g.gzhead.extra&&g.gzhead.extra.length&&(k(g,g.gzhead.extra.length&255),k(g,g.gzhead.extra.length>>8&255)),g.gzhead.hcrc&&(a.adler=E(a.adler,g.pending_buf,g.pending,0)),g.gzindex=0,g.status=69):(k(g,0),k(g,0),k(g,0),k(g,0),k(g,0),k(g,9===g.level?2:2<=g.strategy||2>g.level?4:0),k(g,3),g.status=113)):(n=8+(g.w_bits-8<<4)<<8,q=-1,q=2<=g.strategy||2>g.level?0:6>g.level?1:6===g.level?2:3,n|=q<<6,0!==
g.strstart&&(n|=32),g.status=113,l(g,n+(31-n%31)),0!==g.strstart&&(l(g,a.adler>>>16),l(g,a.adler&65535)),a.adler=1));if(69===g.status)if(g.gzhead.extra){for(n=g.pending;g.gzindex<(g.gzhead.extra.length&65535)&&(g.pending!==g.pending_buf_size||(g.gzhead.hcrc&&g.pending>n&&(a.adler=E(a.adler,g.pending_buf,g.pending-n,n)),h(a),n=g.pending,g.pending!==g.pending_buf_size));)k(g,g.gzhead.extra[g.gzindex]&255),g.gzindex++;g.gzhead.hcrc&&g.pending>n&&(a.adler=E(a.adler,g.pending_buf,g.pending-n,n));g.gzindex===
g.gzhead.extra.length&&(g.gzindex=0,g.status=73)}else g.status=73;if(73===g.status)if(g.gzhead.name){n=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>n&&(a.adler=E(a.adler,g.pending_buf,g.pending-n,n)),h(a),n=g.pending,g.pending===g.pending_buf_size)){q=1;break}q=g.gzindex<g.gzhead.name.length?g.gzhead.name.charCodeAt(g.gzindex++)&255:0;k(g,q)}while(0!==q);g.gzhead.hcrc&&g.pending>n&&(a.adler=E(a.adler,g.pending_buf,g.pending-n,n));0===q&&(g.gzindex=0,g.status=91)}else g.status=
91;if(91===g.status)if(g.gzhead.comment){n=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>n&&(a.adler=E(a.adler,g.pending_buf,g.pending-n,n)),h(a),n=g.pending,g.pending===g.pending_buf_size)){q=1;break}q=g.gzindex<g.gzhead.comment.length?g.gzhead.comment.charCodeAt(g.gzindex++)&255:0;k(g,q)}while(0!==q);g.gzhead.hcrc&&g.pending>n&&(a.adler=E(a.adler,g.pending_buf,g.pending-n,n));0===q&&(g.status=103)}else g.status=103;103===g.status&&(g.gzhead.hcrc?(g.pending+2>g.pending_buf_size&&
h(a),g.pending+2<=g.pending_buf_size&&(k(g,a.adler&255),k(g,a.adler>>8&255),a.adler=0,g.status=113)):g.status=113);if(0!==g.pending){if(h(a),0===a.avail_out)return g.last_flush=-1,0}else if(0===a.avail_in&&(d<<1)-(4<d?9:0)<=(f<<1)-(4<f?9:0)&&4!==d)return b(a,-5);if(666===g.status&&0!==a.avail_in)return b(a,-5);if(0!==a.avail_in||0!==g.lookahead||0!==d&&666!==g.status){f=2===g.strategy?x(g,d):3===g.strategy?A(g,d):D[g.level].func(g,d);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===d?G._tr_align(g):5!==d&&(G._tr_stored_block(g,0,0,!1),3===d&&(e(g.head),0===g.lookahead&&(g.strstart=0,g.block_start=0,g.insert=0))),h(a),0===a.avail_out))return g.last_flush=-1,0}if(4!==d)return 0;if(0>=g.wrap)return 1;2===g.wrap?(k(g,a.adler&255),k(g,a.adler>>8&255),k(g,a.adler>>16&255),k(g,a.adler>>24&255),k(g,a.total_in&255),k(g,a.total_in>>8&255),k(g,a.total_in>>16&255),k(g,a.total_in>>24&255)):(l(g,a.adler>>>16),l(g,a.adler&65535));h(a);0<g.wrap&&(g.wrap=-g.wrap);
return 0!==g.pending?0:1};f.deflateEnd=function(a){var d;if(!a||!a.state)return-2;d=a.state.status;if(42!==d&&69!==d&&73!==d&&91!==d&&103!==d&&113!==d&&666!==d)return b(a,-2);a.state=null;return 113===d?b(a,-3):0};f.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":4,"./adler32":6,"./crc32":8,"./messages":14,"./trees":15}],10:[function(a,d,f){d.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}},{}],11:[function(a,d,f){d.exports=function(a,d){var f,g,k,l,q,t,y,B,A,x,I,F,z,L,n,G,K,E,w,D,u,m,p,J;f=a.state;g=a.next_in;p=a.input;k=g+(a.avail_in-5);l=a.next_out;J=a.output;q=l-(d-a.avail_out);t=l+(a.avail_out-257);y=f.dmax;B=f.wsize;A=f.whave;x=f.wnext;I=f.window;F=f.hold;z=f.bits;L=f.lencode;n=f.distcode;G=(1<<f.lenbits)-1;K=(1<<f.distbits)-1;a:do b:for(15>z&&(F+=p[g++]<<z,z+=8,F+=p[g++]<<z,z+=8),E=L[F&G];;){w=E>>>24;F>>>=w;z-=w;w=E>>>16&255;if(0===w)J[l++]=E&65535;else if(w&16){D=E&65535;
if(w&=15)z<w&&(F+=p[g++]<<z,z+=8),D+=F&(1<<w)-1,F>>>=w,z-=w;15>z&&(F+=p[g++]<<z,z+=8,F+=p[g++]<<z,z+=8);E=n[F&K];c:for(;;){w=E>>>24;F>>>=w;z-=w;w=E>>>16&255;if(w&16){E&=65535;w&=15;z<w&&(F+=p[g++]<<z,z+=8,z<w&&(F+=p[g++]<<z,z+=8));E+=F&(1<<w)-1;if(E>y){a.msg="invalid distance too far back";f.mode=30;break a}F>>>=w;z-=w;w=l-q;if(E>w){w=E-w;if(w>A&&f.sane){a.msg="invalid distance too far back";f.mode=30;break a}u=0;m=I;if(0===x){if(u+=B-w,w<D){D-=w;do J[l++]=I[u++];while(--w);u=l-E;m=J}}else if(x<w){if(u+=
B+x-w,w-=x,w<D){D-=w;do J[l++]=I[u++];while(--w);u=0;if(x<D){w=x;D-=w;do J[l++]=I[u++];while(--w);u=l-E;m=J}}}else if(u+=x-w,w<D){D-=w;do J[l++]=I[u++];while(--w);u=l-E;m=J}for(;2<D;)J[l++]=m[u++],J[l++]=m[u++],J[l++]=m[u++],D-=3;D&&(J[l++]=m[u++],1<D&&(J[l++]=m[u++]))}else{u=l-E;do J[l++]=J[u++],J[l++]=J[u++],J[l++]=J[u++],D-=3;while(2<D);D&&(J[l++]=J[u++],1<D&&(J[l++]=J[u++]))}}else if(0===(w&64)){E=n[(E&65535)+(F&(1<<w)-1)];continue c}else{a.msg="invalid distance code";f.mode=30;break a}break}}else if(0===
(w&64)){E=L[(E&65535)+(F&(1<<w)-1)];continue b}else{w&32?f.mode=12:(a.msg="invalid literal/length code",f.mode=30);break a}break}while(g<k&&l<t);D=z>>3;g-=D;z-=D<<3;a.next_in=g;a.next_out=l;a.avail_in=g<k?5+(k-g):5-(g-k);a.avail_out=l<t?257+(t-l):257-(l-t);f.hold=F&(1<<z)-1;f.bits=z}},{}],12:[function(a,d,f){function b(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 q.Buf16(320);this.work=new q.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function h(a){var b;if(!a||!a.state)return-2;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 q.Buf32(852);b.distcode=b.distdyn=new q.Buf32(592);b.sane=1;b.back=-1;return 0}function g(a){var b;if(!a||!a.state)return-2;b=a.state;b.wsize=0;b.whave=0;b.wnext=0;return h(a)}function k(a,b){var d,e;if(!a||!a.state)return-2;e=a.state;0>b?(d=0,b=-b):(d=(b>>4)+1,48>b&&(b&=15));if(b&&(8>b||15<b))return-2;null!==e.window&&e.wbits!==b&&(e.window=null);e.wrap=d;e.wbits=b;return g(a)}function l(a,b){var d;if(!a)return-2;d=new e;a.state=
d;d.window=null;d=k(a,b);0!==d&&(a.state=null);return d}var q=a("../utils/common"),t=a("./adler32"),y=a("./crc32"),B=a("./inffast"),A=a("./inftrees"),x=!0,I,F;f.inflateReset=g;f.inflateReset2=k;f.inflateResetKeep=h;f.inflateInit=function(a){return l(a,15)};f.inflateInit2=l;f.inflate=function(a,d){var e,f,h,g,l,k,u,m,p,J,H,v,C,P,M=0,R,T,O,Q=new q.Buf8(4),U=[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;e=a.state;12===e.mode&&(e.mode=13);
l=a.next_out;h=a.output;u=a.avail_out;g=a.next_in;f=a.input;k=a.avail_in;m=e.hold;p=e.bits;J=k;H=u;O=0;a:for(;;)switch(e.mode){case 1:if(0===e.wrap){e.mode=13;break}for(;16>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}if(e.wrap&2&&35615===m){e.check=0;Q[0]=m&255;Q[1]=m>>>8&255;e.check=y(e.check,Q,2,0);p=m=0;e.mode=2;break}e.flags=0;e.head&&(e.head.done=!1);if(!(e.wrap&1)||(((m&255)<<8)+(m>>8))%31){a.msg="incorrect header check";e.mode=30;break}if(8!==(m&15)){a.msg="unknown compression method";e.mode=
30;break}m>>>=4;p-=4;C=(m&15)+8;if(0===e.wbits)e.wbits=C;else if(C>e.wbits){a.msg="invalid window size";e.mode=30;break}e.dmax=1<<C;a.adler=e.check=1;e.mode=m&512?10:12;p=m=0;break;case 2:for(;16>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.flags=m;if(8!==(e.flags&255)){a.msg="unknown compression method";e.mode=30;break}if(e.flags&57344){a.msg="unknown header flags set";e.mode=30;break}e.head&&(e.head.text=m>>8&1);e.flags&512&&(Q[0]=m&255,Q[1]=m>>>8&255,e.check=y(e.check,Q,2,0));p=m=0;e.mode=3;case 3:for(;32>
p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.head&&(e.head.time=m);e.flags&512&&(Q[0]=m&255,Q[1]=m>>>8&255,Q[2]=m>>>16&255,Q[3]=m>>>24&255,e.check=y(e.check,Q,4,0));p=m=0;e.mode=4;case 4:for(;16>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.head&&(e.head.xflags=m&255,e.head.os=m>>8);e.flags&512&&(Q[0]=m&255,Q[1]=m>>>8&255,e.check=y(e.check,Q,2,0));p=m=0;e.mode=5;case 5:if(e.flags&1024){for(;16>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.length=m;e.head&&(e.head.extra_len=m);e.flags&512&&(Q[0]=m&255,
Q[1]=m>>>8&255,e.check=y(e.check,Q,2,0));p=m=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(e.flags&1024&&(v=e.length,v>k&&(v=k),v&&(e.head&&(C=e.head.extra_len-e.length,e.head.extra||(e.head.extra=Array(e.head.extra_len)),q.arraySet(e.head.extra,f,g,v,C)),e.flags&512&&(e.check=y(e.check,f,v,g)),k-=v,g+=v,e.length-=v),e.length))break a;e.length=0;e.mode=7;case 7:if(e.flags&2048){if(0===k)break a;v=0;do C=f[g+v++],e.head&&C&&65536>e.length&&(e.head.name+=String.fromCharCode(C));while(C&&v<k);
e.flags&512&&(e.check=y(e.check,f,v,g));k-=v;g+=v;if(C)break a}else e.head&&(e.head.name=null);e.length=0;e.mode=8;case 8:if(e.flags&4096){if(0===k)break a;v=0;do C=f[g+v++],e.head&&C&&65536>e.length&&(e.head.comment+=String.fromCharCode(C));while(C&&v<k);e.flags&512&&(e.check=y(e.check,f,v,g));k-=v;g+=v;if(C)break a}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(e.flags&512){for(;16>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}if(m!==(e.check&65535)){a.msg="header crc mismatch";e.mode=30;break}p=
m=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0);a.adler=e.check=0;e.mode=12;break;case 10:for(;32>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}a.adler=e.check=b(m);p=m=0;e.mode=11;case 11:if(0===e.havedict)return a.next_out=l,a.avail_out=u,a.next_in=g,a.avail_in=k,e.hold=m,e.bits=p,2;a.adler=e.check=1;e.mode=12;case 12:if(5===d||6===d)break a;case 13:if(e.last){m>>>=p&7;p-=p&7;e.mode=27;break}for(;3>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.last=m&1;m>>>=1;--p;switch(m&3){case 0:e.mode=14;
break;case 1:v=e;if(x){C=void 0;I=new q.Buf32(512);F=new q.Buf32(32);for(C=0;144>C;)v.lens[C++]=8;for(;256>C;)v.lens[C++]=9;for(;280>C;)v.lens[C++]=7;for(;288>C;)v.lens[C++]=8;A(1,v.lens,0,288,I,0,v.work,{bits:9});for(C=0;32>C;)v.lens[C++]=5;A(2,v.lens,0,32,F,0,v.work,{bits:5});x=!1}v.lencode=I;v.lenbits=9;v.distcode=F;v.distbits=5;e.mode=20;if(6===d){m>>>=2;p-=2;break a}break;case 2:e.mode=17;break;case 3:a.msg="invalid block type",e.mode=30}m>>>=2;p-=2;break;case 14:m>>>=p&7;for(p-=p&7;32>p;){if(0===
k)break a;k--;m+=f[g++]<<p;p+=8}if((m&65535)!==(m>>>16^65535)){a.msg="invalid stored block lengths";e.mode=30;break}e.length=m&65535;p=m=0;e.mode=15;if(6===d)break a;case 15:e.mode=16;case 16:if(v=e.length){v>k&&(v=k);v>u&&(v=u);if(0===v)break a;q.arraySet(h,f,g,v,l);k-=v;g+=v;u-=v;l+=v;e.length-=v;break}e.mode=12;break;case 17:for(;14>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.nlen=(m&31)+257;m>>>=5;p-=5;e.ndist=(m&31)+1;m>>>=5;p-=5;e.ncode=(m&15)+4;m>>>=4;p-=4;if(286<e.nlen||30<e.ndist){a.msg=
"too many length or distance symbols";e.mode=30;break}e.have=0;e.mode=18;case 18:for(;e.have<e.ncode;){for(;3>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.lens[U[e.have++]]=m&7;m>>>=3;p-=3}for(;19>e.have;)e.lens[U[e.have++]]=0;e.lencode=e.lendyn;e.lenbits=7;v={bits:e.lenbits};O=A(0,e.lens,0,19,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid code lengths set";e.mode=30;break}e.have=0;e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;;){M=e.lencode[m&(1<<e.lenbits)-1];v=M>>>24;M&=65535;
if(v<=p)break;if(0===k)break a;k--;m+=f[g++]<<p;p+=8}if(16>M)m>>>=v,p-=v,e.lens[e.have++]=M;else{if(16===M){for(C=v+2;p<C;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}m>>>=v;p-=v;if(0===e.have){a.msg="invalid bit length repeat";e.mode=30;break}C=e.lens[e.have-1];v=3+(m&3);m>>>=2;p-=2}else if(17===M){for(C=v+3;p<C;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}m>>>=v;p-=v;C=0;v=3+(m&7);m>>>=3;p-=3}else{for(C=v+7;p<C;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}m>>>=v;p-=v;C=0;v=11+(m&127);m>>>=7;p-=7}if(e.have+
v>e.nlen+e.ndist){a.msg="invalid bit length repeat";e.mode=30;break}for(;v--;)e.lens[e.have++]=C}}if(30===e.mode)break;if(0===e.lens[256]){a.msg="invalid code -- missing end-of-block";e.mode=30;break}e.lenbits=9;v={bits:e.lenbits};O=A(1,e.lens,0,e.nlen,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid literal/lengths set";e.mode=30;break}e.distbits=6;e.distcode=e.distdyn;v={bits:e.distbits};O=A(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,v);e.distbits=v.bits;if(O){a.msg="invalid distances set";
e.mode=30;break}e.mode=20;if(6===d)break a;case 20:e.mode=21;case 21:if(6<=k&&258<=u){a.next_out=l;a.avail_out=u;a.next_in=g;a.avail_in=k;e.hold=m;e.bits=p;B(a,H);l=a.next_out;h=a.output;u=a.avail_out;g=a.next_in;f=a.input;k=a.avail_in;m=e.hold;p=e.bits;12===e.mode&&(e.back=-1);break}for(e.back=0;;){M=e.lencode[m&(1<<e.lenbits)-1];v=M>>>24;C=M>>>16&255;M&=65535;if(v<=p)break;if(0===k)break a;k--;m+=f[g++]<<p;p+=8}if(C&&0===(C&240)){P=v;R=C;for(T=M;;){M=e.lencode[T+((m&(1<<P+R)-1)>>P)];v=M>>>24;C=
M>>>16&255;M&=65535;if(P+v<=p)break;if(0===k)break a;k--;m+=f[g++]<<p;p+=8}m>>>=P;p-=P;e.back+=P}m>>>=v;p-=v;e.back+=v;e.length=M;if(0===C){e.mode=26;break}if(C&32){e.back=-1;e.mode=12;break}if(C&64){a.msg="invalid literal/length code";e.mode=30;break}e.extra=C&15;e.mode=22;case 22:if(e.extra){for(C=e.extra;p<C;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.length+=m&(1<<e.extra)-1;m>>>=e.extra;p-=e.extra;e.back+=e.extra}e.was=e.length;e.mode=23;case 23:for(;;){M=e.distcode[m&(1<<e.distbits)-1];v=M>>>
24;C=M>>>16&255;M&=65535;if(v<=p)break;if(0===k)break a;k--;m+=f[g++]<<p;p+=8}if(0===(C&240)){P=v;R=C;for(T=M;;){M=e.distcode[T+((m&(1<<P+R)-1)>>P)];v=M>>>24;C=M>>>16&255;M&=65535;if(P+v<=p)break;if(0===k)break a;k--;m+=f[g++]<<p;p+=8}m>>>=P;p-=P;e.back+=P}m>>>=v;p-=v;e.back+=v;if(C&64){a.msg="invalid distance code";e.mode=30;break}e.offset=M;e.extra=C&15;e.mode=24;case 24:if(e.extra){for(C=e.extra;p<C;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.offset+=m&(1<<e.extra)-1;m>>>=e.extra;p-=e.extra;e.back+=
e.extra}if(e.offset>e.dmax){a.msg="invalid distance too far back";e.mode=30;break}e.mode=25;case 25:if(0===u)break a;v=H-u;if(e.offset>v){v=e.offset-v;if(v>e.whave&&e.sane){a.msg="invalid distance too far back";e.mode=30;break}v>e.wnext?(v-=e.wnext,C=e.wsize-v):C=e.wnext-v;v>e.length&&(v=e.length);P=e.window}else P=h,C=l-e.offset,v=e.length;v>u&&(v=u);u-=v;e.length-=v;do h[l++]=P[C++];while(--v);0===e.length&&(e.mode=21);break;case 26:if(0===u)break a;h[l++]=e.length;u--;e.mode=21;break;case 27:if(e.wrap){for(;32>
p;){if(0===k)break a;k--;m|=f[g++]<<p;p+=8}H-=u;a.total_out+=H;e.total+=H;H&&(a.adler=e.check=e.flags?y(e.check,h,H,l-H):t(e.check,h,H,l-H));H=u;if((e.flags?m:b(m))!==e.check){a.msg="incorrect data check";e.mode=30;break}p=m=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;32>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}if(m!==(e.total&4294967295)){a.msg="incorrect length check";e.mode=30;break}p=m=0}e.mode=29;case 29:O=1;break a;case 30:O=-3;break a;case 31:return-4;default:return-2}a.next_out=l;a.avail_out=
u;a.next_in=g;a.avail_in=k;e.hold=m;e.bits=p;if(e.wsize||H!==a.avail_out&&30>e.mode&&(27>e.mode||4!==d))f=a.output,g=a.next_out,l=H-a.avail_out,u=a.state,null===u.window&&(u.wsize=1<<u.wbits,u.wnext=0,u.whave=0,u.window=new q.Buf8(u.wsize)),l>=u.wsize?(q.arraySet(u.window,f,g-u.wsize,u.wsize,0),u.wnext=0,u.whave=u.wsize):(k=u.wsize-u.wnext,k>l&&(k=l),q.arraySet(u.window,f,g-l,k,u.wnext),(l-=k)?(q.arraySet(u.window,f,g-l,l,0),u.wnext=l,u.whave=u.wsize):(u.wnext+=k,u.wnext===u.wsize&&(u.wnext=0),u.whave<
u.wsize&&(u.whave+=k)));J-=a.avail_in;H-=a.avail_out;a.total_in+=J;a.total_out+=H;e.total+=H;e.wrap&&H&&(a.adler=e.check=e.flags?y(e.check,h,H,a.next_out-H):t(e.check,h,H,a.next_out-H));a.data_type=e.bits+(e.last?64:0)+(12===e.mode?128:0)+(20===e.mode||15===e.mode?256:0);(0===J&&0===H||4===d)&&0===O&&(O=-5);return O};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){var d;if(!a||!a.state)return-2;d=a.state;
if(0===(d.wrap&2))return-2;d.head=b;b.done=!1;return 0};f.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":4,"./adler32":6,"./crc32":8,"./inffast":11,"./inftrees":13}],13:[function(a,d,f){var b=a("../utils/common"),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],h=[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],g=[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],k=[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];d.exports=function(a,d,f,y,B,A,x,I){for(var F=I.bits,z=0,L=0,n=0,G=0,K=0,E=0,w=0,D=0,u=0,m=0,p,J,H=null,v=0,C,P=new b.Buf16(16),E=new b.Buf16(16),M=null,R=0,T,O,Q,z=0;15>=z;z++)P[z]=0;for(L=0;L<y;L++)P[d[f+L]]++;K=F;for(G=15;1<=G&&0===P[G];G--);K>G&&(K=G);if(0===G)return B[A++]=20971520,B[A++]=20971520,I.bits=1,0;for(n=1;n<G&&0===P[n];n++);K<n&&(K=n);for(z=
D=1;15>=z;z++)if(D<<=1,D-=P[z],0>D)return-1;if(0<D&&(0===a||1!==G))return-1;E[1]=0;for(z=1;15>z;z++)E[z+1]=E[z]+P[z];for(L=0;L<y;L++)0!==d[f+L]&&(x[E[d[f+L]]++]=L);0===a?(H=M=x,C=19):1===a?(H=e,v-=257,M=h,R-=257,C=256):(H=g,M=k,C=-1);L=m=0;z=n;F=A;E=K;w=0;J=-1;u=1<<K;y=u-1;if(1===a&&852<u||2===a&&592<u)return 1;for(var U=0;;){U++;T=z-w;x[L]<C?(O=0,Q=x[L]):x[L]>C?(O=M[R+x[L]],Q=H[v+x[L]]):(O=96,Q=0);D=1<<z-w;n=p=1<<E;do p-=D,B[F+(m>>w)+p]=T<<24|O<<16|Q|0;while(0!==p);for(D=1<<z-1;m&D;)D>>=1;0!==D?
(m&=D-1,m+=D):m=0;L++;if(0===--P[z]){if(z===G)break;z=d[f+x[L]]}if(z>K&&(m&y)!==J){0===w&&(w=K);F+=n;E=z-w;for(D=1<<E;E+w<G;){D-=P[E+w];if(0>=D)break;E++;D<<=1}u+=1<<E;if(1===a&&852<u||2===a&&592<u)return 1;J=m&y;B[J]=K<<24|E<<16|F-A|0}}0!==m&&(B[F+m]=z-w<<24|4194304);I.bits=K;return 0}},{"../utils/common":4}],14:[function(a,d,f){d.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"}},
{}],15:[function(a,d,f){function b(a){for(var b=a.length;0<=--b;)a[b]=0}function e(a,b){a.pending_buf[a.pending++]=b&255;a.pending_buf[a.pending++]=b>>>8&255}function h(a,b,d){a.bi_valid>16-d?(a.bi_buf|=b<<a.bi_valid&65535,e(a,a.bi_buf),a.bi_buf=b>>16-a.bi_valid,a.bi_valid+=d-16):(a.bi_buf|=b<<a.bi_valid&65535,a.bi_valid+=d)}function g(a,b,d){h(a,d[2*b],d[2*b+1])}function k(a,b){var d=0;do d|=a&1,a>>>=1,d<<=1;while(0<--b);return d>>>1}function l(a,b,d){var e=Array(16),f=0,h;for(h=1;15>=h;h++)e[h]=
f=f+d[h-1]<<1;for(d=0;d<=b;d++)f=a[2*d+1],0!==f&&(a[2*d]=k(e[f]++,f))}function q(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 t(a){8<a.bi_valid?e(a,a.bi_buf):0<a.bi_valid&&(a.pending_buf[a.pending++]=a.bi_buf);a.bi_buf=0;a.bi_valid=0}function y(a,b,d,e){var f=2*b,h=2*d;return a[f]<a[h]||a[f]===a[h]&&e[b]<=e[d]}function B(a,b,d){for(var e=a.heap[d],f=d<<
1;f<=a.heap_len;){f<a.heap_len&&y(b,a.heap[f+1],a.heap[f],a.depth)&&f++;if(y(b,e,a.heap[f],a.depth))break;a.heap[d]=a.heap[f];d=f;f<<=1}a.heap[d]=e}function A(a,b,d){var e,f,k=0,l,n;if(0!==a.last_lit){do e=a.pending_buf[a.d_buf+2*k]<<8|a.pending_buf[a.d_buf+2*k+1],f=a.pending_buf[a.l_buf+k],k++,0===e?g(a,f,b):(l=p[f],g(a,l+256+1,b),n=G[l],0!==n&&(f-=J[l],h(a,f,n)),e--,l=256>e?m[e]:m[256+(e>>>7)],g(a,l,d),n=K[l],0!==n&&(e-=H[l],h(a,e,n)));while(k<a.last_lit)}g(a,256,b)}function x(a,b){var d=b.dyn_tree,
e=b.stat_desc.static_tree,f=b.stat_desc.has_stree,h=b.stat_desc.elems,g,m=-1,k;a.heap_len=0;a.heap_max=573;for(g=0;g<h;g++)0!==d[2*g]?(a.heap[++a.heap_len]=m=g,a.depth[g]=0):d[2*g+1]=0;for(;2>a.heap_len;)k=a.heap[++a.heap_len]=2>m?++m:0,d[2*k]=1,a.depth[k]=0,a.opt_len--,f&&(a.static_len-=e[2*k+1]);b.max_code=m;for(g=a.heap_len>>1;1<=g;g--)B(a,d,g);k=h;do g=a.heap[1],a.heap[1]=a.heap[a.heap_len--],B(a,d,1),e=a.heap[1],a.heap[--a.heap_max]=g,a.heap[--a.heap_max]=e,d[2*k]=d[2*g]+d[2*e],a.depth[k]=(a.depth[g]>=
a.depth[e]?a.depth[g]:a.depth[e])+1,d[2*g+1]=d[2*e+1]=k,a.heap[1]=k++,B(a,d,1);while(2<=a.heap_len);a.heap[--a.heap_max]=a.heap[1];g=b.dyn_tree;k=b.max_code;for(var n=b.stat_desc.static_tree,p=b.stat_desc.has_stree,C=b.stat_desc.extra_bits,q=b.stat_desc.extra_base,v=b.stat_desc.max_length,t,H,u=0,h=0;15>=h;h++)a.bl_count[h]=0;g[2*a.heap[a.heap_max]+1]=0;for(e=a.heap_max+1;573>e;e++)f=a.heap[e],h=g[2*g[2*f+1]+1]+1,h>v&&(h=v,u++),g[2*f+1]=h,f>k||(a.bl_count[h]++,t=0,f>=q&&(t=C[f-q]),H=g[2*f],a.opt_len+=
H*(h+t),p&&(a.static_len+=H*(n[2*f+1]+t)));if(0!==u){do{for(h=v-1;0===a.bl_count[h];)h--;a.bl_count[h]--;a.bl_count[h+1]+=2;a.bl_count[v]--;u-=2}while(0<u);for(h=v;0!==h;h--)for(f=a.bl_count[h];0!==f;)n=a.heap[--e],n>k||(g[2*n+1]!==h&&(a.opt_len+=(h-g[2*n+1])*g[2*n],g[2*n+1]=h),f--)}l(d,m,a.bl_count)}function I(a,b,d){var e,f=-1,h,g=b[1],m=0,k=7,l=4;0===g&&(k=138,l=3);b[2*(d+1)+1]=65535;for(e=0;e<=d;e++)h=g,g=b[2*(e+1)+1],++m<k&&h===g||(m<l?a.bl_tree[2*h]+=m:0!==h?(h!==f&&a.bl_tree[2*h]++,a.bl_tree[32]++):
10>=m?a.bl_tree[34]++:a.bl_tree[36]++,m=0,f=h,0===g?(k=138,l=3):h===g?(k=6,l=3):(k=7,l=4))}function F(a,b,d){var e,f=-1,m,k=b[1],l=0,n=7,p=4;0===k&&(n=138,p=3);for(e=0;e<=d;e++)if(m=k,k=b[2*(e+1)+1],!(++l<n&&m===k)){if(l<p){do g(a,m,a.bl_tree);while(0!==--l)}else 0!==m?(m!==f&&(g(a,m,a.bl_tree),l--),g(a,16,a.bl_tree),h(a,l-3,2)):10>=l?(g(a,17,a.bl_tree),h(a,l-3,3)):(g(a,18,a.bl_tree),h(a,l-11,7));l=0;f=m;0===k?(n=138,p=3):m===k?(n=6,p=3):(n=7,p=4)}}function z(a){var b=4093624447,d;for(d=0;31>=d;d++,
b>>>=1)if(b&1&&0!==a.dyn_ltree[2*d])return 0;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return 1;for(d=32;256>d;d++)if(0!==a.dyn_ltree[2*d])return 1;return 0}function L(a,b,d,f){h(a,0+(f?1:0),3);t(a);e(a,d);e(a,~d);n.arraySet(a.pending_buf,a.window,b,d,a.pending);a.pending+=d}var n=a("../utils/common"),G=[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],K=[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],E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],
w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],D=Array(576);b(D);var u=Array(60);b(u);var m=Array(512);b(m);var p=Array(256);b(p);var J=Array(29);b(J);var H=Array(30);b(H);var v=function(a,b,d,e,f){this.static_tree=a;this.extra_bits=b;this.extra_base=d;this.elems=e;this.max_length=f;this.has_stree=a&&a.length},C,P,M,R=function(a,b){this.dyn_tree=a;this.max_code=0;this.stat_desc=b},T=!1;f._tr_init=function(a){if(!T){var b,d,e,f=Array(16);for(e=d=0;28>e;e++)for(J[e]=d,b=0;b<1<<G[e];b++)p[d++]=e;
p[d-1]=e;for(e=d=0;16>e;e++)for(H[e]=d,b=0;b<1<<K[e];b++)m[d++]=e;for(d>>=7;30>e;e++)for(H[e]=d<<7,b=0;b<1<<K[e]-7;b++)m[256+d++]=e;for(b=0;15>=b;b++)f[b]=0;for(b=0;143>=b;)D[2*b+1]=8,b++,f[8]++;for(;255>=b;)D[2*b+1]=9,b++,f[9]++;for(;279>=b;)D[2*b+1]=7,b++,f[7]++;for(;287>=b;)D[2*b+1]=8,b++,f[8]++;l(D,287,f);for(b=0;30>b;b++)u[2*b+1]=5,u[2*b]=k(b,5);C=new v(D,G,257,286,15);P=new v(u,K,0,30,15);M=new v([],E,0,19,7);T=!0}a.l_desc=new R(a.dyn_ltree,C);a.d_desc=new R(a.dyn_dtree,P);a.bl_desc=new R(a.bl_tree,
M);a.bi_buf=0;a.bi_valid=0;q(a)};f._tr_stored_block=L;f._tr_flush_block=function(a,b,d,e){var f,g,m=0;if(0<a.level){2===a.strm.data_type&&(a.strm.data_type=z(a));x(a,a.l_desc);x(a,a.d_desc);I(a,a.dyn_ltree,a.l_desc.max_code);I(a,a.dyn_dtree,a.d_desc.max_code);x(a,a.bl_desc);for(m=18;3<=m&&0===a.bl_tree[2*w[m]+1];m--);a.opt_len+=3*(m+1)+14;f=a.opt_len+3+7>>>3;g=a.static_len+3+7>>>3;g<=f&&(f=g)}else f=g=d+5;if(d+4<=f&&-1!==b)L(a,b,d,e);else if(4===a.strategy||g===f)h(a,2+(e?1:0),3),A(a,D,u);else{h(a,
4+(e?1:0),3);b=a.l_desc.max_code+1;d=a.d_desc.max_code+1;m+=1;h(a,b-257,5);h(a,d-1,5);h(a,m-4,4);for(f=0;f<m;f++)h(a,a.bl_tree[2*w[f]+1],3);F(a,a.dyn_ltree,b-1);F(a,a.dyn_dtree,d-1);A(a,a.dyn_ltree,a.dyn_dtree)}q(a);e&&t(a)};f._tr_tally=function(a,b,d){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]=d&255;a.last_lit++;0===b?a.dyn_ltree[2*d]++:(a.matches++,b--,a.dyn_ltree[2*(p[d]+256+1)]++,a.dyn_dtree[2*(256>b?m[b]:m[256+(b>>>
7)])]++);return a.last_lit===a.lit_bufsize-1};f._tr_align=function(a){h(a,2,3);g(a,256,D);16===a.bi_valid?(e(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):8<=a.bi_valid&&(a.pending_buf[a.pending++]=a.bi_buf&255,a.bi_buf>>=8,a.bi_valid-=8)}},{"../utils/common":4}],16:[function(a,d,f){d.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}},{}],17:[function(a,d,f){var b=
b||{};b.NIFTI1=b.NIFTI1||("undefined"!==typeof a?a("./nifti1.js"):null);b.NIFTI2=b.NIFTI2||("undefined"!==typeof a?a("./nifti2.js"):null);b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);var e=e||("undefined"!==typeof a?a("pako"):null);b.isNIFTI1=function(a){var d,e;d=new DataView(a);a=d.getUint8(b.NIFTI1.MAGIC_NUMBER_LOCATION);e=d.getUint8(b.NIFTI1.MAGIC_NUMBER_LOCATION+1);d=d.getUint8(b.NIFTI1.MAGIC_NUMBER_LOCATION+2);return!(a!==b.NIFTI1.MAGIC_NUMBER[0]||e!==b.NIFTI1.MAGIC_NUMBER[1]||
d!==b.NIFTI1.MAGIC_NUMBER[2])};b.isNIFTI2=function(a){var d,e;d=new DataView(a);a=d.getUint8(b.NIFTI2.MAGIC_NUMBER_LOCATION);e=d.getUint8(b.NIFTI2.MAGIC_NUMBER_LOCATION+1);d=d.getUint8(b.NIFTI2.MAGIC_NUMBER_LOCATION+2);return!(a!==b.NIFTI2.MAGIC_NUMBER[0]||e!==b.NIFTI2.MAGIC_NUMBER[1]||d!==b.NIFTI2.MAGIC_NUMBER[2])};b.isNIFTI=function(a){return b.isNIFTI1(a)||b.isNIFTI2(a)};b.isCompressed=function(a){var d;return a&&(d=new DataView(a),a=d.getUint8(0),d=d.getUint8(1),a===b.Utils.GUNZIP_MAGIC_COOKIE1||
d===b.Utils.GUNZIP_MAGIC_COOKIE2)?!0:!1};b.decompress=function(a){return e.inflate(a).buffer};b.readHeader=function(a){var d=null;b.isCompressed(a)&&(a=b.decompress(a));b.isNIFTI1(a)?d=new b.NIFTI1:b.isNIFTI2(a)&&(d=new b.NIFTI2);d?d.readHeader(a):console.error("That file does not appear to be NIFTI!");return d};b.hasExtension=function(a){return 0!=a.extensionFlag[0]};b.readImage=function(a,b){var d=a.vox_offset,e=1,f=1;a.dims[4]&&(e=a.dims[4]);a.dims[5]&&(f=a.dims[5]);return b.slice(d,d+a.numBitsPerVoxel/
8*a.dims[2]*a.dims[3]*e*f*a.dims[1])};b.readExtension=function(a,b){var d=a.getExtensionLocation();return b.slice(d,d+a.extensionSize)};b.readExtensionData=function(a,b){var d=a.getExtensionLocation();return b.slice(d+8,d+a.extensionSize-8)};"undefined"!==typeof d&&d.exports&&(d.exports=b)},{"./nifti1.js":18,"./nifti2.js":19,"./utilities.js":20,pako:1}],18:[function(a,d,f){var b=b||{};b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.NIFTI1=b.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};b.NIFTI1.TYPE_NONE=0;b.NIFTI1.TYPE_BINARY=1;b.NIFTI1.TYPE_UINT8=2;b.NIFTI1.TYPE_INT16=4;b.NIFTI1.TYPE_INT32=8;b.NIFTI1.TYPE_FLOAT32=16;b.NIFTI1.TYPE_COMPLEX64=32;b.NIFTI1.TYPE_FLOAT64=64;b.NIFTI1.TYPE_RGB24=128;b.NIFTI1.TYPE_INT8=256;b.NIFTI1.TYPE_UINT16=512;b.NIFTI1.TYPE_UINT32=768;b.NIFTI1.TYPE_INT64=1024;b.NIFTI1.TYPE_UINT64=1280;b.NIFTI1.TYPE_FLOAT128=
1536;b.NIFTI1.TYPE_COMPLEX128=1792;b.NIFTI1.TYPE_COMPLEX256=2048;b.NIFTI1.XFORM_UNKNOWN=0;b.NIFTI1.XFORM_SCANNER_ANAT=1;b.NIFTI1.XFORM_ALIGNED_ANAT=2;b.NIFTI1.XFORM_TALAIRACH=3;b.NIFTI1.XFORM_MNI_152=4;b.NIFTI1.SPATIAL_UNITS_MASK=7;b.NIFTI1.TEMPORAL_UNITS_MASK=56;b.NIFTI1.UNITS_UNKNOWN=0;b.NIFTI1.UNITS_METER=1;b.NIFTI1.UNITS_MM=2;b.NIFTI1.UNITS_MICRON=3;b.NIFTI1.UNITS_SEC=8;b.NIFTI1.UNITS_MSEC=16;b.NIFTI1.UNITS_USEC=24;b.NIFTI1.UNITS_HZ=32;b.NIFTI1.UNITS_PPM=40;b.NIFTI1.UNITS_RADS=48;b.NIFTI1.MAGIC_COOKIE=
348;b.NIFTI1.MAGIC_NUMBER_LOCATION=344;b.NIFTI1.MAGIC_NUMBER=[110,43,49];b.NIFTI1.MAGIC_NUMBER2=[110,105,49];b.NIFTI1.EXTENSION_HEADER_SIZE=8;b.NIFTI1.prototype.readHeader=function(a){a=new DataView(a);var d=b.Utils.getIntAt(a,0,this.littleEndian),f,k;d!==b.NIFTI1.MAGIC_COOKIE&&(this.littleEndian=!0,d=b.Utils.getIntAt(a,0,this.littleEndian));if(d!==b.NIFTI1.MAGIC_COOKIE)throw Error("This does not appear to be a NIFTI file!");this.dim_info=b.Utils.getByteAt(a,39);for(f=0;8>f;f+=1)d=40+2*f,this.dims[f]=
b.Utils.getShortAt(a,d,this.littleEndian);this.intent_p1=b.Utils.getFloatAt(a,56,this.littleEndian);this.intent_p2=b.Utils.getFloatAt(a,60,this.littleEndian);this.intent_p3=b.Utils.getFloatAt(a,64,this.littleEndian);this.intent_code=b.Utils.getShortAt(a,68,this.littleEndian);this.datatypeCode=b.Utils.getShortAt(a,70,this.littleEndian);this.numBitsPerVoxel=b.Utils.getShortAt(a,72,this.littleEndian);this.slice_start=b.Utils.getShortAt(a,74,this.littleEndian);for(f=0;8>f;f+=1)d=76+4*f,this.pixDims[f]=
b.Utils.getFloatAt(a,d,this.littleEndian);this.vox_offset=b.Utils.getFloatAt(a,108,this.littleEndian);this.scl_slope=b.Utils.getFloatAt(a,112,this.littleEndian);this.scl_inter=b.Utils.getFloatAt(a,116,this.littleEndian);this.slice_end=b.Utils.getShortAt(a,120,this.littleEndian);this.slice_code=b.Utils.getByteAt(a,122);this.xyzt_units=b.Utils.getByteAt(a,123);this.cal_max=b.Utils.getFloatAt(a,124,this.littleEndian);this.cal_min=b.Utils.getFloatAt(a,128,this.littleEndian);this.slice_duration=b.Utils.getFloatAt(a,
132,this.littleEndian);this.toffset=b.Utils.getFloatAt(a,136,this.littleEndian);this.description=b.Utils.getStringAt(a,148,228);this.aux_file=b.Utils.getStringAt(a,228,252);this.qform_code=b.Utils.getShortAt(a,252,this.littleEndian);this.sform_code=b.Utils.getShortAt(a,254,this.littleEndian);this.quatern_b=b.Utils.getFloatAt(a,256,this.littleEndian);this.quatern_c=b.Utils.getFloatAt(a,260,this.littleEndian);this.quatern_d=b.Utils.getFloatAt(a,264,this.littleEndian);this.qoffset_x=b.Utils.getFloatAt(a,
268,this.littleEndian);this.qoffset_y=b.Utils.getFloatAt(a,272,this.littleEndian);this.qoffset_z=b.Utils.getFloatAt(a,276,this.littleEndian);for(f=0;3>f;f+=1)for(k=0;4>k;k+=1)d=280+4*(4*f+k),this.affine[f][k]=b.Utils.getFloatAt(a,d,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=b.Utils.getStringAt(a,328,344);this.magic=b.Utils.getStringAt(a,344,348);this.isHDR=this.magic===b.NIFTI1.MAGIC_NUMBER2;a.byteLength>b.NIFTI1.MAGIC_COOKIE&&
(this.extensionFlag[0]=b.Utils.getByteAt(a,348),this.extensionFlag[1]=b.Utils.getByteAt(a,349),this.extensionFlag[2]=b.Utils.getByteAt(a,350),this.extensionFlag[3]=b.Utils.getByteAt(a,351),this.extensionFlag[0]&&(this.extensionSize=this.getExtensionSize(a),this.extensionCode=this.getExtensionCode(a)))};b.NIFTI1.prototype.toFormattedString=function(){var a=b.Utils.formatNumber,d;d=""+("Dim Info = "+this.dim_info+"\n");d+="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";d+="Intent Parameters (1-3): "+this.intent_p1+", "+this.intent_p2+", "+this.intent_p3+"\n";d+="Intent Code = "+this.intent_code+"\n";d+="Datatype = "+this.datatypeCode+" ("+this.getDatatypeCodeString(this.datatypeCode)+")\n";d+="Bits Per Voxel = "+this.numBitsPerVoxel+"\n";d+="Slice Start = "+this.slice_start+"\n";d+="Voxel Dimensions (1-8): "+a(this.pixDims[0])+", "+a(this.pixDims[1])+", "+a(this.pixDims[2])+
", "+a(this.pixDims[3])+", "+a(this.pixDims[4])+", "+a(this.pixDims[5])+", "+a(this.pixDims[6])+", "+a(this.pixDims[7])+"\n";d+="Image Offset = "+this.vox_offset+"\n";d+="Data Scale:  Slope = "+a(this.scl_slope)+"  Intercept = "+a(this.scl_inter)+"\n";d+="Slice End = "+this.slice_end+"\n";d+="Slice Code = "+this.slice_code+"\n";d+="Units Code = "+this.xyzt_units+" ("+this.getUnitsCodeString(b.NIFTI1.SPATIAL_UNITS_MASK&this.xyzt_units)+", "+this.getUnitsCodeString(b.NIFTI1.TEMPORAL_UNITS_MASK&this.xyzt_units)+
")\n";d+="Display Range:  Max = "+a(this.cal_max)+"  Min = "+a(this.cal_min)+"\n";d+="Slice Duration = "+this.slice_duration+"\n";d+="Time Axis Shift = "+this.toffset+"\n";d+='Description: "'+this.description+'"\n';d+='Auxiliary File: "'+this.aux_file+'"\n';d+="Q-Form Code = "+this.qform_code+" ("+this.getTransformCodeString(this.qform_code)+")\n";d+="S-Form Code = "+this.sform_code+" ("+this.getTransformCodeString(this.sform_code)+")\n";d+="Quaternion Parameters:  b = "+a(this.quatern_b)+"  c = "+
a(this.quatern_c)+"  d = "+a(this.quatern_d)+"\n";d+="Quaternion Offsets:  x = "+this.qoffset_x+"  y = "+this.qoffset_y+"  z = "+this.qoffset_z+"\n";d+="S-Form Parameters X: "+a(this.affine[0][0])+", "+a(this.affine[0][1])+", "+a(this.affine[0][2])+", "+a(this.affine[0][3])+"\n";d+="S-Form Parameters Y: "+a(this.affine[1][0])+", "+a(this.affine[1][1])+", "+a(this.affine[1][2])+", "+a(this.affine[1][3])+"\n";d+="S-Form Parameters Z: "+a(this.affine[2][0])+", "+a(this.affine[2][1])+", "+a(this.affine[2][2])+
", "+a(this.affine[2][3])+"\n";d+='Intent Name: "'+this.intent_name+'"\n';this.extensionFlag[0]&&(d+="Extension: Size = "+this.extensionSize+"  Code = "+this.extensionCode+"\n");return d};b.NIFTI1.prototype.getDatatypeCodeString=function(a){return a===b.NIFTI1.TYPE_UINT8?"1-Byte Unsigned Integer":a===b.NIFTI1.TYPE_INT16?"2-Byte Signed Integer":a===b.NIFTI1.TYPE_INT32?"4-Byte Signed Integer":a===b.NIFTI1.TYPE_FLOAT32?"4-Byte Float":a===b.NIFTI1.TYPE_FLOAT64?"8-Byte Float":a===b.NIFTI1.TYPE_RGB24?"RGB":
a===b.NIFTI1.TYPE_INT8?"1-Byte Signed Integer":a===b.NIFTI1.TYPE_UINT16?"2-Byte Unsigned Integer":a===b.NIFTI1.TYPE_UINT32?"4-Byte Unsigned Integer":a===b.NIFTI1.TYPE_INT64?"8-Byte Signed Integer":a===b.NIFTI1.TYPE_UINT64?"8-Byte Unsigned Integer":"Unknown"};b.NIFTI1.prototype.getTransformCodeString=function(a){return a===b.NIFTI1.XFORM_SCANNER_ANAT?"Scanner":a===b.NIFTI1.XFORM_ALIGNED_ANAT?"Aligned":a===b.NIFTI1.XFORM_TALAIRACH?"Talairach":a===b.NIFTI1.XFORM_MNI_152?"MNI":"Unknown"};b.NIFTI1.prototype.getUnitsCodeString=
function(a){return a===b.NIFTI1.UNITS_METER?"Meters":a===b.NIFTI1.UNITS_MM?"Millimeters":a===b.NIFTI1.UNITS_MICRON?"Microns":a===b.NIFTI1.UNITS_SEC?"Seconds":a===b.NIFTI1.UNITS_MSEC?"Milliseconds":a===b.NIFTI1.UNITS_USEC?"Microseconds":a===b.NIFTI1.UNITS_HZ?"Hz":a===b.NIFTI1.UNITS_PPM?"PPM":a===b.NIFTI1.UNITS_RADS?"Rads":"Unknown"};b.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])};b.NIFTI1.prototype.convertNiftiQFormToNiftiSForm=function(a,b,d,f,l,q,t,y,B,A){var x=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],I=d;x[3][0]=x[3][1]=x[3][2]=0;x[3][3]=1;d=1-(a*a+b*b+I*I);1E-7>d?(d=1/Math.sqrt(a*a+b*b+I*I),a*=d,b*=d,I*=d,d=0):d=Math.sqrt(d);t=0<t?t:1;y=0<y?y:1;B=0<B?B:1;0>A&&(B=-B);x[0][0]=(d*d+a*a-b*b-I*I)*t;x[0][1]=2*(a*b-d*I)*y;x[0][2]=2*(a*I+d*b)*B;x[1][0]=2*(a*b+d*I)*t;x[1][1]=(d*d+b*b-a*a-I*I)*y;x[1][2]=2*(b*I-d*
a)*B;x[2][0]=2*(a*I-d*b)*t;x[2][1]=2*(b*I+d*a)*y;x[2][2]=(d*d+I*I-b*b-a*a)*B;x[0][3]=f;x[1][3]=l;x[2][3]=q;return x};b.NIFTI1.prototype.convertNiftiSFormToNEMA=function(a){var b,d,f,l,q,t,y,B,A,x,I,F,z,L,n,G;n=[[0,0,0],[0,0,0],[0,0,0]];G=[[0,0,0],[0,0,0],[0,0,0]];b=a[0][0];d=a[0][1];f=a[0][2];l=a[1][0];q=a[1][1];t=a[1][2];y=a[2][0];B=a[2][1];A=a[2][2];a=Math.sqrt(b*b+l*l+y*y);if(0===a)return null;b/=a;l/=a;y/=a;a=Math.sqrt(d*d+q*q+B*B);if(0===a)return null;d/=a;q/=a;B/=a;a=b*d+l*q+y*B;if(1E-4<Math.abs(a)){d-=
a*b;q-=a*l;B-=a*y;a=Math.sqrt(d*d+q*q+B*B);if(0===a)return null;d/=a;q/=a;B/=a}a=Math.sqrt(f*f+t*t+A*A);0===a?(f=l*B-y*q,t=y*d-B*b,A=b*q-l*d):(f/=a,t/=a,A/=a);a=b*f+l*t+y*A;if(1E-4<Math.abs(a)){f-=a*b;t-=a*l;A-=a*y;a=Math.sqrt(f*f+t*t+A*A);if(0===a)return null;f/=a;t/=a;A/=a}a=d*f+q*t+B*A;if(1E-4<Math.abs(a)){f-=a*d;t-=a*q;A-=a*B;a=Math.sqrt(f*f+t*t+A*A);if(0===a)return null;f/=a;t/=a;A/=a}n[0][0]=b;n[0][1]=d;n[0][2]=f;n[1][0]=l;n[1][1]=q;n[1][2]=t;n[2][0]=y;n[2][1]=B;n[2][2]=A;y=this.nifti_mat33_determ(n);
if(0===y)return null;L=-666;b=l=q=t=1;d=2;f=3;for(B=1;3>=B;B+=1)for(A=1;3>=A;A+=1)if(B!==A)for(x=1;3>=x;x+=1)if(B!==x&&A!==x)for(G[0][0]=G[0][1]=G[0][2]=G[1][0]=G[1][1]=G[1][2]=G[2][0]=G[2][1]=G[2][2]=0,I=-1;1>=I;I+=2)for(F=-1;1>=F;F+=2)for(z=-1;1>=z;z+=2)G[0][B-1]=I,G[1][A-1]=F,G[2][x-1]=z,a=this.nifti_mat33_determ(G),0<a*y&&(a=this.nifti_mat33_mul(G,n),a=a[0][0]+a[1][1]+a[2][2],a>L&&(L=a,b=B,d=A,f=x,l=I,q=F,t=z));n=G=a=y=B=A=0;switch(b*l){case 1:n="X";y="+";break;case -1:n="X";y="-";break;case 2:n=
"Y";y="+";break;case -2:n="Y";y="-";break;case 3:n="Z";y="+";break;case -3:n="Z",y="-"}switch(d*q){case 1:G="X";B="+";break;case -1:G="X";B="-";break;case 2:G="Y";B="+";break;case -2:G="Y";B="-";break;case 3:G="Z";B="+";break;case -3:G="Z",B="-"}switch(f*t){case 1:a="X";A="+";break;case -1:a="X";A="-";break;case 2:a="Y";A="+";break;case -2:a="Y";A="-";break;case 3:a="Z";A="+";break;case -3:a="Z",A="-"}return n+G+a+y+B+A};b.NIFTI1.prototype.nifti_mat33_mul=function(a,b){var d=[[0,0,0],[0,0,0],[0,0,
0]],f,l;for(f=0;3>f;f+=1)for(l=0;3>l;l+=1)d[f][l]=a[f][0]*b[0][l]+a[f][1]*b[1][l]+a[f][2]*b[2][l];return d};b.NIFTI1.prototype.nifti_mat33_determ=function(a){var b,d,f,l,q,t,y,B;b=a[0][0];d=a[0][1];f=a[0][2];l=a[1][0];q=a[1][1];t=a[1][2];y=a[2][0];B=a[2][1];a=a[2][2];return b*q*a-b*B*t-l*d*a+l*B*f+y*d*t-y*q*f};b.NIFTI1.prototype.getExtensionLocation=function(){return b.NIFTI1.MAGIC_COOKIE+4};b.NIFTI1.prototype.getExtensionSize=function(a){return b.Utils.getIntAt(a,this.getExtensionLocation(),this.littleEndian)};
b.NIFTI1.prototype.getExtensionCode=function(a){return b.Utils.getIntAt(a,this.getExtensionLocation()+4,this.littleEndian)};"undefined"!==typeof d&&d.exports&&(d.exports=b.NIFTI1)},{"./utilities.js":20}],19:[function(a,d,f){var b=b||{};b.Utils=b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.NIFTI1=b.NIFTI1||("undefined"!==typeof a?a("./nifti1.js"):null);b.NIFTI2=b.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]};b.NIFTI2.MAGIC_COOKIE=
540;b.NIFTI2.MAGIC_NUMBER_LOCATION=4;b.NIFTI2.MAGIC_NUMBER=[110,43,50,0,13,10,26,10];b.NIFTI2.prototype.readHeader=function(a){a=new DataView(a);var d=b.Utils.getIntAt(a,0,this.littleEndian),f,k;d!==b.NIFTI2.MAGIC_COOKIE&&(this.littleEndian=!0,d=b.Utils.getIntAt(a,0,this.littleEndian));if(d!==b.NIFTI2.MAGIC_COOKIE)throw Error("This does not appear to be a NIFTI file!");this.datatypeCode=b.Utils.getShortAt(a,12,this.littleEndian);this.numBitsPerVoxel=b.Utils.getShortAt(a,14,this.littleEndian);for(f=
0;8>f;f+=1)d=16+8*f,this.dims[f]=b.Utils.getLongAt(a,d,this.littleEndian);this.intent_p1=b.Utils.getDoubleAt(a,80,this.littleEndian);this.intent_p2=b.Utils.getDoubleAt(a,88,this.littleEndian);this.intent_p3=b.Utils.getDoubleAt(a,96,this.littleEndian);for(f=0;8>f;f+=1)d=104+8*f,this.pixDims[f]=b.Utils.getDoubleAt(a,d,this.littleEndian);this.vox_offset=b.Utils.getLongAt(a,168,this.littleEndian);this.scl_slope=b.Utils.getDoubleAt(a,176,this.littleEndian);this.scl_inter=b.Utils.getDoubleAt(a,184,this.littleEndian);
this.cal_max=b.Utils.getDoubleAt(a,192,this.littleEndian);this.cal_min=b.Utils.getDoubleAt(a,200,this.littleEndian);this.slice_duration=b.Utils.getDoubleAt(a,208,this.littleEndian);this.toffset=b.Utils.getDoubleAt(a,216,this.littleEndian);this.slice_start=b.Utils.getLongAt(a,224,this.littleEndian);this.slice_end=b.Utils.getLongAt(a,232,this.littleEndian);this.description=b.Utils.getStringAt(a,240,320);this.aux_file=b.Utils.getStringAt(a,320,344);this.qform_code=b.Utils.getIntAt(a,344,this.littleEndian);
this.sform_code=b.Utils.getIntAt(a,348,this.littleEndian);this.quatern_b=b.Utils.getDoubleAt(a,352,this.littleEndian);this.quatern_c=b.Utils.getDoubleAt(a,360,this.littleEndian);this.quatern_d=b.Utils.getDoubleAt(a,368,this.littleEndian);this.qoffset_x=b.Utils.getDoubleAt(a,376,this.littleEndian);this.qoffset_y=b.Utils.getDoubleAt(a,384,this.littleEndian);this.qoffset_z=b.Utils.getDoubleAt(a,392,this.littleEndian);for(f=0;3>f;f+=1)for(k=0;4>k;k+=1)d=400+8*(4*f+k),this.affine[f][k]=b.Utils.getDoubleAt(a,
d,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=b.Utils.getIntAt(a,496,this.littleEndian);this.xyzt_units=b.Utils.getIntAt(a,500,this.littleEndian);this.intent_code=b.Utils.getIntAt(a,504,this.littleEndian);this.intent_name=b.Utils.getStringAt(a,508,524);this.dim_info=b.Utils.getByteAt(a,524);a.byteLength>b.NIFTI2.MAGIC_COOKIE&&(this.extensionFlag[0]=b.Utils.getByteAt(a,540),this.extensionFlag[1]=b.Utils.getByteAt(a,541),this.extensionFlag[2]=
b.Utils.getByteAt(a,542),this.extensionFlag[3]=b.Utils.getByteAt(a,543),this.extensionFlag[0]&&(this.extensionSize=this.getExtensionSize(a),this.extensionCode=this.getExtensionCode(a)))};b.NIFTI2.prototype.toFormattedString=function(){var a=b.Utils.formatNumber,d;d=""+("Datatype = "+ +this.datatypeCode+" ("+this.getDatatypeCodeString(this.datatypeCode)+")\n");d+="Bits Per Voxel =  = "+this.numBitsPerVoxel+"\n";d+="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";d+="Intent Parameters (1-3): "+this.intent_p1+", "+this.intent_p2+", "+this.intent_p3+"\n";d+="Voxel Dimensions (1-8): "+a(this.pixDims[0])+", "+a(this.pixDims[1])+", "+a(this.pixDims[2])+", "+a(this.pixDims[3])+", "+a(this.pixDims[4])+", "+a(this.pixDims[5])+", "+a(this.pixDims[6])+", "+a(this.pixDims[7])+"\n";d+="Image Offset = "+this.vox_offset+"\n";d+="Data Scale:  Slope = "+a(this.scl_slope)+"  Intercept = "+a(this.scl_inter)+
"\n";d+="Display Range:  Max = "+a(this.cal_max)+"  Min = "+a(this.cal_min)+"\n";d+="Slice Duration = "+this.slice_duration+"\n";d+="Time Axis Shift = "+this.toffset+"\n";d+="Slice Start = "+this.slice_start+"\n";d+="Slice End = "+this.slice_end+"\n";d+='Description: "'+this.description+'"\n';d+='Auxiliary File: "'+this.aux_file+'"\n';d+="Q-Form Code = "+this.qform_code+" ("+this.getTransformCodeString(this.qform_code)+")\n";d+="S-Form Code = "+this.sform_code+" ("+this.getTransformCodeString(this.sform_code)+
")\n";d+="Quaternion Parameters:  b = "+a(this.quatern_b)+"  c = "+a(this.quatern_c)+"  d = "+a(this.quatern_d)+"\n";d+="Quaternion Offsets:  x = "+this.qoffset_x+"  y = "+this.qoffset_y+"  z = "+this.qoffset_z+"\n";d+="S-Form Parameters X: "+a(this.affine[0][0])+", "+a(this.affine[0][1])+", "+a(this.affine[0][2])+", "+a(this.affine[0][3])+"\n";d+="S-Form Parameters Y: "+a(this.affine[1][0])+", "+a(this.affine[1][1])+", "+a(this.affine[1][2])+", "+a(this.affine[1][3])+"\n";d+="S-Form Parameters Z: "+
a(this.affine[2][0])+", "+a(this.affine[2][1])+", "+a(this.affine[2][2])+", "+a(this.affine[2][3])+"\n";d+="Slice Code = "+this.slice_code+"\n";d+="Units Code = "+this.xyzt_units+" ("+this.getUnitsCodeString(b.NIFTI1.SPATIAL_UNITS_MASK&this.xyzt_units)+", "+this.getUnitsCodeString(b.NIFTI1.TEMPORAL_UNITS_MASK&this.xyzt_units)+")\n";d+="Intent Code = "+this.intent_code+"\n";d+='Intent Name: "'+this.intent_name+'"\n';return d+="Dim Info = "+this.dim_info+"\n"};b.NIFTI2.prototype.getExtensionLocation=
function(){return b.NIFTI2.MAGIC_COOKIE+4};b.NIFTI2.prototype.getExtensionSize=b.NIFTI1.prototype.getExtensionSize;b.NIFTI2.prototype.getExtensionCode=b.NIFTI1.prototype.getExtensionCode;b.NIFTI2.prototype.getDatatypeCodeString=b.NIFTI1.prototype.getDatatypeCodeString;b.NIFTI2.prototype.getTransformCodeString=b.NIFTI1.prototype.getTransformCodeString;b.NIFTI2.prototype.getUnitsCodeString=b.NIFTI1.prototype.getUnitsCodeString;b.NIFTI2.prototype.getQformMat=b.NIFTI1.prototype.getQformMat;b.NIFTI2.prototype.convertNiftiQFormToNiftiSForm=
b.NIFTI1.prototype.convertNiftiQFormToNiftiSForm;b.NIFTI2.prototype.convertNiftiSFormToNEMA=b.NIFTI1.prototype.convertNiftiSFormToNEMA;b.NIFTI2.prototype.nifti_mat33_mul=b.NIFTI1.prototype.nifti_mat33_mul;b.NIFTI2.prototype.nifti_mat33_determ=b.NIFTI1.prototype.nifti_mat33_determ;"undefined"!==typeof d&&d.exports&&(d.exports=b.NIFTI2)},{"./nifti1.js":18,"./utilities.js":20}],20:[function(a,d,f){var b=b||{};b.Utils=b.Utils||{};b.Utils.crcTable=null;b.Utils.GUNZIP_MAGIC_COOKIE1=31;b.Utils.GUNZIP_MAGIC_COOKIE2=
139;b.Utils.getStringAt=function(a,b,d){for(var f="",l;b<d;b+=1)l=a.getUint8(b),0!==l&&(f+=String.fromCharCode(l));return f};b.Utils.getByteAt=function(a,b){return a.getInt8(b)};b.Utils.getShortAt=function(a,b,d){return a.getInt16(b,d)};b.Utils.getIntAt=function(a,b,d){return a.getInt32(b,d)};b.Utils.getFloatAt=function(a,b,d){return a.getFloat32(b,d)};b.Utils.getDoubleAt=function(a,b,d){return a.getFloat64(b,d)};b.Utils.getLongAt=function(a,d,f){var k,l=[],q=0;for(k=0;8>k;k+=1)l[k]=b.Utils.getByteAt(a,
d+k,f);for(k=l.length-1;0<=k;k--)q=256*q+l[k];return q};b.Utils.toArrayBuffer=function(a){var b,d,f;b=new ArrayBuffer(a.length);d=new Uint8Array(b);for(f=0;f<a.length;f+=1)d[f]=a[f];return b};b.Utils.isString=function(a){return"string"===typeof a||a instanceof String};b.Utils.formatNumber=function(a,d){var f=0,f=b.Utils.isString(a)?Number(a):a,f=d?f.toPrecision(5):f.toPrecision(7);return parseFloat(f)};b.Utils.makeCRCTable=function(){for(var a,b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^
a>>>1:a>>>1;b[d]=a}return b};b.Utils.crc32=function(a){for(var d=b.Utils.crcTable||(b.Utils.crcTable=b.Utils.makeCRCTable()),f=-1,k=0;k<a.byteLength;k++)f=f>>>8^d[(f^a.getUint8(k))&255];return(f^-1)>>>0};"undefined"!==typeof d&&d.exports&&(d.exports=b.Utils)},{}]},{},[17])(17)});
(function(c){"object"===typeof exports&&"undefined"!==typeof module?module.exports=c():"function"===typeof define&&define.amd?define([],c):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).gifti=c()})(function(){return function a(d,f,b){function e(g,l){if(!f[g]){if(!d[g]){var q="function"==typeof require&&require;if(!l&&q)return q(g,!0);if(h)return h(g,!0);q=Error("Cannot find module '"+g+"'");throw q.code="MODULE_NOT_FOUND",q;}q=f[g]={exports:{}};
d[g][0].call(q.exports,function(a){var b=d[g][1][a];return e(b?b:a)},q,q.exports,a,d,f,b)}return f[g].exports}for(var h="function"==typeof require&&require,g=0;g<b.length;g++)e(b[g]);return e}({1:[function(a,d,f){a={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",decodeArrayBuffer:function(a){var d=this._keyStr.indexOf(a.charAt(a.length-1)),f=this._keyStr.indexOf(a.charAt(a.length-2)),g=a.length/4*3;64==d&&g--;64==f&&g--;d=new ArrayBuffer(g);this.decode(a,d,g);return d},
decode:function(a,d,f){var g,k,l,q,t,y=0,B=0;d=d?new Uint8Array(d):new Uint8Array(f);a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(y=0;y<f;y+=3)g=this._keyStr.indexOf(a.charAt(B++)),k=this._keyStr.indexOf(a.charAt(B++)),q=this._keyStr.indexOf(a.charAt(B++)),t=this._keyStr.indexOf(a.charAt(B++)),g=g<<2|k>>4,k=(k&15)<<4|q>>2,l=(q&3)<<6|t,d[y]=g,64!=q&&(d[y+1]=k),64!=t&&(d[y+2]=l);return d}};"undefined"!==typeof d&&d.exports&&(d.exports=a)},{}],2:[function(a,d,f){},{}],3:[function(a,d,f){(function(b){function d(){try{var a=
new Uint8Array(1);a.foo=function(){return 42};return 42===a.foo()&&"function"===typeof a.subarray&&0===a.subarray(1,1).byteLength}catch(b){return!1}}function h(a){if(!(this instanceof h))return 1<arguments.length?new h(a,arguments[1]):new h(a);h.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0);if("number"===typeof a){var b;b=l(this,0>a?0:q(a)|0);if(!h.TYPED_ARRAY_SUPPORT)for(var d=0;d<a;d++)b[d]=0;return b}if("string"===typeof a){b=this;d=1<arguments.length?arguments[1]:"utf8";if("string"!==
typeof d||""===d)d="utf8";var e=y(a,d)|0;b=l(b,e);b.write(a,d);return b}return g(this,a)}function g(a,b){if(h.isBuffer(b)){var d=a,e=q(b.length)|0,d=l(d,e);b.copy(d,0,0,e);return d}if(p(b)){for(var d=a,e=q(b.length)|0,d=l(d,e),f=0;f<e;f+=1)d[f]=b[f]&255;return d}if(null==b)throw new TypeError("must start with number, buffer, array or string");if("undefined"!==typeof ArrayBuffer){if(b.buffer instanceof ArrayBuffer)return k(a,b);if(b instanceof ArrayBuffer)return d=a,b.byteLength,h.TYPED_ARRAY_SUPPORT?
(d=new Uint8Array(b),d.__proto__=h.prototype):d=k(d,new Uint8Array(b)),d}if(b.length){d=a;e=q(b.length)|0;d=l(d,e);for(f=0;f<e;f+=1)d[f]=b[f]&255;return d}d=a;f=0;"Buffer"===b.type&&p(b.data)&&(e=b.data,f=q(e.length)|0);for(var d=l(d,f),g=0;g<f;g+=1)d[g]=e[g]&255;return d}function k(a,b){var d=q(b.length)|0;a=l(a,d);for(var e=0;e<d;e+=1)a[e]=b[e]&255;return a}function l(a,b){h.TYPED_ARRAY_SUPPORT?(a=new Uint8Array(b),a.__proto__=h.prototype):a.length=b;0!==b&&b<=h.poolSize>>>1&&(a.parent=J);return a}
function q(a){if(a>=(h.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(h.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return a|0}function t(a,b){if(!(this instanceof t))return new t(a,b);var d=new h(a,b);delete d.parent;return d}function y(a,b){"string"!==typeof a&&(a=""+a);var d=a.length;if(0===d)return 0;for(var e=!1;;)switch(b){case "ascii":case "binary":case "raw":case "raws":return d;case "utf8":case "utf-8":return E(a).length;
case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return 2*d;case "hex":return d>>>1;case "base64":return u.toByteArray(K(a)).length;default:if(e)return E(a).length;b=(""+b).toLowerCase();e=!0}}function B(a,b,d){var e=!1;b|=0;d=void 0===d||Infinity===d?this.length:d|0;a||(a="utf8");0>b&&(b=0);d>this.length&&(d=this.length);if(d<=b)return"";for(;;)switch(a){case "hex":a=b;b=this.length;if(!a||0>a)a=0;if(!d||0>d||d>b)d=b;for(b="";a<d;a++)e=this[a],e=16>e?"0"+e.toString(16):e.toString(16),b+=e;
return b;case "utf8":case "utf-8":return A(this,b,d);case "ascii":a=b;b="";for(d=Math.min(this.length,d);a<d;a++)b+=String.fromCharCode(this[a]&127);return b;case "binary":a=b;b="";for(d=Math.min(this.length,d);a<d;a++)b+=String.fromCharCode(this[a]);return b;case "base64":return a=b,d=0===a&&d===this.length?u.fromByteArray(this):u.fromByteArray(this.slice(a,d)),d;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":d=this.slice(b,d);a="";for(b=0;b<d.length;b+=2)a+=String.fromCharCode(d[b]+256*
d[b+1]);return a;default:if(e)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase();e=!0}}function A(a,b,d){d=Math.min(a.length,d);for(var e=[];b<d;){var f=a[b],h=null,g=239<f?4:223<f?3:191<f?2:1;if(b+g<=d){var m,l,k;switch(g){case 1:128>f&&(h=f);break;case 2:m=a[b+1];128===(m&192)&&(f=(f&31)<<6|m&63,127<f&&(h=f));break;case 3:m=a[b+1];l=a[b+2];128===(m&192)&&128===(l&192)&&(f=(f&15)<<12|(m&63)<<6|l&63,2047<f&&(55296>f||57343<f)&&(h=f));break;case 4:m=a[b+1],l=a[b+2],k=a[b+3],128===(m&
192)&&128===(l&192)&&128===(k&192)&&(f=(f&15)<<18|(m&63)<<12|(l&63)<<6|k&63,65535<f&&1114112>f&&(h=f))}}null===h?(h=65533,g=1):65535<h&&(h-=65536,e.push(h>>>10&1023|55296),h=56320|h&1023);e.push(h);b+=g}a=e.length;if(a<=H)e=String.fromCharCode.apply(String,e);else{d="";for(b=0;b<a;)d+=String.fromCharCode.apply(String,e.slice(b,b+=H));e=d}return e}function x(a,b,d){if(0!==a%1||0>a)throw new RangeError("offset is not uint");if(a+b>d)throw new RangeError("Trying to access beyond buffer length");}function I(a,
b,d,e,f,g){if(!h.isBuffer(a))throw new TypeError("buffer must be a Buffer instance");if(b>f||b<g)throw new RangeError("value is out of bounds");if(d+e>a.length)throw new RangeError("index out of range");}function F(a,b,d,e){0>b&&(b=65535+b+1);for(var f=0,h=Math.min(a.length-d,2);f<h;f++)a[d+f]=(b&255<<8*(e?f:1-f))>>>8*(e?f:1-f)}function z(a,b,d,e){0>b&&(b=4294967295+b+1);for(var f=0,h=Math.min(a.length-d,4);f<h;f++)a[d+f]=b>>>8*(e?f:3-f)&255}function L(a,b,d,e,f,h){if(d+e>a.length)throw new RangeError("index out of range");
if(0>d)throw new RangeError("index out of range");}function n(a,b,d,e,f){f||L(a,b,d,4,3.4028234663852886E38,-3.4028234663852886E38);m.write(a,b,d,e,23,4);return d+4}function G(a,b,d,e,f){f||L(a,b,d,8,1.7976931348623157E308,-1.7976931348623157E308);m.write(a,b,d,e,52,8);return d+8}function K(a){a=a.trim?a.trim():a.replace(/^\s+|\s+$/g,"");a=a.replace(v,"");if(2>a.length)return"";for(;0!==a.length%4;)a+="=";return a}function E(a,b){b=b||Infinity;for(var d,e=a.length,f=null,h=[],g=0;g<e;g++){d=a.charCodeAt(g);
if(55295<d&&57344>d){if(!f){if(56319<d){-1<(b-=3)&&h.push(239,191,189);continue}else if(g+1===e){-1<(b-=3)&&h.push(239,191,189);continue}f=d;continue}if(56320>d){-1<(b-=3)&&h.push(239,191,189);f=d;continue}d=(f-55296<<10|d-56320)+65536}else f&&-1<(b-=3)&&h.push(239,191,189);f=null;if(128>d){if(0>--b)break;h.push(d)}else if(2048>d){if(0>(b-=2))break;h.push(d>>6|192,d&63|128)}else if(65536>d){if(0>(b-=3))break;h.push(d>>12|224,d>>6&63|128,d&63|128)}else if(1114112>d){if(0>(b-=4))break;h.push(d>>18|
240,d>>12&63|128,d>>6&63|128,d&63|128)}else throw Error("Invalid code point");}return h}function w(a){for(var b=[],d=0;d<a.length;d++)b.push(a.charCodeAt(d)&255);return b}function D(a,b,d,e){for(var f=0;f<e&&!(f+d>=b.length||f>=a.length);f++)b[f+d]=a[f];return f}var u=a("base64-js"),m=a("ieee754"),p=a("isarray");f.Buffer=h;f.SlowBuffer=t;f.INSPECT_MAX_BYTES=50;h.poolSize=8192;var J={};h.TYPED_ARRAY_SUPPORT=void 0!==b.TYPED_ARRAY_SUPPORT?b.TYPED_ARRAY_SUPPORT:d();h._augment=function(a){a.__proto__=
h.prototype;return a};h.TYPED_ARRAY_SUPPORT?(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})):(h.prototype.length=void 0,h.prototype.parent=void 0);h.isBuffer=function(a){return!(null==a||!a._isBuffer)};h.compare=function(a,b){if(!h.isBuffer(a)||!h.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var d=a.length,
e=b.length,f=0,g=Math.min(d,e);f<g&&a[f]===b[f];)++f;f!==g&&(d=a[f],e=b[f]);return d<e?-1:e<d?1:0};h.isEncoding=function(a){switch(String(a).toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "binary":case "base64":case "raw":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return!0;default:return!1}};h.concat=function(a,b){if(!p(a))throw new TypeError("list argument must be an Array of Buffers.");if(0===a.length)return new h(0);var d;if(void 0===b)for(d=b=0;d<a.length;d++)b+=
a[d].length;var e=new h(b),f=0;for(d=0;d<a.length;d++){var g=a[d];g.copy(e,f);f+=g.length}return e};h.byteLength=y;h.prototype._isBuffer=!0;h.prototype.toString=function(){var a=this.length|0;return 0===a?"":0===arguments.length?A(this,0,a):B.apply(this,arguments)};h.prototype.equals=function(a){if(!h.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:0===h.compare(this,a)};h.prototype.inspect=function(){var a="",b=f.INSPECT_MAX_BYTES;0<this.length&&(a=this.toString("hex",
0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... "));return"<Buffer "+a+">"};h.prototype.compare=function(a){if(!h.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?0:h.compare(this,a)};h.prototype.indexOf=function(a,b){function d(a,b,e){for(var f=-1,h=0;e+h<a.length;h++)if(a[e+h]===b[-1===f?0:h-f]){if(-1===f&&(f=h),h-f+1===b.length)return e+f}else f=-1;return-1}2147483647<b?b=2147483647:-2147483648>b&&(b=-2147483648);b>>=0;if(0===this.length||b>=this.length)return-1;
0>b&&(b=Math.max(this.length+b,0));if("string"===typeof a)return 0===a.length?-1:String.prototype.indexOf.call(this,a,b);if(h.isBuffer(a))return d(this,a,b);if("number"===typeof a)return h.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,a,b):d(this,[a],b);throw new TypeError("val must be string, number or Buffer");};h.prototype.write=function(a,b,d,e){if(void 0===b)e="utf8",d=this.length,b=0;else if(void 0===d&&"string"===typeof b)e=b,d=this.length,
b=0;else if(isFinite(b))b|=0,isFinite(d)?(d|=0,void 0===e&&(e="utf8")):(e=d,d=void 0);else{var f=e;e=b;b=d|0;d=f}f=this.length-b;if(void 0===d||d>f)d=f;if(0<a.length&&(0>d||0>b)||b>this.length)throw new RangeError("attempt to write outside buffer bounds");e||(e="utf8");for(f=!1;;)switch(e){case "hex":b=Number(b)||0;e=this.length-b;d?(d=Number(d),d>e&&(d=e)):d=e;e=a.length;if(0!==e%2)throw Error("Invalid hex string");d>e/2&&(d=e/2);for(e=0;e<d;e++){f=parseInt(a.substr(2*e,2),16);if(isNaN(f))throw Error("Invalid hex string");
this[b+e]=f}return e;case "utf8":case "utf-8":return D(E(a,this.length-b),this,b,d);case "ascii":return D(w(a),this,b,d);case "binary":return D(w(a),this,b,d);case "base64":return D(u.toByteArray(K(a)),this,b,d);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":e=this.length-b;for(var h=void 0,h=f=void 0,g=[],m=0;m<a.length&&!(0>(e-=2));m++)h=a.charCodeAt(m),f=h>>8,h%=256,g.push(h),g.push(f);return D(g,this,b,d);default:if(f)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase();
f=!0}};h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var H=4096;h.prototype.slice=function(a,b){var d=this.length;a=~~a;b=void 0===b?d:~~b;0>a?(a+=d,0>a&&(a=0)):a>d&&(a=d);0>b?(b+=d,0>b&&(b=0)):b>d&&(b=d);b<a&&(b=a);if(h.TYPED_ARRAY_SUPPORT)d=this.subarray(a,b),d.__proto__=h.prototype;else for(var e=b-a,d=new h(e,void 0),f=0;f<e;f++)d[f]=this[f+a];d.length&&(d.parent=this.parent||this);return d};h.prototype.readUIntLE=function(a,b,d){a|=0;
b|=0;d||x(a,b,this.length);d=this[a];for(var e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return d};h.prototype.readUIntBE=function(a,b,d){a|=0;b|=0;d||x(a,b,this.length);d=this[a+--b];for(var e=1;0<b&&(e*=256);)d+=this[a+--b]*e;return d};h.prototype.readUInt8=function(a,b){b||x(a,1,this.length);return this[a]};h.prototype.readUInt16LE=function(a,b){b||x(a,2,this.length);return this[a]|this[a+1]<<8};h.prototype.readUInt16BE=function(a,b){b||x(a,2,this.length);return this[a]<<8|this[a+1]};h.prototype.readUInt32LE=
function(a,b){b||x(a,4,this.length);return(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]};h.prototype.readUInt32BE=function(a,b){b||x(a,4,this.length);return 16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])};h.prototype.readIntLE=function(a,b,d){a|=0;b|=0;d||x(a,b,this.length);d=this[a];for(var e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;d>=128*e&&(d-=Math.pow(2,8*b));return d};h.prototype.readIntBE=function(a,b,d){a|=0;b|=0;d||x(a,b,this.length);d=b;for(var e=1,f=this[a+--d];0<d&&(e*=
256);)f+=this[a+--d]*e;f>=128*e&&(f-=Math.pow(2,8*b));return f};h.prototype.readInt8=function(a,b){b||x(a,1,this.length);return this[a]&128?-1*(255-this[a]+1):this[a]};h.prototype.readInt16LE=function(a,b){b||x(a,2,this.length);var d=this[a]|this[a+1]<<8;return d&32768?d|4294901760:d};h.prototype.readInt16BE=function(a,b){b||x(a,2,this.length);var d=this[a+1]|this[a]<<8;return d&32768?d|4294901760:d};h.prototype.readInt32LE=function(a,b){b||x(a,4,this.length);return this[a]|this[a+1]<<8|this[a+2]<<
16|this[a+3]<<24};h.prototype.readInt32BE=function(a,b){b||x(a,4,this.length);return this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]};h.prototype.readFloatLE=function(a,b){b||x(a,4,this.length);return m.read(this,a,!0,23,4)};h.prototype.readFloatBE=function(a,b){b||x(a,4,this.length);return m.read(this,a,!1,23,4)};h.prototype.readDoubleLE=function(a,b){b||x(a,8,this.length);return m.read(this,a,!0,52,8)};h.prototype.readDoubleBE=function(a,b){b||x(a,8,this.length);return m.read(this,a,!1,52,8)};
h.prototype.writeUIntLE=function(a,b,d,e){a=+a;b|=0;d|=0;e||I(this,a,b,d,Math.pow(2,8*d),0);e=1;var f=0;for(this[b]=a&255;++f<d&&(e*=256);)this[b+f]=a/e&255;return b+d};h.prototype.writeUIntBE=function(a,b,d,e){a=+a;b|=0;d|=0;e||I(this,a,b,d,Math.pow(2,8*d),0);e=d-1;var f=1;for(this[b+e]=a&255;0<=--e&&(f*=256);)this[b+e]=a/f&255;return b+d};h.prototype.writeUInt8=function(a,b,d){a=+a;b|=0;d||I(this,a,b,1,255,0);h.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));this[b]=a&255;return b+1};h.prototype.writeUInt16LE=
function(a,b,d){a=+a;b|=0;d||I(this,a,b,2,65535,0);h.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8):F(this,a,b,!0);return b+2};h.prototype.writeUInt16BE=function(a,b,d){a=+a;b|=0;d||I(this,a,b,2,65535,0);h.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a&255):F(this,a,b,!1);return b+2};h.prototype.writeUInt32LE=function(a,b,d){a=+a;b|=0;d||I(this,a,b,4,4294967295,0);h.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=a&255):z(this,a,b,!0);return b+4};h.prototype.writeUInt32BE=
function(a,b,d){a=+a;b|=0;d||I(this,a,b,4,4294967295,0);h.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a&255):z(this,a,b,!1);return b+4};h.prototype.writeIntLE=function(a,b,d,e){a=+a;b|=0;e||(e=Math.pow(2,8*d-1),I(this,a,b,d,e-1,-e));e=0;var f=1,h=0>a?1:0;for(this[b]=a&255;++e<d&&(f*=256);)this[b+e]=(a/f>>0)-h&255;return b+d};h.prototype.writeIntBE=function(a,b,d,e){a=+a;b|=0;e||(e=Math.pow(2,8*d-1),I(this,a,b,d,e-1,-e));e=d-1;var f=1,h=0>a?1:0;for(this[b+e]=a&255;0<=
--e&&(f*=256);)this[b+e]=(a/f>>0)-h&255;return b+d};h.prototype.writeInt8=function(a,b,d){a=+a;b|=0;d||I(this,a,b,1,127,-128);h.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));0>a&&(a=255+a+1);this[b]=a&255;return b+1};h.prototype.writeInt16LE=function(a,b,d){a=+a;b|=0;d||I(this,a,b,2,32767,-32768);h.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8):F(this,a,b,!0);return b+2};h.prototype.writeInt16BE=function(a,b,d){a=+a;b|=0;d||I(this,a,b,2,32767,-32768);h.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a&
255):F(this,a,b,!1);return b+2};h.prototype.writeInt32LE=function(a,b,d){a=+a;b|=0;d||I(this,a,b,4,2147483647,-2147483648);h.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):z(this,a,b,!0);return b+4};h.prototype.writeInt32BE=function(a,b,d){a=+a;b|=0;d||I(this,a,b,4,2147483647,-2147483648);0>a&&(a=4294967295+a+1);h.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a&255):z(this,a,b,!1);return b+4};h.prototype.writeFloatLE=function(a,
b,d){return n(this,a,b,!0,d)};h.prototype.writeFloatBE=function(a,b,d){return n(this,a,b,!1,d)};h.prototype.writeDoubleLE=function(a,b,d){return G(this,a,b,!0,d)};h.prototype.writeDoubleBE=function(a,b,d){return G(this,a,b,!1,d)};h.prototype.copy=function(a,b,d,e){d||(d=0);e||0===e||(e=this.length);b>=a.length&&(b=a.length);b||(b=0);0<e&&e<d&&(e=d);if(e===d||0===a.length||0===this.length)return 0;if(0>b)throw new RangeError("targetStart out of bounds");if(0>d||d>=this.length)throw new RangeError("sourceStart out of bounds");
if(0>e)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length);a.length-b<e-d&&(e=a.length-b+d);var f=e-d;if(this===a&&d<b&&b<e)for(e=f-1;0<=e;e--)a[e+b]=this[e+d];else if(1E3>f||!h.TYPED_ARRAY_SUPPORT)for(e=0;e<f;e++)a[e+b]=this[e+d];else Uint8Array.prototype.set.call(a,this.subarray(d,d+f),b);return f};h.prototype.fill=function(a,b,d){a||(a=0);b||(b=0);d||(d=this.length);if(d<b)throw new RangeError("end < start");if(d!==b&&0!==this.length){if(0>b||b>=this.length)throw new RangeError("start out of bounds");
if(0>d||d>this.length)throw new RangeError("end out of bounds");if("number"===typeof a)for(;b<d;b++)this[b]=a;else{a=E(a.toString());for(var e=a.length;b<d;b++)this[b]=a[b%e]}return this}};var v=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"base64-js":4,ieee754:5,isarray:6}],4:[function(a,d,f){(function(a){function d(a){a=l[a.charCodeAt(0)];return void 0!==a?a:-1}function f(a,b,d){for(var e=[],h=b;h<d;h+=
3)b=(a[h]<<16)+(a[h+1]<<8)+a[h+2],e.push(k[b>>18&63]+k[b>>12&63]+k[b>>6&63]+k[b&63]);return e.join("")}var g,k=[];for(g=0;64>g;g++)k[g]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[g];var l=[];for(g=0;64>g;++g)l["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(g)]=g;l[45]=62;l[95]=63;var q="undefined"!==typeof Uint8Array?Uint8Array:Array;a.toByteArray=function(a){function b(a){k[z++]=a}var f,h,g,l,k;if(0<a.length%4)throw Error("Invalid string. Length must be a multiple of 4");
f=a.length;l="="===a.charAt(f-2)?2:"="===a.charAt(f-1)?1:0;k=new q(3*a.length/4-l);h=0<l?a.length-4:a.length;var z=0;for(f=0;f<h;f+=4)g=d(a.charAt(f))<<18|d(a.charAt(f+1))<<12|d(a.charAt(f+2))<<6|d(a.charAt(f+3)),b((g&16711680)>>16),b((g&65280)>>8),b(g&255);2===l?(g=d(a.charAt(f))<<2|d(a.charAt(f+1))>>4,b(g&255)):1===l&&(g=d(a.charAt(f))<<10|d(a.charAt(f+1))<<4|d(a.charAt(f+2))>>2,b(g>>8&255),b(g&255));return k};a.fromByteArray=function(a){var b,d=a.length%3,e="",g=[],l;b=0;for(l=a.length-d;b<l;b+=
16383)g.push(f(a,b,b+16383>l?l:b+16383));switch(d){case 1:a=a[a.length-1];e+=k[a>>2];e+=k[a<<4&63];e+="==";break;case 2:a=(a[a.length-2]<<8)+a[a.length-1],e+=k[a>>10],e+=k[a>>4&63],e+=k[a<<2&63],e+="="}g.push(e);return g.join("")}})("undefined"===typeof f?this.base64js={}:f)},{}],5:[function(a,d,f){f.read=function(a,d,f,g,k){var l;l=8*k-g-1;var q=(1<<l)-1,t=q>>1,y=-7;k=f?k-1:0;var B=f?-1:1,A=a[d+k];k+=B;f=A&(1<<-y)-1;A>>=-y;for(y+=l;0<y;f=256*f+a[d+k],k+=B,y-=8);l=f&(1<<-y)-1;f>>=-y;for(y+=g;0<y;l=
256*l+a[d+k],k+=B,y-=8);if(0===f)f=1-t;else{if(f===q)return l?NaN:Infinity*(A?-1:1);l+=Math.pow(2,g);f-=t}return(A?-1:1)*l*Math.pow(2,f-g)};f.write=function(a,d,f,g,k,l){var q,t=8*l-k-1,y=(1<<t)-1,B=y>>1,A=23===k?Math.pow(2,-24)-Math.pow(2,-77):0;l=g?0:l-1;var x=g?1:-1,I=0>d||0===d&&0>1/d?1:0;d=Math.abs(d);isNaN(d)||Infinity===d?(d=isNaN(d)?1:0,g=y):(g=Math.floor(Math.log(d)/Math.LN2),1>d*(q=Math.pow(2,-g))&&(g--,q*=2),d=1<=g+B?d+A/q:d+A*Math.pow(2,1-B),2<=d*q&&(g++,q/=2),g+B>=y?(d=0,g=y):1<=g+B?
(d=(d*q-1)*Math.pow(2,k),g+=B):(d=d*Math.pow(2,B-1)*Math.pow(2,k),g=0));for(;8<=k;a[f+l]=d&255,l+=x,d/=256,k-=8);g=g<<k|d;for(t+=k;0<t;a[f+l]=g&255,l+=x,g/=256,t-=8);a[f+l-x]|=128*I}},{}],6:[function(a,d,f){var b={}.toString;d.exports=Array.isArray||function(a){return"[object Array]"==b.call(a)}},{}],7:[function(a,d,f){function b(){this._events=this._events||{};this._maxListeners=this._maxListeners||void 0}function e(a){return"function"===typeof a}function h(a){return"object"===typeof a&&null!==a}
d.exports=b;b.EventEmitter=b;b.prototype._events=void 0;b.prototype._maxListeners=void 0;b.defaultMaxListeners=10;b.prototype.setMaxListeners=function(a){if("number"!==typeof a||0>a||isNaN(a))throw TypeError("n must be a positive number");this._maxListeners=a;return this};b.prototype.emit=function(a){var b,d,f,t;this._events||(this._events={});if("error"===a&&(!this._events.error||h(this._events.error)&&!this._events.error.length)){b=arguments[1];if(b instanceof Error)throw b;throw TypeError('Uncaught, unspecified "error" event.');
}d=this._events[a];if(void 0===d)return!1;if(e(d))switch(arguments.length){case 1:d.call(this);break;case 2:d.call(this,arguments[1]);break;case 3:d.call(this,arguments[1],arguments[2]);break;default:b=Array.prototype.slice.call(arguments,1),d.apply(this,b)}else if(h(d))for(b=Array.prototype.slice.call(arguments,1),t=d.slice(),d=t.length,f=0;f<d;f++)t[f].apply(this,b);return!0};b.prototype.addListener=function(a,d){var f;if(!e(d))throw TypeError("listener must be a function");this._events||(this._events=
{});this._events.newListener&&this.emit("newListener",a,e(d.listener)?d.listener:d);this._events[a]?h(this._events[a])?this._events[a].push(d):this._events[a]=[this._events[a],d]:this._events[a]=d;h(this._events[a])&&!this._events[a].warned&&(f=void 0!==this._maxListeners?this._maxListeners:b.defaultMaxListeners)&&0<f&&this._events[a].length>f&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",
this._events[a].length),"function"===typeof console.trace&&console.trace());return this};b.prototype.on=b.prototype.addListener;b.prototype.once=function(a,b){function d(){this.removeListener(a,d);f||(f=!0,b.apply(this,arguments))}if(!e(b))throw TypeError("listener must be a function");var f=!1;d.listener=b;this.on(a,d);return this};b.prototype.removeListener=function(a,b){var d,f,t;if(!e(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;d=this._events[a];
t=d.length;f=-1;if(d===b||e(d.listener)&&d.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(h(d)){for(;0<t--;)if(d[t]===b||d[t].listener&&d[t].listener===b){f=t;break}if(0>f)return this;1===d.length?(d.length=0,delete this._events[a]):d.splice(f,1);this._events.removeListener&&this.emit("removeListener",a,b)}return this};b.prototype.removeAllListeners=function(a){var b;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?
this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);this.removeAllListeners("removeListener");this._events={};return this}b=this._events[a];if(e(b))this.removeListener(a,b);else if(b)for(;b.length;)this.removeListener(a,b[b.length-1]);delete this._events[a];return this};b.prototype.listeners=function(a){return this._events&&this._events[a]?e(this._events[a])?[this._events[a]]:this._events[a].slice():
[]};b.prototype.listenerCount=function(a){if(this._events){a=this._events[a];if(e(a))return 1;if(a)return a.length}return 0};b.listenerCount=function(a,b){return a.listenerCount(b)}},{}],8:[function(a,d,f){d.exports="function"===typeof Object.create?function(a,d){a.super_=d;a.prototype=Object.create(d.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:function(a,d){a.super_=d;var f=function(){};f.prototype=d.prototype;a.prototype=new f;a.prototype.constructor=a}},{}],9:[function(a,
d,f){d.exports=function(a){return!(null==a||!(a._isBuffer||a.constructor&&"function"===typeof a.constructor.isBuffer&&a.constructor.isBuffer(a)))}},{}],10:[function(a,d,f){d.exports=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)}},{}],11:[function(a,d,f){function b(){l=!1;q.length?k=q.concat(k):t=-1;k.length&&e()}function e(){if(!l){var a=setTimeout(b);l=!0;for(var d=k.length;d;){q=k;for(k=[];++t<d;)q&&q[t].run();t=-1;d=k.length}q=null;l=!1;clearTimeout(a)}}function h(a,
b){this.fun=a;this.array=b}function g(){}a=d.exports={};var k=[],l=!1,q,t=-1;a.nextTick=function(a){var b=Array(arguments.length-1);if(1<arguments.length)for(var d=1;d<arguments.length;d++)b[d-1]=arguments[d];k.push(new h(a,b));1!==k.length||l||setTimeout(e,0)};h.prototype.run=function(){this.fun.apply(null,this.array)};a.title="browser";a.browser=!0;a.env={};a.argv=[];a.version="";a.versions={};a.on=g;a.addListener=g;a.once=g;a.off=g;a.removeListener=g;a.removeAllListeners=g;a.emit=g;a.binding=function(a){throw Error("process.binding is not supported");
};a.cwd=function(){return"/"};a.chdir=function(a){throw Error("process.chdir is not supported");};a.umask=function(){return 0}},{}],12:[function(a,d,f){d.exports=a("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":13}],13:[function(a,d,f){function b(a){if(!(this instanceof b))return new b(a);k.call(this,a);l.call(this,a);a&&!1===a.readable&&(this.readable=!1);a&&!1===a.writable&&(this.writable=!1);this.allowHalfOpen=!0;a&&!1===a.allowHalfOpen&&(this.allowHalfOpen=!1);this.once("end",e)}function e(){this.allowHalfOpen||
this._writableState.ended||g(h,this)}function h(a){a.end()}f=Object.keys||function(a){var b=[],d;for(d in a)b.push(d);return b};d.exports=b;var g=a("process-nextick-args");d=a("core-util-is");d.inherits=a("inherits");var k=a("./_stream_readable"),l=a("./_stream_writable");d.inherits(b,k);a=f(l.prototype);for(d=0;d<a.length;d++)f=a[d],b.prototype[f]||(b.prototype[f]=l.prototype[f])},{"./_stream_readable":15,"./_stream_writable":17,"core-util-is":18,inherits:8,"process-nextick-args":19}],14:[function(a,
d,f){function b(a){if(!(this instanceof b))return new b(a);e.call(this,a)}d.exports=b;var e=a("./_stream_transform");d=a("core-util-is");d.inherits=a("inherits");d.inherits(b,e);b.prototype._transform=function(a,b,d){d(null,a)}},{"./_stream_transform":16,"core-util-is":18,inherits:8}],15:[function(a,d,f){(function(b){function e(b,d){J=J||a("./_stream_duplex");b=b||{};this.objectMode=!!b.objectMode;d instanceof J&&(this.objectMode=this.objectMode||!!b.readableObjectMode);var e=b.highWaterMark,f=this.objectMode?
16:16384;this.highWaterMark=e||0===e?e:f;this.highWaterMark=~~this.highWaterMark;this.buffer=[];this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.reading=this.endEmitted=this.ended=!1;this.sync=!0;this.readableListening=this.emittedReadable=this.needReadable=!1;this.defaultEncoding=b.defaultEncoding||"utf8";this.ranOut=!1;this.awaitDrain=0;this.readingMore=!1;this.encoding=this.decoder=null;b.encoding&&(p||(p=a("string_decoder/").StringDecoder),this.decoder=new p(b.encoding),
this.encoding=b.encoding)}function f(b){J=J||a("./_stream_duplex");if(!(this instanceof f))return new f(b);this._readableState=new e(b,this);this.readable=!0;b&&"function"===typeof b.read&&(this._read=b.read);E.call(this)}function g(a,b,d,e,f){var h;h=d;var g=null;K.isBuffer(h)||"string"===typeof h||null===h||void 0===h||b.objectMode||(g=new TypeError("Invalid non-string/buffer chunk"));(h=g)?a.emit("error",h):null===d?(b.reading=!1,b.ended||(b.decoder&&(d=b.decoder.end())&&d.length&&(b.buffer.push(d),
b.length+=b.objectMode?1:d.length),b.ended=!0,l(a))):b.objectMode||d&&0<d.length?b.ended&&!f?(d=Error("stream.push() after EOF"),a.emit("error",d)):b.endEmitted&&f?(d=Error("stream.unshift() after end event"),a.emit("error",d)):(!b.decoder||f||e||(d=b.decoder.write(d)),f||(b.reading=!1),b.flowing&&0===b.length&&!b.sync?(a.emit("data",d),a.read(0)):(b.length+=b.objectMode?1:d.length,f?b.buffer.unshift(d):b.buffer.push(d),b.needReadable&&l(a)),b.readingMore||(b.readingMore=!0,n(t,a,b))):f||(b.reading=
!1);return!b.ended&&(b.needReadable||b.length<b.highWaterMark||0===b.length)}function k(a,b){if(0===b.length&&b.ended)return 0;if(b.objectMode)return 0===a?0:1;if(null===a||isNaN(a))return b.flowing&&b.buffer.length?b.buffer[0].length:b.length;if(0>=a)return 0;if(a>b.highWaterMark){var d=a;8388608<=d?d=8388608:(d--,d|=d>>>1,d|=d>>>2,d|=d>>>4,d|=d>>>8,d|=d>>>16,d++);b.highWaterMark=d}if(a>b.length){if(b.ended)return b.length;b.needReadable=!0;return 0}return a}function l(a){var b=a._readableState;
b.needReadable=!1;b.emittedReadable||(m("emitReadable",b.flowing),b.emittedReadable=!0,b.sync?n(q,a):q(a))}function q(a){m("emit readable");a.emit("readable");x(a)}function t(a,b){for(var d=b.length;!b.reading&&!b.flowing&&!b.ended&&b.length<b.highWaterMark&&(m("maybeReadMore read 0"),a.read(0),d!==b.length);)d=b.length;b.readingMore=!1}function y(a){return function(){var b=a._readableState;m("pipeOnDrain",b.awaitDrain);b.awaitDrain&&b.awaitDrain--;0===b.awaitDrain&&a.listeners("data").length&&(b.flowing=
!0,x(a))}}function B(a){m("readable nexttick read 0");a.read(0)}function A(a,b){b.reading||(m("resume read 0"),a.read(0));b.resumeScheduled=!1;a.emit("resume");x(a);b.flowing&&!b.reading&&a.read(0)}function x(a){var b=a._readableState;m("flow",b.flowing);if(b.flowing){do var d=a.read();while(null!==d&&b.flowing)}}function I(a,b){var d=b.buffer,e=b.length,f=!!b.decoder,h=!!b.objectMode;if(0===d.length)return null;if(0===e)e=null;else if(h)e=d.shift();else if(!a||a>=e)e=f?d.join(""):1===d.length?d[0]:
K.concat(d,e),d.length=0;else if(a<d[0].length)h=d[0],e=h.slice(0,a),d[0]=h.slice(a);else if(a===d[0].length)e=d.shift();else for(var e=f?"":new K(a),g=0,m=0,l=d.length;m<l&&g<a;m++){var h=d[0],k=Math.min(a-g,h.length);f?e+=h.slice(0,k):h.copy(e,g,0,k);k<h.length?d[0]=h.slice(k):d.shift();g+=k}return e}function F(a){var b=a._readableState;if(0<b.length)throw Error("endReadable called on non-empty stream");b.endEmitted||(b.ended=!0,n(z,b,a))}function z(a,b){a.endEmitted||0!==a.length||(a.endEmitted=
!0,b.readable=!1,b.emit("end"))}function L(a,b){for(var d=0,e=a.length;d<e;d++)b(a[d],d)}d.exports=f;var n=a("process-nextick-args"),G=a("isarray"),K=a("buffer").Buffer;f.ReadableState=e;a("events");var E;try{E=a("stream")}catch(w){}finally{E||(E=a("events").EventEmitter)}var K=a("buffer").Buffer,D=a("core-util-is");D.inherits=a("inherits");var u=a("util"),m;m=u&&u.debuglog?u.debuglog("stream"):function(){};var p;D.inherits(f,E);var J;f.prototype.push=function(a,b){var d=this._readableState;d.objectMode||
"string"!==typeof a||(b=b||d.defaultEncoding,b!==d.encoding&&(a=new K(a,b),b=""));return g(this,d,a,b,!1)};f.prototype.unshift=function(a){return g(this,this._readableState,a,"",!0)};f.prototype.isPaused=function(){return!1===this._readableState.flowing};f.prototype.setEncoding=function(b){p||(p=a("string_decoder/").StringDecoder);this._readableState.decoder=new p(b);this._readableState.encoding=b;return this};f.prototype.read=function(a){m("read",a);var b=this._readableState,d=a;if("number"!==typeof a||
0<a)b.emittedReadable=!1;if(0===a&&b.needReadable&&(b.length>=b.highWaterMark||b.ended))return m("read: emitReadable",b.length,b.ended),0===b.length&&b.ended?F(this):l(this),null;a=k(a,b);if(0===a&&b.ended)return 0===b.length&&F(this),null;var e=b.needReadable;m("need readable",e);if(0===b.length||b.length-a<b.highWaterMark)e=!0,m("length less than watermark",e);if(b.ended||b.reading)e=!1,m("reading or ended",e);e&&(m("do read"),b.reading=!0,b.sync=!0,0===b.length&&(b.needReadable=!0),this._read(b.highWaterMark),
b.sync=!1);e&&!b.reading&&(a=k(d,b));e=0<a?I(a,b):null;null===e&&(b.needReadable=!0,a=0);b.length-=a;0!==b.length||b.ended||(b.needReadable=!0);d!==a&&b.ended&&0===b.length&&F(this);null!==e&&this.emit("data",e);return e};f.prototype._read=function(a){this.emit("error",Error("not implemented"))};f.prototype.pipe=function(a,d){function e(a){m("onunpipe");a===t&&h()}function f(){m("onend");a.end()}function h(){m("cleanup");a.removeListener("close",k);a.removeListener("finish",p);a.removeListener("drain",
x);a.removeListener("error",l);a.removeListener("unpipe",e);t.removeListener("end",f);t.removeListener("end",h);t.removeListener("data",g);A=!0;!u.awaitDrain||a._writableState&&!a._writableState.needDrain||x()}function g(b){m("ondata");!1===a.write(b)&&(1!==u.pipesCount||u.pipes[0]!==a||1!==t.listenerCount("data")||A||(m("false write response, pause",t._readableState.awaitDrain),t._readableState.awaitDrain++),t.pause())}function l(b){m("onerror",b);q();a.removeListener("error",l);0===a.listeners("error").length&&
a.emit("error",b)}function k(){a.removeListener("finish",p);q()}function p(){m("onfinish");a.removeListener("close",k);q()}function q(){m("unpipe");t.unpipe(a)}var t=this,u=this._readableState;switch(u.pipesCount){case 0:u.pipes=a;break;case 1:u.pipes=[u.pipes,a];break;default:u.pipes.push(a)}u.pipesCount+=1;m("pipe count=%d opts=%j",u.pipesCount,d);var z=d&&!1===d.end||a===b.stdout||a===b.stderr?h:f;if(u.endEmitted)n(z);else t.once("end",z);a.on("unpipe",e);var x=y(t);a.on("drain",x);var A=!1;t.on("data",
g);if(a._events&&a._events.error)G(a._events.error)?a._events.error.unshift(l):a._events.error=[l,a._events.error];else a.on("error",l);a.once("close",k);a.once("finish",p);a.emit("pipe",t);u.flowing||(m("pipe resume"),t.resume());return a};f.prototype.unpipe=function(a){var b=this._readableState;if(0===b.pipesCount)return this;if(1===b.pipesCount){if(a&&a!==b.pipes)return this;a||(a=b.pipes);b.pipes=null;b.pipesCount=0;b.flowing=!1;a&&a.emit("unpipe",this);return this}if(!a){a=b.pipes;var d=b.pipesCount;
b.pipes=null;b.pipesCount=0;b.flowing=!1;for(var e=0;e<d;e++)a[e].emit("unpipe",this);return this}a:{for(var e=b.pipes,d=0,f=e.length;d<f;d++)if(e[d]===a){e=d;break a}e=-1}if(-1===e)return this;b.pipes.splice(e,1);--b.pipesCount;1===b.pipesCount&&(b.pipes=b.pipes[0]);a.emit("unpipe",this);return this};f.prototype.on=function(a,b){var d=E.prototype.on.call(this,a,b);"data"===a&&!1!==this._readableState.flowing&&this.resume();if("readable"===a&&this.readable){var e=this._readableState;e.readableListening||
(e.readableListening=!0,e.emittedReadable=!1,e.needReadable=!0,e.reading?e.length&&l(this,e):n(B,this))}return d};f.prototype.addListener=f.prototype.on;f.prototype.resume=function(){var a=this._readableState;a.flowing||(m("resume"),a.flowing=!0,a.resumeScheduled||(a.resumeScheduled=!0,n(A,this,a)));return this};f.prototype.pause=function(){m("call pause flowing=%j",this._readableState.flowing);!1!==this._readableState.flowing&&(m("pause"),this._readableState.flowing=!1,this.emit("pause"));return this};
f.prototype.wrap=function(a){var b=this._readableState,d=!1,e=this;a.on("end",function(){m("wrapped end");if(b.decoder&&!b.ended){var a=b.decoder.end();a&&a.length&&e.push(a)}e.push(null)});a.on("data",function(f){m("wrapped data");b.decoder&&(f=b.decoder.write(f));b.objectMode&&(null===f||void 0===f)||!(b.objectMode||f&&f.length)||e.push(f)||(d=!0,a.pause())});for(var f in a)void 0===this[f]&&"function"===typeof a[f]&&(this[f]=function(b){return function(){return a[b].apply(a,arguments)}}(f));L(["error",
"close","destroy","pause","resume"],function(b){a.on(b,e.emit.bind(e,b))});e._read=function(b){m("wrapped _read",b);d&&(d=!1,a.resume())};return e};f._fromList=I}).call(this,a("_process"))},{"./_stream_duplex":13,_process:11,buffer:3,"core-util-is":18,events:7,inherits:8,isarray:10,"process-nextick-args":19,"string_decoder/":26,util:2}],16:[function(a,d,f){function b(a){this.afterTransform=function(b,d){var e;e=a._transformState;e.transforming=!1;var f=e.writecb;f?(e.writechunk=null,e.writecb=null,
null!==d&&void 0!==d&&a.push(d),f&&f(b),e=a._readableState,e.reading=!1,(e.needReadable||e.length<e.highWaterMark)&&a._read(e.highWaterMark),e=void 0):e=a.emit("error",Error("no writecb in Transform class"));return e};this.transforming=this.needTransform=!1;this.writechunk=this.writecb=null}function e(a){if(!(this instanceof e))return new e(a);g.call(this,a);this._transformState=new b(this);var d=this;this._readableState.needReadable=!0;this._readableState.sync=!1;a&&("function"===typeof a.transform&&
(this._transform=a.transform),"function"===typeof a.flush&&(this._flush=a.flush));this.once("prefinish",function(){"function"===typeof this._flush?this._flush(function(a){h(d,a)}):h(d)})}function h(a,b){if(b)return a.emit("error",b);var d=a._transformState;if(a._writableState.length)throw Error("calling transform done when ws.length != 0");if(d.transforming)throw Error("calling transform done when still transforming");return a.push(null)}d.exports=e;var g=a("./_stream_duplex");d=a("core-util-is");
d.inherits=a("inherits");d.inherits(e,g);e.prototype.push=function(a,b){this._transformState.needTransform=!1;return g.prototype.push.call(this,a,b)};e.prototype._transform=function(a,b,d){throw Error("not implemented");};e.prototype._write=function(a,b,d){var e=this._transformState;e.writecb=d;e.writechunk=a;e.writeencoding=b;e.transforming||(a=this._readableState,(e.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark))};e.prototype._read=function(a){a=this._transformState;
null!==a.writechunk&&a.writecb&&!a.transforming?(a.transforming=!0,this._transform(a.writechunk,a.writeencoding,a.afterTransform)):a.needTransform=!0}},{"./_stream_duplex":13,"core-util-is":18,inherits:8}],17:[function(a,d,f){function b(){}function e(a,b,d){this.chunk=a;this.encoding=b;this.callback=d;this.next=null}function h(b,d){z=z||a("./_stream_duplex");b=b||{};this.objectMode=!!b.objectMode;d instanceof z&&(this.objectMode=this.objectMode||!!b.writableObjectMode);var e=b.highWaterMark,f=this.objectMode?
16:16384;this.highWaterMark=e||0===e?e:f;this.highWaterMark=~~this.highWaterMark;this.finished=this.ended=this.ending=this.needDrain=!1;this.decodeStrings=!1!==b.decodeStrings;this.defaultEncoding=b.defaultEncoding||"utf8";this.length=0;this.writing=!1;this.corked=0;this.sync=!0;this.bufferProcessing=!1;this.onwrite=function(a){var b=d._writableState,e=b.sync,f=b.writecb;b.writing=!1;b.writecb=null;b.length-=b.writelen;b.writelen=0;a?(--b.pendingcb,e?B(f,a):f(a),d._writableState.errorEmitted=!0,d.emit("error",
a)):((a=t(b))||b.corked||b.bufferProcessing||!b.bufferedRequest||q(d,b),e?B(l,d,b,a,f):l(d,b,a,f))};this.writecb=null;this.writelen=0;this.lastBufferedRequest=this.bufferedRequest=null;this.pendingcb=0;this.errorEmitted=this.prefinished=!1}function g(b){z=z||a("./_stream_duplex");if(!(this instanceof g||this instanceof z))return new g(b);this._writableState=new h(b,this);this.writable=!0;b&&("function"===typeof b.write&&(this._write=b.write),"function"===typeof b.writev&&(this._writev=b.writev));
I.call(this)}function k(a,b,d,e,f,h,g){b.writelen=e;b.writecb=g;b.writing=!0;b.sync=!0;d?a._writev(f,b.onwrite):a._write(f,h,b.onwrite);b.sync=!1}function l(a,b,d,e){!d&&0===b.length&&b.needDrain&&(b.needDrain=!1,a.emit("drain"));b.pendingcb--;e();y(a,b)}function q(a,b){b.bufferProcessing=!0;var d=b.bufferedRequest;if(a._writev&&d&&d.next){for(var e=[],f=[];d;)f.push(d.callback),e.push(d),d=d.next;b.pendingcb++;b.lastBufferedRequest=null;k(a,b,!0,b.length,e,"",function(a){for(var d=0;d<f.length;d++)b.pendingcb--,
f[d](a)})}else{for(;d&&(e=d.chunk,k(a,b,!1,b.objectMode?1:e.length,e,d.encoding,d.callback),d=d.next,!b.writing););null===d&&(b.lastBufferedRequest=null)}b.bufferedRequest=d;b.bufferProcessing=!1}function t(a){return a.ending&&0===a.length&&null===a.bufferedRequest&&!a.finished&&!a.writing}function y(a,b){var d=t(b);d&&(0===b.pendingcb?(b.prefinished||(b.prefinished=!0,a.emit("prefinish")),b.finished=!0,a.emit("finish")):b.prefinished||(b.prefinished=!0,a.emit("prefinish")));return d}d.exports=g;
var B=a("process-nextick-args"),A=a("buffer").Buffer;g.WritableState=h;d=a("core-util-is");d.inherits=a("inherits");var x={deprecate:a("util-deprecate")},I;try{I=a("stream")}catch(F){}finally{I||(I=a("events").EventEmitter)}A=a("buffer").Buffer;d.inherits(g,I);var z;h.prototype.getBuffer=function(){for(var a=this.bufferedRequest,b=[];a;)b.push(a),a=a.next;return b};(function(){try{Object.defineProperty(h.prototype,"buffer",{get:x.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(a){}})();
g.prototype.pipe=function(){this.emit("error",Error("Cannot pipe. Not readable."))};g.prototype.write=function(a,d,f){var h=this._writableState,g=!1;"function"===typeof d&&(f=d,d=null);A.isBuffer(a)?d="buffer":d||(d=h.defaultEncoding);"function"!==typeof f&&(f=b);if(h.ended)h=f,a=Error("write after end"),this.emit("error",a),B(h,a);else{var l=f,q=!0;A.isBuffer(a)||"string"===typeof a||null===a||void 0===a||h.objectMode||(q=new TypeError("Invalid non-string/buffer chunk"),this.emit("error",q),B(l,
q),q=!1);q&&(h.pendingcb++,g=d,h.objectMode||!1===h.decodeStrings||"string"!==typeof a||(a=new A(a,g)),A.isBuffer(a)&&(g="buffer"),l=h.objectMode?1:a.length,h.length+=l,d=h.length<h.highWaterMark,d||(h.needDrain=!0),h.writing||h.corked?(l=h.lastBufferedRequest,h.lastBufferedRequest=new e(a,g,f),l?l.next=h.lastBufferedRequest:h.bufferedRequest=h.lastBufferedRequest):k(this,h,!1,l,a,g,f),g=d)}return g};g.prototype.cork=function(){this._writableState.corked++};g.prototype.uncork=function(){var a=this._writableState;
a.corked&&(a.corked--,a.writing||a.corked||a.finished||a.bufferProcessing||!a.bufferedRequest||q(this,a))};g.prototype.setDefaultEncoding=function(a){"string"===typeof a&&(a=a.toLowerCase());if(!(-1<"hex utf8 utf-8 ascii binary base64 ucs2 ucs-2 utf16le utf-16le raw".split(" ").indexOf((a+"").toLowerCase())))throw new TypeError("Unknown encoding: "+a);this._writableState.defaultEncoding=a};g.prototype._write=function(a,b,d){d(Error("not implemented"))};g.prototype._writev=null;g.prototype.end=function(a,
b,d){var e=this._writableState;"function"===typeof a?(d=a,b=a=null):"function"===typeof b&&(d=b,b=null);null!==a&&void 0!==a&&this.write(a,b);e.corked&&(e.corked=1,this.uncork());if(!e.ending&&!e.finished){a=d;e.ending=!0;y(this,e);if(a)if(e.finished)B(a);else this.once("finish",a);e.ended=!0}}},{"./_stream_duplex":13,buffer:3,"core-util-is":18,events:7,inherits:8,"process-nextick-args":19,"util-deprecate":20}],18:[function(a,d,f){(function(a){f.isArray=function(a){return Array.isArray?Array.isArray(a):
"[object Array]"===Object.prototype.toString.call(a)};f.isBoolean=function(a){return"boolean"===typeof a};f.isNull=function(a){return null===a};f.isNullOrUndefined=function(a){return null==a};f.isNumber=function(a){return"number"===typeof a};f.isString=function(a){return"string"===typeof a};f.isSymbol=function(a){return"symbol"===typeof a};f.isUndefined=function(a){return void 0===a};f.isRegExp=function(a){return"[object RegExp]"===Object.prototype.toString.call(a)};f.isObject=function(a){return"object"===
typeof a&&null!==a};f.isDate=function(a){return"[object Date]"===Object.prototype.toString.call(a)};f.isError=function(a){return"[object Error]"===Object.prototype.toString.call(a)||a instanceof Error};f.isFunction=function(a){return"function"===typeof a};f.isPrimitive=function(a){return null===a||"boolean"===typeof a||"number"===typeof a||"string"===typeof a||"symbol"===typeof a||"undefined"===typeof a};f.isBuffer=a.isBuffer}).call(this,{isBuffer:a("../../../../insert-module-globals/node_modules/is-buffer/index.js")})},
{"../../../../insert-module-globals/node_modules/is-buffer/index.js":9}],19:[function(a,d,f){(function(a){function e(d){for(var e=Array(arguments.length-1),f=0;f<e.length;)e[f++]=arguments[f];a.nextTick(function(){d.apply(null,e)})}!a.version||0===a.version.indexOf("v0.")||0===a.version.indexOf("v1.")&&0!==a.version.indexOf("v1.8.")?d.exports=e:d.exports=a.nextTick}).call(this,a("_process"))},{_process:11}],20:[function(a,d,f){(function(a){function e(d){try{if(!a.localStorage)return!1}catch(e){return!1}d=
a.localStorage[d];return null==d?!1:"true"===String(d).toLowerCase()}d.exports=function(a,b){if(e("noDeprecation"))return a;var d=!1;return function(){if(!d){if(e("throwDeprecation"))throw Error(b);e("traceDeprecation")?console.trace(b):console.warn(b);d=!0}return a.apply(this,arguments)}}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],21:[function(a,d,f){d.exports=a("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":14}],
22:[function(a,d,f){var b;a:{try{b=a("stream");break a}catch(e){}b=void 0}f=d.exports=a("./lib/_stream_readable.js");f.Stream=b||f;f.Readable=f;f.Writable=a("./lib/_stream_writable.js");f.Duplex=a("./lib/_stream_duplex.js");f.Transform=a("./lib/_stream_transform.js");f.PassThrough=a("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":13,"./lib/_stream_passthrough.js":14,"./lib/_stream_readable.js":15,"./lib/_stream_transform.js":16,"./lib/_stream_writable.js":17}],23:[function(a,d,f){d.exports=
a("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":16}],24:[function(a,d,f){d.exports=a("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":17}],25:[function(a,d,f){function b(){e.call(this)}d.exports=b;var e=a("events").EventEmitter;a("inherits")(b,e);b.Readable=a("readable-stream/readable.js");b.Writable=a("readable-stream/writable.js");b.Duplex=a("readable-stream/duplex.js");b.Transform=a("readable-stream/transform.js");b.PassThrough=a("readable-stream/passthrough.js");b.Stream=
b;b.prototype.pipe=function(a,b){function d(b){a.writable&&!1===a.write(b)&&A.pause&&A.pause()}function f(){A.readable&&A.resume&&A.resume()}function q(){x||(x=!0,a.end())}function t(){x||(x=!0,"function"===typeof a.destroy&&a.destroy())}function y(a){B();if(0===e.listenerCount(this,"error"))throw a;}function B(){A.removeListener("data",d);a.removeListener("drain",f);A.removeListener("end",q);A.removeListener("close",t);A.removeListener("error",y);a.removeListener("error",y);A.removeListener("end",
B);A.removeListener("close",B);a.removeListener("close",B)}var A=this;A.on("data",d);a.on("drain",f);a._isStdio||b&&!1===b.end||(A.on("end",q),A.on("close",t));var x=!1;A.on("error",y);a.on("error",y);A.on("end",B);A.on("close",B);a.on("close",B);a.emit("pipe",A);return a}},{events:7,inherits:8,"readable-stream/duplex.js":12,"readable-stream/passthrough.js":21,"readable-stream/readable.js":22,"readable-stream/transform.js":23,"readable-stream/writable.js":24}],26:[function(a,d,f){function b(a){return a.toString(this.encoding)}
function e(a){this.charLength=(this.charReceived=a.length%2)?2:0}function h(a){this.charLength=(this.charReceived=a.length%3)?3:0}var g=a("buffer").Buffer,k=g.isEncoding||function(a){switch(a&&a.toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "binary":case "base64":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":case "raw":return!0;default:return!1}};a=f.StringDecoder=function(a){this.encoding=(a||"utf8").toLowerCase().replace(/[-_]/,"");if(a&&!k(a))throw Error("Unknown encoding: "+
a);switch(this.encoding){case "utf8":this.surrogateSize=3;break;case "ucs2":case "utf16le":this.surrogateSize=2;this.detectIncompleteChar=e;break;case "base64":this.surrogateSize=3;this.detectIncompleteChar=h;break;default:this.write=b;return}this.charBuffer=new g(6);this.charLength=this.charReceived=0};a.prototype.write=function(a){for(var b="";this.charLength;){b=a.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:a.length;a.copy(this.charBuffer,this.charReceived,0,b);
this.charReceived+=b;if(this.charReceived<this.charLength)return"";a=a.slice(b,a.length);var b=this.charBuffer.slice(0,this.charLength).toString(this.encoding),d=b.charCodeAt(b.length-1);if(55296<=d&&56319>=d)this.charLength+=this.surrogateSize,b="";else{this.charReceived=this.charLength=0;if(0===a.length)return b;break}}this.detectIncompleteChar(a);var e=a.length;this.charLength&&(a.copy(this.charBuffer,0,a.length-this.charReceived,e),e-=this.charReceived);b+=a.toString(this.encoding,0,e);e=b.length-
1;d=b.charCodeAt(e);return 55296<=d&&56319>=d?(d=this.surrogateSize,this.charLength+=d,this.charReceived+=d,this.charBuffer.copy(this.charBuffer,d,0,d),a.copy(this.charBuffer,0,0,d),b.substring(0,e)):b};a.prototype.detectIncompleteChar=function(a){for(var b=3<=a.length?3:a.length;0<b;b--){var d=a[a.length-b];if(1==b&&6==d>>5){this.charLength=2;break}if(2>=b&&14==d>>4){this.charLength=3;break}if(3>=b&&30==d>>3){this.charLength=4;break}}this.charReceived=b};a.prototype.end=function(a){var b="";a&&a.length&&
(b=this.write(a));this.charReceived&&(a=this.encoding,b+=this.charBuffer.slice(0,this.charReceived).toString(a));return b}},{buffer:3}],27:[function(a,d,f){f=a("./lib/utils/common").assign;var b=a("./lib/deflate"),e=a("./lib/inflate");a=a("./lib/zlib/constants");var h={};f(h,b,e,a);d.exports=h},{"./lib/deflate":28,"./lib/inflate":29,"./lib/utils/common":30,"./lib/zlib/constants":33}],28:[function(a,d,f){function b(a){if(!(this instanceof b))return new b(a);a=this.options=g.assign({level:-1,method:8,
chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},a||{});a.raw&&0<a.windowBits?a.windowBits=-a.windowBits:a.gzip&&0<a.windowBits&&16>a.windowBits&&(a.windowBits+=16);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new q;this.strm.avail_out=0;var d=h.deflateInit2(this.strm,a.level,a.method,a.windowBits,a.memLevel,a.strategy);if(0!==d)throw Error(l[d]);a.header&&h.deflateSetHeader(this.strm,a.header)}function e(a,d){var e=new b(d);e.push(a,!0);if(e.err)throw e.msg;return e.result}
var h=a("./zlib/deflate"),g=a("./utils/common"),k=a("./utils/strings"),l=a("./zlib/messages"),q=a("./zlib/zstream"),t=Object.prototype.toString;b.prototype.push=function(a,b){var d=this.strm,e=this.options.chunkSize,f,l;if(this.ended)return!1;l=b===~~b?b:!0===b?4:0;"string"===typeof a?d.input=k.string2buf(a):"[object ArrayBuffer]"===t.call(a)?d.input=new Uint8Array(a):d.input=a;d.next_in=0;d.avail_in=d.input.length;do{0===d.avail_out&&(d.output=new g.Buf8(e),d.next_out=0,d.avail_out=e);f=h.deflate(d,
l);if(1!==f&&0!==f)return this.onEnd(f),this.ended=!0,!1;if(0===d.avail_out||0===d.avail_in&&(4===l||2===l))if("string"===this.options.to)this.onData(k.buf2binstring(g.shrinkBuf(d.output,d.next_out)));else this.onData(g.shrinkBuf(d.output,d.next_out))}while((0<d.avail_in||0===d.avail_out)&&1!==f);if(4===l)return f=h.deflateEnd(this.strm),this.onEnd(f),this.ended=!0,0===f;2===l&&(this.onEnd(0),d.avail_out=0);return!0};b.prototype.onData=function(a){this.chunks.push(a)};b.prototype.onEnd=function(a){0===
a&&(this.result="string"===this.options.to?this.chunks.join(""):g.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};f.Deflate=b;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)}},{"./utils/common":30,"./utils/strings":31,"./zlib/deflate":35,"./zlib/messages":40,"./zlib/zstream":42}],29:[function(a,d,f){function b(a){if(!(this instanceof b))return new b(a);var d=this.options=g.assign({chunkSize:16384,
windowBits:0,to:""},a||{});d.raw&&0<=d.windowBits&&16>d.windowBits&&(d.windowBits=-d.windowBits,0===d.windowBits&&(d.windowBits=-15));!(0<=d.windowBits&&16>d.windowBits)||a&&a.windowBits||(d.windowBits+=32);15<d.windowBits&&48>d.windowBits&&0===(d.windowBits&15)&&(d.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new t;this.strm.avail_out=0;a=h.inflateInit2(this.strm,d.windowBits);if(a!==l.Z_OK)throw Error(q[a]);this.header=new y;h.inflateGetHeader(this.strm,this.header)}
function e(a,d){var e=new b(d);e.push(a,!0);if(e.err)throw e.msg;return e.result}var h=a("./zlib/inflate"),g=a("./utils/common"),k=a("./utils/strings"),l=a("./zlib/constants"),q=a("./zlib/messages"),t=a("./zlib/zstream"),y=a("./zlib/gzheader"),B=Object.prototype.toString;b.prototype.push=function(a,b){var d=this.strm,e=this.options.chunkSize,f,q,n,t,y,E=!1;if(this.ended)return!1;q=b===~~b?b:!0===b?l.Z_FINISH:l.Z_NO_FLUSH;"string"===typeof a?d.input=k.binstring2buf(a):"[object ArrayBuffer]"===B.call(a)?
d.input=new Uint8Array(a):d.input=a;d.next_in=0;d.avail_in=d.input.length;do{0===d.avail_out&&(d.output=new g.Buf8(e),d.next_out=0,d.avail_out=e);f=h.inflate(d,l.Z_NO_FLUSH);f===l.Z_BUF_ERROR&&!0===E&&(f=l.Z_OK,E=!1);if(f!==l.Z_STREAM_END&&f!==l.Z_OK)return this.onEnd(f),this.ended=!0,!1;if(d.next_out&&(0===d.avail_out||f===l.Z_STREAM_END||0===d.avail_in&&(q===l.Z_FINISH||q===l.Z_SYNC_FLUSH)))if("string"===this.options.to)n=k.utf8border(d.output,d.next_out),t=d.next_out-n,y=k.buf2string(d.output,
n),d.next_out=t,d.avail_out=e-t,t&&g.arraySet(d.output,d.output,n,t,0),this.onData(y);else this.onData(g.shrinkBuf(d.output,d.next_out));0===d.avail_in&&0===d.avail_out&&(E=!0)}while((0<d.avail_in||0===d.avail_out)&&f!==l.Z_STREAM_END);f===l.Z_STREAM_END&&(q=l.Z_FINISH);if(q===l.Z_FINISH)return f=h.inflateEnd(this.strm),this.onEnd(f),this.ended=!0,f===l.Z_OK;q===l.Z_SYNC_FLUSH&&(this.onEnd(l.Z_OK),d.avail_out=0);return!0};b.prototype.onData=function(a){this.chunks.push(a)};b.prototype.onEnd=function(a){a===
l.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):g.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};f.Inflate=b;f.inflate=e;f.inflateRaw=function(a,b){b=b||{};b.raw=!0;return e(a,b)};f.ungzip=e},{"./utils/common":30,"./utils/strings":31,"./zlib/constants":33,"./zlib/gzheader":36,"./zlib/inflate":38,"./zlib/messages":40,"./zlib/zstream":42}],30:[function(a,d,f){a="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;
f.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var d=b.shift();if(d){if("object"!==typeof d)throw new TypeError(d+"must be non-object");for(var e in d)d.hasOwnProperty(e)&&(a[e]=d[e])}}return a};f.shrinkBuf=function(a,b){if(a.length===b)return a;if(a.subarray)return a.subarray(0,b);a.length=b;return a};var b={arraySet:function(a,b,d,e,f){if(b.subarray&&a.subarray)a.set(b.subarray(d,d+e),f);else for(var t=0;t<e;t++)a[f+t]=b[d+t]},flattenChunks:function(a){var b,d,
e,f,t;b=e=0;for(d=a.length;b<d;b++)e+=a[b].length;t=new Uint8Array(e);b=e=0;for(d=a.length;b<d;b++)f=a[b],t.set(f,e),e+=f.length;return t}},e={arraySet:function(a,b,d,e,f){for(var t=0;t<e;t++)a[f+t]=b[d+t]},flattenChunks:function(a){return[].concat.apply([],a)}};f.setTyped=function(a){a?(f.Buf8=Uint8Array,f.Buf16=Uint16Array,f.Buf32=Int32Array,f.assign(f,b)):(f.Buf8=Array,f.Buf16=Array,f.Buf32=Array,f.assign(f,e))};f.setTyped(a)},{}],31:[function(a,d,f){function b(a,b){if(65537>b&&(a.subarray&&g||
!a.subarray&&h))return String.fromCharCode.apply(null,e.shrinkBuf(a,b));for(var d="",f=0;f<b;f++)d+=String.fromCharCode(a[f]);return d}var e=a("./common"),h=!0,g=!0;try{String.fromCharCode.apply(null,[0])}catch(k){h=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(l){g=!1}var q=new e.Buf8(256);for(a=0;256>a;a++)q[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;q[254]=q[254]=1;f.string2buf=function(a){var b,d,f,h,g,l=a.length,k=0;for(h=0;h<l;h++)d=a.charCodeAt(h),55296===(d&64512)&&
h+1<l&&(f=a.charCodeAt(h+1),56320===(f&64512)&&(d=65536+(d-55296<<10)+(f-56320),h++)),k+=128>d?1:2048>d?2:65536>d?3:4;b=new e.Buf8(k);for(h=g=0;g<k;h++)d=a.charCodeAt(h),55296===(d&64512)&&h+1<l&&(f=a.charCodeAt(h+1),56320===(f&64512)&&(d=65536+(d-55296<<10)+(f-56320),h++)),128>d?b[g++]=d:(2048>d?b[g++]=192|d>>>6:(65536>d?b[g++]=224|d>>>12:(b[g++]=240|d>>>18,b[g++]=128|d>>>12&63),b[g++]=128|d>>>6&63),b[g++]=128|d&63);return b};f.buf2binstring=function(a){return b(a,a.length)};f.binstring2buf=function(a){for(var b=
new e.Buf8(a.length),d=0,f=b.length;d<f;d++)b[d]=a.charCodeAt(d);return b};f.buf2string=function(a,d){var e,f,h,g,l=d||a.length,k=Array(2*l);for(e=f=0;e<l;)if(h=a[e++],128>h)k[f++]=h;else if(g=q[h],4<g)k[f++]=65533,e+=g-1;else{for(h&=2===g?31:3===g?15:7;1<g&&e<l;)h=h<<6|a[e++]&63,g--;1<g?k[f++]=65533:65536>h?k[f++]=h:(h-=65536,k[f++]=55296|h>>10&1023,k[f++]=56320|h&1023)}return b(k,f)};f.utf8border=function(a,b){var d;b=b||a.length;b>a.length&&(b=a.length);for(d=b-1;0<=d&&128===(a[d]&192);)d--;return 0>
d||0===d?b:d+q[a[d]]>b?d:b}},{"./common":30}],32:[function(a,d,f){d.exports=function(a,d,f,g){var k=a&65535|0;a=a>>>16&65535|0;for(var l=0;0!==f;){l=2E3<f?2E3:f;f-=l;do k=k+d[g++]|0,a=a+k|0;while(--l);k%=65521;a%=65521}return k|a<<16|0}},{}],33:[function(a,d,f){d.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}},{}],34:[function(a,d,f){var b=function(){for(var a,b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>>1:a>>>1;b[d]=a}return b}();d.exports=function(a,d,f,k){f=k+f;for(a^=-1;k<f;k++)a=a>>>8^b[(a^d[k])&255];return a^-1}},{}],35:[function(a,d,f){function b(a,b){a.msg=D[b];return b}function e(a){for(var b=a.length;0<=--b;)a[b]=0}function h(a){var b=
a.state,d=b.pending;d>a.avail_out&&(d=a.avail_out);0!==d&&(G.arraySet(a.output,b.pending_buf,b.pending_out,d,a.next_out),a.next_out+=d,b.pending_out+=d,a.total_out+=d,a.avail_out-=d,b.pending-=d,0===b.pending&&(b.pending_out=0))}function g(a,b){K._tr_flush_block(a,0<=a.block_start?a.block_start:-1,a.strstart-a.block_start,b);a.block_start=a.strstart;h(a.strm)}function k(a,b){a.pending_buf[a.pending++]=b}function l(a,b){a.pending_buf[a.pending++]=b>>>8&255;a.pending_buf[a.pending++]=b&255}function q(a,
b){var d=a.max_chain_length,e=a.strstart,f,h=a.prev_length,g=a.nice_match,l=a.strstart>a.w_size-262?a.strstart-(a.w_size-262):0,k=a.window,n=a.w_mask,q=a.prev,t=a.strstart+258,u=k[e+h-1],z=k[e+h];a.prev_length>=a.good_match&&(d>>=2);g>a.lookahead&&(g=a.lookahead);do if(f=b,k[f+h]===z&&k[f+h-1]===u&&k[f]===k[e]&&k[++f]===k[e+1]){e+=2;for(f++;k[++e]===k[++f]&&k[++e]===k[++f]&&k[++e]===k[++f]&&k[++e]===k[++f]&&k[++e]===k[++f]&&k[++e]===k[++f]&&k[++e]===k[++f]&&k[++e]===k[++f]&&e<t;);f=258-(t-e);e=t-
258;if(f>h){a.match_start=b;h=f;if(f>=g)break;u=k[e+h-1];z=k[e+h]}}while((b=q[b&n])>l&&0!==--d);return h<=a.lookahead?h:a.lookahead}function t(a){var b=a.w_size,d,e,f,h;do{h=a.window_size-a.lookahead-a.strstart;if(a.strstart>=b+(b-262)){G.arraySet(a.window,a.window,b,b,0);a.match_start-=b;a.strstart-=b;a.block_start-=b;d=e=a.hash_size;do f=a.head[--d],a.head[d]=f>=b?f-b:0;while(--e);d=e=b;do f=a.prev[--d],a.prev[d]=f>=b?f-b:0;while(--e);h+=b}if(0===a.strm.avail_in)break;d=a.strm;e=a.window;f=a.strstart+
a.lookahead;var g=d.avail_in;g>h&&(g=h);0===g?e=0:(d.avail_in-=g,G.arraySet(e,d.input,d.next_in,g,f),1===d.state.wrap?d.adler=E(d.adler,e,g,f):2===d.state.wrap&&(d.adler=w(d.adler,e,g,f)),d.next_in+=g,d.total_in+=g,e=g);a.lookahead+=e;if(3<=a.lookahead+a.insert)for(h=a.strstart-a.insert,a.ins_h=a.window[h],a.ins_h=(a.ins_h<<a.hash_shift^a.window[h+1])&a.hash_mask;a.insert&&!(a.ins_h=(a.ins_h<<a.hash_shift^a.window[h+3-1])&a.hash_mask,a.prev[h&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=h,h++,a.insert--,
3>a.lookahead+a.insert););}while(262>a.lookahead&&0!==a.strm.avail_in)}function y(a,b){for(var d;;){if(262>a.lookahead){t(a);if(262>a.lookahead&&0===b)return 1;if(0===a.lookahead)break}d=0;3<=a.lookahead&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);0!==d&&a.strstart-d<=a.w_size-262&&(a.match_length=q(a,d));if(3<=a.match_length)if(d=K._tr_tally(a,a.strstart-a.match_start,a.match_length-3),a.lookahead-=
a.match_length,a.match_length<=a.max_lazy_match&&3<=a.lookahead){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(0!==--a.match_length);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else d=K._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(d&&
(g(a,!1),0===a.strm.avail_out))return 1}a.insert=2>a.strstart?a.strstart:2;return 4===b?(g(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(g(a,!1),0===a.strm.avail_out)?1:2}function B(a,b){for(var d,e;;){if(262>a.lookahead){t(a);if(262>a.lookahead&&0===b)return 1;if(0===a.lookahead)break}d=0;3<=a.lookahead&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);a.prev_length=a.match_length;a.prev_match=a.match_start;
a.match_length=2;0!==d&&a.prev_length<a.max_lazy_match&&a.strstart-d<=a.w_size-262&&(a.match_length=q(a,d),5>=a.match_length&&(1===a.strategy||3===a.match_length&&4096<a.strstart-a.match_start)&&(a.match_length=2));if(3<=a.prev_length&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-3;d=K._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-3);a.lookahead-=a.prev_length-1;a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+3-1])&a.hash_mask,a.prev[a.strstart&
a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(0!==--a.prev_length);a.match_available=0;a.match_length=2;a.strstart++;if(d&&(g(a,!1),0===a.strm.avail_out))return 1}else if(a.match_available){if((d=K._tr_tally(a,0,a.window[a.strstart-1]))&&g(a,!1),a.strstart++,a.lookahead--,0===a.strm.avail_out)return 1}else a.match_available=1,a.strstart++,a.lookahead--}a.match_available&&(K._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0);a.insert=2>a.strstart?a.strstart:2;return 4===b?(g(a,
!0),0===a.strm.avail_out?3:4):a.last_lit&&(g(a,!1),0===a.strm.avail_out)?1:2}function A(a,b){for(var d,e,f,h=a.window;;){if(258>=a.lookahead){t(a);if(258>=a.lookahead&&0===b)return 1;if(0===a.lookahead)break}a.match_length=0;if(3<=a.lookahead&&0<a.strstart&&(e=a.strstart-1,d=h[e],d===h[++e]&&d===h[++e]&&d===h[++e])){for(f=a.strstart+258;d===h[++e]&&d===h[++e]&&d===h[++e]&&d===h[++e]&&d===h[++e]&&d===h[++e]&&d===h[++e]&&d===h[++e]&&e<f;);a.match_length=258-(f-e);a.match_length>a.lookahead&&(a.match_length=
a.lookahead)}3<=a.match_length?(d=K._tr_tally(a,1,a.match_length-3),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(d=K._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++);if(d&&(g(a,!1),0===a.strm.avail_out))return 1}a.insert=0;return 4===b?(g(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(g(a,!1),0===a.strm.avail_out)?1:2}function x(a,b){for(var d;;){if(0===a.lookahead&&(t(a),0===a.lookahead)){if(0===b)return 1;break}a.match_length=0;d=K._tr_tally(a,0,a.window[a.strstart]);
a.lookahead--;a.strstart++;if(d&&(g(a,!1),0===a.strm.avail_out))return 1}a.insert=0;return 4===b?(g(a,!0),0===a.strm.avail_out?3:4):a.last_lit&&(g(a,!1),0===a.strm.avail_out)?1:2}function I(a,b,d,e,f){this.good_length=a;this.max_lazy=b;this.nice_length=d;this.max_chain=e;this.func=f}function F(){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 G.Buf16(1146);this.dyn_dtree=new G.Buf16(122);this.bl_tree=new G.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 G.Buf16(16);this.heap=new G.Buf16(573);e(this.heap);this.heap_max=this.heap_len=0;this.depth=new G.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 z(a){var d;if(!a||!a.state)return b(a,-2);a.total_in=a.total_out=0;a.data_type=2;d=a.state;d.pending=0;d.pending_out=0;0>d.wrap&&(d.wrap=-d.wrap);d.status=d.wrap?
42:113;a.adler=2===d.wrap?0:1;d.last_flush=0;K._tr_init(d);return 0}function L(a){var b=z(a);0===b&&(a=a.state,a.window_size=2*a.w_size,e(a.head),a.max_lazy_match=u[a.level].max_lazy,a.good_match=u[a.level].good_length,a.nice_match=u[a.level].nice_length,a.max_chain_length=u[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 n(a,d,e,f,h,g){if(!a)return-2;var l=1;-1===d&&(d=6);0>f?(l=0,f=-f):15<f&&
(l=2,f-=16);if(1>h||9<h||8!==e||8>f||15<f||0>d||9<d||0>g||4<g)return b(a,-2);8===f&&(f=9);var k=new F;a.state=k;k.strm=a;k.wrap=l;k.gzhead=null;k.w_bits=f;k.w_size=1<<k.w_bits;k.w_mask=k.w_size-1;k.hash_bits=h+7;k.hash_size=1<<k.hash_bits;k.hash_mask=k.hash_size-1;k.hash_shift=~~((k.hash_bits+3-1)/3);k.window=new G.Buf8(2*k.w_size);k.head=new G.Buf16(k.hash_size);k.prev=new G.Buf16(k.w_size);k.lit_bufsize=1<<h+6;k.pending_buf_size=4*k.lit_bufsize;k.pending_buf=new G.Buf8(k.pending_buf_size);k.d_buf=
k.lit_bufsize>>1;k.l_buf=3*k.lit_bufsize;k.level=d;k.strategy=g;k.method=e;return L(a)}var G=a("../utils/common"),K=a("./trees"),E=a("./adler32"),w=a("./crc32"),D=a("./messages"),u;u=[new I(0,0,0,0,function(a,b){var d=65535;for(d>a.pending_buf_size-5&&(d=a.pending_buf_size-5);;){if(1>=a.lookahead){t(a);if(0===a.lookahead&&0===b)return 1;if(0===a.lookahead)break}a.strstart+=a.lookahead;a.lookahead=0;var e=a.block_start+d;if(0===a.strstart||a.strstart>=e)if(a.lookahead=a.strstart-e,a.strstart=e,g(a,
!1),0===a.strm.avail_out)return 1;if(a.strstart-a.block_start>=a.w_size-262&&(g(a,!1),0===a.strm.avail_out))return 1}a.insert=0;if(4===b)return g(a,!0),0===a.strm.avail_out?3:4;a.strstart>a.block_start&&g(a,!1);return 1}),new I(4,4,8,4,y),new I(4,5,16,8,y),new I(4,6,32,32,y),new I(4,4,16,16,B),new I(8,16,32,32,B),new I(8,16,128,128,B),new I(8,32,128,256,B),new I(32,128,258,1024,B),new I(32,258,258,4096,B)];f.deflateInit=function(a,b){return n(a,b,8,15,8,0)};f.deflateInit2=n;f.deflateReset=L;f.deflateResetKeep=
z;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,d){var f,g,n,q;if(!a||!a.state||5<d||0>d)return a?b(a,-2):-2;g=a.state;if(!a.output||!a.input&&0!==a.avail_in||666===g.status&&4!==d)return b(a,0===a.avail_out?-5:-2);g.strm=a;f=g.last_flush;g.last_flush=d;42===g.status&&(2===g.wrap?(a.adler=0,k(g,31),k(g,139),k(g,8),g.gzhead?(k(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)),k(g,g.gzhead.time&255),k(g,g.gzhead.time>>8&255),k(g,g.gzhead.time>>16&255),k(g,g.gzhead.time>>24&255),k(g,9===g.level?2:2<=g.strategy||2>g.level?4:0),k(g,g.gzhead.os&255),g.gzhead.extra&&g.gzhead.extra.length&&(k(g,g.gzhead.extra.length&255),k(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):(k(g,0),k(g,0),k(g,0),k(g,0),k(g,0),k(g,9===g.level?2:2<=g.strategy||2>g.level?4:0),k(g,3),g.status=113)):(n=8+(g.w_bits-8<<4)<<8,
q=-1,q=2<=g.strategy||2>g.level?0:6>g.level?1:6===g.level?2:3,n|=q<<6,0!==g.strstart&&(n|=32),g.status=113,l(g,n+(31-n%31)),0!==g.strstart&&(l(g,a.adler>>>16),l(g,a.adler&65535)),a.adler=1));if(69===g.status)if(g.gzhead.extra){for(n=g.pending;g.gzindex<(g.gzhead.extra.length&65535)&&(g.pending!==g.pending_buf_size||(g.gzhead.hcrc&&g.pending>n&&(a.adler=w(a.adler,g.pending_buf,g.pending-n,n)),h(a),n=g.pending,g.pending!==g.pending_buf_size));)k(g,g.gzhead.extra[g.gzindex]&255),g.gzindex++;g.gzhead.hcrc&&
g.pending>n&&(a.adler=w(a.adler,g.pending_buf,g.pending-n,n));g.gzindex===g.gzhead.extra.length&&(g.gzindex=0,g.status=73)}else g.status=73;if(73===g.status)if(g.gzhead.name){n=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>n&&(a.adler=w(a.adler,g.pending_buf,g.pending-n,n)),h(a),n=g.pending,g.pending===g.pending_buf_size)){q=1;break}q=g.gzindex<g.gzhead.name.length?g.gzhead.name.charCodeAt(g.gzindex++)&255:0;k(g,q)}while(0!==q);g.gzhead.hcrc&&g.pending>n&&(a.adler=w(a.adler,
g.pending_buf,g.pending-n,n));0===q&&(g.gzindex=0,g.status=91)}else g.status=91;if(91===g.status)if(g.gzhead.comment){n=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>n&&(a.adler=w(a.adler,g.pending_buf,g.pending-n,n)),h(a),n=g.pending,g.pending===g.pending_buf_size)){q=1;break}q=g.gzindex<g.gzhead.comment.length?g.gzhead.comment.charCodeAt(g.gzindex++)&255:0;k(g,q)}while(0!==q);g.gzhead.hcrc&&g.pending>n&&(a.adler=w(a.adler,g.pending_buf,g.pending-n,n));0===q&&(g.status=
103)}else g.status=103;103===g.status&&(g.gzhead.hcrc?(g.pending+2>g.pending_buf_size&&h(a),g.pending+2<=g.pending_buf_size&&(k(g,a.adler&255),k(g,a.adler>>8&255),a.adler=0,g.status=113)):g.status=113);if(0!==g.pending){if(h(a),0===a.avail_out)return g.last_flush=-1,0}else if(0===a.avail_in&&(d<<1)-(4<d?9:0)<=(f<<1)-(4<f?9:0)&&4!==d)return b(a,-5);if(666===g.status&&0!==a.avail_in)return b(a,-5);if(0!==a.avail_in||0!==g.lookahead||0!==d&&666!==g.status){f=2===g.strategy?x(g,d):3===g.strategy?A(g,
d):u[g.level].func(g,d);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===d?K._tr_align(g):5!==d&&(K._tr_stored_block(g,0,0,!1),3===d&&(e(g.head),0===g.lookahead&&(g.strstart=0,g.block_start=0,g.insert=0))),h(a),0===a.avail_out))return g.last_flush=-1,0}if(4!==d)return 0;if(0>=g.wrap)return 1;2===g.wrap?(k(g,a.adler&255),k(g,a.adler>>8&255),k(g,a.adler>>16&255),k(g,a.adler>>24&255),k(g,a.total_in&255),k(g,a.total_in>>8&255),k(g,a.total_in>>16&
255),k(g,a.total_in>>24&255)):(l(g,a.adler>>>16),l(g,a.adler&65535));h(a);0<g.wrap&&(g.wrap=-g.wrap);return 0!==g.pending?0:1};f.deflateEnd=function(a){var d;if(!a||!a.state)return-2;d=a.state.status;if(42!==d&&69!==d&&73!==d&&91!==d&&103!==d&&113!==d&&666!==d)return b(a,-2);a.state=null;return 113===d?b(a,-3):0};f.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":30,"./adler32":32,"./crc32":34,"./messages":40,"./trees":41}],36:[function(a,d,f){d.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}},{}],37:[function(a,d,f){d.exports=function(a,d){var f,g,k,l,q,t,y,B,A,x,I,F,z,L,n,G,K,E,w,D,u,m,p,J;f=a.state;g=a.next_in;p=a.input;k=g+(a.avail_in-5);l=a.next_out;J=a.output;q=l-(d-a.avail_out);t=l+(a.avail_out-257);y=f.dmax;B=f.wsize;A=f.whave;x=f.wnext;I=f.window;F=f.hold;z=f.bits;L=f.lencode;n=f.distcode;G=(1<<f.lenbits)-1;K=(1<<f.distbits)-1;a:do b:for(15>z&&(F+=p[g++]<<z,z+=8,F+=p[g++]<<
z,z+=8),E=L[F&G];;){w=E>>>24;F>>>=w;z-=w;w=E>>>16&255;if(0===w)J[l++]=E&65535;else if(w&16){D=E&65535;if(w&=15)z<w&&(F+=p[g++]<<z,z+=8),D+=F&(1<<w)-1,F>>>=w,z-=w;15>z&&(F+=p[g++]<<z,z+=8,F+=p[g++]<<z,z+=8);E=n[F&K];c:for(;;){w=E>>>24;F>>>=w;z-=w;w=E>>>16&255;if(w&16){E&=65535;w&=15;z<w&&(F+=p[g++]<<z,z+=8,z<w&&(F+=p[g++]<<z,z+=8));E+=F&(1<<w)-1;if(E>y){a.msg="invalid distance too far back";f.mode=30;break a}F>>>=w;z-=w;w=l-q;if(E>w){w=E-w;if(w>A&&f.sane){a.msg="invalid distance too far back";f.mode=
30;break a}u=0;m=I;if(0===x){if(u+=B-w,w<D){D-=w;do J[l++]=I[u++];while(--w);u=l-E;m=J}}else if(x<w){if(u+=B+x-w,w-=x,w<D){D-=w;do J[l++]=I[u++];while(--w);u=0;if(x<D){w=x;D-=w;do J[l++]=I[u++];while(--w);u=l-E;m=J}}}else if(u+=x-w,w<D){D-=w;do J[l++]=I[u++];while(--w);u=l-E;m=J}for(;2<D;)J[l++]=m[u++],J[l++]=m[u++],J[l++]=m[u++],D-=3;D&&(J[l++]=m[u++],1<D&&(J[l++]=m[u++]))}else{u=l-E;do J[l++]=J[u++],J[l++]=J[u++],J[l++]=J[u++],D-=3;while(2<D);D&&(J[l++]=J[u++],1<D&&(J[l++]=J[u++]))}}else if(0===
(w&64)){E=n[(E&65535)+(F&(1<<w)-1)];continue c}else{a.msg="invalid distance code";f.mode=30;break a}break}}else if(0===(w&64)){E=L[(E&65535)+(F&(1<<w)-1)];continue b}else{w&32?f.mode=12:(a.msg="invalid literal/length code",f.mode=30);break a}break}while(g<k&&l<t);D=z>>3;g-=D;z-=D<<3;a.next_in=g;a.next_out=l;a.avail_in=g<k?5+(k-g):5-(g-k);a.avail_out=l<t?257+(t-l):257-(l-t);f.hold=F&(1<<z)-1;f.bits=z}},{}],38:[function(a,d,f){function b(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 q.Buf16(320);this.work=new q.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function h(a){var b;
if(!a||!a.state)return-2;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 q.Buf32(852);b.distcode=b.distdyn=new q.Buf32(592);b.sane=1;b.back=-1;return 0}function g(a){var b;if(!a||!a.state)return-2;b=a.state;b.wsize=0;b.whave=0;b.wnext=0;return h(a)}function k(a,b){var d,e;if(!a||!a.state)return-2;e=a.state;0>b?(d=0,b=-b):(d=(b>>4)+1,48>b&&(b&=15));if(b&&(8>b||15<b))return-2;
null!==e.window&&e.wbits!==b&&(e.window=null);e.wrap=d;e.wbits=b;return g(a)}function l(a,b){var d;if(!a)return-2;d=new e;a.state=d;d.window=null;d=k(a,b);0!==d&&(a.state=null);return d}var q=a("../utils/common"),t=a("./adler32"),y=a("./crc32"),B=a("./inffast"),A=a("./inftrees"),x=!0,I,F;f.inflateReset=g;f.inflateReset2=k;f.inflateResetKeep=h;f.inflateInit=function(a){return l(a,15)};f.inflateInit2=l;f.inflate=function(a,d){var e,f,h,g,l,k,u,m,p,J,H,v,C,P,M=0,R,T,O,Q=new q.Buf8(4),U=[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;e=a.state;12===e.mode&&(e.mode=13);l=a.next_out;h=a.output;u=a.avail_out;g=a.next_in;f=a.input;k=a.avail_in;m=e.hold;p=e.bits;J=k;H=u;O=0;a:for(;;)switch(e.mode){case 1:if(0===e.wrap){e.mode=13;break}for(;16>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}if(e.wrap&2&&35615===m){e.check=0;Q[0]=m&255;Q[1]=m>>>8&255;e.check=y(e.check,Q,2,0);p=m=0;e.mode=2;break}e.flags=0;e.head&&(e.head.done=!1);if(!(e.wrap&
1)||(((m&255)<<8)+(m>>8))%31){a.msg="incorrect header check";e.mode=30;break}if(8!==(m&15)){a.msg="unknown compression method";e.mode=30;break}m>>>=4;p-=4;C=(m&15)+8;if(0===e.wbits)e.wbits=C;else if(C>e.wbits){a.msg="invalid window size";e.mode=30;break}e.dmax=1<<C;a.adler=e.check=1;e.mode=m&512?10:12;p=m=0;break;case 2:for(;16>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.flags=m;if(8!==(e.flags&255)){a.msg="unknown compression method";e.mode=30;break}if(e.flags&57344){a.msg="unknown header flags set";
e.mode=30;break}e.head&&(e.head.text=m>>8&1);e.flags&512&&(Q[0]=m&255,Q[1]=m>>>8&255,e.check=y(e.check,Q,2,0));p=m=0;e.mode=3;case 3:for(;32>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.head&&(e.head.time=m);e.flags&512&&(Q[0]=m&255,Q[1]=m>>>8&255,Q[2]=m>>>16&255,Q[3]=m>>>24&255,e.check=y(e.check,Q,4,0));p=m=0;e.mode=4;case 4:for(;16>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.head&&(e.head.xflags=m&255,e.head.os=m>>8);e.flags&512&&(Q[0]=m&255,Q[1]=m>>>8&255,e.check=y(e.check,Q,2,0));p=m=0;e.mode=
5;case 5:if(e.flags&1024){for(;16>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.length=m;e.head&&(e.head.extra_len=m);e.flags&512&&(Q[0]=m&255,Q[1]=m>>>8&255,e.check=y(e.check,Q,2,0));p=m=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(e.flags&1024&&(v=e.length,v>k&&(v=k),v&&(e.head&&(C=e.head.extra_len-e.length,e.head.extra||(e.head.extra=Array(e.head.extra_len)),q.arraySet(e.head.extra,f,g,v,C)),e.flags&512&&(e.check=y(e.check,f,v,g)),k-=v,g+=v,e.length-=v),e.length))break a;e.length=0;e.mode=
7;case 7:if(e.flags&2048){if(0===k)break a;v=0;do C=f[g+v++],e.head&&C&&65536>e.length&&(e.head.name+=String.fromCharCode(C));while(C&&v<k);e.flags&512&&(e.check=y(e.check,f,v,g));k-=v;g+=v;if(C)break a}else e.head&&(e.head.name=null);e.length=0;e.mode=8;case 8:if(e.flags&4096){if(0===k)break a;v=0;do C=f[g+v++],e.head&&C&&65536>e.length&&(e.head.comment+=String.fromCharCode(C));while(C&&v<k);e.flags&512&&(e.check=y(e.check,f,v,g));k-=v;g+=v;if(C)break a}else e.head&&(e.head.comment=null);e.mode=
9;case 9:if(e.flags&512){for(;16>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}if(m!==(e.check&65535)){a.msg="header crc mismatch";e.mode=30;break}p=m=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0);a.adler=e.check=0;e.mode=12;break;case 10:for(;32>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}a.adler=e.check=b(m);p=m=0;e.mode=11;case 11:if(0===e.havedict)return a.next_out=l,a.avail_out=u,a.next_in=g,a.avail_in=k,e.hold=m,e.bits=p,2;a.adler=e.check=1;e.mode=12;case 12:if(5===d||6===d)break a;case 13:if(e.last){m>>>=
p&7;p-=p&7;e.mode=27;break}for(;3>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.last=m&1;m>>>=1;--p;switch(m&3){case 0:e.mode=14;break;case 1:v=e;if(x){C=void 0;I=new q.Buf32(512);F=new q.Buf32(32);for(C=0;144>C;)v.lens[C++]=8;for(;256>C;)v.lens[C++]=9;for(;280>C;)v.lens[C++]=7;for(;288>C;)v.lens[C++]=8;A(1,v.lens,0,288,I,0,v.work,{bits:9});for(C=0;32>C;)v.lens[C++]=5;A(2,v.lens,0,32,F,0,v.work,{bits:5});x=!1}v.lencode=I;v.lenbits=9;v.distcode=F;v.distbits=5;e.mode=20;if(6===d){m>>>=2;p-=2;break a}break;
case 2:e.mode=17;break;case 3:a.msg="invalid block type",e.mode=30}m>>>=2;p-=2;break;case 14:m>>>=p&7;for(p-=p&7;32>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}if((m&65535)!==(m>>>16^65535)){a.msg="invalid stored block lengths";e.mode=30;break}e.length=m&65535;p=m=0;e.mode=15;if(6===d)break a;case 15:e.mode=16;case 16:if(v=e.length){v>k&&(v=k);v>u&&(v=u);if(0===v)break a;q.arraySet(h,f,g,v,l);k-=v;g+=v;u-=v;l+=v;e.length-=v;break}e.mode=12;break;case 17:for(;14>p;){if(0===k)break a;k--;m+=f[g++]<<
p;p+=8}e.nlen=(m&31)+257;m>>>=5;p-=5;e.ndist=(m&31)+1;m>>>=5;p-=5;e.ncode=(m&15)+4;m>>>=4;p-=4;if(286<e.nlen||30<e.ndist){a.msg="too many length or distance symbols";e.mode=30;break}e.have=0;e.mode=18;case 18:for(;e.have<e.ncode;){for(;3>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.lens[U[e.have++]]=m&7;m>>>=3;p-=3}for(;19>e.have;)e.lens[U[e.have++]]=0;e.lencode=e.lendyn;e.lenbits=7;v={bits:e.lenbits};O=A(0,e.lens,0,19,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid code lengths set";
e.mode=30;break}e.have=0;e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;;){M=e.lencode[m&(1<<e.lenbits)-1];v=M>>>24;M&=65535;if(v<=p)break;if(0===k)break a;k--;m+=f[g++]<<p;p+=8}if(16>M)m>>>=v,p-=v,e.lens[e.have++]=M;else{if(16===M){for(C=v+2;p<C;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}m>>>=v;p-=v;if(0===e.have){a.msg="invalid bit length repeat";e.mode=30;break}C=e.lens[e.have-1];v=3+(m&3);m>>>=2;p-=2}else if(17===M){for(C=v+3;p<C;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}m>>>=v;p-=v;C=0;v=3+
(m&7);m>>>=3;p-=3}else{for(C=v+7;p<C;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}m>>>=v;p-=v;C=0;v=11+(m&127);m>>>=7;p-=7}if(e.have+v>e.nlen+e.ndist){a.msg="invalid bit length repeat";e.mode=30;break}for(;v--;)e.lens[e.have++]=C}}if(30===e.mode)break;if(0===e.lens[256]){a.msg="invalid code -- missing end-of-block";e.mode=30;break}e.lenbits=9;v={bits:e.lenbits};O=A(1,e.lens,0,e.nlen,e.lencode,0,e.work,v);e.lenbits=v.bits;if(O){a.msg="invalid literal/lengths set";e.mode=30;break}e.distbits=6;e.distcode=
e.distdyn;v={bits:e.distbits};O=A(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,v);e.distbits=v.bits;if(O){a.msg="invalid distances set";e.mode=30;break}e.mode=20;if(6===d)break a;case 20:e.mode=21;case 21:if(6<=k&&258<=u){a.next_out=l;a.avail_out=u;a.next_in=g;a.avail_in=k;e.hold=m;e.bits=p;B(a,H);l=a.next_out;h=a.output;u=a.avail_out;g=a.next_in;f=a.input;k=a.avail_in;m=e.hold;p=e.bits;12===e.mode&&(e.back=-1);break}for(e.back=0;;){M=e.lencode[m&(1<<e.lenbits)-1];v=M>>>24;C=M>>>16&255;M&=65535;if(v<=
p)break;if(0===k)break a;k--;m+=f[g++]<<p;p+=8}if(C&&0===(C&240)){P=v;R=C;for(T=M;;){M=e.lencode[T+((m&(1<<P+R)-1)>>P)];v=M>>>24;C=M>>>16&255;M&=65535;if(P+v<=p)break;if(0===k)break a;k--;m+=f[g++]<<p;p+=8}m>>>=P;p-=P;e.back+=P}m>>>=v;p-=v;e.back+=v;e.length=M;if(0===C){e.mode=26;break}if(C&32){e.back=-1;e.mode=12;break}if(C&64){a.msg="invalid literal/length code";e.mode=30;break}e.extra=C&15;e.mode=22;case 22:if(e.extra){for(C=e.extra;p<C;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.length+=m&(1<<
e.extra)-1;m>>>=e.extra;p-=e.extra;e.back+=e.extra}e.was=e.length;e.mode=23;case 23:for(;;){M=e.distcode[m&(1<<e.distbits)-1];v=M>>>24;C=M>>>16&255;M&=65535;if(v<=p)break;if(0===k)break a;k--;m+=f[g++]<<p;p+=8}if(0===(C&240)){P=v;R=C;for(T=M;;){M=e.distcode[T+((m&(1<<P+R)-1)>>P)];v=M>>>24;C=M>>>16&255;M&=65535;if(P+v<=p)break;if(0===k)break a;k--;m+=f[g++]<<p;p+=8}m>>>=P;p-=P;e.back+=P}m>>>=v;p-=v;e.back+=v;if(C&64){a.msg="invalid distance code";e.mode=30;break}e.offset=M;e.extra=C&15;e.mode=24;case 24:if(e.extra){for(C=
e.extra;p<C;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}e.offset+=m&(1<<e.extra)-1;m>>>=e.extra;p-=e.extra;e.back+=e.extra}if(e.offset>e.dmax){a.msg="invalid distance too far back";e.mode=30;break}e.mode=25;case 25:if(0===u)break a;v=H-u;if(e.offset>v){v=e.offset-v;if(v>e.whave&&e.sane){a.msg="invalid distance too far back";e.mode=30;break}v>e.wnext?(v-=e.wnext,C=e.wsize-v):C=e.wnext-v;v>e.length&&(v=e.length);P=e.window}else P=h,C=l-e.offset,v=e.length;v>u&&(v=u);u-=v;e.length-=v;do h[l++]=P[C++];while(--v);
0===e.length&&(e.mode=21);break;case 26:if(0===u)break a;h[l++]=e.length;u--;e.mode=21;break;case 27:if(e.wrap){for(;32>p;){if(0===k)break a;k--;m|=f[g++]<<p;p+=8}H-=u;a.total_out+=H;e.total+=H;H&&(a.adler=e.check=e.flags?y(e.check,h,H,l-H):t(e.check,h,H,l-H));H=u;if((e.flags?m:b(m))!==e.check){a.msg="incorrect data check";e.mode=30;break}p=m=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;32>p;){if(0===k)break a;k--;m+=f[g++]<<p;p+=8}if(m!==(e.total&4294967295)){a.msg="incorrect length check";e.mode=
30;break}p=m=0}e.mode=29;case 29:O=1;break a;case 30:O=-3;break a;case 31:return-4;default:return-2}a.next_out=l;a.avail_out=u;a.next_in=g;a.avail_in=k;e.hold=m;e.bits=p;if(e.wsize||H!==a.avail_out&&30>e.mode&&(27>e.mode||4!==d))f=a.output,g=a.next_out,l=H-a.avail_out,u=a.state,null===u.window&&(u.wsize=1<<u.wbits,u.wnext=0,u.whave=0,u.window=new q.Buf8(u.wsize)),l>=u.wsize?(q.arraySet(u.window,f,g-u.wsize,u.wsize,0),u.wnext=0,u.whave=u.wsize):(k=u.wsize-u.wnext,k>l&&(k=l),q.arraySet(u.window,f,g-
l,k,u.wnext),(l-=k)?(q.arraySet(u.window,f,g-l,l,0),u.wnext=l,u.whave=u.wsize):(u.wnext+=k,u.wnext===u.wsize&&(u.wnext=0),u.whave<u.wsize&&(u.whave+=k)));J-=a.avail_in;H-=a.avail_out;a.total_in+=J;a.total_out+=H;e.total+=H;e.wrap&&H&&(a.adler=e.check=e.flags?y(e.check,h,H,a.next_out-H):t(e.check,h,H,a.next_out-H));a.data_type=e.bits+(e.last?64:0)+(12===e.mode?128:0)+(20===e.mode||15===e.mode?256:0);(0===J&&0===H||4===d)&&0===O&&(O=-5);return O};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){var d;if(!a||!a.state)return-2;d=a.state;if(0===(d.wrap&2))return-2;d.head=b;b.done=!1;return 0};f.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":30,"./adler32":32,"./crc32":34,"./inffast":37,"./inftrees":39}],39:[function(a,d,f){var b=a("../utils/common"),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],h=[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],g=[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],k=[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];d.exports=function(a,d,f,y,B,A,x,I){for(var F=I.bits,z=0,L=0,n=0,G=0,K=0,E=0,w=0,D=0,u=0,m=0,p,J,H=null,v=0,C,P=new b.Buf16(16),E=new b.Buf16(16),M=null,R=0,T,O,Q,z=0;15>=z;z++)P[z]=0;for(L=0;L<y;L++)P[d[f+L]]++;K=F;for(G=15;1<=
G&&0===P[G];G--);K>G&&(K=G);if(0===G)return B[A++]=20971520,B[A++]=20971520,I.bits=1,0;for(n=1;n<G&&0===P[n];n++);K<n&&(K=n);for(z=D=1;15>=z;z++)if(D<<=1,D-=P[z],0>D)return-1;if(0<D&&(0===a||1!==G))return-1;E[1]=0;for(z=1;15>z;z++)E[z+1]=E[z]+P[z];for(L=0;L<y;L++)0!==d[f+L]&&(x[E[d[f+L]]++]=L);0===a?(H=M=x,C=19):1===a?(H=e,v-=257,M=h,R-=257,C=256):(H=g,M=k,C=-1);L=m=0;z=n;F=A;E=K;w=0;J=-1;u=1<<K;y=u-1;if(1===a&&852<u||2===a&&592<u)return 1;for(var U=0;;){U++;T=z-w;x[L]<C?(O=0,Q=x[L]):x[L]>C?(O=M[R+
x[L]],Q=H[v+x[L]]):(O=96,Q=0);D=1<<z-w;n=p=1<<E;do p-=D,B[F+(m>>w)+p]=T<<24|O<<16|Q|0;while(0!==p);for(D=1<<z-1;m&D;)D>>=1;0!==D?(m&=D-1,m+=D):m=0;L++;if(0===--P[z]){if(z===G)break;z=d[f+x[L]]}if(z>K&&(m&y)!==J){0===w&&(w=K);F+=n;E=z-w;for(D=1<<E;E+w<G;){D-=P[E+w];if(0>=D)break;E++;D<<=1}u+=1<<E;if(1===a&&852<u||2===a&&592<u)return 1;J=m&y;B[J]=K<<24|E<<16|F-A|0}}0!==m&&(B[F+m]=z-w<<24|4194304);I.bits=K;return 0}},{"../utils/common":30}],40:[function(a,d,f){d.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"}},{}],41:[function(a,d,f){function b(a){for(var b=a.length;0<=--b;)a[b]=0}function e(a,b,d,e,f){this.static_tree=a;this.extra_bits=b;this.extra_base=d;this.elems=e;this.max_length=f;this.has_stree=a&&a.length}function h(a,b){this.dyn_tree=a;this.max_code=0;this.stat_desc=b}function g(a,b){a.pending_buf[a.pending++]=b&255;a.pending_buf[a.pending++]=b>>>8&255}function k(a,
b,d){a.bi_valid>16-d?(a.bi_buf|=b<<a.bi_valid&65535,g(a,a.bi_buf),a.bi_buf=b>>16-a.bi_valid,a.bi_valid+=d-16):(a.bi_buf|=b<<a.bi_valid&65535,a.bi_valid+=d)}function l(a,b,d){k(a,d[2*b],d[2*b+1])}function q(a,b){var d=0;do d|=a&1,a>>>=1,d<<=1;while(0<--b);return d>>>1}function t(a,b,d){var e=Array(16),f=0,g;for(g=1;15>=g;g++)e[g]=f=f+d[g-1]<<1;for(d=0;d<=b;d++)f=a[2*d+1],0!==f&&(a[2*d]=q(e[f]++,f))}function y(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 B(a){8<a.bi_valid?g(a,a.bi_buf):0<a.bi_valid&&(a.pending_buf[a.pending++]=a.bi_buf);a.bi_buf=0;a.bi_valid=0}function A(a,b,d,e){var f=2*b,g=2*d;return a[f]<a[g]||a[f]===a[g]&&e[b]<=e[d]}function x(a,b,d){for(var e=a.heap[d],f=d<<1;f<=a.heap_len;){f<a.heap_len&&A(b,a.heap[f+1],a.heap[f],a.depth)&&f++;if(A(b,e,a.heap[f],a.depth))break;a.heap[d]=a.heap[f];d=f;f<<=1}a.heap[d]=e}function I(a,b,d){var e,f,
g=0,h,m;if(0!==a.last_lit){do e=a.pending_buf[a.d_buf+2*g]<<8|a.pending_buf[a.d_buf+2*g+1],f=a.pending_buf[a.l_buf+g],g++,0===e?l(a,f,b):(h=H[f],l(a,h+256+1,b),m=E[h],0!==m&&(f-=v[h],k(a,f,m)),e--,h=256>e?J[e]:J[256+(e>>>7)],l(a,h,d),m=w[h],0!==m&&(e-=C[h],k(a,e,m)));while(g<a.last_lit)}l(a,256,b)}function F(a,b){var d=b.dyn_tree,e=b.stat_desc.static_tree,f=b.stat_desc.has_stree,g=b.stat_desc.elems,h,k=-1,l;a.heap_len=0;a.heap_max=573;for(h=0;h<g;h++)0!==d[2*h]?(a.heap[++a.heap_len]=k=h,a.depth[h]=
0):d[2*h+1]=0;for(;2>a.heap_len;)l=a.heap[++a.heap_len]=2>k?++k:0,d[2*l]=1,a.depth[l]=0,a.opt_len--,f&&(a.static_len-=e[2*l+1]);b.max_code=k;for(h=a.heap_len>>1;1<=h;h--)x(a,d,h);l=g;do h=a.heap[1],a.heap[1]=a.heap[a.heap_len--],x(a,d,1),e=a.heap[1],a.heap[--a.heap_max]=h,a.heap[--a.heap_max]=e,d[2*l]=d[2*h]+d[2*e],a.depth[l]=(a.depth[h]>=a.depth[e]?a.depth[h]:a.depth[e])+1,d[2*h+1]=d[2*e+1]=l,a.heap[1]=l++,x(a,d,1);while(2<=a.heap_len);a.heap[--a.heap_max]=a.heap[1];h=b.dyn_tree;l=b.max_code;for(var m=
b.stat_desc.static_tree,n=b.stat_desc.has_stree,p=b.stat_desc.extra_bits,q=b.stat_desc.extra_base,u=b.stat_desc.max_length,v,y,w=0,g=0;15>=g;g++)a.bl_count[g]=0;h[2*a.heap[a.heap_max]+1]=0;for(e=a.heap_max+1;573>e;e++)f=a.heap[e],g=h[2*h[2*f+1]+1]+1,g>u&&(g=u,w++),h[2*f+1]=g,f>l||(a.bl_count[g]++,v=0,f>=q&&(v=p[f-q]),y=h[2*f],a.opt_len+=y*(g+v),n&&(a.static_len+=y*(m[2*f+1]+v)));if(0!==w){do{for(g=u-1;0===a.bl_count[g];)g--;a.bl_count[g]--;a.bl_count[g+1]+=2;a.bl_count[u]--;w-=2}while(0<w);for(g=
u;0!==g;g--)for(f=a.bl_count[g];0!==f;)m=a.heap[--e],m>l||(h[2*m+1]!==g&&(a.opt_len+=(g-h[2*m+1])*h[2*m],h[2*m+1]=g),f--)}t(d,k,a.bl_count)}function z(a,b,d){var e,f=-1,g,h=b[1],k=0,l=7,m=4;0===h&&(l=138,m=3);b[2*(d+1)+1]=65535;for(e=0;e<=d;e++)g=h,h=b[2*(e+1)+1],++k<l&&g===h||(k<m?a.bl_tree[2*g]+=k:0!==g?(g!==f&&a.bl_tree[2*g]++,a.bl_tree[32]++):10>=k?a.bl_tree[34]++:a.bl_tree[36]++,k=0,f=g,0===h?(l=138,m=3):g===h?(l=6,m=3):(l=7,m=4))}function L(a,b,d){var e,f=-1,g,h=b[1],m=0,n=7,p=4;0===h&&(n=138,
p=3);for(e=0;e<=d;e++)if(g=h,h=b[2*(e+1)+1],!(++m<n&&g===h)){if(m<p){do l(a,g,a.bl_tree);while(0!==--m)}else 0!==g?(g!==f&&(l(a,g,a.bl_tree),m--),l(a,16,a.bl_tree),k(a,m-3,2)):10>=m?(l(a,17,a.bl_tree),k(a,m-3,3)):(l(a,18,a.bl_tree),k(a,m-11,7));m=0;f=g;0===h?(n=138,p=3):g===h?(n=6,p=3):(n=7,p=4)}}function n(a){var b=4093624447,d;for(d=0;31>=d;d++,b>>>=1)if(b&1&&0!==a.dyn_ltree[2*d])return 0;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return 1;for(d=32;256>d;d++)if(0!==a.dyn_ltree[2*
d])return 1;return 0}function G(a,b,d,e){k(a,0+(e?1:0),3);B(a);g(a,d);g(a,~d);K.arraySet(a.pending_buf,a.window,b,d,a.pending);a.pending+=d}var K=a("../utils/common"),E=[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],D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],m=Array(576);b(m);var p=Array(60);b(p);var J=Array(512);b(J);var H=Array(256);b(H);var v=Array(29);b(v);var C=
Array(30);b(C);var P,M,R,T=!1;f._tr_init=function(a){if(!T){var b,d,f,g=Array(16);for(f=d=0;28>f;f++)for(v[f]=d,b=0;b<1<<E[f];b++)H[d++]=f;H[d-1]=f;for(f=d=0;16>f;f++)for(C[f]=d,b=0;b<1<<w[f];b++)J[d++]=f;for(d>>=7;30>f;f++)for(C[f]=d<<7,b=0;b<1<<w[f]-7;b++)J[256+d++]=f;for(b=0;15>=b;b++)g[b]=0;for(b=0;143>=b;)m[2*b+1]=8,b++,g[8]++;for(;255>=b;)m[2*b+1]=9,b++,g[9]++;for(;279>=b;)m[2*b+1]=7,b++,g[7]++;for(;287>=b;)m[2*b+1]=8,b++,g[8]++;t(m,287,g);for(b=0;30>b;b++)p[2*b+1]=5,p[2*b]=q(b,5);P=new e(m,
E,257,286,15);M=new e(p,w,0,30,15);R=new e([],D,0,19,7);T=!0}a.l_desc=new h(a.dyn_ltree,P);a.d_desc=new h(a.dyn_dtree,M);a.bl_desc=new h(a.bl_tree,R);a.bi_buf=0;a.bi_valid=0;y(a)};f._tr_stored_block=G;f._tr_flush_block=function(a,b,d,e){var f,g,h=0;if(0<a.level){2===a.strm.data_type&&(a.strm.data_type=n(a));F(a,a.l_desc);F(a,a.d_desc);z(a,a.dyn_ltree,a.l_desc.max_code);z(a,a.dyn_dtree,a.d_desc.max_code);F(a,a.bl_desc);for(h=18;3<=h&&0===a.bl_tree[2*u[h]+1];h--);a.opt_len+=3*(h+1)+14;f=a.opt_len+3+
7>>>3;g=a.static_len+3+7>>>3;g<=f&&(f=g)}else f=g=d+5;if(d+4<=f&&-1!==b)G(a,b,d,e);else if(4===a.strategy||g===f)k(a,2+(e?1:0),3),I(a,m,p);else{k(a,4+(e?1:0),3);b=a.l_desc.max_code+1;d=a.d_desc.max_code+1;h+=1;k(a,b-257,5);k(a,d-1,5);k(a,h-4,4);for(f=0;f<h;f++)k(a,a.bl_tree[2*u[f]+1],3);L(a,a.dyn_ltree,b-1);L(a,a.dyn_dtree,d-1);I(a,a.dyn_ltree,a.dyn_dtree)}y(a);e&&B(a)};f._tr_tally=function(a,b,d){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]=d&255;a.last_lit++;0===b?a.dyn_ltree[2*d]++:(a.matches++,b--,a.dyn_ltree[2*(H[d]+256+1)]++,a.dyn_dtree[2*(256>b?J[b]:J[256+(b>>>7)])]++);return a.last_lit===a.lit_bufsize-1};f._tr_align=function(a){k(a,2,3);l(a,256,m);16===a.bi_valid?(g(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):8<=a.bi_valid&&(a.pending_buf[a.pending++]=a.bi_buf&255,a.bi_buf>>=8,a.bi_valid-=8)}},{"../utils/common":30}],42:[function(a,d,f){d.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}},{}],43:[function(a,d,f){(function(b){(function(d){function f(a,b){if(!(this instanceof f))return new f(a,b);for(var g=0,k=E.length;g<k;g++)this[E[g]]="";this.q=this.c="";this.bufferCheckPosition=d.MAX_BUFFER_LENGTH;this.opt=b||{};this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags;this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase";this.tags=[];this.closed=this.closedRoot=
this.sawRoot=!1;this.tag=this.error=null;this.strict=!!a;this.noscript=!(!a&&!this.opt.noscript);this.state=N.BEGIN;this.ENTITIES=(this.strictEntities=this.opt.strictEntities)?Object.create(d.XML_ENTITIES):Object.create(d.ENTITIES);this.attribList=[];this.opt.xmlns&&(this.ns=Object.create(T));if(this.trackPosition=!1!==this.opt.position)this.position=this.line=this.column=0;this.onready&&this.onready(void 0)}function g(a,b){if(!(this instanceof g))return new g(a,b);w.apply(this);this._parser=new f(a,
b);this.readable=this.writable=!0;var d=this;this._parser.onend=function(){d.emit("end")};this._parser.onerror=function(a){d.emit("error",a);d._parser.error=null};this._decoder=null;u.forEach(function(a){Object.defineProperty(d,"on"+a,{get:function(){return d._parser["on"+a]},set:function(b){if(!b)return d.removeAllListeners(a),d._parser["on"+a]=b;d.on(a,b)},enumerable:!0,configurable:!1})})}function k(a){return a.split("").reduce(function(a,b){a[b]=!0;return a},{})}function l(a,b){return"[object RegExp]"===
Object.prototype.toString.call(a)?!!b.match(a):a[b]}function q(a,b,d){a.textNode&&t(a);a[b]&&a[b](d)}function t(a){a.textNode=y(a.opt,a.textNode);a.textNode&&a.ontext&&a.ontext(a.textNode);a.textNode=""}function y(a,b){a.trim&&(b=b.trim());a.normalize&&(b=b.replace(/\s+/g," "));return b}function B(a,b){t(a);a.trackPosition&&(b+="\nLine: "+a.line+"\nColumn: "+a.column+"\nChar: "+a.c);b=Error(b);a.error=b;a.onerror&&a.onerror(b);return a}function A(a){a.sawRoot&&!a.closedRoot&&x(a,"Unclosed root tag");
a.state!==N.BEGIN&&a.state!==N.BEGIN_WHITESPACE&&a.state!==N.TEXT&&B(a,"Unexpected end");t(a);a.c="";a.closed=!0;a.onend&&a.onend(void 0);f.call(a,a.strict,a.opt);return a}function x(a,b){if("object"!==typeof a||!(a instanceof f))throw Error("bad call to strictFail");a.strict&&B(a,b)}function I(a,b){var d=0>a.indexOf(":")?["",a]:a.split(":"),e=d[0],d=d[1];b&&"xmlns"===a&&(e="xmlns",d="");return{prefix:e,local:d}}function F(a){a.strict||(a.attribName=a.attribName[a.looseCase]());if(-1===a.attribList.indexOf(a.attribName)&&
!a.tag.attributes.hasOwnProperty(a.attribName))if(a.opt.xmlns){var b=I(a.attribName,!0),d=b.local;if("xmlns"===b.prefix)if("xml"===d&&a.attribValue!==M)x(a,"xml: prefix must be bound to "+M+"\nActual: "+a.attribValue);else if("xmlns"===d&&a.attribValue!==R)x(a,"xmlns: prefix must be bound to "+R+"\nActual: "+a.attribValue);else{var b=a.tag,e=a.tags[a.tags.length-1]||a;b.ns===e.ns&&(b.ns=Object.create(e.ns));b.ns[d]=a.attribValue}a.attribList.push([a.attribName,a.attribValue])}else a.tag.attributes[a.attribName]=
a.attribValue,q(a,"onattribute",{name:a.attribName,value:a.attribValue});a.attribName=a.attribValue=""}function z(a,b){if(a.opt.xmlns){var d=a.tag,e=I(a.tagName);d.prefix=e.prefix;d.local=e.local;d.uri=d.ns[e.prefix]||"";d.prefix&&!d.uri&&(x(a,"Unbound namespace prefix: "+JSON.stringify(a.tagName)),d.uri=e.prefix);e=a.tags[a.tags.length-1]||a;d.ns&&e.ns!==d.ns&&Object.keys(d.ns).forEach(function(b){q(a,"onopennamespace",{prefix:b,uri:d.ns[b]})});for(var e=0,f=a.attribList.length;e<f;e++){var g=a.attribList[e],
h=g[0],k=g[1],l=I(h,!0),g=l.prefix,m=""===g?"":d.ns[g]||"",k={name:h,value:k,prefix:g,local:l.local,uri:m};g&&"xmlns"!==g&&!m&&(x(a,"Unbound namespace prefix: "+JSON.stringify(g)),k.uri=g);a.tag.attributes[h]=k;q(a,"onattribute",k)}a.attribList.length=0}a.tag.isSelfClosing=!!b;a.sawRoot=!0;a.tags.push(a.tag);q(a,"onopentag",a.tag);b||(a.noscript||"script"!==a.tagName.toLowerCase()?a.state=N.TEXT:a.state=N.SCRIPT,a.tag=null,a.tagName="");a.attribName=a.attribValue="";a.attribList.length=0}function L(a){if(a.tagName){if(a.script){if("script"!==
a.tagName){a.script+="</"+a.tagName+">";a.tagName="";a.state=N.SCRIPT;return}q(a,"onscript",a.script);a.script=""}var b=a.tags.length,d=a.tagName;a.strict||(d=d[a.looseCase]());for(var e=d;b--;)if(a.tags[b].name!==e)x(a,"Unexpected close tag");else break;if(0>b)x(a,"Unmatched closing tag: "+a.tagName),a.textNode+="</"+a.tagName+">";else{a.tagName=d;for(d=a.tags.length;d-- >b;){var f=a.tag=a.tags.pop();a.tagName=a.tag.name;q(a,"onclosetag",a.tagName);for(var g in f.ns);e=a.tags[a.tags.length-1]||a;
a.opt.xmlns&&f.ns!==e.ns&&Object.keys(f.ns).forEach(function(b){q(a,"onclosenamespace",{prefix:b,uri:f.ns[b]})})}0===b&&(a.closedRoot=!0);a.tagName=a.attribValue=a.attribName="";a.attribList.length=0}}else x(a,"Weird empty close tag."),a.textNode+="</>";a.state=N.TEXT}function n(a){var b=a.entity,d=b.toLowerCase(),e,f="";if(a.ENTITIES[b])return a.ENTITIES[b];if(a.ENTITIES[d])return a.ENTITIES[d];b=d;"#"===b.charAt(0)&&("x"===b.charAt(1)?(b=b.slice(2),e=parseInt(b,16),f=e.toString(16)):(b=b.slice(1),
e=parseInt(b,10),f=e.toString(10)));b=b.replace(/^0+/,"");return f.toLowerCase()!==b?(x(a,"Invalid character entity"),"&"+a.entity+";"):String.fromCodePoint(e)}function G(a,b){"<"===b?(a.state=N.OPEN_WAKA,a.startTagPosition=a.position):l(m,b)||(x(a,"Non-whitespace before first tag."),a.textNode=b,a.state=N.TEXT)}function K(a,b){var d="";b<a.length&&(d=a.charAt(b));return d}d.parser=function(a,b){return new f(a,b)};d.SAXParser=f;d.SAXStream=g;d.createStream=function(a,b){return new g(a,b)};d.MAX_BUFFER_LENGTH=
65536;var E="comment sgmlDecl textNode tagName doctype procInstName procInstBody entity attribName attribValue cdata script".split(" ");d.EVENTS="text processinginstruction sgmldeclaration doctype comment attribute opentag closetag opencdata cdata closecdata error end ready script opennamespace closenamespace".split(" ");Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});Object.keys||(Object.keys=function(a){var b=[],d;for(d in a)a.hasOwnProperty(d)&&b.push(d);return b});
f.prototype={end:function(){A(this)},write:function(a){if(this.error)throw this.error;if(this.closed)return B(this,"Cannot write after close. Assign an onready handler.");if(null===a)return A(this);for(var b=0,f="";;){this.c=f=K(a,b++);if(!f)break;this.trackPosition&&(this.position++,"\n"===f?(this.line++,this.column=0):this.column++);switch(this.state){case N.BEGIN:this.state=N.BEGIN_WHITESPACE;if("\ufeff"===f)continue;G(this,f);continue;case N.BEGIN_WHITESPACE:G(this,f);continue;case N.TEXT:if(this.sawRoot&&
!this.closedRoot){for(var g=b-1;f&&"<"!==f&&"&"!==f;)(f=K(a,b++))&&this.trackPosition&&(this.position++,"\n"===f?(this.line++,this.column=0):this.column++);this.textNode+=a.substring(g,b-1)}"<"!==f||this.sawRoot&&this.closedRoot&&!this.strict?(l(m,f)||this.sawRoot&&!this.closedRoot||x(this,"Text data outside of root node."),"&"===f?this.state=N.TEXT_ENTITY:this.textNode+=f):(this.state=N.OPEN_WAKA,this.startTagPosition=this.position);continue;case N.SCRIPT:"<"===f?this.state=N.SCRIPT_ENDING:this.script+=
f;continue;case N.SCRIPT_ENDING:"/"===f?this.state=N.CLOSE_TAG:(this.script+="<"+f,this.state=N.SCRIPT);continue;case N.OPEN_WAKA:"!"===f?(this.state=N.SGML_DECL,this.sgmlDecl=""):l(m,f)||(l(O,f)?(this.state=N.OPEN_TAG,this.tagName=f):"/"===f?(this.state=N.CLOSE_TAG,this.tagName=""):"?"===f?(this.state=N.PROC_INST,this.procInstName=this.procInstBody=""):(x(this,"Unencoded <"),this.startTagPosition+1<this.position&&(f=Array(this.position-this.startTagPosition).join(" ")+f),this.textNode+="<"+f,this.state=
N.TEXT));continue;case N.SGML_DECL:(this.sgmlDecl+f).toUpperCase()===C?(q(this,"onopencdata"),this.state=N.CDATA,this.cdata=this.sgmlDecl=""):"--"===this.sgmlDecl+f?(this.state=N.COMMENT,this.sgmlDecl=this.comment=""):(this.sgmlDecl+f).toUpperCase()===P?(this.state=N.DOCTYPE,(this.doctype||this.sawRoot)&&x(this,"Inappropriately located doctype declaration"),this.sgmlDecl=this.doctype=""):">"===f?(q(this,"onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=N.TEXT):(l(H,f)&&(this.state=N.SGML_DECL_QUOTED),
this.sgmlDecl+=f);continue;case N.SGML_DECL_QUOTED:f===this.q&&(this.state=N.SGML_DECL,this.q="");this.sgmlDecl+=f;continue;case N.DOCTYPE:">"===f?(this.state=N.TEXT,q(this,"ondoctype",this.doctype),this.doctype=!0):(this.doctype+=f,"["===f?this.state=N.DOCTYPE_DTD:l(H,f)&&(this.state=N.DOCTYPE_QUOTED,this.q=f));continue;case N.DOCTYPE_QUOTED:this.doctype+=f;f===this.q&&(this.q="",this.state=N.DOCTYPE);continue;case N.DOCTYPE_DTD:this.doctype+=f;"]"===f?this.state=N.DOCTYPE:l(H,f)&&(this.state=N.DOCTYPE_DTD_QUOTED,
this.q=f);continue;case N.DOCTYPE_DTD_QUOTED:this.doctype+=f;f===this.q&&(this.state=N.DOCTYPE_DTD,this.q="");continue;case N.COMMENT:"-"===f?this.state=N.COMMENT_ENDING:this.comment+=f;continue;case N.COMMENT_ENDING:"-"===f?(this.state=N.COMMENT_ENDED,(this.comment=y(this.opt,this.comment))&&q(this,"oncomment",this.comment),this.comment=""):(this.comment+="-"+f,this.state=N.COMMENT);continue;case N.COMMENT_ENDED:">"!==f?(x(this,"Malformed comment"),this.comment+="--"+f,this.state=N.COMMENT):this.state=
N.TEXT;continue;case N.CDATA:"]"===f?this.state=N.CDATA_ENDING:this.cdata+=f;continue;case N.CDATA_ENDING:"]"===f?this.state=N.CDATA_ENDING_2:(this.cdata+="]"+f,this.state=N.CDATA);continue;case N.CDATA_ENDING_2:">"===f?(this.cdata&&q(this,"oncdata",this.cdata),q(this,"onclosecdata"),this.cdata="",this.state=N.TEXT):"]"===f?this.cdata+="]":(this.cdata+="]]"+f,this.state=N.CDATA);continue;case N.PROC_INST:"?"===f?this.state=N.PROC_INST_ENDING:l(m,f)?this.state=N.PROC_INST_BODY:this.procInstName+=f;
continue;case N.PROC_INST_BODY:if(!this.procInstBody&&l(m,f))continue;else"?"===f?this.state=N.PROC_INST_ENDING:this.procInstBody+=f;continue;case N.PROC_INST_ENDING:">"===f?(q(this,"onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=N.TEXT):(this.procInstBody+="?"+f,this.state=N.PROC_INST_BODY);continue;case N.OPEN_TAG:if(l(Q,f))this.tagName+=f;else{this.strict||(this.tagName=this.tagName[this.looseCase]());var g=this.tags[this.tags.length-
1]||this,h=this.tag={name:this.tagName,attributes:{}};this.opt.xmlns&&(h.ns=g.ns);this.attribList.length=0;">"===f?z(this):"/"===f?this.state=N.OPEN_TAG_SLASH:(l(m,f)||x(this,"Invalid character in tag name"),this.state=N.ATTRIB)}continue;case N.OPEN_TAG_SLASH:">"===f?(z(this,!0),L(this)):(x(this,"Forward-slash in opening tag not followed by >"),this.state=N.ATTRIB);continue;case N.ATTRIB:if(l(m,f))continue;else">"===f?z(this):"/"===f?this.state=N.OPEN_TAG_SLASH:l(O,f)?(this.attribName=f,this.attribValue=
"",this.state=N.ATTRIB_NAME):x(this,"Invalid attribute name");continue;case N.ATTRIB_NAME:"="===f?this.state=N.ATTRIB_VALUE:">"===f?(x(this,"Attribute without value"),this.attribValue=this.attribName,F(this),z(this)):l(m,f)?this.state=N.ATTRIB_NAME_SAW_WHITE:l(Q,f)?this.attribName+=f:x(this,"Invalid attribute name");continue;case N.ATTRIB_NAME_SAW_WHITE:if("="===f)this.state=N.ATTRIB_VALUE;else if(l(m,f))continue;else x(this,"Attribute without value"),this.attribValue=this.tag.attributes[this.attribName]=
"",q(this,"onattribute",{name:this.attribName,value:""}),this.attribName="",">"===f?z(this):l(O,f)?(this.attribName=f,this.state=N.ATTRIB_NAME):(x(this,"Invalid attribute name"),this.state=N.ATTRIB);continue;case N.ATTRIB_VALUE:if(l(m,f))continue;else l(H,f)?(this.q=f,this.state=N.ATTRIB_VALUE_QUOTED):(x(this,"Unquoted attribute value"),this.state=N.ATTRIB_VALUE_UNQUOTED,this.attribValue=f);continue;case N.ATTRIB_VALUE_QUOTED:if(f!==this.q){"&"===f?this.state=N.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=
f;continue}F(this);this.q="";this.state=N.ATTRIB_VALUE_CLOSED;continue;case N.ATTRIB_VALUE_CLOSED:l(m,f)?this.state=N.ATTRIB:">"===f?z(this):"/"===f?this.state=N.OPEN_TAG_SLASH:l(O,f)?(x(this,"No whitespace between attributes"),this.attribName=f,this.attribValue="",this.state=N.ATTRIB_NAME):x(this,"Invalid attribute name");continue;case N.ATTRIB_VALUE_UNQUOTED:if(!l(v,f)){"&"===f?this.state=N.ATTRIB_VALUE_ENTITY_U:this.attribValue+=f;continue}F(this);">"===f?z(this):this.state=N.ATTRIB;continue;case N.CLOSE_TAG:if(this.tagName)">"===
f?L(this):l(Q,f)?this.tagName+=f:this.script?(this.script+="</"+this.tagName,this.tagName="",this.state=N.SCRIPT):(l(m,f)||x(this,"Invalid tagname in closing tag"),this.state=N.CLOSE_TAG_SAW_WHITE);else if(l(m,f))continue;else l(O,f)?this.tagName=f:this.script?(this.script+="</"+f,this.state=N.SCRIPT):x(this,"Invalid tagname in closing tag.");continue;case N.CLOSE_TAG_SAW_WHITE:if(l(m,f))continue;">"===f?L(this):x(this,"Invalid characters in closing tag");continue;case N.TEXT_ENTITY:case N.ATTRIB_VALUE_ENTITY_Q:case N.ATTRIB_VALUE_ENTITY_U:var k,
p;switch(this.state){case N.TEXT_ENTITY:k=N.TEXT;p="textNode";break;case N.ATTRIB_VALUE_ENTITY_Q:k=N.ATTRIB_VALUE_QUOTED;p="attribValue";break;case N.ATTRIB_VALUE_ENTITY_U:k=N.ATTRIB_VALUE_UNQUOTED,p="attribValue"}";"===f?(this[p]+=n(this),this.entity="",this.state=k):l(this.entity.length?ua:U,f)?this.entity+=f:(x(this,"Invalid character in entity name"),this[p]+="&"+this.entity+f,this.entity="",this.state=k);continue;default:throw Error(this,"Unknown state: "+this.state);}}if(this.position>=this.bufferCheckPosition){a=
Math.max(d.MAX_BUFFER_LENGTH,10);f=b=0;for(k=E.length;f<k;f++){p=this[E[f]].length;if(p>a)switch(E[f]){case "textNode":t(this);break;case "cdata":q(this,"oncdata",this.cdata);this.cdata="";break;case "script":q(this,"onscript",this.script);this.script="";break;default:B(this,"Max buffer length exceeded: "+E[f])}b=Math.max(b,p)}this.bufferCheckPosition=d.MAX_BUFFER_LENGTH-b+this.position}return this},resume:function(){this.error=null;return this},close:function(){return this.write(null)},flush:function(){t(this);
""!==this.cdata&&(q(this,"oncdata",this.cdata),this.cdata="");""!==this.script&&(q(this,"onscript",this.script),this.script="")}};var w;try{w=a("stream").Stream}catch(D){w=function(){}}var u=d.EVENTS.filter(function(a){return"error"!==a&&"end"!==a});g.prototype=Object.create(w.prototype,{constructor:{value:g}});g.prototype.write=function(d){"function"===typeof b&&"function"===typeof b.isBuffer&&b.isBuffer(d)&&(this._decoder||(this._decoder=new (a("string_decoder").StringDecoder)("utf8")),d=this._decoder.write(d));
this._parser.write(d.toString());this.emit("data",d);return!0};g.prototype.end=function(a){a&&a.length&&this.write(a);this._parser.end();return!0};g.prototype.on=function(a,b){var d=this;d._parser["on"+a]||-1===u.indexOf(a)||(d._parser["on"+a]=function(){var b=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);b.splice(0,0,a);d.emit.apply(d,b)});return w.prototype.on.call(d,a,b)};var m="\r\n\t ",p="0124356789",J="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",H="'\"",v=m+">",C=
"[CDATA[",P="DOCTYPE",M="http://www.w3.org/XML/1998/namespace",R="http://www.w3.org/2000/xmlns/",T={xml:M,xmlns:R},m=k(m),p=k(p),J=k(J),O=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Q=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,U=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,
ua=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,H=k(H),v=k(v),N=0;d.STATE={BEGIN:N++,BEGIN_WHITESPACE:N++,TEXT:N++,TEXT_ENTITY:N++,OPEN_WAKA:N++,SGML_DECL:N++,SGML_DECL_QUOTED:N++,DOCTYPE:N++,DOCTYPE_QUOTED:N++,DOCTYPE_DTD:N++,DOCTYPE_DTD_QUOTED:N++,COMMENT_STARTING:N++,COMMENT:N++,COMMENT_ENDING:N++,COMMENT_ENDED:N++,CDATA:N++,CDATA_ENDING:N++,CDATA_ENDING_2:N++,
PROC_INST:N++,PROC_INST_BODY:N++,PROC_INST_ENDING:N++,OPEN_TAG:N++,OPEN_TAG_SLASH:N++,ATTRIB:N++,ATTRIB_NAME:N++,ATTRIB_NAME_SAW_WHITE:N++,ATTRIB_VALUE:N++,ATTRIB_VALUE_QUOTED:N++,ATTRIB_VALUE_CLOSED:N++,ATTRIB_VALUE_UNQUOTED:N++,ATTRIB_VALUE_ENTITY_Q:N++,ATTRIB_VALUE_ENTITY_U:N++,CLOSE_TAG:N++,CLOSE_TAG_SAW_WHITE:N++,SCRIPT:N++,SCRIPT_ENDING:N++};d.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};d.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,
Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,
ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,
Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,
zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,
ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(d.ENTITIES).forEach(function(a){var b=d.ENTITIES[a],b="number"===
typeof b?String.fromCharCode(b):b;d.ENTITIES[a]=b});for(var ea in d.STATE)d.STATE[d.STATE[ea]]=ea;N=d.STATE;String.fromCodePoint||function(){var a=String.fromCharCode,b=Math.floor,d=function(){var d=[],e,f,g=-1,h=arguments.length;if(!h)return"";for(var k="";++g<h;){f=Number(arguments[g]);if(!isFinite(f)||0>f||1114111<f||b(f)!==f)throw RangeError("Invalid code point: "+f);65535>=f?d.push(f):(f-=65536,e=(f>>10)+55296,f=f%1024+56320,d.push(e,f));if(g+1===h||16384<d.length)k+=a.apply(null,d),d.length=
0}return k};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:d,configurable:!0,writable:!0}):String.fromCodePoint=d}()})("undefined"===typeof f?this.sax={}:f)}).call(this,a("buffer").Buffer)},{buffer:3,stream:25,string_decoder:26}],44:[function(a,d,f){var b=b||{};b.Transform=b.Transform||("undefined"!==typeof a?a("./transform.js"):null);var e=e||("undefined"!==typeof a?a("../lib/base64-binary.js"):null),h=h||("undefined"!==typeof a?a("pako"):null);b.NIFTI_INTENT_GENMATRIX=
"NIFTI_INTENT_GENMATRIX";b.NIFTI_INTENT_LABEL="NIFTI_INTENT_LABEL";b.NIFTI_INTENT_NODE_INDEX="NIFTI_INTENT_NODE_INDEX";b.NIFTI_INTENT_POINTSET="NIFTI_INTENT_POINTSET";b.NIFTI_INTENT_RGB_VECTOR="NIFTI_INTENT_RGB_VECTOR";b.NIFTI_INTENT_RGBA_VECTOR="NIFTI_INTENT_RGBA_VECTOR";b.NIFTI_INTENT_SHAPE="NIFTI_INTENT_SHAPE";b.NIFTI_INTENT_TIME_SERIES="NIFTI_INTENT_TIME_SERIES";b.NIFTI_INTENT_TRIANGLE="NIFTI_INTENT_TRIANGLE";b.NIFTI_INTENT_NONE="NIFTI_INTENT_NONE";b.NIFTI_INTENT_VECTOR="NIFTI_INTENT_VECTOR";
b.ATT_ARRAYINDEXINGORDER="ArrayIndexingOrder";b.ATT_DATATYPE="DataType";b.ATT_DIMENSIONALITY="Dimensionality";b.ATT_DIMN="Dim";b.ATT_ENCODING="Encoding";b.ATT_ENDIAN="Endian";b.ATT_EXTERNALFILENAME="ExternalFileName";b.ATT_EXTERNALFILEOFFSET="ExternalFileOffset";b.ATT_INTENT="Intent";b.ENCODING_ASCII="ASCII";b.ENCODING_BASE64BINARY="Base64Binary";b.ENCODING_GZIPBASE64BINARY="GZipBase64Binary";b.ENCODING_EXTERNALFILEBINARY="ExternalFileBinary";b.TYPE_NIFTI_TYPE_UINT8="NIFTI_TYPE_UINT8";b.TYPE_NIFTI_TYPE_INT32=
"NIFTI_TYPE_INT32";b.TYPE_NIFTI_TYPE_FLOAT32="NIFTI_TYPE_FLOAT32";b.DataArray=b.DataArray||function(){this.attributes=null;this.metadata={};this.transforms=[];this.data=null;this.dataConverted=!1};b.DataArray.prototype.isPointSet=function(){return this.attributes[b.ATT_INTENT]===b.NIFTI_INTENT_POINTSET};b.DataArray.prototype.isTriangles=function(){return this.attributes[b.ATT_INTENT]===b.NIFTI_INTENT_TRIANGLE};b.DataArray.prototype.isNormals=function(){return this.attributes[b.ATT_INTENT]===b.NIFTI_INTENT_VECTOR};
b.DataArray.prototype.isColors=function(){return this.attributes[b.ATT_INTENT]===b.NIFTI_INTENT_RGB_VECTOR||this.attributes[b.ATT_INTENT]===b.NIFTI_INTENT_RGBA_VECTOR};b.DataArray.prototype.getDimensions=function(){return parseInt(this.attributes[b.ATT_DIMENSIONALITY])};b.DataArray.prototype.getNumElements=function(a){void 0===a&&(a=0);return parseInt(this.attributes[b.ATT_DIMN+a])};b.DataArray.prototype.isScalar=function(){return 1==this.getDimensions()};b.DataArray.prototype.isTriple=function(){return 2==
this.getDimensions()&&3==this.getNumElements(1)};b.DataArray.prototype.isQuad=function(){return 2==this.getDimensions()&&4==this.getNumElements(1)};b.DataArray.prototype.isAscii=function(){return b.ENCODING_ASCII===this.attributes[b.ATT_ENCODING]};b.DataArray.prototype.isBase64Binary=function(){return b.ENCODING_BASE64BINARY===this.attributes[b.ATT_ENCODING]};b.DataArray.prototype.isGzipBase64Binary=function(){return b.ENCODING_GZIPBASE64BINARY===this.attributes[b.ATT_ENCODING]};b.DataArray.prototype.isBase64Encoded=
function(){return this.isBase64Binary()||this.isGzipBase64Binary()};b.DataArray.prototype.isFloat32=function(){return b.TYPE_NIFTI_TYPE_FLOAT32===this.attributes[b.ATT_DATATYPE]};b.DataArray.prototype.isInt32=function(){return b.TYPE_NIFTI_TYPE_INT32===this.attributes[b.ATT_DATATYPE]};b.DataArray.prototype.isUnsignedInt8=function(){return b.TYPE_NIFTI_TYPE_UINT8===this.attributes[b.ATT_DATATYPE]};b.DataArray.prototype.getData=function(){this.dataConverted||(this.dataConverted=!0,this.isAscii()?this.isUnsignedInt8()?
b.DataArray.readUnsignedInt8ASCII(this):this.isInt32()?b.DataArray.readSignedInt32ASCII(this):b.DataArray.readFloat32ASCII(this):this.isBase64Binary()?this.isUnsignedInt8()?b.DataArray.readUnsignedInt8Base64(this):this.isInt32()?b.DataArray.readSignedInt32Base64(this):b.DataArray.readFloat32Base64(this):this.isGzipBase64Binary()&&(this.isUnsignedInt8()?b.DataArray.readUnsignedInt8GZIPBase64(this):this.isInt32()?b.DataArray.readSignedInt32GZIPBase64(this):b.DataArray.readFloat32GZIPBase64(this)));
return this.data};b.DataArray.prototype.getDataAsync=function(a,d){this.dataConverted||(this.dataConverted=!0,this.isAscii()?(this.isUnsignedInt8()?b.DataArray.readUnsignedInt8ASCII(this):this.isInt32()?b.DataArray.readSignedInt32ASCII(this):b.DataArray.readFloat32ASCII(this),d()):this.isBase64Binary()?(this.isUnsignedInt8()?b.DataArray.readUnsignedInt8Base64(this):this.isInt32()?b.DataArray.readSignedInt32Base64(this):b.DataArray.readFloat32Base64(this),d()):this.isGzipBase64Binary()&&(this.isUnsignedInt8()?
b.DataArray.readUnsignedInt8GZIPBase64Async(this,a,d):this.isInt32()?b.DataArray.readSignedInt32GZIPBase64Async(this,a,d):b.DataArray.readFloat32GZIPBase64Async(this,a,d)))};b.DataArray.readFloat32ASCII=function(a){a.data=new Float32Array(a.data.match(/[+-]?\d+(\.\d+)?/g).map(function(a){return parseFloat(a)}))};b.DataArray.readSignedInt32ASCII=function(a){a.data=new Int32Array(a.data.match(/[+-]?\d+(\.\d+)?/g).map(function(a){return parseInt(a)}))};b.DataArray.readUnsignedInt8ASCII=function(a){a.data=
new Uint8Array(a.data.match(/[+-]?\d+(\.\d+)?/g).map(function(a){return parseInt(a)}))};b.DataArray.readUnsignedInt8Base64=function(a){var b=e.decodeArrayBuffer(a.data);a.data=new Uint8Array(b,0,b.byteLength)};b.DataArray.readSignedInt32Base64=function(a){var b=e.decodeArrayBuffer(a.data);a.data=new Int32Array(b,0,b.byteLength/4)};b.DataArray.readFloat32Base64=function(a){var b=e.decodeArrayBuffer(a.data);a.data=new Float32Array(b,0,b.byteLength/4)};b.DataArray.readUnsignedInt8GZIPBase64=function(a){var b=
e.decodeArrayBuffer(a.data),b=h.inflate(b).buffer;a.data=new Uint8Array(b,0,b.byteLength)};b.DataArray.readUnsignedInt8GZIPBase64Async=function(a,d,f){var q=e.decodeArrayBuffer(a.data),t=new h.Inflate,y=function(){a.data=new Uint8Array(t.result.buffer,0,t.result.buffer.byteLength);f(a.data)};setTimeout(function(){b.DataArray.readNext(t,q,0,d,y)},0)};b.DataArray.readSignedInt32GZIPBase64=function(a){var b=e.decodeArrayBuffer(a.data),b=h.inflate(b).buffer;a.data=new Int32Array(b,0,b.byteLength/4)};
b.DataArray.readSignedInt32GZIPBase64Async=function(a,d,f){var q=e.decodeArrayBuffer(a.data),t=new h.Inflate,y=function(){a.data=new Int32Array(t.result.buffer,0,t.result.buffer.byteLength/4);f(a.data)};setTimeout(function(){b.DataArray.readNext(t,q,0,d,y)},0)};b.DataArray.readFloat32GZIPBase64=function(a){var b=e.decodeArrayBuffer(a.data),b=h.inflate(b).buffer;a.data=new Float32Array(b,0,b.byteLength/4)};b.DataArray.readFloat32GZIPBase64Async=function(a,d,f){var q=e.decodeArrayBuffer(a.data),t=new h.Inflate,
y=function(){a.data=new Float32Array(t.result.buffer,0,t.result.buffer.byteLength/4);f(a.data)};setTimeout(function(){b.DataArray.readNext(t,q,0,d,y)},0)};b.DataArray.readNext=function(a,d,e,f,h){var y=e+32768,B=y>=d.byteLength;a.push(d.slice(e,e+32768),B);B?h():(f(y/d.byteLength),setTimeout(function(){b.DataArray.readNext(a,d,y,f,h)},0))};"undefined"!==typeof d&&d.exports&&(d.exports=b.DataArray)},{"../lib/base64-binary.js":1,"./transform.js":46,pako:27}],45:[function(a,d,f){var b=b||{};b.Utils=
b.Utils||("undefined"!==typeof a?a("./utilities.js"):null);b.DataArray=b.DataArray||("undefined"!==typeof a?a("./dataArray.js"):null);b.Transform=b.Transform||("undefined"!==typeof a?a("./transform.js"):null);var e=e||("undefined"!==typeof a?a("sax"):null);b.TAG_TRANSFORM="CoordinateSystemTransformMatrix";b.TAG_DATA="Data";b.TAG_DATAARRAY="DataArray";b.TAG_DATASPACE="DataSpace";b.TAG_GIFTI="GIFTI";b.TAG_LABEL="Label";b.TAG_LABELTABLE="LabelTable";b.TAG_MATRIXDATA="MatrixData";b.TAG_METADATA="MetaData";
b.TAG_MD="MD";b.TAG_NAME="Name";b.TAG_TRANSFORMEDSPACE="TransformedSpace";b.TAG_VALUE="Value";b.GIFTI=b.GIFTI||function(){this.attributes=null;this.metadata={};this.dataArrays=[]};b.GIFTI.prototype.getPointsDataArray=function(){var a;for(a=0;a<this.dataArrays.length;a+=1)if(this.dataArrays[a].isPointSet())return this.dataArrays[a];return null};b.GIFTI.prototype.getTrianglesDataArray=function(){var a;for(a=0;a<this.dataArrays.length;a+=1)if(this.dataArrays[a].isTriangles())return this.dataArrays[a];
return null};b.GIFTI.prototype.getNormalsDataArray=function(){var a;for(a=0;a<this.dataArrays.length;a+=1)if(this.dataArrays[a].isNormals())return this.dataArrays[a];return null};b.GIFTI.prototype.getColorsDataArray=function(){var a;for(a=0;a<this.dataArrays.length;a+=1)if(this.dataArrays[a].isColors())return this.dataArrays[a];return null};b.GIFTI.prototype.getNumPoints=function(){var a;for(a=0;a<this.dataArrays.length;a+=1)if(this.dataArrays[a].isPointSet())return this.dataArrays[a].getNumElements();
return 0};b.GIFTI.prototype.getNumTriangles=function(){var a;for(a=0;a<this.dataArrays.length;a+=1)if(this.dataArrays[a].isTriangles())return this.dataArrays[a].getNumElements();return 0};b.isThisFormat=function(a){return-1!==a.indexOf(".gii")};b.parse=function(a){var d=e.parser(!0),f=null,l=null,q=null,t=null,y=null,B=null,A="",x=!1,I=!1,F=!1,z=!1,L=!1,n=!1;d.onopentag=function(a){a.name===b.TAG_GIFTI?(q=f=new b.GIFTI,f.attributes=a.attributes):a.name!==b.TAG_METADATA&&a.name!==b.TAG_MD&&(a.name===
b.TAG_NAME?x=!0:a.name===b.TAG_VALUE?I=!0:a.name===b.TAG_DATAARRAY?(q=l=new b.DataArray,f.dataArrays.push(l),l.attributes=a.attributes):a.name===b.TAG_TRANSFORM?(B=new b.Transform,l.transforms.push(B)):a.name===b.TAG_DATASPACE?F=!0:a.name===b.TAG_TRANSFORMEDSPACE?z=!0:a.name===b.TAG_MATRIXDATA?L=!0:a.name===b.TAG_DATA&&(n=!0))};d.ontext=d.oncdata=function(a){x?A+=a:I?A+=a:F?A+=a:z?A+=a:L?A+=a:n&&(A+=a)};d.onclosetag=function(a){a!==b.TAG_GIFTI&&a!==b.TAG_METADATA&&(a===b.TAG_MD?q&&(q.metadata[t]=
y):a===b.TAG_NAME?(x=!1,t=A,A=""):a===b.TAG_VALUE?(I=!1,y=A,A=""):a!==b.TAG_DATAARRAY&&a!==b.TAG_TRANSFORM&&(a===b.TAG_DATASPACE?(F=!1,B.dataSpace=A,A=""):a===b.TAG_TRANSFORMEDSPACE?(z=!1,B.transformedSpace=A,A=""):a===b.TAG_MATRIXDATA?(L=!1,B.matrixData=A,A=""):a===b.TAG_DATA&&(n=!1,l.data=A,A="")))};d.onerror=function(a){console.log(a)};d.write(a).close();return f};"undefined"!==typeof d&&d.exports&&(d.exports=b)},{"./dataArray.js":44,"./transform.js":46,"./utilities.js":47,sax:43}],46:[function(a,
d,f){var b=b||{};b.Transform=b.Transform||function(){this.matrixData=this.transformedSpace=this.dataSpace=null};"undefined"!==typeof d&&d.exports&&(d.exports=b.Transform)},{}],47:[function(a,d,f){var b=b||{};b.Utils=b.Utils||{};b.Utils.crcTable=null;b.Utils.makeCRCTable=function(){for(var a,b=[],d=0;256>d;d++){a=d;for(var f=0;8>f;f++)a=a&1?3988292384^a>>>1:a>>>1;b[d]=a}return b};b.Utils.crc32=function(a){for(var d=b.Utils.crcTable||(b.Utils.crcTable=b.Utils.makeCRCTable()),f=-1,k=0;k<a.byteLength;k++)f=
f>>>8^d[(f^a.getUint8(k))&255];return(f^-1)>>>0};"undefined"!==typeof d&&d.exports&&(d.exports=b.Utils)},{}]},{},[45])(45)});glMatrixArrayType="undefined"!=typeof Float32Array?Float32Array:"undefined"!=typeof WebGLFloatArray?WebGLFloatArray:Array;
var vec3={create:function(c){var a=new glMatrixArrayType(3);c&&(a[0]=c[0],a[1]=c[1],a[2]=c[2]);return a},set:function(c,a){a[0]=c[0];a[1]=c[1];a[2]=c[2];return a},add:function(c,a,d){if(!d||c==d)return c[0]+=a[0],c[1]+=a[1],c[2]+=a[2],c;d[0]=c[0]+a[0];d[1]=c[1]+a[1];d[2]=c[2]+a[2];return d},subtract:function(c,a,d){if(!d||c==d)return c[0]-=a[0],c[1]-=a[1],c[2]-=a[2],c;d[0]=c[0]-a[0];d[1]=c[1]-a[1];d[2]=c[2]-a[2];return d},negate:function(c,a){a||(a=c);a[0]=-c[0];a[1]=-c[1];a[2]=-c[2];return a},scale:function(c,
a,d){if(!d||c==d)return c[0]*=a,c[1]*=a,c[2]*=a,c;d[0]=c[0]*a;d[1]=c[1]*a;d[2]=c[2]*a;return d},normalize:function(c,a){a||(a=c);var d=c[0],f=c[1],b=c[2],e=Math.sqrt(d*d+f*f+b*b);if(e){if(1==e)return a[0]=d,a[1]=f,a[2]=b,a}else return a[0]=0,a[1]=0,a[2]=0,a;e=1/e;a[0]=d*e;a[1]=f*e;a[2]=b*e;return a},cross:function(c,a,d){d||(d=c);var f=c[0],b=c[1];c=c[2];var e=a[0],h=a[1];a=a[2];d[0]=b*a-c*h;d[1]=c*e-f*a;d[2]=f*h-b*e;return d},length:function(c){var a=c[0],d=c[1];c=c[2];return Math.sqrt(a*a+d*d+c*
c)},dot:function(c,a){return c[0]*a[0]+c[1]*a[1]+c[2]*a[2]},direction:function(c,a,d){d||(d=c);var f=c[0]-a[0],b=c[1]-a[1];c=c[2]-a[2];a=Math.sqrt(f*f+b*b+c*c);if(!a)return d[0]=0,d[1]=0,d[2]=0,d;a=1/a;d[0]=f*a;d[1]=b*a;d[2]=c*a;return d},lerp:function(c,a,d,f){f||(f=c);f[0]=c[0]+d*(a[0]-c[0]);f[1]=c[1]+d*(a[1]-c[1]);f[2]=c[2]+d*(a[2]-c[2]);return f},str:function(c){return"["+c[0]+", "+c[1]+", "+c[2]+"]"}},mat3={create:function(c){var a=new glMatrixArrayType(9);c&&(a[0]=c[0],a[1]=c[1],a[2]=c[2],a[3]=
c[3],a[4]=c[4],a[5]=c[5],a[6]=c[6],a[7]=c[7],a[8]=c[8],a[9]=c[9]);return a},set:function(c,a){a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[3];a[4]=c[4];a[5]=c[5];a[6]=c[6];a[7]=c[7];a[8]=c[8];return a},identity:function(c){c[0]=1;c[1]=0;c[2]=0;c[3]=0;c[4]=1;c[5]=0;c[6]=0;c[7]=0;c[8]=1;return c},transpose:function(c,a){if(!a||c==a){var d=c[1],f=c[2],b=c[5];c[1]=c[3];c[2]=c[6];c[3]=d;c[5]=c[7];c[6]=f;c[7]=b;return c}a[0]=c[0];a[1]=c[3];a[2]=c[6];a[3]=c[1];a[4]=c[4];a[5]=c[7];a[6]=c[2];a[7]=c[5];a[8]=c[8];return a},
toMat4:function(c,a){a||(a=mat4.create());a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=0;a[4]=c[3];a[5]=c[4];a[6]=c[5];a[7]=0;a[8]=c[6];a[9]=c[7];a[10]=c[8];a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},str:function(c){return"["+c[0]+", "+c[1]+", "+c[2]+", "+c[3]+", "+c[4]+", "+c[5]+", "+c[6]+", "+c[7]+", "+c[8]+"]"}},mat4={create:function(c){var a=new glMatrixArrayType(16);c&&(a[0]=c[0],a[1]=c[1],a[2]=c[2],a[3]=c[3],a[4]=c[4],a[5]=c[5],a[6]=c[6],a[7]=c[7],a[8]=c[8],a[9]=c[9],a[10]=c[10],a[11]=c[11],a[12]=
c[12],a[13]=c[13],a[14]=c[14],a[15]=c[15]);return a},set:function(c,a){a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[3];a[4]=c[4];a[5]=c[5];a[6]=c[6];a[7]=c[7];a[8]=c[8];a[9]=c[9];a[10]=c[10];a[11]=c[11];a[12]=c[12];a[13]=c[13];a[14]=c[14];a[15]=c[15];return a},identity:function(c){c[0]=1;c[1]=0;c[2]=0;c[3]=0;c[4]=0;c[5]=1;c[6]=0;c[7]=0;c[8]=0;c[9]=0;c[10]=1;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return c},transpose:function(c,a){if(!a||c==a){var d=c[1],f=c[2],b=c[3],e=c[6],h=c[7],g=c[11];c[1]=c[4];c[2]=
c[8];c[3]=c[12];c[4]=d;c[6]=c[9];c[7]=c[13];c[8]=f;c[9]=e;c[11]=c[14];c[12]=b;c[13]=h;c[14]=g;return c}a[0]=c[0];a[1]=c[4];a[2]=c[8];a[3]=c[12];a[4]=c[1];a[5]=c[5];a[6]=c[9];a[7]=c[13];a[8]=c[2];a[9]=c[6];a[10]=c[10];a[11]=c[14];a[12]=c[3];a[13]=c[7];a[14]=c[11];a[15]=c[15];return a},determinant:function(c){var a=c[0],d=c[1],f=c[2],b=c[3],e=c[4],h=c[5],g=c[6],k=c[7],l=c[8],q=c[9],t=c[10],y=c[11],B=c[12],A=c[13],x=c[14];c=c[15];return B*q*g*b-l*A*g*b-B*h*t*b+e*A*t*b+l*h*x*b-e*q*x*b-B*q*f*k+l*A*f*k+
B*d*t*k-a*A*t*k-l*d*x*k+a*q*x*k+B*h*f*y-e*A*f*y-B*d*g*y+a*A*g*y+e*d*x*y-a*h*x*y-l*h*f*c+e*q*f*c+l*d*g*c-a*q*g*c-e*d*t*c+a*h*t*c},inverse:function(c,a){a||(a=c);var d=c[0],f=c[1],b=c[2],e=c[3],h=c[4],g=c[5],k=c[6],l=c[7],q=c[8],t=c[9],y=c[10],B=c[11],A=c[12],x=c[13],I=c[14],F=c[15],z=d*g-f*h,L=d*k-b*h,n=d*l-e*h,G=f*k-b*g,K=f*l-e*g,E=b*l-e*k,w=q*x-t*A,D=q*I-y*A,u=q*F-B*A,m=t*I-y*x,p=t*F-B*x,J=y*F-B*I,H=1/(z*J-L*p+n*m+G*u-K*D+E*w);a[0]=(g*J-k*p+l*m)*H;a[1]=(-f*J+b*p-e*m)*H;a[2]=(x*E-I*K+F*G)*H;a[3]=
(-t*E+y*K-B*G)*H;a[4]=(-h*J+k*u-l*D)*H;a[5]=(d*J-b*u+e*D)*H;a[6]=(-A*E+I*n-F*L)*H;a[7]=(q*E-y*n+B*L)*H;a[8]=(h*p-g*u+l*w)*H;a[9]=(-d*p+f*u-e*w)*H;a[10]=(A*K-x*n+F*z)*H;a[11]=(-q*K+t*n-B*z)*H;a[12]=(-h*m+g*D-k*w)*H;a[13]=(d*m-f*D+b*w)*H;a[14]=(-A*G+x*L-I*z)*H;a[15]=(q*G-t*L+y*z)*H;return a},toRotationMat:function(c,a){a||(a=mat4.create());a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[3];a[4]=c[4];a[5]=c[5];a[6]=c[6];a[7]=c[7];a[8]=c[8];a[9]=c[9];a[10]=c[10];a[11]=c[11];a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},
toMat3:function(c,a){a||(a=mat3.create());a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[4];a[4]=c[5];a[5]=c[6];a[6]=c[8];a[7]=c[9];a[8]=c[10];return a},toInverseMat3:function(c,a){var d=c[0],f=c[1],b=c[2],e=c[4],h=c[5],g=c[6],k=c[8],l=c[9],q=c[10],t=q*h-g*l,y=-q*e+g*k,B=l*e-h*k,A=d*t+f*y+b*B;if(!A)return null;A=1/A;a||(a=mat3.create());a[0]=t*A;a[1]=(-q*f+b*l)*A;a[2]=(g*f-b*h)*A;a[3]=y*A;a[4]=(q*d-b*k)*A;a[5]=(-g*d+b*e)*A;a[6]=B*A;a[7]=(-l*d+f*k)*A;a[8]=(h*d-f*e)*A;return a},multiply:function(c,a,d){d||(d=
c);var f=c[0],b=c[1],e=c[2],h=c[3],g=c[4],k=c[5],l=c[6],q=c[7],t=c[8],y=c[9],B=c[10],A=c[11],x=c[12],I=c[13],F=c[14];c=c[15];var z=a[0],L=a[1],n=a[2],G=a[3],K=a[4],E=a[5],w=a[6],D=a[7],u=a[8],m=a[9],p=a[10],J=a[11],H=a[12],v=a[13],C=a[14];a=a[15];d[0]=z*f+L*g+n*t+G*x;d[1]=z*b+L*k+n*y+G*I;d[2]=z*e+L*l+n*B+G*F;d[3]=z*h+L*q+n*A+G*c;d[4]=K*f+E*g+w*t+D*x;d[5]=K*b+E*k+w*y+D*I;d[6]=K*e+E*l+w*B+D*F;d[7]=K*h+E*q+w*A+D*c;d[8]=u*f+m*g+p*t+J*x;d[9]=u*b+m*k+p*y+J*I;d[10]=u*e+m*l+p*B+J*F;d[11]=u*h+m*q+p*A+J*c;
d[12]=H*f+v*g+C*t+a*x;d[13]=H*b+v*k+C*y+a*I;d[14]=H*e+v*l+C*B+a*F;d[15]=H*h+v*q+C*A+a*c;return d},multiplyVec3:function(c,a,d){d||(d=a);var f=a[0],b=a[1];a=a[2];d[0]=c[0]*f+c[4]*b+c[8]*a+c[12];d[1]=c[1]*f+c[5]*b+c[9]*a+c[13];d[2]=c[2]*f+c[6]*b+c[10]*a+c[14];return d},multiplyVec4:function(c,a,d){d||(d=a);var f=a[0],b=a[1],e=a[2];a=a[3];d[0]=c[0]*f+c[4]*b+c[8]*e+c[12]*a;d[1]=c[1]*f+c[5]*b+c[9]*e+c[13]*a;d[2]=c[2]*f+c[6]*b+c[10]*e+c[14]*a;d[3]=c[3]*f+c[7]*b+c[11]*e+c[15]*a;return d},translate:function(c,
a,d){var f=a[0],b=a[1];a=a[2];if(!d||c==d)return c[12]=c[0]*f+c[4]*b+c[8]*a+c[12],c[13]=c[1]*f+c[5]*b+c[9]*a+c[13],c[14]=c[2]*f+c[6]*b+c[10]*a+c[14],c[15]=c[3]*f+c[7]*b+c[11]*a+c[15],c;var e=c[0],h=c[1],g=c[2],k=c[3],l=c[4],q=c[5],t=c[6],y=c[7],B=c[8],A=c[9],x=c[10],I=c[11];d[0]=e;d[1]=h;d[2]=g;d[3]=k;d[4]=l;d[5]=q;d[6]=t;d[7]=y;d[8]=B;d[9]=A;d[10]=x;d[11]=I;d[12]=e*f+l*b+B*a+c[12];d[13]=h*f+q*b+A*a+c[13];d[14]=g*f+t*b+x*a+c[14];d[15]=k*f+y*b+I*a+c[15];return d},scale:function(c,a,d){var f=a[0],b=
a[1];a=a[2];if(!d||c==d)return c[0]*=f,c[1]*=f,c[2]*=f,c[3]*=f,c[4]*=b,c[5]*=b,c[6]*=b,c[7]*=b,c[8]*=a,c[9]*=a,c[10]*=a,c[11]*=a,c;d[0]=c[0]*f;d[1]=c[1]*f;d[2]=c[2]*f;d[3]=c[3]*f;d[4]=c[4]*b;d[5]=c[5]*b;d[6]=c[6]*b;d[7]=c[7]*b;d[8]=c[8]*a;d[9]=c[9]*a;d[10]=c[10]*a;d[11]=c[11]*a;d[12]=c[12];d[13]=c[13];d[14]=c[14];d[15]=c[15];return d},rotate:function(c,a,d,f){var b=d[0],e=d[1];d=d[2];var h=Math.sqrt(b*b+e*e+d*d);if(!h)return null;1!=h&&(h=1/h,b*=h,e*=h,d*=h);var g=Math.sin(a),k=Math.cos(a),l=1-k;
a=c[0];var h=c[1],q=c[2],t=c[3],y=c[4],B=c[5],A=c[6],x=c[7],I=c[8],F=c[9],z=c[10],L=c[11],n=b*b*l+k,G=e*b*l+d*g,K=d*b*l-e*g,E=b*e*l-d*g,w=e*e*l+k,D=d*e*l+b*g,u=b*d*l+e*g,b=e*d*l-b*g,e=d*d*l+k;f?c!=f&&(f[12]=c[12],f[13]=c[13],f[14]=c[14],f[15]=c[15]):f=c;f[0]=a*n+y*G+I*K;f[1]=h*n+B*G+F*K;f[2]=q*n+A*G+z*K;f[3]=t*n+x*G+L*K;f[4]=a*E+y*w+I*D;f[5]=h*E+B*w+F*D;f[6]=q*E+A*w+z*D;f[7]=t*E+x*w+L*D;f[8]=a*u+y*b+I*e;f[9]=h*u+B*b+F*e;f[10]=q*u+A*b+z*e;f[11]=t*u+x*b+L*e;return f},rotateX:function(c,a,d){var f=Math.sin(a);
a=Math.cos(a);var b=c[4],e=c[5],h=c[6],g=c[7],k=c[8],l=c[9],q=c[10],t=c[11];d?c!=d&&(d[0]=c[0],d[1]=c[1],d[2]=c[2],d[3]=c[3],d[12]=c[12],d[13]=c[13],d[14]=c[14],d[15]=c[15]):d=c;d[4]=b*a+k*f;d[5]=e*a+l*f;d[6]=h*a+q*f;d[7]=g*a+t*f;d[8]=b*-f+k*a;d[9]=e*-f+l*a;d[10]=h*-f+q*a;d[11]=g*-f+t*a;return d},rotateY:function(c,a,d){var f=Math.sin(a);a=Math.cos(a);var b=c[0],e=c[1],h=c[2],g=c[3],k=c[8],l=c[9],q=c[10],t=c[11];d?c!=d&&(d[4]=c[4],d[5]=c[5],d[6]=c[6],d[7]=c[7],d[12]=c[12],d[13]=c[13],d[14]=c[14],
d[15]=c[15]):d=c;d[0]=b*a+k*-f;d[1]=e*a+l*-f;d[2]=h*a+q*-f;d[3]=g*a+t*-f;d[8]=b*f+k*a;d[9]=e*f+l*a;d[10]=h*f+q*a;d[11]=g*f+t*a;return d},rotateZ:function(c,a,d){var f=Math.sin(a);a=Math.cos(a);var b=c[0],e=c[1],h=c[2],g=c[3],k=c[4],l=c[5],q=c[6],t=c[7];d?c!=d&&(d[8]=c[8],d[9]=c[9],d[10]=c[10],d[11]=c[11],d[12]=c[12],d[13]=c[13],d[14]=c[14],d[15]=c[15]):d=c;d[0]=b*a+k*f;d[1]=e*a+l*f;d[2]=h*a+q*f;d[3]=g*a+t*f;d[4]=b*-f+k*a;d[5]=e*-f+l*a;d[6]=h*-f+q*a;d[7]=g*-f+t*a;return d},frustum:function(c,a,d,f,
b,e,h){h||(h=mat4.create());var g=a-c,k=f-d,l=e-b;h[0]=2*b/g;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2*b/k;h[6]=0;h[7]=0;h[8]=(a+c)/g;h[9]=(f+d)/k;h[10]=-(e+b)/l;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(e*b*2)/l;h[15]=0;return h},perspective:function(c,a,d,f,b){c=d*Math.tan(c*Math.PI/360);a*=c;return mat4.frustum(-a,a,-c,c,d,f,b)},ortho:function(c,a,d,f,b,e,h){h||(h=mat4.create());var g=a-c,k=f-d,l=e-b;h[0]=2/g;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/k;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/l;h[11]=0;h[12]=-(c+a)/g;h[13]=
-(f+d)/k;h[14]=-(e+b)/l;h[15]=1;return h},lookAt:function(c,a,d,f){f||(f=mat4.create());var b=c[0],e=c[1];c=c[2];var h=d[0],g=d[1],k=d[2];d=a[1];var l=a[2];if(b==a[0]&&e==d&&c==l)return mat4.identity(f);var q,t,y,B;d=b-a[0];l=e-a[1];a=c-a[2];B=1/Math.sqrt(d*d+l*l+a*a);d*=B;l*=B;a*=B;q=g*a-k*l;k=k*d-h*a;h=h*l-g*d;(B=Math.sqrt(q*q+k*k+h*h))?(B=1/B,q*=B,k*=B,h*=B):h=k=q=0;g=l*h-a*k;t=a*q-d*h;y=d*k-l*q;(B=Math.sqrt(g*g+t*t+y*y))?(B=1/B,g*=B,t*=B,y*=B):y=t=g=0;f[0]=q;f[1]=g;f[2]=d;f[3]=0;f[4]=k;f[5]=t;
f[6]=l;f[7]=0;f[8]=h;f[9]=y;f[10]=a;f[11]=0;f[12]=-(q*b+k*e+h*c);f[13]=-(g*b+t*e+y*c);f[14]=-(d*b+l*e+a*c);f[15]=1;return f},str:function(c){return"["+c[0]+", "+c[1]+", "+c[2]+", "+c[3]+", "+c[4]+", "+c[5]+", "+c[6]+", "+c[7]+", "+c[8]+", "+c[9]+", "+c[10]+", "+c[11]+", "+c[12]+", "+c[13]+", "+c[14]+", "+c[15]+"]"}};
quat4={create:function(c){var a=new glMatrixArrayType(4);c&&(a[0]=c[0],a[1]=c[1],a[2]=c[2],a[3]=c[3]);return a},set:function(c,a){a[0]=c[0];a[1]=c[1];a[2]=c[2];a[3]=c[3];return a},calculateW:function(c,a){var d=c[0],f=c[1],b=c[2];if(!a||c==a)return c[3]=-Math.sqrt(Math.abs(1-d*d-f*f-b*b)),c;a[0]=d;a[1]=f;a[2]=b;a[3]=-Math.sqrt(Math.abs(1-d*d-f*f-b*b));return a},inverse:function(c,a){if(!a||c==a)return c[0]*=1,c[1]*=1,c[2]*=1,c;a[0]=-c[0];a[1]=-c[1];a[2]=-c[2];a[3]=c[3];return a},length:function(c){var a=
c[0],d=c[1],f=c[2];c=c[3];return Math.sqrt(a*a+d*d+f*f+c*c)},normalize:function(c,a){a||(a=c);var d=c[0],f=c[1],b=c[2],e=c[3],h=Math.sqrt(d*d+f*f+b*b+e*e);if(0==h)return a[0]=0,a[1]=0,a[2]=0,a[3]=0,a;h=1/h;a[0]=d*h;a[1]=f*h;a[2]=b*h;a[3]=e*h;return a},multiply:function(c,a,d){d||(d=c);var f=c[0],b=c[1],e=c[2];c=c[3];var h=a[0],g=a[1],k=a[2];a=a[3];d[0]=f*a+c*h+b*k-e*g;d[1]=b*a+c*g+e*h-f*k;d[2]=e*a+c*k+f*g-b*h;d[3]=c*a-f*h-b*g-e*k;return d},multiplyVec3:function(c,a,d){d||(d=a);var f=a[0],b=a[1],e=
a[2];a=c[0];var h=c[1],g=c[2];c=c[3];var k=c*f+h*e-g*b,l=c*b+g*f-a*e,q=c*e+a*b-h*f,f=-a*f-h*b-g*e;d[0]=k*c+f*-a+l*-g-q*-h;d[1]=l*c+f*-h+q*-a-k*-g;d[2]=q*c+f*-g+k*-h-l*-a;return d},toMat3:function(c,a){a||(a=mat3.create());var d=c[0],f=c[1],b=c[2],e=c[3],h=d+d,g=f+f,k=b+b,l=d*h,q=d*g,d=d*k,t=f*g,f=f*k,b=b*k,h=e*h,g=e*g,e=e*k;a[0]=1-(t+b);a[1]=q-e;a[2]=d+g;a[3]=q+e;a[4]=1-(l+b);a[5]=f-h;a[6]=d-g;a[7]=f+h;a[8]=1-(l+t);return a},toMat4:function(c,a){a||(a=mat4.create());var d=c[0],f=c[1],b=c[2],e=c[3],
h=d+d,g=f+f,k=b+b,l=d*h,q=d*g,d=d*k,t=f*g,f=f*k,b=b*k,h=e*h,g=e*g,e=e*k;a[0]=1-(t+b);a[1]=q-e;a[2]=d+g;a[3]=0;a[4]=q+e;a[5]=1-(l+b);a[6]=f-h;a[7]=0;a[8]=d-g;a[9]=f+h;a[10]=1-(l+t);a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},slerp:function(c,a,d,f){f||(f=c);var b=d;0>c[0]*a[0]+c[1]*a[1]+c[2]*a[2]+c[3]*a[3]&&(b=-1*d);f[0]=1-d*c[0]+b*a[0];f[1]=1-d*c[1]+b*a[1];f[2]=1-d*c[2]+b*a[2];f[3]=1-d*c[3]+b*a[3];return f},str:function(c){return"["+c[0]+", "+c[1]+", "+c[2]+", "+c[3]+"]"}};var GLU={};
(function(c){c.unProject=function(a,d,f,b,e,h,g){a=[a,d,f,1];d=[];c.multMatrices(b,e,d);if(!c.invertMatrix(d,d))return!1;a[0]=(a[0]-h[0])/h[2];a[1]=(a[1]-h[1])/h[3];a[0]=2*a[0]-1;a[1]=2*a[1]-1;a[2]=2*a[2]-1;b=[];c.multMatrixVec(d,a,b);if(0===b[3])return!1;b[0]/=b[3];b[1]/=b[3];b[2]/=b[3];g[0]=b[0];g[1]=b[1];g[2]=b[2];return!0};c.multMatrixVec=function(a,c,f){for(var b=0;4>b;b+=1)f[b]=c[0]*a[0+b]+c[1]*a[4+b]+c[2]*a[8+b]+c[3]*a[12+b]};c.multMatrices=function(a,c,f){for(var b=0;4>b;b+=1)for(var e=0;4>
e;e+=1)f[4*b+e]=a[4*b+0]*c[0+e]+a[4*b+1]*c[4+e]+a[4*b+2]*c[8+e]+a[4*b+3]*c[12+e]};c.invertMatrix=function(a,c){var f=[];f[0]=a[5]*a[10]*a[15]-a[5]*a[11]*a[14]-a[9]*a[6]*a[15]+a[9]*a[7]*a[14]+a[13]*a[6]*a[11]-a[13]*a[7]*a[10];f[4]=-a[4]*a[10]*a[15]+a[4]*a[11]*a[14]+a[8]*a[6]*a[15]-a[8]*a[7]*a[14]-a[12]*a[6]*a[11]+a[12]*a[7]*a[10];f[8]=a[4]*a[9]*a[15]-a[4]*a[11]*a[13]-a[8]*a[5]*a[15]+a[8]*a[7]*a[13]+a[12]*a[5]*a[11]-a[12]*a[7]*a[9];f[12]=-a[4]*a[9]*a[14]+a[4]*a[10]*a[13]+a[8]*a[5]*a[14]-a[8]*a[6]*a[13]-
a[12]*a[5]*a[10]+a[12]*a[6]*a[9];f[1]=-a[1]*a[10]*a[15]+a[1]*a[11]*a[14]+a[9]*a[2]*a[15]-a[9]*a[3]*a[14]-a[13]*a[2]*a[11]+a[13]*a[3]*a[10];f[5]=a[0]*a[10]*a[15]-a[0]*a[11]*a[14]-a[8]*a[2]*a[15]+a[8]*a[3]*a[14]+a[12]*a[2]*a[11]-a[12]*a[3]*a[10];f[9]=-a[0]*a[9]*a[15]+a[0]*a[11]*a[13]+a[8]*a[1]*a[15]-a[8]*a[3]*a[13]-a[12]*a[1]*a[11]+a[12]*a[3]*a[9];f[13]=a[0]*a[9]*a[14]-a[0]*a[10]*a[13]-a[8]*a[1]*a[14]+a[8]*a[2]*a[13]+a[12]*a[1]*a[10]-a[12]*a[2]*a[9];f[2]=a[1]*a[6]*a[15]-a[1]*a[7]*a[14]-a[5]*a[2]*a[15]+
a[5]*a[3]*a[14]+a[13]*a[2]*a[7]-a[13]*a[3]*a[6];f[6]=-a[0]*a[6]*a[15]+a[0]*a[7]*a[14]+a[4]*a[2]*a[15]-a[4]*a[3]*a[14]-a[12]*a[2]*a[7]+a[12]*a[3]*a[6];f[10]=a[0]*a[5]*a[15]-a[0]*a[7]*a[13]-a[4]*a[1]*a[15]+a[4]*a[3]*a[13]+a[12]*a[1]*a[7]-a[12]*a[3]*a[5];f[14]=-a[0]*a[5]*a[14]+a[0]*a[6]*a[13]+a[4]*a[1]*a[14]-a[4]*a[2]*a[13]-a[12]*a[1]*a[6]+a[12]*a[2]*a[5];f[3]=-a[1]*a[6]*a[11]+a[1]*a[7]*a[10]+a[5]*a[2]*a[11]-a[5]*a[3]*a[10]-a[9]*a[2]*a[7]+a[9]*a[3]*a[6];f[7]=a[0]*a[6]*a[11]-a[0]*a[7]*a[10]-a[4]*a[2]*
a[11]+a[4]*a[3]*a[10]+a[8]*a[2]*a[7]-a[8]*a[3]*a[6];f[11]=-a[0]*a[5]*a[11]+a[0]*a[7]*a[9]+a[4]*a[1]*a[11]-a[4]*a[3]*a[9]-a[8]*a[1]*a[7]+a[8]*a[3]*a[5];f[15]=a[0]*a[5]*a[10]-a[0]*a[6]*a[9]-a[4]*a[1]*a[10]+a[4]*a[2]*a[9]+a[8]*a[1]*a[6]-a[8]*a[2]*a[5];var b=a[0]*f[0]+a[1]*f[4]+a[2]*f[8]+a[3]*f[12];if(0===b)return!1;for(var b=1/b,e=0;16>e;e+=1)c[e]=f[e]*b;return!0}})(GLU);
var PAPAYA_BROWSER_MIN_FIREFOX=7,PAPAYA_BROWSER_MIN_CHROME=7,PAPAYA_BROWSER_MIN_SAFARI=6,PAPAYA_BROWSER_MIN_IE=10,PAPAYA_BROWSER_MIN_OPERA=12,PAPAYA_SURFACE_BROWSER_MIN_FIREFOX=7,PAPAYA_SURFACE_BROWSER_MIN_CHROME=8,PAPAYA_SURFACE_BROWSER_MIN_SAFARI=6,PAPAYA_SURFACE_BROWSER_MIN_IE=11,PAPAYA_SURFACE_BROWSER_MIN_OPERA=12,PAPAYA_CONTAINER_CLASS_NAME="papaya",PAPAYA_CONTAINER_COLLAPSABLE="papaya-collapsable",PAPAYA_CONTAINER_COLLAPSABLE_EXEMPT="papaya-collapsable-exempt",PAPAYA_CONTAINER_FULLSCREEN="papaya-fullscreen",
PAPAYA_VIEWER_CSS="papaya-viewer",PAPAYA_TOOLBAR_CSS="papaya-toolbar",PAPAYA_TITLEBAR_CSS="papaya-titlebar",PAPAYA_SLIDER_CSS="papaya-slider-slice",PAPAYA_KIOSK_CONTROLS_CSS="papaya-kiosk-controls",PAPAYA_DISPLAY_CSS="papaya-display",PAPAYA_DIALOG_CSS="papaya-dialog",PAPAYA_DIALOG_CONTENT_CSS="papaya-dialog-content",PAPAYA_DIALOG_CONTENT_NOWRAP_CSS="papaya-dialog-content-nowrap",PAPAYA_DIALOG_CONTENT_LABEL_CSS="papaya-dialog-content-label",PAPAYA_DIALOG_CONTENT_CONTROL_CSS="papaya-dialog-content-control",
PAPAYA_DIALOG_TITLE_CSS="papaya-dialog-title",PAPAYA_DIALOG_BUTTON_CSS="papaya-dialog-button",PAPAYA_DIALOG_BACKGROUND="papaya-dialog-background",PAPAYA_DIALOG_STOPSCROLL="papaya-dialog-stopscroll",PAPAYA_DIALOG_CONTENT_HELP="papaya-dialog-content-help",PAPAYA_MENU_CSS="papaya-menu",PAPAYA_MENU_LABEL_CSS="papaya-menu-label",PAPAYA_MENU_TITLEBAR_CSS="papaya-menu-titlebar",PAPAYA_MENU_ICON_CSS="papaya-menu-icon",PAPAYA_MENU_HOVERING_CSS="papaya-menu-hovering",PAPAYA_MENU_SPACER_CSS="papaya-menu-spacer",
PAPAYA_MENU_UNSELECTABLE="papaya-menu-unselectable",PAPAYA_MENU_FILECHOOSER="papaya-menu-filechooser",PAPAYA_MENU_BUTTON_CSS="papaya-menu-button",PAPAYA_MENU_BUTTON_HOVERING_CSS="papaya-menu-button-hovering",PAPAYA_MENU_COLORTABLE_CSS="papaya-menu-colortable",PAPAYA_MENU_INPUT_FIELD="papaya-menu-input",PAPAYA_MENU_SLIDER="papaya-menu-slider",PAPAYA_CONTROL_INCREMENT_BUTTON_CSS="papaya-control-increment",PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS="papaya-control-goto-center",PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS=
"papaya-control-goto-origin",PAPAYA_CONTROL_SWAP_BUTTON_CSS="papaya-control-swap",PAPAYA_CONTROL_DIRECTION_SLIDER="papaya-direction-slider",PAPAYA_CONTROL_MAIN_SLIDER="papaya-main-slider",PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS="papaya-main-increment",PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS="papaya-main-decrement",PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS="papaya-main-swap",PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS="papaya-main-goto-center",PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS="papaya-main-goto-origin",
PAPAYA_CONTROL_BAR_LABELS_CSS="papaya-controlbar-label",PAPAYA_UTILS_CHECKFORJS_CSS="checkForJS",PAPAYA_UTILS_UNSUPPORTED_CSS="papaya-utils-unsupported",PAPAYA_UTILS_UNSUPPORTED_MESSAGE_CSS="papaya-utils-unsupported-message",PAPAYA_DEFAULT_VIEWER_ID="papayaViewer",PAPAYA_DEFAULT_DISPLAY_ID="papayaDisplay",PAPAYA_DEFAULT_TOOLBAR_ID="papayaToolbar",PAPAYA_DEFAULT_CONTAINER_ID="papayaContainer",PAPAYA_DEFAULT_SLIDER_ID="papayaSliceSlider",PAPAYA_SPACING=3,PAPAYA_PADDING=8,PAPAYA_CONTAINER_PADDING=20,
PAPAYA_CONTAINER_PADDING_TOP=PAPAYA_CONTAINER_PADDING,PAPAYA_MANGO_INSTALLED="mangoinstalled",PAPAYA_CUSTOM_PROTOCOL="mango",GUNZIP_MAGIC_COOKIE1=31,GUNZIP_MAGIC_COOKIE2=139;"use strict";var papaya=papaya||{};papaya.utilities=papaya.utilities||{};papaya.utilities.ArrayUtils=papaya.utilities.ArrayUtils||{};
papaya.utilities.ArrayUtils.createArray=function(c){var a=Array(c||0),d;if(1<arguments.length){var f=Array.prototype.slice.call(arguments,1);for(d=0;d<c;d+=1)a[d]=papaya.utilities.ArrayUtils.createArray.apply(this,f)}return a};papaya.utilities.ArrayUtils.contains=function(c,a){for(var d=c.length;d--;)if(c[d]===a)return!0;return!1};Array.prototype.clone=function(){var c,a;c=this.slice(0);for(a=0;a<this.length;a+=1)this[a].clone&&(c[a]=this[a].clone());return c};"use strict";papaya=papaya||{};
papaya.utilities=papaya.utilities||{};papaya.utilities.MathUtils=papaya.utilities.MathUtils||{};papaya.utilities.MathUtils.EPSILON=1E-8;papaya.utilities.MathUtils.signum=function(c){return c?0>c?-1:1:0};papaya.utilities.MathUtils.lineDistance=function(c,a,d,f){c=d-c;a=f-a;return Math.sqrt(c*c+a*a)};papaya.utilities.MathUtils.lineDistance3d=function(c,a,d,f,b,e){c=f-c;a=b-a;d=e-d;return Math.sqrt(c*c+a*a+d*d)};
papaya.utilities.MathUtils.essentiallyEqual=function(c,a){return c===a||Math.abs(c-a)<=(Math.abs(c)>Math.abs(a)?Math.abs(a):Math.abs(c))*papaya.utilities.MathUtils.EPSILON};papaya.utilities.MathUtils.getPowerOfTwo=function(c,a){for(a=a||1;a<c;)a*=2;return a};function papayaRoundFast(c){return.5+c|0}function papayaFloorFast(c){return c|0}"use strict";papaya=papaya||{};papaya.utilities=papaya.utilities||{};papaya.utilities.ObjectUtils=papaya.utilities.ObjectUtils||{};
papaya.utilities.ObjectUtils.bind=function(c,a,d,f){if(2===arguments.length)return function(){return a.apply(c,arguments)};var b=Array.prototype.slice;return function(){var e=d||arguments;!0===f?(e=b.call(arguments,0),e=e.concat(d)):"number"===typeof f&&(e=b.call(arguments,0),Ext.Array.insert(e,f,d));return a.apply(c||window,e)}};papaya.utilities.ObjectUtils.isString=function(c){return"string"===typeof c||c instanceof String};
papaya.utilities.ObjectUtils.dereference=function(c){return papaya.utilities.ObjectUtils.dereferenceIn(window,c)};papaya.utilities.ObjectUtils.dereferenceIn=function(c,a){var d,f;if(!papaya.utilities.ObjectUtils.isString(a))return null;if(f=a.replace(/(^[' "]+|[" ']+$)/g,"").match(/(^[\w\$]+(\.[\w\$]+)*)/))for(f=f[1].split("."),d=c[f.shift()];d&&f.length;)d=d[f.shift()];return d||null};"use strict";papaya=papaya||{};papaya.utilities=papaya.utilities||{};
papaya.utilities.PlatformUtils=papaya.utilities.PlatformUtils||{};var console=console||{};console.log=console.log||function(){};console.warn=console.warn||function(){};console.error=console.error||function(){};console.info=console.info||function(){};papaya.utilities.PlatformUtils.os=null;papaya.utilities.PlatformUtils.browser=bowser.name;papaya.utilities.PlatformUtils.browserVersion=bowser.version;papaya.utilities.PlatformUtils.ios=bowser.ios;papaya.utilities.PlatformUtils.mobile=bowser.mobile;
papaya.utilities.PlatformUtils.lastScrollEventTimestamp=0;papaya.utilities.PlatformUtils.smallScreen=window.matchMedia&&window.matchMedia("only screen and (max-width: 760px)").matches;papaya.utilities.PlatformUtils.detectOs=function(){return-1!==navigator.appVersion.indexOf("Win")?"Windows":-1!==navigator.appVersion.indexOf("Mac")?"MacOS":-1!==navigator.appVersion.indexOf("X11")||-1!==navigator.appVersion.indexOf("Linux")?"Linux":"Unknown"};papaya.utilities.PlatformUtils.os=papaya.utilities.PlatformUtils.detectOs();
papaya.utilities.PlatformUtils.checkForBrowserCompatibility=function(){if("Firefox"===papaya.utilities.PlatformUtils.browser){if(papaya.utilities.PlatformUtils.browserVersion<PAPAYA_BROWSER_MIN_FIREFOX)return"Papaya requires Firefox version "+PAPAYA_BROWSER_MIN_FIREFOX+" or higher."}else if("Chrome"===papaya.utilities.PlatformUtils.browser){if(papaya.utilities.PlatformUtils.browserVersion<PAPAYA_BROWSER_MIN_CHROME)return"Papaya requires Chrome version "+PAPAYA_BROWSER_MIN_CHROME+" or higher."}else if("Internet Explorer"===
papaya.utilities.PlatformUtils.browser){if(papaya.utilities.PlatformUtils.browserVersion<PAPAYA_BROWSER_MIN_IE)return"Papaya requires Internet Explorer version "+PAPAYA_BROWSER_MIN_IE+" or higher."}else if("Safari"===papaya.utilities.PlatformUtils.browser){if(papaya.utilities.PlatformUtils.browserVersion<PAPAYA_BROWSER_MIN_SAFARI)return"Papaya requires Safari version "+PAPAYA_BROWSER_MIN_SAFARI+" or higher."}else if("Opera"===papaya.utilities.PlatformUtils.browser&&papaya.utilities.PlatformUtils.browserVersion<
PAPAYA_BROWSER_MIN_OPERA)return"Papaya requires Opera version "+PAPAYA_BROWSER_MIN_OPERA+" or higher.";return null};papaya.utilities.PlatformUtils.isWebGLSupported=function(){var c,a,d;try{if(c=document.createElement("canvas"),a=c.getContext("webgl")||c.getContext("experimental-webgl"),d=a.getExtension("OES_element_index_uint"),!d)return!1}catch(f){return console.log("There was a problem detecting WebGL! "+f),!1}return!0};
papaya.utilities.PlatformUtils.getMousePositionX=function(c){var a;c.originalEvent&&(c=c.originalEvent);if(c.targetTouches){if(1===c.targetTouches.length&&(a=c.targetTouches[0]))return a.pageX}else if(c.changedTouches&&1===c.changedTouches.length&&(a=c.changedTouches[0]))return a.pageX;return c.pageX};
papaya.utilities.PlatformUtils.getMousePositionY=function(c){var a;if(c.targetTouches){if(1===c.targetTouches.length&&(a=c.targetTouches[0]))return a.pageY}else if(c.changedTouches&&1===c.changedTouches.length&&(a=c.changedTouches[0]))return a.pageY;return c.pageY};
papaya.utilities.PlatformUtils.getScrollSign=function(c,a){var d,f;d=a?75:"Firefox"===papaya.utilities.PlatformUtils.browser?10:"Chrome"===papaya.utilities.PlatformUtils.browser?50:"Internet Explorer"===papaya.utilities.PlatformUtils.browser?0:"Safari"===papaya.utilities.PlatformUtils.browser?50:10;f=Date.now();return f-papaya.utilities.PlatformUtils.lastScrollEventTimestamp>d?(papaya.utilities.PlatformUtils.lastScrollEventTimestamp=f,f=papaya.utilities.PlatformUtils.normalizeWheel(c).spinY,d=0<-1*
papaya.utilities.PlatformUtils.normalizeWheel(c).spinY?1:-1,d*=Math.ceil(Math.abs(f/10))):0};papaya.utilities.PlatformUtils.makeSlice=function(c,a,d){return"undefined"===typeof File?function(){}:File.prototype.slice?c.slice(a,a+d):File.prototype.mozSlice?c.mozSlice(a,d):File.prototype.webkitSlice?c.webkitSlice(a,d):null};papaya.utilities.PlatformUtils.isPlatformLittleEndian=function(){var c=new ArrayBuffer(2);(new DataView(c)).setInt16(0,256,!0);return 256===(new Int16Array(c))[0]};
papaya.utilities.PlatformUtils.isInputRangeSupported=function(){var c=document.createElement("input");c.setAttribute("type","range");return"range"===c.type};
papaya.utilities.PlatformUtils.launchCustomProtocol=function(c,a,d){var f,b,e=!1;if("Internet Explorer"===papaya.utilities.PlatformUtils.browser)b=window.open("","","width=0,height=0"),b.document.write("<iframe src='"+a+"'></iframe>"),setTimeout(function(){try{b.location.href,e=!0}catch(a){console.log(a)}e?b.setTimeout("window.close()",100):b.close();d(e)},100);else if("Firefox"===papaya.utilities.PlatformUtils.browser){try{f=$("<iframe />"),f.css({display:"none"}),f.appendTo("body"),f[0].contentWindow.location.href=
a,e=!0}catch(h){e=!1}f.remove();d(e)}else"Chrome"===papaya.utilities.PlatformUtils.browser?(c.viewerHtml.css({outline:0}),c.viewerHtml.attr("tabindex","1"),c.viewerHtml.focus(),c.viewerHtml.blur(function(){e=!0;d(!0)}),location.href=a,setTimeout(function(){c.viewerHtml.off("blur");c.viewerHtml.removeAttr("tabindex");e||d(!1)},2E3)):((f=papaya.utilities.UrlUtils.readCookie(papaya.viewer.Preferences.COOKIE_PREFIX+PAPAYA_MANGO_INSTALLED))||papaya.mangoinstalled?e=!0:confirm("This feature requires that "+
(papaya.utilities.PlatformUtils.ios?"iMango":"Mango")+" is installed.  Continue?")&&(papaya.utilities.UrlUtils.createCookie(papaya.viewer.Preferences.COOKIE_PREFIX+PAPAYA_MANGO_INSTALLED,!0,papaya.viewer.Preferences.COOKIE_EXPIRY_DAYS),e=!0),e&&(location.href=a),d(e))};
papaya.utilities.PlatformUtils.getSupportedScrollEvent=function(){return"Firefox"===papaya.utilities.PlatformUtils.browser?"DOMMouseScroll":"onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll"};var PIXEL_STEP=10,LINE_HEIGHT=40,PAGE_HEIGHT=800;
papaya.utilities.PlatformUtils.normalizeWheel=function(c){var a=0,d=0,f=0,b=0;"detail"in c&&(d=c.detail);"wheelDelta"in c&&(d=-c.wheelDelta/120);"wheelDeltaY"in c&&(d=-c.wheelDeltaY/120);"wheelDeltaX"in c&&(a=-c.wheelDeltaX/120);"axis"in c&&c.axis===c.HORIZONTAL_AXIS&&(a=d,d=0);f=a*PIXEL_STEP;b=d*PIXEL_STEP;"deltaY"in c&&(b=c.deltaY);"deltaX"in c&&(f=c.deltaX);(f||b)&&c.deltaMode&&(1==c.deltaMode?(f*=LINE_HEIGHT,b*=LINE_HEIGHT):(f*=PAGE_HEIGHT,b*=PAGE_HEIGHT));f&&!a&&(a=1>f?-1:1);b&&!d&&(d=1>b?-1:
1);return{spinX:a,spinY:d,pixelX:f,pixelY:b}};"use strict";papaya=papaya||{};papaya.utilities=papaya.utilities||{};papaya.utilities.StringUtils=papaya.utilities.StringUtils||{};papaya.utilities.StringUtils.isStringBlank=function(c){return c&&"string"==(typeof c).toLowerCase()?0===c.trim().length:!0};papaya.utilities.StringUtils.formatNumber=function(c,a){var d=0,d=papaya.utilities.ObjectUtils.isString(c)?Number(c):c,d=a?d.toPrecision(5):d.toPrecision(7);return parseFloat(d)};
papaya.utilities.StringUtils.getSizeString=function(c){var a=null;return a=1048576<c?papaya.utilities.StringUtils.formatNumber(c/1048576,!0)+" Mb":1024<c?papaya.utilities.StringUtils.formatNumber(c/1024,!0)+" Kb":c+" Bytes"};papaya.utilities.StringUtils.wordwrap=function(c,a,d,f){d=d||"\n";a=a||75;return c?c.match(new RegExp(".{1,"+a+"}(\\s|$)"+(f?"|.{"+a+"}|.+$":"|\\S+?(\\s|$)"),"g")).join(d):c};
papaya.utilities.StringUtils.truncateMiddleString=function(c,a){if(c.length<=a)return c;var d=a-3,f=Math.ceil(d/2),d=Math.floor(d/2);return c.substr(0,f)+"..."+c.substr(c.length-d)};papaya.utilities.StringUtils.pad=function(c,a){return("000000000"+c).substr(-a)};"function"!==typeof String.prototype.startsWith&&(String.prototype.startsWith=function(c){return 0===this.indexOf(c)});
"function"!==typeof String.prototype.endsWith&&(String.prototype.endsWith=function(c){return-1!==this.indexOf(c,this.length-c.length)});"function"!==typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});"use strict";papaya=papaya||{};papaya.utilities=papaya.utilities||{};papaya.utilities.UrlUtils=papaya.utilities.UrlUtils||{};
papaya.utilities.UrlUtils.createCookie=function(c,a,d){var f;d?(f=new Date,f.setTime(f.getTime()+864E5*d),d="; expires="+f.toGMTString()):d="";document.cookie=c+"="+a+d+"; path=/"};papaya.utilities.UrlUtils.readCookie=function(c){var a,d,f;c+="=";a=document.cookie.split(";");for(d=0;d<a.length;d+=1){for(f=a[d];" "===f.charAt(0);)f=f.substring(1,f.length);if(0===f.indexOf(c))return f.substring(c.length,f.length)}return null};
papaya.utilities.UrlUtils.eraseCookie=function(c){papaya.utilities.UrlUtils.createCookie(c,"",-1)};papaya.utilities.UrlUtils.getQueryParams=function(c){var a,d,f=/[?&]?([^=]+)=([^&]*)/g;if(-1!==document.location.href.indexOf("?"))for(d=document.location.href.substring(document.location.href.indexOf("?")+1),d=d.split("+").join(" "),a=f.exec(d);a;)c[decodeURIComponent(a[1])]=decodeURIComponent(a[2]),a=f.exec(d)};
papaya.utilities.UrlUtils.getAbsoluteUrl=function(c,a){var d,f;d=window.location.href;d=d.substring(0,d.lastIndexOf("/"));f=document.createElement("a");f.href=d+"/"+a;d=f.host;f=f.pathname;"/"!==f.charAt(0)&&(f="/"+f);return c+"://"+d+f};"use strict";papaya=papaya||{};papaya.core=papaya.core||{};papaya.core.Coordinate=papaya.core.Coordinate||function(c,a,d){this.x=c;this.y=a;this.z=d};
papaya.core.Coordinate.prototype.setCoordinate=function(c,a,d,f){f?(this.x=Math.round(c),this.y=Math.round(a),this.z=Math.round(d)):(this.x=c,this.y=a,this.z=d)};papaya.core.Coordinate.prototype.toString=function(){return"("+this.x+","+this.y+","+this.z+")"};papaya.core.Coordinate.prototype.isAllZeros=function(){return 0===this.x&&0===this.y&&0===this.z};"use strict";papaya=papaya||{};papaya.core=papaya.core||{};papaya.core.Point=papaya.core.Point||function(c,a){this.x=c;this.y=a};"use strict";
papaya=papaya||{};papaya.volume=papaya.volume||{};papaya.volume.Header=papaya.volume.Header||function(c){this.origin=this.error=this.imageRange=this.orientation=this.imageType=this.imageDescription=this.voxelDimensions=this.imageDimensions=this.fileFormat=null;this.pad=c;this.orientationCertainty=papaya.volume.Header.ORIENTATION_CERTAINTY_UNKNOWN;this.onFinishedFileFormatRead=null};papaya.volume.Header.HEADER_TYPE_UNKNOWN=0;papaya.volume.Header.HEADER_TYPE_NIFTI=1;
papaya.volume.Header.HEADER_TYPE_DICOM=2;papaya.volume.Header.ERROR_UNRECOGNIZED_FORMAT="This format is not recognized!";papaya.volume.Header.INVALID_IMAGE_DIMENSIONS="Image dimensions are not valid!";papaya.volume.Header.INVALID_VOXEL_DIMENSIONS="Voxel dimensions are not valid!";papaya.volume.Header.INVALID_DATATYPE="Datatype is not valid or not supported!";papaya.volume.Header.INVALID_IMAGE_RANGE="Image range is not valid!";papaya.volume.Header.ORIENTATION_CERTAINTY_UNKNOWN=0;
papaya.volume.Header.ORIENTATION_CERTAINTY_LOW=1;papaya.volume.Header.ORIENTATION_CERTAINTY_HIGH=2;papaya.volume.Header.prototype.findHeaderType=function(c,a){return papaya.volume.nifti.HeaderNIFTI.isThisFormat(c,a)?papaya.volume.Header.HEADER_TYPE_NIFTI:papaya.Container.DICOM_SUPPORT&&papaya.volume.dicom.HeaderDICOM.isThisFormat(c,a)?papaya.volume.Header.HEADER_TYPE_DICOM:papaya.volume.Header.HEADER_TYPE_UNKNOWN};
papaya.volume.Header.prototype.readHeaderData=function(c,a,d,f,b){c=this.findHeaderType(c,a);this.onFinishedFileFormatRead=b;c===papaya.volume.Header.HEADER_TYPE_NIFTI?(this.fileFormat=new papaya.volume.nifti.HeaderNIFTI,this.fileFormat.readHeaderData(a,d,f,papaya.utilities.ObjectUtils.bind(this,this.onFinishedHeaderRead))):c===papaya.volume.Header.HEADER_TYPE_DICOM?(this.fileFormat=new papaya.volume.dicom.HeaderDICOM,this.fileFormat.readHeaderData(a,d,f,papaya.utilities.ObjectUtils.bind(this,this.onFinishedHeaderRead))):
(this.error=Error(papaya.volume.Header.ERROR_UNRECOGNIZED_FORMAT),this.onFinishedFileFormatRead())};
papaya.volume.Header.prototype.onFinishedHeaderRead=function(){this.fileFormat.hasError()?this.error=this.fileFormat.error:(this.imageType=this.fileFormat.getImageType(),this.imageType.isValid()||(this.error=Error(papaya.volume.Header.INVALID_DATATYPE)),this.imageDimensions=this.fileFormat.getImageDimensions(),this.imageDimensions.isValid()||(this.error=Error(papaya.volume.Header.INVALID_IMAGE_DIMENSIONS)),this.voxelDimensions=this.fileFormat.getVoxelDimensions(),this.voxelDimensions.isValid()||(this.error=
Error(papaya.volume.Header.INVALID_VOXEL_DIMENSIONS)),this.pad&&this.imageDimensions.padIsometric(this.voxelDimensions),this.orientation=this.fileFormat.getOrientation(),this.orientation.isValid()?this.orientationCertainty=this.fileFormat.getOrientationCertainty():(this.orientation=new papaya.volume.Orientation(papaya.volume.Orientation.DEFAULT),this.orientationCertainty=papaya.volume.Header.ORIENTATION_CERTAINTY_UNKNOWN),this.orientation.createInfo(this.imageDimensions,this.voxelDimensions),this.origin=
this.orientation.convertCoordinate(this.fileFormat.getOrigin(),new papaya.core.Coordinate(0,0,0)),this.imageRange=this.fileFormat.getImageRange(),this.imageRange.isValid()||(this.error=Error(papaya.volume.Header.INVALID_IMAGE_RANGE)),this.imageDescription=this.fileFormat.getImageDescription());this.onFinishedFileFormatRead()};papaya.volume.Header.prototype.getName=function(){return this.fileFormat.getName()};
papaya.volume.Header.prototype.readImageData=function(c,a){this.fileFormat.readImageData(c,a)};papaya.volume.Header.prototype.hasError=function(){return null!==this.error};papaya.volume.Header.prototype.getBestTransform=function(){return this.fileFormat.getBestTransform()};papaya.volume.Header.prototype.getBestTransformOrigin=function(){return this.fileFormat.getBestTransformOrigin()};papaya.volume.Header.prototype.toString=function(){return this.fileFormat.toString()};"use strict";
papaya=papaya||{};papaya.volume=papaya.volume||{};papaya.volume.ImageData=papaya.volume.ImageData||function(c){this.data=null;this.pad=c};
papaya.volume.ImageData.prototype.readFileData=function(c,a,d){var f,b;this.pad&&(a=this.padIsometric(c,a));if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_RGB)if(f=a.byteLength/3,b=2*f,c=c.imageType.rgbBySample,a=new DataView(a,0),this.data=new Uint32Array(f),c){for(c=0;c<f;c+=1)this.data[c]|=a.getUint8(c)<<16;for(c=0;c<f;c+=1)this.data[c]|=a.getUint8(c+f)<<8;for(c=0;c<f;c+=1)this.data[c]|=a.getUint8(c+b)}else for(c=0;c<f;c+=1)this.data[c]=a.getUint8(3*c)<<16|a.getUint8(3*c+1)<<8|a.getUint8(3*
c+2);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_SIGNED&&1===c.imageType.numBytes)this.data=new Int8Array(a,0,a.byteLength);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_UNSIGNED&&1===c.imageType.numBytes)this.data=new Uint8Array(a,0,a.byteLength);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_SIGNED&&2===c.imageType.numBytes)this.data=new Int16Array(a,0,a.byteLength/2);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_UNSIGNED&&
2===c.imageType.numBytes)this.data=new Uint16Array(a,0,a.byteLength/2);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_SIGNED&&4===c.imageType.numBytes)this.data=new Int32Array(a,0,a.byteLength/4);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_UNSIGNED&&4===c.imageType.numBytes)this.data=new Uint32Array(a,0,a.byteLength/4);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_FLOAT&&4===c.imageType.numBytes)if(c.imageType.swapped)for(f=a.byteLength/
Float32Array.BYTES_PER_ELEMENT,a=new DataView(a,0),this.data=new Float32Array(f),c=0;c<f;c+=1)this.data[c]=a.getFloat32(c*Float32Array.BYTES_PER_ELEMENT);else this.data=new Float32Array(a,0,a.byteLength/4);else if(c.imageType.datatype===papaya.volume.ImageType.DATATYPE_FLOAT&&8===c.imageType.numBytes)if(c.imageType.swapped)for(f=a.byteLength/Float64Array.BYTES_PER_ELEMENT,a=new DataView(a,0),this.data=new Float64Array(f),c=0;c<f;c+=1)this.data[c]=a.getFloat64(c*Float64Array.BYTES_PER_ELEMENT);else this.data=
new Float64Array(a,0,a.byteLength/8);d()};
papaya.volume.ImageData.prototype.padIsometric=function(c,a){for(var d=c.imageDimensions,f=c.voxelDimensions,b=c.imageType.numBytes,e=new Uint8Array(a,0,a.byteLength),h=d.colsOrig,g=d.rowsOrig,d=d.slicesOrig,k=h*f.colSize,l=g*f.rowSize,q=d*f.sliceSize,t=Math.max(Math.max(k,l),q),k=parseInt((t-k)/f.colSize/2,10),l=parseInt((t-l)/f.rowSize/2,10),t=parseInt((t-q)/f.sliceSize/2,10),y=h+2*k,B=g+2*l,h=h*b,k=k*b,l=l*y*b,A=t*y*B*b,q=f=0,b=new ArrayBuffer(y*B*(d+2*t)*b),t=new Uint8Array(b,0,b.byteLength),
f=f+A,y=0;y<d;y+=1){f+=l;for(B=0;B<g;B+=1){f+=k;for(A=0;A<h;A+=1,q++,f++)t[f]=e[q];f+=k}f+=l}return b};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};papaya.volume.ImageDescription=papaya.volume.ImageDescription||function(c){this.notes="(none)";papaya.utilities.StringUtils.isStringBlank(c)||(this.notes=c)};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};
papaya.volume.ImageDimensions=papaya.volume.ImageDimensions||function(c,a,d,f){this.cols=c;this.rows=a;this.slices=d;this.colsOrig=c;this.rowsOrig=a;this.slicesOrig=d;this.zDim=this.yDim=this.xDim=-1;this.timepoints=f||1;this.dataOffsets=[];this.dataLengths=[]};
papaya.volume.ImageDimensions.prototype.padIsometric=function(c){var a=this.cols,d=this.rows,f=this.slices,b=a*c.colSize,e=d*c.rowSize,h=f*c.sliceSize,g=Math.max(Math.max(b,e),h),b=parseInt((g-b)/c.colSize/2,10),e=parseInt((g-e)/c.rowSize/2,10);c=parseInt((g-h)/c.sliceSize/2,10);this.cols=a+2*b;this.rows=d+2*e;this.slices=f+2*c};papaya.volume.ImageDimensions.prototype.getNumVoxelsSeries=function(){return this.cols*this.rows*this.slices*this.timepoints};
papaya.volume.ImageDimensions.prototype.getNumVoxelsSlice=function(){return this.rows*this.cols};papaya.volume.ImageDimensions.prototype.getNumVoxelsVolume=function(){return this.rows*this.cols*this.slices};papaya.volume.ImageDimensions.prototype.isValid=function(){return 0<this.cols&&0<this.rows&&0<this.slices&&0<this.timepoints&&0<=this.dataOffsets[0]&&0<=this.dataLengths[0]};var moduleType=typeof module;"undefined"!==moduleType&&module.exports&&(module.exports.ImageDimensions=papaya.volume.ImageDimensions);
"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};papaya.volume.ImageRange=papaya.volume.ImageRange||function(c,a){this.displayMin=c;this.displayMax=a;this.imageMax=this.imageMin=0;this.dataScaleSlopes=[];this.dataScaleIntercepts=[];this.globalDataScaleSlope=1;this.globalDataScaleIntercept=0;this.usesGlobalDataScale=!1};papaya.volume.ImageRange.DEFAULT_SCALE=1;papaya.volume.ImageRange.DEFAULT_INTERCEPT=0;papaya.volume.ImageRange.prototype.isValid=function(){return!0};
papaya.volume.ImageRange.prototype.setGlobalDataScale=function(c,a){this.globalDataScaleSlope=c;this.globalDataScaleIntercept=a;this.usesGlobalDataScale=!0;this.dataScaleSlopes=[];this.dataScaleIntercepts=[]};
papaya.volume.ImageRange.prototype.validateDataScale=function(){var c,a,d=!1;if(1!==this.globalDataScaleSlope||0!==this.globalDataScaleIntercept)this.dataScaleSlopes=[],this.dataScaleIntercepts=[],this.usesGlobalDataScale=!0;else if(0<this.dataScaleSlopes.length&&0<this.dataScaleIntercepts.length){a=this.dataScaleSlopes[0];for(c=1;c<this.dataScaleSlopes.length;c+=1)if(a!==this.dataScaleSlopes[c]){d=!0;break}a=this.dataScaleIntercepts[0];for(c=1;c<this.dataScaleIntercepts.length;c+=1)if(a!==this.dataScaleIntercepts[c]){d=
!0;break}d?this.usesGlobalDataScale=!1:this.setGlobalDataScale(this.dataScaleSlopes[0],this.dataScaleIntercepts[0])}else this.setGlobalDataScale(1,0)};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};papaya.volume.ImageType=papaya.volume.ImageType||function(c,a,d,f){this.datatype=c;this.numBytes=a;this.littleEndian=d;this.swapped=!1;this.compressed=f;this.rgbBySample=!1};papaya.volume.ImageType.DATATYPE_UNKNOWN=0;papaya.volume.ImageType.DATATYPE_INTEGER_SIGNED=1;
papaya.volume.ImageType.DATATYPE_INTEGER_UNSIGNED=2;papaya.volume.ImageType.DATATYPE_FLOAT=3;papaya.volume.ImageType.DATATYPE_RGB=4;papaya.volume.ImageType.MAX_SUPPORTED_BYTES_FLOAT=8;papaya.volume.ImageType.MAX_SUPPORTED_BYTES_INTEGER=4;
papaya.volume.ImageType.prototype.isValid=function(){return this.datatype<=papaya.volume.ImageType.DATATYPE_RGB&&this.datatype>papaya.volume.ImageType.DATATYPE_UNKNOWN&&0<this.numBytes&&(this.datatype===papaya.volume.ImageType.DATATYPE_FLOAT&&this.numBytes<=papaya.volume.ImageType.MAX_SUPPORTED_BYTES_FLOAT||this.datatype!==papaya.volume.ImageType.DATATYPE_FLOAT&&this.numBytes<=papaya.volume.ImageType.MAX_SUPPORTED_BYTES_INTEGER)};
papaya.volume.ImageType.prototype.getTypeDescription=function(){return this.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_SIGNED?"Signed Integer":this.datatype===papaya.volume.ImageType.DATATYPE_INTEGER_UNSIGNED?"Unsigned Integer":this.datatype===papaya.volume.ImageType.DATATYPE_FLOAT?"Float":this.datatype===papaya.volume.ImageType.DATATYPE_RGB?"RGB":"Unknown"};
papaya.volume.ImageType.prototype.getOrderDescription=function(){return 1<this.numBytes?this.littleEndian?"Little Endian":"Big Endian":null};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};papaya.volume.nifti=papaya.volume.nifti||{};papaya.volume.nifti.HeaderNIFTI=papaya.volume.nifti.HeaderNIFTI||function(){this.nifti=null;this.compressed=this.isNIFTI2=!1;this.imageData=null};papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT="XYZ-++";
papaya.volume.nifti.HeaderNIFTI.SPATIAL_UNITS_MASK=7;papaya.volume.nifti.HeaderNIFTI.TEMPORAL_UNITS_MASK=56;papaya.volume.nifti.HeaderNIFTI.isThisFormat=function(c,a){return-1!==c.indexOf(".nii")?!0:nifti.isNIFTI(a[0])};papaya.volume.nifti.HeaderNIFTI.prototype.readHeaderData=function(c,a,d,f){this.nifti=nifti.readHeader(c[0]);this.isNIFTI2=nifti.isNIFTI2(c[0]);this.imageData=nifti.readImage(this.nifti,c[0]);f()};
papaya.volume.nifti.HeaderNIFTI.prototype.readImageData=function(c,a){a(this.imageData);this.imageData=null};papaya.volume.nifti.HeaderNIFTI.prototype.getImageDimensions=function(){var c=new papaya.volume.ImageDimensions(this.nifti.dims[1],this.nifti.dims[2],this.nifti.dims[3],this.nifti.dims[4]);c.dataOffsets[0]=this.nifti.vox_offset;c.dataLengths[0]=c.getNumVoxelsSeries()*(this.nifti.numBitsPerVoxel/8);return c};papaya.volume.nifti.HeaderNIFTI.prototype.getName=function(){return null};
papaya.volume.nifti.HeaderNIFTI.prototype.getVoxelDimensions=function(){var c;c=new papaya.volume.VoxelDimensions(this.nifti.pixDims[1],this.nifti.pixDims[2],this.nifti.pixDims[3],this.nifti.pixDims[4]);c.spatialUnit=this.nifti.xyzt_units&papaya.volume.nifti.HeaderNIFTI.SPATIAL_UNITS_MASK;c.temporalUnit=this.nifti.xyzt_units&papaya.volume.nifti.HeaderNIFTI.TEMPORAL_UNITS_MASK;return c};
papaya.volume.nifti.HeaderNIFTI.prototype.getImageType=function(){var c=papaya.volume.ImageType.DATATYPE_UNKNOWN;this.nifti.datatypeCode===nifti.NIFTI1.TYPE_UINT8||this.nifti.datatypeCode===nifti.NIFTI1.TYPE_UINT16||this.nifti.datatypeCode===nifti.NIFTI1.TYPE_UINT32||this.nifti.datatypeCode===nifti.NIFTI1.TYPE_UINT64?c=papaya.volume.ImageType.DATATYPE_INTEGER_UNSIGNED:this.nifti.datatypeCode===nifti.NIFTI1.TYPE_INT8||this.nifti.datatypeCode===nifti.NIFTI1.TYPE_INT16||this.nifti.datatypeCode===nifti.NIFTI1.TYPE_INT32||
this.nifti.datatypeCode===nifti.NIFTI1.TYPE_INT64?c=papaya.volume.ImageType.DATATYPE_INTEGER_SIGNED:this.nifti.datatypeCode===nifti.NIFTI1.TYPE_FLOAT32||this.nifti.datatypeCode===nifti.NIFTI1.TYPE_FLOAT64?c=papaya.volume.ImageType.DATATYPE_FLOAT:this.nifti.datatypeCode===nifti.NIFTI1.TYPE_RGB24&&(c=papaya.volume.ImageType.DATATYPE_RGB);return new papaya.volume.ImageType(c,this.nifti.numBitsPerVoxel/8,this.nifti.littleEndian,this.compressed)};
papaya.volume.nifti.HeaderNIFTI.prototype.getOrientation=function(){var c=null;0<this.nifti.qform_code&&!this.qFormHasRotations()&&(c=this.getOrientationQform());this.nifti.sform_code>this.nifti.qform_code&&!this.sFormHasRotations()&&(c=this.getOrientationSform());null===c&&(c=papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT);return new papaya.volume.Orientation(c)};
papaya.volume.nifti.HeaderNIFTI.prototype.getOrientationQform=function(){var c=papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT,c=this.nifti.convertNiftiQFormToNiftiSForm(this.nifti.quatern_b,this.nifti.quatern_c,this.nifti.quatern_d,this.nifti.qoffset_x,this.nifti.qoffset_y,this.nifti.qoffset_z,this.nifti.pixDims[1],this.nifti.pixDims[2],this.nifti.pixDims[3],this.nifti.pixDims[0]);0<this.nifti.qform_code?(c=this.nifti.convertNiftiSFormToNEMA(c),papaya.volume.Orientation.isValidOrientationString(c)||
(c=papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT)):c=papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT;return c};papaya.volume.nifti.HeaderNIFTI.prototype.getOrientationSform=function(){var c=this.nifti.convertNiftiSFormToNEMA(this.nifti.affine);papaya.volume.Orientation.isValidOrientationString(c)||(c=papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT);return c};papaya.volume.nifti.HeaderNIFTI.prototype.getQformMatCopy=function(){return this.nifti.getQformMat().clone()};
papaya.volume.nifti.HeaderNIFTI.prototype.getSformMatCopy=function(){return this.nifti.affine.clone()};
papaya.volume.nifti.HeaderNIFTI.prototype.getOrigin=function(c,a){var d=new papaya.core.Coordinate(0,0,0),f,b,e,h,g,k,l;0<this.nifti.qform_code&&!a?this.qFormHasRotations()?(f=this.nifti.getQformMat(),f=numeric.inv(f),d.setCoordinate(f[0][3],f[1][3],f[2][3])):(f=this.nifti.convertNiftiQFormToNiftiSForm(this.nifti.quatern_b,this.nifti.quatern_c,this.nifti.quatern_d,this.nifti.qoffset_x,this.nifti.qoffset_y,this.nifti.qoffset_z,this.nifti.pixDims[1],this.nifti.pixDims[2],this.nifti.pixDims[3],this.nifti.pixDims[0]),
f=this.nifti.convertNiftiSFormToNEMA(f),papaya.volume.Orientation.isValidOrientationString(f)||(f=papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT),e=f.substring(0,3).toUpperCase(),b=f.substring(3),f=e.indexOf("X"),h=e.indexOf("Y"),e=e.indexOf("Z"),g="+"===b.charAt(f),k="+"===b.charAt(h),l="+"===b.charAt(e),b=Array(3),b[0]=this.nifti.qoffset_x/this.nifti.pixDims[f+1]*(g?-1:1),b[1]=this.nifti.qoffset_y/this.nifti.pixDims[h+1]*(k?-1:1),b[2]=this.nifti.qoffset_z/this.nifti.pixDims[e+1]*(l?-1:1),d.setCoordinate(b[0],
b[1],b[2],!0)):0<this.nifti.sform_code&&!c&&(this.sFormHasRotations()?(f=numeric.inv(this.nifti.affine),d.setCoordinate(f[0][3],f[1][3],f[2][3])):(f=this.nifti.convertNiftiSFormToNEMA(this.nifti.affine),papaya.volume.Orientation.isValidOrientationString(f)||(f=papaya.volume.nifti.HeaderNIFTI.ORIENTATION_DEFAULT),e=f.substring(0,3).toUpperCase(),b=f.substring(3),f=e.indexOf("X"),h=e.indexOf("Y"),e=e.indexOf("Z"),g="+"===b.charAt(f),k="+"===b.charAt(h),l="+"===b.charAt(e),b=Array(3),b[0]=this.nifti.affine[0][3]/
this.nifti.pixDims[f+1]*(g?-1:1),b[1]=this.nifti.affine[1][3]/this.nifti.pixDims[h+1]*(k?-1:1),b[2]=this.nifti.affine[2][3]/this.nifti.pixDims[e+1]*(l?-1:1),d.setCoordinate(b[0],b[1],b[2],!0)));d.isAllZeros()&&d.setCoordinate(this.nifti.dims[1]/2,this.nifti.dims[2]/2,this.nifti.dims[3]/2);return d};papaya.volume.nifti.HeaderNIFTI.prototype.qFormHasRotations=function(){return papaya.volume.Transform.hasRotations(this.getQformMatCopy())};papaya.volume.nifti.HeaderNIFTI.prototype.sFormHasRotations=function(){return papaya.volume.Transform.hasRotations(this.getSformMatCopy())};
papaya.volume.nifti.HeaderNIFTI.prototype.getImageRange=function(){var c=new papaya.volume.ImageRange(this.nifti.cal_min,this.nifti.cal_max),a=this.nifti.scl_slope,d=this.getImageDimensions();0===a&&(a=1);c.setGlobalDataScale(a,this.nifti.scl_inter,d.slices*d.timepoints);c.validateDataScale();return c};papaya.volume.nifti.HeaderNIFTI.prototype.hasError=function(){return!1};papaya.volume.nifti.HeaderNIFTI.prototype.getImageDescription=function(){return new papaya.volume.ImageDescription(this.nifti.description)};
papaya.volume.nifti.HeaderNIFTI.prototype.getOrientationCertainty=function(){var c,a;c=papaya.volume.Header.ORIENTATION_CERTAINTY_UNKNOWN;if(0<this.nifti.qform_code||0<this.nifti.sform_code)c=papaya.volume.Header.ORIENTATION_CERTAINTY_LOW,a=this.getOrigin(),null===a||a.isAllZeros()||(c=papaya.volume.Header.ORIENTATION_CERTAINTY_HIGH);return c};
papaya.volume.nifti.HeaderNIFTI.prototype.getBestTransform=function(){return 0<this.nifti.qform_code&&this.nifti.qform_code>this.nifti.sform_code&&this.qFormHasRotations()?this.getQformMatCopy():0<this.nifti.sform_code&&this.nifti.sform_code>=this.nifti.qform_code&&this.sFormHasRotations()?this.getSformMatCopy():null};
papaya.volume.nifti.HeaderNIFTI.prototype.getBestTransformOrigin=function(){return 0<this.nifti.qform_code&&this.nifti.qform_code>this.nifti.sform_code&&this.qFormHasRotations()?this.getOrigin(!0,!1):0<this.nifti.sform_code&&this.nifti.sform_code>=this.nifti.qform_code&&this.sFormHasRotations()?this.getOrigin(!1,!0):null};
papaya.volume.nifti.HeaderNIFTI.prototype.toString=function(){var c=papaya.utilities.StringUtils.formatNumber,a="";this.isNIFTI2?(a+="<span style='color:#B5CBD3'>Datatype</span><span style='color:gray'> = </span>"+this.nifti.datatypeCode+" ("+this.nifti.getDatatypeCodeString(this.nifti.datatypeCode)+")<br />",a+="<span style='color:#B5CBD3'>Bits Per Voxel</span><span style='color:gray'> = </span>"+this.nifti.numBitsPerVoxel+"<br />",a+="<span style='color:#B5CBD3'>Image Dimensions</span> (1-8): "+
this.nifti.dims[0]+", "+this.nifti.dims[1]+", "+this.nifti.dims[2]+", "+this.nifti.dims[3]+", "+this.nifti.dims[4]+", "+this.nifti.dims[5]+", "+this.nifti.dims[6]+", "+this.nifti.dims[7]+"<br />",a+="<span style='color:#B5CBD3'>Intent Parameters</span> (1-3): "+this.nifti.intent_p1+", "+this.nifti.intent_p2+", "+this.nifti.intent_p3+"<br />",a+="<span style='color:#B5CBD3'>Voxel Dimensions</span> (1-8): "+c(this.nifti.pixDims[0])+", "+c(this.nifti.pixDims[1])+", "+c(this.nifti.pixDims[2])+", "+c(this.nifti.pixDims[3])+
", "+c(this.nifti.pixDims[4])+", "+c(this.nifti.pixDims[5])+", "+c(this.nifti.pixDims[6])+", "+c(this.nifti.pixDims[7])+"<br />",a+="<span style='color:#B5CBD3'>Image Offset</span><span style='color:gray'> = </span>"+this.nifti.vox_offset+"<br />",a+="<span style='color:#B5CBD3'>Data Scale:  Slope</span><span style='color:gray'> = </span>"+this.nifti.scl_slope+"  <span style='color:#B5CBD3'>Intercept</span><span style='color:gray'> = </span>"+this.nifti.scl_inter+"<br />",a+="<span style='color:#B5CBD3'>Display Range:  Max</span><span style='color:gray'> = </span>"+
this.nifti.cal_max+"  <span style='color:#B5CBD3'>Min</span><span style='color:gray'> = </span>"+this.nifti.cal_min+"<br />",a+="<span style='color:#B5CBD3'>Slice Duration</span><span style='color:gray'> = </span>"+this.nifti.slice_duration+"<br />",a+="<span style='color:#B5CBD3'>Time Axis Shift</span><span style='color:gray'> = </span>"+this.nifti.toffset+"<br />",a+="<span style='color:#B5CBD3'>Slice Start</span><span style='color:gray'> = </span>"+this.nifti.slice_start+"<br />",a+="<span style='color:#B5CBD3'>Slice End</span><span style='color:gray'> = </span>"+
this.nifti.slice_end+"<br />",a+="<span style='color:#B5CBD3'>Description</span>: \""+this.nifti.description+'"<br />',a+="<span style='color:#B5CBD3'>Auxiliary File</span>: \""+this.nifti.aux_file+'"<br />',a+="<span style='color:#B5CBD3'>Q-Form Code</span><span style='color:gray'> = </span>"+this.nifti.qform_code+" ("+this.nifti.getTransformCodeString(this.nifti.qform_code)+")<br />",a+="<span style='color:#B5CBD3'>S-Form Code</span><span style='color:gray'> = </span>"+this.nifti.sform_code+" ("+
this.nifti.getTransformCodeString(this.nifti.sform_code)+")<br />",a+="<span style='color:#B5CBD3'>Quaternion Parameters</span>:  <span style='color:#B5CBD3'>b</span> <span style='color:gray'>=</span> "+c(this.nifti.quatern_b)+"  <span style='color:#B5CBD3'>c</span> <span style='color:gray'>=</span> "+c(this.nifti.quatern_c)+"  <span style='color:#B5CBD3'>d</span> <span style='color:gray'>=</span> "+c(this.nifti.quatern_d)+"<br />",a+="<span style='color:#B5CBD3'>Quaternion Offsets</span>:  <span style='color:#B5CBD3'>x</span> <span style='color:gray'>=</span> "+
this.nifti.qoffset_x+"  <span style='color:#B5CBD3'>y</span> <span style='color:gray'>=</span> "+this.nifti.qoffset_y+"  <span style='color:#B5CBD3'>z</span> <span style='color:gray'>=</span> "+this.nifti.qoffset_z+"<br />",a+="<span style='color:#B5CBD3'>S-Form Parameters X</span>: "+c(this.nifti.affine[0][0])+", "+c(this.nifti.affine[0][1])+", "+c(this.nifti.affine[0][2])+", "+c(this.nifti.affine[0][3])+"<br />",a+="<span style='color:#B5CBD3'>S-Form Parameters Y</span>: "+c(this.nifti.affine[1][0])+
", "+c(this.nifti.affine[1][1])+", "+c(this.nifti.affine[1][2])+", "+c(this.nifti.affine[1][3])+"<br />",a+="<span style='color:#B5CBD3'>S-Form Parameters Z</span>: "+c(this.nifti.affine[2][0])+", "+c(this.nifti.affine[2][1])+", "+c(this.nifti.affine[2][2])+", "+c(this.nifti.affine[2][3])+"<br />",a+="<span style='color:#B5CBD3'>Slice Code</span><span style='color:gray'> = </span>"+this.nifti.slice_code+"<br />",a+="<span style='color:#B5CBD3'>Units Code</span><span style='color:gray'> = </span>"+
this.nifti.xyzt_units+" ("+this.nifti.getUnitsCodeString(nifti.NIFTI1.SPATIAL_UNITS_MASK&this.nifti.xyzt_units)+", "+this.nifti.getUnitsCodeString(nifti.NIFTI1.TEMPORAL_UNITS_MASK&this.nifti.xyzt_units)+")<br />",a+="<span style='color:#B5CBD3'>Intent Code </span><span style='color:gray'> = </span>"+this.nifti.intent_code+"<br />",a+="<span style='color:#B5CBD3'>Intent Name</span>: \""+this.nifti.intent_name+'"<br />',a+="<span style='color:#B5CBD3'>Dim Info </span><span style='color:gray'> = </span>"+
this.nifti.dim_info+"<br />"):(a+="<span style='color:#B5CBD3'>Dim Info</span><span style='color:gray'> = </span>"+this.nifti.dim_info+"<br />",a+="<span style='color:#B5CBD3'>Image Dimensions</span> (1-8): "+this.nifti.dims[0]+", "+this.nifti.dims[1]+", "+this.nifti.dims[2]+", "+this.nifti.dims[3]+", "+this.nifti.dims[4]+", "+this.nifti.dims[5]+", "+this.nifti.dims[6]+", "+this.nifti.dims[7]+"<br />",a+="<span style='color:#B5CBD3'>Intent Parameters</span> (1-3): "+this.nifti.intent_p1+", "+this.nifti.intent_p2+
", "+this.nifti.intent_p3+"<br />",a+="<span style='color:#B5CBD3'>Intent Code</span><span style='color:gray'> = </span>"+this.nifti.intent_code+"<br />",a+="<span style='color:#B5CBD3'>Datatype</span><span style='color:gray'> = </span>"+this.nifti.datatypeCode+" ("+this.nifti.getDatatypeCodeString(this.nifti.datatypeCode)+")<br />",a+="<span style='color:#B5CBD3'>Bits Per Voxel</span><span style='color:gray'> = </span>"+this.nifti.numBitsPerVoxel+"<br />",a+="<span style='color:#B5CBD3'>Slice Start</span><span style='color:gray'> = </span>"+
this.nifti.slice_start+"<br />",a+="<span style='color:#B5CBD3'>Voxel Dimensions</span> (1-8): "+c(this.nifti.pixDims[0])+", "+c(this.nifti.pixDims[1])+", "+c(this.nifti.pixDims[2])+", "+c(this.nifti.pixDims[3])+", "+c(this.nifti.pixDims[4])+", "+c(this.nifti.pixDims[5])+", "+c(this.nifti.pixDims[6])+", "+c(this.nifti.pixDims[7])+"<br />",a+="<span style='color:#B5CBD3'>Image Offset</span><span style='color:gray'> = </span>"+this.nifti.vox_offset+"<br />",a+="<span style='color:#B5CBD3'>Data Scale</span>:  <span style='color:#B5CBD3'>Slope</span> = "+
this.nifti.scl_slope+"  <span style='color:#B5CBD3'>Intercept</span> = "+this.nifti.scl_inter+"<br />",a+="<span style='color:#B5CBD3'>Slice End</span><span style='color:gray'> = </span>"+this.nifti.slice_end+"<br />",a+="<span style='color:#B5CBD3'>Slice Code</span><span style='color:gray'> = </span>"+this.nifti.slice_code+"<br />",a+="<span style='color:#B5CBD3'>Units Code</span><span style='color:gray'> = </span>"+this.nifti.xyzt_units+" ("+this.nifti.getUnitsCodeString(nifti.NIFTI1.SPATIAL_UNITS_MASK&
this.nifti.xyzt_units)+", "+this.nifti.getUnitsCodeString(nifti.NIFTI1.TEMPORAL_UNITS_MASK&this.nifti.xyzt_units)+")<br />",a+="<span style='color:#B5CBD3'>Display Range</span>:  <span style='color:#B5CBD3'>Max</span><span style='color:gray'> = </span>"+this.nifti.cal_max+"  <span style='color:#B5CBD3'>Min</span><span style='color:gray'> = </span>"+this.nifti.cal_min+"<br />",a+="<span style='color:#B5CBD3'>Slice Duration</span><span style='color:gray'> = </span>"+this.nifti.slice_duration+"<br />",
a+="<span style='color:#B5CBD3'>Time Axis Shift</span><span style='color:gray'> = </span>"+this.nifti.toffset+"<br />",a+="<span style='color:#B5CBD3'>Description</span>: \""+this.nifti.description+'"<br />',a+="<span style='color:#B5CBD3'>Auxiliary File</span>: \""+this.nifti.aux_file+'"<br />',a+="<span style='color:#B5CBD3'>Q-Form Code</span><span style='color:gray'> = </span>"+this.nifti.qform_code+" ("+this.nifti.getTransformCodeString(this.nifti.qform_code)+")<br />",a+="<span style='color:#B5CBD3'>S-Form Code</span><span style='color:gray'> = </span>"+
this.nifti.sform_code+" ("+this.nifti.getTransformCodeString(this.nifti.sform_code)+")<br />",a+="<span style='color:#B5CBD3'>Quaternion Parameters</span>:  <span style='color:#B5CBD3'>b</span><span style='color:gray'> = </span>"+c(this.nifti.quatern_b)+"  <span style='color:#B5CBD3'>c</span><span style='color:gray'> = </span>"+c(this.nifti.quatern_c)+"  <span style='color:#B5CBD3'>d</span><span style='color:gray'> = </span>"+c(this.nifti.quatern_d)+"<br />",a+="<span style='color:#B5CBD3'>Quaternion Offsets</span>:  <span style='color:#B5CBD3'>x</span><span style='color:gray'> = </span>"+
this.nifti.qoffset_x+"  <span style='color:#B5CBD3'>y</span><span style='color:gray'> = </span>"+this.nifti.qoffset_y+"  <span style='color:#B5CBD3'>z</span><span style='color:gray'> = </span>"+this.nifti.qoffset_z+"<br />",a+="<span style='color:#B5CBD3'>S-Form Parameters X</span>: "+c(this.nifti.affine[0][0])+", "+c(this.nifti.affine[0][1])+", "+c(this.nifti.affine[0][2])+", "+c(this.nifti.affine[0][3])+"<br />",a+="<span style='color:#B5CBD3'>S-Form Parameters Y</span>: "+c(this.nifti.affine[1][0])+
", "+c(this.nifti.affine[1][1])+", "+c(this.nifti.affine[1][2])+", "+c(this.nifti.affine[1][3])+"<br />",a+="<span style='color:#B5CBD3'>S-Form Parameters Z</span>: "+c(this.nifti.affine[2][0])+", "+c(this.nifti.affine[2][1])+", "+c(this.nifti.affine[2][2])+", "+c(this.nifti.affine[2][3])+"<br />",a+="<span style='color:#B5CBD3'>Intent Name</span>: \""+this.nifti.intent_name+'"<br />');return a};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};
papaya.volume.dicom=papaya.volume.dicom||{};papaya.volume.dicom.HeaderDICOM=papaya.volume.dicom.HeaderDICOM||function(){this.series=null;this.seriesMap=[];this.dialogHandler=this.onFinishedHeaderRead=this.error=null};papaya.volume.dicom.HeaderDICOM.ORIENTATION_DEFAULT="XYZ+--";papaya.volume.dicom.HeaderDICOM.SUPPORTED_TRANSFER_SYNTAXES="1.2.840.10008.1.2 1.2.840.10008.1.2.1 1.2.840.10008.1.2.2 1.2.840.10008.1.2.1.99 1.2.840.10008.1.2.4.50 1.2.840.10008.1.2.4.51 1.2.840.10008.1.2.4.57 1.2.840.10008.1.2.4.70 1.2.840.10008.1.2.4.90 1.2.840.10008.1.2.4.91 1.2.840.10008.1.2.5".split(" ");
papaya.volume.dicom.HeaderDICOM.isThisFormat=function(c,a){var d,f,b,e,h=0;if(-1!==c.indexOf(".dcm"))return!0;d=new DataView(a[0]);f=daikon.Parser.MAGIC_COOKIE_OFFSET;b=daikon.Parser.MAGIC_COOKIE.length;for(e=0;e<b;e+=1)d.getUint8(f+e)===daikon.Parser.MAGIC_COOKIE[e]&&(h+=1);if(4===h)return!0;f=new daikon.Parser;d=f.testForValidTag(d);return null!==d&&8>=d.group&&!f.hasError()};
papaya.volume.dicom.HeaderDICOM.prototype.setSeries=function(c,a){var d;for(d=0;d<Object.keys(this.seriesMap).length;d+=1)if(-1!==Object.keys(this.seriesMap)[d].indexOf(a)){this.series=this.seriesMap[Object.keys(this.seriesMap)[d]];break}};papaya.volume.dicom.HeaderDICOM.prototype.getDataScaleSlope=function(c,a){return c?a.getDataScaleElscint()||1:a.getDataScaleSlope()||1};papaya.volume.dicom.HeaderDICOM.prototype.getDataScaleIntercept=function(c,a){return c?0:a.getDataScaleIntercept()||0};
papaya.volume.dicom.HeaderDICOM.prototype.finishedHeaderRead=function(){var c,a;if(this.error)this.onFinishedHeaderRead();else if(1<Object.keys(this.seriesMap).length){this.series=this.seriesMap[Object.keys(this.seriesMap)[0]];c=[];for(a=0;a<Object.keys(this.seriesMap).length;a+=1)c.push(this.seriesMap[Object.keys(this.seriesMap)[a]]);c={items:[{label:"Select:",field:"series",options:c}]};this.dialogHandler.showDialog("Select DICOM Series",c,this,papaya.utilities.ObjectUtils.bind(this,this.setSeries),
papaya.utilities.ObjectUtils.bind(this,this.finishedSeriesSelection))}else this.series=this.seriesMap[Object.keys(this.seriesMap)[0]],0<this.series.images.length?(this.series.buildSeries(),this.isTransferSyntaxSupported()||(this.error=Error("This transfer syntax is currently not supported!"))):this.error=Error("No images found!"),this.onFinishedHeaderRead()};
papaya.volume.dicom.HeaderDICOM.prototype.isTransferSyntaxSupported=function(){var c=this.series.images[0].getTransferSyntax();return papaya.utilities.StringUtils.isStringBlank(c)||papaya.utilities.ArrayUtils.contains(papaya.volume.dicom.HeaderDICOM.SUPPORTED_TRANSFER_SYNTAXES,c)};
papaya.volume.dicom.HeaderDICOM.prototype.finishedSeriesSelection=function(){0<this.series.images.length?(this.series.buildSeries(),this.isTransferSyntaxSupported()||(this.error=Error("This transfer syntax is currently not supported!"))):this.error=Error("No images found!");this.seriesMap=null;this.onFinishedHeaderRead()};
papaya.volume.dicom.HeaderDICOM.prototype.readHeaderData=function(c,a,d,f){this.onFinishedHeaderRead=f;this.dialogHandler=d;this.readNextHeaderData(c,0,a,papaya.utilities.ObjectUtils.bind(this,this.finishedHeaderRead))};
papaya.volume.dicom.HeaderDICOM.prototype.readNextHeaderData=function(c,a,d,f){var b,e;a>=c.length?(d.drawProgress(1,"Reading DICOM Headers"),f()):(b=daikon.Series.parseImage(new DataView(c[a])),null===b?this.error=daikon.Series.parserError:b.hasPixelData()?(e=this.findSeries(b.getSeriesId()),e||(e=new daikon.Series,this.seriesMap[b.getSeriesId()]=e),e.addImage(b)):this.error=Error("No pixel data found!"),this.error?f():(d.drawProgress(a/c.length,"Reading DICOM Headers"),setTimeout(function(){this.readNextHeaderData(c,
a+1,d,f)}.bind(this),0)))};papaya.volume.dicom.HeaderDICOM.prototype.getName=function(){var c=this.series.getName();return c?c:null};papaya.volume.dicom.HeaderDICOM.prototype.findSeries=function(c){return 0===Object.keys(this.seriesMap).length?null:this.seriesMap[c]};papaya.volume.dicom.HeaderDICOM.prototype.readImageData=function(c,a){this.series.concatenateImageData(c,a)};
papaya.volume.dicom.HeaderDICOM.prototype.getImageDimensions=function(){var c,a,d;this.series.isMosaic?(c=this.series.images[0].getMosaicCols()*this.series.images[0].getMosaicRows(),c=new papaya.volume.ImageDimensions(parseInt(this.series.images[0].getCols()/this.series.images[0].getMosaicCols()),parseInt(this.series.images[0].getRows()/this.series.images[0].getMosaicRows()),c,this.series.images.length)):c=this.series.isMultiFrameVolume?new papaya.volume.ImageDimensions(this.series.images[0].getCols(),
this.series.images[0].getRows(),this.series.numberOfFrames,1):this.series.isMultiFrameTimeseries?new papaya.volume.ImageDimensions(this.series.images[0].getCols(),this.series.images[0].getRows(),this.series.numberOfFramesInFile,this.series.numberOfFrames):this.series.isImplicitTimeseries?new papaya.volume.ImageDimensions(this.series.images[0].getCols(),this.series.images[0].getRows(),parseInt(this.series.images.length/this.series.numberOfFrames),this.series.numberOfFrames):new papaya.volume.ImageDimensions(this.series.images[0].getCols(),
this.series.images[0].getRows(),this.series.images.length,1);d=parseInt(c.getNumVoxelsSeries()*parseInt(this.series.images[0].getBitsAllocated()/8)/this.series.images.length);for(a=0;a<this.series.images.length;a+=1)c.dataOffsets[a]=this.series.images[a].getPixelData().offsetValue,c.dataLengths[a]=d;return c};
papaya.volume.dicom.HeaderDICOM.prototype.getVoxelDimensions=function(){var c,a;c=this.series.images[0].getPixelSpacing()||[0,0];a=Math.max(this.series.images[0].getSliceGap(),this.series.images[0].getSliceThickness());this.series.isMosaic||this.series.isMultiFrame||1===this.series.images.length||(a=Math.abs(this.series.images[0].getSliceLocation()-this.series.images[1].getSliceLocation()),0===a&&(a=Math.max(this.series.images[0].getSliceGap(),this.series.images[0].getSliceThickness())));c=new papaya.volume.VoxelDimensions(c[1],
c[0],a,this.series.images[0].getTR()/1E3);c.isValid()||(0===c.rowSize&&(c.rowSize=1),0===c.colSize&&(c.colSize=1),0===c.sliceSize&&(c.sliceSize=1));c.spatialUnit=papaya.volume.VoxelDimensions.UNITS_MM;c.temporalUnit=papaya.volume.VoxelDimensions.UNITS_SEC;return c};
papaya.volume.dicom.HeaderDICOM.prototype.getImageType=function(){var c;c=this.series.images[0].getDataType();c=new papaya.volume.ImageType(c===daikon.Image.BYTE_TYPE_INTEGER?papaya.volume.ImageType.DATATYPE_INTEGER_SIGNED:c===daikon.Image.BYTE_TYPE_INTEGER_UNSIGNED?papaya.volume.ImageType.DATATYPE_INTEGER_UNSIGNED:c===daikon.Image.BYTE_TYPE_FLOAT?papaya.volume.ImageType.DATATYPE_FLOAT:c===daikon.Image.BYTE_TYPE_RGB?papaya.volume.ImageType.DATATYPE_RGB:papaya.volume.ImageType.DATATYPE_UNKNOWN,parseInt(this.series.images[0].getBitsAllocated()/
8),this.series.images[0].littleEndian,!1);c.rgbBySample=1===this.series.images[0].getPlanarConfig();return c};
papaya.volume.dicom.HeaderDICOM.prototype.getImageRange=function(){var c,a,d,f,b,e,h,g,k,l=[],q=[];g=[];k=[];for(b=a=c=0;b<this.series.images.length;b+=1)d=this.series.images[b],f=d.getImageMax()*this.getDataScaleSlope(this.series.isElscint,d)+(d.getDataScaleIntercept()||0),d=d.getImageMin()*this.getDataScaleSlope(this.series.isElscint,d)+(d.getDataScaleIntercept()||0),0===b?(c=f,a=d):(f>c&&(c=f),d<a&&(a=d));e=f=0;if(this.series.isElscint)for(b=0;b<this.series.images.length;b+=1)d=this.series.images[b],
h=d.getWindowWidth()*d.getDataScaleElscint(),d=d.getWindowCenter()*d.getDataScaleElscint(),0===b?(f=h,e=d):e<d&&(f=h,e=d);else for(b=0;b<this.series.images.length;b+=1)d=this.series.images[b],h=d.getWindowWidth(),d=d.getWindowCenter(),0===b?(f=h,e=d):e<d&&(f=h,e=d);c=new papaya.volume.ImageRange(a,c);c.displayMin=e-f/2;c.displayMax=e+f/2;b=this.getImageDimensions();if(this.series.isMosaic){g=b.slices;k=g*this.series.images.length;for(b=0;b<k;b+=1)d=this.series.images[parseInt(b/g)],l[b]=this.getDataScaleSlope(this.series.isElscint,
d),q[b]=this.getDataScaleIntercept(this.series.isElscint,d);c.dataScaleSlopes=l;c.dataScaleIntercepts=q}else if(this.series.isMultiFrame){b=b.slices*b.timepoints;l=[];q=[];k=parseInt(b/this.series.images.length);for(b=0;b<this.series.images.length;b+=1)for(g=0;g<k;g+=1)d=this.series.images[b],l[b*k+g]=this.getDataScaleSlope(this.series.isElscint,d),q[b*k+g]=this.getDataScaleIntercept(this.series.isElscint,d);c.dataScaleSlopes=l;c.dataScaleIntercepts=q}else if(this.series.isImplicitTimeseries)if(b=
b.slices*b.timepoints,this.series.images.length!==b)c.setGlobalDataScale(this.getDataScaleSlope(this.series.isElscint,this.series.images[0]),this.getDataScaleIntercept(this.series.isElscint,this.series.images[0]),this.series.numberOfFrames);else{for(b=0;b<this.series.images.length;b+=1)d=this.series.images[b],g[b]=this.getDataScaleSlope(this.series.isElscint,d),k[b]=this.getDataScaleIntercept(this.series.isElscint,d);c.dataScaleSlopes=g;c.dataScaleIntercepts=k}else{for(b=0;b<this.series.images.length;b+=
1)d=this.series.images[b],g[b]=this.getDataScaleSlope(this.series.isElscint,d),k[b]=this.getDataScaleIntercept(this.series.isElscint,d);c.dataScaleSlopes=g;c.dataScaleIntercepts=k}c.validateDataScale();return c};papaya.volume.dicom.HeaderDICOM.prototype.getOrientation=function(){var c=this.series.images[0].getOrientation();null===c&&(c=papaya.volume.dicom.HeaderDICOM.ORIENTATION_DEFAULT);c=c.substring(0,5)+(this.series.sliceSense?"+":"-");return new papaya.volume.Orientation(c)};
papaya.volume.dicom.HeaderDICOM.prototype.getOrientationCertainty=function(){return null===this.series.images[0].getOrientation()?papaya.volume.Header.ORIENTATION_CERTAINTY_UNKNOWN:this.series.isMosaic||this.series.isMultiFrameVolume?papaya.volume.Header.ORIENTATION_CERTAINTY_LOW:papaya.volume.Header.ORIENTATION_CERTAINTY_HIGH};
papaya.volume.dicom.HeaderDICOM.prototype.getOrigin=function(){var c=this.getBestTransform();return c?(c=numeric.inv(c),new papaya.core.Coordinate(c[0][3],c[1][3],c[2][3])):new papaya.core.Coordinate(0,0,0)};papaya.volume.dicom.HeaderDICOM.prototype.hasError=function(){return null!==this.error};
papaya.volume.dicom.HeaderDICOM.prototype.getImageDescription=function(){var c,a,d,f,b,e="";c=this.series.images[0].getPatientName();a=this.series.images[0].getPatientID();d=this.series.images[0].getStudyTime();f=this.series.images[0].getStudyDate();b=this.series.images[0].getImageDescription();c&&(e+=" "+c);a&&(e+=" "+a);d&&(e+=" "+d);f&&(e+=" "+f);b&&(e+=" "+b);return new papaya.volume.ImageDescription(e.trim())};
papaya.volume.dicom.HeaderDICOM.prototype.getBestTransform=function(){var c=this.series.images[0].getImageDirections(),a=null;if(c)var a=this.getVoxelDimensions(),d=this.series.images[0].getImagePosition(),f=[c[0],c[1],c[2]],c=[c[3],c[4],c[5]],b=[f[1]*c[2]-f[2]*c[1],f[2]*c[0]-f[0]*c[2],f[0]*c[1]-f[1]*c[0]],a=[[f[0]*a.colSize*-1,c[0]*a.rowSize,b[0]*a.sliceSize,-1*d[0]],[f[1]*a.colSize,c[1]*a.rowSize*-1,b[1]*a.sliceSize,-1*d[1]],[f[2]*a.colSize,c[2]*a.rowSize,b[2]*a.sliceSize,d[2]],[0,0,0,1]];return a};
papaya.volume.dicom.HeaderDICOM.prototype.getBestTransformOrigin=function(){return this.getOrigin()};papaya.volume.dicom.HeaderDICOM.prototype.toString=function(){return this.series.images[0].toString()};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};papaya.volume.Orientation=papaya.volume.Orientation||function(c){this.orientation=c;this.orientMat=null;this.zIncrement=this.yIncrement=this.xIncrement=-1};papaya.volume.Orientation.DEFAULT="XYZ+--";
papaya.volume.Orientation.isValidOrientationString=function(c){var a,d=!0;if(null===c||6!==c.length)d=!1;a=c.toUpperCase().indexOf("X");if(-1===a||2<a||c.toUpperCase().lastIndexOf("X")!==a)d=!1;a=c.toUpperCase().indexOf("Y");if(-1===a||2<a||c.toUpperCase().lastIndexOf("Y")!==a)d=!1;a=c.toUpperCase().indexOf("Z");if(-1===a||2<a||c.toUpperCase().lastIndexOf("Z")!==a)d=!1;"+"!==c.charAt(3)&&"-"!==c.charAt(3)&&(d=!1);"+"!==c.charAt(4)&&"-"!==c.charAt(4)&&(d=!1);"+"!==c.charAt(5)&&"-"!==c.charAt(5)&&(d=
!1);return d};papaya.volume.Orientation.prototype.convertIndexToOffsetNative=function(c,a,d){return c*this.xIncrement+a*this.yIncrement+d*this.zIncrement};
papaya.volume.Orientation.prototype.convertIndexToOffset=function(c,a,d){var f,b;f=papayaFloorFast(c*this.orientMat[0][0]+a*this.orientMat[0][1]+d*this.orientMat[0][2]+this.orientMat[0][3]);b=papayaFloorFast(c*this.orientMat[1][0]+a*this.orientMat[1][1]+d*this.orientMat[1][2]+this.orientMat[1][3]);c=papayaFloorFast(c*this.orientMat[2][0]+a*this.orientMat[2][1]+d*this.orientMat[2][2]+this.orientMat[2][3]);return f*this.xIncrement+b*this.yIncrement+c*this.zIncrement};
papaya.volume.Orientation.prototype.convertCoordinate=function(c,a){a.x=papayaRoundFast(c.x*this.orientMat[0][0]+c.y*this.orientMat[0][1]+c.z*this.orientMat[0][2]+this.orientMat[0][3]);a.y=papayaRoundFast(c.x*this.orientMat[1][0]+c.y*this.orientMat[1][1]+c.z*this.orientMat[1][2]+this.orientMat[1][3]);a.z=papayaRoundFast(c.x*this.orientMat[2][0]+c.y*this.orientMat[2][1]+c.z*this.orientMat[2][2]+this.orientMat[2][3]);return a};
papaya.volume.Orientation.prototype.createInfo=function(c,a){var d,f,b,e,h,g,k,l,q,t,y,B,A,x,I,F;t=c.cols;y=c.rows;B=c.slices;A=c.getNumVoxelsSlice();x=a.colSize;I=a.rowSize;F=a.sliceSize;k="+"===this.orientation.charAt(3);l="+"===this.orientation.charAt(4);q="+"===this.orientation.charAt(5);-1!==this.orientation.toUpperCase().indexOf("XYZ")?(c.xDim=t,c.yDim=y,c.zDim=B,a.xSize=x,a.ySize=I,a.zSize=F,this.xIncrement=1,this.yIncrement=t,this.zIncrement=A,k?(d=1,e=0):(d=-1,e=t-1),l?(f=-1,h=y-1):(f=1,
h=0),q?(b=-1,g=B-1):(b=1,g=0)):-1!==this.orientation.toUpperCase().indexOf("XZY")?(c.xDim=t,c.yDim=B,c.zDim=y,a.xSize=x,a.ySize=F,a.zSize=I,this.xIncrement=1,this.yIncrement=A,this.zIncrement=t,k?(d=1,e=0):(d=-1,e=t-1),l?(b=-1,g=y-1):(b=1,g=0),q?(f=-1,h=B-1):(f=1,h=0)):-1!==this.orientation.toUpperCase().indexOf("YXZ")?(c.xDim=y,c.yDim=t,c.zDim=B,a.xSize=I,a.ySize=x,a.zSize=F,this.xIncrement=t,this.yIncrement=1,this.zIncrement=A,k?(f=-1,h=t-1):(f=1,h=0),l?(d=1,e=0):(d=-1,e=y-1),q?(b=-1,g=B-1):(b=
1,g=0)):-1!==this.orientation.toUpperCase().indexOf("YZX")?(c.xDim=B,c.yDim=t,c.zDim=y,a.xSize=F,a.ySize=x,a.zSize=I,this.xIncrement=A,this.yIncrement=1,this.zIncrement=t,k?(f=-1,h=t-1):(f=1,h=0),l?(b=-1,g=y-1):(b=1,g=0),q?(d=1,e=0):(d=-1,e=B-1)):-1!==this.orientation.toUpperCase().indexOf("ZXY")?(c.xDim=y,c.yDim=B,c.zDim=t,a.xSize=I,a.ySize=F,a.zSize=x,this.xIncrement=t,this.yIncrement=A,this.zIncrement=1,k?(b=-1,g=t-1):(b=1,g=0),l?(d=1,e=0):(d=-1,e=y-1),q?(f=-1,h=B-1):(f=1,h=0)):-1!==this.orientation.toUpperCase().indexOf("ZYX")&&
(c.xDim=B,c.yDim=y,c.zDim=t,a.xSize=F,a.ySize=I,a.zSize=x,this.xIncrement=A,this.yIncrement=t,this.zIncrement=1,k?(b=-1,g=t-1):(b=1,g=0),l?(f=-1,h=y-1):(f=1,h=0),q?(d=1,e=0):(d=-1,e=B-1));this.orientMat=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];this.orientMat[0][0]=d;this.orientMat[0][1]=0;this.orientMat[0][2]=0;this.orientMat[0][3]=e;this.orientMat[1][0]=0;this.orientMat[1][1]=f;this.orientMat[1][2]=0;this.orientMat[1][3]=h;this.orientMat[2][0]=0;this.orientMat[2][1]=0;this.orientMat[2][2]=b;this.orientMat[2][3]=
g;this.orientMat[3][0]=0;this.orientMat[3][1]=0;this.orientMat[3][2]=0;this.orientMat[3][3]=1};papaya.volume.Orientation.prototype.isValid=function(){return papaya.volume.Orientation.isValidOrientationString(this.orientation)};papaya.volume.Orientation.prototype.getOrientationDescription=function(){var c=this.orientation;return"Cols ("+c.charAt(0)+c.charAt(3)+"), Rows ("+c.charAt(1)+c.charAt(4)+"), Slices ("+c.charAt(2)+c.charAt(5)+")"};"use strict";papaya=papaya||{};
papaya.volume=papaya.volume||{};
papaya.volume.Transform=papaya.volume.Transform||function(c,a){this.voxelValue=new papaya.volume.VoxelValue(a.imageData,a.header.imageType,a.header.imageDimensions,a.header.imageRange,a.header.orientation);this.voxelDimensions=a.header.voxelDimensions;this.imageDimensions=a.header.imageDimensions;this.volume=a;this.mat=papaya.volume.Transform.IDENTITY.clone();this.indexMat=papaya.volume.Transform.IDENTITY.clone();this.sizeMat=papaya.volume.Transform.IDENTITY.clone();this.sizeMatInverse=papaya.volume.Transform.IDENTITY.clone();
this.mmMat=papaya.volume.Transform.IDENTITY.clone();this.worldMat=papaya.volume.Transform.IDENTITY.clone();this.worldMatNifti=null;this.originMat=papaya.volume.Transform.IDENTITY.clone();this.tempMat=papaya.volume.Transform.IDENTITY.clone();this.tempMat2=papaya.volume.Transform.IDENTITY.clone();this.orientMat=papaya.volume.Transform.IDENTITY.clone();this.centerMat=papaya.volume.Transform.IDENTITY.clone();this.centerMatInverse=papaya.volume.Transform.IDENTITY.clone();this.rotMatX=papaya.volume.Transform.IDENTITY.clone();
this.rotMatY=papaya.volume.Transform.IDENTITY.clone();this.rotMatZ=papaya.volume.Transform.IDENTITY.clone();this.rotMat=papaya.volume.Transform.IDENTITY.clone();this.updateTransforms(c)};papaya.volume.Transform.IDENTITY=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];papaya.volume.Transform.EPSILON=1E-5;
papaya.volume.Transform.printTransform=function(c){console.log(c[0][0]+" "+c[0][1]+" "+c[0][2]+" "+c[0][3]);console.log(c[1][0]+" "+c[1][1]+" "+c[1][2]+" "+c[1][3]);console.log(c[2][0]+" "+c[2][1]+" "+c[2][2]+" "+c[2][3]);console.log(c[3][0]+" "+c[3][1]+" "+c[3][2]+" "+c[3][3])};
papaya.volume.Transform.decompose=function(c){var a,d,f,b,e,h,g,k,l,q,t,y,B,A,x,I,F,z,L,n;n=[];a=papaya.volume.Transform.validateNum(c[0][3]);d=papaya.volume.Transform.validateNum(c[1][3]);f=papaya.volume.Transform.validateNum(c[2][3]);b=papaya.volume.Transform.validateNum(Math.atan(c[2][1]/c[2][2]));e=0===b?papaya.volume.Transform.validateNum(Math.atan(-1*Math.cos(b)*(c[2][0]/c[2][2]))):papaya.volume.Transform.validateNum(Math.atan(-1*Math.sin(b)*(c[2][0]/c[2][1])));0===e&&(e=papaya.volume.Transform.EPSILON);
k=papaya.volume.Transform.validateScale(c[2][2]/(Math.cos(e)*Math.cos(b)));g=Math.cos(b);l=Math.sin(b)*Math.sin(e)+Math.sin(b)*(Math.cos(e)/Math.tan(e));q=c[1][0]*(Math.sin(b)/Math.tan(e))+c[1][1];h=-1*Math.sin(b);t=Math.cos(b)*Math.sin(e)+Math.cos(b)*(Math.cos(e)/Math.tan(e));y=c[1][0]*(Math.cos(b)/Math.tan(e))+c[1][2];h=papaya.volume.Transform.validateNum(Math.atan((g*y-q*h)/(q*t-l*y)));g=papaya.volume.Transform.validateScale(q/(Math.cos(h)*g+Math.sin(h)*l));l=papaya.volume.Transform.validateNum((g*
Math.sin(h)*Math.cos(e)-c[1][0])/(k*Math.sin(e)));q=Math.cos(e)*Math.cos(h);t=g*Math.cos(e)*Math.sin(h);y=-1*k*Math.sin(e);B=Math.sin(b)*Math.sin(e)*Math.cos(h)-Math.cos(b)*Math.sin(h);A=Math.sin(b)*Math.sin(e)*Math.sin(h)+Math.cos(b)*Math.cos(h);x=k*Math.sin(b)*Math.cos(e);I=Math.cos(b)*Math.sin(e)*Math.cos(h)+Math.sin(b)*Math.sin(h);F=Math.cos(b)*Math.sin(e)*Math.sin(h)-Math.sin(b)*Math.cos(h);z=k*Math.cos(b)*Math.cos(e);A=t*B-q*A;x=y*B-q*x;B=B*c[0][0]-q*c[0][1];F=t*I-q*F;z=y*I-q*z;L=I*c[0][0]-
q*c[0][2];I=papaya.volume.Transform.validateNum((F*B-L*A)/(x*F-A*z));A=papaya.volume.Transform.validateNum((B*z-x*L)/(A*z-x*F));c=papaya.volume.Transform.validateScale((c[0][0]-A*t-I*y)/q);e===papaya.volume.Transform.EPSILON&&(e=0);b*=180/Math.PI;e*=180/Math.PI;h*=180/Math.PI;n[0]=papaya.volume.Transform.validateZero(a);n[1]=papaya.volume.Transform.validateZero(d);n[2]=papaya.volume.Transform.validateZero(f);n[3]=papaya.volume.Transform.validateZero(b);n[4]=papaya.volume.Transform.validateZero(e);
n[5]=papaya.volume.Transform.validateZero(h);n[6]=c;n[7]=g;n[8]=k;n[9]=papaya.volume.Transform.validateZero(l);n[10]=papaya.volume.Transform.validateZero(I);n[11]=papaya.volume.Transform.validateZero(A);return n};papaya.volume.Transform.hasRotations=function(c){var a,d;return null!==c?(a=papaya.volume.Transform.decompose(c),c=Math.abs(1-Math.abs(a[3])/90)%1,d=Math.abs(1-Math.abs(a[4])/90)%1,a=Math.abs(1-Math.abs(a[5])/90)%1,.01<c||.01<d||.01<a):!1};
papaya.volume.Transform.validateNum=function(c){return c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY||isNaN(c)||0===c?0:c};papaya.volume.Transform.validateScale=function(c){return c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY||isNaN(c)?1:c};papaya.volume.Transform.validateZero=function(c){return Math.abs(c)<papaya.volume.Transform.EPSILON?0:c};
papaya.volume.Transform.prototype.updateSizeMat=function(){this.sizeMat[0][0]=this.voxelDimensions.xSize;this.sizeMat[1][1]=this.voxelDimensions.ySize;this.sizeMat[2][2]=this.voxelDimensions.zSize;this.sizeMat[3][3]=1;this.sizeMatInverse[0][0]=1/this.voxelDimensions.xSize;this.sizeMatInverse[1][1]=1/this.voxelDimensions.ySize;this.sizeMatInverse[2][2]=1/this.voxelDimensions.zSize;this.sizeMatInverse[3][3]=1};papaya.volume.Transform.prototype.updateOrientMat=function(){this.orientMat=this.volume.header.orientation.orientMat};
papaya.volume.Transform.prototype.updateIndexTransform=function(){var c,a;for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.indexMat[c][a]=this.orientMat[c][0]*this.mat[0][a]+this.orientMat[c][1]*this.mat[1][a]+this.orientMat[c][2]*this.mat[2][a]+this.orientMat[c][3]*this.mat[3][a]};
papaya.volume.Transform.prototype.updateMmTransform=function(){var c,a;for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.mmMat[c][a]=this.indexMat[c][0]*this.sizeMatInverse[0][a]+this.indexMat[c][1]*this.sizeMatInverse[1][a]+this.indexMat[c][2]*this.sizeMatInverse[2][a]+this.indexMat[c][3]*this.sizeMatInverse[3][a]};
papaya.volume.Transform.prototype.updateOriginMat=function(){this.originMat[0][0]=1;this.originMat[1][1]=-1;this.originMat[2][2]=-1;this.originMat[3][3]=1;this.originMat[0][3]=this.volume.header.origin.x;this.originMat[1][3]=this.volume.header.origin.y;this.originMat[2][3]=this.volume.header.origin.z};
papaya.volume.Transform.prototype.updateImageMat=function(c,a,d,f,b,e){this.updateCenterMat(c,a,d);a=f*Math.PI/180;c=Math.cos(a);a=Math.sin(a);this.rotMatX[1][1]=c;this.rotMatX[1][2]=a;this.rotMatX[2][1]=-1*a;this.rotMatX[2][2]=c;a=b*Math.PI/180;c=Math.cos(a);a=Math.sin(a);this.rotMatY[0][0]=c;this.rotMatY[0][2]=-1*a;this.rotMatY[2][0]=a;this.rotMatY[2][2]=c;a=e*Math.PI/180;c=Math.cos(a);a=Math.sin(a);this.rotMatZ[0][0]=c;this.rotMatZ[0][1]=a;this.rotMatZ[1][0]=-1*a;this.rotMatZ[1][1]=c;for(b=0;4>
b;b+=1)for(e=0;4>e;e+=1)this.tempMat[b][e]=this.rotMatX[b][0]*this.rotMatY[0][e]+this.rotMatX[b][1]*this.rotMatY[1][e]+this.rotMatX[b][2]*this.rotMatY[2][e]+this.rotMatX[b][3]*this.rotMatY[3][e];for(b=0;4>b;b+=1)for(e=0;4>e;e+=1)this.rotMat[b][e]=this.tempMat[b][0]*this.rotMatZ[0][e]+this.tempMat[b][1]*this.rotMatZ[1][e]+this.tempMat[b][2]*this.rotMatZ[2][e]+this.tempMat[b][3]*this.rotMatZ[3][e];for(b=0;4>b;b+=1)for(e=0;4>e;e+=1)this.tempMat[b][e]=this.sizeMatInverse[b][0]*this.centerMatInverse[0][e]+
this.sizeMatInverse[b][1]*this.centerMatInverse[1][e]+this.sizeMatInverse[b][2]*this.centerMatInverse[2][e]+this.sizeMatInverse[b][3]*this.centerMatInverse[3][e];for(b=0;4>b;b+=1)for(e=0;4>e;e+=1)this.tempMat2[b][e]=this.tempMat[b][0]*this.rotMat[0][e]+this.tempMat[b][1]*this.rotMat[1][e]+this.tempMat[b][2]*this.rotMat[2][e]+this.tempMat[b][3]*this.rotMat[3][e];for(b=0;4>b;b+=1)for(e=0;4>e;e+=1)this.tempMat[b][e]=this.tempMat2[b][0]*this.centerMat[0][e]+this.tempMat2[b][1]*this.centerMat[1][e]+this.tempMat2[b][2]*
this.centerMat[2][e]+this.tempMat2[b][3]*this.centerMat[3][e];for(b=0;4>b;b+=1)for(e=0;4>e;e+=1)this.tempMat2[b][e]=this.tempMat[b][0]*this.sizeMat[0][e]+this.tempMat[b][1]*this.sizeMat[1][e]+this.tempMat[b][2]*this.sizeMat[2][e]+this.tempMat[b][3]*this.sizeMat[3][e];this.volume.transform.updateTransforms(this.tempMat2)};
papaya.volume.Transform.prototype.updateCenterMat=function(c,a,d){this.centerMat[0][0]=1;this.centerMat[1][1]=1;this.centerMat[2][2]=1;this.centerMat[3][3]=1;this.centerMat[0][3]=-1*c;this.centerMat[1][3]=-1*a;this.centerMat[2][3]=-1*d;this.centerMatInverse[0][0]=1;this.centerMatInverse[1][1]=1;this.centerMatInverse[2][2]=1;this.centerMatInverse[3][3]=1;this.centerMatInverse[0][3]=c;this.centerMatInverse[1][3]=a;this.centerMatInverse[2][3]=d};
papaya.volume.Transform.prototype.updateWorldMat=function(){var c,a,d,f;if(this.worldMatNifti){d=[[-1,0,0,this.imageDimensions.xDim-1],[0,1,0,0],[0,0,1,0],[0,0,0,1]];f=papaya.volume.Transform.IDENTITY.clone();f[0][0]=-1;f[1][1]=-1;f[2][2]=-1;f[3][3]=1;f[0][3]=this.volume.header.origin.x;f[1][3]=this.volume.header.origin.y;f[2][3]=this.volume.header.origin.z;for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.tempMat[c][a]=this.sizeMat[c][0]*f[0][a]+this.sizeMat[c][1]*f[1][a]+this.sizeMat[c][2]*f[2][a]+this.sizeMat[c][3]*
f[3][a];for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.tempMat2[c][a]=this.tempMat[c][0]*d[0][a]+this.tempMat[c][1]*d[1][a]+this.tempMat[c][2]*d[2][a]+this.tempMat[c][3]*d[3][a];for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.tempMat[c][a]=this.tempMat2[c][0]*this.mat[0][a]+this.tempMat2[c][1]*this.mat[1][a]+this.tempMat2[c][2]*this.mat[2][a]+this.tempMat2[c][3]*this.mat[3][a];for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.tempMat2[c][a]=this.tempMat[c][0]*d[0][a]+this.tempMat[c][1]*d[1][a]+this.tempMat[c][2]*d[2][a]+this.tempMat[c][3]*
d[3][a];for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.tempMat[c][a]=this.tempMat2[c][0]*f[0][a]+this.tempMat2[c][1]*f[1][a]+this.tempMat2[c][2]*f[2][a]+this.tempMat2[c][3]*f[3][a];for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.tempMat2[c][a]=this.tempMat[c][0]*this.sizeMatInverse[0][a]+this.tempMat[c][1]*this.sizeMatInverse[1][a]+this.tempMat[c][2]*this.sizeMatInverse[2][a]+this.tempMat[c][3]*this.sizeMatInverse[3][a];for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.worldMat[c][a]=this.worldMatNifti[c][0]*this.tempMat2[0][a]+
this.worldMatNifti[c][1]*this.tempMat2[1][a]+this.worldMatNifti[c][2]*this.tempMat2[2][a]+this.worldMatNifti[c][3]*this.tempMat2[3][a]}else{for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.tempMat[c][a]=this.indexMat[c][0]*this.originMat[0][a]+this.indexMat[c][1]*this.originMat[1][a]+this.indexMat[c][2]*this.originMat[2][a]+this.indexMat[c][3]*this.originMat[3][a];for(c=0;4>c;c+=1)for(a=0;4>a;a+=1)this.worldMat[c][a]=this.tempMat[c][0]*this.sizeMatInverse[0][a]+this.tempMat[c][1]*this.sizeMatInverse[1][a]+
this.tempMat[c][2]*this.sizeMatInverse[2][a]+this.tempMat[c][3]*this.sizeMatInverse[3][a]}};papaya.volume.Transform.prototype.updateTransforms=function(c){this.mat=c;this.updateSizeMat();this.updateOrientMat();this.updateOriginMat();this.updateIndexTransform();this.updateMmTransform();this.updateWorldMat()};papaya.volume.Transform.prototype.getVoxelAtIndexNative=function(c,a,d,f,b){return this.voxelValue.getVoxelAtIndexNative(c,a,d,f,b)};
papaya.volume.Transform.prototype.getVoxelAtIndex=function(c,a,d,f,b){return this.voxelValue.getVoxelAtIndex(c,a,d,f,b)};
papaya.volume.Transform.prototype.getVoxelAtCoordinate=function(c,a,d,f,b){return this.voxelValue.getVoxelAtIndexNative(c*this.worldMat[0][0]+a*this.worldMat[0][1]+d*this.worldMat[0][2]+this.worldMat[0][3],c*this.worldMat[1][0]+a*this.worldMat[1][1]+d*this.worldMat[1][2]+this.worldMat[1][3],c*this.worldMat[2][0]+a*this.worldMat[2][1]+d*this.worldMat[2][2]+this.worldMat[2][3],f,b)};
papaya.volume.Transform.prototype.getVoxelAtMM=function(c,a,d,f,b){return this.voxelValue.getVoxelAtIndexNative(c*this.mmMat[0][0]+a*this.mmMat[0][1]+d*this.mmMat[0][2]+this.mmMat[0][3],c*this.mmMat[1][0]+a*this.mmMat[1][1]+d*this.mmMat[1][2]+this.mmMat[1][3],c*this.mmMat[2][0]+a*this.mmMat[2][1]+d*this.mmMat[2][2]+this.mmMat[2][3],f,b)};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};
papaya.volume.Volume=papaya.volume.Volume||function(c,a,d){this.progressMeter=c;this.dialogHandler=a;this.files=[];this.rawData=[];this.fileLength=0;this.fileName=this.urls=null;this.compressed=!1;this.transform=null;this.numTimepoints=0;this.transform=this.error=this.onFinishedRead=null;this.isLoaded=!1;this.numTimepoints=1;this.loaded=!1;this.params=d;this.header=new papaya.volume.Header(void 0!==this.params&&this.params.padAllImages);this.imageData=new papaya.volume.ImageData(void 0!==this.params&&
this.params.padAllImages)};papaya.volume.Volume.PROGRESS_LABEL_LOADING="Loading";papaya.volume.Volume.prototype.fileIsCompressed=function(c,a){var d,f;return-1!==c.indexOf(".gz")||a&&(d=new DataView(a),f=d.getUint8(0),d=d.getUint8(1),f===GUNZIP_MAGIC_COOKIE1||d===GUNZIP_MAGIC_COOKIE2)?!0:!1};
papaya.volume.Volume.prototype.readFiles=function(c,a){this.files=c;this.fileName=c[0].name;this.onFinishedRead=a;this.compressed=this.fileIsCompressed(this.fileName);this.fileLength=this.files[0].size;this.readNextFile(this,0)};
papaya.volume.Volume.prototype.readNextFile=function(c,a){var d;if(a<this.files.length){d=papaya.utilities.PlatformUtils.makeSlice(this.files[a],0,this.files[a].size);try{var f=new FileReader;f.onloadend=papaya.utilities.ObjectUtils.bind(c,function(b){b.target.readyState===FileReader.DONE&&(c.rawData[a]=b.target.result,setTimeout(function(){c.readNextFile(c,a+1)},0))});f.onerror=papaya.utilities.ObjectUtils.bind(c,function(a){c.error=Error("There was a problem reading that file:\n\n"+a.getMessage());
c.finishedLoad()});f.readAsArrayBuffer(d)}catch(b){c.error=Error("There was a problem reading that file:\n\n"+b.message),c.finishedLoad()}}else setTimeout(function(){c.decompress(c)},0)};
papaya.volume.Volume.prototype.readURLs=function(c,a){var d=this;this.urls=c;this.fileName=c[0].substr(c[0].lastIndexOf("/")+1,c[0].length);this.onFinishedRead=a;this.compressed=this.fileIsCompressed(this.fileName);this.rawData=[];this.loadedFileCount=0;this.readEachURL(this).done(function(){setTimeout(function(){d.decompress(d)},0)}).fail(function(a,b,c){b=b.message||"";"undefined"!==typeof c&&(b="Response status = "+c.status);a.error=Error("There was a problem reading that file ("+a.fileName+"):\n\n"+
b);a.finishedLoad()})};
papaya.volume.Volume.prototype.loadURL=function(c,a){var d,f,b,e;d=jQuery.Deferred();"string"===typeof(new XMLHttpRequest).responseType?(f=new XMLHttpRequest,f.open("GET",c,!0),f.responseType="arraybuffer",f.onreadystatechange=function(){4===f.readyState&&(200===f.status?(a.fileLength=a.rawData.byteLength,d.resolve(f.response)):d.reject(a,!1,f))},f.onprogress=function(a){a.lengthComputable&&d.notify(a.loaded,a.total)},f.send(null)):(a.error=Error("There was a problem reading that file ("+a.fileName+
"):\n\nResponse type is not supported."),a.finishedLoad());return d.promise().done(function(b){a.loadedFileCount++;a.rawData.push(b)}).fail(function(a,b,c){console.error(a,b,c)}).progress(function(c,d){b=parseInt(100*a.loadedFileCount/a.urls.length,10);e=papaya.volume.Volume.PROGRESS_LABEL_LOADING+" image "+(a.loadedFileCount+1)+" of "+a.urls.length+" ("+b+"%)";a.progressMeter.drawProgress(c/d,e)})};
papaya.volume.Volume.prototype.readEachURL=function(c,a){for(var d=[],f=0;f<c.urls.length;f++){var b=c.loadURL(c.urls[f],c);d.push(b)}return $.when.apply($,d)};papaya.volume.Volume.prototype.readEncodedData=function(c,a){var d=null;try{this.fileName=c[0],this.onFinishedRead=a,d=this,this.fileLength=0,d.readNextEncodedData(d,0,c)}catch(f){d&&(d.error=Error("There was a problem reading that file:\n\n"+f.message),d.finishedLoad())}};
papaya.volume.Volume.prototype.readNextEncodedData=function(c,a,d){if(a<d.length)try{c.rawData[a]=Base64Binary.decodeArrayBuffer(papaya.utilities.ObjectUtils.dereference(d[a])),c.compressed=this.fileIsCompressed(this.fileName,c.rawData[a]),setTimeout(function(){c.readNextEncodedData(c,a+1,d)},0)}catch(f){c&&(c.error=Error("There was a problem reading that file:\n\n"+f.message),c.finishedLoad())}else c.decompress(c)};
papaya.volume.Volume.prototype.getVoxelAtIndexNative=function(c,a,d,f,b){return this.transform.getVoxelAtIndexNative(c,a,d,0,b)};papaya.volume.Volume.prototype.getVoxelAtIndex=function(c,a,d,f,b){return this.transform.getVoxelAtIndex(c,a,d,f,b)};papaya.volume.Volume.prototype.getVoxelAtCoordinate=function(c,a,d,f,b){return this.transform.getVoxelAtCoordinate(c,a,d,f,b)};papaya.volume.Volume.prototype.getVoxelAtMM=function(c,a,d,f,b){return this.transform.getVoxelAtMM(c,a,d,f,b)};
papaya.volume.Volume.prototype.hasError=function(){return null!==this.error};papaya.volume.Volume.prototype.getXDim=function(){return this.header.imageDimensions.xDim};papaya.volume.Volume.prototype.getYDim=function(){return this.header.imageDimensions.yDim};papaya.volume.Volume.prototype.getZDim=function(){return this.header.imageDimensions.zDim};papaya.volume.Volume.prototype.getXSize=function(){return this.header.voxelDimensions.xSize};papaya.volume.Volume.prototype.getYSize=function(){return this.header.voxelDimensions.ySize};
papaya.volume.Volume.prototype.getZSize=function(){return this.header.voxelDimensions.zSize};papaya.volume.Volume.prototype.decompress=function(c){if(c.compressed)try{pako.inflate(new Uint8Array(c.rawData[0]),null,this.progressMeter,function(a){c.finishedDecompress(c,a.buffer)})}catch(a){console.log(a)}else setTimeout(function(){c.finishedReadData(c)},0)};papaya.volume.Volume.prototype.finishedDecompress=function(c,a){c.rawData[0]=a;setTimeout(function(){c.finishedReadData(c)},0)};
papaya.volume.Volume.prototype.finishedReadData=function(c){c.header.readHeaderData(c.fileName,c.rawData,this.progressMeter,this.dialogHandler,papaya.utilities.ObjectUtils.bind(this,this.finishedReadHeaderData))};
papaya.volume.Volume.prototype.finishedReadHeaderData=function(){this.rawData=null;this.header.hasError()?(this.error=this.header.error,console.error(this.error.stack),this.onFinishedRead(this)):(this.header.imageType.swapped=this.header.imageType.littleEndian!==papaya.utilities.PlatformUtils.isPlatformLittleEndian(),this.header.getName()&&(this.fileName=this.header.getName()),this.header.readImageData(this.progressMeter,papaya.utilities.ObjectUtils.bind(this,this.finishedReadImageData)))};
papaya.volume.Volume.prototype.finishedReadImageData=function(c){this.imageData.readFileData(this.header,c,papaya.utilities.ObjectUtils.bind(this,this.finishedLoad))};
papaya.volume.Volume.prototype.finishedLoad=function(){this.loaded||(this.loaded=!0,this.onFinishedRead&&(this.hasError()?console.log(this.error):(this.transform=new papaya.volume.Transform(papaya.volume.Transform.IDENTITY.clone(),this),this.numTimepoints=this.header.imageDimensions.timepoints||1,this.applyBestTransform()),this.isLoaded=!0,this.rawData=null,this.onFinishedRead(this)))};
papaya.volume.Volume.prototype.setOrigin=function(c){c=this.header.orientation.convertCoordinate(c,new papaya.core.Coordinate(0,0,0));this.header.origin.setCoordinate(c.x,c.y,c.z)};papaya.volume.Volume.prototype.getOrigin=function(){return this.header.orientation.convertCoordinate(this.header.origin,new papaya.core.Coordinate(0,0,0))};
papaya.volume.Volume.prototype.applyBestTransform=function(){var c=this.header.getBestTransform();null!==c&&(this.transform.worldMatNifti=numeric.inv(c),this.setOrigin(this.header.getBestTransformOrigin()),this.transform.updateWorldMat())};
papaya.volume.Volume.prototype.isWorldSpaceOnly=function(){var c,a=!1;return this.header.fileFormat instanceof papaya.volume.nifti.HeaderNIFTI?(c=this.header.fileFormat,0<c.nifti.qform_code&&(a|=!c.qFormHasRotations()),0<c.nifti.sform_code&&(a|=!c.sFormHasRotations()),!a):!1};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};
papaya.volume.VoxelDimensions=papaya.volume.VoxelDimensions||function(c,a,d,f){this.colSize=Math.abs(c);this.rowSize=Math.abs(a);this.sliceSize=Math.abs(d);this.zSize=this.ySize=this.xSize=0;this.timeSize=f;this.temporalUnit=this.spatialUnit=papaya.volume.VoxelDimensions.UNITS_UNKNOWN};papaya.volume.VoxelDimensions.UNITS_UNKNOWN=0;papaya.volume.VoxelDimensions.UNITS_METER=1;papaya.volume.VoxelDimensions.UNITS_MM=2;papaya.volume.VoxelDimensions.UNITS_MICRON=3;
papaya.volume.VoxelDimensions.UNITS_SEC=8;papaya.volume.VoxelDimensions.UNITS_MSEC=16;papaya.volume.VoxelDimensions.UNITS_USEC=24;papaya.volume.VoxelDimensions.UNITS_HZ=32;papaya.volume.VoxelDimensions.UNITS_PPM=40;papaya.volume.VoxelDimensions.UNITS_RADS=48;papaya.volume.VoxelDimensions.UNIT_STRINGS=[];papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_UNKNOWN]="Unknown Unit";papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_METER]="Meters";
papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_MM]="Millimeters";papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_MICRON]="Microns";papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_SEC]="Seconds";papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_MSEC]="Milliseconds";papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_USEC]="Microseconds";
papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_HZ]="Hertz";papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_PPM]="Parts-per-million";papaya.volume.VoxelDimensions.UNIT_STRINGS[papaya.volume.VoxelDimensions.UNITS_RADS]="Radians-per-second";papaya.volume.VoxelDimensions.prototype.isValid=function(){return 0<this.colSize&&0<this.rowSize&&0<this.sliceSize&&0<=this.timeSize};papaya.volume.VoxelDimensions.prototype.getSpatialUnitString=function(){return papaya.volume.VoxelDimensions.UNIT_STRINGS[this.spatialUnit]};
papaya.volume.VoxelDimensions.prototype.getTemporalUnitString=function(){return papaya.volume.VoxelDimensions.UNIT_STRINGS[this.temporalUnit]};papaya.volume.VoxelDimensions.prototype.getTemporalUnitMultiplier=function(){return this.temporalUnit===papaya.volume.VoxelDimensions.UNITS_MSEC?.001:this.temporalUnit===papaya.volume.VoxelDimensions.UNITS_USEC?1E-6:1};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};
papaya.volume.VoxelValue=papaya.volume.VoxelValue||function(c,a,d,f,b){this.imageData=c;this.imageType=a;this.imageRange=f;this.orientation=b;this.swap16=2===this.imageType.numBytes&&this.imageType.swapped&&this.imageType.datatype!==papaya.volume.ImageType.DATATYPE_FLOAT;this.swap32=4===this.imageType.numBytes&&this.imageType.swapped&&this.imageType.datatype!==papaya.volume.ImageType.DATATYPE_FLOAT;this.xIncrement=b.xIncrement;this.yIncrement=b.yIncrement;this.zIncrement=b.zIncrement;this.xDim=d.xDim;
this.yDim=d.yDim;this.zDim=d.zDim;this.sliceSize=d.getNumVoxelsSlice();this.volSize=d.getNumVoxelsVolume();this.dataScaleSlopes=f.dataScaleSlopes;this.dataScaleIntercepts=f.dataScaleIntercepts;this.globalDataScaleSlope=f.globalDataScaleSlope;this.globalDataScaleIntercept=f.globalDataScaleIntercept;this.usesGlobalDataScale=f.usesGlobalDataScale;this.interpFirstPass=[[0,0],[0,0]];this.interpSecondPass=[0,0];this.forceABS=!1};
papaya.volume.VoxelValue.prototype.getVoxelAtIndexNative=function(c,a,d,f,b){return b?(c=papayaRoundFast(c),a=papayaRoundFast(a),d=papayaRoundFast(d),this.getVoxelAtOffset(this.orientation.convertIndexToOffsetNative(c,a,d),f,c,a,d)):this.getVoxelAtIndexLinear(c,a,d,f)};
papaya.volume.VoxelValue.prototype.getVoxelAtIndex=function(c,a,d,f,b){return b?(c=papayaRoundFast(c),a=papayaRoundFast(a),d=papayaRoundFast(d),this.getVoxelAtOffset(this.orientation.convertIndexToOffset(c,a,d),f,c,a,d)):this.getVoxelAtIndexLinear(c,a,d,f)};
papaya.volume.VoxelValue.prototype.getVoxelAtOffset=function(c,a,d,f,b){c+=this.volSize*a;if(0>d||d>=this.xDim||0>f||f>=this.yDim||0>b||b>=this.zDim)return 0;this.usesGlobalDataScale?d=this.checkSwap(this.imageData.data[c])*this.globalDataScaleSlope+this.globalDataScaleIntercept:(d=parseInt(c/this.sliceSize),d=this.checkSwap(this.imageData.data[c])*this.dataScaleSlopes[d]+this.dataScaleIntercepts[d]);return this.forceABS?Math.abs(d):d};
papaya.volume.VoxelValue.prototype.getVoxelAtIndexLinear=function(c,a,d,f){var b,e,h,g,k,l,q,t,y;k=Math.floor(c);l=Math.floor(a);q=Math.floor(d);b=c-k;e=a-l;h=d-q;g=0!==b;t=0!==e;y=0!==h;if(g&&t&&y){for(a=0;2>a;a+=1)for(d=0;2>d;d+=1)g=this.orientation.convertIndexToOffsetNative(k+a,l+d,q),c=this.getVoxelAtOffset(g,f,k+a,l+d,q)*(1-h),g=this.orientation.convertIndexToOffsetNative(k+a,l+d,q+1),g=this.getVoxelAtOffset(g,f,k+a,l+d,q+1)*h,this.interpFirstPass[a][d]=c+g;this.interpSecondPass[0]=this.interpFirstPass[0][0]*
(1-e)+this.interpFirstPass[0][1]*e;this.interpSecondPass[1]=this.interpFirstPass[1][0]*(1-e)+this.interpFirstPass[1][1]*e;f=this.interpSecondPass[0]*(1-b)+this.interpSecondPass[1]*b}else if(g&&t&&!y){for(a=0;2>a;a+=1)g=this.orientation.convertIndexToOffsetNative(k+a,l,q),c=this.getVoxelAtOffset(g,f,k+a,l,q)*(1-e),g=this.orientation.convertIndexToOffsetNative(k+a,l+1,q),g=this.getVoxelAtOffset(g,f,k+a,l+1,q)*e,this.interpSecondPass[a]=c+g;f=this.interpSecondPass[0]*(1-b)+this.interpSecondPass[1]*b}else if(g&&
!t&&y){for(a=0;2>a;a+=1)g=this.orientation.convertIndexToOffsetNative(k+a,l,q),c=this.getVoxelAtOffset(g,f,k+a,l,q)*(1-h),g=this.orientation.convertIndexToOffsetNative(k+a,l,q+1),g=this.getVoxelAtOffset(g,f,k+a,l,q+1)*h,this.interpSecondPass[a]=c+g;f=this.interpSecondPass[0]*(1-b)+this.interpSecondPass[1]*b}else if(!g&&t&&y){for(d=0;2>d;d+=1)g=this.orientation.convertIndexToOffsetNative(k,l+d,q),c=this.getVoxelAtOffset(g,f,k,l+d,q)*(1-h),g=this.orientation.convertIndexToOffsetNative(k,l+d,q+1),g=
this.getVoxelAtOffset(g,f,k,l+d,q+1)*h,this.interpSecondPass[d]=c+g;f=this.interpSecondPass[0]*(1-e)+this.interpSecondPass[1]*e}else g||t||!y?g||!t||y?!g||t||y?f=this.getVoxelAtOffset(this.orientation.convertIndexToOffsetNative(c,a,d),f,c,a,d):(g=this.orientation.convertIndexToOffsetNative(k,l,q),c=this.getVoxelAtOffset(g,f,k,l,q)*(1-b),g=this.orientation.convertIndexToOffsetNative(k+1,l,q),g=this.getVoxelAtOffset(g,f,k+1,l,q)*b,f=c+g):(g=this.orientation.convertIndexToOffsetNative(k,l,q),c=this.getVoxelAtOffset(g,
f,k,l,q)*(1-e),g=this.orientation.convertIndexToOffsetNative(k,l+1,q),g=this.getVoxelAtOffset(g,f,k,l+1,q)*e,f=c+g):(g=this.orientation.convertIndexToOffsetNative(k,l,q),c=this.getVoxelAtOffset(g,f,k,l,q)*(1-h),g=this.orientation.convertIndexToOffsetNative(k,l,q+1),g=this.getVoxelAtOffset(g,f,k,l,q+1)*h,f=c+g);return f};papaya.volume.VoxelValue.prototype.checkSwap=function(c){return this.swap16?((c&255)<<8|c>>8&255)<<16>>16:this.swap32?(c&255)<<24|(c&65280)<<8|c>>8&65280|c>>24&255:c};"use strict";
papaya=papaya||{};papaya.surface=papaya.surface||{};
papaya.surface.Surface=papaya.surface.Surface||function(c,a){this.progressMeter=c;this.colorsData=this.normalsData=this.triangleData=this.pointData=this.onFinishedRead=this.rawData=this.filename=this.error=null;this.numTriangles=this.numPoints=0;this.solidColor=this.colorsBuffer=this.normalsBuffer=this.trianglesBuffer=this.pointsBuffer=null;this.surfaceType=papaya.surface.Surface.SURFACE_TYPE_UNKNOWN;this.fileFormat=null;this.params=a;this.nextSurface=null;this.alpha=1};
papaya.surface.Surface.SURFACE_TYPE_UNKNOWN=0;papaya.surface.Surface.SURFACE_TYPE_GIFTI=1;papaya.surface.Surface.SURFACE_TYPE_MANGO=2;papaya.surface.Surface.findSurfaceType=function(c){return gifti.isThisFormat(c)?papaya.surface.Surface.SURFACE_TYPE_GIFTI:papaya.surface.SurfaceMango.isThisFormat(c)?papaya.surface.Surface.SURFACE_TYPE_MANGO:papaya.surface.Surface.SURFACE_TYPE_UNKNOWN};
papaya.surface.Surface.prototype.makeFileFormat=function(c){this.surfaceType=papaya.surface.Surface.findSurfaceType(c);this.surfaceType===papaya.surface.Surface.SURFACE_TYPE_GIFTI?this.fileFormat=new papaya.surface.SurfaceGIFTI:this.surfaceType===papaya.surface.Surface.SURFACE_TYPE_MANGO&&(this.fileFormat=new papaya.surface.SurfaceMango)};
papaya.surface.Surface.prototype.readURL=function(c,a){var d,f=this;this.filename=c.substr(c.lastIndexOf("/")+1,c.length);this.onFinishedRead=a;this.processParams(this.filename);this.makeFileFormat(this.filename);if(this.surfaceType===papaya.surface.Surface.SURFACE_TYPE_UNKNOWN)this.error=Error("This surface format is not supported!"),this.finishedLoading();else try{"string"===typeof(new XMLHttpRequest).responseType?(d=new XMLHttpRequest,d.open("GET",c,!0),this.fileFormat.isSurfaceDataBinary()&&(d.responseType=
"arraybuffer"),d.onreadystatechange=function(){4===d.readyState&&(200===d.status?f.rawData=d.response:f.error=Error("There was a problem reading that file ("+f.filename+"):\n\nResponse status = "+d.status),f.finishedLoading())},d.onprogress=function(a){a.lengthComputable&&f.progressMeter.drawProgress(a.loaded/a.total,papaya.volume.Volume.PROGRESS_LABEL_LOADING)},d.send(null)):(f.error=Error("There was a problem reading that file ("+f.filename+"):\n\nResponse type is not supported."),f.finishedLoading())}catch(b){null!==
f&&(f.error=Error("There was a problem reading that file ("+f.filename+"):\n\n"+b.message),f.finishedLoading())}};
papaya.surface.Surface.prototype.readFile=function(c,a){var d=papaya.utilities.PlatformUtils.makeSlice(c,0,c.size),f=this;this.filename=c.name;this.onFinishedRead=a;this.processParams(this.filename);this.makeFileFormat(this.filename);if(this.surfaceType===papaya.surface.Surface.SURFACE_TYPE_UNKNOWN)this.error=Error("This surface format is not supported!"),this.finishedLoading();else try{var b=new FileReader;b.onloadend=function(a){a.target.readyState===FileReader.DONE&&(f.rawData=a.target.result,
f.finishedLoading())};b.onerror=function(a){f.error=Error("There was a problem reading that file:\n\n"+a.getMessage());f.finishedLoading()};this.fileFormat.isSurfaceDataBinary()?b.readAsArrayBuffer(d):b.readAsText(d)}catch(e){f.error=Error("There was a problem reading that file:\n\n"+e.message),f.finishedLoading()}};
papaya.surface.Surface.prototype.readEncodedData=function(c,a){this.filename=c+".surf.gii";this.onFinishedRead=a;this.processParams(c);this.makeFileFormat(this.filename);if(this.surfaceType===papaya.surface.Surface.SURFACE_TYPE_UNKNOWN)this.error=Error("This surface format is not supported!");else try{this.fileFormat.isSurfaceDataBinary()?this.rawData=Base64Binary.decodeArrayBuffer(papaya.utilities.ObjectUtils.dereference(c)):this.rawData=atob(papaya.utilities.ObjectUtils.dereference(c))}catch(d){this.error=
Error("There was a problem reading that file:\n\n"+d.message)}this.finishedLoading()};papaya.surface.Surface.prototype.processParams=function(c){if(c=params[c])void 0!==c.color&&(this.solidColor=c.color),void 0!==c.alpha&&(this.alpha=c.alpha)};papaya.surface.Surface.prototype.finishedLoading=function(){this.readData()};
papaya.surface.Surface.prototype.readData=function(){if(this.error)console.log(this.error),this.onFinishedRead(this);else{var c=this.progressMeter,a=function(a){c.drawProgress(a,"Loading surface...")};try{this.fileFormat.readData(this.rawData,a,papaya.utilities.ObjectUtils.bind(this,this.finishedReading))}catch(d){console.log(d.stack),this.error=d,this.onFinishedRead(this)}}};
papaya.surface.Surface.prototype.finishedReading=function(){var c=this.fileFormat.getNumSurfaces(),a=this,d;if(this.fileFormat.error)this.error=this.fileFormat.error;else for(d=0;d<c;d+=1)0<d&&(a.nextSurface=new papaya.surface.Surface,a=a.nextSurface),a.numPoints=this.fileFormat.getNumPoints(d),a.numTriangles=this.fileFormat.getNumTriangles(d),a.pointData=this.fileFormat.getPointData(d),a.normalsData=this.fileFormat.getNormalsData(d),a.triangleData=this.fileFormat.getTriangleData(d),a.colorsData=
this.fileFormat.getColorsData(d),null===a.normalsData&&this.generateNormals(),this.fileFormat.getSolidColor(d)&&(a.solidColor=this.fileFormat.getSolidColor(d));this.progressMeter.drawProgress(1,"Loading surface...");this.onFinishedRead(this)};
papaya.surface.Surface.prototype.generateNormals=function(){var c=[],a=[],d=[],f=[],b=[],e,h=this.pointData.length,g,k,l,q,t,y,B,A,x,I;this.normalsData=new Float32Array(h);g=3*this.numTriangles;for(e=0;e<g;e+=3)A=3*this.triangleData[e],x=3*this.triangleData[e+1],I=3*this.triangleData[e+2],c.x=this.pointData[A],c.y=this.pointData[A+1],c.z=this.pointData[A+2],a.x=this.pointData[x],a.y=this.pointData[x+1],a.z=this.pointData[x+2],d.x=this.pointData[I],d.y=this.pointData[I+1],d.z=this.pointData[I+2],k=
a.x-c.x,l=a.y-c.y,q=a.z-c.z,t=d.x-c.x,y=d.y-c.y,B=d.z-c.z,f[0]=y*q-B*l,f[1]=B*k-t*q,f[2]=t*l-y*k,this.normalsData[A]+=f[0],this.normalsData[A+1]+=f[1],this.normalsData[A+2]+=f[2],this.normalsData[x]+=f[0],this.normalsData[x+1]+=f[1],this.normalsData[x+2]+=f[2],this.normalsData[I]+=f[0],this.normalsData[I+1]+=f[1],this.normalsData[I+2]+=f[2];for(e=0;e<h;e+=3)f[0]=-1*this.normalsData[e],f[1]=-1*this.normalsData[e+1],f[2]=-1*this.normalsData[e+2],vec3.normalize(f,b),this.normalsData[e]=b[0],this.normalsData[e+
1]=b[1],this.normalsData[e+2]=b[2]};"use strict";papaya=papaya||{};papaya.surface=papaya.surface||{};papaya.surface.SurfaceGIFTI=papaya.surface.SurfaceGIFTI||function(){this.onFinishedRead=this.colorsData=this.normalsData=this.triangleData=this.pointData=this.error=this.gii=null};papaya.surface.SurfaceGIFTI.prototype.isSurfaceDataBinary=function(){return!1};
papaya.surface.SurfaceGIFTI.prototype.readData=function(c,a,d){var f=this;a(0);this.onFinishedRead=d;this.gii=gifti.parse(c);setTimeout(function(){f.readDataPoints(f,a)},0)};papaya.surface.SurfaceGIFTI.prototype.readDataPoints=function(c,a){a(.2);null!=c.gii.getPointsDataArray()?c.pointData=c.gii.getPointsDataArray().getData():c.error=Error("Surface is missing point information!");setTimeout(function(){c.readDataNormals(c,a)},0)};
papaya.surface.SurfaceGIFTI.prototype.readDataNormals=function(c,a){a(.4);null!=c.gii.getNormalsDataArray()&&(c.normalsData=c.gii.getNormalsDataArray().getData());setTimeout(function(){c.readDataTriangles(c,a)},0)};papaya.surface.SurfaceGIFTI.prototype.readDataTriangles=function(c,a){a(.6);null!=c.gii.getTrianglesDataArray()?c.triangleData=c.gii.getTrianglesDataArray().getData():c.error=Error("Surface is missing triangle information!");setTimeout(function(){c.readDataColors(c,a)},0)};
papaya.surface.SurfaceGIFTI.prototype.readDataColors=function(c,a){a(.8);null!=c.gii.getColorsDataArray()&&(c.colorsData=c.gii.getColorsDataArray().getData());setTimeout(function(){c.onFinishedRead()},0)};papaya.surface.SurfaceGIFTI.prototype.getNumSurfaces=function(){return 1};papaya.surface.SurfaceGIFTI.prototype.getNumPoints=function(){return this.gii.getNumPoints()};papaya.surface.SurfaceGIFTI.prototype.getNumTriangles=function(){return this.gii.getNumTriangles()};
papaya.surface.SurfaceGIFTI.prototype.getPointData=function(){return this.pointData};papaya.surface.SurfaceGIFTI.prototype.getNormalsData=function(){return this.normalsData};papaya.surface.SurfaceGIFTI.prototype.getTriangleData=function(){return this.triangleData};papaya.surface.SurfaceGIFTI.prototype.getColorsData=function(){return this.colorsData};papaya.surface.SurfaceGIFTI.prototype.getSolidColor=function(){return this.solidColor};"use strict";papaya=papaya||{};
papaya.surface=papaya.surface||{};papaya.surface.SurfaceMango=papaya.surface.SurfaceMango||function(){this.onFinishedRead=this.error=null;this.origin=[];this.imageDims=[];this.voxelDims=[];this.center=[];this.diffs=[];this.dv=null;this.numSurfaces=this.dataLength=this.surfaceIndex=this.index=0;this.littleEndian=!1;this.surfaces=[];this.v15=this.v14=!1};
papaya.surface.SurfaceMangoData=papaya.surface.SurfaceMangoData||function(){this.colorsData=this.normalsData=this.triangleData=this.pointData=null;this.solidColor=[]};papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_5="mangol15".split("");papaya.surface.SurfaceMango.MAGIC_NUMBER_BIG_1_5="mangob15".split("");papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_4="mangol14".split("");papaya.surface.SurfaceMango.MAGIC_NUMBER_BIG_1_4="mangob14".split("");
papaya.surface.SurfaceMango.SURFACE_OVERLAY_MAGIC_NUMBER=[0,0,0,0,"s","c","a","l"];papaya.surface.SurfaceMango.NAME_SIZE=64;papaya.surface.SurfaceMango.isThisFormat=function(c){return c.endsWith(".surf")};papaya.surface.SurfaceMango.prototype.isSurfaceDataBinary=function(){return!0};
papaya.surface.SurfaceMango.prototype.isLittleEndian15=function(c){c=new Uint8Array(c);var a;for(a=0;a<papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_5.length;a+=1)if(c[a]!==papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_5[a].charCodeAt(0))return!1;return!0};
papaya.surface.SurfaceMango.prototype.isLittleEndian14=function(c){c=new Uint8Array(c);var a;for(a=0;a<papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_4.length;a+=1)if(c[a]!==papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_4[a].charCodeAt(0))return!1;return!0};
papaya.surface.SurfaceMango.prototype.isVersion15=function(c){c=new Uint8Array(c);var a,d=!0;for(a=0;a<papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_5.length;a+=1)if(c[a]!==papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_5[a].charCodeAt(0)){d=!1;break}if(!d)for(d=!0,a=0;a<papaya.surface.SurfaceMango.MAGIC_NUMBER_BIG_1_5.length;a+=1)if(c[a]!==papaya.surface.SurfaceMango.MAGIC_NUMBER_BIG_1_5[a].charCodeAt(0)){d=!1;break}return d};
papaya.surface.SurfaceMango.prototype.isVersion14=function(c){c=new Uint8Array(c);var a,d=!0;for(a=0;a<papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_4.length;a+=1)if(c[a]!==papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_4[a].charCodeAt(0)){d=!1;break}if(!d)for(d=!0,a=0;a<papaya.surface.SurfaceMango.MAGIC_NUMBER_BIG_1_4.length;a+=1)if(c[a]!==papaya.surface.SurfaceMango.MAGIC_NUMBER_BIG_1_4[a].charCodeAt(0)){d=!1;break}return d};
papaya.surface.SurfaceMango.prototype.isLittleEndian=function(c){return this.isLittleEndian15(c)||this.isLittleEndian14(c)};papaya.surface.SurfaceMango.prototype.hasOverlay=function(){var c,a;for(c=0;c<papaya.surface.SurfaceMango.SURFACE_OVERLAY_MAGIC_NUMBER.length;c+=1)if((a=papaya.surface.SurfaceMango.SURFACE_OVERLAY_MAGIC_NUMBER[c])&&(a=papaya.surface.SurfaceMango.SURFACE_OVERLAY_MAGIC_NUMBER[c].charCodeAt(0)),this.dv.getUint8(this.index+c)!==a)return!1;return!0};
papaya.surface.SurfaceMango.prototype.getString=function(c){var a,d=[];for(a=0;a<c;a+=1)d[a]=this.dv.getUint8(this.index+a);return String.fromCharCode.apply(null,d)};
papaya.surface.SurfaceMango.prototype.readData=function(c,a,d){a(.2);this.littleEndian=this.isLittleEndian(c);this.dataLength=c.byteLength;this.v14=this.isVersion14(c);this.v15=this.isVersion15(c);this.index=papaya.surface.SurfaceMango.MAGIC_NUMBER_LITTLE_1_5.length;this.dv=new DataView(c);if(!this.v14&&!this.v15)throw Error("Only Mango surface format version 1.4 and 1.5 are supported!");this.onFinishedRead=d;c=this.dv.getUint32(this.index,this.littleEndian);this.index+=4;this.numSurfaces=this.dv.getUint32(this.index,
this.littleEndian);this.index+=4;this.index+=128;this.imageDims[0]=this.dv.getUint32(this.index,this.littleEndian);this.index+=4;this.imageDims[1]=this.dv.getUint32(this.index,this.littleEndian);this.index+=4;this.imageDims[2]=this.dv.getUint32(this.index,this.littleEndian);this.index+=4;this.voxelDims[0]=this.dv.getFloat32(this.index,this.littleEndian);this.index+=4;this.voxelDims[1]=this.dv.getFloat32(this.index,this.littleEndian);this.index+=4;this.voxelDims[2]=this.dv.getFloat32(this.index,this.littleEndian);
this.index+=4;this.origin[0]=this.dv.getFloat32(this.index,this.littleEndian)*this.voxelDims[0];this.index+=4;this.origin[1]=this.dv.getFloat32(this.index,this.littleEndian)*this.voxelDims[1];this.index+=4;this.origin[2]=this.dv.getFloat32(this.index,this.littleEndian)*this.voxelDims[2];this.index+=4;this.center[0]=this.imageDims[0]*this.voxelDims[0]/2;this.center[1]=this.imageDims[1]*this.voxelDims[1]/2;this.center[2]=this.imageDims[2]*this.voxelDims[2]/2;this.v14?(this.diffs[0]=this.center[0]-this.origin[0],
this.diffs[1]=this.center[1]-this.origin[1],this.diffs[2]=this.origin[2]-this.center[2]):(this.diffs[0]=this.center[0]-this.origin[0],this.diffs[1]=this.center[1]-this.origin[1],this.diffs[2]=this.center[2]-this.origin[2]);this.index+=4;this.index+=c;this.readNextSurface(this,a)};
papaya.surface.SurfaceMango.prototype.readNextSurface=function(c,a){var d=new papaya.surface.SurfaceMangoData;c.index+=papaya.surface.SurfaceMango.NAME_SIZE;c.surfaces[c.surfaceIndex]=d;c.surfaces[c.surfaceIndex].solidColor[0]=c.dv.getFloat32(c.index,c.littleEndian);c.index+=4;c.surfaces[c.surfaceIndex].solidColor[1]=c.dv.getFloat32(c.index,c.littleEndian);c.index+=4;c.surfaces[c.surfaceIndex].solidColor[2]=c.dv.getFloat32(c.index,c.littleEndian);c.index+=4;setTimeout(function(){c.readDataPoints(c,
a)},0)};
papaya.surface.SurfaceMango.prototype.readDataPoints=function(c,a){var d,f;a(.4);c.index+=4;d=c.dv.getInt32(c.index,c.littleEndian);c.index+=4;c.surfaces[c.surfaceIndex].pointData=new Float32Array(d);if(c.v14)for(f=0;f<d;f+=1,c.index+=4)c.surfaces[c.surfaceIndex].pointData[f]=(2!==f%3?-1:1)*(c.dv.getFloat32(c.index,c.littleEndian)+c.diffs[f%3]);else for(f=0;f<d;f+=1,c.index+=4)c.surfaces[c.surfaceIndex].pointData[f]=(0!==f%3?-1:1)*(c.dv.getFloat32(c.index,c.littleEndian)+c.diffs[f%3]);setTimeout(function(){c.readDataNormals(c,a)},
0)};
papaya.surface.SurfaceMango.prototype.readDataNormals=function(c,a){var d,f;a(.6);c.index+=4;d=c.dv.getInt32(c.index,c.littleEndian);c.index+=4;c.surfaces[c.surfaceIndex].normalsData=new Float32Array(d);if(c.v14)for(f=0;f<d;f+=1,c.index+=4)c.surfaces[c.surfaceIndex].normalsData[f]=(2!==f%3?-1:1)*c.dv.getFloat32(c.index,c.littleEndian);else for(f=0;f<d;f+=1,c.index+=4)c.surfaces[c.surfaceIndex].normalsData[f]=(0!==f%3?-1:1)*c.dv.getFloat32(c.index,c.littleEndian);setTimeout(function(){c.readDataTriangles(c,a)},
0)};papaya.surface.SurfaceMango.prototype.readDataTriangles=function(c,a){var d,f;a(.8);c.index+=4;d=c.dv.getInt32(c.index,c.littleEndian);c.index+=4;c.surfaces[c.surfaceIndex].triangleData=new Uint32Array(d);for(f=0;f<d;f+=1,c.index+=4)c.surfaces[c.surfaceIndex].triangleData[f]=c.dv.getUint32(c.index,c.littleEndian);setTimeout(function(){c.readDataColors(c,a)},0)};
papaya.surface.SurfaceMango.prototype.readDataColors=function(c,a){for(var d,f,b,e,h,g,k,l;c.index<c.dataLength;)if(c.hasOverlay()){c.index+=papaya.surface.SurfaceMango.SURFACE_OVERLAY_MAGIC_NUMBER.length;c.index+=papaya.surface.SurfaceMango.NAME_SIZE;k=c.getString(papaya.surface.SurfaceMango.NAME_SIZE);c.index+=papaya.surface.SurfaceMango.NAME_SIZE;k=k.replace(/\0/g,"");c.index+=4;d=c.dv.getFloat32(this.index,this.littleEndian);c.index+=4;f=c.dv.getFloat32(this.index,this.littleEndian);c.index+=
4;b=255/(f-d);c.index+=4;c.index+=4;e=c.dv.getUint32(this.index,this.littleEndian);c.index+=4;h=new Float32Array(e);for(l=0;l<e;l+=1,c.index+=4)h[l]=c.dv.getFloat32(c.index,c.littleEndian);k=papaya.viewer.ColorTable.findLUT(k)!==papaya.viewer.ColorTable.TABLE_GRAYSCALE?new papaya.viewer.ColorTable(k,!1):new papaya.viewer.ColorTable("Spectrum",!1);k.updateLUT(0,255);e=c.surfaces[c.surfaceIndex].pointData.length/3;null===c.surfaces[c.surfaceIndex].colorsData&&(c.surfaces[c.surfaceIndex].colorsData=
new Float32Array(4*e));for(l=0;l<e;l+=1)g=h[l],g<=d?0===c.surfaces[c.surfaceIndex].colorsData[4*l+3]&&(c.surfaces[c.surfaceIndex].colorsData[4*l]=c.surfaces[c.surfaceIndex].solidColor[0],c.surfaces[c.surfaceIndex].colorsData[4*l+1]=c.surfaces[c.surfaceIndex].solidColor[1],c.surfaces[c.surfaceIndex].colorsData[4*l+2]=c.surfaces[c.surfaceIndex].solidColor[2],c.surfaces[c.surfaceIndex].colorsData[4*l+3]=1):(g>f?(c.surfaces[c.surfaceIndex].colorsData[4*l]=k.lookupRed(255)/255,c.surfaces[c.surfaceIndex].colorsData[4*
l+1]=k.lookupGreen(255)/255,c.surfaces[c.surfaceIndex].colorsData[4*l+2]=k.lookupBlue(255)/255):(g=Math.floor((g-d)*b+.5),c.surfaces[c.surfaceIndex].colorsData[4*l]=k.lookupRed(g)/255,c.surfaces[c.surfaceIndex].colorsData[4*l+1]=k.lookupGreen(g)/255,c.surfaces[c.surfaceIndex].colorsData[4*l+2]=k.lookupBlue(g)/255),c.surfaces[c.surfaceIndex].colorsData[4*l+3]=1)}else break;c.surfaceIndex++;c.surfaceIndex===c.numSurfaces?setTimeout(function(){c.onFinishedRead()},0):setTimeout(function(){c.readNextSurface(c,
a)},0)};papaya.surface.SurfaceMango.prototype.getNumSurfaces=function(){return this.numSurfaces};papaya.surface.SurfaceMango.prototype.getNumPoints=function(c){return this.surfaces[c].pointData.length/3};papaya.surface.SurfaceMango.prototype.getNumTriangles=function(c){return this.surfaces[c].triangleData.length/3};papaya.surface.SurfaceMango.prototype.getSolidColor=function(c){return this.surfaces[c].solidColor};papaya.surface.SurfaceMango.prototype.getPointData=function(c){return this.surfaces[c].pointData};
papaya.surface.SurfaceMango.prototype.getNormalsData=function(c){return this.surfaces[c].normalsData};papaya.surface.SurfaceMango.prototype.getTriangleData=function(c){return this.surfaces[c].triangleData};papaya.surface.SurfaceMango.prototype.getColorsData=function(c){return this.surfaces[c].colorsData};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
papaya.ui.Dialog=papaya.ui.Dialog||function(c,a,d,f,b,e,h,g){this.container=c;this.viewer=c.viewer;this.title=a;this.modifier="";papaya.utilities.StringUtils.isStringBlank(h)||(this.modifier=h);this.id=this.title.replace(/ /g,"_");this.content=d;this.dataSource=f;this.callback=b;this.callbackOk=e;this.doWrap=g;this.scrollBehavior2=this.scrollBehavior1=null};
papaya.ui.Dialog.showModalDialog=function(c,a,d){var f,b,e;c=document.documentElement;var h=window.pageYOffset||c.scrollTop;f=$(window).outerWidth();c=$(window).outerHeight();b=$(d).outerWidth();e=$(d).outerHeight();f=f/2-b/2+"px";c=h+c/2-e/2+"px";$(d).css({position:"absolute",zIndex:100,left:f,top:c});a.removeScroll();$(d).hide().fadeIn(200)};
papaya.ui.Dialog.prototype.showDialog=function(){var c,a,d,f,b;f="#"+this.id;c=$(f);c.remove();b=$("body");d="<div id='"+this.id+"' class='"+PAPAYA_DIALOG_CSS+"'><span class='"+PAPAYA_DIALOG_TITLE_CSS+"'>"+this.title+"</span>";if(this.content){d+="<div class='"+PAPAYA_DIALOG_CONTENT_CSS+"'><table>";for(c=0;c<this.content.items.length;c+=1)if(this.content.items[c].spacer)d+="<tr><td class='"+PAPAYA_DIALOG_CONTENT_LABEL_CSS+"'>&nbsp;</td><td class='"+PAPAYA_DIALOG_CONTENT_CONTROL_CSS+"'>&nbsp;</td></tr>";
else if(this.content.items[c].readonly)d+="<tr><td class='"+PAPAYA_DIALOG_CONTENT_LABEL_CSS+"'>"+this.content.items[c].label+"</td><td class='"+PAPAYA_DIALOG_CONTENT_CONTROL_CSS+"' id='"+this.content.items[c].field+"'></td></tr>";else{a=this.content.items[c].disabled&&!0===papaya.utilities.ObjectUtils.bind(this.container,papaya.utilities.ObjectUtils.dereferenceIn(this,this.content.items[c].disabled))()?"disabled='disabled'":"";d+="<tr><td class='"+PAPAYA_DIALOG_CONTENT_LABEL_CSS+"'>"+this.content.items[c].label+
"</td><td class='"+PAPAYA_DIALOG_CONTENT_CONTROL_CSS+"'><select "+a+" id='"+this.content.items[c].field+"'>";for(a=0;a<this.content.items[c].options.length;a+=1)d+="<option value='"+this.content.items[c].options[a]+"'>"+papaya.utilities.StringUtils.truncateMiddleString(this.content.items[c].options[a].toString(),40)+"</option>";d+="</select></td></tr>";this.content.items[c].help&&(d+="<tr><td colspan='2' class='"+PAPAYA_DIALOG_CONTENT_HELP+"'>"+this.content.items[c].help+"</td></tr>")}d+="</table></div>"}d+=
"<div class='"+PAPAYA_DIALOG_BUTTON_CSS+"'><button type='button' id='"+this.id+"-Ok'>Ok</button></div></div>";b.append('<div class="'+PAPAYA_DIALOG_BACKGROUND+'"></div>');b.append(d);for(c=0;c<this.content.items.length;c+=1)this.content.items[c].readonly?(d=this.dataSource[this.content.items[c].field](this.modifier),null!==d?$("#"+this.content.items[c].field).html(d):$("#"+this.content.items[c].field).parent().remove()):this.content.items[c].spacer||(d=$("#"+this.content.items[c].field),d.val(this.dataSource[this.content.items[c].field]),
d.change(papaya.utilities.ObjectUtils.bind(this,this.doAction,[this.content.items[c].field])));this.doWrap||$("."+PAPAYA_DIALOG_CONTENT_CSS).addClass(PAPAYA_DIALOG_CONTENT_NOWRAP_CSS);$("#"+this.id+"-Ok").click(papaya.utilities.ObjectUtils.bind(this,this.doOk));c=$(f);b.addClass(PAPAYA_DIALOG_STOPSCROLL);papaya.ui.Dialog.showModalDialog(this,this.viewer,c[0])};
papaya.ui.Dialog.prototype.doOk=function(){var c,a;c=$("."+PAPAYA_DIALOG_CSS);a=$("."+PAPAYA_DIALOG_BACKGROUND);c.hide(100);a.hide(100);c.remove();a.remove();window.onmousewheel=this.scrollBehavior1;document.onmousewheel=this.scrollBehavior2;this.callbackOk&&this.callbackOk();$("body").removeClass(PAPAYA_DIALOG_STOPSCROLL);this.container.viewer.addScroll()};papaya.ui.Dialog.prototype.doAction=function(c){this.callback(c,$("#"+c).val())};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
papaya.ui.Menu=papaya.ui.Menu||function(c,a,d,f,b){this.viewer=c;this.method=a.method;this.isTitleBar=a.titleBar;this.label=a.label;this.icons=a.icons;this.callback=d;this.dataSource=f;this.items=[];this.rangeItem=null;this.menuOnHover=a.menuOnHover;this.contextMenu=!1;void 0===b||null===b?(this.imageIndex=-1,this.modifier=this.viewer.container.containerIndex):(this.imageIndex=b,this.modifier=b+this.viewer.container.containerIndex);this.buttonId=this.label.replace(/ /g,"_").replace("...","_")+(this.modifier||
"");this.menuId=(this.label+"Menu").replace(/ /g,"_").replace("...","_")+(this.modifier||"");this.isRight=null!==a.icons;this.isImageButton=a.imageButton;this.isSurfaceButton=a.surfaceButton;this.htmlParent=this.viewer.container.showControlBar&&this.viewer.container.kioskMode&&this.viewer.container.showImageButtons?this.viewer.container.sliderControlHtml:this.viewer.container.toolbarHtml};
papaya.ui.Menu.doShowMenu=function(c,a,d,f){var b,e,h,g,k;b=$(c.canvas).offset();k=$(c.container.display.canvas).outerHeight();e=$(a).offset();h=$(a).outerWidth();g=$(d).outerWidth();a=$(d).outerHeight();f=e.left+(f?-1*g+h:5)+"px";c=c.container.showControlBar&&c.container.kioskMode&&c.container.showImageButtons?b.top+$(c.canvas).outerHeight()+PAPAYA_SPACING+k-a+"px":b.top+"px";$(d).css({position:"absolute",zIndex:100,left:f,top:c});$(d).hide().fadeIn(200)};
papaya.ui.Menu.getColorComponents=function(c){return c?c.match(/\d+/g):[0,0,0,255]};papaya.ui.Menu.getNiceForegroundColor=function(c){c=papaya.ui.Menu.getColorComponents(c);127<(parseInt(c[0])+parseInt(c[1])+parseInt(c[2]))/3?c[0]=c[1]=c[2]=0:c[0]=c[1]=c[2]=255;return"rgb("+c[0]+", "+c[1]+", "+c[2]+")"};
papaya.ui.Menu.prototype.buildMenuButton=function(){var c,a,d;d="#"+this.buttonId;c=$(d);c.remove();c=null;this.icons?(c="<span id='"+this.buttonId+"' class='"+PAPAYA_MENU_UNSELECTABLE+" "+PAPAYA_MENU_ICON_CSS+" "+(this.isImageButton?PAPAYA_MENU_BUTTON_CSS:"")+"'"+(this.isRight?" style='float:right'":"")+"><img class='"+PAPAYA_MENU_UNSELECTABLE+"' style='width:"+papaya.viewer.ColorTable.ICON_SIZE+"px; height:"+papaya.viewer.ColorTable.ICON_SIZE+"px; vertical-align:bottom; ",c=!this.isSurfaceButton&&
this.dataSource.isSelected(parseInt(this.imageIndex,10))?c+"border:2px solid #FF5A3D;background-color:#eeeeee;padding:1px;":c+"border:2px outset lightgray;background-color:#eeeeee;padding:1px;",c=this.method?c+("' src='"+this.icons[papaya.utilities.ObjectUtils.bind(this.viewer,papaya.utilities.ObjectUtils.dereferenceIn(this.viewer,this.method))()?1:0]+"' /></span>"):c+("' src='"+this.icons[0]+"' /></span>")):c=this.isTitleBar?"<div class='"+PAPAYA_MENU_UNSELECTABLE+" "+PAPAYA_MENU_TITLEBAR_CSS+" "+
PAPAYA_TITLEBAR_CSS+"' style='z-index:-1;position:absolute;top:"+(this.viewer.container.viewerHtml.position().top-1.25*papaya.ui.Toolbar.SIZE)+"px;width:"+this.htmlParent.width()+"px;text-align:center;color:"+papaya.ui.Menu.getNiceForegroundColor(this.viewer.bgColor)+"'>"+this.label+"</div>":"<span id='"+this.buttonId+"' class='"+PAPAYA_MENU_UNSELECTABLE+" "+PAPAYA_MENU_LABEL_CSS+"'>"+this.label+"</span>";this.htmlParent.append(c);this.isTitleBar||(c=$(d),d="#"+this.buttonId+" > img",d=$(d),a=this,
this.menuOnHover&&(d.mouseenter(function(){a.showHoverMenuTimeout=setTimeout(papaya.utilities.ObjectUtils.bind(a,a.showMenu),500)}),d.mouseleave(function(){clearTimeout(a.showHoverMenuTimeout);a.showHoverMenuTimeout=null})),c.click(papaya.utilities.ObjectUtils.bind(this,this.doClick)),this.icons?(d.hover(function(){1<a.icons.length?$(this).css({"border-color":"gray"}):$(this).css({"border-color":"#FF5A3D"})},papaya.utilities.ObjectUtils.bind(a,function(){a.dataSource.isSelected(parseInt(a.imageIndex,
10))&&a.dataSource.isSelectable()?$("#"+a.buttonId+" > img").css({border:"2px solid #FF5A3D"}):$("#"+a.buttonId+" > img").css({border:"2px outset lightgray"})})),d.mousedown(function(){$(this).css({border:"2px inset lightgray"})}),d.mouseup(function(){$(this).css({border:"2px outset lightgray"})})):this.isTitleBar||c.hover(function(){$(this).toggleClass(PAPAYA_MENU_BUTTON_HOVERING_CSS)}));return this.buttonId};papaya.ui.Menu.prototype.setMenuButton=function(c){this.buttonId=c};
papaya.ui.Menu.prototype.buildMenu=function(){var c;this.htmlParent.append("<ul id='"+this.menuId+"' class='"+PAPAYA_MENU_CSS+"'></ul>");this.viewer.container.contextManager&&papaya.utilities.PlatformUtils.smallScreen&&($("#"+this.menuId)[0].style.width=this.viewer.viewerDim-10+"px");for(c=0;c<this.items.length;c+=1)this.items[c].hide||this.items[c].buildHTML(this.menuId)};papaya.ui.Menu.prototype.addMenuItem=function(c){c instanceof papaya.ui.MenuItemRange&&(this.rangeItem=c);this.items.push(c)};
papaya.ui.Menu.prototype.showContextMenu=function(){var c,a,d,f=0,b;0<this.items.length&&(d="#"+this.menuId,a=$(d),c=a.is(":visible"),a.remove(),c||(this.htmlParent=this.viewer.container.viewerHtml,this.buildMenu(),a=$(d),a.hide(),c=a.outerHeight(),d=$(this.viewer.canvas).offset(),b=$(this.viewer.container.display.canvas).outerHeight(),this.viewer.contextMenuMousePositionY+c>d.top+b+$(this.viewer.canvas).outerHeight()+PAPAYA_SPACING&&(f=this.viewer.contextMenuMousePositionY+c-(d.top+b+$(this.viewer.canvas).outerHeight()+
PAPAYA_SPACING)-1),this.viewer.container.contextManager&&papaya.utilities.PlatformUtils.smallScreen?a.css({position:"absolute",zIndex:100,left:this.viewer.canvasRect.left,top:this.viewer.canvasRect.top-f}):a.css({position:"absolute",zIndex:100,left:this.viewer.contextMenuMousePositionX+this.viewer.canvasRect.left,top:this.viewer.contextMenuMousePositionY+this.viewer.canvasRect.top-f}),a.hide().fadeIn(200)))};
papaya.ui.Menu.prototype.showMenu=function(){var c,a,d;this.viewer.container.toolbar.closeAllMenus();this.contextMenu?this.showContextMenu():0<this.items.length&&(d="#"+this.menuId,a=$(d),c=a.is(":visible"),a.remove(),c||(c=$("#"+this.buttonId),this.buildMenu(),a=$(d),a.hide(),papaya.ui.Menu.doShowMenu(this.viewer,c[0],a[0],this.isRight)))};
papaya.ui.Menu.prototype.doClick=function(){var c;c=$("#"+this.menuId).is(":visible");this.callback(this.buttonId);this.icons&&(this.method?$("#"+this.buttonId+" > img").attr("src",this.icons[papaya.utilities.ObjectUtils.bind(this.viewer,papaya.utilities.ObjectUtils.dereferenceIn(this.viewer,this.method))()?1:0]):$("#"+this.buttonId+" > img").attr("src",this.icons[0]));this.menuOnHover||c||this.showMenu()};
papaya.ui.Menu.prototype.updateRangeItem=function(c,a){this.rangeItem&&($("#"+this.rangeItem.minId).val(c),$("#"+this.rangeItem.maxId).val(a))};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
papaya.ui.MenuItem=papaya.ui.MenuItem||function(c,a,d,f,b,e,h){this.viewer=c;this.modifier="";papaya.utilities.StringUtils.isStringBlank(h)||(this.modifier="-"+h);this.dataSource=b;this.method=e;this.label=this.dataSource&&this.method?this.dataSource[this.method]():a;this.action=d+this.modifier;this.id=this.action.replace(/ /g,"_")+this.viewer.container.containerIndex;this.callback=f;this.menu=null;this.isContext=!1};
papaya.ui.MenuItem.prototype.buildHTML=function(c){var a;a=this.dataSource&&this.method?this.dataSource[this.method]():this.label;a="<li id='"+this.id+"'><span class='"+PAPAYA_MENU_UNSELECTABLE+"'>"+a+"</span>"+(this.menu?"<span style='float:right'>&nbsp;&#x25B6;</span>":"")+"</li>";$("#"+c).append(a);c=$("#"+this.id);this.viewer.container.contextManager&&papaya.utilities.PlatformUtils.smallScreen&&(c[0].style.width=this.viewer.viewerDim-10+"px",c[0].style.fontSize="18px");c.click(papaya.utilities.ObjectUtils.bind(this,
function(a){this.doAction(this.isContext&&a.shiftKey)}));c.hover(function(){$(this).toggleClass(PAPAYA_MENU_HOVERING_CSS)})};papaya.ui.MenuItem.prototype.doAction=function(c){c||this.menu||(this.viewer.showingContextMenu=!1);this.callback(this.action,null,c)};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
papaya.ui.MenuItemCheckBox=papaya.ui.MenuItemCheckBox||function(c,a,d,f,b,e,h){this.viewer=c;this.label=a;this.modifier="";void 0!==h&&null!==h&&(this.modifier="-"+h);this.action=d+this.modifier;this.method=e;this.id=this.action.replace(/ /g,"_").replace(/\(/g,"").replace(/\)/g,"")+this.viewer.container.containerIndex;this.callback=f;this.dataSource=b};
papaya.ui.MenuItemCheckBox.prototype.buildHTML=function(c){var a,d;a=this.dataSource[this.method](this.label);d="";a&&(d="checked='checked'");a="<li id='"+this.id+"'><input type='checkbox' class='"+PAPAYA_MENU_COLORTABLE_CSS+"' name='"+PAPAYA_MENU_COLORTABLE_CSS+"' id='"+this.id+"' value='"+this.id+"' "+d+"><span class='"+PAPAYA_MENU_UNSELECTABLE+"'>&nbsp;"+this.label+"</span></li>";$("#"+c).append(a);c=$("#"+this.id);c.click(papaya.utilities.ObjectUtils.bind(this,this.doAction));c.hover(function(){$(this).toggleClass(PAPAYA_MENU_HOVERING_CSS)})};
papaya.ui.MenuItemCheckBox.prototype.doAction=function(){$("."+PAPAYA_MENU_COLORTABLE_CSS).removeAttr("checked");$("#"+this.id+" > input")[0].checked=!0;this.callback(this.action,null,!0)};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
papaya.ui.MenuItemRadioButton=papaya.ui.MenuItemRadioButton||function(c,a,d,f,b,e,h){this.viewer=c;this.label=a;this.modifier="";void 0!==h&&null!==h&&(this.modifier="-"+h);this.methodParam=this.action=d+this.modifier;this.method=e;this.id=this.action.replace(/ /g,"_").replace(/\(/g,"").replace(/\)/g,"")+this.viewer.container.containerIndex;this.callback=f;this.dataSource=b};
papaya.ui.MenuItemRadioButton.prototype.buildHTML=function(c){var a,d;a=this.dataSource[this.method](this.label);d="";a&&(d="checked='checked'");a="<li id='"+this.id+"'><input type='radio' class='"+PAPAYA_MENU_COLORTABLE_CSS+"' name='"+PAPAYA_MENU_COLORTABLE_CSS+"' id='"+this.id+"' value='"+this.id+"' "+d+"><span class='"+PAPAYA_MENU_UNSELECTABLE+"'>&nbsp;"+this.label+"</span></li>";$("#"+c).append(a);c=$("#"+this.id);c.click(papaya.utilities.ObjectUtils.bind(this,this.doAction));c.hover(function(){$(this).toggleClass(PAPAYA_MENU_HOVERING_CSS)})};
papaya.ui.MenuItemRadioButton.prototype.doAction=function(){$("."+PAPAYA_MENU_COLORTABLE_CSS).removeAttr("checked");$("#"+this.id+" > input")[0].checked=!0;this.callback(this.action,null,!0)};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
papaya.ui.MenuItemFileChooser=papaya.ui.MenuItemFileChooser||function(c,a,d,f,b,e){this.viewer=c;this.label=a;this.modifier="";void 0!==e&&null!==e&&(this.modifier="-"+e);this.action=d+this.modifier;this.id=this.action.replace(/ /g,"_")+this.viewer.container.containerIndex;this.fileChooserId="fileChooser"+this.label.replace(/ /g,"_").replace(/\./g,"")+this.viewer.container.containerIndex+(b?"folder":"");this.callback=f;this.folder=b};
papaya.ui.MenuItemFileChooser.prototype.buildHTML=function(c){var a,d;a=this;d="<li id='"+this.id+"'><span class='"+PAPAYA_MENU_UNSELECTABLE+"'><label class='"+PAPAYA_MENU_FILECHOOSER+"' for='"+this.fileChooserId+"'>"+this.label;d=this.folder?d+("</label><input type='file' id='"+this.fileChooserId+"' multiple='multiple' webkitdirectory directory name='files' /></span></li>"):d+("</label><input type='file' id='"+this.fileChooserId+"' multiple='multiple' name='files' /></span></li>");$("#"+c).append(d);
$("#"+this.fileChooserId)[0].onchange=papaya.utilities.ObjectUtils.bind(a,function(){a.callback(a.action,document.getElementById(a.fileChooserId).files)});$("#"+this.id).hover(function(){$(this).toggleClass(PAPAYA_MENU_HOVERING_CSS)})};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
papaya.ui.MenuItemRange=papaya.ui.MenuItemRange||function(c,a,d,f,b,e,h){"ChangeRangeNeg"===d&&(this.negatives=!0,h=c.getScreenVolumeIndex(c.screenVolumes[parseInt(h)].negativeScreenVol).toString());this.viewer=c;this.label=a;this.index=h;this.modifier="";void 0!==h&&(this.modifier="-"+h);this.action=d+this.modifier;this.minId=this.action.replace(/ /g,"_")+"Min"+this.viewer.container.containerIndex;this.maxId=this.action.replace(/ /g,"_")+"Max"+this.viewer.container.containerIndex;this.callback=f;
this.dataSource=b;this.method=e;this.id=a+this.modifier+this.viewer.container.containerIndex;this.grabOffset=0;this.screenVol=this.viewer.screenVolumes[this.index]};papaya.ui.MenuItemRange.getRelativeMousePositionFromParentX=function(c,a){var d=c.parent().offset();return papaya.utilities.PlatformUtils.getMousePositionX(a)-d.left};papaya.ui.MenuItemRange.getRelativeMousePositionX=function(c,a){var d=c.offset();return papaya.utilities.PlatformUtils.getMousePositionX(a)-d.left};
papaya.ui.MenuItemRange.prototype.buildHTML=function(c){var a,d,f,b,e,h,g,k,l,q;e=this.id+"SliderMin";g=this.id+"SliderMax";l=this.id+"Slider";a=this.dataSource[this.method]();d=this;a="<li id='"+this.id+"'><span class='"+PAPAYA_MENU_UNSELECTABLE+"' style=''><input class='"+PAPAYA_MENU_INPUT_FIELD+"' type='text' size='4' id='"+this.minId+"' value='"+a[0]+"' /><div style='display:inline-block;position:relative;width:"+(papaya.viewer.ColorTable.COLOR_BAR_WIDTH+papaya.viewer.ColorTable.ARROW_ICON_WIDTH)+
"px;top:-12px;'><img id='"+e+"' class='"+PAPAYA_MENU_UNSELECTABLE+"' style='position:absolute;top:5px;left:"+d.screenVol.colorTable.minLUT/papaya.viewer.ColorTable.LUT_MAX*(papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1)+"px;z-index:99' src='"+papaya.viewer.ColorTable.ARROW_ICON+"' /><img id='"+g+"' class='"+PAPAYA_MENU_UNSELECTABLE+"' style='position:absolute;top:5px;left:"+d.screenVol.colorTable.maxLUT/papaya.viewer.ColorTable.LUT_MAX*(papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1)+"px;z-index:99' src='"+
papaya.viewer.ColorTable.ARROW_ICON+"' /><img id='"+l+"' class='"+PAPAYA_MENU_UNSELECTABLE+"' style='position:absolute;top:0;left:"+parseInt(papaya.viewer.ColorTable.ARROW_ICON_WIDTH/2,10)+"px;' src='"+this.viewer.screenVolumes[parseInt(this.index,10)].colorBar+"' /></div><input class='"+PAPAYA_MENU_INPUT_FIELD+"' type='text' size='4' id='"+this.maxId+"' value='"+a[1]+"' /></span></li>";$("#"+c).append(a);f=$("#"+this.minId);b=$("#"+this.maxId);h=$("#"+e);k=$("#"+g);q=$("#"+l);papaya.utilities.PlatformUtils.ios&&
(f[0].style.width="35px",f[0].style.marginRight="4px",b[0].style.width="35px",b[0].style.marginRight="4px");h.bind(papaya.utilities.PlatformUtils.ios?"touchstart":"mousedown",function(a){d.grabOffset=papaya.ui.MenuItemRange.getRelativeMousePositionX(h,a);$(window).bind(papaya.utilities.PlatformUtils.ios?"touchmove":"mousemove",function(a){var b;b=d.screenVol.colorTable.maxLUT/papaya.viewer.ColorTable.LUT_MAX*(papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1);a=papaya.ui.MenuItemRange.getRelativeMousePositionFromParentX(h,
a)-d.grabOffset;0>a?a=0:a>=papaya.viewer.ColorTable.COLOR_BAR_WIDTH?a=papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1:a>b&&(a=b);d.screenVol.updateMinLUT(Math.round(a/(papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1)*papaya.viewer.ColorTable.LUT_MAX));h.css({left:a+"px"});d.viewer.drawViewer(!1,!0);f.val(d.dataSource[d.method]()[0]);d.screenVol.updateColorBar();q.attr("src",d.screenVol.colorBar)});return!1});k.bind(papaya.utilities.PlatformUtils.ios?"touchstart":"mousedown",function(a){d.grabOffset=papaya.ui.MenuItemRange.getRelativeMousePositionX(k,
a);$(window).bind(papaya.utilities.PlatformUtils.ios?"touchmove":"mousemove",function(a){var c;c=d.screenVol.colorTable.minLUT/papaya.viewer.ColorTable.LUT_MAX*(papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1);a=papaya.ui.MenuItemRange.getRelativeMousePositionFromParentX(k,a)-d.grabOffset;0>a?a=0:a>=papaya.viewer.ColorTable.COLOR_BAR_WIDTH?a=papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1:a<c&&(a=c);d.screenVol.updateMaxLUT(Math.round(a/(papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1)*papaya.viewer.ColorTable.LUT_MAX));
k.css({left:a+"px"});d.viewer.drawViewer(!1,!0);b.val(d.dataSource[d.method]()[1]);d.screenVol.updateColorBar();q.attr("src",d.screenVol.colorBar)});return!1});$(window).bind(papaya.utilities.PlatformUtils.ios?"touchend":"mouseup",function(){$(window).unbind(papaya.utilities.PlatformUtils.ios?"touchmove":"mousemove")});$("#"+this.id).hover(function(){$(this).toggleClass(PAPAYA_MENU_HOVERING_CSS)});f.change(papaya.utilities.ObjectUtils.bind(this,function(){d.rangeChanged(!0)}));b.change(papaya.utilities.ObjectUtils.bind(this,
function(){d.rangeChanged(!1)}));f.keyup(papaya.utilities.ObjectUtils.bind(this,function(a){13===a.keyCode&&(d.rangeChanged(!1),d.viewer.container.toolbar.closeAllMenus())}));b.keyup(papaya.utilities.ObjectUtils.bind(this,function(a){13===a.keyCode&&(d.rangeChanged(!1),d.viewer.container.toolbar.closeAllMenus())}));papaya.utilities.PlatformUtils.ios||setTimeout(function(){f.focus();f.select()},10)};
papaya.ui.MenuItemRange.prototype.rangeChanged=function(c){this.updateDataSource(c);this.viewer.drawViewer(!0);this.resetSlider()};papaya.ui.MenuItemRange.prototype.updateDataSource=function(c){var a,d,f,b;b=$("#"+this.minId);f=$("#"+this.maxId);d=parseFloat(b.val());isNaN(d)&&(d=this.dataSource.screenMin);a=parseFloat(f.val());isNaN(a)&&(a=this.dataSource.screenMax);b.val(d);f.val(a);this.negatives?this.dataSource.setScreenRangeNegatives(d,a):this.dataSource.setScreenRange(d,a);c&&(f.focus(),f.select())};
papaya.ui.MenuItemRange.prototype.resetSlider=function(){var c,a,d;c=this.id+"SliderMin";a=this.id+"SliderMax";d=this.id+"Slider";c=$("#"+c);a=$("#"+a);d=$("#"+d);c.css({left:0});a.css({left:papaya.viewer.ColorTable.COLOR_BAR_WIDTH-1+"px"});this.screenVol.resetDynamicRange();d.attr("src",this.screenVol.colorBar)};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};
papaya.ui.MenuItemSlider=papaya.ui.MenuItemSlider||function(c,a,d,f,b,e,h){"alphaneg"===d&&(d="alpha",h=c.getScreenVolumeIndex(c.screenVolumes[parseInt(h)].negativeScreenVol).toString());this.viewer=c;this.label=a;this.index=h;this.modifier="";papaya.utilities.StringUtils.isStringBlank(h)||(this.modifier="-"+h);this.dataSource=b;this.method=e;this.action=d;this.event=-1!=this.action.toLowerCase().indexOf("alpha")||this.viewer.screenVolumes[0].isHighResSlice?"change":"input change";this.id=this.action.replace(/ /g,
"_")+this.viewer.container.containerIndex+"_"+this.index;this.callback=f;this.screenVol=b};
papaya.ui.MenuItemSlider.prototype.buildHTML=function(c){var a,d,f,b,e;e=this.event;d=this.id+"Slider";a="<li id='"+this.id+"'><span style='padding-right:5px;' class='"+PAPAYA_MENU_UNSELECTABLE+"'>"+this.label+":</span><input min='0' max='100' value='"+parseInt(100*(1-this.screenVol[this.action]),10)+"' id='"+d+"' class='"+PAPAYA_MENU_SLIDER+"' type='range' /></li>";$("#"+c).append(a);$("#"+this.id).hover(function(){$(this).toggleClass(PAPAYA_MENU_HOVERING_CSS)});f=$("#"+d);b=this;$("#"+this.id+"Slider").on(e,
function(){b.screenVol[b.action]=1-f.val()/100;b.doAction();b.viewer.drawViewer(!0,!1)})};papaya.ui.MenuItemSlider.prototype.doAction=function(){this.callback(this.action,null,!0)};"use strict";papaya=papaya||{};papaya.ui=papaya.ui||{};papaya.ui.MenuItemSpacer=papaya.ui.MenuItemSpacer||function(){};papaya.ui.MenuItemSpacer.prototype.buildHTML=function(c){var a;a="<div class='"+PAPAYA_MENU_SPACER_CSS+" "+PAPAYA_MENU_UNSELECTABLE+"'></div>";$("#"+c).append(a)};"use strict";papaya=papaya||{};
papaya.ui=papaya.ui||{};papayaLoadableImages=papayaLoadableImages||[];papaya.ui.Toolbar=papaya.ui.Toolbar||function(c){this.container=c;this.viewer=c.viewer;this.spaceMenu=this.surfaceMenus=this.imageMenus=null};papaya.ui.Toolbar.SIZE=22;papaya.ui.Toolbar.ICON_IMAGESPACE="data:image/gif;base64,R0lGODlhFAAUAPcAMf//////GP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////2f/ZNbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1qWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpVpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACoALAAAAAAUABQAAAipAFUIHEiwoMB/A1coXLiwisOHVf4hVLFCosWLGC9SzMgR48Z/VEJSUVjFj0mTESdWBCmS5EmU/6oIXCly5IqSLx/OlFjT5Us/DneybIkzp8yPDElChCjwj8Q/UKOqmkqVatOnUaGqmsaVq1UVTv+lGjv2z9SuXlVdFUs2ldmtaKeubev2bFy1YCXSfYt2mty8/6CS5XtXRcasVRMftJj1beK/hicanKwiIAA7";
papaya.ui.Toolbar.ICON_WORLDSPACE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAplJREFUeNqM1H1ozVEcx/Hr3p+7O08jQzbzMErznEItK0+Fv0Ye/tki20ia//wn+YMSaXkoEiKkkCVKZhOipsnDstnFagzlrmGMNfeO6/Nd71unu2s59bq7O517ft/z/X7Pz+dLPUbLJrkqX+SbdEubfJZK2cC6PiOQYm61HJcpkintEpcmCcpryZV5spaHhvvbdJ9slsPyU67wgPlEli0X5aiMkMeyXSbKnVRRVxDRRtkm5czbZrv5vkgu8z1P9stWfleRHGkhT3xCLu1YzZIjpfKWnA6VEn43mwcWEaWlo1Ve2YZj5Jms53iP5BjFsFz9lg/yDj0U7JbslFpZQyBP2a83khoiLiWPA/h/OVGOk+GwnJ5y1iyRS5Im1VLm18cKOc+CYrlGjnxUuZPIOlAn0yWdNXdlrMyRE7LM00eBjBT7niFVTvHsKJ8k6sw1yC4ZIl0EUMOcRT/X44v14xEZSBWfk+d8NpzKujgPGiYrOXI+XTGeGtjpewtjm16Qh3JT3sgvickfNo4yF6V4PVyE2wQUZvP7FmmIa/iDIpwkHRPkrC2iEIlhEZ2mtarIsz3sOoX0PPrP7nAWPRYjj51E85JiJEYO0VsfR5hL5wZal3T7aZl10kLiEyNEHtOSbt4g/gaduRjzC+S9RwtZ332XBxQpzGZ+p72SR5BumUYHLaaDSiySUXKPig6Wj+SmjX5s4BQB0pFBQVo4dhenspfKC1kaYLKVa9pOAW5Q2Ww2qeU92kHbzZRDvK2sBSfLDLtNUp/82rOj7nDm9tJi7lhoeWNzG7Pkqxz8R5p8ByhcGVd0CzkOOWv28KBJvNGa+V2/Y5U08vQm8mgvmTNyjpxHSFUj6/9rZPKerGSTuCPCi7qIdX3GXwEGAPFYt+/OgAXDAAAAAElFTkSuQmCC";
papaya.ui.Toolbar.ICON_EXPAND="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAE00lEQVR42u2djW3UQBCFJx3QAemAdJBQAVABTgekAqCC0EGOCoAKWDqADkIHKQGPfKdEh3Nr7493Z977pJWQwtk7+77ETs6zdyYEmrPWEyBtoQDgUABwKAA4FAAcCgAOBQCHAoBDAcChAOBQAHAoADgUABwKAE6uALfjuGg094dx7Mbxo9H5D7wZxzCOF43O/3scN6kvzhXg5ziuGhV+4K20k0DD/964/jCO16kv9iCABvCu0bm/ySRgS4KAC7Abx3Wjc9/J9OO/JUGABXjYn/9Po/O/kimAVtd/EQMC6E1Krevkbhx/Kx17KSpBrcuAHjd2kx2kcwGUYRxfy60LBO9lEjxGEAMCKINQgqUsDV8JYkQAZRBKEGNN+EqQzgTQa/6p69YglOA5YuHPrW2QzgT4NI77SCGDUIJjYuEP4ziXaX2fEqRDAT4vLIgSTCxdq49iSIA1hSGzZo3MCbC2QDTWro1JAVIKRSBlTcwKkFqwV1LXwrQAOYV7ImcNzAuQuwDWya3dhQAlFsIiJWp2I0CpBbFCqVpdCVByYXqmZI3uBCi9QL1RujaXAigeJahRk1sBFE8S1KrFtQCKBwlq1uBeAMWyBLXnDiGAYlGCLeYMI4BiSYKt5golgGJBgi3nCCeA0rMEW88NUgClRwlazKk7AeaaI3WCpQVQepKg1VzmBMhqjs0V4Lg9unavXg8StJzDS5keDX/ai5jVHl9ih5DDBgka/hep36jZMoAeBNRexA8ySaBzydobweoWMS2C6CH84lgVQNkyEJfhK5YFULYIxm34inUBlFhA55K+h8DcTddTBjEcvuJBAOWUBIOkh3Qp0+/ZpY/bDV4EUJ6T4GocvxKP+ZwAgzgIX/EkgKIS6K+ihx/ZQTL+Srbn+K+dgzgJX/EmgKLX7fP9v1O/84+53B8zSPs9iYriUQCyAgoADgUAhwKAQwHAoQDgUABwKAA4FAAcCgAOBQCHAoBDAcChAOB4FEDfDr6Sacfykm8Hy/6YfDu4Y46fCgpS9oEQ7X3QZ/L5QEiH8JGwBLwIcOqh0CtJF6DWw6bd4EGAUyHpj2z9iJWcx8LvT3x9EOMSWBeAjSGZWBaArWEFsCoAm0MLwfZwO+c+0FV7+NwGETk3XTF6CKDlHOY+rLrpBhHcImbbuXS3RQw3idp2Tt1tEsVt4rhNHDeK3HCOUAJYCH/rucIIYCn8LecMIYDF8Leau3sBLIe/RQ2uBfAQfu1a3ArgKfyaNbkUwGP4tWpzJ4Dn8GvU6EoAhPBL1+pGAKTwS9bsQgDE8EvVbl4A5PBLrIFpARj+I6lrYVYAhv8/KWtiUgCG/zxr18acAAw/zpo1MiUAw1/O0rUyI8D9woLII0skOBcDAuhHrFxECmH488QkmFvbIJ0JcIpBGH6MmATHBDEiwCAMfylrJAhiQIBBGP5alkoQpHMB9Lr1PX6oJPS4tXsRY+geAkOlY2vX1UXk/wTpXICa1P6w6hhzvXpbo+eHFUDZjeO60bnvpN53/1KCgAuQ1RyZyVxz7NYEARcgqz06k+P2+BYEaSjArcRvUmqh1/+dtAv/wGGDjFb3AXqTfZP6YqtbxJBCUABwKAA4FAAcCgAOBQCHAoBDAcChAOBQAHAoADgUABwKAA4FAIcCgPMPvdAfn3qMP2kAAAAASUVORK5CYII=";
papaya.ui.Toolbar.ICON_COLLAPSE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAEJGlDQ1BJQ0MgUHJvZmlsZQAAOBGFVd9v21QUPolvUqQWPyBYR4eKxa9VU1u5GxqtxgZJk6XtShal6dgqJOQ6N4mpGwfb6baqT3uBNwb8AUDZAw9IPCENBmJ72fbAtElThyqqSUh76MQPISbtBVXhu3ZiJ1PEXPX6yznfOec7517bRD1fabWaGVWIlquunc8klZOnFpSeTYrSs9RLA9Sr6U4tkcvNEi7BFffO6+EdigjL7ZHu/k72I796i9zRiSJPwG4VHX0Z+AxRzNRrtksUvwf7+Gm3BtzzHPDTNgQCqwKXfZwSeNHHJz1OIT8JjtAq6xWtCLwGPLzYZi+3YV8DGMiT4VVuG7oiZpGzrZJhcs/hL49xtzH/Dy6bdfTsXYNY+5yluWO4D4neK/ZUvok/17X0HPBLsF+vuUlhfwX4j/rSfAJ4H1H0qZJ9dN7nR19frRTeBt4Fe9FwpwtN+2p1MXscGLHR9SXrmMgjONd1ZxKzpBeA71b4tNhj6JGoyFNp4GHgwUp9qplfmnFW5oTdy7NamcwCI49kv6fN5IAHgD+0rbyoBc3SOjczohbyS1drbq6pQdqumllRC/0ymTtej8gpbbuVwpQfyw66dqEZyxZKxtHpJn+tZnpnEdrYBbueF9qQn93S7HQGGHnYP7w6L+YGHNtd1FJitqPAR+hERCNOFi1i1alKO6RQnjKUxL1GNjwlMsiEhcPLYTEiT9ISbN15OY/jx4SMshe9LaJRpTvHr3C/ybFYP1PZAfwfYrPsMBtnE6SwN9ib7AhLwTrBDgUKcm06FSrTfSj187xPdVQWOk5Q8vxAfSiIUc7Z7xr6zY/+hpqwSyv0I0/QMTRb7RMgBxNodTfSPqdraz/sDjzKBrv4zu2+a2t0/HHzjd2Lbcc2sG7GtsL42K+xLfxtUgI7YHqKlqHK8HbCCXgjHT1cAdMlDetv4FnQ2lLasaOl6vmB0CMmwT/IPszSueHQqv6i/qluqF+oF9TfO2qEGTumJH0qfSv9KH0nfS/9TIp0Wboi/SRdlb6RLgU5u++9nyXYe69fYRPdil1o1WufNSdTTsp75BfllPy8/LI8G7AUuV8ek6fkvfDsCfbNDP0dvRh0CrNqTbV7LfEEGDQPJQadBtfGVMWEq3QWWdufk6ZSNsjG2PQjp3ZcnOWWing6noonSInvi0/Ex+IzAreevPhe+CawpgP1/pMTMDo64G0sTCXIM+KdOnFWRfQKdJvQzV1+Bt8OokmrdtY2yhVX2a+qrykJfMq4Ml3VR4cVzTQVz+UoNne4vcKLoyS+gyKO6EHe+75Fdt0Mbe5bRIf/wjvrVmhbqBN97RD1vxrahvBOfOYzoosH9bq94uejSOQGkVM6sN/7HelL4t10t9F4gPdVzydEOx83Gv+uNxo7XyL/FtFl8z9ZAHF4bBsrEwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAeJJREFUOBG1lU1KA0EQhTP5c5MggkvFvQfQjS4iIcled3qBrDyCHsFsvEBcegBBkEBA0VuIW0UFBX8w4/c6VUMbAhoYG16qquvVm05Nd0+SpmlBI0mSogzxV5iY8Yf6EiWUp6NQasJFWfPL7lucQIzzvoDAn6xxrsRDEXYVrE0S44dM86kJC1GtNKxeDy+ULFDiAbQsrpqtMFeXb3GNuDLBaVmtL6zkZH+qCPegGQm1iftR3CduR3HTanxBY62I4OIiPoGOcoxdMIh4A81ZroMvblgINmiEnBcY0f++Cl6B2rMBzp0n3+aUE8cXEGqdVyaRDSY/FGDP2D4N3B64Bs/Ah/wdsA4acG+U8Fr5GuHtIaItpb1cAW2gv18FEt0HC8CHfM0pVxXXavSSpRG0fMUK1NA5sAeWwSfQ6i7AEPhwf4mJAyDBO3AJVBO0dNLw8x+hFfnLsj0kSlt0+kbYOuExiFuhng7JH2LFld0Ej2AeeCu6cF5cy3vs/XiDeAIWwS3Q298G8ZDoFuiBI7ACdKjegcZYSz2eBgjap1dAxafOkW9zyoUj7LnY/hCFmNsByYQRzf9IR6L5XUKI/uXarHn/4Gvn/H5tQvqfi14rcXHzs6vPYh3RmT9N2ZHWxkYgt4/pN/LAOfka/AG9AAAAAElFTkSuQmCC";
papaya.ui.Toolbar.FILE_MENU_DATA={label:"File",icons:null,items:[{label:"Add Image...",action:"OpenImage",type:"file",hide:papaya.utilities.PlatformUtils.ios},{label:"Add Surface...",action:"OpenSurface",type:"file",hide:papaya.utilities.PlatformUtils.ios},{label:"Add DICOM Folder...",action:"OpenFolder",type:"folder",hide:"Chrome"!==papaya.utilities.PlatformUtils.browser||"undefined"===typeof daikon},{label:"Add DTI Vector Series...",action:"OpenDTI",type:"file"},{type:"spacer"},{label:"Close All",
action:"CloseAllImages"}]};papaya.ui.Toolbar.RGB_FILE_MENU_DATA={label:"File",icons:null,items:[{label:"Close All",action:"CloseAllImages"}]};
papaya.ui.Toolbar.MENU_DATA={menus:[papaya.ui.Toolbar.FILE_MENU_DATA,{label:"View",icons:null,items:[{label:"Orientation",action:"ShowOrientation",type:"checkbox",method:"isShowingOrientation"},{label:"Crosshairs",action:"ShowCrosshairs",type:"checkbox",method:"isShowingCrosshairs"},{label:"Ruler",action:"ShowRuler",type:"checkbox",method:"isShowingRuler"},{type:"spacer",required:"hasSurface"},{label:"Surface Planes",action:"ShowSurfacePlanes",type:"checkbox",method:"isShowingSurfacePlanes",required:"hasSurface"}]},
{label:"Settings",icons:null,items:[{label:"Viewer Preferences",action:"Preferences"},{label:"Surface Preferences",action:"SurfacePreferences",required:"hasSurface"}]},{label:"Help",icons:null,items:[{label:"Show Keyboard Reference",action:"KeyboardRef"},{label:"Show Mouse Reference",action:"MouseRef"},{label:"Show License",action:"License"}]},{label:"",icons:null,titleBar:"true"},{label:"EXPAND",icons:[papaya.ui.Toolbar.ICON_EXPAND,papaya.ui.Toolbar.ICON_COLLAPSE],items:[],method:"isCollapsable",
required:"isExpandable"},{label:"SPACE",icons:[papaya.ui.Toolbar.ICON_IMAGESPACE,papaya.ui.Toolbar.ICON_WORLDSPACE],items:[],method:"isWorldMode",menuOnHover:!0}]};papaya.ui.Toolbar.MENU_DATA_KIOSK={menus:[{label:"EXPAND",icons:[papaya.ui.Toolbar.ICON_EXPAND,papaya.ui.Toolbar.ICON_COLLAPSE],items:[],method:"isCollapsable",required:"isExpandable"}]};
papaya.ui.Toolbar.OVERLAY_IMAGE_MENU_DATA={items:[{label:"Show Header",action:"ShowHeader"},{label:"Show Image Info",action:"ImageInfo"},{type:"spacer",required:"isParametricCombined"},{label:"DisplayRange",action:"ChangeRange",type:"displayrange",method:"getRange"},{label:"Load Negatives",action:"LoadNegatives",required:"canCurrentOverlayLoadNegatives"},{label:"Transparency",action:"alpha",type:"range",method:"getAlpha"},{label:"Color Table",action:"ColorTable",items:[],required:"isNonParametricCombined"},
{type:"spacer",required:"isParametricCombined"},{label:"DisplayRange",action:"ChangeRangeNeg",type:"displayrange",method:"getRangeNegative",required:"isParametricCombined"},{label:"Transparency",action:"alphaneg",type:"range",method:"getAlpha",required:"isParametricCombined"},{type:"spacer",required:"isParametricCombined"},{label:"Hide Overlay",action:"ToggleOverlay",method:"getHiddenLabel"},{label:"Close Overlay",action:"CloseOverlay",required:"isDesktopMode"},{label:"Open in Mango",action:"OpenInMango",
required:"canOpenInMango"}]};
papaya.ui.Toolbar.BASE_IMAGE_MENU_DATA={items:[{label:"Show Header",action:"ShowHeader"},{label:"Show Image Info",action:"ImageInfo"},{label:"DisplayRange",action:"ChangeRange",type:"displayrange",method:"getRange"},papaya.ui.Toolbar.OVERLAY_IMAGE_MENU_DATA.items[6],{label:"Rotation",action:"Rotation",items:[{label:"About X Axis",action:"rotationX",type:"range",method:"getRotationX"},{label:"About Y Axis",action:"rotationY",type:"range",method:"getRotationY"},{label:"About Z Axis",action:"rotationZ",
type:"range",method:"getRotationZ"},{label:"Reset Transform",action:"ResetTransform"},{label:"Rotate About Center",action:"Rotate About Center",type:"radiobutton",method:"isRotatingAbout"},{label:"Rotate About Origin",action:"Rotate About Origin",type:"radiobutton",method:"isRotatingAbout"},{label:"Rotate About Crosshairs",action:"Rotate About Crosshairs",type:"radiobutton",method:"isRotatingAbout"}]},{label:"Open in Mango",action:"OpenInMango",required:"canOpenInMango"}]};
papaya.ui.Toolbar.RGB_IMAGE_MENU_DATA={items:[{label:"Show Header",action:"ShowHeader"},{label:"Show Image Info",action:"ImageInfo"},{label:"Open in Mango",action:"OpenInMango",required:"canOpenInMango"}]};papaya.ui.Toolbar.SURFACE_MENU_DATA={items:[{label:"Show Surface Info",action:"SurfaceInfo"},{label:"Transparency",action:"alpha",type:"range",method:"getAlpha"}]};
papaya.ui.Toolbar.DTI_IMAGE_MENU_DATA={items:[{label:"Show Header",action:"ShowHeader"},{label:"Show Image Info",action:"ImageInfo"},{label:"Display Colors",action:"DTI-RGB",type:"checkbox",method:"isDTIRGB"},{label:"Display Lines",action:"DTI-Lines",type:"checkbox",method:"isDTILines"},{label:"Display Lines &amp; Colors",action:"DTI-LinesColors",type:"checkbox",method:"isDTILinesAndRGB"},{label:"Transparency",action:"alpha",type:"range",method:"getAlpha",required:"canCurrentOverlayLoadMod"},{label:"Modulate with...",
action:"DTI-Mod",type:"file",hide:papaya.utilities.PlatformUtils.ios,required:"canCurrentOverlayLoadMod"},{label:"Modulation",action:"dtiAlphaFactor",type:"range",method:"getDtiAlphaFactor",required:"canCurrentOverlayModulate"},{label:"Open in Mango",action:"OpenInMango",required:"canOpenInMango"}]};
papaya.ui.Toolbar.PREFERENCES_DATA={items:[{label:"Coordinate display of:",field:"atlasLocks",options:["Mouse","Crosshairs"]},{label:"Scroll wheel behavior:",field:"scrollBehavior",options:["Zoom","Increment Slice"],disabled:"container.disableScrollWheel"},{spacer:"true"},{label:"Smooth display:",field:"smoothDisplay",options:["Yes","No"]},{label:"Radiological display:",field:"radiological",options:["Yes","No"]}]};
papaya.ui.Toolbar.PREFERENCES_SURFACE_DATA={items:[{label:"Background color:",field:"surfaceBackgroundColor",options:["Black","Dark Gray","Gray","Light Gray","White"]}]};
papaya.ui.Toolbar.IMAGE_INFO_DATA={items:[{label:"Filename:",field:"getFilename",readonly:"true"},{spacer:"true"},{label:"Image Dims:",field:"getImageDimensionsDescription",readonly:"true"},{label:"Voxel Dims:",field:"getVoxelDimensionsDescription",readonly:"true"},{spacer:"true"},{label:"Byte Type:",field:"getByteTypeDescription",readonly:"true"},{label:"Byte Order:",field:"getByteOrderDescription",readonly:"true"},{spacer:"true"},{label:"Orientation:",field:"getOrientationDescription",readonly:"true"},
{spacer:"true"},{label:"Notes:",field:"getImageDescription",readonly:"true"}]};
papaya.ui.Toolbar.SERIES_INFO_DATA={items:[{label:"Filename:",field:"getFilename",readonly:"true"},{label:"File Length:",field:"getFileLength",readonly:"true"},{spacer:"true"},{label:"Image Dims:",field:"getImageDimensionsDescription",readonly:"true"},{label:"Voxel Dims:",field:"getVoxelDimensionsDescription",readonly:"true"},{label:"Series Points:",field:"getSeriesDimensionsDescription",readonly:"true"},{label:"Series Point Size:",field:"getSeriesSizeDescription",readonly:"true"},{spacer:"true"},
{label:"Byte Type:",field:"getByteTypeDescription",readonly:"true"},{label:"Byte Order:",field:"getByteOrderDescription",readonly:"true"},{label:"Compressed:",field:"getCompressedDescription",readonly:"true"},{spacer:"true"},{label:"Orientation:",field:"getOrientationDescription",readonly:"true"},{label:"Notes:",field:"getImageDescription",readonly:"true"}]};
papaya.ui.Toolbar.SURFACE_INFO_DATA={items:[{label:"Filename:",field:"getSurfaceFilename",readonly:"true"},{spacer:"true"},{label:"Points:",field:"getSurfaceNumPoints",readonly:"true"},{label:"Triangles:",field:"getSurfaceNumTriangles",readonly:"true"}]};papaya.ui.Toolbar.HEADER_DATA={items:[{label:"",field:"getHeaderDescription",readonly:"true"}]};papaya.ui.Toolbar.LICENSE_DATA={items:[{label:"",field:"getLicense",readonly:"true"}]};
papaya.ui.Toolbar.KEYBOARD_REF_DATA={items:[{label:"",field:"getKeyboardReference",readonly:"true"}]};papaya.ui.Toolbar.MOUSE_REF_DATA={items:[{label:"",field:"getMouseReference",readonly:"true"}]};papaya.ui.Toolbar.applyContextState=function(c){var a;c.contextMenu=!0;if(c.items)for(a=0;a<c.items.length;a+=1)c.items[a].menu?papaya.ui.Toolbar.applyContextState(c.items[a].menu):c.items[a].isContext=!0};
papaya.ui.Toolbar.prototype.buildToolbar=function(){var c;this.spaceMenu=this.surfaceMenus=this.imageMenus=null;this.container.toolbarHtml.find("."+PAPAYA_MENU_ICON_CSS).remove();this.container.toolbarHtml.find("."+PAPAYA_MENU_LABEL_CSS).remove();this.container.toolbarHtml.find("."+PAPAYA_TITLEBAR_CSS).remove();if(this.container.kioskMode)for(c=0;c<papaya.ui.Toolbar.MENU_DATA_KIOSK.menus.length;c+=1)this.buildMenu(papaya.ui.Toolbar.MENU_DATA_KIOSK.menus[c],null,this.viewer,null);else{0<this.container.viewer.screenVolumes.length&&
this.container.viewer.screenVolumes[0].rgb?papaya.ui.Toolbar.MENU_DATA.menus[0]=papaya.ui.Toolbar.RGB_FILE_MENU_DATA:(papaya.ui.Toolbar.MENU_DATA.menus[0]=papaya.ui.Toolbar.FILE_MENU_DATA,this.buildOpenMenuItems(papaya.ui.Toolbar.MENU_DATA));for(c=0;c<papaya.ui.Toolbar.MENU_DATA.menus.length;c+=1)this.buildMenu(papaya.ui.Toolbar.MENU_DATA.menus[c],null,this.viewer,null);this.buildAtlasMenu()}this.buildColorMenuItems();this.container.titlebarHtml=this.container.containerHtml.find("."+PAPAYA_TITLEBAR_CSS);
600>this.container.getViewerDimensions()[0]?this.container.titlebarHtml.css({visibility:"hidden"}):this.container.titlebarHtml.css({visibility:"visible"})};
papaya.ui.Toolbar.prototype.buildAtlasMenu=function(){if(papaya.data&&papaya.data.Atlas){var c=this.spaceMenu.items;c[0]={label:papaya.data.Atlas.labels.atlas.header.name,action:"AtlasChanged-"+papaya.data.Atlas.labels.atlas.header.name,type:"radiobutton",method:"isUsingAtlas"};papaya.data.Atlas.labels.atlas.header.transformedname&&(c[1]={label:papaya.data.Atlas.labels.atlas.header.transformedname,action:"AtlasChanged-"+papaya.data.Atlas.labels.atlas.header.transformedname,type:"radiobutton",method:"isUsingAtlas"})}};
papaya.ui.Toolbar.prototype.buildColorMenuItems=function(){var c,a,d,f;if(c=this.container.params.luts)for(a=0;a<c.length;a+=1)papaya.viewer.ColorTable.addCustomLUT(c[a]);d=papaya.viewer.ColorTable.TABLE_ALL;c=papaya.ui.Toolbar.OVERLAY_IMAGE_MENU_DATA.items;for(a=0;a<c.length;a+=1)if("Color Table"===c[a].label){c=c[a].items;break}for(a=0;a<d.length;a+=1)f={label:d[a].name,action:"ColorTable-"+d[a].name,type:"radiobutton",method:"isUsingColorTable"},c[a]=f};
papaya.ui.Toolbar.prototype.buildOpenMenuItems=function(c){var a,d;for(a=0;a<c.menus.length;a+=1)if("File"===c.menus[a].label){d=c.menus[a].items;break}if(d)for(a=0;a<papayaLoadableImages.length;a+=1)papayaLoadableImages[a].hide||(papayaLoadableImages[a].surface?(c="Add Surface "+papayaLoadableImages[a].nicename,this.menuContains(d,c)||d.splice(2,0,{label:c,action:"OpenSurface-"+papayaLoadableImages[a].name})):(c="Add "+papayaLoadableImages[a].nicename,this.menuContains(d,c)||d.splice(2,0,{label:c,
action:"Open-"+papayaLoadableImages[a].name})))};papaya.ui.Toolbar.prototype.menuContains=function(c,a){var d;if(c)for(d=0;d<c.length;d+=1)if(c[d].label===a)return!0;return!1};
papaya.ui.Toolbar.prototype.buildMenu=function(c,a,d,f,b){var e=null;void 0===b&&(b=!1);c.required&&!0!==papaya.utilities.ObjectUtils.bind(this.container,papaya.utilities.ObjectUtils.dereferenceIn(this.container,c.required))()||(e=new papaya.ui.Menu(this.viewer,c,papaya.utilities.ObjectUtils.bind(this,this.doAction),this.viewer,f),"SPACE"===c.label&&(this.spaceMenu=c),b||(a?e.setMenuButton(a):a=e.buildMenuButton()),(c=c.items)&&this.buildMenuItems(e,c,a,d,f));return e};
papaya.ui.Toolbar.prototype.buildMenuItems=function(c,a,d,f,b){var e,h,g;void 0===b&&(b="");for(e=0;e<a.length;e+=1)a[e].required&&!0!==papaya.utilities.ObjectUtils.bind(this.container,papaya.utilities.ObjectUtils.dereferenceIn(this.container,a[e].required))(parseInt(b))?h=null:"spacer"===a[e].type?h=new papaya.ui.MenuItemSpacer:"radiobutton"===a[e].type?h=new papaya.ui.MenuItemRadioButton(this.viewer,a[e].label,a[e].action,papaya.utilities.ObjectUtils.bind(this,this.doAction),f,a[e].method,b):"checkbox"===
a[e].type?h=new papaya.ui.MenuItemCheckBox(this.viewer,a[e].label,a[e].action,papaya.utilities.ObjectUtils.bind(this,this.doAction),f,a[e].method,b):"file"===a[e].type?a[e].hide||a[e].required&&!0!==papaya.utilities.ObjectUtils.bind(this.container,papaya.utilities.ObjectUtils.dereferenceIn(this.container,a[e].required))(parseInt(b))||(h=new papaya.ui.MenuItemFileChooser(this.viewer,a[e].label,a[e].action,papaya.utilities.ObjectUtils.bind(this,this.doAction),!1,b)):"folder"===a[e].type?h=a[e].hide||
a[e].required&&!0!==papaya.utilities.ObjectUtils.bind(this.container,papaya.utilities.ObjectUtils.dereferenceIn(this.container,a[e].required))(parseInt(b))?null:new papaya.ui.MenuItemFileChooser(this.viewer,a[e].label,a[e].action,papaya.utilities.ObjectUtils.bind(this,this.doAction),!0,b):"displayrange"===a[e].type?h=this.viewer.screenVolumes[b].supportsDynamicColorTable()?new papaya.ui.MenuItemRange(this.viewer,a[e].label,a[e].action,papaya.utilities.ObjectUtils.bind(this,this.doAction),f,a[e].method,
b):null:"range"===a[e].type?papaya.utilities.PlatformUtils.isInputRangeSupported()&&(h=new papaya.ui.MenuItemSlider(this.viewer,a[e].label,a[e].action,papaya.utilities.ObjectUtils.bind(this,this.doAction),f,a[e].method,b)):h=new papaya.ui.MenuItem(this.viewer,a[e].label,a[e].action,papaya.utilities.ObjectUtils.bind(this,this.doAction),f,a[e].method,b),h&&(c.addMenuItem(h),a[e].items&&(g=this.buildMenu(a[e],d,f,b),h.menu=g,h.callback=papaya.utilities.ObjectUtils.bind(g,g.showMenu)))};
papaya.ui.Toolbar.prototype.updateImageButtons=function(){this.container.toolbarHtml.find("."+PAPAYA_MENU_BUTTON_CSS).remove();this.doUpdateImageButtons();this.updateSurfaceButtons()};
papaya.ui.Toolbar.prototype.doUpdateImageButtons=function(){var c,a,d;this.imageMenus=[];if(this.container.showImageButtons)for(a=this.viewer.screenVolumes.length-1;0<=a;--a)d=this.viewer.screenVolumes[a],c=d.icon,c=[{label:"ImageButton",icons:[c],items:null,imageButton:!0}],c[0].items=0===a?d.rgb?papaya.ui.Toolbar.RGB_IMAGE_MENU_DATA.items:d.dti?papaya.ui.Toolbar.DTI_IMAGE_MENU_DATA.items:papaya.ui.Toolbar.BASE_IMAGE_MENU_DATA.items:d.dti?papaya.ui.Toolbar.DTI_IMAGE_MENU_DATA.items:papaya.ui.Toolbar.OVERLAY_IMAGE_MENU_DATA.items,
this.container.combineParametric&&d.parametric||this.imageMenus.push(this.buildMenu(c[0],null,d,a.toString()))};
papaya.ui.Toolbar.prototype.updateSurfaceButtons=function(){var c,a;this.surfaceMenus=[];if(this.container.showImageButtons)for(a=this.viewer.surfaces.length-1;0<=a;--a)c=this.viewer.surfaces[a].solidColor,null===c&&(c=[.5,.5,.5]),c=papaya.viewer.ScreenVolume.makeSolidIcon(c[0],c[1],c[2]),c=[{label:"SurfaceButton",icons:[c],items:papaya.ui.Toolbar.SURFACE_MENU_DATA.items,imageButton:!0,surfaceButton:!0}],this.surfaceMenus.push(this.buildMenu(c[0],null,this.viewer.surfaces[a],a.toString()))};
papaya.ui.Toolbar.prototype.closeAllMenus=function(c){var a;a=this.container.toolbarHtml.find("."+PAPAYA_MENU_CSS);a.hide(100);a.remove();this.container.showControlBar&&(a=this.container.sliderControlHtml.find("."+PAPAYA_MENU_CSS),a.hide(100),a.remove());a=this.container.toolbarHtml.find("."+PAPAYA_DIALOG_CSS);a.hide(100);a.remove();a=this.container.toolbarHtml.find("."+PAPAYA_DIALOG_BACKGROUND);a.hide(100);a.remove();!c&&(c=this.container.viewerHtml.find("."+PAPAYA_MENU_CSS))&&(c.hide(100),c.remove())};
papaya.ui.Toolbar.prototype.isShowingMenus=function(){var c,a;c=this.container.toolbarHtml.find("."+PAPAYA_MENU_CSS).is(":visible");a=this.container.toolbarHtml.find("."+PAPAYA_DIALOG_CSS).is(":visible");return c||a};
papaya.ui.Toolbar.prototype.doAction=function(c,a,d){d||this.closeAllMenus();if(c)if(c.startsWith("ImageButton"))c=parseInt(c.substr(c.length-2,1),10),this.viewer.setCurrentScreenVol(c),this.updateImageButtons();else if(c.startsWith("OpenSurface-"))a=c.substring(c.indexOf("-")+1),this.viewer.loadSurface(a);else if(c.startsWith("Open-"))a=c.substring(c.indexOf("-")+1),this.viewer.loadImage(a);else if("OpenImage"===c)this.container.display.drawProgress(.1,"Loading"),this.viewer.loadImage(a);else if("OpenDTI"===
c)this.container.display.drawProgress(.1,"Loading"),this.viewer.loadingDTI=!0,this.viewer.loadImage(a);else if("OpenSurface"===c)this.container.display.drawProgress(.1,"Loading"),this.viewer.loadSurface(a);else if("OpenFolder"===c){c=[];for(d=0;d<a.length;d+=1)a[d].name.startsWith(".")?console.log("Ignoring file "+a[d].name):c.push(a[d]);this.container.display.drawProgress(.1,"Loading");this.viewer.loadImage(c)}else c.startsWith("ColorTable")?(a=c.substring(c.indexOf("-")+1,c.lastIndexOf("-")),c=
c.substring(c.lastIndexOf("-")+1),this.viewer.screenVolumes[c].changeColorTable(this.viewer,a),this.updateImageButtons()):c.startsWith("CloseAllImages")?papaya.Container.resetViewer(this.container.containerIndex,{}):"Preferences"===c?(a=new papaya.ui.Dialog(this.container,"Viewer Preferences",papaya.ui.Toolbar.PREFERENCES_DATA,this.container.preferences,papaya.utilities.ObjectUtils.bind(this.container.preferences,this.container.preferences.updatePreference),papaya.utilities.ObjectUtils.bind(this,
function(){this.viewer.updateScreenSliceTransforms();this.viewer.drawViewer(!1,!0)})),a.showDialog()):"SurfacePreferences"===c?(a=new papaya.ui.Dialog(this.container,"Surface Preferences",papaya.ui.Toolbar.PREFERENCES_SURFACE_DATA,this.container.preferences,papaya.utilities.ObjectUtils.bind(this.container.preferences,this.container.preferences.updatePreference),papaya.utilities.ObjectUtils.bind(this,function(){this.viewer.updateScreenSliceTransforms();this.viewer.surfaceView.updatePreferences();this.viewer.drawViewer(!1,
!0)})),a.showDialog()):"License"===c?(a=new papaya.ui.Dialog(this.container,"License",papaya.ui.Toolbar.LICENSE_DATA,papaya.Container,null,null,null,!0),a.showDialog()):"KeyboardRef"===c?(a=new papaya.ui.Dialog(this.container,"Keyboard Reference",papaya.ui.Toolbar.KEYBOARD_REF_DATA,papaya.Container,null,null,null,!0),a.showDialog()):"MouseRef"===c?(a=new papaya.ui.Dialog(this.container,"Mouse Reference",papaya.ui.Toolbar.MOUSE_REF_DATA,papaya.Container,null,null,null,!0),a.showDialog()):c.startsWith("ImageInfo")?
(c=c.substring(c.lastIndexOf("-")+1),a=1<this.viewer.screenVolumes[c].volume.numTimepoints?new papaya.ui.Dialog(this.container,"Image Info",papaya.ui.Toolbar.SERIES_INFO_DATA,this.viewer,null,null,c.toString()):new papaya.ui.Dialog(this.container,"Image Info",papaya.ui.Toolbar.IMAGE_INFO_DATA,this.viewer,null,null,c.toString()),a.showDialog()):c.startsWith("SurfaceInfo")?(c=c.substring(c.lastIndexOf("-")+1),a=new papaya.ui.Dialog(this.container,"Surface Info",papaya.ui.Toolbar.SURFACE_INFO_DATA,this.viewer,
null,null,c.toString()),a.showDialog()):c.startsWith("ShowHeader")?(c=c.substring(c.lastIndexOf("-")+1),a=new papaya.ui.Dialog(this.container,"Header",papaya.ui.Toolbar.HEADER_DATA,this.viewer,null,null,c.toString()),a.showDialog()):c.startsWith("SPACE")?(this.viewer.toggleWorldSpace(),this.viewer.drawViewer(!0)):c.startsWith("AtlasChanged")?(a=c.substring(c.lastIndexOf("-")+1),this.viewer.atlas.currentAtlas=a,this.viewer.drawViewer(!0)):c.startsWith("ShowRuler")?("Yes"===this.container.preferences.showRuler?
this.container.preferences.updatePreference("showRuler","No"):this.container.preferences.updatePreference("showRuler","Yes"),this.viewer.drawViewer(),this.closeAllMenus()):c.startsWith("ShowOrientation")?("Yes"===this.container.preferences.showOrientation?this.container.preferences.updatePreference("showOrientation","No"):this.container.preferences.updatePreference("showOrientation","Yes"),this.viewer.drawViewer(),this.closeAllMenus()):c.startsWith("ShowCrosshairs")?("Yes"===this.container.preferences.showCrosshairs?
this.container.preferences.updatePreference("showCrosshairs","No"):this.container.preferences.updatePreference("showCrosshairs","Yes"),this.viewer.drawViewer(),this.closeAllMenus()):c.startsWith("EXPAND")?this.container.collapsable?this.container.collapseViewer():this.container.expandViewer():c.startsWith("OpenInMango")?(c=parseInt(c.substring(c.lastIndexOf("-")+1),10),0===c?this.container.viewer.volume.urls[0]&&papaya.utilities.PlatformUtils.launchCustomProtocol(this.container,papaya.utilities.UrlUtils.getAbsoluteUrl(PAPAYA_CUSTOM_PROTOCOL,
this.container.viewer.volume.urls[0]),this.customProtocolResult):this.container.viewer.screenVolumes[c].volume.urls[0]&&papaya.utilities.PlatformUtils.launchCustomProtocol(this.container,papaya.utilities.UrlUtils.getAbsoluteUrl(PAPAYA_CUSTOM_PROTOCOL,this.container.viewer.screenVolumes[c].volume.urls[0])+"?"+encodeURIComponent("baseimage="+this.container.viewer.volume.fileName+"&params=o"),this.customProtocolResult)):c.startsWith("CloseOverlay")?(c=parseInt(c.substring(c.lastIndexOf("-")+1),10),this.container.viewer.removeOverlay(c)):
c.startsWith("ToggleOverlay")?(c=parseInt(c.substring(c.lastIndexOf("-")+1),10),this.container.viewer.toggleOverlay(c)):c.startsWith("Context-")?this.container.contextManager.actionPerformed(c.substring(8)):c.startsWith("DTI-RGB")?(c=c.substring(c.lastIndexOf("-")+1),this.viewer.screenVolumes[c].dtiLines=!1,this.viewer.screenVolumes[c].dtiColors=!0,this.viewer.screenVolumes[c].initDTI(),this.viewer.drawViewer(!0,!1)):c.startsWith("DTI-LinesColors")?(c=c.substring(c.lastIndexOf("-")+1),this.viewer.screenVolumes[c].dtiLines=
!0,this.viewer.screenVolumes[c].dtiColors=!0,this.viewer.screenVolumes[c].initDTI(),this.viewer.drawViewer(!0,!1)):c.startsWith("DTI-Lines")?(c=c.substring(c.lastIndexOf("-")+1),this.viewer.screenVolumes[c].dtiLines=!0,this.viewer.screenVolumes[c].dtiColors=!1,this.viewer.screenVolumes[c].initDTI(),this.viewer.drawViewer(!0,!1)):c.startsWith("DTI-Mod")?(c=c.substring(c.lastIndexOf("-")+1),this.container.display.drawProgress(.1,"Loading"),this.viewer.loadingDTIModRef=this.viewer.screenVolumes[c],this.viewer.loadImage(a)):
c.startsWith("LoadNegatives")?(c=c.substring(c.lastIndexOf("-")+1),this.viewer.addParametric(c)):c.startsWith("ShowSurfacePlanes")?(this.viewer.surfaceView.showSurfacePlanes=!this.viewer.surfaceView.showSurfacePlanes,this.viewer.surfaceView.updateActivePlanes(),"Yes"===this.container.preferences.showSurfacePlanes?this.container.preferences.updatePreference("showSurfacePlanes","No"):this.container.preferences.updatePreference("showSurfacePlanes","Yes"),this.viewer.drawViewer(!1,!0),this.closeAllMenus()):
c.startsWith("ShowSurfaceCrosshairs")?(this.viewer.surfaceView.showSurfaceCrosshairs=!this.viewer.surfaceView.showSurfaceCrosshairs,this.viewer.surfaceView.updateActivePlanes(),"Yes"===this.container.preferences.showSurfaceCrosshairs?this.container.preferences.updatePreference("showSurfaceCrosshairs","No"):this.container.preferences.updatePreference("showSurfaceCrosshairs","Yes"),this.viewer.drawViewer(!1,!0),this.closeAllMenus()):c.startsWith("rotation")?this.viewer.screenVolumes[0].updateTransform():
c.startsWith("Rotate About")?(this.viewer.screenVolumes[0].rotationAbout=c.substring(0,c.indexOf("-")),this.viewer.screenVolumes[0].updateTransform(),this.viewer.drawViewer(!0,!1)):c.startsWith("ResetTransform")&&(this.viewer.screenVolumes[0].resetTransform(),this.viewer.screenVolumes[0].updateTransform(),this.viewer.drawViewer(!0,!1))};
papaya.ui.Toolbar.prototype.customProtocolResult=function(c){!1===c&&("Chrome"===papaya.utilities.PlatformUtils.browser||"Internet Explorer"===papaya.utilities.PlatformUtils.browser?alert("Mango does not appear to be installed.  You can download Mango at:\n\nhttp://ric.uthscsa.edu/mango"):papaya.utilities.PlatformUtils.ios?confirm("iMango does not appear to be installed.  Would you like to download it now?")&&window.open("http://itunes.apple.com/us/app/imango/id423626092"):confirm("Mango does not appear to be installed.  Would you like to download it now?")&&
window.open("http://ric.uthscsa.edu/mango/mango.html"))};papaya.ui.Toolbar.prototype.updateTitleBar=function(c){var a=this.container.titlebarHtml[0];a&&(a.innerHTML=c);this.container.titlebarHtml.css({top:this.container.viewerHtml.position().top-1.25*papaya.ui.Toolbar.SIZE})};papaya.ui.Toolbar.prototype.showImageMenu=function(c){this.viewer.screenVolumes[c].resetDynamicRange();this.imageMenus[c].showMenu()};
papaya.ui.Toolbar.prototype.updateImageMenuRange=function(c,a,d){this.imageMenus[c].updateRangeItem(a,d)};"use strict";papaya=papaya||{};papaya.viewer=papaya.viewer||{};
papaya.viewer.Atlas=papaya.viewer.Atlas||function(c,a,d){this.container=a;this.callback=d;this.transformedname=this.name=null;this.labels=[];this.atlasLabelData=c.labels;this.volume=new papaya.volume.Volume(a.display,a.viewer);this.currentAtlas=this.transform=this.returnLabels=this.displayColumns=null;this.maxLabels=0;this.probabilistic=!1;c=a.findLoadableImage(c.labels.atlas.header.images.summaryimagefile);a.params.atlasURL?this.volume.readURLs([a.params.atlasURL],papaya.utilities.ObjectUtils.bind(this,
this.readFinished)):null!==c&&void 0!==c.encode?this.volume.readEncodedData([c.encode],papaya.utilities.ObjectUtils.bind(this,this.readFinished)):null!==c&&void 0!==c.url&&this.volume.readURLs([c.url],papaya.utilities.ObjectUtils.bind(this,this.readFinished))};papaya.viewer.Atlas.MAX_LABELS=4;papaya.viewer.Atlas.PROBABILISTIC=["probabalistic","probabilistic","statistic"];papaya.viewer.Atlas.LABEL_SPLIT_REGEX=/\.|:|,|\//;
papaya.viewer.Atlas.prototype.getLabelAtCoordinate=function(c,a,d){var f,b;this.transform&&this.currentAtlas===this.transformedname?(f=c*this.transform[0][0]+a*this.transform[0][1]+d*this.transform[0][2]+this.transform[0][3],b=c*this.transform[1][0]+a*this.transform[1][1]+d*this.transform[1][2]+this.transform[1][3],c=c*this.transform[2][0]+a*this.transform[2][1]+d*this.transform[2][2]+this.transform[2][3]):(f=c,b=a,c=d);f=this.volume.getVoxelAtCoordinate(f,b,c,0,!0);this.probabilistic&&--f;return this.formatLabels(this.labels[f],
this.returnLabels)};
papaya.viewer.Atlas.prototype.readFinished=function(){this.parseTransform();this.parseLabels();this.parseDisplayColumns();this.maxLabels=this.findMaxLabelParts();this.probabilistic=this.atlasLabelData.atlas.header.type&&(this.atlasLabelData.atlas.header.type.toLowerCase()===papaya.viewer.Atlas.PROBABILISTIC[0]||this.atlasLabelData.atlas.header.type.toLowerCase()===papaya.viewer.Atlas.PROBABILISTIC[1]||this.atlasLabelData.atlas.header.type.toLowerCase()===papaya.viewer.Atlas.PROBABILISTIC[2]);this.returnLabels=
[];this.returnLabels.length=this.maxLabels;this.atlasLabelData.atlas.header.transformedname&&(this.transformedname=this.atlasLabelData.atlas.header.transformedname);this.currentAtlas=this.name=this.atlasLabelData.atlas.header.name;var c=this.container.params.atlas;c&&c===this.transformedname&&(this.currentAtlas=this.transformedname);this.callback()};
papaya.viewer.Atlas.prototype.parseDisplayColumns=function(){var c,a,d;if(this.atlasLabelData.atlas.header.display)for(this.displayColumns=[],c=0,a=this.atlasLabelData.atlas.header.display.split(papaya.viewer.Atlas.LABEL_SPLIT_REGEX),d=0;d<a.length;d+=1)"*"===a[d]&&(this.displayColumns[c]=d,c+=1)};
papaya.viewer.Atlas.prototype.parseTransform=function(){var c,a,d;if(this.atlasLabelData.atlas.header.transform&&(c=this.atlasLabelData.atlas.header.transform.split(" "),this.transform=papaya.volume.Transform.IDENTITY.clone(),16===c.length))for(a=0;4>a;a+=1)for(d=0;4>d;d+=1)this.transform[a][d]=parseFloat(c[4*a+d])};
papaya.viewer.Atlas.prototype.parseLabels=function(){var c,a,d;for(c=0;c<this.atlasLabelData.atlas.data.label.length;c+=1)d=this.atlasLabelData.atlas.data.label[c],a=d.index?parseInt(d.index,10):c,this.labels[a]=d.content?d.content:d};
papaya.viewer.Atlas.prototype.formatLabels=function(c,a){var d,f,b;if(c)if(f=c.split(papaya.viewer.Atlas.LABEL_SPLIT_REGEX),this.displayColumns)for(d=0;d<f.length;d+=1)d<this.displayColumns.length&&(a[d]=f[this.displayColumns[d]]);else for(b=f.length,d=0,b>papaya.viewer.Atlas.MAX_LABELS&&(d=b-papaya.viewer.Atlas.MAX_LABELS);d<f.length;d+=1)a[d]=f[d].trim();else for(d=0;d<a.length;d+=1)a[d]="";return a};
papaya.viewer.Atlas.prototype.findMaxLabelParts=function(){var c,a;if(this.displayColumns)return this.displayColumns.length;a=[];for(c=0;c<this.labels.length;c+=1)this.formatLabels(this.labels[c],a);return a.length};"use strict";papaya=papaya||{};papaya.viewer=papaya.viewer||{};
papaya.viewer.ColorTable=papaya.viewer.ColorTable||function(c,a,d){var f=null,f=void 0!==d?d:papaya.viewer.ColorTable.findLUT(c);this.lutData=f.data;this.minLUT=this.maxLUT=0;this.knotThresholds=[];this.knotRangeRatios=[];this.LUTarrayG=Array(256);this.LUTarrayR=Array(256);this.LUTarrayB=Array(256);this.isBaseImage=a;this.knotMin=this.lutData[0];this.knotMax=this.lutData[this.lutData.length-1];this.useGradation="undefined"===typeof f.gradation||f.gradation;this.updateLUT(papaya.viewer.ColorTable.LUT_MIN,
papaya.viewer.ColorTable.LUT_MAX)};papaya.viewer.ColorTable.TABLE_GRAYSCALE={name:"Grayscale",data:[[0,0,0,0],[1,1,1,1]],gradation:!0};papaya.viewer.ColorTable.TABLE_SPECTRUM={name:"Spectrum",data:[[0,0,0,0],[.1,0,0,1],[.33,0,1,1],[.5,0,1,0],[.66,1,1,0],[.9,1,0,0],[1,1,1,1]],gradation:!0};papaya.viewer.ColorTable.TABLE_RED2YELLOW={name:"Overlay (Positives)",data:[[0,1,0,0],[1,1,1,0]],gradation:!0};papaya.viewer.ColorTable.TABLE_BLUE2GREEN={name:"Overlay (Negatives)",data:[[0,0,0,1],[1,0,1,0]],gradation:!0};
papaya.viewer.ColorTable.TABLE_HOTANDCOLD={name:"Hot-and-Cold",data:[[0,0,0,1],[.15,0,1,1],[.3,0,1,0],[.45,0,0,0],[.5,0,0,0],[.55,0,0,0],[.7,1,1,0],[.85,1,0,0],[1,1,1,1]],gradation:!0};papaya.viewer.ColorTable.TABLE_GOLD={name:"Gold",data:[[0,0,0,0],[.13,.19,.03,0],[.25,.39,.12,0],[.38,.59,.26,0],[.5,.8,.46,.08],[.63,.99,.71,.21],[.75,.99,.88,.34],[.88,.99,.99,.48],[1,.9,.95,.61]],gradation:!0};
papaya.viewer.ColorTable.TABLE_RED2WHITE={name:"Red Overlay",data:[[0,.75,0,0],[.5,1,.5,0],[.95,1,1,0],[1,1,1,1]],gradation:!0};papaya.viewer.ColorTable.TABLE_GREEN2WHITE={name:"Green Overlay",data:[[0,0,.75,0],[.5,.5,1,0],[.95,1,1,0],[1,1,1,1]],gradation:!0};papaya.viewer.ColorTable.TABLE_BLUE2WHITE={name:"Blue Overlay",data:[[0,0,0,1],[.5,0,.5,1],[.95,0,1,1],[1,1,1,1]],gradation:!0};papaya.viewer.ColorTable.TABLE_DTI_SPECTRUM={name:"Spectrum",data:[[0,1,0,0],[.5,0,1,0],[1,0,0,1]],gradation:!0};
papaya.viewer.ColorTable.TABLE_FIRE={name:"Fire",data:[[0,0,0,0],[.06,0,0,.36],[.16,.29,0,.75],[.22,.48,0,.89],[.31,.68,0,.6],[.37,.76,0,.36],[.5,.94,.31,0],[.56,1,.45,0],[.81,1,.91,0],[.88,1,1,.38],[1,1,1,1]],gradation:!0};papaya.viewer.ColorTable.ARROW_ICON="data:image/gif;base64,R0lGODlhCwARAPfGMf//////zP//mf//Zv//M///AP/M///MzP/Mmf/MZv/MM//MAP+Z//+ZzP+Zmf+ZZv+ZM/+ZAP9m//9mzP9mmf9mZv9mM/9mAP8z//8zzP8zmf8zZv8zM/8zAP8A//8AzP8Amf8AZv8AM/8AAMz//8z/zMz/mcz/Zsz/M8z/AMzM/8zMzMzMmczMZszMM8zMAMyZ/8yZzMyZmcyZZsyZM8yZAMxm/8xmzMxmmcxmZsxmM8xmAMwz/8wzzMwzmcwzZswzM8wzAMwA/8wAzMwAmcwAZswAM8wAAJn//5n/zJn/mZn/Zpn/M5n/AJnM/5nMzJnMmZnMZpnMM5nMAJmZ/5mZzJmZmZmZZpmZM5mZAJlm/5lmzJlmmZlmZplmM5lmAJkz/5kzzJkzmZkzZpkzM5kzAJkA/5kAzJkAmZkAZpkAM5kAAGb//2b/zGb/mWb/Zmb/M2b/AGbM/2bMzGbMmWbMZmbMM2bMAGaZ/2aZzGaZmWaZZmaZM2aZAGZm/2ZmzGZmmWZmZmZmM2ZmAGYz/2YzzGYzmWYzZmYzM2YzAGYA/2YAzGYAmWYAZmYAM2YAADP//zP/zDP/mTP/ZjP/MzP/ADPM/zPMzDPMmTPMZjPMMzPMADOZ/zOZzDOZmTOZZjOZMzOZADNm/zNmzDNmmTNmZjNmMzNmADMz/zMzzDMzmTMzZjMzMzMzADMA/zMAzDMAmTMAZjMAMzMAAAD//wD/zAD/mQD/ZgD/MwD/AADM/wDMzADMmQDMZgDMMwDMAACZ/wCZzACZmQCZZgCZMwCZAABm/wBmzABmmQBmZgBmMwBmAAAz/wAzzAAzmQAzZgAzMwAzAAAA/wAAzAAAmQAAZgAAM+4AAN0AALsAAKoAAIgAAHcAAFUAAEQAACIAABEAAADuAADdAAC7AACqAACIAAB3AABVAABEAAAiAAARAAAA7gAA3QAAuwAAqgAAiAAAdwAAVQAARAAAIgAAEe7u7t3d3bu7u6qqqoiIiHd3d1VVVURERCIiIhEREQAAACH5BAEAAMYALAAAAAALABEAAAg/AI0JFGhvoEGC+vodRKgv4UF7DSMqZBixoUKIFSv2w5jRIseOGztK/JgxpMiEJDWmHHkSZUuTIvvt60ezps2AADs=";
papaya.viewer.ColorTable.ARROW_ICON_WIDTH=11;papaya.viewer.ColorTable.DEFAULT_COLOR_TABLE=papaya.viewer.ColorTable.TABLE_GRAYSCALE;papaya.viewer.ColorTable.PARAMETRIC_COLOR_TABLES=[papaya.viewer.ColorTable.TABLE_RED2YELLOW,papaya.viewer.ColorTable.TABLE_BLUE2GREEN];papaya.viewer.ColorTable.OVERLAY_COLOR_TABLES=[papaya.viewer.ColorTable.TABLE_RED2WHITE,papaya.viewer.ColorTable.TABLE_GREEN2WHITE,papaya.viewer.ColorTable.TABLE_BLUE2WHITE];
papaya.viewer.ColorTable.TABLE_ALL=[papaya.viewer.ColorTable.TABLE_GRAYSCALE,papaya.viewer.ColorTable.TABLE_SPECTRUM,papaya.viewer.ColorTable.TABLE_FIRE,papaya.viewer.ColorTable.TABLE_HOTANDCOLD,papaya.viewer.ColorTable.TABLE_GOLD,papaya.viewer.ColorTable.TABLE_RED2YELLOW,papaya.viewer.ColorTable.TABLE_BLUE2GREEN,papaya.viewer.ColorTable.TABLE_RED2WHITE,papaya.viewer.ColorTable.TABLE_GREEN2WHITE,papaya.viewer.ColorTable.TABLE_BLUE2WHITE];papaya.viewer.ColorTable.LUT_MIN=0;
papaya.viewer.ColorTable.LUT_MAX=255;papaya.viewer.ColorTable.ICON_SIZE=18;papaya.viewer.ColorTable.COLOR_BAR_WIDTH=100;papaya.viewer.ColorTable.COLOR_BAR_HEIGHT=15;papaya.viewer.ColorTable.findLUT=function(c){var a;for(a=0;a<papaya.viewer.ColorTable.TABLE_ALL.length;a+=1)if(papaya.viewer.ColorTable.TABLE_ALL[a].name==c)return papaya.viewer.ColorTable.TABLE_ALL[a];return papaya.viewer.ColorTable.TABLE_GRAYSCALE};
papaya.viewer.ColorTable.addCustomLUT=function(c){papaya.viewer.ColorTable.findLUT(c.name).data===papaya.viewer.ColorTable.TABLE_GRAYSCALE.data&&papaya.viewer.ColorTable.TABLE_ALL.push(c)};papaya.viewer.ColorTable.prototype.updateMinLUT=function(c){this.updateLUT(c,this.maxLUT)};papaya.viewer.ColorTable.prototype.updateMaxLUT=function(c){this.updateLUT(this.minLUT,c)};
papaya.viewer.ColorTable.prototype.updateLUT=function(c,a){var d,f,b;this.maxLUT=a;this.minLUT=c;d=this.maxLUT-this.minLUT;for(f=0;f<this.lutData.length;f+=1)this.knotThresholds[f]=this.lutData[f][0]*d+this.minLUT;for(f=0;f<this.lutData.length-1;f+=1)this.knotRangeRatios[f]=papaya.viewer.ColorTable.LUT_MAX/(this.knotThresholds[f+1]-this.knotThresholds[f]);for(f=0;256>f;f+=1)if(f<=this.minLUT)this.LUTarrayR[f]=this.knotMin[1]*papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayG[f]=this.knotMin[2]*papaya.viewer.ColorTable.LUT_MAX,
this.LUTarrayB[f]=this.knotMin[3]*papaya.viewer.ColorTable.LUT_MAX;else if(f>this.maxLUT)this.LUTarrayR[f]=this.knotMax[1]*papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayG[f]=this.knotMax[2]*papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayB[f]=this.knotMax[3]*papaya.viewer.ColorTable.LUT_MAX;else for(d=0;d<this.lutData.length-1;d+=1)f>this.knotThresholds[d]&&f<=this.knotThresholds[d+1]&&(this.useGradation?(b=((f-this.knotThresholds[d])*this.knotRangeRatios[d]+.5)/papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayR[f]=
((1-b)*this.lutData[d][1]+b*this.lutData[d+1][1])*papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayG[f]=((1-b)*this.lutData[d][2]+b*this.lutData[d+1][2])*papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayB[f]=((1-b)*this.lutData[d][3]+b*this.lutData[d+1][3])*papaya.viewer.ColorTable.LUT_MAX):(this.LUTarrayR[f]=this.lutData[d][1]*papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayG[f]=this.lutData[d][2]*papaya.viewer.ColorTable.LUT_MAX,this.LUTarrayB[f]=this.lutData[d][3]*papaya.viewer.ColorTable.LUT_MAX))};
papaya.viewer.ColorTable.prototype.lookupRed=function(c){return 0<=c&&256>c?this.LUTarrayR[c]&255:0};papaya.viewer.ColorTable.prototype.lookupGreen=function(c){return 0<=c&&256>c?this.LUTarrayG[c]&255:0};papaya.viewer.ColorTable.prototype.lookupBlue=function(c){return 0<=c&&256>c?this.LUTarrayB[c]&255:0};"use strict";papaya=papaya||{};papaya.viewer=papaya.viewer||{};
papaya.viewer.Display=papaya.viewer.Display||function(c,a){this.container=c;this.viewer=c.viewer;this.canvas=document.createElement("canvas");this.canvas.width=a;this.canvas.height=papaya.viewer.Display.SIZE;this.context=this.canvas.getContext("2d");this.canvas.style.padding=0;this.canvas.style.margin=0;this.canvas.style.border="none";this.canvas.style.cursor="default";this.tempCoord=new papaya.core.Coordinate(0,0,0);this.drawingError=!1;this.progressStartTime=this.progress=0;this.progressTimeout=
null;this.drawingProgress=!1;this.errorMessage="";this.drawUninitializedDisplay()};papaya.viewer.Display.SIZE=50;papaya.viewer.Display.MINI_LABELS_THRESH=700;papaya.viewer.Display.PADDING=8;papaya.viewer.Display.FONT_COLOR_WHITE="white";papaya.viewer.Display.FONT_COLOR_ORANGE="rgb(182, 59, 0)";papaya.viewer.Display.FONT_SIZE_COORDINATE_LABEL=12;papaya.viewer.Display.FONT_COLOR_COORDINATE_LABEL=papaya.viewer.Display.FONT_COLOR_WHITE;papaya.viewer.Display.FONT_TYPE_COORDINATE_LABEL="sans-serif";
papaya.viewer.Display.FONT_SIZE_COORDINATE_VALUE=18;papaya.viewer.Display.FONT_COLOR_COORDINATE_VALUE=papaya.viewer.Display.FONT_COLOR_ORANGE;papaya.viewer.Display.FONT_TYPE_COORDINATE_VALUE="sans-serif";papaya.viewer.Display.PRECISION_COORDINATE_VALUE=5;papaya.viewer.Display.PRECISION_COORDINATE_MAX=12;papaya.viewer.Display.FONT_SIZE_IMAGE_VALUE=20;papaya.viewer.Display.FONT_COLOR_IMAGE_VALUE=papaya.viewer.Display.FONT_COLOR_WHITE;papaya.viewer.Display.FONT_TYPE_IMAGE_VALUE="sans-serif";
papaya.viewer.Display.PRECISION_IMAGE_VALUE=9;papaya.viewer.Display.PRECISION_IMAGE_MAX=14;papaya.viewer.Display.FONT_SIZE_ATLAS_MINI=14;papaya.viewer.Display.FONT_SIZE_ATLAS=20;papaya.viewer.Display.FONT_TYPE_ATLAS="sans-serif";papaya.viewer.Display.FONT_SIZE_MESSAGE_VALUE=20;papaya.viewer.Display.FONT_TYPE_MESSAGE_VALUE="sans-serif";papaya.viewer.Display.FONT_COLOR_MESSAGE="rgb(200, 75, 25)";papaya.viewer.Display.PROGRESS_LABEL_SUFFIX=["...","",".",".."];
papaya.viewer.Display.PROGRESS_LABEL_DEFAULT="Loading";papaya.viewer.Display.prototype.drawUninitializedDisplay=function(){this.context.fillStyle="#000000";this.context.fillRect(0,0,this.canvas.width,this.canvas.height)};papaya.viewer.Display.prototype.canDraw=function(){return!(this.drawingError||this.drawingProgress)};
papaya.viewer.Display.prototype.drawEmptyDisplay=function(){this.canDraw()?(this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle="#000000",this.context.fillRect(0,0,this.canvas.width,this.canvas.height)):this.drawError&&this.drawError(this.errorMessage)};
papaya.viewer.Display.prototype.drawDisplay=function(c,a,d){var f,b,e,h,g,k,l,q,t;if(this.canDraw()){if(h=this.viewer.canvas.width/600,q=this.viewer.canvas.width/2,g=q/5,e=this.canvas.height,t=300>q,"Mouse"!==this.container.preferences.atlasLocks&&(c=this.viewer.currentCoord.x,a=this.viewer.currentCoord.y,d=this.viewer.currentCoord.z),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle="#000000",this.context.fillRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle=
papaya.viewer.Display.FONT_COLOR_COORDINATE_LABEL,this.context.font=papaya.viewer.Display.FONT_SIZE_COORDINATE_LABEL+"px "+papaya.viewer.Display.FONT_TYPE_COORDINATE_LABEL,f=papaya.viewer.Display.FONT_SIZE_COORDINATE_LABEL+.75*papaya.viewer.Display.PADDING,this.context.fillText("x",1.5*papaya.viewer.Display.PADDING,f),this.context.fillText("y",1.5*papaya.viewer.Display.PADDING+g,f),this.context.fillText("z",1.5*papaya.viewer.Display.PADDING+2*g,f),f+=papaya.viewer.Display.FONT_SIZE_COORDINATE_VALUE+
papaya.viewer.Display.PADDING/2,this.context.fillStyle=papaya.viewer.Display.FONT_COLOR_COORDINATE_VALUE,this.context.font=papaya.viewer.Display.FONT_SIZE_COORDINATE_VALUE-(t?2:0)+"px "+papaya.viewer.Display.FONT_TYPE_COORDINATE_VALUE,this.viewer.worldSpace?(b=this.viewer.screenVolumes[0].volume.header.origin,k=this.viewer.screenVolumes[0].volume.header.voxelDimensions,l=Math.min(papaya.viewer.Display.PRECISION_COORDINATE_MAX,Math.round(papaya.viewer.Display.PRECISION_COORDINATE_VALUE*h)),this.context.fillText(parseFloat(((c-
b.x)*k.xSize).toString().substr(0,l)),1.5*papaya.viewer.Display.PADDING,f),this.context.fillText(parseFloat(((b.y-a)*k.ySize).toString().substr(0,l)),1.5*papaya.viewer.Display.PADDING+g,f),this.context.fillText(parseFloat(((b.z-d)*k.zSize).toString().substr(0,l)),1.5*papaya.viewer.Display.PADDING+2*g,f)):(this.context.fillText(Math.round(c).toString(),1.5*papaya.viewer.Display.PADDING,f),this.context.fillText(Math.round(a).toString(),1.5*papaya.viewer.Display.PADDING+g,f),this.context.fillText(Math.round(d).toString(),
1.5*papaya.viewer.Display.PADDING+2*g,f)),this.viewer.currentScreenVolume.rgb||this.viewer.currentScreenVolume.dti||(b=this.viewer.getCurrentValueAt(c,a,d),this.canvas.currentval=b.toString(),f=e/2+papaya.viewer.Display.FONT_SIZE_IMAGE_VALUE/2-papaya.viewer.Display.PADDING/2,this.context.fillStyle=papaya.viewer.Display.FONT_COLOR_IMAGE_VALUE,this.context.font=papaya.viewer.Display.FONT_SIZE_IMAGE_VALUE-(t?2:0)+"px "+papaya.viewer.Display.FONT_TYPE_IMAGE_VALUE,l=Math.min(papaya.viewer.Display.PRECISION_IMAGE_MAX,
Math.round(papaya.viewer.Display.PRECISION_IMAGE_VALUE*h)),this.context.fillText(parseFloat(b.toString().substr(0,l)),2*papaya.viewer.Display.PADDING+3*g,f)),this.viewer.atlas&&this.viewer.atlas.volume.isLoaded)if(this.viewer.getWorldCoordinateAtIndex(c,a,d,this.tempCoord),d=this.viewer.atlas.getLabelAtCoordinate(this.tempCoord.x,this.tempCoord.y,this.tempCoord.z),c=d.length,l=Math.ceil(this.viewer.atlas.maxLabels/2),300>q&&2<=c)for(a=.75*q,h=c-1;0<=h;--h)this.context.fillStyle=h===c-2?papaya.viewer.Display.FONT_COLOR_ORANGE:
papaya.viewer.Display.FONT_COLOR_WHITE,this.context.font=papaya.viewer.Display.FONT_SIZE_ATLAS_MINI+"px "+papaya.viewer.Display.FONT_TYPE_ATLAS,g=this.context.measureText(d[h]),g.width>a-2*papaya.viewer.Display.PADDING&&(d[h]=d[h].substr(0,Math.round(d[h].length/3))+" ... "+d[h].substr(d[h].length-3,3)),h===c-2?this.context.fillText(d[h],q+.25*q,1.5*papaya.viewer.Display.PADDING+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2):h===c-1&&this.context.fillText(d[h],q+.25*q,papaya.viewer.Display.PADDING+
e/2+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2);else if(600>q&&2<c)for(a=q/2,h=c-1;0<=h;--h)this.context.fillStyle=h<l?papaya.viewer.Display.FONT_COLOR_ORANGE:papaya.viewer.Display.FONT_COLOR_WHITE,this.context.font=papaya.viewer.Display.FONT_SIZE_ATLAS_MINI+"px "+papaya.viewer.Display.FONT_TYPE_ATLAS,g=this.context.measureText(d[h]),g.width>a-6*papaya.viewer.Display.PADDING&&(d[h]=d[h].substr(0,Math.round(d[h].length/3))+" ... "+d[h].substr(d[h].length-3,3)),0===h?this.context.fillText(d[h],q+
5*papaya.viewer.Display.PADDING,1.5*papaya.viewer.Display.PADDING+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2):1===h?this.context.fillText(d[h],q+5*papaya.viewer.Display.PADDING,papaya.viewer.Display.PADDING+e/2+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2):2===h?this.context.fillText(d[h],1.5*q+5*papaya.viewer.Display.PADDING,1.5*papaya.viewer.Display.PADDING+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2):3===h&&this.context.fillText(d[h],1.5*q+5*papaya.viewer.Display.PADDING,papaya.viewer.Display.PADDING+
e/2+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2);else if(800>q&&3<c)for(a=q/3,h=0;4>h;h+=1)2>h?(this.context.fillStyle=h<l?papaya.viewer.Display.FONT_COLOR_ORANGE:papaya.viewer.Display.FONT_COLOR_WHITE,this.context.font=papaya.viewer.Display.FONT_SIZE_ATLAS_MINI+"px "+papaya.viewer.Display.FONT_TYPE_ATLAS,g=this.context.measureText(d[h]),g.width>a-6*papaya.viewer.Display.PADDING&&(d[h]=d[h].substr(0,Math.round(d[h].length/3))+" ... "+d[h].substr(d[h].length-3,3)),0===h?this.context.fillText(d[h],
q+5*papaya.viewer.Display.PADDING,1.5*papaya.viewer.Display.PADDING+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2):1===h?this.context.fillText(d[h],q+5*papaya.viewer.Display.PADDING,papaya.viewer.Display.PADDING+e/2+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2):2===h?this.context.fillText(d[h],1.5*q+5*papaya.viewer.Display.PADDING,1.5*papaya.viewer.Display.PADDING+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2):3===h&&this.context.fillText(d[h],1.5*q+5*papaya.viewer.Display.PADDING,papaya.viewer.Display.PADDING+
e/2+papaya.viewer.Display.FONT_SIZE_ATLAS_MINI/2)):(f=e/2+papaya.viewer.Display.FONT_SIZE_ATLAS/2-papaya.viewer.Display.PADDING/2,this.context.fillStyle=h<l?papaya.viewer.Display.FONT_COLOR_ORANGE:papaya.viewer.Display.FONT_COLOR_WHITE,this.context.font=papaya.viewer.Display.FONT_SIZE_ATLAS+"px "+papaya.viewer.Display.FONT_TYPE_ATLAS,g=this.context.measureText(d[h]),g.width>a-2*papaya.viewer.Display.PADDING&&(d[h]=d[h].substr(0,Math.round(d[h].length/3))+" ... "+d[h].substr(d[h].length-3,3)),2===
h?this.context.fillText(d[h],q+papaya.viewer.Display.PADDING+a,f):3===h&&this.context.fillText(d[h],q+papaya.viewer.Display.PADDING+2*a,f));else for(a=q/c,f=e/2+papaya.viewer.Display.FONT_SIZE_ATLAS/2-papaya.viewer.Display.PADDING/2,h=0;h<c;h+=1)this.context.fillStyle=h<l?papaya.viewer.Display.FONT_COLOR_ORANGE:papaya.viewer.Display.FONT_COLOR_WHITE,this.context.font=papaya.viewer.Display.FONT_SIZE_ATLAS-(t?4:0)+"px "+papaya.viewer.Display.FONT_TYPE_ATLAS,g=this.context.measureText(d[h]),g.width>
a-2*papaya.viewer.Display.PADDING-.05*q*Math.max(0,3-c)&&(d[h]=d[h].substr(0,Math.round(d[h].length/3))+" ... "+d[h].substr(d[h].length-3,3)),this.context.fillText(d[h],q+papaya.viewer.Display.PADDING+.05*q*Math.max(0,3-c)+h*a,f)}else this.drawError&&this.drawError(this.errorMessage)};
papaya.viewer.Display.prototype.drawError=function(c){var a;this.errorMessage=c;this.drawingError=!0;a=this;window.setTimeout(papaya.utilities.ObjectUtils.bind(a,function(){a.drawingError=!1}),3E3);this.context.clearRect(0,0,this.canvas.width,this.canvas.height);this.context.fillStyle="#000000";this.context.fillRect(0,0,this.canvas.width,this.canvas.height);this.context.fillStyle="red";this.context.font=papaya.viewer.Display.FONT_SIZE_MESSAGE_VALUE+"px "+papaya.viewer.Display.FONT_TYPE_MESSAGE_VALUE;
this.context.fillText(c,papaya.viewer.Display.PADDING,papaya.viewer.Display.FONT_SIZE_COORDINATE_LABEL+papaya.viewer.Display.PADDING+1.5*papaya.viewer.Display.PADDING)};
papaya.viewer.Display.prototype.drawProgress=function(c,a){var d,f,b,e;d=Math.round(1E3*c);d>this.progress&&(this.progress=d,d=void 0!==a?a:papaya.viewer.Display.PROGRESS_LABEL_DEFAULT,b=0===this.progressStartTime?this.progressStartTime=(new Date).getTime():(new Date).getTime(),b=parseInt((b-this.progressStartTime)/500,10)%4,990<=this.progress?(this.progressTimeout&&(window.clearTimeout(this.progressTimeout),this.progressTimeout=null),this.drawingProgress=!1,this.progressStartTime=this.progress=0,
this.drawEmptyDisplay()):(this.progressTimeout&&window.clearTimeout(this.progressTimeout),f=this,this.progressTimeout=window.setTimeout(papaya.utilities.ObjectUtils.bind(f,function(){f.drawingProgress=!1}),3E3),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle="#fff",this.context.fillRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle="#000",this.context.fillRect(0,0,this.canvas.width*c,this.canvas.height),this.context.font=papaya.viewer.Display.FONT_SIZE_MESSAGE_VALUE+
"px "+papaya.viewer.Display.FONT_TYPE_MESSAGE_VALUE,this.context.fillStyle=papaya.viewer.Display.FONT_COLOR_MESSAGE,e=papaya.viewer.Display.FONT_SIZE_COORDINATE_LABEL+papaya.viewer.Display.PADDING+1.5*papaya.viewer.Display.PADDING,this.context.fillText(d+papaya.viewer.Display.PROGRESS_LABEL_SUFFIX[b],2*papaya.viewer.Display.PADDING,e)))};"use strict";papaya=papaya||{};papaya.volume=papaya.volume||{};
papaya.viewer.Preferences=papaya.viewer.Preferences||function(){this.viewer=null;this.showCrosshairs=papaya.viewer.Preferences.DEFAULT_SHOW_CROSSHAIRS;this.atlasLocks=papaya.viewer.Preferences.DEFAULT_ATLAS_LOCKS;this.showOrientation=papaya.viewer.Preferences.DEFAULT_SHOW_ORIENTATION;this.scrollBehavior=papaya.viewer.Preferences.DEFAULT_SCROLL;this.smoothDisplay=papaya.viewer.Preferences.DEFAULT_SMOOTH_DISPLAY;this.radiological=papaya.viewer.Preferences.DEFAULT_RADIOLOGICAL;this.showRuler=papaya.viewer.Preferences.DEFAULT_SHOW_RULER;
this.surfaceBackgroundColor=papaya.viewer.Preferences.DEFAULT_SURFACE_BACKGROUND_COLOR;this.showSurfacePlanes=papaya.viewer.Preferences.DEFAULT_SHOW_SURFACE_PLANES;this.showSurfaceCrosshairs=papaya.viewer.Preferences.DEFAULT_SHOW_SURFACE_CROSSHAIRS};papaya.viewer.Preferences.ALL_PREFS="showCrosshairs atlasLocks showOrientation scrollBehavior smoothDisplay radiological showRuler surfaceBackgroundColor showSurfacePlanes".split(" ");papaya.viewer.Preferences.COOKIE_PREFIX="papaya-";
papaya.viewer.Preferences.COOKIE_EXPIRY_DAYS=365;papaya.viewer.Preferences.DEFAULT_SHOW_CROSSHAIRS="Yes";papaya.viewer.Preferences.DEFAULT_ATLAS_LOCKS="Mouse";papaya.viewer.Preferences.DEFAULT_SHOW_ORIENTATION="No";papaya.viewer.Preferences.DEFAULT_SCROLL="Increment Slice";papaya.viewer.Preferences.DEFAULT_SMOOTH_DISPLAY="Yes";papaya.viewer.Preferences.DEFAULT_RADIOLOGICAL="No";papaya.viewer.Preferences.DEFAULT_SHOW_RULER="No";papaya.viewer.Preferences.DEFAULT_SURFACE_BACKGROUND_COLOR="Gray";
papaya.viewer.Preferences.DEFAULT_SHOW_SURFACE_PLANES="Yes";papaya.viewer.Preferences.prototype.updatePreference=function(c,a){this[c]=a;this.viewer.drawViewer(!0);papaya.utilities.UrlUtils.createCookie(papaya.viewer.Preferences.COOKIE_PREFIX+c,a,papaya.viewer.Preferences.COOKIE_EXPIRY_DAYS)};
papaya.viewer.Preferences.prototype.readPreferences=function(){var c,a;for(c=0;c<papaya.viewer.Preferences.ALL_PREFS.length;c+=1)(a=papaya.utilities.UrlUtils.readCookie(papaya.viewer.Preferences.COOKIE_PREFIX+papaya.viewer.Preferences.ALL_PREFS[c]))&&(this[papaya.viewer.Preferences.ALL_PREFS[c]]=a)};"use strict";papaya=papaya||{};papaya.viewer=papaya.viewer||{};
papaya.viewer.ScreenSlice=papaya.viewer.ScreenSlice||function(c,a,d,f,b,e,h,g){this.screenVolumes=h;this.sliceDirection=a;this.currentSlice=-1;this.xDim=d;this.yDim=f;this.xSize=b;this.ySize=e;this.canvasMain=document.createElement("canvas");this.canvasMain.width=this.xDim;this.canvasMain.height=this.yDim;this.contextMain=this.canvasMain.getContext("2d");this.imageDataDraw=this.contextMain.createImageData(this.xDim,this.yDim);this.screenDim=this.screenOffsetY=this.screenOffsetX=0;this.screenTransform=
[[1,0,0],[0,1,0],[0,0,1]];this.zoomTransform=[[1,0,0],[0,1,0],[0,0,1]];this.finalTransform=[[1,0,0],[0,1,0],[0,0,1]];this.radiologicalTransform=[[-1,0,this.xDim],[0,1,0],[0,0,1]];this.tempTransform=[[1,0,0],[0,1,0],[0,0,1]];this.tempTransform2=[[1,0,0],[0,1,0],[0,0,1]];this.screenTransform2=[[1,0,0],[0,1,0],[0,0,1]];this.finalTransform2=[[1,0,0],[0,1,0],[0,0,1]];this.imageData=[];this.imageData2=[];this.manager=g;this.rulerPoints=[new papaya.core.Point(parseInt(.25*d),parseInt(.25*f)),new papaya.core.Point(parseInt(.75*
d),parseInt(.75*f))];this.tempPoint=new papaya.core.Point;this.contextDTILines=this.canvasDTILines=null};papaya.viewer.ScreenSlice.DIRECTION_UNKNOWN=0;papaya.viewer.ScreenSlice.DIRECTION_AXIAL=1;papaya.viewer.ScreenSlice.DIRECTION_CORONAL=2;papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL=3;papaya.viewer.ScreenSlice.DIRECTION_TEMPORAL=4;papaya.viewer.ScreenSlice.DIRECTION_SURFACE=5;papaya.viewer.ScreenSlice.SCREEN_PIXEL_MAX=255;papaya.viewer.ScreenSlice.SCREEN_PIXEL_MIN=0;
papaya.viewer.ScreenSlice.GRAB_RADIUS=5;papaya.viewer.ScreenSlice.DTI_COLORS=["#ff0000","#00ff00","#0000ff"];
papaya.viewer.ScreenSlice.prototype.updateSlice=function(c,a){var d,f,b,e,h,g,k,l,q,t,y,B,A,x,I,F,z,L,n,G,K,E,w,D=!1,u,m=0,p,J=!1,H=this.manager.isWorldMode();c=Math.round(c);u=this.manager.isRadiologicalMode()&&this.isRadiologicalSensitive()?-1:1;if(a||this.currentSlice!==c){this.currentSlice=c;d=this.screenVolumes[0].volume.header.origin;f=this.screenVolumes[0].volume.header.voxelDimensions;this.contextMain.clearRect(0,0,this.canvasMain.width,this.canvasMain.height);this.contextDTILines&&this.contextDTILines.clearRect(0,
0,this.screenDim,this.screenDim);this.imageData.length<this.screenVolumes.length&&(this.imageData=papaya.utilities.ArrayUtils.createArray(this.screenVolumes.length,this.xDim*this.yDim),this.imageData2=papaya.utilities.ArrayUtils.createArray(this.screenVolumes.length,1));for(b=0;b<this.screenVolumes.length;b+=1)if(!this.screenVolumes[b].hidden){t=this.screenVolumes[b].currentTimepoint;y=this.screenVolumes[b].rgb;B=this.screenVolumes[b].dti;A=this.screenVolumes[b].dtiLines;J|=!A;L=this.screenVolumes[b].dtiColors;
w=this.screenVolumes[b].dtiAlphaFactor;p=0===b||this.screenVolumes[b].interpolation;p&="Yes"===this.manager.container.preferences.smoothDisplay;A&&(this.updateDTILinesImage(),this.contextDTILines.lineWidth=1,L||(this.contextDTILines.strokeStyle=papaya.viewer.ScreenSlice.DTI_COLORS[m],m+=1,m%=3,this.contextDTILines.beginPath()));for(e=0;e<this.yDim;e+=1)for(h=0;h<this.xDim;h+=1)(g=0,k=255,q=this.screenVolumes[b].alpha,y)?(this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?g=this.screenVolumes[b].volume.getVoxelAtIndex(h,
e,c,t,!0):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?g=this.screenVolumes[b].volume.getVoxelAtIndex(h,c,e,t,!0):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(g=this.screenVolumes[b].volume.getVoxelAtIndex(c,h,e,t,!0)),l=4*(e*this.xDim+h),this.imageData[b][l]=g,this.imageDataDraw.data[l]=g>>16&255,this.imageDataDraw.data[l+1]=g>>8&255,this.imageDataDraw.data[l+2]=g&255,this.imageDataDraw.data[l+3]=k):B?(H?(this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?
(n=(h-d.x)*f.xSize,G=(d.y-e)*f.ySize,K=(d.z-c)*f.zSize):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(n=(h-d.x)*f.xSize,G=(d.y-c)*f.ySize,K=(d.z-e)*f.zSize):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(n=(c-d.x)*f.xSize,G=(d.y-h)*f.ySize,K=(d.z-e)*f.zSize),F=this.screenVolumes[b].volume.getVoxelAtCoordinate(n,G,K,0,!p),x=this.screenVolumes[b].volume.getVoxelAtCoordinate(n,G,K,1,!p),I=this.screenVolumes[b].volume.getVoxelAtCoordinate(n,G,K,2,!p),this.screenVolumes[b].dtiVolumeMod&&
(q=Math.min(1,this.screenVolumes[b].dtiVolumeMod.getVoxelAtCoordinate(n,G,K,0,!p)))):(this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(n=h*f.xSize,G=e*f.ySize,K=c*f.zSize):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(n=h*f.xSize,G=c*f.ySize,K=e*f.zSize):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(n=c*f.xSize,G=h*f.ySize,K=e*f.zSize),F=this.screenVolumes[b].volume.getVoxelAtMM(n,G,K,0,!p),x=this.screenVolumes[b].volume.getVoxelAtMM(n,G,
K,1,!p),I=this.screenVolumes[b].volume.getVoxelAtMM(n,G,K,2,!p),this.screenVolumes[b].dtiVolumeMod&&(q=Math.min(1,this.screenVolumes[b].dtiVolumeMod.getVoxelAtMM(n,G,K,0,!p)))),l=4*(e*this.xDim+h),A?0!==F||0!==x||0!==I?(this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(z=Math.atan2(u*x,F),E=Math.acos(Math.abs(I)/Math.sqrt(F*F+x*x+I*I))):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(z=Math.atan2(u*I,F),E=Math.acos(Math.abs(x)/Math.sqrt(F*F+x*x+I*I))):this.sliceDirection===
papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(z=Math.atan2(I,x),E=Math.acos(Math.abs(F)/Math.sqrt(F*F+x*x+I*I))),E=1-E/1.5708,F=papayaRoundFast(Math.abs(255*F)),x=papayaRoundFast(Math.abs(255*x)),I=papayaRoundFast(Math.abs(255*I)),g=papayaRoundFast(255*q),g=(g&255)<<24|(F&255)<<16|(x&255)<<8|I&255,L&&(this.contextDTILines.beginPath(),k=g&16777215,this.contextDTILines.strokeStyle="#"+papaya.utilities.StringUtils.pad(k.toString(16),6)),this.imageData[b][l]=z,this.imageData2[b][l]=g,q=Math.sin(z),g=
Math.cos(z),l=this.finalTransform2[0][2]+(h+.5)*this.finalTransform2[0][0],k=this.finalTransform2[1][2]+(e+.5)*this.finalTransform2[1][1],x=this.finalTransform2[0][2]+(h+.5*E)*this.finalTransform2[0][0],I=this.finalTransform2[1][2]+(e+.5)*this.finalTransform2[1][1],F=g*(x-l)-q*(I-k)+l,x=q*(x-l)+g*(I-k)+k,this.contextDTILines.moveTo(F,x),x=this.finalTransform2[0][2]+(h+1-.5*E)*this.finalTransform2[0][0],I=this.finalTransform2[1][2]+(e+.5)*this.finalTransform2[1][1],F=g*(x-l)-q*(I-k)+l,l=q*(x-l)+g*
(I-k)+k,this.contextDTILines.lineTo(F,l),L&&this.contextDTILines.stroke()):this.imageData[b][l]=Number.NaN:(q=0!==F||0!==x||0!==I?1-(1-q)*w:0,F=papayaRoundFast(Math.abs(255*F)),x=papayaRoundFast(Math.abs(255*x)),I=papayaRoundFast(Math.abs(255*I)),g=papayaRoundFast(255*q),this.imageData[b][l]=(g&255)<<24|(F&255)<<16|(x&255)<<8|I&255,D?(this.imageDataDraw.data[l]=this.imageDataDraw.data[l]*(1-q)+(F&255)*q,this.imageDataDraw.data[l+1]=this.imageDataDraw.data[l+1]*(1-q)+(x&255)*q,this.imageDataDraw.data[l+
2]=this.imageDataDraw.data[l+2]*(1-q)+(I&255)*q,this.imageDataDraw.data[l+3]=k):(this.imageDataDraw.data[l]=F&255,this.imageDataDraw.data[l+1]=x&255,this.imageDataDraw.data[l+2]=I&255,this.imageDataDraw.data[l+3]=g&255))):(H?this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?g=this.screenVolumes[b].volume.getVoxelAtCoordinate((h-d.x)*f.xSize,(d.y-e)*f.ySize,(d.z-c)*f.zSize,t,!p):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?g=this.screenVolumes[b].volume.getVoxelAtCoordinate((h-
d.x)*f.xSize,(d.y-c)*f.ySize,(d.z-e)*f.zSize,t,!p):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(g=this.screenVolumes[b].volume.getVoxelAtCoordinate((c-d.x)*f.xSize,(d.y-h)*f.ySize,(d.z-e)*f.zSize,t,!p)):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?g=this.screenVolumes[b].volume.getVoxelAtMM(h*f.xSize,e*f.ySize,c*f.zSize,t,!p):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?g=this.screenVolumes[b].volume.getVoxelAtMM(h*f.xSize,c*f.ySize,
e*f.zSize,t,!p):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(g=this.screenVolumes[b].volume.getVoxelAtMM(c*f.xSize,h*f.ySize,e*f.zSize,t,!p)),l=4*(e*this.xDim+h),F=g,this.imageData[b][l]=g,!this.screenVolumes[b].negative&&g<=this.screenVolumes[b].screenMin||this.screenVolumes[b].negative&&g>=this.screenVolumes[b].screenMin||isNaN(g)?(g=papaya.viewer.ScreenSlice.SCREEN_PIXEL_MIN,k=this.screenVolumes[b].isOverlay()?0:255):g=!this.screenVolumes[b].negative&&g>=this.screenVolumes[b].screenMax||
this.screenVolumes[b].negative&&g<=this.screenVolumes[b].screenMax?papaya.viewer.ScreenSlice.SCREEN_PIXEL_MAX:papayaRoundFast((g-this.screenVolumes[b].screenMin)*this.screenVolumes[b].screenRatio),D)?0<k&&(this.imageDataDraw.data[l]=this.imageDataDraw.data[l]*(1-q)+this.screenVolumes[b].colorTable.lookupRed(g,F)*q,this.imageDataDraw.data[l+1]=this.imageDataDraw.data[l+1]*(1-q)+this.screenVolumes[b].colorTable.lookupGreen(g,F)*q,this.imageDataDraw.data[l+2]=this.imageDataDraw.data[l+2]*(1-q)+this.screenVolumes[b].colorTable.lookupBlue(g,
F)*q,this.imageDataDraw.data[l+3]=k):(this.imageDataDraw.data[l]=this.screenVolumes[b].colorTable.lookupRed(g,F)*q,this.imageDataDraw.data[l+1]=this.screenVolumes[b].colorTable.lookupGreen(g,F)*q,this.imageDataDraw.data[l+2]=this.screenVolumes[b].colorTable.lookupBlue(g,F)*q,this.imageDataDraw.data[l+3]=k);L||this.contextDTILines.stroke();A||(D=!0)}J&&this.contextMain.putImageData(this.imageDataDraw,0,0)}};
papaya.viewer.ScreenSlice.prototype.repaint=function(c,a,d){var f,b,e,h;a=0;var g,k,l,q,t,y,B,A,x,I;d=0;var F=!1;this.currentSlice=c=Math.round(c);this.contextMain.clearRect(0,0,this.canvasMain.width,this.canvasMain.height);this.contextDTILines&&this.contextDTILines.clearRect(0,0,this.screenDim,this.screenDim);if(this.imageData.length===this.screenVolumes.length){for(c=0;c<this.screenVolumes.length;c+=1)if(!this.screenVolumes[c].hidden){k=this.screenVolumes[c].rgb;l=this.screenVolumes[c].dti;q=this.screenVolumes[c].dtiLines;
I=this.screenVolumes[c].dtiColors;q&&(this.contextDTILines.lineWidth=1,I||(this.contextDTILines.strokeStyle=papaya.viewer.ScreenSlice.DTI_COLORS[d],d+=1,d%=3,this.contextDTILines.beginPath()));for(f=0;f<this.yDim;f+=1)for(b=0;b<this.xDim;b+=1)(e=this.imageData[c][a],h=255,g=this.screenVolumes[c].alpha,a=4*(f*this.xDim+b),k)?(this.imageDataDraw.data[a]=e>>16&255,this.imageDataDraw.data[a+1]=e>>8&255,this.imageDataDraw.data[a+2]=e&255,this.imageDataDraw.data[a+3]=h):l?q?(h=this.imageData[c][a],isNaN(h)||
(e=this.imageData2[c][a],x=e>>16&255,A=e>>8&255,y=e&255,g=e&16777215,this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?t=Math.acos(Math.abs(y)/Math.sqrt(x*x+A*A+y*y)):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?t=Math.acos(Math.abs(A)/Math.sqrt(x*x+A*A+y*y)):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(t=Math.acos(Math.abs(x)/Math.sqrt(x*x+A*A+y*y))),t=1-t/1.5708,I&&(this.contextDTILines.beginPath(),this.contextDTILines.strokeStyle="#"+papaya.utilities.StringUtils.pad(g.toString(16),
6)),e=Math.sin(h),x=Math.cos(h),g=this.finalTransform2[0][2]+(b+.5)*this.finalTransform2[0][0],h=this.finalTransform2[1][2]+(f+.5)*this.finalTransform2[1][1],y=this.finalTransform2[0][2]+(b+.5*t)*this.finalTransform2[0][0],B=this.finalTransform2[1][2]+(f+.5)*this.finalTransform2[1][1],A=x*(y-g)-e*(B-h)+g,y=e*(y-g)+x*(B-h)+h,this.contextDTILines.moveTo(A,y),y=this.finalTransform2[0][2]+(b+1-.5*t)*this.finalTransform2[0][0],B=this.finalTransform2[1][2]+(f+.5)*this.finalTransform2[1][1],A=x*(y-g)-e*
(B-h)+g,e=e*(y-g)+x*(B-h)+h,this.contextDTILines.lineTo(A,e),I&&this.contextDTILines.stroke())):(e=this.imageData[c][a],g=e&16777215,g=0!==g?(e>>24&255)/255:0,F?(this.imageDataDraw.data[a]=this.imageDataDraw.data[a]*(1-g)+(e>>16&255)*g,this.imageDataDraw.data[a+1]=this.imageDataDraw.data[a+1]*(1-g)+(e>>8&255)*g,this.imageDataDraw.data[a+2]=this.imageDataDraw.data[a+2]*(1-g)+(e&255)*g,this.imageDataDraw.data[a+3]=h):(this.imageDataDraw.data[a]=e>>16&255,this.imageDataDraw.data[a+1]=e>>8&255,this.imageDataDraw.data[a+
2]=e&255,this.imageDataDraw.data[a+3]=e>>24&255)):(x=e=this.imageData[c][a],!this.screenVolumes[c].negative&&e<=this.screenVolumes[c].screenMin||this.screenVolumes[c].negative&&e>=this.screenVolumes[c].screenMin||isNaN(e)?(e=papaya.viewer.ScreenSlice.SCREEN_PIXEL_MIN,h=this.screenVolumes[c].isOverlay()?0:255):e=!this.screenVolumes[c].negative&&e>=this.screenVolumes[c].screenMax||this.screenVolumes[c].negative&&e<=this.screenVolumes[c].screenMax?papaya.viewer.ScreenSlice.SCREEN_PIXEL_MAX:papayaRoundFast((e-
this.screenVolumes[c].screenMin)*this.screenVolumes[c].screenRatio),F)?0<h&&(this.imageDataDraw.data[a]=this.imageDataDraw.data[a]*(1-g)+this.screenVolumes[c].colorTable.lookupRed(e,x)*g,this.imageDataDraw.data[a+1]=this.imageDataDraw.data[a+1]*(1-g)+this.screenVolumes[c].colorTable.lookupGreen(e,x)*g,this.imageDataDraw.data[a+2]=this.imageDataDraw.data[a+2]*(1-g)+this.screenVolumes[c].colorTable.lookupBlue(e,x)*g,this.imageDataDraw.data[a+3]=h):(this.imageDataDraw.data[a]=this.screenVolumes[c].colorTable.lookupRed(e,
x)*g,this.imageDataDraw.data[a+1]=this.screenVolumes[c].colorTable.lookupGreen(e,x)*g,this.imageDataDraw.data[a+2]=this.screenVolumes[c].colorTable.lookupBlue(e,x)*g,this.imageDataDraw.data[a+3]=h);I||this.contextDTILines.stroke();q||(F=!0)}this.contextMain.putImageData(this.imageDataDraw,0,0)}else this.updateSlice(c,!0)};papaya.viewer.ScreenSlice.prototype.getRealWidth=function(){return this.xDim*this.xSize};papaya.viewer.ScreenSlice.prototype.getRealHeight=function(){return this.yDim*this.ySize};
papaya.viewer.ScreenSlice.prototype.getXYratio=function(){return this.xSize/this.ySize};papaya.viewer.ScreenSlice.prototype.getYXratio=function(){return this.ySize/this.xSize};papaya.viewer.ScreenSlice.prototype.getXSize=function(){return this.xSize};papaya.viewer.ScreenSlice.prototype.getYSize=function(){return this.ySize};papaya.viewer.ScreenSlice.prototype.getXDim=function(){return this.xDim};papaya.viewer.ScreenSlice.prototype.getYDim=function(){return this.yDim};
papaya.viewer.ScreenSlice.prototype.updateZoomTransform=function(c,a,d,f,b,e){var h;a=(a+.5)*(c-1)*-1;d=(d+.5)*(c-1)*-1;f=a+f*(c-1);h=-1*(c-1)*this.xDim;0<f?f=0:f<h&&(f=h);b=d+b*(c-1);h=-1*(c-1)*this.yDim;0<b?b=0:b<h&&(b=h);1<c&&(this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(e.panAmountX=Math.round((f-a)/(c-1)),e.panAmountY=Math.round((b-d)/(c-1))):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(e.panAmountX=Math.round((f-a)/(c-1)),e.panAmountZ=Math.round((b-
d)/(c-1))):this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(e.panAmountY=Math.round((f-a)/(c-1)),e.panAmountZ=Math.round((b-d)/(c-1))));this.zoomTransform[0][0]=c;this.zoomTransform[0][1]=0;this.zoomTransform[0][2]=f;this.zoomTransform[1][0]=0;this.zoomTransform[1][1]=c;this.zoomTransform[1][2]=b;this.updateFinalTransform()};
papaya.viewer.ScreenSlice.prototype.updateFinalTransform=function(){var c,a;if(this.manager.isRadiologicalMode()&&this.isRadiologicalSensitive()){for(c=0;3>c;c+=1)for(a=0;3>a;a+=1)this.tempTransform[c][a]=this.screenTransform[c][a];for(c=0;3>c;c+=1)for(a=0;3>a;a+=1)this.tempTransform2[c][a]=this.tempTransform[c][0]*this.radiologicalTransform[0][a]+this.tempTransform[c][1]*this.radiologicalTransform[1][a]+this.tempTransform[c][2]*this.radiologicalTransform[2][a];for(c=0;3>c;c+=1)for(a=0;3>a;a+=1)this.finalTransform[c][a]=
this.tempTransform2[c][0]*this.zoomTransform[0][a]+this.tempTransform2[c][1]*this.zoomTransform[1][a]+this.tempTransform2[c][2]*this.zoomTransform[2][a];for(c=0;3>c;c+=1)for(a=0;3>a;a+=1)this.tempTransform[c][a]=this.screenTransform2[c][a];for(c=0;3>c;c+=1)for(a=0;3>a;a+=1)this.tempTransform2[c][a]=this.tempTransform[c][0]*this.radiologicalTransform[0][a]+this.tempTransform[c][1]*this.radiologicalTransform[1][a]+this.tempTransform[c][2]*this.radiologicalTransform[2][a];for(c=0;3>c;c+=1)for(a=0;3>
a;a+=1)this.finalTransform2[c][a]=this.tempTransform2[c][0]*this.zoomTransform[0][a]+this.tempTransform2[c][1]*this.zoomTransform[1][a]+this.tempTransform2[c][2]*this.zoomTransform[2][a]}else{for(c=0;3>c;c+=1)for(a=0;3>a;a+=1)this.finalTransform[c][a]=this.screenTransform[c][0]*this.zoomTransform[0][a]+this.screenTransform[c][1]*this.zoomTransform[1][a]+this.screenTransform[c][2]*this.zoomTransform[2][a];for(c=0;3>c;c+=1)for(a=0;3>a;a+=1)this.finalTransform2[c][a]=this.screenTransform2[c][0]*this.zoomTransform[0][a]+
this.screenTransform2[c][1]*this.zoomTransform[1][a]+this.screenTransform2[c][2]*this.zoomTransform[2][a]}};papaya.viewer.ScreenSlice.prototype.isRadiologicalSensitive=function(){return this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL||this.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL};
papaya.viewer.ScreenSlice.prototype.findProximalRulerHandle=function(c,a){this.tempPoint.x=c;this.tempPoint.y=a;return papaya.utilities.MathUtils.lineDistance(this.tempPoint.x,this.tempPoint.y,this.rulerPoints[0].x,this.rulerPoints[0].y)<papaya.viewer.ScreenSlice.GRAB_RADIUS?this.rulerPoints[0]:papaya.utilities.MathUtils.lineDistance(this.tempPoint.x,this.tempPoint.y,this.rulerPoints[1].x,this.rulerPoints[1].y)<papaya.viewer.ScreenSlice.GRAB_RADIUS?this.rulerPoints[1]:null};
papaya.viewer.ScreenSlice.prototype.updateDTILinesImage=function(){if(null===this.canvasDTILines||this.canvasDTILines.width!==this.screenDim)this.canvasDTILines=document.createElement("canvas"),this.canvasDTILines.width=this.screenDim,this.canvasDTILines.height=this.screenDim,this.contextDTILines=this.canvasDTILines.getContext("2d")};papaya.viewer.ScreenSlice.prototype.clearDTILinesImage=function(){this.contextDTILines=this.canvasDTILines=null};"use strict";papaya=papaya||{};
papaya.viewer=papaya.viewer||{};
papaya.viewer.ScreenVolume=papaya.viewer.ScreenVolume||function(c,a,d,f,b,e){this.volume=c;this.lutName=d;this.colorTable=new papaya.viewer.ColorTable(this.lutName,f);this.screenMin=this.volume.header.imageRange.displayMin;this.screenMax=this.volume.header.imageRange.displayMax;this.imageMin=this.volume.header.imageRange.imageMin;this.imageMax=this.volume.header.imageRange.imageMax;this.alpha=1;this.currentTimepoint=0;this.parametric=void 0!==b&&b;this.negativeScreenVol=null;this.dtiLines=this.dti=
!1;this.dtiColors=!0;this.dtiVolumeMod=null;this.dtiAlphaFactor=1;this.rgb=this.volume.header.imageType.datatype===papaya.volume.ImageType.DATATYPE_RGB;this.hasCheckedImageRange=!1;this.interpolation=!0;this.error=null;this.hidden=!1;this.rotationZ=this.rotationY=this.rotationX=.5;this.rotationAbout="Rotate About Center";this.isHighResSlice=262144<this.volume.header.imageDimensions.getNumVoxelsSlice();this.currentCoord=e;(c=a[this.volume.fileName])?(void 0!==c.interpolation&&(this.interpolation=c.interpolation),
void 0!==c.dti&&((this.dti=c.dti)&&3!==this.volume.numTimepoints&&(this.error=Error("DTI vector series must have 3 series points!")),this.dti&&(this.dtiLines=c.dtiLines,this.dtiColors=c.dtiColors,this.dtiLines||this.dtiColors||(this.dtiColors=!0),this.initDTI())),void 0!==c.min&&void 0!==c.max?b?(this.screenMin=-1*Math.abs(c.min),this.screenMax=-1*Math.abs(c.max)):(this.screenMin=c.min,this.screenMax=c.max):this.findDisplayRange(b,c),b?void 0!==c.negative_lut&&(this.lutName=c.negative_lut,this.colorTable=
new papaya.viewer.ColorTable(this.lutName,f)):void 0!==c.lut&&("string"===typeof c.lut||c.lut instanceof String?(this.lutName=c.lut,this.colorTable=new papaya.viewer.ColorTable(this.lutName,f)):(this.lutName="Object",this.colorTable=c.lut)),void 0===c.alpha||f||(this.alpha=c.alpha),f&&(void 0!==c.rotation&&c.rotation.length&&3===c.rotation.length&&(this.rotationX=(Math.min(Math.max(c.rotation[0],-90),90)+90)/180,this.rotationY=(Math.min(Math.max(c.rotation[1],-90),90)+90)/180,this.rotationZ=(Math.min(Math.max(c.rotation[2],
-90),90)+90)/180),c.rotationPoint&&("origin"===c.rotationPoint.toLowerCase()?this.rotationAbout="Rotate About Origin":"crosshairs"===c.rotationPoint.toLowerCase()?this.rotationAbout="Rotate About Crosshairs":this.rotationAbout="Rotate About Center"),this.updateTransform())):this.findDisplayRange(b,{});this.negative=!1;this.updateScreenRange();this.canvasIcon=document.createElement("canvas");this.canvasIcon.width=papaya.viewer.ColorTable.ICON_SIZE;this.canvasIcon.height=papaya.viewer.ColorTable.ICON_SIZE;
this.contextIcon=this.canvasIcon.getContext("2d");this.imageDataIcon=this.contextIcon.createImageData(papaya.viewer.ColorTable.ICON_SIZE,papaya.viewer.ColorTable.ICON_SIZE);this.icon=null;this.canvasBar=document.createElement("canvas");this.canvasBar.width=papaya.viewer.ColorTable.COLOR_BAR_WIDTH;this.canvasBar.height=papaya.viewer.ColorTable.COLOR_BAR_HEIGHT;this.contextBar=this.canvasBar.getContext("2d");this.imageDataBar=this.contextBar.createImageData(papaya.viewer.ColorTable.COLOR_BAR_WIDTH,
papaya.viewer.ColorTable.COLOR_BAR_HEIGHT);this.colorBar=null;this.updateIcon();this.updateColorBar()};papaya.viewer.ScreenVolume.makeSolidIcon=function(c,a,d){var f=document.createElement("canvas");f.width=papaya.viewer.ColorTable.ICON_SIZE;f.height=papaya.viewer.ColorTable.ICON_SIZE;var b=f.getContext("2d");b.fillStyle="rgb("+parseInt(255*c,10)+","+parseInt(255*a,10)+","+parseInt(255*d,10)+")";b.fillRect(0,0,papaya.viewer.ColorTable.ICON_SIZE,papaya.viewer.ColorTable.ICON_SIZE);return f.toDataURL()};
papaya.viewer.ScreenVolume.prototype.setScreenRange=function(c,a){this.screenMin=c;this.screenMax=a;this.updateScreenRange()};papaya.viewer.ScreenVolume.prototype.setScreenRangeNegatives=function(c,a){this.negativeScreenVol.setScreenRange(c,a)};papaya.viewer.ScreenVolume.prototype.updateScreenRange=function(){this.screenRatio=papaya.viewer.ScreenSlice.SCREEN_PIXEL_MAX/(this.screenMax-this.screenMin);this.negative=this.screenMax<this.screenMin};papaya.viewer.ScreenVolume.prototype.isOverlay=function(){return!this.colorTable.isBaseImage};
papaya.viewer.ScreenVolume.prototype.findImageRange=function(){var c,a,d,f,b,e,h,g,k;if(this.volume.header.imageRange.imageMin===this.volume.header.imageRange.imageMax&&!this.hasCheckedImageRange){this.hasCheckedImageRange=!0;c=Number.MAX_VALUE;a=Number.MIN_VALUE;d=this.volume.header.imageDimensions.xDim;f=this.volume.header.imageDimensions.yDim;b=this.volume.header.imageDimensions.zDim;for(e=0;e<b;e+=1)for(h=0;h<f;h+=1)for(g=0;g<d;g+=1)k=this.volume.getVoxelAtIndexNative(g,h,e,0,!0),k>a&&(a=k),k<
c&&(c=k);this.volume.header.imageRange.imageMin=this.imageMin=c;this.volume.header.imageRange.imageMax=this.imageMax=a}};
papaya.viewer.ScreenVolume.prototype.findDisplayRange=function(c,a){var d,f,b,e;d=this.volume.header.imageRange.imageMin!==this.volume.header.imageRange.imageMax;f=this.screenMin;b=this.screenMax;c&&Math.abs(f)>Math.abs(b)&&(e=b,b=f,f=e);if(c||void 0===a.minPercent&&void 0===a.maxPercent)if(this.isOverlay()){if(f===b||0>f&&0<b||0<f&&0>b||c&&(0<f||0<b)||a.symmetric)this.findImageRange(),c?a.symmetric||0===this.imageMin?(f=-1*(this.imageMax-.75*this.imageMax),b=-1*(this.imageMax-.25*this.imageMax)):
(f=this.imageMin-.75*this.imageMin,b=this.imageMin-.25*this.imageMin):(f=this.imageMax-.75*this.imageMax,b=this.imageMax-.25*this.imageMax);1>f&&-1<f&&1>b&&-1<b||(f=Math.round(f),b=Math.round(b))}else 1>f&&-1<f&&1>b&&-1<b||(f=Math.round(f),b=Math.round(b)),0===f&&0===b&&(this.findImageRange(),f=this.imageMin,b=this.imageMax),b<=f&&(this.findImageRange(),f=this.imageMin,b=this.imageMax),d&&f<this.imageMin&&(this.findImageRange(),f=this.imageMin),d&&b>this.imageMax&&(this.findImageRange(),b=this.imageMax);
else this.findImageRange(),f=void 0!==a.minPercent?this.imageMax*a.minPercent:this.imageMin,b=void 0!==a.maxPercent?this.imageMax*a.maxPercent:this.imageMax;this.screenMin=f;this.screenMax=b};papaya.viewer.ScreenVolume.prototype.isUsingColorTable=function(c){return this.lutName===c};papaya.viewer.ScreenVolume.prototype.isRotatingAbout=function(c){return this.rotationAbout===c};
papaya.viewer.ScreenVolume.prototype.changeColorTable=function(c,a){this.colorTable=new papaya.viewer.ColorTable(a,!this.isOverlay());this.lutName=a;this.updateIcon();this.updateColorBar();c.drawViewer(!0)};papaya.viewer.ScreenVolume.prototype.getRange=function(){var c=Array(2);c[0]=this.colorTable.minLUT/(255/(this.screenMax-this.screenMin))+this.screenMin;c[1]=this.colorTable.maxLUT/(255/(this.screenMax-this.screenMin))+this.screenMin;return c};
papaya.viewer.ScreenVolume.prototype.getRangeNegative=function(){return this.negativeScreenVol.getRange()};papaya.viewer.ScreenVolume.prototype.getAlphaNegative=function(){return this.negativeScreenVol.alpha};papaya.viewer.ScreenVolume.prototype.incrementTimepoint=function(){var c=this.volume.numTimepoints;this.currentTimepoint+=1;this.currentTimepoint>=c&&(this.currentTimepoint=c-1)};
papaya.viewer.ScreenVolume.prototype.decrementTimepoint=function(){--this.currentTimepoint;0>this.currentTimepoint&&(this.currentTimepoint=0)};papaya.viewer.ScreenVolume.prototype.setTimepoint=function(c){this.currentTimepoint=0>c?0:c>=this.volume.numTimepoints?this.volume.numTimepoints-1:c};papaya.viewer.ScreenVolume.prototype.updateMinLUT=function(c){this.colorTable.updateMinLUT(c)};papaya.viewer.ScreenVolume.prototype.updateMaxLUT=function(c){this.colorTable.updateMaxLUT(c)};
papaya.viewer.ScreenVolume.prototype.updateLUT=function(c,a){this.colorTable.updateLUT(c,a)};papaya.viewer.ScreenVolume.prototype.supportsDynamicColorTable=function(){return void 0!==this.colorTable.updateMinLUT&&void 0!==this.colorTable.updateMaxLUT&&void 0!==this.colorTable.updateLUT};papaya.viewer.ScreenVolume.prototype.resetDynamicRange=function(){this.colorTable.minLUT=0;this.colorTable.maxLUT=papaya.viewer.ColorTable.LUT_MAX;this.updateLUT(this.colorTable.minLUT,this.colorTable.maxLUT);this.updateColorBar()};
papaya.viewer.ScreenVolume.prototype.getCurrentTime=function(){return this.currentTimepoint*this.volume.header.voxelDimensions.timeSize*this.volume.header.voxelDimensions.getTemporalUnitMultiplier()};papaya.viewer.ScreenVolume.prototype.setCurrentTime=function(c){var a=this.volume.header.voxelDimensions.timeSize*this.volume.header.voxelDimensions.getTemporalUnitMultiplier();0===a?this.setTimepoint(0):this.setTimepoint(parseInt(Math.round(c/a),10))};
papaya.viewer.ScreenVolume.prototype.hasError=function(){return null!==this.error};papaya.viewer.ScreenVolume.prototype.initDTI=function(){this.volume.numTimepoints=1;this.volume.header.imageDimensions.timepoints=1;this.colorTable=new papaya.viewer.ColorTable(this.lutName,!1,papaya.viewer.ColorTable.TABLE_DTI_SPECTRUM);this.volume.transform.voxelValue.forceABS=!this.dtiLines;this.updateIcon()};papaya.viewer.ScreenVolume.prototype.isDTILines=function(){return this.dtiLines&&!this.dtiColors};
papaya.viewer.ScreenVolume.prototype.isDTIRGB=function(){return!this.dtiLines&&this.dtiColors};papaya.viewer.ScreenVolume.prototype.isDTILinesAndRGB=function(){return this.dtiLines&&this.dtiColors};papaya.viewer.ScreenVolume.prototype.getHiddenLabel=function(){return this.hidden?"Show Overlay":"Hide Overlay"};
papaya.viewer.ScreenVolume.prototype.updateIcon=function(){var c,a,d,f,b;if(this.imageDataIcon){c=papaya.viewer.ColorTable.LUT_MAX/papaya.viewer.ColorTable.ICON_SIZE;for(a=0;a<papaya.viewer.ColorTable.ICON_SIZE;a+=1)for(d=0;d<papaya.viewer.ColorTable.ICON_SIZE;d+=1)f=4*(a*papaya.viewer.ColorTable.ICON_SIZE+d),b=Math.round(d*c),this.imageDataIcon.data[f]=this.colorTable.lookupRed(b),this.imageDataIcon.data[f+1]=this.colorTable.lookupGreen(b),this.imageDataIcon.data[f+2]=this.colorTable.lookupBlue(b),
this.imageDataIcon.data[f+3]=255;this.contextIcon.putImageData(this.imageDataIcon,0,0);this.icon=this.canvasIcon.toDataURL()}};
papaya.viewer.ScreenVolume.prototype.updateColorBar=function(){var c,a,d,f,b;if(this.imageDataBar){c=papaya.viewer.ColorTable.LUT_MAX/papaya.viewer.ColorTable.COLOR_BAR_WIDTH;for(a=0;a<papaya.viewer.ColorTable.COLOR_BAR_HEIGHT;a+=1)for(d=0;d<papaya.viewer.ColorTable.COLOR_BAR_WIDTH;d+=1)f=4*(a*papaya.viewer.ColorTable.COLOR_BAR_WIDTH+d),b=Math.round(d*c),this.imageDataBar.data[f]=this.colorTable.lookupRed(b),this.imageDataBar.data[f+1]=this.colorTable.lookupGreen(b),this.imageDataBar.data[f+2]=this.colorTable.lookupBlue(b),
this.imageDataBar.data[f+3]=255;this.contextBar.putImageData(this.imageDataBar,0,0);this.colorBar=this.canvasBar.toDataURL()}};
papaya.viewer.ScreenVolume.prototype.updateTransform=function(){var c=180*(this.rotationX-.5),a=180*(this.rotationY-.5),d=180*(this.rotationZ-.5),f,b,e;"Rotate About Origin"===this.rotationAbout?(f=this.volume.header.origin.x*this.volume.header.voxelDimensions.xSize,b=this.volume.header.origin.y*this.volume.header.voxelDimensions.ySize,e=this.volume.header.origin.z*this.volume.header.voxelDimensions.zSize):"Rotate About Crosshairs"===this.rotationAbout?(f=this.currentCoord.x*this.volume.header.voxelDimensions.xSize,
b=this.currentCoord.y*this.volume.header.voxelDimensions.ySize,e=this.currentCoord.z*this.volume.header.voxelDimensions.zSize):(f=this.volume.header.imageDimensions.xDim/2*this.volume.header.voxelDimensions.xSize,b=this.volume.header.imageDimensions.yDim/2*this.volume.header.voxelDimensions.ySize,e=this.volume.header.imageDimensions.zDim/2*this.volume.header.voxelDimensions.zSize);this.volume.transform.updateImageMat(f,b,e,c,a,d)};
papaya.viewer.ScreenVolume.prototype.resetTransform=function(){this.rotationZ=this.rotationY=this.rotationX=.5};"use strict";papaya=papaya||{};papaya.viewer=papaya.viewer||{};var PAPAYA_BUILD_NUM=PAPAYA_BUILD_NUM||"0";
papaya.viewer.Viewer=papaya.viewer.Viewer||function(c,a,d,f){this.container=c;this.canvas=document.createElement("canvas");this.canvas.width=a;this.canvas.height=d;this.context=this.canvas.getContext("2d");this.canvas.style.padding=0;this.canvas.style.margin=0;this.canvas.style.border="none";this.atlas=null;this.pageLoaded=this.initialized=!1;this.loadingVolume=null;this.volume=new papaya.volume.Volume(this.container.display,this);this.screenVolumes=[];this.surfaces=[];this.lowerImageTop=this.lowerImageBot=
this.lowerImageBot2=this.mainImage=this.selectedSlice=this.surfaceView=this.sagittalSlice=this.coronalSlice=this.axialSlice=this.currentScreenVolume=null;this.viewerDim=0;this.worldSpace=!1;this.currentCoord=new papaya.core.Coordinate(0,0,0);this.cursorPosition=new papaya.core.Coordinate(0,0,0);this.draggingSliceDir=this.longestDimSize=this.longestDim=0;this.isLongTouch=this.didLongTouch=this.isPanning=this.isContextMode=this.isZoomMode=this.isWindowControl=this.isDragging=!1;this.zoomFactorPrevious=
this.zoomFactor=papaya.viewer.Viewer.ZOOM_FACTOR_MIN;this.panAmountZ=this.panAmountY=this.panAmountX=this.panLocZ=this.panLocY=this.panLocX=this.zoomLocZ=this.zoomLocY=this.zoomLocX=0;this.keyPressIgnored=!1;this.previousMousePosition=new papaya.core.Point;this.isShiftKeyDown=this.isAltKeyDown=this.isControlKeyDown=!1;this.toggleMainCrosshairs=!0;this.bgColor=null;this.loadingDTI=this.controlsHidden=this.hasSeries=!1;this.loadingDTIModRef=null;this.tempCoor=new papaya.core.Coordinate;this.listenerContextMenu=
function(a){a.preventDefault();return!1};this.listenerMouseMove=papaya.utilities.ObjectUtils.bind(this,this.mouseMoveEvent);this.listenerMouseDown=papaya.utilities.ObjectUtils.bind(this,this.mouseDownEvent);this.listenerMouseOut=papaya.utilities.ObjectUtils.bind(this,this.mouseOutEvent);this.listenerMouseLeave=papaya.utilities.ObjectUtils.bind(this,this.mouseLeaveEvent);this.listenerMouseUp=papaya.utilities.ObjectUtils.bind(this,this.mouseUpEvent);this.listenerMouseDoubleClick=papaya.utilities.ObjectUtils.bind(this,
this.mouseDoubleClickEvent);this.listenerKeyDown=papaya.utilities.ObjectUtils.bind(this,this.keyDownEvent);this.listenerKeyUp=papaya.utilities.ObjectUtils.bind(this,this.keyUpEvent);this.listenerTouchMove=papaya.utilities.ObjectUtils.bind(this,this.touchMoveEvent);this.listenerTouchStart=papaya.utilities.ObjectUtils.bind(this,this.touchStartEvent);this.listenerTouchEnd=papaya.utilities.ObjectUtils.bind(this,this.touchEndEvent);this.initialCoordinate=null;this.listenerScroll=papaya.utilities.ObjectUtils.bind(this,
this.scrolled);this.updateTimerEvent=this.updateTimer=this.longTouchTimer=null;this.drawEmptyViewer();this.processParams(f)};papaya.viewer.Viewer.GAP=PAPAYA_SPACING;papaya.viewer.Viewer.BACKGROUND_COLOR="rgba(0, 0, 0, 255)";papaya.viewer.Viewer.CROSSHAIRS_COLOR="rgba(28, 134, 238, 255)";papaya.viewer.Viewer.KEYCODE_ROTATE_VIEWS=32;papaya.viewer.Viewer.KEYCODE_CENTER=67;papaya.viewer.Viewer.KEYCODE_ORIGIN=79;papaya.viewer.Viewer.KEYCODE_ARROW_UP=38;papaya.viewer.Viewer.KEYCODE_ARROW_DOWN=40;
papaya.viewer.Viewer.KEYCODE_ARROW_RIGHT=39;papaya.viewer.Viewer.KEYCODE_ARROW_LEFT=37;papaya.viewer.Viewer.KEYCODE_PAGE_UP=33;papaya.viewer.Viewer.KEYCODE_PAGE_DOWN=34;papaya.viewer.Viewer.KEYCODE_SINGLE_QUOTE=222;papaya.viewer.Viewer.KEYCODE_FORWARD_SLASH=191;papaya.viewer.Viewer.KEYCODE_INCREMENT_MAIN=71;papaya.viewer.Viewer.KEYCODE_DECREMENT_MAIN=86;papaya.viewer.Viewer.KEYCODE_TOGGLE_CROSSHAIRS=65;papaya.viewer.Viewer.KEYCODE_SERIES_BACK=188;papaya.viewer.Viewer.KEYCODE_SERIES_FORWARD=190;
papaya.viewer.Viewer.MAX_OVERLAYS=8;papaya.viewer.Viewer.ORIENTATION_MARKER_SUPERIOR="S";papaya.viewer.Viewer.ORIENTATION_MARKER_INFERIOR="I";papaya.viewer.Viewer.ORIENTATION_MARKER_ANTERIOR="A";papaya.viewer.Viewer.ORIENTATION_MARKER_POSTERIOR="P";papaya.viewer.Viewer.ORIENTATION_MARKER_LEFT="L";papaya.viewer.Viewer.ORIENTATION_MARKER_RIGHT="R";papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE=16;papaya.viewer.Viewer.ORIENTATION_CERTAINTY_UNKNOWN_COLOR="red";
papaya.viewer.Viewer.ORIENTATION_CERTAINTY_LOW_COLOR="yellow";papaya.viewer.Viewer.ORIENTATION_CERTAINTY_HIGH_COLOR="white";papaya.viewer.Viewer.UPDATE_TIMER_INTERVAL=250;papaya.viewer.Viewer.ZOOM_FACTOR_MAX=10;papaya.viewer.Viewer.ZOOM_FACTOR_MIN=1;papaya.viewer.Viewer.MOUSE_SCROLL_THRESHLD=.25;papaya.viewer.Viewer.TITLE_MAX_LENGTH=30;papaya.viewer.Viewer.validDimBounds=function(c,a){return c<a?c:a-1};papaya.viewer.Viewer.getKeyCode=function(c){return c.keyCode||c.charCode};
papaya.viewer.Viewer.isControlKey=function(c){c=papaya.viewer.Viewer.getKeyCode(c);return"MacOS"!==papaya.utilities.PlatformUtils.os||91!==c&&93!==c&&224!==c?"MacOS"!==papaya.utilities.PlatformUtils.os&&17===c:!0};papaya.viewer.Viewer.isAltKey=function(c){return 18===papaya.viewer.Viewer.getKeyCode(c)};papaya.viewer.Viewer.isShiftKey=function(c){c=!!c.shiftKey;!c&&window.event&&(c=!!window.event.shiftKey);return c};
papaya.viewer.Viewer.getOffsetRect=function(c){c=c.getBoundingClientRect();var a=document.body,d=document.documentElement,f=c.left+(window.pageXOffset||d.scrollLeft)-(d.clientLeft||a.clientLeft||0);return{top:Math.round(c.top+(window.pageYOffset||d.scrollTop)-(d.clientTop||a.clientTop||0)),left:Math.round(f)}};
papaya.viewer.Viewer.drawRoundRect=function(c,a,d,f,b,e,h,g){"undefined"===typeof g&&(g=!0);"undefined"===typeof e&&(e=5);c.beginPath();c.moveTo(a+e,d);c.lineTo(a+f-e,d);c.quadraticCurveTo(a+f,d,a+f,d+e);c.lineTo(a+f,d+b-e);c.quadraticCurveTo(a+f,d+b,a+f-e,d+b);c.lineTo(a+e,d+b);c.quadraticCurveTo(a,d+b,a,d+b-e);c.lineTo(a,d+e);c.quadraticCurveTo(a,d,a+e,d);c.closePath();g&&c.stroke();h&&c.fill()};
papaya.viewer.Viewer.prototype.loadImage=function(c,a,d){0===this.screenVolumes.length?this.loadBaseImage(c,a,d):this.loadOverlay(c,a,d)};papaya.viewer.Viewer.prototype.showDialog=function(c,a,d,f,b){var e,h=-1;for(e=0;e<papayaContainers.length;e+=1)if(papayaContainers[e]===this.container){h=e;break}(new papaya.ui.Dialog(this.container,c,a,d,f,b,h)).showDialog()};
papaya.viewer.Viewer.prototype.loadBaseImage=function(c,a,d){var f=this.container.findLoadableImage(c);this.volume=new papaya.volume.Volume(this.container.display,this,this.container.params);d?(c=f.encode,c instanceof Array||(c=[],c[0]=f.encode),this.volume.readEncodedData(c,papaya.utilities.ObjectUtils.bind(this,this.initializeViewer))):null!==f&&void 0!==f.encode?(c=f.encode,c instanceof Array||(c=[],c[0]=f.encode),this.volume.readEncodedData(c,papaya.utilities.ObjectUtils.bind(this,this.initializeViewer))):
a?this.volume.readURLs(c,papaya.utilities.ObjectUtils.bind(this,this.initializeViewer)):null!==f&&void 0!==f.url?this.volume.readURLs([f.url],papaya.utilities.ObjectUtils.bind(this,this.initializeViewer)):this.volume.readFiles(c,papaya.utilities.ObjectUtils.bind(this,this.initializeViewer))};
papaya.viewer.Viewer.prototype.loadOverlay=function(c,a,d){var f=this.container.findLoadableImage(c);this.loadingVolume=new papaya.volume.Volume(this.container.display,this,this.container.params);this.screenVolumes.length>papaya.viewer.Viewer.MAX_OVERLAYS?(this.loadingVolume.error=Error("Maximum number of overlays ("+papaya.viewer.Viewer.MAX_OVERLAYS+") has been reached!"),this.initializeOverlay()):d?(c=f.encode,c instanceof Array||(c=[],c[0]=f.encode),this.loadingVolume.readEncodedData(c,papaya.utilities.ObjectUtils.bind(this,
this.initializeOverlay))):null!==f&&void 0!==f.encode?(c=f.encode,c instanceof Array||(c=[],c[0]=f.encode),this.loadingVolume.readEncodedData(c,papaya.utilities.ObjectUtils.bind(this,this.initializeOverlay))):a?this.loadingVolume.readURLs(c,papaya.utilities.ObjectUtils.bind(this,this.initializeOverlay)):null!==f&&void 0!==f.url?this.loadingVolume.readURLs([f.url],papaya.utilities.ObjectUtils.bind(this,this.initializeOverlay)):this.loadingVolume.readFiles(c,papaya.utilities.ObjectUtils.bind(this,this.initializeOverlay))};
papaya.viewer.Viewer.prototype.loadSurface=function(c,a,d){var f=this.container.findLoadableImage(c,!0);if(0==this.screenVolumes.length)this.container.display.drawError("Load an image before loading a surface!");else{var b=new papaya.surface.Surface(this.container.display,this.container.params);d?b.readEncodedData(c[0],papaya.utilities.ObjectUtils.bind(this,this.initializeSurface)):null!==f&&void 0!==f.encode?b.readEncodedData(f.encode,papaya.utilities.ObjectUtils.bind(this,this.initializeSurface)):
a?b.readURL(c,papaya.utilities.ObjectUtils.bind(this,this.initializeSurface)):null!==f&&void 0!==f.url?b.readURL(f.url,papaya.utilities.ObjectUtils.bind(this,this.initializeSurface)):b.readFile(c[0],papaya.utilities.ObjectUtils.bind(this,this.initializeSurface))}};
papaya.viewer.Viewer.prototype.initializeSurface=function(c){var a=c;if(c.error)c.error&&this.container.display.drawError(c.error);else{for(;null!==a;)this.surfaces.push(a),a=a.nextSurface;if(null===this.surfaceView)this.lowerImageBot2=this.surfaceView=new papaya.viewer.ScreenSurface(this.volume,this.surfaces,this,this.container.params),this.container.resizeViewerComponents(!0);else for(a=c;null!==a;)this.surfaceView.initBuffers(this.surfaceView.context,a),a=a.nextSurface;this.container.params.mainView&&
"surface"===this.container.params.mainView.toLowerCase()&&(this.mainImage=this.surfaceView,this.lowerImageTop=this.axialSlice,this.lowerImageBot=this.sagittalSlice,this.lowerImageBot2=this.coronalSlice,this.viewsChanged());this.container.toolbar.buildToolbar();this.container.toolbar.updateImageButtons();this.container.hasMoreToLoad()?this.container.loadNext():this.finishedLoading()}};papaya.viewer.Viewer.prototype.atlasLoaded=function(){this.finishedLoading()};
papaya.viewer.Viewer.prototype.initializeViewer=function(){var c,a;a=this;if(this.volume.hasError())c=this.volume.error.message,this.resetViewer(),this.container.clearParams(),this.container.display.drawError(c);else if(this.screenVolumes[0]=new papaya.viewer.ScreenVolume(this.volume,this.container.params,papaya.viewer.ColorTable.DEFAULT_COLOR_TABLE.name,!0,!1,this.currentCoord),this.loadingDTI&&(this.loadingDTI=!1,this.screenVolumes[0].dti=!0,this.screenVolumes[0].dti&&3!==this.screenVolumes[0].volume.numTimepoints&&
(this.screenVolumes[0].error=Error("DTI vector series must have 3 series points!")),this.screenVolumes[0].dti&&this.screenVolumes[0].initDTI()),this.screenVolumes[0].hasError())c=this.screenVolumes[0].error.message,this.resetViewer(),this.container.clearParams(),this.container.display.drawError(c);else{this.setCurrentScreenVol(0);this.axialSlice=new papaya.viewer.ScreenSlice(this.volume,papaya.viewer.ScreenSlice.DIRECTION_AXIAL,this.volume.getXDim(),this.volume.getYDim(),this.volume.getXSize(),this.volume.getYSize(),
this.screenVolumes,this);this.coronalSlice=new papaya.viewer.ScreenSlice(this.volume,papaya.viewer.ScreenSlice.DIRECTION_CORONAL,this.volume.getXDim(),this.volume.getZDim(),this.volume.getXSize(),this.volume.getZSize(),this.screenVolumes,this);this.sagittalSlice=new papaya.viewer.ScreenSlice(this.volume,papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL,this.volume.getYDim(),this.volume.getZDim(),this.volume.getYSize(),this.volume.getZSize(),this.screenVolumes,this);void 0===this.container.params.mainView||
"axial"===this.container.params.mainView.toLowerCase()?(this.mainImage=this.axialSlice,this.lowerImageTop=this.sagittalSlice,this.lowerImageBot=this.coronalSlice):"coronal"===this.container.params.mainView.toLowerCase()?(this.mainImage=this.coronalSlice,this.lowerImageTop=this.axialSlice,this.lowerImageBot=this.sagittalSlice):"sagittal"===this.container.params.mainView.toLowerCase()?(this.mainImage=this.sagittalSlice,this.lowerImageTop=this.coronalSlice,this.lowerImageBot=this.axialSlice):(this.mainImage=
this.axialSlice,this.lowerImageTop=this.sagittalSlice,this.lowerImageBot=this.coronalSlice);this.canvas.addEventListener("mousemove",this.listenerMouseMove,!1);this.canvas.addEventListener("mousedown",this.listenerMouseDown,!1);this.canvas.addEventListener("mouseout",this.listenerMouseOut,!1);this.canvas.addEventListener("mouseleave",this.listenerMouseLeave,!1);this.canvas.addEventListener("mouseup",this.listenerMouseUp,!1);document.addEventListener("keydown",this.listenerKeyDown,!0);document.addEventListener("keyup",
this.listenerKeyUp,!0);this.canvas.addEventListener("touchmove",this.listenerTouchMove,!1);this.canvas.addEventListener("touchstart",this.listenerTouchStart,!1);this.canvas.addEventListener("touchend",this.listenerTouchEnd,!1);this.canvas.addEventListener("dblclick",this.listenerMouseDoubleClick,!1);document.addEventListener("contextmenu",this.listenerContextMenu,!1);this.container.showControlBar?($(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_MAIN_SLIDER).find("button")).eq(0).click(function(){a.mainImage.sliceDirection===
papaya.viewer.ScreenSlice.DIRECTION_AXIAL?a.incrementAxial(!1):a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?a.incrementCoronal(!1):a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&a.incrementSagittal(!0)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_MAIN_SLIDER).find("button")).eq(1).click(function(){a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?a.incrementAxial(!0):a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?
a.incrementCoronal(!0):a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&a.incrementSagittal(!1)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(0).find("button").eq(0)).click(function(){a.incrementAxial(!1)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(0).find("button").eq(1)).click(function(){a.incrementAxial(!0)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(1).find("button").eq(0)).click(function(){a.incrementCoronal(!1)}),
$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(1).find("button").eq(1)).click(function(){a.incrementCoronal(!0)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(2).find("button").eq(0)).click(function(){a.incrementSagittal(!0)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(2).find("button").eq(1)).click(function(){a.incrementSagittal(!1)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(3).find("button").eq(0)).click(function(){a.decrementSeriesPoint()}),
$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(3).find("button").eq(1)).click(function(){a.incrementSeriesPoint()}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_SWAP_BUTTON_CSS)).click(function(){a.rotateViews()}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS)).click(function(){var c=new papaya.core.Coordinate(Math.floor(a.volume.header.imageDimensions.xDim/2),Math.floor(a.volume.header.imageDimensions.yDim/2),Math.floor(a.volume.header.imageDimensions.zDim/
2));a.gotoCoordinate(c)}),$(this.container.sliderControlHtml.find("."+PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS)).click(function(){a.gotoCoordinate(a.volume.header.origin)}),$("."+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS).prop("disabled",!1),$("."+PAPAYA_CONTROL_SWAP_BUTTON_CSS).prop("disabled",!1),$("."+PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS).prop("disabled",!1),$("."+PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS).prop("disabled",!1)):this.container.showControls&&($("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex).css({display:"inline"}),
$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+this.container.containerIndex).css({display:"inline"}),$("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+this.container.containerIndex).css({display:"inline"}),$(this.container.containerHtml.find("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+this.container.containerIndex)).click(function(){a.rotateViews()}),$(this.container.containerHtml.find("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex)).click(function(){a.mainImage.sliceDirection===
papaya.viewer.ScreenSlice.DIRECTION_AXIAL?a.incrementAxial(!1):a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?a.incrementCoronal(!1):a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&a.incrementSagittal(!0)}),$(this.container.containerHtml.find("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+this.container.containerIndex)).click(function(){a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?a.incrementAxial(!0):a.mainImage.sliceDirection===
papaya.viewer.ScreenSlice.DIRECTION_CORONAL?a.incrementCoronal(!0):a.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&a.incrementSagittal(!1)}),$(this.container.containerHtml.find("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+this.container.containerIndex)).click(function(){var c=new papaya.core.Coordinate(Math.floor(a.volume.header.imageDimensions.xDim/2),Math.floor(a.volume.header.imageDimensions.yDim/2),Math.floor(a.volume.header.imageDimensions.zDim/2));a.gotoCoordinate(c)}),
$(this.container.containerHtml.find("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+this.container.containerIndex)).click(function(){a.gotoCoordinate(a.volume.header.origin)}));this.hasSeries=1<this.volume.header.imageDimensions.timepoints;this.container.allowScroll&&this.addScroll();this.setLongestDim(this.volume);this.calculateScreenSliceTransforms(this);this.currentCoord.setCoordinate(papayaFloorFast(this.volume.getXDim()/2),papayaFloorFast(this.volume.getYDim()/2),papayaFloorFast(this.volume.getZDim()/
2));this.updateOffsetRect();this.bgColor=$("body").css("background-color");if("rgba(0, 0, 0, 0)"===this.bgColor||"transparent"===this.bgColor)this.bgColor="rgba(255, 255, 255, 255)";this.context.fillStyle=this.bgColor;this.context.fillRect(0,0,this.canvas.offsetWidth,this.canvas.offsetHeight);this.volume.isWorldSpaceOnly()&&(this.worldSpace=!0);this.initialized=!0;this.container.resizeViewerComponents(!0);this.drawViewer();this.container.toolbar.buildToolbar();this.container.toolbar.updateImageButtons();
this.updateWindowTitle();this.container.loadingImageIndex=1;this.container.hasMoreToLoad()?this.container.loadNext():this.finishedLoading()}};papaya.viewer.Viewer.prototype.finishedLoading=function(){this.pageLoaded||(this.goToInitialCoordinate(),this.updateSliceSliderControl(),this.pageLoaded=!0);this.container.loadingComplete&&(this.container.loadingComplete(),this.container.loadingComplete=null);this.container.toolbar.buildToolbar();this.container.toolbar.updateImageButtons()};
papaya.viewer.Viewer.prototype.addScroll=function(){this.container.nestedViewer||window.addEventListener(papaya.utilities.PlatformUtils.getSupportedScrollEvent(),this.listenerScroll,!1)};papaya.viewer.Viewer.prototype.removeScroll=function(){window.removeEventListener(papaya.utilities.PlatformUtils.getSupportedScrollEvent(),this.listenerScroll,!1)};papaya.viewer.Viewer.prototype.updateOffsetRect=function(){this.canvasRect=papaya.viewer.Viewer.getOffsetRect(this.canvas)};
papaya.viewer.Viewer.prototype.initializeOverlay=function(){var c,a,d;if(this.loadingVolume.hasError())this.container.display.drawError(this.loadingVolume.error.message),this.container.clearParams(),this.loadingVolume=null;else{a=(c=this.container.params[this.loadingVolume.fileName])&&c.parametric;d=c&&c.dtiMod;if(this.loadingDTIModRef)this.loadingDTIModRef.dtiVolumeMod=this.loadingVolume,this.loadingDTIModRef=null;else if(d){if(a=this.getScreenVolumeByName(c.dtiRef))a.dtiVolumeMod=this.loadingVolume,
a.dtiAlphaFactor=void 0!==c.dtiModAlphaFactor?c.dtiModAlphaFactor:1}else{c=new papaya.viewer.ScreenVolume(this.loadingVolume,this.container.params,a?papaya.viewer.ColorTable.PARAMETRIC_COLOR_TABLES[0].name:this.getNextColorTable(),!1,!1,this.currentCoord);this.loadingDTI&&(this.loadingDTI=!1,c.dti=!0,c.dti&&3!==c.volume.numTimepoints&&(c.error=Error("DTI vector series must have 3 series points!")),c.dti&&c.initDTI());if(c.hasError()){this.container.display.drawError(c.error.message);this.container.clearParams();
this.loadingVolume=null;return}this.screenVolumes[this.screenVolumes.length]=c;this.setCurrentScreenVol(this.screenVolumes.length-1);a&&(this.screenVolumes[this.screenVolumes.length-1].findImageRange(),0>this.screenVolumes[this.screenVolumes.length-1].volume.header.imageRange.imageMin&&(this.screenVolumes[this.screenVolumes.length]=a=new papaya.viewer.ScreenVolume(this.loadingVolume,this.container.params,papaya.viewer.ColorTable.PARAMETRIC_COLOR_TABLES[1].name,!1,!0,this.currentCoord),c.negativeScreenVol=
a,this.setCurrentScreenVol(this.screenVolumes.length-1)))}this.container.toolbar.buildToolbar();this.container.toolbar.updateImageButtons();this.drawViewer(!0);this.hasSeries=!1;for(c=0;c<this.screenVolumes.length;c+=1)if(1<this.screenVolumes[c].volume.header.imageDimensions.timepoints){this.hasSeries=!0;break}this.container.resizeViewerComponents();this.updateWindowTitle();this.loadingVolume=null;this.container.hasMoreToLoad()?this.container.loadNext():this.finishedLoading()}};
papaya.viewer.Viewer.prototype.closeOverlayByRef=function(c){this.closeOverlay(this.getScreenVolumeIndex(c))};
papaya.viewer.Viewer.prototype.closeOverlay=function(c){var a;for(a=0;a<this.screenVolumes.length;a+=1)this.screenVolumes[a].negativeScreenVol===this.screenVolumes[c]&&(this.screenVolumes[a].negativeScreenVol=null);this.screenVolumes.splice(c,1);this.setCurrentScreenVol(this.screenVolumes.length-1);this.drawViewer(!0);this.container.toolbar.buildToolbar();this.container.toolbar.updateImageButtons();this.updateWindowTitle();this.hasSeries=!1;for(a=0;a<this.screenVolumes.length;a+=1)if(1<this.screenVolumes[a].volume.header.imageDimensions.timepoints){this.hasSeries=
!0;break}this.container.resizeViewerComponents()};papaya.viewer.Viewer.prototype.hasDefinedAtlas=function(){var c;return"undefined"!==typeof papaya.data&&(c=typeof papaya.data.Atlas,"undefined"!==c)?!0:!1};papaya.viewer.Viewer.prototype.loadAtlas=function(){null===this.atlas&&(this.atlas=new papaya.viewer.Atlas(papaya.data.Atlas,this.container,papaya.utilities.ObjectUtils.bind(this,this.atlasLoaded)))};
papaya.viewer.Viewer.prototype.isInsideMainSlice=function(c,a){this.updateOffsetRect();c-=this.canvasRect.left;a-=this.canvasRect.top;return this.mainImage===this.axialSlice?this.insideScreenSlice(this.axialSlice,c,a,this.volume.getXDim(),this.volume.getYDim()):this.mainImage===this.coronalSlice?this.insideScreenSlice(this.coronalSlice,c,a,this.volume.getXDim(),this.volume.getZDim()):this.mainImage===this.sagittalSlice?this.insideScreenSlice(this.sagittalSlice,c,a,this.volume.getYDim(),this.volume.getZDim()):
!1};
papaya.viewer.Viewer.prototype.updatePosition=function(c,a,d,f){var b,e;c.updateOffsetRect();b=a;e=d;a-=this.canvasRect.left;d-=this.canvasRect.top;if(this.insideScreenSlice(c.axialSlice,a,d,c.volume.getXDim(),c.volume.getYDim())){if(!this.isDragging||this.draggingSliceDir===papaya.viewer.ScreenSlice.DIRECTION_AXIAL)if(a=this.convertScreenToImageCoordinateX(a,c.axialSlice),d=this.convertScreenToImageCoordinateY(d,c.axialSlice),a!==c.currentCoord.x||d!==c.currentCoord.y)c.currentCoord.x=a,c.currentCoord.y=d,
this.draggingSliceDir=papaya.viewer.ScreenSlice.DIRECTION_AXIAL}else if(this.insideScreenSlice(c.coronalSlice,a,d,c.volume.getXDim(),c.volume.getZDim())){if(!this.isDragging||this.draggingSliceDir===papaya.viewer.ScreenSlice.DIRECTION_CORONAL)if(a=this.convertScreenToImageCoordinateX(a,c.coronalSlice),d=this.convertScreenToImageCoordinateY(d,c.coronalSlice),a!==c.currentCoord.x||d!==c.currentCoord.y)c.currentCoord.x=a,c.currentCoord.z=d,this.draggingSliceDir=papaya.viewer.ScreenSlice.DIRECTION_CORONAL}else if(this.insideScreenSlice(c.sagittalSlice,
a,d,c.volume.getYDim(),c.volume.getZDim())){if(!this.isDragging||this.draggingSliceDir===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL)if(a=this.convertScreenToImageCoordinateX(a,c.sagittalSlice),d=this.convertScreenToImageCoordinateY(d,c.sagittalSlice),a!==c.currentCoord.x||d!==c.currentCoord.y)c.currentCoord.y=a,c.currentCoord.z=d,this.draggingSliceDir=papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL}else c.surfaceView&&this.insideScreenSlice(c.surfaceView,a,d,c.surfaceView.screenDim,c.surfaceView.screenDim)&&
c.surfaceView.updateDynamic(b,e,this.selectedSlice===this.mainImage?1:3);this.container.coordinateChanged(this);c.drawViewer(!1,f)};papaya.viewer.Viewer.prototype.convertScreenToImageCoordinateX=function(c,a){return papaya.viewer.Viewer.validDimBounds(papayaFloorFast((c-a.finalTransform[0][2])/a.finalTransform[0][0]),a.xDim)};
papaya.viewer.Viewer.prototype.convertScreenToImageCoordinateY=function(c,a){return papaya.viewer.Viewer.validDimBounds(papayaFloorFast((c-a.finalTransform[1][2])/a.finalTransform[1][1]),a.yDim)};
papaya.viewer.Viewer.prototype.convertScreenToImageCoordinate=function(c,a,d){var f,b,e;void 0===d&&(d=this.mainImage);d.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(f=this.convertScreenToImageCoordinateX(c,d),b=this.convertScreenToImageCoordinateY(a,d),e=this.axialSlice.currentSlice):d.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(f=this.convertScreenToImageCoordinateX(c,d),e=this.convertScreenToImageCoordinateY(a,d),b=this.coronalSlice.currentSlice):d.sliceDirection===
papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(b=this.convertScreenToImageCoordinateX(c,d),e=this.convertScreenToImageCoordinateY(a,d),f=this.sagittalSlice.currentSlice);return new papaya.core.Coordinate(f,b,e)};papaya.viewer.Viewer.prototype.convertCurrentCoordinateToScreen=function(c){return this.convertCoordinateToScreen(this.currentCoord,c)};
papaya.viewer.Viewer.prototype.intersectsMainSlice=function(c){var a=this.mainImage.sliceDirection;return a===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?c.z===this.mainImage.currentSlice:a===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?c.y===this.mainImage.currentSlice:a===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL?c.x===this.mainImage.currentSlice:!1};
papaya.viewer.Viewer.prototype.convertCoordinateToScreen=function(c,a){var d,f,b;void 0===a&&(a=this.mainImage);b=a.sliceDirection;b===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(d=papayaFloorFast(a.finalTransform[0][2]+(c.x+.5)*a.finalTransform[0][0]),f=papayaFloorFast(a.finalTransform[1][2]+(c.y+.5)*a.finalTransform[1][1])):b===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(d=papayaFloorFast(a.finalTransform[0][2]+(c.x+.5)*a.finalTransform[0][0]),f=papayaFloorFast(a.finalTransform[1][2]+(c.z+.5)*a.finalTransform[1][1])):
b===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(d=papayaFloorFast(a.finalTransform[0][2]+(c.y+.5)*a.finalTransform[0][0]),f=papayaFloorFast(a.finalTransform[1][2]+(c.z+.5)*a.finalTransform[1][1]));return new papaya.core.Point(d,f)};
papaya.viewer.Viewer.prototype.updateCursorPosition=function(c,a,d){var f,b,e,h=null,g;this.container.display&&(a-=this.canvasRect.left,d-=this.canvasRect.top,this.insideScreenSlice(c.axialSlice,a,d,c.volume.getXDim(),c.volume.getYDim())?(f=this.convertScreenToImageCoordinateX(a,c.axialSlice),b=this.convertScreenToImageCoordinateY(d,c.axialSlice),e=c.axialSlice.currentSlice,g=!0):this.insideScreenSlice(c.coronalSlice,a,d,c.volume.getXDim(),c.volume.getZDim())?(f=this.convertScreenToImageCoordinateX(a,
c.coronalSlice),e=this.convertScreenToImageCoordinateY(d,c.coronalSlice),b=c.coronalSlice.currentSlice,g=!0):this.insideScreenSlice(c.sagittalSlice,a,d,c.volume.getYDim(),c.volume.getZDim())?(b=this.convertScreenToImageCoordinateX(a,c.sagittalSlice),e=this.convertScreenToImageCoordinateY(d,c.sagittalSlice),f=c.sagittalSlice.currentSlice,g=!0):this.insideScreenSlice(c.surfaceView,a,d)&&(a-=c.surfaceView.screenOffsetX,d-=c.surfaceView.screenOffsetY,h=this.surfaceView.pick(a,d))&&(this.getIndexCoordinateAtWorld(h.coordinate[0],
h.coordinate[1],h.coordinate[2],this.tempCoor),f=this.tempCoor.x,b=this.tempCoor.y,e=this.tempCoor.z,g=!0),g?(this.cursorPosition.x=f,this.cursorPosition.y=b,this.cursorPosition.z=e,this.container.display.drawDisplay(f,b,e)):this.container.display.drawEmptyDisplay())};
papaya.viewer.Viewer.prototype.insideScreenSlice=function(c,a,d,f,b){var e,h;if(!c)return!1;c===this.surfaceView?(e=c.screenOffsetX,f=c.screenOffsetX+c.screenDim,h=c.screenOffsetY,c=c.screenOffsetY+c.screenDim):(e=papayaRoundFast(c.screenTransform[0][2]),f=papayaRoundFast(c.screenTransform[0][2]+f*c.screenTransform[0][0]),h=papayaRoundFast(c.screenTransform[1][2]),c=papayaRoundFast(c.screenTransform[1][2]+b*c.screenTransform[1][1]));return a>=e&&a<f&&d>=h&&d<c};
papaya.viewer.Viewer.prototype.drawEmptyViewer=function(){var c,a,d;this.context.fillStyle="#000000";this.context.fillRect(0,0,this.canvas.width,this.canvas.height);this.context.fillStyle="#AAAAAA";this.container.readyForDnD()&&(this.context.font="18px sans-serif",c=this.canvas.height-22,a="Drop here or click the File menu",d=this.context.measureText(a),d=d.width,this.context.fillText(a,this.canvas.width/2-d/2,c));900<this.canvas.width&&(this.context.font="14px sans-serif",c=this.canvas.height-20,
a="Supported formats: NIFTI"+(papaya.Container.DICOM_SUPPORT?", DICOM":""),this.context.fillText(a,20,c),this.context.font="14px sans-serif",c=this.canvas.height-20,a="Papaya (Build "+PAPAYA_BUILD_NUM+")",d=this.context.measureText(a),d=d.width,this.context.fillText(a,this.canvas.width-d-20,c))};
papaya.viewer.Viewer.prototype.drawViewer=function(c,a){var d="Yes"===this.container.preferences.radiological,f="Yes"===this.container.preferences.showOrientation;this.initialized?(this.context.save(),a?(this.axialSlice.repaint(this.currentCoord.z,c,this.worldSpace),this.coronalSlice.repaint(this.currentCoord.y,c,this.worldSpace),this.sagittalSlice.repaint(this.currentCoord.x,c,this.worldSpace)):((c||this.draggingSliceDir!==papaya.viewer.ScreenSlice.DIRECTION_AXIAL)&&this.axialSlice.updateSlice(this.currentCoord.z,
c,this.worldSpace),(c||this.draggingSliceDir!==papaya.viewer.ScreenSlice.DIRECTION_CORONAL)&&this.coronalSlice.updateSlice(this.currentCoord.y,c,this.worldSpace),(c||this.draggingSliceDir!==papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL)&&this.sagittalSlice.updateSlice(this.currentCoord.x,c,this.worldSpace)),!this.hasSurface()||papaya.utilities.PlatformUtils.smallScreen&&!c&&this.selectedSlice!==this.surfaceView||this.surfaceView.draw(),"No"===this.container.preferences.smoothDisplay?(this.context.imageSmoothingEnabled=
!1,this.context.webkitImageSmoothingEnabled=!1,this.context.mozImageSmoothingEnabled=!1,this.context.msImageSmoothingEnabled=!1):(this.context.imageSmoothingEnabled=!0,this.context.webkitImageSmoothingEnabled=!0,this.context.mozImageSmoothingEnabled=!0,this.context.msImageSmoothingEnabled=!0),this.drawScreenSlice(this.mainImage),this.container.orthogonal&&(this.drawScreenSlice(this.lowerImageTop),this.drawScreenSlice(this.lowerImageBot),this.hasSurface()&&this.drawScreenSlice(this.lowerImageBot2)),
(f||d)&&this.drawOrientation(),"Yes"===this.container.preferences.showCrosshairs&&this.drawCrosshairs(),"Yes"===this.container.preferences.showRuler&&this.drawRuler(),this.container.display&&this.container.display.drawDisplay(this.currentCoord.x,this.currentCoord.y,this.currentCoord.z,this.getCurrentValueAt(this.currentCoord.x,this.currentCoord.y,this.currentCoord.z)),this.container.contextManager&&this.container.contextManager.drawToViewer&&this.container.contextManager.drawToViewer(this.context)):
this.drawEmptyViewer()};papaya.viewer.Viewer.prototype.hasSurface=function(){return this.container.hasSurface()&&this.surfaceView&&this.surfaceView.initialized};
papaya.viewer.Viewer.prototype.drawScreenSlice=function(c){var a,d;c===this.surfaceView?(this.context.fillStyle=this.surfaceView.getBackgroundColor(),this.context.fillRect(c.screenOffsetX,c.screenOffsetY,c.screenDim,c.screenDim),this.context.drawImage(c.canvas,c.screenOffsetX,c.screenOffsetY),"Yes"===this.container.preferences.showRuler&&this.surfaceView===this.mainImage&&(this.context.font=papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE+"px sans-serif",a=this.context.measureText("Ruler Length: ").width,
d=this.context.measureText("Ruler Length: 000.00").width,d/=2,this.context.fillStyle="#ffb3db",this.context.fillText("Ruler Length:  ",c.screenDim/2-d/2,papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE+5),this.context.fillStyle="#FFFFFF",this.context.fillText(this.surfaceView.getRulerLength().toFixed(2),c.screenDim/2+a-d/2,papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE+5))):(this.context.fillStyle=papaya.viewer.Viewer.BACKGROUND_COLOR,this.context.setTransform(1,0,0,1,0,0),this.context.fillRect(c.screenOffsetX,
c.screenOffsetY,c.screenDim,c.screenDim),this.context.save(),this.context.beginPath(),this.context.rect(c.screenOffsetX,c.screenOffsetY,c.screenDim,c.screenDim),this.context.clip(),this.context.setTransform(c.finalTransform[0][0],0,0,c.finalTransform[1][1],c.finalTransform[0][2],c.finalTransform[1][2]),this.context.drawImage(c.canvasMain,0,0),this.context.restore(),c.canvasDTILines&&this.context.drawImage(c.canvasDTILines,c.screenOffsetX,c.screenOffsetY))};
papaya.viewer.Viewer.prototype.drawOrientation=function(){var c,a,d,f,b,e,h,g,k,l,q,t="Yes"===this.container.preferences.showOrientation;if(this.mainImage!==this.surfaceView){this.context.setTransform(1,0,0,1,0,0);this.context.fillStyle=this.getOrientationCertaintyColor();this.context.font=papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE+"px sans-serif";c=this.context.measureText("X");c=c.width;a="Yes"===this.container.preferences.radiological;this.mainImage===this.axialSlice?(d=papaya.viewer.Viewer.ORIENTATION_MARKER_ANTERIOR,
f=papaya.viewer.Viewer.ORIENTATION_MARKER_POSTERIOR,a?(b=papaya.viewer.Viewer.ORIENTATION_MARKER_RIGHT,e=papaya.viewer.Viewer.ORIENTATION_MARKER_LEFT):(b=papaya.viewer.Viewer.ORIENTATION_MARKER_LEFT,e=papaya.viewer.Viewer.ORIENTATION_MARKER_RIGHT)):this.mainImage===this.coronalSlice?(d=papaya.viewer.Viewer.ORIENTATION_MARKER_SUPERIOR,f=papaya.viewer.Viewer.ORIENTATION_MARKER_INFERIOR,a?(b=papaya.viewer.Viewer.ORIENTATION_MARKER_RIGHT,e=papaya.viewer.Viewer.ORIENTATION_MARKER_LEFT):(b=papaya.viewer.Viewer.ORIENTATION_MARKER_LEFT,
e=papaya.viewer.Viewer.ORIENTATION_MARKER_RIGHT)):this.mainImage===this.sagittalSlice&&(d=papaya.viewer.Viewer.ORIENTATION_MARKER_SUPERIOR,f=papaya.viewer.Viewer.ORIENTATION_MARKER_INFERIOR,b=papaya.viewer.Viewer.ORIENTATION_MARKER_ANTERIOR,e=papaya.viewer.Viewer.ORIENTATION_MARKER_POSTERIOR);a=this.mainImage.screenOffsetX;h=this.mainImage.screenOffsetX+this.mainImage.screenDim;g=Math.round(h/2);k=this.mainImage.screenOffsetY;l=this.mainImage.screenOffsetY+this.mainImage.screenDim;q=Math.round(l/
2);if(t||this.mainImage.isRadiologicalSensitive())this.context.fillText(b,a+papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE,q+.5*papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE),this.context.fillText(e,h-1.5*papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE,q+.5*papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE);t&&(this.context.fillText(d,g-c/2,k+1.5*papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE),this.context.fillText(f,g-c/2,l-papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE))}};
papaya.viewer.Viewer.prototype.drawRuler=function(){var c,a,d,f,b,e;this.mainImage!==this.surfaceView&&(this.mainImage===this.axialSlice?(c=this.axialSlice.finalTransform[0][2]+(this.axialSlice.rulerPoints[0].x+.5)*this.axialSlice.finalTransform[0][0],a=this.axialSlice.finalTransform[1][2]+(this.axialSlice.rulerPoints[0].y+.5)*this.axialSlice.finalTransform[1][1],d=this.axialSlice.finalTransform[0][2]+(this.axialSlice.rulerPoints[1].x+.5)*this.axialSlice.finalTransform[0][0],f=this.axialSlice.finalTransform[1][2]+
(this.axialSlice.rulerPoints[1].y+.5)*this.axialSlice.finalTransform[1][1]):this.mainImage===this.coronalSlice?(c=this.coronalSlice.finalTransform[0][2]+(this.coronalSlice.rulerPoints[0].x+.5)*this.coronalSlice.finalTransform[0][0],a=this.coronalSlice.finalTransform[1][2]+(this.coronalSlice.rulerPoints[0].y+.5)*this.coronalSlice.finalTransform[1][1],d=this.coronalSlice.finalTransform[0][2]+(this.coronalSlice.rulerPoints[1].x+.5)*this.coronalSlice.finalTransform[0][0],f=this.coronalSlice.finalTransform[1][2]+
(this.coronalSlice.rulerPoints[1].y+.5)*this.coronalSlice.finalTransform[1][1]):this.mainImage===this.sagittalSlice&&(c=this.sagittalSlice.finalTransform[0][2]+(this.sagittalSlice.rulerPoints[0].x+.5)*this.sagittalSlice.finalTransform[0][0],a=this.sagittalSlice.finalTransform[1][2]+(this.sagittalSlice.rulerPoints[0].y+.5)*this.sagittalSlice.finalTransform[1][1],d=this.sagittalSlice.finalTransform[0][2]+(this.sagittalSlice.rulerPoints[1].x+.5)*this.sagittalSlice.finalTransform[0][0],f=this.sagittalSlice.finalTransform[1][2]+
(this.sagittalSlice.rulerPoints[1].y+.5)*this.sagittalSlice.finalTransform[1][1]),this.context.setTransform(1,0,0,1,0,0),this.context.strokeStyle="#FF1493",this.context.fillStyle="#FF1493",this.context.lineWidth=2,this.context.save(),this.context.beginPath(),this.context.moveTo(c,a),this.context.lineTo(d,f),this.context.stroke(),this.context.closePath(),this.context.beginPath(),this.context.arc(c,a,3,0,2*Math.PI,!1),this.context.arc(d,f,3,0,2*Math.PI,!1),this.context.fill(),this.context.closePath(),
b=papaya.utilities.StringUtils.formatNumber(papaya.utilities.MathUtils.lineDistance(this.mainImage.rulerPoints[0].x*this.mainImage.xSize,this.mainImage.rulerPoints[0].y*this.mainImage.ySize,this.mainImage.rulerPoints[1].x*this.mainImage.xSize,this.mainImage.rulerPoints[1].y*this.mainImage.ySize),!1),e=this.context.measureText(b),e=e.width,c=parseInt((c+d)/2)-e/2,a=parseInt((a+f)/2)+7,this.context.fillStyle="#FFFFFF",papaya.viewer.Viewer.drawRoundRect(this.context,c-2,a-14-2+1,e+4,18,5,!0,!1),this.context.font=
papaya.viewer.Viewer.ORIENTATION_MARKER_SIZE+"px sans-serif",this.context.strokeStyle="#FF1493",this.context.fillStyle="#FF1493",this.context.fillText(b,c,a))};
papaya.viewer.Viewer.prototype.drawCrosshairs=function(){var c,a,d;this.context.setTransform(1,0,0,1,0,0);this.context.strokeStyle=papaya.viewer.Viewer.CROSSHAIRS_COLOR;this.context.lineWidth=1;if(this.mainImage!==this.axialSlice||this.toggleMainCrosshairs)this.context.save(),this.context.beginPath(),this.context.rect(this.axialSlice.screenOffsetX,this.axialSlice.screenOffsetY,this.axialSlice.screenDim,this.axialSlice.screenDim),this.context.closePath(),this.context.clip(),this.context.beginPath(),
c=this.axialSlice.finalTransform[0][2]+(this.currentCoord.x+.5)*this.axialSlice.finalTransform[0][0],a=this.axialSlice.finalTransform[1][2],d=this.axialSlice.finalTransform[1][2]+this.axialSlice.yDim*this.axialSlice.finalTransform[1][1],this.context.moveTo(c,a),this.context.lineTo(c,d),c=this.axialSlice.finalTransform[1][2]+(this.currentCoord.y+.5)*this.axialSlice.finalTransform[1][1],a=this.axialSlice.finalTransform[0][2],d=this.axialSlice.finalTransform[0][2]+this.axialSlice.xDim*this.axialSlice.finalTransform[0][0],
this.context.moveTo(a,c),this.context.lineTo(d,c),this.context.closePath(),this.context.stroke(),this.context.restore();if(this.mainImage!==this.coronalSlice||this.toggleMainCrosshairs)this.context.save(),this.context.beginPath(),this.context.rect(this.coronalSlice.screenOffsetX,this.coronalSlice.screenOffsetY,this.coronalSlice.screenDim,this.coronalSlice.screenDim),this.context.closePath(),this.context.clip(),this.context.beginPath(),c=this.coronalSlice.finalTransform[0][2]+(this.currentCoord.x+
.5)*this.coronalSlice.finalTransform[0][0],a=this.coronalSlice.finalTransform[1][2],d=this.coronalSlice.finalTransform[1][2]+this.coronalSlice.yDim*this.coronalSlice.finalTransform[1][1],this.context.moveTo(c,a),this.context.lineTo(c,d),c=this.coronalSlice.finalTransform[1][2]+(this.currentCoord.z+.5)*this.coronalSlice.finalTransform[1][1],a=this.coronalSlice.finalTransform[0][2],d=this.coronalSlice.finalTransform[0][2]+this.coronalSlice.xDim*this.coronalSlice.finalTransform[0][0],this.context.moveTo(a,
c),this.context.lineTo(d,c),this.context.closePath(),this.context.stroke(),this.context.restore();if(this.mainImage!==this.sagittalSlice||this.toggleMainCrosshairs)this.context.save(),this.context.beginPath(),this.context.rect(this.sagittalSlice.screenOffsetX,this.sagittalSlice.screenOffsetY,this.sagittalSlice.screenDim,this.sagittalSlice.screenDim),this.context.closePath(),this.context.clip(),this.context.beginPath(),c=this.sagittalSlice.finalTransform[0][2]+(this.currentCoord.y+.5)*this.sagittalSlice.finalTransform[0][0],
a=this.sagittalSlice.finalTransform[1][2],d=this.sagittalSlice.finalTransform[1][2]+this.sagittalSlice.yDim*this.sagittalSlice.finalTransform[1][1],this.context.moveTo(c,a),this.context.lineTo(c,d),c=this.sagittalSlice.finalTransform[1][2]+(this.currentCoord.z+.5)*this.sagittalSlice.finalTransform[1][1],a=this.sagittalSlice.finalTransform[0][2],d=this.sagittalSlice.finalTransform[0][2]+this.sagittalSlice.xDim*this.sagittalSlice.finalTransform[0][0],this.context.moveTo(a,c),this.context.lineTo(d,c),
this.context.closePath(),this.context.stroke(),this.context.restore()};
papaya.viewer.Viewer.prototype.calculateScreenSliceTransforms=function(){this.container.orthogonalTall?this.container.hasSurface()?(this.viewerDim=this.canvas.height/1.333,this.getTransformParameters(this.mainImage,this.viewerDim,!1,3),this.mainImage.screenTransform[0][2]+=this.mainImage.screenOffsetX=0,this.mainImage.screenTransform[1][2]+=this.mainImage.screenOffsetY=0,this.getTransformParameters(this.lowerImageTop,this.viewerDim,!0,3),this.lowerImageTop.screenTransform[0][2]+=this.lowerImageTop.screenOffsetX=
0,this.lowerImageTop.screenTransform[1][2]+=this.lowerImageTop.screenOffsetY=this.viewerDim+papaya.viewer.Viewer.GAP,this.getTransformParameters(this.lowerImageBot,this.viewerDim,!0,3),this.lowerImageBot.screenTransform[0][2]+=this.lowerImageBot.screenOffsetX=(this.viewerDim-papaya.viewer.Viewer.GAP)/3+papaya.viewer.Viewer.GAP,this.lowerImageBot.screenTransform[1][2]+=this.lowerImageBot.screenOffsetY=this.viewerDim+papaya.viewer.Viewer.GAP,this.getTransformParameters(this.lowerImageBot2,this.viewerDim,
!0,3),this.lowerImageBot2.screenTransform[0][2]+=this.lowerImageBot2.screenOffsetX=2*((this.viewerDim-papaya.viewer.Viewer.GAP)/3+papaya.viewer.Viewer.GAP),this.lowerImageBot2.screenTransform[1][2]+=this.lowerImageBot2.screenOffsetY=this.viewerDim+papaya.viewer.Viewer.GAP):(this.viewerDim=this.canvas.height/1.5,this.getTransformParameters(this.mainImage,this.viewerDim,!1,2),this.mainImage.screenTransform[0][2]+=this.mainImage.screenOffsetX=0,this.mainImage.screenTransform[1][2]+=this.mainImage.screenOffsetY=
0,this.getTransformParameters(this.lowerImageBot,this.viewerDim,!0,2),this.lowerImageBot.screenTransform[0][2]+=this.lowerImageBot.screenOffsetX=0,this.lowerImageBot.screenTransform[1][2]+=this.lowerImageBot.screenOffsetY=this.viewerDim+papaya.viewer.Viewer.GAP,this.getTransformParameters(this.lowerImageTop,this.viewerDim,!0,2),this.lowerImageTop.screenTransform[0][2]+=this.lowerImageTop.screenOffsetX=(this.viewerDim-papaya.viewer.Viewer.GAP)/2+papaya.viewer.Viewer.GAP,this.lowerImageTop.screenTransform[1][2]+=
this.lowerImageTop.screenOffsetY=this.viewerDim+papaya.viewer.Viewer.GAP):(this.viewerDim=this.canvas.height,this.container.hasSurface()?(this.getTransformParameters(this.mainImage,this.viewerDim,!1,3),this.mainImage.screenTransform[0][2]+=this.mainImage.screenOffsetX=0,this.mainImage.screenTransform[1][2]+=this.mainImage.screenOffsetY=0,this.getTransformParameters(this.lowerImageTop,this.viewerDim,!0,3),this.lowerImageTop.screenTransform[0][2]+=this.lowerImageTop.screenOffsetX=this.viewerDim+papaya.viewer.Viewer.GAP,
this.lowerImageTop.screenTransform[1][2]+=this.lowerImageTop.screenOffsetY=0,this.getTransformParameters(this.lowerImageBot,this.viewerDim,!0,3),this.lowerImageBot.screenTransform[0][2]+=this.lowerImageBot.screenOffsetX=this.viewerDim+papaya.viewer.Viewer.GAP,this.lowerImageBot.screenTransform[1][2]+=this.lowerImageBot.screenOffsetY=(this.viewerDim-papaya.viewer.Viewer.GAP)/3+papaya.viewer.Viewer.GAP,this.getTransformParameters(this.lowerImageBot2,this.viewerDim,!0,3),this.lowerImageBot2.screenTransform[0][2]+=
this.lowerImageBot2.screenOffsetX=this.viewerDim+papaya.viewer.Viewer.GAP,this.lowerImageBot2.screenTransform[1][2]+=this.lowerImageBot2.screenOffsetY=(this.viewerDim-papaya.viewer.Viewer.GAP)/3*2+2*papaya.viewer.Viewer.GAP):(this.getTransformParameters(this.mainImage,this.viewerDim,!1,2),this.mainImage.screenTransform[0][2]+=this.mainImage.screenOffsetX=0,this.mainImage.screenTransform[1][2]+=this.mainImage.screenOffsetY=0,this.getTransformParameters(this.lowerImageBot,this.viewerDim,!0,2),this.lowerImageBot.screenTransform[0][2]+=
this.lowerImageBot.screenOffsetX=this.viewerDim+papaya.viewer.Viewer.GAP,this.lowerImageBot.screenTransform[1][2]+=this.lowerImageBot.screenOffsetY=(this.viewerDim-papaya.viewer.Viewer.GAP)/2+papaya.viewer.Viewer.GAP,this.getTransformParameters(this.lowerImageTop,this.viewerDim,!0,2),this.lowerImageTop.screenTransform[0][2]+=this.lowerImageTop.screenOffsetX=this.viewerDim+papaya.viewer.Viewer.GAP,this.lowerImageTop.screenTransform[1][2]+=this.lowerImageTop.screenOffsetY=0));this.updateScreenSliceTransforms()};
papaya.viewer.Viewer.prototype.updateScreenSliceTransforms=function(){this.axialSlice.updateFinalTransform();this.coronalSlice.updateFinalTransform();this.sagittalSlice.updateFinalTransform()};
papaya.viewer.Viewer.prototype.getTransformParameters=function(c,a,d,f){var b,e,h,g;b=d?f:1;c===this.surfaceView?this.surfaceView.resize(this.viewerDim/b):(c.getRealWidth()>c.getRealHeight()?(e=(d?a-papaya.viewer.Viewer.GAP:a)/this.longestDim/b*(c.getXSize()/this.longestDimSize),h=(d?a-papaya.viewer.Viewer.GAP:a)/this.longestDim*c.getYXratio()/b*(c.getXSize()/this.longestDimSize)):(e=(d?a-papaya.viewer.Viewer.GAP:a)/this.longestDim*c.getXYratio()/b*(c.getYSize()/this.longestDimSize),h=(d?a-papaya.viewer.Viewer.GAP:
a)/this.longestDim/b*(c.getYSize()/this.longestDimSize)),g=((d?a-papaya.viewer.Viewer.GAP:a)/b-c.getXDim()*e)/2,b=((d?a-papaya.viewer.Viewer.GAP:a)/b-c.getYDim()*h)/2,c.screenDim=d?(a-papaya.viewer.Viewer.GAP)/f:a,c.screenTransform[0][0]=e,c.screenTransform[1][1]=h,c.screenTransform[0][2]=g,c.screenTransform[1][2]=b,c.screenTransform2[0][0]=e,c.screenTransform2[1][1]=h,c.screenTransform2[0][2]=g,c.screenTransform2[1][2]=b)};
papaya.viewer.Viewer.prototype.setLongestDim=function(c){this.longestDim=c.getXDim();this.longestDimSize=c.getXSize();c.getYDim()*c.getYSize()>this.longestDim*this.longestDimSize&&(this.longestDim=c.getYDim(),this.longestDimSize=c.getYSize());c.getZDim()*c.getZSize()>this.longestDim*this.longestDimSize&&(this.longestDim=c.getZDim(),this.longestDimSize=c.getZSize())};
papaya.viewer.Viewer.prototype.keyDownEvent=function(c){var a;this.keyPressIgnored=!1;this.container.toolbar.isShowingMenus()||(1<papayaContainers.length||papayaContainers[0].nestedViewer)&&papaya.Container.papayaLastHoveredViewer!==this||(a=papaya.viewer.Viewer.getKeyCode(c),papaya.viewer.Viewer.isControlKey(c)?this.isControlKeyDown=!0:papaya.viewer.Viewer.isAltKey(c)?this.isAltKeyDown=!0:papaya.viewer.Viewer.isShiftKey(c)?this.isShiftKeyDown=!0:a===papaya.viewer.Viewer.KEYCODE_ROTATE_VIEWS?this.rotateViews():
a===papaya.viewer.Viewer.KEYCODE_CENTER?(a=new papaya.core.Coordinate(Math.floor(this.volume.header.imageDimensions.xDim/2),Math.floor(this.volume.header.imageDimensions.yDim/2),Math.floor(this.volume.header.imageDimensions.zDim/2)),this.gotoCoordinate(a)):a===papaya.viewer.Viewer.KEYCODE_ORIGIN?this.gotoCoordinate(this.volume.header.origin):a===papaya.viewer.Viewer.KEYCODE_ARROW_UP?this.incrementCoronal(!1):a===papaya.viewer.Viewer.KEYCODE_ARROW_DOWN?this.incrementCoronal(!0):a===papaya.viewer.Viewer.KEYCODE_ARROW_LEFT?
this.incrementSagittal(!0):a===papaya.viewer.Viewer.KEYCODE_ARROW_RIGHT?this.incrementSagittal(!1):a===papaya.viewer.Viewer.KEYCODE_PAGE_DOWN||a===papaya.viewer.Viewer.KEYCODE_FORWARD_SLASH?this.incrementAxial(!0):a===papaya.viewer.Viewer.KEYCODE_PAGE_UP||a===papaya.viewer.Viewer.KEYCODE_SINGLE_QUOTE?this.incrementAxial(!1):a===papaya.viewer.Viewer.KEYCODE_INCREMENT_MAIN?this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?this.incrementAxial(!1):this.mainImage.sliceDirection===
papaya.viewer.ScreenSlice.DIRECTION_CORONAL?this.incrementCoronal(!1):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&this.incrementSagittal(!0):a===papaya.viewer.Viewer.KEYCODE_DECREMENT_MAIN?this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?this.incrementAxial(!0):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?this.incrementCoronal(!0):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&
this.incrementSagittal(!1):a===papaya.viewer.Viewer.KEYCODE_TOGGLE_CROSSHAIRS?"Yes"===this.container.preferences.showCrosshairs&&(this.toggleMainCrosshairs=!this.toggleMainCrosshairs,this.drawViewer(!0)):a===papaya.viewer.Viewer.KEYCODE_SERIES_FORWARD?this.incrementSeriesPoint():a===papaya.viewer.Viewer.KEYCODE_SERIES_BACK?this.decrementSeriesPoint():this.keyPressIgnored=!0,this.keyPressIgnored||(c.handled=!0,c.preventDefault()))};
papaya.viewer.Viewer.prototype.keyUpEvent=function(c){1<papayaContainers.length&&papaya.Container.papayaLastHoveredViewer!==this||(this.isShiftKeyDown=this.isAltKeyDown=this.isControlKeyDown=!1,this.keyPressIgnored||(c.handled=!0,c.preventDefault()),this.hasSurface()&&papaya.utilities.PlatformUtils.smallScreen&&this.drawViewer(!0,!1))};
papaya.viewer.Viewer.prototype.rotateViews=function(){var c;this.container.contextManager&&this.container.contextManager.clearContext&&this.container.contextManager.clearContext();this.hasSurface()?(c=this.lowerImageBot2,this.lowerImageBot2=this.lowerImageBot):c=this.lowerImageBot;this.lowerImageBot=this.lowerImageTop;this.lowerImageTop=this.mainImage;this.mainImage=c;this.viewsChanged()};
papaya.viewer.Viewer.prototype.viewsChanged=function(){this.calculateScreenSliceTransforms();this.hasSurface()&&this.lowerImageBot2.clearDTILinesImage();this.lowerImageBot.clearDTILinesImage();this.lowerImageTop.clearDTILinesImage();this.mainImage.clearDTILinesImage();this.controlsHidden||(this.mainImage!==this.surfaceView?this.fadeInControls():($("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex).fadeOut(),$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+this.container.containerIndex).fadeOut()),
$("#"+PAPAYA_DEFAULT_SLIDER_ID+this.container.containerIndex+"main").find("button").prop("disabled",this.mainImage===this.surfaceView));this.drawViewer(!0);this.updateSliceSliderControl()};papaya.viewer.Viewer.prototype.timepointChanged=function(){this.drawViewer(!0);this.updateSliceSliderControl();this.updateWindowTitle()};
papaya.viewer.Viewer.prototype.resetUpdateTimer=function(c){var a=this;null!==this.updateTimer&&(window.clearTimeout(this.updateTimer),this.updateTimerEvent=this.updateTimer=null);null!==c&&(this.updateTimerEvent=c,this.updateTimer=window.setTimeout(papaya.utilities.ObjectUtils.bind(a,function(){a.updatePosition(this,papaya.utilities.PlatformUtils.getMousePositionX(a.updateTimerEvent),papaya.utilities.PlatformUtils.getMousePositionY(a.updateTimerEvent))}),papaya.viewer.Viewer.UPDATE_TIMER_INTERVAL))};
papaya.viewer.Viewer.prototype.mouseDownEvent=function(c){var a=!0,d;papaya.Container.allowPropagation||c.stopPropagation();c.preventDefault();if(this.showingContextMenu)this.container.toolbar.closeAllMenus(),c.handled=!0;else if("IMG"===c.target.nodeName||"CANVAS"===c.target.nodeName)!0!==c.handled&&(this.container.toolbar.closeAllMenus(),this.previousMousePosition.x=papaya.utilities.PlatformUtils.getMousePositionX(c),this.previousMousePosition.y=papaya.utilities.PlatformUtils.getMousePositionY(c),
this.findClickedSlice(this,this.previousMousePosition.x,this.previousMousePosition.y),(2===c.button||this.isControlKeyDown||this.isLongTouch)&&this.container.contextManager&&this.selectedSlice===this.mainImage&&this.mainImage===this.surfaceView?(this.contextMenuMousePositionX=this.previousMousePosition.x-this.canvasRect.left,this.contextMenuMousePositionY=this.previousMousePosition.y-this.canvasRect.top,this.container.contextManager.prefersColorPicking&&this.container.contextManager.prefersColorPicking()&&
(d=this.surfaceView.pickColor(this.contextMenuMousePositionX,this.contextMenuMousePositionY),d=this.container.contextManager.getContextAtColor(d[0],d[1],d[2])),d&&(this.isContextMode=!0,d=this.container.toolbar.buildMenu(d,null,null,null,!0),papaya.ui.Toolbar.applyContextState(d),a=!1,d.showMenu(),this.showingContextMenu=!0),this.isContextMode=!0):(2===c.button||this.isControlKeyDown||this.isLongTouch)&&this.container.contextManager&&this.selectedSlice===this.mainImage?(this.isLongTouch?(d=this.convertCurrentCoordinateToScreen(this.mainImage),
this.contextMenuMousePositionX=d.x,this.contextMenuMousePositionY=d.y,d=this.container.contextManager.getContextAtImagePosition(this.currentCoord.x,this.currentCoord.y,this.currentCoord.z)):(this.contextMenuMousePositionX=this.previousMousePosition.x-this.canvasRect.left,this.contextMenuMousePositionY=this.previousMousePosition.y-this.canvasRect.top,d=this.container.contextManager.getContextAtImagePosition(this.cursorPosition.x,this.cursorPosition.y,this.cursorPosition.z)),d&&(this.isContextMode=
!0,d=this.container.toolbar.buildMenu(d,null,null,null,!0),papaya.ui.Toolbar.applyContextState(d),a=!1,d.showMenu(),this.showingContextMenu=!0)):2!==c.button&&!this.isControlKeyDown||this.currentScreenVolume.rgb||this.container.kioskMode?this.isAltKeyDown&&this.selectedSlice?(this.isZoomMode=!0,this.selectedSlice===this.surfaceView?(this.isPanning=this.isShiftKeyDown,this.surfaceView.setStartDynamic(this.previousMousePosition.x,this.previousMousePosition.y)):this.isZooming()&&this.isShiftKeyDown?
(this.isPanning=!0,this.setStartPanLocation(this.convertScreenToImageCoordinateX(this.previousMousePosition.x,this.selectedSlice),this.convertScreenToImageCoordinateY(this.previousMousePosition.y,this.selectedSlice),this.selectedSlice.sliceDirection)):this.setZoomLocation()):this.selectedSlice&&this.selectedSlice!==this.surfaceView?(this.grabbedHandle=this.selectedSlice.findProximalRulerHandle(this.convertScreenToImageCoordinateX(this.previousMousePosition.x-this.canvasRect.left,this.selectedSlice),
this.convertScreenToImageCoordinateY(this.previousMousePosition.y-this.canvasRect.top,this.selectedSlice)),null===this.grabbedHandle&&(this.updatePosition(this,papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c),!1),this.resetUpdateTimer(c))):this.selectedSlice&&this.selectedSlice===this.surfaceView&&(this.surfaceView.findProximalRulerHandle(this.previousMousePosition.x-this.canvasRect.left,this.previousMousePosition.y-this.canvasRect.top)||(this.isPanning=
this.isShiftKeyDown,this.surfaceView.setStartDynamic(this.previousMousePosition.x,this.previousMousePosition.y)),this.container.display.drawEmptyDisplay()):(this.isWindowControl=!0,this.container.showImageButtons&&(this.container.showControlBar||!this.container.kioskMode)&&this.screenVolumes[this.getCurrentScreenVolIndex()].supportsDynamicColorTable()&&this.container.toolbar.showImageMenu(this.getCurrentScreenVolIndex())),this.isDragging=a,c.handled=!0),this.controlsHidden||(this.controlsHiddenPrimed=
!0)};
papaya.viewer.Viewer.prototype.mouseUpEvent=function(c){papaya.Container.allowPropagation||c.stopPropagation();c.preventDefault();this.showingContextMenu?(this.showingContextMenu=!1,c.handled=!0):("IMG"!==c.target.nodeName&&"CANVAS"!==c.target.nodeName||!0===c.handled||(this.isWindowControl||this.isZoomMode||this.isContextMode||null!==this.grabbedHandle||this.surfaceView&&-1!==this.surfaceView.grabbedRulerPoint||this.updatePosition(this,papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c)),this.selectedSlice===
this.surfaceView&&this.updateCursorPosition(this,papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c)),this.zoomFactorPrevious=this.zoomFactor,this.isPanning=this.isZoomMode=this.isWindowControl=this.isDragging=!1,this.selectedSlice=null,this.controlsHiddenPrimed=!1,c.handled=!0),this.grabbedHandle=null,this.isContextMode=!1,this.updateWindowTitle(),this.updateSliceSliderControl(),this.container.toolbar.closeAllMenus(!0),this.hasSurface()&&(-1===
this.surfaceView.grabbedRulerPoint?this.surfaceView.updateCurrent():this.surfaceView.grabbedRulerPoint=-1,papaya.utilities.PlatformUtils.smallScreen&&this.drawViewer(!0,!1)),this.controlsHidden&&(this.controlsHidden=!1,this.fadeInControls()))};
papaya.viewer.Viewer.prototype.fadeOutControls=function(){$("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex).fadeOut();$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+this.container.containerIndex).fadeOut();$("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+this.container.containerIndex).fadeOut();$("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+this.container.containerIndex).fadeOut();$("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+this.container.containerIndex).fadeOut()};
papaya.viewer.Viewer.prototype.fadeInControls=function(){600>this.container.getViewerDimensions()[0]?(this.mainImage!==this.surfaceView&&($("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex).fadeIn(),$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+this.container.containerIndex).fadeIn()),$("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+this.container.containerIndex).fadeIn()):(this.mainImage!==this.surfaceView&&($("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex).fadeIn(),
$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+this.container.containerIndex).fadeIn()),$("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+this.container.containerIndex).fadeIn(),$("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+this.container.containerIndex).fadeIn(),$("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+this.container.containerIndex).fadeIn())};
papaya.viewer.Viewer.prototype.findClickedSlice=function(c,a,d){a-=this.canvasRect.left;d-=this.canvasRect.top;this.insideScreenSlice(c.axialSlice,a,d,c.volume.getXDim(),c.volume.getYDim())?this.selectedSlice=this.axialSlice:this.insideScreenSlice(c.coronalSlice,a,d,c.volume.getXDim(),c.volume.getZDim())?this.selectedSlice=this.coronalSlice:this.insideScreenSlice(c.sagittalSlice,a,d,c.volume.getYDim(),c.volume.getZDim())?this.selectedSlice=this.sagittalSlice:this.insideScreenSlice(c.surfaceView,a,
d,c.volume.getYDim(),c.volume.getZDim())?this.selectedSlice=this.surfaceView:this.selectedSlice=null};
papaya.viewer.Viewer.prototype.mouseMoveEvent=function(c){c.preventDefault();if(this.showingContextMenu)c.handled=!0;else{var a,d;papaya.Container.papayaLastHoveredViewer=this;a=papaya.utilities.PlatformUtils.getMousePositionX(c);d=papaya.utilities.PlatformUtils.getMousePositionY(c);this.isDragging?this.grabbedHandle?this.isInsideMainSlice(a,d)&&(this.grabbedHandle.x=this.convertScreenToImageCoordinateX(a-this.canvasRect.left,this.selectedSlice),this.grabbedHandle.y=this.convertScreenToImageCoordinateY(d-
this.canvasRect.top,this.selectedSlice),this.drawViewer(!0,!0)):this.isWindowControl?(this.windowLevelChanged(this.previousMousePosition.x-a,this.previousMousePosition.y-d),this.previousMousePosition.x=a,this.previousMousePosition.y=d):this.isPanning?this.selectedSlice===this.surfaceView?(this.surfaceView.updateTranslateDynamic(papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c),this.selectedSlice===this.mainImage?1:3),this.drawViewer(!1,!0)):this.setCurrentPanLocation(this.convertScreenToImageCoordinateX(a,
this.selectedSlice),this.convertScreenToImageCoordinateY(d,this.selectedSlice),this.selectedSlice.sliceDirection):this.isZoomMode?(this.selectedSlice===this.surfaceView?(c=.5*(this.previousMousePosition.y-d)*this.surfaceView.scaleFactor,this.surfaceView.zoom+=c,this.previousMousePosition.x=a,this.previousMousePosition.y=d):(c=.05*(this.previousMousePosition.y-d),this.setZoomFactor(this.zoomFactorPrevious-c),this.axialSlice.updateZoomTransform(this.zoomFactor,this.zoomLocX,this.zoomLocY,this.panAmountX,
this.panAmountY,this),this.coronalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocX,this.zoomLocZ,this.panAmountX,this.panAmountZ,this),this.sagittalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocY,this.zoomLocZ,this.panAmountY,this.panAmountZ,this)),this.drawViewer(!0)):(this.resetUpdateTimer(null),null!==this.selectedSlice&&(this.selectedSlice===this.surfaceView?-1!==this.surfaceView.grabbedRulerPoint?(this.surfaceView.pickRuler(a-this.canvasRect.left,d-this.canvasRect.top),this.drawViewer(!1,
!0)):(this.surfaceView.updateDynamic(papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c),this.selectedSlice===this.mainImage?1:3),this.drawViewer(!1,!0),this.container.display.drawEmptyDisplay()):this.updatePosition(this,papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c)))):(this.updateCursorPosition(this,papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c)),
this.isZoomMode=!1);this.controlsHidden&&!this.isDragging&&(this.controlsHidden=!1,this.fadeInControls());this.controlsTimer&&(clearTimeout(this.controlsTimer),this.controlsTimer=null);this.controlsTimer=setTimeout(papaya.utilities.ObjectUtils.bind(this,function(){this.controlsHidden=!0;this.fadeOutControls()}),8E3);this.controlsHiddenPrimed&&(this.controlsHiddenPrimed=!1,this.controlsHidden=!0,this.fadeOutControls())}};
papaya.viewer.Viewer.prototype.mouseDoubleClickEvent=function(){this.isAltKeyDown&&(this.zoomFactorPrevious=1,this.setZoomFactor(1))};papaya.viewer.Viewer.prototype.mouseOutEvent=function(c){papaya.Container.papayaLastHoveredViewer=null;this.isDragging?this.mouseUpEvent(c):(this.container.display&&this.container.display.drawEmptyDisplay(),this.grabbedHandle=null)};papaya.viewer.Viewer.prototype.mouseLeaveEvent=function(){};
papaya.viewer.Viewer.prototype.touchMoveEvent=function(c){this.didLongTouch||(this.longTouchTimer&&(clearTimeout(this.longTouchTimer),this.longTouchTimer=null),this.isDragging||(this.mouseDownEvent(c),this.isDragging=!0),this.mouseMoveEvent(c))};papaya.viewer.Viewer.prototype.touchStartEvent=function(c){papaya.Container.allowPropagation||c.stopPropagation();c.preventDefault();this.longTouchTimer=setTimeout(papaya.utilities.ObjectUtils.bind(this,function(){this.doLongTouch(c)}),500)};
papaya.viewer.Viewer.prototype.touchEndEvent=function(c){this.didLongTouch||(this.longTouchTimer&&(clearTimeout(this.longTouchTimer),this.longTouchTimer=null),this.isDragging||this.mouseDownEvent(c),this.mouseUpEvent(c));this.isLongTouch=this.didLongTouch=!1};
papaya.viewer.Viewer.prototype.doLongTouch=function(c){this.longTouchTimer=null;this.isLongTouch=this.didLongTouch=!0;this.updateCursorPosition(this,papaya.utilities.PlatformUtils.getMousePositionX(c),papaya.utilities.PlatformUtils.getMousePositionY(c));this.mouseDownEvent(c);this.mouseUpEvent(c)};
papaya.viewer.Viewer.prototype.windowLevelChanged=function(c,a){var d,f;d=.025*(this.currentScreenVolume.screenMax-this.currentScreenVolume.screenMin);Math.abs(c)>Math.abs(a)?(f=this.currentScreenVolume.screenMin+d*papaya.utilities.MathUtils.signum(c),d=this.currentScreenVolume.screenMax+-1*d*papaya.utilities.MathUtils.signum(c),d<=f&&(d=f=this.currentScreenVolume.screenMin)):(f=this.currentScreenVolume.screenMin+d*papaya.utilities.MathUtils.signum(a),d=this.currentScreenVolume.screenMax+d*papaya.utilities.MathUtils.signum(a));
this.currentScreenVolume.setScreenRange(f,d);this.container.showImageButtons&&this.container.toolbar.updateImageMenuRange(this.getCurrentScreenVolIndex(),parseFloat(f.toPrecision(7)),parseFloat(d.toPrecision(7)));this.drawViewer(!0)};
papaya.viewer.Viewer.prototype.gotoCoordinate=function(c,a){if(this.initialized){var d=this.volume.header.imageDimensions.xDim,f=this.volume.header.imageDimensions.yDim,b=this.volume.header.imageDimensions.zDim;this.currentCoord.x=0>c.x?0:c.x>=d?d-1:c.x;this.currentCoord.y=0>c.y?0:c.y>=f?f-1:c.y;this.currentCoord.z=0>c.z?0:c.z>=b?b-1:c.z;this.drawViewer(!0);this.updateSliceSliderControl();a||(this.container.coordinateChanged(this),this.drawViewer(!1))}};
papaya.viewer.Viewer.prototype.gotoWorldCoordinate=function(c,a){var d=new papaya.core.Coordinate;this.gotoCoordinate(this.getIndexCoordinateAtWorld(c.x,c.y,c.z,d),a)};
papaya.viewer.Viewer.prototype.resizeViewer=function(c){var a=PAPAYA_PADDING/2,d;this.canvas.width=c[0];this.canvas.height=c[1];this.initialized&&(this.calculateScreenSliceTransforms(),this.canvasRect=this.canvas.getBoundingClientRect(),this.drawViewer(!0),this.container.showControls&&(c=$(this.canvas).offset(),d=$("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex),d.css({top:c.top+a,left:c.left+this.mainImage.screenDim-d.outerWidth()-a,position:"absolute"}),d=$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+
this.container.containerIndex),d.css({top:c.top+d.outerHeight()+PAPAYA_PADDING,left:c.left+this.mainImage.screenDim-d.outerWidth()-a,position:"absolute"}),d=$("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+this.container.containerIndex),d.css({top:c.top+this.mainImage.screenDim-d.outerHeight()-a,left:c.left+this.mainImage.screenDim-d.outerWidth()-a,position:"absolute"}),d=$("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+this.container.containerIndex),d.css({top:c.top+this.mainImage.screenDim-d.outerHeight()-
a,left:c.left+a,position:"absolute"}),d=$("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+this.container.containerIndex),d.css({top:c.top+this.mainImage.screenDim-d.outerHeight()-a,left:c.left+a+d.outerWidth()+PAPAYA_PADDING,position:"absolute"})))};
papaya.viewer.Viewer.prototype.getWorldCoordinateAtIndex=function(c,a,d,f){f.setCoordinate((c-this.volume.header.origin.x)*this.volume.header.voxelDimensions.xSize,(this.volume.header.origin.y-a)*this.volume.header.voxelDimensions.ySize,(this.volume.header.origin.z-d)*this.volume.header.voxelDimensions.zSize);return f};
papaya.viewer.Viewer.prototype.getIndexCoordinateAtWorld=function(c,a,d,f){f.setCoordinate(c/this.volume.header.voxelDimensions.xSize+this.volume.header.origin.x,-1*(a/this.volume.header.voxelDimensions.ySize-this.volume.header.origin.y),-1*(d/this.volume.header.voxelDimensions.zSize-this.volume.header.origin.z),!0);return f};
papaya.viewer.Viewer.prototype.getNextColorTable=function(){var c,a=0;for(c=1;c<this.screenVolumes.length;c+=1)this.screenVolumes[c].dti||(a+=1);return papaya.viewer.ColorTable.OVERLAY_COLOR_TABLES[a%papaya.viewer.ColorTable.OVERLAY_COLOR_TABLES.length].name};
papaya.viewer.Viewer.prototype.getCurrentValueAt=function(c,a,d){var f=!this.currentScreenVolume.interpolation,f=f&"Yes"===this.container.preferences.smoothDisplay;return this.worldSpace?this.currentScreenVolume.volume.getVoxelAtCoordinate((c-this.volume.header.origin.x)*this.volume.header.voxelDimensions.xSize,(this.volume.header.origin.y-a)*this.volume.header.voxelDimensions.ySize,(this.volume.header.origin.z-d)*this.volume.header.voxelDimensions.zSize,this.currentScreenVolume.currentTimepoint,
!f):this.currentScreenVolume.volume.getVoxelAtMM(c*this.volume.header.voxelDimensions.xSize,a*this.volume.header.voxelDimensions.ySize,d*this.volume.header.voxelDimensions.zSize,this.currentScreenVolume.currentTimepoint,!f)};
papaya.viewer.Viewer.prototype.resetViewer=function(){this.container.showControlBar?($("."+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS).prop("disabled",!0),$("."+PAPAYA_CONTROL_SWAP_BUTTON_CSS).prop("disabled",!0),$("."+PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS).prop("disabled",!0),$("."+PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS).prop("disabled",!0)):this.container.showControls&&($("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+this.container.containerIndex).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+
this.container.containerIndex).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+this.container.containerIndex).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+this.container.containerIndex).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+this.container.containerIndex).css({display:"none"}));this.initialized=!1;this.loadingVolume=null;this.volume=new papaya.volume.Volume(this.container.display,this);this.screenVolumes=[];this.surfaces=[];
this.lowerImageTop=this.lowerImageBot=this.lowerImageBot2=this.mainImage=this.sagittalSlice=this.coronalSlice=this.axialSlice=this.currentScreenVolume=this.surfaceView=null;this.viewerDim=0;this.currentCoord=new papaya.core.Coordinate(0,0,0);this.draggingSliceDir=this.longestDimSize=this.longestDim=0;this.hasSeries=this.isWindowControl=this.isDragging=!1;this.previousMousePosition=new papaya.core.Point;this.canvas.removeEventListener("mousemove",this.listenerMouseMove,!1);this.canvas.removeEventListener("mousedown",
this.listenerMouseDown,!1);this.canvas.removeEventListener("mouseout",this.listenerMouseOut,!1);this.canvas.removeEventListener("mouseleave",this.listenerMouseLeave,!1);this.canvas.removeEventListener("mouseup",this.listenerMouseUp,!1);document.removeEventListener("keydown",this.listenerKeyDown,!0);document.removeEventListener("keyup",this.listenerKeyUp,!0);document.removeEventListener("contextmenu",this.listenerContextMenu,!1);this.canvas.removeEventListener("touchmove",this.listenerTouchMove,!1);
this.canvas.removeEventListener("touchstart",this.listenerTouchStart,!1);this.canvas.removeEventListener("touchend",this.listenerTouchEnd,!1);this.canvas.removeEventListener("dblclick",this.listenerMouseDoubleClick,!1);this.removeScroll();this.updateTimerEvent=this.updateTimer=null;this.drawEmptyViewer();this.container.display&&this.container.display.drawEmptyDisplay();this.updateSliceSliderControl();this.container.toolbar.buildToolbar()};
papaya.viewer.Viewer.prototype.getHeaderDescription=function(c){return this.screenVolumes[c||0].volume.header.toString()};papaya.viewer.Viewer.prototype.getImageDimensionsDescription=function(c){var a;a=this.screenVolumes[c].volume.header.orientation.orientation;c=this.screenVolumes[c].volume.header.imageDimensions;return"("+a.charAt(0)+", "+a.charAt(1)+", "+a.charAt(2)+") "+c.cols+" x "+c.rows+" x "+c.slices};
papaya.viewer.Viewer.prototype.getVoxelDimensionsDescription=function(c){var a;a=this.screenVolumes[c].volume.header.orientation.orientation;c=this.screenVolumes[c].volume.header.voxelDimensions;return"("+a.charAt(0)+", "+a.charAt(1)+", "+a.charAt(2)+") "+papaya.utilities.StringUtils.formatNumber(c.colSize,!0)+" x "+papaya.utilities.StringUtils.formatNumber(c.rowSize,!0)+" x "+papaya.utilities.StringUtils.formatNumber(c.sliceSize,!0)+" "+c.getSpatialUnitString()};
papaya.viewer.Viewer.prototype.getSeriesDimensionsDescription=function(c){return this.screenVolumes[c].volume.header.imageDimensions.timepoints.toString()};papaya.viewer.Viewer.prototype.getSeriesSizeDescription=function(c){c=this.screenVolumes[c].volume.header.voxelDimensions;return c.timeSize.toString()+" "+c.getTemporalUnitString()};papaya.viewer.Viewer.prototype.getFilename=function(c){return papaya.utilities.StringUtils.wordwrap(this.screenVolumes[c].volume.fileName,25,"<br />",!0)};
papaya.viewer.Viewer.prototype.getSurfaceFilename=function(c){return papaya.utilities.StringUtils.wordwrap(this.surfaces[c].filename,25,"<br />",!0)};papaya.viewer.Viewer.prototype.getSurfaceNumPoints=function(c){return this.surfaces[c].numPoints};papaya.viewer.Viewer.prototype.getSurfaceNumTriangles=function(c){return this.surfaces[c].numTriangles};
papaya.viewer.Viewer.prototype.getNiceFilename=function(c){c=this.screenVolumes[c].volume.fileName.replace(".nii","").replace(".gz","");c.length>papaya.viewer.Viewer.TITLE_MAX_LENGTH&&(c=c.substr(0,papaya.viewer.Viewer.TITLE_MAX_LENGTH-3)+"...");return c};papaya.viewer.Viewer.prototype.getFileLength=function(c){return papaya.utilities.StringUtils.getSizeString(this.screenVolumes[c].volume.fileLength)};
papaya.viewer.Viewer.prototype.getByteTypeDescription=function(c){return this.screenVolumes[c].volume.header.imageType.numBytes+"-Byte "+this.screenVolumes[c].volume.header.imageType.getTypeDescription()};papaya.viewer.Viewer.prototype.getByteOrderDescription=function(c){return this.screenVolumes[c].volume.header.imageType.getOrderDescription()};papaya.viewer.Viewer.prototype.getCompressedDescription=function(c){return this.screenVolumes[c].volume.header.imageType.compressed?"Yes":"No"};
papaya.viewer.Viewer.prototype.getOrientationDescription=function(c){return this.screenVolumes[c].volume.header.orientation.getOrientationDescription()};papaya.viewer.Viewer.prototype.getImageDescription=function(c){return papaya.utilities.StringUtils.wordwrap(this.screenVolumes[c].volume.header.imageDescription.notes,35,"<br />",!0)};papaya.viewer.Viewer.prototype.setCurrentScreenVol=function(c){this.currentScreenVolume=this.screenVolumes[c];this.updateWindowTitle()};
papaya.viewer.Viewer.prototype.updateWindowTitle=function(){var c;c=this.getNiceFilename(this.getCurrentScreenVolIndex());1<this.currentScreenVolume.volume.numTimepoints&&(c=c+" ("+(this.currentScreenVolume.currentTimepoint+1)+" of "+this.currentScreenVolume.volume.numTimepoints+")");this.isZooming()&&(c=c+" "+this.getZoomString());this.container.toolbar.updateTitleBar(c)};
papaya.viewer.Viewer.prototype.getCurrentScreenVolIndex=function(){var c;for(c=0;c<this.screenVolumes.length;c+=1)if(this.screenVolumes[c]===this.currentScreenVolume)return c;return-1};papaya.viewer.Viewer.prototype.toggleWorldSpace=function(){this.worldSpace=!this.worldSpace;this.container.syncOverlaySeries&&this.reconcileOverlaySeriesPoint(this.currentScreenVolume)};papaya.viewer.Viewer.prototype.isSelected=function(c){return this.isSelectable()&&c===this.getCurrentScreenVolIndex()};
papaya.viewer.Viewer.prototype.isSelectable=function(){return 1<this.screenVolumes.length};
papaya.viewer.Viewer.prototype.processParams=function(c){c.worldSpace&&(this.worldSpace=!0);c.coordinate&&(this.initialCoordinate=c.coordinate);this.container.isDesktopMode()||(void 0!==c.showOrientation&&(this.container.preferences.showOrientation=c.showOrientation?"Yes":"No"),void 0!==c.smoothDisplay&&(this.container.preferences.smoothDisplay=c.smoothDisplay?"Yes":"No"),void 0!==c.radiological&&(this.container.preferences.radiological=c.radiological?"Yes":"No"),void 0!==c.showRuler&&(this.container.preferences.showRuler=
c.showRuler?"Yes":"No"),void 0!==c.showSurfacePlanes&&(this.container.preferences.showSurfacePlanes=c.showSurfacePlanes?"Yes":"No"),void 0!==c.showSurfaceCrosshairs&&(this.container.preferences.showSurfaceCrosshairs=c.showSurfaceCrosshairs?"Yes":"No"))};papaya.viewer.Viewer.prototype.hasLoadedDTI=function(){return 1===this.screenVolumes.length&&this.screenVolumes[0].dti&&null===this.screenVolumes[0].dtiVolumeMod};
papaya.viewer.Viewer.prototype.goToInitialCoordinate=function(){var c=new papaya.core.Coordinate;0<this.screenVolumes.length&&(null===this.initialCoordinate?c.setCoordinate(papayaFloorFast(this.volume.header.imageDimensions.xDim/2),papayaFloorFast(this.volume.header.imageDimensions.yDim/2),papayaFloorFast(this.volume.header.imageDimensions.zDim/2),!0):(this.worldSpace?this.getIndexCoordinateAtWorld(this.initialCoordinate[0],this.initialCoordinate[1],this.initialCoordinate[2],c):c.setCoordinate(this.initialCoordinate[0],
this.initialCoordinate[1],this.initialCoordinate[2],!0),this.initialCoordinate=null),this.gotoCoordinate(c),this.container.display&&this.container.display.drawDisplay(this.currentCoord.x,this.currentCoord.y,this.currentCoord.z,this.getCurrentValueAt(this.currentCoord.x,this.currentCoord.y,this.currentCoord.z)))};
papaya.viewer.Viewer.prototype.getOrientationCertaintyColor=function(){var c=this.screenVolumes[0].volume.header.orientationCertainty;return c===papaya.volume.Header.ORIENTATION_CERTAINTY_LOW?papaya.viewer.Viewer.ORIENTATION_CERTAINTY_LOW_COLOR:c===papaya.volume.Header.ORIENTATION_CERTAINTY_HIGH?papaya.viewer.Viewer.ORIENTATION_CERTAINTY_HIGH_COLOR:papaya.viewer.Viewer.ORIENTATION_CERTAINTY_UNKNOWN_COLOR};papaya.viewer.Viewer.prototype.isUsingAtlas=function(c){return c===this.atlas.currentAtlas};
papaya.viewer.Viewer.prototype.scrolled=function(c){var a;this.container.nestedViewer||1<papayaContainers.length&&!this.container.collapsable||(c=c||window.event,c.preventDefault&&c.preventDefault(),c.returnValue=!1,a="Increment Slice"===this.container.preferences.scrollBehavior,c=papaya.utilities.PlatformUtils.getScrollSign(c,!a),a?0>c?(this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?this.incrementAxial(!1,Math.abs(c)):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?
this.incrementCoronal(!1,Math.abs(c)):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&this.incrementSagittal(!1,Math.abs(c)),this.gotoCoordinate(this.currentCoord)):0<c&&(this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?this.incrementAxial(!0,Math.abs(c)):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?this.incrementCoronal(!0,Math.abs(c)):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&
this.incrementSagittal(!0,Math.abs(c)),this.gotoCoordinate(this.currentCoord)):0!==c&&(this.isZoomMode=!0,this.mainImage===this.surfaceView?(this.surfaceView.zoom+=-5*c*this.surfaceView.scaleFactor,this.drawViewer(!1,!0)):(this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?this.setZoomLocation(this.currentCoord.x,this.currentCoord.y,this.mainImage.sliceDirection):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?this.setZoomLocation(this.currentCoord.x,
this.currentCoord.z,this.mainImage.sliceDirection):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&this.setZoomLocation(this.currentCoord.y,this.currentCoord.z,this.mainImage.sliceDirection),this.setZoomFactor(this.zoomFactorPrevious+.1*c*this.zoomFactorPrevious)),this.zoomFactorPrevious=this.zoomFactor))};
papaya.viewer.Viewer.prototype.incrementAxial=function(c,a){var d=this.volume.header.imageDimensions.zDim;void 0===a&&(a=1);c?(this.currentCoord.z+=a,this.currentCoord.z>=d&&(this.currentCoord.z=d-1)):(this.currentCoord.z-=a,0>this.currentCoord.z&&(this.currentCoord.z=0));this.gotoCoordinate(this.currentCoord)};
papaya.viewer.Viewer.prototype.incrementCoronal=function(c,a){var d=this.volume.header.imageDimensions.yDim;void 0===a&&(a=1);c?(this.currentCoord.y+=a,this.currentCoord.y>=d&&(this.currentCoord.y=d-1)):(this.currentCoord.y-=a,0>this.currentCoord.y&&(this.currentCoord.y=0));this.gotoCoordinate(this.currentCoord)};
papaya.viewer.Viewer.prototype.incrementSagittal=function(c,a){var d=this.volume.header.imageDimensions.xDim;void 0===a&&(a=1);c?(this.currentCoord.x-=a,0>this.currentCoord.x&&(this.currentCoord.x=0)):(this.currentCoord.x+=a,this.currentCoord.x>=d&&(this.currentCoord.x=d-1));this.gotoCoordinate(this.currentCoord)};
papaya.viewer.Viewer.prototype.setZoomFactor=function(c){c>papaya.viewer.Viewer.ZOOM_FACTOR_MAX?c=papaya.viewer.Viewer.ZOOM_FACTOR_MAX:c<papaya.viewer.Viewer.ZOOM_FACTOR_MIN&&(c=papaya.viewer.Viewer.ZOOM_FACTOR_MIN);this.zoomFactor=c;1===this.zoomFactor&&(this.panAmountX=this.panAmountY=this.panAmountZ=0);this.axialSlice.updateZoomTransform(this.zoomFactor,this.zoomLocX,this.zoomLocY,this.panAmountX,this.panAmountY,this);this.coronalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocX,this.zoomLocZ,
this.panAmountX,this.panAmountZ,this);this.sagittalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocY,this.zoomLocZ,this.panAmountY,this.panAmountZ,this);this.drawViewer(!1,!0);this.updateWindowTitle()};papaya.viewer.Viewer.prototype.getZoomString=function(){return parseInt(100*this.zoomFactor,10)+"%"};papaya.viewer.Viewer.prototype.isZooming=function(){return 1<this.zoomFactor};
papaya.viewer.Viewer.prototype.setZoomLocation=function(){1===this.zoomFactor&&(this.zoomLocX=this.currentCoord.x,this.zoomLocY=this.currentCoord.y,this.zoomLocZ=this.currentCoord.z,this.axialSlice.updateZoomTransform(this.zoomFactor,this.zoomLocX,this.zoomLocY,this.panAmountX,this.panAmountY,this),this.coronalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocX,this.zoomLocZ,this.panAmountX,this.panAmountZ,this),this.sagittalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocY,this.zoomLocZ,
this.panAmountY,this.panAmountZ,this),this.drawViewer(!1,!0))};
papaya.viewer.Viewer.prototype.setStartPanLocation=function(c,a,d){1<this.zoomFactor&&(d===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(this.panLocX=c,this.panLocY=a,this.panLocZ=this.axialSlice.currentSlice):d===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(this.panLocX=c,this.panLocY=this.coronalSlice.currentSlice,this.panLocZ=a):d===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(this.panLocX=this.sagittalSlice.currentSlice,this.panLocY=c,this.panLocZ=a))};
papaya.viewer.Viewer.prototype.setCurrentPanLocation=function(c,a,d){1<this.zoomFactor&&(d===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(this.panAmountX+=c-this.panLocX,this.panAmountY+=a-this.panLocY,this.panAmountZ=0):d===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(this.panAmountX+=c-this.panLocX,this.panAmountY=0,this.panAmountZ+=a-this.panLocZ):d===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(this.panAmountX=0,this.panAmountY+=c-this.panLocY,this.panAmountZ+=a-this.panLocZ),this.axialSlice.updateZoomTransform(this.zoomFactor,
this.zoomLocX,this.zoomLocY,this.panAmountX,this.panAmountY,this),this.coronalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocX,this.zoomLocZ,this.panAmountX,this.panAmountZ,this),this.sagittalSlice.updateZoomTransform(this.zoomFactor,this.zoomLocY,this.zoomLocZ,this.panAmountY,this.panAmountZ,this),this.drawViewer(!1,!0))};papaya.viewer.Viewer.prototype.isWorldMode=function(){return this.worldSpace};papaya.viewer.Viewer.prototype.isRadiologicalMode=function(){return"Yes"===this.container.preferences.radiological};
papaya.viewer.Viewer.prototype.isCollapsable=function(){return this.container.collapsable};
papaya.viewer.Viewer.prototype.mainSliderControlChanged=function(){this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?this.currentCoord.z=parseInt(this.mainSliderControl.val(),10):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?this.currentCoord.y=parseInt(this.mainSliderControl.val(),10):this.mainImage.sliceDirection===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL&&(this.currentCoord.x=parseInt(this.mainSliderControl.val(),10));this.gotoCoordinate(this.currentCoord)};
papaya.viewer.Viewer.prototype.axialSliderControlChanged=function(){this.currentCoord.z=parseInt(this.axialSliderControl.val(),10);this.gotoCoordinate(this.currentCoord)};papaya.viewer.Viewer.prototype.coronalSliderControlChanged=function(){this.currentCoord.y=parseInt(this.coronalSliderControl.val(),10);this.gotoCoordinate(this.currentCoord)};papaya.viewer.Viewer.prototype.sagittalSliderControlChanged=function(){this.currentCoord.x=parseInt(this.sagittalSliderControl.val(),10);this.gotoCoordinate(this.currentCoord)};
papaya.viewer.Viewer.prototype.seriesSliderControlChanged=function(){this.currentScreenVolume.setTimepoint(parseInt(this.seriesSliderControl.val(),10));this.currentScreenVolume.isOverlay()&&this.container.syncOverlaySeries&&this.reconcileOverlaySeriesPoint(this.currentScreenVolume);this.timepointChanged()};
papaya.viewer.Viewer.prototype.updateSliceSliderControl=function(){this.mainSliderControl&&this.doUpdateSliceSliderControl(this.mainSliderControl,this.mainImage.sliceDirection);this.axialSliderControl&&this.doUpdateSliceSliderControl(this.axialSliderControl,papaya.viewer.ScreenSlice.DIRECTION_AXIAL);this.coronalSliderControl&&this.doUpdateSliceSliderControl(this.coronalSliderControl,papaya.viewer.ScreenSlice.DIRECTION_CORONAL);this.sagittalSliderControl&&this.doUpdateSliceSliderControl(this.sagittalSliderControl,
papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL);this.seriesSliderControl&&this.doUpdateSliceSliderControl(this.seriesSliderControl,papaya.viewer.ScreenSlice.DIRECTION_TEMPORAL)};
papaya.viewer.Viewer.prototype.doUpdateSliceSliderControl=function(c,a){this.initialized?(c.prop("disabled",!1),c.prop("min","0"),c.prop("step","1"),a===papaya.viewer.ScreenSlice.DIRECTION_AXIAL?(c.prop("max",(this.volume.header.imageDimensions.zDim-1).toString()),c.val(this.currentCoord.z)):a===papaya.viewer.ScreenSlice.DIRECTION_CORONAL?(c.prop("max",(this.volume.header.imageDimensions.yDim-1).toString()),c.val(this.currentCoord.y)):a===papaya.viewer.ScreenSlice.DIRECTION_SAGITTAL?(c.prop("max",
(this.volume.header.imageDimensions.xDim-1).toString()),c.val(this.currentCoord.x)):a===papaya.viewer.ScreenSlice.DIRECTION_TEMPORAL&&(c.prop("max",(this.currentScreenVolume.volume.header.imageDimensions.timepoints-1).toString()),c.val(this.currentScreenVolume.currentTimepoint))):(c.prop("disabled",!0),c.prop("min","0"),c.prop("step","1"),c.prop("max","1"),c.val(0))};
papaya.viewer.Viewer.prototype.incrementSeriesPoint=function(){this.currentScreenVolume.incrementTimepoint();this.currentScreenVolume.isOverlay()&&this.container.syncOverlaySeries&&this.reconcileOverlaySeriesPoint(this.currentScreenVolume);this.timepointChanged()};
papaya.viewer.Viewer.prototype.decrementSeriesPoint=function(){this.currentScreenVolume.decrementTimepoint();this.currentScreenVolume.isOverlay()&&this.container.syncOverlaySeries&&this.reconcileOverlaySeriesPoint(this.currentScreenVolume);this.timepointChanged()};
papaya.viewer.Viewer.prototype.reconcileOverlaySeriesPoint=function(c){var a,d;if(this.worldSpace)for(d=c.getCurrentTime(),a=1;a<this.screenVolumes.length;a+=1)this.screenVolumes[a]!==c&&this.screenVolumes[a].setCurrentTime(d);else for(d=c.currentTimepoint,a=1;a<this.screenVolumes.length;a+=1)this.screenVolumes[a]!==c&&this.screenVolumes[a].setTimepoint(d)};papaya.viewer.Viewer.prototype.hasParametricPair=function(c){return c?null!==this.screenVolumes[c].negativeScreenVol:!1};
papaya.viewer.Viewer.prototype.getScreenVolumeIndex=function(c){var a;if(c)for(a=0;a<this.screenVolumes.length;a+=1)if(c===this.screenVolumes[a])return a;return-1};papaya.viewer.Viewer.prototype.getScreenVolumeByName=function(c){var a;for(a=0;a<this.screenVolumes.length;a+=1)if(c==this.screenVolumes[a].volume.fileName)return this.screenVolumes[a];return null};papaya.viewer.Viewer.prototype.isShowingRuler=function(){return"Yes"===this.container.preferences.showRuler};
papaya.viewer.Viewer.prototype.isShowingOrientation=function(){return"Yes"===this.container.preferences.showOrientation};papaya.viewer.Viewer.prototype.isShowingCrosshairs=function(){return"Yes"===this.container.preferences.showCrosshairs};papaya.viewer.Viewer.prototype.isShowingSurfacePlanes=function(){return this.surfaceView&&this.surfaceView.showSurfacePlanes};papaya.viewer.Viewer.prototype.isShowingSurfaceCrosshairs=function(){return this.surfaceView&&this.surfaceView.showSurfaceCrosshairs};
papaya.viewer.Viewer.prototype.restart=function(c,a,d){this.resetViewer();this.container.toolbar.updateImageButtons();this.loadImage(c,a,d)};papaya.viewer.Viewer.prototype.removeOverlay=function(c){var a;c=this.container.viewer.screenVolumes[c];a=c.negativeScreenVol;this.closeOverlayByRef(c);this.container.combineParametric&&this.closeOverlayByRef(a);this.drawViewer(!0,!1)};
papaya.viewer.Viewer.prototype.toggleOverlay=function(c){var a;c=this.container.viewer.screenVolumes[c];c.hidden=!c.hidden;a=c.negativeScreenVol;this.container.combineParametric&&a&&(a.hidden=!a.hidden);this.drawViewer(!0,!1);return c.hidden};
papaya.viewer.Viewer.prototype.addParametric=function(c){c=this.container.viewer.screenVolumes[c];var a;null===c.negativeScreenVol&&(this.screenVolumes[this.screenVolumes.length]=a=new papaya.viewer.ScreenVolume(c.volume,{},papaya.viewer.ColorTable.PARAMETRIC_COLOR_TABLES[1].name,!1,!0,this.currentCoord),c.negativeScreenVol=a,this.setCurrentScreenVol(this.screenVolumes.length-1),this.drawViewer(!0,!1),this.container.toolbar.buildToolbar(),this.container.toolbar.updateImageButtons())};"use strict";
papaya=papaya||{};papaya.viewer=papaya.viewer||{};
var shaderVert="precision mediump float;\nattribute vec3 aVertexPosition;\nattribute vec3 aVertexNormal;\nattribute vec4 aVertexColor;\nattribute vec2 aTextureCoord;\nuniform mat4 uMVMatrix;\nuniform mat4 uPMatrix;\nuniform mat3 uNMatrix;\nuniform vec3 uAmbientColor;\nuniform vec3 uPointLightingLocation;\nuniform vec3 uPointLightingColor;\nuniform bool uActivePlane;\nuniform bool uActivePlaneEdge;\nuniform bool uCrosshairs;\nuniform bool uColors;\nuniform bool uColorPicking;\nuniform bool uTrianglePicking;\nuniform bool uColorSolid;\nuniform vec4 uSolidColor;\nuniform bool uOrientationText;\nuniform bool uRuler;\nuniform float uAlpha;\nvarying vec3 vLightWeighting;\nvarying lowp vec4 vColor;\nvarying vec2 vTextureCoord;\nvoid main(void) {\n    vec4 mvPosition = uMVMatrix * vec4(aVertexPosition, 1.0);\n    gl_Position = uPMatrix * mvPosition;\n    if (!uActivePlane && !uActivePlaneEdge && !uCrosshairs && !uOrientationText && !uRuler) {\n       vec3 lightDirection = normalize(uPointLightingLocation - mvPosition.xyz);\n       vec3 transformedNormal = uNMatrix * aVertexNormal;\n       float directionalLightWeighting = max(dot(transformedNormal, lightDirection), 0.0);\n       vLightWeighting = uAmbientColor + uPointLightingColor * directionalLightWeighting;\n       if (uColors) {\n           vColor = aVertexColor;\n       }\n   }\n   if (uColorSolid) {\n       vColor = uSolidColor;\n   }\n   if (uOrientationText) {\n       vTextureCoord = aTextureCoord;\n   }\n}",shaderFrag=
"precision mediump float;\nuniform bool uActivePlane;\nuniform bool uActivePlaneEdge;\nuniform bool uCrosshairs;\nuniform bool uColors;\nuniform bool uColorPicking;\nuniform bool uTrianglePicking;\nuniform bool uColorSolid;\nuniform vec4 uSolidColor;\nuniform bool uOrientationText;\nuniform bool uRuler;\nuniform sampler2D uSampler;\nuniform float uAlpha;\nvarying vec3 vLightWeighting;\nvarying lowp vec4 vColor;\nvarying vec2 vTextureCoord;\nvec4 packFloatToVec4i(const float value) {\n   const vec4 bitSh = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);\n   const vec4 bitMsk = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);\n   vec4 res = fract(value * bitSh);\n   res -= res.xxyz * bitMsk;\n   return res;\n}\nvoid main(void) {\n    vec4 fragmentColor = vec4(1.0, 1.0, 1.0, 1.0);\n    if (uColors) {\n       fragmentColor = vColor;\n    } else if (uColorSolid) {\n       fragmentColor = vColor;\n    }\n    if (uActivePlane) {\n       gl_FragColor = vec4(0.10980392156863, 0.52549019607843, 0.93333333333333, 0.5);\n    } else if (uActivePlaneEdge) {\n       gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n    } else if (uRuler) {\n       gl_FragColor = vec4(1.0, 0.078, 0.576, 1.0);\n    } else if (uOrientationText) {\n        vec4 textureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n        if (textureColor.a > 0.0) {\n           gl_FragColor = vec4(textureColor.rgb, textureColor.a);\n        } else {\n           gl_FragColor = vec4(textureColor.rgb, 0);\n        }\n    } else if (uCrosshairs) {\n       gl_FragColor = vec4(0.10980392156863, 0.52549019607843, 0.93333333333333, 1.0);\n    } else if (uColorPicking) {\n       gl_FragColor = vec4(fragmentColor.r, fragmentColor.g, fragmentColor.b, 1);\n    } else if (uTrianglePicking) {\n       gl_FragColor = packFloatToVec4i(gl_FragCoord.z);\n    } else {\n       gl_FragColor = vec4(fragmentColor.rgb * vLightWeighting, uAlpha);\n    }\n}";
papaya.viewer.ScreenSurface=papaya.viewer.ScreenSurface||function(c,a,d,f){this.shaderProgram=null;this.mvMatrix=mat4.create();this.pMatrix=mat4.create();this.pMatrix1=mat4.create();this.centerMat=mat4.create();this.centerMatInv=mat4.create();this.tempMat=mat4.create();this.tempMat2=mat4.create();this.pickingBuffer=null;this.initialized=!1;this.screenDim=this.screenOffsetY=this.screenOffsetX=0;this.screenTransform=[[1,0,0],[0,1,0],[0,0,1]];this.volume=c;this.surfaces=a;this.viewer=d;this.currentCoord=
d.currentCoord;this.zoom=0;this.sliceDirection=papaya.viewer.ScreenSlice.DIRECTION_SURFACE;this.dynamicStartY=this.dynamicStartX=-1;this.activePlaneVertsAxial=new Float32Array(12);this.activePlaneVertsCoronal=new Float32Array(12);this.activePlaneVertsSagittal=new Float32Array(12);this.activePlaneVertsAxialEdges=new Float32Array(24);this.activePlaneVertsCoronalEdges=new Float32Array(24);this.activePlaneVertsSagittalEdges=new Float32Array(24);this.orientationVerts=new Float32Array(24);this.crosshairLineVertsX=
new Float32Array(6);this.crosshairLineVertsY=new Float32Array(6);this.crosshairLineVertsZ=new Float32Array(6);this.mouseRotDragX=this.clearTransform([]);this.mouseRotDragY=this.clearTransform([]);this.mouseRotDrag=this.clearTransform([]);this.mouseTransDrag=this.clearTransform([]);this.mouseRotCurrent=this.clearTransform([]);this.mouseTransCurrent=this.clearTransform([]);this.mouseRotTemp=this.clearTransform([]);this.mouseTransTemp=this.clearTransform([]);this.crosshairLineZBuffer=this.crosshairLineZBuffer=
this.crosshairLineYBuffer=this.crosshairLineXBuffer=this.orientationBuffer=this.activePlaneSagittalEdgesBuffer=this.activePlaneCoronalEdgesBuffer=this.activePlaneAxialEdgesBuffer=this.activePlaneSagittalBuffer=this.activePlaneCoronalBuffer=this.activePlaneAxialBuffer=null;this.xSize=this.volume.header.voxelDimensions.xSize;this.xDim=this.volume.header.imageDimensions.xDim;this.xHalf=this.xDim*this.xSize/2;this.ySize=this.volume.header.voxelDimensions.ySize;this.yDim=this.volume.header.imageDimensions.yDim;
this.yHalf=this.yDim*this.ySize/2;this.zSize=this.volume.header.voxelDimensions.zSize;this.zDim=this.volume.header.imageDimensions.zDim;this.zHalf=this.zDim*this.zSize/2;this.showSurfacePlanes="Yes"===d.container.preferences.showSurfacePlanes;this.backgroundColor=papaya.viewer.ScreenSurface.DEFAULT_BACKGROUND;this.pickLocY=this.pickLocX=0;this.needsPickColor=!1;this.pickedColor=null;this.needsPick=!1;this.pickedCoordinate=null;this.scaleFactor=1;this.rulerPoints=this.orientationContext=this.orientationCanvas=
this.orientationTextureCoordBuffer=this.orientationTextureCoords=this.orientationTexture=null;this.grabbedRulerPoint=-1;this.processParams(f)};papaya.viewer.ScreenSurface.DEFAULT_ORIENTATION=[-.015552218963737041,.09408106275544359,-.9954430697501158,0,-.9696501263313991,.24152923619118966,.03797658948646743,0,.24400145970103732,.965822108594413,.0874693978960848,0,0,0,0,1];papaya.viewer.ScreenSurface.MOUSE_SENSITIVITY=.3;papaya.viewer.ScreenSurface.DEFAULT_BACKGROUND=[.5,.5,.5];
papaya.viewer.ScreenSurface.TEXT_SIZE=50;papaya.viewer.ScreenSurface.ORIENTATION_SIZE=10;papaya.viewer.ScreenSurface.RULER_COLOR=[1,.078,.576];papaya.viewer.ScreenSurface.RULER_NUM_LINES=25;papaya.viewer.ScreenSurface.RULER_RADIUS=1;papaya.viewer.ScreenSurface.EXT_INT=null;papaya.viewer.ScreenSurface.makeShader=function(c,a,d){d=c.createShader(d);c.shaderSource(d,a);c.compileShader(d);return c.getShaderParameter(d,c.COMPILE_STATUS)?d:(console.log(c.getShaderInfoLog(d)),null)};
papaya.viewer.ScreenSurface.initShaders=function(c){var a=papaya.viewer.ScreenSurface.makeShader(c,shaderVert,c.VERTEX_SHADER),d=papaya.viewer.ScreenSurface.makeShader(c,shaderFrag,c.FRAGMENT_SHADER),f=c.createProgram();c.attachShader(f,d);c.attachShader(f,a);c.linkProgram(f);c.getProgramParameter(f,c.LINK_STATUS)||console.log("Could not initialise shaders");c.useProgram(f);f.vertexPositionAttribute=c.getAttribLocation(f,"aVertexPosition");c.enableVertexAttribArray(f.vertexPositionAttribute);f.vertexNormalAttribute=
c.getAttribLocation(f,"aVertexNormal");c.enableVertexAttribArray(f.vertexNormalAttribute);f.vertexColorAttribute=c.getAttribLocation(f,"aVertexColor");f.textureCoordAttribute=c.getAttribLocation(f,"aTextureCoord");f.pMatrixUniform=c.getUniformLocation(f,"uPMatrix");f.mvMatrixUniform=c.getUniformLocation(f,"uMVMatrix");f.nMatrixUniform=c.getUniformLocation(f,"uNMatrix");f.ambientColorUniform=c.getUniformLocation(f,"uAmbientColor");f.pointLightingLocationUniform=c.getUniformLocation(f,"uPointLightingLocation");
f.pointLightingColorUniform=c.getUniformLocation(f,"uPointLightingColor");f.activePlane=c.getUniformLocation(f,"uActivePlane");f.activePlaneEdge=c.getUniformLocation(f,"uActivePlaneEdge");f.colorPicking=c.getUniformLocation(f,"uColorPicking");f.trianglePicking=c.getUniformLocation(f,"uTrianglePicking");f.crosshairs=c.getUniformLocation(f,"uCrosshairs");f.hasColors=c.getUniformLocation(f,"uColors");f.hasSolidColor=c.getUniformLocation(f,"uColorSolid");f.solidColor=c.getUniformLocation(f,"uSolidColor");
f.orientationText=c.getUniformLocation(f,"uOrientationText");f.samplerUniform=c.getUniformLocation(f,"uSampler");f.ruler=c.getUniformLocation(f,"uRuler");f.alphaVal=c.getUniformLocation(f,"uAlpha");return f};
papaya.viewer.ScreenSurface.prototype.initialize=function(){var c;this.initialized=!0;this.canvas=document.createElement("canvas");this.canvas.width=this.screenDim;this.canvas.height=this.screenDim;this.context=this.canvas.getContext("webgl")||this.canvas.getContext("experimental-webgl");this.context.viewportWidth=this.canvas.width;this.context.viewportHeight=this.canvas.height;this.zoom=this.volume.header.imageDimensions.yDim*this.volume.header.voxelDimensions.ySize*1.5;this.initPerspective();this.shaderProgram=
papaya.viewer.ScreenSurface.initShaders(this.context);for(c=0;c<this.surfaces.length;c+=1)this.initBuffers(this.context,this.surfaces[c]);this.calculateScaleFactor();this.initActivePlaneBuffers(this.context);this.initRulerBuffers(this.context);mat4.multiply(this.centerMat,papaya.viewer.ScreenSurface.DEFAULT_ORIENTATION,this.tempMat);mat4.multiply(this.tempMat,this.centerMatInv,this.mouseRotCurrent);papaya.viewer.ScreenSurface.EXT_INT=this.context.getExtension("OES_element_index_uint");papaya.viewer.ScreenSurface.EXT_INT||
console.log("This browser does not support OES_element_index_uint extension!");this.updateBackgroundColor()};papaya.viewer.ScreenSurface.prototype.calculateScaleFactor=function(){var c=this.ySize*this.yDim,a=this.zSize*this.zDim,d=this.xSize*this.xDim;c>d&&(d=c);a>d&&(d=a);this.scaleFactor=d/256};
papaya.viewer.ScreenSurface.prototype.resize=function(c){this.initialized||this.initialize();this.screenDim=c;this.canvas.width=this.screenDim;this.canvas.height=this.screenDim;this.context.viewportWidth=this.canvas.width;this.context.viewportHeight=this.canvas.height};
papaya.viewer.ScreenSurface.prototype.applyMatrixUniforms=function(c){c.uniformMatrix4fv(this.shaderProgram.pMatrixUniform,!1,this.pMatrix);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,this.mvMatrix);var a=mat3.create();mat4.toInverseMat3(this.mvMatrix,a);mat3.transpose(a);c.uniformMatrix3fv(this.shaderProgram.nMatrixUniform,!1,a)};papaya.viewer.ScreenSurface.prototype.draw=function(){0<this.surfaces.length&&(this.initialized||this.initialize(),this.drawScene(this.context))};
papaya.viewer.ScreenSurface.prototype.initBuffers=function(c,a){a.pointsBuffer=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,a.pointsBuffer);c.bufferData(c.ARRAY_BUFFER,a.pointData,c.STATIC_DRAW);a.pointsBuffer.itemSize=3;a.pointsBuffer.numItems=a.numPoints;a.normalsBuffer=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,a.normalsBuffer);c.bufferData(c.ARRAY_BUFFER,a.normalsData,c.STATIC_DRAW);a.normalsBuffer.itemSize=3;a.normalsBuffer.numItems=a.numPoints;a.colorsData&&(a.colorsBuffer=c.createBuffer(),
c.bindBuffer(c.ARRAY_BUFFER,a.colorsBuffer),c.bufferData(c.ARRAY_BUFFER,a.colorsData,c.STATIC_DRAW),a.colorsBuffer.itemSize=4,a.colorsBuffer.numItems=a.numPoints);a.trianglesBuffer=c.createBuffer();c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,a.trianglesBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,a.triangleData,c.STATIC_DRAW);a.trianglesBuffer.itemSize=1;a.trianglesBuffer.numItems=3*a.numTriangles};
papaya.viewer.ScreenSurface.prototype.initOrientationBuffers=function(c){this.makeOrientedTextSquare();this.orientationBuffer=c.createBuffer();this.orientationBuffer.itemSize=3;this.orientationBuffer.numItems=4;this.orientationTextureCoordBuffer=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,this.orientationTextureCoordBuffer);this.orientationTextureCoords=[0,1,0,0,1,1,1,0];c.bufferData(c.ARRAY_BUFFER,new Float32Array(this.orientationTextureCoords),c.STATIC_DRAW);this.orientationTextureCoordBuffer.itemSize=
2;this.orientationTextureCoordBuffer.numItems=4};
papaya.viewer.ScreenSurface.prototype.initActivePlaneBuffers=function(c){this.updateActivePlanes();this.activePlaneAxialBuffer=c.createBuffer();this.activePlaneAxialBuffer.itemSize=3;this.activePlaneAxialBuffer.numItems=4;this.activePlaneCoronalBuffer=c.createBuffer();this.activePlaneCoronalBuffer.itemSize=3;this.activePlaneCoronalBuffer.numItems=4;this.activePlaneSagittalBuffer=c.createBuffer();this.activePlaneSagittalBuffer.itemSize=3;this.activePlaneSagittalBuffer.numItems=4;this.activePlaneAxialEdgesBuffer=
c.createBuffer();this.activePlaneAxialEdgesBuffer.itemSize=3;this.activePlaneAxialEdgesBuffer.numItems=8;this.activePlaneCoronalEdgesBuffer=c.createBuffer();this.activePlaneCoronalEdgesBuffer.itemSize=3;this.activePlaneCoronalEdgesBuffer.numItems=8;this.activePlaneSagittalEdgesBuffer=c.createBuffer();this.activePlaneSagittalEdgesBuffer.itemSize=3;this.activePlaneSagittalEdgesBuffer.numItems=8;this.crosshairLineXBuffer=c.createBuffer();this.crosshairLineXBuffer.itemSize=3;this.crosshairLineXBuffer.numItems=
2;this.crosshairLineYBuffer=c.createBuffer();this.crosshairLineYBuffer.itemSize=3;this.crosshairLineYBuffer.numItems=2;this.crosshairLineZBuffer=c.createBuffer();this.crosshairLineZBuffer.itemSize=3;this.crosshairLineZBuffer.numItems=2};
papaya.viewer.ScreenSurface.prototype.initRulerBuffers=function(c){this.rulerPointData=this.makeSphere(papaya.viewer.ScreenSurface.RULER_NUM_LINES,papaya.viewer.ScreenSurface.RULER_NUM_LINES,papaya.viewer.ScreenSurface.RULER_RADIUS*this.scaleFactor);this.sphereVertexPositionBuffer=c.createBuffer();this.sphereVertexPositionBuffer.itemSize=3;this.sphereVertexPositionBuffer.numItems=this.rulerPointData.vertices.length/3;this.sphereNormalsPositionBuffer=c.createBuffer();this.sphereNormalsPositionBuffer.itemSize=
3;this.sphereNormalsPositionBuffer.numItems=this.rulerPointData.normals.length/3;this.sphereVertexIndexBuffer=c.createBuffer();this.sphereVertexIndexBuffer.itemSize=1;this.sphereVertexIndexBuffer.numItems=this.rulerPointData.indices.length;this.rulerLineBuffer=c.createBuffer();this.rulerLineBuffer.itemSize=3;this.rulerLineBuffer.numItems=2};
papaya.viewer.ScreenSurface.prototype.initPerspective=function(){mat4.perspective(45,1,10,1E5,this.pMatrix1);this.eye=new vec3.create;this.eye[0]=0;this.eye[1]=0;this.center=new vec3.create;this.centerWorld=new papaya.core.Coordinate;this.viewer.getWorldCoordinateAtIndex(parseInt(this.xDim/2,10),parseInt(this.yDim/2,10),parseInt(this.zDim/2,10),this.centerWorld);this.center[0]=this.centerWorld.x;this.center[1]=this.centerWorld.y;this.center[2]=this.centerWorld.z;mat4.identity(this.centerMat);mat4.translate(this.centerMat,
[this.center[0],this.center[1],this.center[2]]);mat4.identity(this.centerMatInv);mat4.translate(this.centerMatInv,[-this.center[0],-this.center[1],-this.center[2]]);this.up=new vec3.create;this.up[0]=0;this.up[1]=1;this.up[2]=0};papaya.viewer.ScreenSurface.prototype.updatePerspective=function(){var c;this.eye[2]=this.zoom;c=mat4.lookAt(this.eye,this.center,this.up);mat4.multiply(this.pMatrix1,c,this.pMatrix)};
papaya.viewer.ScreenSurface.prototype.unpackFloatFromVec4i=function(c){var a=[1/16777216,1/65536,1/256,1];return c[0]*a[0]+c[1]*a[1]+c[2]*a[2]+c[3]*a[3]};papaya.viewer.ScreenSurface.prototype.hasTranslucentSurfaces=function(){var c;for(c=0;c<this.surfaces.length;c+=1)if(1>this.surfaces[c].alpha)return!0;return!1};
papaya.viewer.ScreenSurface.prototype.drawScene=function(c){var a,d,f;d=this.hasTranslucentSurfaces();c.clearColor(this.backgroundColor[0],this.backgroundColor[1],this.backgroundColor[2],1);c.clear(c.COLOR_BUFFER_BIT|c.DEPTH_BUFFER_BIT);c.viewport(0,0,c.viewportWidth,c.viewportHeight);mat4.identity(this.mvMatrix);mat4.multiply(this.mouseRotDrag,this.mouseRotCurrent,this.mouseRotTemp);mat4.multiply(this.mouseTransDrag,this.mouseTransCurrent,this.mouseTransTemp);mat4.multiply(this.mouseTransTemp,this.mouseRotTemp,
this.tempMat);mat4.set(this.tempMat,this.mvMatrix);this.updatePerspective();this.applyMatrixUniforms(c);c.uniform3f(this.shaderProgram.ambientColorUniform,.2,.2,.2);c.uniform3f(this.shaderProgram.pointLightingLocationUniform,0,0,300*this.scaleFactor);c.uniform3f(this.shaderProgram.pointLightingColorUniform,.8,.8,.8);c.uniform1i(this.shaderProgram.orientationText,0);c.uniform1i(this.shaderProgram.activePlane,0);c.uniform1i(this.shaderProgram.activePlaneEdge,0);c.uniform1i(this.shaderProgram.crosshairs,
0);c.uniform1i(this.shaderProgram.hasColors,0);c.uniform1i(this.shaderProgram.colorPicking,0);c.uniform1i(this.shaderProgram.trianglePicking,0);if(this.needsPick){if(c.uniform1i(this.shaderProgram.trianglePicking,1),null===this.pickingBuffer||this.pickingBuffer.length!==c.viewportWidth*c.viewportHeight*4)this.pickingBuffer=new Uint8Array(c.viewportWidth*c.viewportHeight*4)}else this.needsPickColor&&(c.uniform1i(this.shaderProgram.colorPicking,1),null===this.pickingBuffer||this.pickingBuffer.length!==
c.viewportWidth*c.viewportHeight*4)&&(this.pickingBuffer=new Uint8Array(c.viewportWidth*c.viewportHeight*4));c.enable(c.DEPTH_TEST);for(a=0;a<this.surfaces.length;a+=1)this.renderSurface(c,a,1>this.surfaces[a].alpha,!0,!1);c.uniform1i(this.shaderProgram.hasSolidColor,0);c.uniform1i(this.shaderProgram.hasColors,0);if(this.needsPick)this.needsPick=!1,this.pickedCoordinate=this.findPickedCoordinate(c,this.pickLocX,this.pickLocY),c.uniform1i(this.shaderProgram.trianglePicking,0);else if(this.needsPickColor)this.needsPickColor=
!1,this.pickedColor=this.findPickedColor(c),c.uniform1i(this.shaderProgram.colorPicking,0);else{this.showSurfacePlanes&&(this.needsUpdateActivePlanes&&(this.needsUpdateActivePlanes=!1,this.bindActivePlanes(c)),c.depthMask(!1),c.uniform1i(this.shaderProgram.activePlane,1),c.enable(c.BLEND),c.blendFunc(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA),c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneAxialBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.activePlaneAxialBuffer.itemSize,c.FLOAT,
!1,0,0),c.drawArrays(c.TRIANGLE_STRIP,0,4),c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneCoronalBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.activePlaneCoronalBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.TRIANGLE_STRIP,0,4),c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneSagittalBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.activePlaneSagittalBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.TRIANGLE_STRIP,0,4),c.depthMask(!0),c.disable(c.BLEND),
c.uniform1i(this.shaderProgram.activePlane,0),c.uniform1i(this.shaderProgram.activePlaneEdge,1),c.lineWidth(this.isMainView()?3:2),c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneAxialEdgesBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.activePlaneAxialEdgesBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.LINES,0,8),c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneCoronalEdgesBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.activePlaneCoronalEdgesBuffer.itemSize,
c.FLOAT,!1,0,0),c.drawArrays(c.LINES,0,8),c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneSagittalEdgesBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.activePlaneSagittalEdgesBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.LINES,0,8),c.uniform1i(this.shaderProgram.activePlaneEdge,0));this.viewer.isShowingCrosshairs()&&(this.viewer.mainImage!==this||this.viewer.toggleMainCrosshairs)&&(this.needsUpdateActivePlanes&&(this.needsUpdateActivePlanes=!1,this.bindActivePlanes(c)),
c.uniform1i(this.shaderProgram.crosshairs,1),c.lineWidth(this.isMainView()?3:2),c.bindBuffer(c.ARRAY_BUFFER,this.crosshairLineXBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.crosshairLineXBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.LINES,0,2),c.bindBuffer(c.ARRAY_BUFFER,this.crosshairLineYBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.crosshairLineYBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.LINES,0,2),c.bindBuffer(c.ARRAY_BUFFER,
this.crosshairLineZBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.crosshairLineZBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.LINES,0,2),c.uniform1i(this.shaderProgram.crosshairs,0));c.enable(c.DEPTH_TEST);for(a=0;a<this.surfaces.length;a+=1)d&&this.renderSurface(c,a,1>this.surfaces[a].alpha,!1,!0);this.viewer.mainImage===this.viewer.surfaceView&&"Yes"===this.viewer.container.preferences.showOrientation&&(a=this.currentCoord.x+(this.xDim/2-this.volume.header.origin.x),
d=this.yDim-this.currentCoord.y-(this.yDim/2-this.volume.header.origin.y),f=this.zDim-this.currentCoord.z-(this.zDim/2-this.volume.header.origin.z),this.drawOrientedText(c,"S",papaya.viewer.ScreenSurface.TEXT_SIZE,[a*this.xSize-this.xHalf,d*this.ySize-this.yHalf,this.zHalf+papaya.viewer.ScreenSurface.ORIENTATION_SIZE*this.scaleFactor-(this.zDim/2-this.volume.header.origin.z)*this.zSize]),this.drawOrientedText(c,"I",papaya.viewer.ScreenSurface.TEXT_SIZE,[a*this.xSize-this.xHalf,d*this.ySize-this.yHalf,
-this.zHalf-papaya.viewer.ScreenSurface.ORIENTATION_SIZE*this.scaleFactor-(this.zDim/2-this.volume.header.origin.z)*this.zSize]),this.drawOrientedText(c,"P",papaya.viewer.ScreenSurface.TEXT_SIZE,[a*this.xSize-this.xHalf,-this.yHalf-papaya.viewer.ScreenSurface.ORIENTATION_SIZE*this.scaleFactor-(this.yDim/2-this.volume.header.origin.y)*this.ySize,f*this.zSize-this.zHalf]),this.drawOrientedText(c,"A",papaya.viewer.ScreenSurface.TEXT_SIZE,[a*this.xSize-this.xHalf,this.yHalf+papaya.viewer.ScreenSurface.ORIENTATION_SIZE*
this.scaleFactor-(this.yDim/2-this.volume.header.origin.y)*this.ySize,f*this.zSize-this.zHalf]),this.drawOrientedText(c,"L",papaya.viewer.ScreenSurface.TEXT_SIZE,[-this.xHalf-papaya.viewer.ScreenSurface.ORIENTATION_SIZE*this.scaleFactor+(this.xDim/2-this.volume.header.origin.x)*this.xSize,d*this.ySize-this.yHalf,f*this.zSize-this.zHalf]),this.drawOrientedText(c,"R",papaya.viewer.ScreenSurface.TEXT_SIZE,[this.xHalf+papaya.viewer.ScreenSurface.ORIENTATION_SIZE*this.scaleFactor+(this.xDim/2-this.volume.header.origin.x)*
this.xSize,d*this.ySize-this.yHalf,f*this.zSize-this.zHalf]));"Yes"===this.viewer.container.preferences.showRuler?this.isMainView()&&this.drawRuler(c):this.rulerPoints=null}c.disable(c.DEPTH_TEST)};
papaya.viewer.ScreenSurface.prototype.renderSurface=function(c,a,d,f,b){c.uniform1f(this.shaderProgram.alphaVal,this.surfaces[a].alpha);d?f?(c.enable(c.BLEND),c.enable(c.CULL_FACE),c.blendFunc(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA),c.frontFace(c.CCW),c.cullFace(c.FRONT),c.uniform3f(this.shaderProgram.ambientColorUniform,0,0,0),c.uniform3f(this.shaderProgram.pointLightingLocationUniform,0,0,-300*this.scaleFactor)):b&&(c.enable(c.BLEND),c.enable(c.CULL_FACE),c.blendFunc(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA),
c.frontFace(c.CCW),c.cullFace(c.BACK),c.uniform3f(this.shaderProgram.ambientColorUniform,.2,.2,.2),c.uniform3f(this.shaderProgram.pointLightingLocationUniform,0,0,300*this.scaleFactor)):(c.uniform3f(this.shaderProgram.ambientColorUniform,.2,.2,.2),c.uniform3f(this.shaderProgram.pointLightingLocationUniform,0,0,300*this.scaleFactor));c.uniform1i(this.shaderProgram.hasSolidColor,0);c.uniform1i(this.shaderProgram.hasColors,0);this.surfaces[a].solidColor&&(c.uniform1i(this.shaderProgram.hasSolidColor,
1),c.uniform4f(this.shaderProgram.solidColor,this.surfaces[a].solidColor[0],this.surfaces[a].solidColor[1],this.surfaces[a].solidColor[2],1));c.bindBuffer(c.ARRAY_BUFFER,this.surfaces[a].pointsBuffer);c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.surfaces[a].pointsBuffer.itemSize,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,this.surfaces[a].normalsBuffer);c.vertexAttribPointer(this.shaderProgram.vertexNormalAttribute,this.surfaces[a].normalsBuffer.itemSize,c.FLOAT,!1,0,0);this.surfaces[a].colorsData?
(c.uniform1i(this.shaderProgram.hasColors,1),c.bindBuffer(c.ARRAY_BUFFER,this.surfaces[a].colorsBuffer),c.enableVertexAttribArray(this.shaderProgram.vertexColorAttribute),c.vertexAttribPointer(this.shaderProgram.vertexColorAttribute,this.surfaces[a].colorsBuffer.itemSize,c.FLOAT,!1,0,0)):c.disableVertexAttribArray(this.shaderProgram.vertexColorAttribute);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.surfaces[a].trianglesBuffer);c.drawElements(c.TRIANGLES,this.surfaces[a].trianglesBuffer.numItems,c.UNSIGNED_INT,
0);d&&(f||b)&&(c.disable(c.BLEND),c.disable(c.CULL_FACE))};
papaya.viewer.ScreenSurface.prototype.drawRuler=function(c){var a=!0;null===this.rulerPoints&&(this.rulerPoints=new Float32Array(6),a=this.findInitialRulerPoints(c),this.drawScene(c));a&&(c.uniform1i(this.shaderProgram.ruler,1),this.drawRulerPoint(c,this.rulerPoints[0],this.rulerPoints[1],this.rulerPoints[2]),this.drawRulerPoint(c,this.rulerPoints[3],this.rulerPoints[4],this.rulerPoints[5]),c.bindBuffer(c.ARRAY_BUFFER,this.rulerLineBuffer),c.bufferData(c.ARRAY_BUFFER,this.rulerPoints,c.DYNAMIC_DRAW),
c.bindBuffer(c.ARRAY_BUFFER,this.rulerLineBuffer),c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.rulerLineBuffer.itemSize,c.FLOAT,!1,0,0),c.drawArrays(c.LINES,0,2),c.uniform1i(this.shaderProgram.ruler,0))};
papaya.viewer.ScreenSurface.prototype.drawRulerPoint=function(c,a,d,f){this.sphereVertexPositionBuffer.numItems=this.rulerPointData.vertices.length/3;c.bindBuffer(c.ARRAY_BUFFER,this.sphereVertexPositionBuffer);c.bufferData(c.ARRAY_BUFFER,new Float32Array(this.rulerPointData.vertices),c.STATIC_DRAW);this.sphereNormalsPositionBuffer.numItems=this.rulerPointData.normals.length/3;c.bindBuffer(c.ARRAY_BUFFER,this.sphereNormalsPositionBuffer);c.bufferData(c.ARRAY_BUFFER,new Float32Array(this.rulerPointData.normals),
c.STATIC_DRAW);this.sphereVertexIndexBuffer.numItems=this.rulerPointData.indices.length;c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.sphereVertexIndexBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,new Uint16Array(this.rulerPointData.indices),c.STATIC_DRAW);c.uniform1i(this.shaderProgram.hasSolidColor,1);c.uniform4f(this.shaderProgram.solidColor,papaya.viewer.ScreenSurface.RULER_COLOR[0],papaya.viewer.ScreenSurface.RULER_COLOR[1],papaya.viewer.ScreenSurface.RULER_COLOR[2],1);c.bindBuffer(c.ARRAY_BUFFER,this.sphereVertexPositionBuffer);
c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.sphereVertexPositionBuffer.itemSize,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,this.sphereNormalsPositionBuffer);c.vertexAttribPointer(this.shaderProgram.vertexNormalAttribute,this.sphereNormalsPositionBuffer.itemSize,c.FLOAT,!1,0,0);mat4.set(this.mvMatrix,this.tempMat);mat4.translate(this.mvMatrix,[a,d,f]);this.applyMatrixUniforms(c);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.sphereVertexIndexBuffer);c.drawElements(c.TRIANGLES,
this.sphereVertexIndexBuffer.numItems,c.UNSIGNED_SHORT,0);mat4.set(this.tempMat,this.mvMatrix);this.applyMatrixUniforms(c)};
papaya.viewer.ScreenSurface.prototype.drawOrientedText=function(c,a,d,f){null===this.orientationCanvas&&this.initOrientationBuffers(this.context);this.updateOrientedTextSquare(d,a);null===this.orientationTexture&&(this.orientationTexture=c.createTexture());this.bindOrientation(c);c.enableVertexAttribArray(this.shaderProgram.textureCoordAttribute);c.uniform1i(this.shaderProgram.orientationText,1);c.enable(c.BLEND);c.blendFunc(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA);this.orientationContext.imageSmoothingEnabled=
!0;this.orientationContext.webkitImageSmoothingEnabled=!0;this.orientationContext.mozImageSmoothingEnabled=!0;this.orientationContext.msImageSmoothingEnabled=!0;this.orientationContext.textAlign="center";this.orientationContext.textBaseline="middle";this.orientationContext.font=d+"px sans-serif";this.orientationContext.clearRect(0,0,this.orientationCanvas.width,this.orientationCanvas.height);this.orientationContext.fillStyle="#FFFFFF";this.orientationContext.fillText(a,this.orientationCanvas.width/
2,this.orientationCanvas.height/2);mat4.set(this.mvMatrix,this.tempMat);mat4.multiplyVec3(this.mvMatrix,f);mat4.identity(this.mvMatrix);c.bindBuffer(c.ARRAY_BUFFER,this.orientationBuffer);c.vertexAttribPointer(this.shaderProgram.vertexPositionAttribute,this.orientationBuffer.itemSize,c.FLOAT,!1,0,0);c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,1);c.bindTexture(c.TEXTURE_2D,this.orientationTexture);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,
c.CLAMP_TO_EDGE);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,this.orientationCanvas);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR_MIPMAP_NEAREST);c.generateMipmap(c.TEXTURE_2D);c.bindTexture(c.TEXTURE_2D,null);c.bindBuffer(c.ARRAY_BUFFER,this.orientationTextureCoordBuffer);c.vertexAttribPointer(this.shaderProgram.textureCoordAttribute,this.orientationTextureCoordBuffer.itemSize,c.FLOAT,!1,0,0);c.activeTexture(c.TEXTURE0);
c.bindTexture(c.TEXTURE_2D,this.orientationTexture);c.uniform1i(this.shaderProgram.samplerUniform,0);mat4.translate(this.mvMatrix,f);this.applyMatrixUniforms(c);c.drawArrays(c.TRIANGLE_STRIP,0,4);mat4.set(this.tempMat,this.mvMatrix);this.applyMatrixUniforms(c);c.disable(c.BLEND);c.uniform1i(this.shaderProgram.orientationText,0);c.disableVertexAttribArray(this.shaderProgram.textureCoordAttribute)};
papaya.viewer.ScreenSurface.prototype.bindOrientation=function(c){c.bindBuffer(c.ARRAY_BUFFER,this.orientationBuffer);c.bufferData(c.ARRAY_BUFFER,this.orientationVerts,c.DYNAMIC_DRAW)};
papaya.viewer.ScreenSurface.prototype.bindActivePlanes=function(c){c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneAxialBuffer);c.bufferData(c.ARRAY_BUFFER,this.activePlaneVertsAxial,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneCoronalBuffer);c.bufferData(c.ARRAY_BUFFER,this.activePlaneVertsCoronal,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneSagittalBuffer);c.bufferData(c.ARRAY_BUFFER,this.activePlaneVertsSagittal,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneAxialEdgesBuffer);
c.bufferData(c.ARRAY_BUFFER,this.activePlaneVertsAxialEdges,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneCoronalEdgesBuffer);c.bufferData(c.ARRAY_BUFFER,this.activePlaneVertsCoronalEdges,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.activePlaneSagittalEdgesBuffer);c.bufferData(c.ARRAY_BUFFER,this.activePlaneVertsSagittalEdges,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.crosshairLineXBuffer);c.bufferData(c.ARRAY_BUFFER,this.crosshairLineVertsX,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,
this.crosshairLineYBuffer);c.bufferData(c.ARRAY_BUFFER,this.crosshairLineVertsY,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.crosshairLineZBuffer);c.bufferData(c.ARRAY_BUFFER,this.crosshairLineVertsZ,c.DYNAMIC_DRAW)};papaya.viewer.ScreenSurface.prototype.clearDTILinesImage=function(){};
papaya.viewer.ScreenSurface.prototype.findProximalRulerHandle=function(c,a){this.pick(c,a,!0);this.grabbedRulerPoint=-1;this.pickedCoordinate&&this.rulerPoints&&(papaya.utilities.MathUtils.lineDistance3d(this.rulerPoints[0],this.rulerPoints[1],this.rulerPoints[2],this.pickedCoordinate.coordinate[0],this.pickedCoordinate.coordinate[1],this.pickedCoordinate.coordinate[2])<papaya.viewer.ScreenSlice.GRAB_RADIUS*this.scaleFactor?this.grabbedRulerPoint=0:papaya.utilities.MathUtils.lineDistance3d(this.rulerPoints[3],
this.rulerPoints[4],this.rulerPoints[5],this.pickedCoordinate.coordinate[0],this.pickedCoordinate.coordinate[1],this.pickedCoordinate.coordinate[2])<papaya.viewer.ScreenSlice.GRAB_RADIUS*this.scaleFactor&&(this.grabbedRulerPoint=1));return-1!==this.grabbedRulerPoint};papaya.viewer.ScreenSurface.prototype.setStartDynamic=function(c,a){this.dynamicStartX=c;this.dynamicStartY=a};
papaya.viewer.ScreenSurface.prototype.updateDynamic=function(c,a,d){a=(a-this.dynamicStartY)*papaya.viewer.ScreenSurface.MOUSE_SENSITIVITY*d;c=(c-this.dynamicStartX)*papaya.viewer.ScreenSurface.MOUSE_SENSITIVITY*d*Math.PI/180;mat4.identity(this.mouseRotDragX);mat4.rotateY(this.mouseRotDragX,c);c=a*Math.PI/180;mat4.identity(this.mouseRotDragY);mat4.rotateX(this.mouseRotDragY,c);mat4.multiply(this.centerMat,this.mouseRotDragY,this.tempMat);mat4.multiply(this.tempMat,this.mouseRotDragX,this.tempMat2);
mat4.multiply(this.tempMat2,this.centerMatInv,this.mouseRotDrag)};papaya.viewer.ScreenSurface.prototype.updateTranslateDynamic=function(c,a,d){c=(c-this.dynamicStartX)*papaya.viewer.ScreenSurface.MOUSE_SENSITIVITY*d;a=(a-this.dynamicStartY)*papaya.viewer.ScreenSurface.MOUSE_SENSITIVITY*d*-1;mat4.identity(this.mouseTransDrag);mat4.translate(this.mouseTransDrag,[c,a,0])};
papaya.viewer.ScreenSurface.prototype.updateCurrent=function(){var c=mat4.multiply(this.mouseRotDrag,this.mouseRotCurrent);mat4.set(c,this.mouseRotCurrent);c=mat4.multiply(this.mouseTransDrag,this.mouseTransCurrent);mat4.set(c,this.mouseTransCurrent);mat4.identity(this.mouseTransDrag);mat4.identity(this.mouseRotDragX);mat4.identity(this.mouseRotDragY);mat4.identity(this.mouseRotDrag)};papaya.viewer.ScreenSurface.prototype.clearTransform=function(c){mat4.identity(c);return c};
papaya.viewer.ScreenSurface.prototype.makeOrientedTextSquare=function(){var c=papaya.viewer.ScreenSurface.ORIENTATION_SIZE*this.scaleFactor;this.orientationVerts[0]=-c;this.orientationVerts[1]=c;this.orientationVerts[2]=0;this.orientationVerts[3]=-c;this.orientationVerts[4]=-c;this.orientationVerts[5]=0;this.orientationVerts[6]=c;this.orientationVerts[7]=c;this.orientationVerts[8]=0;this.orientationVerts[9]=c;this.orientationVerts[10]=-c;this.orientationVerts[11]=0;this.orientationCanvas=document.createElement("canvas");
this.orientationContext=this.orientationCanvas.getContext("2d");this.orientationContext.imageSmoothingEnabled=!0;this.orientationContext.webkitImageSmoothingEnabled=!0;this.orientationContext.mozImageSmoothingEnabled=!0;this.orientationContext.msImageSmoothingEnabled=!0;this.orientationContext.fillStyle="#FFFFFF";this.orientationContext.textAlign="center";this.orientationContext.textBaseline="middle"};
papaya.viewer.ScreenSurface.prototype.updateOrientedTextSquare=function(c,a){var d;this.orientationContext.imageSmoothingEnabled=!0;this.orientationContext.webkitImageSmoothingEnabled=!0;this.orientationContext.mozImageSmoothingEnabled=!0;this.orientationContext.msImageSmoothingEnabled=!0;this.orientationContext.fillStyle="#FFFFFF";this.orientationContext.textAlign="center";this.orientationContext.textBaseline="middle";this.orientationContext.font=c+"px sans-serif";d=this.orientationContext.measureText(a).width;
d=Math.max(d,c);this.orientationCanvas.width=papaya.utilities.MathUtils.getPowerOfTwo(d);this.orientationCanvas.height=papaya.utilities.MathUtils.getPowerOfTwo(d)};
papaya.viewer.ScreenSurface.prototype.updateActivePlanes=function(){var c,a,d;if(this.showSurfacePlanes||this.viewer.isShowingCrosshairs())c=this.currentCoord.x+(this.xDim/2-this.volume.header.origin.x),a=this.yDim-this.currentCoord.y-(this.yDim/2-this.volume.header.origin.y),d=this.zDim-this.currentCoord.z-(this.zDim/2-this.volume.header.origin.z),this.activePlaneVertsAxial[0]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsAxial[1]=this.yHalf+this.centerWorld.y,this.activePlaneVertsAxial[2]=
d*this.zSize-this.zHalf,this.activePlaneVertsAxial[3]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsAxial[4]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsAxial[5]=d*this.zSize-this.zHalf,this.activePlaneVertsAxial[6]=this.xHalf+this.centerWorld.x,this.activePlaneVertsAxial[7]=this.yHalf+this.centerWorld.y,this.activePlaneVertsAxial[8]=d*this.zSize-this.zHalf,this.activePlaneVertsAxial[9]=this.xHalf+this.centerWorld.x,this.activePlaneVertsAxial[10]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsAxial[11]=
d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[0]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[1]=this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[2]=d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[3]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[4]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[5]=d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[6]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[7]=
-this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[8]=d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[9]=this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[10]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[11]=d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[12]=this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[13]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[14]=d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[15]=
this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[16]=this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[17]=d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[18]=this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[19]=this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[20]=d*this.zSize-this.zHalf,this.activePlaneVertsAxialEdges[21]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsAxialEdges[22]=this.yHalf+this.centerWorld.y,this.activePlaneVertsAxialEdges[23]=
d*this.zSize-this.zHalf,this.activePlaneVertsCoronal[0]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronal[1]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronal[2]=this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronal[3]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronal[4]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronal[5]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronal[6]=this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronal[7]=a*this.ySize-this.yHalf,
this.activePlaneVertsCoronal[8]=this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronal[9]=this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronal[10]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronal[11]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronalEdges[0]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronalEdges[1]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[2]=this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronalEdges[3]=-this.xHalf+this.centerWorld.x,
this.activePlaneVertsCoronalEdges[4]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[5]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronalEdges[6]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronalEdges[7]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[8]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronalEdges[9]=this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronalEdges[10]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[11]=-this.zHalf+
this.centerWorld.z,this.activePlaneVertsCoronalEdges[12]=this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronalEdges[13]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[14]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronalEdges[15]=this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronalEdges[16]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[17]=this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronalEdges[18]=this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronalEdges[19]=
a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[20]=this.zHalf+this.centerWorld.z,this.activePlaneVertsCoronalEdges[21]=-this.xHalf+this.centerWorld.x,this.activePlaneVertsCoronalEdges[22]=a*this.ySize-this.yHalf,this.activePlaneVertsCoronalEdges[23]=this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittal[0]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittal[1]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittal[2]=this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittal[3]=
c*this.xSize-this.xHalf,this.activePlaneVertsSagittal[4]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittal[5]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittal[6]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittal[7]=this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittal[8]=this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittal[9]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittal[10]=this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittal[11]=-this.zHalf+
this.centerWorld.z,this.activePlaneVertsSagittalEdges[0]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[1]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[2]=this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittalEdges[3]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[4]=-this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[5]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittalEdges[6]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[7]=
-this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[8]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittalEdges[9]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[10]=this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[11]=-this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittalEdges[12]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[13]=this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[14]=-this.zHalf+this.centerWorld.z,
this.activePlaneVertsSagittalEdges[15]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[16]=this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[17]=this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittalEdges[18]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[19]=this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[20]=this.zHalf+this.centerWorld.z,this.activePlaneVertsSagittalEdges[21]=c*this.xSize-this.xHalf,this.activePlaneVertsSagittalEdges[22]=
-this.yHalf+this.centerWorld.y,this.activePlaneVertsSagittalEdges[23]=this.zHalf+this.centerWorld.z,this.crosshairLineVertsZ[0]=c*this.xSize-this.xHalf,this.crosshairLineVertsZ[1]=a*this.ySize-this.yHalf,this.crosshairLineVertsZ[2]=-this.zHalf+this.centerWorld.z,this.crosshairLineVertsZ[3]=c*this.xSize-this.xHalf,this.crosshairLineVertsZ[4]=a*this.ySize-this.yHalf,this.crosshairLineVertsZ[5]=this.zHalf+this.centerWorld.z,this.crosshairLineVertsY[0]=c*this.xSize-this.xHalf,this.crosshairLineVertsY[1]=
-this.yHalf+this.centerWorld.y,this.crosshairLineVertsY[2]=d*this.zSize-this.zHalf,this.crosshairLineVertsY[3]=c*this.xSize-this.xHalf,this.crosshairLineVertsY[4]=this.yHalf+this.centerWorld.y,this.crosshairLineVertsY[5]=d*this.zSize-this.zHalf,this.crosshairLineVertsX[0]=-this.xHalf+this.centerWorld.x,this.crosshairLineVertsX[1]=a*this.ySize-this.yHalf,this.crosshairLineVertsX[2]=d*this.zSize-this.zHalf,this.crosshairLineVertsX[3]=this.xHalf+this.centerWorld.x,this.crosshairLineVertsX[4]=a*this.ySize-
this.yHalf,this.crosshairLineVertsX[5]=d*this.zSize-this.zHalf,this.needsUpdateActivePlanes=!0};papaya.viewer.ScreenSurface.prototype.pick=function(c,a,d){this.needsPick=!0;this.pickLocX=c;this.pickLocY=a;this.draw();if(d)return this.pickedCoordinate;this.draw();return this.pickedCoordinate};
papaya.viewer.ScreenSurface.prototype.pickRuler=function(c,a){this.needsPick=!0;this.pickLocX=c;this.pickLocY=a;this.draw();this.pickedCoordinate&&(this.rulerPoints[3*this.grabbedRulerPoint]=this.pickedCoordinate.coordinate[0],this.rulerPoints[3*this.grabbedRulerPoint+1]=this.pickedCoordinate.coordinate[1],this.rulerPoints[3*this.grabbedRulerPoint+2]=this.pickedCoordinate.coordinate[2],this.draw());return this.pickedCoordinate};
papaya.viewer.ScreenSurface.prototype.pickColor=function(c,a){this.needsPickColor=!0;this.pickLocX=c;this.pickLocY=a;this.draw();this.draw();return this.pickedColor};
papaya.viewer.ScreenSurface.prototype.findPickedCoordinate=function(c,a,d){d=c.viewportHeight-1-d;var f,b=[];c.readPixels(a,d,1,1,c.RGBA,c.UNSIGNED_BYTE,this.pickingBuffer);f=this.unpackFloatFromVec4i(this.pickingBuffer)/255;return 1<=f?null:GLU.unProject(a,d,f,this.mvMatrix,this.pMatrix,[0,0,c.viewportWidth,c.viewportHeight],b)?{coordinate:b,depth:f}:null};
papaya.viewer.ScreenSurface.prototype.findInitialRulerPoints=function(c){var a=c.viewportWidth,d=c.viewportHeight,f;c=[];var b=[],e,h;for(h=1;5>h;h+=1)f=parseInt(.1*a*h,10),e=parseInt(.1*d*h,10),(f=this.pick(f,e,!0))&&c.push(f),f=parseInt(a-.1*a*h,10),e=parseInt(.1*d*h,10),(f=this.pick(f,e,!0))&&c.push(f),f=parseInt(a-.1*a*h,10),e=parseInt(d-.1*d*h,10),(f=this.pick(f,e,!0))&&c.push(f),f=parseInt(.1*a*h,10),e=parseInt(d-.1*d*h,10),(f=this.pick(f,e,!0))&&c.push(f);if(2>c)return!1;for(h=a=0;h<c.length;h+=
1)c[h].depth<c[a].depth&&(a=h);b.push(c[a].coordinate);c.splice(a,1);for(h=a=0;h<c.length;h+=1)c[h].depth<c[a].depth&&(a=h);b.push(c[a].coordinate);this.rulerPoints[0]=b[0][0];this.rulerPoints[1]=b[0][1];this.rulerPoints[2]=b[0][2];this.rulerPoints[3]=b[1][0];this.rulerPoints[4]=b[1][1];this.rulerPoints[5]=b[1][2];return!0};
papaya.viewer.ScreenSurface.prototype.findPickedColor=function(c){c.readPixels(0,0,c.viewportWidth,c.viewportHeight,c.RGBA,c.UNSIGNED_BYTE,this.pickingBuffer);c=(c.viewportHeight-1-this.pickLocY)*c.viewportWidth*4+4*this.pickLocX;return[this.pickingBuffer[c],this.pickingBuffer[c+1],this.pickingBuffer[c+2]]};
papaya.viewer.ScreenSurface.prototype.getBackgroundColor=function(){return"rgba("+parseInt(255*this.backgroundColor[0]+.5)+","+parseInt(255*this.backgroundColor[1]+.5)+","+parseInt(255*this.backgroundColor[2]+.5)+",255)"};papaya.viewer.ScreenSurface.prototype.updatePreferences=function(){this.updateBackgroundColor()};
papaya.viewer.ScreenSurface.prototype.updateBackgroundColor=function(){var c=this.viewer.container.preferences.surfaceBackgroundColor;this.backgroundColor="Black"===c?[0,0,0]:"Dark Gray"===c?[.25,.25,.25]:"Gray"===c?[.5,.5,.5]:"Light Gray"===c?[.75,.75,.75]:"White"===c?[1,1,1]:papaya.viewer.ScreenSurface.DEFAULT_BACKGROUND};papaya.viewer.ScreenSurface.prototype.isMainView=function(){return this.viewer.mainImage===this.viewer.surfaceView};
papaya.viewer.ScreenSurface.prototype.processParams=function(c){this.viewer.container.isDesktopMode()||void 0===c.surfaceBackground||(this.viewer.container.preferences.surfaceBackgroundColor=c.surfaceBackground)};
papaya.viewer.ScreenSurface.prototype.makeSphere=function(c,a,d){var f,b,e=[],h=[];for(f=0;f<=c;f++){b=f*Math.PI/c;var g=Math.sin(b),k=Math.cos(b);for(b=0;b<=a;b++){var l=2*b*Math.PI/a,q=Math.sin(l),l=Math.cos(l)*g,t=k,q=q*g;h.push(l);h.push(t);h.push(q);e.push(d*l);e.push(d*t);e.push(d*q)}}d=[];for(f=0;f<c;f++)for(b=0;b<a;b++)g=f*(a+1)+b,k=g+a+1,d.push(g),d.push(k),d.push(g+1),d.push(k),d.push(k+1),d.push(g+1);return{vertices:e,normals:h,indices:d}};
papaya.viewer.ScreenSurface.prototype.getRulerLength=function(){return papaya.utilities.MathUtils.lineDistance3d(this.rulerPoints[0],this.rulerPoints[1],this.rulerPoints[2],this.rulerPoints[3],this.rulerPoints[4],this.rulerPoints[5])};"use strict";var papaya=papaya||{},papayaContainers=[],papayaLoadableImages=papayaLoadableImages||[],papayaDroppedFiles=[];
papaya.Container=papaya.Container||function(c){this.containerHtml=c;this.preferences=this.toolbar=this.display=this.viewer=this.sliderControlHtml=this.titlebarHtml=this.displayHtml=this.viewerHtml=this.toolbarHtml=this.containerIndex=null;this.params=[];this.loadingSurfaceIndex=this.loadingImageIndex=0;this.collapsable=this.nestedViewer=!1;this.orthogonal=!0;this.kioskMode=this.orthogonalDynamic=this.orthogonalTall=!1;this.showControls=!0;this.showControlBar=!1;this.fullScreenPadding=this.showImageButtons=
!0;this.combineParametric=!1;this.dropTimeout=null;this.showRuler=!1;this.syncOverlaySeries=!0;this.surfaceParams={};this.contextManager=null;this.allowScroll=!0;this.loadingComplete=null;this.resetComponents()};papaya.Container.LICENSE_TEXT="<p>THIS PRODUCT IS NOT FOR CLINICAL USE.<br /><br />This software is available for use, as is, free of charge.  The software and data derived from this software may not be used for clinical purposes.<br /><br />The authors of this software make no representations or warranties about the suitability of the software, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, non-infringement, or conformance to a specification or standard. The authors of this software shall not be liable for any damages suffered by licensee as a result of using or modifying this software or its derivatives.<br /><br />By using this software, you agree to be bounded by the terms of this license.  If you do not agree to the terms of this license, do not use this software.</p>";
papaya.Container.KEYBOARD_REF_TEXT="<span style='color:#B5CBD3'>[Spacebar]</span> Cycle the main slice view in a clockwise rotation.<br /><br /><span style='color:#B5CBD3'>[Page Up]</span> or <span style='color:#B5CBD3'>[']</span> Increment the axial slice.<br /><br /><span style='color:#B5CBD3'>[Page Down]</span> or <span style='color:#B5CBD3'>[/]</span> Decrement the axial slice.<br /><br /><span style='color:#B5CBD3'>[Arrow Up]</span> and <span style='color:#B5CBD3'>[Arrow Down]</span> Increment/decrement the coronal slice.<br /><br /><span style='color:#B5CBD3'>[Arrow Right]</span> and <span style='color:#B5CBD3'>[Arrow Left]</span> Increment/decrement the sagittal slice.<br /><br /><span style='color:#B5CBD3'>[g]</span> and <span style='color:#B5CBD3'>[v]</span> Increment/decrement main slice.<br /><br /><span style='color:#B5CBD3'>[<]</span> or <span style='color:#B5CBD3'>[,]</span> Decrement the series point.<br /><br /><span style='color:#B5CBD3'>[>]</span> or <span style='color:#B5CBD3'>[.]</span> Increment the series point.<br /><br /><span style='color:#B5CBD3'>[o]</span> Navigate viewer to the image origin.<br /><br /><span style='color:#B5CBD3'>[c]</span> Navigate viewer to the center of the image.<br /><br /><span style='color:#B5CBD3'>[a]</span> Toggle main crosshairs on/off.";
papaya.Container.MOUSE_REF_TEXT="<span style='color:#B5CBD3'>(Left-click and drag)</span> Change current coordinate.<br /><br /><span style='color:#B5CBD3'>[Alt](Left-click and drag)</span> Zoom in and out.<br /><br /><span style='color:#B5CBD3'>[Alt](Double left-click)</span> Reset zoom.<br /><br /><span style='color:#B5CBD3'>[Alt][Shift](Left-click and drag)</span> Pan zoomed image.<br /><br /><span style='color:#B5CBD3'>(Right-click and drag)</span> Window level controls.<br /><br /><span style='color:#B5CBD3'>(Scroll wheel)</span> See Preferences.<br /><br />";
papaya.Container.DICOM_SUPPORT=!0;papaya.Container.syncViewers=!1;papaya.Container.syncViewersWorld=!1;papaya.Container.allowPropagation=!1;papaya.Container.papayaLastHoveredViewer=null;papaya.Container.restartViewer=function(c,a,d,f){papayaContainers[c].viewer.restart(a,d,f)};
papaya.Container.resetViewer=function(c,a){a||(a=papayaContainers[c].params,a.loadedImages&&(a.images=a.loadedImages),a.loadedEncodedImages&&(a.encodedImages=a.loadedEncodedImages),a.loadedSurfaces&&(a.surfaces=a.loadedSurfaces),a.loadedEncodedSurfaces&&(a.encodedSurfaces=a.loadedEncodedSurfaces),a.loadedFiles&&(a.files=a.loadedFiles));papayaContainers[c].viewer.resetViewer();papayaContainers[c].toolbar.updateImageButtons();papayaContainers[c].reset();papayaContainers[c].params=a;papayaContainers[c].readGlobalParams();
papayaContainers[c].rebuildContainer(a,c);papayaContainers[c].viewer.processParams(a)};papaya.Container.removeImage=function(c,a){1>a&&console.log("Cannot remove the base image.  Try papaya.Container.resetViewer() instead.");papayaContainers[c].viewer.removeOverlay(a)};papaya.Container.hideImage=function(c,a){papayaContainers[c].viewer.screenVolumes[a].hidden=!0;papayaContainers[c].viewer.drawViewer(!0,!1)};
papaya.Container.showImage=function(c,a){papayaContainers[c].viewer.screenVolumes[a].hidden=!1;papayaContainers[c].viewer.drawViewer(!0,!1)};papaya.Container.addImage=function(c,a,d){d&&(papayaContainers[c].params=$.extend({},papayaContainers[c].params,d));a instanceof Array?d=a:(d=[],d[0]=a);papayaContainers[c].params.images?papayaContainers[c].viewer.loadImage(d,!0,!1):papayaContainers[c].params.encodedImages&&papayaContainers[c].viewer.loadImage(d,!1,!0)};
papaya.Container.findParameters=function(c){var a,d=null;a=c.data("params");a||(c=c.find("."+PAPAYA_VIEWER_CSS))&&(a=c.data("params"));a&&("object"===typeof a?d=a:window[a]&&(d=window[a]));d&&papaya.utilities.UrlUtils.getQueryParams(d);return d};
papaya.Container.fillContainerHTML=function(c,a,d,f){var b;a?(d=c.find("#"+PAPAYA_DEFAULT_TOOLBAR_ID),b=c.find("#"+PAPAYA_DEFAULT_VIEWER_ID),a=c.find("#"+PAPAYA_DEFAULT_DISPLAY_ID),d?d.addClass(PAPAYA_TOOLBAR_CSS):c.prepend("<div class='"+PAPAYA_TOOLBAR_CSS+"' id='"+PAPAYA_DEFAULT_TOOLBAR_ID+"'></div>"),b?b.addClass(PAPAYA_VIEWER_CSS):$("<div class='"+PAPAYA_VIEWER_CSS+"' id='"+PAPAYA_DEFAULT_VIEWER_ID+"'></div>").insertAfter($("#"+PAPAYA_DEFAULT_TOOLBAR_ID)),a?a.addClass(PAPAYA_DISPLAY_CSS):$("<div class='"+
PAPAYA_DISPLAY_CSS+"' id='"+PAPAYA_DEFAULT_DISPLAY_ID+"'></div>").insertAfter($("#"+PAPAYA_DEFAULT_VIEWER_ID)),console.log("This method of adding a Papaya container is deprecated.  Try simply <div class='papaya' data-params='params'></div> instead...")):(a=void 0!==f?f:papayaContainers.length,c.attr("id",PAPAYA_DEFAULT_CONTAINER_ID+a),d&&void 0!==d.kioskMode&&d.kioskMode||c.append("<div id='"+(PAPAYA_DEFAULT_TOOLBAR_ID+a)+"' class='"+PAPAYA_TOOLBAR_CSS+"'></div>"),c.append("<div id='"+(PAPAYA_DEFAULT_VIEWER_ID+
a)+"' class='"+PAPAYA_VIEWER_CSS+"'></div>"),c.append("<div id='"+(PAPAYA_DEFAULT_DISPLAY_ID+a)+"' class='"+PAPAYA_DISPLAY_CSS+"'></div>"),d&&d.showControlBar&&(void 0===d.showControls||d.showControls)?(c.append("<div id='"+PAPAYA_KIOSK_CONTROLS_CSS+a+"' class='"+PAPAYA_KIOSK_CONTROLS_CSS+"'><div id='"+(PAPAYA_DEFAULT_SLIDER_ID+a)+"main' class='"+PAPAYA_SLIDER_CSS+" "+PAPAYA_CONTROL_MAIN_SLIDER+"'><span class='"+PAPAYA_CONTROL_BAR_LABELS_CSS+"'>Slice: </span> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+
"'>+</button> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>-</button> </div><div id='"+(PAPAYA_DEFAULT_SLIDER_ID+a)+"axial' class='"+PAPAYA_SLIDER_CSS+" "+PAPAYA_CONTROL_DIRECTION_SLIDER+"'><span class='"+PAPAYA_CONTROL_BAR_LABELS_CSS+"'>Axial: </span> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>+</button> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>-</button> </div><div id='"+(PAPAYA_DEFAULT_SLIDER_ID+a)+"coronal' class='"+
PAPAYA_SLIDER_CSS+" "+PAPAYA_CONTROL_DIRECTION_SLIDER+"'><span class='"+PAPAYA_CONTROL_BAR_LABELS_CSS+"'>Coronal: </span> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>+</button> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>-</button> </div><div id='"+(PAPAYA_DEFAULT_SLIDER_ID+a)+"sagittal' class='"+PAPAYA_SLIDER_CSS+" "+PAPAYA_CONTROL_DIRECTION_SLIDER+"'><span class='"+PAPAYA_CONTROL_BAR_LABELS_CSS+"'>Sagittal: </span> <button type='button' class='"+
PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>+</button> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>-</button> </div><div id='"+(PAPAYA_DEFAULT_SLIDER_ID+a)+"series' class='"+PAPAYA_SLIDER_CSS+" "+PAPAYA_CONTROL_DIRECTION_SLIDER+"'><span class='"+PAPAYA_CONTROL_BAR_LABELS_CSS+"'>Series: </span> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>&lt;</button> <button type='button' class='"+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS+"'>&gt;</button> </div>&nbsp;&nbsp;&nbsp;<button type='button' "+
(d.kioskMode&&(void 0===d.showImageButtons||d.showImageButtons)?"":"style='float:right;margin-left:5px;' ")+"class='"+PAPAYA_CONTROL_SWAP_BUTTON_CSS+"'>Swap View</button> <button type='button' "+(d.kioskMode&&(void 0===d.showImageButtons||d.showImageButtons)?"":"style='float:right;margin-left:5px;' ")+"class='"+PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS+"'>Go To Center</button> <button type='button' "+(d.kioskMode&&(void 0===d.showImageButtons||d.showImageButtons)?"":"style='float:right;margin-left:5px;' ")+
"class='"+PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS+"'>Go To Origin</button> </div>"),$("."+PAPAYA_CONTROL_INCREMENT_BUTTON_CSS).prop("disabled",!0),$("."+PAPAYA_CONTROL_SWAP_BUTTON_CSS).prop("disabled",!0),$("."+PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS).prop("disabled",!0),$("."+PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS).prop("disabled",!0)):d&&(void 0===d.showControls||d.showControls)&&(c.append("<button type='button' id='"+(PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+a)+"' class='"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+
"'>+</button> "),c.append("<button type='button' id='"+(PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+a)+"' class='"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+"'>-</button> "),c.append("<button type='button' id='"+(PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+a)+"' class='"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+"'>Swap View</button> "),c.append("<button type='button' id='"+(PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+a)+"' class='"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+"'>Go To Center</button> "),c.append("<button type='button' id='"+
(PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+a)+"' class='"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+"'>Go To Origin</button> "),$("#"+PAPAYA_CONTROL_MAIN_INCREMENT_BUTTON_CSS+a).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_DECREMENT_BUTTON_CSS+a).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_SWAP_BUTTON_CSS+a).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+a).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+a).css({display:"none"})));return b};
papaya.Container.buildContainer=function(c,a,d){var f,b,e;b=null;f=papaya.utilities.PlatformUtils.checkForBrowserCompatibility();b=c.find("."+PAPAYA_VIEWER_CSS);null!==f?(papaya.Container.removeCheckForJSClasses(c,b),c.addClass(PAPAYA_UTILS_UNSUPPORTED_CSS),b.addClass(PAPAYA_UTILS_UNSUPPORTED_MESSAGE_CSS),b.html(f)):(f=void 0!==d?d:papayaContainers.length,d=new papaya.Container(c),d.containerIndex=f,d.preferences=new papaya.viewer.Preferences,papaya.Container.removeCheckForJSClasses(c,b),a&&(d.params=
$.extend(d.params,a)),d.nestedViewer="BODY"!==c.parent()[0].tagName.toUpperCase(),d.readGlobalParams(),d.isDesktopMode()&&d.preferences.readPreferences(),d.buildViewer(d.params),d.buildDisplay(),d.showControlBar&&d.buildSliderControl(),d.buildToolbar(),d.setUpDnD(),(e=b.data("load-url"))?(b=e,b instanceof Array||(b=[],b[0]=e),d.viewer.loadImage(b,!0,!1)):d.params.images?(b=d.params.images[0],b instanceof Array||(b=[],b[0]=d.params.images[0]),d.viewer.loadImage(b,!0,!1)):d.params.encodedImages?(b=
d.params.encodedImages[0],b instanceof Array||(b=[],b[0]=d.params.encodedImages[0]),d.viewer.loadImage(b,!1,!0)):d.params.files?(b=d.params.files[0],b instanceof Array||(b=[],b[0]=d.params.files[0]),d.viewer.loadImage(b,!1,!1)):d.viewer.finishedLoading(),d.resizeViewerComponents(!1),d.nestedViewer||(c.parent().height("100%"),c.parent().width("100%")),papayaContainers[f]=d,papaya.Container.showLicense(d,a))};
papaya.Container.prototype.rebuildContainer=function(c,a){this.containerHtml.empty();papaya.Container.fillContainerHTML(this.containerHtml,!1,c,a);papaya.Container.buildContainer(this.containerHtml,c,a);1!==papayaContainers.length||papayaContainers[0].nestedViewer||($("html").addClass(PAPAYA_CONTAINER_FULLSCREEN),$("body").addClass(PAPAYA_CONTAINER_FULLSCREEN),papaya.Container.setToFullPage())};
papaya.Container.buildAllContainers=function(){var c,a;c=$("#"+PAPAYA_DEFAULT_CONTAINER_ID);0<c.length?(papaya.Container.fillContainerHTML(c,!0),a=papaya.Container.findParameters(c),papaya.Container.buildContainer(c,a)):$("."+PAPAYA_CONTAINER_CLASS_NAME).each(function(){a=papaya.Container.findParameters($(this));null===a&&(a=[]);!0===a.fullScreen&&(a.fullScreenPadding=!1,a.kioskMode=!0,a.showControlBar=!1,$("body").css({"background-color":"black"}));papaya.Container.fillContainerHTML($(this),!1,a);
papaya.Container.buildContainer($(this),a)});1!==papayaContainers.length||papayaContainers[0].nestedViewer||($("html").addClass(PAPAYA_CONTAINER_FULLSCREEN),$("body").addClass(PAPAYA_CONTAINER_FULLSCREEN),papaya.Container.setToFullPage(),papayaContainers[0].resizeViewerComponents(!0))};papaya.Container.startPapaya=function(){setTimeout(function(){window.scrollTo(0,0)},0);papaya.Container.DICOM_SUPPORT="undefined"!==typeof daikon;papaya.Container.buildAllContainers()};
papaya.Container.resizePapaya=function(c,a){var d;papaya.Container.updateOrthogonalState();if(1!==papayaContainers.length||papayaContainers[0].nestedViewer)for(d=0;d<papayaContainers.length;d+=1)papayaContainers[d].resizeViewerComponents(!0);else papaya.utilities.PlatformUtils.smallScreen&&!a||papayaContainers[0].resizeViewerComponents(!0);setTimeout(function(){window.scrollTo(0,0)},0)};
papaya.Container.addViewer=function(c,a,d){var f;f=$("#"+c);c=$('<div class="papaya"></div>');f.html(c);f[0].onclick="";f.off("click");papaya.Container.fillContainerHTML(c,!1,a);papaya.Container.buildContainer(c,a);d&&d()};papaya.Container.removeCheckForJSClasses=function(c,a){a.removeClass(PAPAYA_CONTAINER_CLASS_NAME);a.removeClass(PAPAYA_UTILS_CHECKFORJS_CSS);c.removeClass(PAPAYA_CONTAINER_CLASS_NAME);c.removeClass(PAPAYA_UTILS_CHECKFORJS_CSS)};
papaya.Container.setToFullPage=function(){document.body.style.marginTop=0;document.body.style.marginBottom=0;document.body.style.marginLeft="auto";document.body.style.marginRight="auto";document.body.style.padding=0;document.body.style.overflow="hidden";document.body.style.width="100%";document.body.style.height="100%"};papaya.Container.getLicense=function(){return papaya.Container.LICENSE_TEXT};papaya.Container.getKeyboardReference=function(){return papaya.Container.KEYBOARD_REF_TEXT};
papaya.Container.getMouseReference=function(){return papaya.Container.MOUSE_REF_TEXT};papaya.Container.setLicenseRead=function(){papaya.utilities.UrlUtils.createCookie(papaya.viewer.Preferences.COOKIE_PREFIX+"eula","Yes",papaya.viewer.Preferences.COOKIE_EXPIRY_DAYS)};papaya.Container.isLicenseRead=function(){var c=papaya.utilities.UrlUtils.readCookie(papaya.viewer.Preferences.COOKIE_PREFIX+"eula");return c&&"Yes"===c};
papaya.Container.showLicense=function(c,a){a&&void 0!==a.showEULA&&a.showEULA&&!papaya.Container.isLicenseRead()&&(new papaya.ui.Dialog(c,"License",papaya.ui.Toolbar.LICENSE_DATA,papaya.Container,null,papaya.Container.setLicenseRead,null,!0)).showDialog()};
papaya.Container.updateOrthogonalState=function(){var c;for(c=0;c<papayaContainers.length;c+=1)papayaContainers[c].orthogonal&&(papaya.utilities.PlatformUtils.mobile||papayaContainers[c].orthogonalDynamic)&&($(window).height()>$(window).width()?papayaContainers[c].orthogonalTall=!0:papayaContainers[c].orthogonalTall=!1)};
papaya.Container.reorientPapaya=function(){var c;for(c=0;c<papayaContainers.length;c+=1)papayaContainers[c].toolbar.closeAllMenus();papaya.Container.updateOrthogonalState();papaya.Container.resizePapaya(null,!0)};papaya.Container.prototype.resetComponents=function(){this.containerHtml.css({height:"auto"});this.containerHtml.css({width:"auto"});this.containerHtml.css({margin:"auto"});$("head").append("<style>div#papayaViewer:before{ content:'' }</style>")};
papaya.Container.prototype.hasSurface=function(){return this.viewer&&0<this.viewer.surfaces.length};
papaya.Container.prototype.getViewerDimensions=function(){var c,a,d,f;c=this.containerHtml.parent().width()-(this.fullScreenPadding?2*PAPAYA_PADDING:0);d=this.orthogonal?this.hasSurface()?1.333:1.5:1;this.orthogonalTall||!this.orthogonal?(c=(this.collapsable?window.innerHeight:this.containerHtml.parent().height())-(papaya.viewer.Display.SIZE+(this.kioskMode?0:papaya.ui.Toolbar.SIZE+PAPAYA_SPACING)+PAPAYA_SPACING+(this.fullScreenPadding&&!this.nestedViewer?2*PAPAYA_CONTAINER_PADDING_TOP:0))-(this.showControlBar?
2*papaya.ui.Toolbar.SIZE:0),a=papayaRoundFast(c/d)):(a=c,c=papayaRoundFast(a/d));if(!this.nestedViewer||this.collapsable)this.orthogonalTall?(f=window.innerWidth-(this.fullScreenPadding?2*PAPAYA_PADDING:0),a>f&&(a=f,c=papayaRoundFast(a*d))):(f=window.innerHeight-(papaya.viewer.Display.SIZE+(this.kioskMode?0:papaya.ui.Toolbar.SIZE+PAPAYA_SPACING)+PAPAYA_SPACING+(this.fullScreenPadding?2*PAPAYA_CONTAINER_PADDING_TOP:0))-(this.showControlBar?2*papaya.ui.Toolbar.SIZE:0),c>f&&(c=f,a=papayaRoundFast(c*
d)));return[a,c]};papaya.Container.prototype.getViewerPadding=function(){var c,a;c=this.containerHtml.parent().width()-(this.fullScreenPadding?2*PAPAYA_PADDING:0);a=this.getViewerDimensions();return(c-a[0])/2};
papaya.Container.prototype.readGlobalParams=function(){this.kioskMode=!0===this.params.kioskMode||papaya.utilities.PlatformUtils.smallScreen;this.combineParametric=!0===this.params.combineParametric;this.params.loadingComplete&&(this.loadingComplete=this.params.loadingComplete);void 0!==this.params.showControls&&(this.showControls=this.params.showControls);void 0!==this.params.showImageButtons&&(this.showImageButtons=this.params.showImageButtons);papaya.utilities.PlatformUtils.smallScreen&&(this.showImageButtons=
!1);void 0!==this.params.fullScreenPadding&&(this.fullScreenPadding=this.params.fullScreenPadding);void 0!==this.params.orthogonal&&(this.orthogonal=this.params.orthogonal);this.surfaceParams.showSurfacePlanes=!0===this.params.showSurfacePlanes;this.surfaceParams.showSurfaceCrosshairs=!0===this.params.showSurfaceCrosshairs;this.surfaceParams.surfaceBackground=this.params.surfaceBackground;this.orthogonalTall=this.orthogonal&&!0===this.params.orthogonalTall;this.orthogonalDynamic=this.orthogonal&&
!0===this.params.orthogonalDynamic;void 0!==this.params.allowScroll&&(this.allowScroll=this.params.allowScroll);(papaya.utilities.PlatformUtils.mobile||this.orthogonalDynamic)&&this.orthogonal&&($(window).height()>$(window).width()?this.orthogonalTall=!0:this.orthogonalTall=!1);void 0!==this.params.syncOverlaySeries&&(this.syncOverlaySeries=this.params.syncOverlaySeries);void 0!==this.params.showControlBar&&(this.showControlBar=this.showControls&&this.params.showControlBar);void 0!==this.params.contextManager&&
(this.contextManager=this.params.contextManager);!0===this.params.fullScreen&&(this.fullScreenPadding=this.params.fullScreenPadding=!1,this.kioskMode=this.params.kioskMode=!0,this.showControlBar=this.params.showControlBar=!1,$("body").css("background-color:'black'"))};
papaya.Container.prototype.reset=function(){this.loadingSurfaceIndex=this.loadingImageIndex=0;this.collapsable=this.nestedViewer=!1;this.orthogonal=!0;this.kioskMode=this.orthogonalDynamic=this.orthogonalTall=!1;this.showControls=!0;this.showControlBar=!1;this.fullScreenPadding=!0;this.showRuler=this.combineParametric=!1};
papaya.Container.prototype.resizeViewerComponents=function(c){var a,d,f=0;this.toolbar.closeAllMenus();a=this.getViewerDimensions();d=this.getViewerPadding();this.toolbarHtml.css({width:a[0]+"px"});this.toolbarHtml.css({height:papaya.ui.Toolbar.SIZE+"px"});this.toolbarHtml.css({paddingLeft:d+"px"});this.toolbarHtml.css({paddingBottom:PAPAYA_SPACING+"px"});this.viewerHtml.css({width:a[0]+"px"});this.viewerHtml.css({height:a[1]+"px"});this.viewerHtml.css({paddingLeft:d+"px"});c&&this.viewer.resizeViewer(a);
this.displayHtml.css({height:papaya.viewer.Display.SIZE+"px"});this.displayHtml.css({paddingLeft:d+"px"});this.displayHtml.css({paddingTop:PAPAYA_SPACING+"px"});this.display.canvas.width=a[0];this.showControls&&this.showControlBar?(this.sliderControlHtml.css({width:a[0]+"px"}),this.sliderControlHtml.css({height:papaya.viewer.Display.SIZE+"px"}),f=this.kioskMode?f+0:f+-50,f=this.viewer.hasSeries?f+200:f+0,a[0]<775+f?($("."+PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS).css({display:"none"}),$("."+PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS).css({display:"none"})):
($("."+PAPAYA_CONTROL_GOTO_CENTER_BUTTON_CSS).css({display:"inline"}),$("."+PAPAYA_CONTROL_GOTO_ORIGIN_BUTTON_CSS).css({display:"inline"})),a[0]<600+f?($("."+PAPAYA_CONTROL_DIRECTION_SLIDER).css({display:"none"}),$("."+PAPAYA_CONTROL_MAIN_SLIDER).css({display:"inline"})):($("."+PAPAYA_CONTROL_DIRECTION_SLIDER).css({display:"inline"}),$("."+PAPAYA_CONTROL_MAIN_SLIDER).css({display:"none"})),this.viewer.hasSeries&&a[0]<450+f&&$("."+PAPAYA_CONTROL_MAIN_SLIDER).css({display:"none"}),200>a[0]?$("."+PAPAYA_CONTROL_SWAP_BUTTON_CSS).css({display:"none"}):
$("."+PAPAYA_CONTROL_SWAP_BUTTON_CSS).css({display:"inline"}),this.viewer.hasSeries?$("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(3).css({display:"inline"}):$("."+PAPAYA_CONTROL_DIRECTION_SLIDER).eq(3).css({display:"none"})):this.showControls&&this.viewer.initialized&&(600>a[0]?($("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+this.containerIndex).css({display:"none"}),$("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+this.containerIndex).css({display:"none"})):this.viewer.controlsHidden||($("#"+PAPAYA_CONTROL_MAIN_GOTO_CENTER_BUTTON_CSS+
this.containerIndex).css({display:"inline"}),$("#"+PAPAYA_CONTROL_MAIN_GOTO_ORIGIN_BUTTON_CSS+this.containerIndex).css({display:"inline"})));this.isDesktopMode()&&(600>a[0]?this.titlebarHtml.css({visibility:"hidden"}):this.titlebarHtml.css({visibility:"visible"}));this.nestedViewer&&!this.collapsable||!this.fullScreenPadding?this.containerHtml.css({paddingTop:"0"}):this.containerHtml.css({paddingTop:PAPAYA_CONTAINER_PADDING_TOP+"px"});this.fullScreenPadding&&(this.containerHtml.css({paddingLeft:PAPAYA_PADDING+
"px"}),this.containerHtml.css({paddingRight:PAPAYA_PADDING+"px"}));this.viewer.initialized?this.viewer.drawViewer(!1,!0):(this.viewer.drawEmptyViewer(),this.display.drawEmptyDisplay());this.titlebarHtml.css({width:a[0]+"px",top:this.viewerHtml.position().top-1.25*papaya.ui.Toolbar.SIZE})};papaya.Container.prototype.updateViewerSize=function(){this.toolbar.closeAllMenus();this.viewer.resizeViewer(this.getViewerDimensions());this.viewer.updateOffsetRect()};
papaya.Container.prototype.buildViewer=function(c){var a;this.viewerHtml=this.containerHtml.find("."+PAPAYA_VIEWER_CSS);papaya.Container.removeCheckForJSClasses(this.containerHtml,this.viewerHtml);this.viewerHtml.html("");a=this.getViewerDimensions();this.viewer=new papaya.viewer.Viewer(this,a[0],a[1],c);this.viewerHtml.append($(this.viewer.canvas));this.preferences.viewer=this.viewer};
papaya.Container.prototype.buildDisplay=function(){var c;this.displayHtml=this.containerHtml.find("."+PAPAYA_DISPLAY_CSS);c=this.getViewerDimensions();this.display=new papaya.viewer.Display(this,c[0]);this.displayHtml.append($(this.display.canvas))};papaya.Container.prototype.buildSliderControl=function(){this.sliderControlHtml=this.containerHtml.find("."+PAPAYA_KIOSK_CONTROLS_CSS)};
papaya.Container.prototype.buildToolbar=function(){this.toolbarHtml=this.containerHtml.find("."+PAPAYA_TOOLBAR_CSS);this.toolbar=new papaya.ui.Toolbar(this);this.toolbar.buildToolbar();this.toolbar.updateImageButtons()};papaya.Container.prototype.readFile=function(c,a){c.file(function(a,c){a&&"."!==c.name.charAt(0)&&a(c)}.bind(this,a))};papaya.Container.prototype.readDir=function(c){this.readDirNextEntries(c.createReader())};
papaya.Container.prototype.readDirNextEntries=function(c){var a=this;c.readEntries(function(d){var f=d.length,b,e;if(0<f){for(b=0;b<f;b+=1)e=d[b],e.isFile&&a.readFile(e,papaya.utilities.ObjectUtils.bind(a,a.addDroppedFile));a.readDirNextEntries(c)}})};
papaya.Container.prototype.setUpDnD=function(){var c=this;this.containerHtml[0].ondragover=function(){c.viewer.draggingOver=!0;c.viewer.initialized||c.viewer.drawEmptyViewer();return!1};this.containerHtml[0].ondragleave=function(){c.viewer.draggingOver=!1;c.viewer.initialized||c.viewer.drawEmptyViewer();return!1};this.containerHtml[0].ondragend=function(){c.viewer.draggingOver=!1;c.viewer.initialized||c.viewer.drawEmptyViewer();return!1};this.containerHtml[0].ondrop=function(a){a.preventDefault();
var d=a.dataTransfer;c.display.drawProgress(.1,"Loading");if(d)if(d.items&&0<d.items.length){a=d.items;var d=a.length,f,b;for(f=0;f<d;f+=1)b=a[f],b.getAsEntry?b=b.getAsEntry():b.webkitGetAsEntry&&(b=b.webkitGetAsEntry()),b.isFile?c.readFile(b,papaya.utilities.ObjectUtils.bind(c,c.addDroppedFile)):b.isDirectory&&c.readDir(b)}else d.files&&0<d.files.length&&c.viewer.loadImage(a.dataTransfer.files);return!1}};
papaya.Container.prototype.addDroppedFile=function(c){clearTimeout(this.dropTimeout);papayaDroppedFiles.push(c);this.dropTimeout=setTimeout(papaya.utilities.ObjectUtils.bind(this,this.droppedFilesFinishedLoading),100)};
papaya.Container.prototype.droppedFilesFinishedLoading=function(){papaya.surface.Surface.findSurfaceType(papayaDroppedFiles[0].name)!==papaya.surface.Surface.SURFACE_TYPE_UNKNOWN?this.viewer.loadSurface(papayaDroppedFiles):this.viewer.loadImage(papayaDroppedFiles);papayaDroppedFiles=[]};papaya.Container.prototype.clearParams=function(){this.params=[]};
papaya.Container.prototype.loadNext=function(){this.hasImageToLoad()?this.loadNextImage():this.hasSurfaceToLoad()?this.loadNextSurface():this.hasAtlasToLoad()&&this.viewer.loadAtlas()};papaya.Container.prototype.hasMoreToLoad=function(){return this.hasImageToLoad()||this.hasSurfaceToLoad()||this.hasAtlasToLoad()};
papaya.Container.prototype.hasImageToLoad=function(){return this.params.images?this.loadingImageIndex<this.params.images.length:this.params.encodedImages?this.loadingImageIndex<this.params.encodedImages.length:this.params.files?this.loadingImageIndex<this.params.files.length:!1};papaya.Container.prototype.hasAtlasToLoad=function(){return this.viewer.hasDefinedAtlas()};
papaya.Container.prototype.hasSurfaceToLoad=function(){return papaya.utilities.PlatformUtils.isWebGLSupported()?this.params.surfaces?this.loadingSurfaceIndex<this.params.surfaces.length:this.params.encodedSurfaces?this.loadingSurfaceIndex<this.params.encodedSurfaces.length:!1:(console.log("Warning: This browser version is not able to load surfaces."),!1)};
papaya.Container.prototype.loadNextSurface=function(){var c=!1,a;this.params.surfaces?this.loadingSurfaceIndex<this.params.surfaces.length?(c=!0,a=this.params.surfaces[this.loadingSurfaceIndex],this.loadingSurfaceIndex+=1,this.viewer.loadSurface(a,!0,!1)):(this.params.loadedSurfaces=this.params.surfaces,this.params.surfaces=[]):this.params.encodedSurfaces&&(this.loadingSurfaceIndex<this.params.encodedSurfaces.length?(c=!0,a=this.params.encodedSurfaces[this.loadingSurfaceIndex],a instanceof Array||
(a=[],a[0]=this.params.encodedSurfaces[this.loadingSurfaceIndex]),this.viewer.loadSurface(a,!1,!0),this.loadingSurfaceIndex+=1):(this.params.loadedEncodedSurfaces=this.params.encodedSurfaces,this.params.encodedSurfaces=[]));return c};
papaya.Container.prototype.loadNextImage=function(){var c=!1,a;this.params.images?this.loadingImageIndex<this.params.images.length?(c=!0,a=this.params.images[this.loadingImageIndex],a instanceof Array||(a=[],a[0]=this.params.images[this.loadingImageIndex]),this.viewer.loadImage(a,!0,!1),this.loadingImageIndex+=1):(this.params.loadedImages=this.params.images,this.params.images=[]):this.params.encodedImages?this.loadingImageIndex<this.params.encodedImages.length?(c=!0,a=this.params.encodedImages[this.loadingImageIndex],
a instanceof Array||(a=[],a[0]=this.params.encodedImages[this.loadingImageIndex]),this.viewer.loadImage(a,!1,!0),this.loadingImageIndex+=1):(this.params.loadedEncodedImages=this.params.encodedImages,this.params.encodedImages=[]):this.params.files&&(this.loadingImageIndex<this.params.files.length?(c=!0,a=this.params.files[this.loadingImageIndex],a instanceof Array||(a=[],a[0]=this.params.files[this.loadingImageIndex]),this.viewer.loadImage(a,!1,!1),this.loadingImageIndex+=1):(this.params.loadedFiles=
this.params.files,this.params.files=[]));return c};papaya.Container.prototype.readyForDnD=function(){return!this.kioskMode&&(void 0===this.params.images||this.loadingImageIndex>=this.params.images.length)&&(void 0===this.params.encodedImages||this.loadingImageIndex>=this.params.encodedImages.length)&&(void 0===this.params.encodedSurfaces||this.loadingSurfaceIndex>=this.params.encodedSurfaces.length)};
papaya.Container.prototype.findLoadableImage=function(c,a){var d;for(d=0;d<papayaLoadableImages.length;d+=1)if(a){if(papayaLoadableImages[d].surface&&papayaLoadableImages[d].name==c)return papayaLoadableImages[d]}else if(papayaLoadableImages[d].name==c)return papayaLoadableImages[d];return null};
papaya.Container.prototype.expandViewer=function(){var c=this;this.nestedViewer&&(this.nestedViewer=!1,this.collapsable=!0,this.tempScrollTop=$(window).scrollTop(),$(":hidden").addClass(PAPAYA_CONTAINER_COLLAPSABLE_EXEMPT),$(document.body).children().hide(),this.containerHtml.show(),this.originalStyle={},this.originalStyle.width=document.body.style.width,this.originalStyle.height=document.body.style.height,this.originalStyle.marginTop=document.body.style.marginTop,this.originalStyle.marginRight=document.body.style.marginRight,
this.originalStyle.marginBottom=document.body.style.marginBottom,this.originalStyle.marginLeft=document.body.style.marginLeft,this.originalStyle.paddingTop=document.body.style.paddingTop,this.originalStyle.paddingRight=document.body.style.paddingRight,this.originalStyle.paddingBottom=document.body.style.paddingBottom,this.originalStyle.paddingLeft=document.body.style.paddingLeft,this.originalStyle.overflow=document.body.style.overflow,papaya.Container.setToFullPage(),this.containerHtml.after('<div style="display:none" class="'+
PAPAYA_CONTAINER_COLLAPSABLE+'"></div>'),$(document.body).prepend(this.containerHtml),this.resizeViewerComponents(!0),this.viewer.updateOffsetRect(),this.updateViewerSize(),setTimeout(function(){window.scrollTo(0,0);c.viewer.addScroll()},0))};
papaya.Container.prototype.collapseViewer=function(){var c,a;a=this;if(this.collapsable){this.nestedViewer=!0;this.collapsable=!1;document.body.style.width=this.originalStyle.width;document.body.style.height=this.originalStyle.height;document.body.style.marginTop=this.originalStyle.marginTop;document.body.style.marginRight=this.originalStyle.marginRight;document.body.style.marginBottom=this.originalStyle.marginBottom;document.body.style.marginLeft=this.originalStyle.marginLeft;document.body.style.paddingTop=
this.originalStyle.paddingTop;document.body.style.paddingRight=this.originalStyle.paddingRight;document.body.style.paddingBottom=this.originalStyle.paddingBottom;document.body.style.paddingLeft=this.originalStyle.paddingLeft;document.body.style.overflow=this.originalStyle.overflow;$("."+PAPAYA_CONTAINER_COLLAPSABLE).replaceWith(this.containerHtml);$(document.body).children(":not(."+PAPAYA_CONTAINER_COLLAPSABLE_EXEMPT+")").show();$("."+PAPAYA_CONTAINER_COLLAPSABLE_EXEMPT).removeClass(PAPAYA_CONTAINER_COLLAPSABLE_EXEMPT);
this.resizeViewerComponents(!0);for(c=0;c<papayaContainers.length;c+=1)papayaContainers[c].updateViewerSize(),papayaContainers[c].viewer.drawViewer(!0);setTimeout(function(){$(window).scrollTop(a.tempScrollTop);a.viewer.removeScroll()},0)}};papaya.Container.prototype.isNestedViewer=function(){return this.nestedViewer||this.collapsable};papaya.Container.prototype.isDesktopMode=function(){return!this.kioskMode};papaya.Container.prototype.hasLoadedDTI=function(){return this.viewer.hasLoadedDTI()};
papaya.Container.prototype.disableScrollWheel=function(){return this.isNestedViewer()||papaya.utilities.PlatformUtils.ios};papaya.Container.prototype.canOpenInMango=function(){return this.params.canOpenInMango};papaya.Container.prototype.isExpandable=function(){return this.params.expandable&&this.isNestedViewer()};papaya.Container.prototype.isParametricCombined=function(c){return this.combineParametric&&this.viewer.hasParametricPair(c)};papaya.Container.prototype.isNonParametricCombined=function(c){return!this.isParametricCombined(c)};
papaya.Container.prototype.coordinateChanged=function(c){var a,d,f=c.currentCoord;if(papaya.Container.syncViewersWorld)for(a=0;a<papayaContainers.length;a+=1)papayaContainers[a].viewer!==c&&(d=new papaya.core.Coordinate,papayaContainers[a].viewer.gotoWorldCoordinate(c.getWorldCoordinateAtIndex(f.x,f.y,f.z,d),!0));else if(papaya.Container.syncViewers)for(a=0;a<papayaContainers.length;a+=1)papayaContainers[a].viewer!==c&&papayaContainers[a].viewer.gotoCoordinate(f,!0);c.surfaceView&&c.surfaceView.updateActivePlanes();
this.contextManager&&this.contextManager.clearContext&&this.contextManager.clearContext()};papaya.Container.prototype.canCurrentOverlayLoadNegatives=function(){var c=this.viewer.currentScreenVolume;return!c.negative&&null===c.negativeScreenVol};papaya.Container.prototype.canCurrentOverlayLoadMod=function(){var c=this.viewer.currentScreenVolume;return c.dti&&null===c.dtiVolumeMod};
papaya.Container.prototype.canCurrentOverlayModulate=function(){var c=this.viewer.currentScreenVolume;return c.dti&&null!==c.dtiVolumeMod};window.addEventListener("resize",papaya.Container.resizePapaya,!1);window.addEventListener("orientationchange",papaya.Container.reorientPapaya,!1);window.addEventListener("load",papaya.Container.startPapaya,!1);window.addEventListener("message",function(c){c.data===PAPAYA_MANGO_INSTALLED&&(papaya.mangoinstalled=!0)},!1);
